quasar-factory-lib 0.0.67 → 0.0.69

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.67",
100
+ "version": "0.0.69",
101
101
  "author": ""
102
102
  }
@@ -87,13 +87,12 @@
87
87
  :customized-icon-name="(tablePropsData.row[col.name] ? col.customizedIconNameCaseTrue : col.customizedIconNameCaseFalse) || ''"
88
88
  :customized-icon-color="(tablePropsData.row[col.name] ? col.customizedIconColorCaseTrue : col.customizedIconColorCaseFalse) || ''"
89
89
  />
90
-
91
90
  <CustomizedButton
92
91
  v-if="col.showCustomizedButton"
93
92
  :data-cy="col.colButtonDataCy + '-' + tablePropsData.row.id"
94
93
  :btn-color="col.btnColor || 'primary'"
95
94
  :btn-icon="col.btnIcon|| ''"
96
- :btn-disable="tablePropsData.row.btnDisable"
95
+ :btn-disable="getBtnDisabled(tablePropsData, col)"
97
96
  @on-click-button="() => {
98
97
  $emit('onClickButton', col.btnEmit, tablePropsData.row)
99
98
  }"
@@ -176,7 +175,25 @@ export default {
176
175
  methods: {
177
176
  getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean, showBadge: boolean, showIconWithToolTip: boolean }): boolean {
178
177
  return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton || col.showBadge || col.showIconWithToolTip)
178
+ },
179
+ getBtnDisabled(tablePropsData, col) {
180
+ const disableFieldMap = {
181
+ btnStartDisabled: 'btnStartDisabled',
182
+ btnPauseDisabled: 'btnPauseDisabled',
183
+ btnFinishDisabled: 'btnFinishDisabled'
184
+ }
185
+ const field = disableFieldMap[col.field]
186
+ return field ? tablePropsData.row[field] : false
179
187
  }
188
+ // getBtnDisabled(tablePropsData, col) {
189
+ // const disableFieldMap = {
190
+ // fat: 'btnDisable',
191
+ // fat2: 'btnDisable2'
192
+ // }
193
+
194
+ // const field = disableFieldMap[col.field]
195
+ // return field ? tablePropsData.row[field] : false
196
+ // }
180
197
  }
181
198
  }
182
199
  </script>
@@ -122,7 +122,7 @@
122
122
  :data-cy="col.colButtonDataCy + '-' + tablePropsData.row.id"
123
123
  :btn-color="col.btnColor || 'primary'"
124
124
  :btn-icon="col.btnIcon|| ''"
125
- :btn-disable="tablePropsData.row.btnDisable"
125
+ :btn-disable="getBtnDisabled(tablePropsData, col)"
126
126
  @on-click-button="() => {
127
127
  $emit('onClickButton', col.btnEmit, tablePropsData.row)
128
128
  }"
@@ -220,6 +220,15 @@ export default {
220
220
  methods: {
221
221
  getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean, showBadge: boolean, showIconWithToolTip: boolean, showCustomizedButton: boolean }): boolean {
222
222
  return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton || col.showBadge || col.showIconWithToolTip || col.showCustomizedButton)
223
+ },
224
+ getBtnDisabled(tablePropsData, col) {
225
+ const disableFieldMap = {
226
+ btnStartDisabled: 'btnStartDisabled',
227
+ btnPauseDisabled: 'btnPauseDisabled',
228
+ btnFinishDisabled: 'btnFinishDisabled'
229
+ }
230
+ const field = disableFieldMap[col.field]
231
+ return field ? tablePropsData.row[field] : false
223
232
  }
224
233
  }
225
234
  }
@@ -13,7 +13,7 @@
13
13
  :rows="rows"
14
14
  :columns="columns"
15
15
  :visible-columns="store.visiblecolumns"
16
- :small-device="true"
16
+ :small-device="false"
17
17
  :store="store"
18
18
  :table-style="tableStyle"
19
19
  :show-skeleton="showSkeleton"
@@ -119,8 +119,19 @@ export default {
119
119
  btnIcon: 'save',
120
120
  btnEmit: 'onClickButton',
121
121
  dataCy: 'onClickButton',
122
- btnColor: 'primary',
123
- btnDisable: (row: { btnDisable: string }) => row.btnDisable
122
+ btnColor: 'primary'
123
+ },
124
+ {
125
+ name: 'fat2',
126
+ label: 'Fat 2',
127
+ field: 'fat2',
128
+ sortable: true,
129
+ align: 'left',
130
+ showCustomizedButton: true,
131
+ btnIcon: 'save',
132
+ btnEmit: 'onClickButton',
133
+ dataCy: 'onClickButton',
134
+ btnColor: 'secondary',
124
135
  },
125
136
  {
126
137
  name: 'carbs',
@@ -360,7 +371,7 @@ export default {
360
371
  this.rows = []
361
372
  const lista = this.rowsData
362
373
  for (let i = 0; i < lista.length; i++) {
363
- this.rows.push({
374
+ const rows = {
364
375
  id: i + '-' + lista[i].dessert,
365
376
  date: lista[i].date,
366
377
  time: lista[i].time,
@@ -369,19 +380,23 @@ export default {
369
380
  available: lista[i].available,
370
381
  calories: lista[i].calories,
371
382
  fat: lista[i].fat,
383
+ fat2: lista[i].calories,
372
384
  carbs: lista[i].carbs,
373
385
  checked: lista[i].checked,
374
386
  protein: lista[i].protein,
375
387
  sodium: lista[i].sodium,
376
388
  calcium: lista[i].calcium,
377
389
  iron: lista[i].iron,
378
- btnDisable: this.getBtnDisable(lista[i].carbs),
379
390
  badgeColor: this.getBadgeColor(lista[i].carbs),
380
391
  badgeText: this.getBadgeText(lista[i].carbs),
381
392
  toolTipText: this.getBadgeText(lista[i].carbs),
382
393
  iconWithToolTipColor: this.getBadgeColor(lista[i].carbs),
383
- iconWithToolTipName: this.getIconWithToolTipName(lista[i].carbs)
384
- })
394
+ iconWithToolTipName: this.getIconWithToolTipName(lista[i].carbs),
395
+ btnDisable: this.getBtnDisable(lista[i]),
396
+ btnDisable2: this.getBtnDisable2(lista[i]),
397
+ }
398
+
399
+ this.rows.push(rows)
385
400
  }
386
401
  setTimeout(() => {
387
402
  this.showSkeleton = false
@@ -394,8 +409,11 @@ export default {
394
409
  getBadgeText (carbs: number) {
395
410
  return carbs > 50 ? 'header.hello': 'global.total'
396
411
  },
397
- getBtnDisable (carbs: number) {
398
- return carbs > 50
412
+ getBtnDisable (row) {
413
+ return row.fat > 10
414
+ },
415
+ getBtnDisable2 (row) {
416
+ return row.calories > 300
399
417
  },
400
418
  getIconWithToolTipName (carbs: number) {
401
419
  return carbs > 50 ? 'warning': 'home'