quasar-factory-lib 0.0.63 → 0.0.64
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/ConfirmedTask/ConfirmedTask.vue.d.ts +1 -0
- package/dist/components/Table/Table.vue.d.ts +207 -3
- package/dist/components/Table/components/CustomizedBadge.vue.d.ts +60 -0
- package/dist/components/Table/components/CustomizedButtonWithToolTip.vue.d.ts +38 -0
- package/dist/components/Table/components/TableSlotBody.vue.d.ts +100 -1
- package/dist/components/Table/components/TableSlotGrid.vue.d.ts +100 -1
- package/dist/layouts/PdaLayout.vue.d.ts +207 -3
- package/dist/pages/ConfirmedTaskPage.vue.d.ts +1 -0
- package/dist/pages/TablePage.vue.d.ts +376 -3
- package/dist/quasar-factory-lib.js +5618 -5253
- package/dist/quasar-factory-lib.umd.cjs +11 -11
- package/package.json +1 -1
- package/src/components/ConfirmedTask/ConfirmedTask.vue +6 -1
- package/src/components/Table/Table.vue +12 -1
- package/src/components/Table/components/CustomizedBadge.vue +48 -0
- package/src/components/Table/components/CustomizedButtonWithToolTip.vue +43 -0
- package/src/components/Table/components/TableSlotBody.vue +34 -4
- package/src/components/Table/components/TableSlotGrid.vue +33 -4
- package/src/layouts/MenuLayout.vue +0 -1
- package/src/layouts/PdaLayout.vue +1 -1
- package/src/pages/TablePage.vue +38 -4
package/package.json
CHANGED
|
@@ -77,7 +77,12 @@ export default defineComponent({
|
|
|
77
77
|
},
|
|
78
78
|
endTask () {
|
|
79
79
|
this.$emit('endTask')
|
|
80
|
-
}
|
|
80
|
+
},
|
|
81
|
+
showConfirmedTaskAnSetValues (total: number, selected: number): void {
|
|
82
|
+
this.alert = true
|
|
83
|
+
this.values.total = total
|
|
84
|
+
this.values.selected = selected
|
|
85
|
+
},
|
|
81
86
|
},
|
|
82
87
|
mounted () {}
|
|
83
88
|
})
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
@on-update-customized-checkbox-value="onUpdateCustomizedCheckboxValue"
|
|
67
67
|
@on-save-value-popup-edit="onSaveValuePopupEdit"
|
|
68
68
|
@on-click-button="onClickButton"
|
|
69
|
+
@on-click-button-with-tool-tip="onClickButtonWithToolTip"
|
|
69
70
|
@click="onRowClick(props.row)"
|
|
70
71
|
/>
|
|
71
72
|
</template>
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
@on-update-basic-checkbox-value="onUpdateBasicCheckboxValue"
|
|
81
82
|
@on-save-value-popup-edit="onSaveValuePopupEdit"
|
|
82
83
|
@on-click-button="onClickButton"
|
|
84
|
+
@on-click-button-with-tool-tip="onClickButtonWithToolTip"
|
|
83
85
|
@click="onRowClick(props.row)"
|
|
84
86
|
/>
|
|
85
87
|
</template>
|
|
@@ -194,7 +196,13 @@ export default defineComponent({
|
|
|
194
196
|
'deleteItem',
|
|
195
197
|
'openModalWithTable',
|
|
196
198
|
'setItemNotFound',
|
|
197
|
-
'
|
|
199
|
+
'onClickSeeTaskDetails',
|
|
200
|
+
'startMaintenanceTicket',
|
|
201
|
+
'pauseMaintenanceTicket',
|
|
202
|
+
'finishMaintenanceTicket',
|
|
203
|
+
'onRowClick',
|
|
204
|
+
'onClickButtonWithToolTip'
|
|
205
|
+
],
|
|
198
206
|
data () {
|
|
199
207
|
return {
|
|
200
208
|
selected: [],
|
|
@@ -266,6 +274,9 @@ export default defineComponent({
|
|
|
266
274
|
onClickButton (emit: 'onClickButton', row: object) {
|
|
267
275
|
this.$emit(emit, row)
|
|
268
276
|
},
|
|
277
|
+
onClickButtonWithToolTip (row: object) {
|
|
278
|
+
this.$emit('onClickButtonWithToolTip', row)
|
|
279
|
+
},
|
|
269
280
|
onRowClick (row: object) {
|
|
270
281
|
this.$emit('onRowClick', row)
|
|
271
282
|
},
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-badge
|
|
3
|
+
class="cursor-pointer"
|
|
4
|
+
:data-cy="'badge' + dataCy"
|
|
5
|
+
:color="badgeColor"
|
|
6
|
+
:text-color="badgeTextColor"
|
|
7
|
+
:outline="badgeOutline"
|
|
8
|
+
:rounded="badgeRounded"
|
|
9
|
+
:transparent="badgeTransparent"
|
|
10
|
+
>
|
|
11
|
+
{{ $t(badgeText) }}
|
|
12
|
+
</q-badge>
|
|
13
|
+
</template>
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export default {
|
|
16
|
+
name: 'CustomizedBadge',
|
|
17
|
+
props: {
|
|
18
|
+
dataCy: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
badgeText: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
badgeColor: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
badgeTextColor: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true
|
|
33
|
+
},
|
|
34
|
+
badgeOutline: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
required: true
|
|
37
|
+
},
|
|
38
|
+
badgeRounded: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
required: true
|
|
41
|
+
},
|
|
42
|
+
badgeTransparent: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
required: true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-btn
|
|
3
|
+
:data-cy="dataCy"
|
|
4
|
+
flat
|
|
5
|
+
round
|
|
6
|
+
:color="btnColor"
|
|
7
|
+
size="md"
|
|
8
|
+
@click="$emit('onClickButtonWithToolTip')"
|
|
9
|
+
>
|
|
10
|
+
<q-icon :name="btnIcon" />
|
|
11
|
+
<q-tooltip
|
|
12
|
+
anchor="top middle"
|
|
13
|
+
self="bottom middle"
|
|
14
|
+
:offset="[10, 10]"
|
|
15
|
+
>
|
|
16
|
+
{{ $t(toolTipText) }}
|
|
17
|
+
</q-tooltip>
|
|
18
|
+
</q-btn>
|
|
19
|
+
</template>
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
export default {
|
|
22
|
+
name: 'CustomizedButtonWithToolTip',
|
|
23
|
+
props: {
|
|
24
|
+
dataCy: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
btnColor: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
btnIcon: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
toolTipText: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
emits: ['onClickButtonWithToolTip']
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
@@ -97,6 +97,26 @@
|
|
|
97
97
|
$emit('onClickButton', col.btnEmit, tablePropsData.row)
|
|
98
98
|
}"
|
|
99
99
|
/>
|
|
100
|
+
<CustomizedButtonWithToolTip
|
|
101
|
+
v-if="col.showCustomizedButtonWithToolTip"
|
|
102
|
+
:data-cy="col.ButtonWithToolTip + '-' + tablePropsData.row.id"
|
|
103
|
+
:btn-color="tablePropsData.row.btnColor || 'primary'"
|
|
104
|
+
:btn-icon="col.btnIcon|| ''"
|
|
105
|
+
:toolTipText="tablePropsData.row.toolTipText || ''"
|
|
106
|
+
@on-click-button-with-tool-tip="() => {
|
|
107
|
+
$emit('onClickButtonWithToolTip', col.btnEmit, tablePropsData.row)
|
|
108
|
+
}"
|
|
109
|
+
/>
|
|
110
|
+
<CustomizedBadge
|
|
111
|
+
v-if="col.showBadge"
|
|
112
|
+
:data-cy="col.badgeDataCy + tablePropsData.row.id"
|
|
113
|
+
:badgeText="tablePropsData.row.badgeText"
|
|
114
|
+
:badgeColor="tablePropsData.row.badgeColor"
|
|
115
|
+
:badgeTextColor="col.badgeTextColor || 'primary'"
|
|
116
|
+
:badgeOutline="col.badgeOutline || false"
|
|
117
|
+
:badgeRounded="col.badgeRounded || false"
|
|
118
|
+
:badgeTransparent="col.badgeTransparent || false"
|
|
119
|
+
/>
|
|
100
120
|
</q-td>
|
|
101
121
|
</tr>
|
|
102
122
|
</template>
|
|
@@ -107,6 +127,8 @@ import BasicCheckBox from './BasicCheckBox.vue'
|
|
|
107
127
|
import CustomizedCheckBox from './CustomizedCheckBox.vue'
|
|
108
128
|
import CustomizedIcon from './CustomizedIcon.vue'
|
|
109
129
|
import CustomizedButton from './CustomizedButton.vue'
|
|
130
|
+
import CustomizedBadge from './CustomizedBadge.vue'
|
|
131
|
+
import CustomizedButtonWithToolTip from './CustomizedButtonWithToolTip.vue'
|
|
110
132
|
export default {
|
|
111
133
|
name: 'TableSlotBody',
|
|
112
134
|
components: {
|
|
@@ -115,7 +137,9 @@ export default {
|
|
|
115
137
|
BasicCheckBox,
|
|
116
138
|
CustomizedCheckBox,
|
|
117
139
|
CustomizedIcon,
|
|
118
|
-
CustomizedButton
|
|
140
|
+
CustomizedButton,
|
|
141
|
+
CustomizedBadge,
|
|
142
|
+
CustomizedButtonWithToolTip
|
|
119
143
|
},
|
|
120
144
|
props: {
|
|
121
145
|
tableProps: {
|
|
@@ -136,15 +160,21 @@ export default {
|
|
|
136
160
|
this.tablePropsData = val
|
|
137
161
|
}
|
|
138
162
|
},
|
|
139
|
-
emits: [
|
|
163
|
+
emits: [
|
|
164
|
+
'onSaveValuePopupEdit',
|
|
165
|
+
'onUpdateBasicCheckboxValue',
|
|
166
|
+
'onClickButton',
|
|
167
|
+
'onUpdateCustomizedCheckboxValue',
|
|
168
|
+
'onClickButtonWithToolTip'
|
|
169
|
+
],
|
|
140
170
|
data () {
|
|
141
171
|
return {
|
|
142
172
|
tablePropsData: this.tableProps
|
|
143
173
|
}
|
|
144
174
|
},
|
|
145
175
|
methods: {
|
|
146
|
-
getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean }): boolean {
|
|
147
|
-
return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton)
|
|
176
|
+
getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean, showBadge: boolean, showCustomizedButtonWithToolTip: boolean }): boolean {
|
|
177
|
+
return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton || col.showBadge || col.showCustomizedButtonWithToolTip)
|
|
148
178
|
}
|
|
149
179
|
}
|
|
150
180
|
}
|
|
@@ -127,7 +127,31 @@
|
|
|
127
127
|
}"
|
|
128
128
|
/>
|
|
129
129
|
</q-item-section>
|
|
130
|
+
<q-item-section>
|
|
131
|
+
<CustomizedButtonWithToolTip
|
|
132
|
+
v-if="col.showCustomizedButtonWithToolTip"
|
|
133
|
+
:data-cy="col.ButtonWithToolTip + '-' + tablePropsData.row.id"
|
|
134
|
+
:btn-color="tablePropsData.row.btnColor || 'primary'"
|
|
135
|
+
:btn-icon="col.btnIcon|| ''"
|
|
136
|
+
:toolTipText="tablePropsData.row.toolTipText || ''"
|
|
137
|
+
@on-click-button-with-tool-tip="() => {
|
|
138
|
+
$emit('onClickButtonWithToolTip', col.btnEmit, tablePropsData.row)
|
|
139
|
+
}"
|
|
140
|
+
/>
|
|
141
|
+
</q-item-section>
|
|
142
|
+
<q-item-section>
|
|
143
|
+
<CustomizedBadge
|
|
144
|
+
v-if="col.showBadge"
|
|
145
|
+
:data-cy="col.badgeDataCy + tablePropsData.row.id"
|
|
146
|
+
:badgeText="tablePropsData.row.badgeText"
|
|
147
|
+
:badgeColor="tablePropsData.row.badgeColor"
|
|
148
|
+
:badgeTextColor="col.badgeTextColor || 'primary'"
|
|
149
|
+
:badgeOutline="col.badgeOutline || false"
|
|
150
|
+
:badgeRounded="col.badgeRounded || false"
|
|
151
|
+
:badgeTransparent="col.badgeTransparent || false"
|
|
152
|
+
/>
|
|
130
153
|
</q-item-section>
|
|
154
|
+
</q-item-section>
|
|
131
155
|
</q-item>
|
|
132
156
|
</q-list>
|
|
133
157
|
</q-card>
|
|
@@ -140,6 +164,8 @@ import BasicCheckBox from './BasicCheckBox.vue'
|
|
|
140
164
|
import CustomizedCheckBox from './CustomizedCheckBox.vue'
|
|
141
165
|
import CustomizedIcon from './CustomizedIcon.vue'
|
|
142
166
|
import CustomizedButton from './CustomizedButton.vue'
|
|
167
|
+
import CustomizedBadge from './CustomizedBadge.vue'
|
|
168
|
+
import CustomizedButtonWithToolTip from './CustomizedButtonWithToolTip.vue'
|
|
143
169
|
|
|
144
170
|
export default {
|
|
145
171
|
name: 'TableSlotGrid',
|
|
@@ -149,7 +175,9 @@ export default {
|
|
|
149
175
|
BasicCheckBox,
|
|
150
176
|
CustomizedCheckBox,
|
|
151
177
|
CustomizedIcon,
|
|
152
|
-
CustomizedButton
|
|
178
|
+
CustomizedButton,
|
|
179
|
+
CustomizedBadge,
|
|
180
|
+
CustomizedButtonWithToolTip
|
|
153
181
|
},
|
|
154
182
|
props: {
|
|
155
183
|
tableProps: {
|
|
@@ -172,7 +200,8 @@ export default {
|
|
|
172
200
|
'onSaveValuePopupEdit',
|
|
173
201
|
'onUpdateBasicCheckboxValue',
|
|
174
202
|
'onClickButton',
|
|
175
|
-
'onUpdateCustomizedCheckboxValue'
|
|
203
|
+
'onUpdateCustomizedCheckboxValue',
|
|
204
|
+
'onClickButtonWithToolTip'
|
|
176
205
|
],
|
|
177
206
|
data () {
|
|
178
207
|
return {
|
|
@@ -187,8 +216,8 @@ export default {
|
|
|
187
216
|
},
|
|
188
217
|
mounted () {},
|
|
189
218
|
methods: {
|
|
190
|
-
getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean }): boolean {
|
|
191
|
-
return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton)
|
|
219
|
+
getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean, showBadge: boolean, showCustomizedButtonWithToolTip: boolean }): boolean {
|
|
220
|
+
return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton || col.showBadge || col.showCustomizedButtonWithToolTip)
|
|
192
221
|
}
|
|
193
222
|
}
|
|
194
223
|
}
|
package/src/pages/TablePage.vue
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
@on-update-basic-checkbox-value="onUpdateBasicCheckboxValue"
|
|
29
29
|
@on-update-customized-checkbox-value="onUpdateCustomizedCheckboxValue"
|
|
30
30
|
@on-click-button="setItemNotFound"
|
|
31
|
+
@onClickButtonWithToolTip="onClickBadge"
|
|
32
|
+
|
|
31
33
|
/>
|
|
32
34
|
</div>
|
|
33
35
|
</q-page>
|
|
@@ -88,7 +90,11 @@ export default {
|
|
|
88
90
|
label: 'Boolean Icon',
|
|
89
91
|
align: 'left',
|
|
90
92
|
sortable: true,
|
|
91
|
-
showCustomizedIcon: true
|
|
93
|
+
showCustomizedIcon: true,
|
|
94
|
+
customizedIconNameCaseTrue: 'done',
|
|
95
|
+
customizedIconNameCaseFalse: 'done_all',
|
|
96
|
+
customizedIconColorCaseTrue: 'yellow',
|
|
97
|
+
customizedIconColorCaseFalse: 'blue'
|
|
92
98
|
},
|
|
93
99
|
{
|
|
94
100
|
name: 'calories',
|
|
@@ -121,7 +127,14 @@ export default {
|
|
|
121
127
|
field: 'carbs',
|
|
122
128
|
align: 'left',
|
|
123
129
|
sortable: true,
|
|
124
|
-
format: (val: number) => `${val}
|
|
130
|
+
format: (val: number) => `${val}`,
|
|
131
|
+
showBadge: true,
|
|
132
|
+
badgeDataCy: 'badgeDataCy',
|
|
133
|
+
badgeEmit: 'onClickBadge',
|
|
134
|
+
badgeText: (row: { badgeText: string }) => row.badgeText,
|
|
135
|
+
badgeColor: (row: { badgeColor: string }) => row.badgeColor,
|
|
136
|
+
badgeTextColor: 'black',
|
|
137
|
+
badgeOutline: true
|
|
125
138
|
},
|
|
126
139
|
{
|
|
127
140
|
name: 'checked',
|
|
@@ -156,7 +169,14 @@ export default {
|
|
|
156
169
|
label: 'Sodium (mg)',
|
|
157
170
|
align: 'left',
|
|
158
171
|
field: 'sodium',
|
|
159
|
-
|
|
172
|
+
required: true,
|
|
173
|
+
sortable: true,
|
|
174
|
+
showCustomizedButtonWithToolTip: true,
|
|
175
|
+
btnIcon: 'warning',
|
|
176
|
+
btnEmit: 'onClickButtonWithToolTip',
|
|
177
|
+
dataCy: 'onClickButtonWithToolTip',
|
|
178
|
+
btnColor: (row: { btnColor: string }) => row.btnColor,
|
|
179
|
+
toolTipText: (row: { toolTipText: string }) => row.toolTipText,
|
|
160
180
|
},
|
|
161
181
|
{
|
|
162
182
|
name: 'calcium',
|
|
@@ -354,12 +374,26 @@ export default {
|
|
|
354
374
|
protein: lista[i].protein,
|
|
355
375
|
sodium: lista[i].sodium,
|
|
356
376
|
calcium: lista[i].calcium,
|
|
357
|
-
iron: lista[i].iron
|
|
377
|
+
iron: lista[i].iron,
|
|
378
|
+
badgeColor: this.getBadgeColor(lista[i].carbs),
|
|
379
|
+
badgeText: this.getBadgeText(lista[i].carbs),
|
|
380
|
+
toolTipText: this.getBadgeText(lista[i].carbs),
|
|
381
|
+
btnColor: this.getBadgeColor(lista[i].carbs)
|
|
358
382
|
})
|
|
359
383
|
}
|
|
360
384
|
setTimeout(() => {
|
|
361
385
|
this.showSkeleton = false
|
|
362
386
|
}, 1000);
|
|
387
|
+
console.log('rows', this.rows)
|
|
388
|
+
},
|
|
389
|
+
getBadgeColor(carbs: number) {
|
|
390
|
+
return carbs > 50 ? 'negative': 'secondary'
|
|
391
|
+
},
|
|
392
|
+
getBadgeText (carbs: number) {
|
|
393
|
+
return carbs > 50 ? 'header.hello': 'global.total'
|
|
394
|
+
},
|
|
395
|
+
onClickBadge (rows: object []) {
|
|
396
|
+
console.log(rows, 'onClickBadge')
|
|
363
397
|
},
|
|
364
398
|
onUpdateBasicCheckboxValue (rows: object []) {
|
|
365
399
|
console.log(rows, 'onUpdateBasicCheckboxValue')
|