@carbon-labs/wc-date-picker 0.12.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/date-picker/date-picker-input.d.ts +18 -7
- package/es/components/date-picker/date-picker-input.js +50 -26
- package/es/components/date-picker/date-picker-input.js.map +1 -1
- package/es/components/date-picker/date-picker.d.ts +53 -3
- package/es/components/date-picker/date-picker.js +130 -60
- package/es/components/date-picker/date-picker.js.map +1 -1
- package/es/components/date-picker/date-picker.scss.js +1 -1
- package/lib/components/date-picker/date-picker-input.d.ts +18 -7
- package/lib/components/date-picker/date-picker-input.js +49 -25
- package/lib/components/date-picker/date-picker-input.js.map +1 -1
- package/lib/components/date-picker/date-picker.d.ts +53 -3
- package/lib/components/date-picker/date-picker.js +129 -59
- package/lib/components/date-picker/date-picker.js.map +1 -1
- package/lib/components/date-picker/date-picker.scss.js +1 -1
- package/package.json +4 -4
|
@@ -379,15 +379,20 @@ declare class CDSDatePickerInput extends CDSDatePickerInput_base {
|
|
|
379
379
|
*/
|
|
380
380
|
protected _handleAILabelSlotChange({ target }: Event): void;
|
|
381
381
|
/**
|
|
382
|
-
*
|
|
382
|
+
* Handles `click` event on the calendar icon button.
|
|
383
|
+
* Dispatches a custom event and does NOT move focus to the text input,
|
|
384
|
+
* matching the React implementation where the icon is a separate button.
|
|
385
|
+
*
|
|
386
|
+
* @param {MouseEvent} event - The click event.
|
|
383
387
|
*/
|
|
384
|
-
private
|
|
388
|
+
private _handleIconButtonClick;
|
|
385
389
|
/**
|
|
386
|
-
* Handles `click` event on the
|
|
387
|
-
*
|
|
388
|
-
*
|
|
390
|
+
* Handles `click` event on `<input>` in the shadow DOM.
|
|
391
|
+
* Dispatches a custom event so the parent date picker can reopen the calendar
|
|
392
|
+
* when the input already has focus (clicking a focused input does not fire
|
|
393
|
+
* a new `focus` event, so a dedicated click event is required).
|
|
389
394
|
*/
|
|
390
|
-
private
|
|
395
|
+
private _handleInputClick;
|
|
391
396
|
/**
|
|
392
397
|
* Handles `input` event on `<input>` in the shadow DOM.
|
|
393
398
|
*
|
|
@@ -408,7 +413,9 @@ declare class CDSDatePickerInput extends CDSDatePickerInput_base {
|
|
|
408
413
|
*/
|
|
409
414
|
private _handleBlur;
|
|
410
415
|
/**
|
|
411
|
-
* @returns The template for the
|
|
416
|
+
* @returns The template for the calendar icon button.
|
|
417
|
+
* Rendered as a focusable-false button (tabindex="-1") so clicking it does
|
|
418
|
+
* not move focus to the text input — matching the React implementation.
|
|
412
419
|
*/
|
|
413
420
|
private _renderIcon;
|
|
414
421
|
/**
|
|
@@ -526,6 +533,10 @@ declare class CDSDatePickerInput extends CDSDatePickerInput_base {
|
|
|
526
533
|
* A selector that will return the AI Label item.
|
|
527
534
|
*/
|
|
528
535
|
static get aiLabelItem(): string;
|
|
536
|
+
/**
|
|
537
|
+
* The name of the custom event fired when the input is clicked.
|
|
538
|
+
*/
|
|
539
|
+
static get inputClickEventName(): string;
|
|
529
540
|
static shadowRootOptions: {
|
|
530
541
|
delegatesFocus: boolean;
|
|
531
542
|
clonable?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
3
|
import { LitElement, html } from 'lit';
|
|
4
|
-
import {
|
|
4
|
+
import { state, query, property } from 'lit/decorators.js';
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
6
|
import { prefix } from '../../temp-imports/globals/settings.js';
|
|
7
7
|
import FocusMixin from '../../temp-imports/globals/mixins/focus.js';
|
|
@@ -32,6 +32,21 @@ let CDSDatePickerInput = class CDSDatePickerInput extends FocusMixin(LitElement)
|
|
|
32
32
|
* `true` if there is an AI Label.
|
|
33
33
|
*/
|
|
34
34
|
this._hasAILabel = false;
|
|
35
|
+
/**
|
|
36
|
+
* Handles `click` event on `<input>` in the shadow DOM.
|
|
37
|
+
* Dispatches a custom event so the parent date picker can reopen the calendar
|
|
38
|
+
* when the input already has focus (clicking a focused input does not fire
|
|
39
|
+
* a new `focus` event, so a dedicated click event is required).
|
|
40
|
+
*/
|
|
41
|
+
this._handleInputClick = () => {
|
|
42
|
+
this.dispatchEvent(new CustomEvent(`${prefix}-date-picker-input-click`, {
|
|
43
|
+
bubbles: true,
|
|
44
|
+
composed: true,
|
|
45
|
+
detail: {
|
|
46
|
+
inputType: this.kind || 'from',
|
|
47
|
+
},
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
35
50
|
/**
|
|
36
51
|
* Handles `focus` event on `<input>` in the shadow DOM.
|
|
37
52
|
*
|
|
@@ -134,19 +149,18 @@ let CDSDatePickerInput = class CDSDatePickerInput extends FocusMixin(LitElement)
|
|
|
134
149
|
this.requestUpdate();
|
|
135
150
|
}
|
|
136
151
|
/**
|
|
137
|
-
* Handles `click` event on the calendar icon.
|
|
152
|
+
* Handles `click` event on the calendar icon button.
|
|
153
|
+
* Dispatches a custom event and does NOT move focus to the text input,
|
|
154
|
+
* matching the React implementation where the icon is a separate button.
|
|
138
155
|
*
|
|
139
|
-
* @param {MouseEvent} event - The event.
|
|
156
|
+
* @param {MouseEvent} event - The click event.
|
|
140
157
|
*/
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}));
|
|
148
|
-
this.input.focus();
|
|
149
|
-
}
|
|
158
|
+
_handleIconButtonClick(event) {
|
|
159
|
+
event.stopPropagation();
|
|
160
|
+
this.dispatchEvent(new CustomEvent(`${prefix}-date-picker-icon-click`, {
|
|
161
|
+
bubbles: true,
|
|
162
|
+
composed: true,
|
|
163
|
+
}));
|
|
150
164
|
}
|
|
151
165
|
/**
|
|
152
166
|
* Handles `input` event on `<input>` in the shadow DOM.
|
|
@@ -159,16 +173,23 @@ let CDSDatePickerInput = class CDSDatePickerInput extends FocusMixin(LitElement)
|
|
|
159
173
|
this.value = value;
|
|
160
174
|
}
|
|
161
175
|
/**
|
|
162
|
-
* @returns The template for the
|
|
176
|
+
* @returns The template for the calendar icon button.
|
|
177
|
+
* Rendered as a focusable-false button (tabindex="-1") so clicking it does
|
|
178
|
+
* not move focus to the text input — matching the React implementation.
|
|
163
179
|
*/
|
|
164
180
|
_renderIcon() {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
181
|
+
if (this.kind === DATE_PICKER_INPUT_KIND.SIMPLE) {
|
|
182
|
+
return undefined;
|
|
183
|
+
}
|
|
184
|
+
return html `<button
|
|
185
|
+
type="button"
|
|
186
|
+
class="${prefix}--date-picker__icon"
|
|
187
|
+
?disabled="${this.disabled || this.readonly}"
|
|
188
|
+
aria-label="Open calendar"
|
|
189
|
+
tabindex="-1"
|
|
190
|
+
@click="${this._handleIconButtonClick}">
|
|
191
|
+
${iconLoader(Calendar16, { focusable: 'false', 'aria-hidden': 'true' })}
|
|
192
|
+
</button>`;
|
|
172
193
|
}
|
|
173
194
|
/**
|
|
174
195
|
* Handles `slotchange` event on the default `<slot>`.
|
|
@@ -191,7 +212,7 @@ let CDSDatePickerInput = class CDSDatePickerInput extends FocusMixin(LitElement)
|
|
|
191
212
|
*/
|
|
192
213
|
render() {
|
|
193
214
|
const constructor = this.constructor;
|
|
194
|
-
const { disabled, _hasHelperText: hasHelperText, hideLabel, invalid, invalidText, labelText, pattern = constructor.defaultPattern, placeholder, readonly, size, type = constructor.defaultType, value, warn, warnText,
|
|
215
|
+
const { disabled, _hasHelperText: hasHelperText, hideLabel, invalid, invalidText, labelText, pattern = constructor.defaultPattern, placeholder, readonly, size, type = constructor.defaultType, value, warn, warnText, _handleInput: handleInput, _handleFocus: handleFocus, _handleBlur: handleBlur, _handleInputClick: handleInputClick, _hasAILabel: hasAILabel, } = this;
|
|
195
216
|
const invalidIcon = iconLoader(WarningFilled16, {
|
|
196
217
|
class: `${prefix}--date-picker__icon ${prefix}--date-picker__icon--invalid`,
|
|
197
218
|
});
|
|
@@ -241,7 +262,7 @@ let CDSDatePickerInput = class CDSDatePickerInput extends FocusMixin(LitElement)
|
|
|
241
262
|
<label for="input" class="${labelClasses}">
|
|
242
263
|
<slot name="label-text">${labelText}</slot>
|
|
243
264
|
</label>
|
|
244
|
-
<div class="${inputWrapperClasses}"
|
|
265
|
+
<div class="${inputWrapperClasses}">
|
|
245
266
|
<span>
|
|
246
267
|
<input
|
|
247
268
|
id="input"
|
|
@@ -255,6 +276,7 @@ let CDSDatePickerInput = class CDSDatePickerInput extends FocusMixin(LitElement)
|
|
|
255
276
|
@input="${handleInput}"
|
|
256
277
|
@focus="${handleFocus}"
|
|
257
278
|
@blur="${handleBlur}"
|
|
279
|
+
@click="${handleInputClick}"
|
|
258
280
|
?readonly="${readonly}" />
|
|
259
281
|
${normalizedProps.icon || this._renderIcon()}
|
|
260
282
|
<slot
|
|
@@ -311,6 +333,12 @@ let CDSDatePickerInput = class CDSDatePickerInput extends FocusMixin(LitElement)
|
|
|
311
333
|
static get aiLabelItem() {
|
|
312
334
|
return `${prefix}-ai-label`;
|
|
313
335
|
}
|
|
336
|
+
/**
|
|
337
|
+
* The name of the custom event fired when the input is clicked.
|
|
338
|
+
*/
|
|
339
|
+
static get inputClickEventName() {
|
|
340
|
+
return `${prefix}-date-picker-input-click`;
|
|
341
|
+
}
|
|
314
342
|
};
|
|
315
343
|
/**
|
|
316
344
|
* The default value for `pattern` property.
|
|
@@ -325,10 +353,6 @@ CDSDatePickerInput.shadowRootOptions = {
|
|
|
325
353
|
delegatesFocus: true,
|
|
326
354
|
};
|
|
327
355
|
CDSDatePickerInput.styles = styles;
|
|
328
|
-
__decorate([
|
|
329
|
-
query(`.${prefix}--date-picker__icon`),
|
|
330
|
-
__metadata("design:type", SVGElement)
|
|
331
|
-
], CDSDatePickerInput.prototype, "_iconNode", void 0);
|
|
332
356
|
__decorate([
|
|
333
357
|
state(),
|
|
334
358
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-input.js","sources":["../../../../components/date-picker/date-picker-input.ts"],"sourcesContent":[null],"names":["DATE_PICKER_INPUT_COLOR_SCHEME","customElement"],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;AAKG;AAuBH;;;;AAIG;AAEH,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU,CAAC,UAAU,CAAC,CAAA;AAAvD,IAAA,WAAA,GAAA;;AACE;;AAEG;QACK,IAAA,CAAA,WAAW,GAAG,KAAK;AA+D3B;;;;AAIG;AACK,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,MAAkB,KAAI;;YAE5C,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,CAAA,EAAG,MAAM,CAAA,wBAAA,CAA0B,EAAE;AACnD,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,MAAM,EAAE;AACN,oBAAA,SAAS,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM;AAC/B,iBAAA;AACF,aAAA,CAAC,CACH;AACH,QAAA,CAAC;AAED;;;;AAIG;AACK,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,MAAkB,KAAI;;YAE3C,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,CAAA,EAAG,MAAM,CAAA,uBAAA,CAAyB,EAAE;AAClD,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,MAAM,EAAE;AACN,oBAAA,SAAS,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM;AAC/B,iBAAA;AACF,aAAA,CAAC,CACH;AACH,QAAA,CAAC;AAeD;;AAEG;QAEO,IAAA,CAAA,cAAc,GAAG,KAAK;AAyBhC;;AAEG;AAEH,QAAA,IAAA,CAAA,WAAW,GAAGA,yBAA8B,CAAC,OAAO;AAEpD;;AAEG;QAEH,IAAA,CAAA,QAAQ,GAA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AA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAMf,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC9B,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAMb,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;;AACvB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AArPV,kBAAkB,GAAA,UAAA,CAAA;AADvB,IAAAC,aAAa,CAAC,CAAA,EAAG,MAAM,CAAA,kBAAA,CAAoB;AACtC,CAAA,EAAA,kBAAkB,CAobvB;;;;"}
|
|
1
|
+
{"version":3,"file":"date-picker-input.js","sources":["../../../../components/date-picker/date-picker-input.ts"],"sourcesContent":[null],"names":["DATE_PICKER_INPUT_COLOR_SCHEME","customElement"],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;AAKG;AAuBH;;;;AAIG;AAEH,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU,CAAC,UAAU,CAAC,CAAA;AAAvD,IAAA,WAAA,GAAA;;AACE;;AAEG;QACK,IAAA,CAAA,WAAW,GAAG,KAAK;AA6C3B;;;;;AAKG;QACK,IAAA,CAAA,iBAAiB,GAAG,MAAK;YAC/B,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,CAAA,EAAG,MAAM,CAAA,wBAAA,CAA0B,EAAE;AACnD,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,MAAM,EAAE;AACN,oBAAA,SAAS,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM;AAC/B,iBAAA;AACF,aAAA,CAAC,CACH;AACH,QAAA,CAAC;AAaD;;;;AAIG;AACK,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,MAA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AAA,kBAAA,CAAoB;AACtC,CAAA,EAAA,kBAAkB,CA8cvB;;;;"}
|
|
@@ -748,10 +748,19 @@ declare class CDSDatePicker extends CDSDatePicker_base {
|
|
|
748
748
|
* Click outside handler for closing calendar
|
|
749
749
|
*/
|
|
750
750
|
private _clickOutsideHandler;
|
|
751
|
+
/**
|
|
752
|
+
* Pending input target for post-render focus restoration
|
|
753
|
+
*/
|
|
754
|
+
private _pendingRestoreFocusTo;
|
|
751
755
|
/**
|
|
752
756
|
* Timestamp of when calendar was last closed via Tab key
|
|
753
757
|
*/
|
|
754
758
|
private _lastTabCloseTime;
|
|
759
|
+
/**
|
|
760
|
+
* True while programmatic focus restoration is in progress after date
|
|
761
|
+
* selection. Prevents the INPUT_FOCUS handler from auto-reopening the calendar.
|
|
762
|
+
*/
|
|
763
|
+
private _restoringFocus;
|
|
755
764
|
/**
|
|
756
765
|
* @returns The effective date picker mode, determined by the child `<cds-date-picker-input>`.
|
|
757
766
|
*/
|
|
@@ -775,6 +784,15 @@ declare class CDSDatePicker extends CDSDatePicker_base {
|
|
|
775
784
|
* @param {CustomEvent} event - The focus event
|
|
776
785
|
*/
|
|
777
786
|
private _handleInputFocus;
|
|
787
|
+
/**
|
|
788
|
+
* Handles input click event from date-picker-input.
|
|
789
|
+
* When the input already has focus, clicking it does not fire a new focus
|
|
790
|
+
* event. This handler ensures the calendar reopens on click even when focus
|
|
791
|
+
* is already on the input.
|
|
792
|
+
*
|
|
793
|
+
* @param {CustomEvent} event - The click event
|
|
794
|
+
*/
|
|
795
|
+
private _handleInputClick;
|
|
778
796
|
/**
|
|
779
797
|
* Handles input blur event from date-picker-input
|
|
780
798
|
*
|
|
@@ -893,10 +911,38 @@ declare class CDSDatePicker extends CDSDatePicker_base {
|
|
|
893
911
|
*/
|
|
894
912
|
private _handleKeyDown;
|
|
895
913
|
/**
|
|
896
|
-
*
|
|
897
|
-
*
|
|
914
|
+
* A ref to the exit sentinel element rendered at the bottom of the shadow root.
|
|
915
|
+
* It sits just after the calendar container in DOM order. Normally it has
|
|
916
|
+
* tabindex="-1" so it is invisible to Tab. When the user presses Tab from
|
|
917
|
+
* inside the calendar, _activateExitSentinel() sets it to tabindex="0" so
|
|
918
|
+
* the browser delivers the Tab keystroke to it naturally — no DOM scan needed.
|
|
919
|
+
* The focus handler then closes the calendar and restores tabindex="-1".
|
|
920
|
+
*
|
|
921
|
+
* Uses a CSS class rather than an id to avoid any document-level id concerns
|
|
922
|
+
* (shadow-DOM ids are already scoped, but a class is more conventional for
|
|
923
|
+
* internal Lit @query targets and matches the cds-- naming pattern used
|
|
924
|
+
* throughout this file).
|
|
925
|
+
*
|
|
926
|
+
* TODO (carbon monorepo migration): replace this hand-rolled sentinel with the
|
|
927
|
+
* upstream Carbon wrapFocus utility, which implements the same start/end sentinel
|
|
928
|
+
* pattern for focus trapping and exit.
|
|
929
|
+
* Upstream location: packages/react/src/internal/wrapFocus.ts (wrapFocus /
|
|
930
|
+
* wrapFocusWithoutSentinels exports). Note that wrapFocus is designed to trap
|
|
931
|
+
* focus inside a container (modal pattern) rather than release it; the exit-only
|
|
932
|
+
* direction we need maps to the endTrapNode path in that utility.
|
|
933
|
+
*/
|
|
934
|
+
private _exitSentinelNode;
|
|
935
|
+
/**
|
|
936
|
+
* Temporarily make the exit sentinel tabbable so the browser's native Tab
|
|
937
|
+
* handling delivers focus to it after the calendar.
|
|
898
938
|
*/
|
|
899
|
-
private
|
|
939
|
+
private _activateExitSentinel;
|
|
940
|
+
/**
|
|
941
|
+
* Handle focus arriving on the exit sentinel.
|
|
942
|
+
* Close the calendar, then immediately remove the sentinel from the tab order
|
|
943
|
+
* so that a subsequent Tab from outside the date picker skips it entirely.
|
|
944
|
+
*/
|
|
945
|
+
private _handleExitSentinelFocus;
|
|
900
946
|
/**
|
|
901
947
|
* Lifecycle callback when element is connected
|
|
902
948
|
*/
|
|
@@ -975,6 +1021,10 @@ declare class CDSDatePicker extends CDSDatePicker_base {
|
|
|
975
1021
|
* The name of the custom event fired when an input loses focus.
|
|
976
1022
|
*/
|
|
977
1023
|
static get eventInputBlur(): string;
|
|
1024
|
+
/**
|
|
1025
|
+
* The name of the custom event fired when an input is clicked.
|
|
1026
|
+
*/
|
|
1027
|
+
static get eventInputClick(): string;
|
|
978
1028
|
static styles: any;
|
|
979
1029
|
}
|
|
980
1030
|
export default CDSDatePicker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { html, LitElement } from 'lit';
|
|
3
|
-
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { property, query } from 'lit/decorators.js';
|
|
4
4
|
import { prefix } from '../../temp-imports/globals/settings.js';
|
|
5
5
|
import FormMixin from '../../temp-imports/globals/mixins/form.js';
|
|
6
6
|
import HostListenerMixin from '../../temp-imports/globals/mixins/host-listener.js';
|
|
@@ -57,10 +57,19 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
57
57
|
* Click outside handler for closing calendar
|
|
58
58
|
*/
|
|
59
59
|
this._clickOutsideHandler = null;
|
|
60
|
+
/**
|
|
61
|
+
* Pending input target for post-render focus restoration
|
|
62
|
+
*/
|
|
63
|
+
this._pendingRestoreFocusTo = null;
|
|
60
64
|
/**
|
|
61
65
|
* Timestamp of when calendar was last closed via Tab key
|
|
62
66
|
*/
|
|
63
67
|
this._lastTabCloseTime = 0;
|
|
68
|
+
/**
|
|
69
|
+
* True while programmatic focus restoration is in progress after date
|
|
70
|
+
* selection. Prevents the INPUT_FOCUS handler from auto-reopening the calendar.
|
|
71
|
+
*/
|
|
72
|
+
this._restoringFocus = false;
|
|
64
73
|
/**
|
|
65
74
|
* Handles `${prefix}-date-picker-changed` event on this element.
|
|
66
75
|
*
|
|
@@ -101,17 +110,29 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
101
110
|
if (this._adapter && !this.disabled && !this.readonly) {
|
|
102
111
|
const { inputType } = event.detail || {};
|
|
103
112
|
this._adapter.send(DatePickerEvent.INPUT_FOCUS, { inputType });
|
|
104
|
-
// Don't auto-open calendar if
|
|
105
|
-
//
|
|
106
|
-
// but allows normal opening after that brief window
|
|
113
|
+
// Don't auto-open calendar if focus was restored programmatically after
|
|
114
|
+
// date selection, or if it was JUST closed via Tab key (within 100ms).
|
|
107
115
|
const timeSinceTabClose = Date.now() - this._lastTabCloseTime;
|
|
108
|
-
|
|
109
|
-
if (!shouldSkipOpen) {
|
|
110
|
-
// Open calendar when input is focused (matching current Carbon behavior)
|
|
116
|
+
if (!this._restoringFocus && timeSinceTabClose >= 100) {
|
|
111
117
|
this._adapter.send(DatePickerEvent.CALENDAR_OPEN);
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* Handles input click event from date-picker-input.
|
|
123
|
+
* When the input already has focus, clicking it does not fire a new focus
|
|
124
|
+
* event. This handler ensures the calendar reopens on click even when focus
|
|
125
|
+
* is already on the input.
|
|
126
|
+
*
|
|
127
|
+
* @param {CustomEvent} event - The click event
|
|
128
|
+
*/
|
|
129
|
+
this._handleInputClick = (event) => {
|
|
130
|
+
if (this._adapter && !this.disabled && !this.readonly && !this.open) {
|
|
131
|
+
const { inputType } = event.detail || {};
|
|
132
|
+
this._adapter.send(DatePickerEvent.INPUT_FOCUS, { inputType });
|
|
133
|
+
this._adapter.send(DatePickerEvent.CALENDAR_OPEN);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
115
136
|
/**
|
|
116
137
|
* Handles input blur event from date-picker-input
|
|
117
138
|
*
|
|
@@ -233,6 +254,27 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
233
254
|
},
|
|
234
255
|
}));
|
|
235
256
|
}
|
|
257
|
+
if (context.shouldRestoreFocus && context.restoreFocusTo) {
|
|
258
|
+
this._pendingRestoreFocusTo = context.restoreFocusTo;
|
|
259
|
+
this.updateComplete.then(() => {
|
|
260
|
+
var _a, _b;
|
|
261
|
+
const targetSelector = this._pendingRestoreFocusTo === 'to'
|
|
262
|
+
? this.constructor.selectorInputTo
|
|
263
|
+
: this.constructor.selectorInputFrom;
|
|
264
|
+
// @ts-expect-error - querySelector is available from HTMLElement
|
|
265
|
+
const targetInput = this.querySelector(targetSelector);
|
|
266
|
+
// Guard against the INPUT_FOCUS handler auto-reopening the calendar
|
|
267
|
+
// when focus is restored programmatically after date selection.
|
|
268
|
+
this._restoringFocus = true;
|
|
269
|
+
(_a = targetInput === null || targetInput === void 0 ? void 0 : targetInput.input) === null || _a === void 0 ? void 0 : _a.focus();
|
|
270
|
+
this._restoringFocus = false;
|
|
271
|
+
(_b = this._adapter) === null || _b === void 0 ? void 0 : _b.updateContext({
|
|
272
|
+
shouldRestoreFocus: false,
|
|
273
|
+
restoreFocusTo: null,
|
|
274
|
+
});
|
|
275
|
+
this._pendingRestoreFocusTo = null;
|
|
276
|
+
});
|
|
277
|
+
}
|
|
236
278
|
};
|
|
237
279
|
/**
|
|
238
280
|
* Handles calendar date selection
|
|
@@ -334,6 +376,20 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
334
376
|
const isFocusInCalendar = target === calendar ||
|
|
335
377
|
((_b = target.closest) === null || _b === void 0 ? void 0 : _b.call(target, 'cds-date-picker-calendar')) !== null ||
|
|
336
378
|
composedPath.includes(calendar);
|
|
379
|
+
// Case 0: Tab FROM input while closed -> reopen calendar and keep focus on input
|
|
380
|
+
if (!this.open &&
|
|
381
|
+
(isOnFirstInput || isOnSecondInput) &&
|
|
382
|
+
!event.shiftKey) {
|
|
383
|
+
event.preventDefault();
|
|
384
|
+
event.stopPropagation();
|
|
385
|
+
this._lastTabCloseTime = 0;
|
|
386
|
+
this._adapter.send(DatePickerEvent.INPUT_FOCUS, {
|
|
387
|
+
inputType: isOnSecondInput ? 'to' : 'from',
|
|
388
|
+
});
|
|
389
|
+
this._adapter.send(DatePickerEvent.CALENDAR_OPEN);
|
|
390
|
+
this.requestUpdate();
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
337
393
|
// Case 1: Tab FROM first input -> Focus calendar (if open)
|
|
338
394
|
if (this.open && isOnFirstInput && !event.shiftKey) {
|
|
339
395
|
event.preventDefault();
|
|
@@ -388,25 +444,25 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
388
444
|
}
|
|
389
445
|
return;
|
|
390
446
|
}
|
|
391
|
-
// Case 4: Tab FROM calendar -> Move to second input (range) or
|
|
447
|
+
// Case 4: Tab FROM calendar -> Move to second input (range) or exit via sentinel
|
|
392
448
|
if (this.open && isFocusInCalendar && !event.shiftKey) {
|
|
393
|
-
|
|
394
|
-
// In range mode, check which input was last focused
|
|
449
|
+
// In range mode, move to the second input first
|
|
395
450
|
if (this._mode === DATE_PICKER_MODE.RANGE) {
|
|
396
451
|
const context = (_l = this._adapter) === null || _l === void 0 ? void 0 : _l.getContext();
|
|
397
452
|
const lastFocused = context === null || context === void 0 ? void 0 : context.lastFocusedInput;
|
|
398
|
-
// If we were on the first input, move to second input
|
|
399
453
|
if (lastFocused === 'from' && inputTo) {
|
|
454
|
+
event.preventDefault();
|
|
400
455
|
(_m = inputTo.input) === null || _m === void 0 ? void 0 : _m.focus();
|
|
401
456
|
return;
|
|
402
457
|
}
|
|
403
458
|
}
|
|
404
|
-
//
|
|
405
|
-
//
|
|
459
|
+
// Single mode (or range after second input): activate the exit sentinel
|
|
460
|
+
// so the browser delivers Tab to it naturally, then the sentinel's focus
|
|
461
|
+
// handler closes the calendar and removes itself from the tab order.
|
|
462
|
+
// No preventDefault — the browser handles the Tab traversal.
|
|
406
463
|
this._lastTabCloseTime = Date.now();
|
|
407
464
|
this._adapter.send(DatePickerEvent.TAB_KEY);
|
|
408
|
-
|
|
409
|
-
this._focusNextElement(false);
|
|
465
|
+
this._activateExitSentinel();
|
|
410
466
|
return;
|
|
411
467
|
}
|
|
412
468
|
}
|
|
@@ -453,6 +509,24 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
453
509
|
return;
|
|
454
510
|
}
|
|
455
511
|
};
|
|
512
|
+
/**
|
|
513
|
+
* Handle focus arriving on the exit sentinel.
|
|
514
|
+
* Close the calendar, then immediately remove the sentinel from the tab order
|
|
515
|
+
* so that a subsequent Tab from outside the date picker skips it entirely.
|
|
516
|
+
*/
|
|
517
|
+
this._handleExitSentinelFocus = () => {
|
|
518
|
+
var _a;
|
|
519
|
+
// Deactivate sentinel first so it is skipped on all future Tab presses.
|
|
520
|
+
if (this._exitSentinelNode) {
|
|
521
|
+
this._exitSentinelNode.tabIndex = -1;
|
|
522
|
+
}
|
|
523
|
+
// The TAB_KEY event was already sent in _handleKeyDown before the sentinel
|
|
524
|
+
// was activated; the calendar will already be closing / closed.
|
|
525
|
+
// Ensure the open flag is consistent.
|
|
526
|
+
if (this.open) {
|
|
527
|
+
(_a = this._adapter) === null || _a === void 0 ? void 0 : _a.send(DatePickerEvent.TAB_KEY);
|
|
528
|
+
}
|
|
529
|
+
};
|
|
456
530
|
}
|
|
457
531
|
/**
|
|
458
532
|
* @returns The effective date picker mode, determined by the child `<cds-date-picker-input>`.
|
|
@@ -583,6 +657,7 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
583
657
|
* Releases the date picker state machine.
|
|
584
658
|
*/
|
|
585
659
|
_releaseDatePicker() {
|
|
660
|
+
this._pendingRestoreFocusTo = null;
|
|
586
661
|
if (this._adapter) {
|
|
587
662
|
this._adapter.destroy();
|
|
588
663
|
this._adapter = null;
|
|
@@ -607,41 +682,12 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
607
682
|
this.requestUpdate('value', oldValue);
|
|
608
683
|
}
|
|
609
684
|
/**
|
|
610
|
-
*
|
|
611
|
-
*
|
|
685
|
+
* Temporarily make the exit sentinel tabbable so the browser's native Tab
|
|
686
|
+
* handling delivers focus to it after the calendar.
|
|
612
687
|
*/
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
const allTabbable = Array.from(document.querySelectorAll(tabbableSelector));
|
|
617
|
-
// Find the index of this date picker component
|
|
618
|
-
const currentIndex = allTabbable.findIndex((el) => this.contains(el) || el === this);
|
|
619
|
-
if (currentIndex === -1) {
|
|
620
|
-
return; // Couldn't find current element
|
|
621
|
-
}
|
|
622
|
-
// Find the next element after all elements within this date picker
|
|
623
|
-
let nextIndex = currentIndex;
|
|
624
|
-
if (backwards) {
|
|
625
|
-
// Tab backwards - find previous element before this date picker
|
|
626
|
-
for (let i = currentIndex - 1; i >= 0; i--) {
|
|
627
|
-
if (!this.contains(allTabbable[i])) {
|
|
628
|
-
nextIndex = i;
|
|
629
|
-
break;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
else {
|
|
634
|
-
// Tab forwards - find next element after this date picker
|
|
635
|
-
for (let i = currentIndex + 1; i < allTabbable.length; i++) {
|
|
636
|
-
if (!this.contains(allTabbable[i])) {
|
|
637
|
-
nextIndex = i;
|
|
638
|
-
break;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
// Focus the next element
|
|
643
|
-
if (nextIndex !== currentIndex && allTabbable[nextIndex]) {
|
|
644
|
-
allTabbable[nextIndex].focus();
|
|
688
|
+
_activateExitSentinel() {
|
|
689
|
+
if (this._exitSentinelNode) {
|
|
690
|
+
this._exitSentinelNode.tabIndex = 0;
|
|
645
691
|
}
|
|
646
692
|
}
|
|
647
693
|
/**
|
|
@@ -660,7 +706,9 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
660
706
|
*/
|
|
661
707
|
containsNode: (node) => {
|
|
662
708
|
var _a, _b;
|
|
663
|
-
return (
|
|
709
|
+
return (node === this ||
|
|
710
|
+
this.contains(node) ||
|
|
711
|
+
((_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(node)) !== null && _b !== void 0 ? _b : false));
|
|
664
712
|
},
|
|
665
713
|
/**
|
|
666
714
|
* Handle clicks outside the date picker
|
|
@@ -722,6 +770,9 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
722
770
|
this._hideCalendarPopover();
|
|
723
771
|
}
|
|
724
772
|
}
|
|
773
|
+
if (changedProperties.has('closeOnSelect')) {
|
|
774
|
+
this._adapter.updateContext({ closeOnSelect: this.closeOnSelect });
|
|
775
|
+
}
|
|
725
776
|
if (changedProperties.has('disabled') ||
|
|
726
777
|
changedProperties.has('readonly')) {
|
|
727
778
|
const { selectorInputFrom, selectorInputTo } = this
|
|
@@ -774,11 +825,6 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
774
825
|
? [context.startDate]
|
|
775
826
|
: [];
|
|
776
827
|
return html `
|
|
777
|
-
<a
|
|
778
|
-
class="${prefix}--visually-hidden"
|
|
779
|
-
href="javascript:void 0"
|
|
780
|
-
role="navigation"
|
|
781
|
-
tabindex="-1"></a>
|
|
782
828
|
<slot @slotchange="${handleSlotChange}"></slot>
|
|
783
829
|
<div
|
|
784
830
|
id="floating-menu-container"
|
|
@@ -805,11 +851,18 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
805
851
|
`
|
|
806
852
|
: ''}
|
|
807
853
|
</div>
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
854
|
+
<!--
|
|
855
|
+
Exit sentinel: sits just after the calendar container in shadow-DOM tab
|
|
856
|
+
order. Normally tabindex="-1" (invisible to Tab). _activateExitSentinel()
|
|
857
|
+
sets it to tabindex="0" when the user presses Tab from the calendar, so the
|
|
858
|
+
browser delivers that Tab keystroke here naturally. The focus handler then
|
|
859
|
+
closes the calendar and restores tabindex="-1".
|
|
860
|
+
-->
|
|
861
|
+
<span
|
|
862
|
+
class="${prefix}--date-picker__exit-sentinel"
|
|
863
|
+
tabindex="-1"
|
|
864
|
+
aria-hidden="true"
|
|
865
|
+
@focus="${this._handleExitSentinelFocus}"></span>
|
|
813
866
|
`;
|
|
814
867
|
}
|
|
815
868
|
/**
|
|
@@ -890,6 +943,12 @@ let CDSDatePicker = class CDSDatePicker extends HostListenerMixin(FormMixin(LitE
|
|
|
890
943
|
static get eventInputBlur() {
|
|
891
944
|
return `${prefix}-date-picker-input-blur`;
|
|
892
945
|
}
|
|
946
|
+
/**
|
|
947
|
+
* The name of the custom event fired when an input is clicked.
|
|
948
|
+
*/
|
|
949
|
+
static get eventInputClick() {
|
|
950
|
+
return `${prefix}-date-picker-input-click`;
|
|
951
|
+
}
|
|
893
952
|
};
|
|
894
953
|
/**
|
|
895
954
|
* The CSS class applied to the "today" highlight if there are any dates selected.
|
|
@@ -921,6 +980,13 @@ __decorate([
|
|
|
921
980
|
,
|
|
922
981
|
__metadata("design:type", Object)
|
|
923
982
|
], CDSDatePicker.prototype, "_handleInputFocus", void 0);
|
|
983
|
+
__decorate([
|
|
984
|
+
HostListener('eventInputClick')
|
|
985
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
986
|
+
// @ts-ignore: The decorator refers to this method, but TS thinks this method is not referred to
|
|
987
|
+
,
|
|
988
|
+
__metadata("design:type", Object)
|
|
989
|
+
], CDSDatePicker.prototype, "_handleInputClick", void 0);
|
|
924
990
|
__decorate([
|
|
925
991
|
HostListener('eventInputBlur')
|
|
926
992
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -973,6 +1039,10 @@ __decorate([
|
|
|
973
1039
|
__metadata("design:type", String),
|
|
974
1040
|
__metadata("design:paramtypes", [String])
|
|
975
1041
|
], CDSDatePicker.prototype, "value", null);
|
|
1042
|
+
__decorate([
|
|
1043
|
+
query(`.${prefix}--date-picker__exit-sentinel`),
|
|
1044
|
+
__metadata("design:type", HTMLElement)
|
|
1045
|
+
], CDSDatePicker.prototype, "_exitSentinelNode", void 0);
|
|
976
1046
|
CDSDatePicker = __decorate([
|
|
977
1047
|
carbonElement(`${prefix}-date-picker`)
|
|
978
1048
|
], CDSDatePicker);
|