flameresttable 1.0.61 → 1.0.63
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 +1 -1
- package/src/Table/Table.vue +17 -15
package/package.json
CHANGED
package/src/Table/Table.vue
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<!--<div>-->
|
|
25
25
|
|
|
26
26
|
<!-- ЧЕКБОКСЫ -->
|
|
27
|
-
<div class="w-[21px] align-middle col-span-1">
|
|
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,22 +32,24 @@
|
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
<template v-for="column in Table.columns">
|
|
35
|
+
<template v-for="(column, key, index) in Table.columns">
|
|
36
36
|
<div v-if="column.Table.isShow" :key="'cheader_' + column.name"
|
|
37
37
|
:class="' defaultHeader ' + column.Table.classesHeader"
|
|
38
|
-
class=" col-span-1 align-middle border-r border-r-slate-100 px-2">
|
|
38
|
+
class=" col-span-1 align-middle border-r border-r-slate-100 px-2" :style="'grid-column:' + (index + 2)">
|
|
39
39
|
<span>{{ column.Table.titleCustom !== null ? (column as any).Table.titleCustom(column) : column.Table.title !==
|
|
40
40
|
'' ?
|
|
41
41
|
column.Table.title : column.title !== '' ? column.title :
|
|
42
42
|
column.name }}</span>
|
|
43
43
|
</div>
|
|
44
44
|
</template>
|
|
45
|
-
<div v-if="opts.Edit.can" class=" col-span-1 border-r border-r-slate-100 px-2"
|
|
46
|
-
|
|
45
|
+
<div v-if="opts.Edit.can" class=" col-span-1 border-r border-r-slate-100 px-2"
|
|
46
|
+
:style="'grid-column:' + (columnCount() - 1)">
|
|
47
|
+
<button class=" bg-green-600 invisible">
|
|
47
48
|
|
|
48
49
|
</button>
|
|
49
50
|
</div>
|
|
50
|
-
<div v-if="opts.Remove.can" class=" col-span-1 border-r border-r-slate-100 px-2"
|
|
51
|
+
<div v-if="opts.Remove.can" class=" col-span-1 border-r border-r-slate-100 px-2"
|
|
52
|
+
:style="'grid-column:' + (columnCount())">
|
|
51
53
|
<button class="bg-green-600 invisible">
|
|
52
54
|
|
|
53
55
|
</button>
|
|
@@ -55,12 +57,13 @@
|
|
|
55
57
|
<!--</div>-->
|
|
56
58
|
|
|
57
59
|
<!-- СТРОКИ-->
|
|
58
|
-
<template v-for="(row) in
|
|
60
|
+
<template v-for="( row ) in (Table.Rows.rows) ">
|
|
59
61
|
<template v-if="true">
|
|
60
62
|
|
|
61
63
|
<!-- ЧЕКБОКСЫ -->
|
|
62
64
|
<!-- class="defaultRow cursor-pointer hover:bg-slate-100" -->
|
|
63
|
-
<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">
|
|
64
67
|
<label class="checkbox" v-if="Table.opts.rowSelectors">
|
|
65
68
|
<input type='checkbox' v-model="Table.RowsParams[(row as any)[primaryKey]].selected"
|
|
66
69
|
@change="CheckboxSelectionChanged($event, false)">
|
|
@@ -68,12 +71,12 @@
|
|
|
68
71
|
</label>
|
|
69
72
|
</div>
|
|
70
73
|
|
|
71
|
-
<template v-for="column in
|
|
74
|
+
<template v-for=" (column, key, index) in Table.columns ">
|
|
72
75
|
<div v-if="column.Table.isShow" :key="'tc_' + column.name + '_row_' + (row as any).id"
|
|
73
76
|
:class="' defaultCell ' + column.Table.classes"
|
|
74
77
|
class=" col-span-1 align-middle border-r border-r-slate-100 px-2 last:border-r-0 last:pr-0"
|
|
75
78
|
@click="columnClick(row, column)"
|
|
76
|
-
: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;')">
|
|
77
80
|
|
|
78
81
|
<span v-if="!column.Table.isRawValue">{{
|
|
79
82
|
column.Table.value(row, column) }}</span>
|
|
@@ -81,7 +84,7 @@
|
|
|
81
84
|
</div>
|
|
82
85
|
</template>
|
|
83
86
|
<div v-if="opts.Edit.can" class=" col-span-1 border-r border-r-slate-100 px-2 text-center"
|
|
84
|
-
:key="'edit_' + 'row_' + (row as any).id">
|
|
87
|
+
:style="'grid-column:' + (columnCount() - 1)" :key="'edit_' + 'row_' + (row as any).id">
|
|
85
88
|
<button class="mobile:hidden px-2 py-1 bg-green-600 text-white my-1" @click="edit(row)">
|
|
86
89
|
Изменить
|
|
87
90
|
</button>
|
|
@@ -90,7 +93,7 @@
|
|
|
90
93
|
</button>
|
|
91
94
|
</div>
|
|
92
95
|
<div v-if="opts.Remove.can" class=" col-span-1 border-r border-r-slate-100 px-2 text-center"
|
|
93
|
-
:key="'delete_' + 'row_' + (row as any).id">
|
|
96
|
+
:key="'delete_' + 'row_' + (row as any).id" :style="'grid-column:' + (columnCount())">
|
|
94
97
|
<button class="mobile:hidden px-2 py-1 bg-gray-600 opacity-30 text-white my-1" @click="deleteRow(row)">
|
|
95
98
|
Удалить
|
|
96
99
|
</button>
|
|
@@ -123,7 +126,7 @@
|
|
|
123
126
|
<slot name="header" />
|
|
124
127
|
|
|
125
128
|
<!-- КОЛОНКИ ТАБЛИЦЫ-->
|
|
126
|
-
<label v-for="column
|
|
129
|
+
<label v-for=" column in ColumnNames " v-show="Table.columns[column].Popup.isShow" :key="'c' + column"
|
|
127
130
|
class="flex items-stretch justify-center w-full my-1 ml-2">
|
|
128
131
|
|
|
129
132
|
<!-- Заголовок -->
|
|
@@ -150,7 +153,7 @@
|
|
|
150
153
|
<div v-if="Table.columns[column].Popup.popupType === 'selector'"
|
|
151
154
|
class="flex-1 mr-5 w-full flex flex-col self-stretch"><select v-model="Table.columns[column].Popup.model"
|
|
152
155
|
class="h-full self-stretch py-1 px-2 w-full outline-none border border-slate-100">
|
|
153
|
-
<option v-for="(selectorVal, selectorKey) in
|
|
156
|
+
<option v-for="( selectorVal, selectorKey ) in Table.columns[column].Popup.Selector.values "
|
|
154
157
|
:key="'sel_' + selectorKey"
|
|
155
158
|
:value="getSelector(Table.columns[column].Popup.Selector.values, selectorKey, selectorVal)[1]">{{
|
|
156
159
|
getSelector(Table.columns[column].Popup.Selector.values, selectorKey, selectorVal)[0] }}</option>
|
|
@@ -455,7 +458,6 @@ export default defineComponent({
|
|
|
455
458
|
<style scoped lang="scss">
|
|
456
459
|
.grid-container {
|
|
457
460
|
display: grid;
|
|
458
|
-
grid-template-columns: repeat(var(--column-count), 1fr);
|
|
459
461
|
}
|
|
460
462
|
|
|
461
463
|
.no-wrap-cell {
|