diff --git a/lib/components/FilePicker/FilePicker.vue b/lib/components/FilePicker/FilePicker.vue
index 6d16fb1a..72089800 100644
--- a/lib/components/FilePicker/FilePicker.vue
+++ b/lib/components/FilePicker/FilePicker.vue
@@ -11,7 +11,8 @@
+ :filter-string.sync="filterString"
+ :disabled-navigation="disabledNavigation" />
@@ -89,6 +90,11 @@ const props = withDefaults(defineProps<{
*/
allowPickDirectory?: boolean
+ /**
+ * Is the navigation disabled
+ */
+ disabledNavigation?: boolean
+
/**
* Where to mount the dialog
* @default 'body'
@@ -121,6 +127,7 @@ const props = withDefaults(defineProps<{
path?: string
}>(), {
allowPickDirectory: false,
+ disabledNavigation: false,
container: 'body',
filterFn: undefined,
mimetypeFilter: () => [],
diff --git a/lib/components/FilePicker/FilePickerNavigation.vue b/lib/components/FilePicker/FilePickerNavigation.vue
index f3256e7e..62c4bc83 100644
--- a/lib/components/FilePicker/FilePickerNavigation.vue
+++ b/lib/components/FilePicker/FilePickerNavigation.vue
@@ -12,7 +12,7 @@
-
+
@@ -52,7 +52,8 @@ import { useViews } from '../../composables/views'
const props = defineProps<{
currentView: 'files' | 'recent' | 'favorites',
filterString: string,
- isCollapsed: boolean
+ isCollapsed: boolean,
+ disabledNavigation: boolean,
}>()
interface INavigationEvents {
diff --git a/lib/filepicker-builder.ts b/lib/filepicker-builder.ts
index e3ccdd53..a1a28ab7 100644
--- a/lib/filepicker-builder.ts
+++ b/lib/filepicker-builder.ts
@@ -56,6 +56,7 @@ export class FilePicker {
private path?: string
private filter?: IFilePickerFilter
private container?: string
+ private disabledNavigation: boolean
public constructor(title: string,
multiSelect: IsMultiSelect,
@@ -64,7 +65,9 @@ export class FilePicker {
buttons: IFilePickerButton[] | IFilePickerButtonFactory,
path?: string,
filter?: IFilePickerFilter,
- container?: string) {
+ container?: string,
+ disabledNavigation = false,
+ ) {
this.title = title
this.multiSelect = multiSelect
this.mimeTypeFilter = mimeTypeFilter
@@ -73,6 +76,7 @@ export class FilePicker {
this.filter = filter
this.buttons = buttons
this.container = container
+ this.disabledNavigation = disabledNavigation
}
/**
@@ -93,6 +97,7 @@ export class FilePicker {
mimetypeFilter: this.mimeTypeFilter,
multiselect: this.multiSelect,
filterFn: this.filter,
+ disabledNavigation: this.disabledNavigation,
}, (...rest: unknown[]) => {
const [nodes] = rest as [nodes: Node[]]
if (!Array.isArray(nodes) || nodes.length === 0) {
@@ -120,6 +125,7 @@ export class FilePickerBuilder {
private filter?: IFilePickerFilter
private buttons: IFilePickerButton[] | IFilePickerButtonFactory = []
private container?: string
+ private disabledNavigation = false
/**
* Construct a new FilePicker
@@ -273,6 +279,16 @@ export class FilePickerBuilder {
return this
}
+ /**
+ * Allow to pick directories besides files
+ *
+ * @param allow True to allow picking directories
+ */
+ public disableNavigation() {
+ this.disabledNavigation = true
+ return this
+ }
+
/**
* Construct the configured FilePicker
*/
@@ -285,6 +301,8 @@ export class FilePickerBuilder {
this.buttons,
this.path,
this.filter,
+ this.container,
+ this.disabledNavigation,
)
}
diff --git a/package-lock.json b/package-lock.json
index 101ee55d..e5dcd6e5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,6 +10,7 @@
"license": "GPL-3.0-or-later",
"dependencies": {
"@mdi/js": "^7.4.47",
+ "@nextcloud/auth": "^2.2.1",
"@nextcloud/axios": "^2.4.0",
"@nextcloud/event-bus": "^3.1.0",
"@nextcloud/files": "^3.1.0",
@@ -53,7 +54,7 @@
"npm": "^10.0.0"
},
"peerDependencies": {
- "@nextcloud/vue": "^8.2.0",
+ "@nextcloud/vue": "^8.9.1",
"vue": "^2.7.16"
}
},
@@ -3504,13 +3505,13 @@
}
},
"node_modules/@nextcloud/calendar-js": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/@nextcloud/calendar-js/-/calendar-js-6.0.1.tgz",
- "integrity": "sha512-iv6iPw20vp0CinVVrH4ptcuWPdAAx1AawMrYLqFg4vSEr0eVbwz6SW4P8GbxjzzRFJ0xqFXsmFeudiVAhvBaxA==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/@nextcloud/calendar-js/-/calendar-js-6.1.0.tgz",
+ "integrity": "sha512-thVS6Bz+TV7rUB+LO5yFbOhdm65zICDRKcHDUquaZiWL9r6TyV9hCYDcP7cDRV+62wZJh8QPmf1E+d7ZFUOVeA==",
"peer": true,
"engines": {
- "node": ">=16.0.0",
- "npm": ">=8.0.0"
+ "node": "^20.0.0",
+ "npm": "^9.0.0"
},
"peerDependencies": {
"ical.js": "^1.5.0",
@@ -3865,26 +3866,26 @@
}
},
"node_modules/@nextcloud/vue": {
- "version": "8.7.1",
- "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.7.1.tgz",
- "integrity": "sha512-vtfUz2OGqodga95Mzid6wNORQhXNnvl8de8+n3pGWNkuQzPojhUMxevnLT+fdxpJ/F9UWvG41C5cRKR7ChyYrQ==",
+ "version": "8.9.1",
+ "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.9.1.tgz",
+ "integrity": "sha512-Mj+CovsPqAwUsCxeQfhYc9thx7synLTi95htwHu1s0XEg6SlaOV3BRarxD0m4C236ZpaIQ4DDfezDtuBln/mIA==",
"peer": true,
"dependencies": {
"@floating-ui/dom": "^1.1.0",
"@linusborg/vue-simple-portal": "^0.1.5",
- "@nextcloud/auth": "^2.0.0",
- "@nextcloud/axios": "^2.0.0",
+ "@nextcloud/auth": "^2.2.1",
+ "@nextcloud/axios": "^2.4.0",
"@nextcloud/browser-storage": "^0.3.0",
- "@nextcloud/calendar-js": "^6.0.0",
- "@nextcloud/capabilities": "^1.0.4",
- "@nextcloud/event-bus": "^3.0.0",
- "@nextcloud/initial-state": "^2.0.0",
- "@nextcloud/l10n": "^2.0.1",
- "@nextcloud/logger": "^2.2.1",
+ "@nextcloud/calendar-js": "^6.1.0",
+ "@nextcloud/capabilities": "^1.1.0",
+ "@nextcloud/event-bus": "^3.1.0",
+ "@nextcloud/initial-state": "^2.1.0",
+ "@nextcloud/l10n": "^2.2.0",
+ "@nextcloud/logger": "^2.7.0",
"@nextcloud/router": "^3.0.0",
"@nextcloud/vue-select": "^3.25.0",
- "@vueuse/components": "^10.0.2",
- "@vueuse/core": "^10.1.2",
+ "@vueuse/components": "^10.9.0",
+ "@vueuse/core": "^10.9.0",
"clone": "^2.1.2",
"debounce": "2.0.0",
"dompurify": "^3.0.5",
@@ -3907,7 +3908,7 @@
"unified": "^11.0.1",
"unist-builder": "^4.0.0",
"unist-util-visit": "^5.0.0",
- "vue": "^2.7.14",
+ "vue": "^2.7.16",
"vue-color": "^2.8.1",
"vue-frag": "^1.4.3",
"vue2-datepicker": "^3.11.0"
@@ -4667,12 +4668,6 @@
"integrity": "sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==",
"peer": true
},
- "node_modules/@types/web-bluetooth": {
- "version": "0.0.17",
- "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.17.tgz",
- "integrity": "sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==",
- "peer": true
- },
"node_modules/@types/yargs": {
"version": "17.0.24",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz",
@@ -5323,44 +5318,20 @@
"dev": true
},
"node_modules/@vueuse/components": {
- "version": "10.3.0",
- "resolved": "https://registry.npmjs.org/@vueuse/components/-/components-10.3.0.tgz",
- "integrity": "sha512-EeZz3kjmJI7bH7JSxxMlLyk21LGl6GQjXfpl2n/GiI9QSJi+BVzIra5kEty5eM8McwAanx3e/HnK4drYTgFOWw==",
- "peer": true,
- "dependencies": {
- "@vueuse/core": "10.3.0",
- "@vueuse/shared": "10.3.0",
- "vue-demi": ">=0.14.5"
- }
- },
- "node_modules/@vueuse/components/node_modules/@vueuse/core": {
- "version": "10.3.0",
- "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.3.0.tgz",
- "integrity": "sha512-BEM5yxcFKb5btFjTSAFjTu5jmwoW66fyV9uJIP4wUXXU8aR5Hl44gndaaXp7dC5HSObmgbnR2RN+Un1p68Mf5Q==",
+ "version": "10.9.0",
+ "resolved": "https://registry.npmjs.org/@vueuse/components/-/components-10.9.0.tgz",
+ "integrity": "sha512-BHQpA0yIi3y7zKa1gYD0FUzLLkcRTqVhP8smnvsCK6GFpd94Nziq1XVPD7YpFeho0k5BzbBiNZF7V/DpkJ967A==",
"peer": true,
"dependencies": {
- "@types/web-bluetooth": "^0.0.17",
- "@vueuse/metadata": "10.3.0",
- "@vueuse/shared": "10.3.0",
- "vue-demi": ">=0.14.5"
- },
- "funding": {
- "url": "https://github.com/sponsors/antfu"
- }
- },
- "node_modules/@vueuse/components/node_modules/@vueuse/metadata": {
- "version": "10.3.0",
- "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.3.0.tgz",
- "integrity": "sha512-Ema3YhNOa4swDsV0V7CEY5JXvK19JI/o1szFO1iWxdFg3vhdFtCtSTP26PCvbUpnUtNHBY2wx5y3WDXND5Pvnw==",
- "peer": true,
- "funding": {
- "url": "https://github.com/sponsors/antfu"
+ "@vueuse/core": "10.9.0",
+ "@vueuse/shared": "10.9.0",
+ "vue-demi": ">=0.14.7"
}
},
"node_modules/@vueuse/components/node_modules/vue-demi": {
- "version": "0.14.5",
- "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.5.tgz",
- "integrity": "sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==",
+ "version": "0.14.7",
+ "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz",
+ "integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==",
"hasInstallScript": true,
"peer": true,
"bin": {
@@ -5402,17 +5373,6 @@
"resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz",
"integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow=="
},
- "node_modules/@vueuse/core/node_modules/@vueuse/shared": {
- "version": "10.9.0",
- "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.9.0.tgz",
- "integrity": "sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==",
- "dependencies": {
- "vue-demi": ">=0.14.7"
- },
- "funding": {
- "url": "https://github.com/sponsors/antfu"
- }
- },
"node_modules/@vueuse/core/node_modules/vue-demi": {
"version": "0.14.7",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz",
@@ -5447,23 +5407,21 @@
}
},
"node_modules/@vueuse/shared": {
- "version": "10.3.0",
- "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.3.0.tgz",
- "integrity": "sha512-kGqCTEuFPMK4+fNWy6dUOiYmxGcUbtznMwBZLC1PubidF4VZY05B+Oht7Jh7/6x4VOWGpvu3R37WHi81cKpiqg==",
- "peer": true,
+ "version": "10.9.0",
+ "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.9.0.tgz",
+ "integrity": "sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==",
"dependencies": {
- "vue-demi": ">=0.14.5"
+ "vue-demi": ">=0.14.7"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/@vueuse/shared/node_modules/vue-demi": {
- "version": "0.14.5",
- "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.5.tgz",
- "integrity": "sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==",
+ "version": "0.14.7",
+ "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz",
+ "integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==",
"hasInstallScript": true,
- "peer": true,
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
@@ -17897,9 +17855,13 @@
"dev": true
},
"node_modules/uuid": {
- "version": "9.0.0",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
- "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==",
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
+ "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
+ "funding": [
+ "https://github.com/sponsors/broofa",
+ "https://github.com/sponsors/ctavan"
+ ],
"peer": true,
"bin": {
"uuid": "dist/bin/uuid"
diff --git a/package.json b/package.json
index 1f828e3d..6f7d6e59 100644
--- a/package.json
+++ b/package.json
@@ -50,11 +50,12 @@
"dist"
],
"peerDependencies": {
- "@nextcloud/vue": "^8.2.0",
+ "@nextcloud/vue": "^8.9.1",
"vue": "^2.7.16"
},
"dependencies": {
"@mdi/js": "^7.4.47",
+ "@nextcloud/auth": "^2.2.1",
"@nextcloud/axios": "^2.4.0",
"@nextcloud/event-bus": "^3.1.0",
"@nextcloud/files": "^3.1.0",