flameresttable 1.0.96 → 1.0.97

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/README.md CHANGED
@@ -9,6 +9,14 @@
9
9
  opts.Popup.beforeEdit = async (row: any, table: typeof FlameTable.prototype): Promise<boolean> => {
10
10
  }
11
11
 
12
+ # Row slot
13
+ Слот для цельной строки таблицы
14
+ Передан параметр с данными строки `row`
15
+
16
+ # TableHeaders slot
17
+ Слот для строки заголовков
18
+ Передан параметр `columns`
19
+
12
20
  ### RowSubSlot
13
21
  Это слот для клика по строке таблицы, если включён параметр `opts.onRowClickOpenSlot`
14
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flameresttable",
3
- "version": "1.0.96",
3
+ "version": "1.0.97",
4
4
  "main": "./src/plugin.ts",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,82 +21,87 @@
21
21
  <div ref="MainTableElement" class="mt-2 table table-fixed w-full ">
22
22
 
23
23
  <!-- ЗАГОЛОВКИ СТОЛБЦОВ-->
24
- <div class="table-header-group">
25
-
26
- <!-- ЧЕКБОКСЫ -->
27
- <div class="table-cell w-[21px] align-middle">
28
- <label class="checkbox" v-if="Table.opts.rowSelectors">
29
- <input type='checkbox' @change="CheckboxSelectionChanged($event, true)">
30
- <span class='indicator'></span>
31
- </label>
32
- </div>
24
+ <slot name="TableHeaders" :columns="Table.columns">
25
+ <div class="table-header-group">
26
+
27
+ <!-- ЧЕКБОКСЫ -->
28
+ <div class="table-cell w-[21px] align-middle">
29
+ <label class="checkbox" v-if="Table.opts.rowSelectors">
30
+ <input type='checkbox' @change="CheckboxSelectionChanged($event, true)">
31
+ <span class='indicator'></span>
32
+ </label>
33
+ </div>
33
34
 
34
- <div v-for="column in Table.columns" v-show="column.Table.isShow" :key="'cheader_' + column.name"
35
- :class="' defaultHeader ' + column.Table.classesHeader"
36
- class=" table-cell align-middle border-r border-r-slate-100 px-2"
37
- :style="(column.Table.width === null ? '' : 'width:' + column.Table.width + 'px')">
38
- <span>{{ column.Table.titleCustom !== null ? (column as any).Table.titleCustom(column) : column.Table.title
39
- !==
40
- '' ?
41
- column.Table.title : column.title !== '' ? column.title :
42
- column.name }}</span>
43
- </div>
44
- <div v-if="opts.Edit.can" class="table-cell w-[93px] border-r border-r-slate-100 px-2">
45
- <button class="bg-green-600 invisible">
46
- Изменить
47
- </button>
48
- </div>
49
- <div v-if="opts.Remove.can" class="table-cell w-[93px] border-r border-r-slate-100 px-2">
50
- <button class="bg-green-600 invisible">
51
- Удалить
52
- </button>
35
+ <div v-for="column in Table.columns" v-show="column.Table.isShow" :key="'cheader_' + column.name"
36
+ :class="' defaultHeader ' + column.Table.classesHeader"
37
+ class=" table-cell align-middle border-r border-r-slate-100 px-2"
38
+ :style="(column.Table.width === null ? '' : 'width:' + column.Table.width + 'px')">
39
+ <span>{{ column.Table.titleCustom !== null ? (column as any).Table.titleCustom(column) : column.Table.title
40
+ !==
41
+ '' ?
42
+ column.Table.title : column.title !== '' ? column.title :
43
+ column.name }}</span>
44
+ </div>
45
+ <div v-if="opts.Edit.can" class="table-cell w-[93px] border-r border-r-slate-100 px-2">
46
+ <button class="bg-green-600 invisible">
47
+ Изменить
48
+ </button>
49
+ </div>
50
+ <div v-if="opts.Remove.can" class="table-cell w-[93px] border-r border-r-slate-100 px-2">
51
+ <button class="bg-green-600 invisible">
52
+ Удалить
53
+ </button>
54
+ </div>
53
55
  </div>
54
- </div>
55
-
56
+ </slot>
56
57
  <!-- СТРОКИ-->
58
+
57
59
  <div class="table-row-group text-left">
58
60
 
59
61
  <template v-for="(row) in (Table.Rows.rows)">
60
- <div :key="'row_' + (row as any).id" class="defaultRow table-row cursor-pointer hover:bg-slate-100"
61
- v-if="true">
62
-
63
- <!-- ЧЕКБОКСЫ -->
64
- <div class="table-cell align-middle w-[21px]">
65
- <label class="checkbox" v-if="Table.opts.rowSelectors">
66
- <input type='checkbox' v-model="Table.RowsParams[(row as any)[primaryKey]].selected"
67
- @change="CheckboxSelectionChanged($event, false)">
68
- <span class='indicator'></span>
69
- </label>
70
- </div>
71
-
72
- <div v-for="column in Table.columns" v-show="column.Table.isShow" :key="'tc_' + column.name"
73
- :class="' defaultCell ' + column.Table.classes"
74
- class="table-cell align-middle border-r border-r-slate-100 px-2 last:border-r-0 last:pr-0"
75
- @click="columnClick(row, column)"
76
- :style="(column.Table.width === null ? '' : 'width:' + column.Table.width + 'px')">
77
-
78
- <span v-if="!column.Table.isRawValue">{{
79
- column.Table.value(row, column) }}</span>
80
- <span v-else v-html="column.Table.value(row, column)"></span>
81
- </div>
82
- <div v-if="opts.Edit.can" class="table-cell w-[93px] border-r border-r-slate-100 px-2 text-center">
83
- <button class="px-2 py-1 bg-green-600 text-white my-1" @click="edit(row)">
84
- Изменить
85
- </button>
62
+ <slot name="Row" :row="row">
63
+ <div :key="'row_' + (row as any).id" class="defaultRow table-row cursor-pointer hover:bg-slate-100"
64
+ v-if="true">
65
+
66
+ <!-- ЧЕКБОКСЫ -->
67
+ <div class="table-cell align-middle w-[21px]">
68
+ <label class="checkbox" v-if="Table.opts.rowSelectors">
69
+ <input type='checkbox' v-model="Table.RowsParams[(row as any)[primaryKey]].selected"
70
+ @change="CheckboxSelectionChanged($event, false)">
71
+ <span class='indicator'></span>
72
+ </label>
73
+ </div>
74
+
75
+ <div v-for="column in Table.columns" v-show="column.Table.isShow" :key="'tc_' + column.name"
76
+ :class="' defaultCell ' + column.Table.classes"
77
+ class="table-cell align-middle border-r border-r-slate-100 px-2 last:border-r-0 last:pr-0"
78
+ @click="columnClick(row, column)"
79
+ :style="(column.Table.width === null ? '' : 'width:' + column.Table.width + 'px')">
80
+
81
+ <span v-if="!column.Table.isRawValue">{{
82
+ column.Table.value(row, column) }}</span>
83
+ <span v-else v-html="column.Table.value(row, column)"></span>
84
+ </div>
85
+ <div v-if="opts.Edit.can" class="table-cell w-[93px] border-r border-r-slate-100 px-2 text-center">
86
+ <button class="px-2 py-1 bg-green-600 text-white my-1" @click="edit(row)">
87
+ Изменить
88
+ </button>
89
+ </div>
90
+ <div v-if="opts.Remove.can" class="table-cell w-[93px] border-r border-r-slate-100 px-2 text-center">
91
+ <button class="px-2 py-1 bg-gray-600 opacity-30 text-white my-1" @click="deleteRow(row)">
92
+ Удалить
93
+ </button>
94
+ </div>
86
95
  </div>
87
- <div v-if="opts.Remove.can" class="table-cell w-[93px] border-r border-r-slate-100 px-2 text-center">
88
- <button class="px-2 py-1 bg-gray-600 opacity-30 text-white my-1" @click="deleteRow(row)">
89
- Удалить
90
- </button>
96
+ <div class="table-cell text-center relative" :key="'row_slot_' + (row as any).id"
97
+ v-if="opts.onRowClickOpenSlot && !isRowCollapsed(row)">
98
+ <div class=" mx-auto no-wrap-cell mobile:w-full text-center">
99
+ <slot name="RowSubSlot" :row="row" />
100
+ </div>
91
101
  </div>
92
- </div>
93
- <div class="table-cell text-center relative" :key="'row_slot_' + (row as any).id"
94
- v-if="opts.onRowClickOpenSlot && !isRowCollapsed(row)">
95
- <div class=" mx-auto no-wrap-cell mobile:w-full text-center">
96
- <slot name="RowSubSlot" :row="row" />
97
- </div>
98
- </div>
102
+ </slot>
99
103
  </template>
104
+
100
105
  </div>
101
106
 
102
107
  </div>
@@ -120,7 +125,7 @@
120
125
  <!-- Заголовок -->
121
126
  <div class="text-left px-2 py-1 bg-slate-100" style="width: 110px">
122
127
  <div>{{ Table.columns[column].Popup.title !== '' ? Table.columns[column].Popup.title === '' :
123
- Table.columns[column].title !== '' ? Table.columns[column].title : Table.columns[column].name }}</div>
128
+ Table.columns[column].title !== '' ? Table.columns[column].title : Table.columns[column].name }}</div>
124
129
  <div class="text-xs text-slate-400">{{ Table.columns[column].Popup.desc }}</div>
125
130
  </div>
126
131
 
@@ -144,7 +149,7 @@
144
149
  <option v-for="(selectorVal, selectorKey) in Table.columns[column].Popup.Selector.values"
145
150
  :key="'sel_' + selectorKey"
146
151
  :value="getSelector(Table.columns[column].Popup.Selector.values, selectorKey, selectorVal)[1]">{{
147
- getSelector(Table.columns[column].Popup.Selector.values, selectorKey, selectorVal)[0] }}</option>
152
+ getSelector(Table.columns[column].Popup.Selector.values, selectorKey, selectorVal)[0] }}</option>
148
153
  </select>
149
154
  </div>
150
155