matcha-components 20.277.0 → 20.278.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.
- package/fesm2022/matcha-components.mjs +1004 -15
- package/fesm2022/matcha-components.mjs.map +1 -1
- package/index.d.ts +319 -8
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { InjectionToken, HostListener, Input, Directive, EventEmitter, forwardRe
|
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
5
5
|
import * as i2 from '@angular/forms';
|
|
6
|
-
import { NG_VALUE_ACCESSOR, NgControl, FormControlName, NG_VALIDATORS, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
6
|
+
import { NG_VALUE_ACCESSOR, NgControl, FormControlName, NG_VALIDATORS, ReactiveFormsModule, FormsModule, FormGroup, FormControl } from '@angular/forms';
|
|
7
7
|
import { Subject, Subscription, fromEvent, BehaviorSubject, of } from 'rxjs';
|
|
8
8
|
import { filter, debounceTime, distinctUntilChanged, takeUntil, startWith, map } from 'rxjs/operators';
|
|
9
9
|
import { animation, style, animate, trigger, transition, useAnimation, state, query, stagger, animateChild, sequence, group } from '@angular/animations';
|
|
@@ -425,12 +425,25 @@ class MatchaPanelComponent {
|
|
|
425
425
|
if (!this.open)
|
|
426
426
|
return;
|
|
427
427
|
const target = event.target;
|
|
428
|
+
// IMPORTANTE: o nó clicado pode ter sido REMOVIDO do DOM pelo próprio
|
|
429
|
+
// handler do clique antes deste listener rodar — o zone.js dispara
|
|
430
|
+
// change detection entre os listeners de um mesmo evento. Ex: trocar
|
|
431
|
+
// de view no matcha-calendar-picker (dias -> anos/meses) recria os
|
|
432
|
+
// botões via *ngIf, destruindo o botão clicado. Nesse caso
|
|
433
|
+
// `contains(target)` retorna false e o painel fechava indevidamente.
|
|
434
|
+
//
|
|
435
|
+
// Usamos `composedPath()`, capturado no início do dispatch, para saber
|
|
436
|
+
// ONDE o clique originou — robusto a remoções de nós durante o evento.
|
|
437
|
+
const path = (typeof event.composedPath === 'function'
|
|
438
|
+
? event.composedPath()
|
|
439
|
+
: []);
|
|
428
440
|
// Verificar se clicou dentro do painel (via ViewChild pois *ngIf recria)
|
|
429
441
|
const panelEl = this.panelRef?.nativeElement;
|
|
430
|
-
const isInsidePanel = panelEl
|
|
431
|
-
const isInsideTrigger = this.triggerElement
|
|
442
|
+
const isInsidePanel = !!panelEl && (path.includes(panelEl) || panelEl.contains(target));
|
|
443
|
+
const isInsideTrigger = !!this.triggerElement
|
|
444
|
+
&& (path.includes(this.triggerElement) || this.triggerElement.contains(target));
|
|
432
445
|
// Verificar se clicou dentro de um elemento ignorado (ex: submenu)
|
|
433
|
-
const isInsideIgnored = this.ignoreClickOutsideElements.some(el => el
|
|
446
|
+
const isInsideIgnored = this.ignoreClickOutsideElements.some(el => !!el && (path.includes(el) || el.contains(target)));
|
|
434
447
|
if (!isInsidePanel && !isInsideTrigger && !isInsideIgnored) {
|
|
435
448
|
this.closePanel();
|
|
436
449
|
}
|
|
@@ -9249,13 +9262,412 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
9249
9262
|
args: [NgControl, { descendants: true }]
|
|
9250
9263
|
}] } });
|
|
9251
9264
|
|
|
9252
|
-
|
|
9265
|
+
/**
|
|
9266
|
+
* Serviço de internacionalização do matcha-calendar-picker.
|
|
9267
|
+
* Inspirado no MatchaPaginatorIntl, porém registrado APENAS via
|
|
9268
|
+
* `providedIn: 'root'` — nunca em `providers:` de módulo. Isso garante uma
|
|
9269
|
+
* única instância em todo o app mesmo com lazy loading (o registro em
|
|
9270
|
+
* `providers` de um módulo lazy criaria uma instância separada no injector
|
|
9271
|
+
* daquele módulo, e as alterações de label não chegariam ao componente).
|
|
9272
|
+
*
|
|
9273
|
+
* Uso no app consumidor:
|
|
9274
|
+
* constructor(private calendarIntl: MatchaCalendarIntl) {}
|
|
9275
|
+
* setEnglish() {
|
|
9276
|
+
* this.calendarIntl.monthNames = ['January', ...];
|
|
9277
|
+
* this.calendarIntl.changes.next();
|
|
9278
|
+
* }
|
|
9279
|
+
*/
|
|
9280
|
+
class MatchaCalendarIntl {
|
|
9253
9281
|
constructor() {
|
|
9282
|
+
/** Emite quando os labels mudam. O picker reconstrói as células ao receber. */
|
|
9283
|
+
this.changes = new Subject();
|
|
9284
|
+
/** Nomes completos dos meses (view de meses). Índice 0 = Janeiro. */
|
|
9285
|
+
this.monthNames = [
|
|
9286
|
+
'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho',
|
|
9287
|
+
'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'
|
|
9288
|
+
];
|
|
9289
|
+
/** Nomes abreviados dos meses (cabeçalho da view de dias). Índice 0 = Jan. */
|
|
9290
|
+
this.monthNamesShort = [
|
|
9291
|
+
'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
|
|
9292
|
+
'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'
|
|
9293
|
+
];
|
|
9294
|
+
/** Abreviações dos dias da semana (cabeçalho do grid). Índice 0 = Domingo. */
|
|
9295
|
+
this.weekdayNamesShort = ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'];
|
|
9296
|
+
}
|
|
9297
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaCalendarIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
9298
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaCalendarIntl, providedIn: 'root' }); }
|
|
9299
|
+
}
|
|
9300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaCalendarIntl, decorators: [{
|
|
9301
|
+
type: Injectable,
|
|
9302
|
+
args: [{ providedIn: 'root' }]
|
|
9303
|
+
}] });
|
|
9304
|
+
|
|
9305
|
+
/**
|
|
9306
|
+
* Calendário/datepicker apresentacional com três views (dias, meses, anos).
|
|
9307
|
+
*
|
|
9308
|
+
* É um componente "burro": recebe `value`/`min`/`max` (todos no formato
|
|
9309
|
+
* 'YYYY-MM-DD') e emite `dateChange` com a data selecionada. Não implementa
|
|
9310
|
+
* ControlValueAccessor — o host (ex: matcha-date) é quem mantém o valor.
|
|
9311
|
+
*
|
|
9312
|
+
* Tradução via {@link MatchaCalendarIntl} (global) ou pelos @Inputs de label
|
|
9313
|
+
* (override por instância). Os arrays de label são CACHEADOS dentro das
|
|
9314
|
+
* células, por isso reconstruímos as células quando `intl.changes` emite.
|
|
9315
|
+
*/
|
|
9316
|
+
class MatchaCalendarPickerComponent {
|
|
9317
|
+
constructor(intl, cdr) {
|
|
9318
|
+
this.intl = intl;
|
|
9319
|
+
this.cdr = cdr;
|
|
9320
|
+
/** Data selecionada no formato 'YYYY-MM-DD' (ou null). */
|
|
9321
|
+
this.value = null;
|
|
9322
|
+
/** Limite inferior 'YYYY-MM-DD' (ou '' para sem limite). */
|
|
9323
|
+
this.min = '';
|
|
9324
|
+
/** Limite superior 'YYYY-MM-DD' (ou '' para sem limite). */
|
|
9325
|
+
this.max = '';
|
|
9326
|
+
/** Emite a data selecionada no formato 'YYYY-MM-DD'. */
|
|
9327
|
+
this.dateChange = new EventEmitter();
|
|
9328
|
+
// Expor o tipo para o template
|
|
9329
|
+
this.view = 'day';
|
|
9330
|
+
// Caches reconstruídos a cada mudança de input/intl
|
|
9331
|
+
this.weekdayHeaders = [];
|
|
9332
|
+
this.dayCells = [];
|
|
9333
|
+
this.monthCells = [];
|
|
9334
|
+
this.yearCells = [];
|
|
9335
|
+
this.selectedDate = null;
|
|
9336
|
+
this.minDate = null;
|
|
9337
|
+
this.maxDate = null;
|
|
9338
|
+
this.userNavigated = false;
|
|
9339
|
+
this.intlSub = this.intl.changes.subscribe(() => {
|
|
9340
|
+
// Labels ficam cacheados nas células: reconstruir, não só markForCheck.
|
|
9341
|
+
this.rebuildAll();
|
|
9342
|
+
this.cdr.markForCheck();
|
|
9343
|
+
});
|
|
9344
|
+
this.initActiveFromToday();
|
|
9345
|
+
}
|
|
9346
|
+
ngOnChanges(changes) {
|
|
9347
|
+
if (changes['min'] || changes['max']) {
|
|
9348
|
+
this.parseBounds();
|
|
9349
|
+
}
|
|
9350
|
+
if (changes['value']) {
|
|
9351
|
+
this.parseSelection();
|
|
9352
|
+
// Só re-sincroniza o período exibido com a seleção se o usuário ainda
|
|
9353
|
+
// não navegou manualmente (evita "voltar" a tela ao re-vincular value).
|
|
9354
|
+
if (!this.userNavigated) {
|
|
9355
|
+
this.syncActiveToSelection();
|
|
9356
|
+
}
|
|
9357
|
+
}
|
|
9358
|
+
this.rebuildAll();
|
|
9359
|
+
}
|
|
9360
|
+
ngOnDestroy() {
|
|
9361
|
+
this.intlSub?.unsubscribe();
|
|
9362
|
+
}
|
|
9363
|
+
// ---------------------------------------------------------------------------
|
|
9364
|
+
// Labels (híbrido: @Input tem prioridade sobre o serviço)
|
|
9365
|
+
// ---------------------------------------------------------------------------
|
|
9366
|
+
get months() {
|
|
9367
|
+
return this.monthNames ?? this.intl.monthNames;
|
|
9368
|
+
}
|
|
9369
|
+
get monthsShort() {
|
|
9370
|
+
return this.monthNamesShort ?? this.intl.monthNamesShort;
|
|
9371
|
+
}
|
|
9372
|
+
get weekdays() {
|
|
9373
|
+
return this.weekdayNamesShort ?? this.intl.weekdayNamesShort;
|
|
9374
|
+
}
|
|
9375
|
+
get activeMonthLabelShort() {
|
|
9376
|
+
return this.monthsShort[this.activeMonth] ?? '';
|
|
9377
|
+
}
|
|
9378
|
+
get decadeLabel() {
|
|
9379
|
+
return `${this.decadeStart}-${this.decadeStart + 9}`;
|
|
9380
|
+
}
|
|
9381
|
+
// ---------------------------------------------------------------------------
|
|
9382
|
+
// Parse / format (timezone-safe: sempre componentes locais)
|
|
9383
|
+
// ---------------------------------------------------------------------------
|
|
9384
|
+
parseYmd(s) {
|
|
9385
|
+
if (!s || !/^\d{4}-\d{2}-\d{2}$/.test(s)) {
|
|
9386
|
+
return null;
|
|
9387
|
+
}
|
|
9388
|
+
const [y, m, d] = s.split('-').map(Number);
|
|
9389
|
+
const dt = new Date(y, m - 1, d);
|
|
9390
|
+
if (dt.getFullYear() !== y || dt.getMonth() + 1 !== m || dt.getDate() !== d) {
|
|
9391
|
+
return null;
|
|
9392
|
+
}
|
|
9393
|
+
return { y, m: m - 1, d };
|
|
9394
|
+
}
|
|
9395
|
+
formatYmd(y, m0, d) {
|
|
9396
|
+
return `${y}-${String(m0 + 1).padStart(2, '0')}-${String(d).padStart(2, '0')}`;
|
|
9397
|
+
}
|
|
9398
|
+
parseSelection() {
|
|
9399
|
+
this.selectedDate = this.parseYmd(this.value);
|
|
9400
|
+
}
|
|
9401
|
+
parseBounds() {
|
|
9402
|
+
const min = this.parseYmd(this.min);
|
|
9403
|
+
const max = this.parseYmd(this.max);
|
|
9404
|
+
this.minDate = min ? new Date(min.y, min.m, min.d) : null;
|
|
9405
|
+
this.maxDate = max ? new Date(max.y, max.m, max.d) : null;
|
|
9406
|
+
}
|
|
9407
|
+
// ---------------------------------------------------------------------------
|
|
9408
|
+
// Inicialização do período exibido
|
|
9409
|
+
// ---------------------------------------------------------------------------
|
|
9410
|
+
initActiveFromToday() {
|
|
9411
|
+
const now = new Date();
|
|
9412
|
+
this.activeYear = now.getFullYear();
|
|
9413
|
+
this.activeMonth = now.getMonth();
|
|
9414
|
+
this.decadeStart = Math.floor(this.activeYear / 10) * 10;
|
|
9415
|
+
}
|
|
9416
|
+
/** Posiciona o período exibido na seleção, ou hoje, clampando para [min,max]. */
|
|
9417
|
+
syncActiveToSelection() {
|
|
9418
|
+
let y;
|
|
9419
|
+
let m0;
|
|
9420
|
+
if (this.selectedDate) {
|
|
9421
|
+
y = this.selectedDate.y;
|
|
9422
|
+
m0 = this.selectedDate.m;
|
|
9423
|
+
}
|
|
9424
|
+
else {
|
|
9425
|
+
const now = new Date();
|
|
9426
|
+
y = now.getFullYear();
|
|
9427
|
+
m0 = now.getMonth();
|
|
9428
|
+
}
|
|
9429
|
+
// Clampar para o mês válido mais próximo quando o alvo cai fora de [min,max].
|
|
9430
|
+
const target = new Date(y, m0, 1);
|
|
9431
|
+
if (this.minDate && target.getTime() < new Date(this.minDate.getFullYear(), this.minDate.getMonth(), 1).getTime()) {
|
|
9432
|
+
y = this.minDate.getFullYear();
|
|
9433
|
+
m0 = this.minDate.getMonth();
|
|
9434
|
+
}
|
|
9435
|
+
else if (this.maxDate && target.getTime() > new Date(this.maxDate.getFullYear(), this.maxDate.getMonth(), 1).getTime()) {
|
|
9436
|
+
y = this.maxDate.getFullYear();
|
|
9437
|
+
m0 = this.maxDate.getMonth();
|
|
9438
|
+
}
|
|
9439
|
+
this.activeYear = y;
|
|
9440
|
+
this.activeMonth = m0;
|
|
9441
|
+
this.decadeStart = Math.floor(this.activeYear / 10) * 10;
|
|
9442
|
+
}
|
|
9443
|
+
/** Reposiciona a view ao reabrir (chamado pelo host). */
|
|
9444
|
+
resetView() {
|
|
9445
|
+
this.view = 'day';
|
|
9446
|
+
this.userNavigated = false;
|
|
9447
|
+
this.syncActiveToSelection();
|
|
9448
|
+
this.rebuildAll();
|
|
9449
|
+
this.cdr.markForCheck();
|
|
9450
|
+
}
|
|
9451
|
+
// ---------------------------------------------------------------------------
|
|
9452
|
+
// Construção das grids / labels
|
|
9453
|
+
// ---------------------------------------------------------------------------
|
|
9454
|
+
rebuildAll() {
|
|
9455
|
+
this.weekdayHeaders = [...this.weekdays];
|
|
9456
|
+
this.buildDayGrid();
|
|
9457
|
+
this.buildMonthGrid();
|
|
9458
|
+
this.buildYearGrid();
|
|
9459
|
+
}
|
|
9460
|
+
buildDayGrid() {
|
|
9461
|
+
const firstOfMonth = new Date(this.activeYear, this.activeMonth, 1);
|
|
9462
|
+
const leading = firstOfMonth.getDay(); // 0..6 (Domingo = 0)
|
|
9463
|
+
const gridStart = new Date(this.activeYear, this.activeMonth, 1 - leading);
|
|
9464
|
+
const cells = [];
|
|
9465
|
+
for (let i = 0; i < 42; i++) {
|
|
9466
|
+
const dt = new Date(gridStart.getFullYear(), gridStart.getMonth(), gridStart.getDate() + i);
|
|
9467
|
+
const y = dt.getFullYear();
|
|
9468
|
+
const m0 = dt.getMonth();
|
|
9469
|
+
const d = dt.getDate();
|
|
9470
|
+
cells.push({
|
|
9471
|
+
date: this.formatYmd(y, m0, d),
|
|
9472
|
+
day: d,
|
|
9473
|
+
inCurrentMonth: m0 === this.activeMonth,
|
|
9474
|
+
selected: this.isSelected(y, m0, d),
|
|
9475
|
+
disabled: this.isDateDisabled(dt),
|
|
9476
|
+
isToday: this.isToday(y, m0, d)
|
|
9477
|
+
});
|
|
9478
|
+
}
|
|
9479
|
+
this.dayCells = cells;
|
|
9480
|
+
}
|
|
9481
|
+
buildMonthGrid() {
|
|
9482
|
+
this.monthCells = this.months.map((label, m0) => ({
|
|
9483
|
+
month: m0,
|
|
9484
|
+
label,
|
|
9485
|
+
selected: !!this.selectedDate && this.selectedDate.y === this.activeYear && this.selectedDate.m === m0,
|
|
9486
|
+
disabled: this.isMonthFullyOutOfRange(this.activeYear, m0)
|
|
9487
|
+
}));
|
|
9488
|
+
}
|
|
9489
|
+
buildYearGrid() {
|
|
9490
|
+
this.decadeStart = Math.floor(this.activeYear / 10) * 10;
|
|
9491
|
+
const cells = [];
|
|
9492
|
+
for (let i = 0; i < 12; i++) {
|
|
9493
|
+
const yr = this.decadeStart + i;
|
|
9494
|
+
cells.push({
|
|
9495
|
+
year: yr,
|
|
9496
|
+
selected: !!this.selectedDate && this.selectedDate.y === yr,
|
|
9497
|
+
disabled: this.isYearFullyOutOfRange(yr)
|
|
9498
|
+
});
|
|
9499
|
+
}
|
|
9500
|
+
this.yearCells = cells;
|
|
9501
|
+
}
|
|
9502
|
+
// ---------------------------------------------------------------------------
|
|
9503
|
+
// Predicados
|
|
9504
|
+
// ---------------------------------------------------------------------------
|
|
9505
|
+
isSelected(y, m0, d) {
|
|
9506
|
+
return !!this.selectedDate
|
|
9507
|
+
&& this.selectedDate.y === y
|
|
9508
|
+
&& this.selectedDate.m === m0
|
|
9509
|
+
&& this.selectedDate.d === d;
|
|
9510
|
+
}
|
|
9511
|
+
isToday(y, m0, d) {
|
|
9512
|
+
const now = new Date();
|
|
9513
|
+
return now.getFullYear() === y && now.getMonth() === m0 && now.getDate() === d;
|
|
9514
|
+
}
|
|
9515
|
+
isDateDisabled(dt) {
|
|
9516
|
+
const t = dt.getTime();
|
|
9517
|
+
if (this.minDate && t < this.minDate.getTime()) {
|
|
9518
|
+
return true;
|
|
9519
|
+
}
|
|
9520
|
+
if (this.maxDate && t > this.maxDate.getTime()) {
|
|
9521
|
+
return true;
|
|
9522
|
+
}
|
|
9523
|
+
return false;
|
|
9524
|
+
}
|
|
9525
|
+
isMonthFullyOutOfRange(y, m0) {
|
|
9526
|
+
const first = new Date(y, m0, 1);
|
|
9527
|
+
const last = new Date(y, m0 + 1, 0); // último dia do mês
|
|
9528
|
+
if (this.maxDate && first.getTime() > this.maxDate.getTime()) {
|
|
9529
|
+
return true;
|
|
9530
|
+
}
|
|
9531
|
+
if (this.minDate && last.getTime() < this.minDate.getTime()) {
|
|
9532
|
+
return true;
|
|
9533
|
+
}
|
|
9534
|
+
return false;
|
|
9535
|
+
}
|
|
9536
|
+
isYearFullyOutOfRange(y) {
|
|
9537
|
+
const jan1 = new Date(y, 0, 1);
|
|
9538
|
+
const dec31 = new Date(y, 11, 31);
|
|
9539
|
+
if (this.maxDate && jan1.getTime() > this.maxDate.getTime()) {
|
|
9540
|
+
return true;
|
|
9541
|
+
}
|
|
9542
|
+
if (this.minDate && dec31.getTime() < this.minDate.getTime()) {
|
|
9543
|
+
return true;
|
|
9544
|
+
}
|
|
9545
|
+
return false;
|
|
9546
|
+
}
|
|
9547
|
+
// ---------------------------------------------------------------------------
|
|
9548
|
+
// Navegação (setas)
|
|
9549
|
+
// ---------------------------------------------------------------------------
|
|
9550
|
+
prev() {
|
|
9551
|
+
this.shift(-1);
|
|
9552
|
+
}
|
|
9553
|
+
next() {
|
|
9554
|
+
this.shift(1);
|
|
9555
|
+
}
|
|
9556
|
+
shift(dir) {
|
|
9557
|
+
this.userNavigated = true;
|
|
9558
|
+
if (this.view === 'day') {
|
|
9559
|
+
const dt = new Date(this.activeYear, this.activeMonth + dir, 1);
|
|
9560
|
+
this.activeYear = dt.getFullYear();
|
|
9561
|
+
this.activeMonth = dt.getMonth();
|
|
9562
|
+
}
|
|
9563
|
+
else if (this.view === 'month') {
|
|
9564
|
+
this.activeYear += dir;
|
|
9565
|
+
}
|
|
9566
|
+
else {
|
|
9567
|
+
this.activeYear += dir * 10;
|
|
9568
|
+
}
|
|
9569
|
+
this.rebuildAll();
|
|
9570
|
+
}
|
|
9571
|
+
// ---------------------------------------------------------------------------
|
|
9572
|
+
// Troca de view (toggles do cabeçalho)
|
|
9573
|
+
// ---------------------------------------------------------------------------
|
|
9574
|
+
openMonthView() {
|
|
9575
|
+
this.userNavigated = true;
|
|
9576
|
+
this.view = 'month';
|
|
9577
|
+
this.rebuildAll();
|
|
9578
|
+
}
|
|
9579
|
+
openYearView() {
|
|
9580
|
+
this.userNavigated = true;
|
|
9581
|
+
this.view = 'year';
|
|
9582
|
+
this.rebuildAll();
|
|
9583
|
+
}
|
|
9584
|
+
// ---------------------------------------------------------------------------
|
|
9585
|
+
// Seleção
|
|
9586
|
+
// ---------------------------------------------------------------------------
|
|
9587
|
+
selectDay(cell) {
|
|
9588
|
+
if (cell.disabled) {
|
|
9589
|
+
return;
|
|
9590
|
+
}
|
|
9591
|
+
this.dateChange.emit(cell.date);
|
|
9592
|
+
}
|
|
9593
|
+
selectMonth(cell) {
|
|
9594
|
+
if (cell.disabled) {
|
|
9595
|
+
return;
|
|
9596
|
+
}
|
|
9597
|
+
this.activeMonth = cell.month;
|
|
9598
|
+
this.view = 'day';
|
|
9599
|
+
this.rebuildAll();
|
|
9600
|
+
}
|
|
9601
|
+
selectYear(cell) {
|
|
9602
|
+
if (cell.disabled) {
|
|
9603
|
+
return;
|
|
9604
|
+
}
|
|
9605
|
+
this.activeYear = cell.year;
|
|
9606
|
+
this.view = 'month';
|
|
9607
|
+
this.rebuildAll();
|
|
9608
|
+
}
|
|
9609
|
+
/** trackBy para os grids (evita recriar nós ao reconstruir). */
|
|
9610
|
+
trackByDate(_, cell) {
|
|
9611
|
+
return cell.date;
|
|
9612
|
+
}
|
|
9613
|
+
trackByMonth(_, cell) {
|
|
9614
|
+
return cell.month;
|
|
9615
|
+
}
|
|
9616
|
+
trackByYear(_, cell) {
|
|
9617
|
+
return cell.year;
|
|
9618
|
+
}
|
|
9619
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaCalendarPickerComponent, deps: [{ token: MatchaCalendarIntl }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9620
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: MatchaCalendarPickerComponent, isStandalone: false, selector: "matcha-calendar-picker", inputs: { value: "value", min: "min", max: "max", monthNames: "monthNames", monthNamesShort: "monthNamesShort", weekdayNamesShort: "weekdayNamesShort" }, outputs: { dateChange: "dateChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"w-100-p p-8 background-surface color-text flex-column gap-md-16 gap-8\">\n <!-- Cabe\u00E7alho -->\n <div class=\"d-flex flex-align-center flex-space-between\">\n <div class=\"min-w-0 d-flex flex-align-center gap-8\">\n <!-- View de dias: toggle de ano + toggle de m\u00EAs -->\n <ng-container *ngIf=\"view === 'day'\">\n <button type=\"button\" matcha-button size=\"tiny\" class=\"px-8--force\" (click)=\"openYearView()\">\n <span class=\"color-label\">\n {{ activeYear }}\n </span>\n <matcha-icon name=\"action_arrow_down\" color=\"label\" size=\"medium\"></matcha-icon>\n </button>\n <button type=\"button\" matcha-button size=\"tiny\" class=\"px-8--force\" (click)=\"openMonthView()\">\n <span class=\"color-label\">\n {{ activeMonthLabelShort }}\n </span>\n <matcha-icon name=\"action_arrow_down\" color=\"label\" size=\"medium\"></matcha-icon>\n </button>\n </ng-container>\n\n <!-- View de meses: toggle de ano -->\n <button type=\"button\" matcha-button size=\"tiny\" class=\"px-8--force\" *ngIf=\"view === 'month'\" (click)=\"openYearView()\">\n <span class=\"color-label\">\n {{ activeYear }}\n </span>\n <matcha-icon name=\"action_arrow_down\" color=\"label\" size=\"medium\"></matcha-icon>\n </button>\n\n <!-- View de anos: r\u00F3tulo da d\u00E9cada -->\n <button type=\"button\" matcha-button size=\"tiny\" class=\"px-8--force\" *ngIf=\"view === 'year'\">\n <span class=\"color-label\">\n {{ decadeLabel }}\n </span>\n </button>\n </div>\n\n <div class=\"d-sm-flex--force flex-sm-align-center d-none\">\n <button type=\"button\" matcha-button link basic icon size=\"tiny\" color=\"accent\" (click)=\"prev()\" aria-label=\"Anterior\">\n <matcha-icon name=\"chevron-left\"></matcha-icon>\n </button>\n <button type=\"button\" matcha-button link basic icon size=\"tiny\" color=\"accent\" (click)=\"next()\" aria-label=\"Pr\u00F3ximo\">\n <matcha-icon name=\"chevron-right\"></matcha-icon>\n </button>\n </div>\n </div>\n\n <matcha-divider></matcha-divider>\n\n <!-- View de dias -->\n <div *ngIf=\"view === 'day'\">\n <div class=\"matcha-calendar-weekdays\">\n <span class=\"matcha-calendar-weekday\" *ngFor=\"let wd of weekdayHeaders\">{{ wd }}</span>\n </div>\n <div class=\"matcha-calendar-days\">\n <button type=\"button\" class=\"matcha-calendar-day\" *ngFor=\"let cell of dayCells; trackBy: trackByDate\" [class.matcha-calendar-day-outside]=\"!cell.inCurrentMonth\" [class.matcha-calendar-day-selected]=\"cell.selected\" [class.matcha-calendar-day-today]=\"cell.isToday && !cell.selected\" [disabled]=\"cell.disabled\" [attr.aria-label]=\"cell.date\" [attr.aria-selected]=\"cell.selected\" (click)=\"selectDay(cell)\">\n {{ cell.day }}\n </button>\n </div>\n </div>\n\n <!-- View de meses -->\n <div class=\"matcha-calendar-month-view\" *ngIf=\"view === 'month'\">\n <button type=\"button\" matcha-button color=\"surface\" *ngFor=\"let cell of monthCells; trackBy: trackByMonth\" [class.matcha-calendar-month-selected]=\"cell.selected\" [disabled]=\"cell.disabled\" [attr.aria-selected]=\"cell.selected\" (click)=\"selectMonth(cell)\">\n <span class=\"color-label fw-400 fs-12\">\n {{ cell.label }}\n </span>\n </button>\n </div>\n\n <!-- View de anos -->\n <div class=\"matcha-calendar-year-view\" *ngIf=\"view === 'year'\">\n <button type=\"button\" matcha-button color=\"surface\" class=\"h-36--force\" *ngFor=\"let cell of yearCells; trackBy: trackByYear\" [class.matcha-calendar-year-selected]=\"cell.selected\" [disabled]=\"cell.disabled\" [attr.aria-selected]=\"cell.selected\" (click)=\"selectYear(cell)\">\n <span class=\"color-label fw-400 fs-12\">\n {{ cell.year }}\n </span>\n </button>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatchaIconComponent, selector: "matcha-icon", inputs: ["name", "size", "color", "class", "loading"] }, { kind: "component", type: MatchaDividerComponent, selector: "matcha-divider", inputs: ["gap", "gap-sm", "gap-md", "gap-lg", "gap-xl", "direction"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
9621
|
+
}
|
|
9622
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaCalendarPickerComponent, decorators: [{
|
|
9623
|
+
type: Component,
|
|
9624
|
+
args: [{ selector: 'matcha-calendar-picker', encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"w-100-p p-8 background-surface color-text flex-column gap-md-16 gap-8\">\n <!-- Cabe\u00E7alho -->\n <div class=\"d-flex flex-align-center flex-space-between\">\n <div class=\"min-w-0 d-flex flex-align-center gap-8\">\n <!-- View de dias: toggle de ano + toggle de m\u00EAs -->\n <ng-container *ngIf=\"view === 'day'\">\n <button type=\"button\" matcha-button size=\"tiny\" class=\"px-8--force\" (click)=\"openYearView()\">\n <span class=\"color-label\">\n {{ activeYear }}\n </span>\n <matcha-icon name=\"action_arrow_down\" color=\"label\" size=\"medium\"></matcha-icon>\n </button>\n <button type=\"button\" matcha-button size=\"tiny\" class=\"px-8--force\" (click)=\"openMonthView()\">\n <span class=\"color-label\">\n {{ activeMonthLabelShort }}\n </span>\n <matcha-icon name=\"action_arrow_down\" color=\"label\" size=\"medium\"></matcha-icon>\n </button>\n </ng-container>\n\n <!-- View de meses: toggle de ano -->\n <button type=\"button\" matcha-button size=\"tiny\" class=\"px-8--force\" *ngIf=\"view === 'month'\" (click)=\"openYearView()\">\n <span class=\"color-label\">\n {{ activeYear }}\n </span>\n <matcha-icon name=\"action_arrow_down\" color=\"label\" size=\"medium\"></matcha-icon>\n </button>\n\n <!-- View de anos: r\u00F3tulo da d\u00E9cada -->\n <button type=\"button\" matcha-button size=\"tiny\" class=\"px-8--force\" *ngIf=\"view === 'year'\">\n <span class=\"color-label\">\n {{ decadeLabel }}\n </span>\n </button>\n </div>\n\n <div class=\"d-sm-flex--force flex-sm-align-center d-none\">\n <button type=\"button\" matcha-button link basic icon size=\"tiny\" color=\"accent\" (click)=\"prev()\" aria-label=\"Anterior\">\n <matcha-icon name=\"chevron-left\"></matcha-icon>\n </button>\n <button type=\"button\" matcha-button link basic icon size=\"tiny\" color=\"accent\" (click)=\"next()\" aria-label=\"Pr\u00F3ximo\">\n <matcha-icon name=\"chevron-right\"></matcha-icon>\n </button>\n </div>\n </div>\n\n <matcha-divider></matcha-divider>\n\n <!-- View de dias -->\n <div *ngIf=\"view === 'day'\">\n <div class=\"matcha-calendar-weekdays\">\n <span class=\"matcha-calendar-weekday\" *ngFor=\"let wd of weekdayHeaders\">{{ wd }}</span>\n </div>\n <div class=\"matcha-calendar-days\">\n <button type=\"button\" class=\"matcha-calendar-day\" *ngFor=\"let cell of dayCells; trackBy: trackByDate\" [class.matcha-calendar-day-outside]=\"!cell.inCurrentMonth\" [class.matcha-calendar-day-selected]=\"cell.selected\" [class.matcha-calendar-day-today]=\"cell.isToday && !cell.selected\" [disabled]=\"cell.disabled\" [attr.aria-label]=\"cell.date\" [attr.aria-selected]=\"cell.selected\" (click)=\"selectDay(cell)\">\n {{ cell.day }}\n </button>\n </div>\n </div>\n\n <!-- View de meses -->\n <div class=\"matcha-calendar-month-view\" *ngIf=\"view === 'month'\">\n <button type=\"button\" matcha-button color=\"surface\" *ngFor=\"let cell of monthCells; trackBy: trackByMonth\" [class.matcha-calendar-month-selected]=\"cell.selected\" [disabled]=\"cell.disabled\" [attr.aria-selected]=\"cell.selected\" (click)=\"selectMonth(cell)\">\n <span class=\"color-label fw-400 fs-12\">\n {{ cell.label }}\n </span>\n </button>\n </div>\n\n <!-- View de anos -->\n <div class=\"matcha-calendar-year-view\" *ngIf=\"view === 'year'\">\n <button type=\"button\" matcha-button color=\"surface\" class=\"h-36--force\" *ngFor=\"let cell of yearCells; trackBy: trackByYear\" [class.matcha-calendar-year-selected]=\"cell.selected\" [disabled]=\"cell.disabled\" [attr.aria-selected]=\"cell.selected\" (click)=\"selectYear(cell)\">\n <span class=\"color-label fw-400 fs-12\">\n {{ cell.year }}\n </span>\n </button>\n </div>\n</div>\n" }]
|
|
9625
|
+
}], ctorParameters: () => [{ type: MatchaCalendarIntl }, { type: i0.ChangeDetectorRef }], propDecorators: { value: [{
|
|
9626
|
+
type: Input
|
|
9627
|
+
}], min: [{
|
|
9628
|
+
type: Input
|
|
9629
|
+
}], max: [{
|
|
9630
|
+
type: Input
|
|
9631
|
+
}], monthNames: [{
|
|
9632
|
+
type: Input
|
|
9633
|
+
}], monthNamesShort: [{
|
|
9634
|
+
type: Input
|
|
9635
|
+
}], weekdayNamesShort: [{
|
|
9636
|
+
type: Input
|
|
9637
|
+
}], dateChange: [{
|
|
9638
|
+
type: Output
|
|
9639
|
+
}] } });
|
|
9640
|
+
|
|
9641
|
+
class MatchaDateComponent {
|
|
9642
|
+
constructor(elRef, cdr) {
|
|
9643
|
+
this.elRef = elRef;
|
|
9644
|
+
this.cdr = cdr;
|
|
9254
9645
|
this.placeholder = '__/__/____';
|
|
9255
9646
|
this.min = '';
|
|
9256
9647
|
this.max = '';
|
|
9257
9648
|
this.disabled = false;
|
|
9258
9649
|
this.showNativePicker = true; // Mostrar botão para abrir datepicker nativo
|
|
9650
|
+
/**
|
|
9651
|
+
* Define o que o botão de calendário faz ao ser clicado.
|
|
9652
|
+
* - true (padrão): abre o datepicker nativo do navegador (comportamento histórico).
|
|
9653
|
+
* - false: NÃO abre o nativo. A abertura passa a ser responsabilidade do
|
|
9654
|
+
* matcha-calendar-picker (Parte 2), que conterá essa lógica.
|
|
9655
|
+
*/
|
|
9656
|
+
this.useNativePicker = true;
|
|
9657
|
+
/**
|
|
9658
|
+
* Quando true, o painel do matcha-calendar-picker NÃO dispara o evento global
|
|
9659
|
+
* que fecha os demais painéis. Use quando este matcha-date estiver ANINHADO
|
|
9660
|
+
* dentro de outro matcha-panel (ex: o modo "Personalizado" do matcha-period),
|
|
9661
|
+
* para que abrir o calendário não feche o painel pai.
|
|
9662
|
+
*/
|
|
9663
|
+
this.suppressPanelGlobalClose = false;
|
|
9664
|
+
/**
|
|
9665
|
+
* Emite o elemento do painel do calendário quando ele abre/fecha. O painel
|
|
9666
|
+
* pai (quando aninhado) usa esses elementos em `ignoreClickOutsideElements`
|
|
9667
|
+
* para não fechar ao clicar dentro do calendário.
|
|
9668
|
+
*/
|
|
9669
|
+
this.calendarPanelOpened = new EventEmitter();
|
|
9670
|
+
this.calendarPanelClosed = new EventEmitter();
|
|
9259
9671
|
this.value = '';
|
|
9260
9672
|
this.displayValue = '';
|
|
9261
9673
|
this.isDisabled = false;
|
|
@@ -9263,6 +9675,18 @@ class MatchaDateComponent {
|
|
|
9263
9675
|
this.onChange = (value) => { };
|
|
9264
9676
|
this.onTouched = () => { };
|
|
9265
9677
|
}
|
|
9678
|
+
ngAfterViewInit() {
|
|
9679
|
+
// Quando o picker nativo está desligado, ancoramos o painel do calendário
|
|
9680
|
+
// ao matcha-form-field (ou ao próprio host) — mesmo padrão do matcha-period.
|
|
9681
|
+
if (!this.useNativePicker && this.calendarPanel) {
|
|
9682
|
+
this.calendarPanel.attachTo(this.panelAnchor());
|
|
9683
|
+
}
|
|
9684
|
+
}
|
|
9685
|
+
/** Elemento âncora do painel: o matcha-form-field envolvente, ou o host. */
|
|
9686
|
+
panelAnchor() {
|
|
9687
|
+
const formField = this.elRef.nativeElement.closest('matcha-form-field');
|
|
9688
|
+
return formField || this.elRef.nativeElement;
|
|
9689
|
+
}
|
|
9266
9690
|
writeValue(value) {
|
|
9267
9691
|
if (value) {
|
|
9268
9692
|
// Se for um objeto Date, converter para YYYY-MM-DD (usando componentes locais)
|
|
@@ -9470,7 +9894,30 @@ class MatchaDateComponent {
|
|
|
9470
9894
|
}
|
|
9471
9895
|
}
|
|
9472
9896
|
openNativeDatePicker() {
|
|
9473
|
-
if (this.
|
|
9897
|
+
if (this.disabled || this.isDisabled) {
|
|
9898
|
+
return;
|
|
9899
|
+
}
|
|
9900
|
+
// Picker nativo desligado: abrir o matcha-calendar-picker no painel.
|
|
9901
|
+
if (!this.useNativePicker) {
|
|
9902
|
+
if (this.calendarPanel) {
|
|
9903
|
+
this.calendarPanel.attachTo(this.panelAnchor());
|
|
9904
|
+
if (this.calendarPanel.open) {
|
|
9905
|
+
this.calendarPanel.closePanel();
|
|
9906
|
+
}
|
|
9907
|
+
else {
|
|
9908
|
+
// Reposiciona a view na seleção atual ao (re)abrir.
|
|
9909
|
+
this.calendarPicker?.resetView();
|
|
9910
|
+
this.calendarPanel.openPanel();
|
|
9911
|
+
// Avisa o painel pai (quando aninhado) sobre o overlay do calendário.
|
|
9912
|
+
this.lastCalendarPane = this.calendarPanel.paneRef?.nativeElement;
|
|
9913
|
+
if (this.lastCalendarPane) {
|
|
9914
|
+
this.calendarPanelOpened.emit(this.lastCalendarPane);
|
|
9915
|
+
}
|
|
9916
|
+
}
|
|
9917
|
+
}
|
|
9918
|
+
return;
|
|
9919
|
+
}
|
|
9920
|
+
if (this.nativeDateInput?.nativeElement) {
|
|
9474
9921
|
// Verificar se showPicker está disponível (suporte moderno)
|
|
9475
9922
|
if (typeof this.nativeDateInput.nativeElement.showPicker === 'function') {
|
|
9476
9923
|
this.nativeDateInput.nativeElement.showPicker();
|
|
@@ -9482,6 +9929,29 @@ class MatchaDateComponent {
|
|
|
9482
9929
|
}
|
|
9483
9930
|
}
|
|
9484
9931
|
}
|
|
9932
|
+
/** Dia selecionado no matcha-calendar-picker (recebe 'YYYY-MM-DD'). */
|
|
9933
|
+
onCalendarDateSelected(ymd) {
|
|
9934
|
+
this.value = ymd;
|
|
9935
|
+
this.displayValue = this.formatDateForDisplay(ymd);
|
|
9936
|
+
if (this.nativeDateInput?.nativeElement) {
|
|
9937
|
+
this.nativeDateInput.nativeElement.value = ymd;
|
|
9938
|
+
}
|
|
9939
|
+
if (this.textInput?.nativeElement) {
|
|
9940
|
+
this.textInput.nativeElement.value = this.displayValue;
|
|
9941
|
+
}
|
|
9942
|
+
this.onChange(ymd);
|
|
9943
|
+
this.onTouched();
|
|
9944
|
+
this.calendarPanel?.closePanel();
|
|
9945
|
+
this.cdr.detectChanges();
|
|
9946
|
+
}
|
|
9947
|
+
onCalendarPanelClosed() {
|
|
9948
|
+
this.onTouched();
|
|
9949
|
+
// Libera o overlay registrado no painel pai (quando aninhado).
|
|
9950
|
+
if (this.lastCalendarPane) {
|
|
9951
|
+
this.calendarPanelClosed.emit(this.lastCalendarPane);
|
|
9952
|
+
this.lastCalendarPane = undefined;
|
|
9953
|
+
}
|
|
9954
|
+
}
|
|
9485
9955
|
isValidDateFormat(date, format) {
|
|
9486
9956
|
if (format === 'DD/MM/YYYY') {
|
|
9487
9957
|
return /^\d{2}\/\d{2}\/\d{4}$/.test(date);
|
|
@@ -9512,14 +9982,14 @@ class MatchaDateComponent {
|
|
|
9512
9982
|
const [year, month, day] = yyyyMMdd.split('-');
|
|
9513
9983
|
return `${day}/${month}/${year}`;
|
|
9514
9984
|
}
|
|
9515
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9516
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: MatchaDateComponent, isStandalone: false, selector: "matcha-date", inputs: { placeholder: "placeholder", min: "min", max: "max", disabled: "disabled", showNativePicker: "showNativePicker" }, providers: [
|
|
9985
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaDateComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9986
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: MatchaDateComponent, isStandalone: false, selector: "matcha-date", inputs: { placeholder: "placeholder", min: "min", max: "max", disabled: "disabled", showNativePicker: "showNativePicker", useNativePicker: "useNativePicker", suppressPanelGlobalClose: "suppressPanelGlobalClose" }, outputs: { calendarPanelOpened: "calendarPanelOpened", calendarPanelClosed: "calendarPanelClosed" }, providers: [
|
|
9517
9987
|
{
|
|
9518
9988
|
provide: NG_VALUE_ACCESSOR,
|
|
9519
9989
|
useExisting: forwardRef(() => MatchaDateComponent),
|
|
9520
9990
|
multi: true
|
|
9521
9991
|
}
|
|
9522
|
-
], viewQueries: [{ propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true }, { propertyName: "nativeDateInput", first: true, predicate: ["nativeDateInput"], descendants: true }], ngImport: i0, template: "<div class=\"matcha-date-container\">\n <input\n #textInput\n type=\"text\"\n class=\"matcha-date-input\"\n [value]=\"displayValue\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled || isDisabled\"\n maxlength=\"10\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n />\n\n <!-- Input nativo de data (hidden) para usar o datepicker nativo -->\n <input\n #nativeDateInput\n type=\"date\"\n class=\"matcha-date-native-input\"\n [value]=\"value\"\n [min]=\"min\"\n [max]=\"max\"\n [disabled]=\"disabled || isDisabled\"\n (change)=\"onNativeDateChange($event)\"\n tabindex=\"-1\"\n />\n\n <!-- Bot\u00E3o para abrir
|
|
9992
|
+
], viewQueries: [{ propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true }, { propertyName: "nativeDateInput", first: true, predicate: ["nativeDateInput"], descendants: true }, { propertyName: "calendarPanel", first: true, predicate: MatchaPanelComponent, descendants: true }, { propertyName: "calendarPicker", first: true, predicate: MatchaCalendarPickerComponent, descendants: true }], ngImport: i0, template: "<div class=\"matcha-date-container\">\n <input\n #textInput\n type=\"text\"\n class=\"matcha-date-input\"\n [value]=\"displayValue\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled || isDisabled\"\n maxlength=\"10\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n />\n\n <!-- Input nativo de data (hidden) para usar o datepicker nativo -->\n <input\n #nativeDateInput\n type=\"date\"\n class=\"matcha-date-native-input\"\n [value]=\"value\"\n [min]=\"min\"\n [max]=\"max\"\n [disabled]=\"disabled || isDisabled\"\n (change)=\"onNativeDateChange($event)\"\n tabindex=\"-1\"\n />\n\n <!-- Bot\u00E3o para abrir o seletor (nativo ou matcha-calendar-picker) -->\n <button\n *ngIf=\"(showNativePicker || !useNativePicker) && !disabled && !isDisabled\"\n type=\"button\"\n class=\"matcha-date-picker-button mr--12\"\n (click)=\"openNativeDatePicker()\"\n [disabled]=\"disabled || isDisabled\"\n aria-label=\"Abrir seletor de data\"\n tabindex=\"0\"\n >\n <span class=\"i-matcha-calendar color-grey\"></span>\n </button>\n\n <!-- Calend\u00E1rio customizado (usado quando useNativePicker=false) -->\n <matcha-panel\n *ngIf=\"!useNativePicker\"\n [portalToBody]=\"true\"\n [minWidth]=\"260\"\n [maxHeight]=\"380\"\n placement=\"auto\"\n [suppressGlobalClose]=\"suppressPanelGlobalClose\"\n (closed)=\"onCalendarPanelClosed()\"\n >\n <matcha-calendar-picker\n [value]=\"value || null\"\n [min]=\"min\"\n [max]=\"max\"\n (dateChange)=\"onCalendarDateSelected($event)\"\n ></matcha-calendar-picker>\n </matcha-panel>\n</div>\n\n", styles: [".matcha-date-container{position:relative;display:flex;align-items:center;width:100%}.matcha-date-input{width:100%}.matcha-date-native-input{position:absolute;right:0;bottom:0;opacity:0;pointer-events:none;width:0;height:0;border:none;padding:0;margin:0}.matcha-date-picker-button{position:absolute;right:8px;background:none;border:none;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;color:var(--matcha-color-primary, #333);z-index:1}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatchaPanelComponent, selector: "matcha-panel", inputs: ["placement", "maxHeight", "minWidth", "widthMode", "offset", "triggerElement", "open", "hasOverlay", "ignoreClickOutsideElements", "suppressGlobalClose", "portalToBody"], outputs: ["opened", "closed"] }, { kind: "component", type: MatchaCalendarPickerComponent, selector: "matcha-calendar-picker", inputs: ["value", "min", "max", "monthNames", "monthNamesShort", "weekdayNamesShort"], outputs: ["dateChange"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
9523
9993
|
}
|
|
9524
9994
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaDateComponent, decorators: [{
|
|
9525
9995
|
type: Component,
|
|
@@ -9529,8 +9999,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
9529
9999
|
useExisting: forwardRef(() => MatchaDateComponent),
|
|
9530
10000
|
multi: true
|
|
9531
10001
|
}
|
|
9532
|
-
], template: "<div class=\"matcha-date-container\">\n <input\n #textInput\n type=\"text\"\n class=\"matcha-date-input\"\n [value]=\"displayValue\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled || isDisabled\"\n maxlength=\"10\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n />\n\n <!-- Input nativo de data (hidden) para usar o datepicker nativo -->\n <input\n #nativeDateInput\n type=\"date\"\n class=\"matcha-date-native-input\"\n [value]=\"value\"\n [min]=\"min\"\n [max]=\"max\"\n [disabled]=\"disabled || isDisabled\"\n (change)=\"onNativeDateChange($event)\"\n tabindex=\"-1\"\n />\n\n <!-- Bot\u00E3o para abrir
|
|
9533
|
-
}], propDecorators: { placeholder: [{
|
|
10002
|
+
], template: "<div class=\"matcha-date-container\">\n <input\n #textInput\n type=\"text\"\n class=\"matcha-date-input\"\n [value]=\"displayValue\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled || isDisabled\"\n maxlength=\"10\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n />\n\n <!-- Input nativo de data (hidden) para usar o datepicker nativo -->\n <input\n #nativeDateInput\n type=\"date\"\n class=\"matcha-date-native-input\"\n [value]=\"value\"\n [min]=\"min\"\n [max]=\"max\"\n [disabled]=\"disabled || isDisabled\"\n (change)=\"onNativeDateChange($event)\"\n tabindex=\"-1\"\n />\n\n <!-- Bot\u00E3o para abrir o seletor (nativo ou matcha-calendar-picker) -->\n <button\n *ngIf=\"(showNativePicker || !useNativePicker) && !disabled && !isDisabled\"\n type=\"button\"\n class=\"matcha-date-picker-button mr--12\"\n (click)=\"openNativeDatePicker()\"\n [disabled]=\"disabled || isDisabled\"\n aria-label=\"Abrir seletor de data\"\n tabindex=\"0\"\n >\n <span class=\"i-matcha-calendar color-grey\"></span>\n </button>\n\n <!-- Calend\u00E1rio customizado (usado quando useNativePicker=false) -->\n <matcha-panel\n *ngIf=\"!useNativePicker\"\n [portalToBody]=\"true\"\n [minWidth]=\"260\"\n [maxHeight]=\"380\"\n placement=\"auto\"\n [suppressGlobalClose]=\"suppressPanelGlobalClose\"\n (closed)=\"onCalendarPanelClosed()\"\n >\n <matcha-calendar-picker\n [value]=\"value || null\"\n [min]=\"min\"\n [max]=\"max\"\n (dateChange)=\"onCalendarDateSelected($event)\"\n ></matcha-calendar-picker>\n </matcha-panel>\n</div>\n\n", styles: [".matcha-date-container{position:relative;display:flex;align-items:center;width:100%}.matcha-date-input{width:100%}.matcha-date-native-input{position:absolute;right:0;bottom:0;opacity:0;pointer-events:none;width:0;height:0;border:none;padding:0;margin:0}.matcha-date-picker-button{position:absolute;right:8px;background:none;border:none;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;color:var(--matcha-color-primary, #333);z-index:1}\n"] }]
|
|
10003
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { placeholder: [{
|
|
9534
10004
|
type: Input
|
|
9535
10005
|
}], min: [{
|
|
9536
10006
|
type: Input
|
|
@@ -9540,20 +10010,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
9540
10010
|
type: Input
|
|
9541
10011
|
}], showNativePicker: [{
|
|
9542
10012
|
type: Input
|
|
10013
|
+
}], useNativePicker: [{
|
|
10014
|
+
type: Input
|
|
10015
|
+
}], suppressPanelGlobalClose: [{
|
|
10016
|
+
type: Input
|
|
10017
|
+
}], calendarPanelOpened: [{
|
|
10018
|
+
type: Output
|
|
10019
|
+
}], calendarPanelClosed: [{
|
|
10020
|
+
type: Output
|
|
9543
10021
|
}], textInput: [{
|
|
9544
10022
|
type: ViewChild,
|
|
9545
10023
|
args: ['textInput']
|
|
9546
10024
|
}], nativeDateInput: [{
|
|
9547
10025
|
type: ViewChild,
|
|
9548
10026
|
args: ['nativeDateInput']
|
|
10027
|
+
}], calendarPanel: [{
|
|
10028
|
+
type: ViewChild,
|
|
10029
|
+
args: [MatchaPanelComponent]
|
|
10030
|
+
}], calendarPicker: [{
|
|
10031
|
+
type: ViewChild,
|
|
10032
|
+
args: [MatchaCalendarPickerComponent]
|
|
9549
10033
|
}] } });
|
|
9550
10034
|
|
|
10035
|
+
class MatchaCalendarPickerModule {
|
|
10036
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaCalendarPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
10037
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: MatchaCalendarPickerModule, declarations: [MatchaCalendarPickerComponent], imports: [CommonModule,
|
|
10038
|
+
MatchaCardModule,
|
|
10039
|
+
MatchaIconModule,
|
|
10040
|
+
MatchaDividerModule], exports: [MatchaCalendarPickerComponent] }); }
|
|
10041
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaCalendarPickerModule, imports: [CommonModule,
|
|
10042
|
+
MatchaCardModule,
|
|
10043
|
+
MatchaIconModule,
|
|
10044
|
+
MatchaDividerModule] }); }
|
|
10045
|
+
}
|
|
10046
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaCalendarPickerModule, decorators: [{
|
|
10047
|
+
type: NgModule,
|
|
10048
|
+
args: [{
|
|
10049
|
+
declarations: [
|
|
10050
|
+
MatchaCalendarPickerComponent
|
|
10051
|
+
],
|
|
10052
|
+
imports: [
|
|
10053
|
+
CommonModule,
|
|
10054
|
+
MatchaCardModule,
|
|
10055
|
+
MatchaIconModule,
|
|
10056
|
+
MatchaDividerModule
|
|
10057
|
+
],
|
|
10058
|
+
exports: [
|
|
10059
|
+
MatchaCalendarPickerComponent
|
|
10060
|
+
]
|
|
10061
|
+
// MatchaCalendarIntl é providedIn: 'root' — NÃO declarar em providers aqui
|
|
10062
|
+
// (evita instância duplicada em módulos lazy).
|
|
10063
|
+
}]
|
|
10064
|
+
}] });
|
|
10065
|
+
|
|
9551
10066
|
class MatchaDateModule {
|
|
9552
10067
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
9553
10068
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: MatchaDateModule, declarations: [MatchaDateComponent], imports: [CommonModule,
|
|
9554
|
-
FormsModule
|
|
10069
|
+
FormsModule,
|
|
10070
|
+
MatchaPanelModule,
|
|
10071
|
+
MatchaCalendarPickerModule], exports: [MatchaDateComponent] }); }
|
|
9555
10072
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaDateModule, imports: [CommonModule,
|
|
9556
|
-
FormsModule
|
|
10073
|
+
FormsModule,
|
|
10074
|
+
MatchaPanelModule,
|
|
10075
|
+
MatchaCalendarPickerModule] }); }
|
|
9557
10076
|
}
|
|
9558
10077
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaDateModule, decorators: [{
|
|
9559
10078
|
type: NgModule,
|
|
@@ -9563,7 +10082,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
9563
10082
|
],
|
|
9564
10083
|
imports: [
|
|
9565
10084
|
CommonModule,
|
|
9566
|
-
FormsModule
|
|
10085
|
+
FormsModule,
|
|
10086
|
+
MatchaPanelModule,
|
|
10087
|
+
MatchaCalendarPickerModule
|
|
9567
10088
|
],
|
|
9568
10089
|
exports: [
|
|
9569
10090
|
MatchaDateComponent
|
|
@@ -9597,6 +10118,458 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
9597
10118
|
}]
|
|
9598
10119
|
}] });
|
|
9599
10120
|
|
|
10121
|
+
class MatchaPeriodComponent {
|
|
10122
|
+
constructor(elRef, cdr) {
|
|
10123
|
+
this.elRef = elRef;
|
|
10124
|
+
this.cdr = cdr;
|
|
10125
|
+
/** Lista de presets exibidos. Cada preset é auto-contido (ver matcha-period.types). */
|
|
10126
|
+
this.presets = [];
|
|
10127
|
+
/** Habilita a opção "Personalizado" (com Data início / Data fim). */
|
|
10128
|
+
this.allowCustom = true;
|
|
10129
|
+
/** Texto exibido no gatilho quando não há valor. */
|
|
10130
|
+
this.placeholder = 'Selecione o período';
|
|
10131
|
+
/** Rótulo da opção de período personalizado. */
|
|
10132
|
+
this.customLabel = 'Personalizado';
|
|
10133
|
+
/** Formato do intervalo exibido no gatilho. */
|
|
10134
|
+
this.displayFormat = 'dd/MM/yy';
|
|
10135
|
+
this.disabled = false;
|
|
10136
|
+
// Repasse ao matcha-panel
|
|
10137
|
+
this.placement = 'auto';
|
|
10138
|
+
this.maxHeight = 360;
|
|
10139
|
+
this.minWidth = 240;
|
|
10140
|
+
/** Emite sempre que um intervalo é definido (preset selecionado ou "Aplicar" do custom). */
|
|
10141
|
+
this.periodChange = new EventEmitter();
|
|
10142
|
+
this.opened = new EventEmitter();
|
|
10143
|
+
this.closed = new EventEmitter();
|
|
10144
|
+
this.openedChange = new EventEmitter();
|
|
10145
|
+
this.value = null;
|
|
10146
|
+
this.open = false;
|
|
10147
|
+
this.showingCustom = false;
|
|
10148
|
+
/**
|
|
10149
|
+
* Overlays dos calendários (matcha-date aninhados no modo personalizado).
|
|
10150
|
+
* Repassados ao painel via `ignoreClickOutsideElements` para que clicar
|
|
10151
|
+
* dentro de um calendário não feche o painel do período.
|
|
10152
|
+
*/
|
|
10153
|
+
this.calendarOverlays = [];
|
|
10154
|
+
// Modo personalizado: formulário consumido por matcha-date-range + matcha-date.
|
|
10155
|
+
// Cada matcha-date escreve 'YYYY-MM-DD' (ou null quando incompleto/ inválido).
|
|
10156
|
+
this.customForm = new FormGroup({
|
|
10157
|
+
start: new FormControl(null),
|
|
10158
|
+
end: new FormControl(null)
|
|
10159
|
+
});
|
|
10160
|
+
this.customError = '';
|
|
10161
|
+
// Navegação por teclado (índice na lista lógica: presets + opção custom)
|
|
10162
|
+
this.activeIndex = -1;
|
|
10163
|
+
this.onChange = () => { };
|
|
10164
|
+
this.onTouched = () => { };
|
|
10165
|
+
this.isDisabledByForm = false;
|
|
10166
|
+
// Limpa o erro de validação assim que o usuário edita os campos de data.
|
|
10167
|
+
this.customForm.valueChanges.subscribe(() => {
|
|
10168
|
+
if (this.customError) {
|
|
10169
|
+
this.customError = '';
|
|
10170
|
+
}
|
|
10171
|
+
});
|
|
10172
|
+
}
|
|
10173
|
+
get isCurrentlyDisabled() {
|
|
10174
|
+
return this.disabled || this.isDisabledByForm;
|
|
10175
|
+
}
|
|
10176
|
+
get hostDisabledClass() {
|
|
10177
|
+
return this.isCurrentlyDisabled;
|
|
10178
|
+
}
|
|
10179
|
+
get hostDisabledAttr() {
|
|
10180
|
+
return this.isCurrentlyDisabled ? '' : null;
|
|
10181
|
+
}
|
|
10182
|
+
/** Quantidade total de itens navegáveis (presets + custom, se habilitado). */
|
|
10183
|
+
get navCount() {
|
|
10184
|
+
return this.presets.length + (this.allowCustom ? 1 : 0);
|
|
10185
|
+
}
|
|
10186
|
+
ngAfterViewInit() {
|
|
10187
|
+
const formField = this.elRef.nativeElement.closest('matcha-form-field');
|
|
10188
|
+
const anchor = formField || this.elRef.nativeElement;
|
|
10189
|
+
if (this.panel) {
|
|
10190
|
+
this.panel.attachTo(anchor);
|
|
10191
|
+
}
|
|
10192
|
+
this.triggerElement = this.elRef.nativeElement.querySelector('.matcha-period-trigger') || undefined;
|
|
10193
|
+
this.cdr.detectChanges();
|
|
10194
|
+
}
|
|
10195
|
+
// ---------------------------------------------------------------------------
|
|
10196
|
+
// Exibição
|
|
10197
|
+
// ---------------------------------------------------------------------------
|
|
10198
|
+
/** Rótulo exibido no gatilho: intervalo formatado ou placeholder. */
|
|
10199
|
+
get triggerLabel() {
|
|
10200
|
+
if (!this.value) {
|
|
10201
|
+
return this.placeholder;
|
|
10202
|
+
}
|
|
10203
|
+
return `${this.formatDate(this.value.start)} - ${this.formatDate(this.value.end)}`;
|
|
10204
|
+
}
|
|
10205
|
+
get hasValue() {
|
|
10206
|
+
return this.value !== null;
|
|
10207
|
+
}
|
|
10208
|
+
isPresetSelected(preset) {
|
|
10209
|
+
return !!this.value && this.value.presetKey === preset.key;
|
|
10210
|
+
}
|
|
10211
|
+
get isCustomSelected() {
|
|
10212
|
+
return !!this.value && this.value.presetKey === null;
|
|
10213
|
+
}
|
|
10214
|
+
// Limites recíprocos do modo personalizado (formato 'YYYY-MM-DD' esperado pelo matcha-date):
|
|
10215
|
+
// a data de início não pode passar da data de fim, e a de fim não pode ser anterior à de início.
|
|
10216
|
+
// Desabilita as datas inválidas diretamente no seletor nativo via min/max.
|
|
10217
|
+
get customStartMax() {
|
|
10218
|
+
return this.customForm.value.end ?? '';
|
|
10219
|
+
}
|
|
10220
|
+
get customEndMin() {
|
|
10221
|
+
return this.customForm.value.start ?? '';
|
|
10222
|
+
}
|
|
10223
|
+
formatDate(date) {
|
|
10224
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
10225
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
10226
|
+
const year = date.getFullYear();
|
|
10227
|
+
return this.displayFormat === 'dd/MM/yyyy'
|
|
10228
|
+
? `${day}/${month}/${year}`
|
|
10229
|
+
: `${day}/${month}/${String(year).slice(-2)}`;
|
|
10230
|
+
}
|
|
10231
|
+
// ---------------------------------------------------------------------------
|
|
10232
|
+
// Abertura / fechamento do painel
|
|
10233
|
+
// ---------------------------------------------------------------------------
|
|
10234
|
+
onTriggerClick() {
|
|
10235
|
+
if (this.isCurrentlyDisabled) {
|
|
10236
|
+
return;
|
|
10237
|
+
}
|
|
10238
|
+
this.open ? this.closePanel() : this.openPanel();
|
|
10239
|
+
}
|
|
10240
|
+
openPanel() {
|
|
10241
|
+
if (this.isCurrentlyDisabled) {
|
|
10242
|
+
return;
|
|
10243
|
+
}
|
|
10244
|
+
const formField = this.elRef.nativeElement.closest('matcha-form-field');
|
|
10245
|
+
const anchor = formField || this.elRef.nativeElement;
|
|
10246
|
+
this.open = true;
|
|
10247
|
+
this.calendarOverlays = [];
|
|
10248
|
+
// Reabre já no modo personalizado se o valor atual for custom
|
|
10249
|
+
this.showingCustom = this.isCustomSelected;
|
|
10250
|
+
if (this.showingCustom) {
|
|
10251
|
+
this.syncCustomInputsFromValue();
|
|
10252
|
+
}
|
|
10253
|
+
this.activeIndex = -1;
|
|
10254
|
+
this.cdr.detectChanges();
|
|
10255
|
+
this.panel.attachTo(anchor);
|
|
10256
|
+
this.panel.openPanel();
|
|
10257
|
+
this.opened.emit();
|
|
10258
|
+
this.openedChange.emit(true);
|
|
10259
|
+
}
|
|
10260
|
+
closePanel() {
|
|
10261
|
+
if (!this.open) {
|
|
10262
|
+
return;
|
|
10263
|
+
}
|
|
10264
|
+
this.open = false;
|
|
10265
|
+
this.activeIndex = -1;
|
|
10266
|
+
this.calendarOverlays = [];
|
|
10267
|
+
this.panel.closePanel();
|
|
10268
|
+
this.closed.emit();
|
|
10269
|
+
this.openedChange.emit(false);
|
|
10270
|
+
this.onTouched();
|
|
10271
|
+
this.cdr.detectChanges();
|
|
10272
|
+
}
|
|
10273
|
+
// ---------------------------------------------------------------------------
|
|
10274
|
+
// Seleção
|
|
10275
|
+
// ---------------------------------------------------------------------------
|
|
10276
|
+
selectPreset(preset) {
|
|
10277
|
+
const range = preset.getRange();
|
|
10278
|
+
this.commitValue({ start: range.start, end: range.end, presetKey: preset.key });
|
|
10279
|
+
this.showingCustom = false;
|
|
10280
|
+
this.customError = '';
|
|
10281
|
+
this.closePanel();
|
|
10282
|
+
}
|
|
10283
|
+
/**
|
|
10284
|
+
* Registra o overlay de um calendário aninhado (ao abrir) para ignorá-lo no
|
|
10285
|
+
* click-outside do painel do período.
|
|
10286
|
+
*
|
|
10287
|
+
* NÃO removemos o overlay quando o calendário fecha: selecionar uma data fecha
|
|
10288
|
+
* o calendário no MESMO clique que ainda propaga até o listener de click-outside
|
|
10289
|
+
* do período. Como o `composedPath()` desse clique ainda contém o pane (mesmo já
|
|
10290
|
+
* destruído), mantê-lo na lista evita que o período feche junto. Panes destruídos
|
|
10291
|
+
* são inofensivos (nunca casam com cliques futuros) e a lista é zerada ao abrir/
|
|
10292
|
+
* fechar o período.
|
|
10293
|
+
*/
|
|
10294
|
+
registerCalendarOverlay(el) {
|
|
10295
|
+
if (el && !this.calendarOverlays.includes(el)) {
|
|
10296
|
+
this.calendarOverlays = [...this.calendarOverlays, el];
|
|
10297
|
+
this.cdr.detectChanges();
|
|
10298
|
+
}
|
|
10299
|
+
}
|
|
10300
|
+
/** Abre/realça a área de período personalizado, mantendo o painel aberto. */
|
|
10301
|
+
toggleCustom() {
|
|
10302
|
+
this.showingCustom = true;
|
|
10303
|
+
this.customError = '';
|
|
10304
|
+
this.syncCustomInputsFromValue();
|
|
10305
|
+
this.cdr.detectChanges();
|
|
10306
|
+
}
|
|
10307
|
+
applyCustom() {
|
|
10308
|
+
const start = this.parseDate(this.customForm.value.start ?? null);
|
|
10309
|
+
const end = this.parseDate(this.customForm.value.end ?? null);
|
|
10310
|
+
if (!start || !end) {
|
|
10311
|
+
this.customError = 'Informe datas válidas no formato DD/MM/AAAA.';
|
|
10312
|
+
this.cdr.detectChanges();
|
|
10313
|
+
return;
|
|
10314
|
+
}
|
|
10315
|
+
if (start.getTime() > end.getTime()) {
|
|
10316
|
+
this.customError = 'A data de início não pode ser posterior à data de fim.';
|
|
10317
|
+
this.cdr.detectChanges();
|
|
10318
|
+
return;
|
|
10319
|
+
}
|
|
10320
|
+
this.customError = '';
|
|
10321
|
+
this.commitValue({ start, end, presetKey: null });
|
|
10322
|
+
this.closePanel();
|
|
10323
|
+
}
|
|
10324
|
+
commitValue(value) {
|
|
10325
|
+
this.value = value;
|
|
10326
|
+
this.periodChange.emit(value);
|
|
10327
|
+
this.onChange(value);
|
|
10328
|
+
this.onTouched();
|
|
10329
|
+
this.cdr.detectChanges();
|
|
10330
|
+
}
|
|
10331
|
+
// ---------------------------------------------------------------------------
|
|
10332
|
+
// Campos do modo personalizado (delegados a matcha-date-range + matcha-date)
|
|
10333
|
+
// ---------------------------------------------------------------------------
|
|
10334
|
+
/** Converte uma string 'YYYY-MM-DD' válida em Date; retorna null caso contrário. */
|
|
10335
|
+
parseDate(value) {
|
|
10336
|
+
if (!value || !/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
10337
|
+
return null;
|
|
10338
|
+
}
|
|
10339
|
+
const [year, month, day] = value.split('-').map(Number);
|
|
10340
|
+
const date = new Date(year, month - 1, day);
|
|
10341
|
+
// Garante que a data existe (rejeita 31/02, etc.)
|
|
10342
|
+
if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
|
|
10343
|
+
return null;
|
|
10344
|
+
}
|
|
10345
|
+
return date;
|
|
10346
|
+
}
|
|
10347
|
+
syncCustomInputsFromValue() {
|
|
10348
|
+
if (this.value) {
|
|
10349
|
+
this.customForm.setValue({
|
|
10350
|
+
start: this.toInputValue(this.value.start),
|
|
10351
|
+
end: this.toInputValue(this.value.end)
|
|
10352
|
+
}, { emitEvent: false });
|
|
10353
|
+
}
|
|
10354
|
+
}
|
|
10355
|
+
/** Formata um Date para o formato consumido pelo matcha-date ('YYYY-MM-DD'). */
|
|
10356
|
+
toInputValue(date) {
|
|
10357
|
+
const year = date.getFullYear();
|
|
10358
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
10359
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
10360
|
+
return `${year}-${month}-${day}`;
|
|
10361
|
+
}
|
|
10362
|
+
// ---------------------------------------------------------------------------
|
|
10363
|
+
// Navegação por teclado
|
|
10364
|
+
// ---------------------------------------------------------------------------
|
|
10365
|
+
onTriggerKeyDown(event) {
|
|
10366
|
+
if (this.isCurrentlyDisabled) {
|
|
10367
|
+
return;
|
|
10368
|
+
}
|
|
10369
|
+
switch (event.key) {
|
|
10370
|
+
case 'ArrowDown':
|
|
10371
|
+
event.preventDefault();
|
|
10372
|
+
if (!this.open) {
|
|
10373
|
+
this.openPanel();
|
|
10374
|
+
}
|
|
10375
|
+
else {
|
|
10376
|
+
this.moveActive(1);
|
|
10377
|
+
}
|
|
10378
|
+
break;
|
|
10379
|
+
case 'ArrowUp':
|
|
10380
|
+
event.preventDefault();
|
|
10381
|
+
if (this.open) {
|
|
10382
|
+
this.moveActive(-1);
|
|
10383
|
+
}
|
|
10384
|
+
break;
|
|
10385
|
+
case 'Enter':
|
|
10386
|
+
case ' ':
|
|
10387
|
+
event.preventDefault();
|
|
10388
|
+
if (!this.open) {
|
|
10389
|
+
this.openPanel();
|
|
10390
|
+
}
|
|
10391
|
+
else {
|
|
10392
|
+
this.activateCurrent();
|
|
10393
|
+
}
|
|
10394
|
+
break;
|
|
10395
|
+
case 'Escape':
|
|
10396
|
+
if (this.open) {
|
|
10397
|
+
event.preventDefault();
|
|
10398
|
+
this.closePanel();
|
|
10399
|
+
}
|
|
10400
|
+
break;
|
|
10401
|
+
default:
|
|
10402
|
+
break;
|
|
10403
|
+
}
|
|
10404
|
+
}
|
|
10405
|
+
moveActive(delta) {
|
|
10406
|
+
const count = this.navCount;
|
|
10407
|
+
if (count === 0) {
|
|
10408
|
+
return;
|
|
10409
|
+
}
|
|
10410
|
+
if (this.activeIndex < 0) {
|
|
10411
|
+
this.activeIndex = delta > 0 ? 0 : count - 1;
|
|
10412
|
+
}
|
|
10413
|
+
else {
|
|
10414
|
+
this.activeIndex = (this.activeIndex + delta + count) % count;
|
|
10415
|
+
}
|
|
10416
|
+
this.cdr.detectChanges();
|
|
10417
|
+
}
|
|
10418
|
+
isActiveIndex(index) {
|
|
10419
|
+
return this.activeIndex === index;
|
|
10420
|
+
}
|
|
10421
|
+
get isCustomActive() {
|
|
10422
|
+
return this.allowCustom && this.activeIndex === this.presets.length;
|
|
10423
|
+
}
|
|
10424
|
+
activateCurrent() {
|
|
10425
|
+
if (this.activeIndex < 0) {
|
|
10426
|
+
return;
|
|
10427
|
+
}
|
|
10428
|
+
if (this.activeIndex < this.presets.length) {
|
|
10429
|
+
this.selectPreset(this.presets[this.activeIndex]);
|
|
10430
|
+
}
|
|
10431
|
+
else if (this.allowCustom) {
|
|
10432
|
+
this.toggleCustom();
|
|
10433
|
+
}
|
|
10434
|
+
}
|
|
10435
|
+
// ---------------------------------------------------------------------------
|
|
10436
|
+
// ControlValueAccessor
|
|
10437
|
+
// ---------------------------------------------------------------------------
|
|
10438
|
+
writeValue(value) {
|
|
10439
|
+
this.value = this.normalizeValue(value);
|
|
10440
|
+
this.showingCustom = this.isCustomSelected;
|
|
10441
|
+
if (this.showingCustom) {
|
|
10442
|
+
this.syncCustomInputsFromValue();
|
|
10443
|
+
}
|
|
10444
|
+
this.cdr.detectChanges();
|
|
10445
|
+
}
|
|
10446
|
+
registerOnChange(fn) {
|
|
10447
|
+
this.onChange = fn;
|
|
10448
|
+
}
|
|
10449
|
+
registerOnTouched(fn) {
|
|
10450
|
+
this.onTouched = fn;
|
|
10451
|
+
}
|
|
10452
|
+
setDisabledState(isDisabled) {
|
|
10453
|
+
this.isDisabledByForm = isDisabled;
|
|
10454
|
+
if (isDisabled && this.open) {
|
|
10455
|
+
this.closePanel();
|
|
10456
|
+
}
|
|
10457
|
+
this.cdr.detectChanges();
|
|
10458
|
+
}
|
|
10459
|
+
/** Garante que start/end sejam Date (aceita strings/ISO vindas do FormControl). */
|
|
10460
|
+
normalizeValue(value) {
|
|
10461
|
+
if (!value || value.start == null || value.end == null) {
|
|
10462
|
+
return null;
|
|
10463
|
+
}
|
|
10464
|
+
const start = value.start instanceof Date ? value.start : new Date(value.start);
|
|
10465
|
+
const end = value.end instanceof Date ? value.end : new Date(value.end);
|
|
10466
|
+
if (isNaN(start.getTime()) || isNaN(end.getTime())) {
|
|
10467
|
+
return null;
|
|
10468
|
+
}
|
|
10469
|
+
return { start, end, presetKey: value.presetKey ?? null };
|
|
10470
|
+
}
|
|
10471
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaPeriodComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10472
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: MatchaPeriodComponent, isStandalone: false, selector: "matcha-period", inputs: { presets: "presets", allowCustom: "allowCustom", placeholder: "placeholder", customLabel: "customLabel", displayFormat: "displayFormat", disabled: "disabled", placement: "placement", maxHeight: "maxHeight", minWidth: "minWidth" }, outputs: { periodChange: "periodChange", opened: "opened", closed: "closed", openedChange: "openedChange" }, host: { properties: { "class.matcha-period-disabled": "this.hostDisabledClass", "attr.disabled": "this.hostDisabledAttr" } }, providers: [
|
|
10473
|
+
{
|
|
10474
|
+
provide: NG_VALUE_ACCESSOR,
|
|
10475
|
+
useExisting: forwardRef(() => MatchaPeriodComponent),
|
|
10476
|
+
multi: true
|
|
10477
|
+
}
|
|
10478
|
+
], viewQueries: [{ propertyName: "panel", first: true, predicate: MatchaPanelComponent, descendants: true }], ngImport: i0, template: "<div class=\"position-relative d-inline-block w-100-p\">\n <div class=\"matcha-period-trigger d-flex flex-align-center flex-space-between cursor-pointer\"\n [class.matcha-period-disabled]=\"isCurrentlyDisabled\" (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeyDown($event)\" [attr.tabindex]=\"isCurrentlyDisabled ? -1 : 0\" role=\"combobox\"\n [attr.aria-expanded]=\"open\" [attr.aria-haspopup]=\"true\" [attr.aria-disabled]=\"isCurrentlyDisabled\">\n\n <span class=\"matcha-period-value\" [class.matcha-period-placeholder]=\"!hasValue\">\n {{ triggerLabel }}\n </span>\n\n <span class=\"matcha-period-arrow\" [class.matcha-period-arrow-open]=\"open\">\n <span class=\"i-matcha-action_arrow_down\"></span>\n </span>\n </div>\n\n <matcha-panel #panel [placement]=\"placement\" [maxHeight]=\"maxHeight\" [minWidth]=\"minWidth\" [open]=\"open\"\n [portalToBody]=\"true\" [ignoreClickOutsideElements]=\"calendarOverlays\" (closed)=\"closePanel()\">\n\n <div class=\"py-4\" role=\"listbox\">\n <!-- Lista de presets -->\n <div *ngFor=\"let preset of presets; let i = index\" class=\"matcha-period-option\" role=\"option\"\n [class.matcha-period-option-selected]=\"isPresetSelected(preset)\"\n [class.matcha-period-option-active]=\"isActiveIndex(i)\" [attr.aria-selected]=\"isPresetSelected(preset)\"\n (click)=\"selectPreset(preset)\">\n {{ preset.label }}\n </div>\n\n <!-- Op\u00E7\u00E3o \"Personalizado\" -->\n <ng-container *ngIf=\"allowCustom\">\n <matcha-divider gap=\"8\"></matcha-divider>\n\n <div class=\"matcha-period-option\" role=\"option\"\n [class.matcha-period-option-selected]=\"isCustomSelected || showingCustom\"\n [class.matcha-period-option-active]=\"isCustomActive\" [attr.aria-selected]=\"isCustomSelected\"\n (click)=\"toggleCustom()\">\n {{ customLabel }}\n </div>\n\n <!-- Editor de per\u00EDodo personalizado (reaproveita matcha-date-range + matcha-date) -->\n <div class=\"pt-8 px-16 pb-12\" *ngIf=\"showingCustom\" [formGroup]=\"customForm\">\n <matcha-date-range>\n <matcha-form-field>\n <matcha-label>Data in\u00EDcio</matcha-label>\n <matcha-date formControlName=\"start\" placeholder=\"__/__/____\" [useNativePicker]=\"false\"\n [max]=\"customStartMax\" [suppressPanelGlobalClose]=\"true\"\n (calendarPanelOpened)=\"registerCalendarOverlay($event)\"></matcha-date>\n </matcha-form-field>\n <matcha-form-field>\n <matcha-label>Data fim</matcha-label>\n <matcha-date formControlName=\"end\" placeholder=\"__/__/____\" [useNativePicker]=\"false\"\n [min]=\"customEndMin\" [suppressPanelGlobalClose]=\"true\"\n (calendarPanelOpened)=\"registerCalendarOverlay($event)\"></matcha-date>\n </matcha-form-field>\n </matcha-date-range>\n\n <div class=\"color-red fs-12 mt-8\" *ngIf=\"customError\">{{ customError }}</div>\n\n <button matcha-button color=\"accent\" size=\"small\" type=\"button\" class=\"w-100-p mt-12\"\n (click)=\"applyCustom()\">\n Aplicar\n </button>\n </div>\n </ng-container>\n </div>\n </matcha-panel>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MatchaPanelComponent, selector: "matcha-panel", inputs: ["placement", "maxHeight", "minWidth", "widthMode", "offset", "triggerElement", "open", "hasOverlay", "ignoreClickOutsideElements", "suppressGlobalClose", "portalToBody"], outputs: ["opened", "closed"] }, { kind: "component", type: MatchaButtonComponent, selector: "[matcha-button]", inputs: ["size", "size-xs", "size-sm", "size-md", "size-lg", "size-xl", "gap", "color", "basic", "outline", "alpha", "pill", "link", "icon", "badge"] }, { kind: "component", type: MatchaDividerComponent, selector: "matcha-divider", inputs: ["gap", "gap-sm", "gap-md", "gap-lg", "gap-xl", "direction"] }, { kind: "component", type: MatchaDateComponent, selector: "matcha-date", inputs: ["placeholder", "min", "max", "disabled", "showNativePicker", "useNativePicker", "suppressPanelGlobalClose"], outputs: ["calendarPanelOpened", "calendarPanelClosed"] }, { kind: "component", type: MatchaDateRangeComponent, selector: "matcha-date-range" }, { kind: "component", type: MatchaFormFieldComponent, selector: "matcha-form-field", inputs: ["color", "size", "size-xs", "size-sm", "size-md", "size-lg", "size-xl"] }, { kind: "component", type: MatchaLabelComponent, selector: "matcha-label", inputs: ["color"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
10479
|
+
}
|
|
10480
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaPeriodComponent, decorators: [{
|
|
10481
|
+
type: Component,
|
|
10482
|
+
args: [{ selector: 'matcha-period', encapsulation: ViewEncapsulation.None, standalone: false, providers: [
|
|
10483
|
+
{
|
|
10484
|
+
provide: NG_VALUE_ACCESSOR,
|
|
10485
|
+
useExisting: forwardRef(() => MatchaPeriodComponent),
|
|
10486
|
+
multi: true
|
|
10487
|
+
}
|
|
10488
|
+
], template: "<div class=\"position-relative d-inline-block w-100-p\">\n <div class=\"matcha-period-trigger d-flex flex-align-center flex-space-between cursor-pointer\"\n [class.matcha-period-disabled]=\"isCurrentlyDisabled\" (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeyDown($event)\" [attr.tabindex]=\"isCurrentlyDisabled ? -1 : 0\" role=\"combobox\"\n [attr.aria-expanded]=\"open\" [attr.aria-haspopup]=\"true\" [attr.aria-disabled]=\"isCurrentlyDisabled\">\n\n <span class=\"matcha-period-value\" [class.matcha-period-placeholder]=\"!hasValue\">\n {{ triggerLabel }}\n </span>\n\n <span class=\"matcha-period-arrow\" [class.matcha-period-arrow-open]=\"open\">\n <span class=\"i-matcha-action_arrow_down\"></span>\n </span>\n </div>\n\n <matcha-panel #panel [placement]=\"placement\" [maxHeight]=\"maxHeight\" [minWidth]=\"minWidth\" [open]=\"open\"\n [portalToBody]=\"true\" [ignoreClickOutsideElements]=\"calendarOverlays\" (closed)=\"closePanel()\">\n\n <div class=\"py-4\" role=\"listbox\">\n <!-- Lista de presets -->\n <div *ngFor=\"let preset of presets; let i = index\" class=\"matcha-period-option\" role=\"option\"\n [class.matcha-period-option-selected]=\"isPresetSelected(preset)\"\n [class.matcha-period-option-active]=\"isActiveIndex(i)\" [attr.aria-selected]=\"isPresetSelected(preset)\"\n (click)=\"selectPreset(preset)\">\n {{ preset.label }}\n </div>\n\n <!-- Op\u00E7\u00E3o \"Personalizado\" -->\n <ng-container *ngIf=\"allowCustom\">\n <matcha-divider gap=\"8\"></matcha-divider>\n\n <div class=\"matcha-period-option\" role=\"option\"\n [class.matcha-period-option-selected]=\"isCustomSelected || showingCustom\"\n [class.matcha-period-option-active]=\"isCustomActive\" [attr.aria-selected]=\"isCustomSelected\"\n (click)=\"toggleCustom()\">\n {{ customLabel }}\n </div>\n\n <!-- Editor de per\u00EDodo personalizado (reaproveita matcha-date-range + matcha-date) -->\n <div class=\"pt-8 px-16 pb-12\" *ngIf=\"showingCustom\" [formGroup]=\"customForm\">\n <matcha-date-range>\n <matcha-form-field>\n <matcha-label>Data in\u00EDcio</matcha-label>\n <matcha-date formControlName=\"start\" placeholder=\"__/__/____\" [useNativePicker]=\"false\"\n [max]=\"customStartMax\" [suppressPanelGlobalClose]=\"true\"\n (calendarPanelOpened)=\"registerCalendarOverlay($event)\"></matcha-date>\n </matcha-form-field>\n <matcha-form-field>\n <matcha-label>Data fim</matcha-label>\n <matcha-date formControlName=\"end\" placeholder=\"__/__/____\" [useNativePicker]=\"false\"\n [min]=\"customEndMin\" [suppressPanelGlobalClose]=\"true\"\n (calendarPanelOpened)=\"registerCalendarOverlay($event)\"></matcha-date>\n </matcha-form-field>\n </matcha-date-range>\n\n <div class=\"color-red fs-12 mt-8\" *ngIf=\"customError\">{{ customError }}</div>\n\n <button matcha-button color=\"accent\" size=\"small\" type=\"button\" class=\"w-100-p mt-12\"\n (click)=\"applyCustom()\">\n Aplicar\n </button>\n </div>\n </ng-container>\n </div>\n </matcha-panel>\n</div>\n" }]
|
|
10489
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { panel: [{
|
|
10490
|
+
type: ViewChild,
|
|
10491
|
+
args: [MatchaPanelComponent]
|
|
10492
|
+
}], presets: [{
|
|
10493
|
+
type: Input
|
|
10494
|
+
}], allowCustom: [{
|
|
10495
|
+
type: Input
|
|
10496
|
+
}], placeholder: [{
|
|
10497
|
+
type: Input
|
|
10498
|
+
}], customLabel: [{
|
|
10499
|
+
type: Input
|
|
10500
|
+
}], displayFormat: [{
|
|
10501
|
+
type: Input
|
|
10502
|
+
}], disabled: [{
|
|
10503
|
+
type: Input
|
|
10504
|
+
}], placement: [{
|
|
10505
|
+
type: Input
|
|
10506
|
+
}], maxHeight: [{
|
|
10507
|
+
type: Input
|
|
10508
|
+
}], minWidth: [{
|
|
10509
|
+
type: Input
|
|
10510
|
+
}], periodChange: [{
|
|
10511
|
+
type: Output
|
|
10512
|
+
}], opened: [{
|
|
10513
|
+
type: Output
|
|
10514
|
+
}], closed: [{
|
|
10515
|
+
type: Output
|
|
10516
|
+
}], openedChange: [{
|
|
10517
|
+
type: Output
|
|
10518
|
+
}], hostDisabledClass: [{
|
|
10519
|
+
type: HostBinding,
|
|
10520
|
+
args: ['class.matcha-period-disabled']
|
|
10521
|
+
}], hostDisabledAttr: [{
|
|
10522
|
+
type: HostBinding,
|
|
10523
|
+
args: ['attr.disabled']
|
|
10524
|
+
}] } });
|
|
10525
|
+
|
|
10526
|
+
class MatchaPeriodModule {
|
|
10527
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaPeriodModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
10528
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: MatchaPeriodModule, declarations: [MatchaPeriodComponent], imports: [CommonModule,
|
|
10529
|
+
FormsModule,
|
|
10530
|
+
ReactiveFormsModule,
|
|
10531
|
+
MatchaPanelModule,
|
|
10532
|
+
MatchaButtonModule,
|
|
10533
|
+
MatchaIconModule,
|
|
10534
|
+
MatchaDividerModule,
|
|
10535
|
+
MatchaDateModule,
|
|
10536
|
+
MatchaDateRangeModule,
|
|
10537
|
+
MatchaFormFieldModule], exports: [MatchaPeriodComponent] }); }
|
|
10538
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaPeriodModule, imports: [CommonModule,
|
|
10539
|
+
FormsModule,
|
|
10540
|
+
ReactiveFormsModule,
|
|
10541
|
+
MatchaPanelModule,
|
|
10542
|
+
MatchaButtonModule,
|
|
10543
|
+
MatchaIconModule,
|
|
10544
|
+
MatchaDividerModule,
|
|
10545
|
+
MatchaDateModule,
|
|
10546
|
+
MatchaDateRangeModule,
|
|
10547
|
+
MatchaFormFieldModule] }); }
|
|
10548
|
+
}
|
|
10549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MatchaPeriodModule, decorators: [{
|
|
10550
|
+
type: NgModule,
|
|
10551
|
+
args: [{
|
|
10552
|
+
declarations: [
|
|
10553
|
+
MatchaPeriodComponent
|
|
10554
|
+
],
|
|
10555
|
+
imports: [
|
|
10556
|
+
CommonModule,
|
|
10557
|
+
FormsModule,
|
|
10558
|
+
ReactiveFormsModule,
|
|
10559
|
+
MatchaPanelModule,
|
|
10560
|
+
MatchaButtonModule,
|
|
10561
|
+
MatchaIconModule,
|
|
10562
|
+
MatchaDividerModule,
|
|
10563
|
+
MatchaDateModule,
|
|
10564
|
+
MatchaDateRangeModule,
|
|
10565
|
+
MatchaFormFieldModule
|
|
10566
|
+
],
|
|
10567
|
+
exports: [
|
|
10568
|
+
MatchaPeriodComponent
|
|
10569
|
+
]
|
|
10570
|
+
}]
|
|
10571
|
+
}] });
|
|
10572
|
+
|
|
9600
10573
|
class MatchaTimeComponent {
|
|
9601
10574
|
constructor() {
|
|
9602
10575
|
this.placeholder = '__:__';
|
|
@@ -15841,6 +16814,8 @@ class MatchaComponentsModule {
|
|
|
15841
16814
|
MatchaTitleModule,
|
|
15842
16815
|
MatchaTooltipModule,
|
|
15843
16816
|
MatchaDateRangeModule,
|
|
16817
|
+
MatchaPeriodModule,
|
|
16818
|
+
MatchaCalendarPickerModule,
|
|
15844
16819
|
MatchaTimeModule,
|
|
15845
16820
|
MatchaTimeRangeModule,
|
|
15846
16821
|
MatchaDropListModule,
|
|
@@ -15886,6 +16861,8 @@ class MatchaComponentsModule {
|
|
|
15886
16861
|
MatchaTitleModule,
|
|
15887
16862
|
MatchaTooltipModule,
|
|
15888
16863
|
MatchaDateRangeModule,
|
|
16864
|
+
MatchaPeriodModule,
|
|
16865
|
+
MatchaCalendarPickerModule,
|
|
15889
16866
|
MatchaTimeModule,
|
|
15890
16867
|
MatchaTimeRangeModule,
|
|
15891
16868
|
MatchaDropListModule,
|
|
@@ -15936,6 +16913,8 @@ class MatchaComponentsModule {
|
|
|
15936
16913
|
MatchaTitleModule,
|
|
15937
16914
|
MatchaTooltipModule,
|
|
15938
16915
|
MatchaDateRangeModule,
|
|
16916
|
+
MatchaPeriodModule,
|
|
16917
|
+
MatchaCalendarPickerModule,
|
|
15939
16918
|
MatchaTimeModule,
|
|
15940
16919
|
MatchaTimeRangeModule,
|
|
15941
16920
|
MatchaDropListModule,
|
|
@@ -15981,6 +16960,8 @@ class MatchaComponentsModule {
|
|
|
15981
16960
|
MatchaTitleModule,
|
|
15982
16961
|
MatchaTooltipModule,
|
|
15983
16962
|
MatchaDateRangeModule,
|
|
16963
|
+
MatchaPeriodModule,
|
|
16964
|
+
MatchaCalendarPickerModule,
|
|
15984
16965
|
MatchaTimeModule,
|
|
15985
16966
|
MatchaTimeRangeModule,
|
|
15986
16967
|
MatchaDropListModule,
|
|
@@ -16037,6 +17018,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
16037
17018
|
MatchaTitleModule,
|
|
16038
17019
|
MatchaTooltipModule,
|
|
16039
17020
|
MatchaDateRangeModule,
|
|
17021
|
+
MatchaPeriodModule,
|
|
17022
|
+
MatchaCalendarPickerModule,
|
|
16040
17023
|
MatchaTimeModule,
|
|
16041
17024
|
MatchaTimeRangeModule,
|
|
16042
17025
|
MatchaDropListModule,
|
|
@@ -16084,6 +17067,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
16084
17067
|
MatchaTitleModule,
|
|
16085
17068
|
MatchaTooltipModule,
|
|
16086
17069
|
MatchaDateRangeModule,
|
|
17070
|
+
MatchaPeriodModule,
|
|
17071
|
+
MatchaCalendarPickerModule,
|
|
16087
17072
|
MatchaTimeModule,
|
|
16088
17073
|
MatchaTimeRangeModule,
|
|
16089
17074
|
MatchaDropListModule,
|
|
@@ -16131,6 +17116,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
16131
17116
|
}]
|
|
16132
17117
|
}] });
|
|
16133
17118
|
|
|
17119
|
+
/**
|
|
17120
|
+
* Tipagem pública do componente matcha-period (seletor de período / presets).
|
|
17121
|
+
*/
|
|
17122
|
+
|
|
16134
17123
|
class MatchaGridComponent {
|
|
16135
17124
|
getStringSplited(inputValue) {
|
|
16136
17125
|
const stringWithoutSpaces = inputValue.replace(/\s+/g, '');
|
|
@@ -17213,5 +18202,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
17213
18202
|
* Generated bundle index. Do not edit.
|
|
17214
18203
|
*/
|
|
17215
18204
|
|
|
17216
|
-
export { CopyButtonComponent, INITIAL_CONFIG, MATCHA_MASK_CONFIG, MATCHA_OPTION_PARENT, MatchaAccordionComponent, MatchaAccordionContentComponent, MatchaAccordionHeaderComponent, MatchaAccordionItemComponent, MatchaAccordionModule, MatchaAutocompleteComponent, MatchaAutocompleteModule, MatchaAutocompleteTriggerDirective, MatchaAvatarComponent, MatchaAvatarModule, MatchaBreakpointObservableModule, MatchaBreakpointObserver, MatchaButtonComponent, MatchaButtonModule, MatchaButtonToggleComponent, MatchaButtonToggleModule, MatchaCardComponent, MatchaCardModule, MatchaCheckboxComponent, MatchaCheckboxModule, MatchaChipComponent, MatchaChipListComponent, MatchaChipModule, MatchaComponentsModule, MatchaDateComponent, MatchaDateModule, MatchaDateRangeComponent, MatchaDateRangeModule, MatchaDividerComponent, MatchaDividerModule, MatchaDragDirective, MatchaDragHandleDirective, MatchaDrawerComponent, MatchaDrawerContainerComponent, MatchaDrawerContentComponent, MatchaDrawerModule, MatchaDropListComponent, MatchaDropListModule, MatchaDropListService, MatchaDropZoneDirective, MatchaElevationDirective, MatchaElevationModule, MatchaErrorComponent, MatchaFormFieldComponent, MatchaFormFieldModule, MatchaGridComponent, MatchaGridModule, MatchaHighlightComponent, MatchaHighlightModule, MatchaHintTextComponent, MatchaHintTextModule, MatchaIconComponent, MatchaIconModule, MatchaInfiniteScrollComponent, MatchaInfiniteScrollDataComponent, MatchaInfiniteScrollModule, MatchaInputPhoneComponent, MatchaInputPhoneModule, MatchaLabelComponent, MatchaLazyloadComponent, MatchaLazyloadDataComponent, MatchaLazyloadModule, MatchaListComponent, MatchaListItemComponent, MatchaListModule, MatchaMaskApplierService, MatchaMaskCompatibleDirective, MatchaMaskModule, MatchaMaskPipe, MatchaMaskService, MatchaMasonryComponent, MatchaMasonryModule, MatchaMenuComponent, MatchaMenuItemDirective, MatchaMenuModule, MatchaMenuTriggerDirective, MatchaModalComponent, MatchaModalContentComponent, MatchaModalFooterComponent, MatchaModalHeaderComponent, MatchaModalModule, MatchaModalOptionsComponent, MatchaModalService, MatchaMsgBoxActionsComponent, MatchaMsgBoxComponent, MatchaMsgBoxModule, MatchaOptionComponent, MatchaOptionModule, MatchaOverlayService, MatchaPageBuilderComponent, MatchaPageBuilderModule, MatchaPageLayoutComponent, MatchaPageLayoutModule, MatchaPaginatorComponent, MatchaPaginatorIntl, MatchaPaginatorModule, MatchaPanelComponent, MatchaPanelModule, MatchaProgressBarComponent, MatchaProgressBarModule, MatchaRadioComponent, MatchaRadioGroupComponent, MatchaRadioModule, MatchaRippleDirective, MatchaRippleModule, MatchaSelectComponent, MatchaSelectModule, MatchaSelectMultipleComponent, MatchaSelectMultipleModule, MatchaSelectTriggerDirective, MatchaSkeletonComponent, MatchaSkeletonModule, MatchaSlideToggleComponent, MatchaSlideToggleModule, MatchaSliderComponent, MatchaSliderModule, MatchaSnackBarComponent, MatchaSnackBarModule, MatchaSnackBarService, MatchaSpinComponent, MatchaSpinModule, MatchaSpinnerComponent, MatchaSpinnerModule, MatchaStepperComponent, MatchaStepperContentComponent, MatchaStepperControllerComponent, MatchaStepperModule, MatchaStepperStateService, MatchaSubmenuTriggerDirective, MatchaTabItemComponent, MatchaTableComponent, MatchaTableModule, MatchaTabsComponent, MatchaTabsModule, MatchaTextEditorComponent, MatchaTextEditorModule, MatchaTimeComponent, MatchaTimeModule, MatchaTimeRangeComponent, MatchaTimeRangeModule, MatchaTitleComponent, MatchaTitleModule, MatchaToolbarButtonComponent, MatchaToolbarComponent, MatchaToolbarContentComponent, MatchaToolbarCustomButtonComponent, MatchaToolbarMainButtonComponent, MatchaToolbarModule, MatchaTooltipDirective, MatchaTooltipModule, NEW_CONFIG, NextStepDirective, PrevStepDirective, StepComponent, StepContentDirective, buildSunEditorConfig, compatibleOptions, initialConfig, timeMasks, withoutValidation };
|
|
18205
|
+
export { CopyButtonComponent, INITIAL_CONFIG, MATCHA_MASK_CONFIG, MATCHA_OPTION_PARENT, MatchaAccordionComponent, MatchaAccordionContentComponent, MatchaAccordionHeaderComponent, MatchaAccordionItemComponent, MatchaAccordionModule, MatchaAutocompleteComponent, MatchaAutocompleteModule, MatchaAutocompleteTriggerDirective, MatchaAvatarComponent, MatchaAvatarModule, MatchaBreakpointObservableModule, MatchaBreakpointObserver, MatchaButtonComponent, MatchaButtonModule, MatchaButtonToggleComponent, MatchaButtonToggleModule, MatchaCalendarIntl, MatchaCalendarPickerComponent, MatchaCalendarPickerModule, MatchaCardComponent, MatchaCardModule, MatchaCheckboxComponent, MatchaCheckboxModule, MatchaChipComponent, MatchaChipListComponent, MatchaChipModule, MatchaComponentsModule, MatchaDateComponent, MatchaDateModule, MatchaDateRangeComponent, MatchaDateRangeModule, MatchaDividerComponent, MatchaDividerModule, MatchaDragDirective, MatchaDragHandleDirective, MatchaDrawerComponent, MatchaDrawerContainerComponent, MatchaDrawerContentComponent, MatchaDrawerModule, MatchaDropListComponent, MatchaDropListModule, MatchaDropListService, MatchaDropZoneDirective, MatchaElevationDirective, MatchaElevationModule, MatchaErrorComponent, MatchaFormFieldComponent, MatchaFormFieldModule, MatchaGridComponent, MatchaGridModule, MatchaHighlightComponent, MatchaHighlightModule, MatchaHintTextComponent, MatchaHintTextModule, MatchaIconComponent, MatchaIconModule, MatchaInfiniteScrollComponent, MatchaInfiniteScrollDataComponent, MatchaInfiniteScrollModule, MatchaInputPhoneComponent, MatchaInputPhoneModule, MatchaLabelComponent, MatchaLazyloadComponent, MatchaLazyloadDataComponent, MatchaLazyloadModule, MatchaListComponent, MatchaListItemComponent, MatchaListModule, MatchaMaskApplierService, MatchaMaskCompatibleDirective, MatchaMaskModule, MatchaMaskPipe, MatchaMaskService, MatchaMasonryComponent, MatchaMasonryModule, MatchaMenuComponent, MatchaMenuItemDirective, MatchaMenuModule, MatchaMenuTriggerDirective, MatchaModalComponent, MatchaModalContentComponent, MatchaModalFooterComponent, MatchaModalHeaderComponent, MatchaModalModule, MatchaModalOptionsComponent, MatchaModalService, MatchaMsgBoxActionsComponent, MatchaMsgBoxComponent, MatchaMsgBoxModule, MatchaOptionComponent, MatchaOptionModule, MatchaOverlayService, MatchaPageBuilderComponent, MatchaPageBuilderModule, MatchaPageLayoutComponent, MatchaPageLayoutModule, MatchaPaginatorComponent, MatchaPaginatorIntl, MatchaPaginatorModule, MatchaPanelComponent, MatchaPanelModule, MatchaPeriodComponent, MatchaPeriodModule, MatchaProgressBarComponent, MatchaProgressBarModule, MatchaRadioComponent, MatchaRadioGroupComponent, MatchaRadioModule, MatchaRippleDirective, MatchaRippleModule, MatchaSelectComponent, MatchaSelectModule, MatchaSelectMultipleComponent, MatchaSelectMultipleModule, MatchaSelectTriggerDirective, MatchaSkeletonComponent, MatchaSkeletonModule, MatchaSlideToggleComponent, MatchaSlideToggleModule, MatchaSliderComponent, MatchaSliderModule, MatchaSnackBarComponent, MatchaSnackBarModule, MatchaSnackBarService, MatchaSpinComponent, MatchaSpinModule, MatchaSpinnerComponent, MatchaSpinnerModule, MatchaStepperComponent, MatchaStepperContentComponent, MatchaStepperControllerComponent, MatchaStepperModule, MatchaStepperStateService, MatchaSubmenuTriggerDirective, MatchaTabItemComponent, MatchaTableComponent, MatchaTableModule, MatchaTabsComponent, MatchaTabsModule, MatchaTextEditorComponent, MatchaTextEditorModule, MatchaTimeComponent, MatchaTimeModule, MatchaTimeRangeComponent, MatchaTimeRangeModule, MatchaTitleComponent, MatchaTitleModule, MatchaToolbarButtonComponent, MatchaToolbarComponent, MatchaToolbarContentComponent, MatchaToolbarCustomButtonComponent, MatchaToolbarMainButtonComponent, MatchaToolbarModule, MatchaTooltipDirective, MatchaTooltipModule, NEW_CONFIG, NextStepDirective, PrevStepDirective, StepComponent, StepContentDirective, buildSunEditorConfig, compatibleOptions, initialConfig, timeMasks, withoutValidation };
|
|
17217
18206
|
//# sourceMappingURL=matcha-components.mjs.map
|