@acontplus/ng-components 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, output, ViewEncapsulation, Component, inject, viewChild, ViewContainerRef, ChangeDetectionStrategy, effect, Injectable, computed, PLATFORM_ID, signal, Input, TemplateRef, Pipe, Directive, ViewChild, KeyValueDiffers, ChangeDetectorRef, InjectionToken, ANIMATION_MODULE_TYPE, HostListener, ContentChildren, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, output, ViewEncapsulation, Component, inject, viewChild, ViewContainerRef, ChangeDetectionStrategy, effect, Injectable, computed, PLATFORM_ID, signal, Input, TemplateRef, Pipe, Directive, ViewChild, KeyValueDiffers, ChangeDetectorRef, InjectionToken, ANIMATION_MODULE_TYPE, HostListener, ContentChildren, forwardRef, ElementRef, Renderer2 } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/material/card';
|
|
4
4
|
import { MatCardModule } from '@angular/material/card';
|
|
5
5
|
import * as i2 from '@angular/material/button';
|
|
@@ -19,7 +19,8 @@ import { Subject, firstValueFrom, catchError, of, map, BehaviorSubject, delay, d
|
|
|
19
19
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
20
20
|
import { HttpClient } from '@angular/common/http';
|
|
21
21
|
import { MatChipRow, MatChipGrid, MatChipInput, MatChipListbox, MatChip } from '@angular/material/chips';
|
|
22
|
-
import
|
|
22
|
+
import * as i1$5 from '@angular/material/form-field';
|
|
23
|
+
import { MatFormField, MatLabel, MatHint, MatFormFieldModule, MatFormFieldControl } from '@angular/material/form-field';
|
|
23
24
|
import { LiveAnnouncer } from '@angular/cdk/a11y';
|
|
24
25
|
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
|
25
26
|
import { MatProgressSpinner } from '@angular/material/progress-spinner';
|
|
@@ -36,12 +37,17 @@ import { switchMap, catchError as catchError$1, takeUntil as takeUntil$1, filter
|
|
|
36
37
|
import { MatTableDataSource, MatTable, MatColumnDef, MatHeaderRowDef, MatHeaderRow, MatRowDef, MatRow, MatFooterRowDef, MatFooterRow, MatHeaderCellDef, MatHeaderCell, MatCellDef, MatCell, MatFooterCellDef, MatFooterCell } from '@angular/material/table';
|
|
37
38
|
import { MatPaginator } from '@angular/material/paginator';
|
|
38
39
|
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
|
39
|
-
import
|
|
40
|
+
import * as i3$2 from '@angular/material/checkbox';
|
|
41
|
+
import { MatCheckbox, MatCheckboxModule } from '@angular/material/checkbox';
|
|
40
42
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
41
43
|
import * as i1$4 from '@angular/material/menu';
|
|
42
44
|
import { MatMenu, MatMenuItem, MatMenuTrigger, MatMenuModule } from '@angular/material/menu';
|
|
43
45
|
import * as i3$1 from '@angular/material/badge';
|
|
44
46
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
47
|
+
import * as i2$3 from '@angular/material/input';
|
|
48
|
+
import { MatInputModule } from '@angular/material/input';
|
|
49
|
+
import { Datex, SPANISH_LOCALE, DEFAULT_THEME, MATERIAL_THEME, BOOTSTRAP_THEME } from 'datex-ui';
|
|
50
|
+
export { BOOTSTRAP_THEME, DEFAULT_THEME, Datex, MATERIAL_THEME, SPANISH_LOCALE, SPANISH_LOCALE_WITH_TIME } from 'datex-ui';
|
|
45
51
|
import { TranslocoService } from '@jsverse/transloco';
|
|
46
52
|
|
|
47
53
|
/**
|
|
@@ -2276,10 +2282,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2276
2282
|
class DataGridColClassPipe {
|
|
2277
2283
|
transform(colDef, rowData, rowChangeRecord, currentValue) {
|
|
2278
2284
|
if (rowChangeRecord) {
|
|
2279
|
-
|
|
2285
|
+
/* empty */
|
|
2280
2286
|
}
|
|
2281
2287
|
if (currentValue) {
|
|
2282
|
-
|
|
2288
|
+
/* empty */
|
|
2283
2289
|
}
|
|
2284
2290
|
if (typeof colDef.class === 'string') {
|
|
2285
2291
|
return colDef.class;
|
|
@@ -2319,10 +2325,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2319
2325
|
class DataGridCellActionsPipe {
|
|
2320
2326
|
transform(btns, rowData, rowChangeRecord, currentValue) {
|
|
2321
2327
|
if (rowChangeRecord) {
|
|
2322
|
-
|
|
2328
|
+
/* empty */
|
|
2323
2329
|
}
|
|
2324
2330
|
if (currentValue) {
|
|
2325
|
-
|
|
2331
|
+
/* empty */
|
|
2326
2332
|
}
|
|
2327
2333
|
if (typeof btns === 'function') {
|
|
2328
2334
|
return btns(rowData);
|
|
@@ -2374,10 +2380,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2374
2380
|
class DataGridCellActionDisablePipe {
|
|
2375
2381
|
transform(btn, rowData, rowChangeRecord, currentValue) {
|
|
2376
2382
|
if (typeof rowChangeRecord === 'object') {
|
|
2377
|
-
|
|
2383
|
+
/* empty */
|
|
2378
2384
|
}
|
|
2379
2385
|
if (currentValue) {
|
|
2380
|
-
|
|
2386
|
+
/* empty */
|
|
2381
2387
|
}
|
|
2382
2388
|
if (typeof btn.disabled === 'boolean') {
|
|
2383
2389
|
return btn.disabled;
|
|
@@ -2636,15 +2642,6 @@ class KeyboardNavigationService {
|
|
|
2636
2642
|
}
|
|
2637
2643
|
return '';
|
|
2638
2644
|
}, ...(ngDevMode ? [{ debugName: "focusedElementName" }] : []));
|
|
2639
|
-
constructor() {
|
|
2640
|
-
// Este effect se dispara cada vez que el elemento enfocado cambia.
|
|
2641
|
-
// Es útil para realizar acciones secundarias si fuera necesario.
|
|
2642
|
-
effect(() => {
|
|
2643
|
-
const focusedElementIndex = this.currentFocusIndex();
|
|
2644
|
-
const focusedElementName = this.focusedElementName();
|
|
2645
|
-
console.log(`El foco cambió al elemento: ${focusedElementName} (índice: ${focusedElementIndex})`);
|
|
2646
|
-
});
|
|
2647
|
-
}
|
|
2648
2645
|
/**
|
|
2649
2646
|
* Registra un nuevo elemento en el sistema de navegación por teclado.
|
|
2650
2647
|
* @param element El objeto FocusableElement a registrar.
|
|
@@ -2784,7 +2781,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2784
2781
|
args: [{
|
|
2785
2782
|
providedIn: 'root',
|
|
2786
2783
|
}]
|
|
2787
|
-
}]
|
|
2784
|
+
}] });
|
|
2788
2785
|
|
|
2789
2786
|
const DATA_GRID_DEFAULT_OPTIONS = new InjectionToken('data-grid-default-options');
|
|
2790
2787
|
class DataGrid {
|
|
@@ -3339,6 +3336,468 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
3339
3336
|
args: ['document:keydown', ['$event']]
|
|
3340
3337
|
}] } });
|
|
3341
3338
|
|
|
3339
|
+
class DateRangePicker {
|
|
3340
|
+
static nextId = 0;
|
|
3341
|
+
dateInput;
|
|
3342
|
+
// MatFormFieldControl implementation
|
|
3343
|
+
stateChanges = new Subject();
|
|
3344
|
+
id = `acp-date-range-picker-${DateRangePicker.nextId++}`;
|
|
3345
|
+
controlType = 'acp-date-range-picker';
|
|
3346
|
+
autofilled = false;
|
|
3347
|
+
_focused = signal(false, ...(ngDevMode ? [{ debugName: "_focused" }] : []));
|
|
3348
|
+
_required = signal(false, ...(ngDevMode ? [{ debugName: "_required" }] : []));
|
|
3349
|
+
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
3350
|
+
get focused() {
|
|
3351
|
+
return this._focused();
|
|
3352
|
+
}
|
|
3353
|
+
get empty() {
|
|
3354
|
+
return !this._value();
|
|
3355
|
+
}
|
|
3356
|
+
get shouldLabelFloat() {
|
|
3357
|
+
return this.focused || !this.empty;
|
|
3358
|
+
}
|
|
3359
|
+
get required() {
|
|
3360
|
+
return this._required();
|
|
3361
|
+
}
|
|
3362
|
+
get value() {
|
|
3363
|
+
return this._value();
|
|
3364
|
+
}
|
|
3365
|
+
set value(val) {
|
|
3366
|
+
this._value.set(val);
|
|
3367
|
+
this.stateChanges.next();
|
|
3368
|
+
}
|
|
3369
|
+
_errorState = false;
|
|
3370
|
+
get errorState() {
|
|
3371
|
+
return this._errorState;
|
|
3372
|
+
}
|
|
3373
|
+
get userAriaDescribedBy() {
|
|
3374
|
+
return undefined;
|
|
3375
|
+
}
|
|
3376
|
+
get placeholder() {
|
|
3377
|
+
return this.placeholderText();
|
|
3378
|
+
}
|
|
3379
|
+
get disabled() {
|
|
3380
|
+
return this.isDisabled();
|
|
3381
|
+
}
|
|
3382
|
+
ngControl = null;
|
|
3383
|
+
// Configuration inputs
|
|
3384
|
+
options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
3385
|
+
// UI inputs
|
|
3386
|
+
placeholderText = input('Seleccionar rango de fechas', ...(ngDevMode ? [{ debugName: "placeholderText" }] : []));
|
|
3387
|
+
isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
3388
|
+
inputReadonly = input(false, ...(ngDevMode ? [{ debugName: "inputReadonly" }] : []));
|
|
3389
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
3390
|
+
hint = input(...(ngDevMode ? [undefined, { debugName: "hint" }] : []));
|
|
3391
|
+
errorMessage = input(...(ngDevMode ? [undefined, { debugName: "errorMessage" }] : []));
|
|
3392
|
+
appearance = input('outline', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
3393
|
+
// Icon inputs
|
|
3394
|
+
calendarIcon = input('date_range', ...(ngDevMode ? [{ debugName: "calendarIcon" }] : []));
|
|
3395
|
+
showCalendarButton = input(false, ...(ngDevMode ? [{ debugName: "showCalendarButton" }] : []));
|
|
3396
|
+
// Checkbox functionality
|
|
3397
|
+
showCheckbox = input(false, ...(ngDevMode ? [{ debugName: "showCheckbox" }] : []));
|
|
3398
|
+
checkboxChecked = input(false, ...(ngDevMode ? [{ debugName: "checkboxChecked" }] : []));
|
|
3399
|
+
checkboxReadonly = input(false, ...(ngDevMode ? [{ debugName: "checkboxReadonly" }] : []));
|
|
3400
|
+
checkboxAriaLabel = input('Toggle selection', ...(ngDevMode ? [{ debugName: "checkboxAriaLabel" }] : []));
|
|
3401
|
+
checkboxPosition = input('suffix', ...(ngDevMode ? [{ debugName: "checkboxPosition" }] : []));
|
|
3402
|
+
// Events
|
|
3403
|
+
dateRangeSelected = output();
|
|
3404
|
+
pickerShow = output();
|
|
3405
|
+
pickerHide = output();
|
|
3406
|
+
pickerApply = output();
|
|
3407
|
+
pickerCancel = output();
|
|
3408
|
+
checkboxChange = output();
|
|
3409
|
+
// Internal state
|
|
3410
|
+
picker;
|
|
3411
|
+
isInitialized = signal(false, ...(ngDevMode ? [{ debugName: "isInitialized" }] : []));
|
|
3412
|
+
// ControlValueAccessor implementation
|
|
3413
|
+
onChange = (_value) => {
|
|
3414
|
+
// This will be replaced by registerOnChange
|
|
3415
|
+
};
|
|
3416
|
+
onTouched = () => {
|
|
3417
|
+
// This will be replaced by registerOnTouched
|
|
3418
|
+
};
|
|
3419
|
+
constructor() {
|
|
3420
|
+
// No effect here to avoid infinite loops - using ngOnChanges instead
|
|
3421
|
+
}
|
|
3422
|
+
ngOnInit() {
|
|
3423
|
+
this.initializePicker();
|
|
3424
|
+
this.isInitialized.set(true);
|
|
3425
|
+
}
|
|
3426
|
+
ngOnChanges(changes) {
|
|
3427
|
+
if (changes['options'] && !changes['options'].isFirstChange()) {
|
|
3428
|
+
if (this.picker) {
|
|
3429
|
+
this.updateOptions();
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
}
|
|
3433
|
+
ngOnDestroy() {
|
|
3434
|
+
if (this.picker) {
|
|
3435
|
+
this.picker.remove();
|
|
3436
|
+
}
|
|
3437
|
+
this.stateChanges.complete();
|
|
3438
|
+
}
|
|
3439
|
+
setDescribedByIds(_ids) {
|
|
3440
|
+
// Implementation for accessibility
|
|
3441
|
+
}
|
|
3442
|
+
onContainerClick(_event) {
|
|
3443
|
+
if (!this.focused) {
|
|
3444
|
+
this.focus();
|
|
3445
|
+
}
|
|
3446
|
+
}
|
|
3447
|
+
focus() {
|
|
3448
|
+
this.dateInput.nativeElement.focus();
|
|
3449
|
+
this._focused.set(true);
|
|
3450
|
+
this.stateChanges.next();
|
|
3451
|
+
}
|
|
3452
|
+
blur() {
|
|
3453
|
+
this._focused.set(false);
|
|
3454
|
+
this.onTouched();
|
|
3455
|
+
this.stateChanges.next();
|
|
3456
|
+
}
|
|
3457
|
+
initializePicker() {
|
|
3458
|
+
const options = this.buildDatexOptions();
|
|
3459
|
+
this.picker = new Datex(this.dateInput.nativeElement, options, (startDate, endDate, label) => {
|
|
3460
|
+
const opts = this.options();
|
|
3461
|
+
const value = opts.singleDatePicker ? startDate : { startDate, endDate };
|
|
3462
|
+
this._value.set(value);
|
|
3463
|
+
this.onChange(value);
|
|
3464
|
+
this.onTouched();
|
|
3465
|
+
this.dateRangeSelected.emit({ startDate, endDate, label });
|
|
3466
|
+
this.stateChanges.next();
|
|
3467
|
+
});
|
|
3468
|
+
this.setupEventListeners();
|
|
3469
|
+
}
|
|
3470
|
+
updateOptions() {
|
|
3471
|
+
if (!this.picker)
|
|
3472
|
+
return;
|
|
3473
|
+
// Try to use native updateOptions if available
|
|
3474
|
+
if (typeof this.picker.updateOptions === 'function') {
|
|
3475
|
+
const newOptions = this.buildDatexOptions();
|
|
3476
|
+
this.picker.updateOptions(newOptions);
|
|
3477
|
+
}
|
|
3478
|
+
else {
|
|
3479
|
+
// Fallback to reinitialize if updateOptions is not available
|
|
3480
|
+
this.reinitializePicker();
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
reinitializePicker() {
|
|
3484
|
+
if (!this.isInitialized())
|
|
3485
|
+
return;
|
|
3486
|
+
const currentValue = this._value();
|
|
3487
|
+
if (this.picker) {
|
|
3488
|
+
this.picker.remove();
|
|
3489
|
+
this.picker = undefined;
|
|
3490
|
+
}
|
|
3491
|
+
this.initializePicker();
|
|
3492
|
+
if (currentValue) {
|
|
3493
|
+
setTimeout(() => {
|
|
3494
|
+
this.writeValue(currentValue);
|
|
3495
|
+
}, 0);
|
|
3496
|
+
}
|
|
3497
|
+
}
|
|
3498
|
+
buildDatexOptions() {
|
|
3499
|
+
const opts = this.options();
|
|
3500
|
+
const today = new Date();
|
|
3501
|
+
const defaultOptions = {
|
|
3502
|
+
startDate: today,
|
|
3503
|
+
endDate: today,
|
|
3504
|
+
autoApply: false,
|
|
3505
|
+
singleDatePicker: false,
|
|
3506
|
+
showDropdowns: true,
|
|
3507
|
+
linkedCalendars: true,
|
|
3508
|
+
autoUpdateInput: true,
|
|
3509
|
+
alwaysShowCalendars: false,
|
|
3510
|
+
showCustomRangeLabel: true,
|
|
3511
|
+
timePicker: false,
|
|
3512
|
+
timePicker24Hour: true,
|
|
3513
|
+
timePickerIncrement: 1,
|
|
3514
|
+
timePickerSeconds: false,
|
|
3515
|
+
ranges: {},
|
|
3516
|
+
opens: 'center',
|
|
3517
|
+
drops: 'auto',
|
|
3518
|
+
locale: SPANISH_LOCALE,
|
|
3519
|
+
buttonClasses: 'btn btn-sm',
|
|
3520
|
+
applyButtonClasses: 'btn-success',
|
|
3521
|
+
cancelButtonClasses: 'btn-danger',
|
|
3522
|
+
theme: this.getTheme(),
|
|
3523
|
+
};
|
|
3524
|
+
// Merge user options with defaults, excluding presetTheme
|
|
3525
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3526
|
+
const { presetTheme, ...userOptions } = opts;
|
|
3527
|
+
return {
|
|
3528
|
+
...defaultOptions,
|
|
3529
|
+
...userOptions,
|
|
3530
|
+
// Always use getTheme() to handle presetTheme properly
|
|
3531
|
+
theme: this.getTheme(),
|
|
3532
|
+
};
|
|
3533
|
+
}
|
|
3534
|
+
getTheme() {
|
|
3535
|
+
const opts = this.options();
|
|
3536
|
+
const baseTheme = opts.theme ?? DEFAULT_THEME;
|
|
3537
|
+
switch (opts.presetTheme ?? 'material') {
|
|
3538
|
+
case 'bootstrap':
|
|
3539
|
+
return { ...BOOTSTRAP_THEME, ...baseTheme };
|
|
3540
|
+
case 'material':
|
|
3541
|
+
return { ...MATERIAL_THEME, ...baseTheme };
|
|
3542
|
+
case 'custom':
|
|
3543
|
+
return baseTheme;
|
|
3544
|
+
default:
|
|
3545
|
+
return { ...DEFAULT_THEME, ...baseTheme };
|
|
3546
|
+
}
|
|
3547
|
+
}
|
|
3548
|
+
setupEventListeners() {
|
|
3549
|
+
if (!this.picker)
|
|
3550
|
+
return;
|
|
3551
|
+
const input = this.dateInput.nativeElement;
|
|
3552
|
+
input.addEventListener('show.daterangepicker', () => {
|
|
3553
|
+
this.pickerShow.emit();
|
|
3554
|
+
});
|
|
3555
|
+
input.addEventListener('hide.daterangepicker', () => {
|
|
3556
|
+
this.pickerHide.emit();
|
|
3557
|
+
});
|
|
3558
|
+
input.addEventListener('apply.daterangepicker', () => {
|
|
3559
|
+
this.pickerApply.emit();
|
|
3560
|
+
});
|
|
3561
|
+
input.addEventListener('cancel.daterangepicker', () => {
|
|
3562
|
+
this.pickerCancel.emit();
|
|
3563
|
+
});
|
|
3564
|
+
input.addEventListener('focus', () => {
|
|
3565
|
+
this._focused.set(true);
|
|
3566
|
+
this.stateChanges.next();
|
|
3567
|
+
});
|
|
3568
|
+
input.addEventListener('blur', () => {
|
|
3569
|
+
this._focused.set(false);
|
|
3570
|
+
this.onTouched();
|
|
3571
|
+
this.stateChanges.next();
|
|
3572
|
+
});
|
|
3573
|
+
}
|
|
3574
|
+
writeValue(value) {
|
|
3575
|
+
this._value.set(value);
|
|
3576
|
+
if (!this.picker)
|
|
3577
|
+
return;
|
|
3578
|
+
if (value) {
|
|
3579
|
+
const opts = this.options();
|
|
3580
|
+
if (opts.singleDatePicker) {
|
|
3581
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
3582
|
+
this.picker.setStartDate(date);
|
|
3583
|
+
this.picker.setEndDate(date);
|
|
3584
|
+
}
|
|
3585
|
+
else if (value.startDate && value.endDate) {
|
|
3586
|
+
this.picker.setStartDate(new Date(value.startDate));
|
|
3587
|
+
this.picker.setEndDate(new Date(value.endDate));
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
this.stateChanges.next();
|
|
3591
|
+
}
|
|
3592
|
+
registerOnChange(fn) {
|
|
3593
|
+
this.onChange = fn;
|
|
3594
|
+
}
|
|
3595
|
+
registerOnTouched(fn) {
|
|
3596
|
+
this.onTouched = fn;
|
|
3597
|
+
}
|
|
3598
|
+
setDisabledState(isDisabled) {
|
|
3599
|
+
if (this.dateInput) {
|
|
3600
|
+
this.dateInput.nativeElement.disabled = isDisabled;
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3603
|
+
show() {
|
|
3604
|
+
this.picker?.show();
|
|
3605
|
+
}
|
|
3606
|
+
hide() {
|
|
3607
|
+
this.picker?.hide();
|
|
3608
|
+
}
|
|
3609
|
+
toggle() {
|
|
3610
|
+
this.picker?.toggle();
|
|
3611
|
+
}
|
|
3612
|
+
getStartDate() {
|
|
3613
|
+
return this.picker?.getStartDate() || null;
|
|
3614
|
+
}
|
|
3615
|
+
getEndDate() {
|
|
3616
|
+
return this.picker?.getEndDate() || null;
|
|
3617
|
+
}
|
|
3618
|
+
setStartDate(date) {
|
|
3619
|
+
this.picker?.setStartDate(date);
|
|
3620
|
+
}
|
|
3621
|
+
setEndDate(date) {
|
|
3622
|
+
this.picker?.setEndDate(date);
|
|
3623
|
+
}
|
|
3624
|
+
updateTheme(theme) {
|
|
3625
|
+
this.picker?.setTheme({ ...this.getTheme(), ...theme });
|
|
3626
|
+
}
|
|
3627
|
+
updateRanges(ranges) {
|
|
3628
|
+
if (this.picker && 'updateRanges' in this.picker) {
|
|
3629
|
+
this.picker.updateRanges(ranges);
|
|
3630
|
+
}
|
|
3631
|
+
}
|
|
3632
|
+
updateConfiguration() {
|
|
3633
|
+
this.reinitializePicker();
|
|
3634
|
+
}
|
|
3635
|
+
forceReinitialize() {
|
|
3636
|
+
this.reinitializePicker();
|
|
3637
|
+
}
|
|
3638
|
+
onCheckboxToggle(event) {
|
|
3639
|
+
if (this.checkboxReadonly()) {
|
|
3640
|
+
return;
|
|
3641
|
+
}
|
|
3642
|
+
const newValue = event.checked;
|
|
3643
|
+
this.checkboxChange.emit(newValue);
|
|
3644
|
+
}
|
|
3645
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DateRangePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3646
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DateRangePicker, isStandalone: true, selector: "acp-date-range-picker", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholderText: { classPropertyName: "placeholderText", publicName: "placeholderText", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, inputReadonly: { classPropertyName: "inputReadonly", publicName: "inputReadonly", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, calendarIcon: { classPropertyName: "calendarIcon", publicName: "calendarIcon", isSignal: true, isRequired: false, transformFunction: null }, showCalendarButton: { classPropertyName: "showCalendarButton", publicName: "showCalendarButton", isSignal: true, isRequired: false, transformFunction: null }, showCheckbox: { classPropertyName: "showCheckbox", publicName: "showCheckbox", isSignal: true, isRequired: false, transformFunction: null }, checkboxChecked: { classPropertyName: "checkboxChecked", publicName: "checkboxChecked", isSignal: true, isRequired: false, transformFunction: null }, checkboxReadonly: { classPropertyName: "checkboxReadonly", publicName: "checkboxReadonly", isSignal: true, isRequired: false, transformFunction: null }, checkboxAriaLabel: { classPropertyName: "checkboxAriaLabel", publicName: "checkboxAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, checkboxPosition: { classPropertyName: "checkboxPosition", publicName: "checkboxPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateRangeSelected: "dateRangeSelected", pickerShow: "pickerShow", pickerHide: "pickerHide", pickerApply: "pickerApply", pickerCancel: "pickerCancel", checkboxChange: "checkboxChange" }, host: { properties: { "class.floating": "shouldLabelFloat", "id": "id" } }, providers: [
|
|
3647
|
+
{
|
|
3648
|
+
provide: NG_VALUE_ACCESSOR,
|
|
3649
|
+
useExisting: forwardRef(() => DateRangePicker),
|
|
3650
|
+
multi: true,
|
|
3651
|
+
},
|
|
3652
|
+
{
|
|
3653
|
+
provide: MatFormFieldControl,
|
|
3654
|
+
useExisting: DateRangePicker,
|
|
3655
|
+
},
|
|
3656
|
+
], viewQueries: [{ propertyName: "dateInput", first: true, predicate: ["dateInput"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
3657
|
+
<mat-form-field [appearance]="appearance()" class="full-width">
|
|
3658
|
+
@if (label()) {
|
|
3659
|
+
<mat-label>{{ label() }}</mat-label>
|
|
3660
|
+
}
|
|
3661
|
+
|
|
3662
|
+
<!-- Checkbox in prefix -->
|
|
3663
|
+
@if (showCheckbox() && checkboxPosition() === 'prefix') {
|
|
3664
|
+
<mat-checkbox
|
|
3665
|
+
matPrefix
|
|
3666
|
+
[checked]="checkboxChecked()"
|
|
3667
|
+
[disabled]="checkboxReadonly()"
|
|
3668
|
+
[aria-label]="checkboxAriaLabel()"
|
|
3669
|
+
(change)="onCheckboxToggle($event)"
|
|
3670
|
+
(click)="$event.stopPropagation()"
|
|
3671
|
+
></mat-checkbox>
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3674
|
+
<input
|
|
3675
|
+
#dateInput
|
|
3676
|
+
matInput
|
|
3677
|
+
type="text"
|
|
3678
|
+
[placeholder]="placeholderText()"
|
|
3679
|
+
[disabled]="isDisabled()"
|
|
3680
|
+
[readonly]="inputReadonly()"
|
|
3681
|
+
[id]="id"
|
|
3682
|
+
/>
|
|
3683
|
+
|
|
3684
|
+
<!-- Checkbox in suffix -->
|
|
3685
|
+
@if (showCheckbox() && checkboxPosition() === 'suffix') {
|
|
3686
|
+
<mat-checkbox
|
|
3687
|
+
matSuffix
|
|
3688
|
+
[checked]="checkboxChecked()"
|
|
3689
|
+
[disabled]="checkboxReadonly()"
|
|
3690
|
+
[aria-label]="checkboxAriaLabel()"
|
|
3691
|
+
(change)="onCheckboxToggle($event)"
|
|
3692
|
+
(click)="$event.stopPropagation()"
|
|
3693
|
+
></mat-checkbox>
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3696
|
+
<!-- Calendar icon button -->
|
|
3697
|
+
<!-- @if (showCalendarButton()) {
|
|
3698
|
+
<button
|
|
3699
|
+
mat-icon-button
|
|
3700
|
+
matSuffix
|
|
3701
|
+
type="button"
|
|
3702
|
+
(click)="toggle()"
|
|
3703
|
+
[attr.aria-label]="'Abrir selector de fechas'"
|
|
3704
|
+
>
|
|
3705
|
+
<mat-icon>{{ calendarIcon() }}</mat-icon>
|
|
3706
|
+
</button>
|
|
3707
|
+
} -->
|
|
3708
|
+
|
|
3709
|
+
@if (hint()) {
|
|
3710
|
+
<mat-hint>{{ hint() }}</mat-hint>
|
|
3711
|
+
}
|
|
3712
|
+
@if (errorState && errorMessage()) {
|
|
3713
|
+
<mat-error>{{ errorMessage() }}</mat-error>
|
|
3714
|
+
}
|
|
3715
|
+
</mat-form-field>
|
|
3716
|
+
`, isInline: true, styles: [".full-width{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$5.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1$5.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i1$5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }] });
|
|
3717
|
+
}
|
|
3718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DateRangePicker, decorators: [{
|
|
3719
|
+
type: Component,
|
|
3720
|
+
args: [{ selector: 'acp-date-range-picker', template: `
|
|
3721
|
+
<mat-form-field [appearance]="appearance()" class="full-width">
|
|
3722
|
+
@if (label()) {
|
|
3723
|
+
<mat-label>{{ label() }}</mat-label>
|
|
3724
|
+
}
|
|
3725
|
+
|
|
3726
|
+
<!-- Checkbox in prefix -->
|
|
3727
|
+
@if (showCheckbox() && checkboxPosition() === 'prefix') {
|
|
3728
|
+
<mat-checkbox
|
|
3729
|
+
matPrefix
|
|
3730
|
+
[checked]="checkboxChecked()"
|
|
3731
|
+
[disabled]="checkboxReadonly()"
|
|
3732
|
+
[aria-label]="checkboxAriaLabel()"
|
|
3733
|
+
(change)="onCheckboxToggle($event)"
|
|
3734
|
+
(click)="$event.stopPropagation()"
|
|
3735
|
+
></mat-checkbox>
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
<input
|
|
3739
|
+
#dateInput
|
|
3740
|
+
matInput
|
|
3741
|
+
type="text"
|
|
3742
|
+
[placeholder]="placeholderText()"
|
|
3743
|
+
[disabled]="isDisabled()"
|
|
3744
|
+
[readonly]="inputReadonly()"
|
|
3745
|
+
[id]="id"
|
|
3746
|
+
/>
|
|
3747
|
+
|
|
3748
|
+
<!-- Checkbox in suffix -->
|
|
3749
|
+
@if (showCheckbox() && checkboxPosition() === 'suffix') {
|
|
3750
|
+
<mat-checkbox
|
|
3751
|
+
matSuffix
|
|
3752
|
+
[checked]="checkboxChecked()"
|
|
3753
|
+
[disabled]="checkboxReadonly()"
|
|
3754
|
+
[aria-label]="checkboxAriaLabel()"
|
|
3755
|
+
(change)="onCheckboxToggle($event)"
|
|
3756
|
+
(click)="$event.stopPropagation()"
|
|
3757
|
+
></mat-checkbox>
|
|
3758
|
+
}
|
|
3759
|
+
|
|
3760
|
+
<!-- Calendar icon button -->
|
|
3761
|
+
<!-- @if (showCalendarButton()) {
|
|
3762
|
+
<button
|
|
3763
|
+
mat-icon-button
|
|
3764
|
+
matSuffix
|
|
3765
|
+
type="button"
|
|
3766
|
+
(click)="toggle()"
|
|
3767
|
+
[attr.aria-label]="'Abrir selector de fechas'"
|
|
3768
|
+
>
|
|
3769
|
+
<mat-icon>{{ calendarIcon() }}</mat-icon>
|
|
3770
|
+
</button>
|
|
3771
|
+
} -->
|
|
3772
|
+
|
|
3773
|
+
@if (hint()) {
|
|
3774
|
+
<mat-hint>{{ hint() }}</mat-hint>
|
|
3775
|
+
}
|
|
3776
|
+
@if (errorState && errorMessage()) {
|
|
3777
|
+
<mat-error>{{ errorMessage() }}</mat-error>
|
|
3778
|
+
}
|
|
3779
|
+
</mat-form-field>
|
|
3780
|
+
`, providers: [
|
|
3781
|
+
{
|
|
3782
|
+
provide: NG_VALUE_ACCESSOR,
|
|
3783
|
+
useExisting: forwardRef(() => DateRangePicker),
|
|
3784
|
+
multi: true,
|
|
3785
|
+
},
|
|
3786
|
+
{
|
|
3787
|
+
provide: MatFormFieldControl,
|
|
3788
|
+
useExisting: DateRangePicker,
|
|
3789
|
+
},
|
|
3790
|
+
], imports: [MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, MatCheckboxModule], host: {
|
|
3791
|
+
'[class.floating]': 'shouldLabelFloat',
|
|
3792
|
+
'[id]': 'id',
|
|
3793
|
+
}, styles: [".full-width{width:100%}\n"] }]
|
|
3794
|
+
}], ctorParameters: () => [], propDecorators: { dateInput: [{
|
|
3795
|
+
type: ViewChild,
|
|
3796
|
+
args: ['dateInput', { static: true }]
|
|
3797
|
+
}], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholderText: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholderText", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], inputReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputReadonly", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], calendarIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarIcon", required: false }] }], showCalendarButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCalendarButton", required: false }] }], showCheckbox: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCheckbox", required: false }] }], checkboxChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxChecked", required: false }] }], checkboxReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxReadonly", required: false }] }], checkboxAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxAriaLabel", required: false }] }], checkboxPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxPosition", required: false }] }], dateRangeSelected: [{ type: i0.Output, args: ["dateRangeSelected"] }], pickerShow: [{ type: i0.Output, args: ["pickerShow"] }], pickerHide: [{ type: i0.Output, args: ["pickerHide"] }], pickerApply: [{ type: i0.Output, args: ["pickerApply"] }], pickerCancel: [{ type: i0.Output, args: ["pickerCancel"] }], checkboxChange: [{ type: i0.Output, args: ["checkboxChange"] }] } });
|
|
3798
|
+
|
|
3799
|
+
// Angular component
|
|
3800
|
+
|
|
3342
3801
|
class ToUpperCase {
|
|
3343
3802
|
el = inject(ElementRef);
|
|
3344
3803
|
renderer = inject(Renderer2);
|
|
@@ -3476,5 +3935,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
3476
3935
|
* Generated bundle index. Do not edit.
|
|
3477
3936
|
*/
|
|
3478
3937
|
|
|
3479
|
-
export { AUTOCOMPLETE_WRAPPER_CUSTOMER_CONFIG, AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG, AUTOCOMPLETE_WRAPPER_LOCAL_CONFIG, AUTOCOMPLETE_WRAPPER_PAGINATED_CONFIG, AUTOCOMPLETE_WRAPPER_PRODUCT_CONFIG, AUTOCOMPLETE_WRAPPER_SIMPLE_CONFIG, AdvancedDialogService, AutocompleteWrapperService, Button, DATA_GRID_DEFAULT_OPTIONS, DataGrid, DialogWrapper, DynamicCard, DynamicSelect, GetTotalPipe, IconRegistryService, InputChip, OverlayService, Pagination, ReusableAutocompleteComponent, Spinner, StatusDisplayPipe, SvgIcon, TabulatorTable, ThemeSwitcher, ThemeToggle, ToUpperCase, UserIcon, createAutocompleteWrapperConfig };
|
|
3938
|
+
export { AUTOCOMPLETE_WRAPPER_CUSTOMER_CONFIG, AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG, AUTOCOMPLETE_WRAPPER_LOCAL_CONFIG, AUTOCOMPLETE_WRAPPER_PAGINATED_CONFIG, AUTOCOMPLETE_WRAPPER_PRODUCT_CONFIG, AUTOCOMPLETE_WRAPPER_SIMPLE_CONFIG, AdvancedDialogService, AutocompleteWrapperService, Button, DATA_GRID_DEFAULT_OPTIONS, DataGrid, DateRangePicker, DialogWrapper, DynamicCard, DynamicSelect, GetTotalPipe, IconRegistryService, InputChip, KeyboardNavigationService, OverlayService, Pagination, ReusableAutocompleteComponent, Spinner, StatusDisplayPipe, SvgIcon, TabulatorTable, ThemeSwitcher, ThemeToggle, ToUpperCase, UserIcon, createAutocompleteWrapperConfig };
|
|
3480
3939
|
//# sourceMappingURL=acontplus-ng-components.mjs.map
|