quasar-factory-lib 0.0.50 → 0.0.51

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 CHANGED
@@ -97,6 +97,6 @@
97
97
  "release": "standard-version"
98
98
  },
99
99
  "type": "module",
100
- "version": "0.0.50",
100
+ "version": "0.0.51",
101
101
  "author": ""
102
102
  }
@@ -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 together
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.store, this.filteredRows, rows);
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.store, this.rows, filteredRows_)
402
+ filteredRows_ = this.additionalFilterConditions(this.rows, filteredRows_)
406
403
  }
407
404
  this.filteredRows = filteredRows_
408
405
  return filteredRows_.slice(0, this.pageLength)
@@ -28,17 +28,17 @@
28
28
  :key="col.name"
29
29
  >
30
30
  <q-item-section>
31
- <q-item-label class="itemsFontSize ellipsis text-light-gray">
31
+ <q-item-label class="itemsFontSize ellipsis text-color-lightGray">
32
32
  {{
33
33
  col.label
34
- }}
34
+ }}xxxxx
35
35
  </q-item-label>
36
36
  </q-item-section>
37
37
 
38
38
  <q-item-section side>
39
39
  <q-item-label
40
40
  v-if="getColumnValue(col)"
41
- class="itemsFontSize text-almost-black"
41
+ class="itemsFontSize text-color-almostBlack"
42
42
  :class="getCellClass(tablePropsData.row, col)"
43
43
  >
44
44
  <q-icon
@@ -50,6 +50,9 @@
50
50
  font-weight: bold;
51
51
  color: var(--black);
52
52
  }
53
+ .my-table .itemsFontSize{
54
+ font-size: 14px;
55
+ }
53
56
  @media only screen and (max-width: 1100px) {
54
57
  .my-table .q-table__grid-content {
55
58
  overflow: auto;
@@ -1,14 +1,15 @@
1
1
  const utils = {
2
2
  setTableHeight ():string {
3
- const footer = document.getElementsByClassName('q-footer')[0]
4
- let footerHeight = ''
5
- if (footer) {
6
- const computedHeight = window.getComputedStyle(footer).height
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
- footerHeight = computedHeight.replace('px', '')
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,7 @@ const utils = {
18
19
  headerHeight = computedHeight.replace('px', '')
19
20
  }
20
21
  }
21
- const n = Number(footerHeight) + Number(headerHeight)
22
+ const n = Number(footerHeightHeight) + Number(headerHeight)
22
23
  return `height:${window.innerHeight - n}px`
23
24
  }
24
25
  }
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-light-gray {
34
+ .text-color-lightGray {
35
35
  color: var(--light-gray);
36
36
  }
37
- .text-color-almost-black {
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 class=" full-width column justify-center">
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="false"
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 {
@@ -7,8 +7,8 @@
7
7
  <div
8
8
  class="full-width"
9
9
  >
10
- {{ store.prepared }}
11
- <q-btn @click="store.prepared = !store.prepared">Click</q-btn>
10
+ <!-- {{ store.prepared }}
11
+ <q-btn @click="store.prepared = !store.prepared">Click</q-btn> -->
12
12
  <Table
13
13
  ref="table"
14
14
  :rows="rows"
@@ -20,9 +20,6 @@
20
20
  :show-skeleton="false"
21
21
  :selection-type="'multiple'"
22
22
  :getCellClass="getCellClass"
23
- :filterComputedOptions="{ preparedQuantity: store.prepared}"
24
- :additionalSortConditions="additionalSortConditions"
25
- :additional-filter-conditions="additionalFilterConditions"
26
23
  @on-select-visible-columns="saveSelectedColumns"
27
24
  @on-update-basic-checkbox-value="onUpdateBasicCheckboxValue"
28
25
  @on-update-customized-checkbox-value="onUpdateCustomizedCheckboxValue"
@@ -36,7 +33,7 @@
36
33
  import Table from '../components/Table/Table.vue'
37
34
  import setTableHeight from '../components/Table/utils/setTableHeight'
38
35
  import infiniteScroll from '../components/Table/utils/infiniteScroll'
39
- import FilterMethod from '../components/Table/utils/filterMethod'
36
+ // import FilterMethod from '../components/Table/utils/filterMethod'
40
37
  // import TableSort from '../components/Table/utils/sort.js'
41
38
  import { tableStore } from '../store/table.js'
42
39
  export default {
@@ -364,9 +361,6 @@ export default {
364
361
  this.store.visiblecolumns = columns
365
362
  this.visibleColumns = columns
366
363
  },
367
- filterMethod (rows: string | [], terms: { search: string }): object[] | [] {
368
- return FilterMethod.filter(this, rows, terms)
369
- },
370
364
  onUpdateBasicCheckboxValue (rows: object []) {
371
365
  console.log(rows, 'onUpdateBasicCheckboxValue')
372
366
  },
@@ -376,25 +370,16 @@ export default {
376
370
  setItemNotFound (rows: object []) {
377
371
  console.log(rows, 'onClickButton')
378
372
  },
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
373
  getCellClass (row, col) {
389
374
  if (col.name === 'dessert' && row.dessert === 'Frozen Yogurt') {
390
375
  return 'text-color-negative-bold';
391
376
  }
392
377
  return '';
393
378
  },
394
- additionalFilterConditions (store_: { prepared: boolean }, rows_: object[] | [], filteredRowsParam_: object[] | []) {
379
+ additionalFilterConditions (rows_: object[] | [], filteredRowsParam_: object[] | []) {
395
380
  console.log('additional filter conditions')
396
381
  filteredRowsParam_ = []
397
- if (store_.prepared) {
382
+ if (this.store.prepared) {
398
383
  for (let i = 0; i < rows_.length; i++) {
399
384
  if (rows_[i].sodium >= 300) {
400
385
  filteredRowsParam_.push(rows_[i])
@@ -405,9 +390,9 @@ export default {
405
390
  return rows_
406
391
  }
407
392
  },
408
- additionalSortConditions (store_, filteredRowsData, rows) {
393
+ additionalSortConditions (filteredRowsData: object[] | [], rows: object[] | []) {
409
394
  console.log('conditions sort function')
410
- if (store_.prepared) {
395
+ if (this.store.prepared) {
411
396
 
412
397
  const filteredRows_ = []
413
398
  for (let i = 0; i < rows.length; i++) {
@@ -418,10 +403,13 @@ export default {
418
403
  filteredRowsData = filteredRows_
419
404
  return [...filteredRowsData]
420
405
  }
421
- else if (!store_.prepared) {
406
+ else if (!this.store.prepared) {
422
407
  return [...rows]
423
408
  }
424
409
  }
425
410
  }
426
411
  }
427
412
  </script>
413
+ <!-- :filterComputedOptions="{ preparedQuantity: store.prepared}"
414
+ :additional-sort-conditions="additionalSortConditions"
415
+ :additional-filter-conditions="additionalFilterConditions" -->