monkey-style-guide 2.0.121 → 2.0.122

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.
@@ -3051,11 +3051,11 @@ class MonkeyDateRangePickerComponent {
3051
3051
  this.helperMessage = '';
3052
3052
  this.moveDaysForward = true;
3053
3053
  this.onChange = new EventEmitter();
3054
- this.today = moment.default().format('YYYY-MM-DD');
3054
+ this.today = moment().format('YYYY-MM-DD');
3055
3055
  this.onModelChange = (value) => { };
3056
3056
  this.onModelTouched = (value) => { };
3057
- this._dateFirst = moment.default();
3058
- this._dateSecond = moment.default().add(1, 'M');
3057
+ this._dateFirst = moment();
3058
+ this._dateSecond = moment().add(1, 'M');
3059
3059
  this._id = `mecx-date-range-picker-${MonkeyUtils.getRandomString(10)}`;
3060
3060
  this._daysArrFirst = [];
3061
3061
  this._daysArrSecond = [];
@@ -3073,12 +3073,12 @@ class MonkeyDateRangePickerComponent {
3073
3073
  }));
3074
3074
  }
3075
3075
  createCalendar(month) {
3076
- let firstDay = moment.default(month).startOf('M');
3077
- let lastDay = moment.default(month).endOf('M');
3076
+ let firstDay = moment(month).startOf('M');
3077
+ let lastDay = moment(month).endOf('M');
3078
3078
  let days = Array.apply(null, { length: month.daysInMonth() })
3079
3079
  .map(Number.call, Number)
3080
3080
  .map((n) => {
3081
- return moment.default(firstDay).add(n, 'd');
3081
+ return moment(firstDay).add(n, 'd');
3082
3082
  });
3083
3083
  let n = 0;
3084
3084
  while (n < firstDay.weekday()) {
@@ -3116,8 +3116,8 @@ class MonkeyDateRangePickerComponent {
3116
3116
  this.writeValue(this._dateForm.value);
3117
3117
  }
3118
3118
  navigateToToday() {
3119
- this._dateFirst = moment.default();
3120
- this._dateSecond = moment.default().add(1, 'M');
3119
+ this._dateFirst = moment();
3120
+ this._dateSecond = moment().add(1, 'M');
3121
3121
  this.build();
3122
3122
  }
3123
3123
  ngOnInit() {
@@ -3172,14 +3172,14 @@ class MonkeyDateRangePickerComponent {
3172
3172
  if (!day) {
3173
3173
  return false;
3174
3174
  }
3175
- return moment.default().format('L') === day.format('L');
3175
+ return moment().format('L') === day.format('L');
3176
3176
  }
3177
3177
  isSelected(day) {
3178
3178
  if (!day) {
3179
3179
  return false;
3180
3180
  }
3181
- let startDateMoment = moment.default(this._dateForm.value.startDate, 'YYYY-MM-DD');
3182
- let endDateMoment = moment.default(this._dateForm.value.endDate, 'YYYY-MM-DD');
3181
+ let startDateMoment = moment(this._dateForm.value.startDate, 'YYYY-MM-DD');
3182
+ let endDateMoment = moment(this._dateForm.value.endDate, 'YYYY-MM-DD');
3183
3183
  if (this._dateForm.valid) {
3184
3184
  return startDateMoment.isSameOrBefore(day) && endDateMoment.isSameOrAfter(day);
3185
3185
  }
@@ -3190,7 +3190,7 @@ class MonkeyDateRangePickerComponent {
3190
3190
  isDisabled(day) {
3191
3191
  const { _minDate } = this;
3192
3192
  if (_minDate) {
3193
- const firstDay = moment.default(_minDate);
3193
+ const firstDay = moment(_minDate);
3194
3194
  return day.isBefore(firstDay.subtract(1, 'day'));
3195
3195
  }
3196
3196
  return false;
@@ -3206,46 +3206,52 @@ class MonkeyDateRangePickerComponent {
3206
3206
  return day?.isSame(endDate);
3207
3207
  }
3208
3208
  selectedDate(day) {
3209
- if (this._disabled)
3210
- return;
3211
- const { _dateForm, _minDate } = this;
3212
- let dayFormatted = day.format('YYYY-MM-DD');
3213
- if (_minDate) {
3214
- const firstDay = moment.default(_minDate);
3215
- if (day.isBefore(firstDay.subtract(1, 'day')))
3209
+ try {
3210
+ if (this._disabled)
3216
3211
  return;
3217
- }
3218
- if (_dateForm.valid) {
3219
- this.clearDates();
3220
- }
3221
- let { startDate, endDate } = _dateForm.value;
3222
- if (startDate) {
3223
- if (moment.default(startDate).isAfter(moment.default(dayFormatted))) {
3224
- endDate = startDate;
3212
+ const { _dateForm, _minDate } = this;
3213
+ let dayFormatted = day.format('YYYY-MM-DD');
3214
+ if (_minDate) {
3215
+ const firstDay = moment(_minDate);
3216
+ if (day.isBefore(firstDay.subtract(1, 'day')))
3217
+ return;
3218
+ }
3219
+ if (_dateForm.valid) {
3220
+ this.clearDates();
3221
+ }
3222
+ let { startDate, endDate } = _dateForm.value;
3223
+ if (startDate) {
3224
+ if (moment(startDate).isAfter(moment(dayFormatted))) {
3225
+ endDate = startDate;
3226
+ startDate = dayFormatted;
3227
+ }
3228
+ else {
3229
+ endDate = dayFormatted;
3230
+ }
3231
+ }
3232
+ else
3225
3233
  startDate = dayFormatted;
3234
+ if (startDate) {
3235
+ _dateForm.get('startDate').patchValue(startDate);
3226
3236
  }
3227
- else {
3228
- endDate = dayFormatted;
3237
+ if (endDate) {
3238
+ _dateForm.get('endDate').patchValue(endDate);
3229
3239
  }
3240
+ console.log(_dateForm.value);
3241
+ this.writeValue(_dateForm.value);
3230
3242
  }
3231
- else
3232
- startDate = dayFormatted;
3233
- if (startDate) {
3234
- _dateForm.get('startDate').patchValue(startDate);
3235
- }
3236
- if (endDate) {
3237
- _dateForm.get('endDate').patchValue(endDate);
3243
+ catch (e) {
3244
+ console.log(e);
3238
3245
  }
3239
- this.writeValue(_dateForm.value);
3240
3246
  }
3241
3247
  selectRangeOfDays(days) {
3242
3248
  if (this._disabled)
3243
3249
  return;
3244
3250
  const { _dateForm, _minDate, today, moveDaysForward } = this;
3245
3251
  const { startDate } = _dateForm.value;
3246
- const firstDay = moment.default(startDate || _minDate || today).format('YYYY-MM-DD');
3252
+ const firstDay = moment(startDate || _minDate || today).format('YYYY-MM-DD');
3247
3253
  const method = moveDaysForward ? 'add' : 'subtract';
3248
- const lastDay = moment.default(firstDay)[method](days, 'day').format('YYYY-MM-DD');
3254
+ const lastDay = moment(firstDay)[method](days, 'day').format('YYYY-MM-DD');
3249
3255
  if (moveDaysForward) {
3250
3256
  _dateForm.get('startDate').patchValue(firstDay);
3251
3257
  _dateForm.get('endDate').patchValue(lastDay);
@@ -7526,6 +7532,7 @@ class MonkeyTableComponent {
7526
7532
  this.selectedList = null;
7527
7533
  this.selection = new EventEmitter();
7528
7534
  this.selected = new EventEmitter();
7535
+ this.clicked = new EventEmitter();
7529
7536
  this.list = [];
7530
7537
  this._maxWidth = 100;
7531
7538
  //not to do
@@ -7616,9 +7623,12 @@ class MonkeyTableComponent {
7616
7623
  onHandleSelectedAll() {
7617
7624
  return this.list.length === this.newDataSource.length;
7618
7625
  }
7626
+ onHandleClicked(row) {
7627
+ this.clicked.next(row);
7628
+ }
7619
7629
  }
7620
7630
  MonkeyTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: MonkeyTableComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
7621
- MonkeyTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.0", type: MonkeyTableComponent, selector: "monkey-table", inputs: { headers: "headers", dataSource: "dataSource", loading: "loading", rowTemplate: "rowTemplate", selectable: "selectable", showSelectAll: "showSelectAll", callbackValidation: "callbackValidation", callbackValidationAll: "callbackValidationAll", selectedList: "selectedList", functionId: "functionId" }, outputs: { selection: "selection", selected: "selected" }, usesOnChanges: true, ngImport: i0, template: `
7631
+ MonkeyTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.0", type: MonkeyTableComponent, selector: "monkey-table", inputs: { headers: "headers", dataSource: "dataSource", loading: "loading", rowTemplate: "rowTemplate", selectable: "selectable", showSelectAll: "showSelectAll", callbackValidation: "callbackValidation", callbackValidationAll: "callbackValidationAll", selectedList: "selectedList", functionId: "functionId" }, outputs: { selection: "selection", selected: "selected", clicked: "clicked" }, usesOnChanges: true, ngImport: i0, template: `
7622
7632
  <mecx-monkey-table>
7623
7633
  <mecx-monkey-table-header>
7624
7634
  <monkey-checkbox
@@ -7634,6 +7644,7 @@ MonkeyTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
7634
7644
  <mecx-monkey-table-body-row
7635
7645
  [class.selected]="onHandleSelected(row)"
7636
7646
  *ngFor="let row of newDataSource"
7647
+ (click)="onHandleClicked(row)"
7637
7648
  >
7638
7649
  <monkey-checkbox
7639
7650
  [value]="onHandleSelected(row)"
@@ -7670,6 +7681,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
7670
7681
  <mecx-monkey-table-body-row
7671
7682
  [class.selected]="onHandleSelected(row)"
7672
7683
  *ngFor="let row of newDataSource"
7684
+ (click)="onHandleClicked(row)"
7673
7685
  >
7674
7686
  <monkey-checkbox
7675
7687
  [value]="onHandleSelected(row)"
@@ -7712,6 +7724,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
7712
7724
  type: Output
7713
7725
  }], selected: [{
7714
7726
  type: Output
7727
+ }], clicked: [{
7728
+ type: Output
7715
7729
  }] } });
7716
7730
 
7717
7731
  /**************************