@acontplus/ng-components 2.1.3 → 2.1.5

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.
@@ -48,6 +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 { tzDate, format, monthStart, addDay, monthEnd, weekStart, weekEnd } from '@formkit/tempo';
51
52
  import { TranslocoService } from '@jsverse/transloco';
52
53
 
53
54
  /**
@@ -3336,14 +3337,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
3336
3337
  args: ['document:keydown', ['$event']]
3337
3338
  }] } });
3338
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
+ ============================ */
3339
3354
  class DateRangePicker {
3355
+ /* ============================
3356
+ MAT FORM FIELD
3357
+ ============================ */
3340
3358
  static nextId = 0;
3341
- dateInput;
3342
- // MatFormFieldControl implementation
3343
- stateChanges = new Subject();
3344
3359
  id = `acp-date-range-picker-${DateRangePicker.nextId++}`;
3345
3360
  controlType = 'acp-date-range-picker';
3361
+ stateChanges = new Subject();
3346
3362
  autofilled = false;
3363
+ dateInput;
3347
3364
  _focused = signal(false, ...(ngDevMode ? [{ debugName: "_focused" }] : []));
3348
3365
  _required = signal(false, ...(ngDevMode ? [{ debugName: "_required" }] : []));
3349
3366
  _value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
@@ -3359,6 +3376,10 @@ class DateRangePicker {
3359
3376
  get required() {
3360
3377
  return this._required();
3361
3378
  }
3379
+ _errorState = false;
3380
+ get errorState() {
3381
+ return this._errorState;
3382
+ }
3362
3383
  get value() {
3363
3384
  return this._value();
3364
3385
  }
@@ -3366,13 +3387,6 @@ class DateRangePicker {
3366
3387
  this._value.set(val);
3367
3388
  this.stateChanges.next();
3368
3389
  }
3369
- _errorState = false;
3370
- get errorState() {
3371
- return this._errorState;
3372
- }
3373
- get userAriaDescribedBy() {
3374
- return undefined;
3375
- }
3376
3390
  get placeholder() {
3377
3391
  return this.placeholderText();
3378
3392
  }
@@ -3380,9 +3394,21 @@ class DateRangePicker {
3380
3394
  return this.isDisabled();
3381
3395
  }
3382
3396
  ngControl = null;
3383
- // 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
+ ============================ */
3384
3411
  options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
3385
- // UI inputs
3386
3412
  placeholderText = input('Seleccionar rango de fechas', ...(ngDevMode ? [{ debugName: "placeholderText" }] : []));
3387
3413
  isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
3388
3414
  inputReadonly = input(false, ...(ngDevMode ? [{ debugName: "inputReadonly" }] : []));
@@ -3390,185 +3416,107 @@ class DateRangePicker {
3390
3416
  hint = input(...(ngDevMode ? [undefined, { debugName: "hint" }] : []));
3391
3417
  errorMessage = input(...(ngDevMode ? [undefined, { debugName: "errorMessage" }] : []));
3392
3418
  appearance = input('outline', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
3393
- // Icon inputs
3419
+ formatOutputAsString = input(true, ...(ngDevMode ? [{ debugName: "formatOutputAsString" }] : []));
3394
3420
  calendarIcon = input('date_range', ...(ngDevMode ? [{ debugName: "calendarIcon" }] : []));
3395
3421
  showCalendarButton = input(false, ...(ngDevMode ? [{ debugName: "showCalendarButton" }] : []));
3396
- // Checkbox functionality
3397
3422
  showCheckbox = input(false, ...(ngDevMode ? [{ debugName: "showCheckbox" }] : []));
3398
3423
  checkboxChecked = input(false, ...(ngDevMode ? [{ debugName: "checkboxChecked" }] : []));
3399
3424
  checkboxReadonly = input(false, ...(ngDevMode ? [{ debugName: "checkboxReadonly" }] : []));
3400
3425
  checkboxAriaLabel = input('Toggle selection', ...(ngDevMode ? [{ debugName: "checkboxAriaLabel" }] : []));
3401
3426
  checkboxPosition = input('suffix', ...(ngDevMode ? [{ debugName: "checkboxPosition" }] : []));
3402
- // Events
3427
+ /* ============================
3428
+ OUTPUTS
3429
+ ============================ */
3403
3430
  dateRangeSelected = output();
3404
3431
  pickerShow = output();
3405
3432
  pickerHide = output();
3406
3433
  pickerApply = output();
3407
3434
  pickerCancel = output();
3408
3435
  checkboxChange = output();
3409
- // Internal state
3436
+ /* ============================
3437
+ INTERNAL
3438
+ ============================ */
3410
3439
  picker;
3411
- isInitialized = signal(false, ...(ngDevMode ? [{ debugName: "isInitialized" }] : []));
3412
- // ControlValueAccessor implementation
3440
+ currentDate = new Date();
3413
3441
  onChange = (_value) => {
3414
3442
  // This will be replaced by registerOnChange
3415
3443
  };
3416
3444
  onTouched = () => {
3417
3445
  // This will be replaced by registerOnTouched
3418
3446
  };
3419
- constructor() {
3420
- // No effect here to avoid infinite loops - using ngOnChanges instead
3421
- }
3447
+ /* ============================
3448
+ LIFECYCLE
3449
+ ============================ */
3422
3450
  ngOnInit() {
3423
3451
  this.initializePicker();
3424
- this.isInitialized.set(true);
3425
3452
  }
3426
3453
  ngOnChanges(changes) {
3427
- if (changes['options'] && !changes['options'].isFirstChange()) {
3428
- if (this.picker) {
3429
- this.updateOptions();
3430
- }
3454
+ if (changes['options'] && this.picker) {
3455
+ this.reinitializePicker();
3431
3456
  }
3432
3457
  }
3433
3458
  ngOnDestroy() {
3434
- if (this.picker) {
3435
- this.picker.remove();
3436
- }
3459
+ this.picker?.remove();
3437
3460
  this.stateChanges.complete();
3438
3461
  }
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();
3462
+ /* ============================
3463
+ DATE LOGIC
3464
+ ============================ */
3465
+ mapDate(date) {
3466
+ return this.formatOutputAsString()
3467
+ ? formatDateToString(date)
3468
+ : date;
3456
3469
  }
3457
3470
  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);
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);
3464
3479
  this.onTouched();
3465
- this.dateRangeSelected.emit({ startDate, endDate, label });
3480
+ this.dateRangeSelected.emit(range);
3466
3481
  this.stateChanges.next();
3467
3482
  });
3468
3483
  this.setupEventListeners();
3469
3484
  }
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
3485
  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
- }
3486
+ const value = this._value();
3487
+ this.picker?.remove();
3491
3488
  this.initializePicker();
3492
- if (currentValue) {
3493
- setTimeout(() => {
3494
- this.writeValue(currentValue);
3495
- }, 0);
3489
+ if (value) {
3490
+ this.writeValue(value);
3496
3491
  }
3497
3492
  }
3498
3493
  buildDatexOptions() {
3499
3494
  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: this.getDefaultRanges(),
3516
- opens: 'center',
3517
- drops: 'auto',
3495
+ const userOptions = { ...opts };
3496
+ delete userOptions.presetTheme;
3497
+ return {
3498
+ startDate: this.currentDate,
3499
+ endDate: this.currentDate,
3518
3500
  locale: SPANISH_LOCALE,
3519
- buttonClasses: 'btn btn-sm',
3520
- applyButtonClasses: 'btn-success',
3521
- cancelButtonClasses: 'btn-danger',
3501
+ ranges: this.getDefaultRanges(),
3522
3502
  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
- // Merge ranges: user ranges override defaults
3528
- const mergedRanges = {
3529
- ...defaultOptions.ranges,
3530
- ...(userOptions.ranges || {}),
3531
- };
3532
- return {
3533
- ...defaultOptions,
3534
3503
  ...userOptions,
3535
- ranges: mergedRanges,
3536
- // Always use getTheme() to handle presetTheme properly
3537
- theme: this.getTheme(),
3538
3504
  };
3539
3505
  }
3540
3506
  getDefaultRanges() {
3541
- const today = new Date();
3542
- const yesterday = new Date(today);
3543
- yesterday.setDate(today.getDate() - 1);
3544
- const last5Days = new Date(today);
3545
- last5Days.setDate(today.getDate() - 4);
3546
- const last10Days = new Date(today);
3547
- last10Days.setDate(today.getDate() - 9);
3548
- const last15Days = new Date(today);
3549
- last15Days.setDate(today.getDate() - 14);
3550
- const last30Days = new Date(today);
3551
- last30Days.setDate(today.getDate() - 29);
3552
- // Esta semana (lunes a domingo)
3553
- const startOfWeek = new Date(today);
3554
- const dayOfWeek = today.getDay();
3555
- const daysToMonday = dayOfWeek === 0 ? 6 : dayOfWeek - 1; // Domingo = 0, necesitamos ir 6 días atrás
3556
- startOfWeek.setDate(today.getDate() - daysToMonday);
3557
- // Este mes
3558
- const startOfMonth = new Date(today.getFullYear(), today.getMonth(), 1);
3559
- // El mes pasado
3560
- const startOfLastMonth = new Date(today.getFullYear(), today.getMonth() - 1, 1);
3561
- const endOfLastMonth = new Date(today.getFullYear(), today.getMonth(), 0);
3562
3507
  return {
3563
- Hoy: [today, today],
3564
- Ayer: [yesterday, yesterday],
3565
- 'Últimos 5 días': [last5Days, today],
3566
- 'Últimos 10 días': [last10Days, today],
3567
- 'Últimos 15 días': [last15Days, today],
3568
- 'Últimos 30 días': [last30Days, today],
3569
- 'Esta semana': [startOfWeek, today],
3570
- 'Este mes': [startOfMonth, today],
3571
- 'El mes pasado': [startOfLastMonth, endOfLastMonth],
3508
+ Hoy: [this.currentDate, 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],
3514
+ 'Esta semana': [weekStart(this.currentDate), weekEnd(this.currentDate)],
3515
+ 'Este mes': [monthStart(this.currentDate), monthEnd(this.currentDate)],
3516
+ 'El mes pasado': [
3517
+ monthStart(addDay(monthStart(this.currentDate), -1)),
3518
+ addDay(monthStart(this.currentDate), -1),
3519
+ ],
3572
3520
  };
3573
3521
  }
3574
3522
  getTheme() {
@@ -3586,21 +3534,11 @@ class DateRangePicker {
3586
3534
  }
3587
3535
  }
3588
3536
  setupEventListeners() {
3589
- if (!this.picker)
3590
- return;
3591
3537
  const input = this.dateInput.nativeElement;
3592
- input.addEventListener('show.daterangepicker', () => {
3593
- this.pickerShow.emit();
3594
- });
3595
- input.addEventListener('hide.daterangepicker', () => {
3596
- this.pickerHide.emit();
3597
- });
3598
- input.addEventListener('apply.daterangepicker', () => {
3599
- this.pickerApply.emit();
3600
- });
3601
- input.addEventListener('cancel.daterangepicker', () => {
3602
- this.pickerCancel.emit();
3603
- });
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());
3604
3542
  input.addEventListener('focus', () => {
3605
3543
  this._focused.set(true);
3606
3544
  this.stateChanges.next();
@@ -3611,23 +3549,11 @@ class DateRangePicker {
3611
3549
  this.stateChanges.next();
3612
3550
  });
3613
3551
  }
3552
+ /* ============================
3553
+ CVA
3554
+ ============================ */
3614
3555
  writeValue(value) {
3615
3556
  this._value.set(value);
3616
- if (!this.picker)
3617
- return;
3618
- if (value) {
3619
- const opts = this.options();
3620
- if (opts.singleDatePicker) {
3621
- const date = value instanceof Date ? value : new Date(value);
3622
- this.picker.setStartDate(date);
3623
- this.picker.setEndDate(date);
3624
- }
3625
- else if (value.startDate && value.endDate) {
3626
- this.picker.setStartDate(new Date(value.startDate));
3627
- this.picker.setEndDate(new Date(value.endDate));
3628
- }
3629
- }
3630
- this.stateChanges.next();
3631
3557
  }
3632
3558
  registerOnChange(fn) {
3633
3559
  this.onChange = fn;
@@ -3636,10 +3562,11 @@ class DateRangePicker {
3636
3562
  this.onTouched = fn;
3637
3563
  }
3638
3564
  setDisabledState(isDisabled) {
3639
- if (this.dateInput) {
3640
- this.dateInput.nativeElement.disabled = isDisabled;
3641
- }
3565
+ this.dateInput.nativeElement.disabled = isDisabled;
3642
3566
  }
3567
+ /* ============================
3568
+ UI API
3569
+ ============================ */
3643
3570
  show() {
3644
3571
  this.picker?.show();
3645
3572
  }
@@ -3649,41 +3576,13 @@ class DateRangePicker {
3649
3576
  toggle() {
3650
3577
  this.picker?.toggle();
3651
3578
  }
3652
- getStartDate() {
3653
- return this.picker?.getStartDate() || null;
3654
- }
3655
- getEndDate() {
3656
- return this.picker?.getEndDate() || null;
3657
- }
3658
- setStartDate(date) {
3659
- this.picker?.setStartDate(date);
3660
- }
3661
- setEndDate(date) {
3662
- this.picker?.setEndDate(date);
3663
- }
3664
- updateTheme(theme) {
3665
- this.picker?.setTheme({ ...this.getTheme(), ...theme });
3666
- }
3667
- updateRanges(ranges) {
3668
- if (this.picker && 'updateRanges' in this.picker) {
3669
- this.picker.updateRanges(ranges);
3670
- }
3671
- }
3672
- updateConfiguration() {
3673
- this.reinitializePicker();
3674
- }
3675
- forceReinitialize() {
3676
- this.reinitializePicker();
3677
- }
3678
3579
  onCheckboxToggle(event) {
3679
- if (this.checkboxReadonly()) {
3680
- return;
3580
+ if (!this.checkboxReadonly()) {
3581
+ this.checkboxChange.emit(event.checked);
3681
3582
  }
3682
- const newValue = event.checked;
3683
- this.checkboxChange.emit(newValue);
3684
3583
  }
3685
3584
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DateRangePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
3686
- 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: { dateRangeSelected: "dateRangeSelected", pickerShow: "pickerShow", pickerHide: "pickerHide", pickerApply: "pickerApply", pickerCancel: "pickerCancel", checkboxChange: "checkboxChange" }, host: { properties: { "class.floating": "shouldLabelFloat", "id": "id" } }, providers: [
3687
3586
  {
3688
3587
  provide: NG_VALUE_ACCESSOR,
3689
3588
  useExisting: forwardRef(() => DateRangePicker),
@@ -3699,7 +3598,7 @@ class DateRangePicker {
3699
3598
  <mat-label>{{ label() }}</mat-label>
3700
3599
  }
3701
3600
 
3702
- <!-- Checkbox in prefix -->
3601
+ <!-- Checkbox prefix -->
3703
3602
  @if (showCheckbox() && checkboxPosition() === 'prefix') {
3704
3603
  <mat-checkbox
3705
3604
  matPrefix
@@ -3718,10 +3617,9 @@ class DateRangePicker {
3718
3617
  [placeholder]="placeholderText()"
3719
3618
  [disabled]="isDisabled()"
3720
3619
  [readonly]="inputReadonly()"
3721
- [id]="id"
3722
3620
  />
3723
3621
 
3724
- <!-- Checkbox in suffix -->
3622
+ <!-- Checkbox suffix -->
3725
3623
  @if (showCheckbox() && checkboxPosition() === 'suffix') {
3726
3624
  <mat-checkbox
3727
3625
  matSuffix
@@ -3733,22 +3631,10 @@ class DateRangePicker {
3733
3631
  ></mat-checkbox>
3734
3632
  }
3735
3633
 
3736
- <!-- Calendar icon button -->
3737
- <!-- @if (showCalendarButton()) {
3738
- <button
3739
- mat-icon-button
3740
- matSuffix
3741
- type="button"
3742
- (click)="toggle()"
3743
- [attr.aria-label]="'Abrir selector de fechas'"
3744
- >
3745
- <mat-icon>{{ calendarIcon() }}</mat-icon>
3746
- </button>
3747
- } -->
3748
-
3749
3634
  @if (hint()) {
3750
3635
  <mat-hint>{{ hint() }}</mat-hint>
3751
3636
  }
3637
+
3752
3638
  @if (errorState && errorMessage()) {
3753
3639
  <mat-error>{{ errorMessage() }}</mat-error>
3754
3640
  }
@@ -3757,13 +3643,26 @@ class DateRangePicker {
3757
3643
  }
3758
3644
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DateRangePicker, decorators: [{
3759
3645
  type: Component,
3760
- 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: `
3761
3660
  <mat-form-field [appearance]="appearance()" class="full-width">
3762
3661
  @if (label()) {
3763
3662
  <mat-label>{{ label() }}</mat-label>
3764
3663
  }
3765
3664
 
3766
- <!-- Checkbox in prefix -->
3665
+ <!-- Checkbox prefix -->
3767
3666
  @if (showCheckbox() && checkboxPosition() === 'prefix') {
3768
3667
  <mat-checkbox
3769
3668
  matPrefix
@@ -3782,10 +3681,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
3782
3681
  [placeholder]="placeholderText()"
3783
3682
  [disabled]="isDisabled()"
3784
3683
  [readonly]="inputReadonly()"
3785
- [id]="id"
3786
3684
  />
3787
3685
 
3788
- <!-- Checkbox in suffix -->
3686
+ <!-- Checkbox suffix -->
3789
3687
  @if (showCheckbox() && checkboxPosition() === 'suffix') {
3790
3688
  <mat-checkbox
3791
3689
  matSuffix
@@ -3797,44 +3695,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
3797
3695
  ></mat-checkbox>
3798
3696
  }
3799
3697
 
3800
- <!-- Calendar icon button -->
3801
- <!-- @if (showCalendarButton()) {
3802
- <button
3803
- mat-icon-button
3804
- matSuffix
3805
- type="button"
3806
- (click)="toggle()"
3807
- [attr.aria-label]="'Abrir selector de fechas'"
3808
- >
3809
- <mat-icon>{{ calendarIcon() }}</mat-icon>
3810
- </button>
3811
- } -->
3812
-
3813
3698
  @if (hint()) {
3814
3699
  <mat-hint>{{ hint() }}</mat-hint>
3815
3700
  }
3701
+
3816
3702
  @if (errorState && errorMessage()) {
3817
3703
  <mat-error>{{ errorMessage() }}</mat-error>
3818
3704
  }
3819
3705
  </mat-form-field>
3820
- `, providers: [
3821
- {
3822
- provide: NG_VALUE_ACCESSOR,
3823
- useExisting: forwardRef(() => DateRangePicker),
3824
- multi: true,
3825
- },
3826
- {
3827
- provide: MatFormFieldControl,
3828
- useExisting: DateRangePicker,
3829
- },
3830
- ], imports: [MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, MatCheckboxModule], host: {
3831
- '[class.floating]': 'shouldLabelFloat',
3832
- '[id]': 'id',
3833
- }, styles: [".full-width{width:100%}\n"] }]
3834
- }], ctorParameters: () => [], propDecorators: { dateInput: [{
3706
+ `, styles: [".full-width{width:100%}\n"] }]
3707
+ }], propDecorators: { dateInput: [{
3835
3708
  type: ViewChild,
3836
3709
  args: ['dateInput', { static: true }]
3837
- }], 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 }] }], 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"] }] } });
3838
3711
 
3839
3712
  // Angular component
3840
3713