quasar-factory-lib 0.0.69 → 0.0.71

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.69",
100
+ "version": "0.0.71",
101
101
  "author": ""
102
102
  }
@@ -90,7 +90,7 @@
90
90
  <CustomizedButton
91
91
  v-if="col.showCustomizedButton"
92
92
  :data-cy="col.colButtonDataCy + '-' + tablePropsData.row.id"
93
- :btn-color="col.btnColor || 'primary'"
93
+ :btn-color="getButtonColor(tablePropsData, col)"
94
94
  :btn-icon="col.btnIcon|| ''"
95
95
  :btn-disable="getBtnDisabled(tablePropsData, col)"
96
96
  @on-click-button="() => {
@@ -173,27 +173,29 @@ export default {
173
173
  }
174
174
  },
175
175
  methods: {
176
- getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean, showBadge: boolean, showIconWithToolTip: boolean }): boolean {
177
- return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton || col.showBadge || col.showIconWithToolTip)
176
+ getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean, showBadge: boolean, showIconWithToolTip: boolean, showCustomizedButton: boolean }): boolean {
177
+ return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton || col.showBadge || col.showIconWithToolTip || col.showCustomizedButton)
178
178
  },
179
179
  getBtnDisabled(tablePropsData, col) {
180
- const disableFieldMap = {
181
- btnStartDisabled: 'btnStartDisabled',
182
- btnPauseDisabled: 'btnPauseDisabled',
183
- btnFinishDisabled: 'btnFinishDisabled'
180
+ if (col.field === 'btnStart') {
181
+ return tablePropsData.row.btnStartDisabled
182
+ } else if (col.field === 'btnPause') {
183
+ return tablePropsData.row.btnPauseDisabled
184
+ } else {
185
+ return false
186
+ }
187
+ },
188
+ getButtonColor (tablePropsData, col, ):string {
189
+ if (col.btnColor) {
190
+ return col.btnColor
191
+ } else if (col.field === 'btnStart') {
192
+ return tablePropsData.row.btnColorCaseStart
193
+ } else if (col.field === 'btnPause') {
194
+ return tablePropsData.row.btnColorCasePause
195
+ } else {
196
+ return 'primary'
184
197
  }
185
- const field = disableFieldMap[col.field]
186
- return field ? tablePropsData.row[field] : false
187
198
  }
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
- // }
197
199
  }
198
200
  }
199
201
  </script>
@@ -222,13 +222,24 @@ export default {
222
222
  return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton || col.showBadge || col.showIconWithToolTip || col.showCustomizedButton)
223
223
  },
224
224
  getBtnDisabled(tablePropsData, col) {
225
- const disableFieldMap = {
226
- btnStartDisabled: 'btnStartDisabled',
227
- btnPauseDisabled: 'btnPauseDisabled',
228
- btnFinishDisabled: 'btnFinishDisabled'
225
+ if (col.field === 'btnStart') {
226
+ return tablePropsData.row.btnStartDisabled
227
+ } else if (col.field === 'btnPause') {
228
+ return tablePropsData.row.btnPauseDisabled
229
+ } else {
230
+ return false
231
+ }
232
+ },
233
+ getButtonColor (tablePropsData, col, ):string {
234
+ if (col.btnColor) {
235
+ return col.btnColor
236
+ } else if (col.field === 'btnStart') {
237
+ return tablePropsData.row.btnColorCaseStart
238
+ } else if (col.field === 'btnPause') {
239
+ return tablePropsData.row.btnColorCasePause
240
+ } else {
241
+ return 'primary'
229
242
  }
230
- const field = disableFieldMap[col.field]
231
- return field ? tablePropsData.row[field] : false
232
243
  }
233
244
  }
234
245
  }
@@ -112,26 +112,26 @@ export default {
112
112
  {
113
113
  name: 'fat',
114
114
  label: 'Fat (g)',
115
- field: 'fat',
115
+ field: 'btnPause',
116
116
  sortable: true,
117
117
  align: 'left',
118
118
  showCustomizedButton: true,
119
119
  btnIcon: 'save',
120
120
  btnEmit: 'onClickButton',
121
121
  dataCy: 'onClickButton',
122
- btnColor: 'primary'
122
+ // btnColor: 'primary'
123
123
  },
124
124
  {
125
125
  name: 'fat2',
126
126
  label: 'Fat 2',
127
- field: 'fat2',
127
+ field: 'btnStart',
128
128
  sortable: true,
129
129
  align: 'left',
130
130
  showCustomizedButton: true,
131
131
  btnIcon: 'save',
132
132
  btnEmit: 'onClickButton',
133
133
  dataCy: 'onClickButton',
134
- btnColor: 'secondary',
134
+ // btnColor: 'secondary'
135
135
  },
136
136
  {
137
137
  name: 'carbs',
@@ -392,8 +392,11 @@ export default {
392
392
  toolTipText: this.getBadgeText(lista[i].carbs),
393
393
  iconWithToolTipColor: this.getBadgeColor(lista[i].carbs),
394
394
  iconWithToolTipName: this.getIconWithToolTipName(lista[i].carbs),
395
- btnDisable: this.getBtnDisable(lista[i]),
396
- btnDisable2: this.getBtnDisable2(lista[i]),
395
+ btnStartDisabled: this.getBtnDisable2(lista[i]),
396
+ btnPauseDisabled: this.getBtnDisable(lista[i]),
397
+ btnColorCaseStart: this.getBtnColorCaseStart(lista[i]),
398
+ btnColorCasePause: this.getBtnColorCasePause(lista[i]),
399
+
397
400
  }
398
401
 
399
402
  this.rows.push(rows)
@@ -409,6 +412,12 @@ export default {
409
412
  getBadgeText (carbs: number) {
410
413
  return carbs > 50 ? 'header.hello': 'global.total'
411
414
  },
415
+ getBtnColorCaseStart (row) {
416
+ return row.fat > 10 ? 'amber': 'black'
417
+ },
418
+ getBtnColorCasePause (row) {
419
+ return row.fat >= 20 ? 'green': 'purple'
420
+ },
412
421
  getBtnDisable (row) {
413
422
  return row.fat > 10
414
423
  },