quasar-factory-lib 0.0.28 → 0.0.29
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/components/Table/Table.vue.d.ts +282 -0
- package/dist/quasar-factory-lib.js +4655 -4494
- package/dist/quasar-factory-lib.umd.cjs +11 -11
- package/package.json +1 -1
- package/src/components/Table/Table.vue +4 -4
- package/src/components/Table/components/TableSlotBody.vue +0 -1
- package/dist/pages/TablePage.vue.d.ts +0 -871
- package/dist/store/table.d.ts +0 -9
- package/src/pages/TablePage.vue +0 -354
package/dist/store/table.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export const tableStore: import("pinia").StoreDefinition<"tableStore", {
|
|
2
|
-
disableScannerButtons: import("@vueuse/shared").RemovableRef<boolean>;
|
|
3
|
-
filterValue: import("@vueuse/shared").RemovableRef<string>;
|
|
4
|
-
lastFilterValue: import("@vueuse/shared").RemovableRef<string>;
|
|
5
|
-
visiblecolumns: import("@vueuse/shared").RemovableRef<never[]>;
|
|
6
|
-
}, {}, {
|
|
7
|
-
setFilterValue(val: any): void;
|
|
8
|
-
cleanTableFilter(): void;
|
|
9
|
-
}>;
|
package/src/pages/TablePage.vue
DELETED
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-page-container class=" full-width column justify-center">
|
|
3
|
-
<q-page
|
|
4
|
-
class="full-width column justify-center align-center items-center"
|
|
5
|
-
style="height: 70vh;"
|
|
6
|
-
>
|
|
7
|
-
<div
|
|
8
|
-
class="full-width"
|
|
9
|
-
>
|
|
10
|
-
<Table
|
|
11
|
-
:rows="rows"
|
|
12
|
-
:columns="columns"
|
|
13
|
-
:visible-columns="visibleColumns"
|
|
14
|
-
:small-device="true"
|
|
15
|
-
:store="store"
|
|
16
|
-
:table-style="tableStyle"
|
|
17
|
-
:show-skeleton="false"
|
|
18
|
-
:selection-type="'multiple'"
|
|
19
|
-
:filter-method="filterMethod"
|
|
20
|
-
:filter-computed="filter"
|
|
21
|
-
@on-select-visible-columns="saveSelectedColumns"
|
|
22
|
-
@on-update-basic-checkbox-value="onUpdateBasicCheckboxValue"
|
|
23
|
-
@on-update-customized-checkbox-value="onUpdateCustomizedCheckboxValue"
|
|
24
|
-
@on-click-button="setItemNotFound"
|
|
25
|
-
/>
|
|
26
|
-
</div>
|
|
27
|
-
</q-page>
|
|
28
|
-
</q-page-container>
|
|
29
|
-
</template>
|
|
30
|
-
<script lang="ts">
|
|
31
|
-
import Table from '../components/Table/Table.vue'
|
|
32
|
-
import setTableHeight from '../components/Table/utils/setTableHeight'
|
|
33
|
-
import infiniteScroll from '../components/Table/utils/infiniteScroll'
|
|
34
|
-
import FilterMethod from '../components/Table/utils/filterMethod'
|
|
35
|
-
import { tableStore } from '../store/table.js'
|
|
36
|
-
export default {
|
|
37
|
-
components: {
|
|
38
|
-
Table
|
|
39
|
-
},
|
|
40
|
-
data () {
|
|
41
|
-
return {
|
|
42
|
-
showDialog: false,
|
|
43
|
-
forceRender: false,
|
|
44
|
-
store: tableStore(),
|
|
45
|
-
totalPage: 0,
|
|
46
|
-
pageSize: 20,
|
|
47
|
-
tableStyle: '',
|
|
48
|
-
columns: [{
|
|
49
|
-
name: 'name',
|
|
50
|
-
required: true,
|
|
51
|
-
label: 'Dessert (100g serving)',
|
|
52
|
-
align: 'left',
|
|
53
|
-
sortable: true,
|
|
54
|
-
tdStyle: (row: { tdStyle: string }) => row.tdStyle,
|
|
55
|
-
rowStyleFn: (row: { rowStyleFn: string }) => row.rowStyleFn,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'available',
|
|
59
|
-
required: false,
|
|
60
|
-
label: 'Available',
|
|
61
|
-
align: 'left',
|
|
62
|
-
sortable: true,
|
|
63
|
-
showBasicCheckbox: true
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: 'booleanIcon',
|
|
67
|
-
required: true,
|
|
68
|
-
label: 'Boolean Icon',
|
|
69
|
-
align: 'left',
|
|
70
|
-
sortable: true,
|
|
71
|
-
showCustomizedIcon: true
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: 'calories',
|
|
75
|
-
align: 'center',
|
|
76
|
-
label: 'Calories',
|
|
77
|
-
field: 'calories',
|
|
78
|
-
sortable: true,
|
|
79
|
-
editable: true,
|
|
80
|
-
showEditIcon: true,
|
|
81
|
-
popupEditEmit: 'onSaveValuePopupEdit',
|
|
82
|
-
popupEditInputtype: 'number',
|
|
83
|
-
popupEditDataCy: '',
|
|
84
|
-
popupEditMask: '#####',
|
|
85
|
-
tdStyle: (row: { tdStyle: string }) => row.tdStyle,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: 'fat',
|
|
89
|
-
label: 'Fat (g)',
|
|
90
|
-
field: 'fat',
|
|
91
|
-
sortable: true,
|
|
92
|
-
showCustomizedButton: true,
|
|
93
|
-
btnIcon: 'save',
|
|
94
|
-
btnEmit: 'onClickButton',
|
|
95
|
-
dataCy: 'onClickButton',
|
|
96
|
-
btnColor: 'primary'
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
name: 'carbs',
|
|
100
|
-
label: 'Carbs (g)',
|
|
101
|
-
field: 'carbs'
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: 'checked',
|
|
105
|
-
label: 'Checked',
|
|
106
|
-
field: 'carbs',
|
|
107
|
-
sortable: true,
|
|
108
|
-
required: false,
|
|
109
|
-
showCustomizedCheckBox: true,
|
|
110
|
-
checkedIcon: 'check_circle',
|
|
111
|
-
uncheckedIcon: 'cancel',
|
|
112
|
-
checkBoxColorCaseTrue: 'positive',
|
|
113
|
-
checkBoxColorCaseFalse: 'negative',
|
|
114
|
-
checkBoxDataCy: ''
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: 'protein',
|
|
118
|
-
label: 'Protein (g)',
|
|
119
|
-
field: 'protein',
|
|
120
|
-
sortable: true,
|
|
121
|
-
required: false,
|
|
122
|
-
editable: true,
|
|
123
|
-
showEditIcon: true,
|
|
124
|
-
popupEditEmit: 'onSaveValuePopupEdit',
|
|
125
|
-
popupEditInputtype: 'text',
|
|
126
|
-
popupEditDataCy: '',
|
|
127
|
-
showInputPopupEdit: true
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
name: 'sodium',
|
|
131
|
-
label: 'Sodium (mg)',
|
|
132
|
-
field: 'sodium'
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: 'calcium',
|
|
136
|
-
label: 'Calcium (%)',
|
|
137
|
-
field: 'calcium',
|
|
138
|
-
sortable: true
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: 'iron',
|
|
142
|
-
label: 'Iron (%)',
|
|
143
|
-
field: 'iron',
|
|
144
|
-
sortable: true
|
|
145
|
-
}
|
|
146
|
-
],
|
|
147
|
-
rows: [],
|
|
148
|
-
rowsData: [
|
|
149
|
-
{
|
|
150
|
-
name: 'Frozen Yogurt',
|
|
151
|
-
booleanIcon: true,
|
|
152
|
-
available: true,
|
|
153
|
-
calories: 159,
|
|
154
|
-
fat: 6.0,
|
|
155
|
-
carbs: 24,
|
|
156
|
-
checked: false,
|
|
157
|
-
protein: 4.0,
|
|
158
|
-
sodium: 87,
|
|
159
|
-
calcium: '14%',
|
|
160
|
-
iron: '1%'
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: 'Ice cream sandwich',
|
|
164
|
-
booleanIcon: true,
|
|
165
|
-
available: false,
|
|
166
|
-
calories: 237,
|
|
167
|
-
fat: 9.0,
|
|
168
|
-
carbs: 37,
|
|
169
|
-
checked: false,
|
|
170
|
-
protein: 4.3,
|
|
171
|
-
sodium: 129,
|
|
172
|
-
calcium: '8%',
|
|
173
|
-
iron: '1%'
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
name: 'Eclair',
|
|
177
|
-
booleanIcon: true,
|
|
178
|
-
available: true,
|
|
179
|
-
calories: 262,
|
|
180
|
-
fat: 16.0,
|
|
181
|
-
carbs: 23,
|
|
182
|
-
checked: false,
|
|
183
|
-
protein: 6.0,
|
|
184
|
-
sodium: 337,
|
|
185
|
-
calcium: '6%',
|
|
186
|
-
iron: '7%'
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
name: 'Cupcake',
|
|
190
|
-
booleanIcon: false,
|
|
191
|
-
available: false,
|
|
192
|
-
calories: 305,
|
|
193
|
-
fat: 3.7,
|
|
194
|
-
carbs: 67,
|
|
195
|
-
checked: false,
|
|
196
|
-
protein: 4.3,
|
|
197
|
-
sodium: 413,
|
|
198
|
-
calcium: '3%',
|
|
199
|
-
iron: '8%'
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
name: 'Gingerbread',
|
|
203
|
-
booleanIcon: true,
|
|
204
|
-
available: true,
|
|
205
|
-
calories: 356,
|
|
206
|
-
fat: 16.0,
|
|
207
|
-
carbs: 49,
|
|
208
|
-
checked: false,
|
|
209
|
-
protein: 3.9,
|
|
210
|
-
sodium: 327,
|
|
211
|
-
calcium: '7%',
|
|
212
|
-
iron: '16%'
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
name: 'Jelly bean',
|
|
216
|
-
booleanIcon: false,
|
|
217
|
-
available: false,
|
|
218
|
-
calories: 375,
|
|
219
|
-
fat: 0.0,
|
|
220
|
-
carbs: 94,
|
|
221
|
-
checked: true,
|
|
222
|
-
protein: 0.0,
|
|
223
|
-
sodium: 50,
|
|
224
|
-
calcium: '0%',
|
|
225
|
-
iron: '0%'
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
name: 'Lollipop',
|
|
229
|
-
booleanIcon: true,
|
|
230
|
-
available: true,
|
|
231
|
-
calories: 392,
|
|
232
|
-
fat: 0.2,
|
|
233
|
-
carbs: 98,
|
|
234
|
-
checked: false,
|
|
235
|
-
protein: 0,
|
|
236
|
-
sodium: 38,
|
|
237
|
-
calcium: '0%',
|
|
238
|
-
iron: '2%'
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
name: 'Honeycomb',
|
|
242
|
-
booleanIcon: true,
|
|
243
|
-
available: false,
|
|
244
|
-
calories: 408,
|
|
245
|
-
fat: 3.2,
|
|
246
|
-
carbs: 87,
|
|
247
|
-
checked: true,
|
|
248
|
-
protein: 6.5,
|
|
249
|
-
sodium: 562,
|
|
250
|
-
calcium: '0%',
|
|
251
|
-
iron: '45%'
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
name: 'Donut',
|
|
255
|
-
booleanIcon: true,
|
|
256
|
-
available: true,
|
|
257
|
-
calories: 452,
|
|
258
|
-
fat: 25.0,
|
|
259
|
-
carbs: 51,
|
|
260
|
-
checked: false,
|
|
261
|
-
protein: 4.9,
|
|
262
|
-
sodium: 326,
|
|
263
|
-
calcium: '2%',
|
|
264
|
-
iron: '22%'
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
name: 'KitKat',
|
|
268
|
-
booleanIcon: false,
|
|
269
|
-
available: false,
|
|
270
|
-
calories: 518,
|
|
271
|
-
fat: 26.0,
|
|
272
|
-
carbs: 65,
|
|
273
|
-
checked: true,
|
|
274
|
-
protein: 7,
|
|
275
|
-
sodium: 54,
|
|
276
|
-
calcium: '12%',
|
|
277
|
-
iron: '6%'
|
|
278
|
-
}
|
|
279
|
-
],
|
|
280
|
-
visibleColumns: []
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
computed: {
|
|
284
|
-
pageLength (): number {
|
|
285
|
-
return (this.totalPage + 1) * this.pageSize
|
|
286
|
-
},
|
|
287
|
-
filter ():object {
|
|
288
|
-
return {
|
|
289
|
-
search: this.store.filterValue,
|
|
290
|
-
forceRender: this.forceRender
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
mounted () {
|
|
295
|
-
this.store.cleanTableFilter()
|
|
296
|
-
this.tableStyle = setTableHeight.setTableHeight()
|
|
297
|
-
infiniteScroll.handleInfiniteScrollNewTable(this)
|
|
298
|
-
// this.rows = this.rowsData
|
|
299
|
-
this.visibleColumns = this.store.visiblecolumns
|
|
300
|
-
|
|
301
|
-
const lista = this.rowsData
|
|
302
|
-
const lista2 = []
|
|
303
|
-
for (let i = 0; i < lista.length; i++) {
|
|
304
|
-
let tdStyle_= ''
|
|
305
|
-
// if (lista[i].name === 'Frozen Yogurt') {
|
|
306
|
-
// tdStyle_ = "color: red !important; font-weight: bold;"
|
|
307
|
-
// }else {
|
|
308
|
-
// tdStyle_ = "color: blue !important; font-weight: bold;"
|
|
309
|
-
// }
|
|
310
|
-
lista2.push({
|
|
311
|
-
name: lista[i].name,
|
|
312
|
-
booleanIcon: lista[i].booleanIcon,
|
|
313
|
-
available: lista[i].available,
|
|
314
|
-
calories: lista[i].calories,
|
|
315
|
-
fat: lista[i]. fat,
|
|
316
|
-
carbs: lista[i].carbs,
|
|
317
|
-
checked: lista[i].checked,
|
|
318
|
-
protein: lista[i].protein,
|
|
319
|
-
sodium: lista[i].sodium,
|
|
320
|
-
calcium: lista[i].calcium,
|
|
321
|
-
iron: lista[i].iron,
|
|
322
|
-
tdStyle: tdStyle_,
|
|
323
|
-
rowStyleFn: this.rowStyleFn
|
|
324
|
-
})
|
|
325
|
-
}
|
|
326
|
-
// console.log(lista2)
|
|
327
|
-
this.rows = lista2
|
|
328
|
-
},
|
|
329
|
-
methods: {
|
|
330
|
-
rowStyleFn (colName: string, rowName: string) {
|
|
331
|
-
if (colName ==='name' && rowName=== 'Frozen Yogurt') {
|
|
332
|
-
return 'color: red !important; font-weight: bold;'
|
|
333
|
-
}
|
|
334
|
-
return 'color: blue !important; font-weight: bold;'
|
|
335
|
-
},
|
|
336
|
-
saveSelectedColumns (columns: string []): void {
|
|
337
|
-
this.store.visiblecolumns = columns
|
|
338
|
-
this.visibleColumns = columns
|
|
339
|
-
},
|
|
340
|
-
filterMethod (rows: string | [], terms: { search: string }): object[] | [] {
|
|
341
|
-
return FilterMethod.filter(this, rows, terms)
|
|
342
|
-
},
|
|
343
|
-
onUpdateBasicCheckboxValue (rows: object []) {
|
|
344
|
-
console.log(rows, 'onUpdateBasicCheckboxValue')
|
|
345
|
-
},
|
|
346
|
-
onUpdateCustomizedCheckboxValue (rows: object []) {
|
|
347
|
-
console.log(rows, 'onUpdateCustomizedCheckboxValue')
|
|
348
|
-
},
|
|
349
|
-
setItemNotFound (rows: object []) {
|
|
350
|
-
console.log(rows, 'onClickButton')
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
</script>
|