monkey-style-guide 2.0.208 → 2.0.209

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.
@@ -6022,8 +6022,8 @@ class MonkeyDateRangePickerV2Component {
6022
6022
  });
6023
6023
  this._dateForm?.valueChanges?.pipe(takeUntil(this.unsubscribeAll))?.subscribe((values) => {
6024
6024
  const { startDate, endDate } = values;
6025
- this._startDate = startDate && moment$1.default(startDate);
6026
- this._endDate = endDate && moment$1.default(endDate);
6025
+ this._startDate = startDate;
6026
+ this._endDate = endDate;
6027
6027
  });
6028
6028
  }
6029
6029
  createCalendar(month) {
@@ -6214,6 +6214,23 @@ class MonkeyDateRangePickerV2Component {
6214
6214
  }
6215
6215
  this.writeValue(_dateForm.value);
6216
6216
  }
6217
+ onDataChange(event, isStart) {
6218
+ const input = event.target;
6219
+ const { value } = input;
6220
+ const [year] = value.split('-');
6221
+ if (`${Number(year)}`.length < 4)
6222
+ return;
6223
+ if (isStart) {
6224
+ this._dateForm.setValue({ startDate: value, endDate: null });
6225
+ }
6226
+ else {
6227
+ this._dateForm.setValue({ startDate: this._dateForm.value.startDate, endDate: value });
6228
+ }
6229
+ this.cdr.detectChanges();
6230
+ this.onModelChange(this._dateForm.value);
6231
+ this.onModelTouched(this._dateForm.value);
6232
+ this.writeValue(this._dateForm.value);
6233
+ }
6217
6234
  ngOnDestroy() {
6218
6235
  this.unsubscribeAll.next();
6219
6236
  this.unsubscribeAll.complete();
@@ -6243,12 +6260,12 @@ MonkeyDateRangePickerV2Component.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion:
6243
6260
  {{ i18n?.from }}
6244
6261
  </span>
6245
6262
  <span class="data">
6246
- <ng-container *ngIf="_startDate; else select">
6247
- {{ _startDate?.format('DD') }}
6248
- {{ i18n?.of }}
6249
- {{ i18n?.months?.[_startDate.format('M')] }},
6250
- {{ _startDate.format('YYYY') }}
6251
- </ng-container>
6263
+ <input
6264
+ class="date-input"
6265
+ type="date"
6266
+ [(ngModel)]="_startDate"
6267
+ (change)="onDataChange($event, true)"
6268
+ />
6252
6269
  </span>
6253
6270
  </div>
6254
6271
  <div class="to" [class.actual]="_startDate">
@@ -6256,12 +6273,12 @@ MonkeyDateRangePickerV2Component.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion:
6256
6273
  {{ i18n?.to }}
6257
6274
  </span>
6258
6275
  <span class="data">
6259
- <ng-container *ngIf="_endDate; else select">
6260
- {{ _endDate.format('DD') }}
6261
- {{ i18n?.of }}
6262
- {{ i18n?.months?.[_endDate.format('M')] }},
6263
- {{ _endDate.format('YYYY') }}
6264
- </ng-container>
6276
+ <input
6277
+ type="date"
6278
+ class="date-input"
6279
+ [(ngModel)]="_endDate"
6280
+ (change)="onDataChange($event, false)"
6281
+ />
6265
6282
  </span>
6266
6283
  </div>
6267
6284
  <ng-template #select>
@@ -6413,12 +6430,10 @@ MonkeyDateRangePickerV2Component.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion:
6413
6430
  </div>
6414
6431
  </mecx-date-range-picker-group-action>
6415
6432
  </mecx-date-range-picker-group>
6416
- `, 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 });
6433
+ `, 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"] }, { type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
6417
6434
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MonkeyDateRangePickerV2Component, decorators: [{
6418
6435
  type: Component,
6419
- args: [{
6420
- selector: 'monkey-date-range-picker-v2',
6421
- template: `
6436
+ args: [{ selector: 'monkey-date-range-picker-v2', template: `
6422
6437
  <mecx-date-range-picker-group [ngClass]="{ disabled: _disabled }" [id]="_id">
6423
6438
  <mecx-date-range-picker-group-header>
6424
6439
  <label>
@@ -6434,12 +6449,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
6434
6449
  {{ i18n?.from }}
6435
6450
  </span>
6436
6451
  <span class="data">
6437
- <ng-container *ngIf="_startDate; else select">
6438
- {{ _startDate?.format('DD') }}
6439
- {{ i18n?.of }}
6440
- {{ i18n?.months?.[_startDate.format('M')] }},
6441
- {{ _startDate.format('YYYY') }}
6442
- </ng-container>
6452
+ <input
6453
+ class="date-input"
6454
+ type="date"
6455
+ [(ngModel)]="_startDate"
6456
+ (change)="onDataChange($event, true)"
6457
+ />
6443
6458
  </span>
6444
6459
  </div>
6445
6460
  <div class="to" [class.actual]="_startDate">
@@ -6447,12 +6462,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
6447
6462
  {{ i18n?.to }}
6448
6463
  </span>
6449
6464
  <span class="data">
6450
- <ng-container *ngIf="_endDate; else select">
6451
- {{ _endDate.format('DD') }}
6452
- {{ i18n?.of }}
6453
- {{ i18n?.months?.[_endDate.format('M')] }},
6454
- {{ _endDate.format('YYYY') }}
6455
- </ng-container>
6465
+ <input
6466
+ type="date"
6467
+ class="date-input"
6468
+ [(ngModel)]="_endDate"
6469
+ (change)="onDataChange($event, false)"
6470
+ />
6456
6471
  </span>
6457
6472
  </div>
6458
6473
  <ng-template #select>
@@ -6604,17 +6619,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
6604
6619
  </div>
6605
6620
  </mecx-date-range-picker-group-action>
6606
6621
  </mecx-date-range-picker-group>
6607
- `,
6608
- encapsulation: ViewEncapsulation.None,
6609
- providers: [
6622
+ `, encapsulation: ViewEncapsulation.None, providers: [
6610
6623
  {
6611
6624
  provide: NG_VALUE_ACCESSOR,
6612
6625
  useExisting: forwardRef(() => MonkeyDateRangePickerV2Component),
6613
6626
  multi: true
6614
6627
  },
6615
6628
  CurrencyPipe
6616
- ]
6617
- }]
6629
+ ], 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"] }]
6618
6630
  }], ctorParameters: function () { return [{ type: i1$2.FormBuilder }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { label: [{
6619
6631
  type: Input
6620
6632
  }], helperMessage: [{