nuxt-users 1.31.0 → 1.31.2
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,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## v1.31.2
|
|
5
|
+
|
|
6
|
+
[compare changes](https://github.com/rrd108/nuxt-users/compare/v1.31.1...v1.31.2)
|
|
7
|
+
|
|
8
|
+
### 🩹 Fixes
|
|
9
|
+
|
|
10
|
+
- Usercard shows action buttons by default ([d824b1e](https://github.com/rrd108/nuxt-users/commit/d824b1e))
|
|
11
|
+
|
|
12
|
+
### 🏡 Chore
|
|
13
|
+
|
|
14
|
+
- **release:** V1.31.1 ([da02db7](https://github.com/rrd108/nuxt-users/commit/da02db7))
|
|
15
|
+
|
|
16
|
+
### ❤️ Contributors
|
|
17
|
+
|
|
18
|
+
- Rrd108 ([@rrd108](https://github.com/rrd108))
|
|
19
|
+
|
|
20
|
+
## v1.31.1
|
|
21
|
+
|
|
22
|
+
[compare changes](https://github.com/rrd108/nuxt-users/compare/v1.31.0...v1.31.1)
|
|
23
|
+
|
|
24
|
+
### 🩹 Fixes
|
|
25
|
+
|
|
26
|
+
- Includes scripts directory in the published package ([ceaa188](https://github.com/rrd108/nuxt-users/commit/ceaa188))
|
|
27
|
+
|
|
28
|
+
### 🏡 Chore
|
|
29
|
+
|
|
30
|
+
- **release:** V1.31.0 ([21907d3](https://github.com/rrd108/nuxt-users/commit/21907d3))
|
|
31
|
+
|
|
32
|
+
### ❤️ Contributors
|
|
33
|
+
|
|
34
|
+
- Rrd108 ([@rrd108](https://github.com/rrd108))
|
|
35
|
+
|
|
4
36
|
## v1.31.0
|
|
5
37
|
|
|
6
38
|
[compare changes](https://github.com/rrd108/nuxt-users/compare/v1.30.0...v1.31.0)
|
package/dist/module.json
CHANGED
|
@@ -92,55 +92,108 @@ const handleFetchUsers = (page, limit) => {
|
|
|
92
92
|
v-for="(user, index) in users"
|
|
93
93
|
:key="user.id"
|
|
94
94
|
>
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
:index="index"
|
|
99
|
-
:edit-user="() => $emit('editClick', user)"
|
|
100
|
-
:delete-user="() => handleDelete(user)"
|
|
101
|
-
>
|
|
102
|
-
<NUsersUserCard
|
|
95
|
+
<div class="n-users-user-wrapper">
|
|
96
|
+
<slot
|
|
97
|
+
name="user"
|
|
103
98
|
:user="user"
|
|
104
99
|
:index="index"
|
|
105
|
-
:
|
|
106
|
-
:
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
:edit-user="() => $emit('editClick', user)"
|
|
101
|
+
:delete-user="() => handleDelete(user)"
|
|
102
|
+
>
|
|
103
|
+
<NUsersUserCard
|
|
104
|
+
:user="user"
|
|
105
|
+
:index="index"
|
|
106
|
+
:display-fields="displayFields"
|
|
107
|
+
:field-labels="fieldLabels"
|
|
108
|
+
@edit-click="$emit('editClick', user)"
|
|
109
|
+
@delete="handleDelete(user)"
|
|
110
|
+
>
|
|
111
|
+
<template #editButton="{ canEdit, editUser: editUserFn, user: userData }">
|
|
112
|
+
<slot
|
|
113
|
+
name="editButton"
|
|
114
|
+
:can-edit="canEdit"
|
|
115
|
+
:edit-user="editUserFn"
|
|
116
|
+
:user="userData"
|
|
117
|
+
>
|
|
118
|
+
<button
|
|
119
|
+
v-if="canEdit"
|
|
120
|
+
class="n-users-edit-btn"
|
|
121
|
+
@click="editUserFn"
|
|
122
|
+
>
|
|
123
|
+
Edit
|
|
124
|
+
</button>
|
|
125
|
+
</slot>
|
|
126
|
+
</template>
|
|
127
|
+
<template #deleteButton="{ canDelete, deleteUser: deleteUserFn, user: userData }">
|
|
128
|
+
<slot
|
|
129
|
+
name="deleteButton"
|
|
130
|
+
:can-delete="canDelete"
|
|
131
|
+
:delete-user="deleteUserFn"
|
|
132
|
+
:user="userData"
|
|
133
|
+
>
|
|
134
|
+
<button
|
|
135
|
+
v-if="canDelete"
|
|
136
|
+
class="n-users-delete-btn"
|
|
137
|
+
@click="deleteUserFn"
|
|
138
|
+
>
|
|
139
|
+
Delete
|
|
140
|
+
</button>
|
|
141
|
+
</slot>
|
|
142
|
+
</template>
|
|
143
|
+
</NUsersUserCard>
|
|
144
|
+
</slot>
|
|
145
|
+
|
|
146
|
+
<!-- Always show action buttons when using custom user slot -->
|
|
147
|
+
<div
|
|
148
|
+
v-if="$slots.user"
|
|
149
|
+
class="n-users-user-card-actions"
|
|
109
150
|
>
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
151
|
+
<NUsersUserCard
|
|
152
|
+
:user="user"
|
|
153
|
+
:index="index"
|
|
154
|
+
:display-fields="[]"
|
|
155
|
+
:field-labels="{}"
|
|
156
|
+
@edit-click="$emit('editClick', user)"
|
|
157
|
+
@delete="handleDelete(user)"
|
|
158
|
+
>
|
|
159
|
+
<template #userCard>
|
|
160
|
+
<!-- Empty slot to hide the default card content -->
|
|
161
|
+
</template>
|
|
162
|
+
<template #editButton="{ canEdit, editUser: editUserFn, user: userData }">
|
|
163
|
+
<slot
|
|
164
|
+
name="editButton"
|
|
165
|
+
:can-edit="canEdit"
|
|
166
|
+
:edit-user="editUserFn"
|
|
167
|
+
:user="userData"
|
|
121
168
|
>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
169
|
+
<button
|
|
170
|
+
v-if="canEdit"
|
|
171
|
+
class="n-users-edit-btn"
|
|
172
|
+
@click="editUserFn"
|
|
173
|
+
>
|
|
174
|
+
Edit
|
|
175
|
+
</button>
|
|
176
|
+
</slot>
|
|
177
|
+
</template>
|
|
178
|
+
<template #deleteButton="{ canDelete, deleteUser: deleteUserFn, user: userData }">
|
|
179
|
+
<slot
|
|
180
|
+
name="deleteButton"
|
|
181
|
+
:can-delete="canDelete"
|
|
182
|
+
:delete-user="deleteUserFn"
|
|
183
|
+
:user="userData"
|
|
137
184
|
>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
185
|
+
<button
|
|
186
|
+
v-if="canDelete"
|
|
187
|
+
class="n-users-delete-btn"
|
|
188
|
+
@click="deleteUserFn"
|
|
189
|
+
>
|
|
190
|
+
Delete
|
|
191
|
+
</button>
|
|
192
|
+
</slot>
|
|
193
|
+
</template>
|
|
194
|
+
</NUsersUserCard>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
144
197
|
</li>
|
|
145
198
|
</TransitionGroup>
|
|
146
199
|
</slot>
|
|
@@ -22,7 +22,7 @@ const canEdit = computed(() => {
|
|
|
22
22
|
const userPermissions = nuxtUsers.auth.permissions[currentUser.value.role] || [];
|
|
23
23
|
const apiBasePath = nuxtUsers.apiBasePath;
|
|
24
24
|
return userPermissions.some(
|
|
25
|
-
(permission) => permission === "*" || permission === `${apiBasePath}/*` || permission === `${apiBasePath}/[id].
|
|
25
|
+
(permission) => permission === "*" || permission === `${apiBasePath}/*` || permission === `${apiBasePath}/[id].put` || permission === `${apiBasePath}/[id].patch`
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
return false;
|
package/package.json
CHANGED