|
8 | 8 |
|
9 | 9 | ```html:preview |
10 | 10 | <oui-action-menu text="Actions"> |
11 | | - <oui-action-menu-item text="Action 1 (link)" href="#"></oui-action-menu-item> |
12 | | - <oui-action-menu-item text="Action 2 (button)" on-click="$ctrl.onActionClick()"></oui-action-menu-item> |
13 | | - <oui-action-menu-item text="Action 3 (disabled)" disabled></oui-action-menu-item> |
| 11 | + <oui-action-menu-item href="#">Action 1 (link)</oui-action-menu-item> |
| 12 | + <oui-action-menu-item on-click="$ctrl.onActionClick()">Action 2 (button)</oui-action-menu-item> |
| 13 | + <oui-action-menu-item disabled>Action 3 (disabled)</oui-action-menu-item> |
14 | 14 | <oui-action-menu-divider></oui-action-menu-divider> |
15 | | - <oui-action-menu-item text="External link" href="#" external></oui-action-menu-item> |
| 15 | + <oui-action-menu-item href="#" external>External link</oui-action-menu-item> |
16 | 16 | </oui-action-menu> |
17 | 17 | ``` |
18 | 18 |
|
19 | 19 | ### Compact |
20 | 20 |
|
21 | 21 | ```html:preview |
22 | 22 | <oui-action-menu compact> |
23 | | - <oui-action-menu-item text="Action 1 (link)" href="#"></oui-action-menu-item> |
24 | | - <oui-action-menu-item text="Action 2 (button)" on-click="$ctrl.onActionClick()"></oui-action-menu-item> |
25 | | - <oui-action-menu-item text="Action 3 (disabled)" disabled></oui-action-menu-item> |
| 23 | + <oui-action-menu-item href="#">Action 1 (link)</oui-action-menu-item> |
| 24 | + <oui-action-menu-item on-click="$ctrl.onActionClick()">Action 2 (button)</oui-action-menu-item> |
| 25 | + <oui-action-menu-item disabled>Action 3 (disabled)</oui-action-menu-item> |
26 | 26 | <oui-action-menu-divider></oui-action-menu-divider> |
27 | | - <oui-action-menu-item text="External link" href="#" external></oui-action-menu-item> |
| 27 | + <oui-action-menu-item href="#" external>External link</oui-action-menu-item> |
28 | 28 | </oui-action-menu> |
29 | 29 | ``` |
30 | 30 |
|
31 | 31 | ### Disabled |
32 | 32 |
|
33 | 33 | ```html:preview |
34 | 34 | <oui-action-menu text="Actions" disabled> |
35 | | - <oui-action-menu-item text="Action 1 (link)" href="#"></oui-action-menu-item> |
36 | | - <oui-action-menu-item text="Action 2 (button)" on-click="$ctrl.onActionClick()"></oui-action-menu-item> |
37 | | - <oui-action-menu-item text="Action 3 (disabled)" disabled></oui-action-menu-item> |
| 35 | + <oui-action-menu-item href="#">Action 1 (link)</oui-action-menu-item> |
| 36 | + <oui-action-menu-item on-click="$ctrl.onActionClick()">Action 2 (button)</oui-action-menu-item> |
| 37 | + <oui-action-menu-item disabled>Action 3 (disabled)</oui-action-menu-item> |
38 | 38 | <oui-action-menu-divider></oui-action-menu-divider> |
39 | | - <oui-action-menu-item text="External link" href="#" external></oui-action-menu-item> |
| 39 | + <oui-action-menu-item href="#" external>External link</oui-action-menu-item> |
40 | 40 | </oui-action-menu> |
41 | 41 |
|
42 | 42 | <oui-action-menu compact disabled> |
43 | | - <oui-action-menu-item text="Action 1 (link)" href="#"></oui-action-menu-item> |
44 | | - <oui-action-menu-item text="Action 2 (button)" on-click="$ctrl.onActionClick()"></oui-action-menu-item> |
45 | | - <oui-action-menu-item text="Action 3 (disabled)" disabled></oui-action-menu-item> |
| 43 | + <oui-action-menu-item href="#">Action 1 (link)</oui-action-menu-item> |
| 44 | + <oui-action-menu-item on-click="$ctrl.onActionClick()">Action 2 (button)</oui-action-menu-item> |
| 45 | + <oui-action-menu-item disabled>Action 3 (disabled)</oui-action-menu-item> |
46 | 46 | <oui-action-menu-divider></oui-action-menu-divider> |
47 | | - <oui-action-menu-item text="External link" href="#" external></oui-action-menu-item> |
| 47 | + <oui-action-menu-item href="#" external>External link</oui-action-menu-item> |
48 | 48 | </oui-action-menu> |
49 | 49 | ``` |
50 | 50 |
|
|
55 | 55 | ng-init="$ctrl.action1 = false; $ctrl.action2 = false; $ctrl.action3 = false"> |
56 | 56 | <oui-action-menu compact> |
57 | 57 | <oui-action-menu-item |
58 | | - text="Action 1" |
59 | 58 | aria-label="Server: action 1" |
60 | 59 | on-click="$ctrl.action1 = true"> |
| 60 | + Action 1 |
61 | 61 | </oui-action-menu-item> |
62 | 62 | <oui-action-menu-item |
63 | | - text="Action 2" |
64 | 63 | aria-label="Server: action 2" |
65 | 64 | on-click="$ctrl.action2 = true"> |
| 65 | + Action 2 |
66 | 66 | </oui-action-menu-item> |
67 | 67 | <oui-action-menu-item |
68 | | - text="Action 3 (disabled)" |
69 | 68 | aria-label="Server: action 3" |
70 | 69 | on-click="$ctrl.action3 = true" |
71 | 70 | disabled> |
| 71 | + Action 3 (disabled) |
72 | 72 | </oui-action-menu-item> |
73 | 73 | <oui-action-menu-divider></oui-action-menu-divider> |
74 | 74 | <oui-action-menu-item |
75 | | - text="External link" |
76 | 75 | href="#" |
77 | 76 | external> |
| 77 | + External link |
78 | 78 | </oui-action-menu-item> |
79 | 79 | </oui-action-menu> |
80 | 80 | </div> |
|
91 | 91 |
|
92 | 92 | | Attribute | Type | Binding | One-time binding | Values | Default | Description |
93 | 93 | | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
94 | | -| `text` | string | @ | yes | | | button label |
95 | | -| `aria-label` | string | @? | yes | | | accessibility label |
96 | | -| `align` | string | @? | yes | `start`,`center`,`end` | `center` | menu alignment |
97 | | -| `compact` | boolean | <? | yes | | `false` | use the compact button |
98 | | -| `disabled` | boolean | <? | | | `false` | disable flag |
| 94 | +| `text` | string | @ | yes | n/a | n/a | button label |
| 95 | +| `aria-label` | string | @? | yes | n/a | n/a | accessibility label |
| 96 | +| `align` | string | @? | yes | `start`, `center`, `end` | `center` | menu alignment |
| 97 | +| `compact` | boolean | <? | yes | `true`, `false` | `false` | use the compact button |
| 98 | +| `disabled` | boolean | <? | no | `true`, `false` | `false` | disable flag |
99 | 99 |
|
100 | 100 | ### oui-action-menu-item |
101 | 101 |
|
102 | 102 | | Attribute | Type | Binding | One-time binding | Values | Default | Description |
103 | 103 | | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
104 | | -| `text` | string | @ | | | | button label |
105 | | -| `aria-label` | string | @? | | | | accessibility label |
106 | | -| `href` | string | @? | yes | | | hypertext link (link) |
107 | | -| `disabled` | boolean | <? | | | `false` | disable (button) |
108 | | -| `external` | boolean | @? | yes | | | display external icon (link) |
109 | | -| `on-click` | | &? | | | | on-click handler (button) |
| 104 | +| `aria-label` | string | @? | no | n/a | n/a | accessibility label |
| 105 | +| `href` | string | @? | yes | n/a | n/a | hypertext link (link) |
| 106 | +| `disabled` | boolean | <? | no | `true`, `false` | `false` | disable (button) |
| 107 | +| `external` | boolean | @? | yes | `true`, `false` | `false` | display external icon (link) |
| 108 | +| `on-click` | function | &? | no | n/a | n/a | on-click handler (button) |
| 109 | + |
| 110 | +#### Deprecated |
| 111 | + |
| 112 | +* `text`: Replaced by transclude value |
0 commit comments