@aurodesignsystem/auro-formkit 5.9.0 → 5.9.2
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 +13 -4
- package/README.md +4 -4
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +2 -2
- package/components/bibtemplate/dist/registered.js +2 -2
- package/components/checkbox/README.md +62 -62
- package/components/checkbox/demo/api.js +1 -1
- package/components/checkbox/demo/api.md +127 -84
- package/components/checkbox/demo/api.min.js +125 -42
- package/components/checkbox/demo/index.md +9 -281
- package/components/checkbox/demo/index.min.js +125 -42
- package/components/checkbox/demo/readme.html +3 -4
- package/components/checkbox/demo/readme.md +62 -62
- package/components/checkbox/dist/auro-checkbox-group.d.ts +7 -8
- package/components/checkbox/dist/auro-checkbox.d.ts +74 -20
- package/components/checkbox/dist/index.js +125 -42
- package/components/checkbox/dist/registered.js +125 -42
- package/components/combobox/README.md +76 -74
- package/components/combobox/demo/api.html +1 -0
- package/components/combobox/demo/api.js +11 -12
- package/components/combobox/demo/api.md +1302 -875
- package/components/combobox/demo/api.min.js +416 -492
- package/components/combobox/demo/index.html +1 -7
- package/components/combobox/demo/index.js +0 -19
- package/components/combobox/demo/index.md +43 -723
- package/components/combobox/demo/index.min.js +369 -302
- package/components/combobox/demo/readme.html +3 -4
- package/components/combobox/demo/readme.md +76 -74
- package/components/combobox/dist/auro-combobox.d.ts +42 -42
- package/components/combobox/dist/index.js +204 -210
- package/components/combobox/dist/registered.js +204 -210
- package/components/counter/README.md +81 -66
- package/components/counter/demo/api.html +1 -2
- package/components/counter/demo/api.js +2 -2
- package/components/counter/demo/api.md +777 -259
- package/components/counter/demo/api.min.js +119 -171
- package/components/counter/demo/index.html +0 -2
- package/components/counter/demo/index.md +20 -329
- package/components/counter/demo/index.min.js +117 -152
- package/components/counter/demo/readme.html +3 -4
- package/components/counter/demo/readme.md +81 -66
- package/components/counter/dist/auro-counter-group.d.ts +21 -36
- package/components/counter/dist/auro-counter-wrapper.d.ts +1 -6
- package/components/counter/dist/auro-counter.d.ts +5 -8
- package/components/counter/dist/index.js +117 -152
- package/components/counter/dist/registered.js +117 -152
- package/components/datepicker/README.md +57 -61
- package/components/datepicker/demo/api.js +8 -8
- package/components/datepicker/demo/api.md +720 -561
- package/components/datepicker/demo/api.min.js +678 -2769
- package/components/datepicker/demo/index.md +65 -117
- package/components/datepicker/demo/index.min.js +678 -2769
- package/components/datepicker/demo/readme.html +3 -4
- package/components/datepicker/demo/readme.md +57 -61
- package/components/datepicker/dist/auro-calendar.d.ts +60 -34
- package/components/datepicker/dist/auro-datepicker.d.ts +32 -32
- package/components/datepicker/dist/iconVersion.d.ts +1 -1
- package/components/datepicker/dist/index.js +505 -2596
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +505 -2596
- package/components/dropdown/README.md +78 -62
- package/components/dropdown/demo/api.js +4 -4
- package/components/dropdown/demo/api.md +520 -478
- package/components/dropdown/demo/api.min.js +80 -95
- package/components/dropdown/demo/index.md +65 -119
- package/components/dropdown/demo/index.min.js +70 -85
- package/components/dropdown/demo/readme.html +3 -4
- package/components/dropdown/demo/readme.md +78 -62
- package/components/dropdown/dist/auro-dropdown.d.ts +42 -33
- package/components/dropdown/dist/iconVersion.d.ts +1 -1
- package/components/dropdown/dist/index.js +70 -85
- package/components/dropdown/dist/registered.js +70 -85
- package/components/form/README.md +16 -58
- package/components/form/demo/api.md +16 -21
- package/components/form/demo/api.min.js +13 -8
- package/components/form/demo/index.md +38 -39
- package/components/form/demo/index.min.js +13 -8
- package/components/form/demo/readme.md +16 -58
- package/components/form/demo/working.html +1 -1
- package/components/form/dist/auro-form.d.ts +15 -3
- package/components/form/dist/index.js +13 -8
- package/components/form/dist/registered.js +13 -8
- package/components/input/README.md +55 -60
- package/components/input/demo/api.js +3 -5
- package/components/input/demo/api.md +558 -537
- package/components/input/demo/api.min.js +102 -115
- package/components/input/demo/index.js +0 -1
- package/components/input/demo/index.md +90 -203
- package/components/input/demo/index.min.js +87 -99
- package/components/input/demo/readme.html +3 -4
- package/components/input/demo/readme.md +55 -60
- package/components/input/dist/auro-input.d.ts +6 -5
- package/components/input/dist/base-input.d.ts +68 -69
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +87 -82
- package/components/input/dist/registered.js +87 -82
- package/components/menu/README.md +61 -61
- package/components/menu/demo/api.js +6 -8
- package/components/menu/demo/api.md +520 -577
- package/components/menu/demo/api.min.js +199 -97
- package/components/menu/demo/index.js +0 -5
- package/components/menu/demo/index.md +36 -119
- package/components/menu/demo/index.min.js +164 -101
- package/components/menu/demo/readme.html +3 -4
- package/components/menu/demo/readme.md +61 -61
- package/components/menu/dist/auro-menu.context.d.ts +5 -0
- package/components/menu/dist/auro-menu.d.ts +75 -37
- package/components/menu/dist/auro-menuoption.d.ts +38 -13
- package/components/menu/dist/index.js +164 -50
- package/components/menu/dist/registered.js +164 -50
- package/components/radio/README.md +61 -57
- package/components/radio/demo/api.js +2 -2
- package/components/radio/demo/api.md +241 -170
- package/components/radio/demo/api.min.js +154 -77
- package/components/radio/demo/index.md +22 -99
- package/components/radio/demo/index.min.js +145 -68
- package/components/radio/demo/readme.html +3 -4
- package/components/radio/demo/readme.md +61 -57
- package/components/radio/dist/auro-radio-group.d.ts +67 -35
- package/components/radio/dist/auro-radio.d.ts +56 -33
- package/components/radio/dist/index.js +145 -68
- package/components/radio/dist/registered.js +145 -68
- package/components/select/README.md +68 -65
- package/components/select/demo/api.html +1 -0
- package/components/select/demo/api.js +7 -7
- package/components/select/demo/api.md +1305 -625
- package/components/select/demo/api.min.js +357 -262
- package/components/select/demo/index.html +0 -2
- package/components/select/demo/index.md +25 -833
- package/components/select/demo/index.min.js +356 -230
- package/components/select/demo/readme.html +3 -4
- package/components/select/demo/readme.md +68 -65
- package/components/select/dist/auro-select.d.ts +99 -90
- package/components/select/dist/index.js +192 -180
- package/components/select/dist/registered.js +192 -180
- package/package.json +9 -4
|
@@ -1,54 +1,55 @@
|
|
|
1
1
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/api.md) -->
|
|
2
2
|
<!-- The below content is automatically added from ./../docs/api.md -->
|
|
3
3
|
|
|
4
|
-
# auro-datepicker
|
|
4
|
+
# auro-datepicker
|
|
5
|
+
|
|
6
|
+
The `auro-datepicker` component provides users with a way to select a date or date range from a calendar popup or fullscreen calendar on mobile.
|
|
5
7
|
|
|
6
8
|
## Properties
|
|
7
9
|
|
|
8
|
-
| Property
|
|
9
|
-
|
|
10
|
-
| [appearance](#appearance)
|
|
11
|
-
| [autoPlacement](#autoPlacement)
|
|
12
|
-
| [calendarEndDate](#calendarEndDate)
|
|
13
|
-
| [calendarFocusDate](#calendarFocusDate)
|
|
14
|
-
| [calendarStartDate](#calendarStartDate)
|
|
15
|
-
| [centralDate](#centralDate)
|
|
16
|
-
| [
|
|
17
|
-
| [
|
|
18
|
-
| [
|
|
19
|
-
| [
|
|
20
|
-
| [
|
|
21
|
-
| [
|
|
22
|
-
| [
|
|
23
|
-
| [
|
|
24
|
-
| [
|
|
25
|
-
| [
|
|
26
|
-
| [
|
|
27
|
-
| [
|
|
28
|
-
| [
|
|
29
|
-
| [
|
|
30
|
-
| [
|
|
31
|
-
| [
|
|
32
|
-
| [
|
|
33
|
-
| [
|
|
34
|
-
| [
|
|
35
|
-
| [
|
|
36
|
-
| [
|
|
37
|
-
| [
|
|
38
|
-
| [
|
|
39
|
-
| [
|
|
40
|
-
| [
|
|
41
|
-
| [
|
|
42
|
-
| [
|
|
43
|
-
| [
|
|
44
|
-
| [
|
|
45
|
-
| [
|
|
46
|
-
| [
|
|
47
|
-
| [
|
|
48
|
-
| [
|
|
49
|
-
| [
|
|
50
|
-
| [
|
|
51
|
-
| [values](#values) | | readonly | `string[]` | | A convenience wrapper for `value` and `valueEnd`, uses the new Auro "array value pattern". |
|
|
10
|
+
| Property | Attribute | Modifiers | Type | Default | Description |
|
|
11
|
+
|-----------------------------------|-----------------------------------|-----------|--------------------------------------------------|--------------------------------------------------|--------------------------------------------------|
|
|
12
|
+
| [appearance](#appearance) | `appearance` | | `string` | "'default'" | Defines whether the component will be on lighter or darker backgrounds. |
|
|
13
|
+
| [autoPlacement](#autoPlacement) | `autoPlacement` | | `boolean` | "false" | If declared, bib's position will be automatically calculated where to appear. |
|
|
14
|
+
| [calendarEndDate](#calendarEndDate) | `calendarEndDate` | | `string` | "undefined" | The last date that may be displayed in the calendar. |
|
|
15
|
+
| [calendarFocusDate](#calendarFocusDate) | `calendarFocusDate` | | `string` | "value" | The date that will first be visually rendered to the user in the calendar. |
|
|
16
|
+
| [calendarStartDate](#calendarStartDate) | `calendarStartDate` | | `string` | "undefined" | The first date that may be displayed in the calendar. |
|
|
17
|
+
| [centralDate](#centralDate) | `centralDate` | | `string` | | The date that determines the currently visible month. |
|
|
18
|
+
| [disabled](#disabled) | `disabled` | | `boolean` | false | If set, disables the datepicker. |
|
|
19
|
+
| [dvInputOnly](#dvInputOnly) | `dvInputOnly` | | `boolean` | false | If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked. |
|
|
20
|
+
| [error](#error) | `error` | | `string` | | When defined, sets persistent validity to `customError` and sets the validation message to the attribute value. |
|
|
21
|
+
| [format](#format) | `format` | | `string` | "mm/dd/yyyy" | Specifies the date format. The default is `mm/dd/yyyy`. |
|
|
22
|
+
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'disabled'` | "'sm'" | Defines the screen size breakpoint 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. |
|
|
23
|
+
| [hasError](#hasError) | | readonly | `boolean` | | |
|
|
24
|
+
| [inputmode](#inputmode) | `inputmode` | | `string` | | Exposes inputmode attribute for input. |
|
|
25
|
+
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | | `boolean` | false | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600. |
|
|
26
|
+
| [layout](#layout) | `layout` | | `'classic' \| 'snowflake'` | "'classic'" | Sets the layout of the datepicker. |
|
|
27
|
+
| [maxDate](#maxDate) | `maxDate` | | `string` | | Maximum date. All dates after will be disabled. |
|
|
28
|
+
| [minDate](#minDate) | `minDate` | | `string` | | Minimum date. All dates before will be disabled. |
|
|
29
|
+
| [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. |
|
|
30
|
+
| [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`. |
|
|
31
|
+
| [noValidate](#noValidate) | `noValidate` | | `boolean` | false | If set, disables auto-validation on blur. |
|
|
32
|
+
| [offset](#offset) | `offset` | | `number` | "0" | Gap between the trigger element and bib. |
|
|
33
|
+
| [onDark](#onDark) | `onDark` | | `boolean` | false | DEPRECATED - use `appearance="inverse"` instead. |
|
|
34
|
+
| [placeholder](#placeholder) | `placeholder` | | `string` | | Placeholder text to display in the input(s) when no value is set. |
|
|
35
|
+
| [placeholderEndDate](#placeholderEndDate) | `placeholderEndDate` | | `string` | | Optional placeholder text to display in the second input when using date range.<br />By default, datepicker will use `placeholder` for both inputs if placeholder is<br />specified, but placeholderendDate is not. |
|
|
36
|
+
| [placement](#placement) | `placement` | | `'top' \| 'right' \| 'bottom' \| 'left' \| 'bottom-start' \| 'top-start' \| 'top-end' \| 'right-start' \| 'right-end' \| 'bottom-end' \| 'left-start' \| 'left-end'` | "'bottom-start'" | Position where the bib should appear relative to the trigger. |
|
|
37
|
+
| [range](#range) | `range` | | `boolean` | false | If set, turns on date range functionality in auro-calendar. |
|
|
38
|
+
| [referenceDates](#referenceDates) | `referenceDates` | | `array` | | Dates that the user should have for reference as part of their decision making when selecting a date.<br />This should be a JSON string array of dates in the format of `MM-DD-YYYY`. |
|
|
39
|
+
| [required](#required) | `required` | | `boolean` | false | Populates the `required` attribute on the input. Used for client-side validation. |
|
|
40
|
+
| [setCustomValidity](#setCustomValidity) | `setCustomValidity` | | `string` | | Sets a custom help text message to display for all validityStates. |
|
|
41
|
+
| [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | | `string` | | Custom help text message to display when validity = `customError`. |
|
|
42
|
+
| [setCustomValidityRangeOverflow](#setCustomValidityRangeOverflow) | `setCustomValidityRangeOverflow` | | `string` | | Custom help text message to display when validity = `rangeOverflow`. |
|
|
43
|
+
| [setCustomValidityRangeUnderflow](#setCustomValidityRangeUnderflow) | `setCustomValidityRangeUnderflow` | | `string` | | Custom help text message to display when validity = `rangeUnderflow`. |
|
|
44
|
+
| [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | | `string` | | Custom help text message to display when validity = `valueMissing`. |
|
|
45
|
+
| [shape](#shape) | | | `string` | "classic" | |
|
|
46
|
+
| [shift](#shift) | `shift` | | `boolean` | false | If declared, the dropdown will shift its position to avoid being cut off by the viewport. |
|
|
47
|
+
| [size](#size) | | | `string` | "lg" | |
|
|
48
|
+
| [stacked](#stacked) | `stacked` | | `boolean` | false | Set true to make datepicker stacked style. |
|
|
49
|
+
| [validity](#validity) | `validity` | | `string` | "undefined" | Specifies the `validityState` this element is in. |
|
|
50
|
+
| [value](#value) | `value` | | `string` | "undefined" | Value selected for the datepicker. |
|
|
51
|
+
| [valueEnd](#valueEnd) | `valueEnd` | | `string` | "undefined" | Value selected for the second datepicker when using date range. |
|
|
52
|
+
| [values](#values) | | readonly | `string[]` | | A convenience wrapper for `value` and `valueEnd`, uses the new Auro "array value pattern". |
|
|
52
53
|
|
|
53
54
|
## Methods
|
|
54
55
|
|
|
@@ -85,7 +86,8 @@
|
|
|
85
86
|
| `bib.fullscreen.headline` | Defines the headline to display above bib.fullscreen.dateLabels in the mobile layout. |
|
|
86
87
|
| `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. |
|
|
87
88
|
| [fromLabel](#fromLabel) | Defines the label content for the first input. |
|
|
88
|
-
| [helpText](#helpText) | Defines the content of the helpText. |
|
|
89
|
+
| [helpText](#helpText) | Defines the content of the helpText. |
|
|
90
|
+
| [label](#label) | Defines the label content for the entire datepicker when `layout="snowflake"`. |
|
|
89
91
|
| `popover_MM_DD_YYYY` | Defines the content to display in the auro-calendar-cell popover for the specified date. |
|
|
90
92
|
| [toLabel](#toLabel) | Defines the label content for the second input when the `range` attribute is used. |
|
|
91
93
|
|
|
@@ -102,14 +104,12 @@
|
|
|
102
104
|
| [trigger](#trigger) | Use for customizing the style of the datepicker trigger. |
|
|
103
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
104
106
|
|
|
105
|
-
##
|
|
106
|
-
|
|
107
|
-
### Basic
|
|
107
|
+
## Basic
|
|
108
108
|
|
|
109
109
|
<div class="exampleWrapper">
|
|
110
110
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
111
111
|
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
112
|
-
<auro-datepicker
|
|
112
|
+
<auro-datepicker>
|
|
113
113
|
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
114
114
|
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
115
115
|
<span slot="fromLabel">Choose a date</span>
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
124
124
|
|
|
125
125
|
```html
|
|
126
|
-
<auro-datepicker
|
|
126
|
+
<auro-datepicker>
|
|
127
127
|
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
128
128
|
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
129
129
|
<span slot="fromLabel">Choose a date</span>
|
|
@@ -133,14 +133,14 @@
|
|
|
133
133
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
134
134
|
</auro-accordion>
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
## Range
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
The datepicker can also be used to select a range between two dates by adding the `range` attribute.
|
|
139
139
|
|
|
140
140
|
<div class="exampleWrapper">
|
|
141
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
142
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
143
|
-
<auro-datepicker range
|
|
141
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/range.html) -->
|
|
142
|
+
<!-- The below content is automatically added from ./../apiExamples/range.html -->
|
|
143
|
+
<auro-datepicker range>
|
|
144
144
|
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
145
145
|
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
146
146
|
<span slot="fromLabel">Departure</span>
|
|
@@ -148,14 +148,14 @@ When used, the datepicker will display two inputs and the component will support
|
|
|
148
148
|
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
149
149
|
</auro-datepicker>
|
|
150
150
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
151
|
-
</div>
|
|
151
|
+
</div>
|
|
152
152
|
<auro-accordion alignRight>
|
|
153
153
|
<span slot="trigger">See code</span>
|
|
154
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
155
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
154
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/range.html) -->
|
|
155
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/range.html -->
|
|
156
156
|
|
|
157
157
|
```html
|
|
158
|
-
<auro-datepicker range
|
|
158
|
+
<auro-datepicker range>
|
|
159
159
|
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
160
160
|
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
161
161
|
<span slot="fromLabel">Departure</span>
|
|
@@ -166,11 +166,250 @@ When used, the datepicker will display two inputs and the component will support
|
|
|
166
166
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
167
167
|
</auro-accordion>
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
## Property & Attribute Examples
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
### Appearance on Dark Backgrounds
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
Use `appearance="inverse"` to display the datepicker on dark backgrounds.
|
|
174
|
+
|
|
175
|
+
<div class="exampleWrapper--ondark">
|
|
176
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse.html) -->
|
|
177
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
178
|
+
<auro-datepicker appearance="inverse">
|
|
179
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
180
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
181
|
+
<span slot="fromLabel">Choose a date</span>
|
|
182
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
183
|
+
</auro-datepicker>
|
|
184
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
185
|
+
</div>
|
|
186
|
+
<auro-accordion alignRight>
|
|
187
|
+
<span slot="trigger">See code</span>
|
|
188
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse.html) -->
|
|
189
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
190
|
+
|
|
191
|
+
```html
|
|
192
|
+
<auro-datepicker appearance="inverse">
|
|
193
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
194
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
195
|
+
<span slot="fromLabel">Choose a date</span>
|
|
196
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
197
|
+
</auro-datepicker>
|
|
198
|
+
```
|
|
199
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
200
|
+
</auro-accordion>
|
|
201
|
+
<div class="exampleWrapper--ondark">
|
|
202
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-range.html) -->
|
|
203
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse-range.html -->
|
|
204
|
+
<auro-datepicker appearance="inverse" range>
|
|
205
|
+
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
206
|
+
<span slot="fromLabel">Departure</span>
|
|
207
|
+
<span slot="toLabel">Return</span>
|
|
208
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
209
|
+
</auro-datepicker>
|
|
210
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
211
|
+
</div>
|
|
212
|
+
<auro-accordion alignRight>
|
|
213
|
+
<span slot="trigger">See code</span>
|
|
214
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse-range.html) -->
|
|
215
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse-range.html -->
|
|
216
|
+
|
|
217
|
+
```html
|
|
218
|
+
<auro-datepicker appearance="inverse" range>
|
|
219
|
+
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
220
|
+
<span slot="fromLabel">Departure</span>
|
|
221
|
+
<span slot="toLabel">Return</span>
|
|
222
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
223
|
+
</auro-datepicker>
|
|
224
|
+
```
|
|
225
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
226
|
+
</auro-accordion>
|
|
227
|
+
|
|
228
|
+
### Customized Bib Position
|
|
229
|
+
|
|
230
|
+
The bib position can be customized with `placement`, `offset`, `flip`, `autoPlacement`, and `shift` attributes.
|
|
231
|
+
|
|
232
|
+
- `placement` specifies the preferred position where the bib should appear relative to the trigger.
|
|
233
|
+
- `offset` sets the distance between the trigger and the bib.
|
|
234
|
+
- 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`.
|
|
235
|
+
- Unless `noFlip` is enabled, if there isn't enough space for the preferred `placement`, the bib will automatically flip to an alternative position.
|
|
236
|
+
- `shift` when enabled, adjusts the bib position when it would overflow the viewport boundaries, ensuring it remains visible.
|
|
237
|
+
|
|
238
|
+
<div class="exampleWrapper">
|
|
239
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/floater-config.html) -->
|
|
240
|
+
<!-- The below content is automatically added from ./../apiExamples/floater-config.html -->
|
|
241
|
+
<div style="width: 400px">
|
|
242
|
+
<auro-datepicker offset="20" placement="bottom-start" noFlip>
|
|
243
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
244
|
+
<span slot="fromLabel">bottom-start with 20px offset and noFlip</span>
|
|
245
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
246
|
+
</auro-datepicker>
|
|
247
|
+
<br/>
|
|
248
|
+
<auro-datepicker offset="20" placement="bottom-start">
|
|
249
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
250
|
+
<span slot="fromLabel">bottom-start with 20px offset and flip</span>
|
|
251
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
252
|
+
</auro-datepicker>
|
|
253
|
+
<br/>
|
|
254
|
+
<auro-datepicker offset="20" placement="right" autoPlacement noFlip>
|
|
255
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
256
|
+
<span slot="fromLabel">right with 20px offset, noFlip and autoPlacement</span>
|
|
257
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
258
|
+
</auro-datepicker>
|
|
259
|
+
</div>
|
|
260
|
+
<div style="width: 600px; padding-top: 1em;">
|
|
261
|
+
<p>Range bottom-start with 20px offset, noFlip and shift enabled</p>
|
|
262
|
+
<auro-datepicker range offset="20" placement="bottom-start" shift noFlip minDate="07/08/2025">
|
|
263
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
264
|
+
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
265
|
+
<span slot="fromLabel">Departure</span>
|
|
266
|
+
<span slot="toLabel">Return</span>
|
|
267
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
268
|
+
</auro-datepicker>
|
|
269
|
+
</div>
|
|
270
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
271
|
+
</div>
|
|
272
|
+
<auro-accordion alignRight>
|
|
273
|
+
<span slot="trigger">See code</span>
|
|
274
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/floater-config.html) -->
|
|
275
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/floater-config.html -->
|
|
276
|
+
|
|
277
|
+
```html
|
|
278
|
+
<div style="width: 400px">
|
|
279
|
+
<auro-datepicker offset="20" placement="bottom-start" noFlip>
|
|
280
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
281
|
+
<span slot="fromLabel">bottom-start with 20px offset and noFlip</span>
|
|
282
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
283
|
+
</auro-datepicker>
|
|
284
|
+
<br/>
|
|
285
|
+
<auro-datepicker offset="20" placement="bottom-start">
|
|
286
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
287
|
+
<span slot="fromLabel">bottom-start with 20px offset and flip</span>
|
|
288
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
289
|
+
</auro-datepicker>
|
|
290
|
+
<br/>
|
|
291
|
+
<auro-datepicker offset="20" placement="right" autoPlacement noFlip>
|
|
292
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
293
|
+
<span slot="fromLabel">right with 20px offset, noFlip and autoPlacement</span>
|
|
294
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
295
|
+
</auro-datepicker>
|
|
296
|
+
</div>
|
|
297
|
+
<div style="width: 600px; padding-top: 1em;">
|
|
298
|
+
<p>Range bottom-start with 20px offset, noFlip and shift enabled</p>
|
|
299
|
+
<auro-datepicker range offset="20" placement="bottom-start" shift noFlip minDate="07/08/2025">
|
|
300
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
301
|
+
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
302
|
+
<span slot="fromLabel">Departure</span>
|
|
303
|
+
<span slot="toLabel">Return</span>
|
|
304
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
305
|
+
</auro-datepicker>
|
|
306
|
+
</div>
|
|
307
|
+
```
|
|
308
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
309
|
+
</auro-accordion>
|
|
310
|
+
|
|
311
|
+
### Start & End Date
|
|
312
|
+
|
|
313
|
+
The `calendarStartDate` and `calendarEndDate` properties may be used to explicitly control which calendar months _may_ be rendered in the calendar.
|
|
314
|
+
|
|
315
|
+
In <strong>desktop</strong>, the calendar month navigation will be restricted by these dates. In <strong>mobile</strong>, the following logic is used:
|
|
316
|
+
|
|
317
|
+
- if both `calendarStartDate` and `calendarEndDate` are defined: all months between, including these dates, will be rendered.
|
|
318
|
+
- If only `calendarStartDate` is defined: 12 months will be rendered starting with this value.
|
|
319
|
+
- if only `calendarEndDate` is defined: The current date month through the value of this attribute will be rendered.
|
|
320
|
+
|
|
321
|
+
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`.
|
|
322
|
+
|
|
323
|
+
<div class="exampleWrapper">
|
|
324
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/calendar-start-and-end-date.html) -->
|
|
325
|
+
<!-- The below content is automatically added from ./../apiExamples/calendar-start-and-end-date.html -->
|
|
326
|
+
<auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="06/01/2022">
|
|
327
|
+
<span slot="bib.fullscreen.headline">calendarStartDate & calendarEndDate Example</span>
|
|
328
|
+
<span slot="fromLabel">Choose a date</span>
|
|
329
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
330
|
+
</auro-datepicker>
|
|
331
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
332
|
+
</div>
|
|
333
|
+
<auro-accordion alignRight>
|
|
334
|
+
<span slot="trigger">See code</span>
|
|
335
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/calendar-start-and-end-date.html) -->
|
|
336
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/calendar-start-and-end-date.html -->
|
|
337
|
+
|
|
338
|
+
```html
|
|
339
|
+
<auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="06/01/2022">
|
|
340
|
+
<span slot="bib.fullscreen.headline">calendarStartDate & calendarEndDate Example</span>
|
|
341
|
+
<span slot="fromLabel">Choose a date</span>
|
|
342
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
343
|
+
</auro-datepicker>
|
|
344
|
+
```
|
|
345
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
346
|
+
</auro-accordion>
|
|
347
|
+
|
|
348
|
+
### Focus Date
|
|
349
|
+
|
|
350
|
+
The `calendarFocusDate` controls which calendar month is first presented to the user when they open the dropdown bib.
|
|
351
|
+
|
|
352
|
+
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`.
|
|
353
|
+
|
|
354
|
+
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.
|
|
355
|
+
|
|
356
|
+
<div class="exampleWrapper">
|
|
357
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/calendar-focus-date.html) -->
|
|
358
|
+
<!-- The below content is automatically added from ./../apiExamples/calendar-focus-date.html -->
|
|
359
|
+
<auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="12/01/2023" calendarFocusDate="11/01/2022">
|
|
360
|
+
<span slot="bib.fullscreen.headline">calendarFocusDate Example</span>
|
|
361
|
+
<span slot="fromLabel">Choose a date</span>
|
|
362
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
363
|
+
</auro-datepicker>
|
|
364
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
365
|
+
</div>
|
|
366
|
+
<auro-accordion alignRight>
|
|
367
|
+
<span slot="trigger">See code</span>
|
|
368
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/calendar-focus-date.html) -->
|
|
369
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/calendar-focus-date.html -->
|
|
370
|
+
|
|
371
|
+
```html
|
|
372
|
+
<auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="12/01/2023" calendarFocusDate="11/01/2022">
|
|
373
|
+
<span slot="bib.fullscreen.headline">calendarFocusDate Example</span>
|
|
374
|
+
<span slot="fromLabel">Choose a date</span>
|
|
375
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
376
|
+
</auro-datepicker>
|
|
377
|
+
```
|
|
378
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
379
|
+
</auro-accordion>
|
|
380
|
+
|
|
381
|
+
### Central Date
|
|
382
|
+
|
|
383
|
+
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.
|
|
384
|
+
|
|
385
|
+
<div class="exampleWrapper">
|
|
386
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/central-date.html) -->
|
|
387
|
+
<!-- The below content is automatically added from ./../apiExamples/central-date.html -->
|
|
388
|
+
<auro-datepicker centralDate="06/16/1980">
|
|
389
|
+
<span slot="bib.fullscreen.headline">centralDate Example</span>
|
|
390
|
+
<span slot="fromLabel">Choose a date</span>
|
|
391
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
392
|
+
</auro-datepicker>
|
|
393
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
394
|
+
</div>
|
|
395
|
+
<auro-accordion alignRight>
|
|
396
|
+
<span slot="trigger">See code</span>
|
|
397
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/central-date.html) -->
|
|
398
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/central-date.html -->
|
|
399
|
+
|
|
400
|
+
```html
|
|
401
|
+
<auro-datepicker centralDate="06/16/1980">
|
|
402
|
+
<span slot="bib.fullscreen.headline">centralDate Example</span>
|
|
403
|
+
<span slot="fromLabel">Choose a date</span>
|
|
404
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
405
|
+
</auro-datepicker>
|
|
406
|
+
```
|
|
407
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
408
|
+
</auro-accordion>
|
|
409
|
+
|
|
410
|
+
#### Disabled
|
|
411
|
+
|
|
412
|
+
Set the `disabled` attribute to disable all interaction with the datepicker.
|
|
174
413
|
|
|
175
414
|
<div class="exampleWrapper">
|
|
176
415
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
|
|
@@ -195,7 +434,7 @@ If set, disables the datepicker.
|
|
|
195
434
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
196
435
|
</auro-accordion>
|
|
197
436
|
|
|
198
|
-
####
|
|
437
|
+
#### Error
|
|
199
438
|
|
|
200
439
|
Use the `error` attribute to apply a persistent custom error that supersedes the HTML5 validation logic.
|
|
201
440
|
|
|
@@ -204,13 +443,14 @@ A custom error message can be set using the `error` attribute, or it can be used
|
|
|
204
443
|
<div class="exampleWrapper">
|
|
205
444
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/error.html) -->
|
|
206
445
|
<!-- The below content is automatically added from ./../apiExamples/error.html -->
|
|
446
|
+
<auro-button id="undefinedValueExampleBtnAddError">Set Error</auro-button>
|
|
447
|
+
<auro-button id="undefinedValueExampleBtnRemoveError">Remove Error</auro-button>
|
|
448
|
+
<br />
|
|
207
449
|
<auro-datepicker error="Custom error message" id="errorExample">
|
|
208
450
|
<span slot="bib.fullscreen.headline">Error Example</span>
|
|
209
451
|
<span slot="fromLabel">Choose a date</span>
|
|
210
452
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
211
|
-
</auro-datepicker>
|
|
212
|
-
<auro-button id="undefinedValueExampleBtnAddError">Set Error</auro-button>
|
|
213
|
-
<auro-button id="undefinedValueExampleBtnRemoveError">Remove Error</auro-button>
|
|
453
|
+
</auro-datepicker>
|
|
214
454
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
215
455
|
</div>
|
|
216
456
|
<auro-accordion alignRight>
|
|
@@ -219,13 +459,14 @@ A custom error message can be set using the `error` attribute, or it can be used
|
|
|
219
459
|
<!-- The below code snippet is automatically added from ./../apiExamples/error.html -->
|
|
220
460
|
|
|
221
461
|
```html
|
|
462
|
+
<auro-button id="undefinedValueExampleBtnAddError">Set Error</auro-button>
|
|
463
|
+
<auro-button id="undefinedValueExampleBtnRemoveError">Remove Error</auro-button>
|
|
464
|
+
<br />
|
|
222
465
|
<auro-datepicker error="Custom error message" id="errorExample">
|
|
223
466
|
<span slot="bib.fullscreen.headline">Error Example</span>
|
|
224
467
|
<span slot="fromLabel">Choose a date</span>
|
|
225
468
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
226
469
|
</auro-datepicker>
|
|
227
|
-
<auro-button id="undefinedValueExampleBtnAddError">Set Error</auro-button>
|
|
228
|
-
<auro-button id="undefinedValueExampleBtnRemoveError">Remove Error</auro-button>
|
|
229
470
|
```
|
|
230
471
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
231
472
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/error.js) -->
|
|
@@ -247,21 +488,15 @@ export function errorExample() {
|
|
|
247
488
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
248
489
|
</auro-accordion>
|
|
249
490
|
|
|
250
|
-
|
|
491
|
+
### Format
|
|
251
492
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
Example:
|
|
255
|
-
```html
|
|
256
|
-
<auro-datepicker referenceDates='["10-05-2025", "10-15-2025", "10-20-2025", "10-22-2025"]'></auro-datepicker>
|
|
257
|
-
```
|
|
493
|
+
The `format` attribute is used to define the date format used by the datepicker. The default value is `mm/dd/yyyy`.
|
|
258
494
|
|
|
259
495
|
<div class="exampleWrapper">
|
|
260
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
261
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
262
|
-
<auro-datepicker
|
|
263
|
-
<span slot="
|
|
264
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
496
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/format.html) -->
|
|
497
|
+
<!-- The below content is automatically added from ./../apiExamples/format.html -->
|
|
498
|
+
<auro-datepicker format="yyyy/mm/dd">
|
|
499
|
+
<span slot="bib.fullscreen.headline">Format Headline</span>
|
|
265
500
|
<span slot="fromLabel">Choose a date</span>
|
|
266
501
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
267
502
|
</auro-datepicker>
|
|
@@ -269,42 +504,12 @@ Example:
|
|
|
269
504
|
</div>
|
|
270
505
|
<auro-accordion alignRight>
|
|
271
506
|
<span slot="trigger">See code</span>
|
|
272
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
273
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
274
|
-
|
|
275
|
-
```html
|
|
276
|
-
<auro-datepicker referenceDates='["10-05-2025", "10-15-2025", "10-20-2025", "10-22-2025"]' minDate="10-12-2025">
|
|
277
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
278
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
279
|
-
<span slot="fromLabel">Choose a date</span>
|
|
280
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
281
|
-
</auro-datepicker>
|
|
282
|
-
```
|
|
283
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
284
|
-
</auro-accordion>
|
|
285
|
-
|
|
286
|
-
#### Input Mode
|
|
287
|
-
|
|
288
|
-
You can manually set the input mode for the input.
|
|
289
|
-
|
|
290
|
-
<div class="exampleWrapper">
|
|
291
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inputmode.html) -->
|
|
292
|
-
<!-- The below content is automatically added from ./../apiExamples/inputmode.html -->
|
|
293
|
-
<auro-datepicker inputmode="numeric">
|
|
294
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
295
|
-
<span slot="fromLabel">Choose a date</span>
|
|
296
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
297
|
-
</auro-datepicker>
|
|
298
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
299
|
-
</div>
|
|
300
|
-
<auro-accordion alignRight>
|
|
301
|
-
<span slot="trigger">See code</span>
|
|
302
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/inputmode.html) -->
|
|
303
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/inputmode.html -->
|
|
507
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/format.html) -->
|
|
508
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/format.html -->
|
|
304
509
|
|
|
305
510
|
```html
|
|
306
|
-
<auro-datepicker
|
|
307
|
-
<span slot="bib.fullscreen.headline">
|
|
511
|
+
<auro-datepicker format="yyyy/mm/dd">
|
|
512
|
+
<span slot="bib.fullscreen.headline">Format Headline</span>
|
|
308
513
|
<span slot="fromLabel">Choose a date</span>
|
|
309
514
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
310
515
|
</auro-datepicker>
|
|
@@ -312,36 +517,36 @@ You can manually set the input mode for the input.
|
|
|
312
517
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
313
518
|
</auro-accordion>
|
|
314
519
|
|
|
315
|
-
|
|
520
|
+
### Fullscreen Bib
|
|
316
521
|
|
|
317
|
-
|
|
522
|
+
You can make the dropdown open in fullscreen at a specific breakpoint by setting `fullscreenBreakpoint`.
|
|
318
523
|
|
|
319
|
-
|
|
524
|
+
The default value of `fullscreenBreakpoint` is `sm`.
|
|
320
525
|
|
|
321
|
-
|
|
322
|
-
- If only `calendarStartDate` is defined: 12 months will be rendered starting with this value.
|
|
323
|
-
- if only `calendarEndDate` is defined: The current date month through the value of this attribute will be rendered.
|
|
526
|
+
Breakpoint token can be found [here](https://auro.alaskaair.com/getting-started/developers/design-tokens).
|
|
324
527
|
|
|
325
|
-
|
|
528
|
+
To support fullcreen bib, setting `bib.fullscreen.headline` is **STRONGLY RECOMMENDED**.
|
|
326
529
|
|
|
327
530
|
<div class="exampleWrapper">
|
|
328
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
329
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
330
|
-
<auro-datepicker
|
|
331
|
-
<span slot="bib.
|
|
531
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/fullscreen-breakpoint.html) -->
|
|
532
|
+
<!-- The below content is automatically added from ./../apiExamples/fullscreen-breakpoint.html -->
|
|
533
|
+
<auro-datepicker fullscreenBreakpoint="lg">
|
|
534
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
535
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
332
536
|
<span slot="fromLabel">Choose a date</span>
|
|
333
537
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
334
538
|
</auro-datepicker>
|
|
335
539
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
336
|
-
</div>
|
|
540
|
+
</div>
|
|
337
541
|
<auro-accordion alignRight>
|
|
338
542
|
<span slot="trigger">See code</span>
|
|
339
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
340
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
543
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/fullscreen-breakpoint.html) -->
|
|
544
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/fullscreen-breakpoint.html -->
|
|
341
545
|
|
|
342
546
|
```html
|
|
343
|
-
<auro-datepicker
|
|
344
|
-
<span slot="bib.
|
|
547
|
+
<auro-datepicker fullscreenBreakpoint="lg">
|
|
548
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
549
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
345
550
|
<span slot="fromLabel">Choose a date</span>
|
|
346
551
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
347
552
|
</auro-datepicker>
|
|
@@ -349,32 +554,28 @@ Note: This does not restrict setting a value outside of those date constraints.
|
|
|
349
554
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
350
555
|
</auro-accordion>
|
|
351
556
|
|
|
352
|
-
|
|
557
|
+
### Input Mode
|
|
353
558
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
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`.
|
|
357
|
-
|
|
358
|
-
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.
|
|
559
|
+
You can manually set the input mode for the input with the `inputmode` attribute.
|
|
359
560
|
|
|
360
561
|
<div class="exampleWrapper">
|
|
361
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
362
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
363
|
-
<auro-datepicker
|
|
364
|
-
<span slot="bib.fullscreen.headline">
|
|
562
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inputmode.html) -->
|
|
563
|
+
<!-- The below content is automatically added from ./../apiExamples/inputmode.html -->
|
|
564
|
+
<auro-datepicker inputmode="numeric">
|
|
565
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
365
566
|
<span slot="fromLabel">Choose a date</span>
|
|
366
567
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
367
568
|
</auro-datepicker>
|
|
368
569
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
369
|
-
</div>
|
|
570
|
+
</div>
|
|
370
571
|
<auro-accordion alignRight>
|
|
371
572
|
<span slot="trigger">See code</span>
|
|
372
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
373
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
573
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/inputmode.html) -->
|
|
574
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/inputmode.html -->
|
|
374
575
|
|
|
375
576
|
```html
|
|
376
|
-
<auro-datepicker
|
|
377
|
-
<span slot="bib.fullscreen.headline">
|
|
577
|
+
<auro-datepicker inputmode="numeric">
|
|
578
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
378
579
|
<span slot="fromLabel">Choose a date</span>
|
|
379
580
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
380
581
|
</auro-datepicker>
|
|
@@ -382,17 +583,13 @@ In <strong>mobile</strong> layout, upon first opening the bib, the vertical list
|
|
|
382
583
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
383
584
|
</auro-accordion>
|
|
384
585
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
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.
|
|
388
|
-
|
|
389
|
-
#### maxDate
|
|
586
|
+
### Max Date
|
|
390
587
|
|
|
391
588
|
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.
|
|
392
589
|
|
|
393
590
|
<div class="exampleWrapper">
|
|
394
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
395
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
591
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/max-date.html) -->
|
|
592
|
+
<!-- The below content is automatically added from ./../apiExamples/max-date.html -->
|
|
396
593
|
<auro-datepicker maxDate="03/25/2023" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
397
594
|
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
398
595
|
<span slot="fromLabel">Choose a date</span>
|
|
@@ -402,8 +599,8 @@ To give a higher limit you can bind a date to the `maxDate` attribute. It is rec
|
|
|
402
599
|
</div>
|
|
403
600
|
<auro-accordion alignRight>
|
|
404
601
|
<span slot="trigger">See code</span>
|
|
405
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
406
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
602
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/max-date.html) -->
|
|
603
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/max-date.html -->
|
|
407
604
|
|
|
408
605
|
```html
|
|
409
606
|
<auro-datepicker maxDate="03/25/2023" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
@@ -414,6 +611,9 @@ To give a higher limit you can bind a date to the `maxDate` attribute. It is rec
|
|
|
414
611
|
```
|
|
415
612
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
416
613
|
</auro-accordion>
|
|
614
|
+
|
|
615
|
+
#### Update Max Date
|
|
616
|
+
|
|
417
617
|
Setting the `maxDate` attribute to a date earlier than the auro-datepicker `value` will result in the following changes to the component state:
|
|
418
618
|
|
|
419
619
|
* `value` will to reset to `undefined`.
|
|
@@ -422,34 +622,36 @@ Setting the `maxDate` attribute to a date earlier than the auro-datepicker `valu
|
|
|
422
622
|
This example demonstrates that behavior.
|
|
423
623
|
|
|
424
624
|
<div class="exampleWrapper">
|
|
425
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
426
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
625
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/update-max-date.html) -->
|
|
626
|
+
<!-- The below content is automatically added from ./../apiExamples/update-max-date.html -->
|
|
627
|
+
<auro-button id="maxDateChange">Change maxDate to Today's Date</auro-button>
|
|
628
|
+
<auro-button id="resetMaxDate">Reset Datepicker to Initial Example</auro-button>
|
|
629
|
+
<br />
|
|
427
630
|
<auro-datepicker id="maxDateExample" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
428
631
|
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
429
632
|
<span slot="fromLabel">Choose a date</span>
|
|
430
633
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
431
634
|
</auro-datepicker>
|
|
432
|
-
<auro-button id="maxDateChange">Change maxDate to Today's Date</auro-button>
|
|
433
|
-
<auro-button id="resetMaxDate">Reset Datepicker to Initial Example</auro-button>
|
|
434
635
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
435
636
|
</div>
|
|
436
637
|
<auro-accordion alignRight>
|
|
437
638
|
<span slot="trigger">See code</span>
|
|
438
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
439
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
639
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-max-date.html) -->
|
|
640
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/update-max-date.html -->
|
|
440
641
|
|
|
441
642
|
```html
|
|
643
|
+
<auro-button id="maxDateChange">Change maxDate to Today's Date</auro-button>
|
|
644
|
+
<auro-button id="resetMaxDate">Reset Datepicker to Initial Example</auro-button>
|
|
645
|
+
<br />
|
|
442
646
|
<auro-datepicker id="maxDateExample" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
443
647
|
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
444
648
|
<span slot="fromLabel">Choose a date</span>
|
|
445
649
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
446
|
-
</auro-datepicker>
|
|
447
|
-
<auro-button id="maxDateChange">Change maxDate to Today's Date</auro-button>
|
|
448
|
-
<auro-button id="resetMaxDate">Reset Datepicker to Initial Example</auro-button>
|
|
650
|
+
</auro-datepicker>
|
|
449
651
|
```
|
|
450
652
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
451
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
452
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
653
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-max-date.js) -->
|
|
654
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/update-max-date.js -->
|
|
453
655
|
|
|
454
656
|
```js
|
|
455
657
|
function formatDateString(date) {
|
|
@@ -491,13 +693,13 @@ export function updateMaxDateExample() {
|
|
|
491
693
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
492
694
|
</auro-accordion>
|
|
493
695
|
|
|
494
|
-
|
|
696
|
+
### Min Date
|
|
495
697
|
|
|
496
698
|
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.
|
|
497
699
|
|
|
498
700
|
<div class="exampleWrapper">
|
|
499
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
500
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
701
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/min-date.html) -->
|
|
702
|
+
<!-- The below content is automatically added from ./../apiExamples/min-date.html -->
|
|
501
703
|
<auro-datepicker minDate="03/25/2028" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
502
704
|
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
503
705
|
<span slot="fromLabel">Choose a date</span>
|
|
@@ -507,8 +709,8 @@ To give a lower limit you can bind a date to the `minDate` attribute. It is reco
|
|
|
507
709
|
</div>
|
|
508
710
|
<auro-accordion alignRight>
|
|
509
711
|
<span slot="trigger">See code</span>
|
|
510
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
511
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
712
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/min-date.html) -->
|
|
713
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/min-date.html -->
|
|
512
714
|
|
|
513
715
|
```html
|
|
514
716
|
<auro-datepicker minDate="03/25/2028" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
@@ -519,6 +721,9 @@ To give a lower limit you can bind a date to the `minDate` attribute. It is reco
|
|
|
519
721
|
```
|
|
520
722
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
521
723
|
</auro-accordion>
|
|
724
|
+
|
|
725
|
+
#### Update Min Date
|
|
726
|
+
|
|
522
727
|
Setting the `minDate` attribute to a date later than the auro-datepicker `value` will result in the following changes to the component state:
|
|
523
728
|
|
|
524
729
|
* `value` will to reset to `undefined`.
|
|
@@ -527,34 +732,36 @@ Setting the `minDate` attribute to a date later than the auro-datepicker `value`
|
|
|
527
732
|
This example demonstrates that behavior.
|
|
528
733
|
|
|
529
734
|
<div class="exampleWrapper">
|
|
530
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
531
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
735
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/update-min-date.html) -->
|
|
736
|
+
<!-- The below content is automatically added from ./../apiExamples/update-min-date.html -->
|
|
737
|
+
<auro-button id="minDateChange">Change minDate to a week from Today</auro-button>
|
|
738
|
+
<auro-button id="resetMinDate">Reset Datepicker to Initial Example</auro-button>
|
|
739
|
+
<br />
|
|
532
740
|
<auro-datepicker id="minDateExample" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
533
741
|
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
534
742
|
<span slot="fromLabel">Choose a date</span>
|
|
535
743
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
536
744
|
</auro-datepicker>
|
|
537
|
-
<auro-button id="minDateChange">Change minDate to a week from Today</auro-button>
|
|
538
|
-
<auro-button id="resetMinDate">Reset Datepicker to Initial Example</auro-button>
|
|
539
745
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
540
746
|
</div>
|
|
541
747
|
<auro-accordion alignRight>
|
|
542
748
|
<span slot="trigger">See code</span>
|
|
543
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
544
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
749
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-min-date.html) -->
|
|
750
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/update-min-date.html -->
|
|
545
751
|
|
|
546
752
|
```html
|
|
753
|
+
<auro-button id="minDateChange">Change minDate to a week from Today</auro-button>
|
|
754
|
+
<auro-button id="resetMinDate">Reset Datepicker to Initial Example</auro-button>
|
|
755
|
+
<br />
|
|
547
756
|
<auro-datepicker id="minDateExample" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
548
757
|
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
549
758
|
<span slot="fromLabel">Choose a date</span>
|
|
550
759
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
551
|
-
</auro-datepicker>
|
|
552
|
-
<auro-button id="minDateChange">Change minDate to a week from Today</auro-button>
|
|
553
|
-
<auro-button id="resetMinDate">Reset Datepicker to Initial Example</auro-button>
|
|
760
|
+
</auro-datepicker>
|
|
554
761
|
```
|
|
555
762
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
556
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
557
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
763
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-min-date.js) -->
|
|
764
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/update-min-date.js -->
|
|
558
765
|
|
|
559
766
|
```js
|
|
560
767
|
function formatDateString(date) {
|
|
@@ -596,15 +803,56 @@ export function updateMinDateExample() {
|
|
|
596
803
|
```
|
|
597
804
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
598
805
|
</auro-accordion>
|
|
806
|
+
|
|
807
|
+
### Month Names Localization
|
|
808
|
+
|
|
809
|
+
The datepicker supports localized month names through the `monthNames` property.
|
|
810
|
+
|
|
811
|
+
This example demonstrates how to set the `monthNames` property to Korean month names, with a Korean date format.
|
|
812
|
+
|
|
813
|
+
<div class="exampleWrapper">
|
|
814
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization.html) -->
|
|
815
|
+
<!-- The below content is automatically added from ./../apiExamples/localization.html -->
|
|
816
|
+
<auro-datepicker format="yyyy/mm/dd" id="localizationExample">
|
|
817
|
+
<span slot="bib.fullscreen.headline">Localization Headline</span>
|
|
818
|
+
<span slot="fromLabel">Choose a date</span>
|
|
819
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
820
|
+
</auro-datepicker>
|
|
821
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
822
|
+
</div>
|
|
823
|
+
<auro-accordion alignRight>
|
|
824
|
+
<span slot="trigger">See code</span>
|
|
825
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/localization.html) -->
|
|
826
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/localization.html -->
|
|
827
|
+
|
|
828
|
+
```html
|
|
829
|
+
<auro-datepicker format="yyyy/mm/dd" id="localizationExample">
|
|
830
|
+
<span slot="bib.fullscreen.headline">Localization Headline</span>
|
|
831
|
+
<span slot="fromLabel">Choose a date</span>
|
|
832
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
833
|
+
</auro-datepicker>
|
|
834
|
+
```
|
|
835
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
836
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/localization.js) -->
|
|
837
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/localization.js -->
|
|
838
|
+
|
|
839
|
+
```js
|
|
840
|
+
export function localizationExample() {
|
|
841
|
+
const localizedDatepicker = document.querySelector("#localizationExample");
|
|
842
|
+
|
|
843
|
+
localizedDatepicker.monthNames = ['일월', '이월', '삼월', '사월', '오월', '유월', '칠월', '팔월', '구월', '시월', '십일월', '십이월'];
|
|
844
|
+
}
|
|
845
|
+
```
|
|
846
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
599
847
|
</auro-accordion>
|
|
600
848
|
|
|
601
|
-
|
|
849
|
+
### No Validate
|
|
602
850
|
|
|
603
|
-
|
|
851
|
+
Set `noValidate` to force the datepicker not to validate when navigating away from the component.
|
|
604
852
|
|
|
605
853
|
<div class="exampleWrapper">
|
|
606
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
607
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
854
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/no-validate.html) -->
|
|
855
|
+
<!-- The below content is automatically added from ./../apiExamples/no-validate.html -->
|
|
608
856
|
<auro-datepicker required noValidate>
|
|
609
857
|
<span slot="bib.fullscreen.headline">noValidate Example</span>
|
|
610
858
|
<span slot="fromLabel">Choose a date</span>
|
|
@@ -614,8 +862,8 @@ When set, the datepicker will not validate when navigating away from the compone
|
|
|
614
862
|
</div>
|
|
615
863
|
<auro-accordion alignRight>
|
|
616
864
|
<span slot="trigger">See code</span>
|
|
617
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
618
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
865
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/no-validate.html) -->
|
|
866
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/no-validate.html -->
|
|
619
867
|
|
|
620
868
|
```html
|
|
621
869
|
<auro-datepicker required noValidate>
|
|
@@ -627,7 +875,43 @@ When set, the datepicker will not validate when navigating away from the compone
|
|
|
627
875
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
628
876
|
</auro-accordion>
|
|
629
877
|
|
|
630
|
-
|
|
878
|
+
### Reference Dates
|
|
879
|
+
|
|
880
|
+
You can choose to outline dates for the user to reference by passing a string containing an array of values to the component to tell it which dates are your reference dates.
|
|
881
|
+
|
|
882
|
+
Example:
|
|
883
|
+
```html
|
|
884
|
+
<auro-datepicker referenceDates='["10-05-2025", "10-15-2025", "10-20-2025", "10-22-2025"]'></auro-datepicker>
|
|
885
|
+
```
|
|
886
|
+
|
|
887
|
+
<div class="exampleWrapper">
|
|
888
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/reference-dates.html) -->
|
|
889
|
+
<!-- The below content is automatically added from ./../apiExamples/reference-dates.html -->
|
|
890
|
+
<auro-datepicker referenceDates='["10-05-2025", "10-15-2025", "10-20-2025", "10-22-2025"]' minDate="10-12-2025">
|
|
891
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
892
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
893
|
+
<span slot="fromLabel">Choose a date</span>
|
|
894
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
895
|
+
</auro-datepicker>
|
|
896
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
897
|
+
</div>
|
|
898
|
+
<auro-accordion alignRight>
|
|
899
|
+
<span slot="trigger">See code</span>
|
|
900
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reference-dates.html) -->
|
|
901
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/reference-dates.html -->
|
|
902
|
+
|
|
903
|
+
```html
|
|
904
|
+
<auro-datepicker referenceDates='["10-05-2025", "10-15-2025", "10-20-2025", "10-22-2025"]' minDate="10-12-2025">
|
|
905
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
906
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
907
|
+
<span slot="fromLabel">Choose a date</span>
|
|
908
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
909
|
+
</auro-datepicker>
|
|
910
|
+
```
|
|
911
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
912
|
+
</auro-accordion>
|
|
913
|
+
|
|
914
|
+
### Required
|
|
631
915
|
|
|
632
916
|
Populates the `required` attribute on the input. Used for client-side validation.
|
|
633
917
|
|
|
@@ -641,6 +925,7 @@ When the validity check fails the validityState, equals `valueMissing`. The erro
|
|
|
641
925
|
<span slot="fromLabel">Choose a date</span>
|
|
642
926
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
643
927
|
</auro-datepicker>
|
|
928
|
+
<br />
|
|
644
929
|
<auro-datepicker required range setCustomValidityValueMissing="Custom value missing message.">
|
|
645
930
|
<span slot="bib.fullscreen.headline">Required Example</span>
|
|
646
931
|
<span slot="fromLabel">Departure</span>
|
|
@@ -660,6 +945,7 @@ When the validity check fails the validityState, equals `valueMissing`. The erro
|
|
|
660
945
|
<span slot="fromLabel">Choose a date</span>
|
|
661
946
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
662
947
|
</auro-datepicker>
|
|
948
|
+
<br />
|
|
663
949
|
<auro-datepicker required range setCustomValidityValueMissing="Custom value missing message.">
|
|
664
950
|
<span slot="bib.fullscreen.headline">Required Example</span>
|
|
665
951
|
<span slot="fromLabel">Departure</span>
|
|
@@ -670,9 +956,9 @@ When the validity check fails the validityState, equals `valueMissing`. The erro
|
|
|
670
956
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
671
957
|
</auro-accordion>
|
|
672
958
|
|
|
673
|
-
|
|
959
|
+
### Stacked
|
|
674
960
|
|
|
675
|
-
Set stacked attribute to make range datepicker stacked style.
|
|
961
|
+
Set the `stacked` attribute to make range datepicker stacked style.
|
|
676
962
|
|
|
677
963
|
<div class="exampleWrapper">
|
|
678
964
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/stacked.html) -->
|
|
@@ -699,97 +985,20 @@ Set stacked attribute to make range datepicker stacked style.
|
|
|
699
985
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
700
986
|
</auro-accordion>
|
|
701
987
|
|
|
702
|
-
###
|
|
703
|
-
The bib position can be customized with `placement`, `offset`, `flip`, `autoPlacement`, and `shift` attributes.
|
|
704
|
-
|
|
705
|
-
- `placement` specifies the preferred position where the bib should appear relative to the trigger.
|
|
706
|
-
- `offset` sets the distance between the trigger and the bib.
|
|
707
|
-
- 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`.
|
|
708
|
-
- Unless `noFlip` is enabled, if there isn't enough space for the preferred `placement`, the bib will automatically flip to an alternative position.
|
|
709
|
-
- `shift` when enabled, adjusts the bib position when it would overflow the viewport boundaries, ensuring it remains visible.
|
|
710
|
-
|
|
711
|
-
<div class="exampleWrapper">
|
|
712
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/floaterConfig.html) -->
|
|
713
|
-
<!-- The below content is automatically added from ./../apiExamples/floaterConfig.html -->
|
|
714
|
-
<div style="width: 400px">
|
|
715
|
-
<auro-datepicker offset="20" placement="bottom-start" noFlip>
|
|
716
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
717
|
-
<span slot="fromLabel">bottom-start with 20px offset and noFlip</span>
|
|
718
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
719
|
-
</auro-datepicker>
|
|
720
|
-
<auro-datepicker offset="20" placement="bottom-start">
|
|
721
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
722
|
-
<span slot="fromLabel">bottom-start with 20px offset and flip</span>
|
|
723
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
724
|
-
</auro-datepicker>
|
|
725
|
-
<auro-datepicker offset="20" placement="right" autoPlacement noFlip>
|
|
726
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
727
|
-
<span slot="fromLabel">right with 20px offset, noFlip and autoPlacement</span>
|
|
728
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
729
|
-
</auro-datepicker>
|
|
730
|
-
</div>
|
|
731
|
-
<div style="width: 600px; padding-top: 1em;">
|
|
732
|
-
<p>Range bottom-start with 20px offset, noFlip and shift enabled</p>
|
|
733
|
-
<auro-datepicker range offset="20" placement="bottom-start" shift noFlip minDate="07/08/2025">
|
|
734
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
735
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
736
|
-
<span slot="fromLabel">Departure</span>
|
|
737
|
-
<span slot="toLabel">Return</span>
|
|
738
|
-
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
739
|
-
</auro-datepicker>
|
|
740
|
-
</div>
|
|
741
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
742
|
-
</div>
|
|
743
|
-
<auro-accordion alignRight>
|
|
744
|
-
<span slot="trigger">See code</span>
|
|
745
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/floaterConfig.html) -->
|
|
746
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/floaterConfig.html -->
|
|
747
|
-
|
|
748
|
-
```html
|
|
749
|
-
<div style="width: 400px">
|
|
750
|
-
<auro-datepicker offset="20" placement="bottom-start" noFlip>
|
|
751
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
752
|
-
<span slot="fromLabel">bottom-start with 20px offset and noFlip</span>
|
|
753
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
754
|
-
</auro-datepicker>
|
|
755
|
-
<auro-datepicker offset="20" placement="bottom-start">
|
|
756
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
757
|
-
<span slot="fromLabel">bottom-start with 20px offset and flip</span>
|
|
758
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
759
|
-
</auro-datepicker>
|
|
760
|
-
<auro-datepicker offset="20" placement="right" autoPlacement noFlip>
|
|
761
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
762
|
-
<span slot="fromLabel">right with 20px offset, noFlip and autoPlacement</span>
|
|
763
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
764
|
-
</auro-datepicker>
|
|
765
|
-
</div>
|
|
766
|
-
<div style="width: 600px; padding-top: 1em;">
|
|
767
|
-
<p>Range bottom-start with 20px offset, noFlip and shift enabled</p>
|
|
768
|
-
<auro-datepicker range offset="20" placement="bottom-start" shift noFlip minDate="07/08/2025">
|
|
769
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
770
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
771
|
-
<span slot="fromLabel">Departure</span>
|
|
772
|
-
<span slot="toLabel">Return</span>
|
|
773
|
-
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
774
|
-
</auro-datepicker>
|
|
775
|
-
</div>
|
|
776
|
-
```
|
|
777
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
778
|
-
</auro-accordion>
|
|
779
|
-
|
|
780
|
-
#### validity
|
|
988
|
+
### Validity
|
|
781
989
|
|
|
782
990
|
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.
|
|
783
991
|
|
|
784
992
|
<div class="exampleWrapper">
|
|
785
993
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/validity.html) -->
|
|
786
994
|
<!-- The below content is automatically added from ./../apiExamples/validity.html -->
|
|
995
|
+
<auro-button id="validityExampleBtn">Get validity</auro-button>
|
|
996
|
+
<br />
|
|
787
997
|
<auro-datepicker required id="validityExample">
|
|
788
998
|
<span slot="bib.fullscreen.headline">validity Example</span>
|
|
789
999
|
<span slot="fromLabel">Choose a date</span>
|
|
790
1000
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
791
1001
|
</auro-datepicker>
|
|
792
|
-
<auro-button id="validityExampleBtn">Get validity</auro-button>
|
|
793
1002
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
794
1003
|
</div>
|
|
795
1004
|
<auro-accordion alignRight>
|
|
@@ -798,12 +1007,13 @@ Specifies the `validityState` the element is in. Upon first interaction, or pres
|
|
|
798
1007
|
<!-- The below code snippet is automatically added from ./../apiExamples/validity.html -->
|
|
799
1008
|
|
|
800
1009
|
```html
|
|
1010
|
+
<auro-button id="validityExampleBtn">Get validity</auro-button>
|
|
1011
|
+
<br />
|
|
801
1012
|
<auro-datepicker required id="validityExample">
|
|
802
1013
|
<span slot="bib.fullscreen.headline">validity Example</span>
|
|
803
1014
|
<span slot="fromLabel">Choose a date</span>
|
|
804
1015
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
805
|
-
</auro-datepicker>
|
|
806
|
-
<auro-button id="validityExampleBtn">Get validity</auro-button>
|
|
1016
|
+
</auro-datepicker>
|
|
807
1017
|
```
|
|
808
1018
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
809
1019
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/validity.js) -->
|
|
@@ -823,9 +1033,9 @@ export function validityExample() {
|
|
|
823
1033
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
824
1034
|
</auro-accordion>
|
|
825
1035
|
|
|
826
|
-
|
|
1036
|
+
### Value
|
|
827
1037
|
|
|
828
|
-
|
|
1038
|
+
The `value` attribute represents the 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.
|
|
829
1039
|
|
|
830
1040
|
<div class="exampleWrapper">
|
|
831
1041
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/value.html) -->
|
|
@@ -852,13 +1062,13 @@ Value selected for the datepicker. Can be used to pre-set the value of the datep
|
|
|
852
1062
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
853
1063
|
</auro-accordion>
|
|
854
1064
|
|
|
855
|
-
|
|
1065
|
+
### Value of Second Input in Range Mode
|
|
856
1066
|
|
|
857
|
-
|
|
1067
|
+
The `valueEnd` attribute represents the 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.
|
|
858
1068
|
|
|
859
1069
|
<div class="exampleWrapper">
|
|
860
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
861
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
1070
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/value-end.html) -->
|
|
1071
|
+
<!-- The below content is automatically added from ./../apiExamples/value-end.html -->
|
|
862
1072
|
<auro-datepicker id="valueEndExample" range valueEnd="03/03/2023">
|
|
863
1073
|
<span slot="bib.fullscreen.headline">valueEnd Example</span>
|
|
864
1074
|
<span slot="fromLabel">Departure</span>
|
|
@@ -869,8 +1079,8 @@ Value of the second input (end date), selected for the datepicker. Can be used t
|
|
|
869
1079
|
</div>
|
|
870
1080
|
<auro-accordion alignRight>
|
|
871
1081
|
<span slot="trigger">See code</span>
|
|
872
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
873
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1082
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/value-end.html) -->
|
|
1083
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/value-end.html -->
|
|
874
1084
|
|
|
875
1085
|
```html
|
|
876
1086
|
<auro-datepicker id="valueEndExample" range valueEnd="03/03/2023">
|
|
@@ -883,197 +1093,259 @@ Value of the second input (end date), selected for the datepicker. Can be used t
|
|
|
883
1093
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
884
1094
|
</auro-accordion>
|
|
885
1095
|
|
|
886
|
-
|
|
1096
|
+
## Method Examples
|
|
1097
|
+
|
|
1098
|
+
### Focus
|
|
887
1099
|
|
|
888
|
-
The `
|
|
1100
|
+
The `focus()` method will apply focus state to the datepicker's input field.
|
|
889
1101
|
|
|
890
1102
|
<div class="exampleWrapper">
|
|
891
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
892
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
893
|
-
<auro-
|
|
894
|
-
|
|
895
|
-
|
|
1103
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/focus.html) -->
|
|
1104
|
+
<!-- The below content is automatically added from ./../apiExamples/focus.html -->
|
|
1105
|
+
<auro-button id="focusExampleBtn">Apply focus to datepicker</auro-button>
|
|
1106
|
+
<auro-button id="focusExampleBtnTwo">Apply focus to the second input in datepicker</auro-button>
|
|
1107
|
+
<br />
|
|
1108
|
+
<auro-datepicker id="focusExampleElem" range>
|
|
1109
|
+
<span slot="bib.fullscreen.headline">Focus Example</span>
|
|
1110
|
+
<span slot="fromLabel">Departure</span>
|
|
1111
|
+
<span slot="toLabel">Return</span>
|
|
896
1112
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
897
1113
|
</auro-datepicker>
|
|
898
1114
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
899
1115
|
</div>
|
|
900
1116
|
<auro-accordion alignRight>
|
|
901
1117
|
<span slot="trigger">See code</span>
|
|
902
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
903
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1118
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/focus.html) -->
|
|
1119
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/focus.html -->
|
|
904
1120
|
|
|
905
1121
|
```html
|
|
906
|
-
<auro-
|
|
907
|
-
|
|
908
|
-
|
|
1122
|
+
<auro-button id="focusExampleBtn">Apply focus to datepicker</auro-button>
|
|
1123
|
+
<auro-button id="focusExampleBtnTwo">Apply focus to the second input in datepicker</auro-button>
|
|
1124
|
+
<br />
|
|
1125
|
+
<auro-datepicker id="focusExampleElem" range>
|
|
1126
|
+
<span slot="bib.fullscreen.headline">Focus Example</span>
|
|
1127
|
+
<span slot="fromLabel">Departure</span>
|
|
1128
|
+
<span slot="toLabel">Return</span>
|
|
909
1129
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
910
1130
|
</auro-datepicker>
|
|
911
1131
|
```
|
|
912
1132
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
913
|
-
|
|
1133
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/focus.js) -->
|
|
1134
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/focus.js -->
|
|
914
1135
|
|
|
915
|
-
|
|
1136
|
+
```js
|
|
1137
|
+
export function focusExample() {
|
|
1138
|
+
const focusExampleElem = document.querySelector('#focusExampleElem');
|
|
1139
|
+
const focusExampleBtn = document.querySelector('#focusExampleBtn');
|
|
1140
|
+
const focusExampleBtnTwo = document.querySelector('#focusExampleBtnTwo');
|
|
1141
|
+
|
|
1142
|
+
focusExampleBtn.addEventListener('click', () => {
|
|
1143
|
+
focusExampleElem.focus();
|
|
1144
|
+
});
|
|
1145
|
+
|
|
1146
|
+
focusExampleBtnTwo.addEventListener('click', () => {
|
|
1147
|
+
focusExampleElem.focus('endDate');
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
```
|
|
1151
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1152
|
+
</auro-accordion>
|
|
916
1153
|
|
|
917
|
-
|
|
1154
|
+
### Reset State
|
|
918
1155
|
|
|
919
|
-
|
|
1156
|
+
Use the `reset()` method to reset the `<auro-datepicker>`'s `value`, `valueEnd` and `validity` state. Doing so will preserve all other attributes and properties.
|
|
920
1157
|
|
|
921
1158
|
<div class="exampleWrapper">
|
|
922
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
923
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
924
|
-
<auro-
|
|
925
|
-
|
|
1159
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/reset-state.html) -->
|
|
1160
|
+
<!-- The below content is automatically added from ./../apiExamples/reset-state.html -->
|
|
1161
|
+
<auro-button id="resetStateBtn">Reset</auro-button>
|
|
1162
|
+
<br />
|
|
1163
|
+
<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.">
|
|
1164
|
+
<span slot="bib.fullscreen.headline">Reset Example</span>
|
|
926
1165
|
<span slot="fromLabel">Departure</span>
|
|
927
1166
|
<span slot="toLabel">Return</span>
|
|
928
1167
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
929
|
-
</auro-datepicker>
|
|
930
|
-
|
|
931
|
-
|
|
1168
|
+
</auro-datepicker>
|
|
1169
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1170
|
+
</div>
|
|
1171
|
+
<auro-accordion alignRight>
|
|
1172
|
+
<span slot="trigger">See code</span>
|
|
1173
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset-state.html) -->
|
|
1174
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/reset-state.html -->
|
|
1175
|
+
|
|
1176
|
+
```html
|
|
1177
|
+
<auro-button id="resetStateBtn">Reset</auro-button>
|
|
1178
|
+
<br />
|
|
1179
|
+
<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.">
|
|
1180
|
+
<span slot="bib.fullscreen.headline">Reset Example</span>
|
|
1181
|
+
<span slot="fromLabel">Departure</span>
|
|
1182
|
+
<span slot="toLabel">Return</span>
|
|
1183
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1184
|
+
</auro-datepicker>
|
|
1185
|
+
```
|
|
1186
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1187
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset-state.js) -->
|
|
1188
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/reset-state.js -->
|
|
1189
|
+
|
|
1190
|
+
```js
|
|
1191
|
+
export function resetStateExample() {
|
|
1192
|
+
const elem = document.querySelector('#resetStateExample');
|
|
1193
|
+
|
|
1194
|
+
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
1195
|
+
elem.reset();
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
```
|
|
1199
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1200
|
+
</auro-accordion>
|
|
1201
|
+
|
|
1202
|
+
## Event Examples
|
|
1203
|
+
|
|
1204
|
+
### Watch for Value Changes
|
|
1205
|
+
|
|
1206
|
+
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.
|
|
1207
|
+
|
|
1208
|
+
<div class="exampleWrapper">
|
|
1209
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/alert-value.html) -->
|
|
1210
|
+
<!-- The below content is automatically added from ./../apiExamples/alert-value.html -->
|
|
1211
|
+
<auro-datepicker id="datePickerValueAlert">
|
|
1212
|
+
<span slot="bib.fullscreen.headline">Alert Value Example</span>
|
|
1213
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1214
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1215
|
+
</auro-datepicker>
|
|
932
1216
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
933
|
-
</div>
|
|
1217
|
+
</div>
|
|
934
1218
|
<auro-accordion alignRight>
|
|
935
1219
|
<span slot="trigger">See code</span>
|
|
936
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
937
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1220
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/alert-value.html) -->
|
|
1221
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/alert-value.html -->
|
|
938
1222
|
|
|
939
1223
|
```html
|
|
940
|
-
<auro-datepicker id="
|
|
941
|
-
<span slot="bib.fullscreen.headline">
|
|
942
|
-
<span slot="fromLabel">
|
|
943
|
-
<span slot="toLabel">Return</span>
|
|
1224
|
+
<auro-datepicker id="datePickerValueAlert">
|
|
1225
|
+
<span slot="bib.fullscreen.headline">Alert Value Example</span>
|
|
1226
|
+
<span slot="fromLabel">Choose a date</span>
|
|
944
1227
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
945
1228
|
</auro-datepicker>
|
|
946
|
-
<auro-button id="focusExampleBtn">Apply focus to datepicker</auro-button>
|
|
947
|
-
<auro-button id="focusExampleBtnTwo">Apply focus to the second input in datepicker</auro-button>
|
|
948
1229
|
```
|
|
949
1230
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
950
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
951
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1231
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/alert-value.js) -->
|
|
1232
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/alert-value.js -->
|
|
952
1233
|
|
|
953
1234
|
```js
|
|
954
|
-
export function
|
|
955
|
-
const
|
|
956
|
-
const focusExampleBtn = document.querySelector('#focusExampleBtn');
|
|
957
|
-
const focusExampleBtnTwo = document.querySelector('#focusExampleBtnTwo');
|
|
958
|
-
|
|
959
|
-
focusExampleBtn.addEventListener('click', () => {
|
|
960
|
-
focusExampleElem.focus();
|
|
961
|
-
});
|
|
1235
|
+
export function alertValueExample() {
|
|
1236
|
+
const valueAlertExample = document.querySelector('#datePickerValueAlert');
|
|
962
1237
|
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
1238
|
+
valueAlertExample.addEventListener('auroDatePicker-valueSet', () => {
|
|
1239
|
+
console.warn('Select value changed to:', valueAlertExample.value);
|
|
1240
|
+
alert(`Select value changed to: ${valueAlertExample.value}`);
|
|
1241
|
+
})
|
|
966
1242
|
}
|
|
967
1243
|
```
|
|
968
1244
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
969
1245
|
</auro-accordion>
|
|
970
1246
|
|
|
971
|
-
|
|
1247
|
+
## Slot Examples
|
|
972
1248
|
|
|
973
|
-
|
|
1249
|
+
### Aria Label for Clear Button
|
|
974
1250
|
|
|
975
|
-
|
|
1251
|
+
Use the `ariaLabel.input.clear` slot to set the `aria-label` for the clear button in the trigger input.
|
|
976
1252
|
|
|
977
1253
|
<div class="exampleWrapper">
|
|
978
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
979
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
980
|
-
<auro-datepicker
|
|
1254
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/aria-label-input-clear.html) -->
|
|
1255
|
+
<!-- The below content is automatically added from ./../apiExamples/aria-label-input-clear.html -->
|
|
1256
|
+
<auro-datepicker>
|
|
981
1257
|
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
982
1258
|
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
983
1259
|
<span slot="fromLabel">Choose a date</span>
|
|
984
1260
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1261
|
+
<span slot="ariaLabel.input.clear">Custom Clear Input Button</span>
|
|
985
1262
|
</auro-datepicker>
|
|
986
1263
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
987
|
-
</div>
|
|
1264
|
+
</div>
|
|
1265
|
+
<div class="exampleWrapper--ondark">
|
|
1266
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/snowflake/aria-label-input-clear.html) -->
|
|
1267
|
+
<!-- The below content is automatically added from ./../apiExamples/snowflake/aria-label-input-clear.html -->
|
|
1268
|
+
<auro-datepicker layout="snowflake" shape="snowflake" ondark placeholder="MM/DD/YYYY">
|
|
1269
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1270
|
+
<span slot="label">Date</span>
|
|
1271
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1272
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1273
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1274
|
+
<span slot="ariaLabel.input.clear">Snowflake Clear Input Button</span>
|
|
1275
|
+
</auro-datepicker>
|
|
1276
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1277
|
+
</div>
|
|
988
1278
|
<auro-accordion alignRight>
|
|
989
1279
|
<span slot="trigger">See code</span>
|
|
990
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
991
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1280
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/aria-label-input-clear.html) -->
|
|
1281
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/aria-label-input-clear.html -->
|
|
992
1282
|
|
|
993
1283
|
```html
|
|
994
|
-
<auro-datepicker
|
|
1284
|
+
<auro-datepicker>
|
|
995
1285
|
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
996
1286
|
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
997
1287
|
<span slot="fromLabel">Choose a date</span>
|
|
998
1288
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1289
|
+
<span slot="ariaLabel.input.clear">Custom Clear Input Button</span>
|
|
999
1290
|
</auro-datepicker>
|
|
1000
1291
|
```
|
|
1001
1292
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
#### toLabel
|
|
1005
|
-
|
|
1006
|
-
Only for use with the `range` attribute. Sets the label for the second input.
|
|
1007
|
-
|
|
1008
|
-
<div class="exampleWrapper">
|
|
1009
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basicRange.html) -->
|
|
1010
|
-
<!-- The below content is automatically added from ./../apiExamples/basicRange.html -->
|
|
1011
|
-
<auro-datepicker range minDate="07/08/2025">
|
|
1012
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1013
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
1014
|
-
<span slot="fromLabel">Departure</span>
|
|
1015
|
-
<span slot="toLabel">Return</span>
|
|
1016
|
-
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
1017
|
-
</auro-datepicker>
|
|
1018
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1019
|
-
</div>
|
|
1020
|
-
<auro-accordion alignRight>
|
|
1021
|
-
<span slot="trigger">See code</span>
|
|
1022
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basicRange.html) -->
|
|
1023
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/basicRange.html -->
|
|
1293
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/snowflake/aria-label-input-clear.html) -->
|
|
1294
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/snowflake/aria-label-input-clear.html -->
|
|
1024
1295
|
|
|
1025
1296
|
```html
|
|
1026
|
-
<auro-datepicker
|
|
1297
|
+
<auro-datepicker layout="snowflake" shape="snowflake" ondark placeholder="MM/DD/YYYY">
|
|
1027
1298
|
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1028
|
-
<span slot="
|
|
1029
|
-
<span slot="
|
|
1030
|
-
<span slot="
|
|
1031
|
-
<span slot="bib.fullscreen.dateLabel">
|
|
1299
|
+
<span slot="label">Date</span>
|
|
1300
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1301
|
+
<span slot="fromLabel">Choose a date</span>
|
|
1302
|
+
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1303
|
+
<span slot="ariaLabel.input.clear">Snowflake Clear Input Button</span>
|
|
1032
1304
|
</auro-datepicker>
|
|
1033
1305
|
```
|
|
1034
1306
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1035
1307
|
</auro-accordion>
|
|
1036
1308
|
|
|
1037
|
-
|
|
1309
|
+
### Fullscreen Bib Date Label and Headline
|
|
1038
1310
|
|
|
1039
|
-
|
|
1311
|
+
Use the `bib.fullscreen.dateLabel` and `bib.fullscreen.headline` slots to set the the label at the top of the bib and headline when viewed in the mobile layout.
|
|
1312
|
+
To view this demo, set your window to a mobile screen size.
|
|
1040
1313
|
|
|
1041
1314
|
<div class="exampleWrapper">
|
|
1042
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
1043
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
1315
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
1316
|
+
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
1044
1317
|
<auro-datepicker>
|
|
1045
|
-
<span slot="bib.
|
|
1318
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1319
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1046
1320
|
<span slot="fromLabel">Choose a date</span>
|
|
1047
1321
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1048
|
-
<span slot="helpText">Choose a date must be today or earlier.</span>
|
|
1049
1322
|
</auro-datepicker>
|
|
1050
1323
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1051
1324
|
</div>
|
|
1052
1325
|
<auro-accordion alignRight>
|
|
1053
1326
|
<span slot="trigger">See code</span>
|
|
1054
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
1055
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1327
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
1328
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
1056
1329
|
|
|
1057
1330
|
```html
|
|
1058
1331
|
<auro-datepicker>
|
|
1059
|
-
<span slot="bib.
|
|
1332
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1333
|
+
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1060
1334
|
<span slot="fromLabel">Choose a date</span>
|
|
1061
1335
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1062
|
-
<span slot="helpText">Choose a date must be today or earlier.</span>
|
|
1063
1336
|
</auro-datepicker>
|
|
1064
1337
|
```
|
|
1065
1338
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1066
1339
|
</auro-accordion>
|
|
1067
1340
|
|
|
1068
|
-
|
|
1341
|
+
### From Label
|
|
1069
1342
|
|
|
1070
|
-
|
|
1071
|
-
To view this demo, set your window to a mobile screen size.
|
|
1343
|
+
The `fromLabel` slot sets the label used for the input. When the `range` attribute is used this is the first of two inputs.
|
|
1072
1344
|
|
|
1073
1345
|
<div class="exampleWrapper">
|
|
1074
1346
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
1075
1347
|
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
1076
|
-
<auro-datepicker
|
|
1348
|
+
<auro-datepicker>
|
|
1077
1349
|
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1078
1350
|
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1079
1351
|
<span slot="fromLabel">Choose a date</span>
|
|
@@ -1087,7 +1359,7 @@ To view this demo, set your window to a mobile screen size.
|
|
|
1087
1359
|
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
1088
1360
|
|
|
1089
1361
|
```html
|
|
1090
|
-
<auro-datepicker
|
|
1362
|
+
<auro-datepicker>
|
|
1091
1363
|
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1092
1364
|
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1093
1365
|
<span slot="fromLabel">Choose a date</span>
|
|
@@ -1097,53 +1369,71 @@ To view this demo, set your window to a mobile screen size.
|
|
|
1097
1369
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1098
1370
|
</auro-accordion>
|
|
1099
1371
|
|
|
1100
|
-
|
|
1372
|
+
### To Label
|
|
1101
1373
|
|
|
1102
|
-
|
|
1374
|
+
The `toLabel` slot sets the label for the second input. Only for use with the `range` attribute.
|
|
1103
1375
|
|
|
1104
1376
|
<div class="exampleWrapper">
|
|
1105
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
1106
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
1107
|
-
<auro-datepicker>
|
|
1377
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/range.html) -->
|
|
1378
|
+
<!-- The below content is automatically added from ./../apiExamples/range.html -->
|
|
1379
|
+
<auro-datepicker range>
|
|
1108
1380
|
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1109
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1110
|
-
<span slot="fromLabel">
|
|
1111
|
-
<span slot="
|
|
1112
|
-
<span slot="
|
|
1381
|
+
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
1382
|
+
<span slot="fromLabel">Departure</span>
|
|
1383
|
+
<span slot="toLabel">Return</span>
|
|
1384
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
1113
1385
|
</auro-datepicker>
|
|
1114
1386
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1115
|
-
</div>
|
|
1116
|
-
<
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1387
|
+
</div>
|
|
1388
|
+
<auro-accordion alignRight>
|
|
1389
|
+
<span slot="trigger">See code</span>
|
|
1390
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/range.html) -->
|
|
1391
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/range.html -->
|
|
1392
|
+
|
|
1393
|
+
```html
|
|
1394
|
+
<auro-datepicker range>
|
|
1395
|
+
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1396
|
+
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
1397
|
+
<span slot="fromLabel">Departure</span>
|
|
1398
|
+
<span slot="toLabel">Return</span>
|
|
1399
|
+
<span slot="bib.fullscreen.dateLabel">Roundtrip</span>
|
|
1400
|
+
</auro-datepicker>
|
|
1401
|
+
```
|
|
1402
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1403
|
+
</auro-accordion>
|
|
1404
|
+
|
|
1405
|
+
### Help Text
|
|
1406
|
+
|
|
1407
|
+
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.
|
|
1408
|
+
|
|
1409
|
+
<div class="exampleWrapper">
|
|
1410
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/help-text.html) -->
|
|
1411
|
+
<!-- The below content is automatically added from ./../apiExamples/help-text.html -->
|
|
1412
|
+
<auro-datepicker>
|
|
1413
|
+
<span slot="bib.fullscreen.headline">helpText Example</span>
|
|
1123
1414
|
<span slot="fromLabel">Choose a date</span>
|
|
1124
1415
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1125
|
-
<span slot="
|
|
1416
|
+
<span slot="helpText">Choose a date must be today or earlier.</span>
|
|
1126
1417
|
</auro-datepicker>
|
|
1127
1418
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1128
|
-
</div>
|
|
1419
|
+
</div>
|
|
1129
1420
|
<auro-accordion alignRight>
|
|
1130
1421
|
<span slot="trigger">See code</span>
|
|
1131
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
1132
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1422
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/help-text.html) -->
|
|
1423
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/help-text.html -->
|
|
1133
1424
|
|
|
1134
1425
|
```html
|
|
1135
1426
|
<auro-datepicker>
|
|
1136
|
-
<span slot="
|
|
1137
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1427
|
+
<span slot="bib.fullscreen.headline">helpText Example</span>
|
|
1138
1428
|
<span slot="fromLabel">Choose a date</span>
|
|
1139
1429
|
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1140
|
-
<span slot="
|
|
1430
|
+
<span slot="helpText">Choose a date must be today or earlier.</span>
|
|
1141
1431
|
</auro-datepicker>
|
|
1142
1432
|
```
|
|
1143
1433
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1144
1434
|
</auro-accordion>
|
|
1145
1435
|
|
|
1146
|
-
|
|
1436
|
+
### Date Slot
|
|
1147
1437
|
|
|
1148
1438
|
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`).
|
|
1149
1439
|
|
|
@@ -1154,8 +1444,8 @@ Slot content support is limited to text only and a maximum of five (5) character
|
|
|
1154
1444
|
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"`).
|
|
1155
1445
|
|
|
1156
1446
|
<div class="exampleWrapper">
|
|
1157
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
1158
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
1447
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/date-slot.html) -->
|
|
1448
|
+
<!-- The below content is automatically added from ./../apiExamples/date-slot.html -->
|
|
1159
1449
|
<auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
1160
1450
|
<span slot="bib.fullscreen.headline">dateSlot Example</span>
|
|
1161
1451
|
<span slot="fromLabel">Choose a date</span>
|
|
@@ -1172,8 +1462,8 @@ Slot content can be styled using [inline styles](https://www.codecademy.com/arti
|
|
|
1172
1462
|
</div>
|
|
1173
1463
|
<auro-accordion alignRight>
|
|
1174
1464
|
<span slot="trigger">See code</span>
|
|
1175
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
1176
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1465
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/date-slot.html) -->
|
|
1466
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/date-slot.html -->
|
|
1177
1467
|
|
|
1178
1468
|
```html
|
|
1179
1469
|
<auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
@@ -1192,15 +1482,15 @@ Slot content can be styled using [inline styles](https://www.codecademy.com/arti
|
|
|
1192
1482
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1193
1483
|
</auro-accordion>
|
|
1194
1484
|
|
|
1195
|
-
|
|
1485
|
+
### Popover Slot
|
|
1196
1486
|
|
|
1197
1487
|
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`).
|
|
1198
1488
|
|
|
1199
1489
|
The popover slot is intended for use with calendar dates that are `disabled` (e.g. before minimum date or after maximum date).
|
|
1200
1490
|
|
|
1201
1491
|
<div class="exampleWrapper">
|
|
1202
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
1203
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
1492
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/popover-slot.html) -->
|
|
1493
|
+
<!-- The below content is automatically added from ./../apiExamples/popover-slot.html -->
|
|
1204
1494
|
<auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
1205
1495
|
<span slot="bib.fullscreen.headline">Popover Slot Example</span>
|
|
1206
1496
|
<span slot="fromLabel">Choose a date</span>
|
|
@@ -1217,8 +1507,8 @@ The popover slot is intended for use with calendar dates that are `disabled` (e.
|
|
|
1217
1507
|
</div>
|
|
1218
1508
|
<auro-accordion alignRight>
|
|
1219
1509
|
<span slot="trigger">See code</span>
|
|
1220
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
1221
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1510
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/popover-slot.html) -->
|
|
1511
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/popover-slot.html -->
|
|
1222
1512
|
|
|
1223
1513
|
```html
|
|
1224
1514
|
<auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
@@ -1237,103 +1527,15 @@ The popover slot is intended for use with calendar dates that are `disabled` (e.
|
|
|
1237
1527
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1238
1528
|
</auro-accordion>
|
|
1239
1529
|
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
#### Localization
|
|
1243
|
-
|
|
1244
|
-
The datepicker supports localized month names through the `monthNames` property.
|
|
1245
|
-
|
|
1246
|
-
This example demonstrates how to set the `monthNames` property to Korean month names, with a Korean date format.
|
|
1247
|
-
|
|
1248
|
-
<div class="exampleWrapper">
|
|
1249
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization.html) -->
|
|
1250
|
-
<!-- The below content is automatically added from ./../apiExamples/localization.html -->
|
|
1251
|
-
<auro-datepicker format="yyyy/mm/dd" id="localizationExample">
|
|
1252
|
-
<span slot="bib.fullscreen.headline">Localization Headline</span>
|
|
1253
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1254
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1255
|
-
</auro-datepicker>
|
|
1256
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1257
|
-
</div>
|
|
1258
|
-
<auro-accordion alignRight>
|
|
1259
|
-
<span slot="trigger">See code</span>
|
|
1260
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/localization.html) -->
|
|
1261
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/localization.html -->
|
|
1262
|
-
|
|
1263
|
-
```html
|
|
1264
|
-
<auro-datepicker format="yyyy/mm/dd" id="localizationExample">
|
|
1265
|
-
<span slot="bib.fullscreen.headline">Localization Headline</span>
|
|
1266
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1267
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1268
|
-
</auro-datepicker>
|
|
1269
|
-
```
|
|
1270
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1271
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/localization.js) -->
|
|
1272
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/localization.js -->
|
|
1273
|
-
|
|
1274
|
-
```js
|
|
1275
|
-
export function localizationExample() {
|
|
1276
|
-
const localizedDatepicker = document.querySelector("#localizationExample");
|
|
1277
|
-
|
|
1278
|
-
localizedDatepicker.monthNames = ['일월', '이월', '삼월', '사월', '오월', '유월', '칠월', '팔월', '구월', '시월', '십일월', '십이월'];
|
|
1279
|
-
}
|
|
1280
|
-
```
|
|
1281
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1282
|
-
</auro-accordion>
|
|
1283
|
-
|
|
1284
|
-
#### Reset State
|
|
1285
|
-
|
|
1286
|
-
Use the `reset()` method to reset the `<auro-datepicker>`'s `value`, `valueEnd` and `validity` state. Doing so will preserve all other attributes and properties.
|
|
1287
|
-
|
|
1288
|
-
<div class="exampleWrapper">
|
|
1289
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/resetState.html) -->
|
|
1290
|
-
<!-- The below content is automatically added from ./../apiExamples/resetState.html -->
|
|
1291
|
-
<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.">
|
|
1292
|
-
<span slot="bib.fullscreen.headline">Reset Example</span>
|
|
1293
|
-
<span slot="fromLabel">Departure</span>
|
|
1294
|
-
<span slot="toLabel">Return</span>
|
|
1295
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1296
|
-
</auro-datepicker>
|
|
1297
|
-
<auro-button id="resetStateBtn">Reset</auro-button>
|
|
1298
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1299
|
-
</div>
|
|
1300
|
-
<auro-accordion alignRight>
|
|
1301
|
-
<span slot="trigger">See code</span>
|
|
1302
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/resetState.html) -->
|
|
1303
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/resetState.html -->
|
|
1304
|
-
|
|
1305
|
-
```html
|
|
1306
|
-
<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.">
|
|
1307
|
-
<span slot="bib.fullscreen.headline">Reset Example</span>
|
|
1308
|
-
<span slot="fromLabel">Departure</span>
|
|
1309
|
-
<span slot="toLabel">Return</span>
|
|
1310
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1311
|
-
</auro-datepicker>
|
|
1312
|
-
<auro-button id="resetStateBtn">Reset</auro-button>
|
|
1313
|
-
```
|
|
1314
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1315
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/resetState.js) -->
|
|
1316
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/resetState.js -->
|
|
1317
|
-
|
|
1318
|
-
```js
|
|
1319
|
-
export function resetStateExample() {
|
|
1320
|
-
const elem = document.querySelector('#resetStateExample');
|
|
1321
|
-
|
|
1322
|
-
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
1323
|
-
elem.reset();
|
|
1324
|
-
});
|
|
1325
|
-
}
|
|
1326
|
-
```
|
|
1327
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1328
|
-
</auro-accordion>
|
|
1530
|
+
## Common Usage Patterns & Functional Examples
|
|
1329
1531
|
|
|
1330
|
-
|
|
1532
|
+
### Dynamic Slot Content
|
|
1331
1533
|
|
|
1332
1534
|
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.
|
|
1333
1535
|
|
|
1334
1536
|
<div class="exampleWrapper">
|
|
1335
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
1336
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
1537
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dynamic-slot.html) -->
|
|
1538
|
+
<!-- The below content is automatically added from ./../apiExamples/dynamic-slot.html -->
|
|
1337
1539
|
<auro-datepicker id="slotContentExample" centralDate="12/13/2023" minDate="12/13/2023" maxDate="01/18/2024" range>
|
|
1338
1540
|
<span slot="bib.fullscreen.headline">dynamic slot Example</span>
|
|
1339
1541
|
<span slot="fromLabel">Departure</span>
|
|
@@ -1344,8 +1546,8 @@ This example demonstrates data driven slot content for days in the calendar. In
|
|
|
1344
1546
|
</div>
|
|
1345
1547
|
<auro-accordion alignRight>
|
|
1346
1548
|
<span slot="trigger">See code</span>
|
|
1347
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
1348
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1549
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dynamic-slot.html) -->
|
|
1550
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/dynamic-slot.html -->
|
|
1349
1551
|
|
|
1350
1552
|
```html
|
|
1351
1553
|
<auro-datepicker id="slotContentExample" centralDate="12/13/2023" minDate="12/13/2023" maxDate="01/18/2024" range>
|
|
@@ -1356,8 +1558,8 @@ This example demonstrates data driven slot content for days in the calendar. In
|
|
|
1356
1558
|
</auro-datepicker>
|
|
1357
1559
|
```
|
|
1358
1560
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1359
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
1360
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1561
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dynamic-slot.js) -->
|
|
1562
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/dynamic-slot.js -->
|
|
1361
1563
|
|
|
1362
1564
|
```js
|
|
1363
1565
|
export function populateSlotContentExample() {
|
|
@@ -1483,56 +1685,13 @@ export function populateSlotContentExample() {
|
|
|
1483
1685
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1484
1686
|
</auro-accordion>
|
|
1485
1687
|
|
|
1486
|
-
###
|
|
1487
|
-
|
|
1488
|
-
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.
|
|
1489
|
-
|
|
1490
|
-
<div class="exampleWrapper">
|
|
1491
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/alertValue.html) -->
|
|
1492
|
-
<!-- The below content is automatically added from ./../apiExamples/alertValue.html -->
|
|
1493
|
-
<auro-datepicker id="datePickerValueAlert">
|
|
1494
|
-
<span slot="bib.fullscreen.headline">Alert Value Example</span>
|
|
1495
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1496
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1497
|
-
</auro-datepicker>
|
|
1498
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1499
|
-
</div>
|
|
1500
|
-
<auro-accordion alignRight>
|
|
1501
|
-
<span slot="trigger">See code</span>
|
|
1502
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/alertValue.html) -->
|
|
1503
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/alertValue.html -->
|
|
1504
|
-
|
|
1505
|
-
```html
|
|
1506
|
-
<auro-datepicker id="datePickerValueAlert">
|
|
1507
|
-
<span slot="bib.fullscreen.headline">Alert Value Example</span>
|
|
1508
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1509
|
-
<span slot="bib.fullscreen.dateLabel">Choose a date</span>
|
|
1510
|
-
</auro-datepicker>
|
|
1511
|
-
```
|
|
1512
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1513
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/alertValue.js) -->
|
|
1514
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/alertValue.js -->
|
|
1515
|
-
|
|
1516
|
-
```js
|
|
1517
|
-
export function alertValueExample() {
|
|
1518
|
-
const valueAlertExample = document.querySelector('#datePickerValueAlert');
|
|
1519
|
-
|
|
1520
|
-
valueAlertExample.addEventListener('auroDatePicker-valueSet', () => {
|
|
1521
|
-
console.warn('Select value changed to:', valueAlertExample.value);
|
|
1522
|
-
alert(`Select value changed to: ${valueAlertExample.value}`);
|
|
1523
|
-
})
|
|
1524
|
-
}
|
|
1525
|
-
```
|
|
1526
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1527
|
-
</auro-accordion>
|
|
1528
|
-
|
|
1529
|
-
#### in Dialog
|
|
1688
|
+
### Datepicker in Dialog
|
|
1530
1689
|
|
|
1531
|
-
The
|
|
1690
|
+
The following example demonstrates the use of `<auro-datepicker>` within an `<auro-dialog>` component.
|
|
1532
1691
|
|
|
1533
1692
|
<div class="exampleWrapper">
|
|
1534
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
1535
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
1693
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/in-dialog.html) -->
|
|
1694
|
+
<!-- The below content is automatically added from ./../apiExamples/in-dialog.html -->
|
|
1536
1695
|
<div>
|
|
1537
1696
|
<auro-button id="datepicker-dialog-opener">Datepicker in Dialog</auro-button>
|
|
1538
1697
|
<auro-dialog id="datepicker-dialog">
|
|
@@ -1547,8 +1706,8 @@ The component can be in a dialog.
|
|
|
1547
1706
|
</div>
|
|
1548
1707
|
<auro-accordion alignRight>
|
|
1549
1708
|
<span slot="trigger">See code</span>
|
|
1550
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
1551
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1709
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/in-dialog.html) -->
|
|
1710
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/in-dialog.html -->
|
|
1552
1711
|
|
|
1553
1712
|
```html
|
|
1554
1713
|
<div>
|
|
@@ -1563,8 +1722,8 @@ The component can be in a dialog.
|
|
|
1563
1722
|
</div>
|
|
1564
1723
|
```
|
|
1565
1724
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1566
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
1567
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
1725
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/in-dialog.js) -->
|
|
1726
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/in-dialog.js -->
|
|
1568
1727
|
|
|
1569
1728
|
```js
|
|
1570
1729
|
export function inDialogExample() {
|
|
@@ -1577,9 +1736,9 @@ export function inDialogExample() {
|
|
|
1577
1736
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1578
1737
|
</auro-accordion>
|
|
1579
1738
|
|
|
1580
|
-
|
|
1739
|
+
## Restyle Component with CSS Variables
|
|
1581
1740
|
|
|
1582
|
-
The component may be restyled
|
|
1741
|
+
The component may be restyled by changing the values of the following token(s).
|
|
1583
1742
|
|
|
1584
1743
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
1585
1744
|
<!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
|