-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4344 from nextcloud/fix/ncbutton-pressed-style
feat(NcButton): Add `pressed` state for stateful buttons
- Loading branch information
Showing
68 changed files
with
158 additions
and
3 deletions.
There are no files selected for viewing
Binary file modified
BIN
-1 Byte
(100%)
...null-starred_false-compact_true-header_image-secondary_button-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5 Bytes
(100%)
...e_null-starred_false-compact_true-header_image-secondary_none-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
..._null-starred_false-compact_true-header_none-secondary_button-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
...me_null-starred_false-compact_true-header_none-secondary_none-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1 Byte
(100%)
..._null-starred_null-compact_true-header_image-secondary_button-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
...me_null-starred_null-compact_true-header_image-secondary_none-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2 Bytes
(100%)
...e_null-starred_null-compact_true-header_none-secondary_button-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
...ame_null-starred_null-compact_true-header_none-secondary_none-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+153 Bytes
(100%)
...null-starred_true-compact_true-header_image-secondary_button-editable_false.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+138 Bytes
(100%)
..._null-starred_true-compact_true-header_image-secondary_button-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+92 Bytes
(100%)
...e_null-starred_true-compact_true-header_image-secondary_none-editable_false.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+130 Bytes
(100%)
...me_null-starred_true-compact_true-header_image-secondary_none-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+175 Bytes
(100%)
..._null-starred_true-compact_true-header_none-secondary_button-editable_false.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+177 Bytes
(100%)
...e_null-starred_true-compact_true-header_none-secondary_button-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+153 Bytes
(100%)
...me_null-starred_true-compact_true-header_none-secondary_none-editable_false.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+160 Bytes
(100%)
...ame_null-starred_true-compact_true-header_none-secondary_none-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
...true-starred_false-compact_true-header_image-secondary_button-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2 Bytes
(100%)
...e_true-starred_false-compact_true-header_image-secondary_none-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
..._true-starred_false-compact_true-header_none-secondary_button-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
...me_true-starred_false-compact_true-header_none-secondary_none-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1 Byte
(100%)
..._true-starred_null-compact_true-header_image-secondary_button-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2 Bytes
(100%)
...me_true-starred_null-compact_true-header_image-secondary_none-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
...e_true-starred_null-compact_true-header_none-secondary_button-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2 Bytes
(100%)
...ame_true-starred_null-compact_true-header_none-secondary_none-editable_true.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+137 Bytes
(100%)
...true-starred_true-compact_true-header_image-secondary_button-editable_false.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+171 Bytes
(100%)
..._true-starred_true-compact_true-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+138 Bytes
(100%)
...e_true-starred_true-compact_true-header_image-secondary_none-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+169 Bytes
(100%)
...me_true-starred_true-compact_true-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+211 Bytes
(100%)
..._true-starred_true-compact_true-header_none-secondary_button-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+223 Bytes
(100%)
...e_true-starred_true-compact_true-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+168 Bytes
(100%)
...me_true-starred_true-compact_true-header_none-secondary_none-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+189 Bytes
(100%)
...ame_true-starred_true-compact_true-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-2 Bytes
(100%)
...ull-starred_false-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-4 Bytes
(100%)
..._null-starred_false-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-3 Bytes
(100%)
...null-starred_false-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-3 Bytes
(100%)
...e_null-starred_false-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-2 Bytes
(100%)
...null-starred_null-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-2 Bytes
(100%)
...e_null-starred_null-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-2 Bytes
(100%)
..._null-starred_null-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-3 Bytes
(100%)
...me_null-starred_null-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+180 Bytes
(100%)
...ull-starred_true-compact_false-header_image-secondary_button-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+210 Bytes
(100%)
...null-starred_true-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+157 Bytes
(100%)
..._null-starred_true-compact_false-header_image-secondary_none-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+175 Bytes
(100%)
...e_null-starred_true-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+175 Bytes
(100%)
...null-starred_true-compact_false-header_none-secondary_button-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+177 Bytes
(100%)
..._null-starred_true-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+153 Bytes
(100%)
...e_null-starred_true-compact_false-header_none-secondary_none-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+160 Bytes
(100%)
...me_null-starred_true-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
...rue-starred_false-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-5 Bytes
(100%)
..._true-starred_false-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-3 Bytes
(100%)
...true-starred_false-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-1 Byte
(100%)
...e_true-starred_false-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-1 Byte
(100%)
...true-starred_null-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-4 Bytes
(100%)
...e_true-starred_null-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-3 Bytes
(100%)
..._true-starred_null-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
-2 Bytes
(100%)
...me_true-starred_null-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+130 Bytes
(100%)
...rue-starred_true-compact_false-header_image-secondary_button-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+192 Bytes
(100%)
...true-starred_true-compact_false-header_image-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+179 Bytes
(100%)
..._true-starred_true-compact_false-header_image-secondary_none-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+195 Bytes
(100%)
...e_true-starred_true-compact_false-header_image-secondary_none-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+211 Bytes
(100%)
...true-starred_true-compact_false-header_none-secondary_button-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+223 Bytes
(100%)
..._true-starred_true-compact_false-header_none-secondary_button-editable_true.png
Oops, something went wrong.
Binary file modified
BIN
+168 Bytes
(100%)
...e_true-starred_true-compact_false-header_none-secondary_none-editable_false.png
Oops, something went wrong.
Binary file modified
BIN
+189 Bytes
(100%)
...me_true-starred_true-compact_false-header_none-secondary_none-editable_true.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de> | ||
* | ||
* @author Ferdinand Thiessen <opensource@fthiessen.de> | ||
* | ||
* @license AGPL-3.0-or-later | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
import { shallowMount } from '@vue/test-utils' | ||
import NcButton from '../../../../src/components/NcButton/NcButton.vue' | ||
|
||
describe('NcButton', () => { | ||
it('emits update:pressed', async () => { | ||
const wrapper = shallowMount(NcButton, { propsData: { pressed: true, ariaLabel: 'button' } }) | ||
wrapper.findComponent('button').trigger('click') | ||
expect(wrapper.emitted('update:pressed')?.length).toBe(1) | ||
expect(wrapper.emitted('update:pressed')[0]).toEqual([false]) | ||
|
||
// Now the same but when pressed was false | ||
await wrapper.setProps({ pressed: false }) | ||
wrapper.findComponent('button').trigger('click') | ||
expect(wrapper.emitted('update:pressed')?.length).toBe(2) | ||
expect(wrapper.emitted('update:pressed')[1]).toEqual([true]) | ||
}) | ||
|
||
it('does not emit update:pressed when not configured', async () => { | ||
const wrapper = shallowMount(NcButton, { propsData: { ariaLabel: 'button' } }) | ||
wrapper.findComponent('button').trigger('click') | ||
expect(wrapper.emitted('update:pressed')).toBe(undefined) | ||
}) | ||
}) |