@7365admin1/layer-common 3.2.2-staging.100 → 3.2.2-staging.102
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/components/AppField.vue +5 -0
- package/components/AreaChecklistHistoryLogs.vue +51 -44
- package/components/SiteSettingsWorkOrder.vue +61 -30
- package/components/StockCard.vue +17 -12
- package/components/SubscriptionPlanTable.vue +60 -57
- package/components/TableListSecondary.vue +94 -53
- package/package.json +1 -1
package/components/AppField.vue
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
:value="model"
|
|
25
25
|
:placeholder="placeholder"
|
|
26
26
|
:disabled="disabled"
|
|
27
|
+
:readonly="readonly"
|
|
27
28
|
@input="model = ($event.target as HTMLInputElement).value"
|
|
28
29
|
/>
|
|
29
30
|
</label>
|
|
@@ -41,6 +42,10 @@ defineProps({
|
|
|
41
42
|
search: { type: Boolean, default: false },
|
|
42
43
|
compact: { type: Boolean, default: false },
|
|
43
44
|
disabled: { type: Boolean, default: false },
|
|
45
|
+
/** A field that prints a derived value - a preview, a computed reference -
|
|
46
|
+
and is not typed into. Kept distinct from `disabled`, which also greys
|
|
47
|
+
the box and takes it out of the tab order. */
|
|
48
|
+
readonly: { type: Boolean, default: false },
|
|
44
49
|
klass: { type: String, default: "" },
|
|
45
50
|
});
|
|
46
51
|
</script>
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-row no-gutters align="center" justify="center">
|
|
3
3
|
<v-col cols="12">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
>
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
</
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<v-card-text class="pa-0">
|
|
4
|
+
<!-- The screen's name and its Back move out of the `grey-lighten-4` bar -
|
|
5
|
+
a slab that stayed white in dark mode - onto the design's title row.
|
|
6
|
+
All five service apps mount this component bare, so the layer is the
|
|
7
|
+
only place the page name can come from. -->
|
|
8
|
+
<PageHeader title="Area Checklist">
|
|
9
|
+
<template #actions>
|
|
10
|
+
<AppButton variant="ghost" icon="mdi-chevron-left" @click="back()">
|
|
11
|
+
Back
|
|
12
|
+
</AppButton>
|
|
13
|
+
</template>
|
|
14
|
+
</PageHeader>
|
|
15
|
+
|
|
16
|
+
<AppCard>
|
|
17
|
+
<div class="pa-0">
|
|
19
18
|
<v-row no-gutters>
|
|
20
19
|
<v-col
|
|
21
20
|
cols="12"
|
|
22
21
|
md="6"
|
|
23
22
|
lg="5"
|
|
24
23
|
xl="4"
|
|
25
|
-
|
|
24
|
+
class="checklist-detail__split"
|
|
26
25
|
>
|
|
27
26
|
<v-row no-gutters class="pa-6">
|
|
28
27
|
<v-col cols="12" class="mb-4">
|
|
@@ -47,11 +46,11 @@
|
|
|
47
46
|
|
|
48
47
|
<v-col cols="12" class="mb-3">
|
|
49
48
|
<div class="text-body-2 mb-1">Status:</div>
|
|
50
|
-
<
|
|
51
|
-
class="text-capitalize
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
<StatusChip
|
|
50
|
+
class="text-capitalize"
|
|
51
|
+
:status="status"
|
|
52
|
+
:label="status || 'N/A'"
|
|
53
|
+
/>
|
|
55
54
|
</v-col>
|
|
56
55
|
</v-row>
|
|
57
56
|
</v-col>
|
|
@@ -119,15 +118,15 @@
|
|
|
119
118
|
class="text-subtitle-2 font-weight-bold px-0"
|
|
120
119
|
>
|
|
121
120
|
Set {{ checklistSet.set }}
|
|
122
|
-
<
|
|
121
|
+
<StatusChip
|
|
123
122
|
v-if="checklistSet.isScheduleTask"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
class="
|
|
123
|
+
tone="info"
|
|
124
|
+
:dot="false"
|
|
125
|
+
pill
|
|
126
|
+
class="ml-2"
|
|
128
127
|
>
|
|
129
128
|
Schedule Task
|
|
130
|
-
</
|
|
129
|
+
</StatusChip>
|
|
131
130
|
</v-list-subheader>
|
|
132
131
|
|
|
133
132
|
<v-list-item
|
|
@@ -161,22 +160,14 @@
|
|
|
161
160
|
</div>
|
|
162
161
|
</v-col>
|
|
163
162
|
<v-col cols="12" sm="2" class="text-right">
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
: 'grey'
|
|
169
|
-
"
|
|
170
|
-
:variant="
|
|
171
|
-
unit.status?.toLowerCase() === 'completed'
|
|
172
|
-
? 'flat'
|
|
173
|
-
: 'outlined'
|
|
174
|
-
"
|
|
175
|
-
size="small"
|
|
163
|
+
<!-- Same word decides the colour, only now through the
|
|
164
|
+
shared status map, so "Completed" here is the same
|
|
165
|
+
green as on every other screen. -->
|
|
166
|
+
<StatusChip
|
|
176
167
|
class="text-capitalize"
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
168
|
+
:status="unit.status || 'Open'"
|
|
169
|
+
:label="unit.status || 'Open'"
|
|
170
|
+
/>
|
|
180
171
|
</v-col>
|
|
181
172
|
</v-row>
|
|
182
173
|
</v-list-item>
|
|
@@ -191,8 +182,8 @@
|
|
|
191
182
|
</v-row>
|
|
192
183
|
</v-col>
|
|
193
184
|
</v-row>
|
|
194
|
-
</
|
|
195
|
-
</
|
|
185
|
+
</div>
|
|
186
|
+
</AppCard>
|
|
196
187
|
</v-col>
|
|
197
188
|
</v-row>
|
|
198
189
|
</template>
|
|
@@ -242,3 +233,19 @@ const timeOut = ref<string>("N/A");
|
|
|
242
233
|
const status = ref<string>("N/A");
|
|
243
234
|
const signatureUrl = ref<string>("");
|
|
244
235
|
</script>
|
|
236
|
+
|
|
237
|
+
<style scoped>
|
|
238
|
+
/* Was an inline `rgba(0,0,0,.12)`, which is the same near-black rule in dark
|
|
239
|
+
mode. The token follows the theme. At `md` and below the two halves stack, so
|
|
240
|
+
the rule moves under the first one. */
|
|
241
|
+
.checklist-detail__split {
|
|
242
|
+
border-bottom: 1px solid var(--border);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
@media (min-width: 960px) {
|
|
246
|
+
.checklist-detail__split {
|
|
247
|
+
border-bottom: none;
|
|
248
|
+
border-right: 1px solid var(--border);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
</style>
|
|
@@ -1,33 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<!-- The page had no heading of its own: the five service apps mount this
|
|
4
|
+
component bare on `[org]/[site]/settings`, so the name only ever
|
|
5
|
+
appeared in the navigation rail. "Settings" is that rail's own label. -->
|
|
6
|
+
<PageHeader title="Settings" />
|
|
7
|
+
|
|
8
|
+
<v-row no-gutters>
|
|
9
|
+
<!--
|
|
10
|
+
`multiple` and which panel opens first are BEHAVIOUR, so they are
|
|
11
|
+
left exactly as they were - `.screen-accordion` only changes the
|
|
12
|
+
drawing, the same way `SiteSettings` already does it.
|
|
13
|
+
-->
|
|
14
|
+
<v-expansion-panels multiple v-model="openPanels" class="screen-accordion">
|
|
15
|
+
|
|
16
|
+
<!-- Work Order Settings -->
|
|
17
|
+
<v-expansion-panel>
|
|
18
|
+
<v-expansion-panel-title>
|
|
19
|
+
<v-icon class="mr-2">mdi-format-list-numbered</v-icon>
|
|
20
|
+
Work Order Settings
|
|
21
|
+
</v-expansion-panel-title>
|
|
22
|
+
|
|
23
|
+
<v-expansion-panel-text>
|
|
24
|
+
<div class="wo-settings__fields">
|
|
25
|
+
<AppField v-model="prefix" label="Prefix"
|
|
26
|
+
:disabled="isLoading || !canManageSiteSettings" @input="handleInput" />
|
|
27
|
+
|
|
28
|
+
<!-- `return-object` keeps the emitted value a NUMBER, which is
|
|
29
|
+
what `createWorkOrderSettings` puts on the wire today. -->
|
|
30
|
+
<AppSelect v-model="noOfDigits" return-object
|
|
31
|
+
:items="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" label="No. of Digits"
|
|
32
|
+
:disabled="isLoading || !canManageSiteSettings" />
|
|
33
|
+
|
|
34
|
+
<AppField :model-value="orderNumberPreview" label="Preview" readonly />
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<!-- Still a `v-btn`: `AppButton` has no loading state, and the
|
|
38
|
+
spinner on save is feedback, not decoration. -->
|
|
39
|
+
<v-btn v-if="canManageSiteSettings" class="screen-btn-primary text-none mt-4"
|
|
40
|
+
variant="flat" :loading="isLoading" @click="save">
|
|
41
|
+
Save
|
|
42
|
+
</v-btn>
|
|
43
|
+
</v-expansion-panel-text>
|
|
44
|
+
</v-expansion-panel>
|
|
45
|
+
|
|
46
|
+
</v-expansion-panels>
|
|
47
|
+
|
|
48
|
+
<Snackbar v-model="toast.show" :text="toast.message" :color="toast.color" />
|
|
49
|
+
</v-row>
|
|
50
|
+
</div>
|
|
31
51
|
</template>
|
|
32
52
|
|
|
33
53
|
<script setup lang="ts">
|
|
@@ -173,4 +193,15 @@ function show(message: string, color: string) {
|
|
|
173
193
|
toast.message = message
|
|
174
194
|
toast.color = color
|
|
175
195
|
}
|
|
176
|
-
</script>
|
|
196
|
+
</script>
|
|
197
|
+
|
|
198
|
+
<style scoped>
|
|
199
|
+
/* The design stacks a settings form's fields on one gap, rather than leaning on
|
|
200
|
+
each Vuetify field's own 22px of hint space. */
|
|
201
|
+
.wo-settings__fields {
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-direction: column;
|
|
204
|
+
gap: 16px;
|
|
205
|
+
max-width: 420px;
|
|
206
|
+
}
|
|
207
|
+
</style>
|
package/components/StockCard.vue
CHANGED
|
@@ -5,15 +5,18 @@
|
|
|
5
5
|
color="page-background-color fill-height header-row"
|
|
6
6
|
>
|
|
7
7
|
<v-col cols="12" sm="12" md="11" lg="12" xl="12">
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
<!-- The loose Back link above the card becomes the design's title row -
|
|
9
|
+
the page name on the left, its action right-aligned on the same line.
|
|
10
|
+
`title` was already declared here and never drawn. -->
|
|
11
|
+
<PageHeader :title="title">
|
|
12
|
+
<template #actions>
|
|
13
|
+
<AppButton variant="ghost" icon="mdi-arrow-left" @click="back">
|
|
12
14
|
Back
|
|
13
|
-
</
|
|
14
|
-
</
|
|
15
|
-
</
|
|
16
|
-
|
|
15
|
+
</AppButton>
|
|
16
|
+
</template>
|
|
17
|
+
</PageHeader>
|
|
18
|
+
|
|
19
|
+
<AppCard class="pa-5 position-relative">
|
|
17
20
|
<!-- Stock Information -->
|
|
18
21
|
<v-row class="pt-2">
|
|
19
22
|
<v-col cols="12">
|
|
@@ -104,7 +107,7 @@
|
|
|
104
107
|
</TableMain>
|
|
105
108
|
</v-col>
|
|
106
109
|
</v-row>
|
|
107
|
-
</
|
|
110
|
+
</AppCard>
|
|
108
111
|
</v-col>
|
|
109
112
|
</v-row>
|
|
110
113
|
</template>
|
|
@@ -181,9 +184,11 @@ watchEffect(() => {
|
|
|
181
184
|
</script>
|
|
182
185
|
|
|
183
186
|
<style scoped>
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
+
/* The scoped `.text-fontgray { color: #7e7e7e }` that used to sit here is gone.
|
|
188
|
+
It out-specified the layer's tokenised rule in `assets/css/screens.css`, which
|
|
189
|
+
is why these four field labels were the estate's one measured 4.06:1 - the
|
|
190
|
+
same fixed grey in both themes. The surface under them is `AppCard`, which is
|
|
191
|
+
itself tokenised, so the ink can safely follow the theme. */
|
|
187
192
|
|
|
188
193
|
:deep() .v-table .v-table__wrapper > table > thead > tr > th:not(:last-child) {
|
|
189
194
|
border-right: thin solid rgba(var(--v-border-color), var(--v-border-opacity));
|
|
@@ -1,80 +1,82 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-container fluid class="pa-6">
|
|
3
|
-
<!--
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
<!--
|
|
4
|
+
THE DESIGN'S TITLE ROW. Was a hand-rolled flex row with a `text-h5`
|
|
5
|
+
heading and a pill button; it is the same title and the same button on
|
|
6
|
+
the same line, drawn by the shared `PageHeader` at 22px/800 so this
|
|
7
|
+
screen's heading matches every other screen's.
|
|
8
|
+
-->
|
|
9
|
+
<PageHeader title="Subscription Plans">
|
|
10
|
+
<template #actions>
|
|
11
|
+
<v-btn
|
|
12
|
+
class="text-none screen-btn-primary"
|
|
13
|
+
variant="flat"
|
|
14
|
+
@click="openCreateModal"
|
|
15
|
+
>
|
|
16
|
+
Create Plan
|
|
17
|
+
</v-btn>
|
|
18
|
+
</template>
|
|
19
|
+
</PageHeader>
|
|
18
20
|
|
|
19
21
|
<!-- Search & Filters Bar -->
|
|
22
|
+
<!--
|
|
23
|
+
The primitives carry these exactly: the search is a string ref, and both
|
|
24
|
+
filters are string refs over `{ title, value }` options whose values are
|
|
25
|
+
already strings, so `AppSelect`'s native branch emits the same string
|
|
26
|
+
this screen has always stored ("all", "monthly", ...). No filter's
|
|
27
|
+
meaning, order or default changed.
|
|
28
|
+
-->
|
|
20
29
|
<v-row class="mb-2" density="compact">
|
|
21
30
|
<!-- Search Input -->
|
|
22
31
|
<v-col cols="12" sm="4" md="3">
|
|
23
|
-
<v-
|
|
24
|
-
v-model="search"
|
|
25
|
-
placeholder="Search Plan"
|
|
26
|
-
prepend-inner-icon="mdi-magnify"
|
|
27
|
-
variant="outlined"
|
|
28
|
-
density="compact"
|
|
29
|
-
hide-details
|
|
30
|
-
clearable
|
|
31
|
-
/>
|
|
32
|
+
<AppField v-model="search" search placeholder="Search Plan" />
|
|
32
33
|
</v-col>
|
|
33
34
|
|
|
34
35
|
<!-- Filter by Category -->
|
|
35
36
|
<v-col cols="12" sm="4" md="3">
|
|
36
|
-
<
|
|
37
|
+
<AppSelect
|
|
37
38
|
v-model="categoryFilter"
|
|
38
39
|
:items="categoryOptions"
|
|
39
40
|
label="Filter by category"
|
|
40
|
-
variant="outlined"
|
|
41
|
-
density="compact"
|
|
42
|
-
hide-details
|
|
43
41
|
/>
|
|
44
42
|
</v-col>
|
|
45
43
|
|
|
46
44
|
<!-- Filter by Billing Cycle -->
|
|
47
45
|
<v-col cols="12" sm="4" md="3">
|
|
48
|
-
<
|
|
46
|
+
<AppSelect
|
|
49
47
|
v-model="billingFilter"
|
|
50
48
|
:items="billingOptions"
|
|
51
49
|
label="Filter by billing cycle"
|
|
52
|
-
variant="outlined"
|
|
53
|
-
density="compact"
|
|
54
|
-
hide-details
|
|
55
50
|
/>
|
|
56
51
|
</v-col>
|
|
57
52
|
</v-row>
|
|
58
53
|
|
|
59
54
|
<!-- Main Table Card -->
|
|
60
|
-
<
|
|
61
|
-
<!--
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<
|
|
55
|
+
<AppCard class="table-card mt-4">
|
|
56
|
+
<!--
|
|
57
|
+
The tabs and the refresh were a hand-built `bg-grey-lighten-4` strip -
|
|
58
|
+
a hard-coded light grey that stayed light in the dark theme. They are
|
|
59
|
+
the card's own toolbar row now, which is where the design draws tabs,
|
|
60
|
+
and it follows the theme because it is tokenised.
|
|
61
|
+
-->
|
|
62
|
+
<CardToolbar>
|
|
63
|
+
<template #tabs>
|
|
64
|
+
<v-tabs v-model="activeTab" color="primary" density="compact">
|
|
65
|
+
<v-tab value="active" class="text-none font-weight-bold">Active</v-tab>
|
|
66
|
+
<v-tab value="deactive" class="text-none font-weight-bold">Deactive</v-tab>
|
|
67
|
+
</v-tabs>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<template #right>
|
|
69
71
|
<v-btn
|
|
70
72
|
icon="mdi-refresh"
|
|
71
73
|
variant="text"
|
|
72
74
|
density="comfortable"
|
|
73
|
-
|
|
75
|
+
aria-label="Refresh"
|
|
74
76
|
@click="refresh"
|
|
75
77
|
/>
|
|
76
|
-
</
|
|
77
|
-
</
|
|
78
|
+
</template>
|
|
79
|
+
</CardToolbar>
|
|
78
80
|
|
|
79
81
|
<!-- Table View -->
|
|
80
82
|
<v-data-table
|
|
@@ -107,22 +109,21 @@
|
|
|
107
109
|
</template>
|
|
108
110
|
|
|
109
111
|
<!-- Applications Badge -->
|
|
112
|
+
<!-- A count, not a status word, so it takes the design's neutral tag
|
|
113
|
+
shape (no leading dot) rather than a colour it has not earned. -->
|
|
110
114
|
<template #item.applicationIds="{ item }">
|
|
111
|
-
<
|
|
115
|
+
<StatusChip tone="neutral" :dot="false">
|
|
112
116
|
{{ item.applicationIds.length }} Application{{ item.applicationIds.length > 1 ? 's' : '' }}
|
|
113
|
-
</
|
|
117
|
+
</StatusChip>
|
|
114
118
|
</template>
|
|
115
119
|
|
|
116
120
|
<!-- Status Badge -->
|
|
121
|
+
<!-- The shared word -> tone map: "Active" is `ok` (was Vuetify
|
|
122
|
+
`success`) and "Deactive" is unmapped, so it comes out neutral -
|
|
123
|
+
which is the grey it already was. Same two words, same two
|
|
124
|
+
meanings. -->
|
|
117
125
|
<template #item.status="{ item }">
|
|
118
|
-
<
|
|
119
|
-
size="small"
|
|
120
|
-
:color="item.status === 'active' ? 'success' : 'grey'"
|
|
121
|
-
variant="flat"
|
|
122
|
-
class="text-caption font-weight-bold"
|
|
123
|
-
>
|
|
124
|
-
{{ item.status === 'active' ? 'Active' : 'Deactive' }}
|
|
125
|
-
</v-chip>
|
|
126
|
+
<StatusChip :status="item.status === 'active' ? 'Active' : 'Deactive'" />
|
|
126
127
|
</template>
|
|
127
128
|
|
|
128
129
|
<!-- Actions -->
|
|
@@ -166,13 +167,15 @@
|
|
|
166
167
|
</template>
|
|
167
168
|
|
|
168
169
|
<!-- Empty State -->
|
|
170
|
+
<!-- Same sentence, in the shared empty block the design draws it in. -->
|
|
169
171
|
<template #no-data>
|
|
170
|
-
<div class="
|
|
171
|
-
|
|
172
|
+
<div class="table-card__empty">
|
|
173
|
+
<v-icon icon="mdi-magnify-close" size="32" />
|
|
174
|
+
<span>No plans found.</span>
|
|
172
175
|
</div>
|
|
173
176
|
</template>
|
|
174
177
|
</v-data-table>
|
|
175
|
-
</
|
|
178
|
+
</AppCard>
|
|
176
179
|
|
|
177
180
|
<!-- Create / Edit Dialog -->
|
|
178
181
|
<v-dialog v-model="showModal" max-width="600px" persistent>
|
|
@@ -1,55 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<v-toolbar density="compact" class="px-3 border-b-sm" color="transparent">
|
|
4
|
-
<template #prepend>
|
|
5
|
-
<slot name="title">Title</slot>
|
|
6
|
-
</template>
|
|
1
|
+
<!--
|
|
2
|
+
THE SECOND LIST CARD - the one `ListView` and `WorkOrder/ListView` draw.
|
|
7
3
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
Was a `v-card` with TWO `v-toolbar`s: the caller's title + action button on
|
|
5
|
+
the top one, and the page range + arrows on a second one under the table. The
|
|
6
|
+
design has neither. The page name and the screen's primary action belong on
|
|
7
|
+
ONE title row ABOVE the card (`PageHeader`), and the range and the pager
|
|
8
|
+
belong on the card's own single top row (`CardToolbar`) - which is exactly
|
|
9
|
+
the shape `TableMain` was converted to.
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
>
|
|
33
|
-
<template v-if="$slots.item" v-slot:item>
|
|
34
|
-
<slot name="item" :items="props.items"></slot>
|
|
11
|
+
VISUAL ONLY. Same headers, same items, same slots, same row click, same
|
|
12
|
+
`page` model, same `update:pagination` payloads, same increment/decrement
|
|
13
|
+
guards. Nothing is fetched, filtered, sorted or emitted differently; the two
|
|
14
|
+
toolbars became one row and moved, and that is the whole change.
|
|
15
|
+
-->
|
|
16
|
+
<template>
|
|
17
|
+
<div class="list-card">
|
|
18
|
+
<!--
|
|
19
|
+
The fold: the caller's `title` slot used to be the `v-toolbar`'s prepend,
|
|
20
|
+
i.e. a heading INSIDE the card, and its action button sat on the same
|
|
21
|
+
bar. Both are the design's page-title row, so they move up to it. Only
|
|
22
|
+
drawn when the caller actually supplies a title - a caller that passes
|
|
23
|
+
none used to get the literal fallback word "Title" on the bar, which is
|
|
24
|
+
not a heading anybody asked for.
|
|
25
|
+
-->
|
|
26
|
+
<PageHeader v-if="$slots.title">
|
|
27
|
+
<template #title>
|
|
28
|
+
<slot name="title" />
|
|
35
29
|
</template>
|
|
36
30
|
|
|
37
|
-
<template v-
|
|
38
|
-
<
|
|
39
|
-
<td v-for="col in props.headers" :key="col.value">
|
|
40
|
-
<slot :name="col.value" :item="item">
|
|
41
|
-
{{ item[col.value] }}
|
|
42
|
-
</slot>
|
|
43
|
-
</td>
|
|
44
|
-
</tr>
|
|
31
|
+
<template v-if="$slots['action-button']" #actions>
|
|
32
|
+
<slot name="action-button"></slot>
|
|
45
33
|
</template>
|
|
46
|
-
</
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
34
|
+
</PageHeader>
|
|
35
|
+
|
|
36
|
+
<AppCard class="table-card">
|
|
37
|
+
<!--
|
|
38
|
+
ONE toolbar. The range keeps the exact string the caller computed and
|
|
39
|
+
the arrows keep their own disabled rules and emits; they have simply
|
|
40
|
+
stopped costing a second bar under the table.
|
|
41
|
+
-->
|
|
42
|
+
<CardToolbar :count="props.pageRange">
|
|
43
|
+
<template #right>
|
|
53
44
|
<div class="arrow-navigation">
|
|
54
45
|
<v-btn
|
|
55
46
|
icon="mdi-chevron-left"
|
|
@@ -66,14 +57,48 @@
|
|
|
66
57
|
@click="increment"
|
|
67
58
|
/>
|
|
68
59
|
</div>
|
|
69
|
-
</
|
|
70
|
-
</
|
|
60
|
+
</template>
|
|
61
|
+
</CardToolbar>
|
|
71
62
|
|
|
72
|
-
|
|
63
|
+
<!--
|
|
64
|
+
`extension` used to be rendered by BOTH toolbars, i.e. the same content
|
|
65
|
+
twice, above and below the table. It is one row now, under the toolbar,
|
|
66
|
+
where `TableMain` puts a filter row.
|
|
67
|
+
-->
|
|
68
|
+
<div v-if="$slots.extension" class="table-card__extension">
|
|
73
69
|
<slot name="extension"></slot>
|
|
74
|
-
</
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<v-data-table
|
|
73
|
+
v-model="selected"
|
|
74
|
+
:headers="props.headers"
|
|
75
|
+
:items="props.items"
|
|
76
|
+
item-value="_id"
|
|
77
|
+
items-per-page="20"
|
|
78
|
+
fixed-header
|
|
79
|
+
hide-default-footer
|
|
80
|
+
selec
|
|
81
|
+
:loading="props.loading"
|
|
82
|
+
@click:row="handleRowClick"
|
|
83
|
+
:style="`max-height:${props.height}`"
|
|
84
|
+
:class="{ 'clickable-rows': props.clickableRows }"
|
|
85
|
+
>
|
|
86
|
+
<template v-if="$slots.item" v-slot:item>
|
|
87
|
+
<slot name="item" :items="props.items"></slot>
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<template v-slot:item="{ item }">
|
|
91
|
+
<tr @click="handleRowClick(item)">
|
|
92
|
+
<td v-for="col in props.headers" :key="col.value">
|
|
93
|
+
<slot :name="col.value" :item="item">
|
|
94
|
+
{{ item[col.value] }}
|
|
95
|
+
</slot>
|
|
96
|
+
</td>
|
|
97
|
+
</tr>
|
|
98
|
+
</template>
|
|
99
|
+
</v-data-table>
|
|
100
|
+
</AppCard>
|
|
101
|
+
</div>
|
|
77
102
|
</template>
|
|
78
103
|
|
|
79
104
|
<script setup lang="ts">
|
|
@@ -161,4 +186,20 @@ watch(selectAll, (curr) => {
|
|
|
161
186
|
.clickable-rows tbody tr:hover {
|
|
162
187
|
background-color: var(--hover);
|
|
163
188
|
}
|
|
189
|
+
|
|
190
|
+
/*
|
|
191
|
+
Every caller wraps its title in `<span class="text-h6 font-weight-regular">`,
|
|
192
|
+
because the old toolbar drew no type of its own. Vuetify's typography classes
|
|
193
|
+
are `!important`, so that span would keep 20px/400 inside the design's
|
|
194
|
+
22px/800 heading and the fold would look like it had not happened. The
|
|
195
|
+
heading owns the type now; the caller's span is left to carry whatever else
|
|
196
|
+
it says. Confined to this card's own page head, so no other `PageHeader` is
|
|
197
|
+
touched - and no app repo has to be edited for the title to land.
|
|
198
|
+
*/
|
|
199
|
+
.list-card :deep(.app-page-head__title) * {
|
|
200
|
+
font-size: inherit !important;
|
|
201
|
+
font-weight: inherit !important;
|
|
202
|
+
line-height: inherit !important;
|
|
203
|
+
letter-spacing: inherit !important;
|
|
204
|
+
}
|
|
164
205
|
</style>
|