@carbon/web-components 2.60.0 → 2.61.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/custom-elements.json +1401 -361
- package/es/components/breadcrumb/breadcrumb.scss.js +1 -1
- package/es/components/breadcrumb/breadcrumb.scss.js.map +1 -1
- package/es/components/date-picker/date-picker-input.d.ts +13 -1
- package/es/components/date-picker/date-picker-input.d.ts.map +1 -1
- package/es/components/date-picker/date-picker-input.js +36 -16
- package/es/components/date-picker/date-picker-input.js.map +1 -1
- package/es/components/date-picker/date-picker.d.ts +6 -0
- package/es/components/date-picker/date-picker.d.ts.map +1 -1
- package/es/components/date-picker/date-picker.js +10 -2
- package/es/components/date-picker/date-picker.js.map +1 -1
- package/es/components/date-picker/date-picker.scss.js +1 -1
- package/es/components/date-picker/date-picker.scss.js.map +1 -1
- package/es/components/date-picker/defs.d.ts +18 -1
- package/es/components/date-picker/defs.d.ts.map +1 -1
- package/es/components/date-picker/defs.js +19 -1
- package/es/components/date-picker/defs.js.map +1 -1
- package/es/components/date-picker/next/adapters/web-component-adapter.d.ts +143 -0
- package/es/components/date-picker/next/adapters/web-component-adapter.d.ts.map +1 -0
- package/es/components/date-picker/next/adapters/web-component-adapter.js +215 -0
- package/es/components/date-picker/next/adapters/web-component-adapter.js.map +1 -0
- package/es/components/date-picker/next/components/calendar-renderer.d.ts +136 -0
- package/es/components/date-picker/next/components/calendar-renderer.d.ts.map +1 -0
- package/es/components/date-picker/next/components/calendar-renderer.js +278 -0
- package/es/components/date-picker/next/components/calendar-renderer.js.map +1 -0
- package/es/components/date-picker/next/components/date-picker-input-skeleton.d.ts +35 -0
- package/es/components/date-picker/next/components/date-picker-input-skeleton.d.ts.map +1 -0
- package/es/components/date-picker/next/components/date-picker-input-skeleton.js +73 -0
- package/es/components/date-picker/next/components/date-picker-input-skeleton.js.map +1 -0
- package/es/components/date-picker/next/components/date-picker-input.d.ts +196 -0
- package/es/components/date-picker/next/components/date-picker-input.d.ts.map +1 -0
- package/es/components/date-picker/next/components/date-picker-input.js +334 -0
- package/es/components/date-picker/next/components/date-picker-input.js.map +1 -0
- package/es/components/date-picker/next/components/date-picker.d.ts +329 -0
- package/es/components/date-picker/next/components/date-picker.d.ts.map +1 -0
- package/es/components/date-picker/next/components/date-picker.js +621 -0
- package/es/components/date-picker/next/components/date-picker.js.map +1 -0
- package/es/components/date-picker/next/components/date-picker.scss.js +14 -0
- package/es/components/date-picker/next/components/date-picker.scss.js.map +1 -0
- package/es/components/date-picker/next/index.d.ts +11 -0
- package/es/components/date-picker/next/index.d.ts.map +1 -0
- package/es/components/date-picker/next/index.js +11 -0
- package/es/components/dropdown/dropdown.d.ts +8 -0
- package/es/components/dropdown/dropdown.d.ts.map +1 -1
- package/es/components/dropdown/dropdown.js +4 -2
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/fluid-date-picker/fluid-date-picker-input.d.ts +39 -0
- package/es/components/fluid-date-picker/fluid-date-picker-input.d.ts.map +1 -0
- package/es/components/fluid-date-picker/fluid-date-picker-input.js +59 -0
- package/es/components/fluid-date-picker/fluid-date-picker-input.js.map +1 -0
- package/es/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts +20 -0
- package/es/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts.map +1 -0
- package/es/components/fluid-date-picker/fluid-date-picker-skeleton.js +74 -0
- package/es/components/fluid-date-picker/fluid-date-picker-skeleton.js.map +1 -0
- package/es/components/fluid-date-picker/fluid-date-picker.d.ts +24 -0
- package/es/components/fluid-date-picker/fluid-date-picker.d.ts.map +1 -0
- package/es/components/fluid-date-picker/fluid-date-picker.js +51 -0
- package/es/components/fluid-date-picker/fluid-date-picker.js.map +1 -0
- package/es/components/fluid-date-picker/fluid-date-picker.scss.js +14 -0
- package/es/components/fluid-date-picker/fluid-date-picker.scss.js.map +1 -0
- package/es/components/fluid-date-picker/index.d.ts +10 -0
- package/es/components/fluid-date-picker/index.d.ts.map +1 -0
- package/es/components/fluid-date-picker/index.js +10 -0
- package/es/components/pagination/pagination.scss.js +1 -1
- package/es/components/password-input/password-input.d.ts.map +1 -1
- package/es/components/password-input/password-input.js +3 -2
- package/es/components/password-input/password-input.js.map +1 -1
- package/es/components/radio-button/radio-button.js +1 -1
- package/es/components/radio-button/radio-button.js.map +1 -1
- package/es/components/select/select.d.ts +8 -0
- package/es/components/select/select.d.ts.map +1 -1
- package/es/components/select/select.js +4 -2
- package/es/components/select/select.js.map +1 -1
- package/es/components/skip-to-content/skip-to-content.scss.js +1 -1
- package/es/components/text-input/text-input.d.ts +17 -0
- package/es/components/text-input/text-input.d.ts.map +1 -1
- package/es/components/text-input/text-input.js +28 -6
- package/es/components/text-input/text-input.js.map +1 -1
- package/es/components/textarea/textarea.d.ts.map +1 -1
- package/es/components/textarea/textarea.js +2 -1
- package/es/components/textarea/textarea.js.map +1 -1
- package/es/components/ui-shell/header.scss.js +1 -1
- package/es/components/ui-shell/header.scss.js.map +1 -1
- package/es/index.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.scss.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.scss.js.map +1 -1
- package/es-custom/components/date-picker/date-picker-input.d.ts +13 -1
- package/es-custom/components/date-picker/date-picker-input.d.ts.map +1 -1
- package/es-custom/components/date-picker/date-picker-input.js +36 -16
- package/es-custom/components/date-picker/date-picker-input.js.map +1 -1
- package/es-custom/components/date-picker/date-picker.d.ts +6 -0
- package/es-custom/components/date-picker/date-picker.d.ts.map +1 -1
- package/es-custom/components/date-picker/date-picker.js +10 -2
- package/es-custom/components/date-picker/date-picker.js.map +1 -1
- package/es-custom/components/date-picker/date-picker.scss.js +1 -1
- package/es-custom/components/date-picker/date-picker.scss.js.map +1 -1
- package/es-custom/components/date-picker/defs.d.ts +18 -1
- package/es-custom/components/date-picker/defs.d.ts.map +1 -1
- package/es-custom/components/date-picker/defs.js +19 -1
- package/es-custom/components/date-picker/defs.js.map +1 -1
- package/es-custom/components/date-picker/next/adapters/web-component-adapter.d.ts +143 -0
- package/es-custom/components/date-picker/next/adapters/web-component-adapter.d.ts.map +1 -0
- package/es-custom/components/date-picker/next/adapters/web-component-adapter.js +215 -0
- package/es-custom/components/date-picker/next/adapters/web-component-adapter.js.map +1 -0
- package/es-custom/components/date-picker/next/components/calendar-renderer.d.ts +136 -0
- package/es-custom/components/date-picker/next/components/calendar-renderer.d.ts.map +1 -0
- package/es-custom/components/date-picker/next/components/calendar-renderer.js +278 -0
- package/es-custom/components/date-picker/next/components/calendar-renderer.js.map +1 -0
- package/es-custom/components/date-picker/next/components/date-picker-input-skeleton.d.ts +35 -0
- package/es-custom/components/date-picker/next/components/date-picker-input-skeleton.d.ts.map +1 -0
- package/es-custom/components/date-picker/next/components/date-picker-input-skeleton.js +73 -0
- package/es-custom/components/date-picker/next/components/date-picker-input-skeleton.js.map +1 -0
- package/es-custom/components/date-picker/next/components/date-picker-input.d.ts +196 -0
- package/es-custom/components/date-picker/next/components/date-picker-input.d.ts.map +1 -0
- package/es-custom/components/date-picker/next/components/date-picker-input.js +334 -0
- package/es-custom/components/date-picker/next/components/date-picker-input.js.map +1 -0
- package/es-custom/components/date-picker/next/components/date-picker.d.ts +329 -0
- package/es-custom/components/date-picker/next/components/date-picker.d.ts.map +1 -0
- package/es-custom/components/date-picker/next/components/date-picker.js +621 -0
- package/es-custom/components/date-picker/next/components/date-picker.js.map +1 -0
- package/es-custom/components/date-picker/next/components/date-picker.scss.js +14 -0
- package/es-custom/components/date-picker/next/components/date-picker.scss.js.map +1 -0
- package/es-custom/components/date-picker/next/index.d.ts +11 -0
- package/es-custom/components/date-picker/next/index.d.ts.map +1 -0
- package/es-custom/components/date-picker/next/index.js +11 -0
- package/es-custom/components/dropdown/dropdown.d.ts +8 -0
- package/es-custom/components/dropdown/dropdown.d.ts.map +1 -1
- package/es-custom/components/dropdown/dropdown.js +4 -2
- package/es-custom/components/dropdown/dropdown.js.map +1 -1
- package/es-custom/components/fluid-date-picker/fluid-date-picker-input.d.ts +39 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker-input.d.ts.map +1 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker-input.js +59 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker-input.js.map +1 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts +20 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts.map +1 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker-skeleton.js +74 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker-skeleton.js.map +1 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker.d.ts +24 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker.d.ts.map +1 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker.js +51 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker.js.map +1 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker.scss.js +14 -0
- package/es-custom/components/fluid-date-picker/fluid-date-picker.scss.js.map +1 -0
- package/es-custom/components/fluid-date-picker/index.d.ts +10 -0
- package/es-custom/components/fluid-date-picker/index.d.ts.map +1 -0
- package/es-custom/components/fluid-date-picker/index.js +10 -0
- package/es-custom/components/pagination/pagination.scss.js +1 -1
- package/es-custom/components/password-input/password-input.d.ts.map +1 -1
- package/es-custom/components/password-input/password-input.js +3 -2
- package/es-custom/components/password-input/password-input.js.map +1 -1
- package/es-custom/components/radio-button/radio-button.js +1 -1
- package/es-custom/components/radio-button/radio-button.js.map +1 -1
- package/es-custom/components/select/select.d.ts +8 -0
- package/es-custom/components/select/select.d.ts.map +1 -1
- package/es-custom/components/select/select.js +4 -2
- package/es-custom/components/select/select.js.map +1 -1
- package/es-custom/components/skip-to-content/skip-to-content.scss.js +1 -1
- package/es-custom/components/text-input/text-input.d.ts +17 -0
- package/es-custom/components/text-input/text-input.d.ts.map +1 -1
- package/es-custom/components/text-input/text-input.js +28 -6
- package/es-custom/components/text-input/text-input.js.map +1 -1
- package/es-custom/components/textarea/textarea.d.ts.map +1 -1
- package/es-custom/components/textarea/textarea.js +2 -1
- package/es-custom/components/textarea/textarea.js.map +1 -1
- package/es-custom/components/ui-shell/header.scss.js +1 -1
- package/es-custom/components/ui-shell/header.scss.js.map +1 -1
- package/es-custom/index.js +1 -1
- package/lib/components/date-picker/date-picker-input.d.ts +13 -1
- package/lib/components/date-picker/date-picker-input.d.ts.map +1 -1
- package/lib/components/date-picker/date-picker.d.ts +6 -0
- package/lib/components/date-picker/date-picker.d.ts.map +1 -1
- package/lib/components/date-picker/defs.d.ts +18 -1
- package/lib/components/date-picker/defs.d.ts.map +1 -1
- package/lib/components/date-picker/defs.js +19 -0
- package/lib/components/date-picker/defs.js.map +1 -1
- package/lib/components/date-picker/next/adapters/web-component-adapter.d.ts +143 -0
- package/lib/components/date-picker/next/adapters/web-component-adapter.d.ts.map +1 -0
- package/lib/components/date-picker/next/components/calendar-renderer.d.ts +136 -0
- package/lib/components/date-picker/next/components/calendar-renderer.d.ts.map +1 -0
- package/lib/components/date-picker/next/components/date-picker-input-skeleton.d.ts +35 -0
- package/lib/components/date-picker/next/components/date-picker-input-skeleton.d.ts.map +1 -0
- package/lib/components/date-picker/next/components/date-picker-input.d.ts +196 -0
- package/lib/components/date-picker/next/components/date-picker-input.d.ts.map +1 -0
- package/lib/components/date-picker/next/components/date-picker.d.ts +329 -0
- package/lib/components/date-picker/next/components/date-picker.d.ts.map +1 -0
- package/lib/components/date-picker/next/index.d.ts +11 -0
- package/lib/components/date-picker/next/index.d.ts.map +1 -0
- package/lib/components/dropdown/dropdown.d.ts +8 -0
- package/lib/components/dropdown/dropdown.d.ts.map +1 -1
- package/lib/components/fluid-date-picker/fluid-date-picker-input.d.ts +39 -0
- package/lib/components/fluid-date-picker/fluid-date-picker-input.d.ts.map +1 -0
- package/lib/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts +20 -0
- package/lib/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts.map +1 -0
- package/lib/components/fluid-date-picker/fluid-date-picker.d.ts +24 -0
- package/lib/components/fluid-date-picker/fluid-date-picker.d.ts.map +1 -0
- package/lib/components/fluid-date-picker/index.d.ts +10 -0
- package/lib/components/fluid-date-picker/index.d.ts.map +1 -0
- package/lib/components/password-input/password-input.d.ts.map +1 -1
- package/lib/components/select/select.d.ts +8 -0
- package/lib/components/select/select.d.ts.map +1 -1
- package/lib/components/text-input/text-input.d.ts +17 -0
- package/lib/components/text-input/text-input.d.ts.map +1 -1
- package/lib/components/textarea/textarea.d.ts.map +1 -1
- package/package.json +10 -10
- package/scss/components/breadcrumb/breadcrumb.scss +4 -2
- package/scss/components/date-picker/date-picker.scss +6 -0
- package/scss/components/date-picker/next/components/date-picker.scss +124 -0
- package/scss/components/fluid-date-picker/fluid-date-picker.scss +282 -0
- package/scss/components/ui-shell/header.scss +14 -8
- package/telemetry.yml +29 -11
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import "../../../../globals/settings.js";
|
|
9
|
+
import { carbonElement } from "../../../../globals/decorators/carbon-element.js";
|
|
10
|
+
import __decorate from "../../../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
|
|
11
|
+
import iconLoader from "../../../../globals/internal/icon-loader.js";
|
|
12
|
+
import date_picker_default from "./date-picker.scss.js";
|
|
13
|
+
import { LitElement, html } from "lit";
|
|
14
|
+
import { property, state } from "lit/decorators.js";
|
|
15
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
16
|
+
import ChevronRight16 from "@carbon/icons/es/chevron--right/16.js";
|
|
17
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
18
|
+
import ChevronLeft16 from "@carbon/icons/es/chevron--left/16.js";
|
|
19
|
+
import { generateCalendarGrid, getFullDateLabel, getMonthYearLabel, getWeekdayLabels } from "@carbon/utilities/date-picker";
|
|
20
|
+
//#region src/components/date-picker/next/components/calendar-renderer.ts
|
|
21
|
+
/**
|
|
22
|
+
* Copyright IBM Corp. 2026
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Calendar renderer for date picker.
|
|
29
|
+
* Replaces Flatpickr's calendar UI with a lightweight, framework-agnostic implementation.
|
|
30
|
+
*
|
|
31
|
+
* @element cds-preview-date-picker-calendar
|
|
32
|
+
* @fires cds-preview-date-picker-calendar-date-select - Fired when a date is selected
|
|
33
|
+
* @fires cds-preview-date-picker-calendar-month-change - Fired when the month changes
|
|
34
|
+
*/
|
|
35
|
+
let CDSDatePickerCalendar = class CDSDatePickerCalendar extends LitElement {
|
|
36
|
+
constructor(..._args) {
|
|
37
|
+
super(..._args);
|
|
38
|
+
this._currentMonth = Temporal.Now.plainDateISO().toPlainYearMonth();
|
|
39
|
+
this.selectedDates = [];
|
|
40
|
+
this.rangeMode = false;
|
|
41
|
+
this.dateFormat = "m/d/Y";
|
|
42
|
+
this.locale = "en-US";
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Navigate to previous month
|
|
46
|
+
*/
|
|
47
|
+
_handlePrevMonth() {
|
|
48
|
+
this._currentMonth = this._currentMonth.subtract({ months: 1 });
|
|
49
|
+
this._dispatchMonthChange();
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Navigate to next month
|
|
53
|
+
*/
|
|
54
|
+
_handleNextMonth() {
|
|
55
|
+
this._currentMonth = this._currentMonth.add({ months: 1 });
|
|
56
|
+
this._dispatchMonthChange();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Handle date selection
|
|
60
|
+
* @param {Temporal.PlainDate} date - The date to select
|
|
61
|
+
*/
|
|
62
|
+
_handleDateSelect(date) {
|
|
63
|
+
if (this._isDateDisabled(date)) return;
|
|
64
|
+
this.dispatchEvent(new CustomEvent(`cds-preview-date-picker-calendar-date-select`, {
|
|
65
|
+
bubbles: true,
|
|
66
|
+
composed: true,
|
|
67
|
+
detail: { date }
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Dispatch month change event
|
|
72
|
+
*/
|
|
73
|
+
_dispatchMonthChange() {
|
|
74
|
+
this.dispatchEvent(new CustomEvent(`cds-preview-date-picker-calendar-month-change`, {
|
|
75
|
+
bubbles: true,
|
|
76
|
+
composed: true,
|
|
77
|
+
detail: { month: this._currentMonth }
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Check if a date is disabled
|
|
82
|
+
* @param {Temporal.PlainDate} date - The date to check
|
|
83
|
+
*/
|
|
84
|
+
_isDateDisabled(date) {
|
|
85
|
+
if (this.minDate && Temporal.PlainDate.compare(date, this.minDate) < 0) return true;
|
|
86
|
+
if (this.maxDate && Temporal.PlainDate.compare(date, this.maxDate) > 0) return true;
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Check if previous month navigation should be disabled
|
|
91
|
+
*/
|
|
92
|
+
_isPrevMonthDisabled() {
|
|
93
|
+
if (!this.minDate) return false;
|
|
94
|
+
const prevMonth = this._currentMonth.subtract({ months: 1 });
|
|
95
|
+
const prevMonthLastDay = prevMonth.toPlainDate({ day: prevMonth.daysInMonth });
|
|
96
|
+
return Temporal.PlainDate.compare(prevMonthLastDay, this.minDate) < 0;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Check if next month navigation should be disabled
|
|
100
|
+
*/
|
|
101
|
+
_isNextMonthDisabled() {
|
|
102
|
+
if (!this.maxDate) return false;
|
|
103
|
+
const nextMonthFirstDay = this._currentMonth.add({ months: 1 }).toPlainDate({ day: 1 });
|
|
104
|
+
return Temporal.PlainDate.compare(nextMonthFirstDay, this.maxDate) > 0;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Check if a date is selected
|
|
108
|
+
* @param {Temporal.PlainDate} date - The date to check
|
|
109
|
+
*/
|
|
110
|
+
_isDateSelected(date) {
|
|
111
|
+
return this.selectedDates.some((selected) => {
|
|
112
|
+
if (!selected || typeof selected !== "object" || !("year" in selected)) return false;
|
|
113
|
+
return Temporal.PlainDate.compare(selected, date) === 0;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Check if a date is in range (for range mode)
|
|
118
|
+
* @param {Temporal.PlainDate} date - The date to check
|
|
119
|
+
*/
|
|
120
|
+
_isDateInRange(date) {
|
|
121
|
+
if (!this.rangeMode) return false;
|
|
122
|
+
if (this.selectedDates.length === 2) {
|
|
123
|
+
const [start, end] = this.selectedDates.sort((a, b) => Temporal.PlainDate.compare(a, b));
|
|
124
|
+
return Temporal.PlainDate.compare(date, start) >= 0 && Temporal.PlainDate.compare(date, end) <= 0;
|
|
125
|
+
}
|
|
126
|
+
const previewDate = this._hoveredDate || this.focusedDate;
|
|
127
|
+
if (this.selectedDates.length === 1 && previewDate) {
|
|
128
|
+
if (this.minDate && Temporal.PlainDate.compare(previewDate, this.minDate) < 0 || this.maxDate && Temporal.PlainDate.compare(previewDate, this.maxDate) > 0) return false;
|
|
129
|
+
const [rangeStart, rangeEnd] = [this.selectedDates[0], previewDate].sort((a, b) => Temporal.PlainDate.compare(a, b));
|
|
130
|
+
return Temporal.PlainDate.compare(date, rangeStart) >= 0 && Temporal.PlainDate.compare(date, rangeEnd) <= 0;
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Check if a date is focused (for keyboard navigation)
|
|
136
|
+
* @param {Temporal.PlainDate} date - The date to check
|
|
137
|
+
*/
|
|
138
|
+
_isDateFocused(date) {
|
|
139
|
+
if (!this.focusedDate) return false;
|
|
140
|
+
return Temporal.PlainDate.compare(date, this.focusedDate) === 0;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Handle mouse enter on a date
|
|
144
|
+
* @param {Temporal.PlainDate} date - The date being hovered
|
|
145
|
+
*/
|
|
146
|
+
_handleDateMouseEnter(date) {
|
|
147
|
+
if (this.rangeMode && this.selectedDates.length === 1) this._hoveredDate = date;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Handle mouse leave on a date
|
|
151
|
+
*/
|
|
152
|
+
_handleDateMouseLeave() {
|
|
153
|
+
this._hoveredDate = void 0;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Render the calendar header with month/year and navigation
|
|
157
|
+
*/
|
|
158
|
+
_renderHeader() {
|
|
159
|
+
const monthName = getMonthYearLabel(this._currentMonth.toPlainDate({ day: 1 }), this.locale);
|
|
160
|
+
const isPrevDisabled = this._isPrevMonthDisabled();
|
|
161
|
+
const isNextDisabled = this._isNextMonthDisabled();
|
|
162
|
+
return html`
|
|
163
|
+
<div class="${"cds"}--date-picker__month">
|
|
164
|
+
<button
|
|
165
|
+
type="button"
|
|
166
|
+
class="${"cds"}--date-picker__month-nav ${"cds"}--date-picker__month-nav--prev"
|
|
167
|
+
tabindex="-1"
|
|
168
|
+
?disabled="${isPrevDisabled}"
|
|
169
|
+
@click="${this._handlePrevMonth}"
|
|
170
|
+
aria-label="Previous month">
|
|
171
|
+
${iconLoader(ChevronLeft16)}
|
|
172
|
+
</button>
|
|
173
|
+
<div class="${"cds"}--date-picker__current-month">
|
|
174
|
+
<span class="cur-month">${monthName}</span>
|
|
175
|
+
</div>
|
|
176
|
+
<button
|
|
177
|
+
type="button"
|
|
178
|
+
class="${"cds"}--date-picker__month-nav ${"cds"}--date-picker__month-nav--next"
|
|
179
|
+
tabindex="-1"
|
|
180
|
+
?disabled="${isNextDisabled}"
|
|
181
|
+
@click="${this._handleNextMonth}"
|
|
182
|
+
aria-label="Next month">
|
|
183
|
+
${iconLoader(ChevronRight16)}
|
|
184
|
+
</button>
|
|
185
|
+
</div>
|
|
186
|
+
`;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Render the weekday headers
|
|
190
|
+
*/
|
|
191
|
+
_renderWeekdays() {
|
|
192
|
+
return html`
|
|
193
|
+
<div class="${"cds"}--date-picker__weekdays">
|
|
194
|
+
${getWeekdayLabels(this.locale).map((day) => html`
|
|
195
|
+
<span class="${"cds"}--date-picker__weekday">${day}</span>
|
|
196
|
+
`)}
|
|
197
|
+
</div>
|
|
198
|
+
`;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Render the calendar days grid
|
|
202
|
+
*/
|
|
203
|
+
_renderDays() {
|
|
204
|
+
const currentMonthValue = this._currentMonth.month;
|
|
205
|
+
return html`
|
|
206
|
+
<div class="${"cds"}--date-picker__days" role="grid">
|
|
207
|
+
${generateCalendarGrid(this._currentMonth.toPlainDate({ day: 1 }), this.minDate ?? null, this.maxDate ?? null).flat().map(({ date, isCurrentMonth, isDisabled, isToday }) => {
|
|
208
|
+
const isSelected = this._isDateSelected(date);
|
|
209
|
+
const isInRange = this._isDateInRange(date);
|
|
210
|
+
const isFocused = this._isDateFocused(date);
|
|
211
|
+
return html`
|
|
212
|
+
<button
|
|
213
|
+
type="button"
|
|
214
|
+
class="${classMap({
|
|
215
|
+
[`cds--date-picker__day`]: true,
|
|
216
|
+
prevMonthDay: !isCurrentMonth && date.month < currentMonthValue,
|
|
217
|
+
nextMonthDay: !isCurrentMonth && date.month > currentMonthValue,
|
|
218
|
+
disabled: isDisabled,
|
|
219
|
+
selected: isSelected,
|
|
220
|
+
inRange: isInRange,
|
|
221
|
+
today: isToday && !isSelected,
|
|
222
|
+
"no-border": isToday && isSelected,
|
|
223
|
+
focused: isFocused
|
|
224
|
+
})}"
|
|
225
|
+
tabindex="-1"
|
|
226
|
+
?disabled="${isDisabled}"
|
|
227
|
+
@click="${() => this._handleDateSelect(date)}"
|
|
228
|
+
@mouseenter="${() => this._handleDateMouseEnter(date)}"
|
|
229
|
+
@mouseleave="${() => this._handleDateMouseLeave()}"
|
|
230
|
+
aria-label="${getFullDateLabel(date, this.locale)}"
|
|
231
|
+
aria-current="${ifDefined(isToday ? "date" : void 0)}">
|
|
232
|
+
${date.day}
|
|
233
|
+
</button>
|
|
234
|
+
`;
|
|
235
|
+
})}
|
|
236
|
+
</div>
|
|
237
|
+
`;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Lifecycle method called when properties change
|
|
241
|
+
* @param {PropertyValues} changedProperties - Changed properties
|
|
242
|
+
*/
|
|
243
|
+
updated(changedProperties) {
|
|
244
|
+
if (changedProperties.has("viewDate") && this.viewDate) this._currentMonth = Temporal.PlainYearMonth.from({
|
|
245
|
+
year: this.viewDate.year,
|
|
246
|
+
month: this.viewDate.month
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Renders the calendar component
|
|
251
|
+
*/
|
|
252
|
+
render() {
|
|
253
|
+
return html`
|
|
254
|
+
<div class="${"cds"}--date-picker__calendar" tabindex="0">
|
|
255
|
+
${this._renderHeader()} ${this._renderWeekdays()} ${this._renderDays()}
|
|
256
|
+
</div>
|
|
257
|
+
`;
|
|
258
|
+
}
|
|
259
|
+
static {
|
|
260
|
+
this.styles = date_picker_default;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
__decorate([state()], CDSDatePickerCalendar.prototype, "_currentMonth", void 0);
|
|
264
|
+
__decorate([property({ type: Array })], CDSDatePickerCalendar.prototype, "selectedDates", void 0);
|
|
265
|
+
__decorate([property({ type: Object })], CDSDatePickerCalendar.prototype, "viewDate", void 0);
|
|
266
|
+
__decorate([property({ type: Object })], CDSDatePickerCalendar.prototype, "focusedDate", void 0);
|
|
267
|
+
__decorate([state()], CDSDatePickerCalendar.prototype, "_hoveredDate", void 0);
|
|
268
|
+
__decorate([property({ type: Object })], CDSDatePickerCalendar.prototype, "minDate", void 0);
|
|
269
|
+
__decorate([property({ type: Object })], CDSDatePickerCalendar.prototype, "maxDate", void 0);
|
|
270
|
+
__decorate([property({ type: Boolean })], CDSDatePickerCalendar.prototype, "rangeMode", void 0);
|
|
271
|
+
__decorate([property({ type: String })], CDSDatePickerCalendar.prototype, "dateFormat", void 0);
|
|
272
|
+
__decorate([property({ type: String })], CDSDatePickerCalendar.prototype, "locale", void 0);
|
|
273
|
+
CDSDatePickerCalendar = __decorate([carbonElement(`cds-preview-date-picker-calendar`)], CDSDatePickerCalendar);
|
|
274
|
+
var calendar_renderer_default = CDSDatePickerCalendar;
|
|
275
|
+
//#endregion
|
|
276
|
+
export { calendar_renderer_default as default };
|
|
277
|
+
|
|
278
|
+
//# sourceMappingURL=calendar-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-renderer.js","names":["end","styles","customElement"],"sources":["../../../../../src/components/date-picker/next/components/calendar-renderer.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport type { PropertyValues } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { prefix } from '../../../../globals/settings';\nimport { carbonElement as customElement } from '../../../../globals/decorators/carbon-element';\nimport ChevronLeft16 from '@carbon/icons/es/chevron--left/16.js';\nimport ChevronRight16 from '@carbon/icons/es/chevron--right/16.js';\nimport { iconLoader } from '../../../../globals/internal/icon-loader';\nimport {\n generateCalendarGrid,\n getFullDateLabel,\n getMonthYearLabel,\n getWeekdayLabels,\n} from '@carbon/utilities/date-picker';\nimport styles from './date-picker.scss?lit';\n\n/**\n * Calendar renderer for date picker.\n * Replaces Flatpickr's calendar UI with a lightweight, framework-agnostic implementation.\n *\n * @element cds-preview-date-picker-calendar\n * @fires cds-preview-date-picker-calendar-date-select - Fired when a date is selected\n * @fires cds-preview-date-picker-calendar-month-change - Fired when the month changes\n */\n@customElement(`${prefix}-preview-date-picker-calendar`)\nclass CDSDatePickerCalendar extends LitElement {\n /**\n * The currently displayed month (Temporal.PlainYearMonth)\n */\n @state()\n private _currentMonth: Temporal.PlainYearMonth =\n Temporal.Now.plainDateISO().toPlainYearMonth();\n\n /**\n * The selected date(s)\n */\n @property({ type: Array })\n selectedDates: Temporal.PlainDate[] = [];\n\n /**\n * The view date from the state machine (used to sync calendar month)\n */\n @property({ type: Object })\n viewDate?: Temporal.PlainDate;\n\n /**\n * The focused date for keyboard navigation\n */\n @property({ type: Object })\n focusedDate?: Temporal.PlainDate | null;\n\n /**\n * The currently hovered date (for range preview)\n */\n @state()\n private _hoveredDate?: Temporal.PlainDate;\n\n /**\n * The minimum selectable date\n */\n @property({ type: Object })\n minDate?: Temporal.PlainDate;\n\n /**\n * The maximum selectable date\n */\n @property({ type: Object })\n maxDate?: Temporal.PlainDate;\n\n /**\n * Whether range selection is enabled\n */\n @property({ type: Boolean })\n rangeMode = false;\n\n /**\n * The date format for display\n */\n @property({ type: String })\n dateFormat = 'm/d/Y';\n\n /**\n * Locale for date formatting\n */\n @property({ type: String })\n locale = 'en-US';\n\n /**\n * Navigate to previous month\n */\n private _handlePrevMonth() {\n this._currentMonth = this._currentMonth.subtract({ months: 1 });\n this._dispatchMonthChange();\n }\n\n /**\n * Navigate to next month\n */\n private _handleNextMonth() {\n this._currentMonth = this._currentMonth.add({ months: 1 });\n this._dispatchMonthChange();\n }\n\n /**\n * Handle date selection\n * @param {Temporal.PlainDate} date - The date to select\n */\n private _handleDateSelect(date: Temporal.PlainDate) {\n if (this._isDateDisabled(date)) {\n return;\n }\n\n this.dispatchEvent(\n new CustomEvent(`${prefix}-preview-date-picker-calendar-date-select`, {\n bubbles: true,\n composed: true,\n detail: { date },\n })\n );\n }\n\n /**\n * Dispatch month change event\n */\n private _dispatchMonthChange() {\n this.dispatchEvent(\n new CustomEvent(`${prefix}-preview-date-picker-calendar-month-change`, {\n bubbles: true,\n composed: true,\n detail: { month: this._currentMonth },\n })\n );\n }\n\n /**\n * Check if a date is disabled\n * @param {Temporal.PlainDate} date - The date to check\n */\n private _isDateDisabled(date: Temporal.PlainDate): boolean {\n if (this.minDate && Temporal.PlainDate.compare(date, this.minDate) < 0) {\n return true;\n }\n if (this.maxDate && Temporal.PlainDate.compare(date, this.maxDate) > 0) {\n return true;\n }\n return false;\n }\n\n /**\n * Check if previous month navigation should be disabled\n */\n private _isPrevMonthDisabled(): boolean {\n if (!this.minDate) {\n return false;\n }\n // Disable if going to previous month would be before minDate's month\n const prevMonth = this._currentMonth.subtract({ months: 1 });\n const prevMonthLastDay = prevMonth.toPlainDate({\n day: prevMonth.daysInMonth,\n });\n return Temporal.PlainDate.compare(prevMonthLastDay, this.minDate) < 0;\n }\n\n /**\n * Check if next month navigation should be disabled\n */\n private _isNextMonthDisabled(): boolean {\n if (!this.maxDate) {\n return false;\n }\n // Disable if going to next month would be after maxDate's month\n const nextMonth = this._currentMonth.add({ months: 1 });\n const nextMonthFirstDay = nextMonth.toPlainDate({ day: 1 });\n return Temporal.PlainDate.compare(nextMonthFirstDay, this.maxDate) > 0;\n }\n\n /**\n * Check if a date is selected\n * @param {Temporal.PlainDate} date - The date to check\n */\n private _isDateSelected(date: Temporal.PlainDate): boolean {\n return this.selectedDates.some((selected) => {\n if (!selected || typeof selected !== 'object' || !('year' in selected)) {\n return false;\n }\n return Temporal.PlainDate.compare(selected, date) === 0;\n });\n }\n\n /**\n * Check if a date is in range (for range mode)\n * @param {Temporal.PlainDate} date - The date to check\n */\n private _isDateInRange(date: Temporal.PlainDate): boolean {\n if (!this.rangeMode) {\n return false;\n }\n\n // Case 1: Both dates are selected (final range)\n if (this.selectedDates.length === 2) {\n const [start, end] = this.selectedDates.sort((a, b) =>\n Temporal.PlainDate.compare(a, b)\n );\n\n return (\n Temporal.PlainDate.compare(date, start) >= 0 &&\n Temporal.PlainDate.compare(date, end) <= 0\n );\n }\n\n // Case 2: One date selected, show preview range with hovered or focused date\n const previewDate = this._hoveredDate || this.focusedDate;\n if (this.selectedDates.length === 1 && previewDate) {\n // Don't show range preview if the preview date is disabled\n const isPreviewDisabled =\n (this.minDate &&\n Temporal.PlainDate.compare(previewDate, this.minDate) < 0) ||\n (this.maxDate &&\n Temporal.PlainDate.compare(previewDate, this.maxDate) > 0);\n\n if (isPreviewDisabled) {\n return false;\n }\n\n const start = this.selectedDates[0];\n const end = previewDate;\n\n // Sort to handle both forward and backward selection\n const [rangeStart, rangeEnd] = [start, end].sort((a, b) =>\n Temporal.PlainDate.compare(a, b)\n );\n\n return (\n Temporal.PlainDate.compare(date, rangeStart) >= 0 &&\n Temporal.PlainDate.compare(date, rangeEnd) <= 0\n );\n }\n\n return false;\n }\n\n /**\n * Check if a date is focused (for keyboard navigation)\n * @param {Temporal.PlainDate} date - The date to check\n */\n private _isDateFocused(date: Temporal.PlainDate): boolean {\n if (!this.focusedDate) {\n return false;\n }\n return Temporal.PlainDate.compare(date, this.focusedDate) === 0;\n }\n\n /**\n * Handle mouse enter on a date\n * @param {Temporal.PlainDate} date - The date being hovered\n */\n private _handleDateMouseEnter(date: Temporal.PlainDate) {\n // Only track hover in range mode when selecting end date\n if (this.rangeMode && this.selectedDates.length === 1) {\n this._hoveredDate = date;\n }\n }\n\n /**\n * Handle mouse leave on a date\n */\n private _handleDateMouseLeave() {\n // Clear hovered date\n this._hoveredDate = undefined;\n }\n\n /**\n * Render the calendar header with month/year and navigation\n */\n private _renderHeader() {\n const monthName = getMonthYearLabel(\n this._currentMonth.toPlainDate({ day: 1 }),\n this.locale\n );\n\n const isPrevDisabled = this._isPrevMonthDisabled();\n const isNextDisabled = this._isNextMonthDisabled();\n\n return html`\n <div class=\"${prefix}--date-picker__month\">\n <button\n type=\"button\"\n class=\"${prefix}--date-picker__month-nav ${prefix}--date-picker__month-nav--prev\"\n tabindex=\"-1\"\n ?disabled=\"${isPrevDisabled}\"\n @click=\"${this._handlePrevMonth}\"\n aria-label=\"Previous month\">\n ${iconLoader(ChevronLeft16)}\n </button>\n <div class=\"${prefix}--date-picker__current-month\">\n <span class=\"cur-month\">${monthName}</span>\n </div>\n <button\n type=\"button\"\n class=\"${prefix}--date-picker__month-nav ${prefix}--date-picker__month-nav--next\"\n tabindex=\"-1\"\n ?disabled=\"${isNextDisabled}\"\n @click=\"${this._handleNextMonth}\"\n aria-label=\"Next month\">\n ${iconLoader(ChevronRight16)}\n </button>\n </div>\n `;\n }\n\n /**\n * Render the weekday headers\n */\n private _renderWeekdays() {\n const weekdays = getWeekdayLabels(this.locale);\n\n return html`\n <div class=\"${prefix}--date-picker__weekdays\">\n ${weekdays.map(\n (day) => html`\n <span class=\"${prefix}--date-picker__weekday\">${day}</span>\n `\n )}\n </div>\n `;\n }\n\n /**\n * Render the calendar days grid\n */\n private _renderDays() {\n const currentMonthValue = this._currentMonth.month;\n\n const days = generateCalendarGrid(\n this._currentMonth.toPlainDate({ day: 1 }),\n this.minDate ?? null,\n this.maxDate ?? null\n ).flat();\n\n return html`\n <div class=\"${prefix}--date-picker__days\" role=\"grid\">\n ${days.map(({ date, isCurrentMonth, isDisabled, isToday }) => {\n const isSelected = this._isDateSelected(date);\n const isInRange = this._isDateInRange(date);\n const isFocused = this._isDateFocused(date);\n\n const dayClasses = classMap({\n [`${prefix}--date-picker__day`]: true,\n prevMonthDay: !isCurrentMonth && date.month < currentMonthValue,\n nextMonthDay: !isCurrentMonth && date.month > currentMonthValue,\n disabled: isDisabled,\n selected: isSelected,\n inRange: isInRange,\n today: isToday && !isSelected,\n 'no-border': isToday && isSelected,\n focused: isFocused,\n });\n\n return html`\n <button\n type=\"button\"\n class=\"${dayClasses}\"\n tabindex=\"-1\"\n ?disabled=\"${isDisabled}\"\n @click=\"${() => this._handleDateSelect(date)}\"\n @mouseenter=\"${() => this._handleDateMouseEnter(date)}\"\n @mouseleave=\"${() => this._handleDateMouseLeave()}\"\n aria-label=\"${getFullDateLabel(date, this.locale)}\"\n aria-current=\"${ifDefined(isToday ? 'date' : undefined)}\">\n ${date.day}\n </button>\n `;\n })}\n </div>\n `;\n }\n\n /**\n * Lifecycle method called when properties change\n * @param {PropertyValues} changedProperties - Changed properties\n */\n updated(changedProperties: PropertyValues) {\n // Sync calendar month with viewDate from state machine\n if (changedProperties.has('viewDate') && this.viewDate) {\n // Create PlainYearMonth from PlainDate\n this._currentMonth = Temporal.PlainYearMonth.from({\n year: this.viewDate.year,\n month: this.viewDate.month,\n });\n }\n }\n\n /**\n * Renders the calendar component\n */\n render() {\n return html`\n <div class=\"${prefix}--date-picker__calendar\" tabindex=\"0\">\n ${this._renderHeader()} ${this._renderWeekdays()} ${this._renderDays()}\n </div>\n `;\n }\n\n static styles = styles;\n}\n\nexport default CDSDatePickerCalendar;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAA,wBAAA,MACM,8BAA8B,WAAW;;;uBAM3C,SAAS,IAAI,aAAa,CAAC,CAAC,iBAAiB;uBAMT,CAAC;mBAoC3B;oBAMC;gBAMJ;;;;;CAKT,mBAA2B;EACzB,KAAK,gBAAgB,KAAK,cAAc,SAAS,EAAE,QAAQ,EAAE,CAAC;EAC9D,KAAK,qBAAqB;CAC5B;;;;CAKA,mBAA2B;EACzB,KAAK,gBAAgB,KAAK,cAAc,IAAI,EAAE,QAAQ,EAAE,CAAC;EACzD,KAAK,qBAAqB;CAC5B;;;;;CAMA,kBAA0B,MAA0B;EAClD,IAAI,KAAK,gBAAgB,IAAI,GAC3B;EAGF,KAAK,cACH,IAAI,YAAY,gDAAsD;GACpE,SAAS;GACT,UAAU;GACV,QAAQ,EAAE,KAAK;EACjB,CAAC,CACH;CACF;;;;CAKA,uBAA+B;EAC7B,KAAK,cACH,IAAI,YAAY,iDAAuD;GACrE,SAAS;GACT,UAAU;GACV,QAAQ,EAAE,OAAO,KAAK,cAAc;EACtC,CAAC,CACH;CACF;;;;;CAMA,gBAAwB,MAAmC;EACzD,IAAI,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AAE,MAAM,OAAO,CAAC,CAAA,GAAA,sBAAA,WAAA,YAAA,KAAA,CAAA;YAMzB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,sBAAA,WAAA,eAAA,KAAA,CAAA;YAMzB,MAAM,CAAA,GAAA,sBAAA,WAAA,gBAAA,KAAA,CAAA;YAMN,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,sBAAA,WAAA,WAAA,KAAA,CAAA;YAMzB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,sBAAA,WAAA,WAAA,KAAA,CAAA;YAMzB,SAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,sBAAA,WAAA,aAAA,KAAA,CAAA;YAM1B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,sBAAA,WAAA,cAAA,KAAA,CAAA;YAMzB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,sBAAA,WAAA,UAAA,KAAA,CAAA;oCA5D3BC,cAAc,kCAAwC,CAAA,GAAA,qBAAA;AA8XvD,IAAA,4BAAe"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { LitElement } from 'lit';
|
|
8
|
+
import { DATE_PICKER_INPUT_KIND } from '../../defs';
|
|
9
|
+
/**
|
|
10
|
+
* Skeleton version of the input box for date picker.
|
|
11
|
+
*/
|
|
12
|
+
declare class CDSDatePickerInputSkeleton extends LitElement {
|
|
13
|
+
/**
|
|
14
|
+
* Specify whether the label should be hidden, or not
|
|
15
|
+
*/
|
|
16
|
+
hideLabel: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* * @deprecated use `range` instead
|
|
19
|
+
* Date picker input kind. Corresponds to the attribute with the same name.
|
|
20
|
+
*/
|
|
21
|
+
kind: DATE_PICKER_INPUT_KIND;
|
|
22
|
+
/**
|
|
23
|
+
* Specify whether the skeleton should be of range date picker.
|
|
24
|
+
*/
|
|
25
|
+
range: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Renders the component template.
|
|
28
|
+
*
|
|
29
|
+
* @returns {TemplateResult} The template result
|
|
30
|
+
*/
|
|
31
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
32
|
+
static styles: any;
|
|
33
|
+
}
|
|
34
|
+
export default CDSDatePickerInputSkeleton;
|
|
35
|
+
//# sourceMappingURL=date-picker-input-skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker-input-skeleton.d.ts","sourceRoot":"","sources":["../../../../../src/components/date-picker/next/components/date-picker-input-skeleton.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAGvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIpD;;GAEG;AACH,cACM,0BAA2B,SAAQ,UAAU;IACjD;;OAEG;IAEH,SAAS,UAAS;IAElB;;;OAGG;IAEH,IAAI,yBAAiC;IAErC;;OAEG;IAEH,KAAK,UAAS;IAEd;;;;OAIG;IACH,MAAM;IAqBN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import "../../../../globals/settings.js";
|
|
9
|
+
import { carbonElement } from "../../../../globals/decorators/carbon-element.js";
|
|
10
|
+
import __decorate from "../../../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
|
|
11
|
+
import "../../defs.js";
|
|
12
|
+
import date_picker_default from "./date-picker.scss.js";
|
|
13
|
+
import { LitElement, html } from "lit";
|
|
14
|
+
import { property } from "lit/decorators.js";
|
|
15
|
+
//#region src/components/date-picker/next/components/date-picker-input-skeleton.ts
|
|
16
|
+
/**
|
|
17
|
+
* Copyright IBM Corp. 2026
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Skeleton version of the input box for date picker.
|
|
24
|
+
*/
|
|
25
|
+
let CDSDatePickerInputSkeleton = class CDSDatePickerInputSkeleton extends LitElement {
|
|
26
|
+
constructor(..._args) {
|
|
27
|
+
super(..._args);
|
|
28
|
+
this.hideLabel = false;
|
|
29
|
+
this.kind = "simple";
|
|
30
|
+
this.range = false;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Renders the component template.
|
|
34
|
+
*
|
|
35
|
+
* @returns {TemplateResult} The template result
|
|
36
|
+
*/
|
|
37
|
+
render() {
|
|
38
|
+
const { hideLabel, range } = this;
|
|
39
|
+
return html`
|
|
40
|
+
<div class="${"cds"}--date-picker-input-skeleton-container">
|
|
41
|
+
${!hideLabel ? html`<span class="${"cds"}--label"></span>` : null}
|
|
42
|
+
<div class="${"cds"}--date-picker__input ${"cds"}--skeleton"></div>
|
|
43
|
+
</div>
|
|
44
|
+
${range ? html`
|
|
45
|
+
<div class="${"cds"}--date-picker-input-skeleton-container">
|
|
46
|
+
${!hideLabel ? html`<span class="${"cds"}--label"></span>` : null}
|
|
47
|
+
<div
|
|
48
|
+
class="${"cds"}--date-picker__input ${"cds"}--skeleton"></div>
|
|
49
|
+
</div>
|
|
50
|
+
` : null}
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
static {
|
|
54
|
+
this.styles = date_picker_default;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
__decorate([property({
|
|
58
|
+
type: Boolean,
|
|
59
|
+
reflect: true,
|
|
60
|
+
attribute: "hide-label"
|
|
61
|
+
})], CDSDatePickerInputSkeleton.prototype, "hideLabel", void 0);
|
|
62
|
+
__decorate([property({ reflect: true })], CDSDatePickerInputSkeleton.prototype, "kind", void 0);
|
|
63
|
+
__decorate([property({
|
|
64
|
+
type: Boolean,
|
|
65
|
+
reflect: true,
|
|
66
|
+
attribute: "range"
|
|
67
|
+
})], CDSDatePickerInputSkeleton.prototype, "range", void 0);
|
|
68
|
+
CDSDatePickerInputSkeleton = __decorate([carbonElement(`cds-preview-date-picker-input-skeleton`)], CDSDatePickerInputSkeleton);
|
|
69
|
+
var date_picker_input_skeleton_default = CDSDatePickerInputSkeleton;
|
|
70
|
+
//#endregion
|
|
71
|
+
export { date_picker_input_skeleton_default as default };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=date-picker-input-skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker-input-skeleton.js","names":["styles","customElement"],"sources":["../../../../../src/components/date-picker/next/components/date-picker-input-skeleton.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../../../globals/settings';\nimport { DATE_PICKER_INPUT_KIND } from '../../defs';\nimport styles from './date-picker.scss?lit';\nimport { carbonElement as customElement } from '../../../../globals/decorators/carbon-element';\n\n/**\n * Skeleton version of the input box for date picker.\n */\n@customElement(`${prefix}-preview-date-picker-input-skeleton`)\nclass CDSDatePickerInputSkeleton extends LitElement {\n /**\n * Specify whether the label should be hidden, or not\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-label' })\n hideLabel = false;\n\n /**\n * * @deprecated use `range` instead\n * Date picker input kind. Corresponds to the attribute with the same name.\n */\n @property({ reflect: true })\n kind = DATE_PICKER_INPUT_KIND.SIMPLE;\n\n /**\n * Specify whether the skeleton should be of range date picker.\n */\n @property({ type: Boolean, reflect: true, attribute: 'range' })\n range = false;\n\n /**\n * Renders the component template.\n *\n * @returns {TemplateResult} The template result\n */\n render() {\n const { hideLabel, range } = this;\n return html`\n <div class=\"${prefix}--date-picker-input-skeleton-container\">\n ${!hideLabel ? html`<span class=\"${prefix}--label\"></span>` : null}\n <div class=\"${prefix}--date-picker__input ${prefix}--skeleton\"></div>\n </div>\n ${range\n ? html`\n <div class=\"${prefix}--date-picker-input-skeleton-container\">\n ${!hideLabel\n ? html`<span class=\"${prefix}--label\"></span>`\n : null}\n <div\n class=\"${prefix}--date-picker__input ${prefix}--skeleton\"></div>\n </div>\n `\n : null}\n `;\n }\n\n static styles = styles;\n}\n\nexport default CDSDatePickerInputSkeleton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiBA,IAAA,6BAAA,MACM,mCAAmC,WAAW;;;mBAKtC;;eAaJ;;;;;;;CAOR,SAAS;EACP,MAAM,EAAE,WAAW,UAAU;EAC7B,OAAO,IAAI;0BACY;UACjB,CAAC,YAAY,IAAI,gBAAA,MAAuB,oBAAoB,KAAK;4BAC9C,uBAAA,MAA8B;;QAEnD,QACE,IAAI;gCACmB;gBACjB,CAAC,YACC,IAAI,gBAAA,MAAuB,oBAC3B,KAAK;;+BAES,uBAAA,MAA8B;;cAGpD,KAAK;;CAEb;;gBAEgBA;;AAClB;YA3CG,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;AAAa,CAAC,CAAA,GAAA,2BAAA,WAAA,aAAA,KAAA,CAAA;YAOlE,SAAS,EAAE,SAAS,KAAK,CAAC,CAAA,GAAA,2BAAA,WAAA,QAAA,KAAA,CAAA;YAM1B,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;AAAQ,CAAC,CAAA,GAAA,2BAAA,WAAA,SAAA,KAAA,CAAA;yCAlB/DC,cAAc,wCAA8C,CAAA,GAAA,0BAAA;AAkD7D,IAAA,qCAAe"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { LitElement } from 'lit';
|
|
8
|
+
import { INPUT_SIZE, DATE_PICKER_INPUT_COLOR_SCHEME, DATE_PICKER_INPUT_KIND } from '../../defs';
|
|
9
|
+
export { DATE_PICKER_INPUT_COLOR_SCHEME, DATE_PICKER_INPUT_KIND };
|
|
10
|
+
declare const CDSDatePickerInput_base: (new (...args: any[]) => {
|
|
11
|
+
focus(): void;
|
|
12
|
+
}) & typeof LitElement;
|
|
13
|
+
/**
|
|
14
|
+
* The input box for date picker.
|
|
15
|
+
*
|
|
16
|
+
* @element cds-preview-date-picker-input
|
|
17
|
+
*/
|
|
18
|
+
declare class CDSDatePickerInput extends CDSDatePickerInput_base {
|
|
19
|
+
/**
|
|
20
|
+
* `true` if there is an AI Label.
|
|
21
|
+
*/
|
|
22
|
+
private _hasAILabel;
|
|
23
|
+
/**
|
|
24
|
+
* Handles `slotchange` event.
|
|
25
|
+
*
|
|
26
|
+
* @param {object} root0 - Event object
|
|
27
|
+
* @param {EventTarget} root0.target - The event target
|
|
28
|
+
*/
|
|
29
|
+
protected _handleAILabelSlotChange({ target }: Event): void;
|
|
30
|
+
/**
|
|
31
|
+
* Handles `click` event on the calendar icon button.
|
|
32
|
+
* Dispatches a custom event and does NOT move focus to the text input,
|
|
33
|
+
* matching the React implementation where the icon is a separate button.
|
|
34
|
+
*
|
|
35
|
+
* @param {MouseEvent} event - The click event.
|
|
36
|
+
*/
|
|
37
|
+
private _handleIconButtonClick;
|
|
38
|
+
/**
|
|
39
|
+
* Handles `click` event on `<input>` in the shadow DOM.
|
|
40
|
+
* Dispatches a custom event so the parent date picker can reopen the calendar
|
|
41
|
+
* when the input already has focus (clicking a focused input does not fire
|
|
42
|
+
* a new `focus` event, so a dedicated click event is required).
|
|
43
|
+
*/
|
|
44
|
+
private _handleInputClick;
|
|
45
|
+
/**
|
|
46
|
+
* Handles `input` event on `<input>` in the shadow DOM.
|
|
47
|
+
*
|
|
48
|
+
* @param {Event} event - The event.
|
|
49
|
+
* @param {HTMLInputElement} event.target - The event target.
|
|
50
|
+
*/
|
|
51
|
+
private _handleInput;
|
|
52
|
+
/**
|
|
53
|
+
* Handles `focus` event on `<input>` in the shadow DOM.
|
|
54
|
+
*/
|
|
55
|
+
private _handleFocus;
|
|
56
|
+
/**
|
|
57
|
+
* Handles `blur` event on `<input>` in the shadow DOM.
|
|
58
|
+
*/
|
|
59
|
+
private _handleBlur;
|
|
60
|
+
/**
|
|
61
|
+
* @returns The template for the calendar icon button.
|
|
62
|
+
* Rendered as a focusable-false button (tabindex="-1") so clicking it does
|
|
63
|
+
* not move focus to the text input — matching the React implementation.
|
|
64
|
+
*/
|
|
65
|
+
private _renderIcon;
|
|
66
|
+
/**
|
|
67
|
+
* `true` if there is helper text content.
|
|
68
|
+
*/
|
|
69
|
+
protected _hasHelperText: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Handles `slotchange` event on the default `<slot>`.
|
|
72
|
+
*
|
|
73
|
+
* @param {object} root0 - Event object
|
|
74
|
+
* @param {EventTarget} root0.target - The event target
|
|
75
|
+
*/
|
|
76
|
+
protected _handleSlotChange({ target }: Event): void;
|
|
77
|
+
/**
|
|
78
|
+
* The `<input>`, used for Flatpickr to grab.
|
|
79
|
+
*/
|
|
80
|
+
input: HTMLInputElement;
|
|
81
|
+
/**
|
|
82
|
+
* The color scheme.
|
|
83
|
+
*/
|
|
84
|
+
colorScheme: DATE_PICKER_INPUT_COLOR_SCHEME;
|
|
85
|
+
/**
|
|
86
|
+
* `true` if the check box should be disabled.
|
|
87
|
+
*/
|
|
88
|
+
disabled: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* `true` if the label should be hidden.
|
|
91
|
+
*/
|
|
92
|
+
hideLabel: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Controls the invalid state and visibility of the `validityMessage`.
|
|
95
|
+
*/
|
|
96
|
+
invalid: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Message which is displayed if the value is invalid.
|
|
99
|
+
*/
|
|
100
|
+
invalidText: string;
|
|
101
|
+
/**
|
|
102
|
+
* Date picker input kind.
|
|
103
|
+
*/
|
|
104
|
+
kind: DATE_PICKER_INPUT_KIND;
|
|
105
|
+
/**
|
|
106
|
+
* The label text.
|
|
107
|
+
*/
|
|
108
|
+
labelText: string;
|
|
109
|
+
/**
|
|
110
|
+
* The `pattern` attribute for the `<input>` in the shadow DOM.
|
|
111
|
+
*/
|
|
112
|
+
pattern: string;
|
|
113
|
+
/**
|
|
114
|
+
* The placeholder text.
|
|
115
|
+
*/
|
|
116
|
+
placeholder: string;
|
|
117
|
+
/**
|
|
118
|
+
* Specify if the component should be read-only
|
|
119
|
+
*/
|
|
120
|
+
readonly: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* `true` if the value is required.
|
|
123
|
+
*/
|
|
124
|
+
required: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* true to use the short version.
|
|
127
|
+
*/
|
|
128
|
+
short: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Vertical size of this date picker input.
|
|
131
|
+
*/
|
|
132
|
+
size: INPUT_SIZE;
|
|
133
|
+
/**
|
|
134
|
+
* The `type` attribute for the `<input>` in the shadow DOM.
|
|
135
|
+
*/
|
|
136
|
+
type: string;
|
|
137
|
+
/**
|
|
138
|
+
* The value.
|
|
139
|
+
*/
|
|
140
|
+
value: string;
|
|
141
|
+
/**
|
|
142
|
+
* Specify whether the control is currently in warning state
|
|
143
|
+
*/
|
|
144
|
+
warn: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Provide the text that is displayed when the control is in warning state
|
|
147
|
+
*/
|
|
148
|
+
warnText: string;
|
|
149
|
+
/**
|
|
150
|
+
* Renders the component template.
|
|
151
|
+
*
|
|
152
|
+
* @returns {TemplateResult} The template result
|
|
153
|
+
*/
|
|
154
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
155
|
+
/**
|
|
156
|
+
* Lifecycle method called after component updates.
|
|
157
|
+
*/
|
|
158
|
+
updated(): void;
|
|
159
|
+
/**
|
|
160
|
+
* The default value for `pattern` property.
|
|
161
|
+
*/
|
|
162
|
+
static defaultPattern: string;
|
|
163
|
+
/**
|
|
164
|
+
* The default value for `type` property.
|
|
165
|
+
*/
|
|
166
|
+
static defaultType: string;
|
|
167
|
+
/**
|
|
168
|
+
* A selector that will return the parent date picker.
|
|
169
|
+
*/
|
|
170
|
+
static get selectorParent(): string;
|
|
171
|
+
/**
|
|
172
|
+
* A selector that will return the slug item.
|
|
173
|
+
*
|
|
174
|
+
* remove in v12
|
|
175
|
+
*/
|
|
176
|
+
static get slugItem(): string;
|
|
177
|
+
/**
|
|
178
|
+
* A selector that will return the AI Label item.
|
|
179
|
+
*/
|
|
180
|
+
static get aiLabelItem(): string;
|
|
181
|
+
/**
|
|
182
|
+
* The name of the custom event fired when the input is clicked.
|
|
183
|
+
*/
|
|
184
|
+
static get inputClickEventName(): string;
|
|
185
|
+
static shadowRootOptions: {
|
|
186
|
+
delegatesFocus: boolean;
|
|
187
|
+
clonable?: boolean;
|
|
188
|
+
customElementRegistry?: CustomElementRegistry | null;
|
|
189
|
+
mode: ShadowRootMode;
|
|
190
|
+
serializable?: boolean;
|
|
191
|
+
slotAssignment?: SlotAssignmentMode;
|
|
192
|
+
};
|
|
193
|
+
static styles: any;
|
|
194
|
+
}
|
|
195
|
+
export default CDSDatePickerInput;
|
|
196
|
+
//# sourceMappingURL=date-picker-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker-input.d.ts","sourceRoot":"","sources":["../../../../../src/components/date-picker/next/components/date-picker-input.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAQ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