igniteui-webcomponents 6.3.2 → 6.3.3

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.
@@ -6,14 +6,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  var IgcDatePickerComponent_1;
8
8
  import { html, nothing } from 'lit';
9
- import { property, query, queryAssignedElements } from 'lit/decorators.js';
9
+ import { property, query } from 'lit/decorators.js';
10
10
  import { ifDefined } from 'lit/directives/if-defined.js';
11
11
  import { addThemingController } from '../../theming/theming-controller.js';
12
12
  import IgcCalendarComponent, { focusActiveDate } from '../calendar/calendar.js';
13
- import { convertToDate } from '../calendar/helpers.js';
14
- import { DateRangeType, } from '../calendar/types.js';
13
+ import { convertToDate, createDateConstraints } from '../calendar/helpers.js';
15
14
  import { addKeybindings, altKey, arrowDown, arrowUp, escapeKey, } from '../common/controllers/key-bindings.js';
16
15
  import { addRootClickController } from '../common/controllers/root-click.js';
16
+ import { addSlotController, setSlots } from '../common/controllers/slot.js';
17
17
  import { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';
18
18
  import { shadowOptions } from '../common/decorators/shadow-options.js';
19
19
  import { watch } from '../common/decorators/watch.js';
@@ -24,7 +24,7 @@ import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
24
24
  import { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';
25
25
  import { FormValueDateTimeTransformers } from '../common/mixins/forms/form-transformers.js';
26
26
  import { createFormValueState } from '../common/mixins/forms/form-value.js';
27
- import { addSafeEventListener, createCounter, findElementFromEventPath, isEmpty, } from '../common/util.js';
27
+ import { addSafeEventListener, bindIf, equal, findElementFromEventPath, } from '../common/util.js';
28
28
  import IgcDateTimeInputComponent from '../date-time-input/date-time-input.js';
29
29
  import { DateTimeUtil } from '../date-time-input/date-util.js';
30
30
  import IgcDialogComponent from '../dialog/dialog.js';
@@ -36,6 +36,8 @@ import { styles } from './themes/date-picker.base.css.js';
36
36
  import { styles as shared } from './themes/shared/date-picker.common.css.js';
37
37
  import { all } from './themes/themes.js';
38
38
  import { datePickerValidators } from './validators.js';
39
+ let nextId = 1;
40
+ const Slots = setSlots('prefix', 'suffix', 'helper-text', 'bad-input', 'value-missing', 'range-overflow', 'range-underflow', 'custom-error', 'invalid', 'title', 'header-date', 'clear-icon', 'calendar-icon', 'calendar-icon-open', 'actions');
39
41
  let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociatedRequiredMixin(EventEmitterMixin(IgcBaseComboBoxLikeComponent)) {
40
42
  static { IgcDatePickerComponent_1 = this; }
41
43
  static { this.tagName = 'igc-date-picker'; }
@@ -43,13 +45,15 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
43
45
  static register() {
44
46
  registerComponent(IgcDatePickerComponent_1, IgcCalendarComponent, IgcDateTimeInputComponent, IgcFocusTrapComponent, IgcIconComponent, IgcPopoverComponent, IgcDialogComponent, IgcValidationContainerComponent);
45
47
  }
46
- static { this._increment = createCounter(); }
47
48
  get __validators() {
48
49
  return datePickerValidators;
49
50
  }
50
51
  get _isDropDown() {
51
52
  return this.mode === 'dropdown';
52
53
  }
54
+ get _isMaterial() {
55
+ return this._themes.theme === 'material';
56
+ }
53
57
  set value(value) {
54
58
  this._formValue.setValueAndFormState(value);
55
59
  }
@@ -100,11 +104,16 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
100
104
  }
101
105
  _openChange() {
102
106
  this._rootClickController.update();
107
+ if (this.open) {
108
+ this._oldValue = this.value;
109
+ }
103
110
  }
104
111
  constructor() {
105
112
  super();
106
- this._inputId = `date-picker-${IgcDatePickerComponent_1._increment()}`;
113
+ this._inputId = `date-picker-${nextId++}`;
107
114
  this._themes = addThemingController(this, all);
115
+ this._slots = addSlotController(this, { slots: Slots });
116
+ this._oldValue = null;
108
117
  this._activeDate = null;
109
118
  this._min = null;
110
119
  this._max = null;
@@ -138,29 +147,8 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
138
147
  .set([altKey, arrowUp], this._onEscapeKey)
139
148
  .set(escapeKey, this._onEscapeKey);
140
149
  }
141
- createRenderRoot() {
142
- const root = super.createRenderRoot();
143
- root.addEventListener('slotchange', () => this.requestUpdate());
144
- return root;
145
- }
146
150
  _setDateConstraints() {
147
- const dates = [];
148
- if (this._min) {
149
- dates.push({
150
- type: DateRangeType.Before,
151
- dateRange: [this._min],
152
- });
153
- }
154
- if (this._max) {
155
- dates.push({
156
- type: DateRangeType.After,
157
- dateRange: [this._max],
158
- });
159
- }
160
- if (!isEmpty(this._disabledDates ?? [])) {
161
- dates.push(...this.disabledDates);
162
- }
163
- this._dateConstraints = isEmpty(dates) ? undefined : dates;
151
+ this._dateConstraints = createDateConstraints(this.min, this.max, this.disabledDates);
164
152
  }
165
153
  async _shouldCloseCalendarDropdown() {
166
154
  if (!this.keepOpenOnSelect && (await this._hide(true))) {
@@ -176,6 +164,11 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
176
164
  _handleFocusOut({ relatedTarget }) {
177
165
  if (!this.contains(relatedTarget)) {
178
166
  this._handleBlur();
167
+ const readOnly = !this._isDropDown || this.readOnly || this.nonEditable;
168
+ if (readOnly && !equal(this.value, this._oldValue)) {
169
+ this.emitEvent('igcChange', { detail: this.value });
170
+ this._oldValue = this.value;
171
+ }
179
172
  }
180
173
  }
181
174
  _handlerCalendarIconSlotPointerDown(event) {
@@ -226,12 +219,14 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
226
219
  }
227
220
  _handleDialogClosing(event) {
228
221
  event.stopPropagation();
222
+ this._oldValue = this.value;
229
223
  this._hide(true);
230
224
  }
231
225
  _handleDialogClosed(event) {
232
226
  event.stopPropagation();
233
227
  }
234
228
  clear() {
229
+ this._oldValue = this.value;
235
230
  this.value = null;
236
231
  this._input?.clear();
237
232
  }
@@ -257,7 +252,7 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
257
252
  <span
258
253
  slot="suffix"
259
254
  part="clear-icon"
260
- @click=${this.readOnly ? nothing : this.clear}
255
+ @click=${bindIf(!this.readOnly, this.clear)}
261
256
  >
262
257
  <slot name="clear-icon">
263
258
  <igc-icon
@@ -280,7 +275,7 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
280
275
  slot="prefix"
281
276
  part=${state}
282
277
  @pointerdown=${this._handlerCalendarIconSlotPointerDown}
283
- @click=${this.readOnly ? nothing : this.handleAnchorClick}
278
+ @click=${bindIf(!this.readOnly, this.handleAnchorClick)}
284
279
  >
285
280
  <slot name=${state}>${defaultIcon}</slot>
286
281
  </span>
@@ -290,21 +285,25 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
290
285
  if (this._isDropDown) {
291
286
  return nothing;
292
287
  }
293
- const hasHeaderDate = isEmpty(this._headerSlotItems) ? '' : 'header-date';
288
+ const hasHeaderDate = this._slots.hasAssignedElements('header-date');
294
289
  return html `
295
290
  <slot name="title" slot="title">
296
291
  ${this.resourceStrings.selectDate}
297
292
  </slot>
298
- <slot name="header-date" slot=${hasHeaderDate}></slot>
293
+ <slot
294
+ name="header-date"
295
+ slot=${bindIf(hasHeaderDate, 'header-date')}
296
+ ></slot>
299
297
  `;
300
298
  }
301
299
  _renderCalendar(id) {
302
300
  const hideHeader = this._isDropDown ? true : this.hideHeader;
301
+ const isInert = !this.open || this.disabled;
303
302
  return html `
304
303
  <igc-calendar
305
304
  aria-labelledby=${id}
306
305
  role="dialog"
307
- .inert=${!this.open || this.disabled}
306
+ .inert=${isInert}
308
307
  ?show-week-numbers=${this.showWeekNumbers}
309
308
  ?hide-outside-days=${this.hideOutsideDays}
310
309
  ?hide-header=${hideHeader}
@@ -329,19 +328,23 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
329
328
  `;
330
329
  }
331
330
  _renderActions() {
332
- const hasActions = !isEmpty(this._actions);
333
- const slot = this._isDropDown || hasActions ? undefined : 'footer';
331
+ const hasActions = this._slots.hasAssignedElements('actions');
334
332
  return html `
335
- <div part="actions" ?hidden=${!hasActions} slot=${ifDefined(slot)}>
333
+ <div
334
+ part="actions"
335
+ ?hidden=${!hasActions}
336
+ slot=${bindIf(!(this._isDropDown || hasActions), 'footer')}
337
+ >
336
338
  <slot name="actions"></slot>
337
339
  </div>
338
340
  `;
339
341
  }
340
342
  _renderPicker(id) {
343
+ const isDisabled = !this.open || this.disabled;
341
344
  return this._isDropDown
342
345
  ? html `
343
346
  <igc-popover ?open=${this.open} anchor=${id} flip shift>
344
- <igc-focus-trap ?disabled=${!this.open || this.disabled}>
347
+ <igc-focus-trap ?disabled=${isDisabled}>
345
348
  ${this._renderCalendar(id)}${this._renderActions()}
346
349
  </igc-focus-trap>
347
350
  </igc-popover>
@@ -368,7 +371,7 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
368
371
  <label
369
372
  part="label"
370
373
  for=${id}
371
- @click=${isDisabled ? nothing : this.handleAnchorClick}
374
+ @click=${bindIf(!isDisabled, this.handleAnchorClick)}
372
375
  >
373
376
  ${this.label}
374
377
  </label>
@@ -381,14 +384,14 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
381
384
  _renderInput(id) {
382
385
  const format = DateTimeUtil.predefinedToDateDisplayFormat(this._displayFormat);
383
386
  const readOnly = !this._isDropDown || this.readOnly || this.nonEditable;
384
- const prefix = isEmpty(this._prefixes) ? undefined : 'prefix';
385
- const suffix = isEmpty(this._suffixes) ? undefined : 'suffix';
386
- const isMaterial = this._themes.theme === 'material';
387
+ const hasPrefix = this._slots.hasAssignedElements('prefix');
388
+ const hasSuffix = this._slots.hasAssignedElements('suffix');
389
+ const hasClickHandler = !(this._isDropDown || this.readOnly);
387
390
  return html `
388
391
  <igc-date-time-input
389
392
  id=${id}
390
393
  aria-haspopup="dialog"
391
- label=${ifDefined(isMaterial ? this.label : undefined)}
394
+ label=${bindIf(this._isMaterial, this.label)}
392
395
  input-format=${ifDefined(this._inputFormat)}
393
396
  display-format=${ifDefined(format)}
394
397
  ?disabled=${this.disabled}
@@ -404,24 +407,22 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends FormAssociated
404
407
  .invalid=${this.invalid}
405
408
  @igcChange=${this._handleInputChangeEvent}
406
409
  @igcInput=${this._handleInputEvent}
407
- @click=${this._isDropDown || this.readOnly
408
- ? nothing
409
- : this._handleInputClick}
410
+ @click=${bindIf(hasClickHandler, this._handleInputClick)}
410
411
  exportparts="input, label, prefix, suffix"
411
412
  >
412
413
  ${this._renderCalendarIcon()}
413
- <slot name="prefix" slot=${ifDefined(prefix)}></slot>
414
+ <slot name="prefix" slot=${bindIf(hasPrefix, 'prefix')}></slot>
414
415
  ${this._renderClearIcon()}
415
- <slot name="suffix" slot=${ifDefined(suffix)}></slot>
416
+ <slot name="suffix" slot=${bindIf(hasSuffix, 'suffix')}></slot>
416
417
  </igc-date-time-input>
417
418
  `;
418
419
  }
419
420
  render() {
420
421
  const id = this.id || this._inputId;
421
- const isMaterial = this._themes.theme === 'material';
422
422
  return html `
423
- ${isMaterial ? nothing : this._renderLabel(id)} ${this._renderInput(id)}
424
- ${this._renderPicker(id)} ${this._renderHelperText()}
423
+ ${this._isMaterial ? nothing : this._renderLabel(id)}
424
+ ${this._renderInput(id)} ${this._renderPicker(id)}
425
+ ${this._renderHelperText()}
425
426
  `;
426
427
  }
427
428
  };
@@ -431,18 +432,6 @@ __decorate([
431
432
  __decorate([
432
433
  query(IgcCalendarComponent.tagName)
433
434
  ], IgcDatePickerComponent.prototype, "_calendar", void 0);
434
- __decorate([
435
- queryAssignedElements({ slot: 'prefix' })
436
- ], IgcDatePickerComponent.prototype, "_prefixes", void 0);
437
- __decorate([
438
- queryAssignedElements({ slot: 'suffix' })
439
- ], IgcDatePickerComponent.prototype, "_suffixes", void 0);
440
- __decorate([
441
- queryAssignedElements({ slot: 'actions' })
442
- ], IgcDatePickerComponent.prototype, "_actions", void 0);
443
- __decorate([
444
- queryAssignedElements({ slot: 'header-date' })
445
- ], IgcDatePickerComponent.prototype, "_headerSlotItems", void 0);
446
435
  __decorate([
447
436
  property({ type: Boolean, reflect: true })
448
437
  ], IgcDatePickerComponent.prototype, "open", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../../src/components/date-picker/date-picker.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,oBAAoB,EAAE,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAGL,aAAa,GAEd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,MAAM,EACN,SAAS,EACT,OAAO,EACP,SAAS,GACV,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EACL,2BAA2B,GAE5B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,O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AAO,EAAE,CAAC;wDACnB;AAOjB;IADN,QAAQ,EAAE;2DACiB;AAOrB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;6DAC/B;AAOlB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;+DAC5C;AAQ/B;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;2DAGzC;AAYD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;yDAGvC;AAWM;IADN,QAAQ,EAAE;sDACU;AAMd;IADN,QAAQ,EAAE;sDACS;AAIb;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+DAED;AAIvB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;yDACA;AAO5B;IADT,KAAK,CAAC,MAAM,CAAC;yDAGb;AA7SkB,sBAAsB;IAJ1C,4BAA4B,CAC3B,uFAAuF,CACxF;IACA,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;GACnB,sBAAsB,CA6rB1C;eA7rBoB,sBAAsB","sourcesContent":["import { html, nothing, type TemplateResult } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport IgcCalendarComponent, { focusActiveDate } from '../calendar/calendar.js';\nimport { convertToDate } from '../calendar/helpers.js';\nimport {\n type CalendarHeaderOrientation,\n type DateRangeDescriptor,\n DateRangeType,\n type WeekDays,\n} from '../calendar/types.js';\nimport {\n addKeybindings,\n altKey,\n arrowDown,\n arrowUp,\n escapeKey,\n} from '../common/controllers/key-bindings.js';\nimport { addRootClickController } from '../common/controllers/root-click.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\nimport { shadowOptions } from '../common/decorators/shadow-options.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport {\n IgcCalendarResourceStringEN,\n type IgcCalendarResourceStrings,\n} from '../common/i18n/calendar.resources.js';\nimport { IgcBaseComboBoxLikeComponent } from '../common/mixins/combo-box.js';\nimport type { AbstractConstructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';\nimport { FormValueDateTimeTransformers } from '../common/mixins/forms/form-transformers.js';\nimport { createFormValueState } from '../common/mixins/forms/form-value.js';\nimport {\n addSafeEventListener,\n createCounter,\n findElementFromEventPath,\n isEmpty,\n} from '../common/util.js';\nimport IgcDateTimeInputComponent from '../date-time-input/date-time-input.js';\nimport { type DatePart, DateTimeUtil } from '../date-time-input/date-util.js';\nimport IgcDialogComponent from '../dialog/dialog.js';\nimport IgcFocusTrapComponent from '../focus-trap/focus-trap.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcPopoverComponent from '../popover/popover.js';\nimport type {\n ContentOrientation,\n PickerMode,\n RangeTextSelectMode,\n SelectionRangeDirection,\n} from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { styles } from './themes/date-picker.base.css.js';\nimport { styles as shared } from './themes/shared/date-picker.common.css.js';\nimport { all } from './themes/themes.js';\nimport { datePickerValidators } from './validators.js';\n\nexport interface IgcDatePickerComponentEventMap {\n igcOpening: CustomEvent<void>;\n igcOpened: CustomEvent<void>;\n igcClosing: CustomEvent<void>;\n igcClosed: CustomEvent<void>;\n igcChange: CustomEvent<Date>;\n igcInput: CustomEvent<Date>;\n}\n\n/* blazorIndirectRender */\n/* blazorSupportsVisualChildren */\n/**\n * igc-date-picker is a feature rich component used for entering a date through manual text input or\n * choosing date values from a calendar dialog that pops up.\n *\n * @element igc-date-picker\n *\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after the input.\n * @slot helper-text - Renders content below the input.\n * @slot bad-input - Renders content when the value is in the disabledDates ranges.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot range-overflow - Renders content when the max validation fails.\n * @slot range-underflow - Renders content when the min validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n * @slot title - Renders content in the calendar title.\n * @slot header-date - Renders content instead of the current date/range in the calendar header.\n * @slot clear-icon - Renders a clear icon template.\n * @slot calendar-icon - Renders the icon/content for the calendar picker.\n * @slot calendar-icon-open - Renders the icon/content for the picker in open state.\n * @slot actions - Renders content in the action part of the picker in open state.\n *\n * @fires igcOpening - Emitted just before the calendar dropdown is shown.\n * @fires igcOpened - Emitted after the calendar dropdown is shown.\n * @fires igcClosing - Emitted just before the calendar dropdown is hidden.\n * @fires igcClosed - Emitted after the calendar dropdown is hidden.\n * @fires igcChange - Emitted when the user modifies and commits the elements's value.\n * @fires igcInput - Emitted when when the user types in the element.\n *\n * @csspart label - The label wrapper that renders content above the target input.\n * @csspart container - The main wrapper that holds all main input elements.\n * @csspart input - The native input element.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart calendar-icon - The calendar icon wrapper for closed state.\n * @csspart calendar-icon-open - The calendar icon wrapper for opened state.\n * @csspart clear-icon - The clear icon wrapper.\n * @csspart actions - The actions wrapper.\n * @csspart helper-text - The helper-text wrapper that renders content below the target input.\n * @csspart header - The calendar header element.\n * @csspart header-title - The calendar header title element.\n * @csspart header-date - The calendar header date element.\n * @csspart calendar-content - The calendar content element which contains the views and navigation elements.\n * @csspart navigation - The calendar navigation container element.\n * @csspart months-navigation - The calendar months navigation button element.\n * @csspart years-navigation - The calendar years navigation button element.\n * @csspart years-range - The calendar years range element.\n * @csspart navigation-buttons - The calendar navigation buttons container.\n * @csspart navigation-button - The calendar previous/next navigation button.\n * @csspart days-view-container - The calendar days view container element.\n * @csspart days-view - The calendar days view element.\n * @csspart months-view - The calendar months view element.\n * @csspart years-view - The calendar years view element.\n * @csspart days-row - The calendar days row element.\n * @csspart calendar-label - The calendar week header label element.\n * @csspart week-number - The calendar week number element.\n * @csspart week-number-inner - The calendar week number inner element.\n * @csspart date - The calendar date element.\n * @csspart date-inner - The calendar date inner element.\n * @csspart first - The calendar first selected date element in range selection.\n * @csspart last - The calendar last selected date element in range selection.\n * @csspart inactive - The calendar inactive date element.\n * @csspart hidden - The calendar hidden date element.\n * @csspart weekend - The calendar weekend date element.\n * @csspart range - The calendar range selected element.\n * @csspart special - The calendar special date element.\n * @csspart disabled - The calendar disabled date element.\n * @csspart single - The calendar single selected date element.\n * @csspart preview - The calendar range selection preview date element.\n * @csspart month - The calendar month element.\n * @csspart month-inner - The calendar month inner element.\n * @csspart year - The calendar year element.\n * @csspart year-inner - The calendar year inner element.\n * @csspart selected - The calendar selected state for element(s). Applies to date, month and year elements.\n * @csspart current - The calendar current state for element(s). Applies to date, month and year elements.\n */\n@blazorAdditionalDependencies(\n 'IgcCalendarComponent, IgcDateTimeInputComponent, IgcDialogComponent, IgcIconComponent'\n)\n@shadowOptions({ delegatesFocus: true })\nexport default class IgcDatePickerComponent extends FormAssociatedRequiredMixin(\n EventEmitterMixin<\n IgcDatePickerComponentEventMap,\n AbstractConstructor<IgcBaseComboBoxLikeComponent>\n >(IgcBaseComboBoxLikeComponent)\n) {\n public static readonly tagName = 'igc-date-picker';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcDatePickerComponent,\n IgcCalendarComponent,\n IgcDateTimeInputComponent,\n IgcFocusTrapComponent,\n IgcIconComponent,\n IgcPopoverComponent,\n IgcDialogComponent,\n IgcValidationContainerComponent\n );\n }\n\n //#region Private properties and state\n\n private static readonly _increment = createCounter();\n protected _inputId = `date-picker-${IgcDatePickerComponent._increment()}`;\n\n private readonly _themes = addThemingController(this, all);\n\n protected override get __validators() {\n return datePickerValidators;\n }\n\n private _activeDate: Date | null = null;\n private _min: Date | null = null;\n private _max: Date | null = null;\n private _disabledDates?: DateRangeDescriptor[];\n private _dateConstraints?: DateRangeDescriptor[];\n private _displayFormat?: string;\n private _inputFormat?: string;\n\n protected override readonly _formValue = createFormValueState(this, {\n initialValue: null,\n transformers: FormValueDateTimeTransformers,\n });\n\n protected override readonly _rootClickController = addRootClickController(\n this,\n {\n onHide: this._handleClosing,\n }\n );\n\n @query(IgcDateTimeInputComponent.tagName)\n private readonly _input!: IgcDateTimeInputComponent;\n\n @query(IgcCalendarComponent.tagName)\n private readonly _calendar!: IgcCalendarComponent;\n\n @queryAssignedElements({ slot: 'prefix' })\n private readonly _prefixes!: HTMLElement[];\n\n @queryAssignedElements({ slot: 'suffix' })\n private readonly _suffixes!: HTMLElement[];\n\n @queryAssignedElements({ slot: 'actions' })\n private readonly _actions!: HTMLElement[];\n\n @queryAssignedElements({ slot: 'header-date' })\n private readonly _headerSlotItems!: HTMLElement[];\n\n private get _isDropDown(): boolean {\n return this.mode === 'dropdown';\n }\n\n //#endregion\n\n //#region Public properties and attributes\n\n /**\n * Sets the state of the datepicker dropdown.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public override open = false;\n\n /**\n * The label of the datepicker.\n * @attr label\n */\n @property()\n public label!: string;\n\n /**\n * Determines whether the calendar is opened in a dropdown or a modal dialog\n * @attr mode\n */\n @property()\n public mode: PickerMode = 'dropdown';\n\n /**\n * Whether to allow typing in the input.\n * @attr non-editable\n */\n @property({ type: Boolean, reflect: true, attribute: 'non-editable' })\n public nonEditable = false;\n\n /**\n * Makes the control a readonly field.\n * @attr readonly\n */\n @property({ type: Boolean, reflect: true, attribute: 'readonly' })\n public readOnly = false;\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the picker\n * @attr\n */\n @property({ converter: convertToDate })\n public set value(value: Date | string | null | undefined) {\n this._formValue.setValueAndFormState(value as Date | null);\n }\n\n public get value(): Date | null {\n return this._formValue.value;\n }\n\n /**\n * Gets/Sets the date which is shown in the calendar picker and is highlighted.\n * By default it is the current date.\n */\n @property({ attribute: 'active-date', converter: convertToDate })\n public set activeDate(value: Date | string | null | undefined) {\n this._activeDate = convertToDate(value);\n }\n\n public get activeDate(): Date {\n return this._activeDate ?? this._calendar?.activeDate;\n }\n\n /**\n * The minimum value required for the date picker to remain valid.\n * @attr\n */\n @property({ converter: convertToDate })\n public set min(value: Date | string | null | undefined) {\n this._min = convertToDate(value);\n this._setDateConstraints();\n this._validate();\n }\n\n public get min(): Date | null {\n return this._min;\n }\n\n /**\n * The maximum value required for the date picker to remain valid.\n * @attr\n */\n @property({ converter: convertToDate })\n public set max(value: Date | string | null | undefined) {\n this._max = convertToDate(value);\n this._setDateConstraints();\n this._validate();\n }\n\n public get max(): Date | null {\n return this._max;\n }\n\n /**\n * The orientation of the calendar header.\n * @attr header-orientation\n */\n @property({ attribute: 'header-orientation', reflect: true })\n public headerOrientation: CalendarHeaderOrientation = 'horizontal';\n\n /**\n * The orientation of the multiple months displayed in the calendar's days view.\n * @attr\n */\n @property()\n public orientation: ContentOrientation = 'horizontal';\n\n /**\n * Determines whether the calendar hides its header.\n * @attr hide-header\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-header' })\n public hideHeader = false;\n\n /**\n * Controls the visibility of the dates that do not belong to the current month.\n * @attr hide-outside-days\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-outside-days' })\n public hideOutsideDays = false;\n\n /** Gets/sets disabled dates. */\n @property({ attribute: false })\n public set disabledDates(dates: DateRangeDescriptor[]) {\n this._disabledDates = dates;\n this._setDateConstraints();\n this._validate();\n }\n\n public get disabledDates() {\n return this._disabledDates as DateRangeDescriptor[];\n }\n\n /** Gets/sets special dates. */\n @property({ attribute: false })\n public specialDates!: DateRangeDescriptor[];\n\n /**\n * Whether the control will have outlined appearance.\n * @attr\n */\n @property({ reflect: true, type: Boolean })\n public outlined = false;\n\n /**\n * The placeholder attribute of the control.\n * @attr\n */\n @property()\n public placeholder!: string;\n\n /**\n * The number of months displayed in the calendar.\n * @attr visible-months\n */\n @property({ type: Number, attribute: 'visible-months' })\n public visibleMonths = 1;\n\n /**\n * Whether to show the number of the week in the calendar.\n * @attr show-week-numbers\n */\n @property({ type: Boolean, reflect: true, attribute: 'show-week-numbers' })\n public showWeekNumbers = false;\n\n /**\n * Format to display the value in when not editing.\n * Defaults to the input format if not set.\n * @attr display-format\n */\n @property({ attribute: 'display-format' })\n public set displayFormat(value: string) {\n this._displayFormat = value;\n }\n\n public get displayFormat(): string {\n return this._displayFormat ?? this.inputFormat;\n }\n\n /**\n * The date format to apply on the input.\n * Defaults to the current locale Intl.DateTimeFormat\n * @attr input-format\n */\n @property({ attribute: 'input-format' })\n public set inputFormat(value: string) {\n this._inputFormat = value;\n }\n\n public get inputFormat(): string {\n return this._inputFormat ?? this._input?.inputFormat;\n }\n\n /**\n * The locale settings used to display the value.\n * @attr\n */\n @property()\n public locale = 'en';\n\n /** The prompt symbol to use for unfilled parts of the mask.\n * @attr\n */\n @property()\n public prompt = '_';\n\n /** The resource strings of the calendar. */\n @property({ attribute: false })\n public resourceStrings: IgcCalendarResourceStrings =\n IgcCalendarResourceStringEN;\n\n /** Sets the start day of the week for the calendar. */\n @property({ attribute: 'week-start' })\n public weekStart: WeekDays = 'sunday';\n\n //#endregion\n\n //#region Watchers\n\n @watch('open')\n protected _openChange(): void {\n this._rootClickController.update();\n }\n\n //#endregion\n\n //#region Life-cycle hooks\n\n constructor() {\n super();\n\n addSafeEventListener(this, 'focusout', this._handleFocusOut);\n\n addKeybindings(this, {\n skip: () => this.disabled || this.readOnly,\n })\n .set([altKey, arrowDown], this.handleAnchorClick)\n .set([altKey, arrowUp], this._onEscapeKey)\n .set(escapeKey, this._onEscapeKey);\n }\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n const root = super.createRenderRoot();\n root.addEventListener('slotchange', () => this.requestUpdate());\n return root;\n }\n\n //#endregion\n\n //#region Private methods\n\n private _setDateConstraints(): void {\n const dates: DateRangeDescriptor[] = [];\n if (this._min) {\n dates.push({\n type: DateRangeType.Before,\n dateRange: [this._min],\n });\n }\n if (this._max) {\n dates.push({\n type: DateRangeType.After,\n dateRange: [this._max],\n });\n }\n if (!isEmpty(this._disabledDates ?? [])) {\n dates.push(...this.disabledDates);\n }\n\n this._dateConstraints = isEmpty(dates) ? undefined : dates;\n }\n\n private async _shouldCloseCalendarDropdown(): Promise<void> {\n if (!this.keepOpenOnSelect && (await this._hide(true))) {\n this._input.focus();\n this._input.select();\n }\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected async _onEscapeKey(): Promise<void> {\n if (await this._hide(true)) {\n this._input.focus();\n }\n }\n\n protected _handleFocusOut({ relatedTarget }: FocusEvent): void {\n if (!this.contains(relatedTarget as Node)) {\n this._handleBlur();\n }\n }\n\n protected _handlerCalendarIconSlotPointerDown(event: PointerEvent) {\n // This is where the delegateFocus of the underlying input is a chore.\n // If we have a required validator we don't want the input to enter an invalid\n // state right off the bat when opening the picker which will happen since focus is transferred to the calendar element.\n // So we call preventDefault on the event in order to not focus the input and trigger its validation logic on blur.\n event.preventDefault();\n }\n\n protected _handleInputClick(event: Event): void {\n if (findElementFromEventPath('input', event)) {\n // Open only if the click originates from the underlying input\n this.handleAnchorClick();\n }\n }\n\n protected override async handleAnchorClick(): Promise<void> {\n this._calendar.activeDate = this.value ?? this._calendar.activeDate;\n\n super.handleAnchorClick();\n await this.updateComplete;\n this._calendar[focusActiveDate]({ preventScroll: true });\n }\n\n protected _handleInputChangeEvent(event: CustomEvent<Date>): void {\n event.stopPropagation();\n\n this._setTouchedState();\n this.value = (event.target as IgcDateTimeInputComponent).value!;\n this.emitEvent('igcChange', { detail: this.value });\n }\n\n protected async _handleCalendarChangeEvent(\n event: CustomEvent<Date>\n ): Promise<void> {\n event.stopPropagation();\n\n this._setTouchedState();\n\n if (this.readOnly) {\n // Wait till the calendar finishes updating and then restore the current value from the date-picker.\n await this._calendar.updateComplete;\n this._calendar.value = this.value;\n return;\n }\n\n this.value = (event.target as IgcCalendarComponent).value!;\n this.emitEvent('igcChange', { detail: this.value });\n\n this._shouldCloseCalendarDropdown();\n }\n\n protected _handleInputEvent(event: CustomEvent<Date>): void {\n event.stopPropagation();\n\n this._setTouchedState();\n\n if (this.nonEditable) {\n event.preventDefault();\n return;\n }\n\n this.value = (event.target as IgcDateTimeInputComponent).value!;\n this._calendar.activeDate = this.value ?? this._calendar.activeDate;\n this.emitEvent('igcInput', { detail: this.value });\n }\n\n protected _handleClosing(): void {\n this._hide(true);\n }\n\n protected _handleDialogClosing(event: Event): void {\n event.stopPropagation();\n this._hide(true);\n }\n\n protected _handleDialogClosed(event: Event): void {\n event.stopPropagation();\n }\n\n //#endregion\n\n //#region Public methods\n\n /** Clears the input part of the component of any user input */\n public clear(): void {\n this.value = null;\n this._input?.clear();\n }\n\n /** Increments the passed in date part */\n public stepUp(datePart?: DatePart, delta?: number): void {\n this._input.stepUp(datePart, delta);\n }\n\n /** Decrements the passed in date part */\n public stepDown(datePart?: DatePart, delta?: number): void {\n this._input.stepDown(datePart, delta);\n }\n\n /** Selects the text in the input of the component */\n public select(): void {\n this._input.select();\n }\n\n /** Sets the text selection range in the input of the component */\n public setSelectionRange(\n start: number,\n end: number,\n direction?: SelectionRangeDirection\n ): void {\n this._input.setSelectionRange(start, end, direction);\n }\n\n /* Replaces the selected text in the input and re-applies the mask */\n public setRangeText(\n replacement: string,\n start: number,\n end: number,\n mode?: RangeTextSelectMode\n ): void {\n this._input.setRangeText(replacement, start, end, mode);\n this.value = this._input.value;\n }\n\n //#endregion\n\n //#region Render methods\n\n private _renderClearIcon() {\n return this.value\n ? html`\n <span\n slot=\"suffix\"\n part=\"clear-icon\"\n @click=${this.readOnly ? nothing : this.clear}\n >\n <slot name=\"clear-icon\">\n <igc-icon\n name=\"input_clear\"\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `\n : nothing;\n }\n\n private _renderCalendarIcon() {\n const defaultIcon = html`\n <igc-icon name=\"today\" collection=\"default\" aria-hidden=\"true\"></igc-icon>\n `;\n\n const state = this.open ? 'calendar-icon-open' : 'calendar-icon';\n\n return html`\n <span\n slot=\"prefix\"\n part=${state}\n @pointerdown=${this._handlerCalendarIconSlotPointerDown}\n @click=${this.readOnly ? nothing : this.handleAnchorClick}\n >\n <slot name=${state}>${defaultIcon}</slot>\n </span>\n `;\n }\n\n private _renderCalendarSlots() {\n if (this._isDropDown) {\n return nothing;\n }\n\n const hasHeaderDate = isEmpty(this._headerSlotItems) ? '' : 'header-date';\n\n return html`\n <slot name=\"title\" slot=\"title\">\n ${this.resourceStrings.selectDate}\n </slot>\n <slot name=\"header-date\" slot=${hasHeaderDate}></slot>\n `;\n }\n\n private _renderCalendar(id: string) {\n const hideHeader = this._isDropDown ? true : this.hideHeader;\n\n return html`\n <igc-calendar\n aria-labelledby=${id}\n role=\"dialog\"\n .inert=${!this.open || this.disabled}\n ?show-week-numbers=${this.showWeekNumbers}\n ?hide-outside-days=${this.hideOutsideDays}\n ?hide-header=${hideHeader}\n .activeDate=${this.activeDate ?? this.value}\n .value=${this.value}\n .headerOrientation=${this.headerOrientation}\n .orientation=${this.orientation}\n .visibleMonths=${this.visibleMonths}\n .locale=${this.locale}\n .disabledDates=${this._dateConstraints!}\n .specialDates=${this.specialDates}\n .weekStart=${this.weekStart}\n @igcChange=${this._handleCalendarChangeEvent}\n exportparts=\"header, header-title, header-date, content: calendar-content, navigation, months-navigation,\n years-navigation, years-range, navigation-buttons, navigation-button, days-view-container,\n days-view, months-view, years-view, days-row, label: calendar-label, week-number, week-number-inner, date,\n date-inner, first, last, inactive, hidden, weekend, range, special, disabled, single, preview,\n month, month-inner, year, year-inner, selected, current\"\n >\n ${this._renderCalendarSlots()}\n </igc-calendar>\n `;\n }\n\n protected _renderActions() {\n const hasActions = !isEmpty(this._actions);\n const slot = this._isDropDown || hasActions ? undefined : 'footer';\n\n // If in dialog mode use the dialog footer slot\n return html`\n <div part=\"actions\" ?hidden=${!hasActions} slot=${ifDefined(slot)}>\n <slot name=\"actions\"></slot>\n </div>\n `;\n }\n\n protected _renderPicker(id: string) {\n return this._isDropDown\n ? html`\n <igc-popover ?open=${this.open} anchor=${id} flip shift>\n <igc-focus-trap ?disabled=${!this.open || this.disabled}>\n ${this._renderCalendar(id)}${this._renderActions()}\n </igc-focus-trap>\n </igc-popover>\n `\n : html`\n <igc-dialog\n aria-label=${ifDefined(this.resourceStrings.selectDate)}\n role=\"dialog\"\n ?open=${this.open}\n ?close-on-outside-click=${!this.keepOpenOnOutsideClick}\n hide-default-action\n @igcClosing=${this._handleDialogClosing}\n @igcClosed=${this._handleDialogClosed}\n exportparts=\"base: dialog-base, title, footer, overlay\"\n >\n ${this._renderCalendar(id)}${this._renderActions()}\n </igc-dialog>\n `;\n }\n\n private _renderLabel(id: string) {\n const isDisabled = this._isDropDown || this.readOnly;\n\n return this.label\n ? html`\n <label\n part=\"label\"\n for=${id}\n @click=${isDisabled ? nothing : this.handleAnchorClick}\n >\n ${this.label}\n </label>\n `\n : nothing;\n }\n\n private _renderHelperText(): TemplateResult {\n return IgcValidationContainerComponent.create(this);\n }\n\n protected _renderInput(id: string) {\n const format = DateTimeUtil.predefinedToDateDisplayFormat(\n this._displayFormat!\n );\n\n // Dialog mode is always readonly, rest depends on configuration\n const readOnly = !this._isDropDown || this.readOnly || this.nonEditable;\n\n const prefix = isEmpty(this._prefixes) ? undefined : 'prefix';\n const suffix = isEmpty(this._suffixes) ? undefined : 'suffix';\n const isMaterial = this._themes.theme === 'material';\n\n return html`\n <igc-date-time-input\n id=${id}\n aria-haspopup=\"dialog\"\n label=${ifDefined(isMaterial ? this.label : undefined)}\n input-format=${ifDefined(this._inputFormat)}\n display-format=${ifDefined(format)}\n ?disabled=${this.disabled}\n ?readonly=${readOnly}\n ?required=${this.required}\n .value=${this.value}\n .locale=${this.locale}\n .prompt=${this.prompt}\n .outlined=${this.outlined}\n .placeholder=${this.placeholder}\n .min=${this.min}\n .max=${this.max}\n .invalid=${this.invalid}\n @igcChange=${this._handleInputChangeEvent}\n @igcInput=${this._handleInputEvent}\n @click=${this._isDropDown || this.readOnly\n ? nothing\n : this._handleInputClick}\n exportparts=\"input, label, prefix, suffix\"\n >\n ${this._renderCalendarIcon()}\n <slot name=\"prefix\" slot=${ifDefined(prefix)}></slot>\n ${this._renderClearIcon()}\n <slot name=\"suffix\" slot=${ifDefined(suffix)}></slot>\n </igc-date-time-input>\n `;\n }\n\n protected override render() {\n const id = this.id || this._inputId;\n const isMaterial = this._themes.theme === 'material';\n\n return html`\n ${isMaterial ? nothing : this._renderLabel(id)} ${this._renderInput(id)}\n ${this._renderPicker(id)} ${this._renderHelperText()}\n `;\n }\n\n //#endregion\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-date-picker': IgcDatePickerComponent;\n }\n}\n"]}
1
+ {"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../../src/components/date-picker/date-picker.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,oBAAoB,EAAE,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAM9E,OAAO,EACL,cAAc,EACd,MAAM,EACN,SAAS,EACT,OAAO,EACP,SAAS,GACV,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,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AI/B;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;2DAK9B;AAQM;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;4DACa;AAOrC;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wDACnB;AAOjB;IADN,QAAQ,EAAE;2DACiB;AAOrB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;6DAC/B;AAOlB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;+DAC5C;AAQ/B;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;2DAGzC;AAYD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;yDAGvC;AAWM;IADN,QAAQ,EAAE;sDACU;AAMd;IADN,QAAQ,EAAE;sDACS;AAIb;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+DAED;AAIvB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;yDACA;AAO5B;IADT,KAAK,CAAC,MAAM,CAAC;yDAMb;AAxSkB,sBAAsB;IAJ1C,4BAA4B,CAC3B,uFAAuF,CACxF;IACA,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;GACnB,sBAAsB,CAorB1C;eAprBoB,sBAAsB","sourcesContent":["import { html, nothing, type TemplateResult } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport IgcCalendarComponent, { focusActiveDate } from '../calendar/calendar.js';\nimport { convertToDate, createDateConstraints } from '../calendar/helpers.js';\nimport type {\n CalendarHeaderOrientation,\n DateRangeDescriptor,\n WeekDays,\n} from '../calendar/types.js';\nimport {\n addKeybindings,\n altKey,\n arrowDown,\n arrowUp,\n escapeKey,\n} from '../common/controllers/key-bindings.js';\nimport { addRootClickController } from '../common/controllers/root-click.js';\nimport { addSlotController, setSlots } from '../common/controllers/slot.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\nimport { shadowOptions } from '../common/decorators/shadow-options.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport {\n IgcCalendarResourceStringEN,\n type IgcCalendarResourceStrings,\n} from '../common/i18n/calendar.resources.js';\nimport { IgcBaseComboBoxLikeComponent } from '../common/mixins/combo-box.js';\nimport type { AbstractConstructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';\nimport { FormValueDateTimeTransformers } from '../common/mixins/forms/form-transformers.js';\nimport { createFormValueState } from '../common/mixins/forms/form-value.js';\nimport {\n addSafeEventListener,\n bindIf,\n equal,\n findElementFromEventPath,\n} from '../common/util.js';\nimport IgcDateTimeInputComponent from '../date-time-input/date-time-input.js';\nimport { type DatePart, DateTimeUtil } from '../date-time-input/date-util.js';\nimport IgcDialogComponent from '../dialog/dialog.js';\nimport IgcFocusTrapComponent from '../focus-trap/focus-trap.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcPopoverComponent from '../popover/popover.js';\nimport type {\n ContentOrientation,\n PickerMode,\n RangeTextSelectMode,\n SelectionRangeDirection,\n} from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { styles } from './themes/date-picker.base.css.js';\nimport { styles as shared } from './themes/shared/date-picker.common.css.js';\nimport { all } from './themes/themes.js';\nimport { datePickerValidators } from './validators.js';\n\nexport interface IgcDatePickerComponentEventMap {\n igcOpening: CustomEvent<void>;\n igcOpened: CustomEvent<void>;\n igcClosing: CustomEvent<void>;\n igcClosed: CustomEvent<void>;\n igcChange: CustomEvent<Date | null>;\n igcInput: CustomEvent<Date | null>;\n}\n\nlet nextId = 1;\nconst Slots = setSlots(\n 'prefix',\n 'suffix',\n 'helper-text',\n 'bad-input',\n 'value-missing',\n 'range-overflow',\n 'range-underflow',\n 'custom-error',\n 'invalid',\n 'title',\n 'header-date',\n 'clear-icon',\n 'calendar-icon',\n 'calendar-icon-open',\n 'actions'\n);\n\n/* blazorIndirectRender */\n/* blazorSupportsVisualChildren */\n/**\n * igc-date-picker is a feature rich component used for entering a date through manual text input or\n * choosing date values from a calendar dialog that pops up.\n *\n * @element igc-date-picker\n *\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after the input.\n * @slot helper-text - Renders content below the input.\n * @slot bad-input - Renders content when the value is in the disabledDates ranges.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot range-overflow - Renders content when the max validation fails.\n * @slot range-underflow - Renders content when the min validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n * @slot title - Renders content in the calendar title.\n * @slot header-date - Renders content instead of the current date/range in the calendar header.\n * @slot clear-icon - Renders a clear icon template.\n * @slot calendar-icon - Renders the icon/content for the calendar picker.\n * @slot calendar-icon-open - Renders the icon/content for the picker in open state.\n * @slot actions - Renders content in the action part of the picker in open state.\n *\n * @fires igcOpening - Emitted just before the calendar dropdown is shown.\n * @fires igcOpened - Emitted after the calendar dropdown is shown.\n * @fires igcClosing - Emitted just before the calendar dropdown is hidden.\n * @fires igcClosed - Emitted after the calendar dropdown is hidden.\n * @fires igcChange - Emitted when the user modifies and commits the elements's value.\n * @fires igcInput - Emitted when when the user types in the element.\n *\n * @csspart label - The label wrapper that renders content above the target input.\n * @csspart container - The main wrapper that holds all main input elements.\n * @csspart input - The native input element.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart calendar-icon - The calendar icon wrapper for closed state.\n * @csspart calendar-icon-open - The calendar icon wrapper for opened state.\n * @csspart clear-icon - The clear icon wrapper.\n * @csspart actions - The actions wrapper.\n * @csspart helper-text - The helper-text wrapper that renders content below the target input.\n * @csspart header - The calendar header element.\n * @csspart header-title - The calendar header title element.\n * @csspart header-date - The calendar header date element.\n * @csspart calendar-content - The calendar content element which contains the views and navigation elements.\n * @csspart navigation - The calendar navigation container element.\n * @csspart months-navigation - The calendar months navigation button element.\n * @csspart years-navigation - The calendar years navigation button element.\n * @csspart years-range - The calendar years range element.\n * @csspart navigation-buttons - The calendar navigation buttons container.\n * @csspart navigation-button - The calendar previous/next navigation button.\n * @csspart days-view-container - The calendar days view container element.\n * @csspart days-view - The calendar days view element.\n * @csspart months-view - The calendar months view element.\n * @csspart years-view - The calendar years view element.\n * @csspart days-row - The calendar days row element.\n * @csspart calendar-label - The calendar week header label element.\n * @csspart week-number - The calendar week number element.\n * @csspart week-number-inner - The calendar week number inner element.\n * @csspart date - The calendar date element.\n * @csspart date-inner - The calendar date inner element.\n * @csspart first - The calendar first selected date element in range selection.\n * @csspart last - The calendar last selected date element in range selection.\n * @csspart inactive - The calendar inactive date element.\n * @csspart hidden - The calendar hidden date element.\n * @csspart weekend - The calendar weekend date element.\n * @csspart range - The calendar range selected element.\n * @csspart special - The calendar special date element.\n * @csspart disabled - The calendar disabled date element.\n * @csspart single - The calendar single selected date element.\n * @csspart preview - The calendar range selection preview date element.\n * @csspart month - The calendar month element.\n * @csspart month-inner - The calendar month inner element.\n * @csspart year - The calendar year element.\n * @csspart year-inner - The calendar year inner element.\n * @csspart selected - The calendar selected state for element(s). Applies to date, month and year elements.\n * @csspart current - The calendar current state for element(s). Applies to date, month and year elements.\n */\n@blazorAdditionalDependencies(\n 'IgcCalendarComponent, IgcDateTimeInputComponent, IgcDialogComponent, IgcIconComponent'\n)\n@shadowOptions({ delegatesFocus: true })\nexport default class IgcDatePickerComponent extends FormAssociatedRequiredMixin(\n EventEmitterMixin<\n IgcDatePickerComponentEventMap,\n AbstractConstructor<IgcBaseComboBoxLikeComponent>\n >(IgcBaseComboBoxLikeComponent)\n) {\n public static readonly tagName = 'igc-date-picker';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcDatePickerComponent,\n IgcCalendarComponent,\n IgcDateTimeInputComponent,\n IgcFocusTrapComponent,\n IgcIconComponent,\n IgcPopoverComponent,\n IgcDialogComponent,\n IgcValidationContainerComponent\n );\n }\n\n //#region Private properties and state\n\n protected override get __validators() {\n return datePickerValidators;\n }\n\n private readonly _inputId = `date-picker-${nextId++}`;\n private readonly _themes = addThemingController(this, all);\n private readonly _slots = addSlotController(this, { slots: Slots });\n\n private _oldValue: Date | null = null;\n private _activeDate: Date | null = null;\n private _min: Date | null = null;\n private _max: Date | null = null;\n private _disabledDates?: DateRangeDescriptor[];\n private _dateConstraints?: DateRangeDescriptor[];\n private _displayFormat?: string;\n private _inputFormat?: string;\n\n protected override readonly _formValue = createFormValueState(this, {\n initialValue: null,\n transformers: FormValueDateTimeTransformers,\n });\n\n protected override readonly _rootClickController = addRootClickController(\n this,\n {\n onHide: this._handleClosing,\n }\n );\n\n @query(IgcDateTimeInputComponent.tagName)\n private readonly _input!: IgcDateTimeInputComponent;\n\n @query(IgcCalendarComponent.tagName)\n private readonly _calendar!: IgcCalendarComponent;\n\n private get _isDropDown(): boolean {\n return this.mode === 'dropdown';\n }\n\n private get _isMaterial(): boolean {\n return this._themes.theme === 'material';\n }\n\n //#endregion\n\n //#region Public properties and attributes\n\n /**\n * Sets the state of the datepicker dropdown.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public override open = false;\n\n /**\n * The label of the datepicker.\n * @attr label\n */\n @property()\n public label!: string;\n\n /**\n * Determines whether the calendar is opened in a dropdown or a modal dialog\n * @attr mode\n */\n @property()\n public mode: PickerMode = 'dropdown';\n\n /**\n * Whether to allow typing in the input.\n * @attr non-editable\n */\n @property({ type: Boolean, reflect: true, attribute: 'non-editable' })\n public nonEditable = false;\n\n /**\n * Makes the control a readonly field.\n * @attr readonly\n */\n @property({ type: Boolean, reflect: true, attribute: 'readonly' })\n public readOnly = false;\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the picker\n * @attr\n */\n @property({ converter: convertToDate })\n public set value(value: Date | string | null | undefined) {\n this._formValue.setValueAndFormState(value as Date | null);\n }\n\n public get value(): Date | null {\n return this._formValue.value;\n }\n\n /**\n * Gets/Sets the date which is shown in the calendar picker and is highlighted.\n * By default it is the current date.\n */\n @property({ attribute: 'active-date', converter: convertToDate })\n public set activeDate(value: Date | string | null | undefined) {\n this._activeDate = convertToDate(value);\n }\n\n public get activeDate(): Date {\n return this._activeDate ?? this._calendar?.activeDate;\n }\n\n /**\n * The minimum value required for the date picker to remain valid.\n * @attr\n */\n @property({ converter: convertToDate })\n public set min(value: Date | string | null | undefined) {\n this._min = convertToDate(value);\n this._setDateConstraints();\n this._validate();\n }\n\n public get min(): Date | null {\n return this._min;\n }\n\n /**\n * The maximum value required for the date picker to remain valid.\n * @attr\n */\n @property({ converter: convertToDate })\n public set max(value: Date | string | null | undefined) {\n this._max = convertToDate(value);\n this._setDateConstraints();\n this._validate();\n }\n\n public get max(): Date | null {\n return this._max;\n }\n\n /**\n * The orientation of the calendar header.\n * @attr header-orientation\n */\n @property({ attribute: 'header-orientation', reflect: true })\n public headerOrientation: CalendarHeaderOrientation = 'horizontal';\n\n /**\n * The orientation of the multiple months displayed in the calendar's days view.\n * @attr\n */\n @property()\n public orientation: ContentOrientation = 'horizontal';\n\n /**\n * Determines whether the calendar hides its header.\n * @attr hide-header\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-header' })\n public hideHeader = false;\n\n /**\n * Controls the visibility of the dates that do not belong to the current month.\n * @attr hide-outside-days\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-outside-days' })\n public hideOutsideDays = false;\n\n /** Gets/sets disabled dates. */\n @property({ attribute: false })\n public set disabledDates(dates: DateRangeDescriptor[]) {\n this._disabledDates = dates;\n this._setDateConstraints();\n this._validate();\n }\n\n public get disabledDates() {\n return this._disabledDates as DateRangeDescriptor[];\n }\n\n /** Gets/sets special dates. */\n @property({ attribute: false })\n public specialDates!: DateRangeDescriptor[];\n\n /**\n * Whether the control will have outlined appearance.\n * @attr\n */\n @property({ reflect: true, type: Boolean })\n public outlined = false;\n\n /**\n * The placeholder attribute of the control.\n * @attr\n */\n @property()\n public placeholder!: string;\n\n /**\n * The number of months displayed in the calendar.\n * @attr visible-months\n */\n @property({ type: Number, attribute: 'visible-months' })\n public visibleMonths = 1;\n\n /**\n * Whether to show the number of the week in the calendar.\n * @attr show-week-numbers\n */\n @property({ type: Boolean, reflect: true, attribute: 'show-week-numbers' })\n public showWeekNumbers = false;\n\n /**\n * Format to display the value in when not editing.\n * Defaults to the input format if not set.\n * @attr display-format\n */\n @property({ attribute: 'display-format' })\n public set displayFormat(value: string) {\n this._displayFormat = value;\n }\n\n public get displayFormat(): string {\n return this._displayFormat ?? this.inputFormat;\n }\n\n /**\n * The date format to apply on the input.\n * Defaults to the current locale Intl.DateTimeFormat\n * @attr input-format\n */\n @property({ attribute: 'input-format' })\n public set inputFormat(value: string) {\n this._inputFormat = value;\n }\n\n public get inputFormat(): string {\n return this._inputFormat ?? this._input?.inputFormat;\n }\n\n /**\n * The locale settings used to display the value.\n * @attr\n */\n @property()\n public locale = 'en';\n\n /** The prompt symbol to use for unfilled parts of the mask.\n * @attr\n */\n @property()\n public prompt = '_';\n\n /** The resource strings of the calendar. */\n @property({ attribute: false })\n public resourceStrings: IgcCalendarResourceStrings =\n IgcCalendarResourceStringEN;\n\n /** Sets the start day of the week for the calendar. */\n @property({ attribute: 'week-start' })\n public weekStart: WeekDays = 'sunday';\n\n //#endregion\n\n //#region Watchers\n\n @watch('open')\n protected _openChange(): void {\n this._rootClickController.update();\n if (this.open) {\n this._oldValue = this.value;\n }\n }\n\n //#endregion\n\n //#region Life-cycle hooks\n\n constructor() {\n super();\n\n addSafeEventListener(this, 'focusout', this._handleFocusOut);\n\n addKeybindings(this, {\n skip: () => this.disabled || this.readOnly,\n })\n .set([altKey, arrowDown], this.handleAnchorClick)\n .set([altKey, arrowUp], this._onEscapeKey)\n .set(escapeKey, this._onEscapeKey);\n }\n\n //#endregion\n\n //#region Private methods\n\n private _setDateConstraints(): void {\n this._dateConstraints = createDateConstraints(\n this.min,\n this.max,\n this.disabledDates\n );\n }\n\n private async _shouldCloseCalendarDropdown(): Promise<void> {\n if (!this.keepOpenOnSelect && (await this._hide(true))) {\n this._input.focus();\n this._input.select();\n }\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected async _onEscapeKey(): Promise<void> {\n if (await this._hide(true)) {\n this._input.focus();\n }\n }\n\n protected _handleFocusOut({ relatedTarget }: FocusEvent): void {\n if (!this.contains(relatedTarget as Node)) {\n this._handleBlur();\n\n const readOnly = !this._isDropDown || this.readOnly || this.nonEditable;\n if (readOnly && !equal(this.value, this._oldValue)) {\n this.emitEvent('igcChange', { detail: this.value });\n this._oldValue = this.value;\n }\n }\n }\n\n protected _handlerCalendarIconSlotPointerDown(event: PointerEvent) {\n // This is where the delegateFocus of the underlying input is a chore.\n // If we have a required validator we don't want the input to enter an invalid\n // state right off the bat when opening the picker which will happen since focus is transferred to the calendar element.\n // So we call preventDefault on the event in order to not focus the input and trigger its validation logic on blur.\n event.preventDefault();\n }\n\n protected _handleInputClick(event: Event): void {\n if (findElementFromEventPath('input', event)) {\n // Open only if the click originates from the underlying input\n this.handleAnchorClick();\n }\n }\n\n protected override async handleAnchorClick(): Promise<void> {\n this._calendar.activeDate = this.value ?? this._calendar.activeDate;\n\n super.handleAnchorClick();\n await this.updateComplete;\n this._calendar[focusActiveDate]({ preventScroll: true });\n }\n\n protected _handleInputChangeEvent(event: CustomEvent<Date>): void {\n event.stopPropagation();\n\n this._setTouchedState();\n this.value = (event.target as IgcDateTimeInputComponent).value!;\n this.emitEvent('igcChange', { detail: this.value });\n }\n\n protected async _handleCalendarChangeEvent(\n event: CustomEvent<Date>\n ): Promise<void> {\n event.stopPropagation();\n\n this._setTouchedState();\n\n if (this.readOnly) {\n // Wait till the calendar finishes updating and then restore the current value from the date-picker.\n await this._calendar.updateComplete;\n this._calendar.value = this.value;\n return;\n }\n\n this.value = (event.target as IgcCalendarComponent).value!;\n this.emitEvent('igcChange', { detail: this.value });\n\n this._shouldCloseCalendarDropdown();\n }\n\n protected _handleInputEvent(event: CustomEvent<Date>): void {\n event.stopPropagation();\n\n this._setTouchedState();\n\n if (this.nonEditable) {\n event.preventDefault();\n return;\n }\n\n this.value = (event.target as IgcDateTimeInputComponent).value!;\n this._calendar.activeDate = this.value ?? this._calendar.activeDate;\n this.emitEvent('igcInput', { detail: this.value });\n }\n\n protected _handleClosing(): void {\n this._hide(true);\n }\n\n protected _handleDialogClosing(event: Event): void {\n event.stopPropagation();\n this._oldValue = this.value;\n this._hide(true);\n }\n\n protected _handleDialogClosed(event: Event): void {\n event.stopPropagation();\n }\n\n //#endregion\n\n //#region Public methods\n\n /** Clears the input part of the component of any user input */\n public clear(): void {\n this._oldValue = this.value;\n this.value = null;\n this._input?.clear();\n }\n\n /** Increments the passed in date part */\n public stepUp(datePart?: DatePart, delta?: number): void {\n this._input.stepUp(datePart, delta);\n }\n\n /** Decrements the passed in date part */\n public stepDown(datePart?: DatePart, delta?: number): void {\n this._input.stepDown(datePart, delta);\n }\n\n /** Selects the text in the input of the component */\n public select(): void {\n this._input.select();\n }\n\n /** Sets the text selection range in the input of the component */\n public setSelectionRange(\n start: number,\n end: number,\n direction?: SelectionRangeDirection\n ): void {\n this._input.setSelectionRange(start, end, direction);\n }\n\n /* Replaces the selected text in the input and re-applies the mask */\n public setRangeText(\n replacement: string,\n start: number,\n end: number,\n mode?: RangeTextSelectMode\n ): void {\n this._input.setRangeText(replacement, start, end, mode);\n this.value = this._input.value;\n }\n\n //#endregion\n\n //#region Render methods\n\n private _renderClearIcon() {\n return this.value\n ? html`\n <span\n slot=\"suffix\"\n part=\"clear-icon\"\n @click=${bindIf(!this.readOnly, this.clear)}\n >\n <slot name=\"clear-icon\">\n <igc-icon\n name=\"input_clear\"\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `\n : nothing;\n }\n\n private _renderCalendarIcon() {\n const defaultIcon = html`\n <igc-icon name=\"today\" collection=\"default\" aria-hidden=\"true\"></igc-icon>\n `;\n\n const state = this.open ? 'calendar-icon-open' : 'calendar-icon';\n\n return html`\n <span\n slot=\"prefix\"\n part=${state}\n @pointerdown=${this._handlerCalendarIconSlotPointerDown}\n @click=${bindIf(!this.readOnly, this.handleAnchorClick)}\n >\n <slot name=${state}>${defaultIcon}</slot>\n </span>\n `;\n }\n\n private _renderCalendarSlots() {\n if (this._isDropDown) {\n return nothing;\n }\n\n const hasHeaderDate = this._slots.hasAssignedElements('header-date');\n\n return html`\n <slot name=\"title\" slot=\"title\">\n ${this.resourceStrings.selectDate}\n </slot>\n <slot\n name=\"header-date\"\n slot=${bindIf(hasHeaderDate, 'header-date')}\n ></slot>\n `;\n }\n\n private _renderCalendar(id: string) {\n const hideHeader = this._isDropDown ? true : this.hideHeader;\n const isInert = !this.open || this.disabled;\n\n return html`\n <igc-calendar\n aria-labelledby=${id}\n role=\"dialog\"\n .inert=${isInert}\n ?show-week-numbers=${this.showWeekNumbers}\n ?hide-outside-days=${this.hideOutsideDays}\n ?hide-header=${hideHeader}\n .activeDate=${this.activeDate ?? this.value}\n .value=${this.value}\n .headerOrientation=${this.headerOrientation}\n .orientation=${this.orientation}\n .visibleMonths=${this.visibleMonths}\n .locale=${this.locale}\n .disabledDates=${this._dateConstraints!}\n .specialDates=${this.specialDates}\n .weekStart=${this.weekStart}\n @igcChange=${this._handleCalendarChangeEvent}\n exportparts=\"header, header-title, header-date, content: calendar-content, navigation, months-navigation,\n years-navigation, years-range, navigation-buttons, navigation-button, days-view-container,\n days-view, months-view, years-view, days-row, label: calendar-label, week-number, week-number-inner, date,\n date-inner, first, last, inactive, hidden, weekend, range, special, disabled, single, preview,\n month, month-inner, year, year-inner, selected, current\"\n >\n ${this._renderCalendarSlots()}\n </igc-calendar>\n `;\n }\n\n protected _renderActions() {\n const hasActions = this._slots.hasAssignedElements('actions');\n\n // If in dialog mode use the dialog footer slot\n return html`\n <div\n part=\"actions\"\n ?hidden=${!hasActions}\n slot=${bindIf(!(this._isDropDown || hasActions), 'footer')}\n >\n <slot name=\"actions\"></slot>\n </div>\n `;\n }\n\n protected _renderPicker(id: string) {\n const isDisabled = !this.open || this.disabled;\n\n return this._isDropDown\n ? html`\n <igc-popover ?open=${this.open} anchor=${id} flip shift>\n <igc-focus-trap ?disabled=${isDisabled}>\n ${this._renderCalendar(id)}${this._renderActions()}\n </igc-focus-trap>\n </igc-popover>\n `\n : html`\n <igc-dialog\n aria-label=${ifDefined(this.resourceStrings.selectDate)}\n role=\"dialog\"\n ?open=${this.open}\n ?close-on-outside-click=${!this.keepOpenOnOutsideClick}\n hide-default-action\n @igcClosing=${this._handleDialogClosing}\n @igcClosed=${this._handleDialogClosed}\n exportparts=\"base: dialog-base, title, footer, overlay\"\n >\n ${this._renderCalendar(id)}${this._renderActions()}\n </igc-dialog>\n `;\n }\n\n private _renderLabel(id: string) {\n const isDisabled = this._isDropDown || this.readOnly;\n\n return this.label\n ? html`\n <label\n part=\"label\"\n for=${id}\n @click=${bindIf(!isDisabled, this.handleAnchorClick)}\n >\n ${this.label}\n </label>\n `\n : nothing;\n }\n\n private _renderHelperText(): TemplateResult {\n return IgcValidationContainerComponent.create(this);\n }\n\n protected _renderInput(id: string) {\n const format = DateTimeUtil.predefinedToDateDisplayFormat(\n this._displayFormat!\n );\n\n // Dialog mode is always readonly, rest depends on configuration\n const readOnly = !this._isDropDown || this.readOnly || this.nonEditable;\n\n const hasPrefix = this._slots.hasAssignedElements('prefix');\n const hasSuffix = this._slots.hasAssignedElements('suffix');\n const hasClickHandler = !(this._isDropDown || this.readOnly);\n\n return html`\n <igc-date-time-input\n id=${id}\n aria-haspopup=\"dialog\"\n label=${bindIf(this._isMaterial, this.label)}\n input-format=${ifDefined(this._inputFormat)}\n display-format=${ifDefined(format)}\n ?disabled=${this.disabled}\n ?readonly=${readOnly}\n ?required=${this.required}\n .value=${this.value}\n .locale=${this.locale}\n .prompt=${this.prompt}\n .outlined=${this.outlined}\n .placeholder=${this.placeholder}\n .min=${this.min}\n .max=${this.max}\n .invalid=${this.invalid}\n @igcChange=${this._handleInputChangeEvent}\n @igcInput=${this._handleInputEvent}\n @click=${bindIf(hasClickHandler, this._handleInputClick)}\n exportparts=\"input, label, prefix, suffix\"\n >\n ${this._renderCalendarIcon()}\n <slot name=\"prefix\" slot=${bindIf(hasPrefix, 'prefix')}></slot>\n ${this._renderClearIcon()}\n <slot name=\"suffix\" slot=${bindIf(hasSuffix, 'suffix')}></slot>\n </igc-date-time-input>\n `;\n }\n\n protected override render() {\n const id = this.id || this._inputId;\n\n return html`\n ${this._isMaterial ? nothing : this._renderLabel(id)}\n ${this._renderInput(id)} ${this._renderPicker(id)}\n ${this._renderHelperText()}\n `;\n }\n\n //#endregion\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-date-picker': IgcDatePickerComponent;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { nothing, type TemplateResult } from 'lit';
2
- import { type DateRangeDescriptor, type WeekDays } from '../calendar/types.js';
2
+ import type { DateRangeDescriptor, WeekDays } from '../calendar/types.js';
3
3
  import { IgcBaseComboBoxLikeComponent } from '../common/mixins/combo-box.js';
4
4
  import type { AbstractConstructor } from '../common/mixins/constructor.js';
5
5
  import type { ContentOrientation, PickerMode } from '../types.js';
@@ -12,9 +12,8 @@ import { ifDefined } from 'lit/directives/if-defined.js';
12
12
  import { live } from 'lit/directives/live.js';
13
13
  import { addThemingController } from '../../theming/theming-controller.js';
14
14
  import IgcCalendarComponent, { focusActiveDate } from '../calendar/calendar.js';
15
- import { convertToDate, convertToDateRange } from '../calendar/helpers.js';
15
+ import { convertToDate, convertToDateRange, createDateConstraints, } from '../calendar/helpers.js';
16
16
  import { CalendarDay } from '../calendar/model.js';
17
- import { DateRangeType, } from '../calendar/types.js';
18
17
  import { addKeybindings, altKey, arrowDown, arrowUp, escapeKey, } from '../common/controllers/key-bindings.js';
19
18
  import { addRootClickController } from '../common/controllers/root-click.js';
20
19
  import { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';
@@ -342,23 +341,8 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
342
341
  });
343
342
  }
344
343
  _setDateConstraints() {
345
- const dates = [];
346
- if (this._min) {
347
- dates.push({
348
- type: DateRangeType.Before,
349
- dateRange: [this._min],
350
- });
351
- }
352
- if (this._max) {
353
- dates.push({
354
- type: DateRangeType.After,
355
- dateRange: [this._max],
356
- });
357
- }
358
- if (!isEmpty(this.disabledDates)) {
359
- dates.push(...this.disabledDates);
360
- }
361
- this._dateConstraints = isEmpty(dates) ? [] : dates;
344
+ this._dateConstraints =
345
+ createDateConstraints(this.min, this.max, this.disabledDates) ?? [];
362
346
  }
363
347
  _updateMaskedRangeValue() {
364
348
  if (this.useTwoInputs) {