nuxt-users 1.31.2 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,30 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## v1.32.0
5
+
6
+ [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.31.2...v1.32.0)
7
+
8
+ ### 🚀 Enhancements
9
+
10
+ - Extends NUsersList component with function filters ([be9a730](https://github.com/rrd108/nuxt-users/commit/be9a730))
11
+
12
+ ### 🩹 Fixes
13
+
14
+ - Usercard shows action buttons by default ([d824b1e](https://github.com/rrd108/nuxt-users/commit/d824b1e))
15
+
16
+ ### 💅 Refactors
17
+
18
+ - Remove unused code ([cbff5a0](https://github.com/rrd108/nuxt-users/commit/cbff5a0))
19
+
20
+ ### 🏡 Chore
21
+
22
+ - **release:** V1.31.2 ([8136322](https://github.com/rrd108/nuxt-users/commit/8136322))
23
+
24
+ ### ❤️ Contributors
25
+
26
+ - Rrd108 ([@rrd108](https://github.com/rrd108))
27
+
4
28
  ## v1.31.2
5
29
 
6
30
  [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.31.1...v1.31.2)
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
3
  "configKey": "nuxtUsers",
4
- "version": "1.31.2",
4
+ "version": "1.32.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.0"
@@ -5,7 +5,7 @@ import { defaultDisplayFields, defaultFieldLabels } from "nuxt-users/utils";
5
5
  const props = defineProps({
6
6
  displayFields: { type: Array, required: false, default: () => defaultDisplayFields },
7
7
  fieldLabels: { type: Object, required: false, default: () => defaultFieldLabels },
8
- filter: { type: Object, required: false, default: () => ({}) }
8
+ filter: { type: [Object, Function], required: false, default: () => ({}) }
9
9
  });
10
10
  const emit = defineEmits(["editClick", "delete"]);
11
11
  const usersComposable = ref(null);
@@ -14,7 +14,13 @@ const pagination = computed(() => usersComposable.value?.pagination ?? null);
14
14
  const loading = computed(() => usersComposable.value?.loading ?? false);
15
15
  const error = computed(() => usersComposable.value?.error ?? null);
16
16
  const users = computed(() => {
17
- if (!props.filter || Object.keys(props.filter).length === 0) {
17
+ if (!props.filter) {
18
+ return allUsers.value;
19
+ }
20
+ if (typeof props.filter === "function") {
21
+ return allUsers.value.filter(props.filter);
22
+ }
23
+ if (Object.keys(props.filter).length === 0) {
18
24
  return allUsers.value;
19
25
  }
20
26
  return allUsers.value.filter((user) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
- "version": "1.31.2",
3
+ "version": "1.32.0",
4
4
  "description": "A comprehensive user management module for Nuxt 3 and Nuxt 4 applications with authentication, authorization, database support, and CLI tools",
5
5
  "keywords": [
6
6
  "nuxt",