@skyux/datetime 5.6.0 → 5.7.0
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/bundles/skyux-datetime.umd.js +488 -162
- package/documentation.json +696 -835
- package/esm2015/lib/modules/date-pipe/date-format-utility.js +0 -2
- package/esm2015/lib/modules/date-pipe/date-format-utility.js.map +1 -1
- package/esm2015/lib/modules/date-range-picker/date-range-picker.component.js +47 -58
- package/esm2015/lib/modules/date-range-picker/date-range-picker.component.js.map +1 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-relative-value.js +0 -3
- package/esm2015/lib/modules/date-range-picker/types/date-range-relative-value.js.map +1 -1
- package/esm2015/lib/modules/datepicker/datepicker-calendar-inner.component.js.map +1 -1
- package/esm2015/lib/modules/datepicker/datepicker-input-fuzzy.directive.js +60 -50
- package/esm2015/lib/modules/datepicker/datepicker-input-fuzzy.directive.js.map +1 -1
- package/esm2015/lib/modules/datepicker/datepicker-input.directive.js +51 -40
- package/esm2015/lib/modules/datepicker/datepicker-input.directive.js.map +1 -1
- package/esm2015/lib/modules/shared/sky-datetime-resources.module.js +1 -1
- package/esm2015/lib/modules/shared/sky-datetime-resources.module.js.map +1 -1
- package/esm2015/lib/modules/timepicker/timepicker.component.js +6 -6
- package/esm2015/lib/modules/timepicker/timepicker.component.js.map +1 -1
- package/esm2015/lib/modules/timepicker/timepicker.directive.js +4 -5
- package/esm2015/lib/modules/timepicker/timepicker.directive.js.map +1 -1
- package/fesm2015/skyux-datetime.js +168 -164
- package/fesm2015/skyux-datetime.js.map +1 -1
- package/lib/modules/date-pipe/date-format-utility.d.ts +0 -1
- package/lib/modules/date-range-picker/date-range-picker.component.d.ts +4 -3
- package/lib/modules/date-range-picker/types/date-range-relative-value.d.ts +0 -1
- package/lib/modules/datepicker/datepicker-calendar-inner.component.d.ts +16 -13
- package/lib/modules/datepicker/datepicker-input-fuzzy.directive.d.ts +6 -1
- package/lib/modules/datepicker/datepicker-input.directive.d.ts +6 -2
- package/lib/modules/shared/sky-datetime-resources.module.d.ts +1 -1
- package/package.json +18 -16
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
|
|
38
38
|
// This class is mostly ported from the Angular 4.x DatePipe in order to maintain the old
|
|
39
39
|
var SkyDateFormatUtility = /** @class */ (function () {
|
|
40
|
-
/* istanbul ignore next */
|
|
41
40
|
function SkyDateFormatUtility() {
|
|
42
41
|
}
|
|
43
42
|
SkyDateFormatUtility.format = function (locale, value, pattern) {
|
|
@@ -143,7 +142,7 @@
|
|
|
143
142
|
/**
|
|
144
143
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
145
144
|
* The contents of this file were automatically generated by
|
|
146
|
-
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-datetime' schematic.
|
|
145
|
+
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-datetime' schematic.
|
|
147
146
|
* To update this file, simply rerun the command.
|
|
148
147
|
*/
|
|
149
148
|
var RESOURCES = {
|
|
@@ -2370,14 +2369,15 @@
|
|
|
2370
2369
|
*/
|
|
2371
2370
|
this.skyDatepickerNoValidate = false;
|
|
2372
2371
|
this.dateFormatter = new SkyDateFormatter();
|
|
2373
|
-
this.isFirstChange = true;
|
|
2374
2372
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
2375
2373
|
this._futureDisabled = false;
|
|
2376
2374
|
this._disabled = false;
|
|
2377
2375
|
this._yearRequired = false;
|
|
2376
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2378
2377
|
this.onChange = function (_) { };
|
|
2379
|
-
|
|
2378
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2380
2379
|
this.onTouched = function () { };
|
|
2380
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2381
2381
|
this.onValidatorChange = function () { };
|
|
2382
2382
|
this.localeProvider
|
|
2383
2383
|
.getLocaleInfo()
|
|
@@ -2488,7 +2488,9 @@
|
|
|
2488
2488
|
* through the `ngModel` attribute specified on the `input` element.
|
|
2489
2489
|
* @required
|
|
2490
2490
|
*/
|
|
2491
|
-
set: function (value) {
|
|
2491
|
+
set: function (value) {
|
|
2492
|
+
// TODO: Remove this property in a future version of SKY UX.
|
|
2493
|
+
},
|
|
2492
2494
|
enumerable: false,
|
|
2493
2495
|
configurable: true
|
|
2494
2496
|
});
|
|
@@ -2530,50 +2532,7 @@
|
|
|
2530
2532
|
return this._value;
|
|
2531
2533
|
},
|
|
2532
2534
|
set: function (value) {
|
|
2533
|
-
|
|
2534
|
-
var fuzzyMoment;
|
|
2535
|
-
var dateValue;
|
|
2536
|
-
var formattedDate;
|
|
2537
|
-
if (value instanceof Date) {
|
|
2538
|
-
dateValue = value;
|
|
2539
|
-
formattedDate = this.dateFormatter.format(value, this.dateFormat);
|
|
2540
|
-
fuzzyDate = this.fuzzyDateService.getFuzzyDateFromSelectedDate(value, this.dateFormat);
|
|
2541
|
-
}
|
|
2542
|
-
else if (typeof value === 'string') {
|
|
2543
|
-
fuzzyDate = this.fuzzyDateService.getFuzzyDateFromString(value, this.dateFormat);
|
|
2544
|
-
formattedDate = this.fuzzyDateService.format(fuzzyDate, this.dateFormat, this.locale);
|
|
2545
|
-
if (!formattedDate) {
|
|
2546
|
-
formattedDate = value;
|
|
2547
|
-
}
|
|
2548
|
-
fuzzyMoment = this.fuzzyDateService.getMomentFromFuzzyDate(fuzzyDate);
|
|
2549
|
-
if (fuzzyMoment) {
|
|
2550
|
-
dateValue = fuzzyMoment.toDate();
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2553
|
-
else {
|
|
2554
|
-
fuzzyDate = value;
|
|
2555
|
-
formattedDate = this.fuzzyDateService.format(fuzzyDate, this.dateFormat, this.locale);
|
|
2556
|
-
fuzzyMoment = this.fuzzyDateService.getMomentFromFuzzyDate(fuzzyDate);
|
|
2557
|
-
if (fuzzyMoment) {
|
|
2558
|
-
dateValue = fuzzyMoment.toDate();
|
|
2559
|
-
}
|
|
2560
|
-
}
|
|
2561
|
-
var areFuzzyDatesEqual = this.fuzzyDatesEqual(this._value, fuzzyDate);
|
|
2562
|
-
var isNewValue = fuzzyDate !== this._value || !areFuzzyDatesEqual;
|
|
2563
|
-
this._value = fuzzyDate || value;
|
|
2564
|
-
if (isNewValue) {
|
|
2565
|
-
this.onChange(this._value);
|
|
2566
|
-
// Do not mark the field as "dirty"
|
|
2567
|
-
// if the field has been initialized with a value.
|
|
2568
|
-
if (this.isFirstChange && this.control) {
|
|
2569
|
-
this.control.markAsPristine();
|
|
2570
|
-
}
|
|
2571
|
-
if (this.isFirstChange && this._value) {
|
|
2572
|
-
this.isFirstChange = false;
|
|
2573
|
-
}
|
|
2574
|
-
this.datepickerComponent.selectedDate = dateValue;
|
|
2575
|
-
}
|
|
2576
|
-
this.setInputElementValue(formattedDate || '');
|
|
2535
|
+
this.updateValue(value);
|
|
2577
2536
|
},
|
|
2578
2537
|
enumerable: false,
|
|
2579
2538
|
configurable: true
|
|
@@ -2607,7 +2566,6 @@
|
|
|
2607
2566
|
this.datepickerComponent.dateChange
|
|
2608
2567
|
.pipe(operators.distinctUntilChanged(), operators.takeUntil(this.ngUnsubscribe))
|
|
2609
2568
|
.subscribe(function (value) {
|
|
2610
|
-
_this.isFirstChange = false;
|
|
2611
2569
|
_this.value = value;
|
|
2612
2570
|
_this.onTouched();
|
|
2613
2571
|
});
|
|
@@ -2647,7 +2605,7 @@
|
|
|
2647
2605
|
this.control.markAsDirty();
|
|
2648
2606
|
};
|
|
2649
2607
|
SkyFuzzyDatepickerInputDirective.prototype.writeValue = function (value) {
|
|
2650
|
-
this.value
|
|
2608
|
+
this.updateValue(value, false);
|
|
2651
2609
|
};
|
|
2652
2610
|
SkyFuzzyDatepickerInputDirective.prototype.validate = function (control) {
|
|
2653
2611
|
if (!this.control) {
|
|
@@ -2743,7 +2701,6 @@
|
|
|
2743
2701
|
this.onValueChange(this.elementRef.nativeElement.value);
|
|
2744
2702
|
};
|
|
2745
2703
|
SkyFuzzyDatepickerInputDirective.prototype.onValueChange = function (newValue) {
|
|
2746
|
-
this.isFirstChange = false;
|
|
2747
2704
|
this.value = newValue;
|
|
2748
2705
|
};
|
|
2749
2706
|
SkyFuzzyDatepickerInputDirective.prototype.setInputElementValue = function (value) {
|
|
@@ -2778,6 +2735,59 @@
|
|
|
2778
2735
|
((!dateA.month && !dateB.month) || dateA.month === dateB.month) &&
|
|
2779
2736
|
((!dateA.year && !dateB.year) || dateA.year === dateB.year));
|
|
2780
2737
|
};
|
|
2738
|
+
/**
|
|
2739
|
+
* Update the value of the form control and input element
|
|
2740
|
+
* @param emitEvent Denotes if we emit an event to the consumer's form control. We do not want to do this if the value is being updated via a `setValue` call or a `patchValue` call as this is already handled by Angular.
|
|
2741
|
+
* In these cases we do not want to fire `onChange` as it will cause extra `valueChange` and `statusChange` events and the status of the form should not be affected by these changes.
|
|
2742
|
+
*/
|
|
2743
|
+
SkyFuzzyDatepickerInputDirective.prototype.updateValue = function (value, emitEvent) {
|
|
2744
|
+
if (emitEvent === void 0) { emitEvent = true; }
|
|
2745
|
+
var _a;
|
|
2746
|
+
if (this._value === value) {
|
|
2747
|
+
return;
|
|
2748
|
+
}
|
|
2749
|
+
var fuzzyDate;
|
|
2750
|
+
var fuzzyMoment;
|
|
2751
|
+
var dateValue;
|
|
2752
|
+
var formattedDate;
|
|
2753
|
+
if (value instanceof Date) {
|
|
2754
|
+
dateValue = value;
|
|
2755
|
+
formattedDate = this.dateFormatter.format(value, this.dateFormat);
|
|
2756
|
+
fuzzyDate = this.fuzzyDateService.getFuzzyDateFromSelectedDate(value, this.dateFormat);
|
|
2757
|
+
}
|
|
2758
|
+
else if (typeof value === 'string') {
|
|
2759
|
+
fuzzyDate = this.fuzzyDateService.getFuzzyDateFromString(value, this.dateFormat);
|
|
2760
|
+
formattedDate = this.fuzzyDateService.format(fuzzyDate, this.dateFormat, this.locale);
|
|
2761
|
+
if (!formattedDate) {
|
|
2762
|
+
formattedDate = value;
|
|
2763
|
+
}
|
|
2764
|
+
fuzzyMoment = this.fuzzyDateService.getMomentFromFuzzyDate(fuzzyDate);
|
|
2765
|
+
if (fuzzyMoment) {
|
|
2766
|
+
dateValue = fuzzyMoment.toDate();
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
else {
|
|
2770
|
+
fuzzyDate = value;
|
|
2771
|
+
formattedDate = this.fuzzyDateService.format(fuzzyDate, this.dateFormat, this.locale);
|
|
2772
|
+
fuzzyMoment = this.fuzzyDateService.getMomentFromFuzzyDate(fuzzyDate);
|
|
2773
|
+
if (fuzzyMoment) {
|
|
2774
|
+
dateValue = fuzzyMoment.toDate();
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
var areFuzzyDatesEqual = this.fuzzyDatesEqual(this._value, fuzzyDate);
|
|
2778
|
+
var isNewValue = fuzzyDate !== this._value || !areFuzzyDatesEqual;
|
|
2779
|
+
this._value = fuzzyDate || value;
|
|
2780
|
+
if (isNewValue) {
|
|
2781
|
+
if (emitEvent) {
|
|
2782
|
+
this.onChange(this._value);
|
|
2783
|
+
}
|
|
2784
|
+
else {
|
|
2785
|
+
(_a = this.control) === null || _a === void 0 ? void 0 : _a.setValue(this._value, { emitEvent: false });
|
|
2786
|
+
}
|
|
2787
|
+
this.datepickerComponent.selectedDate = dateValue;
|
|
2788
|
+
}
|
|
2789
|
+
this.setInputElementValue(formattedDate || '');
|
|
2790
|
+
};
|
|
2781
2791
|
return SkyFuzzyDatepickerInputDirective;
|
|
2782
2792
|
}());
|
|
2783
2793
|
SkyFuzzyDatepickerInputDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyFuzzyDatepickerInputDirective, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: SkyDatepickerConfigService }, { token: i0__namespace.ElementRef }, { token: SkyFuzzyDateService }, { token: i3__namespace.SkyAppLocaleProvider }, { token: i0__namespace.Renderer2 }, { token: i3__namespace.SkyLibResourcesService }, { token: SkyDatepickerComponent, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
@@ -2856,11 +2866,12 @@
|
|
|
2856
2866
|
*/
|
|
2857
2867
|
this.skyDatepickerNoValidate = false;
|
|
2858
2868
|
this.dateFormatter = new SkyDateFormatter();
|
|
2859
|
-
this.isFirstChange = true;
|
|
2860
2869
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
2870
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2861
2871
|
this.onChange = function (_) { };
|
|
2862
|
-
|
|
2872
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2863
2873
|
this.onTouched = function () { };
|
|
2874
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2864
2875
|
this.onValidatorChange = function () { };
|
|
2865
2876
|
this.initialPlaceholder = this.adapter.getPlaceholder(this.elementRef);
|
|
2866
2877
|
this.updatePlaceholder();
|
|
@@ -3014,28 +3025,7 @@
|
|
|
3014
3025
|
return this._value;
|
|
3015
3026
|
},
|
|
3016
3027
|
set: function (value) {
|
|
3017
|
-
|
|
3018
|
-
var areDatesEqual = this._value instanceof Date &&
|
|
3019
|
-
dateValue &&
|
|
3020
|
-
dateValue.getTime() === this._value.getTime();
|
|
3021
|
-
var isValidDateString = this.isDateStringValid(value);
|
|
3022
|
-
// If the string value supplied is malformed, do not set the value to its Date equivalent.
|
|
3023
|
-
// (JavaScript's Date parser will convert poorly formatted dates to Date objects, such as "abc 123", which isn't ideal.)
|
|
3024
|
-
if (!isValidDateString) {
|
|
3025
|
-
this._value = value;
|
|
3026
|
-
this.notifyUpdatedValue();
|
|
3027
|
-
}
|
|
3028
|
-
else if (dateValue !== this._value || !areDatesEqual) {
|
|
3029
|
-
this._value = dateValue || value;
|
|
3030
|
-
this.notifyUpdatedValue();
|
|
3031
|
-
}
|
|
3032
|
-
if (dateValue && isValidDateString) {
|
|
3033
|
-
var formattedDate = this.dateFormatter.format(dateValue, this.dateFormat);
|
|
3034
|
-
this.setInputElementValue(formattedDate);
|
|
3035
|
-
}
|
|
3036
|
-
else {
|
|
3037
|
-
this.setInputElementValue(value || '');
|
|
3038
|
-
}
|
|
3028
|
+
this.updateValue(value);
|
|
3039
3029
|
},
|
|
3040
3030
|
enumerable: false,
|
|
3041
3031
|
configurable: true
|
|
@@ -3064,7 +3054,6 @@
|
|
|
3064
3054
|
.pipe(operators.distinctUntilChanged())
|
|
3065
3055
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
3066
3056
|
.subscribe(function (value) {
|
|
3067
|
-
_this.isFirstChange = false;
|
|
3068
3057
|
_this.value = value;
|
|
3069
3058
|
_this.onTouched();
|
|
3070
3059
|
});
|
|
@@ -3117,7 +3106,7 @@
|
|
|
3117
3106
|
this.control.markAsDirty();
|
|
3118
3107
|
};
|
|
3119
3108
|
SkyDatepickerInputDirective.prototype.writeValue = function (value) {
|
|
3120
|
-
this.value
|
|
3109
|
+
this.updateValue(value, false);
|
|
3121
3110
|
};
|
|
3122
3111
|
SkyDatepickerInputDirective.prototype.validate = function (control) {
|
|
3123
3112
|
if (!this.control) {
|
|
@@ -3188,7 +3177,6 @@
|
|
|
3188
3177
|
}
|
|
3189
3178
|
};
|
|
3190
3179
|
SkyDatepickerInputDirective.prototype.onValueChange = function (newValue) {
|
|
3191
|
-
this.isFirstChange = false;
|
|
3192
3180
|
this.value = newValue;
|
|
3193
3181
|
};
|
|
3194
3182
|
SkyDatepickerInputDirective.prototype.setInputElementValue = function (value) {
|
|
@@ -3215,7 +3203,7 @@
|
|
|
3215
3203
|
return true;
|
|
3216
3204
|
}
|
|
3217
3205
|
// Does the value only include digits, dashes, or slashes?
|
|
3218
|
-
var regexp = /^[\d
|
|
3206
|
+
var regexp = /^[\d/-]+$/;
|
|
3219
3207
|
var isValid = regexp.test(value);
|
|
3220
3208
|
if (isValid) {
|
|
3221
3209
|
return true;
|
|
@@ -3224,23 +3212,57 @@
|
|
|
3224
3212
|
var isValidIso = moment__default["default"](value, moment__default["default"].ISO_8601).isValid();
|
|
3225
3213
|
return isValidIso;
|
|
3226
3214
|
};
|
|
3227
|
-
SkyDatepickerInputDirective.prototype.notifyUpdatedValue = function () {
|
|
3228
|
-
this.onChange(this._value);
|
|
3229
|
-
// Do not mark the field as "dirty"
|
|
3230
|
-
// if the field has been initialized with a value.
|
|
3231
|
-
if (this.isFirstChange && this.control) {
|
|
3232
|
-
this.control.markAsPristine();
|
|
3233
|
-
}
|
|
3234
|
-
if (this.isFirstChange && this._value) {
|
|
3235
|
-
this.isFirstChange = false;
|
|
3236
|
-
}
|
|
3237
|
-
this.datepickerComponent.selectedDate = this._value;
|
|
3238
|
-
};
|
|
3239
3215
|
SkyDatepickerInputDirective.prototype.updatePlaceholder = function () {
|
|
3240
3216
|
if (!this.initialPlaceholder) {
|
|
3241
3217
|
this.adapter.setPlaceholder(this.elementRef, this.dateFormat);
|
|
3242
3218
|
}
|
|
3243
3219
|
};
|
|
3220
|
+
/**
|
|
3221
|
+
* Update the value of the form control and input element
|
|
3222
|
+
* @param emitEvent Denotes if we emit an event to the consumer's form control. We do not want to do this if the value is being updated via a `setValue` call or a `patchValue` call as this is already handled by Angular.
|
|
3223
|
+
* In these cases we do not want to fire `onChange` as it will cause extra `valueChange` and `statusChange` events and the status of the form should not be affected by these changes.
|
|
3224
|
+
*/
|
|
3225
|
+
SkyDatepickerInputDirective.prototype.updateValue = function (value, emitEvent) {
|
|
3226
|
+
if (emitEvent === void 0) { emitEvent = true; }
|
|
3227
|
+
var _a, _b;
|
|
3228
|
+
if (this._value === value) {
|
|
3229
|
+
return;
|
|
3230
|
+
}
|
|
3231
|
+
var dateValue = this.getDateValue(value);
|
|
3232
|
+
var areDatesEqual = this._value instanceof Date &&
|
|
3233
|
+
dateValue &&
|
|
3234
|
+
dateValue.getTime() === this._value.getTime();
|
|
3235
|
+
var isValidDateString = this.isDateStringValid(value);
|
|
3236
|
+
// If the string value supplied is malformed, do not set the value to its Date equivalent.
|
|
3237
|
+
// (JavaScript's Date parser will convert poorly formatted dates to Date objects, such as "abc 123", which isn't ideal.)
|
|
3238
|
+
if (!isValidDateString) {
|
|
3239
|
+
this._value = value;
|
|
3240
|
+
if (emitEvent) {
|
|
3241
|
+
this.onChange(this._value);
|
|
3242
|
+
}
|
|
3243
|
+
else {
|
|
3244
|
+
(_a = this.control) === null || _a === void 0 ? void 0 : _a.setValue(this._value, { emitEvent: false });
|
|
3245
|
+
}
|
|
3246
|
+
this.datepickerComponent.selectedDate = this._value;
|
|
3247
|
+
}
|
|
3248
|
+
else if (dateValue !== this._value || !areDatesEqual) {
|
|
3249
|
+
this._value = dateValue || value;
|
|
3250
|
+
if (emitEvent) {
|
|
3251
|
+
this.onChange(this._value);
|
|
3252
|
+
}
|
|
3253
|
+
else {
|
|
3254
|
+
(_b = this.control) === null || _b === void 0 ? void 0 : _b.setValue(this._value, { emitEvent: false });
|
|
3255
|
+
}
|
|
3256
|
+
this.datepickerComponent.selectedDate = this._value;
|
|
3257
|
+
}
|
|
3258
|
+
if (dateValue && isValidDateString) {
|
|
3259
|
+
var formattedDate = this.dateFormatter.format(dateValue, this.dateFormat);
|
|
3260
|
+
this.setInputElementValue(formattedDate);
|
|
3261
|
+
}
|
|
3262
|
+
else {
|
|
3263
|
+
this.setInputElementValue(value || '');
|
|
3264
|
+
}
|
|
3265
|
+
};
|
|
3244
3266
|
return SkyDatepickerInputDirective;
|
|
3245
3267
|
}());
|
|
3246
3268
|
SkyDatepickerInputDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDatepickerInputDirective, deps: [{ token: SkyDatepickerAdapterService }, { token: i0__namespace.ChangeDetectorRef }, { token: SkyDatepickerConfigService }, { token: i0__namespace.ElementRef }, { token: i3__namespace.SkyAppLocaleProvider }, { token: i0__namespace.Renderer2 }, { token: i3__namespace.SkyLibResourcesService }, { token: SkyDatepickerComponent, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
@@ -3374,8 +3396,6 @@
|
|
|
3374
3396
|
* @dynamic
|
|
3375
3397
|
*/
|
|
3376
3398
|
var SkyDateRangeRelativeValue = /** @class */ (function () {
|
|
3377
|
-
// Abstract classes are not covered properly.
|
|
3378
|
-
/* istanbul ignore next */
|
|
3379
3399
|
function SkyDateRangeRelativeValue() {
|
|
3380
3400
|
}
|
|
3381
3401
|
Object.defineProperty(SkyDateRangeRelativeValue, "today", {
|
|
@@ -3954,13 +3974,14 @@
|
|
|
3954
3974
|
* ```
|
|
3955
3975
|
*/
|
|
3956
3976
|
var SkyDateRangePickerComponent = /** @class */ (function () {
|
|
3957
|
-
function SkyDateRangePickerComponent(changeDetector, dateRangeService, formBuilder, localeProvider, windowRef, themeSvc) {
|
|
3977
|
+
function SkyDateRangePickerComponent(changeDetector, dateRangeService, formBuilder, localeProvider, windowRef, ngZone, themeSvc) {
|
|
3958
3978
|
var _this = this;
|
|
3959
3979
|
this.changeDetector = changeDetector;
|
|
3960
3980
|
this.dateRangeService = dateRangeService;
|
|
3961
3981
|
this.formBuilder = formBuilder;
|
|
3962
3982
|
this.localeProvider = localeProvider;
|
|
3963
3983
|
this.windowRef = windowRef;
|
|
3984
|
+
this.ngZone = ngZone;
|
|
3964
3985
|
/**
|
|
3965
3986
|
* Indicates whether to require users to specify a start date.
|
|
3966
3987
|
* @default false
|
|
@@ -3977,11 +3998,11 @@
|
|
|
3977
3998
|
this.showStartDatePicker = false;
|
|
3978
3999
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
3979
4000
|
this._disabled = false;
|
|
3980
|
-
|
|
4001
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3981
4002
|
this.onChange = function (_) { };
|
|
3982
|
-
|
|
4003
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3983
4004
|
this.onTouched = function () { };
|
|
3984
|
-
|
|
4005
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3985
4006
|
this.onValidatorChange = function () { };
|
|
3986
4007
|
this.localeProvider
|
|
3987
4008
|
.getLocaleInfo()
|
|
@@ -4153,24 +4174,27 @@
|
|
|
4153
4174
|
this.updateCalculators().then(function () {
|
|
4154
4175
|
_this.addEventListeners();
|
|
4155
4176
|
_this.isReady = true;
|
|
4156
|
-
_this.resetFormGroupValue();
|
|
4157
4177
|
_this.showRelevantFormFields();
|
|
4158
|
-
//
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4178
|
+
// We need to let Angular be stable and have rendered the components prior to setting the values and form controls. This ensures all initial validation will be ran correctly.
|
|
4179
|
+
_this.ngZone.onStable.pipe(operators.first()).subscribe(function () {
|
|
4180
|
+
// Fill in any unprovided values after the calculators have been initialized.
|
|
4181
|
+
// For example, if the control is initialized with only the `calculatorId`,
|
|
4182
|
+
// allow the calculator to fill in the missing start and end dates.
|
|
4183
|
+
var _b = _this.value, startDate = _b.startDate, endDate = _b.endDate;
|
|
4184
|
+
var defaultValue = _this.selectedCalculator.getValue(startDate, endDate);
|
|
4185
|
+
var newValue = Object.assign({}, defaultValue, _this.value);
|
|
4186
|
+
_this.setValue(newValue, false);
|
|
4187
|
+
_this.resetFormGroupValue();
|
|
4188
|
+
// This is needed to address a bug in Angular 4.
|
|
4189
|
+
// When a control value is set intially, its value is not represented on the view.
|
|
4190
|
+
// See: https://github.com/angular/angular/issues/13792
|
|
4191
|
+
/* istanbul ignore else */
|
|
4192
|
+
if (_this.control) {
|
|
4193
|
+
_this.control.setValue(_this.value, {
|
|
4194
|
+
emitEvent: false,
|
|
4195
|
+
});
|
|
4196
|
+
}
|
|
4197
|
+
});
|
|
4174
4198
|
});
|
|
4175
4199
|
};
|
|
4176
4200
|
SkyDateRangePickerComponent.prototype.ngOnChanges = function (changes) {
|
|
@@ -4311,47 +4335,27 @@
|
|
|
4311
4335
|
this.changeDetector.markForCheck();
|
|
4312
4336
|
};
|
|
4313
4337
|
SkyDateRangePickerComponent.prototype.resetFormGroupValue = function (value) {
|
|
4314
|
-
|
|
4315
|
-
// because we're already watching for changes that are triggered by the end user.
|
|
4316
|
-
// For example, if we change the value of the form group internally, we don't want the event
|
|
4317
|
-
// listeners to be triggered, as those are reserved for user interactions.
|
|
4318
|
-
// (See the event listeners listed below.)
|
|
4319
|
-
this.formGroup.reset(value || this.value, {
|
|
4320
|
-
emitEvent: false,
|
|
4321
|
-
});
|
|
4338
|
+
this.formGroup.reset(value || this.value);
|
|
4322
4339
|
};
|
|
4323
4340
|
SkyDateRangePickerComponent.prototype.addEventListeners = function () {
|
|
4324
4341
|
var _this = this;
|
|
4325
|
-
// Detect errors from the date pickers
|
|
4326
|
-
// when control is initialized with a value.
|
|
4327
|
-
rxjs.combineLatest([
|
|
4328
|
-
this.startDateControl.statusChanges,
|
|
4329
|
-
this.endDateControl.statusChanges,
|
|
4330
|
-
])
|
|
4331
|
-
.pipe(operators.first())
|
|
4332
|
-
.subscribe(function (status) {
|
|
4333
|
-
if (status.indexOf('INVALID') > -1) {
|
|
4334
|
-
// Wait for initial validation to complete.
|
|
4335
|
-
_this.windowRef.nativeWindow.setTimeout(function () {
|
|
4336
|
-
_this.onValidatorChange();
|
|
4337
|
-
});
|
|
4338
|
-
}
|
|
4339
|
-
});
|
|
4340
4342
|
// Watch for selected calculator change.
|
|
4341
4343
|
this.calculatorIdControl.valueChanges
|
|
4342
4344
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
4343
4345
|
.subscribe(function (value) {
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4346
|
+
if (value !== _this.value.calculatorId) {
|
|
4347
|
+
var id = parseInt(value, 10);
|
|
4348
|
+
// if the component is disabled during form creation, null is passed
|
|
4349
|
+
// as the value of the calculator id control
|
|
4350
|
+
// only handle the value changes if the calculator id is a number
|
|
4351
|
+
/* istanbul ignore else */
|
|
4352
|
+
if (!isNaN(id)) {
|
|
4353
|
+
var calculator = _this.getCalculatorById(id);
|
|
4354
|
+
var newValue = calculator.getValue();
|
|
4355
|
+
_this.setValue(newValue);
|
|
4356
|
+
_this.resetFormGroupValue(newValue);
|
|
4357
|
+
_this.showRelevantFormFields();
|
|
4358
|
+
}
|
|
4355
4359
|
}
|
|
4356
4360
|
});
|
|
4357
4361
|
// Watch for start date value changes.
|
|
@@ -4374,6 +4378,11 @@
|
|
|
4374
4378
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
4375
4379
|
.subscribe(function () {
|
|
4376
4380
|
_this.changeDetector.markForCheck();
|
|
4381
|
+
// Wait for initial validation to complete.
|
|
4382
|
+
_this.ngZone.onStable.pipe(operators.first()).subscribe(function () {
|
|
4383
|
+
var _a;
|
|
4384
|
+
(_a = _this.control) === null || _a === void 0 ? void 0 : _a.updateValueAndValidity({ emitEvent: false });
|
|
4385
|
+
});
|
|
4377
4386
|
});
|
|
4378
4387
|
};
|
|
4379
4388
|
SkyDateRangePickerComponent.prototype.updateCalculators = function () {
|
|
@@ -4395,7 +4404,7 @@
|
|
|
4395
4404
|
};
|
|
4396
4405
|
return SkyDateRangePickerComponent;
|
|
4397
4406
|
}());
|
|
4398
|
-
SkyDateRangePickerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDateRangePickerComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: SkyDateRangeService }, { token: i2__namespace$2.FormBuilder }, { token: i3__namespace.SkyAppLocaleProvider }, { token: i1__namespace.SkyAppWindowRef }, { token: i3__namespace$2.SkyThemeService, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
4407
|
+
SkyDateRangePickerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDateRangePickerComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: SkyDateRangeService }, { token: i2__namespace$2.FormBuilder }, { token: i3__namespace.SkyAppLocaleProvider }, { token: i1__namespace.SkyAppWindowRef }, { token: i0__namespace.NgZone }, { token: i3__namespace$2.SkyThemeService, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
4399
4408
|
SkyDateRangePickerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyDateRangePickerComponent, selector: "sky-date-range-picker", inputs: { calculatorIds: "calculatorIds", dateFormat: "dateFormat", disabled: "disabled", label: "label", startDateRequired: "startDateRequired", endDateRequired: "endDateRequired" }, providers: [
|
|
4400
4409
|
SKY_DATE_RANGE_PICKER_VALUE_ACCESSOR,
|
|
4401
4410
|
SKY_DATE_RANGE_PICKER_VALIDATOR,
|
|
@@ -4413,7 +4422,7 @@
|
|
|
4413
4422
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
4414
4423
|
}]
|
|
4415
4424
|
}], ctorParameters: function () {
|
|
4416
|
-
return [{ type: i0__namespace.ChangeDetectorRef }, { type: SkyDateRangeService }, { type: i2__namespace$2.FormBuilder }, { type: i3__namespace.SkyAppLocaleProvider }, { type: i1__namespace.SkyAppWindowRef }, { type: i3__namespace$2.SkyThemeService, decorators: [{
|
|
4425
|
+
return [{ type: i0__namespace.ChangeDetectorRef }, { type: SkyDateRangeService }, { type: i2__namespace$2.FormBuilder }, { type: i3__namespace.SkyAppLocaleProvider }, { type: i1__namespace.SkyAppWindowRef }, { type: i0__namespace.NgZone }, { type: i3__namespace$2.SkyThemeService, decorators: [{
|
|
4417
4426
|
type: i0.Optional
|
|
4418
4427
|
}] }];
|
|
4419
4428
|
}, propDecorators: { calculatorIds: [{
|
|
@@ -4470,6 +4479,324 @@
|
|
|
4470
4479
|
}]
|
|
4471
4480
|
}] });
|
|
4472
4481
|
|
|
4482
|
+
/*! *****************************************************************************
|
|
4483
|
+
Copyright (c) Microsoft Corporation.
|
|
4484
|
+
|
|
4485
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
4486
|
+
purpose with or without fee is hereby granted.
|
|
4487
|
+
|
|
4488
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
4489
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
4490
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
4491
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
4492
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
4493
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
4494
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
4495
|
+
***************************************************************************** */
|
|
4496
|
+
/* global Reflect, Promise */
|
|
4497
|
+
var extendStatics = function (d, b) {
|
|
4498
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4499
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
4500
|
+
function (d, b) { for (var p in b)
|
|
4501
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
4502
|
+
d[p] = b[p]; };
|
|
4503
|
+
return extendStatics(d, b);
|
|
4504
|
+
};
|
|
4505
|
+
function __extends(d, b) {
|
|
4506
|
+
if (typeof b !== "function" && b !== null)
|
|
4507
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
4508
|
+
extendStatics(d, b);
|
|
4509
|
+
function __() { this.constructor = d; }
|
|
4510
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4511
|
+
}
|
|
4512
|
+
var __assign = function () {
|
|
4513
|
+
__assign = Object.assign || function __assign(t) {
|
|
4514
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4515
|
+
s = arguments[i];
|
|
4516
|
+
for (var p in s)
|
|
4517
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
4518
|
+
t[p] = s[p];
|
|
4519
|
+
}
|
|
4520
|
+
return t;
|
|
4521
|
+
};
|
|
4522
|
+
return __assign.apply(this, arguments);
|
|
4523
|
+
};
|
|
4524
|
+
function __rest(s, e) {
|
|
4525
|
+
var t = {};
|
|
4526
|
+
for (var p in s)
|
|
4527
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4528
|
+
t[p] = s[p];
|
|
4529
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
4530
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
4531
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
4532
|
+
t[p[i]] = s[p[i]];
|
|
4533
|
+
}
|
|
4534
|
+
return t;
|
|
4535
|
+
}
|
|
4536
|
+
function __decorate(decorators, target, key, desc) {
|
|
4537
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4538
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4539
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
4540
|
+
else
|
|
4541
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
4542
|
+
if (d = decorators[i])
|
|
4543
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4544
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4545
|
+
}
|
|
4546
|
+
function __param(paramIndex, decorator) {
|
|
4547
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
4548
|
+
}
|
|
4549
|
+
function __metadata(metadataKey, metadataValue) {
|
|
4550
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
4551
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
4552
|
+
}
|
|
4553
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
4554
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4555
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4556
|
+
function fulfilled(value) { try {
|
|
4557
|
+
step(generator.next(value));
|
|
4558
|
+
}
|
|
4559
|
+
catch (e) {
|
|
4560
|
+
reject(e);
|
|
4561
|
+
} }
|
|
4562
|
+
function rejected(value) { try {
|
|
4563
|
+
step(generator["throw"](value));
|
|
4564
|
+
}
|
|
4565
|
+
catch (e) {
|
|
4566
|
+
reject(e);
|
|
4567
|
+
} }
|
|
4568
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
4569
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
4570
|
+
});
|
|
4571
|
+
}
|
|
4572
|
+
function __generator(thisArg, body) {
|
|
4573
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
4574
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4575
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
4576
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
4577
|
+
function step(op) {
|
|
4578
|
+
if (f)
|
|
4579
|
+
throw new TypeError("Generator is already executing.");
|
|
4580
|
+
while (_)
|
|
4581
|
+
try {
|
|
4582
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
4583
|
+
return t;
|
|
4584
|
+
if (y = 0, t)
|
|
4585
|
+
op = [op[0] & 2, t.value];
|
|
4586
|
+
switch (op[0]) {
|
|
4587
|
+
case 0:
|
|
4588
|
+
case 1:
|
|
4589
|
+
t = op;
|
|
4590
|
+
break;
|
|
4591
|
+
case 4:
|
|
4592
|
+
_.label++;
|
|
4593
|
+
return { value: op[1], done: false };
|
|
4594
|
+
case 5:
|
|
4595
|
+
_.label++;
|
|
4596
|
+
y = op[1];
|
|
4597
|
+
op = [0];
|
|
4598
|
+
continue;
|
|
4599
|
+
case 7:
|
|
4600
|
+
op = _.ops.pop();
|
|
4601
|
+
_.trys.pop();
|
|
4602
|
+
continue;
|
|
4603
|
+
default:
|
|
4604
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
4605
|
+
_ = 0;
|
|
4606
|
+
continue;
|
|
4607
|
+
}
|
|
4608
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
4609
|
+
_.label = op[1];
|
|
4610
|
+
break;
|
|
4611
|
+
}
|
|
4612
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
4613
|
+
_.label = t[1];
|
|
4614
|
+
t = op;
|
|
4615
|
+
break;
|
|
4616
|
+
}
|
|
4617
|
+
if (t && _.label < t[2]) {
|
|
4618
|
+
_.label = t[2];
|
|
4619
|
+
_.ops.push(op);
|
|
4620
|
+
break;
|
|
4621
|
+
}
|
|
4622
|
+
if (t[2])
|
|
4623
|
+
_.ops.pop();
|
|
4624
|
+
_.trys.pop();
|
|
4625
|
+
continue;
|
|
4626
|
+
}
|
|
4627
|
+
op = body.call(thisArg, _);
|
|
4628
|
+
}
|
|
4629
|
+
catch (e) {
|
|
4630
|
+
op = [6, e];
|
|
4631
|
+
y = 0;
|
|
4632
|
+
}
|
|
4633
|
+
finally {
|
|
4634
|
+
f = t = 0;
|
|
4635
|
+
}
|
|
4636
|
+
if (op[0] & 5)
|
|
4637
|
+
throw op[1];
|
|
4638
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
4639
|
+
}
|
|
4640
|
+
}
|
|
4641
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
4642
|
+
if (k2 === undefined)
|
|
4643
|
+
k2 = k;
|
|
4644
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
4645
|
+
}) : (function (o, m, k, k2) {
|
|
4646
|
+
if (k2 === undefined)
|
|
4647
|
+
k2 = k;
|
|
4648
|
+
o[k2] = m[k];
|
|
4649
|
+
});
|
|
4650
|
+
function __exportStar(m, o) {
|
|
4651
|
+
for (var p in m)
|
|
4652
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
4653
|
+
__createBinding(o, m, p);
|
|
4654
|
+
}
|
|
4655
|
+
function __values(o) {
|
|
4656
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4657
|
+
if (m)
|
|
4658
|
+
return m.call(o);
|
|
4659
|
+
if (o && typeof o.length === "number")
|
|
4660
|
+
return {
|
|
4661
|
+
next: function () {
|
|
4662
|
+
if (o && i >= o.length)
|
|
4663
|
+
o = void 0;
|
|
4664
|
+
return { value: o && o[i++], done: !o };
|
|
4665
|
+
}
|
|
4666
|
+
};
|
|
4667
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
4668
|
+
}
|
|
4669
|
+
function __read(o, n) {
|
|
4670
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4671
|
+
if (!m)
|
|
4672
|
+
return o;
|
|
4673
|
+
var i = m.call(o), r, ar = [], e;
|
|
4674
|
+
try {
|
|
4675
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
4676
|
+
ar.push(r.value);
|
|
4677
|
+
}
|
|
4678
|
+
catch (error) {
|
|
4679
|
+
e = { error: error };
|
|
4680
|
+
}
|
|
4681
|
+
finally {
|
|
4682
|
+
try {
|
|
4683
|
+
if (r && !r.done && (m = i["return"]))
|
|
4684
|
+
m.call(i);
|
|
4685
|
+
}
|
|
4686
|
+
finally {
|
|
4687
|
+
if (e)
|
|
4688
|
+
throw e.error;
|
|
4689
|
+
}
|
|
4690
|
+
}
|
|
4691
|
+
return ar;
|
|
4692
|
+
}
|
|
4693
|
+
/** @deprecated */
|
|
4694
|
+
function __spread() {
|
|
4695
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
4696
|
+
ar = ar.concat(__read(arguments[i]));
|
|
4697
|
+
return ar;
|
|
4698
|
+
}
|
|
4699
|
+
/** @deprecated */
|
|
4700
|
+
function __spreadArrays() {
|
|
4701
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
4702
|
+
s += arguments[i].length;
|
|
4703
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
4704
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
4705
|
+
r[k] = a[j];
|
|
4706
|
+
return r;
|
|
4707
|
+
}
|
|
4708
|
+
function __spreadArray(to, from, pack) {
|
|
4709
|
+
if (pack || arguments.length === 2)
|
|
4710
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4711
|
+
if (ar || !(i in from)) {
|
|
4712
|
+
if (!ar)
|
|
4713
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
4714
|
+
ar[i] = from[i];
|
|
4715
|
+
}
|
|
4716
|
+
}
|
|
4717
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
4718
|
+
}
|
|
4719
|
+
function __await(v) {
|
|
4720
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
4721
|
+
}
|
|
4722
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
4723
|
+
if (!Symbol.asyncIterator)
|
|
4724
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
4725
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
4726
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
4727
|
+
function verb(n) { if (g[n])
|
|
4728
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
4729
|
+
function resume(n, v) { try {
|
|
4730
|
+
step(g[n](v));
|
|
4731
|
+
}
|
|
4732
|
+
catch (e) {
|
|
4733
|
+
settle(q[0][3], e);
|
|
4734
|
+
} }
|
|
4735
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
4736
|
+
function fulfill(value) { resume("next", value); }
|
|
4737
|
+
function reject(value) { resume("throw", value); }
|
|
4738
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
4739
|
+
resume(q[0][0], q[0][1]); }
|
|
4740
|
+
}
|
|
4741
|
+
function __asyncDelegator(o) {
|
|
4742
|
+
var i, p;
|
|
4743
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
4744
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
4745
|
+
}
|
|
4746
|
+
function __asyncValues(o) {
|
|
4747
|
+
if (!Symbol.asyncIterator)
|
|
4748
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
4749
|
+
var m = o[Symbol.asyncIterator], i;
|
|
4750
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
4751
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
4752
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
4753
|
+
}
|
|
4754
|
+
function __makeTemplateObject(cooked, raw) {
|
|
4755
|
+
if (Object.defineProperty) {
|
|
4756
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
4757
|
+
}
|
|
4758
|
+
else {
|
|
4759
|
+
cooked.raw = raw;
|
|
4760
|
+
}
|
|
4761
|
+
return cooked;
|
|
4762
|
+
}
|
|
4763
|
+
;
|
|
4764
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
4765
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4766
|
+
}) : function (o, v) {
|
|
4767
|
+
o["default"] = v;
|
|
4768
|
+
};
|
|
4769
|
+
function __importStar(mod) {
|
|
4770
|
+
if (mod && mod.__esModule)
|
|
4771
|
+
return mod;
|
|
4772
|
+
var result = {};
|
|
4773
|
+
if (mod != null)
|
|
4774
|
+
for (var k in mod)
|
|
4775
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
4776
|
+
__createBinding(result, mod, k);
|
|
4777
|
+
__setModuleDefault(result, mod);
|
|
4778
|
+
return result;
|
|
4779
|
+
}
|
|
4780
|
+
function __importDefault(mod) {
|
|
4781
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
4782
|
+
}
|
|
4783
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
4784
|
+
if (kind === "a" && !f)
|
|
4785
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
4786
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
4787
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4788
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
4789
|
+
}
|
|
4790
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
4791
|
+
if (kind === "m")
|
|
4792
|
+
throw new TypeError("Private method is not writable");
|
|
4793
|
+
if (kind === "a" && !f)
|
|
4794
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
4795
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
4796
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
4797
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
4798
|
+
}
|
|
4799
|
+
|
|
4473
4800
|
var nextId = 0;
|
|
4474
4801
|
/**
|
|
4475
4802
|
* Creates a SKY UX-themed replacement for the HTML `input` element with `type="time"`.
|
|
@@ -4523,7 +4850,6 @@
|
|
|
4523
4850
|
}
|
|
4524
4851
|
},
|
|
4525
4852
|
set: function (setHour) {
|
|
4526
|
-
var hour;
|
|
4527
4853
|
var hourOffset = 0;
|
|
4528
4854
|
if (this.selectedMeridies === 'AM' && setHour === 12) {
|
|
4529
4855
|
hourOffset = -12;
|
|
@@ -4534,7 +4860,7 @@
|
|
|
4534
4860
|
if (this.is8601) {
|
|
4535
4861
|
hourOffset = 0;
|
|
4536
4862
|
}
|
|
4537
|
-
hour = moment__default["default"]({ hour: setHour }).add(hourOffset, 'hours').hour();
|
|
4863
|
+
var hour = moment__default["default"]({ hour: setHour }).add(hourOffset, 'hours').hour();
|
|
4538
4864
|
this.activeTime = moment__default["default"]({
|
|
4539
4865
|
hour: hour,
|
|
4540
4866
|
minute: moment__default["default"](this.activeTime).get('minute') + 0,
|
|
@@ -4664,9 +4990,9 @@
|
|
|
4664
4990
|
localeFormat = 'HH:mm';
|
|
4665
4991
|
this.is8601 = true;
|
|
4666
4992
|
}
|
|
4667
|
-
var data
|
|
4668
|
-
|
|
4669
|
-
hours: Array.apply(
|
|
4993
|
+
var data = {
|
|
4994
|
+
// Create a sparse array with a length equal to the hour.
|
|
4995
|
+
hours: Array.apply(void 0, __spreadArray([], __read(Array(h)))).map(function (_, i) {
|
|
4670
4996
|
if (format === 'hh') {
|
|
4671
4997
|
return ++i;
|
|
4672
4998
|
}
|
|
@@ -4678,7 +5004,8 @@
|
|
|
4678
5004
|
/* sanity check */
|
|
4679
5005
|
return 0;
|
|
4680
5006
|
}),
|
|
4681
|
-
|
|
5007
|
+
// Create a sparse array with a length equal to the minute.
|
|
5008
|
+
minutes: Array.apply(void 0, __spreadArray([], __read(Array(m)))).map(function (_, i) {
|
|
4682
5009
|
return i * minuteMultiplier;
|
|
4683
5010
|
}),
|
|
4684
5011
|
localeFormat: localeFormat,
|
|
@@ -4874,11 +5201,11 @@
|
|
|
4874
5201
|
this.resourcesService = resourcesService;
|
|
4875
5202
|
this.changeDetector = changeDetector;
|
|
4876
5203
|
this._timeFormat = 'hh';
|
|
4877
|
-
|
|
5204
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
4878
5205
|
this._onChange = function (_) { };
|
|
4879
|
-
|
|
5206
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
4880
5207
|
this._onTouched = function () { };
|
|
4881
|
-
|
|
5208
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
4882
5209
|
this._validatorChange = function () { };
|
|
4883
5210
|
}
|
|
4884
5211
|
Object.defineProperty(SkyTimepickerInputDirective.prototype, "skyTimepickerInput", {
|
|
@@ -5038,7 +5365,6 @@
|
|
|
5038
5365
|
return '';
|
|
5039
5366
|
}
|
|
5040
5367
|
var currentFormat = void 0;
|
|
5041
|
-
var formatTime = void 0;
|
|
5042
5368
|
if (this.timeFormat === 'hh') {
|
|
5043
5369
|
currentFormat = 'h:mm A';
|
|
5044
5370
|
}
|
|
@@ -5048,7 +5374,7 @@
|
|
|
5048
5374
|
if (typeof this.returnFormat === 'undefined') {
|
|
5049
5375
|
this.returnFormat = currentFormat;
|
|
5050
5376
|
}
|
|
5051
|
-
formatTime = {
|
|
5377
|
+
var formatTime = {
|
|
5052
5378
|
hour: moment__default["default"](time, currentFormat).hour(),
|
|
5053
5379
|
minute: moment__default["default"](time, currentFormat).minute(),
|
|
5054
5380
|
meridie: moment__default["default"](time, currentFormat).format('A'),
|