quasar-factory-lib 0.0.37 → 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.
@@ -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>
@@ -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'
@@ -162,6 +144,7 @@ export default {
162
144
  rows: [],
163
145
  rowsData: [
164
146
  {
147
+ tdStyle: "color: #597765 !important; font-weight: bold;",
165
148
  name: 'Frozen Yogurt',
166
149
  booleanIcon: true,
167
150
  available: true,
@@ -329,12 +312,6 @@ export default {
329
312
  },
330
313
  setItemNotFound (rows: object []) {
331
314
  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
315
  }
339
316
  }
340
317
  }
@@ -21,6 +21,10 @@ const routes: RouteRecordRaw[] = [
21
21
  path: '/navBarPage',
22
22
  component: () => import('../pages/NavBarPage.vue')
23
23
  },
24
+ {
25
+ path: '/pdaLayout',
26
+ component: () => import('../layouts/PdaLayout.vue')
27
+ }
24
28
  ]
25
29
 
26
30
  export default routes
@@ -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('counter', false),
5
+ disableScannerButtons: useStorage('disableScannerButtons', false),
6
6
  filterValue: useStorage('filterValue', ''),
7
7
  lastFilterValue: useStorage('lastFilterValue', ''),
8
8
  visiblecolumns: useStorage('visiblecolumns', [])
@@ -3,7 +3,6 @@
3
3
  const infiniteScroll = {
4
4
  handleInfiniteScrollNewTable (self: { $nextTick: (arg0: () => void) => void; totalPageModal: number; smallDevice: boolean, totalPage: number }): void {
5
5
  self.$nextTick(() => {
6
- console.log('aqui')
7
6
  const elemClass = self.smallDevice ? 'q-table__grid-content' : 'q-table__middle scroll'
8
7
  const tableType = self.smallDevice ? 'Grid' : 'Table'
9
8
  const qtableScrollElem = document.getElementsByClassName(elemClass) as HTMLCollectionOf<HTMLElement>