quasar-factory-lib 0.0.63 → 0.0.65
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 +223 -3
- package/dist/components/Table/components/CustomizedBadge.vue.d.ts +60 -0
- package/dist/components/Table/components/CustomizedButton.vue.d.ts +8 -0
- package/dist/components/Table/components/CustomizedButtonWithToolTip.vue.d.ts +38 -0
- package/dist/components/Table/components/TableSlotBody.vue.d.ts +108 -1
- package/dist/components/Table/components/TableSlotGrid.vue.d.ts +108 -1
- package/dist/layouts/PdaLayout.vue.d.ts +223 -3
- package/dist/pages/ConfirmedTaskPage.vue.d.ts +1 -0
- package/dist/pages/TablePage.vue.d.ts +392 -3
- package/dist/quasar-factory-lib.js +5625 -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/CustomizedButton.vue +5 -1
- package/src/components/Table/components/CustomizedButtonWithToolTip.vue +43 -0
- package/src/components/Table/components/TableSlotBody.vue +35 -4
- package/src/components/Table/components/TableSlotGrid.vue +34 -4
- package/src/layouts/MenuLayout.vue +0 -1
- package/src/layouts/PdaLayout.vue +1 -1
- package/src/pages/TablePage.vue +39 -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>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
round
|
|
6
6
|
:color="btnColor"
|
|
7
7
|
size="md"
|
|
8
|
+
:disable="btnDisable"
|
|
8
9
|
@click="$emit('onClickButton')"
|
|
9
10
|
>
|
|
10
11
|
<q-icon :name="btnIcon" />
|
|
@@ -25,8 +26,11 @@ export default {
|
|
|
25
26
|
btnIcon: {
|
|
26
27
|
type: String,
|
|
27
28
|
required: true
|
|
29
|
+
},
|
|
30
|
+
btnDisable: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
required: true
|
|
28
33
|
}
|
|
29
|
-
|
|
30
34
|
},
|
|
31
35
|
emits: ['onClickButton'],
|
|
32
36
|
data: function () {
|
|
@@ -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>
|
|
@@ -93,10 +93,31 @@
|
|
|
93
93
|
:data-cy="col.colButtonDataCy + '-' + tablePropsData.row.id"
|
|
94
94
|
:btn-color="col.btnColor || 'primary'"
|
|
95
95
|
:btn-icon="col.btnIcon|| ''"
|
|
96
|
+
:btn-disable="col.btnDisable || tablePropsData.row.btnDisable"
|
|
96
97
|
@on-click-button="() => {
|
|
97
98
|
$emit('onClickButton', col.btnEmit, tablePropsData.row)
|
|
98
99
|
}"
|
|
99
100
|
/>
|
|
101
|
+
<CustomizedButtonWithToolTip
|
|
102
|
+
v-if="col.showCustomizedButtonWithToolTip"
|
|
103
|
+
:data-cy="col.ButtonWithToolTip + '-' + tablePropsData.row.id"
|
|
104
|
+
:btn-color="tablePropsData.row.btnColor || 'primary'"
|
|
105
|
+
:btn-icon="col.btnIcon|| ''"
|
|
106
|
+
:toolTipText="tablePropsData.row.toolTipText || ''"
|
|
107
|
+
@on-click-button-with-tool-tip="() => {
|
|
108
|
+
$emit('onClickButtonWithToolTip', col.btnEmit, tablePropsData.row)
|
|
109
|
+
}"
|
|
110
|
+
/>
|
|
111
|
+
<CustomizedBadge
|
|
112
|
+
v-if="col.showBadge"
|
|
113
|
+
:data-cy="col.badgeDataCy + tablePropsData.row.id"
|
|
114
|
+
:badgeText="tablePropsData.row.badgeText"
|
|
115
|
+
:badgeColor="tablePropsData.row.badgeColor"
|
|
116
|
+
:badgeTextColor="col.badgeTextColor || 'primary'"
|
|
117
|
+
:badgeOutline="col.badgeOutline || false"
|
|
118
|
+
:badgeRounded="col.badgeRounded || false"
|
|
119
|
+
:badgeTransparent="col.badgeTransparent || false"
|
|
120
|
+
/>
|
|
100
121
|
</q-td>
|
|
101
122
|
</tr>
|
|
102
123
|
</template>
|
|
@@ -107,6 +128,8 @@ import BasicCheckBox from './BasicCheckBox.vue'
|
|
|
107
128
|
import CustomizedCheckBox from './CustomizedCheckBox.vue'
|
|
108
129
|
import CustomizedIcon from './CustomizedIcon.vue'
|
|
109
130
|
import CustomizedButton from './CustomizedButton.vue'
|
|
131
|
+
import CustomizedBadge from './CustomizedBadge.vue'
|
|
132
|
+
import CustomizedButtonWithToolTip from './CustomizedButtonWithToolTip.vue'
|
|
110
133
|
export default {
|
|
111
134
|
name: 'TableSlotBody',
|
|
112
135
|
components: {
|
|
@@ -115,7 +138,9 @@ export default {
|
|
|
115
138
|
BasicCheckBox,
|
|
116
139
|
CustomizedCheckBox,
|
|
117
140
|
CustomizedIcon,
|
|
118
|
-
CustomizedButton
|
|
141
|
+
CustomizedButton,
|
|
142
|
+
CustomizedBadge,
|
|
143
|
+
CustomizedButtonWithToolTip
|
|
119
144
|
},
|
|
120
145
|
props: {
|
|
121
146
|
tableProps: {
|
|
@@ -136,15 +161,21 @@ export default {
|
|
|
136
161
|
this.tablePropsData = val
|
|
137
162
|
}
|
|
138
163
|
},
|
|
139
|
-
emits: [
|
|
164
|
+
emits: [
|
|
165
|
+
'onSaveValuePopupEdit',
|
|
166
|
+
'onUpdateBasicCheckboxValue',
|
|
167
|
+
'onClickButton',
|
|
168
|
+
'onUpdateCustomizedCheckboxValue',
|
|
169
|
+
'onClickButtonWithToolTip'
|
|
170
|
+
],
|
|
140
171
|
data () {
|
|
141
172
|
return {
|
|
142
173
|
tablePropsData: this.tableProps
|
|
143
174
|
}
|
|
144
175
|
},
|
|
145
176
|
methods: {
|
|
146
|
-
getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean }): boolean {
|
|
147
|
-
return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton)
|
|
177
|
+
getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean, showBadge: boolean, showCustomizedButtonWithToolTip: boolean }): boolean {
|
|
178
|
+
return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton || col.showBadge || col.showCustomizedButtonWithToolTip)
|
|
148
179
|
}
|
|
149
180
|
}
|
|
150
181
|
}
|
|
@@ -122,12 +122,37 @@
|
|
|
122
122
|
:data-cy="col.colButtonDataCy + '-' + tablePropsData.row.id"
|
|
123
123
|
:btn-color="col.btnColor || 'primary'"
|
|
124
124
|
:btn-icon="col.btnIcon|| ''"
|
|
125
|
+
:btn-disable="col.btnDisable || tablePropsData.row.btnDisable"
|
|
125
126
|
@on-click-button="() => {
|
|
126
127
|
$emit('onClickButton', col.btnEmit, tablePropsData.row)
|
|
127
128
|
}"
|
|
128
129
|
/>
|
|
129
130
|
</q-item-section>
|
|
131
|
+
<q-item-section>
|
|
132
|
+
<CustomizedButtonWithToolTip
|
|
133
|
+
v-if="col.showCustomizedButtonWithToolTip"
|
|
134
|
+
:data-cy="col.ButtonWithToolTip + '-' + tablePropsData.row.id"
|
|
135
|
+
:btn-color="tablePropsData.row.btnColor || 'primary'"
|
|
136
|
+
:btn-icon="col.btnIcon|| ''"
|
|
137
|
+
:toolTipText="tablePropsData.row.toolTipText || ''"
|
|
138
|
+
@on-click-button-with-tool-tip="() => {
|
|
139
|
+
$emit('onClickButtonWithToolTip', col.btnEmit, tablePropsData.row)
|
|
140
|
+
}"
|
|
141
|
+
/>
|
|
142
|
+
</q-item-section>
|
|
143
|
+
<q-item-section>
|
|
144
|
+
<CustomizedBadge
|
|
145
|
+
v-if="col.showBadge"
|
|
146
|
+
:data-cy="col.badgeDataCy + tablePropsData.row.id"
|
|
147
|
+
:badgeText="tablePropsData.row.badgeText"
|
|
148
|
+
:badgeColor="tablePropsData.row.badgeColor"
|
|
149
|
+
:badgeTextColor="col.badgeTextColor || 'primary'"
|
|
150
|
+
:badgeOutline="col.badgeOutline || false"
|
|
151
|
+
:badgeRounded="col.badgeRounded || false"
|
|
152
|
+
:badgeTransparent="col.badgeTransparent || false"
|
|
153
|
+
/>
|
|
130
154
|
</q-item-section>
|
|
155
|
+
</q-item-section>
|
|
131
156
|
</q-item>
|
|
132
157
|
</q-list>
|
|
133
158
|
</q-card>
|
|
@@ -140,6 +165,8 @@ import BasicCheckBox from './BasicCheckBox.vue'
|
|
|
140
165
|
import CustomizedCheckBox from './CustomizedCheckBox.vue'
|
|
141
166
|
import CustomizedIcon from './CustomizedIcon.vue'
|
|
142
167
|
import CustomizedButton from './CustomizedButton.vue'
|
|
168
|
+
import CustomizedBadge from './CustomizedBadge.vue'
|
|
169
|
+
import CustomizedButtonWithToolTip from './CustomizedButtonWithToolTip.vue'
|
|
143
170
|
|
|
144
171
|
export default {
|
|
145
172
|
name: 'TableSlotGrid',
|
|
@@ -149,7 +176,9 @@ export default {
|
|
|
149
176
|
BasicCheckBox,
|
|
150
177
|
CustomizedCheckBox,
|
|
151
178
|
CustomizedIcon,
|
|
152
|
-
CustomizedButton
|
|
179
|
+
CustomizedButton,
|
|
180
|
+
CustomizedBadge,
|
|
181
|
+
CustomizedButtonWithToolTip
|
|
153
182
|
},
|
|
154
183
|
props: {
|
|
155
184
|
tableProps: {
|
|
@@ -172,7 +201,8 @@ export default {
|
|
|
172
201
|
'onSaveValuePopupEdit',
|
|
173
202
|
'onUpdateBasicCheckboxValue',
|
|
174
203
|
'onClickButton',
|
|
175
|
-
'onUpdateCustomizedCheckboxValue'
|
|
204
|
+
'onUpdateCustomizedCheckboxValue',
|
|
205
|
+
'onClickButtonWithToolTip'
|
|
176
206
|
],
|
|
177
207
|
data () {
|
|
178
208
|
return {
|
|
@@ -187,8 +217,8 @@ export default {
|
|
|
187
217
|
},
|
|
188
218
|
mounted () {},
|
|
189
219
|
methods: {
|
|
190
|
-
getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean }): boolean {
|
|
191
|
-
return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton)
|
|
220
|
+
getColumnValue (col: { showBasicCheckbox: boolean; showCustomizedCheckBox: boolean; showCustomizedIcon: boolean; showColumButton: boolean, showBadge: boolean, showCustomizedButtonWithToolTip: boolean }): boolean {
|
|
221
|
+
return !(col.showBasicCheckbox || col.showCustomizedCheckBox || col.showCustomizedIcon || col.showColumButton || col.showBadge || col.showCustomizedButtonWithToolTip)
|
|
192
222
|
}
|
|
193
223
|
}
|
|
194
224
|
}
|
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,27 @@ 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
|
+
btnDisable: true,
|
|
379
|
+
badgeColor: this.getBadgeColor(lista[i].carbs),
|
|
380
|
+
badgeText: this.getBadgeText(lista[i].carbs),
|
|
381
|
+
toolTipText: this.getBadgeText(lista[i].carbs),
|
|
382
|
+
btnColor: this.getBadgeColor(lista[i].carbs)
|
|
358
383
|
})
|
|
359
384
|
}
|
|
360
385
|
setTimeout(() => {
|
|
361
386
|
this.showSkeleton = false
|
|
362
387
|
}, 1000);
|
|
388
|
+
console.log('rows', this.rows)
|
|
389
|
+
},
|
|
390
|
+
getBadgeColor(carbs: number) {
|
|
391
|
+
return carbs > 50 ? 'negative': 'secondary'
|
|
392
|
+
},
|
|
393
|
+
getBadgeText (carbs: number) {
|
|
394
|
+
return carbs > 50 ? 'header.hello': 'global.total'
|
|
395
|
+
},
|
|
396
|
+
onClickBadge (rows: object []) {
|
|
397
|
+
console.log(rows, 'onClickBadge')
|
|
363
398
|
},
|
|
364
399
|
onUpdateBasicCheckboxValue (rows: object []) {
|
|
365
400
|
console.log(rows, 'onUpdateBasicCheckboxValue')
|