flameresttable 1.0.62 → 1.0.64

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flameresttable",
3
- "version": "1.0.62",
3
+ "version": "1.0.64",
4
4
  "main": "./src/plugin.ts",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@
24
24
  <!--<div>-->
25
25
 
26
26
  <!-- ЧЕКБОКСЫ -->
27
- <div class="w-[21px] align-middle col-span-1" :style="'grid-column:' + 0">
27
+ <div class="w-[21px] align-middle col-span-1" :style="'grid-column:' + 1">
28
28
  <label class="checkbox" v-if="Table.opts.rowSelectors">
29
29
  <input type='checkbox' @change="CheckboxSelectionChanged($event, true)">
30
30
  <span class='indicator'></span>
@@ -32,7 +32,7 @@
32
32
  </div>
33
33
 
34
34
 
35
- <template v-for="(column, key, index) in Table.columns">
35
+ <template v-for="(column, index) in columnsArray">
36
36
  <div v-if="column.Table.isShow" :key="'cheader_' + column.name"
37
37
  :class="' defaultHeader ' + column.Table.classesHeader"
38
38
  class=" col-span-1 align-middle border-r border-r-slate-100 px-2" :style="'grid-column:' + (index + 2)">
@@ -62,7 +62,8 @@
62
62
 
63
63
  <!-- ЧЕКБОКСЫ -->
64
64
  <!-- class="defaultRow cursor-pointer hover:bg-slate-100" -->
65
- <div class="col-span-1 align-middle w-[21px]" :key="'chkbox_row_' + (row as any).id">
65
+ <div class="col-span-1 align-middle w-[21px]" :key="'chkbox_row_' + (row as any).id"
66
+ :style="'grid-column:' + 1">
66
67
  <label class="checkbox" v-if="Table.opts.rowSelectors">
67
68
  <input type='checkbox' v-model="Table.RowsParams[(row as any)[primaryKey]].selected"
68
69
  @change="CheckboxSelectionChanged($event, false)">
@@ -70,12 +71,12 @@
70
71
  </label>
71
72
  </div>
72
73
 
73
- <template v-for=" column in Table.columns ">
74
+ <template v-for=" (column, index) in columnsArray ">
74
75
  <div v-if="column.Table.isShow" :key="'tc_' + column.name + '_row_' + (row as any).id"
75
76
  :class="' defaultCell ' + column.Table.classes"
76
77
  class=" col-span-1 align-middle border-r border-r-slate-100 px-2 last:border-r-0 last:pr-0"
77
78
  @click="columnClick(row, column)"
78
- :style="(column.Table.width === null ? '' : 'width:' + column.Table.width + 'px')">
79
+ :style="'grid-column:' + (index + 2) + ';' + (column.Table.width === null ? '' : 'width:' + column.Table.width + 'px;')">
79
80
 
80
81
  <span v-if="!column.Table.isRawValue">{{
81
82
  column.Table.value(row, column) }}</span>
@@ -83,7 +84,7 @@
83
84
  </div>
84
85
  </template>
85
86
  <div v-if="opts.Edit.can" class=" col-span-1 border-r border-r-slate-100 px-2 text-center"
86
- :key="'edit_' + 'row_' + (row as any).id">
87
+ :style="'grid-column:' + (columnCount() - 1)" :key="'edit_' + 'row_' + (row as any).id">
87
88
  <button class="mobile:hidden px-2 py-1 bg-green-600 text-white my-1" @click="edit(row)">
88
89
  Изменить
89
90
  </button>
@@ -92,7 +93,7 @@
92
93
  </button>
93
94
  </div>
94
95
  <div v-if="opts.Remove.can" class=" col-span-1 border-r border-r-slate-100 px-2 text-center"
95
- :key="'delete_' + 'row_' + (row as any).id">
96
+ :key="'delete_' + 'row_' + (row as any).id" :style="'grid-column:' + (columnCount())">
96
97
  <button class="mobile:hidden px-2 py-1 bg-gray-600 opacity-30 text-white my-1" @click="deleteRow(row)">
97
98
  Удалить
98
99
  </button>
@@ -404,6 +405,15 @@ export default defineComponent({
404
405
  }
405
406
 
406
407
  },
408
+
409
+ computed: {
410
+
411
+ columnsArray: function () {
412
+ return Object.keys(this.Table.columns).filter(r => this.Table.columns[r].Table.isShow).map(key => this.Table.columns[key])
413
+ }
414
+
415
+ },
416
+
407
417
  methods: {
408
418
  fileGetData(thisArr: any, getSource: boolean = true) {
409
419
 
@@ -445,7 +455,9 @@ export default defineComponent({
445
455
  for (const key in this.Table.RowsParams) {
446
456
  this.Table.RowsParams[key].selected = event.target.checked
447
457
  }
448
- }
458
+ },
459
+
460
+
449
461
  },
450
462
 
451
463
  })