@7365admin1/layer-common 3.2.2-staging.128 → 3.2.2-staging.130

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.
@@ -45,11 +45,15 @@
45
45
  </template>
46
46
 
47
47
  <template #item.attachment="{ value }">
48
+ <!--
49
+ `variant="tonal"` drew Vuetify's own grey slab in the cell, the one
50
+ off-design control left on the row. The design's ghost button.
51
+ -->
48
52
  <v-btn
49
53
  v-if="value"
50
54
  size="small"
51
- variant="tonal"
52
- class="text-none"
55
+ variant="outlined"
56
+ class="screen-btn-ghost"
53
57
  @click.stop="viewAttachment(value)"
54
58
  >
55
59
  View Image
@@ -143,67 +147,54 @@
143
147
  </HygieneUpdateMoreAction>
144
148
  </v-dialog>
145
149
 
146
- <v-dialog v-model="dialogDeleteEquipment" max-width="450">
147
- <v-card>
148
- <v-toolbar>
149
- <v-row no-gutters class="fill-height px-6" align="center">
150
- <span class="font-weight-bold text-h6 text-capitalize">
151
- Delete {{ selectedEquipment?.name || "Unit" }}
152
- </span>
153
- </v-row>
154
- </v-toolbar>
155
- <v-card-text>
156
- <span class="text-subtitle-2"
157
- >Are you sure you want to delete this equipment?</span
158
- >
159
- </v-card-text>
150
+ <!--
151
+ All three dialogs were `v-toolbar` title bars over toolbar footers carrying
152
+ two block buttons, the confirm one on `color="black"` - not a token, so it
153
+ painted a light-theme fill on the dark theme, and the toolbar surface sat
154
+ visibly lighter than the card it was on. They are the shared `.screen-modal`
155
+ shape now. Same fields, same labels, same handlers, same busy states.
156
+ -->
157
+ <v-dialog v-model="dialogDeleteEquipment" max-width="520">
158
+ <v-card class="screen-modal">
159
+ <v-card-title class="text-capitalize">
160
+ Delete {{ selectedEquipment?.name || "Unit" }}
161
+ </v-card-title>
160
162
 
161
- <v-toolbar class="pa-0" density="compact">
162
- <v-row no-gutters>
163
- <v-col cols="6" class="pa-0">
164
- <v-btn
165
- block
166
- variant="text"
167
- class="text-none"
168
- size="large"
169
- @click="dialogDeleteEquipment = false"
170
- height="48"
171
- >
172
- Cancel
173
- </v-btn>
174
- </v-col>
163
+ <v-card-text class="screen-modal__body">
164
+ Are you sure you want to delete this equipment?
165
+ </v-card-text>
175
166
 
176
- <v-col cols="6" class="pa-0">
177
- <v-btn
178
- block
179
- variant="flat"
180
- color="black"
181
- class="text-none font-weight-bold"
182
- height="48"
183
- :loading="submitting"
184
- @click="_deleteEquipment"
185
- >
186
- Delete
187
- </v-btn>
188
- </v-col>
189
- </v-row>
190
- </v-toolbar>
167
+ <div class="screen-modal__footer">
168
+ <v-btn
169
+ class="screen-btn-ghost"
170
+ variant="outlined"
171
+ :disabled="submitting"
172
+ @click="dialogDeleteEquipment = false"
173
+ >
174
+ Cancel
175
+ </v-btn>
176
+ <v-btn
177
+ class="screen-btn-primary"
178
+ variant="flat"
179
+ :loading="submitting"
180
+ @click="_deleteEquipment"
181
+ >
182
+ Delete
183
+ </v-btn>
184
+ </div>
191
185
  </v-card>
192
186
  </v-dialog>
193
187
 
194
- <v-dialog v-model="dialogStockAction" max-width="450">
195
- <v-card>
196
- <v-toolbar>
197
- <v-row no-gutters class="fill-height px-6" align="center">
198
- <span class="font-weight-bold text-h6 text-capitalize">
199
- {{ stockActionMode === "add" ? "Add Stock" : "Checkout Item" }}
200
- </span>
201
- </v-row>
202
- </v-toolbar>
203
- <v-card-text class="pa-4">
188
+ <v-dialog v-model="dialogStockAction" max-width="520">
189
+ <v-card class="screen-modal">
190
+ <v-card-title class="text-capitalize">
191
+ {{ stockActionMode === "add" ? "Add Stock" : "Checkout Item" }}
192
+ </v-card-title>
193
+
194
+ <v-card-text class="screen-modal__body">
204
195
  <v-form ref="stockActionFormRef" v-model="stockActionValid">
205
196
  <v-row no-gutters>
206
- <v-col cols="12" class="mb-4">
197
+ <v-col cols="12">
207
198
  <InputLabel
208
199
  for="stockActionQty"
209
200
  title="Quantity"
@@ -214,68 +205,53 @@
214
205
  v-model.number="stockActionQuantity"
215
206
  :rules="[requiredRule]"
216
207
  density="comfortable"
217
- variant="outlined"
218
208
  type="number"
219
209
  min="1"
220
210
  placeholder="Enter quantity"
221
211
  hide-details="auto"
212
+ class="filter-field"
222
213
  />
223
214
  </v-col>
224
215
  </v-row>
225
216
  </v-form>
226
217
  </v-card-text>
227
218
 
228
- <v-toolbar class="pa-0" density="compact">
229
- <v-row no-gutters>
230
- <v-col cols="6" class="pa-0">
231
- <v-btn
232
- block
233
- variant="text"
234
- class="text-none"
235
- size="large"
236
- @click="dialogStockAction = false"
237
- height="48"
238
- >
239
- Cancel
240
- </v-btn>
241
- </v-col>
242
-
243
- <v-col cols="6" class="pa-0">
244
- <v-btn
245
- block
246
- variant="flat"
247
- color="black"
248
- class="text-none font-weight-bold rounded-0"
249
- height="48"
250
- :loading="submitting"
251
- @click="stockActionMode === 'add' ? _addStock() : _requestItem()"
252
- >
253
- {{ stockActionMode === "add" ? "Add Stock" : "Checkout Item" }}
254
- </v-btn>
255
- </v-col>
256
- </v-row>
257
- </v-toolbar>
219
+ <div class="screen-modal__footer">
220
+ <v-btn
221
+ class="screen-btn-ghost"
222
+ variant="outlined"
223
+ :disabled="submitting"
224
+ @click="dialogStockAction = false"
225
+ >
226
+ Cancel
227
+ </v-btn>
228
+ <v-btn
229
+ class="screen-btn-primary"
230
+ variant="flat"
231
+ :loading="submitting"
232
+ @click="stockActionMode === 'add' ? _addStock() : _requestItem()"
233
+ >
234
+ {{ stockActionMode === "add" ? "Add Stock" : "Checkout Item" }}
235
+ </v-btn>
236
+ </div>
258
237
  </v-card>
259
238
  </v-dialog>
260
239
 
261
240
  <v-dialog v-model="showAttachmentDialog" max-width="720" persistent>
262
- <v-card rounded="lg">
263
- <v-card-title class="d-flex align-center pa-4">
264
- <span class="text-h6 font-weight-bold">Attachment</span>
265
-
241
+ <v-card class="screen-modal">
242
+ <v-card-title class="d-flex align-center">
243
+ Attachment
266
244
  <v-spacer />
267
-
268
245
  <v-btn
269
246
  icon="mdi-close"
270
247
  variant="text"
271
- size="small"
248
+ class="screen-modal__close"
249
+ aria-label="Close"
272
250
  @click="(showAttachmentDialog = false), (attachmentUrl = '')"
273
251
  />
274
252
  </v-card-title>
275
253
 
276
- <v-divider />
277
-
278
- <v-card-text class="pa-6">
254
+ <v-card-text class="screen-modal__body">
279
255
  <v-img :src="attachmentUrl" contain />
280
256
  </v-card-text>
281
257
  </v-card>
@@ -13,6 +13,7 @@
13
13
  v-model="month"
14
14
  :items="props.months"
15
15
  label="Month"
16
+ class="filter-field"
16
17
  density="comfortable"
17
18
  :name="props.name + 'custom-input-date-month'"
18
19
  hide-details
@@ -28,6 +29,7 @@
28
29
  label="Day"
29
30
  hide-details
30
31
  placeholder="DD"
32
+ class="filter-field"
31
33
  density="comfortable"
32
34
  :name="props.name + 'custom-input-date-day'"
33
35
  :error="!!validationErrMsg"
@@ -42,6 +44,7 @@
42
44
  label="Year"
43
45
  hide-details
44
46
  placeholder="YYYY"
47
+ class="filter-field"
45
48
  density="comfortable"
46
49
  :name="props.name + 'custom-input-date-year'"
47
50
  :error="!!validationErrMsg"
@@ -11,7 +11,7 @@
11
11
  "
12
12
  >
13
13
  <div
14
- class="d-flex align-center justify-center pa-4 rounded-lg border-dashed border border-grey"
14
+ class="file-drop d-flex align-center justify-center pa-4"
15
15
  @dragover.prevent
16
16
  @drop="handleDrop"
17
17
  style="position: relative; z-index: 1"
@@ -35,12 +35,10 @@
35
35
  class="d-flex align-center"
36
36
  style="z-index: 1; pointer-events: none"
37
37
  >
38
- <v-icon size="28" class="mr-2" color="primary"
38
+ <v-icon size="28" class="file-drop__icon mr-2"
39
39
  >mdi-cloud-upload-outline</v-icon
40
40
  >
41
- <span class="text-body-1 font-weight-medium"
42
- >Drag and drop files here</span
43
- >
41
+ <span class="file-drop__hint">Drag and drop files here</span>
44
42
  </div>
45
43
  </div>
46
44
  </v-col>
@@ -55,11 +53,10 @@
55
53
  "
56
54
  >
57
55
  <v-btn
58
- color="primary-button"
59
- min-width="55"
60
- width="55"
61
- height="55"
56
+ class="screen-btn-primary file-camera"
57
+ variant="flat"
62
58
  elevation="0"
59
+ aria-label="Take a photo"
63
60
  @click="selectAttachment"
64
61
  >
65
62
  <v-icon size="20">mdi-camera-outline</v-icon>
@@ -73,7 +70,7 @@
73
70
  v-for="(file, index) in attachments"
74
71
  :key="index"
75
72
  cols="12"
76
- class="d-flex align-center pa-2 mr-2 mb-2 rounded bg-white border-sm"
73
+ class="file-row d-flex align-center pa-2 mr-2 mb-2"
77
74
  >
78
75
  <div class="mr-3">
79
76
  <!-- <v-img
@@ -108,6 +105,8 @@
108
105
 
109
106
  <v-icon
110
107
  size="small"
108
+ class="file-row__remove"
109
+ aria-label="Remove file"
111
110
  @click.stop="$emit('delete', file)"
112
111
  v-if="
113
112
  props.createdFrom === 'feedback' && props.attachments.length > 0
@@ -234,3 +233,49 @@ defineExpose({
234
233
  },
235
234
  });
236
235
  </script>
236
+
237
+ <style scoped>
238
+ /* The drop zone was `border-dashed border border-grey` with a `primary` glyph -
239
+ `primary` being the FOREGROUND token, used here as an icon colour, and the
240
+ grey a fixed light-theme hairline. */
241
+ .file-drop {
242
+ border: 1px dashed var(--border);
243
+ border-radius: var(--r-inner);
244
+ position: relative;
245
+ z-index: 1;
246
+ }
247
+
248
+ .file-drop__icon {
249
+ color: var(--accent-text);
250
+ }
251
+
252
+ .file-drop__hint {
253
+ font-family: var(--font-sans);
254
+ font-size: var(--fs-cell);
255
+ font-weight: 600;
256
+ color: var(--text);
257
+ }
258
+
259
+ /* Was a 55px square. The design's button is 40px, which is what
260
+ .screen-btn-primary carries; this only keeps it square. */
261
+ .file-camera {
262
+ min-width: var(--btn-h) !important;
263
+ width: var(--btn-h);
264
+ padding: 0 !important;
265
+ }
266
+
267
+ /* Each attachment row was `bg-white border-sm` - a hard white slab drawn on the
268
+ dark theme as well. */
269
+ .file-row {
270
+ background: var(--card);
271
+ border: 1px solid var(--border);
272
+ border-radius: var(--r-inner);
273
+ font-family: var(--font-sans);
274
+ font-size: var(--fs-cell);
275
+ color: var(--text);
276
+ }
277
+
278
+ .file-row__remove {
279
+ color: var(--err);
280
+ }
281
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <v-input v-bind="attrs">
3
- <v-card width="100%" v-bind="attrs">
3
+ <v-card class="perm-list screen-card" elevation="0" width="100%" v-bind="attrs">
4
4
  <v-list
5
5
  v-model:selected="selected"
6
6
  lines="two"
@@ -18,14 +18,14 @@
18
18
  <v-list-group :value="permissionKey" fluid>
19
19
  <template v-slot:activator="{ props }">
20
20
  <v-list-item v-bind="props" density="compact">
21
- <span class="text-capitalize">
21
+ <span class="perm-list__group text-capitalize">
22
22
  {{ formatResourceLabel(String(permissionKey)) }}
23
23
  </span>
24
24
 
25
25
  <template #prepend>
26
- <v-chip class="mr-2" small>
26
+ <span class="perm-list__count mr-2">
27
27
  {{ selectedActionCount(String(permissionKey)) }}
28
- </v-chip>
28
+ </span>
29
29
  </template>
30
30
  </v-list-item>
31
31
  </template>
@@ -34,13 +34,13 @@
34
34
  <v-divider></v-divider>
35
35
  <v-list-item v-if="attrs.readonly" density="compact">
36
36
  <template #title class="pl-2">
37
- <span class="text-subtitle-2 text-capitalize">
37
+ <span class="perm-list__title text-capitalize">
38
38
  {{ String(itemKey).replace(/-/g, " ") }}
39
39
  </span>
40
40
  </template>
41
41
 
42
42
  <template #subtitle class="pl-2">
43
- <span class="text-subtitle-2">{{ item.description }}</span>
43
+ <span class="perm-list__sub">{{ item.description }}</span>
44
44
  </template>
45
45
  </v-list-item>
46
46
 
@@ -50,13 +50,13 @@
50
50
  density="compact"
51
51
  >
52
52
  <template #title class="pl-2">
53
- <span class="text-subtitle-2 text-capitalize">
53
+ <span class="perm-list__title text-capitalize">
54
54
  {{ String(itemKey).replace(/-/g, " ") }}
55
55
  </span>
56
56
  </template>
57
57
 
58
58
  <template #subtitle class="pl-2">
59
- <span class="text-subtitle-2 text-capitalize">
59
+ <span class="perm-list__sub text-capitalize">
60
60
  {{ String(item.description).replace(/-/g, " ") }}
61
61
  </span>
62
62
  </template>
@@ -101,3 +101,51 @@ const selectedActionCount = (resource: string) => {
101
101
  .length;
102
102
  };
103
103
  </script>
104
+
105
+ <style scoped>
106
+ .perm-list {
107
+ font-family: var(--font-sans);
108
+ }
109
+
110
+ .perm-list__group {
111
+ font-size: var(--fs-cell);
112
+ font-weight: 600;
113
+ color: var(--text);
114
+ }
115
+
116
+ /**
117
+ * The count beside each permission group. The handoff draws no counter here at
118
+ * all, so this is the neutral chip's own geometry - 999px, 12px/700, the tone
119
+ * wash - rather than a new shape: a `v-chip small`, which is what it was, is
120
+ * 24px of Vuetify grey with its own font.
121
+ */
122
+ .perm-list__count {
123
+ display: inline-flex;
124
+ align-items: center;
125
+ justify-content: center;
126
+ min-width: 24px;
127
+ height: 20px;
128
+ padding: 0 8px;
129
+ border-radius: var(--r-pill);
130
+ background: var(--hover);
131
+ color: var(--text2);
132
+ font-size: var(--fs-chip);
133
+ font-weight: 700;
134
+ }
135
+
136
+ /* A ticked row was Vuetify's own rgb(224,224,224) slab - a light-theme grey
137
+ painted on the dark theme too. Same emphasis, on the design's hover wash. */
138
+ .perm-list :deep(.v-list-item--active) {
139
+ background: var(--hover);
140
+ }
141
+
142
+ .perm-list__title {
143
+ font-size: var(--fs-cell);
144
+ color: var(--text);
145
+ }
146
+
147
+ .perm-list__sub {
148
+ font-size: var(--fs-cell-dense);
149
+ color: var(--muted);
150
+ }
151
+ </style>
@@ -184,13 +184,20 @@
184
184
 
185
185
  <Snackbar v-model="messageSnackbar" :text="message" :color="messageColor" />
186
186
 
187
- <v-dialog v-model="assignRoleDialog" max-width="400px">
188
- <v-card>
189
- <v-card-title class="text-h5">Assign Role</v-card-title>
190
- <v-card-text>
191
- <v-form v-model="memberRoleForm" @submit.prevent="updateMemberRole()">
187
+ <!--
188
+ Was a `text-h5` title, an untokenised select, and two block buttons - the
189
+ submit one on `color="black"`, not a token, so it drew a light-theme fill
190
+ on the dark theme. The shared `.screen-modal` shape now. The footer stays
191
+ INSIDE the `v-form` because Submit is a `type="submit"` and moving it out
192
+ would break the form's own submit.
193
+ -->
194
+ <v-dialog v-model="assignRoleDialog" max-width="520">
195
+ <v-card class="screen-modal">
196
+ <v-card-title>Assign Role</v-card-title>
197
+ <v-form v-model="memberRoleForm" @submit.prevent="updateMemberRole()">
198
+ <v-card-text class="screen-modal__body">
192
199
  <v-row no-gutters>
193
- <v-col cols="12" class="mb-2">
200
+ <v-col cols="12">
194
201
  <v-row no-gutters>
195
202
  <InputLabel class="text-capitalize" title="Name" required />
196
203
  <v-col cols="12">
@@ -207,6 +214,7 @@
207
214
  : ''
208
215
  "
209
216
  persistent-hint
217
+ class="filter-field"
210
218
  ></v-select>
211
219
  </v-col>
212
220
 
@@ -215,34 +223,27 @@
215
223
  </v-col>
216
224
  </v-row>
217
225
  </v-col>
218
-
219
- <v-col cols="12">
220
- <v-row>
221
- <v-col cols="6">
222
- <v-btn
223
- block
224
- variant="text"
225
- @click="setMember({ mode: 'assign-role' })"
226
- >
227
- Cancel
228
- </v-btn>
229
- </v-col>
230
- <v-col cols="6">
231
- <v-btn
232
- block
233
- variant="flat"
234
- color="black"
235
- :disabled="!memberRoleForm"
236
- type="submit"
237
- >
238
- Submit
239
- </v-btn>
240
- </v-col>
241
- </v-row>
242
- </v-col>
243
226
  </v-row>
244
- </v-form>
245
- </v-card-text>
227
+ </v-card-text>
228
+
229
+ <div class="screen-modal__footer">
230
+ <v-btn
231
+ class="screen-btn-ghost"
232
+ variant="outlined"
233
+ @click="setMember({ mode: 'assign-role' })"
234
+ >
235
+ Cancel
236
+ </v-btn>
237
+ <v-btn
238
+ class="screen-btn-primary"
239
+ variant="flat"
240
+ :disabled="!memberRoleForm"
241
+ type="submit"
242
+ >
243
+ Submit
244
+ </v-btn>
245
+ </div>
246
+ </v-form>
246
247
  </v-card>
247
248
  </v-dialog>
248
249
  </div>
@@ -105,23 +105,23 @@
105
105
  />
106
106
  </v-dialog>
107
107
 
108
- <v-dialog v-model="confirmDialog" max-width="450">
109
- <v-card>
110
- <v-toolbar>
111
- <v-row no-gutters class="fill-height px-6" align="center">
112
- <span class="font-weight-bold text-h6 text-capitalize">
113
- Delete Role
114
- </span>
115
- </v-row>
116
- </v-toolbar>
108
+ <!--
109
+ Was a `v-toolbar` title bar over a toolbar footer of two block buttons,
110
+ the confirm one on `color="black"` - not a token, so it drew a
111
+ light-theme fill on the dark theme. The shared confirmation shape now.
112
+ Same question, same reassignment rows, same disabled rule.
113
+ -->
114
+ <v-dialog v-model="confirmDialog" max-width="520">
115
+ <v-card class="screen-modal">
116
+ <v-card-title>Delete Role</v-card-title>
117
117
 
118
- <v-card-text>
119
- <span v-if="!hasAssignedMembers" class="text-subtitle-2">
118
+ <v-card-text class="screen-modal__body">
119
+ <span v-if="!hasAssignedMembers">
120
120
  Are you sure you want to delete this role? This action cannot be
121
121
  undone.
122
122
  </span>
123
123
  <template v-else>
124
- <p class="text-subtitle-2 mb-4">
124
+ <p class="mb-4">
125
125
  There are currently
126
126
  <span class="text-error font-weight-bold">
127
127
  {{ deletionPreview.members.length }}
@@ -138,7 +138,7 @@
138
138
  class="mb-3 pa-3 border rounded-lg"
139
139
  align="center"
140
140
  >
141
- <v-col cols="12" sm="5" class="text-body-2 mb-2 mb-sm-0">
141
+ <v-col cols="12" sm="5" class="mb-2 mb-sm-0">
142
142
  {{ member.name || member.user }}
143
143
  </v-col>
144
144
  <v-col cols="12" sm="7">
@@ -150,43 +150,32 @@
150
150
  label="Reassign role"
151
151
  density="comfortable"
152
152
  hide-details
153
+ class="filter-field"
153
154
  />
154
155
  </v-col>
155
156
  </v-row>
156
157
  </template>
157
158
  </v-card-text>
158
159
 
159
- <v-toolbar class="pa-0" density="compact">
160
- <v-row no-gutters>
161
- <v-col cols="6" class="pa-0">
162
- <v-btn
163
- block
164
- variant="text"
165
- class="text-none"
166
- size="large"
167
- height="48"
168
- @click="closeDeleteDialog"
169
- :disabled="deleteLoading"
170
- >
171
- Cancel
172
- </v-btn>
173
- </v-col>
174
- <v-col cols="6" class="pa-0">
175
- <v-btn
176
- block
177
- variant="flat"
178
- color="black"
179
- class="text-none font-weight-bold rounded-0"
180
- height="48"
181
- @click="handleDeleteRole"
182
- :loading="deleteLoading"
183
- :disabled="hasAssignedMembers && !canConfirmDeletion"
184
- >
185
- {{ hasAssignedMembers ? "Confirm" : "Delete" }}
186
- </v-btn>
187
- </v-col>
188
- </v-row>
189
- </v-toolbar>
160
+ <div class="screen-modal__footer">
161
+ <v-btn
162
+ class="screen-btn-ghost"
163
+ variant="outlined"
164
+ :disabled="deleteLoading"
165
+ @click="closeDeleteDialog"
166
+ >
167
+ Cancel
168
+ </v-btn>
169
+ <v-btn
170
+ class="screen-btn-primary"
171
+ variant="flat"
172
+ :loading="deleteLoading"
173
+ :disabled="hasAssignedMembers && !canConfirmDeletion"
174
+ @click="handleDeleteRole"
175
+ >
176
+ {{ hasAssignedMembers ? "Confirm" : "Delete" }}
177
+ </v-btn>
178
+ </div>
190
179
  </v-card>
191
180
  </v-dialog>
192
181