1
1
---
2
2
title : " ion-action-sheet"
3
3
---
4
+ import Tabs from '@theme/Tabs ';
5
+ import TabItem from '@theme/TabItem ';
6
+
4
7
import Props from '@ionic-internal/component-api /v7/action-sheet/props.md';
5
8
import Events from '@ionic-internal/component-api /v7/action-sheet/events.md';
6
9
import Methods from '@ionic-internal/component-api /v7/action-sheet/methods.md';
@@ -9,7 +12,7 @@ import CustomProps from '@ionic-internal/component-api/v7/action-sheet/custom-pr
9
12
import Slots from '@ionic-internal/component-api /v7/action-sheet/slots.md';
10
13
11
14
<head >
12
- <title >ion-action-sheet | Action Sheet Dialog for iOS and Android Apps </title >
15
+ <title >ion-action-sheet: Action Sheet Dialog for iOS and Android </title >
13
16
<meta name =" description " content =" アクションシートはアプリのコンテンツの上に一連のオプションを表示するダイアログで、手動で解除する必要があります。iOSとAndroidのデバイスでの使用方法については、こちらをご覧ください。 " />
14
17
</head >
15
18
@@ -94,9 +97,149 @@ import CssCustomProperties from '@site/static/usage/v7/action-sheet/theming/css-
94
97
95
98
## アクセシビリティ
96
99
97
- アクションシートには ` role ` として [ ` dialog ` ] ( https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/dialog_role ) が与えられます。ARIA仕様に合わせるため、` aria-label ` 属性または` aria-labelledby ` 属性のいずれかを設定する必要があります。
100
+ ### Screen Readers
101
+
102
+ アクションシートは、スクリーンリーダーにとって [ アクセシブル] ( ../reference/glossary#a11y ) であるためにariaプロパティを設定しますが、これらのプロパティは、十分な説明になっていなかったり、アクションシートがアプリでどのように使用されているかに合っていなかったりする場合、オーバーライドすることができます。
103
+
104
+ #### Role
105
+
106
+ アクションシートには ` role ` として [ ` dialog ` ] ( https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/dialog_role ) が設定されます。ARIA仕様に合わせるためには、` aria-label ` 属性か` aria-labelledby ` 属性のどちらかを設定しなければなりません。
107
+
108
+ #### Action Sheet の概要
109
+
110
+ Ionicは自動的にヘッダー要素を指すように ` aria-labelledby ` を設定するので、すべてのアクションシートには ` header ` プロパティを定義することを強く推奨します。しかし、` header ` を含めない場合は、` htmlAttributes ` プロパティを使って、説明的な` aria-label ` を指定するか、カスタムの` aria-labelledby ` 値を設定することもできます。
111
+
112
+ <Tabs groupId="framework" defaultValue="angular" values={[ { value: 'angular', label: 'Angular' }, { value: 'javascript', label: 'Javascript' }, { value: 'react', label: 'React' }, { value: 'vue', label: 'Vue' }] }>
113
+
114
+ <TabItem value =" angular " >
115
+
116
+ ``` javascript
117
+ const actionSheet = await this .actionSheetController .create ({
118
+ htmlAttributes: {
119
+ ' aria-label' : ' action sheet dialog' ,
120
+ },
121
+ });
122
+ ```
123
+
124
+ </TabItem >
125
+
126
+ <TabItem value =" javascript " >
127
+
128
+ ``` javascript
129
+ const actionSheet = await this .actionSheetController .create ({
130
+ htmlAttributes: {
131
+ ' aria-label' : ' action sheet dialog' ,
132
+ },
133
+ });
134
+ ```
135
+
136
+ </TabItem >
98
137
99
- Ionicは自動的にヘッダー要素を指すように ` aria-labelledby ` を設定するので、すべてのアクションシートには ` header ` プロパティを定義することが強く推奨されています。しかし、` header ` を含めない場合は、` htmlAttributes ` プロパティを使用して、説明的な` aria-label ` を提供するか、カスタム` aria-labelledby ` 値を設定することも可能です。
138
+ <TabItem value =" react " >
139
+
140
+ ``` javascript
141
+ useIonActionSheet ({
142
+ htmlAttributes: {
143
+ ' aria-label' : ' action sheet dialog' ,
144
+ },
145
+ });
146
+ ```
147
+
148
+ </TabItem >
149
+
150
+ <TabItem value =" vue " >
151
+
152
+ ``` javascript
153
+ const actionSheet = await actionSheetController .create ({
154
+ htmlAttributes: {
155
+ ' aria-label' : ' action sheet dialog' ,
156
+ },
157
+ });
158
+ ```
159
+
160
+ </TabItem >
161
+
162
+ </Tabs >
163
+
164
+ #### Action Sheet Buttons の概要
165
+
166
+ テキストを含むボタンはスクリーンリーダーによって読み取られる。ボタンがアイコンのみを含んでいる場合や、既存のテキスト以外の説明が必要な場合は、ボタンの ` htmlAttributes ` プロパティに ` aria-label ` を渡して、ラベルをボタンに割り当てる必要があります。
167
+
168
+ <Tabs groupId="framework" defaultValue="angular" values={[ { value: 'angular', label: 'Angular' }, { value: 'javascript', label: 'Javascript' }, { value: 'react', label: 'React' }, { value: 'vue', label: 'Vue' }] }>
169
+
170
+ <TabItem value =" angular " >
171
+
172
+ ``` javascript
173
+ const actionSheet = await this .actionSheetController .create ({
174
+ header: ' Header' ,
175
+ buttons: [
176
+ {
177
+ icon: ' close' ,
178
+ htmlAttributes: {
179
+ ' aria-label' : ' close' ,
180
+ },
181
+ },
182
+ ],
183
+ });
184
+ ```
185
+
186
+ </TabItem >
187
+
188
+ <TabItem value =" javascript " >
189
+
190
+ ``` javascript
191
+ const actionSheet = await this .actionSheetController .create ({
192
+ header: ' Header' ,
193
+ buttons: [
194
+ {
195
+ icon: ' close' ,
196
+ htmlAttributes: {
197
+ ' aria-label' : ' close' ,
198
+ },
199
+ },
200
+ ],
201
+ });
202
+ ```
203
+
204
+ </TabItem >
205
+
206
+ <TabItem value =" react " >
207
+
208
+ ``` javascript
209
+ useIonActionSheet ({
210
+ header: ' Header' ,
211
+ buttons: [
212
+ {
213
+ icon: ' close' ,
214
+ htmlAttributes: {
215
+ ' aria-label' : ' close' ,
216
+ },
217
+ },
218
+ ],
219
+ });
220
+ ```
221
+
222
+ </TabItem >
223
+
224
+ <TabItem value =" vue " >
225
+
226
+ ``` javascript
227
+ const actionSheet = await actionSheetController .create ({
228
+ header: ' Header' ,
229
+ buttons: [
230
+ {
231
+ icon: ' close' ,
232
+ htmlAttributes: {
233
+ ' aria-label' : ' close' ,
234
+ },
235
+ },
236
+ ],
237
+ });
238
+ ```
239
+
240
+ </TabItem >
241
+
242
+ </Tabs >
100
243
101
244
## Interfaces
102
245
@@ -108,6 +251,8 @@ interface ActionSheetButton<T = any> {
108
251
role? : ' cancel' | ' destructive' | ' selected' | string ;
109
252
icon? : string ;
110
253
cssClass? : string | string [];
254
+ id? : string ;
255
+ htmlAttributes? : { [key : string ]: any };
111
256
handler? : () => boolean | void | Promise <boolean | void >;
112
257
data? : T ;
113
258
}
@@ -150,4 +295,4 @@ interface ActionSheetOptions {
150
295
<CustomProps />
151
296
152
297
## Slots
153
- <Slots />
298
+ <Slots />
0 commit comments