@aurodesignsystem-dev/auro-formkit 0.0.0-pr593.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/CHANGELOG.md +5 -0
- package/LICENSE +201 -0
- package/NOTICE +2 -0
- package/README.md +314 -0
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +39 -0
- package/components/bibtemplate/dist/headerVersion.d.ts +2 -0
- package/components/bibtemplate/dist/iconVersion.d.ts +2 -0
- package/components/bibtemplate/dist/index.d.ts +2 -0
- package/components/bibtemplate/dist/index.js +709 -0
- package/components/bibtemplate/dist/registered.js +709 -0
- package/components/bibtemplate/dist/styles/color-css.d.ts +2 -0
- package/components/bibtemplate/dist/styles/style-css.d.ts +2 -0
- package/components/bibtemplate/dist/styles/tokens-css.d.ts +2 -0
- package/components/checkbox/README.md +142 -0
- package/components/checkbox/demo/api.html +55 -0
- package/components/checkbox/demo/api.js +17 -0
- package/components/checkbox/demo/api.md +401 -0
- package/components/checkbox/demo/api.min.js +1833 -0
- package/components/checkbox/demo/index.html +51 -0
- package/components/checkbox/demo/index.js +8 -0
- package/components/checkbox/demo/index.md +327 -0
- package/components/checkbox/demo/index.min.js +1808 -0
- package/components/checkbox/demo/readme.html +50 -0
- package/components/checkbox/demo/readme.md +142 -0
- package/components/checkbox/dist/auro-checkbox-group.d.ts +166 -0
- package/components/checkbox/dist/auro-checkbox.d.ts +129 -0
- package/components/checkbox/dist/helptextVersion.d.ts +2 -0
- package/components/checkbox/dist/index.d.ts +3 -0
- package/components/checkbox/dist/index.js +1757 -0
- package/components/checkbox/dist/registered.js +1758 -0
- package/components/checkbox/dist/styles/auro-checkbox-css.d.ts +2 -0
- package/components/checkbox/dist/styles/auro-checkbox-group-css.d.ts +2 -0
- package/components/checkbox/dist/styles/color-css.d.ts +2 -0
- package/components/checkbox/dist/styles/colorGroup-css.d.ts +2 -0
- package/components/checkbox/dist/styles/tokens-css.d.ts +2 -0
- package/components/combobox/README.md +152 -0
- package/components/combobox/demo/api.html +57 -0
- package/components/combobox/demo/api.js +36 -0
- package/components/combobox/demo/api.md +1209 -0
- package/components/combobox/demo/api.min.js +15117 -0
- package/components/combobox/demo/index.html +56 -0
- package/components/combobox/demo/index.js +26 -0
- package/components/combobox/demo/index.md +621 -0
- package/components/combobox/demo/index.min.js +14971 -0
- package/components/combobox/demo/readme.html +50 -0
- package/components/combobox/demo/readme.md +152 -0
- package/components/combobox/dist/auro-combobox.d.ts +384 -0
- package/components/combobox/dist/bibtemplateVersion.d.ts +2 -0
- package/components/combobox/dist/dropdownVersion.d.ts +2 -0
- package/components/combobox/dist/index.d.ts +2 -0
- package/components/combobox/dist/index.js +13554 -0
- package/components/combobox/dist/inputVersion.d.ts +2 -0
- package/components/combobox/dist/registered.js +13556 -0
- package/components/combobox/dist/styles/style-css.d.ts +2 -0
- package/components/counter/README.md +146 -0
- package/components/counter/demo/api.html +54 -0
- package/components/counter/demo/api.js +20 -0
- package/components/counter/demo/api.md +584 -0
- package/components/counter/demo/api.min.js +7111 -0
- package/components/counter/demo/index.html +54 -0
- package/components/counter/demo/index.js +21 -0
- package/components/counter/demo/index.md +244 -0
- package/components/counter/demo/index.min.js +7075 -0
- package/components/counter/demo/readme.html +50 -0
- package/components/counter/demo/readme.md +146 -0
- package/components/counter/dist/auro-counter-button.d.ts +12 -0
- package/components/counter/dist/auro-counter-group.d.ts +235 -0
- package/components/counter/dist/auro-counter-wrapper.d.ts +22 -0
- package/components/counter/dist/auro-counter.d.ts +97 -0
- package/components/counter/dist/bibtemplateVersion.d.ts +2 -0
- package/components/counter/dist/dropdownVersion.d.ts +2 -0
- package/components/counter/dist/iconVersion.d.ts +2 -0
- package/components/counter/dist/index.d.ts +3 -0
- package/components/counter/dist/index.js +7018 -0
- package/components/counter/dist/registered.js +7019 -0
- package/components/counter/dist/styles/color-css.d.ts +2 -0
- package/components/counter/dist/styles/counter-button-color-css.d.ts +2 -0
- package/components/counter/dist/styles/counter-button-css.d.ts +2 -0
- package/components/counter/dist/styles/counter-group-css.d.ts +2 -0
- package/components/counter/dist/styles/counter-wrapper-color-css.d.ts +2 -0
- package/components/counter/dist/styles/counter-wrapper-css.d.ts +2 -0
- package/components/counter/dist/styles/style-css.d.ts +2 -0
- package/components/counter/dist/styles/tokens-css.d.ts +2 -0
- package/components/datepicker/README.md +140 -0
- package/components/datepicker/demo/api.html +57 -0
- package/components/datepicker/demo/api.js +35 -0
- package/components/datepicker/demo/api.md +1479 -0
- package/components/datepicker/demo/api.min.js +24534 -0
- package/components/datepicker/demo/index.html +56 -0
- package/components/datepicker/demo/index.js +19 -0
- package/components/datepicker/demo/index.md +112 -0
- package/components/datepicker/demo/index.min.js +24255 -0
- package/components/datepicker/demo/readme.html +50 -0
- package/components/datepicker/demo/readme.md +140 -0
- package/components/datepicker/dist/auro-calendar-cell.d.ts +163 -0
- package/components/datepicker/dist/auro-calendar-month.d.ts +20 -0
- package/components/datepicker/dist/auro-calendar.d.ts +133 -0
- package/components/datepicker/dist/auro-datepicker.d.ts +466 -0
- package/components/datepicker/dist/bibtemplateVersion.d.ts +2 -0
- package/components/datepicker/dist/buttonVersion.d.ts +2 -0
- package/components/datepicker/dist/dropdownVersion.d.ts +2 -0
- package/components/datepicker/dist/index.d.ts +2 -0
- package/components/datepicker/dist/index.js +24185 -0
- package/components/datepicker/dist/inputVersion.d.ts +2 -0
- package/components/datepicker/dist/popoverVersion.d.ts +2 -0
- package/components/datepicker/dist/registered.js +24185 -0
- package/components/datepicker/dist/styles/color-calendar-css.d.ts +2 -0
- package/components/datepicker/dist/styles/color-cell-css.d.ts +2 -0
- package/components/datepicker/dist/styles/color-css.d.ts +2 -0
- package/components/datepicker/dist/styles/color-month-css.d.ts +2 -0
- package/components/datepicker/dist/styles/style-auro-calendar-cell-css.d.ts +2 -0
- package/components/datepicker/dist/styles/style-auro-calendar-css.d.ts +2 -0
- package/components/datepicker/dist/styles/style-auro-calendar-month-css.d.ts +2 -0
- package/components/datepicker/dist/styles/style-css.d.ts +2 -0
- package/components/datepicker/dist/styles/tokens-css.d.ts +2 -0
- package/components/datepicker/dist/utilities.d.ts +78 -0
- package/components/datepicker/dist/utilitiesCalendar.d.ts +38 -0
- package/components/datepicker/dist/utilitiesCalendarRender.d.ts +50 -0
- package/components/datepicker/dist/vendor/wc-range-datepicker/day.d.ts +5 -0
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +60 -0
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-cell.d.ts +1 -0
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +57 -0
- package/components/dropdown/README.md +144 -0
- package/components/dropdown/demo/api.html +57 -0
- package/components/dropdown/demo/api.js +21 -0
- package/components/dropdown/demo/api.md +1434 -0
- package/components/dropdown/demo/api.min.js +3826 -0
- package/components/dropdown/demo/index.html +55 -0
- package/components/dropdown/demo/index.js +19 -0
- package/components/dropdown/demo/index.md +510 -0
- package/components/dropdown/demo/index.min.js +3789 -0
- package/components/dropdown/demo/readme.html +50 -0
- package/components/dropdown/demo/readme.md +144 -0
- package/components/dropdown/dist/auro-dropdown.d.ts +406 -0
- package/components/dropdown/dist/auro-dropdownBib.d.ts +46 -0
- package/components/dropdown/dist/dropdownVersion.d.ts +2 -0
- package/components/dropdown/dist/helptextVersion.d.ts +2 -0
- package/components/dropdown/dist/iconVersion.d.ts +2 -0
- package/components/dropdown/dist/index.d.ts +2 -0
- package/components/dropdown/dist/index.js +3734 -0
- package/components/dropdown/dist/registered.js +3734 -0
- package/components/dropdown/dist/styles/bibColors-css.d.ts +2 -0
- package/components/dropdown/dist/styles/bibStyles-css.d.ts +2 -0
- package/components/dropdown/dist/styles/color-css.d.ts +2 -0
- package/components/dropdown/dist/styles/style-css.d.ts +2 -0
- package/components/dropdown/dist/styles/tokens-css.d.ts +2 -0
- package/components/form/README.md +142 -0
- package/components/form/demo/api.html +49 -0
- package/components/form/demo/api.js +3 -0
- package/components/form/demo/api.md +51 -0
- package/components/form/demo/api.min.js +638 -0
- package/components/form/demo/autocomplete.html +15 -0
- package/components/form/demo/index.html +50 -0
- package/components/form/demo/index.js +4 -0
- package/components/form/demo/index.md +403 -0
- package/components/form/demo/index.min.js +639 -0
- package/components/form/demo/readme.html +50 -0
- package/components/form/demo/readme.md +142 -0
- package/components/form/demo/registerDemoDeps.js +23 -0
- package/components/form/demo/working.html +118 -0
- package/components/form/dist/auro-form.d.ts +223 -0
- package/components/form/dist/index.d.ts +2 -0
- package/components/form/dist/index.js +614 -0
- package/components/form/dist/registered.d.ts +1 -0
- package/components/form/dist/registered.js +614 -0
- package/components/form/dist/styles/style-css.d.ts +2 -0
- package/components/helptext/dist/auro-helptext.d.ts +61 -0
- package/components/helptext/dist/index.d.ts +2 -0
- package/components/helptext/dist/index.js +209 -0
- package/components/helptext/dist/registered.js +209 -0
- package/components/helptext/dist/styles/color-css.d.ts +2 -0
- package/components/helptext/dist/styles/style-css.d.ts +2 -0
- package/components/helptext/dist/styles/tokens-css.d.ts +2 -0
- package/components/input/README.md +135 -0
- package/components/input/demo/api.html +42 -0
- package/components/input/demo/api.js +29 -0
- package/components/input/demo/api.md +1252 -0
- package/components/input/demo/api.min.js +7238 -0
- package/components/input/demo/index.html +43 -0
- package/components/input/demo/index.js +20 -0
- package/components/input/demo/index.md +202 -0
- package/components/input/demo/index.min.js +7157 -0
- package/components/input/demo/readme.html +50 -0
- package/components/input/demo/readme.md +135 -0
- package/components/input/dist/auro-input.d.ts +31 -0
- package/components/input/dist/base-input.d.ts +512 -0
- package/components/input/dist/buttonVersion.d.ts +2 -0
- package/components/input/dist/helptextVersion.d.ts +2 -0
- package/components/input/dist/i18n.d.ts +18 -0
- package/components/input/dist/iconVersion.d.ts +2 -0
- package/components/input/dist/index.d.ts +2 -0
- package/components/input/dist/index.js +7063 -0
- package/components/input/dist/registered.js +7063 -0
- package/components/input/dist/styles/borders-css.d.ts +2 -0
- package/components/input/dist/styles/color-css.d.ts +2 -0
- package/components/input/dist/styles/input-css.d.ts +2 -0
- package/components/input/dist/styles/label-css.d.ts +2 -0
- package/components/input/dist/styles/mixins-css.d.ts +2 -0
- package/components/input/dist/styles/notificationIcons-css.d.ts +2 -0
- package/components/input/dist/styles/style-css.d.ts +2 -0
- package/components/input/dist/styles/tokens-css.d.ts +2 -0
- package/components/input/dist/utilities.d.ts +25 -0
- package/components/menu/README.md +145 -0
- package/components/menu/demo/api.html +55 -0
- package/components/menu/demo/api.js +27 -0
- package/components/menu/demo/api.md +954 -0
- package/components/menu/demo/api.min.js +1538 -0
- package/components/menu/demo/index.html +52 -0
- package/components/menu/demo/index.js +28 -0
- package/components/menu/demo/index.md +61 -0
- package/components/menu/demo/index.min.js +1484 -0
- package/components/menu/demo/readme.html +50 -0
- package/components/menu/demo/readme.md +145 -0
- package/components/menu/dist/auro-menu-utils.d.ts +42 -0
- package/components/menu/dist/auro-menu.d.ts +205 -0
- package/components/menu/dist/auro-menuoption.d.ts +63 -0
- package/components/menu/dist/dropdownVersion.d.ts +2 -0
- package/components/menu/dist/iconVersion.d.ts +2 -0
- package/components/menu/dist/index.d.ts +4 -0
- package/components/menu/dist/index.js +1426 -0
- package/components/menu/dist/registered.js +1427 -0
- package/components/menu/dist/styles/color-menu-css.d.ts +2 -0
- package/components/menu/dist/styles/color-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/style-menu-css.d.ts +2 -0
- package/components/menu/dist/styles/style-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/tokens-css.d.ts +2 -0
- package/components/radio/README.md +137 -0
- package/components/radio/demo/api.html +53 -0
- package/components/radio/demo/api.js +19 -0
- package/components/radio/demo/api.md +562 -0
- package/components/radio/demo/api.min.js +1944 -0
- package/components/radio/demo/index.html +50 -0
- package/components/radio/demo/index.js +8 -0
- package/components/radio/demo/index.md +150 -0
- package/components/radio/demo/index.min.js +1901 -0
- package/components/radio/demo/readme.html +50 -0
- package/components/radio/demo/readme.md +137 -0
- package/components/radio/dist/auro-radio-group.d.ts +194 -0
- package/components/radio/dist/auro-radio.d.ts +144 -0
- package/components/radio/dist/helptextVersion.d.ts +2 -0
- package/components/radio/dist/index.d.ts +3 -0
- package/components/radio/dist/index.js +1850 -0
- package/components/radio/dist/registered.js +1851 -0
- package/components/radio/dist/styles/auro-radio-group-css.d.ts +2 -0
- package/components/radio/dist/styles/color-css.d.ts +2 -0
- package/components/radio/dist/styles/groupColor-css.d.ts +2 -0
- package/components/radio/dist/styles/style-css.d.ts +2 -0
- package/components/radio/dist/styles/tokens-css.d.ts +2 -0
- package/components/select/README.md +144 -0
- package/components/select/demo/api.html +71 -0
- package/components/select/demo/api.js +35 -0
- package/components/select/demo/api.md +1313 -0
- package/components/select/demo/api.min.js +7763 -0
- package/components/select/demo/index.html +66 -0
- package/components/select/demo/index.js +9 -0
- package/components/select/demo/index.md +815 -0
- package/components/select/demo/index.min.js +7651 -0
- package/components/select/demo/readme.html +50 -0
- package/components/select/demo/readme.md +144 -0
- package/components/select/dist/auro-select.d.ts +359 -0
- package/components/select/dist/bibtemplateVersion.d.ts +2 -0
- package/components/select/dist/dropdownVersion.d.ts +2 -0
- package/components/select/dist/index.d.ts +2 -0
- package/components/select/dist/index.js +6300 -0
- package/components/select/dist/registered.js +6300 -0
- package/components/select/dist/styles/style-css.d.ts +2 -0
- package/package.json +217 -0
- package/packages/build-tools/src/postinstall.mjs +12 -0
|
@@ -0,0 +1,1479 @@
|
|
|
1
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/api.md) -->
|
|
2
|
+
<!-- The below content is automatically added from ./../docs/api.md -->
|
|
3
|
+
|
|
4
|
+
# auro-datepicker
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
| Property | Attribute | Modifiers | Type | Default | Description |
|
|
9
|
+
|-----------------------------------|-----------------------------------|-----------|------------|--------------------------------------------------|--------------------------------------------------|
|
|
10
|
+
| [autoPlacement](#autoPlacement) | `autoPlacement` | | `boolean` | "false" | If declared, bib's position will be automatically calculated where to appear. |
|
|
11
|
+
| [calendarEndDate](#calendarEndDate) | `calendarEndDate` | | `string` | "undefined" | The last date that may be displayed in the calendar. |
|
|
12
|
+
| [calendarFocusDate](#calendarFocusDate) | `calendarFocusDate` | | `string` | "value" | The date that will first be visually rendered to the user in the calendar. |
|
|
13
|
+
| [calendarStartDate](#calendarStartDate) | `calendarStartDate` | | `string` | "undefined" | The first date that may be displayed in the calendar. |
|
|
14
|
+
| [centralDate](#centralDate) | `centralDate` | | `string` | | The date that determines the currently visible month. |
|
|
15
|
+
| [disabled](#disabled) | `disabled` | | `boolean` | false | If set, disables the datepicker. |
|
|
16
|
+
| [error](#error) | `error` | | `string` | | When defined, sets persistent validity to `customError` and sets the validation message to the attribute value. |
|
|
17
|
+
| [format](#format) | `format` | | `string` | "mm/dd/yyyy" | Specifies the date format. The default is `mm/dd/yyyy`. |
|
|
18
|
+
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | | `string` | "sm" | Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)<br />at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.<br /><br />When expanded, the dropdown will automatically display in fullscreen mode<br />if the screen size is equal to or smaller than the selected breakpoint. |
|
|
19
|
+
| [inputmode](#inputmode) | `inputmode` | | `string` | | Exposes inputmode attribute for input. |
|
|
20
|
+
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | | `boolean` | false | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600. |
|
|
21
|
+
| [maxDate](#maxDate) | `maxDate` | | `string` | | Maximum date. All dates after will be disabled. |
|
|
22
|
+
| [minDate](#minDate) | `minDate` | | `string` | | Minimum date. All dates before will be disabled. |
|
|
23
|
+
| [monthNames](#monthNames) | `monthNames` | | `array` | ["January","February","March","April","May","June","July","August","September","October","November","December"] | Names of all 12 months to render in the calendar, used for localization of date string in mobile layout. |
|
|
24
|
+
| [noFlip](#noFlip) | `noFlip` | | `boolean` | "false" | If declared, the bib will NOT flip to an alternate position<br />when there isn't enough space in the specified `placement`. |
|
|
25
|
+
| [noValidate](#noValidate) | `noValidate` | | `boolean` | false | If set, disables auto-validation on blur. |
|
|
26
|
+
| [offset](#offset) | `offset` | | `number` | "0" | Gap between the trigger element and bib. |
|
|
27
|
+
| [onDark](#onDark) | `onDark` | | `boolean` | false | If declared, onDark styles will be applied to the trigger. |
|
|
28
|
+
| [placement](#placement) | `placement` | | `string` | "bottom-start" | Position where the bib should appear relative to the trigger.<br />Accepted values:<br />"top" \| "right" \| "bottom" \| "left" \|<br />"bottom-start" \| "top-start" \| "top-end" \|<br />"right-start" \| "right-end" \| "bottom-end" \|<br />"left-start" \| "left-end" |
|
|
29
|
+
| [range](#range) | `range` | | `boolean` | false | If set, turns on date range functionality in auro-calendar. |
|
|
30
|
+
| [required](#required) | `required` | | `boolean` | false | Populates the `required` attribute on the input. Used for client-side validation. |
|
|
31
|
+
| [setCustomValidity](#setCustomValidity) | `setCustomValidity` | | `string` | | Sets a custom help text message to display for all validityStates. |
|
|
32
|
+
| [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | | `string` | | Custom help text message to display when validity = `customError`. |
|
|
33
|
+
| [setCustomValidityRangeOverflow](#setCustomValidityRangeOverflow) | `setCustomValidityRangeOverflow` | | `string` | | Custom help text message to display when validity = `rangeOverflow`. |
|
|
34
|
+
| [setCustomValidityRangeUnderflow](#setCustomValidityRangeUnderflow) | `setCustomValidityRangeUnderflow` | | `string` | | Custom help text message to display when validity = `rangeUnderflow`. |
|
|
35
|
+
| [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | | `string` | | Custom help text message to display when validity = `valueMissing`. |
|
|
36
|
+
| [stacked](#stacked) | `stacked` | | `boolean` | false | Set true to make datepicker stacked style. |
|
|
37
|
+
| [validity](#validity) | `validity` | | `string` | "undefined" | Specifies the `validityState` this element is in. |
|
|
38
|
+
| [value](#value) | `value` | | `string` | "undefined" | Value selected for the datepicker. |
|
|
39
|
+
| [valueEnd](#valueEnd) | `valueEnd` | | `string` | "undefined" | Value selected for the second datepicker when using date range. |
|
|
40
|
+
| [values](#values) | | readonly | `string[]` | | A convenience wrapper for `value` and `valueEnd`, uses the new Auro "array value pattern". |
|
|
41
|
+
|
|
42
|
+
## Methods
|
|
43
|
+
|
|
44
|
+
| Method | Type | Description |
|
|
45
|
+
|------------|----------------------------------------|--------------------------------------------------|
|
|
46
|
+
| [focus](#focus) | `(focusInput: string): void` | Focuses the datepicker trigger input.<br /><br />**focusInput**: Pass in `endDate` to focus on the return input. No parameter is needed to focus on the depart input. |
|
|
47
|
+
| [reset](#reset) | `(): void` | Resets component to initial state. |
|
|
48
|
+
| [validate](#validate) | `(force?: boolean \| undefined): void` | Validates value.<br /><br />**force**: Whether to force validation. |
|
|
49
|
+
|
|
50
|
+
## Events
|
|
51
|
+
|
|
52
|
+
| Event | Type | Description |
|
|
53
|
+
|---------------------------------|--------------------------------------------------|--------------------------------------------------|
|
|
54
|
+
| `auroDatePicker-monthChanged` | `CustomEvent<{ month: any; year: any; numCalendars: any; }>` | Notifies that the visible calendar month(s) have changed. |
|
|
55
|
+
| `auroDatePicker-newSlotContent` | `CustomEvent<any>` | Notifies that new slot content has been added to the datepicker. |
|
|
56
|
+
| `auroDatePicker-toggled` | `CustomEvent<{ expanded: any; }>` | Notifies that the calendar dropdown has been opened/closed. |
|
|
57
|
+
| `auroDatePicker-valueSet` | | Notifies that the component has a new value set. |
|
|
58
|
+
| `auroFormElement-validated` | | Notifies that the component value(s) have been validated. |
|
|
59
|
+
|
|
60
|
+
## Slots
|
|
61
|
+
|
|
62
|
+
| Name | Description |
|
|
63
|
+
|----------------------------|--------------------------------------------------|
|
|
64
|
+
| `bib.fullscreen.dateLabel` | Defines the content to display above selected dates in the mobile layout. |
|
|
65
|
+
| `bib.fullscreen.headline` | Defines the headline to display above bib.fullscreen.dateLabels in the mobile layout. |
|
|
66
|
+
| `date_MM_DD_YYYY` | Defines the content to display in the auro-calendar-cell for the specified date. The content text is colored using the success state token when the `highlight` attribute is applied to the slot. |
|
|
67
|
+
| [fromLabel](#fromLabel) | Defines the label content for the first input. |
|
|
68
|
+
| [helpText](#helpText) | Defines the content of the helpText. |
|
|
69
|
+
| `popover_MM_DD_YYYY` | Defines the content to display in the auro-calendar-cell popover for the specified date. |
|
|
70
|
+
| [toLabel](#toLabel) | Defines the label content for the second input when the `range` attribute is used. |
|
|
71
|
+
|
|
72
|
+
## CSS Shadow Parts
|
|
73
|
+
|
|
74
|
+
| Part | Description |
|
|
75
|
+
|-------------------|--------------------------------------------------|
|
|
76
|
+
| [calendar](#calendar) | Use for customizing the style of the calendar. |
|
|
77
|
+
| [calendarWrapper](#calendarWrapper) | Use for customizing the style of the calendar container. |
|
|
78
|
+
| [dropdown](#dropdown) | Use for customizing the style of the dropdown. |
|
|
79
|
+
| [helpText](#helpText) | Use for customizing the style of the datepicker help text. |
|
|
80
|
+
| [helpTextSpan](#helpTextSpan) | Use for customizing the style of the datepicker help text span. |
|
|
81
|
+
| [input](#input) | Use for customizing the style of the datepicker inputs. |
|
|
82
|
+
| [trigger](#trigger) | Use for customizing the style of the datepicker trigger. |
|
|
83
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
84
|
+
|
|
85
|
+
## API Examples
|
|
86
|
+
|
|
87
|
+
### Basic
|
|
88
|
+
|
|
89
|
+
<div class="exampleWrapper">
|
|
90
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
91
|
+
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
92
|
+
<auro-datepicker>
|
|
93
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
94
|
+
<span slot="fromLabel">Choose a date</span>
|
|
95
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
96
|
+
</auro-datepicker>
|
|
97
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
98
|
+
</div>
|
|
99
|
+
<auro-accordion alignRight>
|
|
100
|
+
<span slot="trigger">See code</span>
|
|
101
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
102
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
103
|
+
|
|
104
|
+
```html
|
|
105
|
+
<auro-datepicker>
|
|
106
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
107
|
+
<span slot="fromLabel">Choose a date</span>
|
|
108
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
109
|
+
</auro-datepicker>
|
|
110
|
+
```
|
|
111
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
112
|
+
</auro-accordion>
|
|
113
|
+
|
|
114
|
+
#### Basic Range
|
|
115
|
+
|
|
116
|
+
When used, the datepicker will display two inputs and the component will support selection of dates for a start and end date.
|
|
117
|
+
|
|
118
|
+
<div class="exampleWrapper">
|
|
119
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basicRange.html) -->
|
|
120
|
+
<!-- The below content is automatically added from ./../apiExamples/basicRange.html -->
|
|
121
|
+
<auro-datepicker range>
|
|
122
|
+
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
123
|
+
<span slot="fromLabel">Departure</span>
|
|
124
|
+
<span slot="toLabel">Return</span>
|
|
125
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
126
|
+
</auro-datepicker>
|
|
127
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
128
|
+
</div>
|
|
129
|
+
<auro-accordion alignRight>
|
|
130
|
+
<span slot="trigger">See code</span>
|
|
131
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basicRange.html) -->
|
|
132
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basicRange.html -->
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<auro-datepicker range>
|
|
136
|
+
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
137
|
+
<span slot="fromLabel">Departure</span>
|
|
138
|
+
<span slot="toLabel">Return</span>
|
|
139
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
140
|
+
</auro-datepicker>
|
|
141
|
+
```
|
|
142
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
143
|
+
</auro-accordion>
|
|
144
|
+
|
|
145
|
+
### Attribute Examples
|
|
146
|
+
|
|
147
|
+
#### disabled
|
|
148
|
+
|
|
149
|
+
If set, disables the datepicker.
|
|
150
|
+
|
|
151
|
+
<div class="exampleWrapper">
|
|
152
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
|
|
153
|
+
<!-- The below content is automatically added from ./../apiExamples/disabled.html -->
|
|
154
|
+
<auro-datepicker disabled>
|
|
155
|
+
<span slot="fromLabel">Choose a date</span>
|
|
156
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
157
|
+
</auro-datepicker>
|
|
158
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
159
|
+
</div>
|
|
160
|
+
<auro-accordion alignRight>
|
|
161
|
+
<span slot="trigger">See code</span>
|
|
162
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
|
|
163
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
|
|
164
|
+
|
|
165
|
+
```html
|
|
166
|
+
<auro-datepicker disabled>
|
|
167
|
+
<span slot="fromLabel">Choose a date</span>
|
|
168
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
169
|
+
</auro-datepicker>
|
|
170
|
+
```
|
|
171
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
172
|
+
</auro-accordion>
|
|
173
|
+
|
|
174
|
+
#### error
|
|
175
|
+
|
|
176
|
+
Use the `error` attribute to apply a persistent custom error that supersedes the HTML5 validation logic.
|
|
177
|
+
|
|
178
|
+
A custom error message can be set using the `error` attribute, or it can be used in conjuction with the `setCustomValidityCustomError` attribute.
|
|
179
|
+
|
|
180
|
+
<div class="exampleWrapper">
|
|
181
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/error.html) -->
|
|
182
|
+
<!-- The below content is automatically added from ./../apiExamples/error.html -->
|
|
183
|
+
<auro-datepicker error="Custom error message" id="errorExample">
|
|
184
|
+
<span slot="bib.fullscreen.headline">Error Example</span>
|
|
185
|
+
<span slot="fromLabel">Choose a date</span>
|
|
186
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
187
|
+
</auro-datepicker>
|
|
188
|
+
<auro-button id="undefinedValueExampleBtnAddError">Set Error</auro-button>
|
|
189
|
+
<auro-button id="undefinedValueExampleBtnRemoveError">Remove Error</auro-button>
|
|
190
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
191
|
+
</div>
|
|
192
|
+
<auro-accordion alignRight>
|
|
193
|
+
<span slot="trigger">See code</span>
|
|
194
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/error.html) -->
|
|
195
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/error.html -->
|
|
196
|
+
|
|
197
|
+
```html
|
|
198
|
+
<auro-datepicker error="Custom error message" id="errorExample">
|
|
199
|
+
<span slot="bib.fullscreen.headline">Error Example</span>
|
|
200
|
+
<span slot="fromLabel">Choose a date</span>
|
|
201
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
202
|
+
</auro-datepicker>
|
|
203
|
+
<auro-button id="undefinedValueExampleBtnAddError">Set Error</auro-button>
|
|
204
|
+
<auro-button id="undefinedValueExampleBtnRemoveError">Remove Error</auro-button>
|
|
205
|
+
```
|
|
206
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
207
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/error.js) -->
|
|
208
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/error.js -->
|
|
209
|
+
|
|
210
|
+
```js
|
|
211
|
+
export function errorExample() {
|
|
212
|
+
const errorExample = document.querySelector('#errorExample');
|
|
213
|
+
|
|
214
|
+
document.querySelector('#undefinedValueExampleBtnAddError').addEventListener('click', () => {
|
|
215
|
+
errorExample.error = 'Custom New Error';
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
document.querySelector('#undefinedValueExampleBtnRemoveError').addEventListener('click', () => {
|
|
219
|
+
errorExample.removeAttribute('error');
|
|
220
|
+
})
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
224
|
+
</auro-accordion>
|
|
225
|
+
|
|
226
|
+
#### Input Mode
|
|
227
|
+
|
|
228
|
+
You can manually set the input mode for the input.
|
|
229
|
+
|
|
230
|
+
<div class="exampleWrapper">
|
|
231
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inputmode.html) -->
|
|
232
|
+
<!-- The below content is automatically added from ./../apiExamples/inputmode.html -->
|
|
233
|
+
<auro-datepicker inputmode="numeric">
|
|
234
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
235
|
+
<span slot="fromLabel">Choose a date</span>
|
|
236
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
237
|
+
</auro-datepicker>
|
|
238
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
239
|
+
</div>
|
|
240
|
+
<auro-accordion alignRight>
|
|
241
|
+
<span slot="trigger">See code</span>
|
|
242
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/inputmode.html) -->
|
|
243
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/inputmode.html -->
|
|
244
|
+
|
|
245
|
+
```html
|
|
246
|
+
<auro-datepicker inputmode="numeric">
|
|
247
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
248
|
+
<span slot="fromLabel">Choose a date</span>
|
|
249
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
250
|
+
</auro-datepicker>
|
|
251
|
+
```
|
|
252
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
253
|
+
</auro-accordion>
|
|
254
|
+
|
|
255
|
+
#### calendarStartDate & calendarEndDate
|
|
256
|
+
|
|
257
|
+
The `calendarStartDate` and `calendarEndDate` properties may be used to explicitly control which calendar months _may_ be rendered in the calendar.
|
|
258
|
+
|
|
259
|
+
In <strong>desktop</strong>, the calendar month navigation will be restricted by these dates. In <strong>mobile</strong>, the following logic is used:
|
|
260
|
+
|
|
261
|
+
- if both `calendarStartDate` and `calendarEndDate` are defined: all months between, including these dates, will be rendered.
|
|
262
|
+
- If only `calendarStartDate` is defined: 12 months will be rendered starting with this value.
|
|
263
|
+
- if only `calendarEndDate` is defined: The current date month through the value of this attribute will be rendered.
|
|
264
|
+
|
|
265
|
+
Note: This does not restrict setting a value outside of those date constraints. These properties _only_ define which months can be rendered in the calendar. A user may still type any date into the input field. If actual value selection restrictions are needed, see the `minDate` and `maxDate` properties which may be used standalone, or in conjunction with `calendarStartDate` and `calendarEndDate`.
|
|
266
|
+
|
|
267
|
+
<div class="exampleWrapper">
|
|
268
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/calendarStartAndEndDate.html) -->
|
|
269
|
+
<!-- The below content is automatically added from ./../apiExamples/calendarStartAndEndDate.html -->
|
|
270
|
+
<auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="06/01/2022">
|
|
271
|
+
<span slot="bib.fullscreen.headline">calendarStartDate & calendarEndDate Example</span>
|
|
272
|
+
<span slot="fromLabel">Choose a date</span>
|
|
273
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
274
|
+
</auro-datepicker>
|
|
275
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
276
|
+
</div>
|
|
277
|
+
<auro-accordion alignRight>
|
|
278
|
+
<span slot="trigger">See code</span>
|
|
279
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/calendarStartAndEndDate.html) -->
|
|
280
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/calendarStartAndEndDate.html -->
|
|
281
|
+
|
|
282
|
+
```html
|
|
283
|
+
<auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="06/01/2022">
|
|
284
|
+
<span slot="bib.fullscreen.headline">calendarStartDate & calendarEndDate Example</span>
|
|
285
|
+
<span slot="fromLabel">Choose a date</span>
|
|
286
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
287
|
+
</auro-datepicker>
|
|
288
|
+
```
|
|
289
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
290
|
+
</auro-accordion>
|
|
291
|
+
|
|
292
|
+
#### calendarFocusDate
|
|
293
|
+
|
|
294
|
+
The `calendarFocusDate` controls which calendar month is first presented to the user when they open the dropdown bib.
|
|
295
|
+
|
|
296
|
+
In <strong>desktop</strong> layout, the first month actually rendered will be the `calendarFocusDate` if defined. Once the user manually navigates the calendar to a different month, the calendar view will remain where the user left off when they close and reopen the bib. If the `calendarFocusDate` attribute is changed, this will re-render the calendar starting at the new date. If `calendarFocusDate` is undefined, the first rendered month will be the current date or the first renderable date defined by `calendarStartDate`.
|
|
297
|
+
|
|
298
|
+
In <strong>mobile</strong> layout, upon first opening the bib, the vertical list of months will scroll (with no animation) to the month defined by the `calendarFocusDate`. If the user scrolls the list to a different position, the scroll position will remain where the user left off when they close and reopen the bib. If the `calendarFocusDate` is changed, the list will scroll to the new dates month. If `calendarFocusDate` is undefined, the list will start at the top most scroll position.
|
|
299
|
+
|
|
300
|
+
<div class="exampleWrapper">
|
|
301
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/calendarFocusDate.html) -->
|
|
302
|
+
<!-- The below content is automatically added from ./../apiExamples/calendarFocusDate.html -->
|
|
303
|
+
<auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="12/01/2023" calendarFocusDate="11/01/2022">
|
|
304
|
+
<span slot="bib.fullscreen.headline">calendarFocusDate Example</span>
|
|
305
|
+
<span slot="fromLabel">Choose a date</span>
|
|
306
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
307
|
+
</auro-datepicker>
|
|
308
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
309
|
+
</div>
|
|
310
|
+
<auro-accordion alignRight>
|
|
311
|
+
<span slot="trigger">See code</span>
|
|
312
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/calendarFocusDate.html) -->
|
|
313
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/calendarFocusDate.html -->
|
|
314
|
+
|
|
315
|
+
```html
|
|
316
|
+
<auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="12/01/2023" calendarFocusDate="11/01/2022">
|
|
317
|
+
<span slot="bib.fullscreen.headline">calendarFocusDate Example</span>
|
|
318
|
+
<span slot="fromLabel">Choose a date</span>
|
|
319
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
320
|
+
</auro-datepicker>
|
|
321
|
+
```
|
|
322
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
323
|
+
</auro-accordion>
|
|
324
|
+
|
|
325
|
+
#### centralDate
|
|
326
|
+
|
|
327
|
+
The `centralDate` attribute can be used to force the calendar to navigate to a specific month. WARNING: Do not set the `centralDate` attribute on blur.
|
|
328
|
+
|
|
329
|
+
#### maxDate
|
|
330
|
+
|
|
331
|
+
To give a higher limit you can bind a date to the `maxDate` attribute. It is recommended to use the `setCustomValidityRangeOverflow` attribute to define an error message to display when validation fails the maximum date restriction.
|
|
332
|
+
|
|
333
|
+
<div class="exampleWrapper">
|
|
334
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/maxDate.html) -->
|
|
335
|
+
<!-- The below content is automatically added from ./../apiExamples/maxDate.html -->
|
|
336
|
+
<auro-datepicker maxDate="03/25/2023" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
337
|
+
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
338
|
+
<span slot="fromLabel">Choose a date</span>
|
|
339
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
340
|
+
</auro-datepicker>
|
|
341
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
342
|
+
</div>
|
|
343
|
+
<auro-accordion alignRight>
|
|
344
|
+
<span slot="trigger">See code</span>
|
|
345
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/maxDate.html) -->
|
|
346
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/maxDate.html -->
|
|
347
|
+
|
|
348
|
+
```html
|
|
349
|
+
<auro-datepicker maxDate="03/25/2023" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
350
|
+
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
351
|
+
<span slot="fromLabel">Choose a date</span>
|
|
352
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
353
|
+
</auro-datepicker>
|
|
354
|
+
```
|
|
355
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
356
|
+
</auro-accordion>
|
|
357
|
+
Setting the `maxDate` attribute to a date earlier than the auro-datepicker `value` will result in the following changes to the component state:
|
|
358
|
+
|
|
359
|
+
* `value` will to reset to `undefined`.
|
|
360
|
+
* If the currently viewed calendar month is later than the new `maxDate`, the calendar view will move to the new `maxDate` month.
|
|
361
|
+
|
|
362
|
+
This example demonstrates that behavior.
|
|
363
|
+
|
|
364
|
+
<div class="exampleWrapper">
|
|
365
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/updateMaxDate.html) -->
|
|
366
|
+
<!-- The below content is automatically added from ./../apiExamples/updateMaxDate.html -->
|
|
367
|
+
<auro-datepicker id="maxDateExample" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
368
|
+
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
369
|
+
<span slot="fromLabel">Choose a date</span>
|
|
370
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
371
|
+
</auro-datepicker>
|
|
372
|
+
<auro-button id="maxDateChange">Change maxDate to Today's Date</auro-button>
|
|
373
|
+
<auro-button id="resetMaxDate">Reset Datepicker to Initial Example</auro-button>
|
|
374
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
375
|
+
</div>
|
|
376
|
+
<auro-accordion alignRight>
|
|
377
|
+
<span slot="trigger">See code</span>
|
|
378
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/updateMaxDate.html) -->
|
|
379
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/updateMaxDate.html -->
|
|
380
|
+
|
|
381
|
+
```html
|
|
382
|
+
<auro-datepicker id="maxDateExample" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
383
|
+
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
384
|
+
<span slot="fromLabel">Choose a date</span>
|
|
385
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
386
|
+
</auro-datepicker>
|
|
387
|
+
<auro-button id="maxDateChange">Change maxDate to Today's Date</auro-button>
|
|
388
|
+
<auro-button id="resetMaxDate">Reset Datepicker to Initial Example</auro-button>
|
|
389
|
+
```
|
|
390
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
391
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/updateMaxDate.js) -->
|
|
392
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/updateMaxDate.js -->
|
|
393
|
+
|
|
394
|
+
```js
|
|
395
|
+
function formatDateString(date) {
|
|
396
|
+
/* eslint-disable prefer-template, no-magic-numbers */
|
|
397
|
+
const dd = String("0" + date.getDate()).slice(-2);
|
|
398
|
+
const mm = String("0" + (date.getMonth() + 1)).slice(-2);
|
|
399
|
+
/* eslint-enable prefer-template, no-magic-numbers */
|
|
400
|
+
const yyyy = date.getFullYear();
|
|
401
|
+
|
|
402
|
+
return `${mm}/${dd}/${yyyy}`;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export function updateMaxDateExample() {
|
|
406
|
+
const maxDateExample = document.getElementById('maxDateExample');
|
|
407
|
+
const changeMaxDateButton = document.getElementById('maxDateChange');
|
|
408
|
+
const resetButton = document.getElementById('resetMaxDate');
|
|
409
|
+
|
|
410
|
+
const today = formatDateString(new Date());
|
|
411
|
+
|
|
412
|
+
let nextWeek = new Date();
|
|
413
|
+
let addOneWeek = nextWeek.getDate() + 7;
|
|
414
|
+
|
|
415
|
+
nextWeek.setDate(addOneWeek);
|
|
416
|
+
nextWeek = formatDateString(nextWeek);
|
|
417
|
+
|
|
418
|
+
maxDateExample.setAttribute('value', nextWeek);
|
|
419
|
+
maxDateExample.setAttribute('maxDate', nextWeek);
|
|
420
|
+
|
|
421
|
+
changeMaxDateButton.addEventListener('click', () => {
|
|
422
|
+
maxDateExample.setAttribute('maxDate', today);
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
resetButton.addEventListener('click', () => {
|
|
426
|
+
maxDateExample.setAttribute('value', nextWeek);
|
|
427
|
+
maxDateExample.setAttribute('maxDate', nextWeek);
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
432
|
+
</auro-accordion>
|
|
433
|
+
|
|
434
|
+
#### minDate
|
|
435
|
+
|
|
436
|
+
To give a lower limit you can bind a date to the `minDate` attribute. It is recommended to use the `setCustomValidityRangeUnderflow` attribute to define an error message to display when validation fails the minimum date restriction.
|
|
437
|
+
|
|
438
|
+
<div class="exampleWrapper">
|
|
439
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/minDate.html) -->
|
|
440
|
+
<!-- The below content is automatically added from ./../apiExamples/minDate.html -->
|
|
441
|
+
<auro-datepicker minDate="03/25/2028" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
442
|
+
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
443
|
+
<span slot="fromLabel">Choose a date</span>
|
|
444
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
445
|
+
</auro-datepicker>
|
|
446
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
447
|
+
</div>
|
|
448
|
+
<auro-accordion alignRight>
|
|
449
|
+
<span slot="trigger">See code</span>
|
|
450
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/minDate.html) -->
|
|
451
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/minDate.html -->
|
|
452
|
+
|
|
453
|
+
```html
|
|
454
|
+
<auro-datepicker minDate="03/25/2028" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
455
|
+
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
456
|
+
<span slot="fromLabel">Choose a date</span>
|
|
457
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
458
|
+
</auro-datepicker>
|
|
459
|
+
```
|
|
460
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
461
|
+
</auro-accordion>
|
|
462
|
+
Setting the `minDate` attribute to a date later than the auro-datepicker `value` will result in the following changes to the component state:
|
|
463
|
+
|
|
464
|
+
* `value` will to reset to `undefined`.
|
|
465
|
+
* If the currently viewed calendar month is earlier than the new `minDate`, the calendar view will move to the new `minDate` month.
|
|
466
|
+
|
|
467
|
+
This example demonstrates that behavior.
|
|
468
|
+
|
|
469
|
+
<div class="exampleWrapper">
|
|
470
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/updateMinDate.html) -->
|
|
471
|
+
<!-- The below content is automatically added from ./../apiExamples/updateMinDate.html -->
|
|
472
|
+
<auro-datepicker id="minDateExample" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
473
|
+
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
474
|
+
<span slot="fromLabel">Choose a date</span>
|
|
475
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
476
|
+
</auro-datepicker>
|
|
477
|
+
<auro-button id="minDateChange">Change minDate to a week from Today</auro-button>
|
|
478
|
+
<auro-button id="resetMinDate">Reset Datepicker to Initial Example</auro-button>
|
|
479
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
480
|
+
</div>
|
|
481
|
+
<auro-accordion alignRight>
|
|
482
|
+
<span slot="trigger">See code</span>
|
|
483
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/updateMinDate.html) -->
|
|
484
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/updateMinDate.html -->
|
|
485
|
+
|
|
486
|
+
```html
|
|
487
|
+
<auro-datepicker id="minDateExample" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
488
|
+
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
489
|
+
<span slot="fromLabel">Choose a date</span>
|
|
490
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
491
|
+
</auro-datepicker>
|
|
492
|
+
<auro-button id="minDateChange">Change minDate to a week from Today</auro-button>
|
|
493
|
+
<auro-button id="resetMinDate">Reset Datepicker to Initial Example</auro-button>
|
|
494
|
+
```
|
|
495
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
496
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/updateMinDate.js) -->
|
|
497
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/updateMinDate.js -->
|
|
498
|
+
|
|
499
|
+
```js
|
|
500
|
+
function formatDateString(date) {
|
|
501
|
+
/* eslint-disable prefer-template, no-magic-numbers */
|
|
502
|
+
const dd = String("0" + date.getDate()).slice(-2);
|
|
503
|
+
const mm = String("0" + (date.getMonth() + 1)).slice(-2);
|
|
504
|
+
/* eslint-enable prefer-template, no-magic-numbers */
|
|
505
|
+
const yyyy = date.getFullYear();
|
|
506
|
+
|
|
507
|
+
return `${mm}/${dd}/${yyyy}`;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export function updateMinDateExample() {
|
|
511
|
+
const minDateExample = document.getElementById('minDateExample');
|
|
512
|
+
const changeMinDateButton = document.getElementById('minDateChange');
|
|
513
|
+
const resetButton = document.getElementById('resetMinDate');
|
|
514
|
+
|
|
515
|
+
const today = formatDateString(new Date());
|
|
516
|
+
|
|
517
|
+
let nextWeek = new Date();
|
|
518
|
+
let addOneWeek = nextWeek.getDate() + 7;
|
|
519
|
+
|
|
520
|
+
nextWeek.setDate(addOneWeek);
|
|
521
|
+
nextWeek = formatDateString(nextWeek);
|
|
522
|
+
|
|
523
|
+
minDateExample.setAttribute('value', today);
|
|
524
|
+
minDateExample.setAttribute('minDate', today);
|
|
525
|
+
|
|
526
|
+
changeMinDateButton.addEventListener('click', () => {
|
|
527
|
+
minDateExample.setAttribute('minDate', nextWeek);
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
resetButton.addEventListener('click', () => {
|
|
531
|
+
minDateExample.setAttribute('value', today);
|
|
532
|
+
minDateExample.setAttribute('minDate', today);
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
}
|
|
536
|
+
```
|
|
537
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
538
|
+
</auro-accordion>
|
|
539
|
+
</auro-accordion>
|
|
540
|
+
|
|
541
|
+
#### noValidate
|
|
542
|
+
|
|
543
|
+
When set, the datepicker will not validate when navigating away from the component.
|
|
544
|
+
|
|
545
|
+
<div class="exampleWrapper">
|
|
546
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/noValidate.html) -->
|
|
547
|
+
<!-- The below content is automatically added from ./../apiExamples/noValidate.html -->
|
|
548
|
+
<auro-datepicker required noValidate>
|
|
549
|
+
<span slot="bib.fullscreen.headline">noValidate Example</span>
|
|
550
|
+
<span slot="fromLabel">Choose a date</span>
|
|
551
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
552
|
+
</auro-datepicker>
|
|
553
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
554
|
+
</div>
|
|
555
|
+
<auro-accordion alignRight>
|
|
556
|
+
<span slot="trigger">See code</span>
|
|
557
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/noValidate.html) -->
|
|
558
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/noValidate.html -->
|
|
559
|
+
|
|
560
|
+
```html
|
|
561
|
+
<auro-datepicker required noValidate>
|
|
562
|
+
<span slot="bib.fullscreen.headline">noValidate Example</span>
|
|
563
|
+
<span slot="fromLabel">Choose a date</span>
|
|
564
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
565
|
+
</auro-datepicker>
|
|
566
|
+
```
|
|
567
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
568
|
+
</auro-accordion>
|
|
569
|
+
|
|
570
|
+
#### required
|
|
571
|
+
|
|
572
|
+
Populates the `required` attribute on the input. Used for client-side validation.
|
|
573
|
+
|
|
574
|
+
When the validity check fails the validityState, equals `valueMissing`. The error message for the `valueMissing` validityState can be set to a custom string using the `setCustomValidityValueMissing`. There is no default error message defined.
|
|
575
|
+
|
|
576
|
+
<div class="exampleWrapper">
|
|
577
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/required.html) -->
|
|
578
|
+
<!-- The below content is automatically added from ./../apiExamples/required.html -->
|
|
579
|
+
<auro-datepicker required setCustomValidityValueMissing="Custom value missing message.">
|
|
580
|
+
<span slot="bib.fullscreen.headline">Required Example</span>
|
|
581
|
+
<span slot="fromLabel">Choose a date</span>
|
|
582
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
583
|
+
</auro-datepicker>
|
|
584
|
+
<auro-datepicker required range setCustomValidityValueMissing="Custom value missing message.">
|
|
585
|
+
<span slot="bib.fullscreen.headline">Required Example</span>
|
|
586
|
+
<span slot="fromLabel">Departure</span>
|
|
587
|
+
<span slot="toLabel">Return</span>
|
|
588
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
589
|
+
</auro-datepicker>
|
|
590
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
591
|
+
</div>
|
|
592
|
+
<auro-accordion alignRight>
|
|
593
|
+
<span slot="trigger">See code</span>
|
|
594
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/required.html) -->
|
|
595
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/required.html -->
|
|
596
|
+
|
|
597
|
+
```html
|
|
598
|
+
<auro-datepicker required setCustomValidityValueMissing="Custom value missing message.">
|
|
599
|
+
<span slot="bib.fullscreen.headline">Required Example</span>
|
|
600
|
+
<span slot="fromLabel">Choose a date</span>
|
|
601
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
602
|
+
</auro-datepicker>
|
|
603
|
+
<auro-datepicker required range setCustomValidityValueMissing="Custom value missing message.">
|
|
604
|
+
<span slot="bib.fullscreen.headline">Required Example</span>
|
|
605
|
+
<span slot="fromLabel">Departure</span>
|
|
606
|
+
<span slot="toLabel">Return</span>
|
|
607
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
608
|
+
</auro-datepicker>
|
|
609
|
+
```
|
|
610
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
611
|
+
</auro-accordion>
|
|
612
|
+
|
|
613
|
+
#### stacked
|
|
614
|
+
|
|
615
|
+
Set stacked attribute to make range datepicker stacked style.
|
|
616
|
+
|
|
617
|
+
<div class="exampleWrapper">
|
|
618
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/stacked.html) -->
|
|
619
|
+
<!-- The below content is automatically added from ./../apiExamples/stacked.html -->
|
|
620
|
+
<auro-datepicker range stacked>
|
|
621
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
622
|
+
<span slot="fromLabel">Choose a date</span>
|
|
623
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
624
|
+
</auro-datepicker>
|
|
625
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
626
|
+
</div>
|
|
627
|
+
<auro-accordion alignRight>
|
|
628
|
+
<span slot="trigger">See code</span>
|
|
629
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/stacked.html) -->
|
|
630
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/stacked.html -->
|
|
631
|
+
|
|
632
|
+
```html
|
|
633
|
+
<auro-datepicker range stacked>
|
|
634
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
635
|
+
<span slot="fromLabel">Choose a date</span>
|
|
636
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
637
|
+
</auro-datepicker>
|
|
638
|
+
```
|
|
639
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
640
|
+
</auro-accordion>
|
|
641
|
+
|
|
642
|
+
### Customized bib position
|
|
643
|
+
The bib position can be customized with `placement`, `offset`, `flip`, `autoPlacement` attributes.
|
|
644
|
+
|
|
645
|
+
- `placement` specifies the preferred position where the bib should appear relative to the trigger.
|
|
646
|
+
- `offset` sets the distance between the trigger and the bib.
|
|
647
|
+
- When `autoPlacement` is enabled, smart positioning logic is applied to determine the best placement for the bib. If all sides have sufficient space, the bib will appear in the position specified by `placement`.
|
|
648
|
+
- Unless `noFlip` is enabled, if there isn't enough space for the preferred `placement`, the bib will automatically flip to an alternative position.
|
|
649
|
+
|
|
650
|
+
<div class="exampleWrapper">
|
|
651
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/floaterConfig.html) -->
|
|
652
|
+
<!-- The below content is automatically added from ./../apiExamples/floaterConfig.html -->
|
|
653
|
+
<div style="width: 400px">
|
|
654
|
+
<auro-datepicker offset="20" placement="bottom-start" noFlip>
|
|
655
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
656
|
+
<span slot="fromLabel">bottom-start with 20px offset and noFlip</span>
|
|
657
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
658
|
+
</auro-datepicker>
|
|
659
|
+
<auro-datepicker offset="20" placement="bottom-start">
|
|
660
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
661
|
+
<span slot="fromLabel">bottom-start with 20px offset and flip</span>
|
|
662
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
663
|
+
</auro-datepicker>
|
|
664
|
+
<auro-datepicker offset="20" placement="right" autoPlacement noFlip>
|
|
665
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
666
|
+
<span slot="fromLabel">right with 20px offset, noFlip and autoPlacement</span>
|
|
667
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
668
|
+
</auro-datepicker>
|
|
669
|
+
</div>
|
|
670
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
671
|
+
</div>
|
|
672
|
+
<auro-accordion alignRight>
|
|
673
|
+
<span slot="trigger">See code</span>
|
|
674
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/floaterConfig.html) -->
|
|
675
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/floaterConfig.html -->
|
|
676
|
+
|
|
677
|
+
```html
|
|
678
|
+
<div style="width: 400px">
|
|
679
|
+
<auro-datepicker offset="20" placement="bottom-start" noFlip>
|
|
680
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
681
|
+
<span slot="fromLabel">bottom-start with 20px offset and noFlip</span>
|
|
682
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
683
|
+
</auro-datepicker>
|
|
684
|
+
<auro-datepicker offset="20" placement="bottom-start">
|
|
685
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
686
|
+
<span slot="fromLabel">bottom-start with 20px offset and flip</span>
|
|
687
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
688
|
+
</auro-datepicker>
|
|
689
|
+
<auro-datepicker offset="20" placement="right" autoPlacement noFlip>
|
|
690
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
691
|
+
<span slot="fromLabel">right with 20px offset, noFlip and autoPlacement</span>
|
|
692
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
693
|
+
</auro-datepicker>
|
|
694
|
+
</div>
|
|
695
|
+
```
|
|
696
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
697
|
+
</auro-accordion>
|
|
698
|
+
|
|
699
|
+
#### validity
|
|
700
|
+
|
|
701
|
+
Specifies the `validityState` the element is in. Upon first interaction, or presetting the `error` attribute, the component will validate on `focusout`. After validation, `validityState` can be queried from the component by using the following JavaScript.
|
|
702
|
+
|
|
703
|
+
<div class="exampleWrapper">
|
|
704
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/validity.html) -->
|
|
705
|
+
<!-- The below content is automatically added from ./../apiExamples/validity.html -->
|
|
706
|
+
<auro-datepicker required id="validityExample">
|
|
707
|
+
<span slot="bib.fullscreen.headline">validity Example</span>
|
|
708
|
+
<span slot="fromLabel">Choose a date</span>
|
|
709
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
710
|
+
</auro-datepicker>
|
|
711
|
+
<auro-button id="validityExampleBtn">Get validity</auro-button>
|
|
712
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
713
|
+
</div>
|
|
714
|
+
<auro-accordion alignRight>
|
|
715
|
+
<span slot="trigger">See code</span>
|
|
716
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/validity.html) -->
|
|
717
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/validity.html -->
|
|
718
|
+
|
|
719
|
+
```html
|
|
720
|
+
<auro-datepicker required id="validityExample">
|
|
721
|
+
<span slot="bib.fullscreen.headline">validity Example</span>
|
|
722
|
+
<span slot="fromLabel">Choose a date</span>
|
|
723
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
724
|
+
</auro-datepicker>
|
|
725
|
+
<auro-button id="validityExampleBtn">Get validity</auro-button>
|
|
726
|
+
```
|
|
727
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
728
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/validity.js) -->
|
|
729
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/validity.js -->
|
|
730
|
+
|
|
731
|
+
```js
|
|
732
|
+
export function validityExample() {
|
|
733
|
+
const validityExampleExample = document.querySelector('#validityExample');
|
|
734
|
+
const validityExampleExampleBtn = document.querySelector('#validityExampleBtn');
|
|
735
|
+
|
|
736
|
+
validityExampleExampleBtn.addEventListener('click', () => {
|
|
737
|
+
console.warn('Validity set to:', validityExampleExample.validity);
|
|
738
|
+
alert(`Validity set to: ${validityExampleExample.validity}`);
|
|
739
|
+
})
|
|
740
|
+
}
|
|
741
|
+
```
|
|
742
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
743
|
+
</auro-accordion>
|
|
744
|
+
|
|
745
|
+
#### value
|
|
746
|
+
|
|
747
|
+
Value selected for the datepicker. Can be used to pre-set the value of the datepicker. When the `range` attribute is used, `value` is for the first input.
|
|
748
|
+
|
|
749
|
+
<div class="exampleWrapper">
|
|
750
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/value.html) -->
|
|
751
|
+
<!-- The below content is automatically added from ./../apiExamples/value.html -->
|
|
752
|
+
<auro-datepicker id="valueExample" value="02/02/2022">
|
|
753
|
+
<span slot="bib.fullscreen.headline">value Example</span>
|
|
754
|
+
<span slot="fromLabel">Choose a date</span>
|
|
755
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
756
|
+
</auro-datepicker>
|
|
757
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
758
|
+
</div>
|
|
759
|
+
<auro-accordion alignRight>
|
|
760
|
+
<span slot="trigger">See code</span>
|
|
761
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/value.html) -->
|
|
762
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/value.html -->
|
|
763
|
+
|
|
764
|
+
```html
|
|
765
|
+
<auro-datepicker id="valueExample" value="02/02/2022">
|
|
766
|
+
<span slot="bib.fullscreen.headline">value Example</span>
|
|
767
|
+
<span slot="fromLabel">Choose a date</span>
|
|
768
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
769
|
+
</auro-datepicker>
|
|
770
|
+
```
|
|
771
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
772
|
+
</auro-accordion>
|
|
773
|
+
|
|
774
|
+
#### valueEnd
|
|
775
|
+
|
|
776
|
+
Value of the second input (end date), selected for the datepicker. Can be used to pre-set the value of the datepicker. Only applicable for a datepicker with the `range` attribute.
|
|
777
|
+
|
|
778
|
+
<div class="exampleWrapper">
|
|
779
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/valueEnd.html) -->
|
|
780
|
+
<!-- The below content is automatically added from ./../apiExamples/valueEnd.html -->
|
|
781
|
+
<auro-datepicker id="valueEndExample" range valueEnd="03/03/2023">
|
|
782
|
+
<span slot="bib.fullscreen.headline">valueEnd Example</span>
|
|
783
|
+
<span slot="fromLabel">Departure</span>
|
|
784
|
+
<span slot="toLabel">Return</span>
|
|
785
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
786
|
+
</auro-datepicker>
|
|
787
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
788
|
+
</div>
|
|
789
|
+
<auro-accordion alignRight>
|
|
790
|
+
<span slot="trigger">See code</span>
|
|
791
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/valueEnd.html) -->
|
|
792
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/valueEnd.html -->
|
|
793
|
+
|
|
794
|
+
```html
|
|
795
|
+
<auro-datepicker id="valueEndExample" range valueEnd="03/03/2023">
|
|
796
|
+
<span slot="bib.fullscreen.headline">valueEnd Example</span>
|
|
797
|
+
<span slot="fromLabel">Departure</span>
|
|
798
|
+
<span slot="toLabel">Return</span>
|
|
799
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
800
|
+
</auro-datepicker>
|
|
801
|
+
```
|
|
802
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
803
|
+
</auro-accordion>
|
|
804
|
+
|
|
805
|
+
#### format
|
|
806
|
+
|
|
807
|
+
The `format` attribute is used to define the date format used by the datepicker. The default value is `mm/dd/yyyy`.
|
|
808
|
+
|
|
809
|
+
<div class="exampleWrapper">
|
|
810
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/format.html) -->
|
|
811
|
+
<!-- The below content is automatically added from ./../apiExamples/format.html -->
|
|
812
|
+
<auro-datepicker format="yyyy/mm/dd">
|
|
813
|
+
<span slot="bib.fullscreen.headline">Format Headline</span>
|
|
814
|
+
<span slot="fromLabel">Choose a date</span>
|
|
815
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
816
|
+
</auro-datepicker>
|
|
817
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
818
|
+
</div>
|
|
819
|
+
<auro-accordion alignRight>
|
|
820
|
+
<span slot="trigger">See code</span>
|
|
821
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/format.html) -->
|
|
822
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/format.html -->
|
|
823
|
+
|
|
824
|
+
```html
|
|
825
|
+
<auro-datepicker format="yyyy/mm/dd">
|
|
826
|
+
<span slot="bib.fullscreen.headline">Format Headline</span>
|
|
827
|
+
<span slot="fromLabel">Choose a date</span>
|
|
828
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
829
|
+
</auro-datepicker>
|
|
830
|
+
```
|
|
831
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
832
|
+
</auro-accordion>
|
|
833
|
+
|
|
834
|
+
### Method Examples
|
|
835
|
+
|
|
836
|
+
#### focus
|
|
837
|
+
|
|
838
|
+
The focus method will apply focus state to the datepicker's input field.
|
|
839
|
+
|
|
840
|
+
<div class="exampleWrapper">
|
|
841
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/focus.html) -->
|
|
842
|
+
<!-- The below content is automatically added from ./../apiExamples/focus.html -->
|
|
843
|
+
<auro-datepicker id="focusExampleElem" range>
|
|
844
|
+
<span slot="bib.fullscreen.headline">Focus Example</span>
|
|
845
|
+
<span slot="fromLabel">Departure</span>
|
|
846
|
+
<span slot="toLabel">Return</span>
|
|
847
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
848
|
+
</auro-datepicker>
|
|
849
|
+
<auro-button id="focusExampleBtn">Apply focus to datepicker</auro-button>
|
|
850
|
+
<auro-button id="focusExampleBtnTwo">Apply focus to the second input in datepicker</auro-button>
|
|
851
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
852
|
+
</div>
|
|
853
|
+
<auro-accordion alignRight>
|
|
854
|
+
<span slot="trigger">See code</span>
|
|
855
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/focus.html) -->
|
|
856
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/focus.html -->
|
|
857
|
+
|
|
858
|
+
```html
|
|
859
|
+
<auro-datepicker id="focusExampleElem" range>
|
|
860
|
+
<span slot="bib.fullscreen.headline">Focus Example</span>
|
|
861
|
+
<span slot="fromLabel">Departure</span>
|
|
862
|
+
<span slot="toLabel">Return</span>
|
|
863
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
864
|
+
</auro-datepicker>
|
|
865
|
+
<auro-button id="focusExampleBtn">Apply focus to datepicker</auro-button>
|
|
866
|
+
<auro-button id="focusExampleBtnTwo">Apply focus to the second input in datepicker</auro-button>
|
|
867
|
+
```
|
|
868
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
869
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/focus.js) -->
|
|
870
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/focus.js -->
|
|
871
|
+
|
|
872
|
+
```js
|
|
873
|
+
export function focusExample() {
|
|
874
|
+
const focusExampleElem = document.querySelector('#focusExampleElem');
|
|
875
|
+
const focusExampleBtn = document.querySelector('#focusExampleBtn');
|
|
876
|
+
const focusExampleBtnTwo = document.querySelector('#focusExampleBtnTwo');
|
|
877
|
+
|
|
878
|
+
focusExampleBtn.addEventListener('click', () => {
|
|
879
|
+
focusExampleElem.focus();
|
|
880
|
+
});
|
|
881
|
+
|
|
882
|
+
focusExampleBtnTwo.addEventListener('click', () => {
|
|
883
|
+
focusExampleElem.focus('endDate');
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
```
|
|
887
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
888
|
+
</auro-accordion>
|
|
889
|
+
|
|
890
|
+
### Slot Examples
|
|
891
|
+
|
|
892
|
+
#### fromLabel
|
|
893
|
+
|
|
894
|
+
Sets the label used for the input. When the `range` attribute is used this is the first of two inputs.
|
|
895
|
+
|
|
896
|
+
<div class="exampleWrapper">
|
|
897
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
898
|
+
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
899
|
+
<auro-datepicker>
|
|
900
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
901
|
+
<span slot="fromLabel">Choose a date</span>
|
|
902
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
903
|
+
</auro-datepicker>
|
|
904
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
905
|
+
</div>
|
|
906
|
+
<auro-accordion alignRight>
|
|
907
|
+
<span slot="trigger">See code</span>
|
|
908
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
909
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
910
|
+
|
|
911
|
+
```html
|
|
912
|
+
<auro-datepicker>
|
|
913
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
914
|
+
<span slot="fromLabel">Choose a date</span>
|
|
915
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
916
|
+
</auro-datepicker>
|
|
917
|
+
```
|
|
918
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
919
|
+
</auro-accordion>
|
|
920
|
+
|
|
921
|
+
#### helpText
|
|
922
|
+
|
|
923
|
+
Sets the help text displayed below the trigger. The `helpText` slot can be used to provide additional context for the combobox. When using the `error` attribute, the `helpText` slot can be used to describe the error.
|
|
924
|
+
|
|
925
|
+
<div class="exampleWrapper">
|
|
926
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/helpText.html) -->
|
|
927
|
+
<!-- The below content is automatically added from ./../apiExamples/helpText.html -->
|
|
928
|
+
<auro-datepicker>
|
|
929
|
+
<span slot="bib.fullscreen.headline">helpText Example</span>
|
|
930
|
+
<span slot="fromLabel">Choose a date</span>
|
|
931
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
932
|
+
<span slot="helpText">Choose a date must be today or earlier.</span>
|
|
933
|
+
</auro-datepicker>
|
|
934
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
935
|
+
</div>
|
|
936
|
+
<auro-accordion alignRight>
|
|
937
|
+
<span slot="trigger">See code</span>
|
|
938
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/helpText.html) -->
|
|
939
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/helpText.html -->
|
|
940
|
+
|
|
941
|
+
```html
|
|
942
|
+
<auro-datepicker>
|
|
943
|
+
<span slot="bib.fullscreen.headline">helpText Example</span>
|
|
944
|
+
<span slot="fromLabel">Choose a date</span>
|
|
945
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
946
|
+
<span slot="helpText">Choose a date must be today or earlier.</span>
|
|
947
|
+
</auro-datepicker>
|
|
948
|
+
```
|
|
949
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
950
|
+
</auro-accordion>
|
|
951
|
+
|
|
952
|
+
#### bib.fullscreen.dateLabel and bib.fullscreen.headline
|
|
953
|
+
|
|
954
|
+
Sets the headline and the label at the top of the bib when viewed in the mobile layout.
|
|
955
|
+
To view this demo, set your window to a mobile screen size.
|
|
956
|
+
|
|
957
|
+
<div class="exampleWrapper">
|
|
958
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
959
|
+
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
960
|
+
<auro-datepicker>
|
|
961
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
962
|
+
<span slot="fromLabel">Choose a date</span>
|
|
963
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
964
|
+
</auro-datepicker>
|
|
965
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
966
|
+
</div>
|
|
967
|
+
<auro-accordion alignRight>
|
|
968
|
+
<span slot="trigger">See code</span>
|
|
969
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
970
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
971
|
+
|
|
972
|
+
```html
|
|
973
|
+
<auro-datepicker>
|
|
974
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
975
|
+
<span slot="fromLabel">Choose a date</span>
|
|
976
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
977
|
+
</auro-datepicker>
|
|
978
|
+
```
|
|
979
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
980
|
+
</auro-accordion>
|
|
981
|
+
|
|
982
|
+
#### toLabel
|
|
983
|
+
|
|
984
|
+
Only for use with the `range` attribute. Sets the label for the second input.
|
|
985
|
+
|
|
986
|
+
<div class="exampleWrapper">
|
|
987
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basicRange.html) -->
|
|
988
|
+
<!-- The below content is automatically added from ./../apiExamples/basicRange.html -->
|
|
989
|
+
<auro-datepicker range>
|
|
990
|
+
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
991
|
+
<span slot="fromLabel">Departure</span>
|
|
992
|
+
<span slot="toLabel">Return</span>
|
|
993
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
994
|
+
</auro-datepicker>
|
|
995
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
996
|
+
</div>
|
|
997
|
+
<auro-accordion alignRight>
|
|
998
|
+
<span slot="trigger">See code</span>
|
|
999
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basicRange.html) -->
|
|
1000
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basicRange.html -->
|
|
1001
|
+
|
|
1002
|
+
```html
|
|
1003
|
+
<auro-datepicker range>
|
|
1004
|
+
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
1005
|
+
<span slot="fromLabel">Departure</span>
|
|
1006
|
+
<span slot="toLabel">Return</span>
|
|
1007
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
1008
|
+
</auro-datepicker>
|
|
1009
|
+
```
|
|
1010
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1011
|
+
</auro-accordion>
|
|
1012
|
+
|
|
1013
|
+
#### Date Slot
|
|
1014
|
+
|
|
1015
|
+
Custom content can be added to any day in the calendar using a `slot` named following the pattern `date_{MM}_{DD}_{YYYY}` (e.g. `date_01_08_2024`).
|
|
1016
|
+
|
|
1017
|
+
Adding the `highlight` attribute to the slot will change the slot content's color to `var(--ds-color-text-success-default)`.
|
|
1018
|
+
|
|
1019
|
+
Slot content support is limited to text only and a maximum of five (5) characters.
|
|
1020
|
+
|
|
1021
|
+
Slot content can be styled using [inline styles](https://www.codecademy.com/article/html-inline-styles) or [CSS Parts](https://css-tricks.com/styling-in-the-shadow-dom-with-css-shadow-parts/) (`part="dateSlot"`).
|
|
1022
|
+
|
|
1023
|
+
<div class="exampleWrapper">
|
|
1024
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dateSlot.html) -->
|
|
1025
|
+
<!-- The below content is automatically added from ./../apiExamples/dateSlot.html -->
|
|
1026
|
+
<auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
1027
|
+
<span slot="bib.fullscreen.headline">dateSlot Example</span>
|
|
1028
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1029
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1030
|
+
<span slot="date_12_03_2023">Sold</span>
|
|
1031
|
+
<span highlight slot="date_12_04_2023">$89</span>
|
|
1032
|
+
<span slot="date_12_05_2023">$100</span>
|
|
1033
|
+
<span slot="date_12_06_2023">$2345</span>
|
|
1034
|
+
<span highlight slot="date_12_07_2023">$149</span>
|
|
1035
|
+
<span highlight slot="date_12_08_2023">$382</span>
|
|
1036
|
+
<span slot="date_12_09_2023">$560</span>
|
|
1037
|
+
</auro-datepicker>
|
|
1038
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1039
|
+
</div>
|
|
1040
|
+
<auro-accordion alignRight>
|
|
1041
|
+
<span slot="trigger">See code</span>
|
|
1042
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dateSlot.html) -->
|
|
1043
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/dateSlot.html -->
|
|
1044
|
+
|
|
1045
|
+
```html
|
|
1046
|
+
<auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
1047
|
+
<span slot="bib.fullscreen.headline">dateSlot Example</span>
|
|
1048
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1049
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1050
|
+
<span slot="date_12_03_2023">Sold</span>
|
|
1051
|
+
<span highlight slot="date_12_04_2023">$89</span>
|
|
1052
|
+
<span slot="date_12_05_2023">$100</span>
|
|
1053
|
+
<span slot="date_12_06_2023">$2345</span>
|
|
1054
|
+
<span highlight slot="date_12_07_2023">$149</span>
|
|
1055
|
+
<span highlight slot="date_12_08_2023">$382</span>
|
|
1056
|
+
<span slot="date_12_09_2023">$560</span>
|
|
1057
|
+
</auro-datepicker>
|
|
1058
|
+
```
|
|
1059
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1060
|
+
</auro-accordion>
|
|
1061
|
+
|
|
1062
|
+
#### Popover Slot
|
|
1063
|
+
|
|
1064
|
+
Custom content can be added to any day's `auro-popover` in the calendar using a `slot` named following the pattern `popover_{MM}_{DD}_{YYYY}` (e.g. `popover_01_08_2024`).
|
|
1065
|
+
|
|
1066
|
+
The popover slot is intended for use with calendar dates that are `disabled` (e.g. before minimum date or after maximum date).
|
|
1067
|
+
|
|
1068
|
+
<div class="exampleWrapper">
|
|
1069
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/popoverSlot.html) -->
|
|
1070
|
+
<!-- The below content is automatically added from ./../apiExamples/popoverSlot.html -->
|
|
1071
|
+
<auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
1072
|
+
<span slot="bib.fullscreen.headline">Popover Slot Example</span>
|
|
1073
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1074
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1075
|
+
<span slot="popover_12_03_2023">Tickets for this day are sold out</span>
|
|
1076
|
+
<span slot="popover_12_04_2023">Tickets for this day are $89</span>
|
|
1077
|
+
<span slot="popover_12_05_2023">Tickets for this day are $100</span>
|
|
1078
|
+
<span slot="popover_12_06_2023">Tickets for this day are $2345</span>
|
|
1079
|
+
<span slot="popover_12_07_2023">Tickets for this day are $149</span>
|
|
1080
|
+
<span slot="popover_12_08_2023">Tickets for this day are $382</span>
|
|
1081
|
+
<span slot="popover_12_09_2023">Tickets for this day are $560</span>
|
|
1082
|
+
</auro-datepicker>
|
|
1083
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1084
|
+
</div>
|
|
1085
|
+
<auro-accordion alignRight>
|
|
1086
|
+
<span slot="trigger">See code</span>
|
|
1087
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/popoverSlot.html) -->
|
|
1088
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/popoverSlot.html -->
|
|
1089
|
+
|
|
1090
|
+
```html
|
|
1091
|
+
<auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
1092
|
+
<span slot="bib.fullscreen.headline">Popover Slot Example</span>
|
|
1093
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1094
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1095
|
+
<span slot="popover_12_03_2023">Tickets for this day are sold out</span>
|
|
1096
|
+
<span slot="popover_12_04_2023">Tickets for this day are $89</span>
|
|
1097
|
+
<span slot="popover_12_05_2023">Tickets for this day are $100</span>
|
|
1098
|
+
<span slot="popover_12_06_2023">Tickets for this day are $2345</span>
|
|
1099
|
+
<span slot="popover_12_07_2023">Tickets for this day are $149</span>
|
|
1100
|
+
<span slot="popover_12_08_2023">Tickets for this day are $382</span>
|
|
1101
|
+
<span slot="popover_12_09_2023">Tickets for this day are $560</span>
|
|
1102
|
+
</auro-datepicker>
|
|
1103
|
+
```
|
|
1104
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1105
|
+
</auro-accordion>
|
|
1106
|
+
|
|
1107
|
+
### Functional Examples
|
|
1108
|
+
|
|
1109
|
+
#### Localization
|
|
1110
|
+
|
|
1111
|
+
The datepicker supports localized month names through the `monthNames` property.
|
|
1112
|
+
|
|
1113
|
+
This example demonstrates how to set the `monthNames` property to Korean month names, with a Korean date format.
|
|
1114
|
+
|
|
1115
|
+
<div class="exampleWrapper">
|
|
1116
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization.html) -->
|
|
1117
|
+
<!-- The below content is automatically added from ./../apiExamples/localization.html -->
|
|
1118
|
+
<auro-datepicker format="yyyy/mm/dd" id="localizationExample">
|
|
1119
|
+
<span slot="bib.fullscreen.headline">Localization Headline</span>
|
|
1120
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1121
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1122
|
+
</auro-datepicker>
|
|
1123
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1124
|
+
</div>
|
|
1125
|
+
<auro-accordion alignRight>
|
|
1126
|
+
<span slot="trigger">See code</span>
|
|
1127
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/localization.html) -->
|
|
1128
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/localization.html -->
|
|
1129
|
+
|
|
1130
|
+
```html
|
|
1131
|
+
<auro-datepicker format="yyyy/mm/dd" id="localizationExample">
|
|
1132
|
+
<span slot="bib.fullscreen.headline">Localization Headline</span>
|
|
1133
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1134
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1135
|
+
</auro-datepicker>
|
|
1136
|
+
```
|
|
1137
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1138
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/localization.js) -->
|
|
1139
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/localization.js -->
|
|
1140
|
+
|
|
1141
|
+
```js
|
|
1142
|
+
export function localizationExample() {
|
|
1143
|
+
const localizedDatepicker = document.querySelector("#localizationExample");
|
|
1144
|
+
|
|
1145
|
+
localizedDatepicker.monthNames = ['일월', '이월', '삼월', '사월', '오월', '유월', '칠월', '팔월', '구월', '시월', '십일월', '십이월'];
|
|
1146
|
+
}
|
|
1147
|
+
```
|
|
1148
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1149
|
+
</auro-accordion>
|
|
1150
|
+
|
|
1151
|
+
#### Reset State
|
|
1152
|
+
|
|
1153
|
+
Use the `reset()` method to reset the `<auro-datepicker>`'s `value`, `valueEnd` and `validity` state. Doing so will preserve all other attributes and properties.
|
|
1154
|
+
|
|
1155
|
+
<div class="exampleWrapper">
|
|
1156
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/resetState.html) -->
|
|
1157
|
+
<!-- The below content is automatically added from ./../apiExamples/resetState.html -->
|
|
1158
|
+
<auro-datepicker id="resetStateExample" range minDate="06/30/2025" calendarStartDate="06/30/2025" calendarFocusDate="06/30/2025" value="02/14/2025" valueEnd="04/05/2025" setCustomValidityRangeUnderflow="The date you entered is too early.">
|
|
1159
|
+
<span slot="bib.fullscreen.headline">Reset Example</span>
|
|
1160
|
+
<span slot="fromLabel">Departure</span>
|
|
1161
|
+
<span slot="toLabel">Return</span>
|
|
1162
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1163
|
+
</auro-datepicker>
|
|
1164
|
+
<auro-button id="resetStateBtn">Reset</auro-button>
|
|
1165
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1166
|
+
</div>
|
|
1167
|
+
<auro-accordion alignRight>
|
|
1168
|
+
<span slot="trigger">See code</span>
|
|
1169
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/resetState.html) -->
|
|
1170
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/resetState.html -->
|
|
1171
|
+
|
|
1172
|
+
```html
|
|
1173
|
+
<auro-datepicker id="resetStateExample" range minDate="06/30/2025" calendarStartDate="06/30/2025" calendarFocusDate="06/30/2025" value="02/14/2025" valueEnd="04/05/2025" setCustomValidityRangeUnderflow="The date you entered is too early.">
|
|
1174
|
+
<span slot="bib.fullscreen.headline">Reset Example</span>
|
|
1175
|
+
<span slot="fromLabel">Departure</span>
|
|
1176
|
+
<span slot="toLabel">Return</span>
|
|
1177
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1178
|
+
</auro-datepicker>
|
|
1179
|
+
<auro-button id="resetStateBtn">Reset</auro-button>
|
|
1180
|
+
```
|
|
1181
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1182
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/resetState.js) -->
|
|
1183
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/resetState.js -->
|
|
1184
|
+
|
|
1185
|
+
```js
|
|
1186
|
+
export function resetStateExample() {
|
|
1187
|
+
const elem = document.querySelector('#resetStateExample');
|
|
1188
|
+
|
|
1189
|
+
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
1190
|
+
elem.reset();
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
```
|
|
1194
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1195
|
+
</auro-accordion>
|
|
1196
|
+
|
|
1197
|
+
#### Dynamic Slot Content
|
|
1198
|
+
|
|
1199
|
+
This example demonstrates data driven slot content for days in the calendar. In this example, the slot content is inserted into each `auro-calendar-cell` after the bib of the `auro-datepicker` is opened, simulating an API call on a dynamic data source.
|
|
1200
|
+
|
|
1201
|
+
<div class="exampleWrapper">
|
|
1202
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dynamicSlot.html) -->
|
|
1203
|
+
<!-- The below content is automatically added from ./../apiExamples/dynamicSlot.html -->
|
|
1204
|
+
<auro-datepicker id="slotContentExample" centralDate="12/13/2023" minDate="12/13/2023" maxDate="01/18/2024" range>
|
|
1205
|
+
<span slot="bib.fullscreen.headline">dynamic slot Example</span>
|
|
1206
|
+
<span slot="fromLabel">Departure</span>
|
|
1207
|
+
<span slot="toLabel">Return</span>
|
|
1208
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1209
|
+
</auro-datepicker>
|
|
1210
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1211
|
+
</div>
|
|
1212
|
+
<auro-accordion alignRight>
|
|
1213
|
+
<span slot="trigger">See code</span>
|
|
1214
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dynamicSlot.html) -->
|
|
1215
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/dynamicSlot.html -->
|
|
1216
|
+
|
|
1217
|
+
```html
|
|
1218
|
+
<auro-datepicker id="slotContentExample" centralDate="12/13/2023" minDate="12/13/2023" maxDate="01/18/2024" range>
|
|
1219
|
+
<span slot="bib.fullscreen.headline">dynamic slot Example</span>
|
|
1220
|
+
<span slot="fromLabel">Departure</span>
|
|
1221
|
+
<span slot="toLabel">Return</span>
|
|
1222
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1223
|
+
</auro-datepicker>
|
|
1224
|
+
```
|
|
1225
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1226
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dynamicSlot.js) -->
|
|
1227
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/dynamicSlot.js -->
|
|
1228
|
+
|
|
1229
|
+
```js
|
|
1230
|
+
export function populateSlotContentExample() {
|
|
1231
|
+
const populateSlotContentExample = document.querySelector('#slotContentExample');
|
|
1232
|
+
|
|
1233
|
+
// Insert slot content when the datepicker has been opened
|
|
1234
|
+
populateSlotContentExample.addEventListener('auroDatePicker-toggled', (event) => {
|
|
1235
|
+
if (event.detail.expanded) {
|
|
1236
|
+
// Array of object(s) containing key, value pairs defining what slot content to render
|
|
1237
|
+
const data = [
|
|
1238
|
+
{slot: 'date', month: 12, day: 1, year: 2023, content: 'Sold'},
|
|
1239
|
+
{slot: 'date', month: 12, day: 2, year: 2023, content: 'Sold'},
|
|
1240
|
+
{slot: 'date', month: 12, day: 3, year: 2023, content: 'Sold'},
|
|
1241
|
+
{slot: 'date', month: 12, day: 4, year: 2023, content: 'Sold'},
|
|
1242
|
+
{slot: 'date', month: 12, day: 5, year: 2023, content: 'Sold'},
|
|
1243
|
+
{slot: 'date', month: 12, day: 6, year: 2023, content: 'Sold'},
|
|
1244
|
+
{slot: 'date', month: 12, day: 7, year: 2023, content: 'Sold'},
|
|
1245
|
+
{slot: 'date', month: 12, day: 8, year: 2023, content: 'Sold'},
|
|
1246
|
+
{slot: 'date', month: 12, day: 9, year: 2023, content: 'Sold'},
|
|
1247
|
+
{slot: 'date', month: 12, day: 10, year: 2023, content: 'Sold'},
|
|
1248
|
+
{slot: 'date', month: 12, day: 11, year: 2023, content: 'Sold'},
|
|
1249
|
+
{slot: 'date', month: 12, day: 12, year: 2023, content: 'Sold'},
|
|
1250
|
+
{slot: 'date', month: 12, day: 13, year: 2023, content: '$560'},
|
|
1251
|
+
{slot: 'date', month: 12, day: 14, year: 2023, content: '$89', highlight: true},
|
|
1252
|
+
{slot: 'date', month: 12, day: 15, year: 2023, content: '$100'},
|
|
1253
|
+
{slot: 'date', month: 12, day: 16, year: 2023, content: '$2345'},
|
|
1254
|
+
{slot: 'date', month: 12, day: 17, year: 2023, content: '$2345'},
|
|
1255
|
+
{slot: 'date', month: 12, day: 18, year: 2023, content: '$2345'},
|
|
1256
|
+
{slot: 'date', month: 12, day: 19, year: 2023, content: '$2345'},
|
|
1257
|
+
{slot: 'date', month: 12, day: 20, year: 2023, content: '$2345'},
|
|
1258
|
+
{slot: 'date', month: 12, day: 21, year: 2023, content: '$2345'},
|
|
1259
|
+
{slot: 'date', month: 12, day: 22, year: 2023, content: '$2345'},
|
|
1260
|
+
{slot: 'date', month: 12, day: 23, year: 2023, content: '$2345'},
|
|
1261
|
+
{slot: 'date', month: 12, day: 24, year: 2023, content: '$2345'},
|
|
1262
|
+
{slot: 'date', month: 12, day: 25, year: 2023, content: '$2345'},
|
|
1263
|
+
{slot: 'date', month: 12, day: 26, year: 2023, content: '$2345'},
|
|
1264
|
+
{slot: 'date', month: 12, day: 27, year: 2023, content: '$2345'},
|
|
1265
|
+
{slot: 'date', month: 12, day: 28, year: 2023, content: '$2345'},
|
|
1266
|
+
{slot: 'date', month: 12, day: 29, year: 2023, content: '$2345'},
|
|
1267
|
+
{slot: 'date', month: 12, day: 30, year: 2023, content: '$2345'},
|
|
1268
|
+
{slot: 'date', month: 12, day: 31, year: 2023, content: '$2345'},
|
|
1269
|
+
{slot: 'date', month: 1, day: 14, year: 2024, content: '$83', highlight: true},
|
|
1270
|
+
{slot: 'date', month: 1, day: 15, year: 2024, content: '$203'},
|
|
1271
|
+
{slot: 'date', month: 1, day: 16, year: 2024, content: '$4444'},
|
|
1272
|
+
{slot: 'date', month: 1, day: 17, year: 2024, content: '$83', highlight: true},
|
|
1273
|
+
{slot: 'date', month: 1, day: 18, year: 2024, content: '$96', highlight: true},
|
|
1274
|
+
{slot: 'date', month: 1, day: 19, year: 2024, content: 'Sold'},
|
|
1275
|
+
{slot: 'date', month: 1, day: 20, year: 2024, content: 'Sold'},
|
|
1276
|
+
{slot: 'popover', month: 12, day: 1, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1277
|
+
{slot: 'popover', month: 12, day: 2, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1278
|
+
{slot: 'popover', month: 12, day: 3, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1279
|
+
{slot: 'popover', month: 12, day: 4, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1280
|
+
{slot: 'popover', month: 12, day: 5, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1281
|
+
{slot: 'popover', month: 12, day: 6, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1282
|
+
{slot: 'popover', month: 12, day: 7, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1283
|
+
{slot: 'popover', month: 12, day: 8, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1284
|
+
{slot: 'popover', month: 12, day: 9, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1285
|
+
{slot: 'popover', month: 12, day: 10, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1286
|
+
{slot: 'popover', month: 12, day: 11, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1287
|
+
{slot: 'popover', month: 12, day: 12, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1288
|
+
{slot: 'popover', month: 12, day: 13, year: 2023, content: 'Tickets for this date are $560'},
|
|
1289
|
+
{slot: 'popover', month: 12, day: 14, year: 2023, content: 'Tickets for this date are $89'},
|
|
1290
|
+
{slot: 'popover', month: 12, day: 15, year: 2023, content: 'Tickets for this date are $100'},
|
|
1291
|
+
{slot: 'popover', month: 12, day: 16, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1292
|
+
{slot: 'popover', month: 12, day: 17, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1293
|
+
{slot: 'popover', month: 12, day: 18, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1294
|
+
{slot: 'popover', month: 12, day: 19, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1295
|
+
{slot: 'popover', month: 12, day: 20, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1296
|
+
{slot: 'popover', month: 12, day: 21, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1297
|
+
{slot: 'popover', month: 12, day: 22, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1298
|
+
{slot: 'popover', month: 12, day: 23, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1299
|
+
{slot: 'popover', month: 12, day: 24, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1300
|
+
{slot: 'popover', month: 12, day: 25, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1301
|
+
{slot: 'popover', month: 12, day: 26, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1302
|
+
{slot: 'popover', month: 12, day: 27, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1303
|
+
{slot: 'popover', month: 12, day: 28, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1304
|
+
{slot: 'popover', month: 12, day: 29, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1305
|
+
{slot: 'popover', month: 12, day: 30, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1306
|
+
{slot: 'popover', month: 12, day: 31, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1307
|
+
{slot: 'popover', month: 1, day: 14, year: 2024, content: 'Tickets for this date are $83'},
|
|
1308
|
+
{slot: 'popover', month: 1, day: 15, year: 2024, content: 'Tickets for this date are $203'},
|
|
1309
|
+
{slot: 'popover', month: 1, day: 16, year: 2024, content: 'Tickets for this date are $4444'},
|
|
1310
|
+
{slot: 'popover', month: 1, day: 17, year: 2024, content: 'Tickets for this date are $83'},
|
|
1311
|
+
{slot: 'popover', month: 1, day: 18, year: 2024, content: 'Tickets for this date are $96'},
|
|
1312
|
+
{slot: 'popover', month: 1, day: 19, year: 2024, content: 'Tickets for this date are sold out'},
|
|
1313
|
+
{slot: 'popover', month: 1, day: 20, year: 2024, content: 'Tickets for this date are sold out'}
|
|
1314
|
+
];
|
|
1315
|
+
|
|
1316
|
+
// For each item in the array, parse the keys into an HTML element and insert it into the DOM
|
|
1317
|
+
data.forEach((item) => {
|
|
1318
|
+
// Create the new element for the slot content
|
|
1319
|
+
const slotElement = document.createElement('span');
|
|
1320
|
+
|
|
1321
|
+
if (item.month.toString().length === 1) {
|
|
1322
|
+
item.month = `0` + item.month;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
if (item.day.toString().length === 1) {
|
|
1326
|
+
item.day = `0` + item.day;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
// Create the slot name from the item's keys
|
|
1330
|
+
const slotName = `${item.slot}_${item.month}_${item.day}_${item.year}`;
|
|
1331
|
+
|
|
1332
|
+
// Set the slot name and content
|
|
1333
|
+
slotElement.setAttribute('slot', slotName);
|
|
1334
|
+
slotElement.textContent = item.content;
|
|
1335
|
+
|
|
1336
|
+
// Set the 'highlight' attribute on date slot content
|
|
1337
|
+
if (item.slot === 'date' && item.highlight) {
|
|
1338
|
+
slotElement.setAttribute('highlight', item.highlight);
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
// Append the new element to the DOM
|
|
1342
|
+
populateSlotContentExample.appendChild(slotElement);
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
populateSlotContentExample.pushSlotContent();
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
```
|
|
1350
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1351
|
+
</auro-accordion>
|
|
1352
|
+
|
|
1353
|
+
### Watch for value changes
|
|
1354
|
+
|
|
1355
|
+
The following example listens for the `auroDatePicker-valueSet` event. Once triggered, `element.value` may be queried for the new value **and** in successful scenarios, an alert will appear. Open the JavaScript console in the browser's developer tools to see the `console.warn` message that appears after the `auroDatePicker-valueSet` event has been triggered.
|
|
1356
|
+
|
|
1357
|
+
<div class="exampleWrapper">
|
|
1358
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/alertValue.html) -->
|
|
1359
|
+
<!-- The below content is automatically added from ./../apiExamples/alertValue.html -->
|
|
1360
|
+
<auro-datepicker id="datePickerValueAlert">
|
|
1361
|
+
<span slot="bib.fullscreen.headline">Alert Value Example</span>
|
|
1362
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1363
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1364
|
+
</auro-datepicker>
|
|
1365
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1366
|
+
</div>
|
|
1367
|
+
<auro-accordion alignRight>
|
|
1368
|
+
<span slot="trigger">See code</span>
|
|
1369
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/alertValue.html) -->
|
|
1370
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/alertValue.html -->
|
|
1371
|
+
|
|
1372
|
+
```html
|
|
1373
|
+
<auro-datepicker id="datePickerValueAlert">
|
|
1374
|
+
<span slot="bib.fullscreen.headline">Alert Value Example</span>
|
|
1375
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1376
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1377
|
+
</auro-datepicker>
|
|
1378
|
+
```
|
|
1379
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1380
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/alertValue.js) -->
|
|
1381
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/alertValue.js -->
|
|
1382
|
+
|
|
1383
|
+
```js
|
|
1384
|
+
export function alertValueExample() {
|
|
1385
|
+
const valueAlertExample = document.querySelector('#datePickerValueAlert');
|
|
1386
|
+
|
|
1387
|
+
valueAlertExample.addEventListener('auroDatePicker-valueSet', () => {
|
|
1388
|
+
console.warn('Select value changed to:', valueAlertExample.value);
|
|
1389
|
+
alert(`Select value changed to: ${valueAlertExample.value}`);
|
|
1390
|
+
})
|
|
1391
|
+
}
|
|
1392
|
+
```
|
|
1393
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1394
|
+
</auro-accordion>
|
|
1395
|
+
|
|
1396
|
+
#### in Dialog
|
|
1397
|
+
|
|
1398
|
+
The component can be in a dialog.
|
|
1399
|
+
|
|
1400
|
+
<div class="exampleWrapper">
|
|
1401
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inDialog.html) -->
|
|
1402
|
+
<!-- The below content is automatically added from ./../apiExamples/inDialog.html -->
|
|
1403
|
+
<div>
|
|
1404
|
+
<auro-button id="datepicker-dialog-opener">Datepicker in Dialog</auro-button>
|
|
1405
|
+
<auro-dialog id="datepicker-dialog">
|
|
1406
|
+
<span slot="bib.fullscreen.headline">inDialog Example</span>
|
|
1407
|
+
<span slot="header">Datepicker in Dialog</span>
|
|
1408
|
+
<div slot="content">
|
|
1409
|
+
<auro-datepicker />
|
|
1410
|
+
</div>
|
|
1411
|
+
</auro-dialog>
|
|
1412
|
+
</div>
|
|
1413
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1414
|
+
</div>
|
|
1415
|
+
<auro-accordion alignRight>
|
|
1416
|
+
<span slot="trigger">See code</span>
|
|
1417
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/inDialog.html) -->
|
|
1418
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/inDialog.html -->
|
|
1419
|
+
|
|
1420
|
+
```html
|
|
1421
|
+
<div>
|
|
1422
|
+
<auro-button id="datepicker-dialog-opener">Datepicker in Dialog</auro-button>
|
|
1423
|
+
<auro-dialog id="datepicker-dialog">
|
|
1424
|
+
<span slot="bib.fullscreen.headline">inDialog Example</span>
|
|
1425
|
+
<span slot="header">Datepicker in Dialog</span>
|
|
1426
|
+
<div slot="content">
|
|
1427
|
+
<auro-datepicker />
|
|
1428
|
+
</div>
|
|
1429
|
+
</auro-dialog>
|
|
1430
|
+
</div>
|
|
1431
|
+
```
|
|
1432
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1433
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/inDialog.js) -->
|
|
1434
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/inDialog.js -->
|
|
1435
|
+
|
|
1436
|
+
```js
|
|
1437
|
+
export function inDialogExample() {
|
|
1438
|
+
document.querySelector("#datepicker-dialog-opener").addEventListener("click", () => {
|
|
1439
|
+
const dialog = document.querySelector("#datepicker-dialog");
|
|
1440
|
+
dialog.open = true;
|
|
1441
|
+
});
|
|
1442
|
+
};
|
|
1443
|
+
```
|
|
1444
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1445
|
+
</auro-accordion>
|
|
1446
|
+
|
|
1447
|
+
### Theme Support
|
|
1448
|
+
|
|
1449
|
+
The component may be restyled using the following code sample and changing the values of the following token(s).
|
|
1450
|
+
|
|
1451
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
1452
|
+
<!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
|
|
1453
|
+
|
|
1454
|
+
```scss
|
|
1455
|
+
/* stylelint-disable color-function-notation */
|
|
1456
|
+
|
|
1457
|
+
@import "@aurodesignsystem/design-tokens/dist/alaska/SCSSVariables--alaska";
|
|
1458
|
+
@import "@aurodesignsystem/design-tokens/dist/auro-classic/SCSSVariables";
|
|
1459
|
+
|
|
1460
|
+
:host {
|
|
1461
|
+
--ds-auro-datepicker-placeholder-color: var(--ds-basic-color-texticon-default, #{$ds-basic-color-texticon-default});
|
|
1462
|
+
--ds-auro-datepicker-range-input-divider-color: var(--ds-basic-color-border-bold, #{$ds-basic-color-border-bold});
|
|
1463
|
+
--ds-auro-calendar-mobile-header-container-color: var(--ds-basic-color-surface-default, #{$ds-basic-color-surface-default});
|
|
1464
|
+
--ds-auro-calendar-mobile-header-divider-color: var(--ds-basic-color-border-divider, #{$ds-basic-color-border-divider});
|
|
1465
|
+
--ds-auro-calendar-mobile-header-text-color: var(--ds-basic-color-texticon-muted, #{$ds-basic-color-texticon-muted});
|
|
1466
|
+
--ds-auro-calendar-nav-btn-border-color: transparent;
|
|
1467
|
+
--ds-auro-calendar-nav-btn-chevron-color: var(--ds-basic-color-brand-primary, #{$ds-basic-color-brand-primary});
|
|
1468
|
+
--ds-auro-calendar-nav-btn-container-color: transparent;
|
|
1469
|
+
--ds-auro-calendar-month-container-color: var(--ds-basic-color-surface-default, #{$ds-basic-color-surface-default});
|
|
1470
|
+
--ds-auro-calendar-month-divider-color: var(--ds-basic-color-border-divider, #{$ds-basic-color-border-divider});
|
|
1471
|
+
--ds-auro-calendar-month-header-color: var(--ds-basic-color-texticon-default, #{$ds-basic-color-texticon-default});
|
|
1472
|
+
--ds-auro-calendar-cell-border-color: transparent;
|
|
1473
|
+
--ds-auro-calendar-cell-container-color: transparent;
|
|
1474
|
+
--ds-auro-calendar-cell-in-range-color: var(--ds-advanced-color-shared-background-muted, #{$ds-advanced-color-shared-background-muted});
|
|
1475
|
+
--ds-auro-calendar-cell-price-text-color: var(--ds-basic-color-texticon-default, #{$ds-basic-color-texticon-default});
|
|
1476
|
+
--ds-auro-calendar-cell-text-color: var(--ds-basic-color-texticon-default, #{$ds-basic-color-texticon-default});
|
|
1477
|
+
}
|
|
1478
|
+
```
|
|
1479
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|