@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.scss.js","names":[],"sources":["../../../src/components/date-picker/date-picker.scss?lit"],"sourcesContent":["//\n// Copyright IBM Corp. 2019, 2025\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\n$css--plex: true !default;\n\n@use '@carbon/styles/scss/config' as *;\n@use '@carbon/styles/scss/theme' as *;\n@use '@carbon/styles/scss/utilities' as *;\n@use '@carbon/styles/scss/colors' as *;\n@use '@carbon/styles/scss/spacing' as *;\n@use '@carbon/styles/scss/components/form';\n@use '@carbon/styles/scss/components/date-picker/date-picker' as *;\n@use '@carbon/styles/scss/utilities/ai-gradient' as *;\n\n// https://github.com/carbon-design-system/carbon/issues/11408\n@include date-picker;\n\n:host(#{$prefix}-date-picker) {\n @extend .#{$prefix}--date-picker;\n\n #floating-menu-container {\n position: fixed;\n z-index: z('dropdown');\n inline-size: 100%;\n }\n\n .#{$prefix}--date-picker__calendar.open {\n margin-block-start: 0;\n }\n\n .flatpickr-next-month,\n .flatpickr-prev-month {\n svg {\n transform: rotate(0) #{'/*rtl:rotate(180deg)*/'};\n }\n }\n\n // _date-picker.scss#L351-L360 in `v10.6.0` tree, coping with the CSS class that latest Flatpickr has\n .#{$prefix}--date-picker__day.flatpickr-disabled,\n .flatpickr-day.flatpickr-disabled {\n color: $layer-selected-inverse;\n cursor: not-allowed;\n opacity: 0.5;\n\n &:hover {\n background: transparent;\n }\n }\n\n // _date-picker.scss#L455-L468 in `v10.6.0` tree, coping with the CSS class that latest Flatpickr has\n .flatpickr-next-month.flatpickr-disabled,\n .flatpickr-prev-month.flatpickr-disabled {\n svg {\n cursor: not-allowed;\n fill: $layer-selected-inverse;\n opacity: 0.5;\n }\n\n &:hover {\n svg {\n fill: $layer-selected-inverse;\n }\n }\n }\n}\n\n:host(#{$prefix}-date-picker-input),\n:host(#{$prefix}-date-picker-input-skeleton) {\n @extend .#{$prefix}--date-picker-container;\n\n outline: none;\n\n .#{$prefix}--form-requirement[hidden] {\n display: none;\n }\n}\n:host(#{$prefix}-date-picker-input[warn]:not([invalid])) {\n .#{$prefix}--form-requirement {\n color: $text-primary;\n }\n}\n\n:host(#{$prefix}-date-picker-input[kind='simple']),\n:host(#{$prefix}-date-picker-input-skeleton[kind='simple']) {\n .#{$prefix}--date-picker__input {\n inline-size: rem(120px);\n }\n\n .#{$prefix}--date-picker__input--invalid,\n .#{$prefix}--date-picker__input--warn {\n inline-size: rem(152px);\n }\n}\n\n:host(#{$prefix}-date-picker-input[kind='simple'][short]),\n:host(#{$prefix}-date-picker-input-skeleton[kind='simple'][short]) {\n .#{$prefix}--date-picker__input {\n inline-size: rem(90px);\n }\n}\n\n:host(#{$prefix}-date-picker-input[kind='single']),\n:host(#{$prefix}-date-picker-input-skeleton[kind='single']) {\n max-inline-size: rem(288px);\n\n .#{$prefix}--date-picker__input {\n inline-size: rem(288px);\n }\n}\n\n:host(#{$prefix}-date-picker-input[kind='from']),\n:host(#{$prefix}-date-picker-input-skeleton[kind='from']) {\n margin-inline-end: rem(1px);\n}\n\n:host(#{$prefix}-date-picker-input[kind='from']),\n:host(#{$prefix}-date-picker-input[kind='to']),\n:host(#{$prefix}-date-picker-input-skeleton[kind='from']),\n:host(#{$prefix}-date-picker-input-skeleton[kind='to']) {\n inline-size: rem(143.5px);\n\n .#{$prefix}--date-picker__input {\n inline-size: rem(143.5px);\n }\n}\n\n:host(#{$prefix}-date-picker-input) {\n .#{$prefix}--date-picker__icon {\n @extend .#{$prefix}--date-picker__icon;\n }\n\n .#{$prefix}--date-picker__icon--warn {\n @extend .#{$prefix}--date-picker__icon--warn;\n }\n\n .#{$prefix}--date-picker__icon--invalid {\n @extend .#{$prefix}--date-picker__icon--invalid;\n }\n\n ::slotted(#{$prefix}-ai-label),\n ::slotted(#{$prefix}-slug) {\n position: absolute;\n inset-block-start: 50%;\n inset-inline-end: $spacing-08;\n }\n\n ::slotted(#{$prefix}-ai-label:not([revert-active])),\n ::slotted(#{$prefix}-slug:not([revert-active])) {\n transform: translateY(-50%);\n }\n}\n\n:host(#{$prefix}-date-picker-input-skeleton) {\n display: inline-block;\n\n .#{$prefix}--label {\n @include skeleton;\n\n block-size: rem(14px);\n\n inline-size: rem(75px);\n }\n\n .#{$prefix}--date-picker-input-skeleton-container {\n display: inline-block;\n }\n}\n\n:host(#{$prefix}-date-picker-input-skeleton[range]) {\n .#{$prefix}--date-picker-input-skeleton-container {\n inline-size: rem(143.5px);\n\n .#{$prefix}--date-picker__input {\n inline-size: rem(143.5px);\n }\n }\n}\n\n:host(#{$prefix}-date-picker-input[ai-label])\n .#{$prefix}--date-picker__input--decorator {\n @include ai-gradient;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"date-picker.scss.js","names":[],"sources":["../../../src/components/date-picker/date-picker.scss?lit"],"sourcesContent":["//\n// Copyright IBM Corp. 2019, 2025\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\n$css--plex: true !default;\n\n@use '@carbon/styles/scss/config' as *;\n@use '@carbon/styles/scss/theme' as *;\n@use '@carbon/styles/scss/utilities' as *;\n@use '@carbon/styles/scss/colors' as *;\n@use '@carbon/styles/scss/spacing' as *;\n@use '@carbon/styles/scss/components/form';\n@use '@carbon/styles/scss/components/date-picker/date-picker' as *;\n@use '@carbon/styles/scss/utilities/ai-gradient' as *;\n\n// https://github.com/carbon-design-system/carbon/issues/11408\n@include date-picker;\n\n:host(#{$prefix}-date-picker) {\n @extend .#{$prefix}--date-picker;\n\n #floating-menu-container {\n position: fixed;\n z-index: z('dropdown');\n inline-size: 100%;\n }\n\n .#{$prefix}--date-picker__calendar.open {\n margin-block-start: 0;\n }\n\n .flatpickr-next-month,\n .flatpickr-prev-month {\n svg {\n transform: rotate(0) #{'/*rtl:rotate(180deg)*/'};\n }\n }\n\n // _date-picker.scss#L351-L360 in `v10.6.0` tree, coping with the CSS class that latest Flatpickr has\n .#{$prefix}--date-picker__day.flatpickr-disabled,\n .flatpickr-day.flatpickr-disabled {\n color: $layer-selected-inverse;\n cursor: not-allowed;\n opacity: 0.5;\n\n &:hover {\n background: transparent;\n }\n }\n\n // _date-picker.scss#L455-L468 in `v10.6.0` tree, coping with the CSS class that latest Flatpickr has\n .flatpickr-next-month.flatpickr-disabled,\n .flatpickr-prev-month.flatpickr-disabled {\n svg {\n cursor: not-allowed;\n fill: $layer-selected-inverse;\n opacity: 0.5;\n }\n\n &:hover {\n svg {\n fill: $layer-selected-inverse;\n }\n }\n }\n}\n\n:host(#{$prefix}-date-picker-input),\n:host(#{$prefix}-date-picker-input-skeleton) {\n @extend .#{$prefix}--date-picker-container;\n\n outline: none;\n\n .#{$prefix}--form-requirement[hidden] {\n display: none;\n }\n}\n:host(#{$prefix}-date-picker-input[warn]:not([invalid])) {\n .#{$prefix}--form-requirement {\n color: $text-primary;\n }\n}\n\n:host(#{$prefix}-date-picker-input[kind='simple']),\n:host(#{$prefix}-date-picker-input-skeleton[kind='simple']) {\n .#{$prefix}--date-picker__input {\n inline-size: rem(120px);\n }\n\n .#{$prefix}--date-picker__input--invalid,\n .#{$prefix}--date-picker__input--warn {\n inline-size: rem(152px);\n }\n}\n\n:host(#{$prefix}-date-picker-input[kind='simple'][short]),\n:host(#{$prefix}-date-picker-input-skeleton[kind='simple'][short]) {\n .#{$prefix}--date-picker__input {\n inline-size: rem(90px);\n }\n}\n\n:host(#{$prefix}-date-picker-input[kind='single']),\n:host(#{$prefix}-date-picker-input-skeleton[kind='single']) {\n max-inline-size: rem(288px);\n\n .#{$prefix}--date-picker__input {\n inline-size: rem(288px);\n }\n}\n\n:host(#{$prefix}-date-picker-input[kind='from']),\n:host(#{$prefix}-date-picker-input-skeleton[kind='from']) {\n margin-inline-end: rem(1px);\n}\n\n:host(#{$prefix}-date-picker-input[kind='from']),\n:host(#{$prefix}-date-picker-input[kind='to']),\n:host(#{$prefix}-date-picker-input-skeleton[kind='from']),\n:host(#{$prefix}-date-picker-input-skeleton[kind='to']) {\n inline-size: rem(143.5px);\n\n .#{$prefix}--date-picker__input {\n inline-size: rem(143.5px);\n }\n}\n\n:host(#{$prefix}-date-picker-input) {\n .#{$prefix}--date-picker__icon {\n @extend .#{$prefix}--date-picker__icon;\n }\n\n .#{$prefix}--date-picker__icon--warn {\n @extend .#{$prefix}--date-picker__icon--warn;\n }\n\n .#{$prefix}--date-picker__icon--invalid {\n @extend .#{$prefix}--date-picker__icon--invalid;\n }\n\n ::slotted(#{$prefix}-ai-label),\n ::slotted(#{$prefix}-slug) {\n position: absolute;\n inset-block-start: 50%;\n inset-inline-end: $spacing-08;\n }\n\n ::slotted(#{$prefix}-ai-label:not([revert-active])),\n ::slotted(#{$prefix}-slug:not([revert-active])) {\n transform: translateY(-50%);\n }\n}\n\n:host(#{$prefix}-date-picker-input-skeleton) {\n display: inline-block;\n\n .#{$prefix}--label {\n @include skeleton;\n\n block-size: rem(14px);\n\n inline-size: rem(75px);\n }\n\n .#{$prefix}--date-picker-input-skeleton-container {\n display: inline-block;\n }\n}\n\n:host(#{$prefix}-date-picker-input-skeleton[range]) {\n .#{$prefix}--date-picker-input-skeleton-container {\n inline-size: rem(143.5px);\n\n .#{$prefix}--date-picker__input {\n inline-size: rem(143.5px);\n }\n }\n}\n\n:host(#{$prefix}-date-picker-input[ai-label])\n .#{$prefix}--date-picker__input--decorator {\n @include ai-gradient;\n}\n\n.#{$prefix}--form-requirement {\n box-sizing: border-box;\n inline-size: 0;\n min-inline-size: 100%;\n}\n"],"mappings":""}
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2020,
|
|
2
|
+
* Copyright IBM Corp. 2020, 2026
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
export { FORM_ELEMENT_COLOR_SCHEME as DATE_PICKER_INPUT_COLOR_SCHEME } from '../../globals/shared-enums';
|
|
8
|
+
/**
|
|
9
|
+
* Input sizes.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum INPUT_SIZE {
|
|
12
|
+
/**
|
|
13
|
+
* Small size.
|
|
14
|
+
*/
|
|
15
|
+
SMALL = "sm",
|
|
16
|
+
/**
|
|
17
|
+
* Medium size (default).
|
|
18
|
+
*/
|
|
19
|
+
MEDIUM = "md",
|
|
20
|
+
/**
|
|
21
|
+
* Large size.
|
|
22
|
+
*/
|
|
23
|
+
LARGE = "lg"
|
|
24
|
+
}
|
|
8
25
|
/**
|
|
9
26
|
* Date picker input kinds.
|
|
10
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/defs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,yBAAyB,IAAI,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAEzG;;GAEG;AACH,oBAAY,sBAAsB;IAChC;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,EAAE,OAAO;CACV"}
|
|
1
|
+
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/defs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,yBAAyB,IAAI,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAEzG;;GAEG;AACH,oBAAY,UAAU;IACpB;;OAEG;IACH,KAAK,OAAO;IAEZ;;OAEG;IACH,MAAM,OAAO;IAEb;;OAEG;IACH,KAAK,OAAO;CACb;AAED;;GAEG;AACH,oBAAY,sBAAsB;IAChC;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,EAAE,OAAO;CACV"}
|
|
@@ -8,6 +8,24 @@
|
|
|
8
8
|
import { FORM_ELEMENT_COLOR_SCHEME } from "../../globals/shared-enums.js";
|
|
9
9
|
//#region src/components/date-picker/defs.ts
|
|
10
10
|
/**
|
|
11
|
+
* Input sizes.
|
|
12
|
+
*/
|
|
13
|
+
let INPUT_SIZE = /* @__PURE__ */ function(INPUT_SIZE) {
|
|
14
|
+
/**
|
|
15
|
+
* Small size.
|
|
16
|
+
*/
|
|
17
|
+
INPUT_SIZE["SMALL"] = "sm";
|
|
18
|
+
/**
|
|
19
|
+
* Medium size (default).
|
|
20
|
+
*/
|
|
21
|
+
INPUT_SIZE["MEDIUM"] = "md";
|
|
22
|
+
/**
|
|
23
|
+
* Large size.
|
|
24
|
+
*/
|
|
25
|
+
INPUT_SIZE["LARGE"] = "lg";
|
|
26
|
+
return INPUT_SIZE;
|
|
27
|
+
}({});
|
|
28
|
+
/**
|
|
11
29
|
* Date picker input kinds.
|
|
12
30
|
*/
|
|
13
31
|
let DATE_PICKER_INPUT_KIND = /* @__PURE__ */ function(DATE_PICKER_INPUT_KIND) {
|
|
@@ -30,6 +48,6 @@ let DATE_PICKER_INPUT_KIND = /* @__PURE__ */ function(DATE_PICKER_INPUT_KIND) {
|
|
|
30
48
|
return DATE_PICKER_INPUT_KIND;
|
|
31
49
|
}({});
|
|
32
50
|
//#endregion
|
|
33
|
-
export { FORM_ELEMENT_COLOR_SCHEME as DATE_PICKER_INPUT_COLOR_SCHEME, DATE_PICKER_INPUT_KIND };
|
|
51
|
+
export { FORM_ELEMENT_COLOR_SCHEME as DATE_PICKER_INPUT_COLOR_SCHEME, DATE_PICKER_INPUT_KIND, INPUT_SIZE };
|
|
34
52
|
|
|
35
53
|
//# sourceMappingURL=defs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defs.js","names":[],"sources":["../../../src/components/date-picker/defs.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2020,
|
|
1
|
+
{"version":3,"file":"defs.js","names":[],"sources":["../../../src/components/date-picker/defs.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2020, 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\nexport { FORM_ELEMENT_COLOR_SCHEME as DATE_PICKER_INPUT_COLOR_SCHEME } from '../../globals/shared-enums';\n\n/**\n * Input sizes.\n */\nexport enum INPUT_SIZE {\n /**\n * Small size.\n */\n SMALL = 'sm',\n\n /**\n * Medium size (default).\n */\n MEDIUM = 'md',\n\n /**\n * Large size.\n */\n LARGE = 'lg',\n}\n\n/**\n * Date picker input kinds.\n */\nexport enum DATE_PICKER_INPUT_KIND {\n /**\n * One for simple variant of date picker, comes without the calendar dropdown.\n */\n SIMPLE = 'simple',\n\n /**\n * One for single variant of date picker.\n */\n SINGLE = 'single',\n\n /**\n * One for the start date for the range variant.\n */\n FROM = 'from',\n\n /**\n * One for the end date for the range variant.\n */\n TO = 'to',\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAY,aAAL,yBAAA,YAAA;;;;CAIL,WAAA,WAAA;;;;CAKA,WAAA,YAAA;;;;CAKA,WAAA,WAAA;;AACF,EAAA,CAAA,CAAA;;;;AAKA,IAAY,yBAAL,yBAAA,wBAAA;;;;CAIL,uBAAA,YAAA;;;;CAKA,uBAAA,YAAA;;;;CAKA,uBAAA,UAAA;;;;CAKA,uBAAA,QAAA;;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { DatePickerState } from '@carbon/utilities/date-picker';
|
|
8
|
+
import type { DatePickerContext, StateTransition } from '@carbon/utilities/date-picker';
|
|
9
|
+
import type CDSDatePicker from '../components/date-picker';
|
|
10
|
+
/**
|
|
11
|
+
* Adapter configuration
|
|
12
|
+
*/
|
|
13
|
+
export interface AdapterConfig {
|
|
14
|
+
/** The date picker component instance */
|
|
15
|
+
component: CDSDatePicker;
|
|
16
|
+
/** Initial context values */
|
|
17
|
+
initialContext?: Partial<DatePickerContext>;
|
|
18
|
+
/** Callback when state changes */
|
|
19
|
+
onStateChange?: (transition: StateTransition) => void;
|
|
20
|
+
/** Callback when the calendar should open */
|
|
21
|
+
onCalendarOpen?: () => void;
|
|
22
|
+
/** Callback when the calendar should close */
|
|
23
|
+
onCalendarClose?: () => void;
|
|
24
|
+
/** Callback when the date is selected */
|
|
25
|
+
onDateSelect?: (context: DatePickerContext) => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Web Component Adapter
|
|
29
|
+
* Bridges the state machine with the Web Component implementation
|
|
30
|
+
*/
|
|
31
|
+
export declare class WebComponentAdapter {
|
|
32
|
+
private machine;
|
|
33
|
+
private component;
|
|
34
|
+
private config;
|
|
35
|
+
private unsubscribe?;
|
|
36
|
+
/**
|
|
37
|
+
* Create a new adapter
|
|
38
|
+
*
|
|
39
|
+
* @param {AdapterConfig} config - Adapter configuration
|
|
40
|
+
*/
|
|
41
|
+
constructor(config: AdapterConfig);
|
|
42
|
+
/**
|
|
43
|
+
* Send an event to the state machine
|
|
44
|
+
*
|
|
45
|
+
* @param {string} event - Event type
|
|
46
|
+
* @param {unknown} payload - Event payload
|
|
47
|
+
* @returns Updated context
|
|
48
|
+
*/
|
|
49
|
+
send(event: string, payload?: unknown): DatePickerContext;
|
|
50
|
+
/**
|
|
51
|
+
* Get the current state
|
|
52
|
+
*
|
|
53
|
+
* @returns Current state
|
|
54
|
+
*/
|
|
55
|
+
getState(): DatePickerState;
|
|
56
|
+
/**
|
|
57
|
+
* Get the current context
|
|
58
|
+
*
|
|
59
|
+
* @returns Current context
|
|
60
|
+
*/
|
|
61
|
+
getContext(): DatePickerContext;
|
|
62
|
+
/**
|
|
63
|
+
* Update context directly
|
|
64
|
+
*
|
|
65
|
+
* @param {Partial<DatePickerContext>} updates - Context updates
|
|
66
|
+
* @returns Updated context
|
|
67
|
+
*/
|
|
68
|
+
updateContext(updates: Partial<DatePickerContext>): DatePickerContext;
|
|
69
|
+
/**
|
|
70
|
+
* Check if a transition is valid
|
|
71
|
+
*
|
|
72
|
+
* @param {string} event - Event type
|
|
73
|
+
* @returns True if transition is valid
|
|
74
|
+
*/
|
|
75
|
+
canTransition(event: string): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Handle state changes
|
|
78
|
+
*
|
|
79
|
+
* @param {StateTransition} transition - State transition
|
|
80
|
+
*/
|
|
81
|
+
private handleStateChange;
|
|
82
|
+
/**
|
|
83
|
+
* Sync component properties with context
|
|
84
|
+
*
|
|
85
|
+
* @param {DatePickerContext} context - Current context
|
|
86
|
+
*/
|
|
87
|
+
private syncComponentProperties;
|
|
88
|
+
/**
|
|
89
|
+
* Handle transition-specific effects
|
|
90
|
+
*
|
|
91
|
+
* @param {string} from - Previous state
|
|
92
|
+
* @param {string} to - New state
|
|
93
|
+
* @param {DatePickerContext} context - Current context
|
|
94
|
+
*/
|
|
95
|
+
private handleTransitionEffects;
|
|
96
|
+
/**
|
|
97
|
+
* Handle calendar date selection
|
|
98
|
+
* Call this from the calendar's onChange callback
|
|
99
|
+
*
|
|
100
|
+
* @param {Date[]} selectedDates - Selected dates from calendar
|
|
101
|
+
*/
|
|
102
|
+
handleCalendarChange(selectedDates: Date[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* Handle calendar open event
|
|
105
|
+
*/
|
|
106
|
+
handleCalendarOpen(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Handle calendar close event
|
|
109
|
+
*/
|
|
110
|
+
handleCalendarClose(): void;
|
|
111
|
+
/**
|
|
112
|
+
* Handle input focus
|
|
113
|
+
*
|
|
114
|
+
* @param {('from' | 'to')} inputType - Type of input ('from' or 'to')
|
|
115
|
+
*/
|
|
116
|
+
handleInputFocus(inputType: 'from' | 'to'): void;
|
|
117
|
+
/**
|
|
118
|
+
* Handle input blur
|
|
119
|
+
*/
|
|
120
|
+
handleInputBlur(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Handle outside click
|
|
123
|
+
*/
|
|
124
|
+
handleOutsideClick(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Handle keyboard events
|
|
127
|
+
*
|
|
128
|
+
* @param {string} key - Key pressed
|
|
129
|
+
* @param {boolean} shiftKey - Whether shift key was pressed
|
|
130
|
+
*/
|
|
131
|
+
handleKeyboard(key: string, shiftKey?: boolean): void;
|
|
132
|
+
/**
|
|
133
|
+
* Reset the state machine
|
|
134
|
+
*
|
|
135
|
+
* @param {Partial<DatePickerContext>} initialContext - Optional new initial context
|
|
136
|
+
*/
|
|
137
|
+
reset(initialContext?: Partial<DatePickerContext>): void;
|
|
138
|
+
/**
|
|
139
|
+
* Cleanup and unsubscribe
|
|
140
|
+
*/
|
|
141
|
+
destroy(): void;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=web-component-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-component-adapter.d.ts","sourceRoot":"","sources":["../../../../../src/components/date-picker/next/adapters/web-component-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,eAAe,EAEhB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAEhB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,SAAS,EAAE,aAAa,CAAC;IACzB,6BAA6B;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC5C,kCAAkC;IAClC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,KAAK,IAAI,CAAC;IACtD,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,8CAA8C;IAC9C,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,yCAAyC;IACzC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACrD;AAED;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,OAAO,CAAyB;IACxC,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,WAAW,CAAC,CAAa;IAEjC;;;;OAIG;gBACS,MAAM,EAAE,aAAa;IAWjC;;;;;;OAMG;IACI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,iBAAiB;IAIhE;;;;OAIG;IACI,QAAQ,IAAI,eAAe;IAIlC;;;;OAIG;IACI,UAAU,IAAI,iBAAiB;IAItC;;;;;OAKG;IACI,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB;IAI5E;;;;;OAKG;IACI,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAI5C;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAwBzB;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAsB/B;;;;;;OAMG;IACH,OAAO,CAAC,uBAAuB;IAiC/B;;;;;OAKG;IACI,oBAAoB,CAAC,aAAa,EAAE,IAAI,EAAE,GAAG,IAAI;IAuBxD;;OAEG;IACI,kBAAkB,IAAI,IAAI;IAOjC;;OAEG;IACI,mBAAmB,IAAI,IAAI;IAOlC;;;;OAIG;IACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIvD;;OAEG;IACI,eAAe,IAAI,IAAI;IAI9B;;OAEG;IACI,kBAAkB,IAAI,IAAI;IAIjC;;;;;OAKG;IACI,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,IAAI;IAoB1D;;;;OAIG;IACI,KAAK,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAI/D;;OAEG;IACI,OAAO,IAAI,IAAI;CAKvB"}
|
|
@@ -0,0 +1,215 @@
|
|
|
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 { DatePickerEvent, DatePickerState, DatePickerStateMachine, dateToPlainDate } from "@carbon/utilities/date-picker";
|
|
9
|
+
//#region src/components/date-picker/next/adapters/web-component-adapter.ts
|
|
10
|
+
/**
|
|
11
|
+
* Copyright IBM Corp. 2026
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Web Component Adapter
|
|
18
|
+
* Bridges the state machine with the Web Component implementation
|
|
19
|
+
*/
|
|
20
|
+
var WebComponentAdapter = class {
|
|
21
|
+
/**
|
|
22
|
+
* Create a new adapter
|
|
23
|
+
*
|
|
24
|
+
* @param {AdapterConfig} config - Adapter configuration
|
|
25
|
+
*/
|
|
26
|
+
constructor(config) {
|
|
27
|
+
this.config = config;
|
|
28
|
+
this.component = config.component;
|
|
29
|
+
this.machine = new DatePickerStateMachine(config.initialContext);
|
|
30
|
+
this.unsubscribe = this.machine.subscribe((transition) => {
|
|
31
|
+
this.handleStateChange(transition);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Send an event to the state machine
|
|
36
|
+
*
|
|
37
|
+
* @param {string} event - Event type
|
|
38
|
+
* @param {unknown} payload - Event payload
|
|
39
|
+
* @returns Updated context
|
|
40
|
+
*/
|
|
41
|
+
send(event, payload) {
|
|
42
|
+
return this.machine.send(event, payload);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get the current state
|
|
46
|
+
*
|
|
47
|
+
* @returns Current state
|
|
48
|
+
*/
|
|
49
|
+
getState() {
|
|
50
|
+
return this.machine.getState();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get the current context
|
|
54
|
+
*
|
|
55
|
+
* @returns Current context
|
|
56
|
+
*/
|
|
57
|
+
getContext() {
|
|
58
|
+
return this.machine.getContext();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Update context directly
|
|
62
|
+
*
|
|
63
|
+
* @param {Partial<DatePickerContext>} updates - Context updates
|
|
64
|
+
* @returns Updated context
|
|
65
|
+
*/
|
|
66
|
+
updateContext(updates) {
|
|
67
|
+
return this.machine.updateContext(updates);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Check if a transition is valid
|
|
71
|
+
*
|
|
72
|
+
* @param {string} event - Event type
|
|
73
|
+
* @returns True if transition is valid
|
|
74
|
+
*/
|
|
75
|
+
canTransition(event) {
|
|
76
|
+
return this.machine.canTransition(event);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Handle state changes
|
|
80
|
+
*
|
|
81
|
+
* @param {StateTransition} transition - State transition
|
|
82
|
+
*/
|
|
83
|
+
handleStateChange(transition) {
|
|
84
|
+
const { from, to, context } = transition;
|
|
85
|
+
this.syncComponentProperties(context);
|
|
86
|
+
this.handleTransitionEffects(from, to, context);
|
|
87
|
+
if (this.config.onStateChange) this.config.onStateChange(transition);
|
|
88
|
+
this.component.dispatchEvent(new CustomEvent("cds-preview-date-picker-state-change", {
|
|
89
|
+
detail: { transition },
|
|
90
|
+
bubbles: true,
|
|
91
|
+
composed: true
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Sync component properties with context
|
|
96
|
+
*
|
|
97
|
+
* @param {DatePickerContext} context - Current context
|
|
98
|
+
*/
|
|
99
|
+
syncComponentProperties(context) {
|
|
100
|
+
if (this.component.open !== context.isOpen) this.component.open = context.isOpen;
|
|
101
|
+
if (this.component.value !== context.value) this.component.value = context.value;
|
|
102
|
+
if (this.component.disabled !== context.isDisabled) this.component.disabled = context.isDisabled;
|
|
103
|
+
if (this.component.readonly !== context.isReadonly) this.component.readonly = context.isReadonly;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Handle transition-specific effects
|
|
107
|
+
*
|
|
108
|
+
* @param {string} from - Previous state
|
|
109
|
+
* @param {string} to - New state
|
|
110
|
+
* @param {DatePickerContext} context - Current context
|
|
111
|
+
*/
|
|
112
|
+
handleTransitionEffects(from, to, context) {
|
|
113
|
+
if (to === DatePickerState.CALENDAR_OPEN && from !== DatePickerState.CALENDAR_OPEN) {
|
|
114
|
+
if (this.config.onCalendarOpen) this.config.onCalendarOpen();
|
|
115
|
+
}
|
|
116
|
+
if (from === DatePickerState.CALENDAR_OPEN && to !== DatePickerState.CALENDAR_OPEN) {
|
|
117
|
+
if (this.config.onCalendarClose) this.config.onCalendarClose();
|
|
118
|
+
}
|
|
119
|
+
if (to === DatePickerState.DATE_SELECTED) {
|
|
120
|
+
if (this.config.onDateSelect) this.config.onDateSelect(context);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Handle calendar date selection
|
|
125
|
+
* Call this from the calendar's onChange callback
|
|
126
|
+
*
|
|
127
|
+
* @param {Date[]} selectedDates - Selected dates from calendar
|
|
128
|
+
*/
|
|
129
|
+
handleCalendarChange(selectedDates) {
|
|
130
|
+
const context = this.getContext();
|
|
131
|
+
if (context.mode === "single" && selectedDates.length > 0) {
|
|
132
|
+
const date = dateToPlainDate(selectedDates[0]);
|
|
133
|
+
this.send(DatePickerEvent.DATE_SELECT, { date });
|
|
134
|
+
} else if (context.mode === "range") {
|
|
135
|
+
if (selectedDates.length === 1) {
|
|
136
|
+
const date = dateToPlainDate(selectedDates[0]);
|
|
137
|
+
this.send(DatePickerEvent.RANGE_START_SELECT, { date });
|
|
138
|
+
} else if (selectedDates.length === 2) {
|
|
139
|
+
const date = dateToPlainDate(selectedDates[1]);
|
|
140
|
+
this.send(DatePickerEvent.RANGE_END_SELECT, { date });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Handle calendar open event
|
|
146
|
+
*/
|
|
147
|
+
handleCalendarOpen() {
|
|
148
|
+
if (this.getState() !== DatePickerState.CALENDAR_OPEN) this.send(DatePickerEvent.CALENDAR_OPEN);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Handle calendar close event
|
|
152
|
+
*/
|
|
153
|
+
handleCalendarClose() {
|
|
154
|
+
if (this.getState() === DatePickerState.CALENDAR_OPEN) this.send(DatePickerEvent.CALENDAR_CLOSE);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Handle input focus
|
|
158
|
+
*
|
|
159
|
+
* @param {('from' | 'to')} inputType - Type of input ('from' or 'to')
|
|
160
|
+
*/
|
|
161
|
+
handleInputFocus(inputType) {
|
|
162
|
+
this.send(DatePickerEvent.INPUT_FOCUS, { inputType });
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Handle input blur
|
|
166
|
+
*/
|
|
167
|
+
handleInputBlur() {
|
|
168
|
+
this.send(DatePickerEvent.INPUT_BLUR);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Handle outside click
|
|
172
|
+
*/
|
|
173
|
+
handleOutsideClick() {
|
|
174
|
+
this.send(DatePickerEvent.OUTSIDE_CLICK);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Handle keyboard events
|
|
178
|
+
*
|
|
179
|
+
* @param {string} key - Key pressed
|
|
180
|
+
* @param {boolean} shiftKey - Whether shift key was pressed
|
|
181
|
+
*/
|
|
182
|
+
handleKeyboard(key, shiftKey = false) {
|
|
183
|
+
switch (key) {
|
|
184
|
+
case "Escape":
|
|
185
|
+
this.send(DatePickerEvent.ESCAPE_KEY);
|
|
186
|
+
break;
|
|
187
|
+
case "Tab":
|
|
188
|
+
if (shiftKey) this.send(DatePickerEvent.SHIFT_TAB_KEY);
|
|
189
|
+
else this.send(DatePickerEvent.TAB_KEY);
|
|
190
|
+
break;
|
|
191
|
+
case "Enter":
|
|
192
|
+
this.send(DatePickerEvent.ENTER_KEY);
|
|
193
|
+
break;
|
|
194
|
+
default: break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Reset the state machine
|
|
199
|
+
*
|
|
200
|
+
* @param {Partial<DatePickerContext>} initialContext - Optional new initial context
|
|
201
|
+
*/
|
|
202
|
+
reset(initialContext) {
|
|
203
|
+
this.machine.reset(initialContext);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Cleanup and unsubscribe
|
|
207
|
+
*/
|
|
208
|
+
destroy() {
|
|
209
|
+
if (this.unsubscribe) this.unsubscribe();
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
//#endregion
|
|
213
|
+
export { WebComponentAdapter };
|
|
214
|
+
|
|
215
|
+
//# sourceMappingURL=web-component-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-component-adapter.js","names":[],"sources":["../../../../../src/components/date-picker/next/adapters/web-component-adapter.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 { DatePickerStateMachine } from '@carbon/utilities/date-picker';\nimport {\n DatePickerState,\n DatePickerEvent,\n} from '@carbon/utilities/date-picker';\nimport { dateToPlainDate } from '@carbon/utilities/date-picker';\nimport type {\n DatePickerContext,\n StateTransition,\n DateSelectPayload,\n} from '@carbon/utilities/date-picker';\nimport type CDSDatePicker from '../components/date-picker';\n\n/**\n * Adapter configuration\n */\nexport interface AdapterConfig {\n /** The date picker component instance */\n component: CDSDatePicker;\n /** Initial context values */\n initialContext?: Partial<DatePickerContext>;\n /** Callback when state changes */\n onStateChange?: (transition: StateTransition) => void;\n /** Callback when the calendar should open */\n onCalendarOpen?: () => void;\n /** Callback when the calendar should close */\n onCalendarClose?: () => void;\n /** Callback when the date is selected */\n onDateSelect?: (context: DatePickerContext) => void;\n}\n\n/**\n * Web Component Adapter\n * Bridges the state machine with the Web Component implementation\n */\nexport class WebComponentAdapter {\n private machine: DatePickerStateMachine;\n private component: CDSDatePicker;\n private config: AdapterConfig;\n private unsubscribe?: () => void;\n\n /**\n * Create a new adapter\n *\n * @param {AdapterConfig} config - Adapter configuration\n */\n constructor(config: AdapterConfig) {\n this.config = config;\n this.component = config.component;\n this.machine = new DatePickerStateMachine(config.initialContext);\n\n // Subscribe to state changes\n this.unsubscribe = this.machine.subscribe((transition) => {\n this.handleStateChange(transition);\n });\n }\n\n /**\n * Send an event to the state machine\n *\n * @param {string} event - Event type\n * @param {unknown} payload - Event payload\n * @returns Updated context\n */\n public send(event: string, payload?: unknown): DatePickerContext {\n return this.machine.send(event, payload);\n }\n\n /**\n * Get the current state\n *\n * @returns Current state\n */\n public getState(): DatePickerState {\n return this.machine.getState();\n }\n\n /**\n * Get the current context\n *\n * @returns Current context\n */\n public getContext(): DatePickerContext {\n return this.machine.getContext();\n }\n\n /**\n * Update context directly\n *\n * @param {Partial<DatePickerContext>} updates - Context updates\n * @returns Updated context\n */\n public updateContext(updates: Partial<DatePickerContext>): DatePickerContext {\n return this.machine.updateContext(updates);\n }\n\n /**\n * Check if a transition is valid\n *\n * @param {string} event - Event type\n * @returns True if transition is valid\n */\n public canTransition(event: string): boolean {\n return this.machine.canTransition(event);\n }\n\n /**\n * Handle state changes\n *\n * @param {StateTransition} transition - State transition\n */\n private handleStateChange(transition: StateTransition): void {\n const { from, to, context } = transition;\n\n // Sync component properties with state machine context\n this.syncComponentProperties(context);\n\n // Handle specific state transitions\n this.handleTransitionEffects(from, to, context);\n\n // Call user callback\n if (this.config.onStateChange) {\n this.config.onStateChange(transition);\n }\n\n // Dispatch custom event\n (this.component as unknown as HTMLElement).dispatchEvent(\n new CustomEvent('cds-preview-date-picker-state-change', {\n detail: { transition },\n bubbles: true,\n composed: true,\n })\n );\n }\n\n /**\n * Sync component properties with context\n *\n * @param {DatePickerContext} context - Current context\n */\n private syncComponentProperties(context: DatePickerContext): void {\n // Sync open state\n if (this.component.open !== context.isOpen) {\n this.component.open = context.isOpen;\n }\n\n // Sync value\n if (this.component.value !== context.value) {\n this.component.value = context.value;\n }\n\n // Sync disabled state\n if (this.component.disabled !== context.isDisabled) {\n this.component.disabled = context.isDisabled;\n }\n\n // Sync readonly state\n if (this.component.readonly !== context.isReadonly) {\n this.component.readonly = context.isReadonly;\n }\n }\n\n /**\n * Handle transition-specific effects\n *\n * @param {string} from - Previous state\n * @param {string} to - New state\n * @param {DatePickerContext} context - Current context\n */\n private handleTransitionEffects(\n from: string,\n to: string,\n context: DatePickerContext\n ): void {\n // Handle calendar opening\n if (\n to === DatePickerState.CALENDAR_OPEN &&\n from !== DatePickerState.CALENDAR_OPEN\n ) {\n if (this.config.onCalendarOpen) {\n this.config.onCalendarOpen();\n }\n }\n\n // Handle calendar closing\n if (\n from === DatePickerState.CALENDAR_OPEN &&\n to !== DatePickerState.CALENDAR_OPEN\n ) {\n if (this.config.onCalendarClose) {\n this.config.onCalendarClose();\n }\n }\n\n // Handle date selection\n if (to === DatePickerState.DATE_SELECTED) {\n if (this.config.onDateSelect) {\n this.config.onDateSelect(context);\n }\n }\n }\n\n /**\n * Handle calendar date selection\n * Call this from the calendar's onChange callback\n *\n * @param {Date[]} selectedDates - Selected dates from calendar\n */\n public handleCalendarChange(selectedDates: Date[]): void {\n const context = this.getContext();\n\n if (context.mode === 'single' && selectedDates.length > 0) {\n const date = dateToPlainDate(selectedDates[0]);\n this.send(DatePickerEvent.DATE_SELECT, {\n date,\n } as DateSelectPayload);\n } else if (context.mode === 'range') {\n if (selectedDates.length === 1) {\n const date = dateToPlainDate(selectedDates[0]);\n this.send(DatePickerEvent.RANGE_START_SELECT, {\n date,\n } as DateSelectPayload);\n } else if (selectedDates.length === 2) {\n const date = dateToPlainDate(selectedDates[1]);\n this.send(DatePickerEvent.RANGE_END_SELECT, {\n date,\n } as DateSelectPayload);\n }\n }\n }\n\n /**\n * Handle calendar open event\n */\n public handleCalendarOpen(): void {\n const currentState = this.getState();\n if (currentState !== DatePickerState.CALENDAR_OPEN) {\n this.send(DatePickerEvent.CALENDAR_OPEN);\n }\n }\n\n /**\n * Handle calendar close event\n */\n public handleCalendarClose(): void {\n const currentState = this.getState();\n if (currentState === DatePickerState.CALENDAR_OPEN) {\n this.send(DatePickerEvent.CALENDAR_CLOSE);\n }\n }\n\n /**\n * Handle input focus\n *\n * @param {('from' | 'to')} inputType - Type of input ('from' or 'to')\n */\n public handleInputFocus(inputType: 'from' | 'to'): void {\n this.send(DatePickerEvent.INPUT_FOCUS, { inputType });\n }\n\n /**\n * Handle input blur\n */\n public handleInputBlur(): void {\n this.send(DatePickerEvent.INPUT_BLUR);\n }\n\n /**\n * Handle outside click\n */\n public handleOutsideClick(): void {\n this.send(DatePickerEvent.OUTSIDE_CLICK);\n }\n\n /**\n * Handle keyboard events\n *\n * @param {string} key - Key pressed\n * @param {boolean} shiftKey - Whether shift key was pressed\n */\n public handleKeyboard(key: string, shiftKey = false): void {\n switch (key) {\n case 'Escape':\n this.send(DatePickerEvent.ESCAPE_KEY);\n break;\n case 'Tab':\n if (shiftKey) {\n this.send(DatePickerEvent.SHIFT_TAB_KEY);\n } else {\n this.send(DatePickerEvent.TAB_KEY);\n }\n break;\n case 'Enter':\n this.send(DatePickerEvent.ENTER_KEY);\n break;\n default:\n break;\n }\n }\n\n /**\n * Reset the state machine\n *\n * @param {Partial<DatePickerContext>} initialContext - Optional new initial context\n */\n public reset(initialContext?: Partial<DatePickerContext>): void {\n this.machine.reset(initialContext);\n }\n\n /**\n * Cleanup and unsubscribe\n */\n public destroy(): void {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,IAAa,sBAAb,MAAiC;;;;;;CAW/B,YAAY,QAAuB;EACjC,KAAK,SAAS;EACd,KAAK,YAAY,OAAO;EACxB,KAAK,UAAU,IAAI,uBAAuB,OAAO,cAAc;EAG/D,KAAK,cAAc,KAAK,QAAQ,WAAW,eAAe;GACxD,KAAK,kBAAkB,UAAU;EACnC,CAAC;CACH;;;;;;;;CASA,KAAY,OAAe,SAAsC;EAC/D,OAAO,KAAK,QAAQ,KAAK,OAAO,OAAO;CACzC;;;;;;CAOA,WAAmC;EACjC,OAAO,KAAK,QAAQ,SAAS;CAC/B;;;;;;CAOA,aAAuC;EACrC,OAAO,KAAK,QAAQ,WAAW;CACjC;;;;;;;CAQA,cAAqB,SAAwD;EAC3E,OAAO,KAAK,QAAQ,cAAc,OAAO;CAC3C;;;;;;;CAQA,cAAqB,OAAwB;EAC3C,OAAO,KAAK,QAAQ,cAAc,KAAK;CACzC;;;;;;CAOA,kBAA0B,YAAmC;EAC3D,MAAM,EAAE,MAAM,IAAI,YAAY;EAG9B,KAAK,wBAAwB,OAAO;EAGpC,KAAK,wBAAwB,MAAM,IAAI,OAAO;EAG9C,IAAI,KAAK,OAAO,eACd,KAAK,OAAO,cAAc,UAAU;EAItC,KAAM,UAAqC,cACzC,IAAI,YAAY,wCAAwC;GACtD,QAAQ,EAAE,WAAW;GACrB,SAAS;GACT,UAAU;EACZ,CAAC,CACH;CACF;;;;;;CAOA,wBAAgC,SAAkC;EAEhE,IAAI,KAAK,UAAU,SAAS,QAAQ,QAClC,KAAK,UAAU,OAAO,QAAQ;EAIhC,IAAI,KAAK,UAAU,UAAU,QAAQ,OACnC,KAAK,UAAU,QAAQ,QAAQ;EAIjC,IAAI,KAAK,UAAU,aAAa,QAAQ,YACtC,KAAK,UAAU,WAAW,QAAQ;EAIpC,IAAI,KAAK,UAAU,aAAa,QAAQ,YACtC,KAAK,UAAU,WAAW,QAAQ;CAEtC;;;;;;;;CASA,wBACE,MACA,IACA,SACM;EAEN,IACE,OAAO,gBAAgB,iBACvB,SAAS,gBAAgB;OAErB,KAAK,OAAO,gBACd,KAAK,OAAO,eAAe;EAAA;EAK/B,IACE,SAAS,gBAAgB,iBACzB,OAAO,gBAAgB;OAEnB,KAAK,OAAO,iBACd,KAAK,OAAO,gBAAgB;EAAA;EAKhC,IAAI,OAAO,gBAAgB;OACrB,KAAK,OAAO,cACd,KAAK,OAAO,aAAa,OAAO;EAAA;CAGtC;;;;;;;CAQA,qBAA4B,eAA6B;EACvD,MAAM,UAAU,KAAK,WAAW;EAEhC,IAAI,QAAQ,SAAS,YAAY,cAAc,SAAS,GAAG;GACzD,MAAM,OAAO,gBAAgB,cAAc,EAAE;GAC7C,KAAK,KAAK,gBAAgB,aAAa,EACrC,KACF,CAAsB;EACxB,OAAO,IAAI,QAAQ,SAAS;OACtB,cAAc,WAAW,GAAG;IAC9B,MAAM,OAAO,gBAAgB,cAAc,EAAE;IAC7C,KAAK,KAAK,gBAAgB,oBAAoB,EAC5C,KACF,CAAsB;GACxB,OAAO,IAAI,cAAc,WAAW,GAAG;IACrC,MAAM,OAAO,gBAAgB,cAAc,EAAE;IAC7C,KAAK,KAAK,gBAAgB,kBAAkB,EAC1C,KACF,CAAsB;GACxB;;CAEJ;;;;CAKA,qBAAkC;EAEhC,IADqB,KAAK,SACX,MAAM,gBAAgB,eACnC,KAAK,KAAK,gBAAgB,aAAa;CAE3C;;;;CAKA,sBAAmC;EAEjC,IADqB,KAAK,SACX,MAAM,gBAAgB,eACnC,KAAK,KAAK,gBAAgB,cAAc;CAE5C;;;;;;CAOA,iBAAwB,WAAgC;EACtD,KAAK,KAAK,gBAAgB,aAAa,EAAE,UAAU,CAAC;CACtD;;;;CAKA,kBAA+B;EAC7B,KAAK,KAAK,gBAAgB,UAAU;CACtC;;;;CAKA,qBAAkC;EAChC,KAAK,KAAK,gBAAgB,aAAa;CACzC;;;;;;;CAQA,eAAsB,KAAa,WAAW,OAAa;EACzD,QAAQ,KAAR;GACE,KAAK;IACH,KAAK,KAAK,gBAAgB,UAAU;IACpC;GACF,KAAK;IACH,IAAI,UACF,KAAK,KAAK,gBAAgB,aAAa;SAEvC,KAAK,KAAK,gBAAgB,OAAO;IAEnC;GACF,KAAK;IACH,KAAK,KAAK,gBAAgB,SAAS;IACnC;GACF,SACE;EACJ;CACF;;;;;;CAOA,MAAa,gBAAmD;EAC9D,KAAK,QAAQ,MAAM,cAAc;CACnC;;;;CAKA,UAAuB;EACrB,IAAI,KAAK,aACP,KAAK,YAAY;CAErB;AACF"}
|
|
@@ -0,0 +1,136 @@
|
|
|
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 type { PropertyValues } from 'lit';
|
|
9
|
+
/**
|
|
10
|
+
* Calendar renderer for date picker.
|
|
11
|
+
* Replaces Flatpickr's calendar UI with a lightweight, framework-agnostic implementation.
|
|
12
|
+
*
|
|
13
|
+
* @element cds-preview-date-picker-calendar
|
|
14
|
+
* @fires cds-preview-date-picker-calendar-date-select - Fired when a date is selected
|
|
15
|
+
* @fires cds-preview-date-picker-calendar-month-change - Fired when the month changes
|
|
16
|
+
*/
|
|
17
|
+
declare class CDSDatePickerCalendar extends LitElement {
|
|
18
|
+
/**
|
|
19
|
+
* The currently displayed month (Temporal.PlainYearMonth)
|
|
20
|
+
*/
|
|
21
|
+
private _currentMonth;
|
|
22
|
+
/**
|
|
23
|
+
* The selected date(s)
|
|
24
|
+
*/
|
|
25
|
+
selectedDates: Temporal.PlainDate[];
|
|
26
|
+
/**
|
|
27
|
+
* The view date from the state machine (used to sync calendar month)
|
|
28
|
+
*/
|
|
29
|
+
viewDate?: Temporal.PlainDate;
|
|
30
|
+
/**
|
|
31
|
+
* The focused date for keyboard navigation
|
|
32
|
+
*/
|
|
33
|
+
focusedDate?: Temporal.PlainDate | null;
|
|
34
|
+
/**
|
|
35
|
+
* The currently hovered date (for range preview)
|
|
36
|
+
*/
|
|
37
|
+
private _hoveredDate?;
|
|
38
|
+
/**
|
|
39
|
+
* The minimum selectable date
|
|
40
|
+
*/
|
|
41
|
+
minDate?: Temporal.PlainDate;
|
|
42
|
+
/**
|
|
43
|
+
* The maximum selectable date
|
|
44
|
+
*/
|
|
45
|
+
maxDate?: Temporal.PlainDate;
|
|
46
|
+
/**
|
|
47
|
+
* Whether range selection is enabled
|
|
48
|
+
*/
|
|
49
|
+
rangeMode: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The date format for display
|
|
52
|
+
*/
|
|
53
|
+
dateFormat: string;
|
|
54
|
+
/**
|
|
55
|
+
* Locale for date formatting
|
|
56
|
+
*/
|
|
57
|
+
locale: string;
|
|
58
|
+
/**
|
|
59
|
+
* Navigate to previous month
|
|
60
|
+
*/
|
|
61
|
+
private _handlePrevMonth;
|
|
62
|
+
/**
|
|
63
|
+
* Navigate to next month
|
|
64
|
+
*/
|
|
65
|
+
private _handleNextMonth;
|
|
66
|
+
/**
|
|
67
|
+
* Handle date selection
|
|
68
|
+
* @param {Temporal.PlainDate} date - The date to select
|
|
69
|
+
*/
|
|
70
|
+
private _handleDateSelect;
|
|
71
|
+
/**
|
|
72
|
+
* Dispatch month change event
|
|
73
|
+
*/
|
|
74
|
+
private _dispatchMonthChange;
|
|
75
|
+
/**
|
|
76
|
+
* Check if a date is disabled
|
|
77
|
+
* @param {Temporal.PlainDate} date - The date to check
|
|
78
|
+
*/
|
|
79
|
+
private _isDateDisabled;
|
|
80
|
+
/**
|
|
81
|
+
* Check if previous month navigation should be disabled
|
|
82
|
+
*/
|
|
83
|
+
private _isPrevMonthDisabled;
|
|
84
|
+
/**
|
|
85
|
+
* Check if next month navigation should be disabled
|
|
86
|
+
*/
|
|
87
|
+
private _isNextMonthDisabled;
|
|
88
|
+
/**
|
|
89
|
+
* Check if a date is selected
|
|
90
|
+
* @param {Temporal.PlainDate} date - The date to check
|
|
91
|
+
*/
|
|
92
|
+
private _isDateSelected;
|
|
93
|
+
/**
|
|
94
|
+
* Check if a date is in range (for range mode)
|
|
95
|
+
* @param {Temporal.PlainDate} date - The date to check
|
|
96
|
+
*/
|
|
97
|
+
private _isDateInRange;
|
|
98
|
+
/**
|
|
99
|
+
* Check if a date is focused (for keyboard navigation)
|
|
100
|
+
* @param {Temporal.PlainDate} date - The date to check
|
|
101
|
+
*/
|
|
102
|
+
private _isDateFocused;
|
|
103
|
+
/**
|
|
104
|
+
* Handle mouse enter on a date
|
|
105
|
+
* @param {Temporal.PlainDate} date - The date being hovered
|
|
106
|
+
*/
|
|
107
|
+
private _handleDateMouseEnter;
|
|
108
|
+
/**
|
|
109
|
+
* Handle mouse leave on a date
|
|
110
|
+
*/
|
|
111
|
+
private _handleDateMouseLeave;
|
|
112
|
+
/**
|
|
113
|
+
* Render the calendar header with month/year and navigation
|
|
114
|
+
*/
|
|
115
|
+
private _renderHeader;
|
|
116
|
+
/**
|
|
117
|
+
* Render the weekday headers
|
|
118
|
+
*/
|
|
119
|
+
private _renderWeekdays;
|
|
120
|
+
/**
|
|
121
|
+
* Render the calendar days grid
|
|
122
|
+
*/
|
|
123
|
+
private _renderDays;
|
|
124
|
+
/**
|
|
125
|
+
* Lifecycle method called when properties change
|
|
126
|
+
* @param {PropertyValues} changedProperties - Changed properties
|
|
127
|
+
*/
|
|
128
|
+
updated(changedProperties: PropertyValues): void;
|
|
129
|
+
/**
|
|
130
|
+
* Renders the calendar component
|
|
131
|
+
*/
|
|
132
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
133
|
+
static styles: any;
|
|
134
|
+
}
|
|
135
|
+
export default CDSDatePickerCalendar;
|
|
136
|
+
//# sourceMappingURL=calendar-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/components/date-picker/next/components/calendar-renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAiB1C;;;;;;;GAOG;AACH,cACM,qBAAsB,SAAQ,UAAU;IAC5C;;OAEG;IAEH,OAAO,CAAC,aAAa,CAC4B;IAEjD;;OAEG;IAEH,aAAa,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAM;IAEzC;;OAEG;IAEH,QAAQ,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAE9B;;OAEG;IAEH,WAAW,CAAC,EAAE,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC;IAExC;;OAEG;IAEH,OAAO,CAAC,YAAY,CAAC,CAAqB;IAE1C;;OAEG;IAEH,OAAO,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAE7B;;OAEG;IAEH,OAAO,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;IAE7B;;OAEG;IAEH,SAAS,UAAS;IAElB;;OAEG;IAEH,UAAU,SAAW;IAErB;;OAEG;IAEH,MAAM,SAAW;IAEjB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAKxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAKxB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAczB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAY5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;;OAGG;IACH,OAAO,CAAC,eAAe;IASvB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAgDtB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAOtB;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAO7B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAK7B;;OAEG;IACH,OAAO,CAAC,aAAa;IAoCrB;;OAEG;IACH,OAAO,CAAC,eAAe;IAcvB;;OAEG;IACH,OAAO,CAAC,WAAW;IA+CnB;;;OAGG;IACH,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAWzC;;OAEG;IACH,MAAM;IAQN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,qBAAqB,CAAC"}
|