grantthomas-nuxt 1.0.21 → 1.0.23

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grantthomas/nuxt",
3
3
  "configKey": "grantThomasNuxt",
4
- "version": "1.0.21",
4
+ "version": "1.0.23",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -4,8 +4,8 @@ type __VLS_WithSlots<T, S> = T & (new () => {
4
4
  $slots: S;
5
5
  });
6
6
  declare const __VLS_component: import("vue").DefineComponent<{}, {
7
- debounced: boolean;
8
7
  path: string;
8
+ debounced: boolean;
9
9
  await: boolean;
10
10
  listeners: unknown[];
11
11
  customFilters?: Record<string, any> | undefined;
@@ -4,8 +4,8 @@ type __VLS_WithSlots<T, S> = T & (new () => {
4
4
  $slots: S;
5
5
  });
6
6
  declare const __VLS_component: import("vue").DefineComponent<{}, {
7
- debounced: boolean;
8
7
  path: string;
8
+ debounced: boolean;
9
9
  await: boolean;
10
10
  listeners: unknown[];
11
11
  customFilters?: Record<string, any> | undefined;
@@ -4,10 +4,10 @@ type __VLS_WithSlots<T, S> = T & (new () => {
4
4
  $slots: S;
5
5
  });
6
6
  declare const __VLS_component: import("vue").DefineComponent<{}, {
7
+ path: string;
7
8
  page: number;
8
9
  debounced: boolean;
9
10
  disableNoResults: boolean;
10
- path: string;
11
11
  perPage: number;
12
12
  await: boolean;
13
13
  listeners: unknown[];
@@ -4,10 +4,10 @@ type __VLS_WithSlots<T, S> = T & (new () => {
4
4
  $slots: S;
5
5
  });
6
6
  declare const __VLS_component: import("vue").DefineComponent<{}, {
7
+ path: string;
7
8
  page: number;
8
9
  debounced: boolean;
9
10
  disableNoResults: boolean;
10
- path: string;
11
11
  perPage: number;
12
12
  await: boolean;
13
13
  listeners: unknown[];
@@ -15,6 +15,8 @@ declare const __VLS_component: import("vue").DefineComponent<{}, {
15
15
  deleteTitle: string;
16
16
  allowCreate: boolean;
17
17
  hideFilters: boolean;
18
+ hideActionsOnSave: boolean;
19
+ closeOnSave: boolean;
18
20
  fullScreenDialog: boolean;
19
21
  contentClasses: string;
20
22
  showPerPageSelector: boolean;
@@ -42,6 +44,10 @@ type __VLS_Slots = {
42
44
  exportAction: any;
43
45
  exportPending: any;
44
46
  exportErrors: any;
47
+ totalItems: any;
48
+ currentPage: any;
49
+ totalPages: any;
50
+ closeAction: any;
45
51
  }) => any) | undefined;
46
52
  } & {
47
53
  filters?: ((props: {
@@ -62,12 +68,20 @@ type __VLS_Slots = {
62
68
  updateAction: any;
63
69
  deleteAction: any;
64
70
  formPending: any;
71
+ totalItems: any;
72
+ currentPage: any;
73
+ totalPages: any;
74
+ closeAction: any;
65
75
  }) => any) | undefined;
66
76
  } & {
67
77
  form?: ((props: {
68
78
  action: any;
69
79
  item: any;
80
+ closeAction: any;
70
81
  originalItem: any;
71
82
  errors: any;
83
+ totalItems: any;
84
+ currentPage: any;
85
+ totalPages: any;
72
86
  }) => any) | undefined;
73
87
  };
@@ -11,7 +11,18 @@ import CrudFormDialog from "./CrudFormDialog.vue";
11
11
  import CrudErrorDisplay from "./CrudErrorDisplay.vue";
12
12
  const { parseQuery, stringifyQuery, cloneDeep } = useCrudConverters();
13
13
  const props = defineProps({
14
+ hideActionsOnSave: {
15
+ type: Boolean,
16
+ required: false,
17
+ default: false
18
+ },
19
+ closeOnSave: {
20
+ type: Boolean,
21
+ required: false,
22
+ default: true
23
+ },
14
24
  fullScreenDialog: {
25
+ type: Boolean,
15
26
  type: Boolean,
16
27
  required: false,
17
28
  default: false
@@ -165,6 +176,7 @@ perPage.value = props.perPage;
165
176
  const route = useRoute();
166
177
  const router = useRouter();
167
178
  const previousRoute = usePreviousRoute();
179
+ const hideActions = ref(false);
168
180
  const action = computed(() => route.query[(props.loaderKey ?? "") + "action"]);
169
181
  const actionId = computed(() => route.query[(props.loaderKey ?? "") + "actionId"]);
170
182
  const dialogOpen = computed({
@@ -308,7 +320,12 @@ const saveAction = async () => {
308
320
  const savedPath = props.path;
309
321
  const savedAction = action.value;
310
322
  const savedItem = item.value;
311
- dialogOpen.value = false;
323
+ if (props.closeOnSave) {
324
+ dialogOpen.value = false;
325
+ }
326
+ if (props.hideActionsOnSave) {
327
+ hideActions.value = true;
328
+ }
312
329
  await getItems(Number.parseInt(page.value) ?? null, null, filterValues.value);
313
330
  notify(savedPath + ":" + savedAction, savedItem);
314
331
  }
@@ -350,6 +367,9 @@ const exportAction = async () => {
350
367
  window.open(exportUrl.value, "_blank");
351
368
  }
352
369
  };
370
+ const closeAction = () => {
371
+ dialogOpen.value = false;
372
+ };
353
373
  </script>
354
374
 
355
375
  <template>
@@ -365,6 +385,10 @@ const exportAction = async () => {
365
385
  :export-action="exportAction"
366
386
  :export-pending="exportPending"
367
387
  :export-errors="exportErrors"
388
+ :total-items="totalItems"
389
+ :current-page="currentPage"
390
+ :total-pages="totalPages"
391
+ :close-action="closeAction"
368
392
  >
369
393
  </slot>
370
394
  <div :class="contentClasses">
@@ -394,6 +418,10 @@ const exportAction = async () => {
394
418
  :update-action="updateForm"
395
419
  :delete-action="deleteForm"
396
420
  :form-pending="formPending"
421
+ :total-items="totalItems"
422
+ :current-page="currentPage"
423
+ :total-pages="totalPages"
424
+ :close-action="closeAction"
397
425
  >
398
426
  </slot>
399
427
  </div>
@@ -426,6 +454,7 @@ const exportAction = async () => {
426
454
  <crud-form-dialog
427
455
  v-model:dialog="dialogOpen"
428
456
  v-model="item"
457
+ :hide-actions="hideActions"
429
458
  :original-item="originalItem"
430
459
  :action="action"
431
460
  :form-errors="formErrors"
@@ -439,11 +468,16 @@ const exportAction = async () => {
439
468
  :full-screen="fullScreenDialog"
440
469
  >
441
470
  <slot
442
- name="form" :action="action"
471
+ name="form"
472
+ :action="action"
443
473
  :item="item"
474
+ :close-action="closeAction"
444
475
  :original-item="originalItem"
445
- :errors="formErrors">
446
-
476
+ :errors="formErrors"
477
+ :total-items="totalItems"
478
+ :current-page="currentPage"
479
+ :total-pages="totalPages"
480
+ >
447
481
  </slot>
448
482
  </crud-form-dialog>
449
483
 
@@ -15,6 +15,8 @@ declare const __VLS_component: import("vue").DefineComponent<{}, {
15
15
  deleteTitle: string;
16
16
  allowCreate: boolean;
17
17
  hideFilters: boolean;
18
+ hideActionsOnSave: boolean;
19
+ closeOnSave: boolean;
18
20
  fullScreenDialog: boolean;
19
21
  contentClasses: string;
20
22
  showPerPageSelector: boolean;
@@ -42,6 +44,10 @@ type __VLS_Slots = {
42
44
  exportAction: any;
43
45
  exportPending: any;
44
46
  exportErrors: any;
47
+ totalItems: any;
48
+ currentPage: any;
49
+ totalPages: any;
50
+ closeAction: any;
45
51
  }) => any) | undefined;
46
52
  } & {
47
53
  filters?: ((props: {
@@ -62,12 +68,20 @@ type __VLS_Slots = {
62
68
  updateAction: any;
63
69
  deleteAction: any;
64
70
  formPending: any;
71
+ totalItems: any;
72
+ currentPage: any;
73
+ totalPages: any;
74
+ closeAction: any;
65
75
  }) => any) | undefined;
66
76
  } & {
67
77
  form?: ((props: {
68
78
  action: any;
69
79
  item: any;
80
+ closeAction: any;
70
81
  originalItem: any;
71
82
  errors: any;
83
+ totalItems: any;
84
+ currentPage: any;
85
+ totalPages: any;
72
86
  }) => any) | undefined;
73
87
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grantthomas-nuxt",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Crud module for Nuxt 3 interacting with sibling .net project",
5
5
  "repository": "Tap-Leagues/GrantThomas.Nuxt",
6
6
  "license": "MIT",