@skyux/datetime 5.5.0 → 5.6.2

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.
Files changed (70) hide show
  1. package/bundles/skyux-datetime.umd.js +1090 -764
  2. package/documentation.json +793 -932
  3. package/esm2015/lib/modules/date-pipe/date-format-utility.js +0 -2
  4. package/esm2015/lib/modules/date-pipe/date-format-utility.js.map +1 -1
  5. package/esm2015/lib/modules/date-pipe/date-pipe.module.js.map +1 -1
  6. package/esm2015/lib/modules/date-pipe/date.pipe.js.map +1 -1
  7. package/esm2015/lib/modules/date-pipe/fuzzy-date.pipe.js.map +1 -1
  8. package/esm2015/lib/modules/date-range-picker/date-range-picker.component.js +49 -60
  9. package/esm2015/lib/modules/date-range-picker/date-range-picker.component.js.map +1 -1
  10. package/esm2015/lib/modules/date-range-picker/date-range-picker.module.js.map +1 -1
  11. package/esm2015/lib/modules/date-range-picker/date-range.service.js.map +1 -1
  12. package/esm2015/lib/modules/date-range-picker/types/date-range-calculation.js.map +1 -1
  13. package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-config.js.map +1 -1
  14. package/esm2015/lib/modules/date-range-picker/types/date-range-calculator.js.map +1 -1
  15. package/esm2015/lib/modules/date-range-picker/types/date-range-default-calculator-config.js.map +1 -1
  16. package/esm2015/lib/modules/date-range-picker/types/date-range-default-calculator-configs.js.map +1 -1
  17. package/esm2015/lib/modules/date-range-picker/types/date-range-relative-value.js +0 -3
  18. package/esm2015/lib/modules/date-range-picker/types/date-range-relative-value.js.map +1 -1
  19. package/esm2015/lib/modules/datepicker/date-formatter.js.map +1 -1
  20. package/esm2015/lib/modules/datepicker/datepicker-calendar-change.js.map +1 -1
  21. package/esm2015/lib/modules/datepicker/datepicker-calendar-inner.component.js +6 -6
  22. package/esm2015/lib/modules/datepicker/datepicker-calendar-inner.component.js.map +1 -1
  23. package/esm2015/lib/modules/datepicker/datepicker-calendar.component.js +1 -1
  24. package/esm2015/lib/modules/datepicker/datepicker-calendar.component.js.map +1 -1
  25. package/esm2015/lib/modules/datepicker/datepicker-input-fuzzy.directive.js +62 -52
  26. package/esm2015/lib/modules/datepicker/datepicker-input-fuzzy.directive.js.map +1 -1
  27. package/esm2015/lib/modules/datepicker/datepicker-input.directive.js +53 -42
  28. package/esm2015/lib/modules/datepicker/datepicker-input.directive.js.map +1 -1
  29. package/esm2015/lib/modules/datepicker/datepicker.component.js +2 -2
  30. package/esm2015/lib/modules/datepicker/datepicker.component.js.map +1 -1
  31. package/esm2015/lib/modules/datepicker/datepicker.module.js +10 -10
  32. package/esm2015/lib/modules/datepicker/datepicker.module.js.map +1 -1
  33. package/esm2015/lib/modules/datepicker/daypicker-button.component.js.map +1 -1
  34. package/esm2015/lib/modules/datepicker/daypicker-cell.component.js +1 -1
  35. package/esm2015/lib/modules/datepicker/daypicker-cell.component.js.map +1 -1
  36. package/esm2015/lib/modules/datepicker/daypicker.component.js +13 -13
  37. package/esm2015/lib/modules/datepicker/daypicker.component.js.map +1 -1
  38. package/esm2015/lib/modules/datepicker/fuzzy-date.service.js +10 -10
  39. package/esm2015/lib/modules/datepicker/fuzzy-date.service.js.map +1 -1
  40. package/esm2015/lib/modules/datepicker/monthpicker.component.js +5 -5
  41. package/esm2015/lib/modules/datepicker/monthpicker.component.js.map +1 -1
  42. package/esm2015/lib/modules/datepicker/yearpicker.component.js +2 -2
  43. package/esm2015/lib/modules/datepicker/yearpicker.component.js.map +1 -1
  44. package/esm2015/lib/modules/shared/sky-datetime-resources.module.js +1 -1
  45. package/esm2015/lib/modules/shared/sky-datetime-resources.module.js.map +1 -1
  46. package/esm2015/lib/modules/timepicker/timepicker.component.js +8 -8
  47. package/esm2015/lib/modules/timepicker/timepicker.component.js.map +1 -1
  48. package/esm2015/lib/modules/timepicker/timepicker.directive.js +7 -8
  49. package/esm2015/lib/modules/timepicker/timepicker.directive.js.map +1 -1
  50. package/esm2015/lib/modules/timepicker/timepicker.module.js +3 -3
  51. package/esm2015/lib/modules/timepicker/timepicker.module.js.map +1 -1
  52. package/esm2015/testing/datepicker-fixture.js.map +1 -1
  53. package/esm2015/testing/timepicker-fixture.js.map +1 -1
  54. package/fesm2015/skyux-datetime-testing.js.map +1 -1
  55. package/fesm2015/skyux-datetime.js +528 -524
  56. package/fesm2015/skyux-datetime.js.map +1 -1
  57. package/lib/modules/date-pipe/date-format-utility.d.ts +0 -1
  58. package/lib/modules/date-range-picker/date-range-picker.component.d.ts +6 -5
  59. package/lib/modules/date-range-picker/date-range.service.d.ts +1 -1
  60. package/lib/modules/date-range-picker/types/date-range-calculation.d.ts +1 -1
  61. package/lib/modules/date-range-picker/types/date-range-calculator.d.ts +1 -1
  62. package/lib/modules/date-range-picker/types/date-range-relative-value.d.ts +0 -1
  63. package/lib/modules/datepicker/datepicker-calendar-change.d.ts +1 -1
  64. package/lib/modules/datepicker/datepicker-calendar-inner.component.d.ts +17 -14
  65. package/lib/modules/datepicker/datepicker-calendar.component.d.ts +1 -1
  66. package/lib/modules/datepicker/datepicker-input-fuzzy.directive.d.ts +7 -2
  67. package/lib/modules/datepicker/datepicker-input.directive.d.ts +7 -3
  68. package/lib/modules/datepicker/datepicker.component.d.ts +2 -2
  69. package/lib/modules/datepicker/daypicker.component.d.ts +1 -1
  70. package/package.json +18 -16
@@ -1,13 +1,13 @@
1
- import { ChangeDetectorRef, Directive, ElementRef, forwardRef, HostListener, Input, Optional, Renderer2, } from '@angular/core';
1
+ import { ChangeDetectorRef, Directive, ElementRef, HostListener, Input, Optional, Renderer2, forwardRef, } from '@angular/core';
2
2
  import { NG_VALIDATORS, NG_VALUE_ACCESSOR, } from '@angular/forms';
3
3
  import { SkyAppLocaleProvider, SkyLibResourcesService } from '@skyux/i18n';
4
+ import moment from 'moment';
4
5
  import { Subject } from 'rxjs';
5
6
  import { distinctUntilChanged, takeUntil } from 'rxjs/operators';
6
7
  import { SkyDateFormatter } from './date-formatter';
7
8
  import { SkyDatepickerAdapterService } from './datepicker-adapter.service';
8
9
  import { SkyDatepickerConfigService } from './datepicker-config.service';
9
10
  import { SkyDatepickerComponent } from './datepicker.component';
10
- import moment from 'moment';
11
11
  import * as i0 from "@angular/core";
12
12
  import * as i1 from "./datepicker-adapter.service";
13
13
  import * as i2 from "./datepicker-config.service";
@@ -41,11 +41,12 @@ export class SkyDatepickerInputDirective {
41
41
  */
42
42
  this.skyDatepickerNoValidate = false;
43
43
  this.dateFormatter = new SkyDateFormatter();
44
- this.isFirstChange = true;
45
44
  this.ngUnsubscribe = new Subject();
45
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
46
46
  this.onChange = (_) => { };
47
- /*istanbul ignore next */
47
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
48
48
  this.onTouched = () => { };
49
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
49
50
  this.onValidatorChange = () => { };
50
51
  this.initialPlaceholder = this.adapter.getPlaceholder(this.elementRef);
51
52
  this.updatePlaceholder();
@@ -166,28 +167,7 @@ export class SkyDatepickerInputDirective {
166
167
  return this._value;
167
168
  }
168
169
  set value(value) {
169
- const dateValue = this.getDateValue(value);
170
- const areDatesEqual = this._value instanceof Date &&
171
- dateValue &&
172
- dateValue.getTime() === this._value.getTime();
173
- const isValidDateString = this.isDateStringValid(value);
174
- // If the string value supplied is malformed, do not set the value to its Date equivalent.
175
- // (JavaScript's Date parser will convert poorly formatted dates to Date objects, such as "abc 123", which isn't ideal.)
176
- if (!isValidDateString) {
177
- this._value = value;
178
- this.notifyUpdatedValue();
179
- }
180
- else if (dateValue !== this._value || !areDatesEqual) {
181
- this._value = dateValue || value;
182
- this.notifyUpdatedValue();
183
- }
184
- if (dateValue && isValidDateString) {
185
- const formattedDate = this.dateFormatter.format(dateValue, this.dateFormat);
186
- this.setInputElementValue(formattedDate);
187
- }
188
- else {
189
- this.setInputElementValue(value || '');
190
- }
170
+ this.updateValue(value);
191
171
  }
192
172
  ngOnInit() {
193
173
  if (!this.datepickerComponent) {
@@ -211,7 +191,6 @@ export class SkyDatepickerInputDirective {
211
191
  .pipe(distinctUntilChanged())
212
192
  .pipe(takeUntil(this.ngUnsubscribe))
213
193
  .subscribe((value) => {
214
- this.isFirstChange = false;
215
194
  this.value = value;
216
195
  this.onTouched();
217
196
  });
@@ -263,7 +242,7 @@ export class SkyDatepickerInputDirective {
263
242
  this.control.markAsDirty();
264
243
  }
265
244
  writeValue(value) {
266
- this.value = value;
245
+ this.updateValue(value, false);
267
246
  }
268
247
  validate(control) {
269
248
  if (!this.control) {
@@ -334,7 +313,6 @@ export class SkyDatepickerInputDirective {
334
313
  }
335
314
  }
336
315
  onValueChange(newValue) {
337
- this.isFirstChange = false;
338
316
  this.value = newValue;
339
317
  }
340
318
  setInputElementValue(value) {
@@ -361,7 +339,7 @@ export class SkyDatepickerInputDirective {
361
339
  return true;
362
340
  }
363
341
  // Does the value only include digits, dashes, or slashes?
364
- const regexp = /^[\d\/\-]+$/;
342
+ const regexp = /^[\d/-]+$/;
365
343
  const isValid = regexp.test(value);
366
344
  if (isValid) {
367
345
  return true;
@@ -370,23 +348,56 @@ export class SkyDatepickerInputDirective {
370
348
  const isValidIso = moment(value, moment.ISO_8601).isValid();
371
349
  return isValidIso;
372
350
  }
373
- notifyUpdatedValue() {
374
- this.onChange(this._value);
375
- // Do not mark the field as "dirty"
376
- // if the field has been initialized with a value.
377
- if (this.isFirstChange && this.control) {
378
- this.control.markAsPristine();
379
- }
380
- if (this.isFirstChange && this._value) {
381
- this.isFirstChange = false;
382
- }
383
- this.datepickerComponent.selectedDate = this._value;
384
- }
385
351
  updatePlaceholder() {
386
352
  if (!this.initialPlaceholder) {
387
353
  this.adapter.setPlaceholder(this.elementRef, this.dateFormat);
388
354
  }
389
355
  }
356
+ /**
357
+ * Update the value of the form control and input element
358
+ * @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.
359
+ * 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.
360
+ */
361
+ updateValue(value, emitEvent = true) {
362
+ var _a, _b;
363
+ if (this._value === value) {
364
+ return;
365
+ }
366
+ const dateValue = this.getDateValue(value);
367
+ const areDatesEqual = this._value instanceof Date &&
368
+ dateValue &&
369
+ dateValue.getTime() === this._value.getTime();
370
+ const isValidDateString = this.isDateStringValid(value);
371
+ // If the string value supplied is malformed, do not set the value to its Date equivalent.
372
+ // (JavaScript's Date parser will convert poorly formatted dates to Date objects, such as "abc 123", which isn't ideal.)
373
+ if (!isValidDateString) {
374
+ this._value = value;
375
+ if (emitEvent) {
376
+ this.onChange(this._value);
377
+ }
378
+ else {
379
+ (_a = this.control) === null || _a === void 0 ? void 0 : _a.setValue(this._value, { emitEvent: false });
380
+ }
381
+ this.datepickerComponent.selectedDate = this._value;
382
+ }
383
+ else if (dateValue !== this._value || !areDatesEqual) {
384
+ this._value = dateValue || value;
385
+ if (emitEvent) {
386
+ this.onChange(this._value);
387
+ }
388
+ else {
389
+ (_b = this.control) === null || _b === void 0 ? void 0 : _b.setValue(this._value, { emitEvent: false });
390
+ }
391
+ this.datepickerComponent.selectedDate = this._value;
392
+ }
393
+ if (dateValue && isValidDateString) {
394
+ const formattedDate = this.dateFormatter.format(dateValue, this.dateFormat);
395
+ this.setInputElementValue(formattedDate);
396
+ }
397
+ else {
398
+ this.setInputElementValue(value || '');
399
+ }
400
+ }
390
401
  }
391
402
  SkyDatepickerInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDatepickerInputDirective, deps: [{ token: i1.SkyDatepickerAdapterService }, { token: i0.ChangeDetectorRef }, { token: i2.SkyDatepickerConfigService }, { token: i0.ElementRef }, { token: i3.SkyAppLocaleProvider }, { token: i0.Renderer2 }, { token: i3.SkyLibResourcesService }, { token: i4.SkyDatepickerComponent, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
392
403
  SkyDatepickerInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyDatepickerInputDirective, selector: "[skyDatepickerInput]", inputs: { dateFormat: "dateFormat", disabled: "disabled", maxDate: "maxDate", minDate: "minDate", skyDatepickerInput: "skyDatepickerInput", skyDatepickerNoValidate: "skyDatepickerNoValidate", startingDay: "startingDay", strict: "strict" }, host: { listeners: { "change": "onInputChange($event)", "blur": "onInputBlur()", "keyup": "onInputKeyup()" } }, providers: [
@@ -1 +1 @@
1
- {"version":3,"file":"datepicker-input.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker-input.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,UAAU,EACV,YAAY,EACZ,KAAK,EAGL,QAAQ,EACR,SAAS,GACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAGL,aAAa,EACb,iBAAiB,GAGlB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE3E,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,MAAM,MAAM,QAAQ,CAAC;;;;;;AAE5B,sDAAsD;AACtD,MAAM,6BAA6B,GAAG;IACpC,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,2BAA2B,CAAC;IAC1D,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,MAAM,wBAAwB,GAAG;I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sBADlB,YAAY;uBAAC,OAAO","sourcesContent":["import {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n forwardRef,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Renderer2,\n} from '@angular/core';\n\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n Validator,\n ValidationErrors,\n} from '@angular/forms';\n\nimport { SkyAppLocaleProvider, SkyLibResourcesService } from '@skyux/i18n';\n\nimport { Subject } from 'rxjs';\n\nimport { distinctUntilChanged, takeUntil } from 'rxjs/operators';\n\nimport { SkyDateFormatter } from './date-formatter';\n\nimport { SkyDatepickerAdapterService } from './datepicker-adapter.service';\n\nimport { SkyDatepickerConfigService } from './datepicker-config.service';\n\nimport { SkyDatepickerComponent } from './datepicker.component';\n\nimport moment from 'moment';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_DATEPICKER_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyDatepickerInputDirective),\n multi: true,\n};\n\nconst SKY_DATEPICKER_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyDatepickerInputDirective),\n multi: true,\n};\n// tslint:enable\n\n@Directive({\n selector: '[skyDatepickerInput]',\n providers: [\n SKY_DATEPICKER_VALUE_ACCESSOR,\n SKY_DATEPICKER_VALIDATOR,\n SkyDatepickerAdapterService,\n ],\n})\nexport class SkyDatepickerInputDirective\n implements\n OnInit,\n OnDestroy,\n AfterViewInit,\n AfterContentInit,\n ControlValueAccessor,\n Validator\n{\n /**\n * Specifies the date format for the input. Place this attribute on the `input` element\n * to override the default in the `SkyDatepickerConfigService`.\n * @default \"MM/DD/YYYY\"\n */\n @Input()\n public set dateFormat(value: string) {\n /* istanbul ignore else */\n if (value !== this._dateFormat) {\n this._dateFormat = value;\n this.applyDateFormat();\n }\n }\n\n public get dateFormat(): string {\n return (\n this._dateFormat ||\n this.configService.dateFormat ||\n this.preferredShortDateFormat\n );\n }\n\n /**\n * Indicates whether to disable the datepicker.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n this._disabled = value;\n this.datepickerComponent.disabled = value;\n this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', value);\n }\n\n public get disabled(): boolean {\n return this._disabled || false;\n }\n\n /**\n * @internal\n * Indicates if the input element or any of its children have focus.\n */\n public get inputIsFocused(): boolean {\n return this.adapter.elementIsFocused();\n }\n\n /**\n * Specifies the latest date that is available in the calendar. Place this attribute on\n * the `input` element to override the default in `SkyDatepickerConfigService`.\n */\n @Input()\n public set maxDate(value: Date) {\n this._maxDate = value;\n this.datepickerComponent.maxDate = this.maxDate;\n\n this.onValidatorChange();\n }\n\n public get maxDate(): Date {\n return this._maxDate || this.configService.maxDate;\n }\n\n /**\n * Specifies the earliest date that is available in the calendar. Place this attribute on\n * the `input` element to override the default in `SkyDatepickerConfigService`.\n */\n @Input()\n public set minDate(value: Date) {\n this._minDate = value;\n this.datepickerComponent.minDate = this.minDate;\n\n this.onValidatorChange();\n }\n\n public get minDate(): Date {\n return this._minDate || this.configService.minDate;\n }\n\n /**\n * Creates the datepicker input and calendar. Place this directive on an `input` element,\n * and wrap the input in a `sky-datepicker` component. The value that users select is driven\n * through the `ngModel` attribute specified on the `input` element.\n * @required\n */\n @Input()\n public set skyDatepickerInput(\n value: SkyDatepickerComponent | undefined | ''\n ) {\n if (value) {\n console.warn(\n '[Deprecation warning] You no longer need to provide a template reference variable ' +\n 'to the `skyDatepickerInput` attribute (this will be a breaking change in the next ' +\n 'major version release).\\n' +\n 'Do this instead:\\n' +\n '<sky-datepicker>\\n <input skyDatepickerInput />\\n</sky-datepicker>'\n );\n }\n }\n\n /**\n * Indicates whether to disable date validation on the datepicker input.\n * @default false\n */\n @Input()\n public skyDatepickerNoValidate = false;\n\n /**\n * Specifies the starting day of the week in the calendar, where `0` sets the starting day\n * to Sunday. Place this attribute on the `input` element to override the default\n * in `SkyDatepickerConfigService`.\n * @default 0\n */\n @Input()\n public set startingDay(value: number) {\n this._startingDay = value;\n this.datepickerComponent.startingDay = this.startingDay;\n\n this.onValidatorChange();\n }\n\n public get startingDay(): number {\n return this._startingDay || this.configService.startingDay;\n }\n\n /**\n * Indicates whether the format of the date value must match the format from the `dateFormat` value.\n * If this property is `true` and the datepicker input directive cannot find an exact match, then\n * the input is marked as invalid.\n * If this property is `false` and the datepicker input directive cannot find an exact match, then\n * it attempts to format the string based on the [ISO 8601 standard format](https://www.iso.org/iso-8601-date-and-time-format.html).\n * @default false\n */\n @Input()\n public set strict(value: boolean) {\n this._strict = value;\n }\n\n public get strict(): boolean {\n return this._strict || false;\n }\n\n private get value(): any {\n return this._value;\n }\n\n private set value(value: any) {\n const dateValue = this.getDateValue(value);\n\n const areDatesEqual =\n this._value instanceof Date &&\n dateValue &&\n dateValue.getTime() === this._value.getTime();\n\n const isValidDateString = this.isDateStringValid(value);\n\n // If the string value supplied is malformed, do not set the value to its Date equivalent.\n // (JavaScript's Date parser will convert poorly formatted dates to Date objects, such as \"abc 123\", which isn't ideal.)\n if (!isValidDateString) {\n this._value = value;\n this.notifyUpdatedValue();\n } else if (dateValue !== this._value || !areDatesEqual) {\n this._value = dateValue || value;\n this.notifyUpdatedValue();\n }\n\n if (dateValue && isValidDateString) {\n const formattedDate = this.dateFormatter.format(\n dateValue,\n this.dateFormat\n );\n this.setInputElementValue(formattedDate);\n } else {\n this.setInputElementValue(value || '');\n }\n }\n\n private control: AbstractControl;\n private dateFormatter = new SkyDateFormatter();\n private isFirstChange = true;\n private initialPlaceholder: string;\n private preferredShortDateFormat: string;\n private ngUnsubscribe = new Subject<void>();\n\n private _dateFormat: string;\n private _disabled: boolean;\n private _maxDate: Date;\n private _minDate: Date;\n private _startingDay: number;\n private _strict: boolean;\n private _value: any;\n\n constructor(\n private adapter: SkyDatepickerAdapterService,\n private changeDetector: ChangeDetectorRef,\n private configService: SkyDatepickerConfigService,\n private elementRef: ElementRef,\n private localeProvider: SkyAppLocaleProvider,\n private renderer: Renderer2,\n private resourcesService: SkyLibResourcesService,\n @Optional() private datepickerComponent: SkyDatepickerComponent\n ) {\n this.initialPlaceholder = this.adapter.getPlaceholder(this.elementRef);\n this.updatePlaceholder();\n\n this.localeProvider\n .getLocaleInfo()\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((localeInfo) => {\n SkyDateFormatter.setLocale(localeInfo.locale);\n this.preferredShortDateFormat =\n SkyDateFormatter.getPreferredShortDateFormat();\n this.applyDateFormat();\n });\n }\n\n public ngOnInit(): void {\n if (!this.datepickerComponent) {\n throw new Error(\n 'You must wrap the `skyDatepickerInput` directive within a ' +\n '`<sky-datepicker>` component!'\n );\n }\n\n const element = this.elementRef.nativeElement;\n\n this.renderer.addClass(element, 'sky-form-control');\n\n const hasAriaLabel = element.getAttribute('aria-label');\n\n if (!hasAriaLabel) {\n this.resourcesService\n .getString('skyux_date_field_default_label')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: string) => {\n this.renderer.setAttribute(element, 'aria-label', value);\n });\n }\n }\n\n public ngAfterContentInit(): void {\n this.datepickerComponent.dateChange\n .pipe(distinctUntilChanged())\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: Date) => {\n this.isFirstChange = false;\n this.value = value;\n this.onTouched();\n });\n }\n\n public ngAfterViewInit(): void {\n // This is needed to address a bug in Angular 4.\n // When a control value is set intially, its value is not represented on the view.\n // See: https://github.com/angular/angular/issues/13792\n // Of note is the parent check which allows us to determine if the form is reactive.\n // Without this check there is a changed before checked error\n /* istanbul ignore else */\n if (this.control && this.control.parent) {\n setTimeout(() => {\n this.control.setValue(this.value, {\n emitEvent: false,\n });\n\n this.changeDetector.markForCheck();\n });\n }\n\n this.adapter.init(this.elementRef);\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n @HostListener('change', ['$event'])\n public onInputChange(event: any) {\n const value = event.target.value;\n\n if (this.skyDatepickerNoValidate) {\n this.onValueChange(value);\n return;\n }\n\n // Don't try to parse the string value into a Date value if it is malformed.\n if (this.isDateStringValid(value)) {\n this.onValueChange(value);\n return;\n }\n\n this._value = value;\n this.onChange(value);\n\n this.control.setErrors({\n skyDate: {\n invalid: true,\n },\n });\n }\n\n @HostListener('blur')\n public onInputBlur(): void {\n this.onTouched();\n }\n\n @HostListener('keyup')\n public onInputKeyup(): void {\n this.control.markAsDirty();\n }\n\n public writeValue(value: any): void {\n this.value = value;\n }\n\n public validate(control: AbstractControl): ValidationErrors {\n if (!this.control) {\n this.control = control;\n }\n\n if (this.skyDatepickerNoValidate) {\n return;\n }\n\n const value: any = control.value;\n\n if (!value) {\n return;\n }\n\n const dateValue = this.getDateValue(value);\n const isDateValid = dateValue && this.dateFormatter.dateIsValid(dateValue);\n\n if (!isDateValid || !this.isDateStringValid(value)) {\n // Mark the invalid control as touched so that the input's invalid CSS styles appear.\n // (This is only required when the invalid value is set by the FormControl constructor.)\n this.control.markAsTouched();\n\n return {\n skyDate: {\n invalid: value,\n },\n };\n }\n\n const minDate = this.minDate;\n\n if (minDate && this.dateFormatter.dateIsValid(minDate) && value < minDate) {\n return {\n skyDate: {\n minDate,\n },\n };\n }\n\n const maxDate = this.maxDate;\n\n if (maxDate && this.dateFormatter.dateIsValid(maxDate) && value > maxDate) {\n return {\n skyDate: {\n maxDate,\n },\n };\n }\n }\n\n public registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n public registerOnValidatorChange(fn: () => void): void {\n this.onValidatorChange = fn;\n }\n\n public setDisabledState(disabled: boolean): void {\n this.disabled = disabled;\n this.datepickerComponent.disabled = disabled;\n }\n\n /**\n * Detects changes to the underlying input element's value and updates the ngModel accordingly.\n * This is useful if you need to update the ngModel value before the input element loses focus.\n */\n public detectInputValueChange(): void {\n this.onValueChange(this.elementRef.nativeElement.value);\n }\n\n private applyDateFormat(): void {\n this.updatePlaceholder();\n if (this.value) {\n const formattedDate = this.dateFormatter.format(\n this.value,\n this.dateFormat\n );\n this.setInputElementValue(formattedDate);\n this.changeDetector.markForCheck();\n }\n }\n\n private onValueChange(newValue: string): void {\n this.isFirstChange = false;\n this.value = newValue;\n }\n\n private setInputElementValue(value: string): void {\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);\n }\n\n private getDateValue(value: any): Date {\n let dateValue: Date;\n if (value instanceof Date) {\n dateValue = value;\n } else if (typeof value === 'string') {\n const date = this.dateFormatter.getDateFromString(\n value,\n this.dateFormat,\n this.strict\n );\n if (this.dateFormatter.dateIsValid(date)) {\n dateValue = date;\n }\n }\n\n return dateValue;\n }\n\n /**\n * Validates the input value to ensure it is formatted correctly.\n */\n private isDateStringValid(value: string): boolean {\n if (!value || typeof value !== 'string') {\n return true;\n }\n\n // Does the value only include digits, dashes, or slashes?\n const regexp = /^[\\d\\/\\-]+$/;\n const isValid = regexp.test(value);\n\n if (isValid) {\n return true;\n }\n\n // If not, does it conform to the standard ISO format?\n const isValidIso = moment(value, moment.ISO_8601).isValid();\n\n return isValidIso;\n }\n\n private onChange = (_: any) => {};\n /*istanbul ignore next */\n private onTouched = () => {};\n private onValidatorChange = () => {};\n\n private notifyUpdatedValue(): void {\n this.onChange(this._value);\n\n // Do not mark the field as \"dirty\"\n // if the field has been initialized with a value.\n if (this.isFirstChange && this.control) {\n this.control.markAsPristine();\n }\n\n if (this.isFirstChange && this._value) {\n this.isFirstChange = false;\n }\n\n this.datepickerComponent.selectedDate = this._value;\n }\n\n private updatePlaceholder(): void {\n if (!this.initialPlaceholder) {\n this.adapter.setPlaceholder(this.elementRef, this.dateFormat);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"datepicker-input.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker-input.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EACjB,SAAS,EACT,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E,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;aAC3D;YAED,IAAI,CAAC,mBAAmB,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;SACrD;QAED,IAAI,SAAS,IAAI,iBAAiB,EAAE;YAClC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAC7C,SAAS,EACT,IAAI,CAAC,UAAU,CAChB,CAAC;YACF,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;SAC1C;aAAM;YACL,IAAI,CAAC,oBAAoB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;SACxC;IACH,CAAC;;yHA5eU,2BAA2B;6GAA3B,2BAA2B,+YAN3B;QACT,6BAA6B;QAC7B,wBAAwB;QACxB,2BAA2B;KAC5B;4FAEU,2BAA2B;kBARvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,SAAS,EAAE;wBACT,6BAA6B;wBAC7B,wBAAwB;wBACxB,2BAA2B;qBAC5B;iBACF;;0BAoLI,QAAQ;4CApKA,UAAU;sBADpB,KAAK;gBAsBK,QAAQ;sBADlB,KAAK;gBAwBK,OAAO;sBADjB,KAAK;gBAiBK,OAAO;sBADjB,KAAK;gBAmBK,kBAAkB;sBAD5B,KAAK;gBAoBC,uBAAuB;sBAD7B,KAAK;gBAUK,WAAW;sBADrB,KAAK;gBAqBK,MAAM;sBADhB,KAAK;gBAmHC,aAAa;sBADnB,YAAY;uBAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBA0B3B,WAAW;sBADjB,YAAY;uBAAC,MAAM;gBAMb,YAAY;sBADlB,YAAY;uBAAC,OAAO","sourcesContent":["import {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Renderer2,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\nimport { SkyAppLocaleProvider, SkyLibResourcesService } from '@skyux/i18n';\n\nimport moment from 'moment';\nimport { Subject } from 'rxjs';\nimport { distinctUntilChanged, takeUntil } from 'rxjs/operators';\n\nimport { SkyDateFormatter } from './date-formatter';\nimport { SkyDatepickerAdapterService } from './datepicker-adapter.service';\nimport { SkyDatepickerConfigService } from './datepicker-config.service';\nimport { SkyDatepickerComponent } from './datepicker.component';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_DATEPICKER_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyDatepickerInputDirective),\n multi: true,\n};\n\nconst SKY_DATEPICKER_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyDatepickerInputDirective),\n multi: true,\n};\n// tslint:enable\n\n@Directive({\n selector: '[skyDatepickerInput]',\n providers: [\n SKY_DATEPICKER_VALUE_ACCESSOR,\n SKY_DATEPICKER_VALIDATOR,\n SkyDatepickerAdapterService,\n ],\n})\nexport class SkyDatepickerInputDirective\n implements\n OnInit,\n OnDestroy,\n AfterViewInit,\n AfterContentInit,\n ControlValueAccessor,\n Validator\n{\n /**\n * Specifies the date format for the input. Place this attribute on the `input` element\n * to override the default in the `SkyDatepickerConfigService`.\n * @default \"MM/DD/YYYY\"\n */\n @Input()\n public set dateFormat(value: string) {\n /* istanbul ignore else */\n if (value !== this._dateFormat) {\n this._dateFormat = value;\n this.applyDateFormat();\n }\n }\n\n public get dateFormat(): string {\n return (\n this._dateFormat ||\n this.configService.dateFormat ||\n this.preferredShortDateFormat\n );\n }\n\n /**\n * Indicates whether to disable the datepicker.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n this._disabled = value;\n this.datepickerComponent.disabled = value;\n this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', value);\n }\n\n public get disabled(): boolean {\n return this._disabled || false;\n }\n\n /**\n * @internal\n * Indicates if the input element or any of its children have focus.\n */\n public get inputIsFocused(): boolean {\n return this.adapter.elementIsFocused();\n }\n\n /**\n * Specifies the latest date that is available in the calendar. Place this attribute on\n * the `input` element to override the default in `SkyDatepickerConfigService`.\n */\n @Input()\n public set maxDate(value: Date) {\n this._maxDate = value;\n this.datepickerComponent.maxDate = this.maxDate;\n\n this.onValidatorChange();\n }\n\n public get maxDate(): Date {\n return this._maxDate || this.configService.maxDate;\n }\n\n /**\n * Specifies the earliest date that is available in the calendar. Place this attribute on\n * the `input` element to override the default in `SkyDatepickerConfigService`.\n */\n @Input()\n public set minDate(value: Date) {\n this._minDate = value;\n this.datepickerComponent.minDate = this.minDate;\n\n this.onValidatorChange();\n }\n\n public get minDate(): Date {\n return this._minDate || this.configService.minDate;\n }\n\n /**\n * Creates the datepicker input and calendar. Place this directive on an `input` element,\n * and wrap the input in a `sky-datepicker` component. The value that users select is driven\n * through the `ngModel` attribute specified on the `input` element.\n * @required\n */\n @Input()\n public set skyDatepickerInput(\n value: SkyDatepickerComponent | undefined | ''\n ) {\n if (value) {\n console.warn(\n '[Deprecation warning] You no longer need to provide a template reference variable ' +\n 'to the `skyDatepickerInput` attribute (this will be a breaking change in the next ' +\n 'major version release).\\n' +\n 'Do this instead:\\n' +\n '<sky-datepicker>\\n <input skyDatepickerInput />\\n</sky-datepicker>'\n );\n }\n }\n\n /**\n * Indicates whether to disable date validation on the datepicker input.\n * @default false\n */\n @Input()\n public skyDatepickerNoValidate = false;\n\n /**\n * Specifies the starting day of the week in the calendar, where `0` sets the starting day\n * to Sunday. Place this attribute on the `input` element to override the default\n * in `SkyDatepickerConfigService`.\n * @default 0\n */\n @Input()\n public set startingDay(value: number) {\n this._startingDay = value;\n this.datepickerComponent.startingDay = this.startingDay;\n\n this.onValidatorChange();\n }\n\n public get startingDay(): number {\n return this._startingDay || this.configService.startingDay;\n }\n\n /**\n * Indicates whether the format of the date value must match the format from the `dateFormat` value.\n * If this property is `true` and the datepicker input directive cannot find an exact match, then\n * the input is marked as invalid.\n * If this property is `false` and the datepicker input directive cannot find an exact match, then\n * it attempts to format the string based on the [ISO 8601 standard format](https://www.iso.org/iso-8601-date-and-time-format.html).\n * @default false\n */\n @Input()\n public set strict(value: boolean) {\n this._strict = value;\n }\n\n public get strict(): boolean {\n return this._strict || false;\n }\n\n private get value(): any {\n return this._value;\n }\n\n private set value(value: any) {\n this.updateValue(value);\n }\n\n private control: AbstractControl;\n private dateFormatter = new SkyDateFormatter();\n private initialPlaceholder: string;\n private preferredShortDateFormat: string;\n private ngUnsubscribe = new Subject<void>();\n\n private _dateFormat: string;\n private _disabled: boolean;\n private _maxDate: Date;\n private _minDate: Date;\n private _startingDay: number;\n private _strict: boolean;\n private _value: any;\n\n constructor(\n private adapter: SkyDatepickerAdapterService,\n private changeDetector: ChangeDetectorRef,\n private configService: SkyDatepickerConfigService,\n private elementRef: ElementRef,\n private localeProvider: SkyAppLocaleProvider,\n private renderer: Renderer2,\n private resourcesService: SkyLibResourcesService,\n @Optional() private datepickerComponent: SkyDatepickerComponent\n ) {\n this.initialPlaceholder = this.adapter.getPlaceholder(this.elementRef);\n this.updatePlaceholder();\n\n this.localeProvider\n .getLocaleInfo()\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((localeInfo) => {\n SkyDateFormatter.setLocale(localeInfo.locale);\n this.preferredShortDateFormat =\n SkyDateFormatter.getPreferredShortDateFormat();\n this.applyDateFormat();\n });\n }\n\n public ngOnInit(): void {\n if (!this.datepickerComponent) {\n throw new Error(\n 'You must wrap the `skyDatepickerInput` directive within a ' +\n '`<sky-datepicker>` component!'\n );\n }\n\n const element = this.elementRef.nativeElement;\n\n this.renderer.addClass(element, 'sky-form-control');\n\n const hasAriaLabel = element.getAttribute('aria-label');\n\n if (!hasAriaLabel) {\n this.resourcesService\n .getString('skyux_date_field_default_label')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: string) => {\n this.renderer.setAttribute(element, 'aria-label', value);\n });\n }\n }\n\n public ngAfterContentInit(): void {\n this.datepickerComponent.dateChange\n .pipe(distinctUntilChanged())\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: Date) => {\n this.value = value;\n this.onTouched();\n });\n }\n\n public ngAfterViewInit(): void {\n // This is needed to address a bug in Angular 4.\n // When a control value is set intially, its value is not represented on the view.\n // See: https://github.com/angular/angular/issues/13792\n // Of note is the parent check which allows us to determine if the form is reactive.\n // Without this check there is a changed before checked error\n /* istanbul ignore else */\n if (this.control && this.control.parent) {\n setTimeout(() => {\n this.control.setValue(this.value, {\n emitEvent: false,\n });\n\n this.changeDetector.markForCheck();\n });\n }\n\n this.adapter.init(this.elementRef);\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n @HostListener('change', ['$event'])\n public onInputChange(event: any) {\n const value = event.target.value;\n\n if (this.skyDatepickerNoValidate) {\n this.onValueChange(value);\n return;\n }\n\n // Don't try to parse the string value into a Date value if it is malformed.\n if (this.isDateStringValid(value)) {\n this.onValueChange(value);\n return;\n }\n\n this._value = value;\n this.onChange(value);\n\n this.control.setErrors({\n skyDate: {\n invalid: true,\n },\n });\n }\n\n @HostListener('blur')\n public onInputBlur(): void {\n this.onTouched();\n }\n\n @HostListener('keyup')\n public onInputKeyup(): void {\n this.control.markAsDirty();\n }\n\n public writeValue(value: any): void {\n this.updateValue(value, false);\n }\n\n public validate(control: AbstractControl): ValidationErrors {\n if (!this.control) {\n this.control = control;\n }\n\n if (this.skyDatepickerNoValidate) {\n return;\n }\n\n const value: any = control.value;\n\n if (!value) {\n return;\n }\n\n const dateValue = this.getDateValue(value);\n const isDateValid = dateValue && this.dateFormatter.dateIsValid(dateValue);\n\n if (!isDateValid || !this.isDateStringValid(value)) {\n // Mark the invalid control as touched so that the input's invalid CSS styles appear.\n // (This is only required when the invalid value is set by the FormControl constructor.)\n this.control.markAsTouched();\n\n return {\n skyDate: {\n invalid: value,\n },\n };\n }\n\n const minDate = this.minDate;\n\n if (minDate && this.dateFormatter.dateIsValid(minDate) && value < minDate) {\n return {\n skyDate: {\n minDate,\n },\n };\n }\n\n const maxDate = this.maxDate;\n\n if (maxDate && this.dateFormatter.dateIsValid(maxDate) && value > maxDate) {\n return {\n skyDate: {\n maxDate,\n },\n };\n }\n }\n\n public registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n public registerOnValidatorChange(fn: () => void): void {\n this.onValidatorChange = fn;\n }\n\n public setDisabledState(disabled: boolean): void {\n this.disabled = disabled;\n this.datepickerComponent.disabled = disabled;\n }\n\n /**\n * Detects changes to the underlying input element's value and updates the ngModel accordingly.\n * This is useful if you need to update the ngModel value before the input element loses focus.\n */\n public detectInputValueChange(): void {\n this.onValueChange(this.elementRef.nativeElement.value);\n }\n\n private applyDateFormat(): void {\n this.updatePlaceholder();\n if (this.value) {\n const formattedDate = this.dateFormatter.format(\n this.value,\n this.dateFormat\n );\n this.setInputElementValue(formattedDate);\n this.changeDetector.markForCheck();\n }\n }\n\n private onValueChange(newValue: string): void {\n this.value = newValue;\n }\n\n private setInputElementValue(value: string): void {\n this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);\n }\n\n private getDateValue(value: any): Date {\n let dateValue: Date;\n if (value instanceof Date) {\n dateValue = value;\n } else if (typeof value === 'string') {\n const date = this.dateFormatter.getDateFromString(\n value,\n this.dateFormat,\n this.strict\n );\n if (this.dateFormatter.dateIsValid(date)) {\n dateValue = date;\n }\n }\n\n return dateValue;\n }\n\n /**\n * Validates the input value to ensure it is formatted correctly.\n */\n private isDateStringValid(value: string): boolean {\n if (!value || typeof value !== 'string') {\n return true;\n }\n\n // Does the value only include digits, dashes, or slashes?\n const regexp = /^[\\d/-]+$/;\n const isValid = regexp.test(value);\n\n if (isValid) {\n return true;\n }\n\n // If not, does it conform to the standard ISO format?\n const isValidIso = moment(value, moment.ISO_8601).isValid();\n\n return isValidIso;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onChange = (_: any) => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onTouched = () => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onValidatorChange = () => {};\n\n private updatePlaceholder(): void {\n if (!this.initialPlaceholder) {\n this.adapter.setPlaceholder(this.elementRef, this.dateFormat);\n }\n }\n\n /**\n * Update the value of the form control and input element\n * @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.\n * 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.\n */\n private updateValue(value: any, emitEvent = true): void {\n if (this._value === value) {\n return;\n }\n\n const dateValue = this.getDateValue(value);\n\n const areDatesEqual =\n this._value instanceof Date &&\n dateValue &&\n dateValue.getTime() === this._value.getTime();\n\n const isValidDateString = this.isDateStringValid(value);\n\n // If the string value supplied is malformed, do not set the value to its Date equivalent.\n // (JavaScript's Date parser will convert poorly formatted dates to Date objects, such as \"abc 123\", which isn't ideal.)\n if (!isValidDateString) {\n this._value = value;\n if (emitEvent) {\n this.onChange(this._value);\n } else {\n this.control?.setValue(this._value, { emitEvent: false });\n }\n\n this.datepickerComponent.selectedDate = this._value;\n } else if (dateValue !== this._value || !areDatesEqual) {\n this._value = dateValue || value;\n if (emitEvent) {\n this.onChange(this._value);\n } else {\n this.control?.setValue(this._value, { emitEvent: false });\n }\n\n this.datepickerComponent.selectedDate = this._value;\n }\n\n if (dateValue && isValidDateString) {\n const formattedDate = this.dateFormatter.format(\n dateValue,\n this.dateFormat\n );\n this.setInputElementValue(formattedDate);\n } else {\n this.setInputElementValue(value || '');\n }\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, TemplateRef, Optional, ViewChild, Output, } from '@angular/core';
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Optional, Output, TemplateRef, ViewChild, } from '@angular/core';
2
2
  import { SkyAffixAutoFitContext, SkyAffixService, SkyCoreAdapterService, SkyOverlayService, } from '@skyux/core';
3
3
  import { SkyInputBoxHostService } from '@skyux/forms';
4
4
  import { SkyThemeService } from '@skyux/theme';
5
- import { fromEvent, Subject } from 'rxjs';
5
+ import { Subject, fromEvent } from 'rxjs';
6
6
  import { debounceTime, takeUntil } from 'rxjs/operators';
7
7
  import { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';
8
8
  import * as i0 from "@angular/core";
@@ -1 +1 @@
1
- {"version":3,"file":"datepicker.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker.component.ts","../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EACL,WAAW,EAGX,QAAQ,EACR,SAAS,EACT,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,sBAAsB,EAEtB,eAAe,EACf,qBAAqB,EAErB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;;;;;;;;;AAEjF,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf;;;GAGG;AAOH,MAAM,OAAO,sBAAsB;IAqKjC,YACU,YAA6B,EAC7B,cAAiC,EACjC,WAAkC,EAClC,cAAiC,EACtB,mBAA4C,EACnD,QAA0B;QAL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\n Component,\n ElementRef,\n EventEmitter,\n Input,\n TemplateRef,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild,\n Output,\n} from '@angular/core';\n\nimport {\n SkyAffixAutoFitContext,\n SkyAffixer,\n SkyAffixService,\n SkyCoreAdapterService,\n SkyOverlayInstance,\n SkyOverlayService,\n} from '@skyux/core';\nimport { SkyDatepickerCustomDate } from './datepicker-custom-date';\nimport { SkyDatepickerCalendarChange } from './datepicker-calendar-change';\n\nimport { SkyInputBoxHostService } from '@skyux/forms';\n\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { fromEvent, Subject, Subscription } from 'rxjs';\n\nimport { debounceTime, takeUntil } from 'rxjs/operators';\n\nimport { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';\n\nlet nextId = 0;\n\n/**\n * Creates the datepicker button and calendar.\n * You must wrap this component around an input with the `skyDatepickerInput` directive.\n */\n@Component({\n selector: 'sky-datepicker',\n templateUrl: './datepicker.component.html',\n styleUrls: ['./datepicker.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyDatepickerComponent implements OnDestroy, OnInit {\n /**\n * Adds a class to the datepicker.\n * @default \"\"\n */\n @Input()\n public pickerClass = '';\n\n /**\n * @internal\n * Indicates if the calendar button element or any of its children have focus.\n * @deprecated This property will be removed in the next major version release.\n */\n public get buttonIsFocused(): boolean {\n /* sanity check */\n /* istanbul ignore if */\n if (!this.triggerButtonRef) {\n return false;\n }\n const activeEl = document.activeElement;\n return this.triggerButtonRef.nativeElement === activeEl;\n }\n\n /**\n * @internal\n * Indicates if the calendar element or any of its children have focus.\n * @deprecated This property will be removed in the next major version release.\n */\n public get calendarIsFocused(): boolean {\n if (!this.calendarRef) {\n return false;\n }\n\n const focusedEl = document.activeElement;\n return this.calendarRef.nativeElement.contains(focusedEl);\n }\n\n /**\n * @internal\n * Indicates if the calendar element's visiblity property is 'visible'.\n * @deprecated This property will be removed in the next major version release.\n */\n public get calendarIsVisible(): boolean {\n return this.calendar ? this.calendar.isVisible : false;\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n public set disabled(value: boolean) {\n this._disabled = value;\n this.changeDetector.markForCheck();\n }\n\n public set selectedDate(value: Date) {\n this._selectedDate = value;\n if (this.calendar) {\n this.calendar.writeValue(this._selectedDate);\n }\n }\n\n /**\n * Fires when the range of displayed dates in the calendar changes. Provides the\n * current range of displayed dates and a mutable `customDate` property consumers can use\n * to modify individual dates on the calendar.\n */\n @Output()\n public calendarDateRangeChange = new EventEmitter<SkyDatepickerCalendarChange>();\n\n public calendarId: string;\n\n public customDates: SkyDatepickerCustomDate[] | undefined;\n\n public dateChange = new EventEmitter<Date>();\n\n public isDaypickerWaiting: boolean = false;\n\n public isOpen: boolean = false;\n\n public isVisible: boolean = false;\n\n public maxDate: Date;\n\n public minDate: Date;\n\n public startingDay: number;\n\n public triggerButtonId: string;\n\n @ViewChild(SkyDatepickerCalendarComponent)\n private calendar: SkyDatepickerCalendarComponent;\n\n @ViewChild('calendarRef', {\n read: ElementRef,\n })\n private set calendarRef(value: ElementRef) {\n if (value) {\n this._calendarRef = value;\n\n // Wait for the calendar component to render before gauging dimensions.\n setTimeout(() => {\n this.calendar.writeValue(this._selectedDate);\n\n this.destroyAffixer();\n this.createAffixer();\n\n setTimeout(() => {\n this.coreAdapter.getFocusableChildrenAndApplyFocus(\n this.calendarRef,\n '.sky-datepicker-calendar-inner',\n false\n );\n\n this.isVisible = true;\n this.changeDetector.markForCheck();\n });\n });\n }\n }\n\n private get calendarRef(): ElementRef {\n return this._calendarRef;\n }\n\n @ViewChild('calendarTemplateRef', {\n read: TemplateRef,\n })\n private calendarTemplateRef: TemplateRef<any>;\n\n @ViewChild('triggerButtonRef', {\n read: ElementRef,\n })\n private triggerButtonRef: ElementRef;\n\n @ViewChild('inputTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private inputTemplateRef: TemplateRef<any>;\n\n @ViewChild('triggerButtonTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private triggerButtonTemplateRef: TemplateRef<any>;\n\n private affixer: SkyAffixer;\n\n private calendarUnsubscribe: Subject<void>;\n\n private customDatesSubscription: Subscription;\n\n private ngUnsubscribe = new Subject();\n\n private overlay: SkyOverlayInstance;\n\n private overlayKeydownListner: Subscription;\n\n private _calendarRef: ElementRef;\n\n private _disabled = false;\n\n private _selectedDate: Date;\n\n constructor(\n private affixService: SkyAffixService,\n private changeDetector: ChangeDetectorRef,\n private coreAdapter: SkyCoreAdapterService,\n private overlayService: SkyOverlayService,\n @Optional() public inputBoxHostService?: SkyInputBoxHostService,\n @Optional() themeSvc?: SkyThemeService\n ) {\n const uniqueId = nextId++;\n this.calendarId = `sky-datepicker-calendar-${uniqueId}`;\n this.triggerButtonId = `sky-datepicker-button-${uniqueId}`;\n\n // Update icons when theme changes.\n themeSvc?.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnInit(): void {\n if (this.inputBoxHostService) {\n this.inputBoxHostService.populate({\n inputTemplate: this.inputTemplateRef,\n buttonsTemplate: this.triggerButtonTemplateRef,\n });\n }\n }\n\n public ngOnDestroy(): void {\n this.dateChange.complete();\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.removePickerEventListeners();\n this.destroyAffixer();\n this.destroyOverlay();\n }\n\n public onCalendarModeChange(): void {\n // Let the calendar populate in the DOM before recalculating placement.\n setTimeout(() => {\n this.affixer.reaffix();\n });\n }\n\n public onSelectedDateChange(value: Date): void {\n this.dateChange.emit(value);\n this.closePicker();\n }\n\n public onTriggerButtonClick(): void {\n if (this.isOpen) {\n this.closePicker();\n } else {\n this.openPicker();\n }\n }\n\n public onCalendarDateRangeChange(event: SkyDatepickerCalendarChange): void {\n /* istanbul ignore else */\n if (event) {\n this.cancelCustomDatesSubscription();\n\n const args: SkyDatepickerCalendarChange = {\n startDate: event.startDate,\n endDate: event.endDate,\n customDates: undefined,\n };\n this.calendarDateRangeChange.emit(args);\n // If consumer has added an observable to the args, watch for incoming custom dates.\n /* istanbul ignore else */\n if (args.customDates) {\n this.isDaypickerWaiting = true;\n // Avoid an ExpressionChangedAfterItHasBeenCheckedError.\n this.changeDetector.detectChanges();\n\n this.customDatesSubscription = args.customDates\n .pipe(debounceTime(250))\n .subscribe((result) => {\n this.customDates = result;\n this.isDaypickerWaiting = false;\n\n // Trigger change detection in child components to show changes in the calendar.\n this.changeDetector.markForCheck();\n });\n } else {\n // If consumer returns an undefined value after custom dates have\n // already ben established, remove custom dates.\n if (this.customDates) {\n this.customDates = undefined;\n // Avoid an ExpressionChangedAfterItHasBeenCheckedError.\n this.changeDetector.detectChanges();\n }\n }\n }\n }\n\n private closePicker() {\n this.destroyAffixer();\n this.destroyOverlay();\n this.removePickerEventListeners();\n this.triggerButtonRef.nativeElement.focus();\n this.isOpen = false;\n }\n\n private openPicker(): void {\n this.isVisible = false;\n this.changeDetector.markForCheck();\n\n this.removePickerEventListeners();\n this.calendarUnsubscribe = new Subject<void>();\n this.destroyOverlay();\n this.createOverlay();\n\n this.isOpen = true;\n this.changeDetector.markForCheck();\n }\n\n private createAffixer(): void {\n const affixer = this.affixService.createAffixer(this.calendarRef);\n\n // Hide calendar when trigger button is scrolled off screen.\n affixer.placementChange\n .pipe(takeUntil(this.calendarUnsubscribe))\n .subscribe((change) => {\n this.isVisible = change.placement !== null;\n this.changeDetector.markForCheck();\n });\n\n affixer.affixTo(this.triggerButtonRef.nativeElement, {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: 'right',\n isSticky: true,\n placement: 'below',\n });\n\n this.affixer = affixer;\n }\n\n private destroyAffixer(): void {\n /*istanbul ignore else*/\n if (this.affixer) {\n this.affixer.destroy();\n this.affixer = undefined;\n }\n }\n\n private createOverlay(): void {\n const overlay = this.overlayService.create({\n wrapperClass: this.pickerClass,\n enableClose: false,\n enablePointerEvents: false,\n });\n\n overlay.backdropClick\n .pipe(takeUntil(this.calendarUnsubscribe))\n .subscribe(() => {\n /* istanbul ignore else */\n if (this.isOpen) {\n this.closePicker();\n }\n });\n\n this.addKeydownListner();\n\n overlay.attachTemplate(this.calendarTemplateRef);\n\n this.overlay = overlay;\n }\n\n private destroyOverlay(): void {\n /*istanbul ignore else*/\n if (this.overlay) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n }\n }\n\n private addKeydownListner(): void {\n this.overlayKeydownListner = fromEvent(window.document, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key?.toLowerCase();\n if (key === 'escape' && this.isOpen) {\n this.closePicker();\n }\n });\n }\n\n private removePickerEventListeners(): void {\n /* istanbul ignore else */\n if (this.calendarUnsubscribe) {\n this.calendarUnsubscribe.next();\n this.calendarUnsubscribe.complete();\n this.calendarUnsubscribe = undefined;\n }\n this.overlayKeydownListner?.unsubscribe();\n }\n\n private cancelCustomDatesSubscription(): void {\n if (this.customDatesSubscription) {\n this.customDatesSubscription.unsubscribe();\n this.customDatesSubscription = undefined;\n }\n }\n}\n","<div class=\"sky-datepicker\">\n <ng-container *ngIf=\"!inputBoxHostService\">\n <div class=\"sky-input-group\">\n <ng-container *ngTemplateOutlet=\"inputTemplateRef\"></ng-container>\n <ng-container *ngTemplateOutlet=\"triggerButtonTemplateRef\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n<ng-template #inputTemplateRef>\n <ng-content></ng-content>\n</ng-template>\n\n<ng-template #triggerButtonTemplateRef>\n <div class=\"sky-input-group-btn\">\n <button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-btn-default sky-input-group-datepicker-btn\"\n type=\"button\"\n [attr.aria-controls]=\"isOpen ? calendarId : null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-label]=\"\n 'skyux_datepicker_trigger_button_label' | skyLibResources\n \"\n [attr.id]=\"triggerButtonId\"\n [attr.title]=\"'skyux_datepicker_trigger_button_label' | skyLibResources\"\n [disabled]=\"disabled\"\n (click)=\"onTriggerButtonClick()\"\n #triggerButtonRef\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"calendar\" size=\"lg\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"calendar\"\n size=\"lg\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #calendarTemplateRef>\n <div\n class=\"sky-datepicker-calendar-container sky-shadow sky-elevation-4\"\n role=\"dialog\"\n [attr.aria-labelledby]=\"triggerButtonId\"\n [attr.id]=\"calendarId\"\n [class.sky-datepicker-hidden]=\"!isVisible\"\n #calendarRef\n >\n <sky-datepicker-calendar\n [customDates]=\"customDates\"\n [isDaypickerWaiting]=\"isDaypickerWaiting\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [startingDay]=\"startingDay\"\n (calendarDateRangeChange)=\"onCalendarDateRangeChange($event)\"\n (calendarModeChange)=\"onCalendarModeChange()\"\n (selectedDateChange)=\"onSelectedDateChange($event)\"\n >\n </sky-datepicker-calendar>\n </div>\n</ng-template>\n"]}
1
+ {"version":3,"file":"datepicker.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker.component.ts","../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EAGL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,eAAe,EAEf,qBAAqB,EAErB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAE,MAAM,MAAM,CA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AE;wBAC7B,IAAI,EAAE,UAAU;qBACjB;gBAOO,gBAAgB;sBAJvB,SAAS;uBAAC,kBAAkB,EAAE;wBAC7B,IAAI,EAAE,WAAW;wBACjB,MAAM,EAAE,IAAI;qBACb;gBAOO,wBAAwB;sBAJ/B,SAAS;uBAAC,0BAA0B,EAAE;wBACrC,IAAI,EAAE,WAAW;wBACjB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {\n SkyAffixAutoFitContext,\n SkyAffixService,\n SkyAffixer,\n SkyCoreAdapterService,\n SkyOverlayInstance,\n SkyOverlayService,\n} from '@skyux/core';\nimport { SkyInputBoxHostService } from '@skyux/forms';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { Subject, Subscription, fromEvent } from 'rxjs';\nimport { debounceTime, takeUntil } from 'rxjs/operators';\n\nimport { SkyDatepickerCalendarChange } from './datepicker-calendar-change';\nimport { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';\nimport { SkyDatepickerCustomDate } from './datepicker-custom-date';\n\nlet nextId = 0;\n\n/**\n * Creates the datepicker button and calendar.\n * You must wrap this component around an input with the `skyDatepickerInput` directive.\n */\n@Component({\n selector: 'sky-datepicker',\n templateUrl: './datepicker.component.html',\n styleUrls: ['./datepicker.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyDatepickerComponent implements OnDestroy, OnInit {\n /**\n * Adds a class to the datepicker.\n * @default \"\"\n */\n @Input()\n public pickerClass = '';\n\n /**\n * @internal\n * Indicates if the calendar button element or any of its children have focus.\n * @deprecated This property will be removed in the next major version release.\n */\n public get buttonIsFocused(): boolean {\n /* sanity check */\n /* istanbul ignore if */\n if (!this.triggerButtonRef) {\n return false;\n }\n const activeEl = document.activeElement;\n return this.triggerButtonRef.nativeElement === activeEl;\n }\n\n /**\n * @internal\n * Indicates if the calendar element or any of its children have focus.\n * @deprecated This property will be removed in the next major version release.\n */\n public get calendarIsFocused(): boolean {\n if (!this.calendarRef) {\n return false;\n }\n\n const focusedEl = document.activeElement;\n return this.calendarRef.nativeElement.contains(focusedEl);\n }\n\n /**\n * @internal\n * Indicates if the calendar element's visiblity property is 'visible'.\n * @deprecated This property will be removed in the next major version release.\n */\n public get calendarIsVisible(): boolean {\n return this.calendar ? this.calendar.isVisible : false;\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n public set disabled(value: boolean) {\n this._disabled = value;\n this.changeDetector.markForCheck();\n }\n\n public set selectedDate(value: Date) {\n this._selectedDate = value;\n if (this.calendar) {\n this.calendar.writeValue(this._selectedDate);\n }\n }\n\n /**\n * Fires when the range of displayed dates in the calendar changes. Provides the\n * current range of displayed dates and a mutable `customDate` property consumers can use\n * to modify individual dates on the calendar.\n */\n @Output()\n public calendarDateRangeChange = new EventEmitter<SkyDatepickerCalendarChange>();\n\n public calendarId: string;\n\n public customDates: SkyDatepickerCustomDate[] | undefined;\n\n public dateChange = new EventEmitter<Date>();\n\n public isDaypickerWaiting = false;\n\n public isOpen = false;\n\n public isVisible = false;\n\n public maxDate: Date;\n\n public minDate: Date;\n\n public startingDay: number;\n\n public triggerButtonId: string;\n\n @ViewChild(SkyDatepickerCalendarComponent)\n private calendar: SkyDatepickerCalendarComponent;\n\n @ViewChild('calendarRef', {\n read: ElementRef,\n })\n private set calendarRef(value: ElementRef) {\n if (value) {\n this._calendarRef = value;\n\n // Wait for the calendar component to render before gauging dimensions.\n setTimeout(() => {\n this.calendar.writeValue(this._selectedDate);\n\n this.destroyAffixer();\n this.createAffixer();\n\n setTimeout(() => {\n this.coreAdapter.getFocusableChildrenAndApplyFocus(\n this.calendarRef,\n '.sky-datepicker-calendar-inner',\n false\n );\n\n this.isVisible = true;\n this.changeDetector.markForCheck();\n });\n });\n }\n }\n\n private get calendarRef(): ElementRef {\n return this._calendarRef;\n }\n\n @ViewChild('calendarTemplateRef', {\n read: TemplateRef,\n })\n private calendarTemplateRef: TemplateRef<any>;\n\n @ViewChild('triggerButtonRef', {\n read: ElementRef,\n })\n private triggerButtonRef: ElementRef;\n\n @ViewChild('inputTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private inputTemplateRef: TemplateRef<any>;\n\n @ViewChild('triggerButtonTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private triggerButtonTemplateRef: TemplateRef<any>;\n\n private affixer: SkyAffixer;\n\n private calendarUnsubscribe: Subject<void>;\n\n private customDatesSubscription: Subscription;\n\n private ngUnsubscribe = new Subject();\n\n private overlay: SkyOverlayInstance;\n\n private overlayKeydownListner: Subscription;\n\n private _calendarRef: ElementRef;\n\n private _disabled = false;\n\n private _selectedDate: Date;\n\n constructor(\n private affixService: SkyAffixService,\n private changeDetector: ChangeDetectorRef,\n private coreAdapter: SkyCoreAdapterService,\n private overlayService: SkyOverlayService,\n @Optional() public inputBoxHostService?: SkyInputBoxHostService,\n @Optional() themeSvc?: SkyThemeService\n ) {\n const uniqueId = nextId++;\n this.calendarId = `sky-datepicker-calendar-${uniqueId}`;\n this.triggerButtonId = `sky-datepicker-button-${uniqueId}`;\n\n // Update icons when theme changes.\n themeSvc?.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnInit(): void {\n if (this.inputBoxHostService) {\n this.inputBoxHostService.populate({\n inputTemplate: this.inputTemplateRef,\n buttonsTemplate: this.triggerButtonTemplateRef,\n });\n }\n }\n\n public ngOnDestroy(): void {\n this.dateChange.complete();\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.removePickerEventListeners();\n this.destroyAffixer();\n this.destroyOverlay();\n }\n\n public onCalendarModeChange(): void {\n // Let the calendar populate in the DOM before recalculating placement.\n setTimeout(() => {\n this.affixer.reaffix();\n });\n }\n\n public onSelectedDateChange(value: Date): void {\n this.dateChange.emit(value);\n this.closePicker();\n }\n\n public onTriggerButtonClick(): void {\n if (this.isOpen) {\n this.closePicker();\n } else {\n this.openPicker();\n }\n }\n\n public onCalendarDateRangeChange(event: SkyDatepickerCalendarChange): void {\n /* istanbul ignore else */\n if (event) {\n this.cancelCustomDatesSubscription();\n\n const args: SkyDatepickerCalendarChange = {\n startDate: event.startDate,\n endDate: event.endDate,\n customDates: undefined,\n };\n this.calendarDateRangeChange.emit(args);\n // If consumer has added an observable to the args, watch for incoming custom dates.\n /* istanbul ignore else */\n if (args.customDates) {\n this.isDaypickerWaiting = true;\n // Avoid an ExpressionChangedAfterItHasBeenCheckedError.\n this.changeDetector.detectChanges();\n\n this.customDatesSubscription = args.customDates\n .pipe(debounceTime(250))\n .subscribe((result) => {\n this.customDates = result;\n this.isDaypickerWaiting = false;\n\n // Trigger change detection in child components to show changes in the calendar.\n this.changeDetector.markForCheck();\n });\n } else {\n // If consumer returns an undefined value after custom dates have\n // already ben established, remove custom dates.\n if (this.customDates) {\n this.customDates = undefined;\n // Avoid an ExpressionChangedAfterItHasBeenCheckedError.\n this.changeDetector.detectChanges();\n }\n }\n }\n }\n\n private closePicker() {\n this.destroyAffixer();\n this.destroyOverlay();\n this.removePickerEventListeners();\n this.triggerButtonRef.nativeElement.focus();\n this.isOpen = false;\n }\n\n private openPicker(): void {\n this.isVisible = false;\n this.changeDetector.markForCheck();\n\n this.removePickerEventListeners();\n this.calendarUnsubscribe = new Subject<void>();\n this.destroyOverlay();\n this.createOverlay();\n\n this.isOpen = true;\n this.changeDetector.markForCheck();\n }\n\n private createAffixer(): void {\n const affixer = this.affixService.createAffixer(this.calendarRef);\n\n // Hide calendar when trigger button is scrolled off screen.\n affixer.placementChange\n .pipe(takeUntil(this.calendarUnsubscribe))\n .subscribe((change) => {\n this.isVisible = change.placement !== null;\n this.changeDetector.markForCheck();\n });\n\n affixer.affixTo(this.triggerButtonRef.nativeElement, {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: 'right',\n isSticky: true,\n placement: 'below',\n });\n\n this.affixer = affixer;\n }\n\n private destroyAffixer(): void {\n /*istanbul ignore else*/\n if (this.affixer) {\n this.affixer.destroy();\n this.affixer = undefined;\n }\n }\n\n private createOverlay(): void {\n const overlay = this.overlayService.create({\n wrapperClass: this.pickerClass,\n enableClose: false,\n enablePointerEvents: false,\n });\n\n overlay.backdropClick\n .pipe(takeUntil(this.calendarUnsubscribe))\n .subscribe(() => {\n /* istanbul ignore else */\n if (this.isOpen) {\n this.closePicker();\n }\n });\n\n this.addKeydownListner();\n\n overlay.attachTemplate(this.calendarTemplateRef);\n\n this.overlay = overlay;\n }\n\n private destroyOverlay(): void {\n /*istanbul ignore else*/\n if (this.overlay) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n }\n }\n\n private addKeydownListner(): void {\n this.overlayKeydownListner = fromEvent(window.document, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key?.toLowerCase();\n if (key === 'escape' && this.isOpen) {\n this.closePicker();\n }\n });\n }\n\n private removePickerEventListeners(): void {\n /* istanbul ignore else */\n if (this.calendarUnsubscribe) {\n this.calendarUnsubscribe.next();\n this.calendarUnsubscribe.complete();\n this.calendarUnsubscribe = undefined;\n }\n this.overlayKeydownListner?.unsubscribe();\n }\n\n private cancelCustomDatesSubscription(): void {\n if (this.customDatesSubscription) {\n this.customDatesSubscription.unsubscribe();\n this.customDatesSubscription = undefined;\n }\n }\n}\n","<div class=\"sky-datepicker\">\n <ng-container *ngIf=\"!inputBoxHostService\">\n <div class=\"sky-input-group\">\n <ng-container *ngTemplateOutlet=\"inputTemplateRef\"></ng-container>\n <ng-container *ngTemplateOutlet=\"triggerButtonTemplateRef\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n<ng-template #inputTemplateRef>\n <ng-content></ng-content>\n</ng-template>\n\n<ng-template #triggerButtonTemplateRef>\n <div class=\"sky-input-group-btn\">\n <button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-btn-default sky-input-group-datepicker-btn\"\n type=\"button\"\n [attr.aria-controls]=\"isOpen ? calendarId : null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-label]=\"\n 'skyux_datepicker_trigger_button_label' | skyLibResources\n \"\n [attr.id]=\"triggerButtonId\"\n [attr.title]=\"'skyux_datepicker_trigger_button_label' | skyLibResources\"\n [disabled]=\"disabled\"\n (click)=\"onTriggerButtonClick()\"\n #triggerButtonRef\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"calendar\" size=\"lg\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"calendar\"\n size=\"lg\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #calendarTemplateRef>\n <div\n class=\"sky-datepicker-calendar-container sky-shadow sky-elevation-4\"\n role=\"dialog\"\n [attr.aria-labelledby]=\"triggerButtonId\"\n [attr.id]=\"calendarId\"\n [class.sky-datepicker-hidden]=\"!isVisible\"\n #calendarRef\n >\n <sky-datepicker-calendar\n [customDates]=\"customDates\"\n [isDaypickerWaiting]=\"isDaypickerWaiting\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [startingDay]=\"startingDay\"\n (calendarDateRangeChange)=\"onCalendarDateRangeChange($event)\"\n (calendarModeChange)=\"onCalendarModeChange()\"\n (selectedDateChange)=\"onSelectedDateChange($event)\"\n >\n </sky-datepicker-calendar>\n </div>\n</ng-template>\n"]}
@@ -1,23 +1,23 @@
1
- import { NgModule } from '@angular/core';
2
1
  import { CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
3
  import { FormsModule } from '@angular/forms';
4
4
  import { SkyAffixModule, SkyOverlayModule } from '@skyux/core';
5
5
  import { SkyI18nModule } from '@skyux/i18n';
6
6
  import { SkyIconModule, SkyWaitModule } from '@skyux/indicators';
7
+ import { SkyPopoverModule } from '@skyux/popovers';
7
8
  import { SkyThemeModule } from '@skyux/theme';
8
- import { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';
9
+ import { SkyDatetimeResourcesModule } from '../shared/sky-datetime-resources.module';
9
10
  import { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';
10
- import { SkyDayPickerComponent } from './daypicker.component';
11
- import { SkyMonthPickerComponent } from './monthpicker.component';
12
- import { SkyYearPickerComponent } from './yearpicker.component';
13
- import { SkyDatepickerComponent } from './datepicker.component';
14
- import { SkyDatepickerInputDirective } from './datepicker-input.directive';
11
+ import { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';
15
12
  import { SkyFuzzyDatepickerInputDirective } from './datepicker-input-fuzzy.directive';
16
- import { SkyDatetimeResourcesModule } from '../shared/sky-datetime-resources.module';
13
+ import { SkyDatepickerInputDirective } from './datepicker-input.directive';
14
+ import { SkyDatepickerComponent } from './datepicker.component';
15
+ import { SkyDatepickerService } from './datepicker.service';
17
16
  import { SkyDayPickerButtonComponent } from './daypicker-button.component';
18
17
  import { SkyDayPickerCellComponent } from './daypicker-cell.component';
19
- import { SkyPopoverModule } from '@skyux/popovers';
20
- import { SkyDatepickerService } from './datepicker.service';
18
+ import { SkyDayPickerComponent } from './daypicker.component';
19
+ import { SkyMonthPickerComponent } from './monthpicker.component';
20
+ import { SkyYearPickerComponent } from './yearpicker.component';
21
21
  import * as i0 from "@angular/core";
22
22
  export class SkyDatepickerModule {
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"datepicker.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC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ACtB,2BAA2B;QAC3B,gCAAgC;kHAIvB,mBAAmB,aAFnB,CAAC,oBAAoB,CAAC,YAlBxB;YACP,YAAY;YACZ,aAAa;YACb,WAAW;YACX,aAAa;YACb,0BAA0B;YAC1B,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,gBAAgB;YAChB,aAAa;SACd;4FASU,mBAAmB;kBAjC/B,QAAQ;mBAAC;oBACR,YAAY,EAAE;wBACZ,8BAA8B;wBAC9B,mCAAmC;wBACnC,qBAAqB;wBACrB,uBAAuB;wBACvB,sBAAsB;wBACtB,sBAAsB;wBACtB,2BAA2B;wBAC3B,gCAAgC;wBAChC,yBAAyB;wBACzB,2BAA2B;qBAC5B;oBACD,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,WAAW;wBACX,aAAa;wBACb,0BAA0B;wBAC1B,cAAc;wBACd,gBAAgB;wBAChB,cAAc;wBACd,gBAAgB;wBAChB,aAAa;qBACd;oBACD,OAAO,EAAE;wBACP,8BAA8B;wBAC9B,sBAAsB;wBACtB,2BAA2B;wBAC3B,gCAAgC;qBACjC;oBACD,SAAS,EAAE,CAAC,oBAAoB,CAAC;iBAClC","sourcesContent":["import { NgModule } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\n\nimport { FormsModule } from '@angular/forms';\n\nimport { SkyAffixModule, SkyOverlayModule } from '@skyux/core';\n\nimport { SkyI18nModule } from '@skyux/i18n';\n\nimport { SkyIconModule, SkyWaitModule } from '@skyux/indicators';\n\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';\n\nimport { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';\n\nimport { SkyDayPickerComponent } from './daypicker.component';\n\nimport { SkyMonthPickerComponent } from './monthpicker.component';\n\nimport { SkyYearPickerComponent } from './yearpicker.component';\n\nimport { SkyDatepickerComponent } from './datepicker.component';\n\nimport { SkyDatepickerInputDirective } from './datepicker-input.directive';\n\nimport { SkyFuzzyDatepickerInputDirective } from './datepicker-input-fuzzy.directive';\nimport { SkyDatetimeResourcesModule } from '../shared/sky-datetime-resources.module';\nimport { SkyDayPickerButtonComponent } from './daypicker-button.component';\nimport { SkyDayPickerCellComponent } from './daypicker-cell.component';\nimport { SkyPopoverModule } from '@skyux/popovers';\nimport { SkyDatepickerService } from './datepicker.service';\n\n@NgModule({\n declarations: [\n SkyDatepickerCalendarComponent,\n SkyDatepickerCalendarInnerComponent,\n SkyDayPickerComponent,\n SkyMonthPickerComponent,\n SkyYearPickerComponent,\n SkyDatepickerComponent,\n SkyDatepickerInputDirective,\n SkyFuzzyDatepickerInputDirective,\n SkyDayPickerCellComponent,\n SkyDayPickerButtonComponent,\n ],\n imports: [\n CommonModule,\n SkyI18nModule,\n FormsModule,\n SkyIconModule,\n SkyDatetimeResourcesModule,\n SkyAffixModule,\n SkyOverlayModule,\n SkyThemeModule,\n SkyPopoverModule,\n SkyWaitModule,\n ],\n exports: [\n SkyDatepickerCalendarComponent,\n SkyDatepickerComponent,\n SkyDatepickerInputDirective,\n SkyFuzzyDatepickerInputDirective,\n ],\n providers: [SkyDatepickerService],\n})\nexport class SkyDatepickerModule {}\n"]}
1
+ {"version":3,"file":"datepicker.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACn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c;YACd,gBAAgB;YAChB,aAAa;SACd;4FASU,mBAAmB;kBAjC/B,QAAQ;mBAAC;oBACR,YAAY,EAAE;wBACZ,8BAA8B;wBAC9B,mCAAmC;wBACnC,qBAAqB;wBACrB,uBAAuB;wBACvB,sBAAsB;wBACtB,sBAAsB;wBACtB,2BAA2B;wBAC3B,gCAAgC;wBAChC,yBAAyB;wBACzB,2BAA2B;qBAC5B;oBACD,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,WAAW;wBACX,aAAa;wBACb,0BAA0B;wBAC1B,cAAc;wBACd,gBAAgB;wBAChB,cAAc;wBACd,gBAAgB;wBAChB,aAAa;qBACd;oBACD,OAAO,EAAE;wBACP,8BAA8B;wBAC9B,sBAAsB;wBACtB,2BAA2B;wBAC3B,gCAAgC;qBACjC;oBACD,SAAS,EAAE,CAAC,oBAAoB,CAAC;iBAClC","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyAffixModule, SkyOverlayModule } from '@skyux/core';\nimport { SkyI18nModule } from '@skyux/i18n';\nimport { SkyIconModule, SkyWaitModule } from '@skyux/indicators';\nimport { SkyPopoverModule } from '@skyux/popovers';\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyDatetimeResourcesModule } from '../shared/sky-datetime-resources.module';\n\nimport { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';\nimport { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';\nimport { SkyFuzzyDatepickerInputDirective } from './datepicker-input-fuzzy.directive';\nimport { SkyDatepickerInputDirective } from './datepicker-input.directive';\nimport { SkyDatepickerComponent } from './datepicker.component';\nimport { SkyDatepickerService } from './datepicker.service';\nimport { SkyDayPickerButtonComponent } from './daypicker-button.component';\nimport { SkyDayPickerCellComponent } from './daypicker-cell.component';\nimport { SkyDayPickerComponent } from './daypicker.component';\nimport { SkyMonthPickerComponent } from './monthpicker.component';\nimport { SkyYearPickerComponent } from './yearpicker.component';\n\n@NgModule({\n declarations: [\n SkyDatepickerCalendarComponent,\n SkyDatepickerCalendarInnerComponent,\n SkyDayPickerComponent,\n SkyMonthPickerComponent,\n SkyYearPickerComponent,\n SkyDatepickerComponent,\n SkyDatepickerInputDirective,\n SkyFuzzyDatepickerInputDirective,\n SkyDayPickerCellComponent,\n SkyDayPickerButtonComponent,\n ],\n imports: [\n CommonModule,\n SkyI18nModule,\n FormsModule,\n SkyIconModule,\n SkyDatetimeResourcesModule,\n SkyAffixModule,\n SkyOverlayModule,\n SkyThemeModule,\n SkyPopoverModule,\n SkyWaitModule,\n ],\n exports: [\n SkyDatepickerCalendarComponent,\n SkyDatepickerComponent,\n SkyDatepickerInputDirective,\n SkyFuzzyDatepickerInputDirective,\n ],\n providers: [SkyDatepickerService],\n})\nexport class SkyDatepickerModule {}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"daypicker-button.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/daypicker-button.component.ts","../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/daypicker-button.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;;;;AAI5F;;GAEG;AAMH,MAAM,OAAO,2BAA2B;IAOtC,YAAmB,UAA+C;QAA/C,eAAU,GAAV,UAAU,CAAqC;IAAG,CAAC;;yHAP3D,2BAA2B;6GAA3B,2BAA2B,sFCdxC,0lBAkBA;4FDJa,2BAA2B;kBALvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,WAAW,EAAE,iCAAiC;oBAC9C,SAAS,EAAE,CAAC,mCAAmC,CAAC;iBACjD;0HAMQ,IAAI;sBADV,KAAK","sourcesContent":["import { Component, Input } from '@angular/core';\n\nimport { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';\n\nimport { SkyDatepickerDate } from './datepicker-date';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-daypicker-button',\n templateUrl: 'daypicker-button.component.html',\n styleUrls: ['./daypicker-button.component.scss'],\n})\nexport class SkyDayPickerButtonComponent {\n /**\n * Specifies the date this picker button will represent on the calendar.\n */\n @Input()\n public date: SkyDatepickerDate;\n\n constructor(public datepicker: SkyDatepickerCalendarInnerComponent) {}\n}\n","<button\n class=\"sky-btn sky-btn-sm sky-btn-default sky-datepicker-btn-date\"\n tabindex=\"-1\"\n type=\"button\"\n [disabled]=\"date.disabled\"\n [ngClass]=\"{\n 'sky-datepicker-btn-selected': date.selected,\n 'sky-btn-disabled': date.disabled,\n 'sky-btn-active': datepicker.isActive(date),\n 'sky-datepicker-btn-disabled': date.disabled,\n 'sky-datepicker-btn-key-date': date.keyDate\n }\"\n (click)=\"datepicker.selectCalendar($event, date.date, true)\"\n>\n <span [ngClass]=\"{ 'sky-datepicker-secondary': date.secondary }\">\n {{ date.label }}\n </span>\n</button>\n"]}
1
+ {"version":3,"file":"daypicker-button.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/daypicker-button.component.ts","../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/daypicker-button.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;;;;AAG5F;;GAEG;AAMH,MAAM,OAAO,2BAA2B;IAOtC,YAAmB,UAA+C;QAA/C,eAAU,GAAV,UAAU,CAAqC;IAAG,CAAC;;yHAP3D,2BAA2B;6GAA3B,2BAA2B,sFCbxC,0lBAkBA;4FDLa,2BAA2B;kBALvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,WAAW,EAAE,iCAAiC;oBAC9C,SAAS,EAAE,CAAC,mCAAmC,CAAC;iBACjD;0HAMQ,IAAI;sBADV,KAAK","sourcesContent":["import { Component, Input } from '@angular/core';\n\nimport { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';\nimport { SkyDatepickerDate } from './datepicker-date';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-daypicker-button',\n templateUrl: 'daypicker-button.component.html',\n styleUrls: ['./daypicker-button.component.scss'],\n})\nexport class SkyDayPickerButtonComponent {\n /**\n * Specifies the date this picker button will represent on the calendar.\n */\n @Input()\n public date: SkyDatepickerDate;\n\n constructor(public datepicker: SkyDatepickerCalendarInnerComponent) {}\n}\n","<button\n class=\"sky-btn sky-btn-sm sky-btn-default sky-datepicker-btn-date\"\n tabindex=\"-1\"\n type=\"button\"\n [disabled]=\"date.disabled\"\n [ngClass]=\"{\n 'sky-datepicker-btn-selected': date.selected,\n 'sky-btn-disabled': date.disabled,\n 'sky-btn-active': datepicker.isActive(date),\n 'sky-datepicker-btn-disabled': date.disabled,\n 'sky-datepicker-btn-key-date': date.keyDate\n }\"\n (click)=\"datepicker.selectCalendar($event, date.date, true)\"\n>\n <span [ngClass]=\"{ 'sky-datepicker-secondary': date.secondary }\">\n {{ date.label }}\n </span>\n</button>\n"]}
@@ -1,7 +1,7 @@
1
1
  import { ChangeDetectionStrategy, Component, Input, } from '@angular/core';
2
2
  import { SkyPopoverMessageType } from '@skyux/popovers';
3
- import { takeUntil } from 'rxjs/operators';
4
3
  import { Subject } from 'rxjs';
4
+ import { takeUntil } from 'rxjs/operators';
5
5
  import { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';
6
6
  import { SkyDatepickerService } from './datepicker.service';
7
7
  import * as i0 from "@angular/core";
@@ -1 +1 @@
1
- {"version":3,"file":"daypicker-cell.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/daypicker-cell.component.ts","../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/daypicker-cell.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACv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AE;YACtB,yEAAyE;YACzE,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;SAC5B;IACH,CAAC;IAEM,eAAe;QACpB,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACzC;aAAM;YACL,OAAO,EAAE,CAAC;SACX;IACH,CAAC;IAEO,WAAW;QACjB,0BAA0B;QAC1B,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAC;SACpE;IACH,CAAC;IAEO,WAAW;QACjB,0BAA0B;QAC1B,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACxC;;eAEG;YACH,UAAU,CAAC,GAAG,EAAE;gBACd,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;oBAC3D,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,IAAI,EAAE,CAAC,CAAC;iBACnE;YACH,CAAC,EAAE,GAAG,CAAC,CAAC;SACT;IACH,CAAC;;uHA/HU,yBAAyB;2GAAzB,yBAAyB,kIC5BtC,o9BAiCA;4FDLa,yBAAyB;kBALrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,WAAW,EAAE,+BAA+B;oBAC5C,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;6JAMQ,oBAAoB;sBAD1B,KAAK;gBAOC,IAAI;sBADV,KAAK","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnDestroy,\n OnInit,\n} from '@angular/core';\n\nimport { SkyPopoverMessage, SkyPopoverMessageType } from '@skyux/popovers';\n\nimport { takeUntil } from 'rxjs/operators';\n\nimport { Subject } from 'rxjs';\n\nimport { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';\n\nimport { SkyDatepickerDate } from './datepicker-date';\n\nimport { SkyDatepickerService } from './datepicker.service';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-daypicker-cell',\n templateUrl: 'daypicker-cell.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyDayPickerCellComponent implements OnInit, OnDestroy {\n /**\n * Specifies if the active date has been changed.\n */\n @Input()\n public activeDateHasChanged: boolean;\n\n /**\n * Specifies the date this picker cell will represent on the calendar.\n */\n @Input()\n public date: SkyDatepickerDate;\n\n public hasTooltip: boolean = false;\n\n public popoverController = new Subject<SkyPopoverMessage>();\n\n private activeUid: string = '';\n\n private cancelPopover: boolean = false;\n\n private popoverOpen: boolean = false;\n\n private ngUnsubscribe = new Subject<void>();\n\n public constructor(\n private datepicker: SkyDatepickerCalendarInnerComponent,\n private datepickerService: SkyDatepickerService\n ) {}\n\n public ngOnInit(): void {\n this.hasTooltip =\n this.date.keyDate &&\n this.date.keyDateText &&\n this.date.keyDateText.length > 0 &&\n this.date.keyDateText[0].length > 0;\n\n // show the tooltip if this is the active date and is not the\n // initial active date (activeDateHasChanged)\n if (\n this.datepicker.isActive(this.date) &&\n this.activeDateHasChanged &&\n this.hasTooltip\n ) {\n this.activeUid = this.date.uid;\n this.showTooltip();\n }\n\n if (this.hasTooltip) {\n this.datepickerService.keyDatePopoverStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((date) => {\n if (date) {\n this.activeUid = date.uid;\n } else {\n this.activeUid = '';\n }\n // If this day has an open popover and they have moved off of the day close the popover.\n if (this.date.uid !== this.activeUid) {\n this.hideTooltip();\n }\n });\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public onDayMouseenter(): void {\n this.cancelPopover = false;\n if (this.hasTooltip) {\n this.showTooltip();\n this.datepickerService.keyDatePopoverStream.next(this.date);\n }\n }\n\n public onDayMouseleave(): void {\n this.cancelPopover = true;\n if (this.hasTooltip) {\n this.hideTooltip();\n }\n this.datepickerService.keyDatePopoverStream.next(undefined);\n }\n\n public onPopoverClosed(): void {\n this.popoverOpen = false;\n }\n\n public onPopoverOpened(): void {\n this.popoverOpen = true;\n /* istanbul ignore else */\n if (this.cancelPopover) {\n // If the popover gets opened just as a mouseout event happens, close it.\n this.hideTooltip();\n this.cancelPopover = false;\n }\n }\n\n public getKeyDateLabel(): string {\n if (this.hasTooltip) {\n return this.date.keyDateText.join(', ');\n } else {\n return '';\n }\n }\n\n private hideTooltip(): void {\n /* istanbul ignore else */\n if (this.popoverOpen) {\n this.popoverController.next({ type: SkyPopoverMessageType.Close });\n }\n }\n\n private showTooltip(): void {\n /* istanbul ignore else */\n if (this.hasTooltip && !this.popoverOpen) {\n /**\n * Delay 1/2 second before opening the popover as long as mouse hasn't moved off the date.\n */\n setTimeout(() => {\n if (!this.cancelPopover && this.activeUid === this.date.uid) {\n this.popoverController.next({ type: SkyPopoverMessageType.Open });\n }\n }, 500);\n }\n }\n}\n","<div\n *ngIf=\"hasTooltip\"\n class=\"sky-daypicker-cell\"\n [attr.aria-label]=\"getKeyDateLabel()\"\n [skyPopover]=\"dayInfoPopover\"\n skyPopoverPlacement=\"left\"\n [skyPopoverMessageStream]=\"popoverController\"\n (mouseenter)=\"onDayMouseenter()\"\n (mouseleave)=\"onDayMouseleave()\"\n>\n <ng-container *ngTemplateOutlet=\"daypickerButtonTemplateRef\"></ng-container>\n <sky-popover\n (popoverClosed)=\"onPopoverClosed()\"\n (popoverOpened)=\"onPopoverOpened()\"\n #dayInfoPopover\n >\n <div *ngFor=\"let text of date.keyDateText\">\n {{ text }}\n </div>\n </sky-popover>\n</div>\n<div\n *ngIf=\"!hasTooltip\"\n class=\"sky-daypicker-cell\"\n (mouseenter)=\"onDayMouseenter()\"\n (mouseleave)=\"onDayMouseleave()\"\n>\n <ng-container *ngTemplateOutlet=\"daypickerButtonTemplateRef\"></ng-container>\n</div>\n\n<ng-template #daypickerButtonTemplateRef>\n <sky-daypicker-button [date]=\"date\"> </sky-daypicker-button>\n</ng-template>\n"]}
1
+ {"version":3,"file":"daypicker-cell.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/daypicker-cell.component.ts","../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/daypicker-cell.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,KAAK,GAGN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAqB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAE5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;;;;;;;AAE5D;;GAEG;AAMH,MAAM,OAAO,yBAAyB;IAyBpC,YACU,UAA+C,EAC/C,iBAAuC;QADvC,eAAU,GAAV,UAAU,CAAqC;QAC/C,sBAAiB,GAAjB,iBAAiB,CAAsB;QAd1C,eAAU,GAAG,KAAK,CAAC;QAEnB,sBAAiB,GAAG,IAAI,OAAO,EAAqB,CAAC;QAEpD,cAAS,GAAG,EAAE,CAAC;QAEf,kBAAa,GAAG,KAAK,CAAC;QAEtB,gBAAW,GAAG,KAAK,CAAC;QAEpB,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;IAKzC,CAAC;IAEG,QAAQ;QACb,IAAI,CAAC,UAAU;YACb,IAAI,CAAC,IAAI,CAAC,OAAO;gBACjB,IAAI,CAAC,IAAI,CAAC,WAAW;gBACrB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC;gBAChC,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;uHA/HU,yBAAyB;2GAAzB,yBAAyB,kICxBtC,o9BAiCA;4FDTa,yBAAyB;kBALrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,WAAW,EAAE,+BAA+B;oBAC5C,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;6JAMQ,oBAAoB;sBAD1B,KAAK;gBAOC,IAAI;sBADV,KAAK","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { SkyPopoverMessage, SkyPopoverMessageType } from '@skyux/popovers';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';\nimport { SkyDatepickerDate } from './datepicker-date';\nimport { SkyDatepickerService } from './datepicker.service';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-daypicker-cell',\n templateUrl: 'daypicker-cell.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyDayPickerCellComponent implements OnInit, OnDestroy {\n /**\n * Specifies if the active date has been changed.\n */\n @Input()\n public activeDateHasChanged: boolean;\n\n /**\n * Specifies the date this picker cell will represent on the calendar.\n */\n @Input()\n public date: SkyDatepickerDate;\n\n public hasTooltip = false;\n\n public popoverController = new Subject<SkyPopoverMessage>();\n\n private activeUid = '';\n\n private cancelPopover = false;\n\n private popoverOpen = false;\n\n private ngUnsubscribe = new Subject<void>();\n\n public constructor(\n private datepicker: SkyDatepickerCalendarInnerComponent,\n private datepickerService: SkyDatepickerService\n ) {}\n\n public ngOnInit(): void {\n this.hasTooltip =\n this.date.keyDate &&\n this.date.keyDateText &&\n this.date.keyDateText.length > 0 &&\n this.date.keyDateText[0].length > 0;\n\n // show the tooltip if this is the active date and is not the\n // initial active date (activeDateHasChanged)\n if (\n this.datepicker.isActive(this.date) &&\n this.activeDateHasChanged &&\n this.hasTooltip\n ) {\n this.activeUid = this.date.uid;\n this.showTooltip();\n }\n\n if (this.hasTooltip) {\n this.datepickerService.keyDatePopoverStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((date) => {\n if (date) {\n this.activeUid = date.uid;\n } else {\n this.activeUid = '';\n }\n // If this day has an open popover and they have moved off of the day close the popover.\n if (this.date.uid !== this.activeUid) {\n this.hideTooltip();\n }\n });\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public onDayMouseenter(): void {\n this.cancelPopover = false;\n if (this.hasTooltip) {\n this.showTooltip();\n this.datepickerService.keyDatePopoverStream.next(this.date);\n }\n }\n\n public onDayMouseleave(): void {\n this.cancelPopover = true;\n if (this.hasTooltip) {\n this.hideTooltip();\n }\n this.datepickerService.keyDatePopoverStream.next(undefined);\n }\n\n public onPopoverClosed(): void {\n this.popoverOpen = false;\n }\n\n public onPopoverOpened(): void {\n this.popoverOpen = true;\n /* istanbul ignore else */\n if (this.cancelPopover) {\n // If the popover gets opened just as a mouseout event happens, close it.\n this.hideTooltip();\n this.cancelPopover = false;\n }\n }\n\n public getKeyDateLabel(): string {\n if (this.hasTooltip) {\n return this.date.keyDateText.join(', ');\n } else {\n return '';\n }\n }\n\n private hideTooltip(): void {\n /* istanbul ignore else */\n if (this.popoverOpen) {\n this.popoverController.next({ type: SkyPopoverMessageType.Close });\n }\n }\n\n private showTooltip(): void {\n /* istanbul ignore else */\n if (this.hasTooltip && !this.popoverOpen) {\n /**\n * Delay 1/2 second before opening the popover as long as mouse hasn't moved off the date.\n */\n setTimeout(() => {\n if (!this.cancelPopover && this.activeUid === this.date.uid) {\n this.popoverController.next({ type: SkyPopoverMessageType.Open });\n }\n }, 500);\n }\n }\n}\n","<div\n *ngIf=\"hasTooltip\"\n class=\"sky-daypicker-cell\"\n [attr.aria-label]=\"getKeyDateLabel()\"\n [skyPopover]=\"dayInfoPopover\"\n skyPopoverPlacement=\"left\"\n [skyPopoverMessageStream]=\"popoverController\"\n (mouseenter)=\"onDayMouseenter()\"\n (mouseleave)=\"onDayMouseleave()\"\n>\n <ng-container *ngTemplateOutlet=\"daypickerButtonTemplateRef\"></ng-container>\n <sky-popover\n (popoverClosed)=\"onPopoverClosed()\"\n (popoverOpened)=\"onPopoverOpened()\"\n #dayInfoPopover\n >\n <div *ngFor=\"let text of date.keyDateText\">\n {{ text }}\n </div>\n </sky-popover>\n</div>\n<div\n *ngIf=\"!hasTooltip\"\n class=\"sky-daypicker-cell\"\n (mouseenter)=\"onDayMouseenter()\"\n (mouseleave)=\"onDayMouseleave()\"\n>\n <ng-container *ngTemplateOutlet=\"daypickerButtonTemplateRef\"></ng-container>\n</div>\n\n<ng-template #daypickerButtonTemplateRef>\n <sky-daypicker-button [date]=\"date\"> </sky-daypicker-button>\n</ng-template>\n"]}
@@ -46,7 +46,7 @@ export class SkyDayPickerComponent {
46
46
  this.ngUnsubscribe.complete();
47
47
  }
48
48
  getDates(startDate, n) {
49
- let dates = new Array(n);
49
+ const dates = new Array(n);
50
50
  let current = new Date(startDate.getTime());
51
51
  let i = 0;
52
52
  let date;
@@ -59,17 +59,17 @@ export class SkyDayPickerComponent {
59
59
  return dates;
60
60
  }
61
61
  compareDays(date1, date2) {
62
- let d1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());
63
- let d2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
62
+ const d1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());
63
+ const d2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
64
64
  return d1.getTime() - d2.getTime();
65
65
  }
66
66
  refreshDayView() {
67
- let year = this.datepicker.activeDate.getFullYear();
68
- let month = this.datepicker.activeDate.getMonth();
69
- let firstDayOfMonth = new Date(year, month, 1);
70
- let difference = this.datepicker.startingDay - firstDayOfMonth.getDay();
71
- let numDisplayedFromPreviousMonth = difference > 0 ? 7 - difference : -difference;
72
- let firstDate = new Date(firstDayOfMonth.getTime());
67
+ const year = this.datepicker.activeDate.getFullYear();
68
+ const month = this.datepicker.activeDate.getMonth();
69
+ const firstDayOfMonth = new Date(year, month, 1);
70
+ const difference = this.datepicker.startingDay - firstDayOfMonth.getDay();
71
+ const numDisplayedFromPreviousMonth = difference > 0 ? 7 - difference : -difference;
72
+ const firstDate = new Date(firstDayOfMonth.getTime());
73
73
  if (this.datepicker.activeDate.getDate() !== this.initialDate) {
74
74
  this.activeDateHasChanged = true;
75
75
  }
@@ -79,10 +79,10 @@ export class SkyDayPickerComponent {
79
79
  firstDate.setDate(-numDisplayedFromPreviousMonth + 1);
80
80
  }
81
81
  // 42 is the number of days on a six-week calendar
82
- let days = this.getDates(firstDate, 42);
83
- let pickerDates = [];
82
+ const days = this.getDates(firstDate, 42);
83
+ const pickerDates = [];
84
84
  for (let i = 0; i < 42; i++) {
85
- let _dateObject = this.datepicker.createDateObject(days[i], this.datepicker.formatDay, days[i].getMonth() !== month, this.datepicker.datepickerId + '-' + i);
85
+ const _dateObject = this.datepicker.createDateObject(days[i], this.datepicker.formatDay, days[i].getMonth() !== month, this.datepicker.datepickerId + '-' + i);
86
86
  pickerDates[i] = _dateObject;
87
87
  }
88
88
  this.labels = [];
@@ -119,7 +119,7 @@ export class SkyDayPickerComponent {
119
119
  date = date + 7;
120
120
  }
121
121
  else if (key === 'pageup' || key === 'pagedown') {
122
- let month = this.datepicker.activeDate.getMonth() + (key === 'pageup' ? -1 : 1);
122
+ const month = this.datepicker.activeDate.getMonth() + (key === 'pageup' ? -1 : 1);
123
123
  this.datepicker.activeDate.setMonth(month, 1);
124
124
  date = Math.min(this.getDaysInMonth(this.datepicker.activeDate.getFullYear(), this.datepicker.activeDate.getMonth()), date);
125
125
  }