quasar-factory-lib 0.0.50 → 0.0.52
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 +8 -8
- package/dist/components/Table/utils/setTableHeight.d.ts +1 -0
- package/dist/layouts/PdaLayout.vue.d.ts +9 -8
- package/dist/pages/TablePage.vue.d.ts +10 -15
- package/dist/quasar-factory-lib.js +20 -11
- package/dist/quasar-factory-lib.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Table/Table.vue +7 -10
- package/src/components/Table/components/TableSlotGrid.vue +2 -2
- package/src/components/Table/css/table.css +3 -0
- package/src/components/Table/utils/setTableHeight.ts +20 -6
- package/src/css/app.css +2 -2
- package/src/layouts/PdaLayout.vue +7 -3
- package/src/pages/TablePage.vue +17 -25
package/package.json
CHANGED
|
@@ -174,15 +174,15 @@ export default defineComponent({
|
|
|
174
174
|
showSkeleton: {
|
|
175
175
|
type: Boolean
|
|
176
176
|
},
|
|
177
|
-
filterComputedOptions: {
|
|
178
|
-
type: Object,
|
|
179
|
-
default: {}
|
|
180
|
-
},
|
|
181
177
|
getCellClass: {
|
|
182
178
|
type: Function,
|
|
183
179
|
default: function () {}
|
|
184
180
|
},
|
|
185
|
-
// Needs to be used
|
|
181
|
+
// Needs to be used with additionalFilterConditions and additionalSortConditions
|
|
182
|
+
filterComputedOptions: {
|
|
183
|
+
type: Object,
|
|
184
|
+
default: {}
|
|
185
|
+
},
|
|
186
186
|
additionalFilterConditions: {
|
|
187
187
|
type: Function,
|
|
188
188
|
default: function () {}
|
|
@@ -191,7 +191,6 @@ export default defineComponent({
|
|
|
191
191
|
type: Function,
|
|
192
192
|
default: function () {}
|
|
193
193
|
}
|
|
194
|
-
//
|
|
195
194
|
},
|
|
196
195
|
emits: [
|
|
197
196
|
'onSelectVisibleColumns',
|
|
@@ -247,7 +246,6 @@ export default defineComponent({
|
|
|
247
246
|
pageLength (): number {
|
|
248
247
|
return (this.totalPage + 1) * this.pageSize
|
|
249
248
|
}
|
|
250
|
-
|
|
251
249
|
},
|
|
252
250
|
watch: {
|
|
253
251
|
rows (val) {
|
|
@@ -256,7 +254,6 @@ export default defineComponent({
|
|
|
256
254
|
visibleColumns (val: string [] | []) {
|
|
257
255
|
this.visibleColumnsData = val
|
|
258
256
|
}
|
|
259
|
-
|
|
260
257
|
},
|
|
261
258
|
mounted () {
|
|
262
259
|
},
|
|
@@ -321,7 +318,7 @@ export default defineComponent({
|
|
|
321
318
|
data = [...this.rows];
|
|
322
319
|
}
|
|
323
320
|
if (this.additionalSortConditions && this.additionalSortConditions.toString().replace(/\s+/g, '') !== 'function(){}') {
|
|
324
|
-
data = this.additionalSortConditions(this.
|
|
321
|
+
data = this.additionalSortConditions(this.filteredRows, rows);
|
|
325
322
|
} else {
|
|
326
323
|
console.log('else sort')
|
|
327
324
|
}
|
|
@@ -402,7 +399,7 @@ export default defineComponent({
|
|
|
402
399
|
filteredRows_ = rows
|
|
403
400
|
}
|
|
404
401
|
if (this.additionalFilterConditions && this.additionalFilterConditions.toString().replace(/\s+/g, '') !== 'function(){}') {
|
|
405
|
-
filteredRows_ = this.additionalFilterConditions(this.
|
|
402
|
+
filteredRows_ = this.additionalFilterConditions(this.rows, filteredRows_)
|
|
406
403
|
}
|
|
407
404
|
this.filteredRows = filteredRows_
|
|
408
405
|
return filteredRows_.slice(0, this.pageLength)
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
:key="col.name"
|
|
29
29
|
>
|
|
30
30
|
<q-item-section>
|
|
31
|
-
<q-item-label class="itemsFontSize ellipsis text-
|
|
31
|
+
<q-item-label class="itemsFontSize ellipsis text-color-lightGray">
|
|
32
32
|
{{
|
|
33
33
|
col.label
|
|
34
34
|
}}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<q-item-section side>
|
|
39
39
|
<q-item-label
|
|
40
40
|
v-if="getColumnValue(col)"
|
|
41
|
-
class="itemsFontSize text-
|
|
41
|
+
class="itemsFontSize text-color-almostBlack"
|
|
42
42
|
:class="getCellClass(tablePropsData.row, col)"
|
|
43
43
|
>
|
|
44
44
|
<q-icon
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
const utils = {
|
|
2
2
|
setTableHeight ():string {
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
if (
|
|
6
|
-
const computedHeight = window.getComputedStyle(
|
|
3
|
+
const qPageStickBottom = document.getElementsByClassName('q-page-sticky')[0]
|
|
4
|
+
let footerHeightHeight = ''
|
|
5
|
+
if (qPageStickBottom) {
|
|
6
|
+
const computedHeight = window.getComputedStyle(qPageStickBottom).height
|
|
7
7
|
|
|
8
8
|
if (computedHeight !== 'auto') {
|
|
9
|
-
|
|
9
|
+
footerHeightHeight = computedHeight.replace('px', '')
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
|
|
12
13
|
const header = document.getElementsByClassName('q-header')[0]
|
|
13
14
|
let headerHeight = ''
|
|
14
15
|
if (header) {
|
|
@@ -18,7 +19,20 @@ const utils = {
|
|
|
18
19
|
headerHeight = computedHeight.replace('px', '')
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
|
-
const n = Number(
|
|
22
|
+
const n = Number(footerHeightHeight) + Number(headerHeight)
|
|
23
|
+
return `height:${window.innerHeight - n}px`
|
|
24
|
+
},
|
|
25
|
+
setModalTableHeight (elementId: string):string {
|
|
26
|
+
const topCard = document.getElementById(elementId)
|
|
27
|
+
let topCardHeight = ''
|
|
28
|
+
if (topCard) {
|
|
29
|
+
const computedHeight = window.getComputedStyle(topCard).height
|
|
30
|
+
|
|
31
|
+
if (computedHeight !== 'auto') {
|
|
32
|
+
topCardHeight = computedHeight.replace('px', '')
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const n = Number(topCardHeight)
|
|
22
36
|
return `height:${window.innerHeight - n}px`
|
|
23
37
|
}
|
|
24
38
|
}
|
package/src/css/app.css
CHANGED
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
.bg-light-peach {
|
|
32
32
|
background-color: var(--light-peach);
|
|
33
33
|
}
|
|
34
|
-
.text-color-
|
|
34
|
+
.text-color-lightGray {
|
|
35
35
|
color: var(--light-gray);
|
|
36
36
|
}
|
|
37
|
-
.text-color-
|
|
37
|
+
.text-color-almostBlack {
|
|
38
38
|
color: var(--almost-black);
|
|
39
39
|
}
|
|
40
40
|
.q-toolbar-unset-height .q-toolbar {
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
</TaskNavBar>
|
|
18
18
|
</div>
|
|
19
19
|
</q-header>
|
|
20
|
-
<q-page-container
|
|
20
|
+
<q-page-container>
|
|
21
21
|
<q-page>
|
|
22
22
|
<Table
|
|
23
23
|
ref="table"
|
|
24
24
|
:rows="rows"
|
|
25
25
|
:columns="columns"
|
|
26
26
|
:visible-columns="visibleColumns"
|
|
27
|
-
:small-device="
|
|
27
|
+
:small-device="smallDevice"
|
|
28
28
|
:store="store"
|
|
29
29
|
:table-style="tableStyle"
|
|
30
30
|
:show-skeleton="false"
|
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
@on-update-customized-checkbox-value="onUpdateCustomizedCheckboxValue"
|
|
36
36
|
@on-click-button="setItemNotFound"
|
|
37
37
|
/>
|
|
38
|
+
<q-page-sticky position="bottom" v-if="smallDevice">
|
|
39
|
+
<q-btn color="accent" icon="arrow_forward" stretch />
|
|
40
|
+
</q-page-sticky>
|
|
38
41
|
</q-page>
|
|
39
42
|
</q-page-container>
|
|
40
43
|
</q-layout>
|
|
@@ -56,6 +59,7 @@ export default {
|
|
|
56
59
|
},
|
|
57
60
|
data () {
|
|
58
61
|
return {
|
|
62
|
+
smallDevice: true,
|
|
59
63
|
showDialog: false,
|
|
60
64
|
store: tableStore(),
|
|
61
65
|
tableStyle: '',
|
|
@@ -312,8 +316,8 @@ export default {
|
|
|
312
316
|
this.store.cleanTableFilter()
|
|
313
317
|
this.tableStyle = setTableHeight.setTableHeight()
|
|
314
318
|
infiniteScroll.handleInfiniteScrollNewTable(this)
|
|
315
|
-
this.rows = this.rowsData
|
|
316
319
|
this.visibleColumns = this.store.visiblecolumns
|
|
320
|
+
this.rows = this.rowsData
|
|
317
321
|
},
|
|
318
322
|
methods: {
|
|
319
323
|
saveSelectedColumns (columns: string []): void {
|
package/src/pages/TablePage.vue
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
:selection-type="'multiple'"
|
|
22
22
|
:getCellClass="getCellClass"
|
|
23
23
|
:filterComputedOptions="{ preparedQuantity: store.prepared}"
|
|
24
|
-
:
|
|
24
|
+
:additional-sort-conditions="additionalSortConditions"
|
|
25
25
|
:additional-filter-conditions="additionalFilterConditions"
|
|
26
26
|
@on-select-visible-columns="saveSelectedColumns"
|
|
27
27
|
@on-update-basic-checkbox-value="onUpdateBasicCheckboxValue"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
import Table from '../components/Table/Table.vue'
|
|
37
37
|
import setTableHeight from '../components/Table/utils/setTableHeight'
|
|
38
38
|
import infiniteScroll from '../components/Table/utils/infiniteScroll'
|
|
39
|
-
import FilterMethod from '../components/Table/utils/filterMethod'
|
|
39
|
+
// import FilterMethod from '../components/Table/utils/filterMethod'
|
|
40
40
|
// import TableSort from '../components/Table/utils/sort.js'
|
|
41
41
|
import { tableStore } from '../store/table.js'
|
|
42
42
|
export default {
|
|
@@ -364,9 +364,6 @@ export default {
|
|
|
364
364
|
this.store.visiblecolumns = columns
|
|
365
365
|
this.visibleColumns = columns
|
|
366
366
|
},
|
|
367
|
-
filterMethod (rows: string | [], terms: { search: string }): object[] | [] {
|
|
368
|
-
return FilterMethod.filter(this, rows, terms)
|
|
369
|
-
},
|
|
370
367
|
onUpdateBasicCheckboxValue (rows: object []) {
|
|
371
368
|
console.log(rows, 'onUpdateBasicCheckboxValue')
|
|
372
369
|
},
|
|
@@ -376,38 +373,30 @@ export default {
|
|
|
376
373
|
setItemNotFound (rows: object []) {
|
|
377
374
|
console.log(rows, 'onClickButton')
|
|
378
375
|
},
|
|
379
|
-
// sortMethod (rows: object[], sortBy: string, descending: boolean): object[] | [] {
|
|
380
|
-
// let allrowsSorted = []
|
|
381
|
-
// if (this.store.filterValue !== '') {
|
|
382
|
-
// allrowsSorted = TableSort.sortMethod(this.filteredRows, sortBy, descending, this.sortDateValues)
|
|
383
|
-
// } else {
|
|
384
|
-
// allrowsSorted = TableSort.sortMethod(this.rows, sortBy, descending, this.sortDateValues)
|
|
385
|
-
// }
|
|
386
|
-
// return allrowsSorted.slice(0, rows.length)
|
|
387
|
-
// },
|
|
388
376
|
getCellClass (row, col) {
|
|
389
377
|
if (col.name === 'dessert' && row.dessert === 'Frozen Yogurt') {
|
|
390
378
|
return 'text-color-negative-bold';
|
|
391
379
|
}
|
|
392
380
|
return '';
|
|
393
381
|
},
|
|
394
|
-
additionalFilterConditions (
|
|
382
|
+
additionalFilterConditions (rows_: object[] | [], filteredRowsParam_: object[] | []) {
|
|
395
383
|
console.log('additional filter conditions')
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
384
|
+
const rowsToReturn = []
|
|
385
|
+
const filteredOrAllRows = filteredRowsParam_.length > 0 ? filteredRowsParam_: rows_
|
|
386
|
+
if (this.store.prepared) {
|
|
387
|
+
for (let i = 0; i < filteredOrAllRows.length; i++) {
|
|
388
|
+
if (filteredOrAllRows[i].sodium >= 300) {
|
|
389
|
+
rowsToReturn.push(filteredOrAllRows[i])
|
|
401
390
|
}
|
|
402
391
|
}
|
|
403
|
-
return
|
|
392
|
+
return rowsToReturn
|
|
404
393
|
} else {
|
|
405
|
-
return
|
|
394
|
+
return filteredRowsParam_
|
|
406
395
|
}
|
|
407
396
|
},
|
|
408
|
-
additionalSortConditions (
|
|
397
|
+
additionalSortConditions (filteredRowsData: object[] | [], rows: object[] | []) {
|
|
409
398
|
console.log('conditions sort function')
|
|
410
|
-
if (
|
|
399
|
+
if (this.store.prepared) {
|
|
411
400
|
|
|
412
401
|
const filteredRows_ = []
|
|
413
402
|
for (let i = 0; i < rows.length; i++) {
|
|
@@ -418,10 +407,13 @@ export default {
|
|
|
418
407
|
filteredRowsData = filteredRows_
|
|
419
408
|
return [...filteredRowsData]
|
|
420
409
|
}
|
|
421
|
-
else if (!
|
|
410
|
+
else if (!this.store.prepared) {
|
|
422
411
|
return [...rows]
|
|
423
412
|
}
|
|
424
413
|
}
|
|
425
414
|
}
|
|
426
415
|
}
|
|
427
416
|
</script>
|
|
417
|
+
<!-- :filterComputedOptions="{ preparedQuantity: store.prepared}"
|
|
418
|
+
:additional-sort-conditions="additionalSortConditions"
|
|
419
|
+
:additional-filter-conditions="additionalFilterConditions" -->
|