@aurodesignsystem-dev/auro-formkit 0.0.0-pr1451.2 → 0.0.0-pr1451.21
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/components/checkbox/README.md +11 -27
- package/components/checkbox/demo/accessibility.html +49 -0
- package/components/checkbox/demo/accessibility.md +44 -0
- package/components/checkbox/demo/api.html +17 -25
- package/components/checkbox/demo/api.md +40 -416
- package/components/checkbox/demo/api.min.js +5 -4
- package/components/checkbox/demo/customize.html +52 -0
- package/components/checkbox/demo/customize.md +361 -0
- package/components/checkbox/demo/demo-support.js +60 -0
- package/components/checkbox/demo/design.html +52 -0
- package/components/checkbox/demo/design.md +149 -0
- package/components/checkbox/demo/getting-started.html +52 -0
- package/components/checkbox/demo/getting-started.md +261 -0
- package/components/checkbox/demo/index.html +17 -20
- package/components/checkbox/demo/index.md +144 -29
- package/components/checkbox/demo/index.min.js +5 -4
- package/components/checkbox/demo/keyboard-behavior.html +49 -0
- package/components/checkbox/demo/keyboard-behavior.md +0 -3
- package/components/checkbox/demo/layout.md +30 -0
- package/components/checkbox/demo/readme.html +10 -17
- package/components/checkbox/demo/readme.md +11 -27
- package/components/checkbox/demo/styles.css +974 -0
- package/components/checkbox/demo/voiceover.html +49 -0
- package/components/checkbox/demo/voiceover.md +37 -0
- package/components/checkbox/dist/auro-checkbox.d.ts +1 -0
- package/components/checkbox/dist/index.js +5 -4
- package/components/checkbox/dist/registered.js +5 -4
- package/components/combobox/README.md +8 -29
- package/components/combobox/demo/accessibility.html +2 -20
- package/components/combobox/demo/accessibility.md +1 -1
- package/components/combobox/demo/api.html +5 -52
- package/components/combobox/demo/api.md +53 -2261
- package/components/combobox/demo/api.min.js +15 -12
- package/components/combobox/demo/customize.html +53 -0
- package/components/combobox/demo/customize.js +24 -0
- package/components/combobox/demo/customize.md +1249 -0
- package/components/combobox/demo/customize.min.js +18132 -0
- package/components/combobox/demo/demo-support.js +60 -0
- package/components/combobox/demo/design.html +2 -43
- package/components/combobox/demo/design.md +4 -4
- package/components/combobox/demo/getting-started.html +53 -0
- package/components/combobox/demo/{install.js → getting-started.js} +2 -5
- package/components/combobox/demo/getting-started.md +397 -0
- package/components/combobox/demo/{install.min.js → getting-started.min.js} +14 -38
- package/components/combobox/demo/index.html +4 -47
- package/components/combobox/demo/index.md +3 -569
- package/components/combobox/demo/index.min.js +15 -12
- package/components/combobox/demo/keyboard-behavior.html +2 -20
- package/components/combobox/demo/keyboard-behavior.md +2 -2
- package/components/combobox/demo/layout.md +2 -2
- package/components/combobox/demo/readme.html +2 -43
- package/components/combobox/demo/readme.md +8 -29
- package/components/combobox/demo/styles.css +98 -105
- package/components/combobox/demo/voiceover.html +2 -20
- package/components/combobox/demo/voiceover.md +1 -1
- package/components/combobox/dist/index.js +12 -10
- package/components/combobox/dist/registered.js +12 -10
- package/components/counter/README.md +21 -51
- package/components/counter/demo/accessibility.html +49 -0
- package/components/counter/demo/accessibility.md +34 -0
- package/components/counter/demo/api.html +12 -20
- package/components/counter/demo/api.md +49 -1299
- package/components/counter/demo/api.min.js +6 -6
- package/components/counter/demo/customize.html +53 -0
- package/components/counter/demo/customize.md +650 -0
- package/components/counter/demo/demo-support.js +60 -0
- package/components/counter/demo/design.html +52 -0
- package/components/counter/demo/design.md +192 -0
- package/components/counter/demo/getting-started.html +54 -0
- package/components/counter/demo/getting-started.md +332 -0
- package/components/counter/demo/index.html +14 -19
- package/components/counter/demo/index.md +113 -47
- package/components/counter/demo/index.min.js +6 -6
- package/components/counter/demo/keyboard-behavior.html +49 -0
- package/components/counter/demo/keyboard-behavior.md +1 -1
- package/components/counter/demo/keyboardBehavior.html +7 -39
- package/components/counter/demo/layout.md +10 -0
- package/components/counter/demo/readme.html +11 -15
- package/components/counter/demo/readme.md +21 -51
- package/components/counter/demo/styles.css +974 -0
- package/components/counter/demo/voiceover.html +51 -0
- package/components/counter/demo/voiceover.md +80 -0
- package/components/counter/dist/index.js +6 -6
- package/components/counter/dist/registered.js +6 -6
- package/components/datepicker/README.md +10 -24
- package/components/datepicker/demo/accessibility.html +50 -0
- package/components/datepicker/demo/accessibility.md +64 -0
- package/components/datepicker/demo/api.md +69 -1739
- package/components/datepicker/demo/api.min.js +14 -14
- package/components/datepicker/demo/customize.html +53 -0
- package/components/datepicker/demo/customize.md +723 -0
- package/components/datepicker/demo/demo-support.js +60 -0
- package/components/{select/demo/layout.html → datepicker/demo/design.html} +7 -47
- package/components/datepicker/demo/design.md +158 -0
- package/components/datepicker/demo/getting-started.html +53 -0
- package/components/datepicker/demo/getting-started.md +237 -0
- package/components/datepicker/demo/index.html +14 -34
- package/components/datepicker/demo/index.md +160 -103
- package/components/datepicker/demo/index.min.js +14 -14
- package/components/datepicker/demo/keyboard-behavior.html +12 -33
- package/components/datepicker/demo/layout.md +92 -0
- package/components/datepicker/demo/readme.md +10 -24
- package/components/datepicker/demo/styles.css +974 -0
- package/components/{dropdown/demo/keyboardBehavior.html → datepicker/demo/voiceover.html} +14 -36
- package/components/datepicker/demo/voiceover.md +98 -0
- package/components/datepicker/dist/index.js +14 -14
- package/components/datepicker/dist/registered.js +14 -14
- package/components/dropdown/README.md +0 -25
- package/components/dropdown/demo/accessibility.html +49 -0
- package/components/dropdown/demo/accessibility.md +45 -0
- package/components/dropdown/demo/api.html +10 -19
- package/components/dropdown/demo/api.md +40 -1364
- package/components/dropdown/demo/api.min.js +2 -2
- package/components/dropdown/demo/customize.html +54 -0
- package/components/dropdown/demo/customize.md +780 -0
- package/components/dropdown/demo/demo-support.js +60 -0
- package/components/dropdown/demo/design.html +52 -0
- package/components/dropdown/demo/design.md +186 -0
- package/components/dropdown/demo/getting-started.html +54 -0
- package/components/dropdown/demo/getting-started.md +317 -0
- package/components/dropdown/demo/index.html +12 -20
- package/components/dropdown/demo/index.md +70 -225
- package/components/dropdown/demo/index.min.js +2 -2
- package/components/dropdown/demo/keyboard-behavior.html +49 -0
- package/components/dropdown/demo/keyboard-behavior.md +4 -8
- package/components/dropdown/demo/layout.md +21 -0
- package/components/dropdown/demo/readme.html +7 -20
- package/components/dropdown/demo/readme.md +0 -25
- package/components/dropdown/demo/styles.css +974 -0
- package/components/dropdown/demo/voiceover.html +51 -0
- package/components/dropdown/demo/voiceover.md +63 -0
- package/components/dropdown/dist/index.js +2 -2
- package/components/dropdown/dist/registered.js +2 -2
- package/components/form/README.md +9 -13
- package/components/form/demo/accessibility.html +51 -0
- package/components/form/demo/accessibility.md +23 -0
- package/components/form/demo/api.html +11 -14
- package/components/form/demo/api.md +14 -290
- package/components/form/demo/api.min.js +53 -50
- package/components/form/demo/customize.html +54 -0
- package/components/form/demo/customize.md +246 -0
- package/components/form/demo/demo-support.js +60 -0
- package/components/form/demo/getting-started.html +54 -0
- package/components/form/demo/getting-started.md +291 -0
- package/components/form/demo/index.html +12 -14
- package/components/form/demo/index.md +66 -96
- package/components/form/demo/index.min.js +53 -50
- package/components/form/demo/keyboard-behavior.html +51 -0
- package/components/form/demo/readme.html +12 -17
- package/components/form/demo/readme.md +9 -13
- package/components/form/demo/styles.css +974 -0
- package/components/form/demo/voiceover.html +51 -0
- package/components/form/demo/voiceover.md +36 -0
- package/components/helptext/dist/index.js +1 -1
- package/components/helptext/dist/registered.js +1 -1
- package/components/input/README.md +17 -28
- package/components/input/demo/accessibility.html +38 -0
- package/components/input/demo/accessibility.md +69 -0
- package/components/input/demo/api.html +17 -22
- package/components/input/demo/api.js +4 -23
- package/components/input/demo/api.md +67 -1267
- package/components/input/demo/api.min.js +6 -98
- package/components/input/demo/customize.html +54 -0
- package/components/input/demo/customize.js +25 -0
- package/components/input/demo/customize.md +1372 -0
- package/components/input/demo/customize.min.js +7431 -0
- package/components/input/demo/demo-support.js +60 -0
- package/components/input/demo/design.html +39 -0
- package/components/input/demo/design.md +224 -0
- package/components/input/demo/getting-started.html +53 -0
- package/components/input/demo/getting-started.js +8 -0
- package/components/input/demo/getting-started.md +312 -0
- package/components/input/demo/getting-started.min.js +7369 -0
- package/components/input/demo/index.html +16 -22
- package/components/input/demo/index.js +0 -11
- package/components/input/demo/index.md +171 -139
- package/components/input/demo/index.min.js +6 -18
- package/components/input/demo/keyboard-behavior.html +38 -0
- package/components/input/demo/layout.md +77 -0
- package/components/input/demo/readme.md +17 -28
- package/components/input/demo/styles.css +974 -0
- package/components/input/demo/voiceover.html +38 -0
- package/components/input/demo/voiceover.md +70 -0
- package/components/input/dist/base-input.d.ts +1 -0
- package/components/input/dist/index.js +6 -6
- package/components/input/dist/registered.js +6 -6
- package/components/menu/README.md +1 -5
- package/components/menu/demo/api.md +43 -43
- package/components/menu/demo/api.min.js +2 -2
- package/components/menu/demo/index.md +1 -1
- package/components/menu/demo/index.min.js +2 -2
- package/components/menu/demo/readme.md +1 -5
- package/components/menu/dist/index.js +2 -2
- package/components/menu/dist/registered.js +2 -2
- package/components/radio/README.md +9 -22
- package/components/radio/demo/accessibility.html +51 -0
- package/components/radio/demo/accessibility.md +44 -0
- package/components/radio/demo/api.html +13 -20
- package/components/radio/demo/api.md +44 -589
- package/components/radio/demo/api.min.js +3 -3
- package/components/radio/demo/customize.html +53 -0
- package/components/radio/demo/customize.md +368 -0
- package/components/radio/demo/demo-support.js +60 -0
- package/components/radio/demo/design.html +52 -0
- package/components/radio/demo/design.md +143 -0
- package/components/radio/demo/getting-started.html +54 -0
- package/components/radio/demo/getting-started.md +296 -0
- package/components/radio/demo/index.html +16 -19
- package/components/radio/demo/index.md +110 -45
- package/components/radio/demo/index.min.js +3 -3
- package/components/radio/demo/keyboard-behavior.html +51 -0
- package/components/radio/demo/layout.md +30 -0
- package/components/radio/demo/readme.html +11 -17
- package/components/radio/demo/readme.md +9 -22
- package/components/radio/demo/styles.css +974 -0
- package/components/radio/demo/voiceover.html +51 -0
- package/components/radio/demo/voiceover.md +43 -0
- package/components/radio/dist/index.js +3 -3
- package/components/radio/dist/registered.js +3 -3
- package/components/select/README.md +7 -4
- package/components/select/demo/accessibility.html +5 -21
- package/components/select/demo/accessibility.md +1 -1
- package/components/select/demo/api.html +3 -48
- package/components/select/demo/api.md +52 -2342
- package/components/select/demo/customize.html +54 -0
- package/components/select/demo/customize.js +11 -0
- package/components/select/demo/customize.md +1049 -0
- package/components/select/demo/{api.min.js → customize.min.js} +12 -113
- package/components/select/demo/demo-support.js +60 -0
- package/components/select/demo/design.html +3 -44
- package/components/select/demo/design.md +2 -2
- package/components/select/demo/getting-started.html +5 -76
- package/components/select/demo/getting-started.js +20 -3
- package/components/select/demo/getting-started.md +97 -705
- package/components/select/demo/getting-started.min.js +58 -9
- package/components/select/demo/index.html +4 -43
- package/components/select/demo/index.js +5 -3
- package/components/select/demo/index.md +2 -2
- package/components/select/demo/index.min.js +14 -9
- package/components/select/demo/keyboard-behavior.html +6 -47
- package/components/select/demo/keyboard-behavior.md +5 -6
- package/components/select/demo/keyboardBehavior.html +4 -46
- package/components/select/demo/readme.html +3 -44
- package/components/select/demo/readme.md +7 -4
- package/components/select/demo/styles.css +57 -109
- package/components/select/demo/voiceover.html +3 -30
- package/components/select/dist/index.js +5 -5
- package/components/select/dist/registered.js +5 -5
- package/custom-elements.json +249 -246
- package/package.json +3 -3
- package/components/combobox/demo/install.html +0 -94
- package/components/combobox/demo/install.md +0 -98
- package/components/select/demo/api.js +0 -39
- package/components/select/demo/install.md +0 -92
|
@@ -8,63 +8,63 @@ The `auro-datepicker` component provides users with a way to select a date or da
|
|
|
8
8
|
## Properties
|
|
9
9
|
|
|
10
10
|
| Property | Attribute | Modifiers | Type | Default | Description |
|
|
11
|
-
|-----------------------------------|-----------------------------------|-----------|--------------------------------------------------|--------------------------------------------------|--------------------------------------------------|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
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
|
-
|
|
|
52
|
-
|
|
|
11
|
+
|-----------------------------------|-----------------------------------|-----------|--------------------------------------------------|--------------------------------------------------|--------------------------------------------------|
|
|
12
|
+
| `appearance` | `appearance` | | `string` | "'default'" | Defines whether the component will be on lighter or darker backgrounds. |
|
|
13
|
+
| `autoPlacement` | `autoPlacement` | | `boolean` | "false" | If declared, bib's position will be automatically calculated where to appear. |
|
|
14
|
+
| `calendarEndDate` | `calendarEndDate` | | `string` | "undefined" | The last date that may be displayed in the calendar. |
|
|
15
|
+
| `calendarFocusDate` | `calendarFocusDate` | | `string` | "value" | The date that will first be visually rendered to the user in the calendar. |
|
|
16
|
+
| `calendarStartDate` | `calendarStartDate` | | `string` | "undefined" | The first date that may be displayed in the calendar. |
|
|
17
|
+
| `centralDate` | `centralDate` | | `string` | | The date that determines the currently visible month. |
|
|
18
|
+
| `disabled` | `disabled` | | `boolean` | false | If set, disables the datepicker. |
|
|
19
|
+
| `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` | | `string` | | When defined, sets persistent validity to `customError` and sets the validation message to the attribute value. |
|
|
21
|
+
| `format` | `format` | | `string` | "mm/dd/yyyy" | Specifies the date format. The default is `mm/dd/yyyy`. |
|
|
22
|
+
| `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` | | readonly | `boolean` | | |
|
|
24
|
+
| `inputmode` | `inputmode` | | `string` | | Exposes inputmode attribute for input. |
|
|
25
|
+
| `largeFullscreenHeadline` | `largeFullscreenHeadline` | | `boolean` | false | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600. |
|
|
26
|
+
| `layout` | `layout` | | `'classic' \| 'snowflake'` | "'classic'" | Sets the layout of the datepicker. |
|
|
27
|
+
| `maxDate` | `maxDate` | | `string` | | Maximum date. All dates after will be disabled. |
|
|
28
|
+
| `minDate` | `minDate` | | `string` | | Minimum date. All dates before will be disabled. |
|
|
29
|
+
| `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` | | `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` | | `boolean` | false | If set, disables auto-validation on blur. |
|
|
32
|
+
| `offset` | `offset` | | `number` | "0" | Gap between the trigger element and bib. |
|
|
33
|
+
| `onDark` | `onDark` | | `boolean` | false | DEPRECATED - use `appearance="inverse"` instead. |
|
|
34
|
+
| `placeholder` | `placeholder` | | `string` | | Placeholder text to display in the input(s) when no value is set. |
|
|
35
|
+
| `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` | | `'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` | | `boolean` | false | If set, turns on date range functionality in auro-calendar. |
|
|
38
|
+
| `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` | | `boolean` | false | Populates the `required` attribute on the input. Used for client-side validation. |
|
|
40
|
+
| `setCustomValidity` | `setCustomValidity` | | `string` | | Sets a custom help text message to display for all validityStates. |
|
|
41
|
+
| `setCustomValidityCustomError` | `setCustomValidityCustomError` | | `string` | | Custom help text message to display when validity = `customError`. |
|
|
42
|
+
| `setCustomValidityRangeOverflow` | `setCustomValidityRangeOverflow` | | `string` | | Custom help text message to display when validity = `rangeOverflow`. |
|
|
43
|
+
| `setCustomValidityRangeUnderflow` | `setCustomValidityRangeUnderflow` | | `string` | | Custom help text message to display when validity = `rangeUnderflow`. |
|
|
44
|
+
| `setCustomValidityValueMissing` | `setCustomValidityValueMissing` | | `string` | | Custom help text message to display when validity = `valueMissing`. |
|
|
45
|
+
| `shape` | | | `string` | "classic" | |
|
|
46
|
+
| `shift` | `shift` | | `boolean` | false | If declared, the dropdown will shift its position to avoid being cut off by the viewport. |
|
|
47
|
+
| `size` | | | `string` | "lg" | |
|
|
48
|
+
| `stacked` | `stacked` | | `boolean` | false | Set true to make datepicker stacked style. |
|
|
49
|
+
| `validity` | `validity` | | `string` | "undefined" | Specifies the `validityState` this element is in. |
|
|
50
|
+
| `value` | `value` | | `string` | "undefined" | Value selected for the datepicker. |
|
|
51
|
+
| `valueEnd` | `valueEnd` | | `string` | "undefined" | Value selected for the second datepicker when using date range. |
|
|
52
|
+
| `values` | | readonly | `string[]` | | A convenience wrapper for `value` and `valueEnd`, uses the new Auro "array value pattern". |
|
|
53
53
|
|
|
54
54
|
## Methods
|
|
55
55
|
|
|
56
56
|
| Method | Type | Description |
|
|
57
|
-
|-------------------------------|----------------------------------------|--------------------------------------------------|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
57
|
+
|-------------------------------|----------------------------------------|--------------------------------------------------|
|
|
58
|
+
| `clear` | `(): void` | Clears the current value(s) of the datepicker. |
|
|
59
|
+
| `focus` | `(focusInput?: string): void` | Focuses the datepicker trigger input.<br /><br />**focusInput**: Pass in `endDate` to focus on the return input. No parameter is needed to focus on the depart input. |
|
|
60
|
+
| `hideBib` | `(): void` | Hides the dropdown bib if its open. |
|
|
61
|
+
| `reset` | `(): void` | Resets component to initial state. |
|
|
62
|
+
| `resetInputs` | `(): void` | Resets values without resetting validation. |
|
|
63
|
+
| `resetLayoutClasses` | `(): void` | |
|
|
64
|
+
| `resetShapeClasses` | `(): void` | |
|
|
65
|
+
| `showBib` | `(): void` | Shows the dropdown bib if there are options to show. |
|
|
66
|
+
| `updateComponentArchitecture` | `(): void` | |
|
|
67
|
+
| `validate` | `(force?: boolean \| undefined): void` | Validates value.<br /><br />**force**: Whether to force validation. |
|
|
68
68
|
|
|
69
69
|
## Events
|
|
70
70
|
|
|
@@ -74,8 +74,8 @@ The `auro-datepicker` component provides users with a way to select a date or da
|
|
|
74
74
|
| `auroDatePicker-newSlotContent` | `CustomEvent<any>` | Notifies that new slot content has been added to the datepicker. |
|
|
75
75
|
| `auroDatePicker-toggled` | `CustomEvent<{ expanded: any; }>` | Notifies that the calendar dropdown has been opened/closed. |
|
|
76
76
|
| `auroDatePicker-valueSet` | | Notifies that the component has a new value set. |
|
|
77
|
-
| `auroFormElement-validated` | | Notifies that the component value(s) have been validated. |
|
|
78
|
-
|
|
|
77
|
+
| `auroFormElement-validated` | | Notifies that the component value(s) have been validated. |
|
|
78
|
+
| `input` | | |
|
|
79
79
|
|
|
80
80
|
## Slots
|
|
81
81
|
|
|
@@ -87,1692 +87,22 @@ The `auro-datepicker` component provides users with a way to select a date or da
|
|
|
87
87
|
| `bib.fullscreen.fromLabel` | Defines the content to display above the first input in the mobile layout. |
|
|
88
88
|
| `bib.fullscreen.headline` | Defines the headline to display above bib.fullscreen.dateLabels in the mobile layout. |
|
|
89
89
|
| `bib.fullscreen.toLabel` | Defines the content to display above the second input in the mobile layout when `range` is true. |
|
|
90
|
-
| `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. |
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
| `popover_MM_DD_YYYY` | Defines the content to display in the auro-calendar-cell popover for the specified date. |
|
|
95
|
-
|
|
|
90
|
+
| `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. |
|
|
91
|
+
| `fromLabel` | Defines the label content for the first input. |
|
|
92
|
+
| `helpText` | Defines the content of the helpText. |
|
|
93
|
+
| `label` | Defines the label content for the entire datepicker when `layout="snowflake"`. |
|
|
94
|
+
| `popover_MM_DD_YYYY` | Defines the content to display in the auro-calendar-cell popover for the specified date. |
|
|
95
|
+
| `toLabel` | Defines the label content for the second input when the `range` attribute is used. |
|
|
96
96
|
|
|
97
97
|
## CSS Shadow Parts
|
|
98
98
|
|
|
99
99
|
| Part | Description |
|
|
100
|
-
|-------------------|--------------------------------------------------|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
109
|
-
|
|
110
|
-
## Basic
|
|
111
|
-
|
|
112
|
-
<div class="exampleWrapper">
|
|
113
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
114
|
-
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
115
|
-
<auro-datepicker>
|
|
116
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
117
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
118
|
-
<span slot="fromLabel">Choose a date</span>
|
|
119
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
120
|
-
</auro-datepicker>
|
|
121
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
122
|
-
</div>
|
|
123
|
-
<auro-accordion alignRight>
|
|
124
|
-
<span slot="trigger">See code</span>
|
|
125
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
126
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
127
|
-
|
|
128
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker>
|
|
129
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
130
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
131
|
-
<span slot="fromLabel">Choose a date</span>
|
|
132
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
133
|
-
</auro-datepicker></code></pre>
|
|
134
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
135
|
-
</auro-accordion>
|
|
136
|
-
|
|
137
|
-
## Range
|
|
138
|
-
|
|
139
|
-
The datepicker can also be used to select a range between two dates by adding the `range` attribute.
|
|
140
|
-
|
|
141
|
-
<div class="exampleWrapper">
|
|
142
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/range.html) -->
|
|
143
|
-
<!-- The below content is automatically added from ./../apiExamples/range.html -->
|
|
144
|
-
<auro-datepicker range>
|
|
145
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
146
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
147
|
-
<span slot="fromLabel">Departure</span>
|
|
148
|
-
<span slot="toLabel">Return</span>
|
|
149
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
150
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
151
|
-
</auro-datepicker>
|
|
152
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
153
|
-
</div>
|
|
154
|
-
<auro-accordion alignRight>
|
|
155
|
-
<span slot="trigger">See code</span>
|
|
156
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/range.html) -->
|
|
157
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/range.html -->
|
|
158
|
-
|
|
159
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker range>
|
|
160
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
161
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
162
|
-
<span slot="fromLabel">Departure</span>
|
|
163
|
-
<span slot="toLabel">Return</span>
|
|
164
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
165
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
166
|
-
</auro-datepicker></code></pre>
|
|
167
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
168
|
-
</auro-accordion>
|
|
169
|
-
|
|
170
|
-
## Property & Attribute Examples
|
|
171
|
-
|
|
172
|
-
### Appearance on Dark Backgrounds
|
|
173
|
-
|
|
174
|
-
Use `appearance="inverse"` to display the datepicker on dark backgrounds.
|
|
175
|
-
|
|
176
|
-
<div class="exampleWrapper--ondark">
|
|
177
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse.html) -->
|
|
178
|
-
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
179
|
-
<auro-datepicker appearance="inverse">
|
|
180
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
181
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
182
|
-
<span slot="fromLabel">Choose a date</span>
|
|
183
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
184
|
-
</auro-datepicker>
|
|
185
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
186
|
-
</div>
|
|
187
|
-
<auro-accordion alignRight>
|
|
188
|
-
<span slot="trigger">See code</span>
|
|
189
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse.html) -->
|
|
190
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
191
|
-
|
|
192
|
-
<pre class="language-html"><code class="language-html"><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.fromLabel">Choose a date</span>
|
|
197
|
-
</auro-datepicker></code></pre>
|
|
198
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
199
|
-
</auro-accordion>
|
|
200
|
-
<div class="exampleWrapper--ondark">
|
|
201
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-range.html) -->
|
|
202
|
-
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse-range.html -->
|
|
203
|
-
<auro-datepicker appearance="inverse" range>
|
|
204
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
205
|
-
<span slot="fromLabel">Departure</span>
|
|
206
|
-
<span slot="toLabel">Return</span>
|
|
207
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
208
|
-
<span slot="bib.fullscreen.toLabel">Return</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
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker appearance="inverse" range>
|
|
218
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
219
|
-
<span slot="fromLabel">Departure</span>
|
|
220
|
-
<span slot="toLabel">Return</span>
|
|
221
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
222
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
223
|
-
</auro-datepicker></code></pre>
|
|
224
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
225
|
-
</auro-accordion>
|
|
226
|
-
|
|
227
|
-
### Customized Bib Position
|
|
228
|
-
|
|
229
|
-
The bib position can be customized with `placement`, `offset`, `flip`, `autoPlacement`, and `shift` attributes.
|
|
230
|
-
|
|
231
|
-
- `placement` specifies the preferred position where the bib should appear relative to the trigger.
|
|
232
|
-
- `offset` sets the distance between the trigger and the bib.
|
|
233
|
-
- 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`.
|
|
234
|
-
- Unless `noFlip` is enabled, if there isn't enough space for the preferred `placement`, the bib will automatically flip to an alternative position.
|
|
235
|
-
- `shift` when enabled, adjusts the bib position when it would overflow the viewport boundaries, ensuring it remains visible.
|
|
236
|
-
|
|
237
|
-
<div class="exampleWrapper">
|
|
238
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/floater-config.html) -->
|
|
239
|
-
<!-- The below content is automatically added from ./../apiExamples/floater-config.html -->
|
|
240
|
-
<div style="width: 400px">
|
|
241
|
-
<auro-datepicker offset="20" placement="bottom-start" noFlip>
|
|
242
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
243
|
-
<span slot="fromLabel">bottom-start with 20px offset and noFlip</span>
|
|
244
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
245
|
-
</auro-datepicker>
|
|
246
|
-
<br/>
|
|
247
|
-
<auro-datepicker offset="20" placement="bottom-start">
|
|
248
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
249
|
-
<span slot="fromLabel">bottom-start with 20px offset and flip</span>
|
|
250
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
251
|
-
</auro-datepicker>
|
|
252
|
-
<br/>
|
|
253
|
-
<auro-datepicker offset="20" placement="right" autoPlacement noFlip>
|
|
254
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
255
|
-
<span slot="fromLabel">right with 20px offset, noFlip and autoPlacement</span>
|
|
256
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
257
|
-
</auro-datepicker>
|
|
258
|
-
</div>
|
|
259
|
-
<div style="width: 600px; padding-top: 1em;">
|
|
260
|
-
<p>Range bottom-start with 20px offset, noFlip and shift enabled</p>
|
|
261
|
-
<auro-datepicker range offset="20" placement="bottom-start" shift noFlip minDate="07/08/2025">
|
|
262
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
263
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
264
|
-
<span slot="fromLabel">Departure</span>
|
|
265
|
-
<span slot="toLabel">Return</span>
|
|
266
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
267
|
-
<span slot="bib.fullscreen.toLabel">Return</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
|
-
<pre class="language-html"><code class="language-html"><div style="width: 400px">
|
|
278
|
-
<auro-datepicker offset="20" placement="bottom-start" noFlip>
|
|
279
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
280
|
-
<span slot="fromLabel">bottom-start with 20px offset and noFlip</span>
|
|
281
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
282
|
-
</auro-datepicker>
|
|
283
|
-
<br/>
|
|
284
|
-
<auro-datepicker offset="20" placement="bottom-start">
|
|
285
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
286
|
-
<span slot="fromLabel">bottom-start with 20px offset and flip</span>
|
|
287
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
288
|
-
</auro-datepicker>
|
|
289
|
-
<br/>
|
|
290
|
-
<auro-datepicker offset="20" placement="right" autoPlacement noFlip>
|
|
291
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
292
|
-
<span slot="fromLabel">right with 20px offset, noFlip and autoPlacement</span>
|
|
293
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
294
|
-
</auro-datepicker>
|
|
295
|
-
</div>
|
|
296
|
-
<div style="width: 600px; padding-top: 1em;">
|
|
297
|
-
<p>Range bottom-start with 20px offset, noFlip and shift enabled</p>
|
|
298
|
-
<auro-datepicker range offset="20" placement="bottom-start" shift noFlip minDate="07/08/2025">
|
|
299
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
300
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
301
|
-
<span slot="fromLabel">Departure</span>
|
|
302
|
-
<span slot="toLabel">Return</span>
|
|
303
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
304
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
305
|
-
</auro-datepicker>
|
|
306
|
-
</div></code></pre>
|
|
307
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
308
|
-
</auro-accordion>
|
|
309
|
-
|
|
310
|
-
### Start & End Date
|
|
311
|
-
|
|
312
|
-
The `calendarStartDate` and `calendarEndDate` properties may be used to explicitly control which calendar months _may_ be rendered in the calendar.
|
|
313
|
-
|
|
314
|
-
In <strong>desktop</strong>, the calendar month navigation will be restricted by these dates. In <strong>mobile</strong>, the following logic is used:
|
|
315
|
-
|
|
316
|
-
- if both `calendarStartDate` and `calendarEndDate` are defined: all months between, including these dates, will be rendered.
|
|
317
|
-
- If only `calendarStartDate` is defined: 12 months will be rendered starting with this value.
|
|
318
|
-
- if only `calendarEndDate` is defined: The current date month through the value of this attribute will be rendered.
|
|
319
|
-
|
|
320
|
-
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`.
|
|
321
|
-
|
|
322
|
-
<div class="exampleWrapper">
|
|
323
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/calendar-start-and-end-date.html) -->
|
|
324
|
-
<!-- The below content is automatically added from ./../apiExamples/calendar-start-and-end-date.html -->
|
|
325
|
-
<auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="06/01/2022">
|
|
326
|
-
<span slot="bib.fullscreen.headline">calendarStartDate & calendarEndDate Example</span>
|
|
327
|
-
<span slot="fromLabel">Choose a date</span>
|
|
328
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
329
|
-
</auro-datepicker>
|
|
330
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
331
|
-
</div>
|
|
332
|
-
<auro-accordion alignRight>
|
|
333
|
-
<span slot="trigger">See code</span>
|
|
334
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/calendar-start-and-end-date.html) -->
|
|
335
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/calendar-start-and-end-date.html -->
|
|
336
|
-
|
|
337
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="06/01/2022">
|
|
338
|
-
<span slot="bib.fullscreen.headline">calendarStartDate & calendarEndDate Example</span>
|
|
339
|
-
<span slot="fromLabel">Choose a date</span>
|
|
340
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
341
|
-
</auro-datepicker></code></pre>
|
|
342
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
343
|
-
</auro-accordion>
|
|
344
|
-
|
|
345
|
-
### Focus Date
|
|
346
|
-
|
|
347
|
-
The `calendarFocusDate` controls which calendar month is first presented to the user when they open the dropdown bib.
|
|
348
|
-
|
|
349
|
-
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`.
|
|
350
|
-
|
|
351
|
-
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.
|
|
352
|
-
|
|
353
|
-
<div class="exampleWrapper">
|
|
354
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/calendar-focus-date.html) -->
|
|
355
|
-
<!-- The below content is automatically added from ./../apiExamples/calendar-focus-date.html -->
|
|
356
|
-
<auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="12/01/2023" calendarFocusDate="11/01/2022">
|
|
357
|
-
<span slot="bib.fullscreen.headline">calendarFocusDate Example</span>
|
|
358
|
-
<span slot="fromLabel">Choose a date</span>
|
|
359
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
360
|
-
</auro-datepicker>
|
|
361
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
362
|
-
</div>
|
|
363
|
-
<auro-accordion alignRight>
|
|
364
|
-
<span slot="trigger">See code</span>
|
|
365
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/calendar-focus-date.html) -->
|
|
366
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/calendar-focus-date.html -->
|
|
367
|
-
|
|
368
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="12/01/2023" calendarFocusDate="11/01/2022">
|
|
369
|
-
<span slot="bib.fullscreen.headline">calendarFocusDate Example</span>
|
|
370
|
-
<span slot="fromLabel">Choose a date</span>
|
|
371
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
372
|
-
</auro-datepicker></code></pre>
|
|
373
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
374
|
-
</auro-accordion>
|
|
375
|
-
|
|
376
|
-
### Central Date
|
|
377
|
-
|
|
378
|
-
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.
|
|
379
|
-
|
|
380
|
-
<div class="exampleWrapper">
|
|
381
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/central-date.html) -->
|
|
382
|
-
<!-- The below content is automatically added from ./../apiExamples/central-date.html -->
|
|
383
|
-
<auro-datepicker centralDate="06/16/1980">
|
|
384
|
-
<span slot="bib.fullscreen.headline">centralDate Example</span>
|
|
385
|
-
<span slot="fromLabel">Choose a date</span>
|
|
386
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
387
|
-
</auro-datepicker>
|
|
388
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
389
|
-
</div>
|
|
390
|
-
<auro-accordion alignRight>
|
|
391
|
-
<span slot="trigger">See code</span>
|
|
392
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/central-date.html) -->
|
|
393
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/central-date.html -->
|
|
394
|
-
|
|
395
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker centralDate="06/16/1980">
|
|
396
|
-
<span slot="bib.fullscreen.headline">centralDate Example</span>
|
|
397
|
-
<span slot="fromLabel">Choose a date</span>
|
|
398
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
399
|
-
</auro-datepicker></code></pre>
|
|
400
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
401
|
-
</auro-accordion>
|
|
402
|
-
|
|
403
|
-
#### Disabled
|
|
404
|
-
|
|
405
|
-
Set the `disabled` attribute to disable all interaction with the datepicker.
|
|
406
|
-
|
|
407
|
-
<div class="exampleWrapper">
|
|
408
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
|
|
409
|
-
<!-- The below content is automatically added from ./../apiExamples/disabled.html -->
|
|
410
|
-
<auro-datepicker disabled>
|
|
411
|
-
<span slot="fromLabel">Choose a date</span>
|
|
412
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
413
|
-
</auro-datepicker>
|
|
414
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
415
|
-
</div>
|
|
416
|
-
<auro-accordion alignRight>
|
|
417
|
-
<span slot="trigger">See code</span>
|
|
418
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
|
|
419
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
|
|
420
|
-
|
|
421
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker disabled>
|
|
422
|
-
<span slot="fromLabel">Choose a date</span>
|
|
423
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
424
|
-
</auro-datepicker></code></pre>
|
|
425
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
426
|
-
</auro-accordion>
|
|
427
|
-
|
|
428
|
-
#### Error
|
|
429
|
-
|
|
430
|
-
Use the `error` attribute to apply a persistent custom error that supersedes the HTML5 validation logic.
|
|
431
|
-
|
|
432
|
-
A custom error message can be set using the `error` attribute, or it can be used in conjuction with the `setCustomValidityCustomError` attribute.
|
|
433
|
-
|
|
434
|
-
<div class="exampleWrapper">
|
|
435
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/error.html) -->
|
|
436
|
-
<!-- The below content is automatically added from ./../apiExamples/error.html -->
|
|
437
|
-
<auro-button id="undefinedValueExampleBtnAddError">Set Error</auro-button>
|
|
438
|
-
<auro-button id="undefinedValueExampleBtnRemoveError">Remove Error</auro-button>
|
|
439
|
-
<br />
|
|
440
|
-
<auro-datepicker error="Custom error message" id="errorExample">
|
|
441
|
-
<span slot="bib.fullscreen.headline">Error Example</span>
|
|
442
|
-
<span slot="fromLabel">Choose a date</span>
|
|
443
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
444
|
-
</auro-datepicker>
|
|
445
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
446
|
-
</div>
|
|
447
|
-
<auro-accordion alignRight>
|
|
448
|
-
<span slot="trigger">See code</span>
|
|
449
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/error.html) -->
|
|
450
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/error.html -->
|
|
451
|
-
|
|
452
|
-
<pre class="language-html"><code class="language-html"><auro-button id="undefinedValueExampleBtnAddError">Set Error</auro-button>
|
|
453
|
-
<auro-button id="undefinedValueExampleBtnRemoveError">Remove Error</auro-button>
|
|
454
|
-
<br />
|
|
455
|
-
<auro-datepicker error="Custom error message" id="errorExample">
|
|
456
|
-
<span slot="bib.fullscreen.headline">Error Example</span>
|
|
457
|
-
<span slot="fromLabel">Choose a date</span>
|
|
458
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
459
|
-
</auro-datepicker></code></pre>
|
|
460
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
461
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/error.js) -->
|
|
462
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/error.js -->
|
|
463
|
-
|
|
464
|
-
<pre class="language-js"><code class="language-js">export function errorExample() {
|
|
465
|
-
const errorExample = document.querySelector('#errorExample');
|
|
466
|
-
|
|
467
|
-
document.querySelector('#undefinedValueExampleBtnAddError').addEventListener('click', () => {
|
|
468
|
-
errorExample.error = 'Custom New Error';
|
|
469
|
-
})
|
|
470
|
-
|
|
471
|
-
document.querySelector('#undefinedValueExampleBtnRemoveError').addEventListener('click', () => {
|
|
472
|
-
errorExample.removeAttribute('error');
|
|
473
|
-
})
|
|
474
|
-
}</code></pre>
|
|
475
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
476
|
-
</auro-accordion>
|
|
477
|
-
|
|
478
|
-
### Format
|
|
479
|
-
|
|
480
|
-
The `format` attribute is used to define the date format used by the datepicker. The default value is `mm/dd/yyyy`.
|
|
481
|
-
|
|
482
|
-
<div class="exampleWrapper">
|
|
483
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/format.html) -->
|
|
484
|
-
<!-- The below content is automatically added from ./../apiExamples/format.html -->
|
|
485
|
-
<auro-datepicker format="yyyy/mm/dd">
|
|
486
|
-
<span slot="bib.fullscreen.headline">Format Headline</span>
|
|
487
|
-
<span slot="fromLabel">Choose a date</span>
|
|
488
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
489
|
-
</auro-datepicker>
|
|
490
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
491
|
-
</div>
|
|
492
|
-
<auro-accordion alignRight>
|
|
493
|
-
<span slot="trigger">See code</span>
|
|
494
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/format.html) -->
|
|
495
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/format.html -->
|
|
496
|
-
|
|
497
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker format="yyyy/mm/dd">
|
|
498
|
-
<span slot="bib.fullscreen.headline">Format Headline</span>
|
|
499
|
-
<span slot="fromLabel">Choose a date</span>
|
|
500
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
501
|
-
</auro-datepicker></code></pre>
|
|
502
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
503
|
-
</auro-accordion>
|
|
504
|
-
|
|
505
|
-
### Fullscreen Bib
|
|
506
|
-
|
|
507
|
-
You can make the dropdown open in fullscreen at a specific breakpoint by setting `fullscreenBreakpoint`.
|
|
508
|
-
|
|
509
|
-
The default value of `fullscreenBreakpoint` is `sm`.
|
|
510
|
-
|
|
511
|
-
Breakpoint token can be found [here](https://auro.alaskaair.com/getting-started/developers/design-tokens).
|
|
512
|
-
|
|
513
|
-
To support fullcreen bib, setting `bib.fullscreen.headline` is **STRONGLY RECOMMENDED**.
|
|
514
|
-
|
|
515
|
-
<div class="exampleWrapper">
|
|
516
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/fullscreen-breakpoint.html) -->
|
|
517
|
-
<!-- The below content is automatically added from ./../apiExamples/fullscreen-breakpoint.html -->
|
|
518
|
-
<auro-datepicker fullscreenBreakpoint="lg">
|
|
519
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
520
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
521
|
-
<span slot="fromLabel">Choose a date</span>
|
|
522
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
523
|
-
</auro-datepicker>
|
|
524
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
525
|
-
</div>
|
|
526
|
-
<auro-accordion alignRight>
|
|
527
|
-
<span slot="trigger">See code</span>
|
|
528
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/fullscreen-breakpoint.html) -->
|
|
529
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/fullscreen-breakpoint.html -->
|
|
530
|
-
|
|
531
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker fullscreenBreakpoint="lg">
|
|
532
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
533
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
534
|
-
<span slot="fromLabel">Choose a date</span>
|
|
535
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
536
|
-
</auro-datepicker></code></pre>
|
|
537
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
538
|
-
</auro-accordion>
|
|
539
|
-
|
|
540
|
-
### Input Mode
|
|
541
|
-
|
|
542
|
-
You can manually set the input mode for the input with the `inputmode` attribute.
|
|
543
|
-
|
|
544
|
-
<div class="exampleWrapper">
|
|
545
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inputmode.html) -->
|
|
546
|
-
<!-- The below content is automatically added from ./../apiExamples/inputmode.html -->
|
|
547
|
-
<auro-datepicker inputmode="numeric">
|
|
548
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
549
|
-
<span slot="fromLabel">Choose a date</span>
|
|
550
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
551
|
-
</auro-datepicker>
|
|
552
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
553
|
-
</div>
|
|
554
|
-
<auro-accordion alignRight>
|
|
555
|
-
<span slot="trigger">See code</span>
|
|
556
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/inputmode.html) -->
|
|
557
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/inputmode.html -->
|
|
558
|
-
|
|
559
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker inputmode="numeric">
|
|
560
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
561
|
-
<span slot="fromLabel">Choose a date</span>
|
|
562
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
563
|
-
</auro-datepicker></code></pre>
|
|
564
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
565
|
-
</auro-accordion>
|
|
566
|
-
|
|
567
|
-
### Max Date
|
|
568
|
-
|
|
569
|
-
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.
|
|
570
|
-
|
|
571
|
-
<div class="exampleWrapper">
|
|
572
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/max-date.html) -->
|
|
573
|
-
<!-- The below content is automatically added from ./../apiExamples/max-date.html -->
|
|
574
|
-
<auro-datepicker maxDate="03/25/2023" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
575
|
-
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
576
|
-
<span slot="fromLabel">Choose a date</span>
|
|
577
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
578
|
-
</auro-datepicker>
|
|
579
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
580
|
-
</div>
|
|
581
|
-
<auro-accordion alignRight>
|
|
582
|
-
<span slot="trigger">See code</span>
|
|
583
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/max-date.html) -->
|
|
584
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/max-date.html -->
|
|
585
|
-
|
|
586
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker maxDate="03/25/2023" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
587
|
-
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
588
|
-
<span slot="fromLabel">Choose a date</span>
|
|
589
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
590
|
-
</auro-datepicker></code></pre>
|
|
591
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
592
|
-
</auro-accordion>
|
|
593
|
-
|
|
594
|
-
#### Update Max Date
|
|
595
|
-
|
|
596
|
-
Setting the `maxDate` attribute to a date earlier than the auro-datepicker `value` will result in the following changes to the component state:
|
|
597
|
-
|
|
598
|
-
* `value` will to reset to `undefined`.
|
|
599
|
-
* If the currently viewed calendar month is later than the new `maxDate`, the calendar view will move to the new `maxDate` month.
|
|
600
|
-
|
|
601
|
-
This example demonstrates that behavior.
|
|
602
|
-
|
|
603
|
-
<div class="exampleWrapper">
|
|
604
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/update-max-date.html) -->
|
|
605
|
-
<!-- The below content is automatically added from ./../apiExamples/update-max-date.html -->
|
|
606
|
-
<auro-button id="maxDateChange">Change maxDate to Today's Date</auro-button>
|
|
607
|
-
<auro-button id="resetMaxDate">Reset Datepicker to Initial Example</auro-button>
|
|
608
|
-
<br />
|
|
609
|
-
<auro-datepicker id="maxDateExample" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
610
|
-
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
611
|
-
<span slot="fromLabel">Choose a date</span>
|
|
612
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
613
|
-
</auro-datepicker>
|
|
614
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
615
|
-
</div>
|
|
616
|
-
<auro-accordion alignRight>
|
|
617
|
-
<span slot="trigger">See code</span>
|
|
618
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-max-date.html) -->
|
|
619
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/update-max-date.html -->
|
|
620
|
-
|
|
621
|
-
<pre class="language-html"><code class="language-html"><auro-button id="maxDateChange">Change maxDate to Today's Date</auro-button>
|
|
622
|
-
<auro-button id="resetMaxDate">Reset Datepicker to Initial Example</auro-button>
|
|
623
|
-
<br />
|
|
624
|
-
<auro-datepicker id="maxDateExample" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
|
|
625
|
-
<span slot="bib.fullscreen.headline">maxDate Example</span>
|
|
626
|
-
<span slot="fromLabel">Choose a date</span>
|
|
627
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
628
|
-
</auro-datepicker></code></pre>
|
|
629
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
630
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-max-date.js) -->
|
|
631
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/update-max-date.js -->
|
|
632
|
-
|
|
633
|
-
<pre class="language-js"><code class="language-js">function formatDateString(date) {
|
|
634
|
-
/* eslint-disable prefer-template, no-magic-numbers */
|
|
635
|
-
const dd = String("0" + date.getDate()).slice(-2);
|
|
636
|
-
const mm = String("0" + (date.getMonth() + 1)).slice(-2);
|
|
637
|
-
/* eslint-enable prefer-template, no-magic-numbers */
|
|
638
|
-
const yyyy = date.getFullYear();
|
|
639
|
-
|
|
640
|
-
return `${mm}/${dd}/${yyyy}`;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
export function updateMaxDateExample() {
|
|
644
|
-
const maxDateExample = document.getElementById('maxDateExample');
|
|
645
|
-
const changeMaxDateButton = document.getElementById('maxDateChange');
|
|
646
|
-
const resetButton = document.getElementById('resetMaxDate');
|
|
647
|
-
|
|
648
|
-
const today = formatDateString(new Date());
|
|
649
|
-
|
|
650
|
-
let nextWeek = new Date();
|
|
651
|
-
let addOneWeek = nextWeek.getDate() + 7;
|
|
652
|
-
|
|
653
|
-
nextWeek.setDate(addOneWeek);
|
|
654
|
-
nextWeek = formatDateString(nextWeek);
|
|
655
|
-
|
|
656
|
-
maxDateExample.setAttribute('value', nextWeek);
|
|
657
|
-
maxDateExample.setAttribute('maxDate', nextWeek);
|
|
658
|
-
|
|
659
|
-
changeMaxDateButton.addEventListener('click', () => {
|
|
660
|
-
maxDateExample.setAttribute('maxDate', today);
|
|
661
|
-
});
|
|
662
|
-
|
|
663
|
-
resetButton.addEventListener('click', () => {
|
|
664
|
-
maxDateExample.setAttribute('value', nextWeek);
|
|
665
|
-
maxDateExample.setAttribute('maxDate', nextWeek);
|
|
666
|
-
});
|
|
667
|
-
}</code></pre>
|
|
668
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
669
|
-
</auro-accordion>
|
|
670
|
-
|
|
671
|
-
### Min Date
|
|
672
|
-
|
|
673
|
-
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.
|
|
674
|
-
|
|
675
|
-
<div class="exampleWrapper">
|
|
676
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/min-date.html) -->
|
|
677
|
-
<!-- The below content is automatically added from ./../apiExamples/min-date.html -->
|
|
678
|
-
<auro-datepicker minDate="03/25/2028" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
679
|
-
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
680
|
-
<span slot="fromLabel">Choose a date</span>
|
|
681
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
682
|
-
</auro-datepicker>
|
|
683
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
684
|
-
</div>
|
|
685
|
-
<auro-accordion alignRight>
|
|
686
|
-
<span slot="trigger">See code</span>
|
|
687
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/min-date.html) -->
|
|
688
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/min-date.html -->
|
|
689
|
-
|
|
690
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker minDate="03/25/2028" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
691
|
-
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
692
|
-
<span slot="fromLabel">Choose a date</span>
|
|
693
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
694
|
-
</auro-datepicker></code></pre>
|
|
695
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
696
|
-
</auro-accordion>
|
|
697
|
-
|
|
698
|
-
#### Update Min Date
|
|
699
|
-
|
|
700
|
-
Setting the `minDate` attribute to a date later than the auro-datepicker `value` will result in the following changes to the component state:
|
|
701
|
-
|
|
702
|
-
* `value` will to reset to `undefined`.
|
|
703
|
-
* If the currently viewed calendar month is earlier than the new `minDate`, the calendar view will move to the new `minDate` month.
|
|
704
|
-
|
|
705
|
-
This example demonstrates that behavior.
|
|
706
|
-
|
|
707
|
-
<div class="exampleWrapper">
|
|
708
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/update-min-date.html) -->
|
|
709
|
-
<!-- The below content is automatically added from ./../apiExamples/update-min-date.html -->
|
|
710
|
-
<auro-button id="minDateChange">Change minDate to a week from Today</auro-button>
|
|
711
|
-
<auro-button id="resetMinDate">Reset Datepicker to Initial Example</auro-button>
|
|
712
|
-
<br />
|
|
713
|
-
<auro-datepicker id="minDateExample" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
714
|
-
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
715
|
-
<span slot="fromLabel">Choose a date</span>
|
|
716
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
717
|
-
</auro-datepicker>
|
|
718
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
719
|
-
</div>
|
|
720
|
-
<auro-accordion alignRight>
|
|
721
|
-
<span slot="trigger">See code</span>
|
|
722
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-min-date.html) -->
|
|
723
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/update-min-date.html -->
|
|
724
|
-
|
|
725
|
-
<pre class="language-html"><code class="language-html"><auro-button id="minDateChange">Change minDate to a week from Today</auro-button>
|
|
726
|
-
<auro-button id="resetMinDate">Reset Datepicker to Initial Example</auro-button>
|
|
727
|
-
<br />
|
|
728
|
-
<auro-datepicker id="minDateExample" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
|
|
729
|
-
<span slot="bib.fullscreen.headline">minDate Example</span>
|
|
730
|
-
<span slot="fromLabel">Choose a date</span>
|
|
731
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
732
|
-
</auro-datepicker></code></pre>
|
|
733
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
734
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-min-date.js) -->
|
|
735
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/update-min-date.js -->
|
|
736
|
-
|
|
737
|
-
<pre class="language-js"><code class="language-js">function formatDateString(date) {
|
|
738
|
-
/* eslint-disable prefer-template, no-magic-numbers */
|
|
739
|
-
const dd = String("0" + date.getDate()).slice(-2);
|
|
740
|
-
const mm = String("0" + (date.getMonth() + 1)).slice(-2);
|
|
741
|
-
/* eslint-enable prefer-template, no-magic-numbers */
|
|
742
|
-
const yyyy = date.getFullYear();
|
|
743
|
-
|
|
744
|
-
return `${mm}/${dd}/${yyyy}`;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
export function updateMinDateExample() {
|
|
748
|
-
const minDateExample = document.getElementById('minDateExample');
|
|
749
|
-
const changeMinDateButton = document.getElementById('minDateChange');
|
|
750
|
-
const resetButton = document.getElementById('resetMinDate');
|
|
751
|
-
|
|
752
|
-
const today = formatDateString(new Date());
|
|
753
|
-
|
|
754
|
-
let nextWeek = new Date();
|
|
755
|
-
let addOneWeek = nextWeek.getDate() + 7;
|
|
756
|
-
|
|
757
|
-
nextWeek.setDate(addOneWeek);
|
|
758
|
-
nextWeek = formatDateString(nextWeek);
|
|
759
|
-
|
|
760
|
-
minDateExample.setAttribute('value', today);
|
|
761
|
-
minDateExample.setAttribute('minDate', today);
|
|
762
|
-
|
|
763
|
-
changeMinDateButton.addEventListener('click', () => {
|
|
764
|
-
minDateExample.setAttribute('minDate', nextWeek);
|
|
765
|
-
});
|
|
766
|
-
|
|
767
|
-
resetButton.addEventListener('click', () => {
|
|
768
|
-
minDateExample.setAttribute('value', today);
|
|
769
|
-
minDateExample.setAttribute('minDate', today);
|
|
770
|
-
});
|
|
771
|
-
|
|
772
|
-
}</code></pre>
|
|
773
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
774
|
-
</auro-accordion>
|
|
775
|
-
|
|
776
|
-
### Month Names Localization
|
|
777
|
-
|
|
778
|
-
The datepicker supports localized month names through the `monthNames` property.
|
|
779
|
-
|
|
780
|
-
This example demonstrates how to set the `monthNames` property to Korean month names, with a Korean date format.
|
|
781
|
-
|
|
782
|
-
<div class="exampleWrapper">
|
|
783
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization.html) -->
|
|
784
|
-
<!-- The below content is automatically added from ./../apiExamples/localization.html -->
|
|
785
|
-
<auro-datepicker format="yyyy/mm/dd" id="localizationExample">
|
|
786
|
-
<span slot="bib.fullscreen.headline">Localization Headline</span>
|
|
787
|
-
<span slot="fromLabel">Choose a date</span>
|
|
788
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
789
|
-
</auro-datepicker>
|
|
790
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
791
|
-
</div>
|
|
792
|
-
<auro-accordion alignRight>
|
|
793
|
-
<span slot="trigger">See code</span>
|
|
794
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/localization.html) -->
|
|
795
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/localization.html -->
|
|
796
|
-
|
|
797
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker format="yyyy/mm/dd" id="localizationExample">
|
|
798
|
-
<span slot="bib.fullscreen.headline">Localization Headline</span>
|
|
799
|
-
<span slot="fromLabel">Choose a date</span>
|
|
800
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
801
|
-
</auro-datepicker></code></pre>
|
|
802
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
803
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/localization.js) -->
|
|
804
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/localization.js -->
|
|
805
|
-
|
|
806
|
-
<pre class="language-js"><code class="language-js">export function localizationExample() {
|
|
807
|
-
const localizedDatepicker = document.querySelector("#localizationExample");
|
|
808
|
-
|
|
809
|
-
localizedDatepicker.monthNames = ['일월', '이월', '삼월', '사월', '오월', '유월', '칠월', '팔월', '구월', '시월', '십일월', '십이월'];
|
|
810
|
-
}</code></pre>
|
|
811
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
812
|
-
</auro-accordion>
|
|
813
|
-
|
|
814
|
-
### No Validate
|
|
815
|
-
|
|
816
|
-
Set `noValidate` to force the datepicker not to validate when navigating away from the component.
|
|
817
|
-
|
|
818
|
-
<div class="exampleWrapper">
|
|
819
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/no-validate.html) -->
|
|
820
|
-
<!-- The below content is automatically added from ./../apiExamples/no-validate.html -->
|
|
821
|
-
<auro-datepicker required noValidate>
|
|
822
|
-
<span slot="bib.fullscreen.headline">noValidate Example</span>
|
|
823
|
-
<span slot="fromLabel">Choose a date</span>
|
|
824
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
825
|
-
</auro-datepicker>
|
|
826
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
827
|
-
</div>
|
|
828
|
-
<auro-accordion alignRight>
|
|
829
|
-
<span slot="trigger">See code</span>
|
|
830
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/no-validate.html) -->
|
|
831
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/no-validate.html -->
|
|
832
|
-
|
|
833
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker required noValidate>
|
|
834
|
-
<span slot="bib.fullscreen.headline">noValidate Example</span>
|
|
835
|
-
<span slot="fromLabel">Choose a date</span>
|
|
836
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
837
|
-
</auro-datepicker></code></pre>
|
|
838
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
839
|
-
</auro-accordion>
|
|
840
|
-
|
|
841
|
-
### Reference Dates
|
|
842
|
-
|
|
843
|
-
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.
|
|
844
|
-
|
|
845
|
-
Example:
|
|
846
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker referenceDates='["10/05/2025", "10/15/2025", "10/20/2025", "10/22/2025"]'></auro-datepicker></code></pre>
|
|
847
|
-
|
|
848
|
-
<div class="exampleWrapper">
|
|
849
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/reference-dates.html) -->
|
|
850
|
-
<!-- The below content is automatically added from ./../apiExamples/reference-dates.html -->
|
|
851
|
-
<auro-datepicker referenceDates='["10/05/2025", "10/15/2025", "10/20/2025", "10/22/2025"]' minDate="10/12/2025">
|
|
852
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
853
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
854
|
-
<span slot="fromLabel">Choose a date</span>
|
|
855
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
856
|
-
</auro-datepicker>
|
|
857
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
858
|
-
</div>
|
|
859
|
-
<auro-accordion alignRight>
|
|
860
|
-
<span slot="trigger">See code</span>
|
|
861
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reference-dates.html) -->
|
|
862
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/reference-dates.html -->
|
|
863
|
-
|
|
864
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker referenceDates='["10/05/2025", "10/15/2025", "10/20/2025", "10/22/2025"]' minDate="10/12/2025">
|
|
865
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
866
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
867
|
-
<span slot="fromLabel">Choose a date</span>
|
|
868
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
869
|
-
</auro-datepicker></code></pre>
|
|
870
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
871
|
-
</auro-accordion>
|
|
872
|
-
|
|
873
|
-
### Required
|
|
874
|
-
|
|
875
|
-
Populates the `required` attribute on the input. Used for client-side validation.
|
|
876
|
-
|
|
877
|
-
When the validity check fails the validityState, equals `valueMissing`. The error message for the `valueMissing` validityState can be set to a custom string using the `setCustomValidityValueMissing`. There is no default error message defined.
|
|
878
|
-
|
|
879
|
-
<div class="exampleWrapper">
|
|
880
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/required.html) -->
|
|
881
|
-
<!-- The below content is automatically added from ./../apiExamples/required.html -->
|
|
882
|
-
<auro-datepicker required setCustomValidityValueMissing="Custom value missing message.">
|
|
883
|
-
<span slot="bib.fullscreen.headline">Required Example</span>
|
|
884
|
-
<span slot="fromLabel">Choose a date</span>
|
|
885
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
886
|
-
</auro-datepicker>
|
|
887
|
-
<br />
|
|
888
|
-
<auro-datepicker required range setCustomValidityValueMissing="Custom value missing message.">
|
|
889
|
-
<span slot="bib.fullscreen.headline">Required Example</span>
|
|
890
|
-
<span slot="fromLabel">Departure</span>
|
|
891
|
-
<span slot="toLabel">Return</span>
|
|
892
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
893
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
894
|
-
</auro-datepicker>
|
|
895
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
896
|
-
</div>
|
|
897
|
-
<auro-accordion alignRight>
|
|
898
|
-
<span slot="trigger">See code</span>
|
|
899
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/required.html) -->
|
|
900
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/required.html -->
|
|
901
|
-
|
|
902
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker required setCustomValidityValueMissing="Custom value missing message.">
|
|
903
|
-
<span slot="bib.fullscreen.headline">Required Example</span>
|
|
904
|
-
<span slot="fromLabel">Choose a date</span>
|
|
905
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
906
|
-
</auro-datepicker>
|
|
907
|
-
<br />
|
|
908
|
-
<auro-datepicker required range setCustomValidityValueMissing="Custom value missing message.">
|
|
909
|
-
<span slot="bib.fullscreen.headline">Required Example</span>
|
|
910
|
-
<span slot="fromLabel">Departure</span>
|
|
911
|
-
<span slot="toLabel">Return</span>
|
|
912
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
913
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
914
|
-
</auro-datepicker></code></pre>
|
|
915
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
916
|
-
</auro-accordion>
|
|
917
|
-
|
|
918
|
-
### Stacked
|
|
919
|
-
|
|
920
|
-
Set the `stacked` attribute to make range datepicker stacked style.
|
|
921
|
-
|
|
922
|
-
<div class="exampleWrapper">
|
|
923
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/stacked.html) -->
|
|
924
|
-
<!-- The below content is automatically added from ./../apiExamples/stacked.html -->
|
|
925
|
-
<auro-datepicker range stacked>
|
|
926
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
927
|
-
<span slot="fromLabel">Choose a date</span>
|
|
928
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
929
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
930
|
-
</auro-datepicker>
|
|
931
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
932
|
-
</div>
|
|
933
|
-
<auro-accordion alignRight>
|
|
934
|
-
<span slot="trigger">See code</span>
|
|
935
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/stacked.html) -->
|
|
936
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/stacked.html -->
|
|
937
|
-
|
|
938
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker range stacked>
|
|
939
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
940
|
-
<span slot="fromLabel">Choose a date</span>
|
|
941
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
942
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
943
|
-
</auro-datepicker></code></pre>
|
|
944
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
945
|
-
</auro-accordion>
|
|
946
|
-
|
|
947
|
-
### Validity
|
|
948
|
-
|
|
949
|
-
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.
|
|
950
|
-
|
|
951
|
-
<div class="exampleWrapper">
|
|
952
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/validity.html) -->
|
|
953
|
-
<!-- The below content is automatically added from ./../apiExamples/validity.html -->
|
|
954
|
-
<auro-button id="validityExampleBtn">Get validity</auro-button>
|
|
955
|
-
<br />
|
|
956
|
-
<auro-datepicker required id="validityExample">
|
|
957
|
-
<span slot="bib.fullscreen.headline">validity Example</span>
|
|
958
|
-
<span slot="fromLabel">Choose a date</span>
|
|
959
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
960
|
-
</auro-datepicker>
|
|
961
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
962
|
-
</div>
|
|
963
|
-
<auro-accordion alignRight>
|
|
964
|
-
<span slot="trigger">See code</span>
|
|
965
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/validity.html) -->
|
|
966
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/validity.html -->
|
|
967
|
-
|
|
968
|
-
<pre class="language-html"><code class="language-html"><auro-button id="validityExampleBtn">Get validity</auro-button>
|
|
969
|
-
<br />
|
|
970
|
-
<auro-datepicker required id="validityExample">
|
|
971
|
-
<span slot="bib.fullscreen.headline">validity Example</span>
|
|
972
|
-
<span slot="fromLabel">Choose a date</span>
|
|
973
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
974
|
-
</auro-datepicker></code></pre>
|
|
975
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
976
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/validity.js) -->
|
|
977
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/validity.js -->
|
|
978
|
-
|
|
979
|
-
<pre class="language-js"><code class="language-js">export function validityExample() {
|
|
980
|
-
const validityExampleExample = document.querySelector('#validityExample');
|
|
981
|
-
const validityExampleExampleBtn = document.querySelector('#validityExampleBtn');
|
|
982
|
-
|
|
983
|
-
validityExampleExampleBtn.addEventListener('click', () => {
|
|
984
|
-
console.warn('Validity set to:', validityExampleExample.validity);
|
|
985
|
-
alert(`Validity set to: ${validityExampleExample.validity}`);
|
|
986
|
-
})
|
|
987
|
-
}</code></pre>
|
|
988
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
989
|
-
</auro-accordion>
|
|
990
|
-
|
|
991
|
-
### Value
|
|
992
|
-
|
|
993
|
-
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.
|
|
994
|
-
|
|
995
|
-
<div class="exampleWrapper">
|
|
996
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/value.html) -->
|
|
997
|
-
<!-- The below content is automatically added from ./../apiExamples/value.html -->
|
|
998
|
-
<auro-datepicker id="valueExample" value="02/02/2022">
|
|
999
|
-
<span slot="bib.fullscreen.headline">value Example</span>
|
|
1000
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1001
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1002
|
-
</auro-datepicker>
|
|
1003
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1004
|
-
</div>
|
|
1005
|
-
<auro-accordion alignRight>
|
|
1006
|
-
<span slot="trigger">See code</span>
|
|
1007
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/value.html) -->
|
|
1008
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/value.html -->
|
|
1009
|
-
|
|
1010
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker id="valueExample" value="02/02/2022">
|
|
1011
|
-
<span slot="bib.fullscreen.headline">value Example</span>
|
|
1012
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1013
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1014
|
-
</auro-datepicker></code></pre>
|
|
1015
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1016
|
-
</auro-accordion>
|
|
1017
|
-
|
|
1018
|
-
### Value of Second Input in Range Mode
|
|
1019
|
-
|
|
1020
|
-
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.
|
|
1021
|
-
|
|
1022
|
-
<div class="exampleWrapper">
|
|
1023
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/value-end.html) -->
|
|
1024
|
-
<!-- The below content is automatically added from ./../apiExamples/value-end.html -->
|
|
1025
|
-
<auro-datepicker id="valueEndExample" range valueEnd="03/03/2023">
|
|
1026
|
-
<span slot="bib.fullscreen.headline">valueEnd Example</span>
|
|
1027
|
-
<span slot="fromLabel">Departure</span>
|
|
1028
|
-
<span slot="toLabel">Return</span>
|
|
1029
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
1030
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
1031
|
-
</auro-datepicker>
|
|
1032
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1033
|
-
</div>
|
|
1034
|
-
<auro-accordion alignRight>
|
|
1035
|
-
<span slot="trigger">See code</span>
|
|
1036
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/value-end.html) -->
|
|
1037
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/value-end.html -->
|
|
1038
|
-
|
|
1039
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker id="valueEndExample" range valueEnd="03/03/2023">
|
|
1040
|
-
<span slot="bib.fullscreen.headline">valueEnd Example</span>
|
|
1041
|
-
<span slot="fromLabel">Departure</span>
|
|
1042
|
-
<span slot="toLabel">Return</span>
|
|
1043
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
1044
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
1045
|
-
</auro-datepicker></code></pre>
|
|
1046
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1047
|
-
</auro-accordion>
|
|
1048
|
-
|
|
1049
|
-
## Method Examples
|
|
1050
|
-
|
|
1051
|
-
### Focus
|
|
1052
|
-
|
|
1053
|
-
The `focus()` method will apply focus state to the datepicker's input field.
|
|
1054
|
-
|
|
1055
|
-
<div class="exampleWrapper">
|
|
1056
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/focus.html) -->
|
|
1057
|
-
<!-- The below content is automatically added from ./../apiExamples/focus.html -->
|
|
1058
|
-
<auro-button id="focusExampleBtn">Apply focus to datepicker</auro-button>
|
|
1059
|
-
<auro-button id="focusExampleBtnTwo">Apply focus to the second input in datepicker</auro-button>
|
|
1060
|
-
<br />
|
|
1061
|
-
<auro-datepicker id="focusExampleElem" range>
|
|
1062
|
-
<span slot="bib.fullscreen.headline">Focus Example</span>
|
|
1063
|
-
<span slot="fromLabel">Departure</span>
|
|
1064
|
-
<span slot="toLabel">Return</span>
|
|
1065
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1066
|
-
<span slot="bib.fullscreen.toLabel">Choose a date</span>
|
|
1067
|
-
</auro-datepicker>
|
|
1068
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1069
|
-
</div>
|
|
1070
|
-
<auro-accordion alignRight>
|
|
1071
|
-
<span slot="trigger">See code</span>
|
|
1072
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/focus.html) -->
|
|
1073
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/focus.html -->
|
|
1074
|
-
|
|
1075
|
-
<pre class="language-html"><code class="language-html"><auro-button id="focusExampleBtn">Apply focus to datepicker</auro-button>
|
|
1076
|
-
<auro-button id="focusExampleBtnTwo">Apply focus to the second input in datepicker</auro-button>
|
|
1077
|
-
<br />
|
|
1078
|
-
<auro-datepicker id="focusExampleElem" range>
|
|
1079
|
-
<span slot="bib.fullscreen.headline">Focus Example</span>
|
|
1080
|
-
<span slot="fromLabel">Departure</span>
|
|
1081
|
-
<span slot="toLabel">Return</span>
|
|
1082
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1083
|
-
<span slot="bib.fullscreen.toLabel">Choose a date</span>
|
|
1084
|
-
</auro-datepicker></code></pre>
|
|
1085
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1086
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/focus.js) -->
|
|
1087
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/focus.js -->
|
|
1088
|
-
|
|
1089
|
-
<pre class="language-js"><code class="language-js">export function focusExample() {
|
|
1090
|
-
const focusExampleElem = document.querySelector('#focusExampleElem');
|
|
1091
|
-
const focusExampleBtn = document.querySelector('#focusExampleBtn');
|
|
1092
|
-
const focusExampleBtnTwo = document.querySelector('#focusExampleBtnTwo');
|
|
1093
|
-
|
|
1094
|
-
focusExampleBtn.addEventListener('click', () => {
|
|
1095
|
-
focusExampleElem.focus();
|
|
1096
|
-
});
|
|
1097
|
-
|
|
1098
|
-
focusExampleBtnTwo.addEventListener('click', () => {
|
|
1099
|
-
focusExampleElem.focus('endDate');
|
|
1100
|
-
});
|
|
1101
|
-
}</code></pre>
|
|
1102
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1103
|
-
</auro-accordion>
|
|
1104
|
-
|
|
1105
|
-
### Reset State
|
|
1106
|
-
|
|
1107
|
-
Use the `reset()` method to reset the `<auro-datepicker>`'s `value`, `valueEnd` and `validity` state. Doing so will preserve all other attributes and properties.
|
|
1108
|
-
|
|
1109
|
-
<div class="exampleWrapper">
|
|
1110
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/reset-state.html) -->
|
|
1111
|
-
<!-- The below content is automatically added from ./../apiExamples/reset-state.html -->
|
|
1112
|
-
<auro-button id="resetStateBtn">Reset</auro-button>
|
|
1113
|
-
<br />
|
|
1114
|
-
<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.">
|
|
1115
|
-
<span slot="bib.fullscreen.headline">Reset Example</span>
|
|
1116
|
-
<span slot="fromLabel">Departure</span>
|
|
1117
|
-
<span slot="toLabel">Return</span>
|
|
1118
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
1119
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
1120
|
-
</auro-datepicker>
|
|
1121
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1122
|
-
</div>
|
|
1123
|
-
<auro-accordion alignRight>
|
|
1124
|
-
<span slot="trigger">See code</span>
|
|
1125
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset-state.html) -->
|
|
1126
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/reset-state.html -->
|
|
1127
|
-
|
|
1128
|
-
<pre class="language-html"><code class="language-html"><auro-button id="resetStateBtn">Reset</auro-button>
|
|
1129
|
-
<br />
|
|
1130
|
-
<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.">
|
|
1131
|
-
<span slot="bib.fullscreen.headline">Reset Example</span>
|
|
1132
|
-
<span slot="fromLabel">Departure</span>
|
|
1133
|
-
<span slot="toLabel">Return</span>
|
|
1134
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
1135
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
1136
|
-
</auro-datepicker></code></pre>
|
|
1137
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1138
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset-state.js) -->
|
|
1139
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/reset-state.js -->
|
|
1140
|
-
|
|
1141
|
-
<pre class="language-js"><code class="language-js">export function resetStateExample() {
|
|
1142
|
-
const elem = document.querySelector('#resetStateExample');
|
|
1143
|
-
|
|
1144
|
-
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
1145
|
-
elem.reset();
|
|
1146
|
-
});
|
|
1147
|
-
}</code></pre>
|
|
1148
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1149
|
-
</auro-accordion>
|
|
1150
|
-
|
|
1151
|
-
## Event Examples
|
|
1152
|
-
|
|
1153
|
-
### Watch for Value Changes
|
|
1154
|
-
|
|
1155
|
-
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.
|
|
1156
|
-
|
|
1157
|
-
<div class="exampleWrapper">
|
|
1158
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/alert-value.html) -->
|
|
1159
|
-
<!-- The below content is automatically added from ./../apiExamples/alert-value.html -->
|
|
1160
|
-
<auro-datepicker id="datePickerValueAlert">
|
|
1161
|
-
<span slot="bib.fullscreen.headline">Alert Value Example</span>
|
|
1162
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1163
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1164
|
-
</auro-datepicker>
|
|
1165
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1166
|
-
</div>
|
|
1167
|
-
<auro-accordion alignRight>
|
|
1168
|
-
<span slot="trigger">See code</span>
|
|
1169
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/alert-value.html) -->
|
|
1170
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/alert-value.html -->
|
|
1171
|
-
|
|
1172
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker id="datePickerValueAlert">
|
|
1173
|
-
<span slot="bib.fullscreen.headline">Alert Value Example</span>
|
|
1174
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1175
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1176
|
-
</auro-datepicker></code></pre>
|
|
1177
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1178
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/alert-value.js) -->
|
|
1179
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/alert-value.js -->
|
|
1180
|
-
|
|
1181
|
-
<pre class="language-js"><code class="language-js">export function alertValueExample() {
|
|
1182
|
-
const valueAlertExample = document.querySelector('#datePickerValueAlert');
|
|
1183
|
-
|
|
1184
|
-
valueAlertExample.addEventListener('auroDatePicker-valueSet', () => {
|
|
1185
|
-
console.warn('Select value changed to:', valueAlertExample.value);
|
|
1186
|
-
alert(`Select value changed to: ${valueAlertExample.value}`);
|
|
1187
|
-
})
|
|
1188
|
-
}</code></pre>
|
|
1189
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1190
|
-
</auro-accordion>
|
|
1191
|
-
|
|
1192
|
-
## Slot Examples
|
|
1193
|
-
|
|
1194
|
-
### Aria Label for Clear Button
|
|
1195
|
-
|
|
1196
|
-
Use the `ariaLabel.input.clear` slot to set the `aria-label` for the clear button in the trigger input.
|
|
1197
|
-
|
|
1198
|
-
<div class="exampleWrapper">
|
|
1199
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/aria-label-input-clear.html) -->
|
|
1200
|
-
<!-- The below content is automatically added from ./../apiExamples/aria-label-input-clear.html -->
|
|
1201
|
-
<auro-datepicker>
|
|
1202
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1203
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1204
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1205
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1206
|
-
<span slot="ariaLabel.input.clear">Custom Clear Input Button</span>
|
|
1207
|
-
</auro-datepicker>
|
|
1208
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1209
|
-
</div>
|
|
1210
|
-
<div class="exampleWrapper--ondark">
|
|
1211
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/snowflake/aria-label-input-clear.html) -->
|
|
1212
|
-
<!-- The below content is automatically added from ./../apiExamples/snowflake/aria-label-input-clear.html -->
|
|
1213
|
-
<auro-datepicker layout="snowflake" shape="snowflake" ondark placeholder="MM/DD/YYYY">
|
|
1214
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1215
|
-
<span slot="label">Date</span>
|
|
1216
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1217
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1218
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1219
|
-
<span slot="ariaLabel.input.clear">Snowflake Clear Input Button</span>
|
|
1220
|
-
</auro-datepicker>
|
|
1221
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1222
|
-
</div>
|
|
1223
|
-
<auro-accordion alignRight>
|
|
1224
|
-
<span slot="trigger">See code</span>
|
|
1225
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/aria-label-input-clear.html) -->
|
|
1226
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/aria-label-input-clear.html -->
|
|
1227
|
-
|
|
1228
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker>
|
|
1229
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1230
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1231
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1232
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1233
|
-
<span slot="ariaLabel.input.clear">Custom Clear Input Button</span>
|
|
1234
|
-
</auro-datepicker></code></pre>
|
|
1235
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1236
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/snowflake/aria-label-input-clear.html) -->
|
|
1237
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/snowflake/aria-label-input-clear.html -->
|
|
1238
|
-
|
|
1239
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker layout="snowflake" shape="snowflake" ondark placeholder="MM/DD/YYYY">
|
|
1240
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1241
|
-
<span slot="label">Date</span>
|
|
1242
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1243
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1244
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1245
|
-
<span slot="ariaLabel.input.clear">Snowflake Clear Input Button</span>
|
|
1246
|
-
</auro-datepicker></code></pre>
|
|
1247
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1248
|
-
</auro-accordion>
|
|
1249
|
-
|
|
1250
|
-
### Fullscreen Bib Date Labels and Headline
|
|
1251
|
-
|
|
1252
|
-
Use the `bib.fullscreen.fromLabel`, `bib.fullscreen.toLabel`, and `bib.fullscreen.headline` slots to set the the labels at the top of the bib and headline when viewed in the mobile layout.
|
|
1253
|
-
|
|
1254
|
-
To view this demo, set your window to a mobile screen size.
|
|
1255
|
-
|
|
1256
|
-
**Note**: The previously supported `bib.fullscreen.dateLabel` slot is deprecated and will continue to work for backwards compatibility, but it is recommended to use the new `bib.fullscreen.fromLabel` and `bib.fullscreen.toLabel` slots to apply a label for each input when in mobile layout.
|
|
1257
|
-
|
|
1258
|
-
<div class="exampleWrapper">
|
|
1259
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
1260
|
-
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
1261
|
-
<auro-datepicker>
|
|
1262
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1263
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1264
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1265
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1266
|
-
</auro-datepicker>
|
|
1267
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1268
|
-
</div>
|
|
1269
|
-
<auro-accordion alignRight>
|
|
1270
|
-
<span slot="trigger">See code</span>
|
|
1271
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
1272
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
1273
|
-
|
|
1274
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker>
|
|
1275
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1276
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1277
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1278
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1279
|
-
</auro-datepicker></code></pre>
|
|
1280
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1281
|
-
</auro-accordion>
|
|
1282
|
-
|
|
1283
|
-
### From Label
|
|
1284
|
-
|
|
1285
|
-
The `fromLabel` slot sets the label used for the input. When the `range` attribute is used this is the first of two inputs.
|
|
1286
|
-
|
|
1287
|
-
<div class="exampleWrapper">
|
|
1288
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
1289
|
-
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
1290
|
-
<auro-datepicker>
|
|
1291
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1292
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1293
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1294
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1295
|
-
</auro-datepicker>
|
|
1296
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1297
|
-
</div>
|
|
1298
|
-
<auro-accordion alignRight>
|
|
1299
|
-
<span slot="trigger">See code</span>
|
|
1300
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
1301
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
1302
|
-
|
|
1303
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker>
|
|
1304
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1305
|
-
<span slot="bib.fullscreen.headline">Datepicker Headline</span>
|
|
1306
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1307
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1308
|
-
</auro-datepicker></code></pre>
|
|
1309
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1310
|
-
</auro-accordion>
|
|
1311
|
-
|
|
1312
|
-
### To Label
|
|
1313
|
-
|
|
1314
|
-
The `toLabel` slot sets the label for the second input. Only for use with the `range` attribute.
|
|
1315
|
-
|
|
1316
|
-
<div class="exampleWrapper">
|
|
1317
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/range.html) -->
|
|
1318
|
-
<!-- The below content is automatically added from ./../apiExamples/range.html -->
|
|
1319
|
-
<auro-datepicker range>
|
|
1320
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1321
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
1322
|
-
<span slot="fromLabel">Departure</span>
|
|
1323
|
-
<span slot="toLabel">Return</span>
|
|
1324
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
1325
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
1326
|
-
</auro-datepicker>
|
|
1327
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1328
|
-
</div>
|
|
1329
|
-
<auro-accordion alignRight>
|
|
1330
|
-
<span slot="trigger">See code</span>
|
|
1331
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/range.html) -->
|
|
1332
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/range.html -->
|
|
1333
|
-
|
|
1334
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker range>
|
|
1335
|
-
<span slot="ariaLabel.bib.close">Close Calendar</span>
|
|
1336
|
-
<span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
|
|
1337
|
-
<span slot="fromLabel">Departure</span>
|
|
1338
|
-
<span slot="toLabel">Return</span>
|
|
1339
|
-
<span slot="bib.fullscreen.fromLabel">Departure</span>
|
|
1340
|
-
<span slot="bib.fullscreen.toLabel">Return</span>
|
|
1341
|
-
</auro-datepicker></code></pre>
|
|
1342
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1343
|
-
</auro-accordion>
|
|
1344
|
-
|
|
1345
|
-
### Help Text
|
|
1346
|
-
|
|
1347
|
-
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.
|
|
1348
|
-
|
|
1349
|
-
<div class="exampleWrapper">
|
|
1350
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/help-text.html) -->
|
|
1351
|
-
<!-- The below content is automatically added from ./../apiExamples/help-text.html -->
|
|
1352
|
-
<auro-datepicker>
|
|
1353
|
-
<span slot="bib.fullscreen.headline">helpText Example</span>
|
|
1354
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1355
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1356
|
-
<span slot="helpText">Choose a date must be today or earlier.</span>
|
|
1357
|
-
</auro-datepicker>
|
|
1358
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1359
|
-
</div>
|
|
1360
|
-
<auro-accordion alignRight>
|
|
1361
|
-
<span slot="trigger">See code</span>
|
|
1362
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/help-text.html) -->
|
|
1363
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/help-text.html -->
|
|
1364
|
-
|
|
1365
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker>
|
|
1366
|
-
<span slot="bib.fullscreen.headline">helpText Example</span>
|
|
1367
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1368
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1369
|
-
<span slot="helpText">Choose a date must be today or earlier.</span>
|
|
1370
|
-
</auro-datepicker></code></pre>
|
|
1371
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1372
|
-
</auro-accordion>
|
|
1373
|
-
|
|
1374
|
-
### Date Slot
|
|
1375
|
-
|
|
1376
|
-
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`).
|
|
1377
|
-
|
|
1378
|
-
Adding the `highlight` attribute to the slot will change the slot content's color to `var(--ds-color-text-success-default)`.
|
|
1379
|
-
|
|
1380
|
-
Slot content support is limited to text only and a maximum of five (5) characters.
|
|
1381
|
-
|
|
1382
|
-
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"`).
|
|
1383
|
-
|
|
1384
|
-
<div class="exampleWrapper">
|
|
1385
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/date-slot.html) -->
|
|
1386
|
-
<!-- The below content is automatically added from ./../apiExamples/date-slot.html -->
|
|
1387
|
-
<auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
1388
|
-
<span slot="bib.fullscreen.headline">dateSlot Example</span>
|
|
1389
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1390
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1391
|
-
<span slot="date_12_03_2023">Sold</span>
|
|
1392
|
-
<span highlight slot="date_12_04_2023">$89</span>
|
|
1393
|
-
<span slot="date_12_05_2023">$100</span>
|
|
1394
|
-
<span slot="date_12_06_2023">$2345</span>
|
|
1395
|
-
<span highlight slot="date_12_07_2023">$149</span>
|
|
1396
|
-
<span highlight slot="date_12_08_2023">$382</span>
|
|
1397
|
-
<span slot="date_12_09_2023">$560</span>
|
|
1398
|
-
</auro-datepicker>
|
|
1399
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1400
|
-
</div>
|
|
1401
|
-
<auro-accordion alignRight>
|
|
1402
|
-
<span slot="trigger">See code</span>
|
|
1403
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/date-slot.html) -->
|
|
1404
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/date-slot.html -->
|
|
1405
|
-
|
|
1406
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
1407
|
-
<span slot="bib.fullscreen.headline">dateSlot Example</span>
|
|
1408
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1409
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1410
|
-
<span slot="date_12_03_2023">Sold</span>
|
|
1411
|
-
<span highlight slot="date_12_04_2023">$89</span>
|
|
1412
|
-
<span slot="date_12_05_2023">$100</span>
|
|
1413
|
-
<span slot="date_12_06_2023">$2345</span>
|
|
1414
|
-
<span highlight slot="date_12_07_2023">$149</span>
|
|
1415
|
-
<span highlight slot="date_12_08_2023">$382</span>
|
|
1416
|
-
<span slot="date_12_09_2023">$560</span>
|
|
1417
|
-
</auro-datepicker></code></pre>
|
|
1418
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1419
|
-
</auro-accordion>
|
|
1420
|
-
|
|
1421
|
-
### Popover Slot
|
|
1422
|
-
|
|
1423
|
-
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`).
|
|
1424
|
-
|
|
1425
|
-
The popover slot is intended for use with calendar dates that are `disabled` (e.g. before minimum date or after maximum date).
|
|
1426
|
-
|
|
1427
|
-
<div class="exampleWrapper">
|
|
1428
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/popover-slot.html) -->
|
|
1429
|
-
<!-- The below content is automatically added from ./../apiExamples/popover-slot.html -->
|
|
1430
|
-
<auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
1431
|
-
<span slot="bib.fullscreen.headline">Popover Slot Example</span>
|
|
1432
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1433
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1434
|
-
<span slot="popover_12_03_2023">Tickets for this day are sold out</span>
|
|
1435
|
-
<span slot="popover_12_04_2023">Tickets for this day are $89</span>
|
|
1436
|
-
<span slot="popover_12_05_2023">Tickets for this day are $100</span>
|
|
1437
|
-
<span slot="popover_12_06_2023">Tickets for this day are $2345</span>
|
|
1438
|
-
<span slot="popover_12_07_2023">Tickets for this day are $149</span>
|
|
1439
|
-
<span slot="popover_12_08_2023">Tickets for this day are $382</span>
|
|
1440
|
-
<span slot="popover_12_09_2023">Tickets for this day are $560</span>
|
|
1441
|
-
</auro-datepicker>
|
|
1442
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1443
|
-
</div>
|
|
1444
|
-
<auro-accordion alignRight>
|
|
1445
|
-
<span slot="trigger">See code</span>
|
|
1446
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/popover-slot.html) -->
|
|
1447
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/popover-slot.html -->
|
|
1448
|
-
|
|
1449
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
|
|
1450
|
-
<span slot="bib.fullscreen.headline">Popover Slot Example</span>
|
|
1451
|
-
<span slot="fromLabel">Choose a date</span>
|
|
1452
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1453
|
-
<span slot="popover_12_03_2023">Tickets for this day are sold out</span>
|
|
1454
|
-
<span slot="popover_12_04_2023">Tickets for this day are $89</span>
|
|
1455
|
-
<span slot="popover_12_05_2023">Tickets for this day are $100</span>
|
|
1456
|
-
<span slot="popover_12_06_2023">Tickets for this day are $2345</span>
|
|
1457
|
-
<span slot="popover_12_07_2023">Tickets for this day are $149</span>
|
|
1458
|
-
<span slot="popover_12_08_2023">Tickets for this day are $382</span>
|
|
1459
|
-
<span slot="popover_12_09_2023">Tickets for this day are $560</span>
|
|
1460
|
-
</auro-datepicker></code></pre>
|
|
1461
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1462
|
-
</auro-accordion>
|
|
1463
|
-
|
|
1464
|
-
## Common Usage Patterns & Functional Examples
|
|
1465
|
-
|
|
1466
|
-
### Dynamic Slot Content
|
|
1467
|
-
|
|
1468
|
-
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.
|
|
1469
|
-
|
|
1470
|
-
<div class="exampleWrapper">
|
|
1471
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dynamic-slot.html) -->
|
|
1472
|
-
<!-- The below content is automatically added from ./../apiExamples/dynamic-slot.html -->
|
|
1473
|
-
<auro-datepicker id="slotContentExample" centralDate="12/13/2023" minDate="12/13/2023" maxDate="01/18/2024" range>
|
|
1474
|
-
<span slot="bib.fullscreen.headline">dynamic slot Example</span>
|
|
1475
|
-
<span slot="fromLabel">Departure</span>
|
|
1476
|
-
<span slot="toLabel">Return</span>
|
|
1477
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1478
|
-
</auro-datepicker>
|
|
1479
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1480
|
-
</div>
|
|
1481
|
-
<auro-accordion alignRight>
|
|
1482
|
-
<span slot="trigger">See code</span>
|
|
1483
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dynamic-slot.html) -->
|
|
1484
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/dynamic-slot.html -->
|
|
1485
|
-
|
|
1486
|
-
<pre class="language-html"><code class="language-html"><auro-datepicker id="slotContentExample" centralDate="12/13/2023" minDate="12/13/2023" maxDate="01/18/2024" range>
|
|
1487
|
-
<span slot="bib.fullscreen.headline">dynamic slot Example</span>
|
|
1488
|
-
<span slot="fromLabel">Departure</span>
|
|
1489
|
-
<span slot="toLabel">Return</span>
|
|
1490
|
-
<span slot="bib.fullscreen.fromLabel">Choose a date</span>
|
|
1491
|
-
</auro-datepicker></code></pre>
|
|
1492
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1493
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dynamic-slot.js) -->
|
|
1494
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/dynamic-slot.js -->
|
|
1495
|
-
|
|
1496
|
-
<pre class="language-js"><code class="language-js">export function populateSlotContentExample() {
|
|
1497
|
-
const populateSlotContentExample = document.querySelector('#slotContentExample');
|
|
1498
|
-
|
|
1499
|
-
// Insert slot content when the datepicker has been opened
|
|
1500
|
-
populateSlotContentExample.addEventListener('auroDatePicker-toggled', (event) => {
|
|
1501
|
-
if (event.detail.expanded) {
|
|
1502
|
-
// Array of object(s) containing key, value pairs defining what slot content to render
|
|
1503
|
-
const data = [
|
|
1504
|
-
{slot: 'date', month: 12, day: 1, year: 2023, content: 'Sold'},
|
|
1505
|
-
{slot: 'date', month: 12, day: 2, year: 2023, content: 'Sold'},
|
|
1506
|
-
{slot: 'date', month: 12, day: 3, year: 2023, content: 'Sold'},
|
|
1507
|
-
{slot: 'date', month: 12, day: 4, year: 2023, content: 'Sold'},
|
|
1508
|
-
{slot: 'date', month: 12, day: 5, year: 2023, content: 'Sold'},
|
|
1509
|
-
{slot: 'date', month: 12, day: 6, year: 2023, content: 'Sold'},
|
|
1510
|
-
{slot: 'date', month: 12, day: 7, year: 2023, content: 'Sold'},
|
|
1511
|
-
{slot: 'date', month: 12, day: 8, year: 2023, content: 'Sold'},
|
|
1512
|
-
{slot: 'date', month: 12, day: 9, year: 2023, content: 'Sold'},
|
|
1513
|
-
{slot: 'date', month: 12, day: 10, year: 2023, content: 'Sold'},
|
|
1514
|
-
{slot: 'date', month: 12, day: 11, year: 2023, content: 'Sold'},
|
|
1515
|
-
{slot: 'date', month: 12, day: 12, year: 2023, content: 'Sold'},
|
|
1516
|
-
{slot: 'date', month: 12, day: 13, year: 2023, content: '$560'},
|
|
1517
|
-
{slot: 'date', month: 12, day: 14, year: 2023, content: '$89', highlight: true},
|
|
1518
|
-
{slot: 'date', month: 12, day: 15, year: 2023, content: '$100'},
|
|
1519
|
-
{slot: 'date', month: 12, day: 16, year: 2023, content: '$2345'},
|
|
1520
|
-
{slot: 'date', month: 12, day: 17, year: 2023, content: '$2345'},
|
|
1521
|
-
{slot: 'date', month: 12, day: 18, year: 2023, content: '$2345'},
|
|
1522
|
-
{slot: 'date', month: 12, day: 19, year: 2023, content: '$2345'},
|
|
1523
|
-
{slot: 'date', month: 12, day: 20, year: 2023, content: '$2345'},
|
|
1524
|
-
{slot: 'date', month: 12, day: 21, year: 2023, content: '$2345'},
|
|
1525
|
-
{slot: 'date', month: 12, day: 22, year: 2023, content: '$2345'},
|
|
1526
|
-
{slot: 'date', month: 12, day: 23, year: 2023, content: '$2345'},
|
|
1527
|
-
{slot: 'date', month: 12, day: 24, year: 2023, content: '$2345'},
|
|
1528
|
-
{slot: 'date', month: 12, day: 25, year: 2023, content: '$2345'},
|
|
1529
|
-
{slot: 'date', month: 12, day: 26, year: 2023, content: '$2345'},
|
|
1530
|
-
{slot: 'date', month: 12, day: 27, year: 2023, content: '$2345'},
|
|
1531
|
-
{slot: 'date', month: 12, day: 28, year: 2023, content: '$2345'},
|
|
1532
|
-
{slot: 'date', month: 12, day: 29, year: 2023, content: '$2345'},
|
|
1533
|
-
{slot: 'date', month: 12, day: 30, year: 2023, content: '$2345'},
|
|
1534
|
-
{slot: 'date', month: 12, day: 31, year: 2023, content: '$2345'},
|
|
1535
|
-
{slot: 'date', month: 1, day: 14, year: 2024, content: '$83', highlight: true},
|
|
1536
|
-
{slot: 'date', month: 1, day: 15, year: 2024, content: '$203'},
|
|
1537
|
-
{slot: 'date', month: 1, day: 16, year: 2024, content: '$4444'},
|
|
1538
|
-
{slot: 'date', month: 1, day: 17, year: 2024, content: '$83', highlight: true},
|
|
1539
|
-
{slot: 'date', month: 1, day: 18, year: 2024, content: '$96', highlight: true},
|
|
1540
|
-
{slot: 'date', month: 1, day: 19, year: 2024, content: 'Sold'},
|
|
1541
|
-
{slot: 'date', month: 1, day: 20, year: 2024, content: 'Sold'},
|
|
1542
|
-
{slot: 'popover', month: 12, day: 1, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1543
|
-
{slot: 'popover', month: 12, day: 2, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1544
|
-
{slot: 'popover', month: 12, day: 3, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1545
|
-
{slot: 'popover', month: 12, day: 4, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1546
|
-
{slot: 'popover', month: 12, day: 5, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1547
|
-
{slot: 'popover', month: 12, day: 6, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1548
|
-
{slot: 'popover', month: 12, day: 7, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1549
|
-
{slot: 'popover', month: 12, day: 8, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1550
|
-
{slot: 'popover', month: 12, day: 9, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1551
|
-
{slot: 'popover', month: 12, day: 10, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1552
|
-
{slot: 'popover', month: 12, day: 11, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1553
|
-
{slot: 'popover', month: 12, day: 12, year: 2023, content: 'Tickets for this date are sold out'},
|
|
1554
|
-
{slot: 'popover', month: 12, day: 13, year: 2023, content: 'Tickets for this date are $560'},
|
|
1555
|
-
{slot: 'popover', month: 12, day: 14, year: 2023, content: 'Tickets for this date are $89'},
|
|
1556
|
-
{slot: 'popover', month: 12, day: 15, year: 2023, content: 'Tickets for this date are $100'},
|
|
1557
|
-
{slot: 'popover', month: 12, day: 16, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1558
|
-
{slot: 'popover', month: 12, day: 17, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1559
|
-
{slot: 'popover', month: 12, day: 18, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1560
|
-
{slot: 'popover', month: 12, day: 19, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1561
|
-
{slot: 'popover', month: 12, day: 20, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1562
|
-
{slot: 'popover', month: 12, day: 21, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1563
|
-
{slot: 'popover', month: 12, day: 22, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1564
|
-
{slot: 'popover', month: 12, day: 23, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1565
|
-
{slot: 'popover', month: 12, day: 24, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1566
|
-
{slot: 'popover', month: 12, day: 25, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1567
|
-
{slot: 'popover', month: 12, day: 26, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1568
|
-
{slot: 'popover', month: 12, day: 27, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1569
|
-
{slot: 'popover', month: 12, day: 28, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1570
|
-
{slot: 'popover', month: 12, day: 29, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1571
|
-
{slot: 'popover', month: 12, day: 30, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1572
|
-
{slot: 'popover', month: 12, day: 31, year: 2023, content: 'Tickets for this date are $2345'},
|
|
1573
|
-
{slot: 'popover', month: 1, day: 14, year: 2024, content: 'Tickets for this date are $83'},
|
|
1574
|
-
{slot: 'popover', month: 1, day: 15, year: 2024, content: 'Tickets for this date are $203'},
|
|
1575
|
-
{slot: 'popover', month: 1, day: 16, year: 2024, content: 'Tickets for this date are $4444'},
|
|
1576
|
-
{slot: 'popover', month: 1, day: 17, year: 2024, content: 'Tickets for this date are $83'},
|
|
1577
|
-
{slot: 'popover', month: 1, day: 18, year: 2024, content: 'Tickets for this date are $96'},
|
|
1578
|
-
{slot: 'popover', month: 1, day: 19, year: 2024, content: 'Tickets for this date are sold out'},
|
|
1579
|
-
{slot: 'popover', month: 1, day: 20, year: 2024, content: 'Tickets for this date are sold out'}
|
|
1580
|
-
];
|
|
1581
|
-
|
|
1582
|
-
// For each item in the array, parse the keys into an HTML element and insert it into the DOM
|
|
1583
|
-
data.forEach((item) => {
|
|
1584
|
-
// Create the new element for the slot content
|
|
1585
|
-
const slotElement = document.createElement('span');
|
|
1586
|
-
|
|
1587
|
-
if (item.month.toString().length === 1) {
|
|
1588
|
-
item.month = `0` + item.month;
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
if (item.day.toString().length === 1) {
|
|
1592
|
-
item.day = `0` + item.day;
|
|
1593
|
-
}
|
|
1594
|
-
|
|
1595
|
-
// Create the slot name from the item's keys
|
|
1596
|
-
const slotName = `${item.slot}_${item.month}_${item.day}_${item.year}`;
|
|
1597
|
-
|
|
1598
|
-
// Set the slot name and content
|
|
1599
|
-
slotElement.setAttribute('slot', slotName);
|
|
1600
|
-
slotElement.textContent = item.content;
|
|
1601
|
-
|
|
1602
|
-
// Set the 'highlight' attribute on date slot content
|
|
1603
|
-
if (item.slot === 'date' && item.highlight) {
|
|
1604
|
-
slotElement.setAttribute('highlight', item.highlight);
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1607
|
-
// Append the new element to the DOM
|
|
1608
|
-
populateSlotContentExample.appendChild(slotElement);
|
|
1609
|
-
});
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
populateSlotContentExample.pushSlotContent();
|
|
1613
|
-
});
|
|
1614
|
-
}</code></pre>
|
|
1615
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1616
|
-
</auro-accordion>
|
|
1617
|
-
|
|
1618
|
-
### Datepicker in Dialog
|
|
1619
|
-
|
|
1620
|
-
The following example demonstrates the use of `<auro-datepicker>` within an `<auro-dialog>` component.
|
|
1621
|
-
|
|
1622
|
-
<div class="exampleWrapper">
|
|
1623
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/in-dialog.html) -->
|
|
1624
|
-
<!-- The below content is automatically added from ./../apiExamples/in-dialog.html -->
|
|
1625
|
-
<div>
|
|
1626
|
-
<auro-button id="datepicker-dialog-opener">Datepicker in Dialog</auro-button>
|
|
1627
|
-
<auro-dialog id="datepicker-dialog">
|
|
1628
|
-
<span slot="bib.fullscreen.headline">inDialog Example</span>
|
|
1629
|
-
<span slot="header">Datepicker in Dialog</span>
|
|
1630
|
-
<div slot="content">
|
|
1631
|
-
<auro-datepicker />
|
|
1632
|
-
</div>
|
|
1633
|
-
</auro-dialog>
|
|
1634
|
-
</div>
|
|
1635
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1636
|
-
</div>
|
|
1637
|
-
<auro-accordion alignRight>
|
|
1638
|
-
<span slot="trigger">See code</span>
|
|
1639
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/in-dialog.html) -->
|
|
1640
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/in-dialog.html -->
|
|
1641
|
-
|
|
1642
|
-
<pre class="language-html"><code class="language-html"><div>
|
|
1643
|
-
<auro-button id="datepicker-dialog-opener">Datepicker in Dialog</auro-button>
|
|
1644
|
-
<auro-dialog id="datepicker-dialog">
|
|
1645
|
-
<span slot="bib.fullscreen.headline">inDialog Example</span>
|
|
1646
|
-
<span slot="header">Datepicker in Dialog</span>
|
|
1647
|
-
<div slot="content">
|
|
1648
|
-
<auro-datepicker />
|
|
1649
|
-
</div>
|
|
1650
|
-
</auro-dialog>
|
|
1651
|
-
</div></code></pre>
|
|
1652
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1653
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/in-dialog.js) -->
|
|
1654
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/in-dialog.js -->
|
|
1655
|
-
|
|
1656
|
-
<pre class="language-js"><code class="language-js">export function inDialogExample() {
|
|
1657
|
-
document.querySelector("#datepicker-dialog-opener").addEventListener("click", () => {
|
|
1658
|
-
const dialog = document.querySelector("#datepicker-dialog");
|
|
1659
|
-
dialog.open = true;
|
|
1660
|
-
});
|
|
1661
|
-
};</code></pre>
|
|
1662
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1663
|
-
</auro-accordion>
|
|
1664
|
-
|
|
1665
|
-
### Datepicker in Drawer
|
|
1666
|
-
|
|
1667
|
-
The following example demonstrates the use of `<auro-datepicker>` within an `<auro-drawer>` component.
|
|
1668
|
-
|
|
1669
|
-
<div class="exampleWrapper">
|
|
1670
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/in-drawer.html) -->
|
|
1671
|
-
<!-- The below content is automatically added from ./../apiExamples/in-drawer.html -->
|
|
1672
|
-
<div>
|
|
1673
|
-
<auro-button id="datepicker-drawer-opener">Datepicker in Drawer</auro-button>
|
|
1674
|
-
<auro-drawer id="datepicker-drawer">
|
|
1675
|
-
<span slot="header">Datepicker in Drawer</span>
|
|
1676
|
-
<div slot="content">
|
|
1677
|
-
<auro-datepicker>
|
|
1678
|
-
<span slot="bib.fullscreen.headline">inDrawer Example</span>
|
|
1679
|
-
</auro-datepicker>
|
|
1680
|
-
</div>
|
|
1681
|
-
</auro-drawer>
|
|
1682
|
-
</div>
|
|
1683
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1684
|
-
</div>
|
|
1685
|
-
<auro-accordion alignRight>
|
|
1686
|
-
<span slot="trigger">See code</span>
|
|
1687
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/in-drawer.html) -->
|
|
1688
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/in-drawer.html -->
|
|
1689
|
-
|
|
1690
|
-
<pre class="language-html"><code class="language-html"><div>
|
|
1691
|
-
<auro-button id="datepicker-drawer-opener">Datepicker in Drawer</auro-button>
|
|
1692
|
-
<auro-drawer id="datepicker-drawer">
|
|
1693
|
-
<span slot="header">Datepicker in Drawer</span>
|
|
1694
|
-
<div slot="content">
|
|
1695
|
-
<auro-datepicker>
|
|
1696
|
-
<span slot="bib.fullscreen.headline">inDrawer Example</span>
|
|
1697
|
-
</auro-datepicker>
|
|
1698
|
-
</div>
|
|
1699
|
-
</auro-drawer>
|
|
1700
|
-
</div></code></pre>
|
|
1701
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1702
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/in-drawer.js) -->
|
|
1703
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/in-drawer.js -->
|
|
1704
|
-
|
|
1705
|
-
<pre class="language-js"><code class="language-js">export function inDrawerExample() {
|
|
1706
|
-
document.querySelector("#datepicker-drawer-opener").addEventListener("click", () => {
|
|
1707
|
-
const drawer = document.querySelector("#datepicker-drawer");
|
|
1708
|
-
if (drawer.hasAttribute('open')) {
|
|
1709
|
-
drawer.removeAttribute('open');
|
|
1710
|
-
} else {
|
|
1711
|
-
drawer.setAttribute('open', true);
|
|
1712
|
-
}
|
|
1713
|
-
});
|
|
1714
|
-
};</code></pre>
|
|
1715
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1716
|
-
</auro-accordion>
|
|
1717
|
-
|
|
1718
|
-
## Restyle Component with CSS Variables
|
|
1719
|
-
|
|
1720
|
-
The component may be restyled by changing the values of the following token(s).
|
|
1721
|
-
|
|
1722
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
1723
|
-
<!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
|
|
1724
|
-
|
|
1725
|
-
<pre class="language-scss"><code class="language-scss">/* stylelint-disable color-function-notation */
|
|
1726
|
-
|
|
1727
|
-
@use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
|
|
1728
|
-
|
|
1729
|
-
:host(:not([ondark])),
|
|
1730
|
-
:host(:not([appearance="inverse"])) {
|
|
1731
|
-
// datepicker
|
|
1732
|
-
--ds-auro-datepicker-range-input-divider-color: var(--ds-basic-color-border-bold, #{v.$ds-basic-color-border-bold});
|
|
1733
|
-
--ds-auro-datepicker-error-icon-color: var(--ds-basic-color-status-error, #{v.$ds-basic-color-status-error});
|
|
1734
|
-
--ds-auro-datepicker-label-text-color: var(--ds-basic-color-texticon-muted, #{v.$ds-basic-color-texticon-muted});
|
|
1735
|
-
--ds-auro-datepicker-outline-color: transparent;
|
|
1736
|
-
|
|
1737
|
-
// calendar
|
|
1738
|
-
--ds-auro-calendar-mobile-header-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
|
|
1739
|
-
--ds-auro-calendar-mobile-header-divider-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
|
|
1740
|
-
--ds-auro-calendar-mobile-header-text-color: var(--ds-basic-color-texticon-muted, #{v.$ds-basic-color-texticon-muted});
|
|
1741
|
-
--ds-auro-calendar-nav-btn-border-color: transparent;
|
|
1742
|
-
--ds-auro-calendar-nav-btn-chevron-color: var(--ds-basic-color-brand-primary, #{v.$ds-basic-color-brand-primary});
|
|
1743
|
-
--ds-auro-calendar-nav-btn-container-color: transparent;
|
|
1744
|
-
--ds-auro-calendar-month-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
|
|
1745
|
-
--ds-auro-calendar-month-divider-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
|
|
1746
|
-
--ds-auro-calendar-month-header-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1747
|
-
--ds-auro-calendar-cell-border-color: transparent;
|
|
1748
|
-
--ds-auro-calendar-cell-container-color: transparent;
|
|
1749
|
-
--ds-auro-calendar-cell-in-range-color: var(--ds-advanced-color-shared-background-muted, #{v.$ds-advanced-color-shared-background-muted});
|
|
1750
|
-
--ds-auro-calendar-cell-price-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1751
|
-
--ds-auro-calendar-cell-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1754
|
-
:host([ondark]),
|
|
1755
|
-
:host([appearance="inverse"]) {
|
|
1756
|
-
// datepicker
|
|
1757
|
-
--ds-auro-datepicker-range-input-divider-color: var(--ds-basic-color-texticon-inverse-muted, #{v.$ds-basic-color-texticon-inverse-muted});
|
|
1758
|
-
--ds-auro-datepicker-error-icon-color: var(--ds-advanced-color-state-error-inverse, #{v.$ds-advanced-color-state-error-inverse});
|
|
1759
|
-
--ds-auro-datepicker-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #{v.$ds-basic-color-texticon-inverse-muted});
|
|
1760
|
-
--ds-auro-datepicker-outline-color: transparent;
|
|
1761
|
-
|
|
1762
|
-
// calendar
|
|
1763
|
-
--ds-auro-calendar-mobile-header-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
|
|
1764
|
-
--ds-auro-calendar-mobile-header-divider-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
|
|
1765
|
-
--ds-auro-calendar-mobile-header-text-color: var(--ds-basic-color-texticon-muted, #{v.$ds-basic-color-texticon-muted});
|
|
1766
|
-
--ds-auro-calendar-nav-btn-border-color: transparent;
|
|
1767
|
-
--ds-auro-calendar-nav-btn-chevron-color: var(--ds-basic-color-brand-primary, #{v.$ds-basic-color-brand-primary});
|
|
1768
|
-
--ds-auro-calendar-nav-btn-container-color: transparent;
|
|
1769
|
-
--ds-auro-calendar-month-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
|
|
1770
|
-
--ds-auro-calendar-month-divider-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
|
|
1771
|
-
--ds-auro-calendar-month-header-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1772
|
-
--ds-auro-calendar-cell-border-color: transparent;
|
|
1773
|
-
--ds-auro-calendar-cell-container-color: transparent;
|
|
1774
|
-
--ds-auro-calendar-cell-in-range-color: var(--ds-advanced-color-shared-background-muted, #{v.$ds-advanced-color-shared-background-muted});
|
|
1775
|
-
--ds-auro-calendar-cell-price-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1776
|
-
--ds-auro-calendar-cell-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1777
|
-
}</code></pre>
|
|
100
|
+
|-------------------|--------------------------------------------------|
|
|
101
|
+
| `calendar` | Use for customizing the style of the calendar. |
|
|
102
|
+
| `calendarWrapper` | Use for customizing the style of the calendar container. |
|
|
103
|
+
| `dropdown` | Use for customizing the style of the dropdown. |
|
|
104
|
+
| `helpText` | Use for customizing the style of the datepicker help text. |
|
|
105
|
+
| `helpTextSpan` | Use for customizing the style of the datepicker help text span. |
|
|
106
|
+
| `input` | Use for customizing the style of the datepicker inputs. |
|
|
107
|
+
| `trigger` | Use for customizing the style of the datepicker trigger. |
|
|
1778
108
|
<!-- AURO-GENERATED-CONTENT:END -->
|