Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[next] refactor: Use boolean props with default value false #6509

Merged
merged 2 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Especially the following are now provided as composables:
* ci: Migrate component tests to Playwright [\#5818](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5818) \([susnux](https://github.com/susnux)\)
* Change module import paths - drop dist and .js-extension [\#6389](https://github.com/nextcloud-libraries/nextcloud-vue/pull/6389) \([susnux](https://github.com/susnux)\)
* The plugin was removed - components need to be registered manually now [\#6349](https://github.com/nextcloud-libraries/nextcloud-vue/pull/6349) \([ShGKme](https://github.com/ShGKme)\)
* chore(Nc*Field): icon slot change note [\#6398](https://github.com/nextcloud-libraries/nextcloud-vue/pull/6398) \([ShGKme](https://github.com/ShGKme)\)
* chore(Nc*Field): icon slot change note [\#6398](https://github.com/nextcloud-libraries/nextcloud-vue/pull/6398) \([ShGKme](https://github.com/ShGKme)\)
* Rename `checked` prop to `modelValue` [\#4994](https://github.com/nextcloud-libraries/nextcloud-vue/pull/4994) \([raimund-schluessler](https://github.com/raimund-schluessler)\)
* Unify `modelValue` naming [\#4990](https://github.com/nextcloud-libraries/nextcloud-vue/pull/4990) \([raimund-schluessler](https://github.com/raimund-schluessler)\)
* Remove deprecated mixins [\#4830](https://github.com/nextcloud-libraries/nextcloud-vue/pull/4830) \([raimund-schluessler](https://github.com/raimund-schluessler)\)
Expand Down
13 changes: 7 additions & 6 deletions src/components/NcAppContent/NcAppContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
'app-content-wrapper--show-list': !showDetails,
'app-content-wrapper--mobile': isMobile,}">
<NcAppDetailsToggle v-if="showDetails" @click.stop.prevent="hideDetails" />
<slot v-if="!showDetails" name="list" />

<slot v-if="!showDetails" name="list" />
<slot v-else />
</div>
<div v-else-if="layout === 'vertical-split' || layout === 'horizontal-split'" class="app-content-wrapper">
Expand Down Expand Up @@ -130,11 +130,11 @@
},
props: {
/**
* Allows to disable the control by swipe of the app navigation open state
* Allows to disable the control by swipe of the app navigation open state.
*/
allowSwipeNavigation: {
disableSwipe: {
type: Boolean,
default: true,
default: false,
},

/**
Expand Down Expand Up @@ -175,7 +175,8 @@
},

/**
* When in mobile view, only the list or the details are shown
* When in mobile view, only the list or the details are shown.
*
* If you provide a list, you need to provide a variable
* that will be set to true by the user when an element of
* the list gets selected. The details will then show a back
Expand Down Expand Up @@ -281,7 +282,7 @@
},

mounted() {
if (this.allowSwipeNavigation) {
if (!this.disableSwipe) {
this.swiping = useSwipe(this.$el, {
onSwipeEnd: this.handleSwipe,
})
Expand Down Expand Up @@ -321,7 +322,7 @@
/**
* Emitted when the list pane is resized by the user
*/
this.$emit('resize:list', { size: listPaneSize })

Check warning on line 325 in src/components/NcAppContent/NcAppContent.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Custom event name 'resize:list' must be camelCase
console.debug('AppContent pane config', listPaneSize)
},

Expand Down
2 changes: 1 addition & 1 deletion src/components/NcDialog/NcDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default {
<NcModal v-if="open"
class="dialog__modal"
:enable-slideshow="false"
:enable-swipe="false"
disable-swipe
v-bind="modalProps"
@close="handleClosed"
@update:show="handleClosing()">
Expand Down
8 changes: 4 additions & 4 deletions src/components/NcModal/NcModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,11 @@ export default {
default: false,
},
/**
* Enable swipe between slides
* Disable swipe between slides
*/
enableSwipe: {
disableSwipe: {
type: Boolean,
default: true,
default: false,
},
spreadNavigation: {
type: Boolean,
Expand Down Expand Up @@ -731,7 +731,7 @@ export default {
* @param {import('@vueuse/core').SwipeDirection} direction Swipe direction
*/
handleSwipe(e, direction) {
if (this.enableSwipe) {
if (!this.disableSwipe) {
if (direction === 'left') {
// swiping to left to go to the next item
this.next(e)
Expand Down
Loading