quasar-factory-lib 0.0.70 → 0.0.72

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.70",
100
+ "version": "0.0.72",
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,8 +173,8 @@ 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
180
  if (col.field === 'btnStart') {
@@ -183,6 +183,17 @@ export default {
183
183
  return tablePropsData.row.btnPauseDisabled
184
184
  } else {
185
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'
186
197
  }
187
198
  }
188
199
  }
@@ -120,7 +120,7 @@
120
120
  <CustomizedButton
121
121
  v-if="col.showCustomizedButton"
122
122
  :data-cy="col.colButtonDataCy + '-' + tablePropsData.row.id"
123
- :btn-color="col.btnColor || 'primary'"
123
+ :btn-color="getButtonColor(tablePropsData, col)"
124
124
  :btn-icon="col.btnIcon|| ''"
125
125
  :btn-disable="getBtnDisabled(tablePropsData, col)"
126
126
  @on-click-button="() => {
@@ -229,6 +229,17 @@ export default {
229
229
  } else {
230
230
  return false
231
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'
242
+ }
232
243
  }
233
244
  }
234
245
  }
@@ -13,7 +13,7 @@
13
13
  :rows="rows"
14
14
  :columns="columns"
15
15
  :visible-columns="store.visiblecolumns"
16
- :small-device="false"
16
+ :small-device="true"
17
17
  :store="store"
18
18
  :table-style="tableStyle"
19
19
  :show-skeleton="showSkeleton"
@@ -119,7 +119,7 @@ export default {
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',
@@ -131,7 +131,7 @@ export default {
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',
@@ -393,7 +393,10 @@ export default {
393
393
  iconWithToolTipColor: this.getBadgeColor(lista[i].carbs),
394
394
  iconWithToolTipName: this.getIconWithToolTipName(lista[i].carbs),
395
395
  btnStartDisabled: this.getBtnDisable2(lista[i]),
396
- btnPauseDisabled: this.getBtnDisable(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
  },