monkey-style-guide 2.0.121 → 2.0.124
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.
- package/esm2020/lib/components/date-range-picker/date-range-picker.component.mjs +46 -40
- package/esm2020/lib/components/table/table.component.mjs +10 -2
- package/esm2020/lib/core/services/snackbar/mokey-style-guide-snackbar.service.mjs +4 -2
- package/fesm2015/monkey-style-guide.mjs +58 -41
- package/fesm2015/monkey-style-guide.mjs.map +1 -1
- package/fesm2020/monkey-style-guide.mjs +57 -41
- package/fesm2020/monkey-style-guide.mjs.map +1 -1
- package/lib/components/table/table.component.d.ts +3 -1
- package/lib/core/services/snackbar/mokey-style-guide-snackbar.service.d.ts +1 -0
- package/monkey-style-guide-2.0.124.tgz +0 -0
- package/package.json +1 -1
- package/monkey-style-guide-2.0.121.tgz +0 -0
|
@@ -442,7 +442,10 @@ class MonkeyStyleGuideSnackbarService {
|
|
|
442
442
|
this.timeoutBlinkTab = null;
|
|
443
443
|
this.snackbarElements = new SnackbarElements();
|
|
444
444
|
this.locationRouter.onUrlChange(() => {
|
|
445
|
-
|
|
445
|
+
var _a;
|
|
446
|
+
if (this.config && !((_a = this.config) === null || _a === void 0 ? void 0 : _a.keepOnUrlChange)) {
|
|
447
|
+
this.closeAll();
|
|
448
|
+
}
|
|
446
449
|
});
|
|
447
450
|
}
|
|
448
451
|
stopBlinking() {
|
|
@@ -3045,11 +3048,11 @@ class MonkeyDateRangePickerComponent {
|
|
|
3045
3048
|
this.helperMessage = '';
|
|
3046
3049
|
this.moveDaysForward = true;
|
|
3047
3050
|
this.onChange = new EventEmitter();
|
|
3048
|
-
this.today = moment
|
|
3051
|
+
this.today = moment().format('YYYY-MM-DD');
|
|
3049
3052
|
this.onModelChange = (value) => { };
|
|
3050
3053
|
this.onModelTouched = (value) => { };
|
|
3051
|
-
this._dateFirst = moment
|
|
3052
|
-
this._dateSecond = moment
|
|
3054
|
+
this._dateFirst = moment();
|
|
3055
|
+
this._dateSecond = moment().add(1, 'M');
|
|
3053
3056
|
this._id = `mecx-date-range-picker-${MonkeyUtils.getRandomString(10)}`;
|
|
3054
3057
|
this._daysArrFirst = [];
|
|
3055
3058
|
this._daysArrSecond = [];
|
|
@@ -3067,12 +3070,12 @@ class MonkeyDateRangePickerComponent {
|
|
|
3067
3070
|
}));
|
|
3068
3071
|
}
|
|
3069
3072
|
createCalendar(month) {
|
|
3070
|
-
let firstDay = moment
|
|
3071
|
-
let lastDay = moment
|
|
3073
|
+
let firstDay = moment(month).startOf('M');
|
|
3074
|
+
let lastDay = moment(month).endOf('M');
|
|
3072
3075
|
let days = Array.apply(null, { length: month.daysInMonth() })
|
|
3073
3076
|
.map(Number.call, Number)
|
|
3074
3077
|
.map((n) => {
|
|
3075
|
-
return moment
|
|
3078
|
+
return moment(firstDay).add(n, 'd');
|
|
3076
3079
|
});
|
|
3077
3080
|
let n = 0;
|
|
3078
3081
|
while (n < firstDay.weekday()) {
|
|
@@ -3110,8 +3113,8 @@ class MonkeyDateRangePickerComponent {
|
|
|
3110
3113
|
this.writeValue(this._dateForm.value);
|
|
3111
3114
|
}
|
|
3112
3115
|
navigateToToday() {
|
|
3113
|
-
this._dateFirst = moment
|
|
3114
|
-
this._dateSecond = moment
|
|
3116
|
+
this._dateFirst = moment();
|
|
3117
|
+
this._dateSecond = moment().add(1, 'M');
|
|
3115
3118
|
this.build();
|
|
3116
3119
|
}
|
|
3117
3120
|
ngOnInit() {
|
|
@@ -3166,14 +3169,14 @@ class MonkeyDateRangePickerComponent {
|
|
|
3166
3169
|
if (!day) {
|
|
3167
3170
|
return false;
|
|
3168
3171
|
}
|
|
3169
|
-
return moment
|
|
3172
|
+
return moment().format('L') === day.format('L');
|
|
3170
3173
|
}
|
|
3171
3174
|
isSelected(day) {
|
|
3172
3175
|
if (!day) {
|
|
3173
3176
|
return false;
|
|
3174
3177
|
}
|
|
3175
|
-
let startDateMoment = moment
|
|
3176
|
-
let endDateMoment = moment
|
|
3178
|
+
let startDateMoment = moment(this._dateForm.value.startDate, 'YYYY-MM-DD');
|
|
3179
|
+
let endDateMoment = moment(this._dateForm.value.endDate, 'YYYY-MM-DD');
|
|
3177
3180
|
if (this._dateForm.valid) {
|
|
3178
3181
|
return startDateMoment.isSameOrBefore(day) && endDateMoment.isSameOrAfter(day);
|
|
3179
3182
|
}
|
|
@@ -3184,7 +3187,7 @@ class MonkeyDateRangePickerComponent {
|
|
|
3184
3187
|
isDisabled(day) {
|
|
3185
3188
|
const { _minDate } = this;
|
|
3186
3189
|
if (_minDate) {
|
|
3187
|
-
const firstDay = moment
|
|
3190
|
+
const firstDay = moment(_minDate);
|
|
3188
3191
|
return day.isBefore(firstDay.subtract(1, 'day'));
|
|
3189
3192
|
}
|
|
3190
3193
|
return false;
|
|
@@ -3200,46 +3203,52 @@ class MonkeyDateRangePickerComponent {
|
|
|
3200
3203
|
return day === null || day === void 0 ? void 0 : day.isSame(endDate);
|
|
3201
3204
|
}
|
|
3202
3205
|
selectedDate(day) {
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
const { _dateForm, _minDate } = this;
|
|
3206
|
-
let dayFormatted = day.format('YYYY-MM-DD');
|
|
3207
|
-
if (_minDate) {
|
|
3208
|
-
const firstDay = moment.default(_minDate);
|
|
3209
|
-
if (day.isBefore(firstDay.subtract(1, 'day')))
|
|
3206
|
+
try {
|
|
3207
|
+
if (this._disabled)
|
|
3210
3208
|
return;
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3209
|
+
const { _dateForm, _minDate } = this;
|
|
3210
|
+
let dayFormatted = day.format('YYYY-MM-DD');
|
|
3211
|
+
if (_minDate) {
|
|
3212
|
+
const firstDay = moment(_minDate);
|
|
3213
|
+
if (day.isBefore(firstDay.subtract(1, 'day')))
|
|
3214
|
+
return;
|
|
3215
|
+
}
|
|
3216
|
+
if (_dateForm.valid) {
|
|
3217
|
+
this.clearDates();
|
|
3218
|
+
}
|
|
3219
|
+
let { startDate, endDate } = _dateForm.value;
|
|
3220
|
+
if (startDate) {
|
|
3221
|
+
if (moment(startDate).isAfter(moment(dayFormatted))) {
|
|
3222
|
+
endDate = startDate;
|
|
3223
|
+
startDate = dayFormatted;
|
|
3224
|
+
}
|
|
3225
|
+
else {
|
|
3226
|
+
endDate = dayFormatted;
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
else
|
|
3219
3230
|
startDate = dayFormatted;
|
|
3231
|
+
if (startDate) {
|
|
3232
|
+
_dateForm.get('startDate').patchValue(startDate);
|
|
3220
3233
|
}
|
|
3221
|
-
|
|
3222
|
-
endDate
|
|
3234
|
+
if (endDate) {
|
|
3235
|
+
_dateForm.get('endDate').patchValue(endDate);
|
|
3223
3236
|
}
|
|
3237
|
+
console.log(_dateForm.value);
|
|
3238
|
+
this.writeValue(_dateForm.value);
|
|
3224
3239
|
}
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
if (startDate) {
|
|
3228
|
-
_dateForm.get('startDate').patchValue(startDate);
|
|
3229
|
-
}
|
|
3230
|
-
if (endDate) {
|
|
3231
|
-
_dateForm.get('endDate').patchValue(endDate);
|
|
3240
|
+
catch (e) {
|
|
3241
|
+
console.log(e);
|
|
3232
3242
|
}
|
|
3233
|
-
this.writeValue(_dateForm.value);
|
|
3234
3243
|
}
|
|
3235
3244
|
selectRangeOfDays(days) {
|
|
3236
3245
|
if (this._disabled)
|
|
3237
3246
|
return;
|
|
3238
3247
|
const { _dateForm, _minDate, today, moveDaysForward } = this;
|
|
3239
3248
|
const { startDate } = _dateForm.value;
|
|
3240
|
-
const firstDay = moment
|
|
3249
|
+
const firstDay = moment(startDate || _minDate || today).format('YYYY-MM-DD');
|
|
3241
3250
|
const method = moveDaysForward ? 'add' : 'subtract';
|
|
3242
|
-
const lastDay = moment
|
|
3251
|
+
const lastDay = moment(firstDay)[method](days, 'day').format('YYYY-MM-DD');
|
|
3243
3252
|
if (moveDaysForward) {
|
|
3244
3253
|
_dateForm.get('startDate').patchValue(firstDay);
|
|
3245
3254
|
_dateForm.get('endDate').patchValue(lastDay);
|
|
@@ -7534,6 +7543,7 @@ class MonkeyTableComponent {
|
|
|
7534
7543
|
this.selectedList = null;
|
|
7535
7544
|
this.selection = new EventEmitter();
|
|
7536
7545
|
this.selected = new EventEmitter();
|
|
7546
|
+
this.clicked = new EventEmitter();
|
|
7537
7547
|
this.list = [];
|
|
7538
7548
|
this._maxWidth = 100;
|
|
7539
7549
|
//not to do
|
|
@@ -7625,9 +7635,12 @@ class MonkeyTableComponent {
|
|
|
7625
7635
|
onHandleSelectedAll() {
|
|
7626
7636
|
return this.list.length === this.newDataSource.length;
|
|
7627
7637
|
}
|
|
7638
|
+
onHandleClicked(row) {
|
|
7639
|
+
this.clicked.next(row);
|
|
7640
|
+
}
|
|
7628
7641
|
}
|
|
7629
7642
|
MonkeyTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: MonkeyTableComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
7630
|
-
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: `
|
|
7643
|
+
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: `
|
|
7631
7644
|
<mecx-monkey-table>
|
|
7632
7645
|
<mecx-monkey-table-header>
|
|
7633
7646
|
<monkey-checkbox
|
|
@@ -7643,6 +7656,7 @@ MonkeyTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
|
|
|
7643
7656
|
<mecx-monkey-table-body-row
|
|
7644
7657
|
[class.selected]="onHandleSelected(row)"
|
|
7645
7658
|
*ngFor="let row of newDataSource"
|
|
7659
|
+
(click)="onHandleClicked(row)"
|
|
7646
7660
|
>
|
|
7647
7661
|
<monkey-checkbox
|
|
7648
7662
|
[value]="onHandleSelected(row)"
|
|
@@ -7679,6 +7693,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
7679
7693
|
<mecx-monkey-table-body-row
|
|
7680
7694
|
[class.selected]="onHandleSelected(row)"
|
|
7681
7695
|
*ngFor="let row of newDataSource"
|
|
7696
|
+
(click)="onHandleClicked(row)"
|
|
7682
7697
|
>
|
|
7683
7698
|
<monkey-checkbox
|
|
7684
7699
|
[value]="onHandleSelected(row)"
|
|
@@ -7721,6 +7736,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImpor
|
|
|
7721
7736
|
type: Output
|
|
7722
7737
|
}], selected: [{
|
|
7723
7738
|
type: Output
|
|
7739
|
+
}], clicked: [{
|
|
7740
|
+
type: Output
|
|
7724
7741
|
}] } });
|
|
7725
7742
|
|
|
7726
7743
|
/**************************
|