quasar-factory-lib 0.0.26 → 0.0.28

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
@@ -3,7 +3,7 @@
3
3
  "@quasar/extras": "^1.16.11",
4
4
  "global": "^4.4.0",
5
5
  "pinia": "^3.0.1",
6
- "quasar": "^2.17.0",
6
+ "quasar": "^2.18.0",
7
7
  "vue": "^3.5.11",
8
8
  "vue-i18n": "^10.0.4"
9
9
  },
@@ -97,6 +97,6 @@
97
97
  "release": "standard-version"
98
98
  },
99
99
  "type": "module",
100
- "version": "0.0.26",
100
+ "version": "0.0.28",
101
101
  "author": ""
102
102
  }
@@ -56,7 +56,7 @@
56
56
  :small-device="smallDevice"
57
57
  />
58
58
  </template>
59
- <template #body="props">
59
+ <!-- <template #body="props">
60
60
  <TableSlotBody
61
61
  v-if="!showSkeleton"
62
62
  :table-props="props"
@@ -67,7 +67,7 @@
67
67
  @on-click-button="onClickButton"
68
68
  @click="onRowClick(props.row)"
69
69
  />
70
- </template>
70
+ </template> -->
71
71
  <template #item="props">
72
72
  <TableSlotGrid
73
73
  :table-props="props"
@@ -95,7 +95,7 @@
95
95
  import { defineComponent } from 'vue'
96
96
  import TableSlotHeader from './components/TableSlotHeader.vue'
97
97
  import TableColumnsSelector from './components/TableColumnsSelector.vue'
98
- import TableSlotBody from './components/TableSlotBody.vue'
98
+ // import TableSlotBody from './components/TableSlotBody.vue'
99
99
  import TableSlotGrid from './components/TableSlotGrid.vue'
100
100
  import TableFilter from './components/TableFilter.vue'
101
101
  import TableSort from './utils/sort.js'
@@ -106,7 +106,7 @@ export default defineComponent({
106
106
  components: {
107
107
  TableSlotHeader,
108
108
  TableColumnsSelector,
109
- TableSlotBody,
109
+ // TableSlotBody,
110
110
  TableSlotGrid,
111
111
  TableFilter,
112
112
  TableSkeleton,
@@ -20,13 +20,14 @@
20
20
  :style="tablePropsData.row.tdStyle"
21
21
  >
22
22
  <span
23
+ :style="tableProps.row.rowStyleFn(col.name, tableProps.row.name)"
23
24
  v-if="getColumnValue(col)"
24
25
  v-html="tableProps.row[col.name]"
25
- />
26
+ ></span>
26
27
  <!-- fa-solid fa-pen-to-square -->
27
28
  <q-icon
28
29
  v-if="col.editable"
29
- name="edit"
30
+ name="fa-solid fa-pen-to-square "
30
31
  color="primary"
31
32
  size="sm"
32
33
  class="cursor-pointer"
@@ -39,6 +39,7 @@
39
39
  <q-item-label
40
40
  v-if="getColumnValue(col)"
41
41
  class="itemsFontSize text-almost-black"
42
+ :style="tableProps.row.rowStyleFn(col.name, tableProps.row.name)"
42
43
  >
43
44
  <q-icon
44
45
  v-if="col.editable"
@@ -9,6 +9,7 @@
9
9
  v-if="selectionType == 'multiple'"
10
10
  v-model="tablePropsData.selected"
11
11
  size="sm"
12
+ class="float-left"
12
13
  />
13
14
  </q-th>
14
15
  <q-th
@@ -2,12 +2,12 @@
2
2
  <div id="taskNavBar">
3
3
  <q-toolbar class="q-toolbar-unset-height">
4
4
  <div class="row full-width">
5
- <div class="col-6">
5
+ <div class="col-8">
6
6
  <img :src="logo" class="logo">
7
7
  <span id="mobile-title">{{ title }}</span>
8
8
  </div>
9
- <div class="col-6 text-right">
10
- <q-icon v-if="showBtnBack" size="md" @click="onClickBtnBack">
9
+ <div class="col-4 text-right">
10
+ <q-icon v-if="showBtnBack" size="md" class="cursor-pointer" @click="onClickBtnBack">
11
11
  <svg class="text-h4" xmlns="http://www.w3.org/2000/svg" width="30" height="30"
12
12
  viewBox="0 0 23.648 22.836">
13
13
  <g id="Arrow_brand" data-name="Arrow brand" transform="translate(0 22.836) rotate(-90)">
@@ -17,10 +17,15 @@
17
17
  </g>
18
18
  </svg>
19
19
  </q-icon>
20
- <q-icon v-if="showBtnSearch" color="primary" name="search" size="md" class="q-ml-md" @click="onClickBtnSearch">
20
+ <q-icon
21
+ v-if="showBtnSearch"
22
+ color="primary"
23
+ :name="showIconSearch ?'search' : 'search_off'"
24
+ size="md"
25
+ class="q-ml-md cursor-pointer"
26
+ @click="onClickBtnSearch">
21
27
  </q-icon>
22
-
23
- <q-icon id="iconMenu" size="md" @click="onClickBtnMenu" class="q-ml-md">
28
+ <q-icon id="iconMenu" size="md" @click="onClickBtnMenu" class="q-ml-md cursor-pointer">
24
29
  <svg xmlns="http://www.w3.org/2000/svg" width="30.448" height="28.247" viewBox="0 0 30.448 28.247">
25
30
  <g id="Componente_11_3" data-name="Componente 11 – 3" transform="translate(0 1)">
26
31
  <path id="Caminho_702" data-name="Caminho 702" d="M38.053,40.174H24"
@@ -53,6 +58,7 @@ export default defineComponent({
53
58
  data() {
54
59
  return {
55
60
  date,
61
+ showIconSearch: true,
56
62
  rightDrawerOpen: false
57
63
  }
58
64
  },
@@ -81,6 +87,7 @@ export default defineComponent({
81
87
  console.log('menu')
82
88
  },
83
89
  onClickBtnSearch() {
90
+ this.showIconSearch = !this.showIconSearch
84
91
  this.$emit('onClickBtnSearch')
85
92
  console.log('search')
86
93
  },
@@ -1,7 +1,7 @@
1
1
  #taskNavBar .logo {
2
2
  display: block;
3
3
  width: 125px;
4
- height: 50px;
4
+ height: auto;
5
5
  background-position: center;
6
6
  background-repeat: no-repeat;
7
7
  background-size: contain;
package/src/css/app.css CHANGED
@@ -37,4 +37,15 @@
37
37
  .q-toolbar-unset-height .q-toolbar {
38
38
  min-height: unset;
39
39
  padding: 0;
40
+ }
41
+
42
+ .text-color-positive {
43
+ color: var(--positive);
44
+ }
45
+
46
+ .bg-negative {
47
+ background-color: var(--negative);
48
+ }
49
+ .bg-positive {
50
+ background-color: var(--positive);
40
51
  }
@@ -11,7 +11,7 @@
11
11
  :rows="rows"
12
12
  :columns="columns"
13
13
  :visible-columns="visibleColumns"
14
- :small-device="false"
14
+ :small-device="true"
15
15
  :store="store"
16
16
  :table-style="tableStyle"
17
17
  :show-skeleton="false"
@@ -23,30 +23,12 @@
23
23
  @on-update-customized-checkbox-value="onUpdateCustomizedCheckboxValue"
24
24
  @on-click-button="setItemNotFound"
25
25
  />
26
- <q-dialog v-model="showDialog" >
27
- <div>
28
- <q-btn @click="close">Close</q-btn>
29
- <Table
30
- :rows="rows"
31
- :columns="columns"
32
- :visible-columns="visibleColumns"
33
- :small-device="false"
34
- :store="store"
35
- :table-style="tableStyle"
36
- :show-skeleton="false"
37
- :selection-type="'multiple'"
38
- :filter-method="filterMethod"
39
- :filter-computed="filter"
40
- />
41
- </div>
42
- </q-dialog>
43
26
  </div>
44
27
  </q-page>
45
28
  </q-page-container>
46
29
  </template>
47
30
  <script lang="ts">
48
31
  import Table from '../components/Table/Table.vue'
49
- // import rows from '../testData.js'
50
32
  import setTableHeight from '../components/Table/utils/setTableHeight'
51
33
  import infiniteScroll from '../components/Table/utils/infiniteScroll'
52
34
  import FilterMethod from '../components/Table/utils/filterMethod'
@@ -68,11 +50,13 @@ export default {
68
50
  required: true,
69
51
  label: 'Dessert (100g serving)',
70
52
  align: 'left',
71
- sortable: true
53
+ sortable: true,
54
+ tdStyle: (row: { tdStyle: string }) => row.tdStyle,
55
+ rowStyleFn: (row: { rowStyleFn: string }) => row.rowStyleFn,
72
56
  },
73
57
  {
74
58
  name: 'available',
75
- required: true,
59
+ required: false,
76
60
  label: 'Available',
77
61
  align: 'left',
78
62
  sortable: true,
@@ -97,7 +81,8 @@ export default {
97
81
  popupEditEmit: 'onSaveValuePopupEdit',
98
82
  popupEditInputtype: 'number',
99
83
  popupEditDataCy: '',
100
- popupEditMask: '#####'
84
+ popupEditMask: '#####',
85
+ tdStyle: (row: { tdStyle: string }) => row.tdStyle,
101
86
  },
102
87
  {
103
88
  name: 'fat',
@@ -120,7 +105,7 @@ export default {
120
105
  label: 'Checked',
121
106
  field: 'carbs',
122
107
  sortable: true,
123
- required: true,
108
+ required: false,
124
109
  showCustomizedCheckBox: true,
125
110
  checkedIcon: 'check_circle',
126
111
  uncheckedIcon: 'cancel',
@@ -133,7 +118,7 @@ export default {
133
118
  label: 'Protein (g)',
134
119
  field: 'protein',
135
120
  sortable: true,
136
- required: true,
121
+ required: false,
137
122
  editable: true,
138
123
  showEditIcon: true,
139
124
  popupEditEmit: 'onSaveValuePopupEdit',
@@ -310,10 +295,44 @@ export default {
310
295
  this.store.cleanTableFilter()
311
296
  this.tableStyle = setTableHeight.setTableHeight()
312
297
  infiniteScroll.handleInfiniteScrollNewTable(this)
313
- this.rows = this.rowsData
298
+ // this.rows = this.rowsData
314
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
315
328
  },
316
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
+ },
317
336
  saveSelectedColumns (columns: string []): void {
318
337
  this.store.visiblecolumns = columns
319
338
  this.visibleColumns = columns
@@ -329,12 +348,6 @@ export default {
329
348
  },
330
349
  setItemNotFound (rows: object []) {
331
350
  console.log(rows, 'onClickButton')
332
- this.showDialog = true
333
- this.store.lastFilterValue = this.store.filterValue
334
- },
335
- close () {
336
- this.showDialog= false
337
- this.store.filterValue = this.store.lastFilterValue
338
351
  }
339
352
  }
340
353
  }