quasar-factory-lib 0.0.68 → 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.68",
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
- :btn-color="col.btnColor || tablePropsData.row.btnColor || 'primary'"
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>
@@ -120,9 +120,9 @@
120
120
  <CustomizedButton
121
121
  v-if="col.showCustomizedButton"
122
122
  :data-cy="col.colButtonDataCy + '-' + tablePropsData.row.id"
123
- :btn-color="col.btnColor || tablePropsData.row.btnColor || 'primary'"
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
  }
@@ -119,8 +119,19 @@ export default {
119
119
  btnIcon: 'save',
120
120
  btnEmit: 'onClickButton',
121
121
  dataCy: 'onClickButton',
122
- btnColor: 'black',
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,20 +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
- // btnColor: this.getBadgeColor(lista[i].carbs),
379
- btnDisable: this.getBtnDisable(lista[i].carbs),
380
390
  badgeColor: this.getBadgeColor(lista[i].carbs),
381
391
  badgeText: this.getBadgeText(lista[i].carbs),
382
392
  toolTipText: this.getBadgeText(lista[i].carbs),
383
393
  iconWithToolTipColor: this.getBadgeColor(lista[i].carbs),
384
- iconWithToolTipName: this.getIconWithToolTipName(lista[i].carbs)
385
- })
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)
386
400
  }
387
401
  setTimeout(() => {
388
402
  this.showSkeleton = false
@@ -395,8 +409,11 @@ export default {
395
409
  getBadgeText (carbs: number) {
396
410
  return carbs > 50 ? 'header.hello': 'global.total'
397
411
  },
398
- getBtnDisable (carbs: number) {
399
- return carbs > 50
412
+ getBtnDisable (row) {
413
+ return row.fat > 10
414
+ },
415
+ getBtnDisable2 (row) {
416
+ return row.calories > 300
400
417
  },
401
418
  getIconWithToolTipName (carbs: number) {
402
419
  return carbs > 50 ? 'warning': 'home'