quasar-factory-lib 0.0.38 → 0.0.39
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/layouts/PdaLayout.vue.d.ts +1184 -0
- package/dist/quasar-factory-lib.js +454 -440
- package/dist/quasar-factory-lib.umd.cjs +11 -11
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Table/Table.vue +4 -0
- package/src/components/Table/components/TableSlotBody.vue +16 -11
- package/src/components/Table/components/TableSlotGrid.vue +10 -10
- package/src/components/Table/components/TableSlotHeader.vue +7 -2
- package/src/css/app.css +3 -0
- package/src/layouts/MenuLayout.vue +6 -0
- package/src/layouts/PdaLayout.vue +364 -0
- package/src/router/routes.ts +4 -0
- package/src/store/table.js +1 -1
package/package.json
CHANGED
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
</template>
|
|
71
71
|
<template #item="props">
|
|
72
72
|
<TableSlotGrid
|
|
73
|
+
v-if="!showSkeleton"
|
|
73
74
|
:table-props="props"
|
|
74
75
|
:selection-type="selectionType"
|
|
75
76
|
:popup-edit-number-options="popupEditNumberOptions"
|
|
@@ -223,6 +224,9 @@ export default defineComponent({
|
|
|
223
224
|
watch: {
|
|
224
225
|
rows (val) {
|
|
225
226
|
this.rowsData = val
|
|
227
|
+
},
|
|
228
|
+
visibleColumns (val: string [] | []) {
|
|
229
|
+
this.visibleColumnsData = val
|
|
226
230
|
}
|
|
227
231
|
},
|
|
228
232
|
mounted () {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<tr
|
|
3
|
-
:class="
|
|
3
|
+
:class="tablePropsData.row.rowBgColor || 'bg-main-color'"
|
|
4
4
|
>
|
|
5
5
|
<q-td
|
|
6
6
|
v-if="selectionType != 'none'"
|
|
7
|
-
:id="
|
|
7
|
+
:id="tablePropsData.row.id"
|
|
8
8
|
auto-width
|
|
9
9
|
>
|
|
10
10
|
<q-checkbox
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
/>
|
|
14
14
|
</q-td>
|
|
15
15
|
<q-td
|
|
16
|
-
v-for="col in
|
|
16
|
+
v-for="col in tablePropsData.cols"
|
|
17
17
|
:key="col.name"
|
|
18
|
-
:class="
|
|
19
|
-
:props="
|
|
18
|
+
:class="tablePropsData.row.rowBgColor || 'bg-main-color'"
|
|
19
|
+
:props="tablePropsData"
|
|
20
20
|
>
|
|
21
21
|
<span
|
|
22
22
|
:style="tablePropsData.row.tdStyle"
|
|
23
23
|
v-if="getColumnValue(col)"
|
|
24
|
-
v-html="
|
|
24
|
+
v-html="tablePropsData.row[col.name]"
|
|
25
25
|
/>
|
|
26
26
|
<!-- fa-solid fa-pen-to-square -->
|
|
27
27
|
<q-icon
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
v-if="col.editable"
|
|
36
36
|
:model="tablePropsData.row[col.name] || ''"
|
|
37
37
|
:label="col.label"
|
|
38
|
-
:data-cy="col.popupEditDataCy + '-' +
|
|
38
|
+
:data-cy="col.popupEditDataCy + '-' + tablePropsData.row.id"
|
|
39
39
|
:input-max-length="col.inputMaxLength || 20"
|
|
40
40
|
:mask="col.popupEditMask || ''"
|
|
41
41
|
:input-type="col.popupEditInputtype || 'text'"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<BasicCheckBox
|
|
51
51
|
v-if="col.showBasicCheckbox"
|
|
52
52
|
:table-props="tablePropsData"
|
|
53
|
-
:data-cy="col.checkBoxDataCy + '-' +
|
|
53
|
+
:data-cy="col.checkBoxDataCy + '-' + tablePropsData.row.id || ''"
|
|
54
54
|
:model="tablePropsData.row[col.name]"
|
|
55
55
|
@check-box-emit="(val: object) => {
|
|
56
56
|
tablePropsData.row[col.name] = val
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
<CustomizedCheckBox
|
|
61
61
|
v-if="col.showCustomizedCheckBox"
|
|
62
62
|
:table-props="tablePropsData"
|
|
63
|
-
:data-cy="col.checkBoxDataCy + '-' +
|
|
63
|
+
:data-cy="col.checkBoxDataCy + '-' + tablePropsData.row.id || ''"
|
|
64
64
|
:model="tablePropsData.row[col.name]"
|
|
65
65
|
:check-box-color="tablePropsData.row[col.name] ? col.checkBoxColorCaseTrue : col.checkBoxColorCaseFalse"
|
|
66
66
|
:check-box-icon-size="'md'"
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
|
|
82
82
|
<CustomizedButton
|
|
83
83
|
v-if="col.showCustomizedButton"
|
|
84
|
-
:data-cy="col.colButtonDataCy + '-' +
|
|
84
|
+
:data-cy="col.colButtonDataCy + '-' + tablePropsData.row.id"
|
|
85
85
|
:btn-color="col.btnColor || 'primary'"
|
|
86
86
|
:btn-icon="col.btnIcon|| ''"
|
|
87
87
|
@on-click-button="() => {
|
|
88
|
-
$emit('onClickButton', col.btnEmit,
|
|
88
|
+
$emit('onClickButton', col.btnEmit, tablePropsData.row)
|
|
89
89
|
}"
|
|
90
90
|
/>
|
|
91
91
|
</q-td>
|
|
@@ -116,6 +116,11 @@ export default {
|
|
|
116
116
|
default: 'none'
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
+
watch: {
|
|
120
|
+
tableProps (val) {
|
|
121
|
+
this.tablePropsData = val
|
|
122
|
+
}
|
|
123
|
+
},
|
|
119
124
|
emits: ['onSaveValuePopupEdit', 'onUpdateBasicCheckboxValue', 'onClickButton', 'onUpdateCustomizedCheckboxValue'],
|
|
120
125
|
data () {
|
|
121
126
|
return {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
? $q.dark.isActive
|
|
13
13
|
? 'bg-grey-9'
|
|
14
14
|
: 'bg-grey-2'
|
|
15
|
-
:
|
|
15
|
+
: tablePropsData.row.rowBgColor || 'bg-main-color'
|
|
16
16
|
"
|
|
17
17
|
>
|
|
18
18
|
<q-card-section>
|
|
@@ -43,16 +43,16 @@
|
|
|
43
43
|
>
|
|
44
44
|
<q-icon
|
|
45
45
|
v-if="col.editable"
|
|
46
|
-
name="
|
|
46
|
+
name="edit"
|
|
47
47
|
color="primary"
|
|
48
48
|
size="sm"
|
|
49
49
|
class="cursor-pointer"
|
|
50
50
|
/>
|
|
51
|
-
<span v-html="
|
|
51
|
+
<span v-html="tablePropsData.row[col.name]" />
|
|
52
52
|
<TablePopupEdit
|
|
53
53
|
:model="tablePropsData.row[col.name] || ''"
|
|
54
54
|
:label="col.label"
|
|
55
|
-
:data-cy="col.popupEditDataCy + '-' +
|
|
55
|
+
:data-cy="col.popupEditDataCy + '-' + tablePropsData.row.id"
|
|
56
56
|
:input-max-length="col.inputMaxLength || 20"
|
|
57
57
|
:mask="col.popupEditMask || ''"
|
|
58
58
|
:input-type="col.popupEditInputtype || 'text'"
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
<BasicCheckBox
|
|
70
70
|
v-if="col.showBasicCheckbox"
|
|
71
71
|
:table-props="tablePropsData"
|
|
72
|
-
:data-cy="col.checkBoxDataCy + '-' +
|
|
72
|
+
:data-cy="col.checkBoxDataCy + '-' + tablePropsData.row.id || ''"
|
|
73
73
|
:model="tablePropsData.row[col.name]"
|
|
74
74
|
@check-box-emit="(val: object) => {
|
|
75
75
|
tablePropsData.row[col.name] = val
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
<CustomizedCheckBox
|
|
80
80
|
v-if="col.showCustomizedCheckBox"
|
|
81
81
|
:table-props="tablePropsData"
|
|
82
|
-
:data-cy="col.checkBoxDataCy + '-' +
|
|
82
|
+
:data-cy="col.checkBoxDataCy + '-' + tablePropsData.row.id || ''"
|
|
83
83
|
:model="tablePropsData.row[col.name]"
|
|
84
84
|
:check-box-color="tablePropsData.row[col.name] ? col.checkBoxColorCaseTrue : col.checkBoxColorCaseFalse"
|
|
85
85
|
:check-box-icon-size="'lg'"
|
|
@@ -106,11 +106,11 @@
|
|
|
106
106
|
<q-item-section>
|
|
107
107
|
<CustomizedButton
|
|
108
108
|
v-if="col.showCustomizedButton"
|
|
109
|
-
:data-cy="col.colButtonDataCy + '-' +
|
|
109
|
+
:data-cy="col.colButtonDataCy + '-' + tablePropsData.row.id"
|
|
110
110
|
:btn-color="col.btnColor || 'primary'"
|
|
111
111
|
:btn-icon="col.btnIcon|| ''"
|
|
112
112
|
@on-click-button="() => {
|
|
113
|
-
$emit('onClickButton', col.btnEmit,
|
|
113
|
+
$emit('onClickButton', col.btnEmit, tablePropsData.row)
|
|
114
114
|
}"
|
|
115
115
|
/>
|
|
116
116
|
</q-item-section>
|
|
@@ -162,8 +162,8 @@ export default {
|
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
164
|
watch: {
|
|
165
|
-
|
|
166
|
-
this.
|
|
165
|
+
tableProps (val) {
|
|
166
|
+
this.tablePropsData = val
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
mounted () {},
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
/>
|
|
14
14
|
</q-th>
|
|
15
15
|
<q-th
|
|
16
|
-
v-for="col in
|
|
16
|
+
v-for="col in tablePropsData.cols"
|
|
17
17
|
v-if="!smallDevice"
|
|
18
18
|
:key="col.name"
|
|
19
|
-
:props="
|
|
19
|
+
:props="tablePropsData"
|
|
20
20
|
>
|
|
21
21
|
{{ col.label }}
|
|
22
22
|
</q-th>
|
|
@@ -46,6 +46,11 @@ export default {
|
|
|
46
46
|
showSearch: false
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
+
watch: {
|
|
50
|
+
tableProps (val) {
|
|
51
|
+
this.tablePropsData = val
|
|
52
|
+
}
|
|
53
|
+
},
|
|
49
54
|
methods: {
|
|
50
55
|
}
|
|
51
56
|
}
|
package/src/css/app.css
CHANGED
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<q-layout
|
|
4
|
+
view="hHh lpR fFf"
|
|
5
|
+
>
|
|
6
|
+
<q-header
|
|
7
|
+
class="bg-light-peach text-black"
|
|
8
|
+
>
|
|
9
|
+
<div class="header-container text-black">
|
|
10
|
+
<TaskNavBar
|
|
11
|
+
:logo="'src/assets/vue1.svg'"
|
|
12
|
+
:title="'Pda'"
|
|
13
|
+
:show-btn-back="false"
|
|
14
|
+
:show-btn-search="true"
|
|
15
|
+
@on-click-btn-search="toggleSearchVisibility"
|
|
16
|
+
@on-click-btn-menu="toogleColumnsSelectorVisibility">
|
|
17
|
+
</TaskNavBar>
|
|
18
|
+
</div>
|
|
19
|
+
</q-header>
|
|
20
|
+
<q-page-container class=" full-width column justify-center">
|
|
21
|
+
<q-page>
|
|
22
|
+
<Table
|
|
23
|
+
ref="table"
|
|
24
|
+
:rows="rows"
|
|
25
|
+
:columns="columns"
|
|
26
|
+
:visible-columns="visibleColumns"
|
|
27
|
+
:small-device="false"
|
|
28
|
+
:store="store"
|
|
29
|
+
:table-style="tableStyle"
|
|
30
|
+
:show-skeleton="false"
|
|
31
|
+
:selection-type="'multiple'"
|
|
32
|
+
:filter-method="filterMethod"
|
|
33
|
+
:filter-computed="filter"
|
|
34
|
+
@on-select-visible-columns="saveSelectedColumns"
|
|
35
|
+
@on-update-basic-checkbox-value="onUpdateBasicCheckboxValue"
|
|
36
|
+
@on-update-customized-checkbox-value="onUpdateCustomizedCheckboxValue"
|
|
37
|
+
@on-click-button="setItemNotFound"
|
|
38
|
+
/>
|
|
39
|
+
</q-page>
|
|
40
|
+
</q-page-container>
|
|
41
|
+
</q-layout>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
<style>
|
|
45
|
+
</style>
|
|
46
|
+
<script lang="ts">
|
|
47
|
+
import TaskNavBar from '../components/TaskNavBar/TaskNavBar.vue'
|
|
48
|
+
import Table from '../components/Table/Table.vue'
|
|
49
|
+
import setTableHeight from '../components/Table/utils/setTableHeight'
|
|
50
|
+
import infiniteScroll from '../components/Table/utils/infiniteScroll'
|
|
51
|
+
import FilterMethod from '../components/Table/utils/filterMethod'
|
|
52
|
+
import { tableStore } from '../store/table.js'
|
|
53
|
+
export default {
|
|
54
|
+
components: {
|
|
55
|
+
TaskNavBar,
|
|
56
|
+
Table
|
|
57
|
+
},
|
|
58
|
+
data () {
|
|
59
|
+
return {
|
|
60
|
+
showDialog: false,
|
|
61
|
+
forceRender: false,
|
|
62
|
+
store: tableStore(),
|
|
63
|
+
totalPage: 0,
|
|
64
|
+
pageSize: 20,
|
|
65
|
+
tableStyle: '',
|
|
66
|
+
columns: [{
|
|
67
|
+
name: 'name',
|
|
68
|
+
required: true,
|
|
69
|
+
label: 'Dessert (100g serving)',
|
|
70
|
+
align: 'left',
|
|
71
|
+
sortable: true
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'available',
|
|
75
|
+
required: true,
|
|
76
|
+
label: 'Available',
|
|
77
|
+
align: 'left',
|
|
78
|
+
sortable: true,
|
|
79
|
+
showBasicCheckbox: true
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'booleanIcon',
|
|
83
|
+
required: true,
|
|
84
|
+
label: 'Boolean Icon',
|
|
85
|
+
align: 'left',
|
|
86
|
+
sortable: true,
|
|
87
|
+
showCustomizedIcon: true
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'calories',
|
|
91
|
+
align: 'center',
|
|
92
|
+
label: 'Calories',
|
|
93
|
+
field: 'calories',
|
|
94
|
+
sortable: true,
|
|
95
|
+
editable: true,
|
|
96
|
+
showEditIcon: true,
|
|
97
|
+
popupEditEmit: 'onSaveValuePopupEdit',
|
|
98
|
+
popupEditInputtype: 'number',
|
|
99
|
+
popupEditDataCy: '',
|
|
100
|
+
popupEditMask: '#####'
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'fat',
|
|
104
|
+
label: 'Fat (g)',
|
|
105
|
+
field: 'fat',
|
|
106
|
+
sortable: true,
|
|
107
|
+
showCustomizedButton: true,
|
|
108
|
+
btnIcon: 'save',
|
|
109
|
+
btnEmit: 'onClickButton',
|
|
110
|
+
dataCy: 'onClickButton',
|
|
111
|
+
btnColor: 'primary'
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'carbs',
|
|
115
|
+
label: 'Carbs (g)',
|
|
116
|
+
field: 'carbs'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'checked',
|
|
120
|
+
label: 'Checked',
|
|
121
|
+
field: 'carbs',
|
|
122
|
+
sortable: true,
|
|
123
|
+
required: true,
|
|
124
|
+
showCustomizedCheckBox: true,
|
|
125
|
+
checkedIcon: 'check_circle',
|
|
126
|
+
uncheckedIcon: 'cancel',
|
|
127
|
+
checkBoxColorCaseTrue: 'positive',
|
|
128
|
+
checkBoxColorCaseFalse: 'negative',
|
|
129
|
+
checkBoxDataCy: ''
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'protein',
|
|
133
|
+
label: 'Protein (g)',
|
|
134
|
+
field: 'protein',
|
|
135
|
+
sortable: true,
|
|
136
|
+
required: true,
|
|
137
|
+
editable: true,
|
|
138
|
+
showEditIcon: true,
|
|
139
|
+
popupEditEmit: 'onSaveValuePopupEdit',
|
|
140
|
+
popupEditInputtype: 'text',
|
|
141
|
+
popupEditDataCy: '',
|
|
142
|
+
showInputPopupEdit: true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'sodium',
|
|
146
|
+
label: 'Sodium (mg)',
|
|
147
|
+
field: 'sodium'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'calcium',
|
|
151
|
+
label: 'Calcium (%)',
|
|
152
|
+
field: 'calcium',
|
|
153
|
+
sortable: true
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'iron',
|
|
157
|
+
label: 'Iron (%)',
|
|
158
|
+
field: 'iron',
|
|
159
|
+
sortable: true
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
rows: [],
|
|
163
|
+
rowsData: [
|
|
164
|
+
{
|
|
165
|
+
id: 1,
|
|
166
|
+
name: 'Frozen Yogurt',
|
|
167
|
+
booleanIcon: true,
|
|
168
|
+
available: true,
|
|
169
|
+
calories: 159,
|
|
170
|
+
fat: 6.0,
|
|
171
|
+
carbs: 24,
|
|
172
|
+
checked: false,
|
|
173
|
+
protein: 4.0,
|
|
174
|
+
sodium: 87,
|
|
175
|
+
calcium: '14%',
|
|
176
|
+
iron: '1%'
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: 2,
|
|
180
|
+
name: 'Ice cream sandwich',
|
|
181
|
+
booleanIcon: true,
|
|
182
|
+
available: false,
|
|
183
|
+
calories: 237,
|
|
184
|
+
fat: 9.0,
|
|
185
|
+
carbs: 37,
|
|
186
|
+
checked: false,
|
|
187
|
+
protein: 4.3,
|
|
188
|
+
sodium: 129,
|
|
189
|
+
calcium: '8%',
|
|
190
|
+
iron: '1%'
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: 3,
|
|
194
|
+
name: 'Eclair',
|
|
195
|
+
booleanIcon: true,
|
|
196
|
+
available: true,
|
|
197
|
+
calories: 262,
|
|
198
|
+
fat: 16.0,
|
|
199
|
+
carbs: 23,
|
|
200
|
+
checked: false,
|
|
201
|
+
protein: 6.0,
|
|
202
|
+
sodium: 337,
|
|
203
|
+
calcium: '6%',
|
|
204
|
+
iron: '7%'
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: 4,
|
|
208
|
+
name: 'Cupcake',
|
|
209
|
+
booleanIcon: false,
|
|
210
|
+
available: false,
|
|
211
|
+
calories: 305,
|
|
212
|
+
fat: 3.7,
|
|
213
|
+
carbs: 67,
|
|
214
|
+
checked: false,
|
|
215
|
+
protein: 4.3,
|
|
216
|
+
sodium: 413,
|
|
217
|
+
calcium: '3%',
|
|
218
|
+
iron: '8%'
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
id: 5,
|
|
222
|
+
name: 'Gingerbread',
|
|
223
|
+
booleanIcon: true,
|
|
224
|
+
available: true,
|
|
225
|
+
calories: 356,
|
|
226
|
+
fat: 16.0,
|
|
227
|
+
carbs: 49,
|
|
228
|
+
checked: false,
|
|
229
|
+
protein: 3.9,
|
|
230
|
+
sodium: 327,
|
|
231
|
+
calcium: '7%',
|
|
232
|
+
iron: '16%'
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: 5,
|
|
236
|
+
name: 'Jelly bean',
|
|
237
|
+
booleanIcon: false,
|
|
238
|
+
available: false,
|
|
239
|
+
calories: 375,
|
|
240
|
+
fat: 0.0,
|
|
241
|
+
carbs: 94,
|
|
242
|
+
checked: true,
|
|
243
|
+
protein: 0.0,
|
|
244
|
+
sodium: 50,
|
|
245
|
+
calcium: '0%',
|
|
246
|
+
iron: '0%'
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: 6,
|
|
250
|
+
name: 'Lollipop',
|
|
251
|
+
booleanIcon: true,
|
|
252
|
+
available: true,
|
|
253
|
+
calories: 392,
|
|
254
|
+
fat: 0.2,
|
|
255
|
+
carbs: 98,
|
|
256
|
+
checked: false,
|
|
257
|
+
protein: 0,
|
|
258
|
+
sodium: 38,
|
|
259
|
+
calcium: '0%',
|
|
260
|
+
iron: '2%'
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: 7,
|
|
264
|
+
name: 'Honeycomb',
|
|
265
|
+
booleanIcon: true,
|
|
266
|
+
available: false,
|
|
267
|
+
calories: 408,
|
|
268
|
+
fat: 3.2,
|
|
269
|
+
carbs: 87,
|
|
270
|
+
checked: true,
|
|
271
|
+
protein: 6.5,
|
|
272
|
+
sodium: 562,
|
|
273
|
+
calcium: '0%',
|
|
274
|
+
iron: '45%'
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: 8,
|
|
278
|
+
name: 'Donut',
|
|
279
|
+
booleanIcon: true,
|
|
280
|
+
available: true,
|
|
281
|
+
calories: 452,
|
|
282
|
+
fat: 25.0,
|
|
283
|
+
carbs: 51,
|
|
284
|
+
checked: false,
|
|
285
|
+
protein: 4.9,
|
|
286
|
+
sodium: 326,
|
|
287
|
+
calcium: '2%',
|
|
288
|
+
iron: '22%'
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
id: 9,
|
|
292
|
+
name: 'KitKat',
|
|
293
|
+
booleanIcon: false,
|
|
294
|
+
available: false,
|
|
295
|
+
calories: 518,
|
|
296
|
+
fat: 26.0,
|
|
297
|
+
carbs: 65,
|
|
298
|
+
checked: true,
|
|
299
|
+
protein: 7,
|
|
300
|
+
sodium: 54,
|
|
301
|
+
calcium: '12%',
|
|
302
|
+
iron: '6%'
|
|
303
|
+
}
|
|
304
|
+
],
|
|
305
|
+
visibleColumns: []
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
computed: {
|
|
309
|
+
pageLength (): number {
|
|
310
|
+
return (this.totalPage + 1) * this.pageSize
|
|
311
|
+
},
|
|
312
|
+
filter ():object {
|
|
313
|
+
return {
|
|
314
|
+
search: this.store.filterValue,
|
|
315
|
+
forceRender: this.forceRender
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
mounted () {
|
|
320
|
+
this.store.cleanTableFilter()
|
|
321
|
+
this.tableStyle = setTableHeight.setTableHeight()
|
|
322
|
+
infiniteScroll.handleInfiniteScrollNewTable(this)
|
|
323
|
+
this.rows = this.rowsData
|
|
324
|
+
this.visibleColumns = this.store.visiblecolumns
|
|
325
|
+
},
|
|
326
|
+
methods: {
|
|
327
|
+
saveSelectedColumns (columns: string []): void {
|
|
328
|
+
this.store.visiblecolumns = columns
|
|
329
|
+
this.visibleColumns = columns
|
|
330
|
+
},
|
|
331
|
+
filterMethod (rows: string | [], terms: { search: string }): object[] | [] {
|
|
332
|
+
return FilterMethod.filter(this, rows, terms)
|
|
333
|
+
},
|
|
334
|
+
onUpdateBasicCheckboxValue (rows: object []) {
|
|
335
|
+
console.log(rows, 'onUpdateBasicCheckboxValue')
|
|
336
|
+
},
|
|
337
|
+
onUpdateCustomizedCheckboxValue (rows: object []) {
|
|
338
|
+
console.log(rows, 'onUpdateCustomizedCheckboxValue')
|
|
339
|
+
},
|
|
340
|
+
setItemNotFound (rows: object []) {
|
|
341
|
+
console.log(rows, 'onClickButton')
|
|
342
|
+
},
|
|
343
|
+
toggleSearchVisibility () {
|
|
344
|
+
this.$refs.table.toggleSearchVisibility(this.store)
|
|
345
|
+
this.$refs.table.filterInputFocus()
|
|
346
|
+
},
|
|
347
|
+
toggleRightDrawer (): void {
|
|
348
|
+
},
|
|
349
|
+
toogleColumnsSelectorVisibility () {
|
|
350
|
+
// this.$refs.sideBar.setRightDrawerOpenToFalse()
|
|
351
|
+
this.$refs.table.toogleColumnsSelectorVisibility()
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
</script>
|
|
356
|
+
<style scoped>
|
|
357
|
+
.header-container {
|
|
358
|
+
padding: 20px 20px 5px 20px;
|
|
359
|
+
}
|
|
360
|
+
.q-toolbar {
|
|
361
|
+
min-height: unset !important;
|
|
362
|
+
padding: 0 !important;
|
|
363
|
+
}
|
|
364
|
+
</style>
|
package/src/router/routes.ts
CHANGED
package/src/store/table.js
CHANGED
|
@@ -2,7 +2,7 @@ import { defineStore } from 'pinia'
|
|
|
2
2
|
import { useStorage } from '@vueuse/core'
|
|
3
3
|
export const tableStore = defineStore('tableStore', {
|
|
4
4
|
state: () => ({
|
|
5
|
-
disableScannerButtons: useStorage('
|
|
5
|
+
disableScannerButtons: useStorage('disableScannerButtons', false),
|
|
6
6
|
filterValue: useStorage('filterValue', ''),
|
|
7
7
|
lastFilterValue: useStorage('lastFilterValue', ''),
|
|
8
8
|
visiblecolumns: useStorage('visiblecolumns', [])
|