@acontplus/ng-components 2.1.4 → 2.1.6

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, forwardRef, 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, model, 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';
@@ -48,7 +48,7 @@ import * as i2$3 from '@angular/material/input';
48
48
  import { MatInputModule } from '@angular/material/input';
49
49
  import { Datex, SPANISH_LOCALE, DEFAULT_THEME, MATERIAL_THEME, BOOTSTRAP_THEME } from 'datex-ui';
50
50
  export { BOOTSTRAP_THEME, DEFAULT_THEME, Datex, MATERIAL_THEME, SPANISH_LOCALE, SPANISH_LOCALE_WITH_TIME } from 'datex-ui';
51
- import { addDay, monthStart, monthEnd, weekStart, weekEnd } from '@formkit/tempo';
51
+ import { tzDate, format, monthStart, addDay, monthEnd, weekStart, weekEnd } from '@formkit/tempo';
52
52
  import { TranslocoService } from '@jsverse/transloco';
53
53
 
54
54
  /**
@@ -3337,14 +3337,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
3337
3337
  args: ['document:keydown', ['$event']]
3338
3338
  }] } });
3339
3339
 
3340
+ /* ============================
3341
+ HELPERS
3342
+ ============================ */
3343
+ function formatDateToString(date) {
3344
+ const dateZone = tzDate(date, 'America/Guayaquil');
3345
+ return format({
3346
+ date: dateZone,
3347
+ format: 'YYYY-MM-DD hh:mm:ss A',
3348
+ tz: 'America/Guayaquil',
3349
+ });
3350
+ }
3351
+ /* ============================
3352
+ COMPONENT
3353
+ ============================ */
3340
3354
  class DateRangePicker {
3355
+ /* ============================
3356
+ MAT FORM FIELD
3357
+ ============================ */
3341
3358
  static nextId = 0;
3342
- dateInput;
3343
- // MatFormFieldControl implementation
3344
- stateChanges = new Subject();
3345
3359
  id = `acp-date-range-picker-${DateRangePicker.nextId++}`;
3346
3360
  controlType = 'acp-date-range-picker';
3361
+ stateChanges = new Subject();
3347
3362
  autofilled = false;
3363
+ dateInput;
3348
3364
  _focused = signal(false, ...(ngDevMode ? [{ debugName: "_focused" }] : []));
3349
3365
  _required = signal(false, ...(ngDevMode ? [{ debugName: "_required" }] : []));
3350
3366
  _value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
@@ -3360,6 +3376,10 @@ class DateRangePicker {
3360
3376
  get required() {
3361
3377
  return this._required();
3362
3378
  }
3379
+ _errorState = false;
3380
+ get errorState() {
3381
+ return this._errorState;
3382
+ }
3363
3383
  get value() {
3364
3384
  return this._value();
3365
3385
  }
@@ -3367,14 +3387,6 @@ class DateRangePicker {
3367
3387
  this._value.set(val);
3368
3388
  this.stateChanges.next();
3369
3389
  }
3370
- _errorState = false;
3371
- currentDate = new Date();
3372
- get errorState() {
3373
- return this._errorState;
3374
- }
3375
- get userAriaDescribedBy() {
3376
- return undefined;
3377
- }
3378
3390
  get placeholder() {
3379
3391
  return this.placeholderText();
3380
3392
  }
@@ -3382,9 +3394,21 @@ class DateRangePicker {
3382
3394
  return this.isDisabled();
3383
3395
  }
3384
3396
  ngControl = null;
3385
- // Configuration inputs
3397
+ setDescribedByIds(_ids) {
3398
+ // Implementation for accessibility
3399
+ }
3400
+ onContainerClick() {
3401
+ this.focus();
3402
+ }
3403
+ focus() {
3404
+ this.dateInput.nativeElement.focus();
3405
+ this._focused.set(true);
3406
+ this.stateChanges.next();
3407
+ }
3408
+ /* ============================
3409
+ INPUTS
3410
+ ============================ */
3386
3411
  options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
3387
- // UI inputs
3388
3412
  placeholderText = input('Seleccionar rango de fechas', ...(ngDevMode ? [{ debugName: "placeholderText" }] : []));
3389
3413
  isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
3390
3414
  inputReadonly = input(false, ...(ngDevMode ? [{ debugName: "inputReadonly" }] : []));
@@ -3392,164 +3416,101 @@ class DateRangePicker {
3392
3416
  hint = input(...(ngDevMode ? [undefined, { debugName: "hint" }] : []));
3393
3417
  errorMessage = input(...(ngDevMode ? [undefined, { debugName: "errorMessage" }] : []));
3394
3418
  appearance = input('outline', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
3395
- // Icon inputs
3419
+ formatOutputAsString = input(true, ...(ngDevMode ? [{ debugName: "formatOutputAsString" }] : []));
3396
3420
  calendarIcon = input('date_range', ...(ngDevMode ? [{ debugName: "calendarIcon" }] : []));
3397
3421
  showCalendarButton = input(false, ...(ngDevMode ? [{ debugName: "showCalendarButton" }] : []));
3398
- // Checkbox functionality
3399
3422
  showCheckbox = input(false, ...(ngDevMode ? [{ debugName: "showCheckbox" }] : []));
3400
- checkboxChecked = input(false, ...(ngDevMode ? [{ debugName: "checkboxChecked" }] : []));
3423
+ checkboxChecked = model(false, ...(ngDevMode ? [{ debugName: "checkboxChecked" }] : []));
3401
3424
  checkboxReadonly = input(false, ...(ngDevMode ? [{ debugName: "checkboxReadonly" }] : []));
3402
3425
  checkboxAriaLabel = input('Toggle selection', ...(ngDevMode ? [{ debugName: "checkboxAriaLabel" }] : []));
3403
3426
  checkboxPosition = input('suffix', ...(ngDevMode ? [{ debugName: "checkboxPosition" }] : []));
3404
- // Events
3427
+ /* ============================
3428
+ OUTPUTS
3429
+ ============================ */
3405
3430
  dateRangeSelected = output();
3406
3431
  pickerShow = output();
3407
3432
  pickerHide = output();
3408
3433
  pickerApply = output();
3409
3434
  pickerCancel = output();
3410
3435
  checkboxChange = output();
3411
- // Internal state
3436
+ /* ============================
3437
+ INTERNAL
3438
+ ============================ */
3412
3439
  picker;
3413
- isInitialized = signal(false, ...(ngDevMode ? [{ debugName: "isInitialized" }] : []));
3414
- // ControlValueAccessor implementation
3440
+ currentDate = new Date();
3415
3441
  onChange = (_value) => {
3416
3442
  // This will be replaced by registerOnChange
3417
3443
  };
3418
3444
  onTouched = () => {
3419
3445
  // This will be replaced by registerOnTouched
3420
3446
  };
3421
- constructor() {
3422
- // No effect here to avoid infinite loops - using ngOnChanges instead
3423
- }
3447
+ /* ============================
3448
+ LIFECYCLE
3449
+ ============================ */
3424
3450
  ngOnInit() {
3425
3451
  this.initializePicker();
3426
- this.isInitialized.set(true);
3427
3452
  }
3428
3453
  ngOnChanges(changes) {
3429
- if (changes['options'] && !changes['options'].isFirstChange()) {
3430
- if (this.picker) {
3431
- this.updateOptions();
3432
- }
3454
+ if (changes['options'] && this.picker) {
3455
+ this.reinitializePicker();
3433
3456
  }
3434
3457
  }
3435
3458
  ngOnDestroy() {
3436
- if (this.picker) {
3437
- this.picker.remove();
3438
- }
3459
+ this.picker?.remove();
3439
3460
  this.stateChanges.complete();
3440
3461
  }
3441
- setDescribedByIds(_ids) {
3442
- // Implementation for accessibility
3443
- }
3444
- onContainerClick(_event) {
3445
- if (!this.focused) {
3446
- this.focus();
3447
- }
3448
- }
3449
- focus() {
3450
- this.dateInput.nativeElement.focus();
3451
- this._focused.set(true);
3452
- this.stateChanges.next();
3453
- }
3454
- blur() {
3455
- this._focused.set(false);
3456
- this.onTouched();
3457
- this.stateChanges.next();
3462
+ /* ============================
3463
+ DATE LOGIC
3464
+ ============================ */
3465
+ mapDate(date) {
3466
+ return this.formatOutputAsString()
3467
+ ? formatDateToString(date)
3468
+ : date;
3458
3469
  }
3459
3470
  initializePicker() {
3460
- const options = this.buildDatexOptions();
3461
- this.picker = new Datex(this.dateInput.nativeElement, options, (startDate, endDate, label) => {
3462
- const opts = this.options();
3463
- const value = opts.singleDatePicker ? startDate : { startDate, endDate };
3464
- this._value.set(value);
3465
- this.onChange(value);
3471
+ this.picker = new Datex(this.dateInput.nativeElement, this.buildDatexOptions(), (start, end, label) => {
3472
+ const range = {
3473
+ from: this.mapDate(start),
3474
+ to: this.mapDate(end),
3475
+ label,
3476
+ };
3477
+ this._value.set(range);
3478
+ this.onChange(range);
3466
3479
  this.onTouched();
3467
- this.dateRangeSelected.emit({ startDate, endDate, label });
3480
+ this.dateRangeSelected.emit(range);
3468
3481
  this.stateChanges.next();
3469
3482
  });
3470
3483
  this.setupEventListeners();
3471
3484
  }
3472
- updateOptions() {
3473
- if (!this.picker)
3474
- return;
3475
- // Try to use native updateOptions if available
3476
- if (typeof this.picker.updateOptions === 'function') {
3477
- const newOptions = this.buildDatexOptions();
3478
- this.picker.updateOptions(newOptions);
3479
- }
3480
- else {
3481
- // Fallback to reinitialize if updateOptions is not available
3482
- this.reinitializePicker();
3483
- }
3484
- }
3485
3485
  reinitializePicker() {
3486
- if (!this.isInitialized())
3487
- return;
3488
- const currentValue = this._value();
3489
- if (this.picker) {
3490
- this.picker.remove();
3491
- this.picker = undefined;
3492
- }
3486
+ const value = this._value();
3487
+ this.picker?.remove();
3493
3488
  this.initializePicker();
3494
- if (currentValue) {
3495
- setTimeout(() => {
3496
- this.writeValue(currentValue);
3497
- }, 0);
3489
+ if (value) {
3490
+ this.writeValue(value);
3498
3491
  }
3499
3492
  }
3500
3493
  buildDatexOptions() {
3501
3494
  const opts = this.options();
3502
- const today = new Date();
3503
- const defaultOptions = {
3504
- startDate: today,
3505
- endDate: today,
3506
- autoApply: false,
3507
- singleDatePicker: false,
3508
- showDropdowns: true,
3509
- linkedCalendars: true,
3510
- autoUpdateInput: true,
3511
- alwaysShowCalendars: false,
3512
- showCustomRangeLabel: true,
3513
- timePicker: false,
3514
- timePicker24Hour: true,
3515
- timePickerIncrement: 1,
3516
- timePickerSeconds: false,
3517
- ranges: this.getDefaultRanges(),
3518
- opens: 'center',
3519
- drops: 'auto',
3495
+ const userOptions = { ...opts };
3496
+ delete userOptions.presetTheme;
3497
+ return {
3498
+ startDate: this.currentDate,
3499
+ endDate: this.currentDate,
3520
3500
  locale: SPANISH_LOCALE,
3521
- buttonClasses: 'btn btn-sm',
3522
- applyButtonClasses: 'btn-success',
3523
- cancelButtonClasses: 'btn-danger',
3501
+ ranges: this.getDefaultRanges(),
3524
3502
  theme: this.getTheme(),
3525
- };
3526
- // Merge user options with defaults, excluding presetTheme
3527
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
3528
- const { presetTheme, ...userOptions } = opts;
3529
- // Merge ranges: user ranges override defaults
3530
- const mergedRanges = {
3531
- ...defaultOptions.ranges,
3532
- ...(userOptions.ranges || {}),
3533
- };
3534
- return {
3535
- ...defaultOptions,
3536
3503
  ...userOptions,
3537
- ranges: mergedRanges,
3538
- // Always use getTheme() to handle presetTheme properly
3539
- theme: this.getTheme(),
3540
3504
  };
3541
3505
  }
3542
- getDateAddDay(day) {
3543
- return addDay(this.currentDate, day);
3544
- }
3545
3506
  getDefaultRanges() {
3546
3507
  return {
3547
3508
  Hoy: [this.currentDate, this.currentDate],
3548
- Ayer: [this.getDateAddDay(-1), this.getDateAddDay(-1)],
3549
- 'Últimos 5 días': [this.getDateAddDay(-4), this.currentDate],
3550
- 'Últimos 10 días': [this.getDateAddDay(-9), this.currentDate],
3551
- 'Últimos 15 días': [this.getDateAddDay(-14), this.currentDate],
3552
- 'Últimos 30 días': [this.getDateAddDay(-29), this.currentDate],
3509
+ Ayer: [addDay(this.currentDate, -1), addDay(this.currentDate, -1)],
3510
+ 'Últimos 5 días': [addDay(this.currentDate, -4), this.currentDate],
3511
+ 'Últimos 10 días': [addDay(this.currentDate, -9), this.currentDate],
3512
+ 'Últimos 15 días': [addDay(this.currentDate, -14), this.currentDate],
3513
+ 'Últimos 30 días': [addDay(this.currentDate, -29), this.currentDate],
3553
3514
  'Esta semana': [weekStart(this.currentDate), weekEnd(this.currentDate)],
3554
3515
  'Este mes': [monthStart(this.currentDate), monthEnd(this.currentDate)],
3555
3516
  'El mes pasado': [
@@ -3573,21 +3534,11 @@ class DateRangePicker {
3573
3534
  }
3574
3535
  }
3575
3536
  setupEventListeners() {
3576
- if (!this.picker)
3577
- return;
3578
3537
  const input = this.dateInput.nativeElement;
3579
- input.addEventListener('show.daterangepicker', () => {
3580
- this.pickerShow.emit();
3581
- });
3582
- input.addEventListener('hide.daterangepicker', () => {
3583
- this.pickerHide.emit();
3584
- });
3585
- input.addEventListener('apply.daterangepicker', () => {
3586
- this.pickerApply.emit();
3587
- });
3588
- input.addEventListener('cancel.daterangepicker', () => {
3589
- this.pickerCancel.emit();
3590
- });
3538
+ input.addEventListener('show.daterangepicker', () => this.pickerShow.emit());
3539
+ input.addEventListener('hide.daterangepicker', () => this.pickerHide.emit());
3540
+ input.addEventListener('apply.daterangepicker', () => this.pickerApply.emit());
3541
+ input.addEventListener('cancel.daterangepicker', () => this.pickerCancel.emit());
3591
3542
  input.addEventListener('focus', () => {
3592
3543
  this._focused.set(true);
3593
3544
  this.stateChanges.next();
@@ -3598,23 +3549,11 @@ class DateRangePicker {
3598
3549
  this.stateChanges.next();
3599
3550
  });
3600
3551
  }
3552
+ /* ============================
3553
+ CVA
3554
+ ============================ */
3601
3555
  writeValue(value) {
3602
3556
  this._value.set(value);
3603
- if (!this.picker)
3604
- return;
3605
- if (value) {
3606
- const opts = this.options();
3607
- if (opts.singleDatePicker) {
3608
- const date = value instanceof Date ? value : new Date(value);
3609
- this.picker.setStartDate(date);
3610
- this.picker.setEndDate(date);
3611
- }
3612
- else if (value.startDate && value.endDate) {
3613
- this.picker.setStartDate(new Date(value.startDate));
3614
- this.picker.setEndDate(new Date(value.endDate));
3615
- }
3616
- }
3617
- this.stateChanges.next();
3618
3557
  }
3619
3558
  registerOnChange(fn) {
3620
3559
  this.onChange = fn;
@@ -3623,10 +3562,11 @@ class DateRangePicker {
3623
3562
  this.onTouched = fn;
3624
3563
  }
3625
3564
  setDisabledState(isDisabled) {
3626
- if (this.dateInput) {
3627
- this.dateInput.nativeElement.disabled = isDisabled;
3628
- }
3565
+ this.dateInput.nativeElement.disabled = isDisabled;
3629
3566
  }
3567
+ /* ============================
3568
+ UI API
3569
+ ============================ */
3630
3570
  show() {
3631
3571
  this.picker?.show();
3632
3572
  }
@@ -3636,41 +3576,13 @@ class DateRangePicker {
3636
3576
  toggle() {
3637
3577
  this.picker?.toggle();
3638
3578
  }
3639
- getStartDate() {
3640
- return this.picker?.getStartDate() || null;
3641
- }
3642
- getEndDate() {
3643
- return this.picker?.getEndDate() || null;
3644
- }
3645
- setStartDate(date) {
3646
- this.picker?.setStartDate(date);
3647
- }
3648
- setEndDate(date) {
3649
- this.picker?.setEndDate(date);
3650
- }
3651
- updateTheme(theme) {
3652
- this.picker?.setTheme({ ...this.getTheme(), ...theme });
3653
- }
3654
- updateRanges(ranges) {
3655
- if (this.picker && 'updateRanges' in this.picker) {
3656
- this.picker.updateRanges(ranges);
3657
- }
3658
- }
3659
- updateConfiguration() {
3660
- this.reinitializePicker();
3661
- }
3662
- forceReinitialize() {
3663
- this.reinitializePicker();
3664
- }
3665
3579
  onCheckboxToggle(event) {
3666
- if (this.checkboxReadonly()) {
3667
- return;
3580
+ if (!this.checkboxReadonly()) {
3581
+ this.checkboxChange.emit(event.checked);
3668
3582
  }
3669
- const newValue = event.checked;
3670
- this.checkboxChange.emit(newValue);
3671
3583
  }
3672
3584
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DateRangePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
3673
- 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: [
3585
+ 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 }, formatOutputAsString: { classPropertyName: "formatOutputAsString", publicName: "formatOutputAsString", 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: { checkboxChecked: "checkboxCheckedChange", dateRangeSelected: "dateRangeSelected", pickerShow: "pickerShow", pickerHide: "pickerHide", pickerApply: "pickerApply", pickerCancel: "pickerCancel", checkboxChange: "checkboxChange" }, host: { properties: { "class.floating": "shouldLabelFloat", "id": "id" } }, providers: [
3674
3586
  {
3675
3587
  provide: NG_VALUE_ACCESSOR,
3676
3588
  useExisting: forwardRef(() => DateRangePicker),
@@ -3686,7 +3598,7 @@ class DateRangePicker {
3686
3598
  <mat-label>{{ label() }}</mat-label>
3687
3599
  }
3688
3600
 
3689
- <!-- Checkbox in prefix -->
3601
+ <!-- Checkbox prefix -->
3690
3602
  @if (showCheckbox() && checkboxPosition() === 'prefix') {
3691
3603
  <mat-checkbox
3692
3604
  matPrefix
@@ -3705,10 +3617,9 @@ class DateRangePicker {
3705
3617
  [placeholder]="placeholderText()"
3706
3618
  [disabled]="isDisabled()"
3707
3619
  [readonly]="inputReadonly()"
3708
- [id]="id"
3709
3620
  />
3710
3621
 
3711
- <!-- Checkbox in suffix -->
3622
+ <!-- Checkbox suffix -->
3712
3623
  @if (showCheckbox() && checkboxPosition() === 'suffix') {
3713
3624
  <mat-checkbox
3714
3625
  matSuffix
@@ -3720,22 +3631,10 @@ class DateRangePicker {
3720
3631
  ></mat-checkbox>
3721
3632
  }
3722
3633
 
3723
- <!-- Calendar icon button -->
3724
- <!-- @if (showCalendarButton()) {
3725
- <button
3726
- mat-icon-button
3727
- matSuffix
3728
- type="button"
3729
- (click)="toggle()"
3730
- [attr.aria-label]="'Abrir selector de fechas'"
3731
- >
3732
- <mat-icon>{{ calendarIcon() }}</mat-icon>
3733
- </button>
3734
- } -->
3735
-
3736
3634
  @if (hint()) {
3737
3635
  <mat-hint>{{ hint() }}</mat-hint>
3738
3636
  }
3637
+
3739
3638
  @if (errorState && errorMessage()) {
3740
3639
  <mat-error>{{ errorMessage() }}</mat-error>
3741
3640
  }
@@ -3744,13 +3643,26 @@ class DateRangePicker {
3744
3643
  }
3745
3644
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DateRangePicker, decorators: [{
3746
3645
  type: Component,
3747
- args: [{ selector: 'acp-date-range-picker', template: `
3646
+ args: [{ selector: 'acp-date-range-picker', standalone: true, imports: [MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, MatCheckboxModule], providers: [
3647
+ {
3648
+ provide: NG_VALUE_ACCESSOR,
3649
+ useExisting: forwardRef(() => DateRangePicker),
3650
+ multi: true,
3651
+ },
3652
+ {
3653
+ provide: MatFormFieldControl,
3654
+ useExisting: DateRangePicker,
3655
+ },
3656
+ ], host: {
3657
+ '[class.floating]': 'shouldLabelFloat',
3658
+ '[id]': 'id',
3659
+ }, template: `
3748
3660
  <mat-form-field [appearance]="appearance()" class="full-width">
3749
3661
  @if (label()) {
3750
3662
  <mat-label>{{ label() }}</mat-label>
3751
3663
  }
3752
3664
 
3753
- <!-- Checkbox in prefix -->
3665
+ <!-- Checkbox prefix -->
3754
3666
  @if (showCheckbox() && checkboxPosition() === 'prefix') {
3755
3667
  <mat-checkbox
3756
3668
  matPrefix
@@ -3769,10 +3681,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
3769
3681
  [placeholder]="placeholderText()"
3770
3682
  [disabled]="isDisabled()"
3771
3683
  [readonly]="inputReadonly()"
3772
- [id]="id"
3773
3684
  />
3774
3685
 
3775
- <!-- Checkbox in suffix -->
3686
+ <!-- Checkbox suffix -->
3776
3687
  @if (showCheckbox() && checkboxPosition() === 'suffix') {
3777
3688
  <mat-checkbox
3778
3689
  matSuffix
@@ -3784,44 +3695,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
3784
3695
  ></mat-checkbox>
3785
3696
  }
3786
3697
 
3787
- <!-- Calendar icon button -->
3788
- <!-- @if (showCalendarButton()) {
3789
- <button
3790
- mat-icon-button
3791
- matSuffix
3792
- type="button"
3793
- (click)="toggle()"
3794
- [attr.aria-label]="'Abrir selector de fechas'"
3795
- >
3796
- <mat-icon>{{ calendarIcon() }}</mat-icon>
3797
- </button>
3798
- } -->
3799
-
3800
3698
  @if (hint()) {
3801
3699
  <mat-hint>{{ hint() }}</mat-hint>
3802
3700
  }
3701
+
3803
3702
  @if (errorState && errorMessage()) {
3804
3703
  <mat-error>{{ errorMessage() }}</mat-error>
3805
3704
  }
3806
3705
  </mat-form-field>
3807
- `, providers: [
3808
- {
3809
- provide: NG_VALUE_ACCESSOR,
3810
- useExisting: forwardRef(() => DateRangePicker),
3811
- multi: true,
3812
- },
3813
- {
3814
- provide: MatFormFieldControl,
3815
- useExisting: DateRangePicker,
3816
- },
3817
- ], imports: [MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, MatCheckboxModule], host: {
3818
- '[class.floating]': 'shouldLabelFloat',
3819
- '[id]': 'id',
3820
- }, styles: [".full-width{width:100%}\n"] }]
3821
- }], ctorParameters: () => [], propDecorators: { dateInput: [{
3706
+ `, styles: [".full-width{width:100%}\n"] }]
3707
+ }], propDecorators: { dateInput: [{
3822
3708
  type: ViewChild,
3823
3709
  args: ['dateInput', { static: true }]
3824
- }], 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"] }] } });
3710
+ }], 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 }] }], formatOutputAsString: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatOutputAsString", 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 }] }, { type: i0.Output, args: ["checkboxCheckedChange"] }], 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"] }] } });
3825
3711
 
3826
3712
  // Angular component
3827
3713