atom-nuxt 1.0.152 → 1.0.154
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/dist/module.json
CHANGED
|
@@ -77,6 +77,11 @@ const props = defineProps({
|
|
|
77
77
|
required: false,
|
|
78
78
|
default: false
|
|
79
79
|
},
|
|
80
|
+
hideActions: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
required: false,
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
80
85
|
originalItem: {
|
|
81
86
|
type: Object,
|
|
82
87
|
required: false,
|
|
@@ -154,7 +159,7 @@ const isLarge = computed(() => display.lgAndUp.value);
|
|
|
154
159
|
</suspense>
|
|
155
160
|
</div>
|
|
156
161
|
</div>
|
|
157
|
-
<v-card-actions class="pa-0 border-t pa-4 elevation-5">
|
|
162
|
+
<v-card-actions v-if="!hideActions" class="pa-0 border-t pa-4 elevation-5">
|
|
158
163
|
<v-btn
|
|
159
164
|
size="large"
|
|
160
165
|
class="px-5"
|
|
@@ -187,9 +187,9 @@ const page = computed(() => props.loaderKey ? parseQuery(route.query[props.loade
|
|
|
187
187
|
const filterValues = props.loaderKey ? ref({ ...props.customFilters, ...parseQuery(route.query[props.loaderKey]) }) : ref({ ...props.customFilters, ...route.query });
|
|
188
188
|
const onQueryChange = (page2) => {
|
|
189
189
|
console.error("QUERY CHANGED");
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
for (
|
|
190
|
+
const newQuery = {};
|
|
191
|
+
const existingQuery = parseQuery(route.query);
|
|
192
|
+
for (const key in filterValues.value) {
|
|
193
193
|
if (filterValues.value[key] !== null && filterValues.value[key] !== "") {
|
|
194
194
|
newQuery[key] = filterValues.value[key];
|
|
195
195
|
}
|
|
@@ -203,6 +203,13 @@ const onQueryChange = (page2) => {
|
|
|
203
203
|
} else {
|
|
204
204
|
finalQuery = newQuery;
|
|
205
205
|
}
|
|
206
|
+
if (props.loaderKey) {
|
|
207
|
+
delete finalQuery[`${props.loaderKey}action`];
|
|
208
|
+
delete finalQuery[`${props.loaderKey}actionId`];
|
|
209
|
+
} else {
|
|
210
|
+
delete finalQuery.action;
|
|
211
|
+
delete finalQuery.actionId;
|
|
212
|
+
}
|
|
206
213
|
console.error("Setting query", finalQuery);
|
|
207
214
|
router.replace({ path: route.path, query: finalQuery, force: true });
|
|
208
215
|
};
|
|
@@ -223,10 +230,10 @@ watch(() => filterValues, () => {
|
|
|
223
230
|
}, { deep: true });
|
|
224
231
|
const debouncedGet = useDebounceFn(() => {
|
|
225
232
|
console.error("DEBOUNCED GET");
|
|
226
|
-
getItems(parseInt(page.value) ?? null, null, filterValues.value);
|
|
233
|
+
getItems(Number.parseInt(page.value) ?? null, null, filterValues.value);
|
|
227
234
|
}, 200);
|
|
228
235
|
const updateForm = async (id) => {
|
|
229
|
-
|
|
236
|
+
const newQuery = { query: { ...route.query } };
|
|
230
237
|
if (props.loaderKey) {
|
|
231
238
|
newQuery.query[(props.loaderKey ?? "") + "action"] = "update";
|
|
232
239
|
newQuery.query[(props.loaderKey ?? "") + "actionId"] = id;
|
|
@@ -237,7 +244,7 @@ const updateForm = async (id) => {
|
|
|
237
244
|
await router.push(newQuery);
|
|
238
245
|
};
|
|
239
246
|
const deleteForm = async (id) => {
|
|
240
|
-
|
|
247
|
+
const newQuery = { query: { ...route.query } };
|
|
241
248
|
if (props.loaderKey) {
|
|
242
249
|
newQuery.query[(props.loaderKey ?? "") + "action"] = "delete";
|
|
243
250
|
newQuery.query[(props.loaderKey ?? "") + "actionId"] = id;
|
|
@@ -249,7 +256,7 @@ const deleteForm = async (id) => {
|
|
|
249
256
|
};
|
|
250
257
|
const createForm = () => {
|
|
251
258
|
item.value = props.initialItem ? cloneDeep(props.initialItem) : {};
|
|
252
|
-
|
|
259
|
+
const newQuery = { query: { ...route.query } };
|
|
253
260
|
if (props.loaderKey) {
|
|
254
261
|
newQuery.query[(props.loaderKey ?? "") + "action"] = "create";
|
|
255
262
|
} else {
|
|
@@ -284,7 +291,7 @@ const saveAction = async () => {
|
|
|
284
291
|
const savedAction = action.value;
|
|
285
292
|
const savedItem = item.value;
|
|
286
293
|
dialogOpen.value = false;
|
|
287
|
-
await getItems(parseInt(page.value) ?? null, null, filterValues.value);
|
|
294
|
+
await getItems(Number.parseInt(page.value) ?? null, null, filterValues.value);
|
|
288
295
|
notify(savedPath + ":" + savedAction, savedItem);
|
|
289
296
|
}
|
|
290
297
|
};
|
|
@@ -310,7 +317,7 @@ const { addListener, removeLocalListenersWithEvent, notify } = useListenerServic
|
|
|
310
317
|
onMounted(() => {
|
|
311
318
|
props.listeners.forEach((listener) => {
|
|
312
319
|
addListener(listener, (data) => {
|
|
313
|
-
getItems(parseInt(page.value) ?? null, null, filterValues.value);
|
|
320
|
+
getItems(Number.parseInt(page.value) ?? null, null, filterValues.value);
|
|
314
321
|
});
|
|
315
322
|
});
|
|
316
323
|
});
|
|
@@ -333,13 +340,13 @@ const exportAction = async () => {
|
|
|
333
340
|
name="before"
|
|
334
341
|
:items="items"
|
|
335
342
|
:pending="listPending"
|
|
336
|
-
:
|
|
337
|
-
:
|
|
338
|
-
:
|
|
339
|
-
:
|
|
340
|
-
:
|
|
341
|
-
:
|
|
342
|
-
:
|
|
343
|
+
:create-action="createForm"
|
|
344
|
+
:update-action="updateForm"
|
|
345
|
+
:delete-action="deleteForm"
|
|
346
|
+
:form-pending="formPending"
|
|
347
|
+
:export-action="exportAction"
|
|
348
|
+
:export-pending="exportPending"
|
|
349
|
+
:export-errors="exportErrors"
|
|
343
350
|
>
|
|
344
351
|
</slot>
|
|
345
352
|
<div :class="contentClasses">
|
|
@@ -348,13 +355,13 @@ const exportAction = async () => {
|
|
|
348
355
|
<v-col v-if="!hideFilters && filters.length > 0" cols="12" md="3">
|
|
349
356
|
<div>
|
|
350
357
|
<slot name="filters" :filters="filters">
|
|
351
|
-
<crud-filter-list
|
|
358
|
+
<crud-filter-list v-model="filterValues" :filters="filters"></crud-filter-list>
|
|
352
359
|
</slot>
|
|
353
360
|
</div>
|
|
354
361
|
</v-col>
|
|
355
|
-
<v-col cols="12" :md="hideFilters || filters.length
|
|
362
|
+
<v-col cols="12" :md="hideFilters || filters.length === 0 ? '12' : '9'">
|
|
356
363
|
<div class="">
|
|
357
|
-
<slot v-if="!listPending && totalItems === 0 && !hasListErrors" name="empty" :
|
|
364
|
+
<slot v-if="!listPending && totalItems === 0 && !hasListErrors" name="empty" :create-action="createForm">
|
|
358
365
|
<v-alert icon="mdi-playlist-remove" type="info" class="pa-5">
|
|
359
366
|
{{ noResultsText }}
|
|
360
367
|
</v-alert>
|
|
@@ -362,20 +369,21 @@ const exportAction = async () => {
|
|
|
362
369
|
<slot v-if="hasListErrors" name="error" :errors="listErrors">
|
|
363
370
|
<crud-error-display :errors="listErrors"></crud-error-display>
|
|
364
371
|
</slot>
|
|
365
|
-
<slot
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
372
|
+
<slot
|
|
373
|
+
v-if="totalItems > 0"
|
|
374
|
+
:items="items"
|
|
375
|
+
:pending="listPending"
|
|
376
|
+
:update-action="updateForm"
|
|
377
|
+
:delete-action="deleteForm"
|
|
378
|
+
:form-pending="formPending"
|
|
371
379
|
>
|
|
372
380
|
</slot>
|
|
373
381
|
</div>
|
|
374
382
|
<div v-if="totalItems > 0 && totalPages > 1" class="pa-3">
|
|
375
383
|
<span class="d-none d-md-block pa-3">Page {{ currentPage }} of {{ totalPages }} pages with {{ totalItems }} items</span>
|
|
376
384
|
<v-pagination
|
|
377
|
-
:disabled="listPending"
|
|
378
385
|
v-model="currentPage"
|
|
386
|
+
:disabled="listPending"
|
|
379
387
|
:length="totalPages"
|
|
380
388
|
@input="getItems()"></v-pagination>
|
|
381
389
|
</div>
|
|
@@ -388,20 +396,21 @@ const exportAction = async () => {
|
|
|
388
396
|
v-model="item"
|
|
389
397
|
:original-item="originalItem"
|
|
390
398
|
:action="action"
|
|
391
|
-
:
|
|
392
|
-
:
|
|
393
|
-
:
|
|
394
|
-
:
|
|
395
|
-
:
|
|
396
|
-
:
|
|
397
|
-
:
|
|
399
|
+
:form-errors="formErrors"
|
|
400
|
+
:item-errors="itemErrors"
|
|
401
|
+
:form-pending="formPending"
|
|
402
|
+
:item-pending="itemPending"
|
|
403
|
+
:create-title="createTitle"
|
|
404
|
+
:update-title="updateTitle"
|
|
405
|
+
:delete-title="deleteTitle"
|
|
398
406
|
:save-action="saveAction"
|
|
399
407
|
:full-screen="fullScreenDialog"
|
|
400
408
|
>
|
|
401
|
-
<slot
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
409
|
+
<slot
|
|
410
|
+
name="form" :action="action"
|
|
411
|
+
:item="item"
|
|
412
|
+
:original-item="originalItem"
|
|
413
|
+
:errors="formErrors">
|
|
405
414
|
|
|
406
415
|
</slot>
|
|
407
416
|
</crud-form-dialog>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atom-nuxt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.154",
|
|
4
4
|
"description": "My new Nuxt module",
|
|
5
5
|
"repository": "atomengine/atom-nuxt",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@types/uuid": "^8.3.0",
|
|
50
50
|
"changelogen": "^0.6.1",
|
|
51
51
|
"eslint": "^9.29.0",
|
|
52
|
+
"eslint-config-prettier": "^8.8.0",
|
|
52
53
|
"sass": "^1.89.2",
|
|
53
54
|
"typescript": "^5.8.3",
|
|
54
55
|
"vue-tsc": "^2.2.10",
|