@hostlink/nuxt-light 0.0.67 → 0.0.69

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,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "0.0.67"
4
+ "version": "0.0.69"
5
5
  }
@@ -49,23 +49,27 @@ const props = defineProps({
49
49
  selection: {
50
50
  type: String,
51
51
  default: "none"
52
+ },
53
+ rowsPerPageOptions: {
54
+ type: Array,
55
+ default: () => [3, 5, 7, 10, 15, 20, 25, 50, 0]
56
+ }, pagination: {
57
+ type: Object,
58
+ default: () => {
59
+ return {
60
+ sortBy: "",
61
+ descending: true,
62
+ page: 1,
63
+ rowsPerPage: 10,
64
+ }
65
+ }
52
66
  }
53
67
  })
54
68
 
55
- const hideBottom = ref(false)
56
-
57
- const pagination = ref({
58
- sortBy: "",
59
- descending: true,
60
- page: 1,
61
- rowsPerPage: 10,
62
- })
63
-
69
+ const pagination = ref(props.pagination);
64
70
 
65
- if (props.rows == undefined) {
66
- console.log(props.rows);
67
- //server side
68
- //pagination.value.rowsNumber = 0;
71
+ if (props.rowsPerPageOptions[0] == 0) {
72
+ pagination.value.rowsPerPage = 0;
69
73
  }
70
74
 
71
75
  //apply all aligns to the columns
@@ -277,11 +281,12 @@ const onRequest = async (p: any) => {
277
281
  modelName.value = allData.meta.name;
278
282
 
279
283
 
280
- pagination.value.rowsPerPage = p.pagination.rowsPerPage;
284
+ //pagination.value.rowsPerPage = p.pagination.rowsPerPage;
281
285
  pagination.value.page = p.pagination.page;
282
286
  pagination.value.sortBy = p.pagination.sortBy;
283
287
  pagination.value.descending = p.pagination.descending;
284
288
  pagination.value.rowsNumber = allData.meta.total;
289
+
285
290
  loading.value = false;
286
291
  validateData()
287
292
 
@@ -324,9 +329,9 @@ const onFilters = () => {
324
329
  onRequest({
325
330
  pagination: {
326
331
  page: 1,
327
- rowsPerPage: pagination.value.rowsPerPage,
328
- sortBy: pagination.value.sortBy,
329
- descending: pagination.value.descending
332
+ rowsPerPage: props.pagination.rowsPerPage,
333
+ sortBy: props.pagination.sortBy,
334
+ descending: props.pagination.descending
330
335
  }
331
336
  })
332
337
  }
@@ -358,14 +363,6 @@ const onDelete = async (id: any) => {
358
363
 
359
364
  //style
360
365
 
361
- let rowsPerPageOptions = [3, 5, 7, 10, 15, 20, 25, 50, 0];
362
- if (props.pagination == false) {
363
- hideBottom.value = true;
364
- pagination.value = null;
365
- rowsPerPageOptions = [0]
366
- }
367
-
368
-
369
366
  const attrs = {
370
367
  ...{
371
368
  dense: light.getStyle("tableDense", false),
@@ -387,21 +384,21 @@ const attrs = {
387
384
 
388
385
  <template v-if="debug">
389
386
  <pre>primaryKey:{{ primaryKey }}
390
- modelName:{{ modelName }}
391
- filters:{{ filters }}
392
- pagination:{{ pagination }}
393
- actionView:{{ actionView }}
394
- actionDelete:{{ actionDelete }}
395
- activeEdit:{{ activeEdit }}
396
- attrs:{{ attrs }}
397
- $attrs:{{ $attrs }}
398
- </pre>
387
+ modelName:{{ modelName }}
388
+ filters:{{ filters }}
389
+ pagination:{{ pagination }}
390
+ actionView:{{ actionView }}
391
+ actionDelete:{{ actionDelete }}
392
+ activeEdit:{{ activeEdit }}
393
+ attrs:{{ attrs }}
394
+ $attrs:{{ $attrs }}
395
+ </pre>
399
396
  rows:{{ props.rows }}
400
397
  </template>
401
398
 
402
- <q-table v-bind="attrs" :row-key="rowKey" :loading="loading" :rows="rows" :hide-bottom="hideBottom" ref="table"
403
- @request="onRequest" :rows-per-page-label="$t(props.rowsPerPageLabel)" :columns="renderColumns"
404
- :rows-per-page-options="rowsPerPageOptions" :selection="selection" :pagination="pagination">
399
+ <q-table v-bind="attrs" :row-key="rowKey" :loading="loading" :rows="rows" ref="table" @request="onRequest"
400
+ :rows-per-page-label="$t(props.rowsPerPageLabel)" :columns="renderColumns"
401
+ :rows-per-page-options="rowsPerPageOptions" :selection="selection" v-model:pagination="pagination">
405
402
 
406
403
 
407
404
  <template v-for="s in ss" v-slot:[s]="props">
@@ -416,7 +413,8 @@ $attrs:{{ $attrs }}
416
413
  <l-view-btn v-if="actionView && props.row.canView"
417
414
  :to="`/${modelName}/${props.row[primaryKey]}/view`" />
418
415
 
419
- <l-edit-btn :to="`/${modelName}/${props.row[primaryKey]}/edit`" v-if="activeEdit && props.row.canUpdate" />
416
+ <l-edit-btn :to="`/${modelName}/${props.row[primaryKey]}/edit`"
417
+ v-if="activeEdit && props.row.canUpdate" />
420
418
 
421
419
  <l-delete-btn v-if="actionDelete && props.row.canDelete"
422
420
  @submit="onDelete(props.row[primaryKey])"></l-delete-btn>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.67",
3
+ "version": "0.0.69",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",