You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/checkbox.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,15 +29,27 @@ import Basic from '@site/static/usage/v7/checkbox/basic/index.md';
29
29
30
30
## Label Placement
31
31
32
-
Developers can use the `labelPlacement` property to control how the label is placed relative to the control.
32
+
Developers can use the `labelPlacement` property to control how the label is placed relative to the control. This property mirrors the flexbox `flex-direction` property.
33
33
34
34
import LabelPlacement from '@site/static/usage/v7/checkbox/label-placement/index.md';
35
35
36
36
<LabelPlacement />
37
37
38
+
## Alignment
39
+
40
+
Developers can use the `alignment` property to control how the label and control are aligned on the cross axis. This property mirrors the flexbox `align-items` property.
41
+
42
+
:::note
43
+
Stacked checkboxes can be aligned using the `alignment` property. This can be useful when the label and control need to be centered horizontally.
44
+
:::
45
+
46
+
import Alignment from '@site/static/usage/v7/checkbox/alignment/index.md';
47
+
48
+
<Alignment />
49
+
38
50
## Justification
39
51
40
-
Developers can use the `justify` property to control how the label and control are packed on a line.
52
+
Developers can use the `justify` property to control how the label and control are packed on a line. This property mirrors the flexbox `justify-content` property.
41
53
42
54
import Justify from '@site/static/usage/v7/checkbox/justify/index.md';
Copy file name to clipboardExpand all lines: docs/api/datetime.md
+19-4Lines changed: 19 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ import HighlightedDatesCallback from '@site/static/usage/v7/datetime/highlighted
37
37
import MultipleDateSelection from '@site/static/usage/v7/datetime/multiple/index.md';
38
38
39
39
import GlobalTheming from '@site/static/usage/v7/datetime/styling/global-theming/index.md';
40
+
import CalendarDaysStyling from '@site/static/usage/v7/datetime/styling/calendar-days/index.md';
40
41
import WheelStyling from '@site/static/usage/v7/datetime/styling/wheel-styling/index.md';
41
42
42
43
<head>
@@ -50,7 +51,7 @@ import EncapsulationPill from '@components/page/api/EncapsulationPill';
50
51
51
52
Datetimes present a calendar interface and time wheel, making it easy for users to select dates and times. Datetimes are similar to the native `input` elements of `datetime-local`, however, Ionic Framework's Datetime component makes it easy to display the date and time in the preferred format, and manage the datetime values.
52
53
53
-
## Overview
54
+
## Overview
54
55
55
56
Historically, handling datetime values within JavaScript, or even within HTML
56
57
inputs, has always been a challenge. Specifically, JavaScript's `Date` object is
@@ -98,13 +99,17 @@ While seconds, milliseconds, and time zone can be specified using the ISO 8601 d
98
99
99
100
If you need to present a datetime in an overlay such as a modal or a popover, we recommend using [ion-datetime-button](./datetime-button). `ion-datetime-button` should be used when space is constrained. This component displays buttons which show the current date and time values. When the buttons are tapped, the date or time pickers open in the overlay.
100
101
102
+
## Setting Values Asynchronously
103
+
104
+
If its `value` is updated programmatically after a datetime has already been created, the datetime will automatically jump to the new date. However, it is recommended to avoid updating the `value` in this way when users are able to interact with the datetime, as this could be disorienting for those currently trying to select a date. For example, if a datetime's `value` is loaded by an asynchronous process, it is recommended to hide the datetime with CSS until the value has finished updating.
105
+
101
106
## Date Constraints
102
107
103
108
### Max and Min Dates
104
109
105
110
To customize the minimum and maximum datetime values, the `min` and `max` component properties can be provided which may make more sense for the app's use-case. Following the same IS0 8601 format listed in the table above, each component can restrict which dates can be selected by the user.
106
111
107
-
The following example restricts date selection to March 2022 through May 2022 only.
112
+
The following example restricts date selection to March 2022 through May 2022 only.
108
113
109
114
<MaxMin />
110
115
@@ -118,7 +123,7 @@ The following example allows minutes to be selected in increments of 15. It also
118
123
119
124
### Advanced Date Constraints
120
125
121
-
With the `isDateEnabled` property, developers can customize the `ion-datetime` to disable a specific day, range of dates, weekends or any custom rule using an ISO 8601 date string.
126
+
With the `isDateEnabled` property, developers can customize the `ion-datetime` to disable a specific day, range of dates, weekends or any custom rule using an ISO 8601 date string.
122
127
The `isDateEnabled` property accepts a function returning a boolean, indicating if a date is enabled. The function is called for each rendered calendar day, for the previous, current and next month. Custom implementations should be optimized for performance to avoid jank.
123
128
124
129
The following example shows how to disable all weekend dates. For more advanced date manipulation, we recommend using a date utility such as `date-fns`.
@@ -321,6 +326,16 @@ The benefit of this approach is that every component, not just `ion-datetime`, c
321
326
322
327
<GlobalTheming />
323
328
329
+
### Calendar Days
330
+
331
+
The calendar days in a grid-style `ion-datetime` can be styled using CSS shadow parts.
332
+
333
+
:::note
334
+
The example below selects the day 2 days ago, unless that day is in the previous month, then it selects a day 2 days in the future. This is done for demo purposes in order to show how to apply custom styling to all days, the current day, and the selected day.
335
+
:::
336
+
337
+
<CalendarDaysStyling />
338
+
324
339
### Wheel Pickers
325
340
326
341
The wheels used in `ion-datetime` can be styled through a combination of shadow parts and CSS variables. This applies to both the columns in wheel-style datetimes, and the month/year picker in grid-style datetimes.
@@ -363,7 +378,7 @@ import { format, parseISO } from 'date-fns';
Copy file name to clipboardExpand all lines: docs/api/radio.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,21 +30,32 @@ import Basic from '@site/static/usage/v7/radio/basic/index.md';
30
30
31
31
## Label Placement
32
32
33
-
Developers can use the `labelPlacement` property to control how the label is placed relative to the control.
33
+
Developers can use the `labelPlacement` property to control how the label is placed relative to the control. This property mirrors the flexbox `flex-direction` property.
34
34
35
35
import LabelPlacement from '@site/static/usage/v7/radio/label-placement/index.md';
36
36
37
37
<LabelPlacement />
38
38
39
+
## Alignment
40
+
41
+
Developers can use the `alignment` property to control how the label and control are aligned on the cross axis. This property mirrors the flexbox `align-items` property.
42
+
43
+
:::note
44
+
Stacked radios can be aligned using the `alignment` property. This can be useful when the label and control need to be centered horizontally.
45
+
:::
46
+
47
+
import Alignment from '@site/static/usage/v7/radio/alignment/index.md';
48
+
49
+
<Alignment />
50
+
39
51
## Justification
40
52
41
-
Developers can use the `justify` property to control how the label and control are packed on a line.
53
+
Developers can use the `justify` property to control how the label and control are packed on a line. This property mirrors the flexbox `justify-content` property.
42
54
43
55
import Justify from '@site/static/usage/v7/radio/justify/index.md';
44
56
45
57
<Justify />
46
58
47
-
48
59
:::note
49
60
`ion-item` is only used in the demos to emphasize how `justify` works. It is not needed in order for `justify` to function correctly.
Copy file name to clipboardExpand all lines: docs/api/toggle.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,17 @@ import LabelPlacement from '@site/static/usage/v7/toggle/label-placement/index.m
53
53
54
54
<LabelPlacement />
55
55
56
+
## Alignment
57
+
58
+
Developers can use the `alignment` property to control how the label and control are aligned on the cross axis. This property mirrors the flexbox `align-items` property.
59
+
60
+
:::note
61
+
Stacked toggles can be aligned using the `alignment` property. This can be useful when the label and control need to be centered horizontally.
62
+
:::
63
+
64
+
import Alignment from '@site/static/usage/v7/toggle/alignment/index.md';
65
+
66
+
<Alignment />
56
67
57
68
## Justification
58
69
@@ -62,7 +73,6 @@ import Justify from '@site/static/usage/v7/toggle/justify/index.md';
0 commit comments