monkey-style-guide 2.0.207 → 2.0.208

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.
@@ -5343,8 +5343,8 @@ class MonkeyDateRangePickerComponent {
5343
5343
  });
5344
5344
  this._dateForm?.valueChanges?.pipe(takeUntil(this.unsubscribeAll))?.subscribe((values) => {
5345
5345
  const { startDate, endDate } = values;
5346
- this._startDate = startDate && moment$2.default(startDate);
5347
- this._endDate = endDate && moment$2.default(endDate);
5346
+ this._startDate = startDate;
5347
+ this._endDate = endDate;
5348
5348
  });
5349
5349
  }
5350
5350
  createCalendar(month) {
@@ -5531,6 +5531,23 @@ class MonkeyDateRangePickerComponent {
5531
5531
  }
5532
5532
  this.writeValue(_dateForm.value);
5533
5533
  }
5534
+ onDataChange(event, isStart) {
5535
+ const input = event.target;
5536
+ const { value } = input;
5537
+ const [year] = value.split('-');
5538
+ if (`${Number(year)}`.length < 4)
5539
+ return;
5540
+ if (isStart) {
5541
+ this._dateForm.setValue({ startDate: value, endDate: null });
5542
+ }
5543
+ else {
5544
+ this._dateForm.setValue({ startDate: this._dateForm.value.startDate, endDate: value });
5545
+ }
5546
+ this.cdr.detectChanges();
5547
+ this.onModelChange(this._dateForm.value);
5548
+ this.onModelTouched(this._dateForm.value);
5549
+ this.writeValue(this._dateForm.value);
5550
+ }
5534
5551
  ngOnDestroy() {
5535
5552
  this.unsubscribeAll.next();
5536
5553
  this.unsubscribeAll.complete();
@@ -5561,12 +5578,12 @@ MonkeyDateRangePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
5561
5578
  {{ i18n?.from }}
5562
5579
  </span>
5563
5580
  <span class="data">
5564
- <ng-container *ngIf="_startDate; else select">
5565
- {{ _startDate?.format('DD') }}
5566
- {{ i18n?.of }}
5567
- {{ i18n?.months?.[_startDate.format('M')] }},
5568
- {{ _startDate.format('YYYY') }}
5569
- </ng-container>
5581
+ <input
5582
+ class="date-input"
5583
+ type="date"
5584
+ [(ngModel)]="_startDate"
5585
+ (change)="onDataChange($event, true)"
5586
+ />
5570
5587
  </span>
5571
5588
  </div>
5572
5589
  <div class="to" [class.actual]="_startDate">
@@ -5574,12 +5591,12 @@ MonkeyDateRangePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
5574
5591
  {{ i18n?.to }}
5575
5592
  </span>
5576
5593
  <span class="data">
5577
- <ng-container *ngIf="_endDate; else select">
5578
- {{ _endDate.format('DD') }}
5579
- {{ i18n?.of }}
5580
- {{ i18n?.months?.[_endDate.format('M')] }},
5581
- {{ _endDate.format('YYYY') }}
5582
- </ng-container>
5594
+ <input
5595
+ type="date"
5596
+ class="date-input"
5597
+ [(ngModel)]="_endDate"
5598
+ (change)="onDataChange($event, false)"
5599
+ />
5583
5600
  </span>
5584
5601
  </div>
5585
5602
  <ng-template #select>
@@ -5731,12 +5748,10 @@ MonkeyDateRangePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
5731
5748
  </monkey-button>
5732
5749
  </mecx-date-range-picker-group-action>
5733
5750
  </mecx-date-range-picker-group>
5734
- `, isInline: true, components: [{ type: MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], encapsulation: i0.ViewEncapsulation.None });
5751
+ `, isInline: true, styles: ["monkey-date-range-picker .date-input::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none}monkey-date-range-picker .date-input::-moz-calendar-picker-indicator{display:none}monkey-date-range-picker .date-input::-webkit-inner-spin-button,monkey-date-range-picker .date-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}\n"], components: [{ type: MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], encapsulation: i0.ViewEncapsulation.None });
5735
5752
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MonkeyDateRangePickerComponent, decorators: [{
5736
5753
  type: Component,
5737
- args: [{
5738
- selector: 'monkey-date-range-picker',
5739
- template: `
5754
+ args: [{ selector: 'monkey-date-range-picker', template: `
5740
5755
  <mecx-date-range-picker-group [ngClass]="{ disabled: _disabled }" [id]="_id">
5741
5756
  <mecx-date-range-picker-group-header>
5742
5757
  <label>
@@ -5753,12 +5768,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
5753
5768
  {{ i18n?.from }}
5754
5769
  </span>
5755
5770
  <span class="data">
5756
- <ng-container *ngIf="_startDate; else select">
5757
- {{ _startDate?.format('DD') }}
5758
- {{ i18n?.of }}
5759
- {{ i18n?.months?.[_startDate.format('M')] }},
5760
- {{ _startDate.format('YYYY') }}
5761
- </ng-container>
5771
+ <input
5772
+ class="date-input"
5773
+ type="date"
5774
+ [(ngModel)]="_startDate"
5775
+ (change)="onDataChange($event, true)"
5776
+ />
5762
5777
  </span>
5763
5778
  </div>
5764
5779
  <div class="to" [class.actual]="_startDate">
@@ -5766,12 +5781,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
5766
5781
  {{ i18n?.to }}
5767
5782
  </span>
5768
5783
  <span class="data">
5769
- <ng-container *ngIf="_endDate; else select">
5770
- {{ _endDate.format('DD') }}
5771
- {{ i18n?.of }}
5772
- {{ i18n?.months?.[_endDate.format('M')] }},
5773
- {{ _endDate.format('YYYY') }}
5774
- </ng-container>
5784
+ <input
5785
+ type="date"
5786
+ class="date-input"
5787
+ [(ngModel)]="_endDate"
5788
+ (change)="onDataChange($event, false)"
5789
+ />
5775
5790
  </span>
5776
5791
  </div>
5777
5792
  <ng-template #select>
@@ -5923,17 +5938,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
5923
5938
  </monkey-button>
5924
5939
  </mecx-date-range-picker-group-action>
5925
5940
  </mecx-date-range-picker-group>
5926
- `,
5927
- encapsulation: ViewEncapsulation.None,
5928
- providers: [
5941
+ `, encapsulation: ViewEncapsulation.None, providers: [
5929
5942
  {
5930
5943
  provide: NG_VALUE_ACCESSOR,
5931
5944
  useExisting: forwardRef(() => MonkeyDateRangePickerComponent),
5932
5945
  multi: true,
5933
5946
  },
5934
5947
  CurrencyPipe,
5935
- ],
5936
- }]
5948
+ ], styles: ["monkey-date-range-picker .date-input::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none}monkey-date-range-picker .date-input::-moz-calendar-picker-indicator{display:none}monkey-date-range-picker .date-input::-webkit-inner-spin-button,monkey-date-range-picker .date-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}\n"] }]
5937
5949
  }], ctorParameters: function () { return [{ type: i1$2.FormBuilder }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { label: [{
5938
5950
  type: Input
5939
5951
  }], helperMessage: [{