@revenexx/cover 0.15.0 → 0.17.0
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/app/api/account.ts +1 -0
- package/app/components/RevenexxForm.vue +183 -19
- package/app/components/account/address/AccountAddressCard.vue +8 -2
- package/app/components/account/address/AccountAddressView.vue +5 -1
- package/app/components/account/carts/AccountCartsTable.vue +85 -3
- package/app/components/account/dashboard/AccountDashboardBudgets.vue +2 -1
- package/app/components/account/dashboard/AccountDashboardRecentOrders.vue +2 -1
- package/app/components/account/dashboard/AccountDashboardRequisitions.vue +2 -1
- package/app/components/account/directorder/AccountDirectOrder.vue +100 -12
- package/app/components/account/governance/AccountApprovalLimitsTable.vue +124 -8
- package/app/components/account/governance/AccountCostCenterDetail.vue +3 -2
- package/app/components/account/governance/AccountCostCentersTable.vue +133 -6
- package/app/components/account/governance/AccountRequisitionDetail.vue +2 -1
- package/app/components/account/governance/AccountRequisitionsTable.vue +102 -6
- package/app/components/account/governance/AccountWorkflowDetail.vue +3 -2
- package/app/components/account/governance/AccountWorkflowsTable.vue +76 -1
- package/app/components/account/governance/GovernanceApprovalLimitModal.vue +8 -0
- package/app/components/account/governance/GovernanceCostCenterModal.vue +7 -0
- package/app/components/account/governance/GovernanceWorkflowModal.vue +7 -0
- package/app/components/account/orderlists/AccountOrderListDetail.vue +14 -4
- package/app/components/account/orderlists/AccountOrderListsTable.vue +115 -7
- package/app/components/account/orders/AccountOrderDetail.vue +67 -3
- package/app/components/account/orders/AccountOrderPay.vue +211 -0
- package/app/components/account/orders/AccountOrdersTable.vue +119 -10
- package/app/components/account/organization/AccountOrganization.vue +6 -0
- package/app/components/account/profile/AccountPasswordForm.vue +2 -0
- package/app/components/account/profile/AccountProfileForm.vue +4 -0
- package/app/components/account/quotes/AccountQuoteDetail.vue +7 -10
- package/app/components/account/team/AccountTeam.vue +91 -0
- package/app/components/auth/AuthLoginTeaser.vue +1 -1
- package/app/components/auth/AuthRegisterPanel.vue +22 -3
- package/app/components/cart/manage/CartNameModal.vue +4 -0
- package/app/components/checkout/onepage/CheckoutAddressSection.vue +5 -1
- package/app/components/checkout/onepage/CheckoutGuestDetailsSection.vue +9 -1
- package/app/components/checkout/onepage/CheckoutSummarySection.vue +6 -1
- package/app/components/form/FormPage.vue +7 -4
- package/app/components/layout/footer/Footer.vue +15 -2
- package/app/components/ui/forms/PasswordInput.vue +2 -0
- package/app/components/ui/table/TableCardList.vue +69 -0
- package/app/components/ui/table/TableSortButton.vue +1 -1
- package/app/components/ui/table/TableToolbar.vue +2 -0
- package/app/components/withdrawal/WithdrawalDeclaration.vue +286 -0
- package/app/composables/useCheckoutOnePage.ts +22 -0
- package/app/composables/useMobileTableSort.ts +82 -0
- package/app/config/forms.ts +8 -0
- package/app/config/navigation.ts +8 -0
- package/app/formkit.config.ts +21 -0
- package/app/interfaces/account/order-list.ts +11 -0
- package/app/interfaces/account/quotes.ts +7 -3
- package/app/pages/punchout/transfer.vue +36 -1
- package/app/pages/widerruf.vue +33 -0
- package/app/shared/addressLines.ts +66 -0
- package/app/shared/checkoutAddressRefusal.ts +63 -0
- package/i18n/locales/de/account.json +13 -1
- package/i18n/locales/de/cart.json +1 -0
- package/i18n/locales/de/checkout.json +1 -1
- package/i18n/locales/de/common.json +7 -0
- package/i18n/locales/de/withdrawal.json +34 -0
- package/i18n/locales/en/account.json +13 -1
- package/i18n/locales/en/cart.json +1 -0
- package/i18n/locales/en/checkout.json +1 -1
- package/i18n/locales/en/common.json +7 -0
- package/i18n/locales/en/withdrawal.json +34 -0
- package/nuxt.config.ts +3 -0
- package/package.json +1 -1
- package/server/api/account/orders/[id]/pay.post.ts +100 -0
- package/server/api/account/orders/[id].get.ts +5 -1
- package/server/api/account/quotes/[id]/order.post.ts +22 -22
- package/server/api/forms/[slug].get.ts +1 -3
- package/server/api/orders/index.post.ts +33 -50
- package/server/api/punchout/return.post.ts +3 -1
- package/server/data/forms/authored.json +69 -8
- package/server/dev/errorHandler.ts +47 -0
- package/server/interfaces/punchout.ts +5 -0
- package/server/middleware/missing-media.ts +35 -0
- package/server/middleware/punchout-hand-back-csp.ts +17 -0
- package/server/plugins/vue-devtools-sink.ts +28 -0
- package/server/services/ApiCartService.ts +75 -6
- package/server/services/MockFormsService.ts +3 -1
- package/server/utils/addressRefusal.ts +63 -0
- package/server/utils/country.ts +23 -0
- package/server/utils/forms.ts +23 -1
- package/server/utils/liveOrders.ts +44 -2
- package/server/utils/orderPayment.ts +155 -0
- package/server/utils/punchoutFormAction.ts +44 -0
package/app/api/account.ts
CHANGED
|
@@ -6,6 +6,7 @@ export const accountApi = {
|
|
|
6
6
|
orderLists: () => "/api/account/order-lists",
|
|
7
7
|
requisitions: () => "/api/account/requisitions",
|
|
8
8
|
orderReturn: (id: string) => `/api/account/orders/${id}/return`,
|
|
9
|
+
orderPay: (id: string) => `/api/account/orders/${id}/pay`,
|
|
9
10
|
addresses: () => "/api/account/addresses",
|
|
10
11
|
addressUpdate: (id: string) => `/api/account/address/${id}`,
|
|
11
12
|
addressCreate: () => "/api/account/address",
|
|
@@ -29,6 +29,12 @@ const props = defineProps<{
|
|
|
29
29
|
* read the matching URL query param automatically (`?product=SKU-123`).
|
|
30
30
|
*/
|
|
31
31
|
context?: Record<string, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Card look of a page that is nothing but this form: the fields sit in one
|
|
34
|
+
* card, and any box the visitor has to tick (consent, terms) in a card of
|
|
35
|
+
* its own below — like the conditions on the register page.
|
|
36
|
+
*/
|
|
37
|
+
cards?: boolean;
|
|
32
38
|
}>();
|
|
33
39
|
|
|
34
40
|
const themeEvents = useThemeEvents();
|
|
@@ -136,18 +142,104 @@ const prefill = computed<Record<string, unknown>>(() => {
|
|
|
136
142
|
return out;
|
|
137
143
|
});
|
|
138
144
|
|
|
139
|
-
/**
|
|
145
|
+
/** The rules of a schema node as a list — the Form Builder writes a pipe string. */
|
|
146
|
+
function validationRules(node: Record<string, unknown>): string[] {
|
|
147
|
+
const rules = Array.isArray(node.validation) ? node.validation.join("|") : node.validation;
|
|
148
|
+
return typeof rules === "string" ? rules.split("|").map(rule => rule.trim()) : [];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// A red asterisk after the label (or a radio group's legend) of a field the
|
|
152
|
+
// visitor cannot leave out — before it on a checkbox, whose label is a whole
|
|
153
|
+
// sentence. Pseudo-content, so the label text stays the authored one.
|
|
154
|
+
const REQUIRED_MARK = "after:content-['*'] after:ml-0.5 after:text-error";
|
|
155
|
+
const REQUIRED_MARK_LEADING = "before:content-['*'] before:mr-0.5 before:text-error";
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The value a field holds right now — the live form once it exists, before that
|
|
159
|
+
* (and during SSR) the pre-fill or the schema's own default.
|
|
160
|
+
*/
|
|
161
|
+
function currentValue(field: string): unknown {
|
|
162
|
+
void tick.value;
|
|
163
|
+
const live = (getNode(formId)?.value as Record<string, unknown> | undefined)?.[field];
|
|
164
|
+
if (live !== undefined) return live;
|
|
165
|
+
if (prefill.value[field] != null) return prefill.value[field];
|
|
166
|
+
return steps.value.flatMap(s => s.nodes).find(n => n.name === field)?.value;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** Whether the rules make a field required at this moment. */
|
|
170
|
+
function isRequiredNow(rules: string[]): boolean {
|
|
171
|
+
return rules.some((rule) => {
|
|
172
|
+
if (rule === "required" || rule === "accepted") return true;
|
|
173
|
+
const [name, args = ""] = rule.split(":");
|
|
174
|
+
if (name !== "requiredIf") return false;
|
|
175
|
+
const [field, expected] = args.split(",").map(arg => arg.trim());
|
|
176
|
+
return field !== undefined && String(currentValue(field) ?? "") === expected;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** A radio group's `label` section is each option; the question is the legend. */
|
|
181
|
+
function markSection(node: Record<string, unknown>): "labelClass" | "legendClass" {
|
|
182
|
+
return node.$formkit === "radio" ? "legendClass" : "labelClass";
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The node's own class for its label (or legend), plus the asterisk while the
|
|
187
|
+
* field is required. A field the schema gives a default (a quantity of 1, a
|
|
188
|
+
* pre-selected radio) cannot be left empty, so a mark would ask for nothing.
|
|
189
|
+
*/
|
|
190
|
+
function markedClass(node: Record<string, unknown>): string {
|
|
191
|
+
const hasDefault = node.value != null && node.value !== "";
|
|
192
|
+
const marked = Boolean(node.$formkit) && !hasDefault && isRequiredNow(validationRules(node));
|
|
193
|
+
const mark = node.$formkit === "checkbox" ? REQUIRED_MARK_LEADING : REQUIRED_MARK;
|
|
194
|
+
return [node[markSection(node)], marked ? mark : ""].filter(Boolean).join(" ");
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** The current label classes of every `requiredIf` field, by name. */
|
|
198
|
+
const rxMarks = computed<Record<string, string>>(() => Object.fromEntries(steps.value
|
|
199
|
+
.flatMap(s => s.nodes)
|
|
200
|
+
.filter(n => typeof n.name === "string" && /^\w+$/.test(n.name)
|
|
201
|
+
&& validationRules(n).some(rule => rule.startsWith("requiredIf:")))
|
|
202
|
+
.map(n => [n.name as string, markedClass(n)])));
|
|
203
|
+
const schemaData = reactive({ rxMarks });
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Strip our internal `rxKind` marker, lock a product field once pre-filled and
|
|
207
|
+
* mark the required ones — a `requiredIf` field only while its condition holds.
|
|
208
|
+
*/
|
|
140
209
|
function cleanNodes(nodes: Record<string, unknown>[]): FormKitSchemaDefinition {
|
|
141
210
|
return nodes.map((n) => {
|
|
142
|
-
|
|
143
|
-
const { rxKind, ...rest } = n;
|
|
211
|
+
const { rxKind, ...rest } = n as Record<string, unknown> & { rxKind?: string };
|
|
144
212
|
if (rxKind === "product" && typeof n.name === "string" && prefill.value[n.name] != null) {
|
|
145
|
-
|
|
213
|
+
rest.readonly = true;
|
|
214
|
+
}
|
|
215
|
+
// A checkbox label runs over several lines: the box sits on the first
|
|
216
|
+
// one (a line-tall inner keeps it centred there), not in the middle.
|
|
217
|
+
if (n.$formkit === "checkbox") {
|
|
218
|
+
rest.wrapperClass = [n.wrapperClass, "!items-start"].filter(Boolean).join(" ");
|
|
219
|
+
rest.innerClass = [n.innerClass, "h-5"].filter(Boolean).join(" ");
|
|
220
|
+
}
|
|
221
|
+
const section = markSection(n);
|
|
222
|
+
if (typeof n.name === "string" && n.name in rxMarks.value) {
|
|
223
|
+
// FormKit compiles a class prop once; an expression it re-evaluates
|
|
224
|
+
// itself lets the mark follow the field the condition points at.
|
|
225
|
+
rest[section] = `$rxMarks.${n.name}`;
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
const classes = markedClass(n);
|
|
229
|
+
if (classes) rest[section] = classes;
|
|
146
230
|
}
|
|
147
231
|
return rest;
|
|
148
232
|
}) as FormKitSchemaDefinition;
|
|
149
233
|
}
|
|
150
234
|
|
|
235
|
+
/**
|
|
236
|
+
* A box the visitor must tick to send the form — consent, terms. Read from the
|
|
237
|
+
* schema rather than a field name, because the tenant authors the form.
|
|
238
|
+
*/
|
|
239
|
+
function isAcknowledgement(node: Record<string, unknown>): boolean {
|
|
240
|
+
return node.$formkit === "checkbox" && validationRules(node).includes("accepted");
|
|
241
|
+
}
|
|
242
|
+
|
|
151
243
|
const formId = useId();
|
|
152
244
|
const stepIndex = ref(0);
|
|
153
245
|
/** Whatever filled the decoy. Kept outside FormKit's value tree so the field
|
|
@@ -238,10 +330,13 @@ async function onSubmit(values: Record<string, unknown>) {
|
|
|
238
330
|
v-else-if="submitted"
|
|
239
331
|
class="space-y-6"
|
|
240
332
|
>
|
|
241
|
-
<
|
|
333
|
+
<component
|
|
334
|
+
:is="cards ? 'section' : 'div'"
|
|
242
335
|
v-if="thankStep && thankStep.nodes.length"
|
|
243
|
-
:
|
|
244
|
-
|
|
336
|
+
:class="{ 'flex flex-col gap-2 rounded-lg bg-default shadow-sm p-6': cards }"
|
|
337
|
+
>
|
|
338
|
+
<FormKitSchema :schema="cleanNodes(thankStep.nodes)" />
|
|
339
|
+
</component>
|
|
245
340
|
<UAlert
|
|
246
341
|
color="success"
|
|
247
342
|
variant="soft"
|
|
@@ -269,7 +364,7 @@ async function onSubmit(values: Record<string, unknown>) {
|
|
|
269
364
|
>
|
|
270
365
|
<!-- Step progress -->
|
|
271
366
|
<p
|
|
272
|
-
v-if="fieldSteps.length > 1"
|
|
367
|
+
v-if="!cards && fieldSteps.length > 1"
|
|
273
368
|
class="mb-4 text-sm text-muted"
|
|
274
369
|
>
|
|
275
370
|
{{ t('forms.step', { current: stepIndex + 1, total: fieldSteps.length }) }}<template v-if="fieldSteps[stepIndex]?.title"> · {{ fieldSteps[stepIndex]?.title }}</template>
|
|
@@ -279,8 +374,51 @@ async function onSubmit(values: Record<string, unknown>) {
|
|
|
279
374
|
v-for="(step, i) in fieldSteps"
|
|
280
375
|
v-show="i === stepIndex"
|
|
281
376
|
:key="step.id"
|
|
377
|
+
class="max-lg:[&_input:not([type=checkbox]):not([type=radio])]:min-h-11 max-lg:[&_select]:min-h-11
|
|
378
|
+
max-lg:[&_.formkit-option_.formkit-wrapper]:min-h-11 max-lg:[&_.formkit-options]:gap-0
|
|
379
|
+
[&_input[readonly]]:bg-elevated [&_input[readonly]]:text-muted [&_input[readonly]]:cursor-default"
|
|
380
|
+
:class="{ 'flex flex-col gap-4': cards }"
|
|
282
381
|
>
|
|
283
|
-
<
|
|
382
|
+
<template v-if="cards">
|
|
383
|
+
<section class="flex flex-col gap-4 rounded-lg bg-default shadow-sm p-6">
|
|
384
|
+
<!-- A step of a multi-step form heads its card like a register section. -->
|
|
385
|
+
<header
|
|
386
|
+
v-if="fieldSteps.length > 1 || step.title"
|
|
387
|
+
class="flex flex-col gap-1"
|
|
388
|
+
>
|
|
389
|
+
<p
|
|
390
|
+
v-if="fieldSteps.length > 1"
|
|
391
|
+
class="text-sm text-muted"
|
|
392
|
+
>
|
|
393
|
+
{{ t('forms.step', { current: i + 1, total: fieldSteps.length }) }}
|
|
394
|
+
</p>
|
|
395
|
+
<h3
|
|
396
|
+
v-if="step.title"
|
|
397
|
+
class="text-xl font-semibold text-highlighted"
|
|
398
|
+
>
|
|
399
|
+
{{ step.title }}
|
|
400
|
+
</h3>
|
|
401
|
+
</header>
|
|
402
|
+
<FormKitSchema
|
|
403
|
+
:schema="cleanNodes(step.nodes.filter(n => !isAcknowledgement(n)))"
|
|
404
|
+
:data="schemaData"
|
|
405
|
+
/>
|
|
406
|
+
</section>
|
|
407
|
+
<section
|
|
408
|
+
v-if="step.nodes.some(isAcknowledgement)"
|
|
409
|
+
class="flex flex-col gap-4 rounded-lg bg-default shadow-sm p-6"
|
|
410
|
+
>
|
|
411
|
+
<FormKitSchema
|
|
412
|
+
:schema="cleanNodes(step.nodes.filter(isAcknowledgement))"
|
|
413
|
+
:data="schemaData"
|
|
414
|
+
/>
|
|
415
|
+
</section>
|
|
416
|
+
</template>
|
|
417
|
+
<FormKitSchema
|
|
418
|
+
v-else
|
|
419
|
+
:schema="cleanNodes(step.nodes)"
|
|
420
|
+
:data="schemaData"
|
|
421
|
+
/>
|
|
284
422
|
</div>
|
|
285
423
|
|
|
286
424
|
<!--
|
|
@@ -304,22 +442,34 @@ async function onSubmit(values: Record<string, unknown>) {
|
|
|
304
442
|
>
|
|
305
443
|
</div>
|
|
306
444
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
445
|
+
<!--
|
|
446
|
+
Cards (a form page): the primary action full width, "back" below it as a
|
|
447
|
+
quiet link with an arrow — like the checkout summary. Otherwise back and
|
|
448
|
+
forward sit on one row.
|
|
449
|
+
-->
|
|
450
|
+
<div
|
|
451
|
+
:class="cards ? 'mt-4 flex flex-col gap-4' : 'mt-6 flex items-center justify-between gap-3'"
|
|
452
|
+
>
|
|
453
|
+
<template v-if="!cards">
|
|
454
|
+
<UButton
|
|
455
|
+
v-if="stepIndex > 0"
|
|
456
|
+
type="button"
|
|
457
|
+
color="neutral"
|
|
458
|
+
variant="ghost"
|
|
459
|
+
class="max-lg:min-h-11"
|
|
460
|
+
:label="t('forms.back')"
|
|
461
|
+
@click="back"
|
|
462
|
+
/>
|
|
463
|
+
<span v-else />
|
|
464
|
+
</template>
|
|
317
465
|
|
|
318
466
|
<UButton
|
|
319
467
|
v-if="!isLastStep"
|
|
320
468
|
type="button"
|
|
321
469
|
color="primary"
|
|
322
470
|
:disabled="!activeStepValid"
|
|
471
|
+
class="max-lg:min-h-11"
|
|
472
|
+
:block="cards"
|
|
323
473
|
:label="t('forms.continue')"
|
|
324
474
|
@click="next"
|
|
325
475
|
/>
|
|
@@ -329,9 +479,23 @@ async function onSubmit(values: Record<string, unknown>) {
|
|
|
329
479
|
color="primary"
|
|
330
480
|
:loading="submitting"
|
|
331
481
|
:disabled="!activeStepValid"
|
|
482
|
+
class="max-lg:min-h-11"
|
|
483
|
+
:block="cards"
|
|
332
484
|
:label="submitLabel"
|
|
333
485
|
@click="triggerSubmit"
|
|
334
486
|
/>
|
|
487
|
+
|
|
488
|
+
<UButton
|
|
489
|
+
v-if="cards && stepIndex > 0"
|
|
490
|
+
type="button"
|
|
491
|
+
color="neutral"
|
|
492
|
+
variant="ghost"
|
|
493
|
+
block
|
|
494
|
+
class="max-lg:min-h-11"
|
|
495
|
+
:icon="icon('arrow-left')"
|
|
496
|
+
:label="t('forms.back')"
|
|
497
|
+
@click="back"
|
|
498
|
+
/>
|
|
335
499
|
</div>
|
|
336
500
|
|
|
337
501
|
<UAlert
|
|
@@ -82,6 +82,7 @@ function confirmDelete() {
|
|
|
82
82
|
:icon="icon('edit')"
|
|
83
83
|
variant="ghost"
|
|
84
84
|
color="primary"
|
|
85
|
+
class="shrink-0 max-lg:size-11 max-lg:justify-center"
|
|
85
86
|
:aria-label="t('actions.edit')"
|
|
86
87
|
@click="emit('toggle-edit')"
|
|
87
88
|
/>
|
|
@@ -94,6 +95,7 @@ function confirmDelete() {
|
|
|
94
95
|
:icon="icon('delete')"
|
|
95
96
|
variant="ghost"
|
|
96
97
|
color="error"
|
|
98
|
+
class="shrink-0 max-lg:size-11 max-lg:justify-center"
|
|
97
99
|
:aria-label="t('addresses.actions.delete')"
|
|
98
100
|
@click="confirmDeleteOpen = true"
|
|
99
101
|
/>
|
|
@@ -104,7 +106,7 @@ function confirmDelete() {
|
|
|
104
106
|
variant="ghost"
|
|
105
107
|
color="neutral"
|
|
106
108
|
disabled
|
|
107
|
-
class="text-gray-300 dark:text-gray-600"
|
|
109
|
+
class="shrink-0 text-gray-300 dark:text-gray-600 max-lg:size-11 max-lg:justify-center"
|
|
108
110
|
:aria-label="t('addresses.actions.delete')"
|
|
109
111
|
/>
|
|
110
112
|
</div>
|
|
@@ -139,7 +141,7 @@ function confirmDelete() {
|
|
|
139
141
|
:actions="false"
|
|
140
142
|
@submit="emit('submit')"
|
|
141
143
|
>
|
|
142
|
-
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
|
144
|
+
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 max-lg:[&_input:not([type=checkbox])]:min-h-11 max-lg:[&_select]:min-h-11">
|
|
143
145
|
<FormKit
|
|
144
146
|
v-model="formState.label"
|
|
145
147
|
type="text"
|
|
@@ -246,6 +248,7 @@ function confirmDelete() {
|
|
|
246
248
|
<div class="flex justify-end">
|
|
247
249
|
<UButton
|
|
248
250
|
type="submit"
|
|
251
|
+
class="max-lg:min-h-11"
|
|
249
252
|
:loading="isSaving"
|
|
250
253
|
:label="t('addresses.actions.save')"
|
|
251
254
|
/>
|
|
@@ -256,6 +259,7 @@ function confirmDelete() {
|
|
|
256
259
|
<UModal
|
|
257
260
|
v-model:open="confirmDeleteOpen"
|
|
258
261
|
:title="t('addresses.delete.title')"
|
|
262
|
+
:close="{ class: 'max-lg:size-11 max-lg:justify-center' }"
|
|
259
263
|
>
|
|
260
264
|
<template #body>
|
|
261
265
|
<p class="text-sm text-muted">
|
|
@@ -266,12 +270,14 @@ function confirmDelete() {
|
|
|
266
270
|
<UButton
|
|
267
271
|
color="neutral"
|
|
268
272
|
variant="ghost"
|
|
273
|
+
class="max-lg:min-h-11"
|
|
269
274
|
@click="confirmDeleteOpen = false"
|
|
270
275
|
>
|
|
271
276
|
{{ t('addresses.delete.cancel') }}
|
|
272
277
|
</UButton>
|
|
273
278
|
<UButton
|
|
274
279
|
color="error"
|
|
280
|
+
class="max-lg:min-h-11"
|
|
275
281
|
@click="confirmDelete"
|
|
276
282
|
>
|
|
277
283
|
{{ t('addresses.delete.submit') }}
|
|
@@ -253,6 +253,7 @@ async function onAddAddress() {
|
|
|
253
253
|
>
|
|
254
254
|
<UButton
|
|
255
255
|
:icon="icon('plus')"
|
|
256
|
+
class="max-lg:min-h-11"
|
|
256
257
|
:label="t('addresses.actions.add')"
|
|
257
258
|
@click="addModalOpen = true"
|
|
258
259
|
/>
|
|
@@ -330,6 +331,7 @@ async function onAddAddress() {
|
|
|
330
331
|
<UModal
|
|
331
332
|
v-model:open="addModalOpen"
|
|
332
333
|
:title="t('addresses.add.title')"
|
|
334
|
+
:close="{ class: 'max-lg:size-11 max-lg:justify-center' }"
|
|
333
335
|
>
|
|
334
336
|
<template #body>
|
|
335
337
|
<FormKit
|
|
@@ -337,7 +339,7 @@ async function onAddAddress() {
|
|
|
337
339
|
:actions="false"
|
|
338
340
|
@submit="onAddAddress"
|
|
339
341
|
>
|
|
340
|
-
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
|
342
|
+
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 max-lg:[&_input:not([type=checkbox])]:min-h-11 max-lg:[&_select]:min-h-11">
|
|
341
343
|
<FormKit
|
|
342
344
|
v-model="addFormState.label"
|
|
343
345
|
type="text"
|
|
@@ -441,12 +443,14 @@ async function onAddAddress() {
|
|
|
441
443
|
<UButton
|
|
442
444
|
color="neutral"
|
|
443
445
|
variant="ghost"
|
|
446
|
+
class="max-lg:min-h-11"
|
|
444
447
|
@click="addModalOpen = false"
|
|
445
448
|
>
|
|
446
449
|
{{ t('addresses.delete.cancel') }}
|
|
447
450
|
</UButton>
|
|
448
451
|
<UButton
|
|
449
452
|
type="submit"
|
|
453
|
+
class="max-lg:min-h-11"
|
|
450
454
|
:loading="isAdding"
|
|
451
455
|
>
|
|
452
456
|
{{ t('addresses.add.submit') }}
|
|
@@ -55,6 +55,14 @@ const columns = computed<TableColumn<CartSummaryEntry>[]>(() => [
|
|
|
55
55
|
|
|
56
56
|
const formatDate = (value: string) => d(new Date(value), { dateStyle: "medium", timeStyle: "short" });
|
|
57
57
|
|
|
58
|
+
/* ---- mobile card list (below md) ---------------------------------------- */
|
|
59
|
+
const { items: sortItems, model: mobileSort, sorted: sortedCarts } = useMobileTableSort(filtered, sorting, () => [
|
|
60
|
+
{ id: "updatedAt", label: t("cart.multi.page.columns.updatedAt"), kind: "date", value: summary => summary.updatedAt },
|
|
61
|
+
{ id: "name", label: t("cart.multi.page.columns.name"), kind: "text", value: summary => summary.name },
|
|
62
|
+
{ id: "value", label: t("cart.multi.page.columns.value"), kind: "number", value: summary => summary.value },
|
|
63
|
+
{ id: "positions", label: t("cart.multi.page.columns.positions"), kind: "number", value: summary => summary.positions },
|
|
64
|
+
]);
|
|
65
|
+
|
|
58
66
|
/* ---- actions ------------------------------------------------------------ */
|
|
59
67
|
const createOpen = ref(false);
|
|
60
68
|
const renameOpen = ref(false);
|
|
@@ -127,6 +135,7 @@ function onDelete(): void {
|
|
|
127
135
|
<UButton
|
|
128
136
|
color="primary"
|
|
129
137
|
tabindex="0"
|
|
138
|
+
class="max-lg:min-h-11"
|
|
130
139
|
:icon="icon('plus')"
|
|
131
140
|
:label="t('cart.multi.newCart')"
|
|
132
141
|
@click="createOpen = true"
|
|
@@ -134,8 +143,75 @@ function onDelete(): void {
|
|
|
134
143
|
</template>
|
|
135
144
|
</UiTableToolbar>
|
|
136
145
|
|
|
146
|
+
<UiTableCardList
|
|
147
|
+
v-model:sort="mobileSort"
|
|
148
|
+
:rows="sortedCarts"
|
|
149
|
+
:row-key="summary => summary.id"
|
|
150
|
+
:sort-items="sortItems"
|
|
151
|
+
>
|
|
152
|
+
<template #item="{ row }">
|
|
153
|
+
<div class="space-y-1">
|
|
154
|
+
<div class="flex flex-wrap items-center gap-1.5">
|
|
155
|
+
<span class="font-semibold text-highlighted break-words min-w-0">{{ row.name }}</span>
|
|
156
|
+
<UBadge
|
|
157
|
+
v-if="row.active"
|
|
158
|
+
color="primary"
|
|
159
|
+
variant="subtle"
|
|
160
|
+
size="sm"
|
|
161
|
+
:label="t('cart.multi.activeBadge')"
|
|
162
|
+
/>
|
|
163
|
+
</div>
|
|
164
|
+
<p class="text-sm tabular-nums">
|
|
165
|
+
<span class="text-muted">{{ t('cart.multi.page.positionsCount', row.positions) }}</span>
|
|
166
|
+
<span class="text-dimmed"> · </span>
|
|
167
|
+
<span class="text-highlighted">{{ formatCurrency(row.value) }}</span>
|
|
168
|
+
</p>
|
|
169
|
+
</div>
|
|
170
|
+
<div class="flex items-center justify-between gap-2 mt-1 -mb-2.5 -me-2.5">
|
|
171
|
+
<p class="text-xs text-muted min-w-0">
|
|
172
|
+
{{ t('cart.multi.page.columns.updatedAt') }}: {{ formatDate(row.updatedAt) }}
|
|
173
|
+
</p>
|
|
174
|
+
<div class="flex items-center shrink-0">
|
|
175
|
+
<UButton
|
|
176
|
+
v-if="!row.active"
|
|
177
|
+
color="primary"
|
|
178
|
+
variant="soft"
|
|
179
|
+
class="size-11 justify-center"
|
|
180
|
+
:icon="icon('cart')"
|
|
181
|
+
:aria-label="t('cart.multi.activate')"
|
|
182
|
+
@click="activate(row)"
|
|
183
|
+
/>
|
|
184
|
+
<UButton
|
|
185
|
+
color="neutral"
|
|
186
|
+
variant="ghost"
|
|
187
|
+
class="size-11 justify-center"
|
|
188
|
+
:icon="icon('edit')"
|
|
189
|
+
:aria-label="t('cart.multi.rename')"
|
|
190
|
+
@click="openRename(row)"
|
|
191
|
+
/>
|
|
192
|
+
<UButton
|
|
193
|
+
color="neutral"
|
|
194
|
+
variant="ghost"
|
|
195
|
+
class="size-11 justify-center"
|
|
196
|
+
:icon="icon('delete')"
|
|
197
|
+
:aria-label="t('cart.multi.delete')"
|
|
198
|
+
@click="deleteTarget = row"
|
|
199
|
+
/>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</template>
|
|
203
|
+
<template #empty>
|
|
204
|
+
<UiFeedbackEmptyState
|
|
205
|
+
:icon="icon('cart')"
|
|
206
|
+
:title="t('cart.multi.page.empty.title')"
|
|
207
|
+
:description="t('cart.multi.page.empty.description')"
|
|
208
|
+
/>
|
|
209
|
+
</template>
|
|
210
|
+
</UiTableCardList>
|
|
211
|
+
|
|
137
212
|
<UTable
|
|
138
213
|
v-model:sorting="sorting"
|
|
214
|
+
class="hidden md:block"
|
|
139
215
|
:data="filtered"
|
|
140
216
|
:columns="columns"
|
|
141
217
|
:ui="tableUi"
|
|
@@ -166,7 +242,7 @@ function onDelete(): void {
|
|
|
166
242
|
</template>
|
|
167
243
|
|
|
168
244
|
<template #name-cell="{ row }">
|
|
169
|
-
<span class="font-semibold text-highlighted">{{ row.original.name }}</span>
|
|
245
|
+
<span class="font-semibold text-highlighted whitespace-normal block min-w-28">{{ row.original.name }}</span>
|
|
170
246
|
</template>
|
|
171
247
|
<template #positions-cell="{ row }">
|
|
172
248
|
<span class="tabular-nums">{{ row.original.positions }}</span>
|
|
@@ -175,7 +251,7 @@ function onDelete(): void {
|
|
|
175
251
|
<span class="tabular-nums text-highlighted">{{ formatCurrency(row.original.value) }}</span>
|
|
176
252
|
</template>
|
|
177
253
|
<template #updatedAt-cell="{ row }">
|
|
178
|
-
{{ formatDate(row.original.updatedAt) }}
|
|
254
|
+
<span class="max-lg:whitespace-normal">{{ formatDate(row.original.updatedAt) }}</span>
|
|
179
255
|
</template>
|
|
180
256
|
<template #status-cell="{ row }">
|
|
181
257
|
<UBadge
|
|
@@ -191,7 +267,7 @@ function onDelete(): void {
|
|
|
191
267
|
>—</span>
|
|
192
268
|
</template>
|
|
193
269
|
<template #actions-cell="{ row }">
|
|
194
|
-
<div class="flex items-center justify-end gap-1">
|
|
270
|
+
<div class="flex items-center justify-end gap-1 max-lg:gap-0">
|
|
195
271
|
<UTooltip
|
|
196
272
|
v-if="!row.original.active"
|
|
197
273
|
:text="t('cart.multi.activate')"
|
|
@@ -201,6 +277,7 @@ function onDelete(): void {
|
|
|
201
277
|
variant="soft"
|
|
202
278
|
size="sm"
|
|
203
279
|
tabindex="0"
|
|
280
|
+
class="max-lg:size-11 max-lg:justify-center"
|
|
204
281
|
:icon="icon('cart')"
|
|
205
282
|
:aria-label="t('cart.multi.activate')"
|
|
206
283
|
@click="activate(row.original)"
|
|
@@ -212,6 +289,7 @@ function onDelete(): void {
|
|
|
212
289
|
variant="ghost"
|
|
213
290
|
size="sm"
|
|
214
291
|
tabindex="0"
|
|
292
|
+
class="max-lg:size-11 max-lg:justify-center"
|
|
215
293
|
:icon="icon('edit')"
|
|
216
294
|
:aria-label="t('cart.multi.rename')"
|
|
217
295
|
@click="openRename(row.original)"
|
|
@@ -223,6 +301,7 @@ function onDelete(): void {
|
|
|
223
301
|
variant="ghost"
|
|
224
302
|
size="sm"
|
|
225
303
|
tabindex="0"
|
|
304
|
+
class="max-lg:size-11 max-lg:justify-center"
|
|
226
305
|
:icon="icon('delete')"
|
|
227
306
|
:aria-label="t('cart.multi.delete')"
|
|
228
307
|
@click="deleteTarget = row.original"
|
|
@@ -255,6 +334,7 @@ function onDelete(): void {
|
|
|
255
334
|
<UModal
|
|
256
335
|
:open="deleteTarget !== null"
|
|
257
336
|
:title="t('cart.multi.deleteTitle')"
|
|
337
|
+
:close="{ class: 'max-lg:size-11 max-lg:justify-center' }"
|
|
258
338
|
@update:open="(value: boolean) => { if (!value) deleteTarget = null; }"
|
|
259
339
|
>
|
|
260
340
|
<template #body>
|
|
@@ -270,12 +350,14 @@ function onDelete(): void {
|
|
|
270
350
|
color="neutral"
|
|
271
351
|
variant="ghost"
|
|
272
352
|
tabindex="0"
|
|
353
|
+
class="max-lg:min-h-11"
|
|
273
354
|
:label="t('cart.item.cancel')"
|
|
274
355
|
@click="deleteTarget = null"
|
|
275
356
|
/>
|
|
276
357
|
<UButton
|
|
277
358
|
color="error"
|
|
278
359
|
tabindex="0"
|
|
360
|
+
class="max-lg:min-h-11"
|
|
279
361
|
:label="t('cart.multi.delete')"
|
|
280
362
|
@click="onDelete"
|
|
281
363
|
/>
|
|
@@ -23,7 +23,8 @@ const {
|
|
|
23
23
|
{{ t('account.dashboard.budgets') }}
|
|
24
24
|
</h2>
|
|
25
25
|
<ULink
|
|
26
|
-
class="text-xs font-medium text-primary hover:underline
|
|
26
|
+
class="inline-flex shrink-0 items-center whitespace-nowrap text-xs font-medium text-primary hover:underline
|
|
27
|
+
max-lg:-my-3 max-lg:min-h-11"
|
|
27
28
|
:to="localePath('/account/cost-centers')"
|
|
28
29
|
>
|
|
29
30
|
{{ t('account.dashboard.viewAll') }} →
|
|
@@ -25,7 +25,8 @@ const {
|
|
|
25
25
|
{{ t('account.dashboard.recentOrders') }}
|
|
26
26
|
</h2>
|
|
27
27
|
<ULink
|
|
28
|
-
class="text-xs font-medium text-primary hover:underline
|
|
28
|
+
class="inline-flex shrink-0 items-center whitespace-nowrap text-xs font-medium text-primary hover:underline
|
|
29
|
+
max-lg:-my-3 max-lg:min-h-11"
|
|
29
30
|
:to="localePath('/account/orders')"
|
|
30
31
|
>
|
|
31
32
|
{{ t('account.dashboard.viewAll') }} →
|
|
@@ -23,7 +23,8 @@ const {
|
|
|
23
23
|
{{ t('account.dashboard.openRequisitions') }}
|
|
24
24
|
</h2>
|
|
25
25
|
<ULink
|
|
26
|
-
class="text-xs font-medium text-primary hover:underline
|
|
26
|
+
class="inline-flex shrink-0 items-center whitespace-nowrap text-xs font-medium text-primary hover:underline
|
|
27
|
+
max-lg:-my-3 max-lg:min-h-11"
|
|
27
28
|
:to="localePath('/account/requisitions')"
|
|
28
29
|
>
|
|
29
30
|
{{ t('account.dashboard.viewAll') }} →
|