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/dist/components/Table/Table.vue.d.ts +3 -0
- package/dist/components/Table/components/TableSlotBody.vue.d.ts +2 -0
- package/dist/components/Table/components/TableSlotGrid.vue.d.ts +1 -0
- package/dist/layouts/PdaLayout.vue.d.ts +3 -0
- package/dist/pages/TablePage.vue.d.ts +5 -10
- package/dist/quasar-factory-lib.js +1247 -1259
- package/dist/quasar-factory-lib.umd.cjs +8 -8
- package/package.json +1 -1
- package/src/components/Table/components/TableSlotBody.vue +20 -18
- package/src/components/Table/components/TableSlotGrid.vue +17 -6
- package/src/pages/TablePage.vue +15 -6
package/package.json
CHANGED
|
@@ -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
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
}
|
package/src/pages/TablePage.vue
CHANGED
|
@@ -112,26 +112,26 @@ export default {
|
|
|
112
112
|
{
|
|
113
113
|
name: 'fat',
|
|
114
114
|
label: 'Fat (g)',
|
|
115
|
-
field: '
|
|
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: '
|
|
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
|
-
|
|
396
|
-
|
|
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
|
},
|