@wisemen/wise-invoicing-web 0.16.0 → 0.18.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/dist/{ApprovalReminderSettingsViewDataProvider-CpGYtZKw.js → ApprovalReminderSettingsViewDataProvider-BZBuz6EF.js} +4 -4
- package/dist/{BillingDocumentDetailViewDataProvider-CA71dgRN.js → BillingDocumentDetailViewDataProvider-BCADHPFR.js} +1080 -1079
- package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
- package/dist/{BillingDocumentPdf-CvUxfHDH.js → BillingDocumentPdf-ddBlGdIN.js} +4 -4
- package/dist/{CreditNoteDetailViewDataProvider-DK7hkA8d.js → CreditNoteDetailViewDataProvider-Donn5pVv.js} +222 -205
- package/dist/{CreditNotePdfViewDataProvider-DcQxB1p4.js → CreditNotePdfViewDataProvider-c-apCeCW.js} +3 -3
- package/dist/{DunningCaseSendDialog-BWbEi9Vr.js → DunningCaseSendDialog-fgL9OsV8.js} +3 -3
- package/dist/{InvoiceApprovalOutOfSyncIndicator-CptL1bbz.js → InvoiceApprovalOutOfSyncIndicator-BoPBNXx1.js} +1 -1
- package/dist/{InvoiceApprovalOverviewView-dsTZWXyZ.js → InvoiceApprovalOverviewView-BIiJ6gen.js} +9 -9
- package/dist/{InvoiceApprovalStatusBadge-6cSp2XOq.js → InvoiceApprovalStatusBadge-CaVSCtI0.js} +4 -4
- package/dist/{InvoiceApproveDialogDataProvider-DsxA74kh.js → InvoiceApproveDialogDataProvider-C9NhZX-D.js} +7 -7
- package/dist/{InvoiceDeliverySendDialog-byobpQe1.js → InvoiceDeliverySendDialog-BICcd6Cf.js} +186 -114
- package/dist/{InvoiceDetailViewDataProvider-DgNkoQNH.js → InvoiceDetailViewDataProvider-BppXFT6D.js} +609 -600
- package/dist/{InvoicePdfView-CA-nt_Qs.js → InvoicePdfView-BRJaAErd.js} +2 -2
- package/dist/{InvoicePdfViewDataProvider-CVgcgc9t.js → InvoicePdfViewDataProvider-J7NP1Dhh.js} +3 -3
- package/dist/{InvoicePublicProFormaPdfViewDataProvider-BIhn-msJ.js → InvoicePublicProFormaPdfViewDataProvider-mZaggXYf.js} +3 -3
- package/dist/{InvoicingFileUploadProvider-DFjM7Xcj.js → InvoicingFileUploadProvider-rU9APFrt.js} +2 -2
- package/dist/{IssuerSettingsViewDataProvider-2Gk7FgL2.js → IssuerSettingsViewDataProvider-D13f6rvi.js} +4 -4
- package/dist/{PeppolSettingsViewDataProvider-CLgFRfm_.js → PeppolSettingsViewDataProvider-DymLdaRM.js} +3 -3
- package/dist/{api.util-DMgdn9-w.js → api.util-sW4gNny-.js} +832 -779
- package/dist/{billingDocumentDetail.transformer-DFlbGUZp.js → billingDocumentDetail.transformer-DcNMzl46.js} +3 -2
- package/dist/client/index.d.ts +1 -1
- package/dist/client/sdk.gen.d.ts +1 -1
- package/dist/client/types.gen.d.ts +134 -70
- package/dist/client/zod.gen.d.ts +15385 -11665
- package/dist/{creditNoteDetail.query-D7J1umi4.js → creditNoteDetail.query-DiS_-xFz.js} +5 -3
- package/dist/{deliveryReason.util-iMVhwjiW.js → deliveryReason.util-KBh3q_-P.js} +2 -2
- package/dist/{dist-Ck8ZEByl.js → dist-C99_-gWv.js} +2 -2
- package/dist/{dist-ByzJNujV.js → dist-CyUNvdkD.js} +1 -1
- package/dist/{documentTitle.composable-QdSLs6eT.js → documentTitle.composable-Dl8Cm3v3.js} +1 -1
- package/dist/{i18n.lib-CEXUpXfo.js → i18n.lib-DckceEsg.js} +12 -2
- package/dist/index.d.ts +10 -0
- package/dist/index.js +789 -844
- package/dist/{invoice.service-NBqJSMkg.js → invoice.service-2QiktTs9.js} +14 -6
- package/dist/{invoiceApproval.service-Bk--tRnu.js → invoiceApproval.service-DXIKgCI_.js} +2 -2
- package/dist/{invoiceApprovalStatus.util-CYWPHuJD.js → invoiceApprovalStatus.util-CB5pi_hm.js} +2 -2
- package/dist/{invoiceCustomer.service-D13Cwb13.js → invoiceCustomer.service-BNQJt1KV.js} +2 -2
- package/dist/{invoiceDeliveryStatus.util-BExQWz3m.js → invoiceDeliveryStatus.util-Dp9hD1Tj.js} +3 -3
- package/dist/{invoiceDetail.query-CLvnFeZh.js → invoiceDetail.query-MIrBYgNS.js} +1 -1
- package/dist/{invoicingConfig.composable-BebjIIAC.js → invoicingConfig.composable-D-hxnEnh.js} +2 -2
- package/dist/{issuerSettings.query-P_gGS0ER.js → issuerSettings.query-CR7EtvNm.js} +2 -2
- package/dist/libs/i18n.lib.d.ts +10 -0
- package/dist/locales/en-US.json.d.ts +6 -1
- package/dist/locales/nl-BE.json.d.ts +6 -1
- package/dist/models/billing-document/billingDocumentDetail.model.d.ts +1 -0
- package/dist/modules/credit-note/api/mutations/creditNoteUpdate.mutation.d.ts +1 -0
- package/dist/modules/credit-note/models/update/creditNoteUpdateForm.model.d.ts +1 -0
- package/dist/modules/invoice/api/mutations/invoiceBulkFinalize.mutation.d.ts +1 -0
- package/dist/modules/invoice/api/mutations/invoiceUpdate.mutation.d.ts +1 -0
- package/dist/modules/invoice/api/services/invoice.service.d.ts +1 -1
- package/dist/modules/invoice/models/invoice/payment/invoicePaymentCreateForm.model.d.ts +1 -1
- package/dist/modules/invoice/models/invoice/update/invoiceUpdateForm.model.d.ts +1 -0
- package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkActionDialog.vue.d.ts +11 -1
- package/dist/{reminderConfig.query-s-gBYoPo.js → reminderConfig.query-DJmhJp6W.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/types/apiError.type.d.ts +2 -2
- package/package.json +4 -4
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import "./api.util-
|
|
2
|
-
import { C as e, N as t, P as n, S as r, f as i, i as a, l as o, m as s, n as c, o as l, p as u, r as d, t as f, u as p, v as m, x as h, y as g } from "./documentTitle.composable-
|
|
1
|
+
import "./api.util-sW4gNny-.js";
|
|
2
|
+
import { C as e, N as t, P as n, S as r, f as i, i as a, l as o, m as s, n as c, o as l, p as u, r as d, t as f, u as p, v as m, x as h, y as g } from "./documentTitle.composable-Dl8Cm3v3.js";
|
|
3
3
|
import { n as _, r as v, t as y } from "./useCurrencyFormat.composable-MtZaqKnO.js";
|
|
4
|
-
import { n as b } from "./invoicingConfig.composable-
|
|
5
|
-
import { r as x, t as S } from "./invoice.service-
|
|
6
|
-
import {
|
|
4
|
+
import { n as b } from "./invoicingConfig.composable-D-hxnEnh.js";
|
|
5
|
+
import { r as x, t as S } from "./invoice.service-2QiktTs9.js";
|
|
6
|
+
import { i as ee, n as C, o as w } from "./InvoiceDeliverySendDialog-BICcd6Cf.js";
|
|
7
7
|
import { n as te } from "./download.util-LyRpGWKA.js";
|
|
8
8
|
import { t as ne } from "./percentage.util-Bl78kSSk.js";
|
|
9
9
|
import { $ as re, B as ie, C as T, D as ae, E as oe, J as se, K as ce, L as le, M as ue, O as de, Q as fe, R as pe, S as me, St as he, Tt as ge, W as _e, X as ve, Y as ye, Z as be, _ as xe, _t as Se, at as Ce, c as we, ct as Te, et as Ee, f as De, ft as Oe, g as ke, gt as Ae, h as je, ht as Me, it as Ne, k as Pe, nt as Fe, o as Ie, ot as Le, p as Re, q as ze, r as Be, s as Ve, t as He, tt as Ue, v as We, vt as Ge, w as Ke, wt as qe, x as Je, xt as Ye, y as Xe, z as Ze } from "./dist-B33lNwLw.js";
|
|
10
|
-
import { r as Qe } from "./dist-
|
|
10
|
+
import { r as Qe } from "./dist-CyUNvdkD.js";
|
|
11
11
|
import { t as $e } from "./DataProvider-BtnD-BzI.js";
|
|
12
12
|
import { t as et } from "./formango.util-D5c2ql--.js";
|
|
13
13
|
import { t as tt } from "./dist-CwkVU5yS.js";
|
|
14
|
-
import { t as nt } from "./invoiceApprovalStatus.util-
|
|
15
|
-
import { t as rt } from "./InvoiceApprovalStatusBadge-
|
|
16
|
-
import { t as it } from "./deliveryReason.util-
|
|
14
|
+
import { t as nt } from "./invoiceApprovalStatus.util-CB5pi_hm.js";
|
|
15
|
+
import { t as rt } from "./InvoiceApprovalStatusBadge-CaVSCtI0.js";
|
|
16
|
+
import { t as it } from "./deliveryReason.util-KBh3q_-P.js";
|
|
17
17
|
import { t as at } from "./dashboard-BaWGNEek.js";
|
|
18
|
-
import { n as ot, r as st, t as ct } from "./BillingDocumentPdf-
|
|
19
|
-
import { n as lt, r as ut, t as dt } from "./InvoicingFileUploadProvider-
|
|
18
|
+
import { n as ot, r as st, t as ct } from "./BillingDocumentPdf-ddBlGdIN.js";
|
|
19
|
+
import { n as lt, r as ut, t as dt } from "./InvoicingFileUploadProvider-rU9APFrt.js";
|
|
20
20
|
import ft, { z as E } from "zod";
|
|
21
21
|
import { useI18n as D } from "vue-i18n";
|
|
22
|
-
import { Fragment as O, computed as k, createBlock as A, createCommentVNode as j, createElementBlock as M, createElementVNode as N, createStaticVNode as pt, createTextVNode as mt, createVNode as P, defineComponent as F, getCurrentInstance as ht, guardReactiveProps as gt, h as _t, inject as vt, isRef as yt, mergeModels as bt, mergeProps as I, nextTick as xt, normalizeClass as
|
|
23
|
-
import { useQueryClient as
|
|
24
|
-
import { QueryClient as
|
|
25
|
-
import { refDebounced as
|
|
26
|
-
import { RouterLink as
|
|
27
|
-
import { Temporal as
|
|
28
|
-
import { UIActionTooltip as
|
|
29
|
-
import { useViewModels as
|
|
30
|
-
import { useForm as
|
|
22
|
+
import { Fragment as O, computed as k, createBlock as A, createCommentVNode as j, createElementBlock as M, createElementVNode as N, createStaticVNode as pt, createTextVNode as mt, createVNode as P, defineComponent as F, getCurrentInstance as ht, guardReactiveProps as gt, h as _t, inject as vt, isRef as yt, mergeModels as bt, mergeProps as I, nextTick as xt, normalizeClass as L, normalizeProps as St, normalizeStyle as Ct, onBeforeUnmount as wt, onMounted as Tt, onUnmounted as Et, openBlock as R, provide as Dt, reactive as Ot, ref as z, renderList as kt, renderSlot as At, resolveDynamicComponent as jt, toDisplayString as B, toRefs as Mt, unref as V, useAttrs as Nt, useModel as Pt, useTemplateRef as Ft, vShow as It, watch as Lt, withCtx as H, withDirectives as Rt, withKeys as zt, withModifiers as Bt } from "vue";
|
|
23
|
+
import { useQueryClient as Vt } from "@tanstack/vue-query";
|
|
24
|
+
import { QueryClient as Ht, useMutation as Ut, useQuery as Wt } from "@wisemen/vue-core-api-utils";
|
|
25
|
+
import { refDebounced as Gt, useInfiniteScroll as Kt, useIntervalFn as qt, useLocalStorage as Jt, useResizeObserver as Yt, watchDebounced as Xt } from "@vueuse/core";
|
|
26
|
+
import { RouterLink as Zt, useRouter as Qt } from "vue-router";
|
|
27
|
+
import { Temporal as $t } from "temporal-polyfill";
|
|
28
|
+
import { UIActionTooltip as en, UIBadge as tn, UIButton as nn, UICheckbox as rn, UIClickableElement as an, UIColumnLayout as on, UIDashboardPage as sn, UIDashboardPageCenteredContentScrollable as cn, UIDateField as ln, UIDetailListGroup as un, UIDialogBody as dn, UIDialogFooter as fn, UIDialogFooterCancel as pn, UIDialogFooterSubmit as mn, UIDialogHeader as hn, UIDropdownMenu as gn, UIDropdownMenuGroup as _n, UIDropdownMenuItem as vn, UIDropdownMenuSeparator as yn, UIEmptyState as bn, UIForm as xn, UIFormDialog as Sn, UIFormFileUpload as Cn, UIIconButton as wn, UINumberBadge as Tn, UINumberField as En, UIPopover as Dn, UIRowLayout as U, UISelect as On, UISelectDropdown as kn, UISeparator as An, UISwitch as jn, UITabs as Mn, UITabsItem as Nn, UITabsList as Pn, UITagsField as Fn, UIText as W, UITextField as In, UITextareaField as Ln, UITimeField as Rn, UITimeline as zn, UITimelineItem as Bn, UITooltip as Vn, UITooltipContent as Hn, createSelectOptions as Un, useOverlay as Wn, useToast as Gn } from "@wisemen/vue-core-design-system";
|
|
29
|
+
import { useViewModels as Kn } from "@wisemen/vue-core-actions";
|
|
30
|
+
import { useForm as qn } from "formango";
|
|
31
31
|
//#region src/composables/form-auto-save/formAutoSave.composable.ts
|
|
32
|
-
var
|
|
33
|
-
function
|
|
32
|
+
var Jn = 500;
|
|
33
|
+
function Yn(e) {
|
|
34
34
|
let { debounceMs: t, form: n } = e;
|
|
35
35
|
async function r() {
|
|
36
36
|
!n.isSubmitting.value && n.isValid.value && n.isDirty.value && await n.submit();
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
debounce: t ??
|
|
38
|
+
Xt(() => n.state.value, r, {
|
|
39
|
+
debounce: t ?? Jn,
|
|
40
40
|
deep: !0
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/models/billing-document/billingDocumentStatusEnum.model.ts
|
|
45
|
-
var
|
|
45
|
+
var Xn = class {
|
|
46
46
|
value;
|
|
47
47
|
colorMap = /* @__PURE__ */ new Map([
|
|
48
48
|
[r.CREDITED, "success"],
|
|
@@ -75,7 +75,7 @@ var Zn = class {
|
|
|
75
75
|
get translationKey() {
|
|
76
76
|
return this.i18nKeyMap.get(this.value) ?? "wise_invoicing.invoice.status.draft";
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, Zn = class {
|
|
79
79
|
static getSummary(t) {
|
|
80
80
|
let { grossAmount: n, lifecycleStatus: r, originalInvoice: i, type: a } = t;
|
|
81
81
|
if (a !== e.CREDIT_NOTE || i === null || r === h.FINALIZED) return null;
|
|
@@ -99,9 +99,9 @@ var Zn = class {
|
|
|
99
99
|
};
|
|
100
100
|
//#endregion
|
|
101
101
|
//#region src/modules/invoice-delivery/api/mutations/invoiceReminderSend.mutation.ts
|
|
102
|
-
function
|
|
103
|
-
return
|
|
104
|
-
queryFn: (e) =>
|
|
102
|
+
function Qn() {
|
|
103
|
+
return Ut({
|
|
104
|
+
queryFn: (e) => C.sendReminder(e.params.invoiceUuid),
|
|
105
105
|
queryKeysToInvalidate: {
|
|
106
106
|
creditNoteDetail: {},
|
|
107
107
|
invoiceDetail: {},
|
|
@@ -111,9 +111,9 @@ function $n() {
|
|
|
111
111
|
}
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/ui/billing-document/useBillingDocumentFinalizePreference.composable.ts
|
|
114
|
-
var
|
|
115
|
-
function
|
|
116
|
-
let e =
|
|
114
|
+
var $n = "wise-invoicing.billing-document.finalize-confirmation.skip";
|
|
115
|
+
function er() {
|
|
116
|
+
let e = Jt($n, !1);
|
|
117
117
|
function t(t) {
|
|
118
118
|
e.value = t;
|
|
119
119
|
}
|
|
@@ -124,7 +124,7 @@ function tr() {
|
|
|
124
124
|
}
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/ui/billing-document/BillingDocumentFinalizeDialog.vue
|
|
127
|
-
var
|
|
127
|
+
var tr = /* @__PURE__ */ F({
|
|
128
128
|
__name: "BillingDocumentFinalizeDialog",
|
|
129
129
|
props: {
|
|
130
130
|
billingDocumentType: {},
|
|
@@ -132,42 +132,42 @@ var nr = /* @__PURE__ */ F({
|
|
|
132
132
|
},
|
|
133
133
|
emits: ["close"],
|
|
134
134
|
setup(e, { emit: t }) {
|
|
135
|
-
let n = e, r = t, i = D(), { setShouldSkipConfirmation: a } =
|
|
135
|
+
let n = e, r = t, i = D(), { setShouldSkipConfirmation: a } = er(), o = qn({
|
|
136
136
|
initialState: { doNotShowAgain: !1 },
|
|
137
137
|
schema: ft.object({ doNotShowAgain: ft.boolean() }),
|
|
138
138
|
onSubmit: async (e) => {
|
|
139
139
|
await n.onConfirm() && (e.doNotShowAgain && a(!0), r("close"));
|
|
140
140
|
}
|
|
141
141
|
}), s = o.register("doNotShowAgain", !1);
|
|
142
|
-
return (e, t) => (
|
|
143
|
-
form:
|
|
142
|
+
return (e, t) => (R(), A(V(Sn), {
|
|
143
|
+
form: V(o),
|
|
144
144
|
size: "sm",
|
|
145
145
|
onClose: t[0] ||= (e) => r("close")
|
|
146
146
|
}, {
|
|
147
|
-
default:
|
|
148
|
-
title:
|
|
149
|
-
description:
|
|
150
|
-
}, null, 8, ["title", "description"]), P(
|
|
151
|
-
left:
|
|
152
|
-
right:
|
|
147
|
+
default: H(() => [P(V(hn), {
|
|
148
|
+
title: V(i).t(`wise_invoicing.${n.billingDocumentType}.finalize.confirmation.title`),
|
|
149
|
+
description: V(i).t(`wise_invoicing.${n.billingDocumentType}.finalize.confirmation.description`)
|
|
150
|
+
}, null, 8, ["title", "description"]), P(V(fn), null, {
|
|
151
|
+
left: H(() => [P(V(rn), I(V(et)(V(s)), { label: V(i).t("wise_invoicing.common.do_not_show_again") }), null, 16, ["label"])]),
|
|
152
|
+
right: H(() => [P(V(pn)), P(V(mn), { label: V(i).t(`wise_invoicing.${n.billingDocumentType}.finalize.confirmation.submit_button`) }, null, 8, ["label"])]),
|
|
153
153
|
_: 1
|
|
154
154
|
})]),
|
|
155
155
|
_: 1
|
|
156
156
|
}, 8, ["form"]));
|
|
157
157
|
}
|
|
158
|
-
}),
|
|
158
|
+
}), nr = /* @__PURE__ */ F({
|
|
159
159
|
__name: "InvoiceOverdueBadge",
|
|
160
160
|
props: { size: { default: "sm" } },
|
|
161
161
|
setup(e) {
|
|
162
162
|
let t = e, n = D(), r = k(() => n.t("wise_invoicing.invoice.status.overdue"));
|
|
163
|
-
return (e, n) => (
|
|
163
|
+
return (e, n) => (R(), A(V(tn), {
|
|
164
164
|
label: r.value,
|
|
165
165
|
size: t.size,
|
|
166
166
|
color: "error",
|
|
167
167
|
variant: "translucent"
|
|
168
168
|
}, null, 8, ["label", "size"]));
|
|
169
169
|
}
|
|
170
|
-
}),
|
|
170
|
+
}), rr = { class: "flex size-9 items-center justify-center rounded-lg border border-primary bg-primary p-md shadow-xs" }, ir = /* @__PURE__ */ F({
|
|
171
171
|
__name: "BillingDocumentDetailHeaderSection",
|
|
172
172
|
props: {
|
|
173
173
|
isDisabled: { type: Boolean },
|
|
@@ -181,29 +181,29 @@ var nr = /* @__PURE__ */ F({
|
|
|
181
181
|
},
|
|
182
182
|
setup(e) {
|
|
183
183
|
let t = e, n = D();
|
|
184
|
-
return (e, r) => (
|
|
185
|
-
default:
|
|
184
|
+
return (e, r) => (R(), A(V(on), { gap: "md" }, {
|
|
185
|
+
default: H(() => [P(V(U), {
|
|
186
186
|
justify: "between",
|
|
187
187
|
class: "w-full flex-wrap"
|
|
188
188
|
}, {
|
|
189
|
-
default:
|
|
190
|
-
default:
|
|
191
|
-
default:
|
|
192
|
-
default:
|
|
193
|
-
t.isDisabled ? (
|
|
189
|
+
default: H(() => [P(V(U), { class: "flex-1" }, {
|
|
190
|
+
default: H(() => [N("div", rr, [(R(), A(jt(t.icon), { class: "size-5 text-secondary" }))]), P(V(on), { gap: "none" }, {
|
|
191
|
+
default: H(() => [P(V(U), null, {
|
|
192
|
+
default: H(() => [
|
|
193
|
+
t.isDisabled ? (R(), A(V(Vn), {
|
|
194
194
|
key: 0,
|
|
195
195
|
"popover-side-offset": 8,
|
|
196
196
|
"popover-align": "start",
|
|
197
197
|
"popover-side": "bottom"
|
|
198
198
|
}, {
|
|
199
|
-
trigger:
|
|
200
|
-
content:
|
|
201
|
-
default:
|
|
199
|
+
trigger: H(() => [P(V(le), { class: "size-4 text-brand-primary" })]),
|
|
200
|
+
content: H(() => [P(V(Hn), null, {
|
|
201
|
+
default: H(() => [P(V(on), {
|
|
202
202
|
gap: "xs",
|
|
203
203
|
class: "max-w-80"
|
|
204
204
|
}, {
|
|
205
|
-
default:
|
|
206
|
-
text:
|
|
205
|
+
default: H(() => [P(V(W), {
|
|
206
|
+
text: V(n).t("wise_invoicing.billing_document.detail.header.locked_tooltip.title"),
|
|
207
207
|
class: "text-sm text-primary"
|
|
208
208
|
}, null, 8, ["text"])]),
|
|
209
209
|
_: 1
|
|
@@ -212,12 +212,12 @@ var nr = /* @__PURE__ */ F({
|
|
|
212
212
|
})]),
|
|
213
213
|
_: 1
|
|
214
214
|
})) : j("", !0),
|
|
215
|
-
P(
|
|
215
|
+
P(V(W), {
|
|
216
216
|
text: t.sequence ?? t.fallbackTitle,
|
|
217
217
|
as: "h1",
|
|
218
218
|
class: "text-lg font-semibold text-primary"
|
|
219
219
|
}, null, 8, ["text"]),
|
|
220
|
-
|
|
220
|
+
At(e.$slots, "status", {}, () => [P(V(tn), {
|
|
221
221
|
label: t.statusLabel,
|
|
222
222
|
color: t.statusColor,
|
|
223
223
|
size: "sm",
|
|
@@ -225,12 +225,12 @@ var nr = /* @__PURE__ */ F({
|
|
|
225
225
|
}, null, 8, ["label", "color"])])
|
|
226
226
|
]),
|
|
227
227
|
_: 3
|
|
228
|
-
}), t.isDisabled ? (
|
|
228
|
+
}), t.isDisabled ? (R(), A(V(W), {
|
|
229
229
|
key: 0,
|
|
230
230
|
truncate: !1,
|
|
231
|
-
text:
|
|
231
|
+
text: V(tt).trimOrNull(t.subjectField.modelValue.value) ?? "-",
|
|
232
232
|
class: "text-sm wrap-break-word text-secondary"
|
|
233
|
-
}, null, 8, ["text"])) : (
|
|
233
|
+
}, null, 8, ["text"])) : (R(), A(V(In), I({ key: 1 }, V(et)(t.subjectField), {
|
|
234
234
|
label: null,
|
|
235
235
|
placeholder: t.subjectPlaceholder,
|
|
236
236
|
class: "min-w-80"
|
|
@@ -238,11 +238,11 @@ var nr = /* @__PURE__ */ F({
|
|
|
238
238
|
_: 3
|
|
239
239
|
})]),
|
|
240
240
|
_: 3
|
|
241
|
-
}), P(
|
|
241
|
+
}), P(V(U), {
|
|
242
242
|
justify: "end",
|
|
243
243
|
class: "flex-1"
|
|
244
244
|
}, {
|
|
245
|
-
default:
|
|
245
|
+
default: H(() => [At(e.$slots, "actions")]),
|
|
246
246
|
_: 3
|
|
247
247
|
})]),
|
|
248
248
|
_: 3
|
|
@@ -250,7 +250,7 @@ var nr = /* @__PURE__ */ F({
|
|
|
250
250
|
_: 3
|
|
251
251
|
}));
|
|
252
252
|
}
|
|
253
|
-
}),
|
|
253
|
+
}), ar = /* @__PURE__ */ F({
|
|
254
254
|
__name: "BillingDocumentHeaderActions",
|
|
255
255
|
props: {
|
|
256
256
|
isPdfViewActive: { type: Boolean },
|
|
@@ -266,16 +266,16 @@ var nr = /* @__PURE__ */ F({
|
|
|
266
266
|
type: "icon"
|
|
267
267
|
} };
|
|
268
268
|
}
|
|
269
|
-
return (e, t) => (
|
|
270
|
-
default:
|
|
271
|
-
P(
|
|
272
|
-
"icon-left":
|
|
273
|
-
label: n.isPdfViewActive ?
|
|
269
|
+
return (e, t) => (R(), A(V(U), { class: "gap-sm" }, {
|
|
270
|
+
default: H(() => [
|
|
271
|
+
P(V(nn), {
|
|
272
|
+
"icon-left": V(_e),
|
|
273
|
+
label: n.isPdfViewActive ? V(i).t("wise_invoicing.common.view_details") : V(i).t("wise_invoicing.common.view_pdf"),
|
|
274
274
|
size: "md",
|
|
275
275
|
variant: "secondary",
|
|
276
276
|
onClick: t[0] ||= (e) => r("togglePdfView")
|
|
277
277
|
}, null, 8, ["icon-left", "label"]),
|
|
278
|
-
(
|
|
278
|
+
(R(!0), M(O, null, kt(n.primaryButtons, (e) => (R(), A(V(nn), {
|
|
279
279
|
key: e.key,
|
|
280
280
|
"icon-left": e.iconLeft,
|
|
281
281
|
"icon-right": e.iconRight,
|
|
@@ -297,14 +297,14 @@ var nr = /* @__PURE__ */ F({
|
|
|
297
297
|
"variant",
|
|
298
298
|
"onClick"
|
|
299
299
|
]))), 128)),
|
|
300
|
-
a.value ? (
|
|
301
|
-
trigger:
|
|
302
|
-
icon:
|
|
303
|
-
label:
|
|
300
|
+
a.value ? (R(), A(V(gn), { key: 0 }, {
|
|
301
|
+
trigger: H(() => [P(V(wn), {
|
|
302
|
+
icon: V(qe),
|
|
303
|
+
label: V(i).t("wise_invoicing.invoice.detail.header.actions_more"),
|
|
304
304
|
variant: "tertiary"
|
|
305
305
|
}, null, 8, ["icon", "label"])]),
|
|
306
|
-
content:
|
|
307
|
-
default:
|
|
306
|
+
content: H(() => [(R(!0), M(O, null, kt(n.menuGroups, (e, t) => (R(), M(O, { key: e.key }, [t > 0 ? (R(), A(V(yn), { key: 0 })) : j("", !0), P(V(_n), null, {
|
|
307
|
+
default: H(() => [(R(!0), M(O, null, kt(e.items, (e) => (R(), A(V(vn), {
|
|
308
308
|
key: e.key,
|
|
309
309
|
config: o(e),
|
|
310
310
|
"disabled-reason": e.disabledReason,
|
|
@@ -324,7 +324,7 @@ var nr = /* @__PURE__ */ F({
|
|
|
324
324
|
_: 1
|
|
325
325
|
}));
|
|
326
326
|
}
|
|
327
|
-
}),
|
|
327
|
+
}), or = /* @__PURE__ */ F({
|
|
328
328
|
__name: "BillingDocumentDetailRemarksSection",
|
|
329
329
|
props: {
|
|
330
330
|
title: {},
|
|
@@ -334,21 +334,21 @@ var nr = /* @__PURE__ */ F({
|
|
|
334
334
|
},
|
|
335
335
|
setup(e) {
|
|
336
336
|
let t = e;
|
|
337
|
-
return (e, n) => (
|
|
337
|
+
return (e, n) => (R(), A(V(on), {
|
|
338
338
|
as: "section",
|
|
339
339
|
gap: "md",
|
|
340
340
|
class: "w-full"
|
|
341
341
|
}, {
|
|
342
|
-
default:
|
|
342
|
+
default: H(() => [P(V(W), {
|
|
343
343
|
text: t.title,
|
|
344
344
|
as: "h2",
|
|
345
345
|
class: "text-sm font-semibold text-primary"
|
|
346
|
-
}, null, 8, ["text"]), t.isDisabled ? (
|
|
346
|
+
}, null, 8, ["text"]), t.isDisabled ? (R(), A(V(W), {
|
|
347
347
|
key: 0,
|
|
348
|
-
text:
|
|
348
|
+
text: V(tt).trimOrNull(t.remarksField.modelValue.value) ?? "-",
|
|
349
349
|
truncate: !1,
|
|
350
350
|
class: "w-full text-sm whitespace-pre-wrap text-secondary"
|
|
351
|
-
}, null, 8, ["text"])) : (
|
|
351
|
+
}, null, 8, ["text"])) : (R(), A(V(Ln), I({ key: 1 }, V(et)(t.remarksField), {
|
|
352
352
|
"is-disabled": t.isDisabled,
|
|
353
353
|
label: null,
|
|
354
354
|
placeholder: t.placeholder,
|
|
@@ -358,16 +358,16 @@ var nr = /* @__PURE__ */ F({
|
|
|
358
358
|
_: 1
|
|
359
359
|
}));
|
|
360
360
|
}
|
|
361
|
-
}),
|
|
361
|
+
}), sr = {
|
|
362
362
|
LEVEL: "level",
|
|
363
363
|
REJECTION_REASON: "rejectionReason",
|
|
364
364
|
REMARK: "remark",
|
|
365
365
|
STATUS: "status"
|
|
366
366
|
};
|
|
367
|
-
function
|
|
367
|
+
function cr(e, t) {
|
|
368
368
|
return e.find((e) => e.entityRole === d.APPROVAL && e.field === t);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function lr(e, t) {
|
|
371
371
|
let n = E.enum(g).safeParse(e);
|
|
372
372
|
if (!n.success) return null;
|
|
373
373
|
let r = E.enum(l).safeParse(t);
|
|
@@ -378,11 +378,11 @@ function ur(e, t) {
|
|
|
378
378
|
status: n.data
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
var
|
|
381
|
+
var ur = class {
|
|
382
382
|
static getApprovalTransition(e) {
|
|
383
|
-
let t =
|
|
383
|
+
let t = cr(e, sr.STATUS);
|
|
384
384
|
if (t === void 0) return null;
|
|
385
|
-
let n =
|
|
385
|
+
let n = cr(e, sr.LEVEL), r = lr(t.from, n?.from ?? null), i = lr(t.to, n?.to ?? null);
|
|
386
386
|
return {
|
|
387
387
|
isStatusChanged: nt.getDisplayStatus({
|
|
388
388
|
approval: r,
|
|
@@ -396,67 +396,67 @@ var dr = class {
|
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
398
|
static getRejectionReason(e) {
|
|
399
|
-
let t = E.enum(m).safeParse(
|
|
399
|
+
let t = E.enum(m).safeParse(cr(e, sr.REJECTION_REASON)?.to);
|
|
400
400
|
return t.success ? t.data : null;
|
|
401
401
|
}
|
|
402
402
|
static getRemark(e) {
|
|
403
|
-
let t = E.string().safeParse(
|
|
403
|
+
let t = E.string().safeParse(cr(e, sr.REMARK)?.to);
|
|
404
404
|
return t.success ? t.data : null;
|
|
405
405
|
}
|
|
406
|
-
},
|
|
406
|
+
}, dr = {
|
|
407
407
|
key: 0,
|
|
408
408
|
class: "flex flex-col items-start gap-xs py-xs"
|
|
409
|
-
},
|
|
409
|
+
}, fr = {
|
|
410
410
|
key: 0,
|
|
411
411
|
class: "flex flex-wrap items-center gap-xs"
|
|
412
|
-
},
|
|
412
|
+
}, pr = {
|
|
413
413
|
key: 1,
|
|
414
414
|
class: "text-xs text-secondary"
|
|
415
|
-
},
|
|
415
|
+
}, mr = {
|
|
416
416
|
key: 2,
|
|
417
417
|
class: "text-xs wrap-break-word text-secondary"
|
|
418
|
-
},
|
|
418
|
+
}, hr = ["onClick"], gr = { class: "truncate" }, _r = /* @__PURE__ */ F({
|
|
419
419
|
__name: "BillingDocumentDetailSidebarActivityApprovalDetails",
|
|
420
420
|
props: { entry: {} },
|
|
421
421
|
setup(e) {
|
|
422
|
-
let t = e, n = D(), r = k(() =>
|
|
423
|
-
let e =
|
|
422
|
+
let t = e, n = D(), r = k(() => ur.getApprovalTransition(t.entry.changes)), i = k(() => {
|
|
423
|
+
let e = ur.getRejectionReason(t.entry.changes);
|
|
424
424
|
return e === null ? null : n.t(nt.getRejectionReasonTranslationKey(e));
|
|
425
|
-
}), a = k(() =>
|
|
425
|
+
}), a = k(() => ur.getRemark(t.entry.changes)), o = k(() => t.entry.entities.filter((e) => e.role === d.ATTACHMENT)), s = k(() => r.value !== null || i.value !== null || a.value !== null || o.value.length > 0);
|
|
426
426
|
async function c(e) {
|
|
427
427
|
let t = await ut.getDownloadUrl(e.uuid);
|
|
428
428
|
t !== null && window.open(t, "_blank", "noopener");
|
|
429
429
|
}
|
|
430
|
-
return (e, t) => s.value ? (
|
|
431
|
-
r.value === null ? j("", !0) : (
|
|
430
|
+
return (e, t) => s.value ? (R(), M("div", dr, [
|
|
431
|
+
r.value === null ? j("", !0) : (R(), M("div", fr, [r.value.isStatusChanged ? (R(), M(O, { key: 0 }, [P(rt, {
|
|
432
432
|
approval: r.value.from,
|
|
433
433
|
"requires-prior-approval": !0
|
|
434
|
-
}, null, 8, ["approval"]), P(
|
|
434
|
+
}, null, 8, ["approval"]), P(V(pe), { class: "size-(--spacing-lg) shrink-0 text-tertiary" })], 64)) : j("", !0), P(rt, {
|
|
435
435
|
approval: r.value.to,
|
|
436
436
|
"requires-prior-approval": !0
|
|
437
437
|
}, null, 8, ["approval"])])),
|
|
438
|
-
i.value === null ? j("", !0) : (
|
|
439
|
-
a.value === null ? j("", !0) : (
|
|
440
|
-
(
|
|
441
|
-
default:
|
|
438
|
+
i.value === null ? j("", !0) : (R(), M("p", pr, B(i.value), 1)),
|
|
439
|
+
a.value === null ? j("", !0) : (R(), M("p", mr, B(a.value), 1)),
|
|
440
|
+
(R(!0), M(O, null, kt(o.value, (e) => (R(), A(V(an), { key: e.uuid }, {
|
|
441
|
+
default: H(() => [N("button", {
|
|
442
442
|
class: "flex max-w-full items-center gap-xs text-xs font-semibold text-brand-secondary underline-offset-2 hover:underline",
|
|
443
443
|
type: "button",
|
|
444
444
|
onClick: (t) => c(e)
|
|
445
|
-
}, [P(
|
|
445
|
+
}, [P(V(Ge), { class: "size-(--spacing-lg) shrink-0" }), N("span", gr, B(e.label ?? V(n).t("wise_invoicing.invoice.detail.activity_log.attachment")), 1)], 8, hr)]),
|
|
446
446
|
_: 2
|
|
447
447
|
}, 1024))), 128))
|
|
448
448
|
])) : j("", !0);
|
|
449
449
|
}
|
|
450
|
-
}),
|
|
450
|
+
}), vr = {
|
|
451
451
|
key: 0,
|
|
452
452
|
class: "flex flex-col divide-y divide-secondary py-xl"
|
|
453
|
-
},
|
|
453
|
+
}, yr = {
|
|
454
454
|
key: 1,
|
|
455
455
|
class: "flex size-full items-center justify-center py-xl"
|
|
456
|
-
},
|
|
456
|
+
}, br = { class: "text-xs text-primary" }, xr = ["title"], Sr = {
|
|
457
457
|
key: 0,
|
|
458
458
|
class: "border-t border-secondary px-xl py-lg"
|
|
459
|
-
},
|
|
459
|
+
}, Cr = /* @__PURE__ */ F({
|
|
460
460
|
__name: "BillingDocumentDetailSidebarActivityContent",
|
|
461
461
|
props: {
|
|
462
462
|
hasNextPage: { type: Boolean },
|
|
@@ -567,7 +567,7 @@ var dr = class {
|
|
|
567
567
|
case a.INVOICE_PAYMENT_DELETED: return [h(e.entities), p(x(e.changes))];
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function ee(e) {
|
|
571
571
|
switch (e.action) {
|
|
572
572
|
case a.INVOICE_FINALIZED:
|
|
573
573
|
case a.INVOICE_PAYMENT_CREATED:
|
|
@@ -588,65 +588,65 @@ var dr = class {
|
|
|
588
588
|
case a.INVOICE_FINALIZATION_BLOCKED: return Je;
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function C(e) {
|
|
592
592
|
return e.actorType === c.USER && e.actor !== null ? [e.actor.firstName, e.actor.lastName].filter(Boolean).join(" ") || e.actor.email || r.t("wise_invoicing.invoice.detail.activity_log.actor.system") : e.actorType === c.SERVICE ? u(e.entities, d.ACTOR)?.label ?? r.t("wise_invoicing.invoice.detail.activity_log.actor.external_system") : r.t("wise_invoicing.invoice.detail.activity_log.actor.system");
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function w(e) {
|
|
595
595
|
return i.toDateTime(e.createdAt);
|
|
596
596
|
}
|
|
597
597
|
function te(e) {
|
|
598
598
|
return i.toDateTime(e.createdAt);
|
|
599
599
|
}
|
|
600
600
|
function ne(e) {
|
|
601
|
-
return `${
|
|
601
|
+
return `${w(e)} · ${C(e)}`;
|
|
602
602
|
}
|
|
603
|
-
let re =
|
|
604
|
-
return
|
|
603
|
+
let re = z(null);
|
|
604
|
+
return Kt(re, async () => {
|
|
605
605
|
t.hasNextPage && !t.isFetchingNextPage && await t.fetchNextPage();
|
|
606
|
-
}, { distance: 250 }), (e, n) => t.isLoading ? (
|
|
606
|
+
}, { distance: 250 }), (e, n) => t.isLoading ? (R(), M("div", vr, [(R(), M(O, null, kt(5, (e) => N("div", {
|
|
607
607
|
key: e,
|
|
608
608
|
class: "flex flex-col gap-xs px-xl py-lg"
|
|
609
|
-
}, [...n[0] ||= [N("div", { class: "h-4 w-2/3 animate-pulse rounded-sm bg-secondary" }, null, -1), N("div", { class: "h-3 w-1/3 animate-pulse rounded-sm bg-secondary" }, null, -1)]])), 64))])) : s.value.length === 0 ? (
|
|
609
|
+
}, [...n[0] ||= [N("div", { class: "h-4 w-2/3 animate-pulse rounded-sm bg-secondary" }, null, -1), N("div", { class: "h-3 w-1/3 animate-pulse rounded-sm bg-secondary" }, null, -1)]])), 64))])) : s.value.length === 0 ? (R(), M("div", yr, [P(V(bn), {
|
|
610
610
|
description: t.emptyMessage,
|
|
611
|
-
title:
|
|
612
|
-
}, null, 8, ["description", "title"])])) : (
|
|
611
|
+
title: V(r).t("wise_invoicing.invoice.detail.sub_tabs.activity")
|
|
612
|
+
}, null, 8, ["description", "title"])])) : (R(), M("div", {
|
|
613
613
|
key: 2,
|
|
614
614
|
ref_key: "scrollContainerRef",
|
|
615
615
|
ref: re,
|
|
616
616
|
class: "h-full overflow-y-auto"
|
|
617
|
-
}, [P(
|
|
617
|
+
}, [P(V(zn), {
|
|
618
618
|
size: "md",
|
|
619
619
|
class: "p-xl"
|
|
620
620
|
}, {
|
|
621
|
-
default:
|
|
621
|
+
default: H(() => [(R(!0), M(O, null, kt(s.value, (e, t) => (R(), A(V(Bn), {
|
|
622
622
|
key: t,
|
|
623
|
-
icon:
|
|
623
|
+
icon: ee(e),
|
|
624
624
|
"is-last": t === s.value.length - 1
|
|
625
625
|
}, {
|
|
626
|
-
default:
|
|
627
|
-
N("p",
|
|
626
|
+
default: H(() => [
|
|
627
|
+
N("p", br, [(R(!0), M(O, null, kt(S(e), (e, t) => (R(), M(O, { key: `${t}-${e.text}` }, [e.to === void 0 ? (R(), M("span", {
|
|
628
628
|
key: 1,
|
|
629
|
-
class:
|
|
630
|
-
},
|
|
629
|
+
class: L({ "font-semibold": e.variant === "emphasis" })
|
|
630
|
+
}, B(e.text), 3)) : (R(), A(V(Zt), {
|
|
631
631
|
key: 0,
|
|
632
632
|
to: e.to,
|
|
633
633
|
class: "font-semibold underline underline-offset-2 transition-colors hover:text-brand-700 focus-visible:text-brand-700 focus-visible:outline-none"
|
|
634
634
|
}, {
|
|
635
|
-
default:
|
|
635
|
+
default: H(() => [mt(B(e.text), 1)]),
|
|
636
636
|
_: 2
|
|
637
637
|
}, 1032, ["to"]))], 64))), 128))]),
|
|
638
|
-
P(
|
|
638
|
+
P(_r, { entry: e }, null, 8, ["entry"]),
|
|
639
639
|
N("p", {
|
|
640
640
|
title: te(e),
|
|
641
641
|
class: "truncate text-xs text-tertiary"
|
|
642
|
-
},
|
|
642
|
+
}, B(ne(e)), 9, xr)
|
|
643
643
|
]),
|
|
644
644
|
_: 2
|
|
645
645
|
}, 1032, ["icon", "is-last"]))), 128))]),
|
|
646
646
|
_: 1
|
|
647
|
-
}), t.isFetchingNextPage ? (
|
|
647
|
+
}), t.isFetchingNextPage ? (R(), M("div", Sr, [...n[1] ||= [N("div", { class: "h-4 w-full animate-pulse rounded-sm bg-secondary" }, null, -1)]])) : j("", !0)], 512));
|
|
648
648
|
}
|
|
649
|
-
}),
|
|
649
|
+
}), wr = {
|
|
650
650
|
[p.BOOLEAN]: ke,
|
|
651
651
|
[p.DATE]: Te,
|
|
652
652
|
[p.MONETARY]: Ze,
|
|
@@ -657,13 +657,13 @@ var dr = class {
|
|
|
657
657
|
[p.TEXT]: Ve,
|
|
658
658
|
[p.TEXT_ARRAY]: se,
|
|
659
659
|
[p.TIMESTAMP]: je
|
|
660
|
-
},
|
|
660
|
+
}, Tr = /* @__PURE__ */ F({
|
|
661
661
|
__name: "BillingDocumentDetailSidebarOriginalInvoiceSection",
|
|
662
662
|
props: { originalInvoice: {} },
|
|
663
663
|
setup(e) {
|
|
664
664
|
let t = e, n = D(), r = v(), i = k(() => {
|
|
665
665
|
if (t.originalInvoice === null) return null;
|
|
666
|
-
let e = new
|
|
666
|
+
let e = new Xn(t.originalInvoice.status);
|
|
667
667
|
return {
|
|
668
668
|
uuid: t.originalInvoice.uuid,
|
|
669
669
|
amountLabel: r.formatMonetary(t.originalInvoice.grossAmount),
|
|
@@ -672,46 +672,46 @@ var dr = class {
|
|
|
672
672
|
statusLabel: n.t(e.translationKey)
|
|
673
673
|
};
|
|
674
674
|
});
|
|
675
|
-
return (e, t) => i.value ? (
|
|
675
|
+
return (e, t) => i.value ? (R(), A(V(un), {
|
|
676
676
|
key: 0,
|
|
677
677
|
"collapse-options": {
|
|
678
678
|
isCollapsible: !0,
|
|
679
679
|
isOpenByDefault: !1,
|
|
680
680
|
badge: {
|
|
681
681
|
color: "brand",
|
|
682
|
-
icon:
|
|
683
|
-
label: i.value.sequence ??
|
|
682
|
+
icon: V(ce),
|
|
683
|
+
label: i.value.sequence ?? V(n).t("wise_invoicing.invoice.detail.parent_invoice.untitled"),
|
|
684
684
|
variant: "translucent"
|
|
685
685
|
}
|
|
686
686
|
},
|
|
687
|
-
label:
|
|
687
|
+
label: V(n).t("wise_invoicing.invoice.detail.parent_invoice.title")
|
|
688
688
|
}, {
|
|
689
|
-
default:
|
|
689
|
+
default: H(() => [P(V(Zt), {
|
|
690
690
|
to: {
|
|
691
691
|
name: "invoicing-invoice-detail",
|
|
692
692
|
params: { invoiceUuid: i.value.uuid }
|
|
693
693
|
},
|
|
694
694
|
class: "flex w-full items-center gap-md rounded-lg border border-secondary bg-primary p-lg transition-colors hover:bg-secondary"
|
|
695
695
|
}, {
|
|
696
|
-
default:
|
|
697
|
-
P(
|
|
696
|
+
default: H(() => [
|
|
697
|
+
P(V(U), {
|
|
698
698
|
gap: "xs",
|
|
699
699
|
class: "min-w-0 flex-1 items-baseline"
|
|
700
700
|
}, {
|
|
701
|
-
default:
|
|
702
|
-
text:
|
|
701
|
+
default: H(() => [P(V(W), {
|
|
702
|
+
text: V(n).t("wise_invoicing.invoice.detail.parent_invoice.untitled"),
|
|
703
703
|
class: "text-xs font-semibold text-primary"
|
|
704
|
-
}, null, 8, ["text"]), i.value.sequence === null ? j("", !0) : (
|
|
704
|
+
}, null, 8, ["text"]), i.value.sequence === null ? j("", !0) : (R(), A(V(W), {
|
|
705
705
|
key: 0,
|
|
706
706
|
text: i.value.sequence,
|
|
707
707
|
class: "truncate font-mono text-xs text-primary"
|
|
708
708
|
}, null, 8, ["text"]))]),
|
|
709
709
|
_: 1
|
|
710
710
|
}),
|
|
711
|
-
P(
|
|
711
|
+
P(V(tn), {
|
|
712
712
|
label: i.value.statusLabel,
|
|
713
713
|
color: i.value.statusColor,
|
|
714
|
-
icon:
|
|
714
|
+
icon: V(We),
|
|
715
715
|
size: "sm",
|
|
716
716
|
variant: "translucent"
|
|
717
717
|
}, null, 8, [
|
|
@@ -719,7 +719,7 @@ var dr = class {
|
|
|
719
719
|
"color",
|
|
720
720
|
"icon"
|
|
721
721
|
]),
|
|
722
|
-
P(
|
|
722
|
+
P(V(tn), {
|
|
723
723
|
label: i.value.amountLabel,
|
|
724
724
|
color: "gray",
|
|
725
725
|
size: "sm",
|
|
@@ -731,33 +731,33 @@ var dr = class {
|
|
|
731
731
|
_: 1
|
|
732
732
|
}, 8, ["collapse-options", "label"])) : j("", !0);
|
|
733
733
|
}
|
|
734
|
-
}),
|
|
734
|
+
}), Er = { class: "flex size-full items-center justify-center" }, Dr = /* @__PURE__ */ F({
|
|
735
735
|
__name: "BillingDocumentDetailSidebarActivityTab",
|
|
736
736
|
setup(e) {
|
|
737
737
|
let t = D();
|
|
738
|
-
return (e, n) => (
|
|
739
|
-
title:
|
|
740
|
-
description:
|
|
738
|
+
return (e, n) => (R(), M("div", Er, [P(V(bn), {
|
|
739
|
+
title: V(t).t("wise_invoicing.invoice.detail.sub_tabs.activity"),
|
|
740
|
+
description: V(t).t("wise_invoicing.invoice.detail.sidebar.activity_empty")
|
|
741
741
|
}, null, 8, ["title", "description"])]));
|
|
742
742
|
}
|
|
743
743
|
});
|
|
744
744
|
//#endregion
|
|
745
745
|
//#region src/modules/invoice/api/mutations/invoiceUpdateAttachments.mutation.ts
|
|
746
|
-
function
|
|
747
|
-
return
|
|
746
|
+
function Or() {
|
|
747
|
+
return Ut({
|
|
748
748
|
queryFn: (e) => S.updateAttachments(e.params.invoiceUuid, e.body),
|
|
749
749
|
queryKeysToInvalidate: { invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid } }
|
|
750
750
|
});
|
|
751
751
|
}
|
|
752
752
|
//#endregion
|
|
753
753
|
//#region src/modules/invoice/models/invoice/update/invoiceAttachmentsUpdateForm.model.ts
|
|
754
|
-
var
|
|
754
|
+
var kr = E.object({ attachments: lt.array() }), Ar = ["onClick"], jr = 26214400, Mr = /* @__PURE__ */ F({
|
|
755
755
|
__name: "BillingDocumentDetailSidebarAttachmentsTab",
|
|
756
756
|
props: { billingDocument: {} },
|
|
757
757
|
setup(e) {
|
|
758
|
-
let t = e, n = D(), r =
|
|
758
|
+
let t = e, n = D(), r = Gn(), i = Or(), a = qn({
|
|
759
759
|
initialState: k(() => x.toForm(t.billingDocument.attachments)),
|
|
760
|
-
schema:
|
|
760
|
+
schema: kr,
|
|
761
761
|
onSubmit: async (e) => {
|
|
762
762
|
let n = await i.execute({
|
|
763
763
|
body: e,
|
|
@@ -767,7 +767,7 @@ var Ar = E.object({ attachments: lt.array() }), jr = ["onClick"], Mr = 26214400,
|
|
|
767
767
|
}
|
|
768
768
|
}), o = a.register("attachments");
|
|
769
769
|
function s(e) {
|
|
770
|
-
return e.size >
|
|
770
|
+
return e.size > jr ? n.t("wise_invoicing.invoice.detail.sidebar.attachments_too_large") : !0;
|
|
771
771
|
}
|
|
772
772
|
let c = k(() => t.billingDocument.approvalProofs.map((e) => ({
|
|
773
773
|
color: "success",
|
|
@@ -778,21 +778,21 @@ var Ar = E.object({ attachments: lt.array() }), jr = ["onClick"], Mr = 26214400,
|
|
|
778
778
|
let t = await ut.getDownloadUrl(e.uuid);
|
|
779
779
|
t !== null && window.open(t, "_blank", "noopener");
|
|
780
780
|
}
|
|
781
|
-
return
|
|
782
|
-
form:
|
|
781
|
+
return Yn({ form: a }), (e, t) => (R(), A(V(xn), {
|
|
782
|
+
form: V(a),
|
|
783
783
|
"prompt-on-unsaved-changes": !1
|
|
784
784
|
}, {
|
|
785
|
-
default:
|
|
785
|
+
default: H(() => [P(V(on), {
|
|
786
786
|
gap: "md",
|
|
787
787
|
class: "px-2xl py-xl"
|
|
788
788
|
}, {
|
|
789
|
-
default:
|
|
790
|
-
default:
|
|
789
|
+
default: H(() => [P(dt, null, {
|
|
790
|
+
default: H(() => [P(V(Cn), I(V(et)(V(o)), {
|
|
791
791
|
accept: ["*/*"],
|
|
792
|
-
description:
|
|
793
|
-
hint:
|
|
792
|
+
description: V(n).t("wise_invoicing.invoice.detail.sidebar.attachments_upload_description"),
|
|
793
|
+
hint: V(n).t("wise_invoicing.invoice.detail.sidebar.attachments_upload_hint"),
|
|
794
794
|
"is-valid-file": s,
|
|
795
|
-
preprocess:
|
|
795
|
+
preprocess: V(ut).preprocess,
|
|
796
796
|
class: "w-full"
|
|
797
797
|
}), null, 16, [
|
|
798
798
|
"description",
|
|
@@ -800,18 +800,18 @@ var Ar = E.object({ attachments: lt.array() }), jr = ["onClick"], Mr = 26214400,
|
|
|
800
800
|
"preprocess"
|
|
801
801
|
])]),
|
|
802
802
|
_: 1
|
|
803
|
-
}), (
|
|
803
|
+
}), (R(!0), M(O, null, kt(c.value, (e) => (R(), A(V(U), {
|
|
804
804
|
key: e.file.uuid,
|
|
805
805
|
gap: "sm"
|
|
806
806
|
}, {
|
|
807
|
-
default:
|
|
808
|
-
default:
|
|
807
|
+
default: H(() => [P(V(an), null, {
|
|
808
|
+
default: H(() => [N("button", {
|
|
809
809
|
class: "min-w-0 truncate text-sm text-secondary underline-offset-2 hover:underline",
|
|
810
810
|
type: "button",
|
|
811
811
|
onClick: (t) => l(e.file)
|
|
812
|
-
},
|
|
812
|
+
}, B(e.file.name), 9, Ar)]),
|
|
813
813
|
_: 2
|
|
814
|
-
}, 1024), P(
|
|
814
|
+
}, 1024), P(V(tn), {
|
|
815
815
|
label: e.label,
|
|
816
816
|
color: e.color,
|
|
817
817
|
size: "sm",
|
|
@@ -824,7 +824,7 @@ var Ar = E.object({ attachments: lt.array() }), jr = ["onClick"], Mr = 26214400,
|
|
|
824
824
|
_: 1
|
|
825
825
|
}, 8, ["form"]));
|
|
826
826
|
}
|
|
827
|
-
}),
|
|
827
|
+
}), Nr = { class: "w-full" }, Pr = { class: "px-lg pt-md" }, Fr = /* @__PURE__ */ F({
|
|
828
828
|
__name: "BillingDocumentDetailSidebarHeader",
|
|
829
829
|
props: /*@__PURE__*/ bt({ attachmentsCount: {} }, {
|
|
830
830
|
modelValue: { required: !0 },
|
|
@@ -832,7 +832,7 @@ var Ar = E.object({ attachments: lt.array() }), jr = ["onClick"], Mr = 26214400,
|
|
|
832
832
|
}),
|
|
833
833
|
emits: ["update:modelValue"],
|
|
834
834
|
setup(e) {
|
|
835
|
-
let t = e, n =
|
|
835
|
+
let t = e, n = Pt(e, "modelValue"), r = D(), i = k(() => [
|
|
836
836
|
{
|
|
837
837
|
key: "info",
|
|
838
838
|
label: r.t("wise_invoicing.invoice.detail.sub_tabs.details")
|
|
@@ -847,18 +847,18 @@ var Ar = E.object({ attachments: lt.array() }), jr = ["onClick"], Mr = 26214400,
|
|
|
847
847
|
label: r.t("wise_invoicing.invoice.detail.sub_tabs.activity")
|
|
848
848
|
}
|
|
849
849
|
]);
|
|
850
|
-
return (e, t) => (
|
|
851
|
-
text:
|
|
850
|
+
return (e, t) => (R(), M("div", Nr, [N("div", Pr, [P(V(W), {
|
|
851
|
+
text: V(r).t("wise_invoicing.invoice.detail.sidebar.details"),
|
|
852
852
|
class: "text-sm font-semibold text-primary"
|
|
853
|
-
}, null, 8, ["text"])]), P(
|
|
853
|
+
}, null, 8, ["text"])]), P(V(Mn), {
|
|
854
854
|
modelValue: n.value,
|
|
855
855
|
"onUpdate:modelValue": t[0] ||= (e) => n.value = e,
|
|
856
856
|
"is-full-width": !0,
|
|
857
857
|
"underline-tabs-horizontal-list-padding": "lg",
|
|
858
858
|
variant: "underline"
|
|
859
859
|
}, {
|
|
860
|
-
default:
|
|
861
|
-
default:
|
|
860
|
+
default: H(() => [P(V(Pn), null, {
|
|
861
|
+
default: H(() => [(R(!0), M(O, null, kt(i.value, (e) => (R(), A(V(Nn), {
|
|
862
862
|
key: e.key,
|
|
863
863
|
value: e.key,
|
|
864
864
|
label: e.label,
|
|
@@ -874,43 +874,43 @@ var Ar = E.object({ attachments: lt.array() }), jr = ["onClick"], Mr = 26214400,
|
|
|
874
874
|
_: 1
|
|
875
875
|
}, 8, ["modelValue"])]));
|
|
876
876
|
}
|
|
877
|
-
}),
|
|
877
|
+
}), Ir = { class: "flex size-full min-h-0 flex-col overflow-hidden" }, Lr = { class: "mt-auto px-3xl py-xl" }, Rr = /* @__PURE__ */ F({
|
|
878
878
|
__name: "BillingDocumentDetailSidebarLayout",
|
|
879
879
|
props: { updatedFooter: {} },
|
|
880
880
|
setup(e) {
|
|
881
881
|
let t = e;
|
|
882
|
-
return (e, n) => (
|
|
882
|
+
return (e, n) => (R(), M("aside", Ir, [At(e.$slots, "default"), N("div", Lr, [P(V(W), {
|
|
883
883
|
text: t.updatedFooter,
|
|
884
884
|
class: "text-right text-xs text-tertiary"
|
|
885
885
|
}, null, 8, ["text"])])]));
|
|
886
886
|
}
|
|
887
|
-
}),
|
|
887
|
+
}), zr = { class: "flex-1 overflow-y-auto" }, Br = /* @__PURE__ */ F({
|
|
888
888
|
__name: "BillingDocumentDetailSidebar",
|
|
889
889
|
props: {
|
|
890
890
|
billingDocument: {},
|
|
891
891
|
updatedFooter: {}
|
|
892
892
|
},
|
|
893
893
|
setup(e) {
|
|
894
|
-
let t = e, n =
|
|
895
|
-
return (e, r) => (
|
|
896
|
-
default:
|
|
894
|
+
let t = e, n = z("info");
|
|
895
|
+
return (e, r) => (R(), A(Rr, { "updated-footer": t.updatedFooter }, {
|
|
896
|
+
default: H(() => [P(Fr, {
|
|
897
897
|
modelValue: n.value,
|
|
898
898
|
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
899
899
|
"attachments-count": t.billingDocument.attachments.length + t.billingDocument.approvalProofs.length
|
|
900
|
-
}, null, 8, ["modelValue", "attachments-count"]), N("div",
|
|
900
|
+
}, null, 8, ["modelValue", "attachments-count"]), N("div", zr, [n.value === "info" ? At(e.$slots, "info", {}, void 0, void 0, 0) : n.value === "attachments" ? (R(), A(Mr, {
|
|
901
901
|
key: 1,
|
|
902
902
|
"billing-document": t.billingDocument
|
|
903
|
-
}, null, 8, ["billing-document"])) :
|
|
903
|
+
}, null, 8, ["billing-document"])) : At(e.$slots, "activity", {}, () => [P(Dr)], void 0, 2)])]),
|
|
904
904
|
_: 3
|
|
905
905
|
}, 8, ["updated-footer"]));
|
|
906
906
|
}
|
|
907
907
|
});
|
|
908
908
|
//#endregion
|
|
909
909
|
//#region src/utils/context.util.ts
|
|
910
|
-
function
|
|
910
|
+
function Vr(e) {
|
|
911
911
|
let t = Symbol(e);
|
|
912
912
|
function n(e) {
|
|
913
|
-
return
|
|
913
|
+
return Dt(t, e), e;
|
|
914
914
|
}
|
|
915
915
|
function r(n) {
|
|
916
916
|
let r = vt(t, n ?? void 0);
|
|
@@ -921,13 +921,14 @@ function Hr(e) {
|
|
|
921
921
|
}
|
|
922
922
|
//#endregion
|
|
923
923
|
//#region src/ui/billing-document/table/billingDocumentLineItemsTable.context.ts
|
|
924
|
-
var [
|
|
924
|
+
var [Hr, Ur] = Vr("BillingDocumentLineItemsTable"), Wr = 4, Gr = [
|
|
925
925
|
n._0,
|
|
926
926
|
n._6,
|
|
927
927
|
n._12,
|
|
928
928
|
n._21
|
|
929
929
|
], Kr = [
|
|
930
930
|
t.PIECE,
|
|
931
|
+
t.MINUTE,
|
|
931
932
|
t.HOUR,
|
|
932
933
|
t.DAY,
|
|
933
934
|
t.KILOMETER,
|
|
@@ -936,7 +937,7 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
936
937
|
t.CUBIC_METER,
|
|
937
938
|
t.SQUARE_METER,
|
|
938
939
|
t.LITRE
|
|
939
|
-
],
|
|
940
|
+
], G = class {
|
|
940
941
|
static appendBillingDocumentEditorRows(e, t, n) {
|
|
941
942
|
let r = [...n.lines.map((e) => ({
|
|
942
943
|
line: e,
|
|
@@ -1161,9 +1162,9 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
1161
1162
|
quantity: t.quantity,
|
|
1162
1163
|
unit: t.unit,
|
|
1163
1164
|
unitPrice: {
|
|
1164
|
-
amount: _(t.unitPrice,
|
|
1165
|
+
amount: _(t.unitPrice, Wr),
|
|
1165
1166
|
currency: e.currency,
|
|
1166
|
-
precision:
|
|
1167
|
+
precision: Wr
|
|
1167
1168
|
},
|
|
1168
1169
|
vatRate: t.vatRate
|
|
1169
1170
|
};
|
|
@@ -1551,7 +1552,7 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
1551
1552
|
}, Xr = { class: "w-40 py-xxs" }, Zr = ["onClick"], Qr = { class: "max-h-64 w-44 overflow-y-auto py-xxs" }, $r = ["onClick"], ei = { class: "max-h-64 w-64 overflow-y-auto py-xxs" }, ti = ["onClick"], ni = /* @__PURE__ */ F({
|
|
1552
1553
|
__name: "BillingDocumentLineItemsBulkActionBar",
|
|
1553
1554
|
setup(e) {
|
|
1554
|
-
let t = D(), n = b(), r =
|
|
1555
|
+
let t = D(), n = b(), r = Ur(), i = z(!1), a = z(!1), o = z(!1), s = k(() => r.rows.value.filter(G.isGroupRow)), c = k(() => G.canGroupSelectedRows(r.rows.value, new Set(r.selection.selectedIds.value)) ? null : t.t("wise_invoicing.invoice.detail.line_items.max_group_level", { max: 4 }));
|
|
1555
1556
|
function l(e) {
|
|
1556
1557
|
return r.structure.value.groups.get(e.id)?.level ?? 1;
|
|
1557
1558
|
}
|
|
@@ -1570,41 +1571,41 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
1570
1571
|
function m(e) {
|
|
1571
1572
|
o.value = !1, r.mutations.moveSelectedLinesToGroup(e);
|
|
1572
1573
|
}
|
|
1573
|
-
return (e, h) =>
|
|
1574
|
-
N("span", Yr,
|
|
1574
|
+
return (e, h) => V(r).isEditable.value && V(r).selection.selectedCount.value > 0 ? (R(), M("div", qr, [N("div", Jr, [
|
|
1575
|
+
N("span", Yr, B(V(t).t("wise_invoicing.invoice.detail.line_items.items_selected", { count: V(r).selection.selectedCount.value })), 1),
|
|
1575
1576
|
h[8] ||= N("span", { class: "mx-xxs h-5 w-px bg-secondary" }, null, -1),
|
|
1576
|
-
P(
|
|
1577
|
-
label:
|
|
1578
|
-
"icon-left":
|
|
1577
|
+
P(V(nn), {
|
|
1578
|
+
label: V(t).t("wise_invoicing.invoice.detail.line_items.bulk_group"),
|
|
1579
|
+
"icon-left": V(Ce),
|
|
1579
1580
|
"is-disabled": c.value !== null,
|
|
1580
1581
|
"disabled-reason": c.value,
|
|
1581
1582
|
size: "sm",
|
|
1582
1583
|
variant: "tertiary",
|
|
1583
|
-
onClick: h[0] ||= (e) =>
|
|
1584
|
+
onClick: h[0] ||= (e) => V(r).mutations.groupSelectedLines()
|
|
1584
1585
|
}, null, 8, [
|
|
1585
1586
|
"label",
|
|
1586
1587
|
"icon-left",
|
|
1587
1588
|
"is-disabled",
|
|
1588
1589
|
"disabled-reason"
|
|
1589
1590
|
]),
|
|
1590
|
-
P(
|
|
1591
|
-
label:
|
|
1592
|
-
"icon-left":
|
|
1591
|
+
P(V(nn), {
|
|
1592
|
+
label: V(t).t("wise_invoicing.invoice.detail.line_items.bulk_duplicate"),
|
|
1593
|
+
"icon-left": V(xe),
|
|
1593
1594
|
size: "sm",
|
|
1594
1595
|
variant: "tertiary",
|
|
1595
|
-
onClick: h[1] ||= (e) =>
|
|
1596
|
+
onClick: h[1] ||= (e) => V(r).mutations.duplicateSelectedLines()
|
|
1596
1597
|
}, null, 8, ["label", "icon-left"]),
|
|
1597
|
-
P(
|
|
1598
|
+
P(V(Dn), {
|
|
1598
1599
|
"is-open": i.value,
|
|
1599
1600
|
"onUpdate:isOpen": h[2] ||= (e) => i.value = e,
|
|
1600
1601
|
"popover-side-offset": 6,
|
|
1601
1602
|
"popover-align": "center",
|
|
1602
1603
|
"popover-side": "top"
|
|
1603
1604
|
}, {
|
|
1604
|
-
trigger:
|
|
1605
|
-
label:
|
|
1606
|
-
"icon-left":
|
|
1607
|
-
"icon-right":
|
|
1605
|
+
trigger: H(() => [P(V(nn), {
|
|
1606
|
+
label: V(t).t("wise_invoicing.invoice.detail.line_items.bulk_set_vat"),
|
|
1607
|
+
"icon-left": V(Re),
|
|
1608
|
+
"icon-right": V(Ne),
|
|
1608
1609
|
size: "sm",
|
|
1609
1610
|
variant: "tertiary"
|
|
1610
1611
|
}, null, 8, [
|
|
@@ -1612,15 +1613,15 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
1612
1613
|
"icon-left",
|
|
1613
1614
|
"icon-right"
|
|
1614
1615
|
])]),
|
|
1615
|
-
content:
|
|
1616
|
+
content: H(() => [N("div", Xr, [(R(!0), M(O, null, kt(V(Gr), (e) => (R(), M("button", {
|
|
1616
1617
|
key: e,
|
|
1617
1618
|
class: "flex w-full items-center px-md py-sm text-left text-sm text-primary transition-colors hover:bg-secondary",
|
|
1618
1619
|
type: "button",
|
|
1619
1620
|
onClick: (t) => f(e)
|
|
1620
|
-
},
|
|
1621
|
+
}, B(Number(e)) + "% ", 9, Zr))), 128))])]),
|
|
1621
1622
|
_: 1
|
|
1622
1623
|
}, 8, ["is-open"]),
|
|
1623
|
-
|
|
1624
|
+
V(n).isUnitVisible.value ? (R(), A(V(Dn), {
|
|
1624
1625
|
key: 0,
|
|
1625
1626
|
"is-open": a.value,
|
|
1626
1627
|
"onUpdate:isOpen": h[3] ||= (e) => a.value = e,
|
|
@@ -1628,10 +1629,10 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
1628
1629
|
"popover-align": "center",
|
|
1629
1630
|
"popover-side": "top"
|
|
1630
1631
|
}, {
|
|
1631
|
-
trigger:
|
|
1632
|
-
label:
|
|
1633
|
-
"icon-left":
|
|
1634
|
-
"icon-right":
|
|
1632
|
+
trigger: H(() => [P(V(nn), {
|
|
1633
|
+
label: V(t).t("wise_invoicing.invoice.detail.line_items.bulk_set_unit"),
|
|
1634
|
+
"icon-left": V(Xe),
|
|
1635
|
+
"icon-right": V(Ne),
|
|
1635
1636
|
size: "sm",
|
|
1636
1637
|
variant: "tertiary"
|
|
1637
1638
|
}, null, 8, [
|
|
@@ -1639,15 +1640,15 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
1639
1640
|
"icon-left",
|
|
1640
1641
|
"icon-right"
|
|
1641
1642
|
])]),
|
|
1642
|
-
content:
|
|
1643
|
+
content: H(() => [N("div", Qr, [(R(!0), M(O, null, kt(V(Kr), (e) => (R(), M("button", {
|
|
1643
1644
|
key: e,
|
|
1644
1645
|
class: "flex w-full items-center px-md py-sm text-left text-sm text-primary transition-colors hover:bg-secondary",
|
|
1645
1646
|
type: "button",
|
|
1646
1647
|
onClick: (t) => p(e)
|
|
1647
|
-
},
|
|
1648
|
+
}, B(u(e)), 9, $r))), 128))])]),
|
|
1648
1649
|
_: 1
|
|
1649
1650
|
}, 8, ["is-open"])) : j("", !0),
|
|
1650
|
-
s.value.length > 0 ? (
|
|
1651
|
+
s.value.length > 0 ? (R(), A(V(Dn), {
|
|
1651
1652
|
key: 1,
|
|
1652
1653
|
"is-open": o.value,
|
|
1653
1654
|
"onUpdate:isOpen": h[5] ||= (e) => o.value = e,
|
|
@@ -1655,10 +1656,10 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
1655
1656
|
"popover-align": "center",
|
|
1656
1657
|
"popover-side": "top"
|
|
1657
1658
|
}, {
|
|
1658
|
-
trigger:
|
|
1659
|
-
label:
|
|
1660
|
-
"icon-left":
|
|
1661
|
-
"icon-right":
|
|
1659
|
+
trigger: H(() => [P(V(nn), {
|
|
1660
|
+
label: V(t).t("wise_invoicing.invoice.detail.line_items.bulk_move_to_group"),
|
|
1661
|
+
"icon-left": V(ve),
|
|
1662
|
+
"icon-right": V(Ne),
|
|
1662
1663
|
size: "sm",
|
|
1663
1664
|
variant: "tertiary"
|
|
1664
1665
|
}, null, 8, [
|
|
@@ -1666,33 +1667,33 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
1666
1667
|
"icon-left",
|
|
1667
1668
|
"icon-right"
|
|
1668
1669
|
])]),
|
|
1669
|
-
content:
|
|
1670
|
+
content: H(() => [N("div", ei, [N("button", {
|
|
1670
1671
|
class: "flex w-full items-center truncate border-b border-secondary px-md py-sm text-left text-sm text-tertiary transition-colors hover:bg-secondary",
|
|
1671
1672
|
type: "button",
|
|
1672
1673
|
onClick: h[4] ||= (e) => m(null)
|
|
1673
|
-
},
|
|
1674
|
+
}, B(V(t).t("wise_invoicing.invoice.detail.line_items.move_to_top_level")), 1), (R(!0), M(O, null, kt(s.value, (e) => (R(), M("button", {
|
|
1674
1675
|
key: e.id,
|
|
1675
|
-
style:
|
|
1676
|
-
class:
|
|
1676
|
+
style: Ct({ paddingLeft: `calc(var(--spacing-md) + ${l(e) - 1}rem)` }),
|
|
1677
|
+
class: L([l(e) === 1 ? "font-medium" : void 0, "flex w-full items-center truncate py-sm pr-md text-left text-sm text-primary transition-colors hover:bg-secondary"]),
|
|
1677
1678
|
type: "button",
|
|
1678
1679
|
onClick: (t) => m(e.id)
|
|
1679
|
-
},
|
|
1680
|
+
}, B(d(e)), 15, ti))), 128))])]),
|
|
1680
1681
|
_: 1
|
|
1681
1682
|
}, 8, ["is-open"])) : j("", !0),
|
|
1682
1683
|
h[9] ||= N("span", { class: "mx-xxs h-5 w-px bg-secondary" }, null, -1),
|
|
1683
|
-
P(
|
|
1684
|
-
icon:
|
|
1685
|
-
label:
|
|
1684
|
+
P(V(wn), {
|
|
1685
|
+
icon: V(ue),
|
|
1686
|
+
label: V(t).t("wise_invoicing.invoice.detail.line_items.delete_all"),
|
|
1686
1687
|
size: "sm",
|
|
1687
1688
|
variant: "destructive-tertiary",
|
|
1688
|
-
onClick: h[6] ||= (e) =>
|
|
1689
|
+
onClick: h[6] ||= (e) => V(r).mutations.deleteSelectedLines()
|
|
1689
1690
|
}, null, 8, ["icon", "label"]),
|
|
1690
|
-
P(
|
|
1691
|
-
icon:
|
|
1692
|
-
label:
|
|
1691
|
+
P(V(wn), {
|
|
1692
|
+
icon: V(re),
|
|
1693
|
+
label: V(t).t("wise_invoicing.invoice.detail.line_items.bulk_clear"),
|
|
1693
1694
|
size: "sm",
|
|
1694
1695
|
variant: "tertiary",
|
|
1695
|
-
onClick: h[7] ||= (e) =>
|
|
1696
|
+
onClick: h[7] ||= (e) => V(r).selection.clearSelection()
|
|
1696
1697
|
}, null, 8, ["icon", "label"])
|
|
1697
1698
|
])])) : j("", !0);
|
|
1698
1699
|
}
|
|
@@ -1722,20 +1723,20 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
1722
1723
|
},
|
|
1723
1724
|
emits: ["addGroup", "addLine"],
|
|
1724
1725
|
setup(e, { emit: t }) {
|
|
1725
|
-
let n = e, r = t, i = D(), a =
|
|
1726
|
+
let n = e, r = t, i = D(), a = z(!1), o = Ft("popoverAnchorRef"), s = k(() => n.placement === "end");
|
|
1726
1727
|
function c() {
|
|
1727
1728
|
a.value = !1, r("addLine");
|
|
1728
1729
|
}
|
|
1729
1730
|
function l() {
|
|
1730
1731
|
n.addGroupDisabledReason === null && (a.value = !1, r("addGroup"));
|
|
1731
1732
|
}
|
|
1732
|
-
return (e, t) => (
|
|
1733
|
-
N("div", { class:
|
|
1733
|
+
return (e, t) => (R(), M("div", { class: L([[s.value ? "top-0" : "top-0 -translate-y-1/2"], "group pointer-events-none absolute inset-x-0 z-20 h-5 w-full overflow-visible"]) }, [
|
|
1734
|
+
N("div", { class: L([[s.value ? "top-0 -translate-y-1/2" : "top-1/2 -translate-y-1/2"], "absolute inset-x-0 h-3"]) }, null, 2),
|
|
1734
1735
|
N("div", {
|
|
1735
|
-
class:
|
|
1736
|
-
style:
|
|
1736
|
+
class: L([[s.value ? "top-0 -translate-y-1/2" : "top-1/2 -translate-y-1/2"], "absolute inset-x-0 z-30 h-px w-full bg-brand-500 opacity-0 transition-opacity group-hover:opacity-100 group-has-focus-visible:opacity-100"]),
|
|
1737
|
+
style: Ct(a.value ? { opacity: 1 } : void 0)
|
|
1737
1738
|
}, null, 6),
|
|
1738
|
-
N("div", { class:
|
|
1739
|
+
N("div", { class: L([[s.value ? "top-0 -translate-y-1/2" : "top-1/2 -translate-y-1/2"], "pointer-events-auto absolute inset-x-0 z-40 px-md"]) }, [P(V(Dn), {
|
|
1739
1740
|
"is-open": a.value,
|
|
1740
1741
|
"onUpdate:isOpen": t[0] ||= (e) => a.value = e,
|
|
1741
1742
|
"popover-anchor-reference-element": o.value,
|
|
@@ -1743,30 +1744,30 @@ var [Ur, Wr] = Hr("BillingDocumentLineItemsTable"), Gr = [
|
|
|
1743
1744
|
"popover-align": "start",
|
|
1744
1745
|
"popover-side": "bottom"
|
|
1745
1746
|
}, {
|
|
1746
|
-
trigger:
|
|
1747
|
+
trigger: H(() => [N("button", {
|
|
1747
1748
|
"aria-label": n.label,
|
|
1748
1749
|
class: "group/trigger flex h-5 w-full cursor-pointer items-center justify-start outline-none",
|
|
1749
1750
|
type: "button"
|
|
1750
1751
|
}, [N("span", {
|
|
1751
1752
|
ref_key: "popoverAnchorRef",
|
|
1752
1753
|
ref: o,
|
|
1753
|
-
class:
|
|
1754
|
-
}, [P(
|
|
1755
|
-
content:
|
|
1754
|
+
class: L([a.value ? "opacity-100" : void 0, "sticky left-(--spacing-sm) flex size-5 shrink-0 items-center justify-center rounded-sm bg-brand-500 text-white opacity-0 shadow-sm transition-all group-hover:opacity-100 group-hover/trigger:bg-brand-700 group-focus-visible/trigger:opacity-100 group-has-focus-visible:opacity-100"])
|
|
1755
|
+
}, [P(V(Le), { class: "size-3" })], 2)], 8, ii)]),
|
|
1756
|
+
content: H(() => [N("div", ai, [N("button", {
|
|
1756
1757
|
class: "flex w-full items-center gap-md px-md py-sm text-left transition-colors hover:bg-secondary",
|
|
1757
1758
|
type: "button",
|
|
1758
1759
|
onClick: c
|
|
1759
|
-
}, [P(
|
|
1760
|
-
default:
|
|
1760
|
+
}, [P(V(Le), { class: "size-5 shrink-0 text-tertiary" }), P(V(on), { gap: "none" }, {
|
|
1761
|
+
default: H(() => [N("span", oi, B(V(i).t("wise_invoicing.invoice.detail.line_items.new_line_item")), 1), N("span", si, B(V(i).t("wise_invoicing.invoice.detail.line_items.new_line_item_description")), 1)]),
|
|
1761
1762
|
_: 1
|
|
1762
|
-
})]), n.canAddGroup ? (
|
|
1763
|
+
})]), n.canAddGroup ? (R(), M("button", {
|
|
1763
1764
|
key: 0,
|
|
1764
1765
|
"aria-disabled": n.addGroupDisabledReason !== null,
|
|
1765
|
-
class:
|
|
1766
|
+
class: L([n.addGroupDisabledReason === null ? "hover:bg-secondary" : "cursor-not-allowed opacity-60", "flex w-full items-center gap-md border-t border-secondary px-md py-sm text-left transition-colors"]),
|
|
1766
1767
|
type: "button",
|
|
1767
1768
|
onClick: l
|
|
1768
|
-
}, [P(
|
|
1769
|
-
default:
|
|
1769
|
+
}, [P(V(Ce), { class: "size-5 shrink-0 text-tertiary" }), P(V(on), { gap: "none" }, {
|
|
1770
|
+
default: H(() => [N("span", li, B(V(i).t("wise_invoicing.invoice.detail.line_items.new_group")), 1), N("span", ui, B(n.addGroupDisabledReason ?? V(i).t("wise_invoicing.invoice.detail.line_items.new_group_description")), 1)]),
|
|
1770
1771
|
_: 1
|
|
1771
1772
|
})], 10, ci)) : j("", !0)])]),
|
|
1772
1773
|
_: 1
|
|
@@ -1792,19 +1793,19 @@ var pi = /* @__PURE__ */ F({
|
|
|
1792
1793
|
},
|
|
1793
1794
|
setup(e) {
|
|
1794
1795
|
let t = e, n = D(), r = k(() => te.listByDefinitions(t.definitions, t.values));
|
|
1795
|
-
return (e, t) => r.value.length > 0 ? (
|
|
1796
|
+
return (e, t) => r.value.length > 0 ? (R(), A(V(U), {
|
|
1796
1797
|
key: 0,
|
|
1797
1798
|
align: "center",
|
|
1798
1799
|
gap: "md"
|
|
1799
1800
|
}, {
|
|
1800
|
-
default:
|
|
1801
|
+
default: H(() => [(R(!0), M(O, null, kt(r.value, (e) => (R(), A(V(U), {
|
|
1801
1802
|
key: e.definition.uuid,
|
|
1802
1803
|
align: "start",
|
|
1803
1804
|
gap: "xs",
|
|
1804
1805
|
class: "min-w-0"
|
|
1805
1806
|
}, {
|
|
1806
|
-
default:
|
|
1807
|
-
text: `${
|
|
1807
|
+
default: H(() => [P(V(W), {
|
|
1808
|
+
text: `${V(w).getLabel(e.definition, V(n).locale.value)}:`,
|
|
1808
1809
|
class: "shrink-0 text-xs font-medium text-secondary"
|
|
1809
1810
|
}, null, 8, ["text"]), P(ee, {
|
|
1810
1811
|
definition: e.definition,
|
|
@@ -1833,7 +1834,7 @@ var pi = /* @__PURE__ */ F({
|
|
|
1833
1834
|
}) : i.t("wise_invoicing.invoice.detail.line_items.delete_dialog.group.description", {
|
|
1834
1835
|
name: n.name,
|
|
1835
1836
|
count: n.lineCount ?? 0
|
|
1836
|
-
})), c =
|
|
1837
|
+
})), c = qn({
|
|
1837
1838
|
initialState: { confirmation: "" },
|
|
1838
1839
|
schema: ft.object({ confirmation: ft.string().refine((e) => e === a.value, { message: i.t("wise_invoicing.invoice.detail.line_items.delete_dialog.confirmation.validation") }) }),
|
|
1839
1840
|
onSubmit: () => {
|
|
@@ -1843,49 +1844,49 @@ var pi = /* @__PURE__ */ F({
|
|
|
1843
1844
|
function u(e) {
|
|
1844
1845
|
n.type === "group" && n.onDeleteGroup !== void 0 && (n.onDeleteGroup({ deleteLines: e }), r("close"));
|
|
1845
1846
|
}
|
|
1846
|
-
return (e, t) => (
|
|
1847
|
-
form:
|
|
1847
|
+
return (e, t) => (R(), A(V(Sn), {
|
|
1848
|
+
form: V(c),
|
|
1848
1849
|
"enable-click-outside-if-dirty": !0,
|
|
1849
1850
|
size: "sm",
|
|
1850
1851
|
onClose: t[2] ||= (e) => r("close")
|
|
1851
1852
|
}, {
|
|
1852
|
-
default:
|
|
1853
|
-
P(
|
|
1853
|
+
default: H(() => [
|
|
1854
|
+
P(V(hn), {
|
|
1854
1855
|
description: s.value,
|
|
1855
|
-
icon:
|
|
1856
|
-
title: n.type === "line" ?
|
|
1856
|
+
icon: V(Oe),
|
|
1857
|
+
title: n.type === "line" ? V(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.line.title") : V(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.group.title")
|
|
1857
1858
|
}, null, 8, [
|
|
1858
1859
|
"description",
|
|
1859
1860
|
"icon",
|
|
1860
1861
|
"title"
|
|
1861
1862
|
]),
|
|
1862
|
-
P(
|
|
1863
|
-
default:
|
|
1863
|
+
P(V(dn), null, {
|
|
1864
|
+
default: H(() => [P(V(In), I(V(et)(V(l)), {
|
|
1864
1865
|
"error-message": null,
|
|
1865
|
-
label:
|
|
1866
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.confirmation.label", { name: a.value }),
|
|
1866
1867
|
placeholder: a.value
|
|
1867
1868
|
}), null, 16, ["label", "placeholder"])]),
|
|
1868
1869
|
_: 1
|
|
1869
1870
|
}),
|
|
1870
|
-
P(
|
|
1871
|
-
right:
|
|
1872
|
-
P(
|
|
1873
|
-
n.type === "line" ? (
|
|
1871
|
+
P(V(fn), null, {
|
|
1872
|
+
right: H(() => [
|
|
1873
|
+
P(V(pn)),
|
|
1874
|
+
n.type === "line" ? (R(), A(V(mn), {
|
|
1874
1875
|
key: 0,
|
|
1875
1876
|
"is-destructive": !0,
|
|
1876
|
-
"is-disabled": !
|
|
1877
|
-
label:
|
|
1878
|
-
}, null, 8, ["is-disabled", "label"])) : (
|
|
1877
|
+
"is-disabled": !V(c).isValid.value,
|
|
1878
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.line.confirm")
|
|
1879
|
+
}, null, 8, ["is-disabled", "label"])) : (R(), A(V(nn), {
|
|
1879
1880
|
key: 1,
|
|
1880
|
-
"is-disabled": !
|
|
1881
|
-
label: o.value ?
|
|
1881
|
+
"is-disabled": !V(c).isValid.value,
|
|
1882
|
+
label: o.value ? V(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.group.keep_contents") : V(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.group.keep_lines"),
|
|
1882
1883
|
variant: "secondary",
|
|
1883
1884
|
onClick: t[0] ||= (e) => u(!1)
|
|
1884
1885
|
}, null, 8, ["is-disabled", "label"])),
|
|
1885
|
-
n.type === "group" ? (
|
|
1886
|
+
n.type === "group" ? (R(), A(V(nn), {
|
|
1886
1887
|
key: 2,
|
|
1887
|
-
"is-disabled": !
|
|
1888
|
-
label: o.value ?
|
|
1888
|
+
"is-disabled": !V(c).isValid.value,
|
|
1889
|
+
label: o.value ? V(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.group.delete_with_contents") : V(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.group.delete_with_lines"),
|
|
1889
1890
|
variant: "destructive-primary",
|
|
1890
1891
|
onClick: t[1] ||= (e) => u(!0)
|
|
1891
1892
|
}, null, 8, ["is-disabled", "label"])) : j("", !0)
|
|
@@ -1900,8 +1901,8 @@ var pi = /* @__PURE__ */ F({
|
|
|
1900
1901
|
__name: "BillingDocumentLineItemsDragHandle",
|
|
1901
1902
|
setup(e) {
|
|
1902
1903
|
let t = D();
|
|
1903
|
-
return (e, n) => (
|
|
1904
|
-
"aria-label":
|
|
1904
|
+
return (e, n) => (R(), M("svg", {
|
|
1905
|
+
"aria-label": V(t).t("wise_invoicing.invoice.detail.line_items.drag_row"),
|
|
1905
1906
|
class: "size-5 cursor-grab text-quaternary transition-colors group-hover/row:text-tertiary hover:text-primary! motion-reduce:transition-none",
|
|
1906
1907
|
fill: "none",
|
|
1907
1908
|
height: "100%",
|
|
@@ -1918,12 +1919,12 @@ var pi = /* @__PURE__ */ F({
|
|
|
1918
1919
|
type: {}
|
|
1919
1920
|
},
|
|
1920
1921
|
setup(e) {
|
|
1921
|
-
let t = e, n = k(() => `${
|
|
1922
|
-
return (e, t) => (
|
|
1923
|
-
style:
|
|
1922
|
+
let t = e, n = k(() => `${G.getRowIndentInRem(t.type, t.depth)}rem`);
|
|
1923
|
+
return (e, t) => (R(), M("div", {
|
|
1924
|
+
style: Ct({ paddingLeft: n.value }),
|
|
1924
1925
|
class: "flex min-w-0 items-center",
|
|
1925
1926
|
"data-line-item-tree-indent": ""
|
|
1926
|
-
}, [
|
|
1927
|
+
}, [At(e.$slots, "default")], 4));
|
|
1927
1928
|
}
|
|
1928
1929
|
}), vi = ["for"], yi = { key: 0 }, bi = {
|
|
1929
1930
|
key: 0,
|
|
@@ -1960,18 +1961,18 @@ var pi = /* @__PURE__ */ F({
|
|
|
1960
1961
|
},
|
|
1961
1962
|
emits: ["blur"],
|
|
1962
1963
|
setup(e, { emit: t }) {
|
|
1963
|
-
let n = e, r = t, i =
|
|
1964
|
-
return (e, t) => (
|
|
1964
|
+
let n = e, r = t, i = Nt(), a = k(() => n.isTouched && n.errorMessage !== null), o = k(() => i.type === "number"), s = k(() => n.align === "right"), c = k(() => `${n.id}-error`), l = k(() => n.emphasis === "semibold" ? "font-semibold text-primary" : n.emphasis === "medium" ? "font-medium text-primary" : "text-tertiary");
|
|
1965
|
+
return (e, t) => (R(), M(O, null, [N("label", {
|
|
1965
1966
|
for: n.id,
|
|
1966
1967
|
class: "sr-only"
|
|
1967
|
-
}, [mt(
|
|
1968
|
+
}, [mt(B(n.label), 1), n.isRequired ? (R(), M("span", yi, "*")) : j("", !0)], 8, vi), N("div", { class: L([[
|
|
1968
1969
|
n.width === "content" ? "w-auto max-w-full" : "w-full",
|
|
1969
1970
|
n.variant === "outlined" && !a.value ? "bg-primary" : "\n bg-transparent\n ",
|
|
1970
1971
|
n.isDisabled ? "cursor-not-allowed" : "cursor-text",
|
|
1971
|
-
a.value && !n.isDisabled ? "bg-primary ring-2 ring-error-500 ring-inset" : n.isDisabled ? "" : "\n focus-within:
|
|
1972
|
+
a.value && !n.isDisabled ? "bg-primary ring-2 ring-error-500 ring-inset" : n.isDisabled ? "" : "\n focus-within:bg-primary focus-within:ring-2\n focus-within:ring-brand-500 focus-within:ring-inset\n "
|
|
1972
1973
|
], "relative flex h-11 items-center rounded-md border border-transparent transition-[background-color,box-shadow] duration-100 motion-reduce:transition-none"]) }, [
|
|
1973
|
-
n.prefix ? (
|
|
1974
|
-
(
|
|
1974
|
+
n.prefix ? (R(), M("span", bi, B(n.prefix), 1)) : j("", !0),
|
|
1975
|
+
(R(), A(jt(n.as), I(V(i), {
|
|
1975
1976
|
id: n.id,
|
|
1976
1977
|
disabled: n.isDisabled,
|
|
1977
1978
|
required: n.isRequired,
|
|
@@ -1987,7 +1988,7 @@ var pi = /* @__PURE__ */ F({
|
|
|
1987
1988
|
], "relative z-1 h-full border-none bg-transparent text-xs tabular-nums outline-none placeholder:text-placeholder disabled:cursor-not-allowed disabled:text-disabled"],
|
|
1988
1989
|
onBlur: t[0] ||= (e) => r("blur", e)
|
|
1989
1990
|
}), {
|
|
1990
|
-
default:
|
|
1991
|
+
default: H(() => [At(e.$slots, "default", {}, void 0, !0)]),
|
|
1991
1992
|
_: 3
|
|
1992
1993
|
}, 16, [
|
|
1993
1994
|
"id",
|
|
@@ -1998,21 +1999,21 @@ var pi = /* @__PURE__ */ F({
|
|
|
1998
1999
|
"aria-describedby",
|
|
1999
2000
|
"class"
|
|
2000
2001
|
])),
|
|
2001
|
-
n.isRequired && !a.value ? (
|
|
2002
|
-
a.value ? (
|
|
2002
|
+
n.isRequired && !a.value ? (R(), M("span", xi, " * ")) : j("", !0),
|
|
2003
|
+
a.value ? (R(), A(V(W), {
|
|
2003
2004
|
key: 2,
|
|
2004
2005
|
id: c.value,
|
|
2005
2006
|
text: n.errorMessage ?? "",
|
|
2006
2007
|
class: "min-w-0 shrink pr-lg text-xs text-error-primary"
|
|
2007
2008
|
}, null, 8, ["id", "text"])) : j("", !0),
|
|
2008
|
-
n.suffix ? (
|
|
2009
|
+
n.suffix ? (R(), M("span", Si, B(n.suffix), 1)) : j("", !0)
|
|
2009
2010
|
], 2)], 64));
|
|
2010
2011
|
}
|
|
2011
2012
|
}), wi = (e, t) => {
|
|
2012
2013
|
let n = e.__vccOpts || e;
|
|
2013
2014
|
for (let [e, r] of t) n[e] = r;
|
|
2014
2015
|
return n;
|
|
2015
|
-
}, Ti = /*#__PURE__*/ wi(Ci, [["__scopeId", "data-v-
|
|
2016
|
+
}, Ti = /*#__PURE__*/ wi(Ci, [["__scopeId", "data-v-cd8ef12a"]]), Ei = /* @__PURE__ */ F({
|
|
2016
2017
|
__name: "BillingDocumentLineItemsTableTextField",
|
|
2017
2018
|
props: /*@__PURE__*/ bt({
|
|
2018
2019
|
id: {},
|
|
@@ -2031,8 +2032,8 @@ var pi = /* @__PURE__ */ F({
|
|
|
2031
2032
|
}),
|
|
2032
2033
|
emits: /*@__PURE__*/ bt(["blur"], ["update:modelValue"]),
|
|
2033
2034
|
setup(e, { emit: t }) {
|
|
2034
|
-
let n = e, r = t, i =
|
|
2035
|
-
return (e, t) => (
|
|
2035
|
+
let n = e, r = t, i = Pt(e, "modelValue");
|
|
2036
|
+
return (e, t) => (R(), A(Ti, I(n, {
|
|
2036
2037
|
value: i.value ?? "",
|
|
2037
2038
|
type: "text",
|
|
2038
2039
|
onBlur: t[0] ||= (e) => r("blur", e),
|
|
@@ -2058,14 +2059,14 @@ var pi = /* @__PURE__ */ F({
|
|
|
2058
2059
|
},
|
|
2059
2060
|
emits: ["expand", "toggleCollapse"],
|
|
2060
2061
|
setup(e, { emit: t }) {
|
|
2061
|
-
let n = e, r = t, i = D(), a = v(), o =
|
|
2062
|
+
let n = e, r = t, i = D(), a = v(), o = Ur(), s = Wn().create(mi), c = Ft("editFieldsRef"), l = z(n.group.name === ""), u = z("name"), d = k(() => n.group.name || i.t("wise_invoicing.invoice.detail.line_items.group_placeholder"));
|
|
2062
2063
|
function f(e, t) {
|
|
2063
2064
|
return Math.min(Math.max((e == null || e === "" ? t : e).length, 10), 64);
|
|
2064
2065
|
}
|
|
2065
2066
|
function p(e) {
|
|
2066
2067
|
return e.name !== n.group.name || e.description !== n.group.description;
|
|
2067
2068
|
}
|
|
2068
|
-
let m =
|
|
2069
|
+
let m = qn({
|
|
2069
2070
|
initialState: k(() => ({
|
|
2070
2071
|
name: n.group.name,
|
|
2071
2072
|
description: n.group.description
|
|
@@ -2074,10 +2075,10 @@ var pi = /* @__PURE__ */ F({
|
|
|
2074
2075
|
onSubmit: (e) => {
|
|
2075
2076
|
p(e) && o.mutations.updateGroup(n.group.id, e);
|
|
2076
2077
|
}
|
|
2077
|
-
}), h = m.register("name"), g = m.register("description"), _ = k(() => f(m.state.value.name, d.value)), y = k(() => f(m.state.value.description, i.t("wise_invoicing.invoice.detail.line_items.group_description_placeholder"))), b = k(() => o.structure.value.groups.get(n.group.id)), x = k(() => b.value?.level ?? 1), S = k(() => x.value === 1),
|
|
2078
|
+
}), h = m.register("name"), g = m.register("description"), _ = k(() => f(m.state.value.name, d.value)), y = k(() => f(m.state.value.description, i.t("wise_invoicing.invoice.detail.line_items.group_description_placeholder"))), b = k(() => o.structure.value.groups.get(n.group.id)), x = k(() => b.value?.level ?? 1), S = k(() => x.value === 1), ee = k(() => b.value?.subgroupCount ?? 0), C = k(() => b.value?.descendantLineIds ?? []), w = k(() => i.t("wise_invoicing.invoice.detail.line_items.max_group_level", { max: 4 })), te = k(() => x.value < 4), ne = k(() => o.getReferenceLinks(n.group)), re = k(() => G.indentRow(o.rows.value, n.group.id) !== o.rows.value), ie = k(() => !S.value), T = k(() => [i.t("wise_invoicing.invoice.detail.line_items.group_subgroup_count", { count: ee.value }), i.t("wise_invoicing.invoice.detail.line_items.group_item_count", { count: C.value.length })].join(" · ")), ae = k(() => C.value.length > 0 && C.value.every((e) => o.selection.isSelected(e))), oe = k(() => !ae.value && C.value.some((e) => o.selection.isSelected(e)));
|
|
2078
2079
|
function se() {
|
|
2079
2080
|
let e = !ae.value;
|
|
2080
|
-
for (let t of
|
|
2081
|
+
for (let t of C.value) e !== o.selection.isSelected(t) && o.selection.toggleRow(t);
|
|
2081
2082
|
}
|
|
2082
2083
|
let ce = k(() => n.total === null ? null : a.format(o.meta.value.currency, n.total)), le = k(() => {
|
|
2083
2084
|
if (n.total === null || n.discountTotal === 0) return null;
|
|
@@ -2119,15 +2120,15 @@ var pi = /* @__PURE__ */ F({
|
|
|
2119
2120
|
async function Te() {
|
|
2120
2121
|
await s.open({
|
|
2121
2122
|
name: n.group.name || i.t("wise_invoicing.invoice.detail.line_items.group_placeholder"),
|
|
2122
|
-
lineCount:
|
|
2123
|
-
subgroupCount:
|
|
2123
|
+
lineCount: C.value.length,
|
|
2124
|
+
subgroupCount: ee.value,
|
|
2124
2125
|
type: "group",
|
|
2125
2126
|
onDeleteGroup: (e) => {
|
|
2126
2127
|
o.mutations.deleteGroup(n.group.id, e);
|
|
2127
2128
|
}
|
|
2128
2129
|
});
|
|
2129
2130
|
}
|
|
2130
|
-
|
|
2131
|
+
Tt(async () => {
|
|
2131
2132
|
l.value && await me(u.value);
|
|
2132
2133
|
});
|
|
2133
2134
|
async function Ee(e) {
|
|
@@ -2136,20 +2137,20 @@ var pi = /* @__PURE__ */ F({
|
|
|
2136
2137
|
async function De() {
|
|
2137
2138
|
await xt(), m.isValid.value ? (await m.submit(), l.value = !1) : h.onBlur();
|
|
2138
2139
|
}
|
|
2139
|
-
return
|
|
2140
|
+
return Xt(() => m.state.value, async () => {
|
|
2140
2141
|
o.isEditable.value && m.isValid.value && p(m.state.value) && await m.submit();
|
|
2141
2142
|
}, {
|
|
2142
2143
|
debounce: 500,
|
|
2143
2144
|
deep: !0
|
|
2144
|
-
}), (e, t) => (
|
|
2145
|
+
}), (e, t) => (R(), M("tr", {
|
|
2145
2146
|
"data-line-item-row-id": n.group.id,
|
|
2146
2147
|
"data-line-item-group-level": x.value,
|
|
2147
|
-
class:
|
|
2148
|
+
class: L([S.value ? "bg-secondary" : "bg-tertiary", "group/row h-10 border-b border-secondary align-middle"]),
|
|
2148
2149
|
"data-line-item-row-type": "group",
|
|
2149
2150
|
"data-line-item-row": "",
|
|
2150
2151
|
onKeydown: Se
|
|
2151
2152
|
}, [
|
|
2152
|
-
|
|
2153
|
+
V(o).isEditable.value ? (R(), M("td", Oi, [P(gi)])) : j("", !0),
|
|
2153
2154
|
N("td", {
|
|
2154
2155
|
colspan: n.contentColumnSpan,
|
|
2155
2156
|
class: "py-none pr-lg pl-none",
|
|
@@ -2159,19 +2160,19 @@ var pi = /* @__PURE__ */ F({
|
|
|
2159
2160
|
class: "h-10 gap-xs",
|
|
2160
2161
|
type: "group"
|
|
2161
2162
|
}, {
|
|
2162
|
-
default:
|
|
2163
|
-
P(
|
|
2163
|
+
default: H(() => [
|
|
2164
|
+
P(V(U), {
|
|
2164
2165
|
align: "center",
|
|
2165
2166
|
class: "min-w-0 gap-lg"
|
|
2166
2167
|
}, {
|
|
2167
|
-
default:
|
|
2168
|
+
default: H(() => [V(o).isEditable.value ? (R(), A(V(rn), {
|
|
2168
2169
|
key: 0,
|
|
2169
2170
|
id: pe("select-group"),
|
|
2170
2171
|
"model-value": ae.value || oe.value,
|
|
2171
2172
|
"is-indeterminate": oe.value,
|
|
2172
|
-
label:
|
|
2173
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.select_group"),
|
|
2173
2174
|
"is-label-hidden": !0,
|
|
2174
|
-
"is-disabled": !
|
|
2175
|
+
"is-disabled": !V(o).isEditable.value || C.value.length === 0,
|
|
2175
2176
|
class: "w-4 shrink-0",
|
|
2176
2177
|
"onUpdate:modelValue": se
|
|
2177
2178
|
}, null, 8, [
|
|
@@ -2180,38 +2181,38 @@ var pi = /* @__PURE__ */ F({
|
|
|
2180
2181
|
"is-indeterminate",
|
|
2181
2182
|
"label",
|
|
2182
2183
|
"is-disabled"
|
|
2183
|
-
])) : j("", !0), P(
|
|
2184
|
+
])) : j("", !0), P(V(U), {
|
|
2184
2185
|
align: "center",
|
|
2185
2186
|
class: "min-w-0 gap-xs"
|
|
2186
2187
|
}, {
|
|
2187
|
-
default:
|
|
2188
|
-
"aria-label": n.isCollapsed ?
|
|
2188
|
+
default: H(() => [N("button", {
|
|
2189
|
+
"aria-label": n.isCollapsed ? V(i).t("wise_invoicing.invoice.detail.line_items.expand_group") : V(i).t("wise_invoicing.invoice.detail.line_items.collapse_group"),
|
|
2189
2190
|
"aria-expanded": !n.isCollapsed,
|
|
2190
2191
|
class: "flex shrink-0 items-center justify-center rounded-sm text-tertiary transition-colors hover:text-primary",
|
|
2191
2192
|
type: "button",
|
|
2192
2193
|
onClick: t[0] ||= (e) => r("toggleCollapse", e.altKey)
|
|
2193
|
-
}, [P(
|
|
2194
|
+
}, [P(V(Ne), { class: L([n.isCollapsed ? "rotate-0" : "rotate-180", "size-4 transition-transform duration-200 motion-reduce:transition-none"]) }, null, 8, ["class"])], 8, ji), N("div", {
|
|
2194
2195
|
ref_key: "editFieldsRef",
|
|
2195
2196
|
ref: c,
|
|
2196
2197
|
class: "min-w-0"
|
|
2197
|
-
}, [l.value ? (
|
|
2198
|
+
}, [l.value ? (R(), A(V(U), {
|
|
2198
2199
|
key: 0,
|
|
2199
2200
|
align: "center",
|
|
2200
2201
|
class: "min-w-0",
|
|
2201
2202
|
gap: "xs",
|
|
2202
2203
|
onFocusout: Ee
|
|
2203
2204
|
}, {
|
|
2204
|
-
default:
|
|
2205
|
+
default: H(() => [P(Ei, I({
|
|
2205
2206
|
id: pe("name"),
|
|
2206
|
-
label:
|
|
2207
|
-
placeholder:
|
|
2207
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.group_label"),
|
|
2208
|
+
placeholder: V(i).t("wise_invoicing.invoice.detail.line_items.group_placeholder"),
|
|
2208
2209
|
size: _.value,
|
|
2209
|
-
"is-disabled": !
|
|
2210
|
+
"is-disabled": !V(o).isEditable.value,
|
|
2210
2211
|
"is-required": !0,
|
|
2211
2212
|
emphasis: S.value ? "semibold" : "medium",
|
|
2212
2213
|
variant: "ghost",
|
|
2213
2214
|
width: "content"
|
|
2214
|
-
},
|
|
2215
|
+
}, V(et)(V(h)), { onKeydown: zt(Bt(De, ["prevent"]), ["enter"]) }), null, 16, [
|
|
2215
2216
|
"id",
|
|
2216
2217
|
"label",
|
|
2217
2218
|
"placeholder",
|
|
@@ -2221,13 +2222,13 @@ var pi = /* @__PURE__ */ F({
|
|
|
2221
2222
|
"onKeydown"
|
|
2222
2223
|
]), P(Ei, I({
|
|
2223
2224
|
id: pe("description"),
|
|
2224
|
-
label:
|
|
2225
|
-
placeholder:
|
|
2225
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.group_description_label"),
|
|
2226
|
+
placeholder: V(i).t("wise_invoicing.invoice.detail.line_items.group_description_placeholder"),
|
|
2226
2227
|
size: y.value,
|
|
2227
|
-
"is-disabled": !
|
|
2228
|
+
"is-disabled": !V(o).isEditable.value,
|
|
2228
2229
|
variant: "ghost",
|
|
2229
2230
|
width: "content"
|
|
2230
|
-
},
|
|
2231
|
+
}, V(et)(V(g)), { onKeydown: zt(Bt(De, ["prevent"]), ["enter"]) }), null, 16, [
|
|
2231
2232
|
"id",
|
|
2232
2233
|
"label",
|
|
2233
2234
|
"placeholder",
|
|
@@ -2236,37 +2237,37 @@ var pi = /* @__PURE__ */ F({
|
|
|
2236
2237
|
"onKeydown"
|
|
2237
2238
|
])]),
|
|
2238
2239
|
_: 1
|
|
2239
|
-
})) : (
|
|
2240
|
+
})) : (R(), A(V(U), {
|
|
2240
2241
|
key: 1,
|
|
2241
2242
|
align: "center",
|
|
2242
2243
|
gap: "xs",
|
|
2243
2244
|
class: "min-w-0"
|
|
2244
2245
|
}, {
|
|
2245
|
-
default:
|
|
2246
|
+
default: H(() => [V(o).isEditable.value ? (R(), A(V(an), {
|
|
2246
2247
|
key: 0,
|
|
2247
2248
|
class: "min-w-0 shrink-0 rounded-sm"
|
|
2248
2249
|
}, {
|
|
2249
|
-
default:
|
|
2250
|
-
class:
|
|
2250
|
+
default: H(() => [N("button", {
|
|
2251
|
+
class: L([[S.value ? "font-semibold" : "font-medium", n.isDropTarget ? "text-brand-700" : "text-primary"], "min-w-0 truncate text-left text-xs transition-colors hover:text-brand-700 motion-reduce:transition-none"]),
|
|
2251
2252
|
type: "button",
|
|
2252
2253
|
onClick: t[1] ||= (e) => ge()
|
|
2253
|
-
},
|
|
2254
|
+
}, B(d.value), 3)]),
|
|
2254
2255
|
_: 1
|
|
2255
|
-
})) : (
|
|
2256
|
+
})) : (R(), A(V(W), {
|
|
2256
2257
|
key: 1,
|
|
2257
2258
|
text: d.value,
|
|
2258
|
-
class:
|
|
2259
|
-
}, null, 8, ["text", "class"])), n.group.description ? (
|
|
2259
|
+
class: L([[S.value ? "font-semibold" : "font-medium", n.isDropTarget ? "text-brand-700" : "text-primary"], "shrink-0 text-xs"])
|
|
2260
|
+
}, null, 8, ["text", "class"])), n.group.description ? (R(), M(O, { key: 2 }, [V(o).isEditable.value ? (R(), A(V(an), {
|
|
2260
2261
|
key: 0,
|
|
2261
2262
|
class: "min-w-0 rounded-sm"
|
|
2262
2263
|
}, {
|
|
2263
|
-
default:
|
|
2264
|
+
default: H(() => [N("button", {
|
|
2264
2265
|
class: "min-w-0 truncate text-left text-xs text-tertiary transition-colors hover:text-secondary motion-reduce:transition-none",
|
|
2265
2266
|
type: "button",
|
|
2266
2267
|
onClick: t[2] ||= (e) => ge("description")
|
|
2267
|
-
},
|
|
2268
|
+
}, B(n.group.description), 1)]),
|
|
2268
2269
|
_: 1
|
|
2269
|
-
})) : (
|
|
2270
|
+
})) : (R(), A(V(W), {
|
|
2270
2271
|
key: 1,
|
|
2271
2272
|
text: n.group.description,
|
|
2272
2273
|
class: "min-w-0 truncate text-xs text-tertiary"
|
|
@@ -2277,85 +2278,85 @@ var pi = /* @__PURE__ */ F({
|
|
|
2277
2278
|
})]),
|
|
2278
2279
|
_: 1
|
|
2279
2280
|
}),
|
|
2280
|
-
S.value ? (
|
|
2281
|
+
S.value ? (R(), M(O, { key: 0 }, [ee.value > 0 ? (R(), A(V(Vn), {
|
|
2281
2282
|
key: 0,
|
|
2282
2283
|
"popover-side-offset": 8,
|
|
2283
2284
|
"popover-side": "top"
|
|
2284
2285
|
}, {
|
|
2285
|
-
trigger:
|
|
2286
|
-
value: String(
|
|
2286
|
+
trigger: H(() => [P(V(Tn), {
|
|
2287
|
+
value: String(ee.value),
|
|
2287
2288
|
"aria-label": T.value,
|
|
2288
2289
|
class: "shrink-0",
|
|
2289
2290
|
color: "gray",
|
|
2290
2291
|
variant: "outline"
|
|
2291
2292
|
}, null, 8, ["value", "aria-label"])]),
|
|
2292
|
-
content:
|
|
2293
|
-
default:
|
|
2293
|
+
content: H(() => [P(V(Hn), null, {
|
|
2294
|
+
default: H(() => [P(V(W), {
|
|
2294
2295
|
text: T.value,
|
|
2295
2296
|
class: "text-xs text-primary"
|
|
2296
2297
|
}, null, 8, ["text"])]),
|
|
2297
2298
|
_: 1
|
|
2298
2299
|
})]),
|
|
2299
2300
|
_: 1
|
|
2300
|
-
})) : (
|
|
2301
|
+
})) : (R(), A(V(Tn), {
|
|
2301
2302
|
key: 1,
|
|
2302
|
-
value: String(
|
|
2303
|
-
"aria-label":
|
|
2303
|
+
value: String(C.value.length),
|
|
2304
|
+
"aria-label": V(i).t("wise_invoicing.invoice.detail.line_items.group_item_count", { count: C.value.length }),
|
|
2304
2305
|
class: "shrink-0",
|
|
2305
2306
|
color: "gray",
|
|
2306
2307
|
variant: "outline"
|
|
2307
2308
|
}, null, 8, ["value", "aria-label"]))], 64)) : j("", !0),
|
|
2308
2309
|
P(pi, {
|
|
2309
|
-
definitions:
|
|
2310
|
+
definitions: V(o).groupCustomFieldDefinitions.value,
|
|
2310
2311
|
values: n.group.customFields,
|
|
2311
2312
|
class: "ml-sm shrink-0"
|
|
2312
2313
|
}, null, 8, ["definitions", "values"])
|
|
2313
2314
|
]),
|
|
2314
2315
|
_: 1
|
|
2315
2316
|
}, 8, ["depth"])])], 8, ki),
|
|
2316
|
-
N("td", Mi,
|
|
2317
|
+
N("td", Mi, B(S.value ? null : fe.value), 1),
|
|
2317
2318
|
t[4] ||= N("td", { class: "py-none" }, null, -1),
|
|
2318
|
-
N("td", { class:
|
|
2319
|
+
N("td", { class: L([S.value ? "font-medium text-primary" : "text-secondary", "px-lg py-none text-right text-xs tabular-nums"]) }, [P(V(U), {
|
|
2319
2320
|
align: "center",
|
|
2320
2321
|
gap: "xxs",
|
|
2321
2322
|
justify: "end"
|
|
2322
2323
|
}, {
|
|
2323
|
-
default:
|
|
2324
|
+
default: H(() => [le.value === null ? j("", !0) : (R(), A(V(en), {
|
|
2324
2325
|
key: 0,
|
|
2325
2326
|
label: le.value
|
|
2326
2327
|
}, {
|
|
2327
|
-
default:
|
|
2328
|
-
label:
|
|
2329
|
-
icon:
|
|
2328
|
+
default: H(() => [P(V(wn), {
|
|
2329
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.group_total_breakdown"),
|
|
2330
|
+
icon: V(Ae),
|
|
2330
2331
|
class: "rounded-full!",
|
|
2331
2332
|
size: "sm",
|
|
2332
2333
|
variant: "tertiary"
|
|
2333
2334
|
}, null, 8, ["label", "icon"])]),
|
|
2334
2335
|
_: 1
|
|
2335
|
-
}, 8, ["label"])), mt(" " +
|
|
2336
|
+
}, 8, ["label"])), mt(" " + B(ce.value), 1)]),
|
|
2336
2337
|
_: 1
|
|
2337
2338
|
})], 2),
|
|
2338
|
-
|
|
2339
|
+
V(o).hasActionsColumn.value ? (R(), M("td", Ni, [P(V(U), {
|
|
2339
2340
|
justify: "end",
|
|
2340
2341
|
gap: "xxs"
|
|
2341
2342
|
}, {
|
|
2342
|
-
default:
|
|
2343
|
-
trigger:
|
|
2344
|
-
icon:
|
|
2345
|
-
label:
|
|
2343
|
+
default: H(() => [V(o).isEditable.value || ne.value.length > 0 ? (R(), A(V(gn), { key: 0 }, {
|
|
2344
|
+
trigger: H(() => [P(V(wn), {
|
|
2345
|
+
icon: V(qe),
|
|
2346
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.group_actions"),
|
|
2346
2347
|
variant: "tertiary"
|
|
2347
2348
|
}, null, 8, ["icon", "label"])]),
|
|
2348
|
-
content:
|
|
2349
|
-
P(
|
|
2350
|
-
default:
|
|
2351
|
-
icon:
|
|
2352
|
-
label:
|
|
2349
|
+
content: H(() => [V(o).isEditable.value ? (R(), M(O, { key: 0 }, [
|
|
2350
|
+
P(V(_n), null, {
|
|
2351
|
+
default: H(() => [P(V(vn), {
|
|
2352
|
+
icon: V(we),
|
|
2353
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.edit_group"),
|
|
2353
2354
|
onSelect: t[3] ||= (e) => ge()
|
|
2354
|
-
}, null, 8, ["icon", "label"]), P(
|
|
2355
|
-
icon:
|
|
2355
|
+
}, null, 8, ["icon", "label"]), P(V(vn), {
|
|
2356
|
+
icon: V(Ce),
|
|
2356
2357
|
"is-disabled": !te.value,
|
|
2357
|
-
"disabled-reason": te.value ? null :
|
|
2358
|
-
label:
|
|
2358
|
+
"disabled-reason": te.value ? null : w.value,
|
|
2359
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.add_subgroup"),
|
|
2359
2360
|
onSelect: _e
|
|
2360
2361
|
}, null, 8, [
|
|
2361
2362
|
"icon",
|
|
@@ -2365,43 +2366,43 @@ var pi = /* @__PURE__ */ F({
|
|
|
2365
2366
|
])]),
|
|
2366
2367
|
_: 1
|
|
2367
2368
|
}),
|
|
2368
|
-
P(
|
|
2369
|
-
P(
|
|
2370
|
-
default:
|
|
2371
|
-
P(
|
|
2372
|
-
icon:
|
|
2369
|
+
P(V(yn)),
|
|
2370
|
+
P(V(_n), null, {
|
|
2371
|
+
default: H(() => [
|
|
2372
|
+
P(V(vn), {
|
|
2373
|
+
icon: V(Ke),
|
|
2373
2374
|
"is-disabled": !re.value,
|
|
2374
|
-
label:
|
|
2375
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.indent_row"),
|
|
2375
2376
|
onSelect: ve
|
|
2376
2377
|
}, null, 8, [
|
|
2377
2378
|
"icon",
|
|
2378
2379
|
"is-disabled",
|
|
2379
2380
|
"label"
|
|
2380
2381
|
]),
|
|
2381
|
-
P(
|
|
2382
|
-
icon:
|
|
2382
|
+
P(V(vn), {
|
|
2383
|
+
icon: V(he),
|
|
2383
2384
|
"is-disabled": !ie.value,
|
|
2384
|
-
label:
|
|
2385
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.outdent_row"),
|
|
2385
2386
|
onSelect: ye
|
|
2386
2387
|
}, null, 8, [
|
|
2387
2388
|
"icon",
|
|
2388
2389
|
"is-disabled",
|
|
2389
2390
|
"label"
|
|
2390
2391
|
]),
|
|
2391
|
-
P(
|
|
2392
|
-
icon:
|
|
2393
|
-
label:
|
|
2392
|
+
P(V(vn), {
|
|
2393
|
+
icon: V(de),
|
|
2394
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.ungroup"),
|
|
2394
2395
|
onSelect: xe
|
|
2395
2396
|
}, null, 8, ["icon", "label"])
|
|
2396
2397
|
]),
|
|
2397
2398
|
_: 1
|
|
2398
2399
|
})
|
|
2399
|
-
], 64)) : j("", !0), ne.value.length > 0 ? (
|
|
2400
|
-
default:
|
|
2400
|
+
], 64)) : j("", !0), ne.value.length > 0 ? (R(), M(O, { key: 1 }, [V(o).isEditable.value ? (R(), A(V(yn), { key: 0 })) : j("", !0), P(V(_n), null, {
|
|
2401
|
+
default: H(() => [(R(!0), M(O, null, kt(ne.value, (e) => (R(), A(V(vn), {
|
|
2401
2402
|
key: e.definition.uuid,
|
|
2402
|
-
icon:
|
|
2403
|
-
label:
|
|
2404
|
-
onSelect: (t) =>
|
|
2403
|
+
icon: V(be),
|
|
2404
|
+
label: V(i).t("wise_invoicing.custom_field.reference.open", { label: e.label }),
|
|
2405
|
+
onSelect: (t) => V(o).openReferenceLink(e)
|
|
2405
2406
|
}, null, 8, [
|
|
2406
2407
|
"icon",
|
|
2407
2408
|
"label",
|
|
@@ -2410,11 +2411,11 @@ var pi = /* @__PURE__ */ F({
|
|
|
2410
2411
|
_: 1
|
|
2411
2412
|
})], 64)) : j("", !0)]),
|
|
2412
2413
|
_: 1
|
|
2413
|
-
})) : j("", !0),
|
|
2414
|
+
})) : j("", !0), V(o).isEditable.value ? (R(), A(V(wn), {
|
|
2414
2415
|
key: 1,
|
|
2415
|
-
icon:
|
|
2416
|
-
"is-disabled": !
|
|
2417
|
-
label:
|
|
2416
|
+
icon: V(ue),
|
|
2417
|
+
"is-disabled": !V(o).isEditable.value,
|
|
2418
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.delete_group"),
|
|
2418
2419
|
variant: "destructive-tertiary",
|
|
2419
2420
|
onClick: Te
|
|
2420
2421
|
}, null, 8, [
|
|
@@ -2483,7 +2484,7 @@ function Li(e) {
|
|
|
2483
2484
|
};
|
|
2484
2485
|
}
|
|
2485
2486
|
}), l = k({
|
|
2486
|
-
get: () => i.value?.type === p.DATE && i.value.value instanceof
|
|
2487
|
+
get: () => i.value?.type === p.DATE && i.value.value instanceof $t.PlainDate ? i.value.value : null,
|
|
2487
2488
|
set: (e) => {
|
|
2488
2489
|
i.value = e === null ? null : {
|
|
2489
2490
|
definitionUuid: n().uuid,
|
|
@@ -2491,14 +2492,14 @@ function Li(e) {
|
|
|
2491
2492
|
value: e
|
|
2492
2493
|
};
|
|
2493
2494
|
}
|
|
2494
|
-
}), u = k(() => i.value?.type === p.TIMESTAMP ? i.value.value.toZonedDateTimeISO(
|
|
2495
|
+
}), u = k(() => i.value?.type === p.TIMESTAMP ? i.value.value.toZonedDateTimeISO($t.Now.timeZoneId()) : null);
|
|
2495
2496
|
function d(e, t) {
|
|
2496
2497
|
e === null ? i.value = null : i.value = {
|
|
2497
2498
|
definitionUuid: n().uuid,
|
|
2498
2499
|
type: p.TIMESTAMP,
|
|
2499
2500
|
value: e.toZonedDateTime({
|
|
2500
|
-
plainTime: t ?? new
|
|
2501
|
-
timeZone:
|
|
2501
|
+
plainTime: t ?? new $t.PlainTime(),
|
|
2502
|
+
timeZone: $t.Now.timeZoneId()
|
|
2502
2503
|
}).toInstant()
|
|
2503
2504
|
};
|
|
2504
2505
|
}
|
|
@@ -2575,28 +2576,28 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2575
2576
|
}),
|
|
2576
2577
|
emits: ["update:modelValue"],
|
|
2577
2578
|
setup(e) {
|
|
2578
|
-
let t = e, n =
|
|
2579
|
+
let t = e, n = Pt(e, "modelValue"), r = D(), i = Li({
|
|
2579
2580
|
currency: () => t.currency,
|
|
2580
2581
|
definition: () => t.definition,
|
|
2581
2582
|
precision: () => t.precision,
|
|
2582
2583
|
value: n
|
|
2583
2584
|
}), a = k(() => {
|
|
2584
|
-
let e =
|
|
2585
|
+
let e = w.getLabel(t.definition, r.locale.value);
|
|
2585
2586
|
return t.definition.type === p.MONETARY ? `${e} (${t.currency})` : e;
|
|
2586
2587
|
}), o = k(() => ({
|
|
2587
2588
|
isDisabled: t.isDisabled ?? !1,
|
|
2588
2589
|
isLabelHidden: t.isLabelHidden ?? !1,
|
|
2589
2590
|
isRequired: t.definition.isRequired,
|
|
2590
|
-
helpText: t.definition.description === null ? null :
|
|
2591
|
+
helpText: t.definition.description === null ? null : w.getLocalizedValue(t.definition.description, r.locale.value),
|
|
2591
2592
|
label: a.value
|
|
2592
|
-
})), s = k(() =>
|
|
2593
|
+
})), s = k(() => Un(t.definition.choices.toSorted((e, t) => e.order - t.order).map((e) => e.value))), c = k(() => n.value?.type === p.DATE ? n.value.value === "infinity" ? r.t("wise_invoicing.custom_field.date.infinity") : n.value.value === "-infinity" ? r.t("wise_invoicing.custom_field.date.negative_infinity") : null : null);
|
|
2593
2594
|
function l(e) {
|
|
2594
|
-
return
|
|
2595
|
+
return w.getChoiceLabel(t.definition, e, r.locale.value);
|
|
2595
2596
|
}
|
|
2596
|
-
return (e, n) => t.definition.type ===
|
|
2597
|
+
return (e, n) => t.definition.type === V(p).TEXT ? (R(), A(V(In), I({
|
|
2597
2598
|
key: 0,
|
|
2598
|
-
modelValue:
|
|
2599
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
2599
|
+
modelValue: V(i).text.value,
|
|
2600
|
+
"onUpdate:modelValue": n[0] ||= (e) => V(i).text.value = e
|
|
2600
2601
|
}, o.value, {
|
|
2601
2602
|
placeholder: t.placeholder,
|
|
2602
2603
|
size: t.size
|
|
@@ -2604,10 +2605,10 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2604
2605
|
"modelValue",
|
|
2605
2606
|
"placeholder",
|
|
2606
2607
|
"size"
|
|
2607
|
-
])) : t.definition.type ===
|
|
2608
|
+
])) : t.definition.type === V(p).TEXT_ARRAY ? (R(), A(V(Fn), I({
|
|
2608
2609
|
key: 1,
|
|
2609
|
-
modelValue:
|
|
2610
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
2610
|
+
modelValue: V(i).textArray.value,
|
|
2611
|
+
"onUpdate:modelValue": n[1] ||= (e) => V(i).textArray.value = e
|
|
2611
2612
|
}, o.value, {
|
|
2612
2613
|
placeholder: t.placeholder,
|
|
2613
2614
|
size: t.size
|
|
@@ -2615,18 +2616,18 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2615
2616
|
"modelValue",
|
|
2616
2617
|
"placeholder",
|
|
2617
2618
|
"size"
|
|
2618
|
-
])) : t.definition.type ===
|
|
2619
|
+
])) : t.definition.type === V(p).NUMBER ? (R(), A(V(En), I({
|
|
2619
2620
|
key: 2,
|
|
2620
|
-
modelValue:
|
|
2621
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
2622
|
-
}, o.value, { placeholder: t.placeholder }), null, 16, ["modelValue", "placeholder"])) : t.definition.type ===
|
|
2621
|
+
modelValue: V(i).number.value,
|
|
2622
|
+
"onUpdate:modelValue": n[2] ||= (e) => V(i).number.value = e
|
|
2623
|
+
}, o.value, { placeholder: t.placeholder }), null, 16, ["modelValue", "placeholder"])) : t.definition.type === V(p).BOOLEAN ? (R(), A(V(jn), I({
|
|
2623
2624
|
key: 3,
|
|
2624
|
-
modelValue:
|
|
2625
|
-
"onUpdate:modelValue": n[3] ||= (e) =>
|
|
2626
|
-
}, o.value), null, 16, ["modelValue"])) : t.definition.type ===
|
|
2625
|
+
modelValue: V(i).boolean.value,
|
|
2626
|
+
"onUpdate:modelValue": n[3] ||= (e) => V(i).boolean.value = e
|
|
2627
|
+
}, o.value), null, 16, ["modelValue"])) : t.definition.type === V(p).DATE ? (R(), A(V(ln), I({
|
|
2627
2628
|
key: 4,
|
|
2628
|
-
modelValue:
|
|
2629
|
-
"onUpdate:modelValue": n[4] ||= (e) =>
|
|
2629
|
+
modelValue: V(i).date.value,
|
|
2630
|
+
"onUpdate:modelValue": n[4] ||= (e) => V(i).date.value = e
|
|
2630
2631
|
}, o.value, {
|
|
2631
2632
|
hint: c.value,
|
|
2632
2633
|
placeholder: t.placeholder,
|
|
@@ -2636,14 +2637,14 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2636
2637
|
"hint",
|
|
2637
2638
|
"placeholder",
|
|
2638
2639
|
"size"
|
|
2639
|
-
])) : t.definition.type ===
|
|
2640
|
+
])) : t.definition.type === V(p).TIMESTAMP ? (R(), A(V(U), {
|
|
2640
2641
|
key: 5,
|
|
2641
2642
|
align: "start",
|
|
2642
2643
|
gap: "xs"
|
|
2643
2644
|
}, {
|
|
2644
|
-
default:
|
|
2645
|
-
modelValue:
|
|
2646
|
-
"onUpdate:modelValue": n[5] ||= (e) =>
|
|
2645
|
+
default: H(() => [P(V(ln), I({
|
|
2646
|
+
modelValue: V(i).timestampDate.value,
|
|
2647
|
+
"onUpdate:modelValue": n[5] ||= (e) => V(i).timestampDate.value = e
|
|
2647
2648
|
}, o.value, {
|
|
2648
2649
|
placeholder: t.placeholder,
|
|
2649
2650
|
size: t.size
|
|
@@ -2651,10 +2652,10 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2651
2652
|
"modelValue",
|
|
2652
2653
|
"placeholder",
|
|
2653
2654
|
"size"
|
|
2654
|
-
]), P(
|
|
2655
|
-
modelValue:
|
|
2656
|
-
"onUpdate:modelValue": n[6] ||= (e) =>
|
|
2657
|
-
"is-disabled": t.isDisabled ||
|
|
2655
|
+
]), P(V(Rn), {
|
|
2656
|
+
modelValue: V(i).timestampTime.value,
|
|
2657
|
+
"onUpdate:modelValue": n[6] ||= (e) => V(i).timestampTime.value = e,
|
|
2658
|
+
"is-disabled": t.isDisabled || V(i).timestampDate.value === null,
|
|
2658
2659
|
"is-label-hidden": !0,
|
|
2659
2660
|
label: a.value,
|
|
2660
2661
|
placeholder: t.placeholder,
|
|
@@ -2667,10 +2668,10 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2667
2668
|
"size"
|
|
2668
2669
|
])]),
|
|
2669
2670
|
_: 1
|
|
2670
|
-
})) : t.definition.type ===
|
|
2671
|
+
})) : t.definition.type === V(p).SINGLE_SELECT ? (R(), A(V(On), I({
|
|
2671
2672
|
key: 6,
|
|
2672
|
-
modelValue:
|
|
2673
|
-
"onUpdate:modelValue": n[7] ||= (e) =>
|
|
2673
|
+
modelValue: V(i).singleSelect.value,
|
|
2674
|
+
"onUpdate:modelValue": n[7] ||= (e) => V(i).singleSelect.value = e
|
|
2674
2675
|
}, o.value, {
|
|
2675
2676
|
"display-fn": l,
|
|
2676
2677
|
items: s.value,
|
|
@@ -2681,10 +2682,10 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2681
2682
|
"items",
|
|
2682
2683
|
"placeholder",
|
|
2683
2684
|
"size"
|
|
2684
|
-
])) : t.definition.type ===
|
|
2685
|
+
])) : t.definition.type === V(p).MULTI_SELECT ? (R(), A(V(On), I({
|
|
2685
2686
|
key: 7,
|
|
2686
|
-
modelValue:
|
|
2687
|
-
"onUpdate:modelValue": n[8] ||= (e) =>
|
|
2687
|
+
modelValue: V(i).multiSelect.value,
|
|
2688
|
+
"onUpdate:modelValue": n[8] ||= (e) => V(i).multiSelect.value = e
|
|
2688
2689
|
}, o.value, {
|
|
2689
2690
|
"display-fn": l,
|
|
2690
2691
|
items: s.value,
|
|
@@ -2695,10 +2696,10 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2695
2696
|
"items",
|
|
2696
2697
|
"placeholder",
|
|
2697
2698
|
"size"
|
|
2698
|
-
])) : t.definition.type ===
|
|
2699
|
+
])) : t.definition.type === V(p).MONETARY ? (R(), A(V(En), I({
|
|
2699
2700
|
key: 8,
|
|
2700
|
-
modelValue:
|
|
2701
|
-
"onUpdate:modelValue": n[9] ||= (e) =>
|
|
2701
|
+
modelValue: V(i).monetary.value,
|
|
2702
|
+
"onUpdate:modelValue": n[9] ||= (e) => V(i).monetary.value = e
|
|
2702
2703
|
}, o.value, { placeholder: t.placeholder }), null, 16, ["modelValue", "placeholder"])) : j("", !0);
|
|
2703
2704
|
}
|
|
2704
2705
|
}), zi = /* @__PURE__ */ F({
|
|
@@ -2721,11 +2722,11 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2721
2722
|
}),
|
|
2722
2723
|
emits: /*@__PURE__*/ bt(["blur"], ["update:modelValue"]),
|
|
2723
2724
|
setup(e, { emit: t }) {
|
|
2724
|
-
let n = e, r = t, i =
|
|
2725
|
+
let n = e, r = t, i = Pt(e, "modelValue"), a = z(s(i.value)), o = z(!1);
|
|
2725
2726
|
function s(e) {
|
|
2726
2727
|
return e === null ? "" : String(e);
|
|
2727
2728
|
}
|
|
2728
|
-
|
|
2729
|
+
Lt(i, (e) => {
|
|
2729
2730
|
o.value || (a.value = s(e));
|
|
2730
2731
|
});
|
|
2731
2732
|
function c() {
|
|
@@ -2743,7 +2744,7 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2743
2744
|
function u(e) {
|
|
2744
2745
|
o.value = !1, a.value = s(i.value), r("blur", e);
|
|
2745
2746
|
}
|
|
2746
|
-
return (e, t) => (
|
|
2747
|
+
return (e, t) => (R(), A(Ti, I(n, {
|
|
2747
2748
|
value: a.value,
|
|
2748
2749
|
align: "right",
|
|
2749
2750
|
type: "number",
|
|
@@ -2774,11 +2775,11 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2774
2775
|
}),
|
|
2775
2776
|
emits: /*@__PURE__*/ bt(["blur"], ["update:modelValue"]),
|
|
2776
2777
|
setup(e, { emit: t }) {
|
|
2777
|
-
let n = e, r = t, i =
|
|
2778
|
+
let n = e, r = t, i = Pt(e, "modelValue"), a = k(() => n.isTouched && n.errorMessage !== null), o = k(() => Un(n.options.map((e) => e.value))), s = k(() => n.options.find((e) => e.value === i.value)?.label ?? null);
|
|
2778
2779
|
function c(e) {
|
|
2779
2780
|
return n.options.find((t) => t.value === e)?.label ?? e;
|
|
2780
2781
|
}
|
|
2781
|
-
return (e, t) => (
|
|
2782
|
+
return (e, t) => (R(), M("div", { class: L([[n.isDisabled ? "cursor-not-allowed" : "cursor-pointer", a.value && !n.isDisabled ? "bg-primary ring-2 ring-error-500 ring-inset" : n.isDisabled ? "" : "\n focus-within:bg-primary focus-within:ring-2\n focus-within:ring-brand-500 focus-within:ring-inset\n "], "relative flex h-11 w-full items-center rounded-md border border-transparent bg-transparent transition-[background-color,box-shadow] duration-100 motion-reduce:transition-none"]) }, [P(V(kn), {
|
|
2782
2783
|
id: n.id,
|
|
2783
2784
|
modelValue: i.value,
|
|
2784
2785
|
"onUpdate:modelValue": t[0] ||= (e) => i.value = e,
|
|
@@ -2792,7 +2793,7 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2792
2793
|
"popover-width": "anchor-width",
|
|
2793
2794
|
onBlur: t[1] ||= (e) => r("blur")
|
|
2794
2795
|
}, {
|
|
2795
|
-
trigger:
|
|
2796
|
+
trigger: H(({ isOpen: e }) => [N("button", {
|
|
2796
2797
|
id: n.id,
|
|
2797
2798
|
disabled: n.isDisabled,
|
|
2798
2799
|
"aria-invalid": a.value,
|
|
@@ -2800,7 +2801,7 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2800
2801
|
"aria-controls": `${n.id}-content`,
|
|
2801
2802
|
role: "combobox",
|
|
2802
2803
|
class: "relative z-1 flex size-full items-center justify-between border-none bg-transparent px-lg text-xs outline-none disabled:cursor-not-allowed"
|
|
2803
|
-
}, [N("span", { class:
|
|
2804
|
+
}, [N("span", { class: L([n.isDisabled ? "text-disabled" : s.value === null ? "text-placeholder" : "text-tertiary"]) }, B(s.value ?? n.placeholder ?? ""), 3), n.isDisabled ? j("", !0) : (R(), A(V(Ne), {
|
|
2804
2805
|
key: 0,
|
|
2805
2806
|
class: "size-4 shrink-0 text-tertiary"
|
|
2806
2807
|
}))], 8, Bi)]),
|
|
@@ -2828,20 +2829,20 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2828
2829
|
}),
|
|
2829
2830
|
emits: ["update:modelValue"],
|
|
2830
2831
|
setup(e) {
|
|
2831
|
-
let t = e, n =
|
|
2832
|
+
let t = e, n = Pt(e, "modelValue"), r = D(), i = v(), a = Li({
|
|
2832
2833
|
currency: () => t.currency,
|
|
2833
2834
|
definition: () => t.definition,
|
|
2834
2835
|
precision: () => t.precision,
|
|
2835
2836
|
value: n
|
|
2836
|
-
}), o = k(() =>
|
|
2837
|
-
label:
|
|
2837
|
+
}), o = k(() => w.getLabel(t.definition, r.locale.value)), s = k(() => i.getSymbol(t.currency)), c = k(() => t.definition.choices.toSorted((e, t) => e.order - t.order).map((e) => ({
|
|
2838
|
+
label: w.getChoiceLabel(t.definition, e.value, r.locale.value),
|
|
2838
2839
|
value: e.value
|
|
2839
2840
|
})));
|
|
2840
|
-
return (e, r) => t.definition.type ===
|
|
2841
|
+
return (e, r) => t.definition.type === V(p).TEXT ? (R(), A(Ei, {
|
|
2841
2842
|
key: 0,
|
|
2842
2843
|
id: t.id,
|
|
2843
|
-
modelValue:
|
|
2844
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
2844
|
+
modelValue: V(a).text.value,
|
|
2845
|
+
"onUpdate:modelValue": r[0] ||= (e) => V(a).text.value = e,
|
|
2845
2846
|
"is-disabled": t.isDisabled,
|
|
2846
2847
|
"is-touched": !1,
|
|
2847
2848
|
"error-message": null,
|
|
@@ -2852,11 +2853,11 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2852
2853
|
"modelValue",
|
|
2853
2854
|
"is-disabled",
|
|
2854
2855
|
"label"
|
|
2855
|
-
])) : t.definition.type ===
|
|
2856
|
+
])) : t.definition.type === V(p).NUMBER ? (R(), A(zi, {
|
|
2856
2857
|
key: 1,
|
|
2857
2858
|
id: t.id,
|
|
2858
|
-
modelValue:
|
|
2859
|
-
"onUpdate:modelValue": r[1] ||= (e) =>
|
|
2859
|
+
modelValue: V(a).number.value,
|
|
2860
|
+
"onUpdate:modelValue": r[1] ||= (e) => V(a).number.value = e,
|
|
2860
2861
|
"is-disabled": t.isDisabled,
|
|
2861
2862
|
"is-touched": !1,
|
|
2862
2863
|
"error-message": null,
|
|
@@ -2867,11 +2868,11 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2867
2868
|
"modelValue",
|
|
2868
2869
|
"is-disabled",
|
|
2869
2870
|
"label"
|
|
2870
|
-
])) : t.definition.type ===
|
|
2871
|
+
])) : t.definition.type === V(p).MONETARY ? (R(), A(zi, {
|
|
2871
2872
|
key: 2,
|
|
2872
2873
|
id: t.id,
|
|
2873
|
-
modelValue:
|
|
2874
|
-
"onUpdate:modelValue": r[2] ||= (e) =>
|
|
2874
|
+
modelValue: V(a).monetary.value,
|
|
2875
|
+
"onUpdate:modelValue": r[2] ||= (e) => V(a).monetary.value = e,
|
|
2875
2876
|
"is-disabled": t.isDisabled,
|
|
2876
2877
|
"is-touched": !1,
|
|
2877
2878
|
"error-message": null,
|
|
@@ -2886,11 +2887,11 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2886
2887
|
"label",
|
|
2887
2888
|
"prefix",
|
|
2888
2889
|
"suffix"
|
|
2889
|
-
])) : t.definition.type ===
|
|
2890
|
+
])) : t.definition.type === V(p).SINGLE_SELECT ? (R(), A(Vi, {
|
|
2890
2891
|
key: 3,
|
|
2891
2892
|
id: t.id,
|
|
2892
|
-
modelValue:
|
|
2893
|
-
"onUpdate:modelValue": r[3] ||= (e) =>
|
|
2893
|
+
modelValue: V(a).singleSelect.value,
|
|
2894
|
+
"onUpdate:modelValue": r[3] ||= (e) => V(a).singleSelect.value = e,
|
|
2894
2895
|
"is-disabled": t.isDisabled,
|
|
2895
2896
|
"is-touched": !1,
|
|
2896
2897
|
"error-message": null,
|
|
@@ -2903,7 +2904,7 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2903
2904
|
"is-disabled",
|
|
2904
2905
|
"label",
|
|
2905
2906
|
"options"
|
|
2906
|
-
])) : (
|
|
2907
|
+
])) : (R(), A(Ri, {
|
|
2907
2908
|
key: 4,
|
|
2908
2909
|
modelValue: n.value,
|
|
2909
2910
|
"onUpdate:modelValue": r[4] ||= (e) => n.value = e,
|
|
@@ -2946,13 +2947,13 @@ var Ri = /* @__PURE__ */ F({
|
|
|
2946
2947
|
net: {}
|
|
2947
2948
|
},
|
|
2948
2949
|
setup(t) {
|
|
2949
|
-
let n = t, r = D(), i = v(), a = b(), o =
|
|
2950
|
+
let n = t, r = D(), i = v(), a = b(), o = Wn().create(mi), s = Ur(), c = Gr.map((e) => ({
|
|
2950
2951
|
label: `${Number(e)}%`,
|
|
2951
2952
|
value: e
|
|
2952
2953
|
})), l = Kr.map((e) => ({
|
|
2953
2954
|
label: r.t(`wise_invoicing.invoice.detail.line_items.units.${e}`),
|
|
2954
2955
|
value: e
|
|
2955
|
-
})), u = k(() => s.structure.value.rows.get(n.line.id)?.depth ?? 0), d = k(() => i.getSymbol(s.meta.value.currency)), f = k(() => s.meta.value.documentType === e.CREDIT_NOTE), p = f.value ? Ii : Fi, m = k(() => !s.isEditable.value || n.line.isDiscount), h =
|
|
2956
|
+
})), u = k(() => s.structure.value.rows.get(n.line.id)?.depth ?? 0), d = k(() => i.getSymbol(s.meta.value.currency)), f = k(() => s.meta.value.documentType === e.CREDIT_NOTE), p = f.value ? Ii : Fi, m = k(() => !s.isEditable.value || n.line.isDiscount), h = qn({
|
|
2956
2957
|
initialState: k(() => le(n.line)),
|
|
2957
2958
|
schema: p,
|
|
2958
2959
|
onSubmit: (e) => {
|
|
@@ -3000,29 +3001,29 @@ var Ri = /* @__PURE__ */ F({
|
|
|
3000
3001
|
function de(e, t) {
|
|
3001
3002
|
return e.name === t.name && e.description === t.description && e.quantity === t.quantity && e.unit === t.unit && e.unitPrice === t.unitPrice && (e.discountPercentage?.getValue() ?? null) === t.discountPercentage && e.vatRate === t.vatRate;
|
|
3002
3003
|
}
|
|
3003
|
-
return
|
|
3004
|
+
return Lt(() => [h.state.value, h.isValid.value], async () => {
|
|
3004
3005
|
s.isEditable.value && h.isValid.value && !de(n.line, h.state.value) && await h.submit();
|
|
3005
|
-
}, { deep: !0 }), (e, t) => (
|
|
3006
|
+
}, { deep: !0 }), (e, t) => (R(), M("tr", {
|
|
3006
3007
|
"data-line-item-row-id": n.line.id,
|
|
3007
3008
|
"data-appearing": n.isAppearing ? "true" : void 0,
|
|
3008
3009
|
class: "group/row h-11 border-b border-secondary bg-primary align-middle transition-colors hover:bg-secondary motion-reduce:transition-none",
|
|
3009
3010
|
"data-line-item-row-type": "line",
|
|
3010
3011
|
"data-line-item-row": ""
|
|
3011
3012
|
}, [
|
|
3012
|
-
|
|
3013
|
+
V(s).isEditable.value ? (R(), M("td", Wi, [P(gi)])) : j("", !0),
|
|
3013
3014
|
N("td", Gi, [P(_i, {
|
|
3014
3015
|
depth: u.value,
|
|
3015
3016
|
type: "line"
|
|
3016
3017
|
}, {
|
|
3017
|
-
default:
|
|
3018
|
+
default: H(() => [V(s).isEditable.value ? (R(), A(V(rn), {
|
|
3018
3019
|
key: 0,
|
|
3019
3020
|
id: T("select-row"),
|
|
3020
|
-
"model-value":
|
|
3021
|
-
label:
|
|
3021
|
+
"model-value": V(s).selection.isSelected(n.line.id),
|
|
3022
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.item"),
|
|
3022
3023
|
"is-label-hidden": !0,
|
|
3023
|
-
"is-disabled": !
|
|
3024
|
+
"is-disabled": !V(s).isEditable.value,
|
|
3024
3025
|
class: "w-4 shrink-0",
|
|
3025
|
-
"onUpdate:modelValue": t[0] ||= (e) =>
|
|
3026
|
+
"onUpdate:modelValue": t[0] ||= (e) => V(s).selection.toggleRow(n.line.id)
|
|
3026
3027
|
}, null, 8, [
|
|
3027
3028
|
"id",
|
|
3028
3029
|
"model-value",
|
|
@@ -3030,12 +3031,12 @@ var Ri = /* @__PURE__ */ F({
|
|
|
3030
3031
|
"is-disabled"
|
|
3031
3032
|
])) : j("", !0), P(Ei, I({
|
|
3032
3033
|
id: T("name"),
|
|
3033
|
-
label:
|
|
3034
|
-
placeholder:
|
|
3035
|
-
"is-disabled": !
|
|
3034
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.item"),
|
|
3035
|
+
placeholder: V(r).t("wise_invoicing.invoice.detail.line_items.item_placeholder"),
|
|
3036
|
+
"is-disabled": !V(s).isEditable.value,
|
|
3036
3037
|
class: "min-w-0 flex-1",
|
|
3037
3038
|
emphasis: "medium"
|
|
3038
|
-
},
|
|
3039
|
+
}, V(et)(V(g))), null, 16, [
|
|
3039
3040
|
"id",
|
|
3040
3041
|
"label",
|
|
3041
3042
|
"placeholder",
|
|
@@ -3045,33 +3046,33 @@ var Ri = /* @__PURE__ */ F({
|
|
|
3045
3046
|
}, 8, ["depth"])]),
|
|
3046
3047
|
N("td", Ki, [P(Ei, I({
|
|
3047
3048
|
id: T("description"),
|
|
3048
|
-
label:
|
|
3049
|
-
placeholder:
|
|
3050
|
-
"is-disabled": !
|
|
3051
|
-
},
|
|
3049
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.item_description"),
|
|
3050
|
+
placeholder: V(r).t("wise_invoicing.invoice.detail.line_items.item_description_placeholder"),
|
|
3051
|
+
"is-disabled": !V(s).isEditable.value
|
|
3052
|
+
}, V(et)(V(_))), null, 16, [
|
|
3052
3053
|
"id",
|
|
3053
3054
|
"label",
|
|
3054
3055
|
"placeholder",
|
|
3055
3056
|
"is-disabled"
|
|
3056
3057
|
])]),
|
|
3057
|
-
(
|
|
3058
|
+
(R(!0), M(O, null, kt(ne.value, (e) => (R(), M("td", {
|
|
3058
3059
|
key: e.definition.uuid,
|
|
3059
3060
|
class: "p-none"
|
|
3060
|
-
}, [
|
|
3061
|
+
}, [V(s).isEditable.value ? (R(), A(Hi, {
|
|
3061
3062
|
key: 0,
|
|
3062
3063
|
id: T(`custom-field-${e.definition.uuid}`),
|
|
3063
|
-
currency:
|
|
3064
|
+
currency: V(s).meta.value.currency,
|
|
3064
3065
|
definition: e.definition,
|
|
3065
3066
|
"is-disabled": !0,
|
|
3066
3067
|
"model-value": e.value,
|
|
3067
|
-
precision:
|
|
3068
|
+
precision: V(s).meta.value.precision
|
|
3068
3069
|
}, null, 8, [
|
|
3069
3070
|
"id",
|
|
3070
3071
|
"currency",
|
|
3071
3072
|
"definition",
|
|
3072
3073
|
"model-value",
|
|
3073
3074
|
"precision"
|
|
3074
|
-
])) : e.value === null ? j("", !0) : (
|
|
3075
|
+
])) : e.value === null ? j("", !0) : (R(), A(ee, {
|
|
3075
3076
|
key: 1,
|
|
3076
3077
|
definition: e.definition,
|
|
3077
3078
|
value: e.value,
|
|
@@ -3080,20 +3081,20 @@ var Ri = /* @__PURE__ */ F({
|
|
|
3080
3081
|
}, null, 8, ["definition", "value"]))]))), 128)),
|
|
3081
3082
|
N("td", qi, [P(zi, I({
|
|
3082
3083
|
id: T("quantity"),
|
|
3083
|
-
"is-disabled": !
|
|
3084
|
-
label:
|
|
3084
|
+
"is-disabled": !V(s).isEditable.value,
|
|
3085
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.qty"),
|
|
3085
3086
|
step: "0.01"
|
|
3086
|
-
},
|
|
3087
|
+
}, V(et)(V(y)), { "onUpdate:modelValue": ie }), null, 16, [
|
|
3087
3088
|
"id",
|
|
3088
3089
|
"is-disabled",
|
|
3089
3090
|
"label"
|
|
3090
3091
|
])]),
|
|
3091
|
-
|
|
3092
|
+
V(a).isUnitVisible.value ? (R(), M("td", Ji, [P(Vi, I({
|
|
3092
3093
|
id: T("unit"),
|
|
3093
|
-
"is-disabled": !
|
|
3094
|
-
label:
|
|
3095
|
-
options:
|
|
3096
|
-
},
|
|
3094
|
+
"is-disabled": !V(s).isEditable.value,
|
|
3095
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.unit"),
|
|
3096
|
+
options: V(l)
|
|
3097
|
+
}, V(et)(V(x))), null, 16, [
|
|
3097
3098
|
"id",
|
|
3098
3099
|
"is-disabled",
|
|
3099
3100
|
"label",
|
|
@@ -3101,70 +3102,70 @@ var Ri = /* @__PURE__ */ F({
|
|
|
3101
3102
|
])])) : j("", !0),
|
|
3102
3103
|
N("td", Yi, [P(zi, I({
|
|
3103
3104
|
id: T("unit-price"),
|
|
3104
|
-
"is-disabled": !
|
|
3105
|
-
label:
|
|
3105
|
+
"is-disabled": !V(s).isEditable.value,
|
|
3106
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.unit_price"),
|
|
3106
3107
|
prefix: d.value.position === "prefix" ? d.value.symbol : void 0,
|
|
3107
3108
|
suffix: d.value.position === "suffix" ? d.value.symbol : void 0,
|
|
3108
3109
|
min: "0",
|
|
3109
3110
|
step: "0.01"
|
|
3110
|
-
},
|
|
3111
|
+
}, V(et)(V(S))), null, 16, [
|
|
3111
3112
|
"id",
|
|
3112
3113
|
"is-disabled",
|
|
3113
3114
|
"label",
|
|
3114
3115
|
"prefix",
|
|
3115
3116
|
"suffix"
|
|
3116
3117
|
])]),
|
|
3117
|
-
|
|
3118
|
+
V(a).isLineDiscountEnabled.value ? (R(), M("td", Xi, [P(zi, I({
|
|
3118
3119
|
id: T("discount"),
|
|
3119
|
-
label:
|
|
3120
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.discount"),
|
|
3120
3121
|
"is-disabled": m.value,
|
|
3121
3122
|
placeholder: "-",
|
|
3122
3123
|
min: "0",
|
|
3123
3124
|
max: "100",
|
|
3124
3125
|
step: "0.01",
|
|
3125
3126
|
suffix: "%"
|
|
3126
|
-
},
|
|
3127
|
+
}, V(et)(V(C))), null, 16, [
|
|
3127
3128
|
"id",
|
|
3128
3129
|
"label",
|
|
3129
3130
|
"is-disabled"
|
|
3130
3131
|
])])) : j("", !0),
|
|
3131
|
-
N("td", Zi,
|
|
3132
|
+
N("td", Zi, B(se(n.net)), 1),
|
|
3132
3133
|
N("td", Qi, [P(Vi, I({
|
|
3133
3134
|
id: T("vat-rate"),
|
|
3134
|
-
"is-disabled": !
|
|
3135
|
-
label:
|
|
3136
|
-
options:
|
|
3137
|
-
},
|
|
3135
|
+
"is-disabled": !V(s).isEditable.value,
|
|
3136
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.vat"),
|
|
3137
|
+
options: V(c)
|
|
3138
|
+
}, V(et)(V(w))), null, 16, [
|
|
3138
3139
|
"id",
|
|
3139
3140
|
"is-disabled",
|
|
3140
3141
|
"label",
|
|
3141
3142
|
"options"
|
|
3142
3143
|
])]),
|
|
3143
|
-
N("td", $i,
|
|
3144
|
-
|
|
3144
|
+
N("td", $i, B(ce(n.gross)), 1),
|
|
3145
|
+
V(s).hasActionsColumn.value ? (R(), M("td", ea, [P(V(U), {
|
|
3145
3146
|
justify: "end",
|
|
3146
3147
|
gap: "xxs",
|
|
3147
3148
|
class: "opacity-0 transition group-focus-within/row:opacity-100 group-hover/row:opacity-100"
|
|
3148
3149
|
}, {
|
|
3149
|
-
default:
|
|
3150
|
-
trigger:
|
|
3151
|
-
icon:
|
|
3152
|
-
label:
|
|
3150
|
+
default: H(() => [re.value.length > 0 ? (R(), A(V(gn), { key: 0 }, {
|
|
3151
|
+
trigger: H(() => [P(V(wn), {
|
|
3152
|
+
icon: V(qe),
|
|
3153
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.line_actions"),
|
|
3153
3154
|
variant: "tertiary"
|
|
3154
3155
|
}, null, 8, ["icon", "label"])]),
|
|
3155
|
-
content:
|
|
3156
|
-
default:
|
|
3157
|
-
icon:
|
|
3158
|
-
label:
|
|
3159
|
-
onSelect: t[1] ||= (e) =>
|
|
3156
|
+
content: H(() => [V(s).isEditable.value ? (R(), M(O, { key: 0 }, [P(V(_n), null, {
|
|
3157
|
+
default: H(() => [P(V(vn), {
|
|
3158
|
+
icon: V(xe),
|
|
3159
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.duplicate"),
|
|
3160
|
+
onSelect: t[1] ||= (e) => V(s).mutations.duplicateLine(n.line.id)
|
|
3160
3161
|
}, null, 8, ["icon", "label"])]),
|
|
3161
3162
|
_: 1
|
|
3162
|
-
}), P(
|
|
3163
|
-
default:
|
|
3163
|
+
}), P(V(yn))], 64)) : j("", !0), P(V(_n), null, {
|
|
3164
|
+
default: H(() => [(R(!0), M(O, null, kt(re.value, (e) => (R(), A(V(vn), {
|
|
3164
3165
|
key: e.definition.uuid,
|
|
3165
|
-
icon:
|
|
3166
|
-
label:
|
|
3167
|
-
onSelect: (t) =>
|
|
3166
|
+
icon: V(be),
|
|
3167
|
+
label: V(r).t("wise_invoicing.custom_field.reference.open", { label: e.label }),
|
|
3168
|
+
onSelect: (t) => V(s).openReferenceLink(e)
|
|
3168
3169
|
}, null, 8, [
|
|
3169
3170
|
"icon",
|
|
3170
3171
|
"label",
|
|
@@ -3173,22 +3174,22 @@ var Ri = /* @__PURE__ */ F({
|
|
|
3173
3174
|
_: 1
|
|
3174
3175
|
})]),
|
|
3175
3176
|
_: 1
|
|
3176
|
-
})) :
|
|
3177
|
+
})) : V(s).isEditable.value ? (R(), A(V(wn), {
|
|
3177
3178
|
key: 1,
|
|
3178
|
-
icon:
|
|
3179
|
-
"is-disabled": !
|
|
3180
|
-
label:
|
|
3179
|
+
icon: V(xe),
|
|
3180
|
+
"is-disabled": !V(s).isEditable.value,
|
|
3181
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.duplicate"),
|
|
3181
3182
|
variant: "tertiary",
|
|
3182
|
-
onClick: t[2] ||= (e) =>
|
|
3183
|
+
onClick: t[2] ||= (e) => V(s).mutations.duplicateLine(n.line.id)
|
|
3183
3184
|
}, null, 8, [
|
|
3184
3185
|
"icon",
|
|
3185
3186
|
"is-disabled",
|
|
3186
3187
|
"label"
|
|
3187
|
-
])) : j("", !0),
|
|
3188
|
+
])) : j("", !0), V(s).isEditable.value ? (R(), A(V(wn), {
|
|
3188
3189
|
key: 2,
|
|
3189
|
-
icon:
|
|
3190
|
-
"is-disabled": !
|
|
3191
|
-
label:
|
|
3190
|
+
icon: V(ue),
|
|
3191
|
+
"is-disabled": !V(s).isEditable.value,
|
|
3192
|
+
label: V(r).t("wise_invoicing.invoice.detail.line_items.delete"),
|
|
3192
3193
|
variant: "destructive-tertiary",
|
|
3193
3194
|
onClick: oe
|
|
3194
3195
|
}, null, 8, [
|
|
@@ -3436,10 +3437,10 @@ var Ua = Ha(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Wa = Ha(/E
|
|
|
3436
3437
|
capture: !1,
|
|
3437
3438
|
passive: !1
|
|
3438
3439
|
};
|
|
3439
|
-
function
|
|
3440
|
+
function K(e, t, n) {
|
|
3440
3441
|
e.addEventListener(t, n, !Ua && Ya);
|
|
3441
3442
|
}
|
|
3442
|
-
function
|
|
3443
|
+
function q(e, t, n) {
|
|
3443
3444
|
e.removeEventListener(t, n, !Ua && Ya);
|
|
3444
3445
|
}
|
|
3445
3446
|
function Xa(e, t) {
|
|
@@ -3471,7 +3472,7 @@ var $a = /\s+/g;
|
|
|
3471
3472
|
function eo(e, t, n) {
|
|
3472
3473
|
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace($a, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace($a, " "));
|
|
3473
3474
|
}
|
|
3474
|
-
function
|
|
3475
|
+
function J(e, t, n) {
|
|
3475
3476
|
var r = e && e.style;
|
|
3476
3477
|
if (r) {
|
|
3477
3478
|
if (n === void 0) return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (n = e.currentStyle), t === void 0 ? n : n[t];
|
|
@@ -3482,7 +3483,7 @@ function to(e, t) {
|
|
|
3482
3483
|
var n = "";
|
|
3483
3484
|
if (typeof e == "string") n = e;
|
|
3484
3485
|
else do {
|
|
3485
|
-
var r =
|
|
3486
|
+
var r = J(e, "transform");
|
|
3486
3487
|
r && r !== "none" && (n = r + " " + n);
|
|
3487
3488
|
} while (!t && (e = e.parentNode));
|
|
3488
3489
|
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
@@ -3503,9 +3504,9 @@ function io(e, t, n, r, i) {
|
|
|
3503
3504
|
if (e.getBoundingClientRect || e === window) {
|
|
3504
3505
|
var a, o, s, c, l, u, d;
|
|
3505
3506
|
if (e !== window && e.parentNode && e !== ro() ? (a = e.getBoundingClientRect(), o = a.top, s = a.left, c = a.bottom, l = a.right, u = a.height, d = a.width) : (o = 0, s = 0, c = window.innerHeight, l = window.innerWidth, u = window.innerHeight, d = window.innerWidth), (t || n) && e !== window && (i ||= e.parentNode, !Ua)) do
|
|
3506
|
-
if (i && i.getBoundingClientRect && (
|
|
3507
|
+
if (i && i.getBoundingClientRect && (J(i, "transform") !== "none" || n && J(i, "position") !== "static")) {
|
|
3507
3508
|
var f = i.getBoundingClientRect();
|
|
3508
|
-
o -= f.top + parseInt(
|
|
3509
|
+
o -= f.top + parseInt(J(i, "border-top-width")), s -= f.left + parseInt(J(i, "border-left-width")), c = o + a.height, l = s + a.width;
|
|
3509
3510
|
break;
|
|
3510
3511
|
}
|
|
3511
3512
|
while (i = i.parentNode);
|
|
@@ -3543,7 +3544,7 @@ function oo(e, t, n, r) {
|
|
|
3543
3544
|
return null;
|
|
3544
3545
|
}
|
|
3545
3546
|
function so(e, t) {
|
|
3546
|
-
for (var n = e.lastElementChild; n && (n === $.ghost ||
|
|
3547
|
+
for (var n = e.lastElementChild; n && (n === $.ghost || J(n, "display") === "none" || t && !Xa(n, t));) n = n.previousElementSibling;
|
|
3547
3548
|
return n || null;
|
|
3548
3549
|
}
|
|
3549
3550
|
function co(e, t) {
|
|
@@ -3571,7 +3572,7 @@ function fo(e, t) {
|
|
|
3571
3572
|
var n = e, r = !1;
|
|
3572
3573
|
do
|
|
3573
3574
|
if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
|
|
3574
|
-
var i =
|
|
3575
|
+
var i = J(n);
|
|
3575
3576
|
if (n.clientWidth < n.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
|
|
3576
3577
|
if (!n.getBoundingClientRect || n === document.body) return ro();
|
|
3577
3578
|
if (r || t) return n;
|
|
@@ -3624,7 +3625,7 @@ function So() {
|
|
|
3624
3625
|
return {
|
|
3625
3626
|
captureAnimationState: function() {
|
|
3626
3627
|
e = [], this.options.animation && [].slice.call(this.el.children).forEach(function(t) {
|
|
3627
|
-
if (
|
|
3628
|
+
if (J(t, "display") !== "none" && t !== $.ghost) {
|
|
3628
3629
|
e.push({
|
|
3629
3630
|
target: t,
|
|
3630
3631
|
rect: io(t)
|
|
@@ -3661,10 +3662,10 @@ function So() {
|
|
|
3661
3662
|
},
|
|
3662
3663
|
animate: function(e, t, n, r) {
|
|
3663
3664
|
if (r) {
|
|
3664
|
-
|
|
3665
|
+
J(e, "transition", ""), J(e, "transform", "");
|
|
3665
3666
|
var i = to(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1);
|
|
3666
|
-
e.animatingX = !!s, e.animatingY = !!c,
|
|
3667
|
-
|
|
3667
|
+
e.animatingX = !!s, e.animatingY = !!c, J(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = Co(e), J(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), J(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() {
|
|
3668
|
+
J(e, "transition", ""), J(e, "transform", ""), e.animated = !1, e.animatingX = !1, e.animatingY = !1;
|
|
3668
3669
|
}, r);
|
|
3669
3670
|
}
|
|
3670
3671
|
}
|
|
@@ -3734,29 +3735,29 @@ function Oo(e) {
|
|
|
3734
3735
|
var ko = ["evt"], Ao = function(e, t) {
|
|
3735
3736
|
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = Ba(n, ko);
|
|
3736
3737
|
Do.pluginEvent.bind($)(e, t, Fa({
|
|
3737
|
-
dragEl:
|
|
3738
|
-
parentEl:
|
|
3738
|
+
dragEl: Y,
|
|
3739
|
+
parentEl: Mo,
|
|
3739
3740
|
ghostEl: X,
|
|
3740
3741
|
rootEl: Z,
|
|
3741
|
-
nextEl:
|
|
3742
|
-
lastDownEl:
|
|
3742
|
+
nextEl: No,
|
|
3743
|
+
lastDownEl: Po,
|
|
3743
3744
|
cloneEl: Q,
|
|
3744
|
-
cloneHidden:
|
|
3745
|
-
dragStarted:
|
|
3746
|
-
putSortable:
|
|
3745
|
+
cloneHidden: Fo,
|
|
3746
|
+
dragStarted: Zo,
|
|
3747
|
+
putSortable: Vo,
|
|
3747
3748
|
activeSortable: $.active,
|
|
3748
3749
|
originalEvent: r,
|
|
3749
|
-
oldIndex:
|
|
3750
|
-
oldDraggableIndex:
|
|
3751
|
-
newIndex:
|
|
3752
|
-
newDraggableIndex:
|
|
3753
|
-
hideGhostForTarget:
|
|
3754
|
-
unhideGhostForTarget:
|
|
3750
|
+
oldIndex: Io,
|
|
3751
|
+
oldDraggableIndex: Ro,
|
|
3752
|
+
newIndex: Lo,
|
|
3753
|
+
newDraggableIndex: zo,
|
|
3754
|
+
hideGhostForTarget: gs,
|
|
3755
|
+
unhideGhostForTarget: _s,
|
|
3755
3756
|
cloneNowHidden: function() {
|
|
3756
|
-
|
|
3757
|
+
Fo = !0;
|
|
3757
3758
|
},
|
|
3758
3759
|
cloneNowShown: function() {
|
|
3759
|
-
|
|
3760
|
+
Fo = !1;
|
|
3760
3761
|
},
|
|
3761
3762
|
dispatchSortableEvent: function(e) {
|
|
3762
3763
|
jo({
|
|
@@ -3769,44 +3770,44 @@ var ko = ["evt"], Ao = function(e, t) {
|
|
|
3769
3770
|
};
|
|
3770
3771
|
function jo(e) {
|
|
3771
3772
|
Oo(Fa({
|
|
3772
|
-
putSortable:
|
|
3773
|
+
putSortable: Vo,
|
|
3773
3774
|
cloneEl: Q,
|
|
3774
|
-
targetEl:
|
|
3775
|
+
targetEl: Y,
|
|
3775
3776
|
rootEl: Z,
|
|
3776
|
-
oldIndex:
|
|
3777
|
-
oldDraggableIndex:
|
|
3778
|
-
newIndex:
|
|
3779
|
-
newDraggableIndex:
|
|
3777
|
+
oldIndex: Io,
|
|
3778
|
+
oldDraggableIndex: Ro,
|
|
3779
|
+
newIndex: Lo,
|
|
3780
|
+
newDraggableIndex: zo
|
|
3780
3781
|
}, e));
|
|
3781
3782
|
}
|
|
3782
|
-
var
|
|
3783
|
-
if (
|
|
3783
|
+
var Y, Mo, X, Z, No, Po, Q, Fo, Io, Lo, Ro, zo, Bo, Vo, Ho = !1, Uo = !1, Wo = [], Go, Ko, qo, Jo, Yo, Xo, Zo, Qo, $o, es = !1, ts = !1, ns, rs, is = [], as = !1, os = [], ss = typeof document < "u", cs = qa, ls = Wa || Ua ? "cssFloat" : "float", us = ss && !Ja && !qa && "draggable" in document.createElement("div"), ds = function() {
|
|
3784
|
+
if (ss) {
|
|
3784
3785
|
if (Ua) return !1;
|
|
3785
3786
|
var e = document.createElement("x");
|
|
3786
3787
|
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
3787
3788
|
}
|
|
3788
|
-
}(),
|
|
3789
|
-
var n =
|
|
3789
|
+
}(), fs = function(e, t) {
|
|
3790
|
+
var n = J(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = oo(e, 0, t), a = oo(e, 1, t), o = i && J(i), s = a && J(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + io(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + io(a).width;
|
|
3790
3791
|
if (n.display === "flex") return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
3791
3792
|
if (n.display === "grid") return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
3792
3793
|
if (i && o.float && o.float !== "none") {
|
|
3793
3794
|
var u = o.float === "left" ? "left" : "right";
|
|
3794
3795
|
return a && (s.clear === "both" || s.clear === u) ? "vertical" : "horizontal";
|
|
3795
3796
|
}
|
|
3796
|
-
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[
|
|
3797
|
-
},
|
|
3797
|
+
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[ls] === "none" || a && n[ls] === "none" && c + l > r) ? "vertical" : "horizontal";
|
|
3798
|
+
}, ps = function(e, t, n) {
|
|
3798
3799
|
var r = n ? e.left : e.top, i = n ? e.right : e.bottom, a = n ? e.width : e.height, o = n ? t.left : t.top, s = n ? t.right : t.bottom, c = n ? t.width : t.height;
|
|
3799
3800
|
return r === o || i === s || r + a / 2 === o + c / 2;
|
|
3800
|
-
},
|
|
3801
|
+
}, ms = function(e, t) {
|
|
3801
3802
|
var n;
|
|
3802
|
-
return
|
|
3803
|
+
return Wo.some(function(r) {
|
|
3803
3804
|
var i = r[xo].options.emptyInsertThreshold;
|
|
3804
3805
|
if (i && !so(r)) {
|
|
3805
3806
|
var a = io(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i;
|
|
3806
3807
|
if (o && s) return n = r;
|
|
3807
3808
|
}
|
|
3808
3809
|
}), n;
|
|
3809
|
-
},
|
|
3810
|
+
}, hs = function(e) {
|
|
3810
3811
|
function t(e, n) {
|
|
3811
3812
|
return function(r, i, a, o) {
|
|
3812
3813
|
var s = r.options.group.name && i.options.group.name && r.options.group.name === i.options.group.name;
|
|
@@ -3820,26 +3821,26 @@ var J, Y, X, Z, Mo, No, Q, Po, Fo, Io, Lo, Ro, zo, Bo, Vo = !1, Ho = !1, Uo = []
|
|
|
3820
3821
|
}
|
|
3821
3822
|
var n = {}, r = e.group;
|
|
3822
3823
|
(!r || Ia(r) != "object") && (r = { name: r }), n.name = r.name, n.checkPull = t(r.pull, !0), n.checkPut = t(r.put), n.revertClone = r.revertClone, e.group = n;
|
|
3823
|
-
}, hs = function() {
|
|
3824
|
-
!us && X && q(X, "display", "none");
|
|
3825
3824
|
}, gs = function() {
|
|
3826
|
-
!
|
|
3825
|
+
!ds && X && J(X, "display", "none");
|
|
3826
|
+
}, _s = function() {
|
|
3827
|
+
!ds && X && J(X, "display", "");
|
|
3827
3828
|
};
|
|
3828
|
-
|
|
3829
|
-
if (
|
|
3829
|
+
ss && !Ja && document.addEventListener("click", function(e) {
|
|
3830
|
+
if (Uo) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), Uo = !1, !1;
|
|
3830
3831
|
}, !0);
|
|
3831
|
-
var
|
|
3832
|
-
if (
|
|
3832
|
+
var vs = function(e) {
|
|
3833
|
+
if (Y) {
|
|
3833
3834
|
e = e.touches ? e.touches[0] : e;
|
|
3834
|
-
var t =
|
|
3835
|
+
var t = ms(e.clientX, e.clientY);
|
|
3835
3836
|
if (t) {
|
|
3836
3837
|
var n = {};
|
|
3837
3838
|
for (var r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
|
|
3838
3839
|
n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[xo]._onDragOver(n);
|
|
3839
3840
|
}
|
|
3840
3841
|
}
|
|
3841
|
-
},
|
|
3842
|
-
|
|
3842
|
+
}, ys = function(e) {
|
|
3843
|
+
Y && Y.parentNode[xo]._isOutsideThisEl(e.target);
|
|
3843
3844
|
};
|
|
3844
3845
|
function $(e, t) {
|
|
3845
3846
|
if (!(e && e.nodeType && e.nodeType === 1)) throw `Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;
|
|
@@ -3856,7 +3857,7 @@ function $(e, t) {
|
|
|
3856
3857
|
invertedSwapThreshold: null,
|
|
3857
3858
|
removeCloneOnHide: !0,
|
|
3858
3859
|
direction: function() {
|
|
3859
|
-
return
|
|
3860
|
+
return fs(e, this.options);
|
|
3860
3861
|
},
|
|
3861
3862
|
ghostClass: "sortable-ghost",
|
|
3862
3863
|
chosenClass: "sortable-chosen",
|
|
@@ -3887,22 +3888,22 @@ function $(e, t) {
|
|
|
3887
3888
|
emptyInsertThreshold: 5
|
|
3888
3889
|
};
|
|
3889
3890
|
for (var r in Do.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]);
|
|
3890
|
-
for (var i in
|
|
3891
|
-
this.nativeDraggable = !t.forceFallback &&
|
|
3891
|
+
for (var i in hs(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
3892
|
+
this.nativeDraggable = !t.forceFallback && us, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? K(e, "pointerdown", this._onTapStart) : (K(e, "mousedown", this._onTapStart), K(e, "touchstart", this._onTapStart)), this.nativeDraggable && (K(e, "dragover", this), K(e, "dragenter", this)), Wo.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), Ra(this, So());
|
|
3892
3893
|
}
|
|
3893
3894
|
$.prototype = {
|
|
3894
3895
|
constructor: $,
|
|
3895
3896
|
_isOutsideThisEl: function(e) {
|
|
3896
|
-
!this.el.contains(e) && e !== this.el && (
|
|
3897
|
+
!this.el.contains(e) && e !== this.el && (Qo = null);
|
|
3897
3898
|
},
|
|
3898
3899
|
_getDirection: function(e, t) {
|
|
3899
|
-
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t,
|
|
3900
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, Y) : this.options.direction;
|
|
3900
3901
|
},
|
|
3901
3902
|
_onTapStart: function(e) {
|
|
3902
3903
|
if (e.cancelable) {
|
|
3903
3904
|
var t = this, n = this.el, r = this.options, i = r.preventOnFilter, a = e.type, o = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (o || e).target, c = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, l = r.filter;
|
|
3904
|
-
if (
|
|
3905
|
-
if (
|
|
3905
|
+
if (ks(n), !Y && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && Ka && s && s.tagName.toUpperCase() === "SELECT") && (s = Qa(s, r.draggable, n, !1), !(s && s.animated) && Po !== s)) {
|
|
3906
|
+
if (Io = co(s), Ro = co(s, r.draggable), typeof l == "function") {
|
|
3906
3907
|
if (l.call(this, e, s, this)) {
|
|
3907
3908
|
jo({
|
|
3908
3909
|
sortable: t,
|
|
@@ -3933,26 +3934,26 @@ $.prototype = {
|
|
|
3933
3934
|
},
|
|
3934
3935
|
_prepareDragStart: function(e, t, n) {
|
|
3935
3936
|
var r = this, i = r.el, a = r.options, o = i.ownerDocument, s;
|
|
3936
|
-
if (n && !
|
|
3937
|
+
if (n && !Y && n.parentNode === i) {
|
|
3937
3938
|
var c = io(n);
|
|
3938
|
-
if (Z = i,
|
|
3939
|
-
target:
|
|
3939
|
+
if (Z = i, Y = n, Mo = Y.parentNode, No = Y.nextSibling, Po = n, Bo = a.group, $.dragged = Y, Go = {
|
|
3940
|
+
target: Y,
|
|
3940
3941
|
clientX: (t || e).clientX,
|
|
3941
3942
|
clientY: (t || e).clientY
|
|
3942
|
-
},
|
|
3943
|
-
Ao("delayEnded", r, { evt: e }), $.eventCanceled ? r._onDrop() : (r._disableDelayedDragEvents(), !Ga && r.nativeDraggable && (
|
|
3943
|
+
}, Yo = Go.clientX - c.left, Xo = Go.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, Y.style["will-change"] = "all", s = function() {
|
|
3944
|
+
Ao("delayEnded", r, { evt: e }), $.eventCanceled ? r._onDrop() : (r._disableDelayedDragEvents(), !Ga && r.nativeDraggable && (Y.draggable = !0), r._triggerDragStart(e, t), jo({
|
|
3944
3945
|
sortable: r,
|
|
3945
3946
|
name: "choose",
|
|
3946
3947
|
originalEvent: e
|
|
3947
|
-
}), eo(
|
|
3948
|
+
}), eo(Y, a.chosenClass, !0));
|
|
3948
3949
|
}, a.ignore.split(",").forEach(function(e) {
|
|
3949
|
-
no(
|
|
3950
|
-
}),
|
|
3950
|
+
no(Y, e.trim(), Ss);
|
|
3951
|
+
}), K(o, "dragover", vs), K(o, "mousemove", vs), K(o, "touchmove", vs), K(o, "mouseup", r._onDrop), K(o, "touchend", r._onDrop), K(o, "touchcancel", r._onDrop), Ga && this.nativeDraggable && (this.options.touchStartThreshold = 4, Y.draggable = !0), Ao("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(Wa || Ua))) {
|
|
3951
3952
|
if ($.eventCanceled) {
|
|
3952
3953
|
this._onDrop();
|
|
3953
3954
|
return;
|
|
3954
3955
|
}
|
|
3955
|
-
|
|
3956
|
+
K(o, "mouseup", r._disableDelayedDrag), K(o, "touchend", r._disableDelayedDrag), K(o, "touchcancel", r._disableDelayedDrag), K(o, "mousemove", r._delayedDragTouchMoveHandler), K(o, "touchmove", r._delayedDragTouchMoveHandler), a.supportPointer && K(o, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, a.delay);
|
|
3956
3957
|
} else s();
|
|
3957
3958
|
}
|
|
3958
3959
|
},
|
|
@@ -3961,25 +3962,25 @@ $.prototype = {
|
|
|
3961
3962
|
Math.max(Math.abs(t.clientX - this._lastX), Math.abs(t.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
|
|
3962
3963
|
},
|
|
3963
3964
|
_disableDelayedDrag: function() {
|
|
3964
|
-
|
|
3965
|
+
Y && Ss(Y), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
3965
3966
|
},
|
|
3966
3967
|
_disableDelayedDragEvents: function() {
|
|
3967
3968
|
var e = this.el.ownerDocument;
|
|
3968
|
-
|
|
3969
|
+
q(e, "mouseup", this._disableDelayedDrag), q(e, "touchend", this._disableDelayedDrag), q(e, "touchcancel", this._disableDelayedDrag), q(e, "mousemove", this._delayedDragTouchMoveHandler), q(e, "touchmove", this._delayedDragTouchMoveHandler), q(e, "pointermove", this._delayedDragTouchMoveHandler);
|
|
3969
3970
|
},
|
|
3970
3971
|
_triggerDragStart: function(e, t) {
|
|
3971
|
-
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ?
|
|
3972
|
+
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? K(document, "pointermove", this._onTouchMove) : t ? K(document, "touchmove", this._onTouchMove) : K(document, "mousemove", this._onTouchMove) : (K(Y, "dragend", this), K(Z, "dragstart", this._onDragStart));
|
|
3972
3973
|
try {
|
|
3973
|
-
document.selection ?
|
|
3974
|
+
document.selection ? As(function() {
|
|
3974
3975
|
document.selection.empty();
|
|
3975
3976
|
}) : window.getSelection().removeAllRanges();
|
|
3976
3977
|
} catch {}
|
|
3977
3978
|
},
|
|
3978
3979
|
_dragStarted: function(e, t) {
|
|
3979
|
-
if (
|
|
3980
|
-
Ao("dragStarted", this, { evt: t }), this.nativeDraggable &&
|
|
3980
|
+
if (Ho = !1, Z && Y) {
|
|
3981
|
+
Ao("dragStarted", this, { evt: t }), this.nativeDraggable && K(document, "dragover", ys);
|
|
3981
3982
|
var n = this.options;
|
|
3982
|
-
!e && eo(
|
|
3983
|
+
!e && eo(Y, n.dragClass, !1), eo(Y, n.ghostClass, !0), $.active = this, e && this._appendGhost(), jo({
|
|
3983
3984
|
sortable: this,
|
|
3984
3985
|
name: "start",
|
|
3985
3986
|
originalEvent: t
|
|
@@ -3987,33 +3988,33 @@ $.prototype = {
|
|
|
3987
3988
|
} else this._nulling();
|
|
3988
3989
|
},
|
|
3989
3990
|
_emulateDragOver: function() {
|
|
3990
|
-
if (
|
|
3991
|
-
this._lastX =
|
|
3992
|
-
for (var e = document.elementFromPoint(
|
|
3993
|
-
if (
|
|
3991
|
+
if (Ko) {
|
|
3992
|
+
this._lastX = Ko.clientX, this._lastY = Ko.clientY, gs();
|
|
3993
|
+
for (var e = document.elementFromPoint(Ko.clientX, Ko.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(Ko.clientX, Ko.clientY), e !== t);) t = e;
|
|
3994
|
+
if (Y.parentNode[xo]._isOutsideThisEl(e), t) do {
|
|
3994
3995
|
if (t[xo]) {
|
|
3995
3996
|
var n = void 0;
|
|
3996
3997
|
if (n = t[xo]._onDragOver({
|
|
3997
|
-
clientX:
|
|
3998
|
-
clientY:
|
|
3998
|
+
clientX: Ko.clientX,
|
|
3999
|
+
clientY: Ko.clientY,
|
|
3999
4000
|
target: e,
|
|
4000
4001
|
rootEl: t
|
|
4001
4002
|
}), n && !this.options.dragoverBubble) break;
|
|
4002
4003
|
}
|
|
4003
4004
|
e = t;
|
|
4004
4005
|
} while (t = t.parentNode);
|
|
4005
|
-
|
|
4006
|
+
_s();
|
|
4006
4007
|
}
|
|
4007
4008
|
},
|
|
4008
4009
|
_onTouchMove: function(e) {
|
|
4009
|
-
if (
|
|
4010
|
-
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = X && to(X, !0), o = X && a && a.a, s = X && a && a.d, c =
|
|
4011
|
-
if (!$.active && !
|
|
4010
|
+
if (Go) {
|
|
4011
|
+
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = X && to(X, !0), o = X && a && a.a, s = X && a && a.d, c = cs && rs && lo(rs), l = (i.clientX - Go.clientX + r.x) / (o || 1) + (c ? c[0] - is[0] : 0) / (o || 1), u = (i.clientY - Go.clientY + r.y) / (s || 1) + (c ? c[1] - is[1] : 0) / (s || 1);
|
|
4012
|
+
if (!$.active && !Ho) {
|
|
4012
4013
|
if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) return;
|
|
4013
4014
|
this._onDragStart(e, !0);
|
|
4014
4015
|
}
|
|
4015
4016
|
if (X) {
|
|
4016
|
-
a ? (a.e += l - (
|
|
4017
|
+
a ? (a.e += l - (qo || 0), a.f += u - (Jo || 0)) : a = {
|
|
4017
4018
|
a: 1,
|
|
4018
4019
|
b: 0,
|
|
4019
4020
|
c: 0,
|
|
@@ -4022,33 +4023,33 @@ $.prototype = {
|
|
|
4022
4023
|
f: u
|
|
4023
4024
|
};
|
|
4024
4025
|
var d = `matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;
|
|
4025
|
-
|
|
4026
|
+
J(X, "webkitTransform", d), J(X, "mozTransform", d), J(X, "msTransform", d), J(X, "transform", d), qo = l, Jo = u, Ko = i;
|
|
4026
4027
|
}
|
|
4027
4028
|
e.cancelable && e.preventDefault();
|
|
4028
4029
|
}
|
|
4029
4030
|
},
|
|
4030
4031
|
_appendGhost: function() {
|
|
4031
4032
|
if (!X) {
|
|
4032
|
-
var e = this.options.fallbackOnBody ? document.body : Z, t = io(
|
|
4033
|
-
if (
|
|
4034
|
-
for (
|
|
4035
|
-
|
|
4033
|
+
var e = this.options.fallbackOnBody ? document.body : Z, t = io(Y, !0, cs, !0, e), n = this.options;
|
|
4034
|
+
if (cs) {
|
|
4035
|
+
for (rs = e; J(rs, "position") === "static" && J(rs, "transform") === "none" && rs !== document;) rs = rs.parentNode;
|
|
4036
|
+
rs !== document.body && rs !== document.documentElement ? (rs === document && (rs = ro()), t.top += rs.scrollTop, t.left += rs.scrollLeft) : rs = ro(), is = lo(rs);
|
|
4036
4037
|
}
|
|
4037
|
-
X =
|
|
4038
|
+
X = Y.cloneNode(!0), eo(X, n.ghostClass, !1), eo(X, n.fallbackClass, !0), eo(X, n.dragClass, !0), J(X, "transition", ""), J(X, "transform", ""), J(X, "box-sizing", "border-box"), J(X, "margin", 0), J(X, "top", t.top), J(X, "left", t.left), J(X, "width", t.width), J(X, "height", t.height), J(X, "opacity", "0.8"), J(X, "position", cs ? "absolute" : "fixed"), J(X, "zIndex", "100000"), J(X, "pointerEvents", "none"), $.ghost = X, e.appendChild(X), J(X, "transform-origin", Yo / parseInt(X.style.width) * 100 + "% " + Xo / parseInt(X.style.height) * 100 + "%");
|
|
4038
4039
|
}
|
|
4039
4040
|
},
|
|
4040
4041
|
_onDragStart: function(e, t) {
|
|
4041
4042
|
var n = this, r = e.dataTransfer, i = n.options;
|
|
4042
|
-
Ao("dragStart", this, { evt: e }), $.eventCanceled ? this._onDrop() : (Ao("setupClone", this), $.eventCanceled || (Q = yo(
|
|
4043
|
-
Ao("clone", n), !$.eventCanceled && (n.options.removeCloneOnHide || Z.insertBefore(Q,
|
|
4043
|
+
Ao("dragStart", this, { evt: e }), $.eventCanceled ? this._onDrop() : (Ao("setupClone", this), $.eventCanceled || (Q = yo(Y), Q.removeAttribute("id"), Q.draggable = !1, Q.style["will-change"] = "", this._hideClone(), eo(Q, this.options.chosenClass, !1), $.clone = Q), n.cloneId = As(function() {
|
|
4044
|
+
Ao("clone", n), !$.eventCanceled && (n.options.removeCloneOnHide || Z.insertBefore(Q, Y), n._hideClone(), jo({
|
|
4044
4045
|
sortable: n,
|
|
4045
4046
|
name: "clone"
|
|
4046
4047
|
}));
|
|
4047
|
-
}), !t && eo(
|
|
4048
|
+
}), !t && eo(Y, i.dragClass, !0), t ? (Uo = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (q(document, "mouseup", n._onDrop), q(document, "touchend", n._onDrop), q(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, Y)), K(document, "drop", n), J(Y, "transform", "translateZ(0)")), Ho = !0, n._dragStartId = As(n._dragStarted.bind(n, t, e)), K(document, "selectstart", n), Zo = !0, Ka && J(document.body, "user-select", "none"));
|
|
4048
4049
|
},
|
|
4049
4050
|
_onDragOver: function(e) {
|
|
4050
|
-
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = $.active, l =
|
|
4051
|
-
if (
|
|
4051
|
+
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = $.active, l = Bo === s, u = o.sort, d = Vo || c, f, p = this, m = !1;
|
|
4052
|
+
if (as) return;
|
|
4052
4053
|
function h(o, s) {
|
|
4053
4054
|
Ao(o, p, Fa({
|
|
4054
4055
|
evt: e,
|
|
@@ -4062,7 +4063,7 @@ $.prototype = {
|
|
|
4062
4063
|
target: n,
|
|
4063
4064
|
completed: _,
|
|
4064
4065
|
onMove: function(n, i) {
|
|
4065
|
-
return
|
|
4066
|
+
return xs(Z, t, Y, r, n, io(n), e, i);
|
|
4066
4067
|
},
|
|
4067
4068
|
changed: v
|
|
4068
4069
|
}, s));
|
|
@@ -4071,115 +4072,115 @@ $.prototype = {
|
|
|
4071
4072
|
h("dragOverAnimationCapture"), p.captureAnimationState(), p !== d && d.captureAnimationState();
|
|
4072
4073
|
}
|
|
4073
4074
|
function _(r) {
|
|
4074
|
-
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (eo(
|
|
4075
|
+
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (eo(Y, Vo ? Vo.options.ghostClass : c.options.ghostClass, !1), eo(Y, o.ghostClass, !0)), Vo !== p && p !== $.active ? Vo = p : p === $.active && Vo && (Vo = null), d === p && (p._ignoreWhileAnimating = n), p.animateAll(function() {
|
|
4075
4076
|
h("dragOverAnimationComplete"), p._ignoreWhileAnimating = null;
|
|
4076
|
-
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n ===
|
|
4077
|
+
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === Y && !Y.animated || n === t && !n.animated) && (Qo = null), !o.dragoverBubble && !e.rootEl && n !== document && (Y.parentNode[xo]._isOutsideThisEl(e.target), !r && vs(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0;
|
|
4077
4078
|
}
|
|
4078
4079
|
function v() {
|
|
4079
|
-
|
|
4080
|
+
Lo = co(Y), zo = co(Y, o.draggable), jo({
|
|
4080
4081
|
sortable: p,
|
|
4081
4082
|
name: "change",
|
|
4082
4083
|
toEl: t,
|
|
4083
|
-
newIndex:
|
|
4084
|
-
newDraggableIndex:
|
|
4084
|
+
newIndex: Lo,
|
|
4085
|
+
newDraggableIndex: zo,
|
|
4085
4086
|
originalEvent: e
|
|
4086
4087
|
});
|
|
4087
4088
|
}
|
|
4088
4089
|
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = Qa(n, o.draggable, t, !0), h("dragOver"), $.eventCanceled) return m;
|
|
4089
|
-
if (
|
|
4090
|
-
if (
|
|
4091
|
-
if (f = this._getDirection(e, n) === "vertical", r = io(
|
|
4092
|
-
if (a) return
|
|
4090
|
+
if (Y.contains(e.target) || n.animated && n.animatingX && n.animatingY || p._ignoreWhileAnimating === n) return _(!1);
|
|
4091
|
+
if (Uo = !1, c && !o.disabled && (l ? u || (a = Mo !== Z) : Vo === this || (this.lastPutMode = Bo.checkPull(this, c, Y, e)) && s.checkPut(this, c, Y, e))) {
|
|
4092
|
+
if (f = this._getDirection(e, n) === "vertical", r = io(Y), h("dragOverValid"), $.eventCanceled) return m;
|
|
4093
|
+
if (a) return Mo = Z, g(), this._hideClone(), h("revert"), $.eventCanceled || (No ? Z.insertBefore(Y, No) : Z.appendChild(Y)), _(!0);
|
|
4093
4094
|
var y = so(t, o.draggable);
|
|
4094
|
-
if (!y ||
|
|
4095
|
-
if (y ===
|
|
4096
|
-
if (y && t === e.target && (n = y), n && (i = io(n)),
|
|
4097
|
-
} else if (y &&
|
|
4095
|
+
if (!y || Ts(e, f, this) && !y.animated) {
|
|
4096
|
+
if (y === Y) return _(!1);
|
|
4097
|
+
if (y && t === e.target && (n = y), n && (i = io(n)), xs(Z, t, Y, r, n, i, e, !!n) !== !1) return g(), y && y.nextSibling ? t.insertBefore(Y, y.nextSibling) : t.appendChild(Y), Mo = t, v(), _(!0);
|
|
4098
|
+
} else if (y && ws(e, f, this)) {
|
|
4098
4099
|
var b = oo(t, 0, o, !0);
|
|
4099
|
-
if (b ===
|
|
4100
|
-
if (n = b, i = io(n),
|
|
4100
|
+
if (b === Y) return _(!1);
|
|
4101
|
+
if (n = b, i = io(n), xs(Z, t, Y, r, n, i, e, !1) !== !1) return g(), t.insertBefore(Y, b), Mo = t, v(), _(!0);
|
|
4101
4102
|
} else if (n.parentNode === t) {
|
|
4102
4103
|
i = io(n);
|
|
4103
|
-
var x = 0, S,
|
|
4104
|
-
|
|
4104
|
+
var x = 0, S, ee = Y.parentNode !== t, C = !ps(Y.animated && Y.toRect || r, n.animated && n.toRect || i, f), w = f ? "top" : "left", te = ao(n, "top", "top") || ao(Y, "top", "top"), ne = te ? te.scrollTop : void 0;
|
|
4105
|
+
Qo !== n && (S = i[w], es = !1, ts = !C && o.invertSwap || ee), x = Es(e, n, i, f, C ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, ts, Qo === n);
|
|
4105
4106
|
var re;
|
|
4106
4107
|
if (x !== 0) {
|
|
4107
|
-
var ie = co(
|
|
4108
|
+
var ie = co(Y);
|
|
4108
4109
|
do
|
|
4109
|
-
ie -= x, re =
|
|
4110
|
-
while (re && (
|
|
4110
|
+
ie -= x, re = Mo.children[ie];
|
|
4111
|
+
while (re && (J(re, "display") === "none" || re === X));
|
|
4111
4112
|
}
|
|
4112
4113
|
if (x === 0 || re === n) return _(!1);
|
|
4113
|
-
|
|
4114
|
+
Qo = n, $o = x;
|
|
4114
4115
|
var T = n.nextElementSibling, ae = !1;
|
|
4115
4116
|
ae = x === 1;
|
|
4116
|
-
var oe =
|
|
4117
|
-
if (oe !== !1) return (oe === 1 || oe === -1) && (ae = oe === 1),
|
|
4117
|
+
var oe = xs(Z, t, Y, r, n, i, e, ae);
|
|
4118
|
+
if (oe !== !1) return (oe === 1 || oe === -1) && (ae = oe === 1), as = !0, setTimeout(Cs, 30), g(), ae && !T ? t.appendChild(Y) : n.parentNode.insertBefore(Y, ae ? T : n), te && vo(te, 0, ne - te.scrollTop), Mo = Y.parentNode, S !== void 0 && !ts && (ns = Math.abs(S - io(n)[w])), v(), _(!0);
|
|
4118
4119
|
}
|
|
4119
|
-
if (t.contains(
|
|
4120
|
+
if (t.contains(Y)) return _(!1);
|
|
4120
4121
|
}
|
|
4121
4122
|
return !1;
|
|
4122
4123
|
},
|
|
4123
4124
|
_ignoreWhileAnimating: null,
|
|
4124
4125
|
_offMoveEvents: function() {
|
|
4125
|
-
|
|
4126
|
+
q(document, "mousemove", this._onTouchMove), q(document, "touchmove", this._onTouchMove), q(document, "pointermove", this._onTouchMove), q(document, "dragover", vs), q(document, "mousemove", vs), q(document, "touchmove", vs);
|
|
4126
4127
|
},
|
|
4127
4128
|
_offUpEvents: function() {
|
|
4128
4129
|
var e = this.el.ownerDocument;
|
|
4129
|
-
|
|
4130
|
+
q(e, "mouseup", this._onDrop), q(e, "touchend", this._onDrop), q(e, "pointerup", this._onDrop), q(e, "touchcancel", this._onDrop), q(document, "selectstart", this);
|
|
4130
4131
|
},
|
|
4131
4132
|
_onDrop: function(e) {
|
|
4132
4133
|
var t = this.el, n = this.options;
|
|
4133
|
-
|
|
4134
|
+
Lo = co(Y), zo = co(Y, n.draggable), Ao("drop", this, { evt: e }), Mo = Y && Y.parentNode, Lo = co(Y), zo = co(Y, n.draggable), $.eventCanceled || (Ho = !1, ts = !1, es = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), js(this.cloneId), js(this._dragStartId), this.nativeDraggable && (q(document, "drop", this), q(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Ka && J(document.body, "user-select", ""), J(Y, "transform", ""), e && (Zo && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), X && X.parentNode && X.parentNode.removeChild(X), (Z === Mo || Vo && Vo.lastPutMode !== "clone") && Q && Q.parentNode && Q.parentNode.removeChild(Q), Y && (this.nativeDraggable && q(Y, "dragend", this), Ss(Y), Y.style["will-change"] = "", Zo && !Ho && eo(Y, Vo ? Vo.options.ghostClass : this.options.ghostClass, !1), eo(Y, this.options.chosenClass, !1), jo({
|
|
4134
4135
|
sortable: this,
|
|
4135
4136
|
name: "unchoose",
|
|
4136
|
-
toEl:
|
|
4137
|
+
toEl: Mo,
|
|
4137
4138
|
newIndex: null,
|
|
4138
4139
|
newDraggableIndex: null,
|
|
4139
4140
|
originalEvent: e
|
|
4140
|
-
}), Z ===
|
|
4141
|
+
}), Z === Mo ? Lo !== Io && Lo >= 0 && (jo({
|
|
4141
4142
|
sortable: this,
|
|
4142
4143
|
name: "update",
|
|
4143
|
-
toEl:
|
|
4144
|
+
toEl: Mo,
|
|
4144
4145
|
originalEvent: e
|
|
4145
4146
|
}), jo({
|
|
4146
4147
|
sortable: this,
|
|
4147
4148
|
name: "sort",
|
|
4148
|
-
toEl:
|
|
4149
|
+
toEl: Mo,
|
|
4149
4150
|
originalEvent: e
|
|
4150
|
-
})) : (
|
|
4151
|
-
rootEl:
|
|
4151
|
+
})) : (Lo >= 0 && (jo({
|
|
4152
|
+
rootEl: Mo,
|
|
4152
4153
|
name: "add",
|
|
4153
|
-
toEl:
|
|
4154
|
+
toEl: Mo,
|
|
4154
4155
|
fromEl: Z,
|
|
4155
4156
|
originalEvent: e
|
|
4156
4157
|
}), jo({
|
|
4157
4158
|
sortable: this,
|
|
4158
4159
|
name: "remove",
|
|
4159
|
-
toEl:
|
|
4160
|
+
toEl: Mo,
|
|
4160
4161
|
originalEvent: e
|
|
4161
4162
|
}), jo({
|
|
4162
|
-
rootEl:
|
|
4163
|
+
rootEl: Mo,
|
|
4163
4164
|
name: "sort",
|
|
4164
|
-
toEl:
|
|
4165
|
+
toEl: Mo,
|
|
4165
4166
|
fromEl: Z,
|
|
4166
4167
|
originalEvent: e
|
|
4167
4168
|
}), jo({
|
|
4168
4169
|
sortable: this,
|
|
4169
4170
|
name: "sort",
|
|
4170
|
-
toEl:
|
|
4171
|
+
toEl: Mo,
|
|
4171
4172
|
originalEvent: e
|
|
4172
|
-
})),
|
|
4173
|
+
})), Vo && Vo.save()), $.active && ((Lo == null || Lo === -1) && (Lo = Io, zo = Ro), jo({
|
|
4173
4174
|
sortable: this,
|
|
4174
4175
|
name: "end",
|
|
4175
|
-
toEl:
|
|
4176
|
+
toEl: Mo,
|
|
4176
4177
|
originalEvent: e
|
|
4177
4178
|
}), this.save())))), this._nulling();
|
|
4178
4179
|
},
|
|
4179
4180
|
_nulling: function() {
|
|
4180
|
-
Ao("nulling", this), Z =
|
|
4181
|
+
Ao("nulling", this), Z = Y = Mo = X = No = Q = Po = Fo = Go = Ko = Zo = Lo = zo = Io = Ro = Qo = $o = Vo = Bo = $.dragged = $.ghost = $.clone = $.active = null, os.forEach(function(e) {
|
|
4181
4182
|
e.checked = !0;
|
|
4182
|
-
}),
|
|
4183
|
+
}), os.length = qo = Jo = 0;
|
|
4183
4184
|
},
|
|
4184
4185
|
handleEvent: function(e) {
|
|
4185
4186
|
switch (e.type) {
|
|
@@ -4189,13 +4190,13 @@ $.prototype = {
|
|
|
4189
4190
|
break;
|
|
4190
4191
|
case "dragenter":
|
|
4191
4192
|
case "dragover":
|
|
4192
|
-
|
|
4193
|
+
Y && (this._onDragOver(e), bs(e));
|
|
4193
4194
|
break;
|
|
4194
4195
|
case "selectstart": e.preventDefault();
|
|
4195
4196
|
}
|
|
4196
4197
|
},
|
|
4197
4198
|
toArray: function() {
|
|
4198
|
-
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], Qa(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) ||
|
|
4199
|
+
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], Qa(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || Os(t));
|
|
4199
4200
|
return e;
|
|
4200
4201
|
},
|
|
4201
4202
|
sort: function(e, t) {
|
|
@@ -4218,89 +4219,89 @@ $.prototype = {
|
|
|
4218
4219
|
var n = this.options;
|
|
4219
4220
|
if (t === void 0) return n[e];
|
|
4220
4221
|
var r = Do.modifyOption(this, e, t);
|
|
4221
|
-
n[e] = r === void 0 ? t : r, e === "group" &&
|
|
4222
|
+
n[e] = r === void 0 ? t : r, e === "group" && hs(n);
|
|
4222
4223
|
},
|
|
4223
4224
|
destroy: function() {
|
|
4224
4225
|
Ao("destroy", this);
|
|
4225
4226
|
var e = this.el;
|
|
4226
|
-
e[xo] = null,
|
|
4227
|
+
e[xo] = null, q(e, "mousedown", this._onTapStart), q(e, "touchstart", this._onTapStart), q(e, "pointerdown", this._onTapStart), this.nativeDraggable && (q(e, "dragover", this), q(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) {
|
|
4227
4228
|
e.removeAttribute("draggable");
|
|
4228
|
-
}), this._onDrop(), this._disableDelayedDragEvents(),
|
|
4229
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), Wo.splice(Wo.indexOf(this.el), 1), this.el = e = null;
|
|
4229
4230
|
},
|
|
4230
4231
|
_hideClone: function() {
|
|
4231
|
-
if (!
|
|
4232
|
+
if (!Fo) {
|
|
4232
4233
|
if (Ao("hideClone", this), $.eventCanceled) return;
|
|
4233
|
-
|
|
4234
|
+
J(Q, "display", "none"), this.options.removeCloneOnHide && Q.parentNode && Q.parentNode.removeChild(Q), Fo = !0;
|
|
4234
4235
|
}
|
|
4235
4236
|
},
|
|
4236
4237
|
_showClone: function(e) {
|
|
4237
4238
|
if (e.lastPutMode !== "clone") this._hideClone();
|
|
4238
|
-
else if (
|
|
4239
|
+
else if (Fo) {
|
|
4239
4240
|
if (Ao("showClone", this), $.eventCanceled) return;
|
|
4240
|
-
|
|
4241
|
+
Y.parentNode == Z && !this.options.group.revertClone ? Z.insertBefore(Q, Y) : No ? Z.insertBefore(Q, No) : Z.appendChild(Q), this.options.group.revertClone && this.animate(Y, Q), J(Q, "display", ""), Fo = !1;
|
|
4241
4242
|
}
|
|
4242
4243
|
}
|
|
4243
4244
|
};
|
|
4244
|
-
function
|
|
4245
|
+
function bs(e) {
|
|
4245
4246
|
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
4246
4247
|
}
|
|
4247
|
-
function
|
|
4248
|
+
function xs(e, t, n, r, i, a, o, s) {
|
|
4248
4249
|
var c, l = e[xo], u = l.options.onMove, d;
|
|
4249
4250
|
return window.CustomEvent && !Ua && !Wa ? c = new CustomEvent("move", {
|
|
4250
4251
|
bubbles: !0,
|
|
4251
4252
|
cancelable: !0
|
|
4252
4253
|
}) : (c = document.createEvent("Event"), c.initEvent("move", !0, !0)), c.to = t, c.from = e, c.dragged = n, c.draggedRect = r, c.related = i || t, c.relatedRect = a || io(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d;
|
|
4253
4254
|
}
|
|
4254
|
-
function
|
|
4255
|
+
function Ss(e) {
|
|
4255
4256
|
e.draggable = !1;
|
|
4256
4257
|
}
|
|
4257
|
-
function
|
|
4258
|
-
|
|
4258
|
+
function Cs() {
|
|
4259
|
+
as = !1;
|
|
4259
4260
|
}
|
|
4260
|
-
function
|
|
4261
|
+
function ws(e, t, n) {
|
|
4261
4262
|
var r = io(oo(n.el, 0, n.options, !0)), i = bo(n.el, n.options, X), a = 10;
|
|
4262
4263
|
return t ? e.clientX < i.left - a || e.clientY < r.top && e.clientX < r.right : e.clientY < i.top - a || e.clientY < r.bottom && e.clientX < r.left;
|
|
4263
4264
|
}
|
|
4264
|
-
function
|
|
4265
|
+
function Ts(e, t, n) {
|
|
4265
4266
|
var r = io(so(n.el, n.options.draggable)), i = bo(n.el, n.options, X), a = 10;
|
|
4266
4267
|
return t ? e.clientX > i.right + a || e.clientY > r.bottom && e.clientX > r.left : e.clientY > i.bottom + a || e.clientX > r.right && e.clientY > r.top;
|
|
4267
4268
|
}
|
|
4268
|
-
function
|
|
4269
|
+
function Es(e, t, n, r, i, a, o, s) {
|
|
4269
4270
|
var c = r ? e.clientY : e.clientX, l = r ? n.height : n.width, u = r ? n.top : n.left, d = r ? n.bottom : n.right, f = !1;
|
|
4270
4271
|
if (!o) {
|
|
4271
|
-
if (s &&
|
|
4272
|
-
if (
|
|
4273
|
-
else if (
|
|
4274
|
-
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return
|
|
4272
|
+
if (s && ns < l * i) {
|
|
4273
|
+
if (!es && ($o === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (es = !0), es) f = !0;
|
|
4274
|
+
else if ($o === 1 ? c < u + ns : c > d - ns) return -$o;
|
|
4275
|
+
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return Ds(t);
|
|
4275
4276
|
}
|
|
4276
4277
|
return f ||= o, f && (c < u + l * a / 2 || c > d - l * a / 2) ? c > u + l / 2 ? 1 : -1 : 0;
|
|
4277
4278
|
}
|
|
4278
|
-
function Es(e) {
|
|
4279
|
-
return co(J) < co(e) ? 1 : -1;
|
|
4280
|
-
}
|
|
4281
4279
|
function Ds(e) {
|
|
4280
|
+
return co(Y) < co(e) ? 1 : -1;
|
|
4281
|
+
}
|
|
4282
|
+
function Os(e) {
|
|
4282
4283
|
for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, r = 0; n--;) r += t.charCodeAt(n);
|
|
4283
4284
|
return r.toString(36);
|
|
4284
4285
|
}
|
|
4285
|
-
function
|
|
4286
|
-
|
|
4286
|
+
function ks(e) {
|
|
4287
|
+
os.length = 0;
|
|
4287
4288
|
for (var t = e.getElementsByTagName("input"), n = t.length; n--;) {
|
|
4288
4289
|
var r = t[n];
|
|
4289
|
-
r.checked &&
|
|
4290
|
+
r.checked && os.push(r);
|
|
4290
4291
|
}
|
|
4291
4292
|
}
|
|
4292
|
-
function
|
|
4293
|
+
function As(e) {
|
|
4293
4294
|
return setTimeout(e, 0);
|
|
4294
4295
|
}
|
|
4295
|
-
function
|
|
4296
|
+
function js(e) {
|
|
4296
4297
|
return clearTimeout(e);
|
|
4297
4298
|
}
|
|
4298
|
-
|
|
4299
|
-
($.active ||
|
|
4299
|
+
ss && K(document, "touchmove", function(e) {
|
|
4300
|
+
($.active || Ho) && e.cancelable && e.preventDefault();
|
|
4300
4301
|
}), $.utils = {
|
|
4301
|
-
on:
|
|
4302
|
-
off:
|
|
4303
|
-
css:
|
|
4302
|
+
on: K,
|
|
4303
|
+
off: q,
|
|
4304
|
+
css: J,
|
|
4304
4305
|
find: no,
|
|
4305
4306
|
is: function(e, t) {
|
|
4306
4307
|
return !!Qa(e, t, e, !1);
|
|
@@ -4311,9 +4312,9 @@ os && G(document, "touchmove", function(e) {
|
|
|
4311
4312
|
toggleClass: eo,
|
|
4312
4313
|
clone: yo,
|
|
4313
4314
|
index: co,
|
|
4314
|
-
nextTick:
|
|
4315
|
-
cancelNextTick:
|
|
4316
|
-
detectDirection:
|
|
4315
|
+
nextTick: As,
|
|
4316
|
+
cancelNextTick: js,
|
|
4317
|
+
detectDirection: fs,
|
|
4317
4318
|
getChild: oo
|
|
4318
4319
|
}, $.get = function(e) {
|
|
4319
4320
|
return e[xo];
|
|
@@ -4326,8 +4327,8 @@ os && G(document, "touchmove", function(e) {
|
|
|
4326
4327
|
}, $.create = function(e, t) {
|
|
4327
4328
|
return new $(e, t);
|
|
4328
4329
|
}, $.version = Va;
|
|
4329
|
-
var
|
|
4330
|
-
function
|
|
4330
|
+
var Ms = [], Ns, Ps, Fs = !1, Is, Ls, Rs, zs;
|
|
4331
|
+
function Bs() {
|
|
4331
4332
|
function e() {
|
|
4332
4333
|
for (var e in this.defaults = {
|
|
4333
4334
|
scroll: !0,
|
|
@@ -4340,36 +4341,36 @@ function zs() {
|
|
|
4340
4341
|
return e.prototype = {
|
|
4341
4342
|
dragStarted: function(e) {
|
|
4342
4343
|
var t = e.originalEvent;
|
|
4343
|
-
this.sortable.nativeDraggable ?
|
|
4344
|
+
this.sortable.nativeDraggable ? K(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? K(document, "pointermove", this._handleFallbackAutoScroll) : t.touches ? K(document, "touchmove", this._handleFallbackAutoScroll) : K(document, "mousemove", this._handleFallbackAutoScroll);
|
|
4344
4345
|
},
|
|
4345
4346
|
dragOverCompleted: function(e) {
|
|
4346
4347
|
var t = e.originalEvent;
|
|
4347
4348
|
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
4348
4349
|
},
|
|
4349
4350
|
drop: function() {
|
|
4350
|
-
this.sortable.nativeDraggable ?
|
|
4351
|
+
this.sortable.nativeDraggable ? q(document, "dragover", this._handleAutoScroll) : (q(document, "pointermove", this._handleFallbackAutoScroll), q(document, "touchmove", this._handleFallbackAutoScroll), q(document, "mousemove", this._handleFallbackAutoScroll)), Hs(), Vs(), _o();
|
|
4351
4352
|
},
|
|
4352
4353
|
nulling: function() {
|
|
4353
|
-
|
|
4354
|
+
Rs = Ps = Ns = Fs = zs = Is = Ls = null, Ms.length = 0;
|
|
4354
4355
|
},
|
|
4355
4356
|
_handleFallbackAutoScroll: function(e) {
|
|
4356
4357
|
this._handleAutoScroll(e, !0);
|
|
4357
4358
|
},
|
|
4358
4359
|
_handleAutoScroll: function(e, t) {
|
|
4359
4360
|
var n = this, r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = document.elementFromPoint(r, i);
|
|
4360
|
-
if (
|
|
4361
|
-
|
|
4361
|
+
if (Rs = e, t || this.options.forceAutoScrollFallback || Wa || Ua || Ka) {
|
|
4362
|
+
Us(e, this.options, a, t);
|
|
4362
4363
|
var o = fo(a, !0);
|
|
4363
|
-
|
|
4364
|
+
Fs && (!zs || r !== Is || i !== Ls) && (zs && Hs(), zs = setInterval(function() {
|
|
4364
4365
|
var a = fo(document.elementFromPoint(r, i), !0);
|
|
4365
|
-
a !== o && (o = a,
|
|
4366
|
-
}, 10),
|
|
4366
|
+
a !== o && (o = a, Vs()), Us(e, n.options, a, t);
|
|
4367
|
+
}, 10), Is = r, Ls = i);
|
|
4367
4368
|
} else {
|
|
4368
4369
|
if (!this.options.bubbleScroll || fo(a, !0) === ro()) {
|
|
4369
|
-
|
|
4370
|
+
Vs();
|
|
4370
4371
|
return;
|
|
4371
4372
|
}
|
|
4372
|
-
|
|
4373
|
+
Us(e, this.options, fo(a, !1), !1);
|
|
4373
4374
|
}
|
|
4374
4375
|
}
|
|
4375
4376
|
}, Ra(e, {
|
|
@@ -4377,33 +4378,33 @@ function zs() {
|
|
|
4377
4378
|
initializeByDefault: !0
|
|
4378
4379
|
});
|
|
4379
4380
|
}
|
|
4380
|
-
function
|
|
4381
|
-
|
|
4381
|
+
function Vs() {
|
|
4382
|
+
Ms.forEach(function(e) {
|
|
4382
4383
|
clearInterval(e.pid);
|
|
4383
|
-
}),
|
|
4384
|
+
}), Ms = [];
|
|
4384
4385
|
}
|
|
4385
|
-
function
|
|
4386
|
-
clearInterval(
|
|
4386
|
+
function Hs() {
|
|
4387
|
+
clearInterval(zs);
|
|
4387
4388
|
}
|
|
4388
|
-
var
|
|
4389
|
+
var Us = go(function(e, t, n, r) {
|
|
4389
4390
|
if (t.scroll) {
|
|
4390
4391
|
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = ro(), l = !1, u;
|
|
4391
|
-
|
|
4392
|
-
var d = 0, f =
|
|
4392
|
+
Ps !== n && (Ps = n, Vs(), Ns = t.scroll, u = t.scrollFn, Ns === !0 && (Ns = fo(n, !0)));
|
|
4393
|
+
var d = 0, f = Ns;
|
|
4393
4394
|
do {
|
|
4394
|
-
var p = f, m = io(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, S = void 0,
|
|
4395
|
-
p === c ? (x = y <
|
|
4396
|
-
var re = x && (Math.abs(v - i) <= o && te + y <
|
|
4397
|
-
if (!
|
|
4398
|
-
(
|
|
4399
|
-
r && this.layer === 0 && $.active._onTouchMove(
|
|
4400
|
-
var t =
|
|
4401
|
-
typeof u == "function" && u.call($.dragged.parentNode[xo], n, t, e,
|
|
4395
|
+
var p = f, m = io(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, S = void 0, ee = p.scrollWidth, C = p.scrollHeight, w = J(p), te = p.scrollLeft, ne = p.scrollTop;
|
|
4396
|
+
p === c ? (x = y < ee && (w.overflowX === "auto" || w.overflowX === "scroll" || w.overflowX === "visible"), S = b < C && (w.overflowY === "auto" || w.overflowY === "scroll" || w.overflowY === "visible")) : (x = y < ee && (w.overflowX === "auto" || w.overflowX === "scroll"), S = b < C && (w.overflowY === "auto" || w.overflowY === "scroll"));
|
|
4397
|
+
var re = x && (Math.abs(v - i) <= o && te + y < ee) - (Math.abs(_ - i) <= o && !!te), ie = S && (Math.abs(g - a) <= o && ne + b < C) - (Math.abs(h - a) <= o && !!ne);
|
|
4398
|
+
if (!Ms[d]) for (var T = 0; T <= d; T++) Ms[T] || (Ms[T] = {});
|
|
4399
|
+
(Ms[d].vx != re || Ms[d].vy != ie || Ms[d].el !== p) && (Ms[d].el = p, Ms[d].vx = re, Ms[d].vy = ie, clearInterval(Ms[d].pid), (re != 0 || ie != 0) && (l = !0, Ms[d].pid = setInterval(function() {
|
|
4400
|
+
r && this.layer === 0 && $.active._onTouchMove(Rs);
|
|
4401
|
+
var t = Ms[this.layer].vy ? Ms[this.layer].vy * s : 0, n = Ms[this.layer].vx ? Ms[this.layer].vx * s : 0;
|
|
4402
|
+
typeof u == "function" && u.call($.dragged.parentNode[xo], n, t, e, Rs, Ms[this.layer].el) !== "continue" || vo(Ms[this.layer].el, n, t);
|
|
4402
4403
|
}.bind({ layer: d }), 24))), d++;
|
|
4403
4404
|
} while (t.bubbleScroll && f !== c && (f = fo(f, !1)));
|
|
4404
|
-
|
|
4405
|
+
Fs = l;
|
|
4405
4406
|
}
|
|
4406
|
-
}, 30),
|
|
4407
|
+
}, 30), Ws = function(e) {
|
|
4407
4408
|
var t = e.originalEvent, n = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, o = e.hideGhostForTarget, s = e.unhideGhostForTarget;
|
|
4408
4409
|
if (t) {
|
|
4409
4410
|
var c = n || i;
|
|
@@ -4415,8 +4416,8 @@ var Hs = go(function(e, t, n, r) {
|
|
|
4415
4416
|
}));
|
|
4416
4417
|
}
|
|
4417
4418
|
};
|
|
4418
|
-
function
|
|
4419
|
-
|
|
4419
|
+
function Gs() {}
|
|
4420
|
+
Gs.prototype = {
|
|
4420
4421
|
startIndex: null,
|
|
4421
4422
|
dragStart: function(e) {
|
|
4422
4423
|
var t = e.oldDraggableIndex;
|
|
@@ -4428,64 +4429,64 @@ Ws.prototype = {
|
|
|
4428
4429
|
var r = oo(this.sortable.el, this.startIndex, this.options);
|
|
4429
4430
|
r ? this.sortable.el.insertBefore(t, r) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
|
|
4430
4431
|
},
|
|
4431
|
-
drop:
|
|
4432
|
-
}, Ra(
|
|
4433
|
-
function
|
|
4434
|
-
|
|
4432
|
+
drop: Ws
|
|
4433
|
+
}, Ra(Gs, { pluginName: "revertOnSpill" });
|
|
4434
|
+
function Ks() {}
|
|
4435
|
+
Ks.prototype = {
|
|
4435
4436
|
onSpill: function(e) {
|
|
4436
4437
|
var t = e.dragEl, n = e.putSortable || this.sortable;
|
|
4437
4438
|
n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll();
|
|
4438
4439
|
},
|
|
4439
|
-
drop:
|
|
4440
|
-
}, Ra(
|
|
4441
|
-
function Ks(e) {
|
|
4442
|
-
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
4443
|
-
}
|
|
4440
|
+
drop: Ws
|
|
4441
|
+
}, Ra(Ks, { pluginName: "removeOnSpill" }), $.mount(new Bs()), $.mount(Ks, Gs);
|
|
4444
4442
|
function qs(e) {
|
|
4445
|
-
|
|
4443
|
+
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
4446
4444
|
}
|
|
4447
4445
|
function Js(e) {
|
|
4448
|
-
ht()
|
|
4446
|
+
ht() && Et(e);
|
|
4447
|
+
}
|
|
4448
|
+
function Ys(e) {
|
|
4449
|
+
ht() ? Tt(e) : xt(e);
|
|
4449
4450
|
}
|
|
4450
|
-
var
|
|
4451
|
-
function
|
|
4452
|
-
|
|
4451
|
+
var Xs = null, Zs = null;
|
|
4452
|
+
function Qs(e = null, t = null) {
|
|
4453
|
+
Xs = e, Zs = t;
|
|
4453
4454
|
}
|
|
4454
|
-
function
|
|
4455
|
+
function $s() {
|
|
4455
4456
|
return {
|
|
4456
|
-
data:
|
|
4457
|
-
clonedData:
|
|
4457
|
+
data: Xs,
|
|
4458
|
+
clonedData: Zs
|
|
4458
4459
|
};
|
|
4459
4460
|
}
|
|
4460
|
-
var
|
|
4461
|
-
function
|
|
4461
|
+
var ec = Symbol("cloneElement");
|
|
4462
|
+
function tc(...e) {
|
|
4462
4463
|
let t = ht()?.proxy, n = null, r = e[0], [, i, a] = e;
|
|
4463
|
-
Array.isArray(
|
|
4464
|
-
let o = null, { immediate: s = !0, clone: c =
|
|
4464
|
+
Array.isArray(V(i)) || (a = i, i = null);
|
|
4465
|
+
let o = null, { immediate: s = !0, clone: c = qs, forceFallback: l, fallbackOnBody: u, customUpdate: d } = V(a) ?? {};
|
|
4465
4466
|
function f(e) {
|
|
4466
4467
|
let { from: t, oldIndex: r, item: a } = e, o = Array.from(t.childNodes);
|
|
4467
4468
|
n = l && !u ? o.slice(0, -1) : o;
|
|
4468
|
-
let s =
|
|
4469
|
-
|
|
4469
|
+
let s = V(V(i)?.[r]), d = c(s);
|
|
4470
|
+
Qs(s, d), a[ec] = d;
|
|
4470
4471
|
}
|
|
4471
4472
|
function p(e) {
|
|
4472
|
-
let t = e.item[
|
|
4473
|
+
let t = e.item[ec];
|
|
4473
4474
|
if (!Ca(t)) {
|
|
4474
4475
|
if (Ea(e.item), yt(i)) {
|
|
4475
|
-
let n = [...
|
|
4476
|
+
let n = [...V(i)];
|
|
4476
4477
|
i.value = Sa(n, e.newDraggableIndex, t);
|
|
4477
4478
|
return;
|
|
4478
4479
|
}
|
|
4479
|
-
Sa(
|
|
4480
|
+
Sa(V(i), e.newDraggableIndex, t);
|
|
4480
4481
|
}
|
|
4481
4482
|
}
|
|
4482
4483
|
function m(e) {
|
|
4483
4484
|
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, pullMode: o, clone: s } = e;
|
|
4484
4485
|
if (Ta(t, n, r), o === "clone") Ea(s);
|
|
4485
4486
|
else if (yt(i)) {
|
|
4486
|
-
let e = [...
|
|
4487
|
+
let e = [...V(i)];
|
|
4487
4488
|
i.value = xa(e, a);
|
|
4488
|
-
} else xa(
|
|
4489
|
+
} else xa(V(i), a);
|
|
4489
4490
|
}
|
|
4490
4491
|
function h(e) {
|
|
4491
4492
|
if (d) {
|
|
@@ -4494,9 +4495,9 @@ function ec(...e) {
|
|
|
4494
4495
|
}
|
|
4495
4496
|
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, newDraggableIndex: o } = e;
|
|
4496
4497
|
if (Ea(n), Ta(t, n, r), yt(i)) {
|
|
4497
|
-
let e = [...
|
|
4498
|
+
let e = [...V(i)];
|
|
4498
4499
|
i.value = va(e, a, o);
|
|
4499
|
-
} else va(
|
|
4500
|
+
} else va(V(i), a, o);
|
|
4500
4501
|
}
|
|
4501
4502
|
function g(e) {
|
|
4502
4503
|
let { newIndex: t, oldIndex: r, from: i, to: a } = e, o = null, s = t === r && i === a;
|
|
@@ -4515,7 +4516,7 @@ function ec(...e) {
|
|
|
4515
4516
|
n = null;
|
|
4516
4517
|
}
|
|
4517
4518
|
xt(() => {
|
|
4518
|
-
if (
|
|
4519
|
+
if (Qs(), o) throw o;
|
|
4519
4520
|
});
|
|
4520
4521
|
}
|
|
4521
4522
|
let _ = {
|
|
@@ -4526,19 +4527,19 @@ function ec(...e) {
|
|
|
4526
4527
|
onEnd: g
|
|
4527
4528
|
};
|
|
4528
4529
|
function v(e) {
|
|
4529
|
-
let n =
|
|
4530
|
+
let n = V(r);
|
|
4530
4531
|
return e ||= wa(n) ? Da(n, t?.$el) : n, e && !Aa(e) && (e = e.$el), e || _a("Root element not found"), e;
|
|
4531
4532
|
}
|
|
4532
4533
|
function y() {
|
|
4533
|
-
let e =
|
|
4534
|
+
let e = V(a) ?? {}, { immediate: t, clone: n } = e, r = ma(e, ["immediate", "clone"]);
|
|
4534
4535
|
return ja(r, (e, t) => {
|
|
4535
|
-
Ma(e) && (r[e] = (e, ...n) => (Na(e,
|
|
4536
|
+
Ma(e) && (r[e] = (e, ...n) => (Na(e, $s()), t(e, ...n)));
|
|
4536
4537
|
}), ka(i === null ? {} : _, r);
|
|
4537
4538
|
}
|
|
4538
4539
|
let b = (e) => {
|
|
4539
4540
|
e = v(e), o && x.destroy(), o = new $(e, y());
|
|
4540
4541
|
};
|
|
4541
|
-
|
|
4542
|
+
Lt(() => a, () => {
|
|
4542
4543
|
o && ja(y(), (e, t) => {
|
|
4543
4544
|
o?.option(e, t);
|
|
4544
4545
|
});
|
|
@@ -4552,15 +4553,15 @@ function ec(...e) {
|
|
|
4552
4553
|
toArray: () => o?.toArray(),
|
|
4553
4554
|
closest: (...e) => o?.closest(...e)
|
|
4554
4555
|
};
|
|
4555
|
-
return
|
|
4556
|
+
return Ys(() => {
|
|
4556
4557
|
s && b();
|
|
4557
|
-
}),
|
|
4558
|
+
}), Js(x.destroy), pa({
|
|
4558
4559
|
start: b,
|
|
4559
4560
|
pause: () => x?.option("disabled", !0),
|
|
4560
4561
|
resume: () => x?.option("disabled", !1)
|
|
4561
4562
|
}, x);
|
|
4562
4563
|
}
|
|
4563
|
-
var
|
|
4564
|
+
var nc = [
|
|
4564
4565
|
"update",
|
|
4565
4566
|
"start",
|
|
4566
4567
|
"add",
|
|
@@ -4573,7 +4574,7 @@ var tc = [
|
|
|
4573
4574
|
"clone",
|
|
4574
4575
|
"move",
|
|
4575
4576
|
"change"
|
|
4576
|
-
],
|
|
4577
|
+
], rc = [
|
|
4577
4578
|
"clone",
|
|
4578
4579
|
"animation",
|
|
4579
4580
|
"ghostClass",
|
|
@@ -4617,7 +4618,7 @@ var tc = [
|
|
|
4617
4618
|
"tag",
|
|
4618
4619
|
"target",
|
|
4619
4620
|
"customUpdate",
|
|
4620
|
-
...
|
|
4621
|
+
...nc.map((e) => `on${e.replace(/^\S/, (e) => e.toUpperCase())}`)
|
|
4621
4622
|
];
|
|
4622
4623
|
F({
|
|
4623
4624
|
name: "VueDraggable",
|
|
@@ -4625,35 +4626,35 @@ F({
|
|
|
4625
4626
|
prop: "modelValue",
|
|
4626
4627
|
event: "update:modelValue"
|
|
4627
4628
|
},
|
|
4628
|
-
props:
|
|
4629
|
-
emits: ["update:modelValue", ...
|
|
4629
|
+
props: rc,
|
|
4630
|
+
emits: ["update:modelValue", ...nc],
|
|
4630
4631
|
setup(e, { slots: t, emit: n, expose: r, attrs: i }) {
|
|
4631
|
-
let a =
|
|
4632
|
+
let a = nc.reduce((e, t) => {
|
|
4632
4633
|
let r = `on${t.replace(/^\S/, (e) => e.toUpperCase())}`;
|
|
4633
4634
|
return e[r] = (...e) => n(t, ...e), e;
|
|
4634
4635
|
}, {}), o = k(() => {
|
|
4635
|
-
let t =
|
|
4636
|
-
let r =
|
|
4636
|
+
let t = Mt(e), { modelValue: n } = t, r = ma(t, ["modelValue"]), o = Object.entries(r).reduce((e, [t, n]) => {
|
|
4637
|
+
let r = V(n);
|
|
4637
4638
|
return r !== void 0 && (e[t] = r), e;
|
|
4638
4639
|
}, {});
|
|
4639
4640
|
return pa(pa({}, a), ba(pa(pa({}, i), o)));
|
|
4640
4641
|
}), s = k({
|
|
4641
4642
|
get: () => e.modelValue,
|
|
4642
4643
|
set: (e) => n("update:modelValue", e)
|
|
4643
|
-
}), c =
|
|
4644
|
+
}), c = z(), l = Ot(tc(e.target || c, s, o));
|
|
4644
4645
|
return r(l), () => _t(e.tag || "div", { ref: c }, (t?.default)?.call(t, l));
|
|
4645
4646
|
}
|
|
4646
4647
|
});
|
|
4647
|
-
var
|
|
4648
|
+
var ic = {
|
|
4648
4649
|
mounted: "mounted",
|
|
4649
4650
|
unmounted: "unmounted"
|
|
4650
4651
|
};
|
|
4651
|
-
|
|
4652
|
+
ic.mounted, ic.unmounted;
|
|
4652
4653
|
//#endregion
|
|
4653
4654
|
//#region src/ui/billing-document/table/composables/useBillingDocumentLineItemsTableDrag.composable.ts
|
|
4654
|
-
var
|
|
4655
|
-
function
|
|
4656
|
-
let t =
|
|
4655
|
+
var ac = 24;
|
|
4656
|
+
function oc(e) {
|
|
4657
|
+
let t = z(!1), n = z(0), r = z(null), i = null, a = !1, o = !1, s = null, c = null, l = "", u = "", d = "";
|
|
4657
4658
|
function f() {
|
|
4658
4659
|
return e.tbodyRef.value?.closest("table") ?? null;
|
|
4659
4660
|
}
|
|
@@ -4692,7 +4693,7 @@ function ac(e) {
|
|
|
4692
4693
|
s = {
|
|
4693
4694
|
x: e.clientX,
|
|
4694
4695
|
y: e.clientY
|
|
4695
|
-
}, y(
|
|
4696
|
+
}, y(ee(e.clientX));
|
|
4696
4697
|
}
|
|
4697
4698
|
function x() {
|
|
4698
4699
|
document.removeEventListener("pointermove", b), s = null, c = null, i = null, r.value = null;
|
|
@@ -4710,14 +4711,14 @@ function ac(e) {
|
|
|
4710
4711
|
y: n.clientY
|
|
4711
4712
|
};
|
|
4712
4713
|
}
|
|
4713
|
-
function
|
|
4714
|
-
return c === null ? 0 : Math.trunc((e - c) /
|
|
4714
|
+
function ee(e) {
|
|
4715
|
+
return c === null ? 0 : Math.trunc((e - c) / ac);
|
|
4715
4716
|
}
|
|
4716
|
-
function
|
|
4717
|
+
function C(e) {
|
|
4717
4718
|
let t = (S(e) ?? s)?.x;
|
|
4718
|
-
return t === void 0 ? r.value?.levelOffset ?? 0 :
|
|
4719
|
+
return t === void 0 ? r.value?.levelOffset ?? 0 : ee(t);
|
|
4719
4720
|
}
|
|
4720
|
-
function
|
|
4721
|
+
function w(t) {
|
|
4721
4722
|
let n = (S(t) ?? s)?.y, r = e.tbodyRef.value, i = t.oldDraggableIndex;
|
|
4722
4723
|
if (n === void 0 || r === null || i === void 0) return null;
|
|
4723
4724
|
let a = Array.from(r.querySelectorAll("tr[data-line-item-row]")), o = a.findIndex((e) => {
|
|
@@ -4748,7 +4749,7 @@ function ac(e) {
|
|
|
4748
4749
|
y(r.value?.levelOffset ?? 0);
|
|
4749
4750
|
},
|
|
4750
4751
|
onEnd: (t) => {
|
|
4751
|
-
let r =
|
|
4752
|
+
let r = w(t), i = C(t), s = o;
|
|
4752
4753
|
!o && t.oldDraggableIndex !== void 0 && r !== null && (t.oldDraggableIndex !== r || i !== 0) && (e.moveLineByIndex(t.oldDraggableIndex, r, i), e.saveNow(), s = !0), (s || a) && (n.value += 1), a = !1, o = !1, _();
|
|
4753
4754
|
},
|
|
4754
4755
|
onStart: (e) => {
|
|
@@ -4759,16 +4760,16 @@ function ac(e) {
|
|
|
4759
4760
|
}, o = !1, a = e.item instanceof HTMLElement && e.item.dataset.lineItemRowType === "group", t.value = !0;
|
|
4760
4761
|
},
|
|
4761
4762
|
onUpdate: (t) => {
|
|
4762
|
-
t.oldDraggableIndex !== void 0 && t.newDraggableIndex !== void 0 && t.oldDraggableIndex !== t.newDraggableIndex && (o = !0, e.moveLineByIndex(t.oldDraggableIndex, t.newDraggableIndex,
|
|
4763
|
+
t.oldDraggableIndex !== void 0 && t.newDraggableIndex !== void 0 && t.oldDraggableIndex !== t.newDraggableIndex && (o = !0, e.moveLineByIndex(t.oldDraggableIndex, t.newDraggableIndex, C(t)), e.saveNow());
|
|
4763
4764
|
}
|
|
4764
4765
|
}),
|
|
4765
4766
|
set: () => {}
|
|
4766
|
-
}), ne =
|
|
4767
|
+
}), ne = tc(e.tbodyRef, te);
|
|
4767
4768
|
function re() {
|
|
4768
4769
|
let t = e.tbodyRef.value;
|
|
4769
4770
|
t !== null && ne.start(t);
|
|
4770
4771
|
}
|
|
4771
|
-
return
|
|
4772
|
+
return wt(() => {
|
|
4772
4773
|
x(), m(), g();
|
|
4773
4774
|
}), {
|
|
4774
4775
|
isDragging: t,
|
|
@@ -4779,37 +4780,37 @@ function ac(e) {
|
|
|
4779
4780
|
}
|
|
4780
4781
|
//#endregion
|
|
4781
4782
|
//#region src/ui/billing-document/table/BillingDocumentLineItemsTableGrid.vue?vue&type=script&setup=true&lang.ts
|
|
4782
|
-
var
|
|
4783
|
+
var sc = { class: "relative" }, cc = { class: "border-b border-secondary bg-secondary" }, lc = {
|
|
4783
4784
|
key: 0,
|
|
4784
4785
|
class: "sticky left-0 z-10 h-11 bg-inherit px-xs py-sm"
|
|
4785
|
-
},
|
|
4786
|
+
}, uc = {
|
|
4786
4787
|
key: 0,
|
|
4787
4788
|
class: "flex items-center gap-lg"
|
|
4788
|
-
},
|
|
4789
|
+
}, dc = { class: "flex min-w-0 flex-1 items-center justify-between gap-xs" }, fc = {
|
|
4789
4790
|
key: 1,
|
|
4790
4791
|
class: "sticky right-0 z-10 h-11 bg-inherit px-md py-sm"
|
|
4791
|
-
},
|
|
4792
|
+
}, pc = {
|
|
4792
4793
|
key: 0,
|
|
4793
4794
|
class: "h-0"
|
|
4794
|
-
},
|
|
4795
|
+
}, mc = ["colspan"], hc = {
|
|
4795
4796
|
key: 0,
|
|
4796
4797
|
class: "h-5",
|
|
4797
4798
|
"data-line-items-insert-row": ""
|
|
4798
|
-
},
|
|
4799
|
+
}, gc = ["colspan"], _c = { key: 1 }, vc = ["colspan"], yc = {
|
|
4799
4800
|
key: 0,
|
|
4800
4801
|
"aria-live": "polite",
|
|
4801
4802
|
class: "pointer-events-none absolute inset-x-0 bottom-4 z-30 flex justify-center px-md"
|
|
4802
|
-
},
|
|
4803
|
+
}, bc = 2.25, xc = 4.5, Sc = .5, Cc = /* @__PURE__ */ F({
|
|
4803
4804
|
__name: "BillingDocumentLineItemsTableGrid",
|
|
4804
4805
|
setup(e) {
|
|
4805
|
-
let t = D(), n =
|
|
4806
|
-
label:
|
|
4806
|
+
let t = D(), n = Ur(), r = b(), i = k(() => n.lineCustomFieldDefinitions.value.map((e) => ({
|
|
4807
|
+
label: w.getLabel(e, t.locale.value),
|
|
4807
4808
|
widthInRem: 12
|
|
4808
|
-
}))), a = k(() => 18 + Math.max(n.structure.value.maxDepth - 1, 0) *
|
|
4809
|
-
let e = Te(), o = e.map((e) =>
|
|
4809
|
+
}))), a = k(() => 18 + Math.max(n.structure.value.maxDepth - 1, 0) * Sc), o = k(() => {
|
|
4810
|
+
let e = Te(), o = e.map((e) => G.createBillingDocumentLineItemTotals(e)), s = Ee(e.map((e) => e.quantity), 5, 8), c = Ee(e.map((e) => e.unitPrice), 7, 11), l = Ee(e.map((e) => e.discountPercentage?.getValue() ?? 0), 6.5, 9), u = Ee(o.map((e) => e.net), 8, 12), d = Ee(o.map((e) => e.gross), 8, 12), f = [
|
|
4810
4811
|
{
|
|
4811
4812
|
isHidden: !n.isEditable.value,
|
|
4812
|
-
widthInRem:
|
|
4813
|
+
widthInRem: bc
|
|
4813
4814
|
},
|
|
4814
4815
|
{
|
|
4815
4816
|
isItemColumn: !0,
|
|
@@ -4856,11 +4857,11 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
4856
4857
|
},
|
|
4857
4858
|
{
|
|
4858
4859
|
isHidden: !n.hasActionsColumn.value,
|
|
4859
|
-
minWidthInRem:
|
|
4860
|
+
minWidthInRem: xc
|
|
4860
4861
|
}
|
|
4861
4862
|
];
|
|
4862
4863
|
return n.isEditable.value ? f : f.filter((e) => !e.isHidden);
|
|
4863
|
-
}), s = k(() => o.value.length), c = k(() => o.value.filter((e) => e.label !== void 0)), l = k(() => Math.max(c.value.length - 3, 1)), u = n.displayRows, d =
|
|
4864
|
+
}), s = k(() => o.value.length), c = k(() => o.value.filter((e) => e.label !== void 0)), l = k(() => Math.max(c.value.length - 3, 1)), u = n.displayRows, d = Ft("tbodyRef"), f = Ft("scrollContainerRef"), p = Ft("tableRef"), m = z(!1), h = z(!1), g = z(0);
|
|
4864
4865
|
function _() {
|
|
4865
4866
|
let e = f.value;
|
|
4866
4867
|
if (e === null) {
|
|
@@ -4876,14 +4877,14 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
4876
4877
|
let t = Array.from(e.querySelectorAll("thead tr, tbody tr:not([data-line-items-insert-row])")).at(-1);
|
|
4877
4878
|
return t === void 0 ? e.offsetHeight : t.getBoundingClientRect().bottom - e.getBoundingClientRect().top;
|
|
4878
4879
|
}
|
|
4879
|
-
|
|
4880
|
-
let { isDragging: y, dragTarget: x, dragVersion: S, restart:
|
|
4880
|
+
Yt(f, _), Yt(p, _), Tt(_);
|
|
4881
|
+
let { isDragging: y, dragTarget: x, dragVersion: S, restart: ee } = oc({
|
|
4881
4882
|
isEditable: n.isEditable,
|
|
4882
4883
|
moveLineByIndex: we,
|
|
4883
4884
|
saveNow: n.saveNow,
|
|
4884
4885
|
tbodyRef: d
|
|
4885
4886
|
});
|
|
4886
|
-
function
|
|
4887
|
+
function C(e) {
|
|
4887
4888
|
let t = n.rows.value.findIndex((t) => t.id === e);
|
|
4888
4889
|
return t === -1 ? null : n.mutations.addLine(t + 1);
|
|
4889
4890
|
}
|
|
@@ -4893,7 +4894,7 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
4893
4894
|
let i = null;
|
|
4894
4895
|
for (let e = r - 1; e >= 0; --e) {
|
|
4895
4896
|
let n = t[e];
|
|
4896
|
-
if (n !== void 0 &&
|
|
4897
|
+
if (n !== void 0 && G.isLineRow(n)) {
|
|
4897
4898
|
i = n.id;
|
|
4898
4899
|
break;
|
|
4899
4900
|
}
|
|
@@ -4902,7 +4903,7 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
4902
4903
|
}
|
|
4903
4904
|
let ne = sa({
|
|
4904
4905
|
isEditable: n.isEditable,
|
|
4905
|
-
addLineBelow:
|
|
4906
|
+
addLineBelow: C,
|
|
4906
4907
|
deleteEmptyLine: te,
|
|
4907
4908
|
duplicateLine: (e) => n.mutations.duplicateLine(e),
|
|
4908
4909
|
indentRow: (e) => re(e, "indent"),
|
|
@@ -4913,24 +4914,24 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
4913
4914
|
let r = t === "indent" ? n.mutations.indentRow(e) : n.mutations.outdentRow(e);
|
|
4914
4915
|
return r && xe(e), r;
|
|
4915
4916
|
}
|
|
4916
|
-
let ie =
|
|
4917
|
-
|
|
4918
|
-
ie.value += 1, await xt(),
|
|
4917
|
+
let ie = z(0);
|
|
4918
|
+
Lt(S, async () => {
|
|
4919
|
+
ie.value += 1, await xt(), ee();
|
|
4919
4920
|
}, { flush: "post" });
|
|
4920
|
-
let T =
|
|
4921
|
-
|
|
4921
|
+
let T = z(G.getInitiallyCollapsedGroupIds(n.structure.value, r.expandedGroupLevels.value)), ae = z(null), oe;
|
|
4922
|
+
wt(() => {
|
|
4922
4923
|
oe !== void 0 && clearTimeout(oe);
|
|
4923
4924
|
});
|
|
4924
4925
|
function se(e) {
|
|
4925
4926
|
return n.structure.value.rows.get(e)?.ancestorGroupIds ?? [];
|
|
4926
4927
|
}
|
|
4927
4928
|
function ce(e) {
|
|
4928
|
-
return ae.value !== null &&
|
|
4929
|
+
return ae.value !== null && G.isLineRow(e.line) && se(e.line.id).includes(ae.value);
|
|
4929
4930
|
}
|
|
4930
4931
|
let le = k(() => {
|
|
4931
4932
|
let e = /* @__PURE__ */ new Map();
|
|
4932
4933
|
for (let t of u.value) {
|
|
4933
|
-
if (!
|
|
4934
|
+
if (!G.isLineRow(t.line) || t.gross === null || t.net === null) continue;
|
|
4934
4935
|
let r = ri.getDisplayGrossLineTotal(n.meta.value.documentType, t.gross, t.line.isDiscount), i = ri.getDisplayGrossLineTotal(n.meta.value.documentType, t.net, t.line.isDiscount);
|
|
4935
4936
|
for (let n of se(t.line.id)) {
|
|
4936
4937
|
let a = e.get(n) ?? {
|
|
@@ -4949,20 +4950,20 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
4949
4950
|
}), ue = k(() => u.value.filter((e) => !se(e.line.id).some((e) => T.value.has(e)))), de = k(() => n.structure.value.groups.size > 0), fe = k(() => [...T.value].some((e) => n.structure.value.groups.has(e))), pe = k(() => t.t("wise_invoicing.invoice.detail.line_items.max_group_level", { max: 4 })), me = k(() => {
|
|
4950
4951
|
let e = x.value, t = e === null ? void 0 : ue.value[e.fromIndex]?.line;
|
|
4951
4952
|
if (e === null || t === void 0) return null;
|
|
4952
|
-
let r =
|
|
4953
|
+
let r = G.moveRowByIndex(n.rows.value, ke(e.fromIndex), ke(e.toIndex), e.levelOffset, T.value), i = G.createBillingDocumentLineItemsStructure(r).rows.get(t.id), a = n.structure.value.rows.get(t.id)?.depth ?? 0, o = i?.depth ?? a, s = n.structure.value.groups.get(t.id)?.height ?? 0;
|
|
4953
4954
|
return {
|
|
4954
4955
|
containerId: i?.ancestorGroupIds.at(-1) ?? null,
|
|
4955
|
-
isDepthLimited:
|
|
4956
|
-
depthShiftInRem:
|
|
4957
|
-
dropIndentInRem:
|
|
4956
|
+
isDepthLimited: G.isGroupRow(t) && o < a + e.levelOffset && o + s >= 4,
|
|
4957
|
+
depthShiftInRem: G.getRowIndentInRem(t.type, o) - G.getRowIndentInRem(t.type, a),
|
|
4958
|
+
dropIndentInRem: G.getRowIndentInRem(t.type, o)
|
|
4958
4959
|
};
|
|
4959
4960
|
}), he = k(() => me.value === null ? void 0 : {
|
|
4960
4961
|
"--line-items-drop-indent": `${me.value.dropIndentInRem}rem`,
|
|
4961
4962
|
"--line-items-drop-shift": `${me.value.depthShiftInRem}rem`
|
|
4962
4963
|
}), ge = k(() => {
|
|
4963
|
-
let e = n.isEditable.value ?
|
|
4964
|
+
let e = n.isEditable.value ? bc : 0;
|
|
4964
4965
|
return {
|
|
4965
|
-
"--line-items-frozen-end": n.hasActionsColumn.value ? `${
|
|
4966
|
+
"--line-items-frozen-end": n.hasActionsColumn.value ? `${xc}rem` : "0rem",
|
|
4966
4967
|
"--line-items-frozen-start": `${e + a.value}rem`,
|
|
4967
4968
|
"--line-items-item-start": `${e}rem`
|
|
4968
4969
|
};
|
|
@@ -4997,7 +4998,7 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
4997
4998
|
n.mutations.moveLineByIndex(ke(e), ke(t), r, T.value), i !== void 0 && xe(i);
|
|
4998
4999
|
}
|
|
4999
5000
|
function Te() {
|
|
5000
|
-
return n.rows.value.filter((e) =>
|
|
5001
|
+
return n.rows.value.filter((e) => G.isLineRow(e));
|
|
5001
5002
|
}
|
|
5002
5003
|
function Ee(e, t, n) {
|
|
5003
5004
|
let r = e.reduce((e, t) => Math.max(e, String(t).length), 0);
|
|
@@ -5017,17 +5018,17 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
5017
5018
|
}
|
|
5018
5019
|
function Ae(e) {
|
|
5019
5020
|
let t = ue.value[e - 1]?.line;
|
|
5020
|
-
if (t !== void 0 &&
|
|
5021
|
+
if (t !== void 0 && G.isGroupRow(t) && T.value.has(t.id)) {
|
|
5021
5022
|
let e = u.value.findIndex((e) => e.line.id === t.id);
|
|
5022
5023
|
if (e !== -1) return e + 1;
|
|
5023
5024
|
}
|
|
5024
5025
|
return ke(e);
|
|
5025
5026
|
}
|
|
5026
5027
|
function je(e) {
|
|
5027
|
-
return
|
|
5028
|
+
return G.resolveGroupInsertParentId(ue.value.map((e) => e.line), e, n.structure.value, T.value);
|
|
5028
5029
|
}
|
|
5029
5030
|
function Me(e) {
|
|
5030
|
-
return
|
|
5031
|
+
return G.canAddGroupInside(n.structure.value, je(e)) ? null : pe.value;
|
|
5031
5032
|
}
|
|
5032
5033
|
async function Ne(e) {
|
|
5033
5034
|
await xt();
|
|
@@ -5037,80 +5038,80 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
5037
5038
|
function Pe(e) {
|
|
5038
5039
|
if (!n.isEditable.value) return;
|
|
5039
5040
|
let t = n.mutations.addLine(Ae(e)), r = n.rows.value.find((e) => e.id === t);
|
|
5040
|
-
r !== void 0 &&
|
|
5041
|
+
r !== void 0 && G.isLineRow(r) && be(r.groupId), Ne(t);
|
|
5041
5042
|
}
|
|
5042
5043
|
function Fe(e) {
|
|
5043
5044
|
if (!n.isEditable.value) return;
|
|
5044
5045
|
let t = je(e);
|
|
5045
|
-
|
|
5046
|
+
G.canAddGroupInside(n.structure.value, t) && (n.mutations.addGroup(ke(e), t), be(t));
|
|
5046
5047
|
}
|
|
5047
|
-
return (e, r) => (
|
|
5048
|
-
style:
|
|
5048
|
+
return (e, r) => (R(), M("div", {
|
|
5049
|
+
style: Ct(ge.value),
|
|
5049
5050
|
class: "relative"
|
|
5050
|
-
}, [N("div",
|
|
5051
|
+
}, [N("div", sc, [
|
|
5051
5052
|
N("div", {
|
|
5052
5053
|
ref_key: "scrollContainerRef",
|
|
5053
5054
|
ref: f,
|
|
5054
|
-
class:
|
|
5055
|
+
class: L([V(y) ? "select-none" : void 0, "relative overflow-x-auto overflow-y-hidden"]),
|
|
5055
5056
|
"data-test-id": "billing-document-line-items-scroll-container",
|
|
5056
5057
|
onScroll: _
|
|
5057
5058
|
}, [N("table", {
|
|
5058
5059
|
ref_key: "tableRef",
|
|
5059
5060
|
ref: p,
|
|
5060
|
-
style:
|
|
5061
|
+
style: Ct({
|
|
5061
5062
|
minWidth: _e.value,
|
|
5062
5063
|
width: "100%"
|
|
5063
5064
|
}),
|
|
5064
5065
|
class: "table-fixed text-left"
|
|
5065
5066
|
}, [
|
|
5066
|
-
N("colgroup", null, [(
|
|
5067
|
+
N("colgroup", null, [(R(!0), M(O, null, kt(o.value, (e, t) => (R(), M("col", {
|
|
5067
5068
|
key: t,
|
|
5068
|
-
style:
|
|
5069
|
+
style: Ct(e.widthInRem === void 0 ? {} : { width: `${e.widthInRem}rem` })
|
|
5069
5070
|
}, null, 4))), 128))]),
|
|
5070
|
-
N("thead", null, [N("tr",
|
|
5071
|
-
|
|
5072
|
-
(
|
|
5071
|
+
N("thead", null, [N("tr", cc, [
|
|
5072
|
+
V(n).isEditable.value ? (R(), M("th", lc)) : j("", !0),
|
|
5073
|
+
(R(!0), M(O, null, kt(c.value, (e, i) => (R(), M("th", {
|
|
5073
5074
|
key: i,
|
|
5074
|
-
class:
|
|
5075
|
+
class: L([[e.align === "right" ? "text-right" : "text-left", e.isItemColumn ? "\n sticky left-(--line-items-item-start) z-10 bg-inherit pr-lg\n pl-md\n " : "px-lg"], "h-11 py-sm text-xs font-semibold text-quaternary"]),
|
|
5075
5076
|
scope: "col"
|
|
5076
|
-
}, [e.isItemColumn ? (
|
|
5077
|
+
}, [e.isItemColumn ? (R(), M("div", uc, [V(n).isEditable.value ? (R(), A(V(rn), {
|
|
5077
5078
|
key: 0,
|
|
5078
5079
|
id: "billing-document-line-items-select-all",
|
|
5079
|
-
"model-value":
|
|
5080
|
-
"is-indeterminate":
|
|
5081
|
-
label:
|
|
5080
|
+
"model-value": V(n).selection.allSelected.value || V(n).selection.indeterminate.value,
|
|
5081
|
+
"is-indeterminate": V(n).selection.indeterminate.value,
|
|
5082
|
+
label: V(t).t("wise_invoicing.invoice.detail.line_items.item"),
|
|
5082
5083
|
"is-label-hidden": !0,
|
|
5083
|
-
"is-disabled": !
|
|
5084
|
+
"is-disabled": !V(n).isEditable.value,
|
|
5084
5085
|
class: "w-4 shrink-0",
|
|
5085
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
5086
|
+
"onUpdate:modelValue": r[0] ||= (e) => V(n).selection.toggleAll()
|
|
5086
5087
|
}, null, 8, [
|
|
5087
5088
|
"model-value",
|
|
5088
5089
|
"is-indeterminate",
|
|
5089
5090
|
"label",
|
|
5090
5091
|
"is-disabled"
|
|
5091
|
-
])) : j("", !0), N("span",
|
|
5092
|
+
])) : j("", !0), N("span", dc, [mt(B(e.label) + " ", 1), de.value ? (R(), A(V(wn), {
|
|
5092
5093
|
key: 0,
|
|
5093
|
-
icon: fe.value ?
|
|
5094
|
-
label: fe.value ?
|
|
5094
|
+
icon: fe.value ? V(Se) : V(De),
|
|
5095
|
+
label: fe.value ? V(t).t("wise_invoicing.invoice.detail.line_items.expand_all_groups") : V(t).t("wise_invoicing.invoice.detail.line_items.collapse_all_groups"),
|
|
5095
5096
|
size: "sm",
|
|
5096
5097
|
variant: "tertiary",
|
|
5097
5098
|
onClick: Ce
|
|
5098
|
-
}, null, 8, ["icon", "label"])) : j("", !0)])])) : (
|
|
5099
|
-
|
|
5099
|
+
}, null, 8, ["icon", "label"])) : j("", !0)])])) : (R(), M(O, { key: 1 }, [mt(B(e.label), 1)], 64))], 2))), 128)),
|
|
5100
|
+
V(n).hasActionsColumn.value ? (R(), M("th", fc)) : j("", !0)
|
|
5100
5101
|
])]),
|
|
5101
|
-
(
|
|
5102
|
+
(R(), M("tbody", {
|
|
5102
5103
|
key: ie.value,
|
|
5103
5104
|
ref_key: "tbodyRef",
|
|
5104
5105
|
ref: d,
|
|
5105
|
-
style:
|
|
5106
|
-
onKeydownCapture: r[3] ||= (...e) =>
|
|
5106
|
+
style: Ct(he.value),
|
|
5107
|
+
onKeydownCapture: r[3] ||= (...e) => V(ne).onKeydown && V(ne).onKeydown(...e)
|
|
5107
5108
|
}, [
|
|
5108
|
-
(
|
|
5109
|
+
(R(!0), M(O, null, kt(ue.value, (e, r) => (R(), M(O, { key: e.line.id }, [V(n).isEditable.value ? Rt((R(), M("tr", pc, [N("td", {
|
|
5109
5110
|
colspan: s.value,
|
|
5110
5111
|
class: "relative h-0 overflow-visible p-none"
|
|
5111
5112
|
}, [P(di, {
|
|
5112
5113
|
"add-group-disabled-reason": Me(r),
|
|
5113
|
-
label:
|
|
5114
|
+
label: V(t).t("wise_invoicing.invoice.detail.line_items.insert_line"),
|
|
5114
5115
|
onAddLine: (e) => Pe(r),
|
|
5115
5116
|
onAddGroup: (e) => Fe(r)
|
|
5116
5117
|
}, null, 8, [
|
|
@@ -5118,12 +5119,12 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
5118
5119
|
"label",
|
|
5119
5120
|
"onAddLine",
|
|
5120
5121
|
"onAddGroup"
|
|
5121
|
-
])], 8,
|
|
5122
|
+
])], 8, mc)], 512)), [[It, !V(y)]]) : j("", !0), V(G).isGroupRow(e.line) ? (R(), A(Pi, {
|
|
5122
5123
|
key: 1,
|
|
5123
5124
|
"content-column-span": l.value,
|
|
5124
5125
|
group: e.line,
|
|
5125
5126
|
"is-collapsed": T.value.has(e.line.id),
|
|
5126
|
-
"is-drop-target":
|
|
5127
|
+
"is-drop-target": V(y) && me.value?.containerId === e.line.id,
|
|
5127
5128
|
"discount-total": le.value.get(e.line.id)?.discountGross ?? 0,
|
|
5128
5129
|
"net-total": le.value.get(e.line.id)?.net ?? null,
|
|
5129
5130
|
total: le.value.get(e.line.id)?.gross ?? null,
|
|
@@ -5139,7 +5140,7 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
5139
5140
|
"total",
|
|
5140
5141
|
"onExpand",
|
|
5141
5142
|
"onToggleCollapse"
|
|
5142
|
-
])) : (
|
|
5143
|
+
])) : (R(), A(ta, {
|
|
5143
5144
|
key: 2,
|
|
5144
5145
|
line: e.line,
|
|
5145
5146
|
net: e.net ?? 0,
|
|
@@ -5151,44 +5152,44 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
5151
5152
|
"gross",
|
|
5152
5153
|
"is-appearing"
|
|
5153
5154
|
]))], 64))), 128)),
|
|
5154
|
-
ue.value.length > 0 &&
|
|
5155
|
+
ue.value.length > 0 && V(n).isEditable.value ? Rt((R(), M("tr", hc, [N("td", {
|
|
5155
5156
|
colspan: s.value,
|
|
5156
5157
|
class: "relative h-5 overflow-visible p-none"
|
|
5157
5158
|
}, [P(di, {
|
|
5158
5159
|
"add-group-disabled-reason": Me(ue.value.length),
|
|
5159
|
-
label:
|
|
5160
|
+
label: V(t).t("wise_invoicing.invoice.detail.line_items.insert_line"),
|
|
5160
5161
|
placement: "end",
|
|
5161
5162
|
onAddLine: r[1] ||= (e) => Pe(ue.value.length),
|
|
5162
5163
|
onAddGroup: r[2] ||= (e) => Fe(ue.value.length)
|
|
5163
|
-
}, null, 8, ["add-group-disabled-reason", "label"])], 8,
|
|
5164
|
-
ue.value.length === 0 && !
|
|
5164
|
+
}, null, 8, ["add-group-disabled-reason", "label"])], 8, gc)], 512)), [[It, !V(y)]]) : j("", !0),
|
|
5165
|
+
ue.value.length === 0 && !V(n).isEditable.value ? (R(), M("tr", _c, [N("td", {
|
|
5165
5166
|
colspan: s.value,
|
|
5166
5167
|
class: "px-lg py-xl text-center"
|
|
5167
|
-
}, [P(
|
|
5168
|
-
text:
|
|
5168
|
+
}, [P(V(W), {
|
|
5169
|
+
text: V(t).t("wise_invoicing.invoice.detail.line_items.empty"),
|
|
5169
5170
|
class: "text-sm text-tertiary"
|
|
5170
|
-
}, null, 8, ["text"])], 8,
|
|
5171
|
+
}, null, 8, ["text"])], 8, vc)])) : j("", !0)
|
|
5171
5172
|
], 36))
|
|
5172
5173
|
], 4)], 34),
|
|
5173
|
-
|
|
5174
|
+
V(y) && me.value?.isDepthLimited ? (R(), M("div", yc, [P(V(W), {
|
|
5174
5175
|
text: pe.value,
|
|
5175
5176
|
class: "rounded-lg border border-secondary bg-primary px-md py-sm text-xs text-secondary shadow-lg"
|
|
5176
5177
|
}, null, 8, ["text"])])) : j("", !0),
|
|
5177
|
-
m.value ? (
|
|
5178
|
+
m.value ? (R(), M("div", {
|
|
5178
5179
|
key: 1,
|
|
5179
|
-
style:
|
|
5180
|
+
style: Ct({ height: `${g.value}px` }),
|
|
5180
5181
|
class: "pointer-events-none absolute top-0 left-(--line-items-frozen-start) z-20 border-l border-secondary",
|
|
5181
5182
|
"data-test-id": "billing-document-line-items-leading-divider"
|
|
5182
5183
|
}, null, 4)) : j("", !0),
|
|
5183
|
-
h.value ? (
|
|
5184
|
+
h.value ? (R(), M("div", {
|
|
5184
5185
|
key: 2,
|
|
5185
|
-
style:
|
|
5186
|
+
style: Ct({ height: `${g.value}px` }),
|
|
5186
5187
|
class: "pointer-events-none absolute top-0 right-(--line-items-frozen-end) z-20 border-r border-secondary",
|
|
5187
5188
|
"data-test-id": "billing-document-line-items-trailing-divider"
|
|
5188
5189
|
}, null, 4)) : j("", !0)
|
|
5189
5190
|
])], 4));
|
|
5190
5191
|
}
|
|
5191
|
-
}),
|
|
5192
|
+
}), wc = /* @__PURE__ */ F({
|
|
5192
5193
|
__name: "BillingDocumentLineItemsTableHeader",
|
|
5193
5194
|
props: { showApplyDiscount: {
|
|
5194
5195
|
type: Boolean,
|
|
@@ -5196,7 +5197,7 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
5196
5197
|
} },
|
|
5197
5198
|
emits: ["applyDiscount"],
|
|
5198
5199
|
setup(e, { emit: t }) {
|
|
5199
|
-
let n = e, r = t, i = D(), a =
|
|
5200
|
+
let n = e, r = t, i = D(), a = Ur(), o = k(() => a.isEditable.value ? a.hasInvalidRows.value && a.isDirty.value ? {
|
|
5200
5201
|
isBlocking: !0,
|
|
5201
5202
|
text: i.t("wise_invoicing.invoice.detail.line_items.save_blocked")
|
|
5202
5203
|
} : a.saveState.value === "error" ? {
|
|
@@ -5212,52 +5213,52 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
5212
5213
|
function s() {
|
|
5213
5214
|
r("applyDiscount");
|
|
5214
5215
|
}
|
|
5215
|
-
return (e, t) => (
|
|
5216
|
+
return (e, t) => (R(), A(V(U), {
|
|
5216
5217
|
justify: "between",
|
|
5217
5218
|
class: "w-full gap-lg border-b border-secondary px-lg py-md"
|
|
5218
5219
|
}, {
|
|
5219
|
-
default:
|
|
5220
|
+
default: H(() => [P(V(U), {
|
|
5220
5221
|
align: "center",
|
|
5221
5222
|
class: "min-w-0 gap-md"
|
|
5222
5223
|
}, {
|
|
5223
|
-
default:
|
|
5224
|
-
text:
|
|
5224
|
+
default: H(() => [P(V(W), {
|
|
5225
|
+
text: V(i).t("wise_invoicing.invoice.detail.line_items.title"),
|
|
5225
5226
|
as: "h2",
|
|
5226
5227
|
class: "shrink-0 text-sm font-semibold text-primary"
|
|
5227
|
-
}, null, 8, ["text"]), o.value === null ? j("", !0) : (
|
|
5228
|
+
}, null, 8, ["text"]), o.value === null ? j("", !0) : (R(), A(V(U), {
|
|
5228
5229
|
key: 0,
|
|
5229
|
-
class:
|
|
5230
|
+
class: L([o.value.isBlocking ? "text-error-primary" : "text-tertiary", "min-w-0 gap-xs"]),
|
|
5230
5231
|
align: "center",
|
|
5231
5232
|
"aria-live": "polite",
|
|
5232
5233
|
"data-test-id": "billing-document-line-items-save-status"
|
|
5233
5234
|
}, {
|
|
5234
|
-
default:
|
|
5235
|
+
default: H(() => [o.value.isBlocking ? (R(), A(V(Oe), {
|
|
5235
5236
|
key: 0,
|
|
5236
5237
|
class: "size-4 shrink-0"
|
|
5237
|
-
})) : j("", !0), P(
|
|
5238
|
+
})) : j("", !0), P(V(W), {
|
|
5238
5239
|
text: o.value.text,
|
|
5239
5240
|
class: "min-w-0 truncate text-xs"
|
|
5240
5241
|
}, null, 8, ["text"])]),
|
|
5241
5242
|
_: 1
|
|
5242
5243
|
}, 8, ["class"]))]),
|
|
5243
5244
|
_: 1
|
|
5244
|
-
}), P(
|
|
5245
|
-
default:
|
|
5245
|
+
}), P(V(U), { class: "shrink-0 gap-sm" }, {
|
|
5246
|
+
default: H(() => [n.showApplyDiscount ? (R(), A(V(nn), {
|
|
5246
5247
|
key: 0,
|
|
5247
|
-
label:
|
|
5248
|
-
"icon-left":
|
|
5249
|
-
"is-disabled": !
|
|
5248
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.global_discount"),
|
|
5249
|
+
"icon-left": V(He),
|
|
5250
|
+
"is-disabled": !V(a).isEditable.value,
|
|
5250
5251
|
variant: "secondary",
|
|
5251
5252
|
onClick: s
|
|
5252
5253
|
}, null, 8, [
|
|
5253
5254
|
"label",
|
|
5254
5255
|
"icon-left",
|
|
5255
5256
|
"is-disabled"
|
|
5256
|
-
])) : j("", !0), P(
|
|
5257
|
-
label:
|
|
5258
|
-
"icon-left":
|
|
5259
|
-
"is-disabled": !
|
|
5260
|
-
onClick: t[0] ||= (e) =>
|
|
5257
|
+
])) : j("", !0), P(V(nn), {
|
|
5258
|
+
label: V(i).t("wise_invoicing.invoice.detail.line_items.add_item"),
|
|
5259
|
+
"icon-left": V(Le),
|
|
5260
|
+
"is-disabled": !V(a).isEditable.value,
|
|
5261
|
+
onClick: t[0] ||= (e) => V(a).mutations.addLineAtEnd()
|
|
5261
5262
|
}, null, 8, [
|
|
5262
5263
|
"label",
|
|
5263
5264
|
"icon-left",
|
|
@@ -5268,11 +5269,11 @@ var oc = { class: "relative" }, sc = { class: "border-b border-secondary bg-seco
|
|
|
5268
5269
|
_: 1
|
|
5269
5270
|
}));
|
|
5270
5271
|
}
|
|
5271
|
-
}),
|
|
5272
|
-
function
|
|
5273
|
-
return
|
|
5272
|
+
}), Tc = {}, Ec = { class: "relative w-full rounded-lg border border-secondary bg-primary shadow-sm" };
|
|
5273
|
+
function Dc(e, t) {
|
|
5274
|
+
return R(), M("section", Ec, [At(e.$slots, "default")]);
|
|
5274
5275
|
}
|
|
5275
|
-
var
|
|
5276
|
+
var Oc = /*#__PURE__*/ wi(Tc, [["render", Dc]]), kc = { class: "grid grid-cols-[auto_auto_auto] items-center gap-x-xl gap-y-xs" }, Ac = /* @__PURE__ */ F({
|
|
5276
5277
|
__name: "BillingDocumentLineItemsTotals",
|
|
5277
5278
|
props: { billingDocument: {} },
|
|
5278
5279
|
setup(t) {
|
|
@@ -5300,65 +5301,65 @@ var Dc = /*#__PURE__*/ wi(wc, [["render", Ec]]), Oc = { class: "grid grid-cols-[
|
|
|
5300
5301
|
advancePayment: `-${o(e)}`,
|
|
5301
5302
|
amountDue: o(st.getAmountAfterAdvance(t, e))
|
|
5302
5303
|
};
|
|
5303
|
-
}), d = k(() =>
|
|
5304
|
-
return (e, t) => (
|
|
5304
|
+
}), d = k(() => Zn.getSummary(n.billingDocument)), f = k(() => r.t("wise_invoicing.credit_note.exceeds_creditable_amount", { sequence: d.value?.originalInvoiceSequence ?? "-" })), p = k(() => r.t("wise_invoicing.invoice.detail.totals.vat_rounding_tooltip"));
|
|
5305
|
+
return (e, t) => (R(), A(V(U), {
|
|
5305
5306
|
align: "end",
|
|
5306
5307
|
justify: "end",
|
|
5307
5308
|
class: "px-3xl py-lg"
|
|
5308
5309
|
}, {
|
|
5309
|
-
default:
|
|
5310
|
+
default: H(() => [P(V(U), {
|
|
5310
5311
|
align: "end",
|
|
5311
5312
|
justify: "end",
|
|
5312
5313
|
gap: "3xl",
|
|
5313
5314
|
class: "text-right"
|
|
5314
5315
|
}, {
|
|
5315
|
-
default:
|
|
5316
|
-
N("div",
|
|
5316
|
+
default: H(() => [
|
|
5317
|
+
N("div", kc, [
|
|
5317
5318
|
t[0] ||= N("div", null, null, -1),
|
|
5318
|
-
P(
|
|
5319
|
-
text:
|
|
5319
|
+
P(V(W), {
|
|
5320
|
+
text: V(r).t("wise_invoicing.invoice.detail.totals.excl_vat"),
|
|
5320
5321
|
as: "div",
|
|
5321
5322
|
class: "text-xs font-medium text-secondary",
|
|
5322
5323
|
"disable-tooltip": ""
|
|
5323
5324
|
}, null, 8, ["text"]),
|
|
5324
|
-
P(
|
|
5325
|
-
text:
|
|
5325
|
+
P(V(W), {
|
|
5326
|
+
text: V(r).t("wise_invoicing.invoice.detail.totals.vat"),
|
|
5326
5327
|
as: "div",
|
|
5327
5328
|
class: "text-xs font-medium text-secondary",
|
|
5328
5329
|
"disable-tooltip": ""
|
|
5329
5330
|
}, null, 8, ["text"]),
|
|
5330
|
-
(
|
|
5331
|
-
P(
|
|
5331
|
+
(R(!0), M(O, null, kt(s.value, (e) => (R(), M(O, { key: e.key }, [
|
|
5332
|
+
P(V(W), {
|
|
5332
5333
|
text: e.label,
|
|
5333
5334
|
as: "div",
|
|
5334
5335
|
class: "text-xs font-medium whitespace-nowrap text-secondary",
|
|
5335
5336
|
"disable-tooltip": ""
|
|
5336
5337
|
}, null, 8, ["text"]),
|
|
5337
|
-
P(
|
|
5338
|
+
P(V(W), {
|
|
5338
5339
|
text: e.net,
|
|
5339
5340
|
as: "div",
|
|
5340
5341
|
class: "text-sm font-medium whitespace-nowrap text-primary",
|
|
5341
5342
|
"disable-tooltip": ""
|
|
5342
5343
|
}, null, 8, ["text"]),
|
|
5343
|
-
P(
|
|
5344
|
+
P(V(U), {
|
|
5344
5345
|
align: "center",
|
|
5345
5346
|
justify: "end",
|
|
5346
5347
|
gap: "xs",
|
|
5347
5348
|
class: "whitespace-nowrap"
|
|
5348
5349
|
}, {
|
|
5349
|
-
default:
|
|
5350
|
+
default: H(() => [e.key === "vat-total-overall" ? (R(), A(V(en), {
|
|
5350
5351
|
key: 0,
|
|
5351
5352
|
label: p.value
|
|
5352
5353
|
}, {
|
|
5353
|
-
default:
|
|
5354
|
-
label:
|
|
5355
|
-
icon:
|
|
5354
|
+
default: H(() => [P(V(wn), {
|
|
5355
|
+
label: V(r).t("wise_invoicing.invoice.detail.totals.info"),
|
|
5356
|
+
icon: V(Ae),
|
|
5356
5357
|
class: "rounded-full!",
|
|
5357
5358
|
size: "xs",
|
|
5358
5359
|
variant: "tertiary"
|
|
5359
5360
|
}, null, 8, ["label", "icon"])]),
|
|
5360
5361
|
_: 1
|
|
5361
|
-
}, 8, ["label"])) : j("", !0), P(
|
|
5362
|
+
}, 8, ["label"])) : j("", !0), P(V(W), {
|
|
5362
5363
|
text: e.vat,
|
|
5363
5364
|
as: "div",
|
|
5364
5365
|
class: "text-sm font-medium whitespace-nowrap text-primary",
|
|
@@ -5368,28 +5369,28 @@ var Dc = /*#__PURE__*/ wi(wc, [["render", Ec]]), Oc = { class: "grid grid-cols-[
|
|
|
5368
5369
|
}, 1024)
|
|
5369
5370
|
], 64))), 128))
|
|
5370
5371
|
]),
|
|
5371
|
-
P(
|
|
5372
|
+
P(V(An), {
|
|
5372
5373
|
orientation: "vertical",
|
|
5373
5374
|
class: "h-24 bg-tertiary"
|
|
5374
5375
|
}),
|
|
5375
|
-
P(
|
|
5376
|
+
P(V(on), {
|
|
5376
5377
|
gap: "sm",
|
|
5377
5378
|
class: "w-auto"
|
|
5378
5379
|
}, {
|
|
5379
|
-
default:
|
|
5380
|
-
c.value ? (
|
|
5380
|
+
default: H(() => [
|
|
5381
|
+
c.value ? (R(), A(V(U), {
|
|
5381
5382
|
key: 0,
|
|
5382
5383
|
align: "center",
|
|
5383
5384
|
justify: "between",
|
|
5384
5385
|
gap: "lg",
|
|
5385
5386
|
class: "w-full whitespace-nowrap"
|
|
5386
5387
|
}, {
|
|
5387
|
-
default:
|
|
5388
|
-
text:
|
|
5388
|
+
default: H(() => [P(V(W), {
|
|
5389
|
+
text: V(r).t("wise_invoicing.invoice.detail.totals.total_discount"),
|
|
5389
5390
|
as: "div",
|
|
5390
5391
|
class: "text-xs font-medium text-secondary",
|
|
5391
5392
|
"disable-tooltip": ""
|
|
5392
|
-
}, null, 8, ["text"]), P(
|
|
5393
|
+
}, null, 8, ["text"]), P(V(W), {
|
|
5393
5394
|
text: l.value,
|
|
5394
5395
|
as: "div",
|
|
5395
5396
|
class: "text-sm font-medium whitespace-nowrap text-primary",
|
|
@@ -5397,25 +5398,25 @@ var Dc = /*#__PURE__*/ wi(wc, [["render", Ec]]), Oc = { class: "grid grid-cols-[
|
|
|
5397
5398
|
}, null, 8, ["text"])]),
|
|
5398
5399
|
_: 1
|
|
5399
5400
|
})) : j("", !0),
|
|
5400
|
-
c.value ? (
|
|
5401
|
+
c.value ? (R(), A(V(An), {
|
|
5401
5402
|
key: 1,
|
|
5402
5403
|
orientation: "horizontal",
|
|
5403
5404
|
class: "bg-tertiary"
|
|
5404
5405
|
})) : j("", !0),
|
|
5405
|
-
P(
|
|
5406
|
+
P(V(U), {
|
|
5406
5407
|
justify: "between",
|
|
5407
5408
|
align: "center",
|
|
5408
5409
|
gap: "lg",
|
|
5409
5410
|
class: "w-full whitespace-nowrap"
|
|
5410
5411
|
}, {
|
|
5411
|
-
default:
|
|
5412
|
-
text:
|
|
5412
|
+
default: H(() => [P(V(W), {
|
|
5413
|
+
text: V(r).t("wise_invoicing.invoice.detail.totals.total_incl_vat"),
|
|
5413
5414
|
as: "div",
|
|
5414
5415
|
class: "text-xs font-medium text-secondary",
|
|
5415
5416
|
"disable-tooltip": ""
|
|
5416
|
-
}, null, 8, ["text"]), P(
|
|
5417
|
+
}, null, 8, ["text"]), P(V(W), {
|
|
5417
5418
|
text: o(n.billingDocument.grossAmount),
|
|
5418
|
-
class:
|
|
5419
|
+
class: L([{
|
|
5419
5420
|
"text-xl font-semibold": u.value === null,
|
|
5420
5421
|
"text-sm font-medium": u.value !== null
|
|
5421
5422
|
}, "whitespace-nowrap text-primary"]),
|
|
@@ -5424,19 +5425,19 @@ var Dc = /*#__PURE__*/ wi(wc, [["render", Ec]]), Oc = { class: "grid grid-cols-[
|
|
|
5424
5425
|
}, null, 8, ["text", "class"])]),
|
|
5425
5426
|
_: 1
|
|
5426
5427
|
}),
|
|
5427
|
-
u.value === null ? j("", !0) : (
|
|
5428
|
-
P(
|
|
5428
|
+
u.value === null ? j("", !0) : (R(), M(O, { key: 2 }, [
|
|
5429
|
+
P(V(U), {
|
|
5429
5430
|
justify: "between",
|
|
5430
5431
|
align: "center",
|
|
5431
5432
|
gap: "lg",
|
|
5432
5433
|
class: "w-full whitespace-nowrap"
|
|
5433
5434
|
}, {
|
|
5434
|
-
default:
|
|
5435
|
-
text:
|
|
5435
|
+
default: H(() => [P(V(W), {
|
|
5436
|
+
text: V(r).t("wise_invoicing.invoice.detail.totals.advance_payment"),
|
|
5436
5437
|
as: "div",
|
|
5437
5438
|
class: "text-xs font-medium text-secondary",
|
|
5438
5439
|
"disable-tooltip": ""
|
|
5439
|
-
}, null, 8, ["text"]), P(
|
|
5440
|
+
}, null, 8, ["text"]), P(V(W), {
|
|
5440
5441
|
text: u.value.advancePayment,
|
|
5441
5442
|
as: "div",
|
|
5442
5443
|
class: "text-sm font-medium whitespace-nowrap text-primary",
|
|
@@ -5444,22 +5445,22 @@ var Dc = /*#__PURE__*/ wi(wc, [["render", Ec]]), Oc = { class: "grid grid-cols-[
|
|
|
5444
5445
|
}, null, 8, ["text"])]),
|
|
5445
5446
|
_: 1
|
|
5446
5447
|
}),
|
|
5447
|
-
P(
|
|
5448
|
+
P(V(An), {
|
|
5448
5449
|
orientation: "horizontal",
|
|
5449
5450
|
class: "bg-tertiary"
|
|
5450
5451
|
}),
|
|
5451
|
-
P(
|
|
5452
|
+
P(V(U), {
|
|
5452
5453
|
justify: "between",
|
|
5453
5454
|
align: "center",
|
|
5454
5455
|
gap: "lg",
|
|
5455
5456
|
class: "w-full whitespace-nowrap"
|
|
5456
5457
|
}, {
|
|
5457
|
-
default:
|
|
5458
|
-
text:
|
|
5458
|
+
default: H(() => [P(V(W), {
|
|
5459
|
+
text: V(r).t("wise_invoicing.invoice.detail.totals.amount_due"),
|
|
5459
5460
|
as: "div",
|
|
5460
5461
|
class: "text-xs font-medium text-secondary",
|
|
5461
5462
|
"disable-tooltip": ""
|
|
5462
|
-
}, null, 8, ["text"]), P(
|
|
5463
|
+
}, null, 8, ["text"]), P(V(W), {
|
|
5463
5464
|
text: u.value.amountDue,
|
|
5464
5465
|
as: "div",
|
|
5465
5466
|
class: "text-xl font-semibold whitespace-nowrap text-primary",
|
|
@@ -5468,52 +5469,52 @@ var Dc = /*#__PURE__*/ wi(wc, [["render", Ec]]), Oc = { class: "grid grid-cols-[
|
|
|
5468
5469
|
_: 1
|
|
5469
5470
|
})
|
|
5470
5471
|
], 64)),
|
|
5471
|
-
d.value === null ? j("", !0) : (
|
|
5472
|
-
P(
|
|
5472
|
+
d.value === null ? j("", !0) : (R(), M(O, { key: 3 }, [
|
|
5473
|
+
P(V(An), {
|
|
5473
5474
|
orientation: "horizontal",
|
|
5474
5475
|
class: "bg-tertiary"
|
|
5475
5476
|
}),
|
|
5476
|
-
P(
|
|
5477
|
+
P(V(U), {
|
|
5477
5478
|
justify: "between",
|
|
5478
5479
|
align: "center",
|
|
5479
5480
|
gap: "lg",
|
|
5480
5481
|
class: "w-full whitespace-nowrap"
|
|
5481
5482
|
}, {
|
|
5482
|
-
default:
|
|
5483
|
-
text:
|
|
5483
|
+
default: H(() => [P(V(W), {
|
|
5484
|
+
text: V(r).t("wise_invoicing.invoice.detail.totals.creditable", { sequence: d.value.originalInvoiceSequence ?? "-" }),
|
|
5484
5485
|
as: "div",
|
|
5485
5486
|
class: "text-xs font-medium text-secondary",
|
|
5486
5487
|
"disable-tooltip": ""
|
|
5487
|
-
}, null, 8, ["text"]), P(
|
|
5488
|
-
text:
|
|
5488
|
+
}, null, 8, ["text"]), P(V(W), {
|
|
5489
|
+
text: V(i).formatMonetary(d.value.creditableAmount),
|
|
5489
5490
|
as: "div",
|
|
5490
5491
|
class: "text-sm font-medium whitespace-nowrap text-primary",
|
|
5491
5492
|
"disable-tooltip": ""
|
|
5492
5493
|
}, null, 8, ["text"])]),
|
|
5493
5494
|
_: 1
|
|
5494
5495
|
}),
|
|
5495
|
-
P(
|
|
5496
|
+
P(V(U), {
|
|
5496
5497
|
justify: "between",
|
|
5497
5498
|
align: "center",
|
|
5498
5499
|
gap: "lg",
|
|
5499
5500
|
class: "w-full whitespace-nowrap"
|
|
5500
5501
|
}, {
|
|
5501
|
-
default:
|
|
5502
|
-
text:
|
|
5502
|
+
default: H(() => [P(V(W), {
|
|
5503
|
+
text: V(r).t("wise_invoicing.invoice.detail.totals.creditable_remaining"),
|
|
5503
5504
|
as: "div",
|
|
5504
5505
|
class: "text-xs font-medium text-secondary",
|
|
5505
5506
|
"disable-tooltip": ""
|
|
5506
|
-
}, null, 8, ["text"]), P(
|
|
5507
|
+
}, null, 8, ["text"]), P(V(U), {
|
|
5507
5508
|
align: "center",
|
|
5508
5509
|
justify: "end",
|
|
5509
5510
|
gap: "xs"
|
|
5510
5511
|
}, {
|
|
5511
|
-
default:
|
|
5512
|
+
default: H(() => [P(V(wn), {
|
|
5512
5513
|
label: f.value,
|
|
5513
5514
|
"tooltip-label": f.value,
|
|
5514
5515
|
"is-tooltip-disabled": !d.value.isExceeded,
|
|
5515
|
-
icon:
|
|
5516
|
-
class:
|
|
5516
|
+
icon: V(Oe),
|
|
5517
|
+
class: L([{ invisible: !d.value.isExceeded }, "rounded-full!"]),
|
|
5517
5518
|
size: "xs",
|
|
5518
5519
|
variant: "destructive-tertiary"
|
|
5519
5520
|
}, null, 8, [
|
|
@@ -5522,9 +5523,9 @@ var Dc = /*#__PURE__*/ wi(wc, [["render", Ec]]), Oc = { class: "grid grid-cols-[
|
|
|
5522
5523
|
"is-tooltip-disabled",
|
|
5523
5524
|
"icon",
|
|
5524
5525
|
"class"
|
|
5525
|
-
]), P(
|
|
5526
|
-
text:
|
|
5527
|
-
class:
|
|
5526
|
+
]), P(V(W), {
|
|
5527
|
+
text: V(i).formatMonetary(d.value.remainingAmount),
|
|
5528
|
+
class: L([d.value.isExceeded ? "text-error-primary" : "\n text-primary\n ", "text-sm font-medium whitespace-nowrap"]),
|
|
5528
5529
|
as: "div",
|
|
5529
5530
|
"disable-tooltip": ""
|
|
5530
5531
|
}, null, 8, ["text", "class"])]),
|
|
@@ -5545,8 +5546,8 @@ var Dc = /*#__PURE__*/ wi(wc, [["render", Ec]]), Oc = { class: "grid grid-cols-[
|
|
|
5545
5546
|
});
|
|
5546
5547
|
//#endregion
|
|
5547
5548
|
//#region src/modules/custom-field/composables/customFieldReferenceLinks.composable.ts
|
|
5548
|
-
function
|
|
5549
|
-
let e = D(), t =
|
|
5549
|
+
function jc() {
|
|
5550
|
+
let e = D(), t = Qt(), n = b();
|
|
5550
5551
|
function r(t, r) {
|
|
5551
5552
|
return t.flatMap((t) => {
|
|
5552
5553
|
let i = te.findByDefinition(r, t.uuid);
|
|
@@ -5558,7 +5559,7 @@ function Ac() {
|
|
|
5558
5559
|
});
|
|
5559
5560
|
return a === null ? [] : [{
|
|
5560
5561
|
definition: t,
|
|
5561
|
-
label:
|
|
5562
|
+
label: w.getLabel(t, e.locale.value),
|
|
5562
5563
|
route: a
|
|
5563
5564
|
}];
|
|
5564
5565
|
});
|
|
@@ -5573,7 +5574,7 @@ function Ac() {
|
|
|
5573
5574
|
}
|
|
5574
5575
|
//#endregion
|
|
5575
5576
|
//#region src/ui/billing-document/table/composables/useBillingDocumentLineItemsAutoSave.composable.ts
|
|
5576
|
-
function
|
|
5577
|
+
function Mc(e) {
|
|
5577
5578
|
let { hasInvalidRows: t, hasSaveError: n, isDirty: r, isEditable: i, isSaving: a, baselineRowsKey: o, rows: s, rowsKey: c, updateLines: l, meta: u } = e, d = null, f = null, p = k(() => a.value ? "saving" : n.value ? "error" : r.value ? "dirty" : "saved");
|
|
5578
5579
|
async function m() {
|
|
5579
5580
|
if (!i.value || t.value || !r.value) return;
|
|
@@ -5590,11 +5591,11 @@ function jc(e) {
|
|
|
5590
5591
|
}), d;
|
|
5591
5592
|
}
|
|
5592
5593
|
function h() {
|
|
5593
|
-
let e =
|
|
5594
|
+
let e = G.buildBillingDocumentLineItemsPayload(u.value, s.value);
|
|
5594
5595
|
return l(e);
|
|
5595
5596
|
}
|
|
5596
|
-
let g =
|
|
5597
|
-
return
|
|
5597
|
+
let g = Gt(c, 500);
|
|
5598
|
+
return Lt(g, async () => {
|
|
5598
5599
|
i.value && !t.value && r.value && await m();
|
|
5599
5600
|
}), {
|
|
5600
5601
|
isSaving: a,
|
|
@@ -5604,27 +5605,27 @@ function jc(e) {
|
|
|
5604
5605
|
}
|
|
5605
5606
|
//#endregion
|
|
5606
5607
|
//#region src/ui/billing-document/table/composables/useBillingDocumentLineItemsRowMutations.composable.ts
|
|
5607
|
-
function
|
|
5608
|
+
function Nc(e, t) {
|
|
5608
5609
|
return Number.isFinite(e) ? e : t;
|
|
5609
5610
|
}
|
|
5610
|
-
function
|
|
5611
|
+
function Pc(e) {
|
|
5611
5612
|
return e === null || e === 0 ? null : new ne(e);
|
|
5612
5613
|
}
|
|
5613
|
-
function
|
|
5614
|
+
function Fc(e) {
|
|
5614
5615
|
let { hasSaveError: t, isEditable: n, baselineRowsKey: r, billingDocument: i, rows: a, selection: o, meta: s } = e;
|
|
5615
5616
|
function c(e = { clearSelection: !1 }) {
|
|
5616
|
-
let s =
|
|
5617
|
-
a.value =
|
|
5617
|
+
let s = G.createBillingDocumentLineItemDisplayRows(i(), n.value);
|
|
5618
|
+
a.value = G.syncBillingDocumentLineItemRowsWithServer(s, a.value), r.value = G.createBillingDocumentLineItemRowsKey(a.value), t.value = !1, e.clearSelection ? o.clearSelection() : o.syncSelection();
|
|
5618
5619
|
}
|
|
5619
5620
|
function l() {
|
|
5620
5621
|
c({ clearSelection: !0 });
|
|
5621
5622
|
}
|
|
5622
5623
|
function u(e, t) {
|
|
5623
|
-
let n = a.value.find((t) =>
|
|
5624
|
+
let n = a.value.find((t) => G.isLineRow(t) && t.id === e);
|
|
5624
5625
|
n !== void 0 && Object.assign(n, t(n));
|
|
5625
5626
|
}
|
|
5626
5627
|
function d(e, t) {
|
|
5627
|
-
let n = a.value.find((t) =>
|
|
5628
|
+
let n = a.value.find((t) => G.isGroupRow(t) && t.id === e);
|
|
5628
5629
|
n !== void 0 && (n.name = t.name, n.description = t.description);
|
|
5629
5630
|
}
|
|
5630
5631
|
function f(e, t) {
|
|
@@ -5632,78 +5633,78 @@ function Pc(e) {
|
|
|
5632
5633
|
...e,
|
|
5633
5634
|
name: t.name,
|
|
5634
5635
|
description: t.description,
|
|
5635
|
-
discountPercentage:
|
|
5636
|
-
quantity:
|
|
5636
|
+
discountPercentage: Pc(t.discountPercentage),
|
|
5637
|
+
quantity: Nc(t.quantity, e.quantity),
|
|
5637
5638
|
unit: t.unit,
|
|
5638
|
-
unitPrice: Math.max(0,
|
|
5639
|
+
unitPrice: Math.max(0, Nc(t.unitPrice, e.unitPrice)),
|
|
5639
5640
|
vatRate: t.vatRate
|
|
5640
5641
|
}));
|
|
5641
5642
|
}
|
|
5642
5643
|
function p(e) {
|
|
5643
|
-
let t =
|
|
5644
|
+
let t = G.resolveInsertGroupId(a.value, e), n = G.createNewBillingDocumentLineItemRow(s.value, t);
|
|
5644
5645
|
return a.value.splice(e, 0, n), o.syncSelection(), n.id;
|
|
5645
5646
|
}
|
|
5646
5647
|
function m() {
|
|
5647
|
-
let e =
|
|
5648
|
+
let e = G.createNewBillingDocumentLineItemRow(s.value);
|
|
5648
5649
|
return a.value.push(e), o.syncSelection(), e.id;
|
|
5649
5650
|
}
|
|
5650
5651
|
function h(e, t = null) {
|
|
5651
|
-
let n =
|
|
5652
|
+
let n = G.createNewBillingDocumentLineItemGroupRow(t);
|
|
5652
5653
|
return a.value.splice(e, 0, n), o.syncSelection(), n.id;
|
|
5653
5654
|
}
|
|
5654
5655
|
function g(e) {
|
|
5655
|
-
let t =
|
|
5656
|
+
let t = G.findGroupBlockEndIndex(a.value, e);
|
|
5656
5657
|
return t === -1 ? null : h(t + 1, e);
|
|
5657
5658
|
}
|
|
5658
5659
|
function _(e) {
|
|
5659
5660
|
a.value = a.value.filter((t) => t.id !== e), o.syncSelection();
|
|
5660
5661
|
}
|
|
5661
5662
|
function v(e, t = { deleteLines: !0 }) {
|
|
5662
|
-
a.value =
|
|
5663
|
+
a.value = G.deleteGroupRow(a.value, e, t.deleteLines), o.syncSelection();
|
|
5663
5664
|
}
|
|
5664
5665
|
function y(e) {
|
|
5665
5666
|
v(e, { deleteLines: !1 });
|
|
5666
5667
|
}
|
|
5667
5668
|
function b(e) {
|
|
5668
|
-
let t =
|
|
5669
|
+
let t = G.indentRow(a.value, e);
|
|
5669
5670
|
return t !== a.value && (a.value = t, !0);
|
|
5670
5671
|
}
|
|
5671
5672
|
function x(e) {
|
|
5672
|
-
let t =
|
|
5673
|
+
let t = G.outdentRow(a.value, e);
|
|
5673
5674
|
return t !== a.value && (a.value = t, !0);
|
|
5674
5675
|
}
|
|
5675
5676
|
function S(e) {
|
|
5676
|
-
let t = a.value.findIndex((t) =>
|
|
5677
|
+
let t = a.value.findIndex((t) => G.isLineRow(t) && t.id === e);
|
|
5677
5678
|
if (t === -1) return null;
|
|
5678
5679
|
let n = a.value[t];
|
|
5679
|
-
if (n === void 0 || !
|
|
5680
|
-
let r =
|
|
5680
|
+
if (n === void 0 || !G.isLineRow(n)) return null;
|
|
5681
|
+
let r = G.duplicateBillingDocumentLineItemRow(n);
|
|
5681
5682
|
return a.value.splice(t + 1, 0, r), o.syncSelection(), r.id;
|
|
5682
5683
|
}
|
|
5683
|
-
function
|
|
5684
|
+
function ee() {
|
|
5684
5685
|
if (o.selectedIds.value.length === 0) return;
|
|
5685
5686
|
let e = new Set(o.selectedIds.value);
|
|
5686
|
-
a.value =
|
|
5687
|
+
a.value = G.deleteSelectedRows(a.value, e), o.clearSelection();
|
|
5687
5688
|
}
|
|
5688
|
-
function
|
|
5689
|
+
function C() {
|
|
5689
5690
|
if (o.selectedIds.value.length === 0) return;
|
|
5690
|
-
let e =
|
|
5691
|
-
a.value =
|
|
5691
|
+
let e = G.createNewBillingDocumentLineItemGroupRow();
|
|
5692
|
+
a.value = G.groupSelectedRows(a.value, new Set(o.selectedIds.value), e), o.clearSelection();
|
|
5692
5693
|
}
|
|
5693
|
-
function
|
|
5694
|
-
o.selectedIds.value.length !== 0 && (a.value =
|
|
5694
|
+
function w() {
|
|
5695
|
+
o.selectedIds.value.length !== 0 && (a.value = G.duplicateSelectedRows(a.value, new Set(o.selectedIds.value)), o.clearSelection());
|
|
5695
5696
|
}
|
|
5696
5697
|
function te(e) {
|
|
5697
|
-
o.selectedIds.value.length !== 0 && (a.value =
|
|
5698
|
+
o.selectedIds.value.length !== 0 && (a.value = G.moveSelectedRowsToGroup(a.value, new Set(o.selectedIds.value), e), o.clearSelection());
|
|
5698
5699
|
}
|
|
5699
5700
|
function ne(e) {
|
|
5700
|
-
o.selectedIds.value.length !== 0 && (a.value =
|
|
5701
|
+
o.selectedIds.value.length !== 0 && (a.value = G.setVatRateForSelectedRows(a.value, new Set(o.selectedIds.value), e));
|
|
5701
5702
|
}
|
|
5702
5703
|
function re(e) {
|
|
5703
|
-
o.selectedIds.value.length !== 0 && (a.value =
|
|
5704
|
+
o.selectedIds.value.length !== 0 && (a.value = G.setUnitForSelectedRows(a.value, new Set(o.selectedIds.value), e));
|
|
5704
5705
|
}
|
|
5705
5706
|
function ie(e, t, n = 0, r = /* @__PURE__ */ new Set()) {
|
|
5706
|
-
a.value =
|
|
5707
|
+
a.value = G.moveRowByIndex(a.value, e, t, n, r), o.syncSelection();
|
|
5707
5708
|
}
|
|
5708
5709
|
return {
|
|
5709
5710
|
addGroup: h,
|
|
@@ -5713,10 +5714,10 @@ function Pc(e) {
|
|
|
5713
5714
|
applyServerRows: c,
|
|
5714
5715
|
deleteGroup: v,
|
|
5715
5716
|
deleteLine: _,
|
|
5716
|
-
deleteSelectedLines:
|
|
5717
|
+
deleteSelectedLines: ee,
|
|
5717
5718
|
duplicateLine: S,
|
|
5718
|
-
duplicateSelectedLines:
|
|
5719
|
-
groupSelectedLines:
|
|
5719
|
+
duplicateSelectedLines: w,
|
|
5720
|
+
groupSelectedLines: C,
|
|
5720
5721
|
indentRow: b,
|
|
5721
5722
|
moveLineByIndex: ie,
|
|
5722
5723
|
moveSelectedLinesToGroup: te,
|
|
@@ -5731,8 +5732,8 @@ function Pc(e) {
|
|
|
5731
5732
|
}
|
|
5732
5733
|
//#endregion
|
|
5733
5734
|
//#region src/ui/billing-document/table/composables/useBillingDocumentLineItemsSelection.composable.ts
|
|
5734
|
-
function
|
|
5735
|
-
let t =
|
|
5735
|
+
function Ic(e) {
|
|
5736
|
+
let t = z([]), n = k(() => e.rows().filter(G.isLineRow)), r = k(() => {
|
|
5736
5737
|
let e = n.value;
|
|
5737
5738
|
return e.length > 0 && t.value.length === e.length;
|
|
5738
5739
|
}), i = k(() => {
|
|
@@ -5769,20 +5770,20 @@ function Fc(e) {
|
|
|
5769
5770
|
}
|
|
5770
5771
|
//#endregion
|
|
5771
5772
|
//#region src/ui/billing-document/table/composables/useBillingDocumentLineItemsEditor.composable.ts
|
|
5772
|
-
function
|
|
5773
|
-
let t =
|
|
5773
|
+
function Lc(e) {
|
|
5774
|
+
let t = z([]), n = z(""), i = z(!1), a = k(() => e.customFieldDefinitions?.() ?? []), s = k(() => w.filterByEntityType(a.value, o.INVOICE_LINE)), c = k(() => w.filterByEntityType(a.value, o.INVOICE_LINE_GROUP)), l = k(() => s.value.filter((e) => e.type !== p.REFERENCE)), u = k(() => c.value.filter((e) => e.type !== p.REFERENCE)), d = k(() => s.value.filter((e) => e.type === p.REFERENCE)), f = k(() => c.value.filter((e) => e.type === p.REFERENCE)), m = jc(), h = k(() => G.createBillingDocumentLineItemsMeta(e.billingDocument())), g = k(() => e.canEdit === void 0 ? e.billingDocument().status === r.DRAFT || e.billingDocument().status === r.READY : e.canEdit.value);
|
|
5774
5775
|
function _(e) {
|
|
5775
|
-
return m.getLinks(
|
|
5776
|
+
return m.getLinks(G.isGroupRow(e) ? f.value : d.value, e.customFields);
|
|
5776
5777
|
}
|
|
5777
|
-
let v = k(() => g.value || t.value.some((e) => _(e).length > 0)), y = k(() =>
|
|
5778
|
-
if (
|
|
5778
|
+
let v = k(() => g.value || t.value.some((e) => _(e).length > 0)), y = k(() => G.createBillingDocumentLineItemRowsKey(t.value)), b = k(() => y.value !== n.value), x = k(() => G.createBillingDocumentLineItemsStructure(t.value)), S = k(() => t.value.some((e) => !G.isTransientEmptyLineRow(e) && !G.isBillingDocumentLineItemRowValid(e))), ee = k(() => G.createBillingDocumentLineItemsServerSnapshot(e.billingDocument())), C = Ic({ rows: () => t.value }), te = k(() => t.value.map((e) => {
|
|
5779
|
+
if (G.isGroupRow(e)) return {
|
|
5779
5780
|
discount: null,
|
|
5780
5781
|
gross: null,
|
|
5781
5782
|
line: e,
|
|
5782
5783
|
net: null,
|
|
5783
5784
|
vat: null
|
|
5784
5785
|
};
|
|
5785
|
-
let { discount: t, gross: n, net: r, vat: i } =
|
|
5786
|
+
let { discount: t, gross: n, net: r, vat: i } = G.createBillingDocumentLineItemTotals(e);
|
|
5786
5787
|
return {
|
|
5787
5788
|
discount: t,
|
|
5788
5789
|
gross: n,
|
|
@@ -5790,15 +5791,15 @@ function Ic(e) {
|
|
|
5790
5791
|
net: r,
|
|
5791
5792
|
vat: i
|
|
5792
5793
|
};
|
|
5793
|
-
})), ne =
|
|
5794
|
+
})), ne = Fc({
|
|
5794
5795
|
hasSaveError: i,
|
|
5795
5796
|
isEditable: g,
|
|
5796
5797
|
baselineRowsKey: n,
|
|
5797
5798
|
billingDocument: e.billingDocument,
|
|
5798
5799
|
rows: t,
|
|
5799
|
-
selection:
|
|
5800
|
+
selection: C,
|
|
5800
5801
|
meta: h
|
|
5801
|
-
}), re =
|
|
5802
|
+
}), re = Mc({
|
|
5802
5803
|
hasInvalidRows: S,
|
|
5803
5804
|
hasSaveError: i,
|
|
5804
5805
|
isDirty: b,
|
|
@@ -5810,7 +5811,7 @@ function Ic(e) {
|
|
|
5810
5811
|
updateLines: e.updateLines,
|
|
5811
5812
|
meta: h
|
|
5812
5813
|
});
|
|
5813
|
-
return
|
|
5814
|
+
return Lt(ee, (e, t) => {
|
|
5814
5815
|
t !== void 0 && b.value || ne.applyServerRows();
|
|
5815
5816
|
}, { immediate: !0 }), {
|
|
5816
5817
|
hasActionsColumn: v,
|
|
@@ -5829,18 +5830,18 @@ function Ic(e) {
|
|
|
5829
5830
|
rows: t,
|
|
5830
5831
|
saveNow: re.saveNow,
|
|
5831
5832
|
saveState: re.saveState,
|
|
5832
|
-
selection:
|
|
5833
|
+
selection: C,
|
|
5833
5834
|
structure: x,
|
|
5834
5835
|
meta: h
|
|
5835
5836
|
};
|
|
5836
5837
|
}
|
|
5837
5838
|
//#endregion
|
|
5838
5839
|
//#region src/modules/invoice-delivery/api/queries/invoiceDeliveries.query.ts
|
|
5839
|
-
function
|
|
5840
|
-
let t = new
|
|
5840
|
+
function Rc(e) {
|
|
5841
|
+
let t = new Ht(Vt()), n = null, r = Wt("invoiceDeliveries", {
|
|
5841
5842
|
params: { invoiceUuid: e },
|
|
5842
5843
|
queryFn: async () => {
|
|
5843
|
-
let r = await
|
|
5844
|
+
let r = await C.get(e.value);
|
|
5844
5845
|
if (r.isOk()) {
|
|
5845
5846
|
let e = r.value.map((e) => `${e.uuid}:${e.revision}`).join(",");
|
|
5846
5847
|
n !== null && n !== e && await Promise.all([
|
|
@@ -5852,7 +5853,7 @@ function Lc(e) {
|
|
|
5852
5853
|
return r;
|
|
5853
5854
|
}
|
|
5854
5855
|
});
|
|
5855
|
-
return
|
|
5856
|
+
return qt(() => {
|
|
5856
5857
|
let e = r.result.value;
|
|
5857
5858
|
e.isOk() && e.getValue().some((e) => [
|
|
5858
5859
|
u.QUEUED,
|
|
@@ -5863,45 +5864,45 @@ function Lc(e) {
|
|
|
5863
5864
|
}
|
|
5864
5865
|
//#endregion
|
|
5865
5866
|
//#region src/modules/invoice-delivery/use-cases/status/components/InvoiceDeliveryStatus.vue?vue&type=script&setup=true&lang.ts
|
|
5866
|
-
var
|
|
5867
|
+
var zc = {
|
|
5867
5868
|
key: 0,
|
|
5868
5869
|
class: "flex w-full flex-col gap-md rounded-lg border border-secondary p-lg"
|
|
5869
|
-
},
|
|
5870
|
+
}, Bc = { class: "font-semibold" }, Vc = { class: "text-sm text-secondary" }, Hc = { class: "flex flex-wrap items-center gap-md" }, Uc = { key: 0 }, Wc = {
|
|
5870
5871
|
key: 0,
|
|
5871
5872
|
role: "alert",
|
|
5872
5873
|
class: "text-sm text-error-primary"
|
|
5873
|
-
},
|
|
5874
|
+
}, Gc = {
|
|
5874
5875
|
key: 1,
|
|
5875
5876
|
class: "text-sm text-secondary"
|
|
5876
|
-
},
|
|
5877
|
+
}, Kc = /* @__PURE__ */ F({
|
|
5877
5878
|
__name: "InvoiceDeliveryStatus",
|
|
5878
5879
|
props: { invoiceUuid: {} },
|
|
5879
5880
|
setup(e) {
|
|
5880
|
-
let t = e, n = D(), r =
|
|
5881
|
+
let t = e, n = D(), r = Rc(k(() => t.invoiceUuid));
|
|
5881
5882
|
function i(e) {
|
|
5882
5883
|
return n.t(it.translationKey(e));
|
|
5883
5884
|
}
|
|
5884
|
-
return (e, t) => (
|
|
5885
|
-
default:
|
|
5886
|
-
N("h2",
|
|
5887
|
-
N("p",
|
|
5888
|
-
(
|
|
5885
|
+
return (e, t) => (R(), A($e, { queries: { deliveries: V(r) } }, {
|
|
5886
|
+
default: H(({ data: e }) => [e.deliveries.length > 0 ? (R(), M("section", zc, [
|
|
5887
|
+
N("h2", Bc, B(V(n).t("wise_invoicing.delivery.status.title")), 1),
|
|
5888
|
+
N("p", Vc, B(V(n).t("wise_invoicing.delivery.status.description")), 1),
|
|
5889
|
+
(R(!0), M(O, null, kt(e.deliveries, (e) => (R(), M("div", {
|
|
5889
5890
|
key: e.uuid,
|
|
5890
5891
|
class: "flex flex-col gap-sm"
|
|
5891
5892
|
}, [
|
|
5892
|
-
N("div",
|
|
5893
|
-
N("strong", null,
|
|
5894
|
-
e.provider === null ? j("", !0) : (
|
|
5895
|
-
N("span", null,
|
|
5893
|
+
N("div", Hc, [
|
|
5894
|
+
N("strong", null, B(V(n).t(`wise_invoicing.delivery.channel.${e.channel}`)), 1),
|
|
5895
|
+
e.provider === null ? j("", !0) : (R(), M("span", Uc, B(V(n).t(`wise_invoicing.delivery.provider.${e.provider}`)), 1)),
|
|
5896
|
+
N("span", null, B(V(n).t(`wise_invoicing.delivery.state.${e.state}`)), 1)
|
|
5896
5897
|
]),
|
|
5897
|
-
e.errorCode === null ? j("", !0) : (
|
|
5898
|
-
e.providerReference === null ? j("", !0) : (
|
|
5898
|
+
e.errorCode === null ? j("", !0) : (R(), M("p", Wc, B(i(e.errorCode)), 1)),
|
|
5899
|
+
e.providerReference === null ? j("", !0) : (R(), M("p", Gc, B(V(n).t("wise_invoicing.delivery.status.reference", { reference: e.providerReference })), 1))
|
|
5899
5900
|
]))), 128))
|
|
5900
5901
|
])) : j("", !0)]),
|
|
5901
5902
|
_: 1
|
|
5902
5903
|
}, 8, ["queries"]));
|
|
5903
5904
|
}
|
|
5904
|
-
}),
|
|
5905
|
+
}), qc = /* @__PURE__ */ F({
|
|
5905
5906
|
__name: "BillingDocumentDetailLayout",
|
|
5906
5907
|
props: {
|
|
5907
5908
|
title: {},
|
|
@@ -5909,7 +5910,7 @@ var Rc = {
|
|
|
5909
5910
|
},
|
|
5910
5911
|
setup(e) {
|
|
5911
5912
|
let t = e;
|
|
5912
|
-
return (e, n) => (
|
|
5913
|
+
return (e, n) => (R(), A(V(sn), {
|
|
5913
5914
|
breadcrumbs: t.breadcrumbs,
|
|
5914
5915
|
title: t.title,
|
|
5915
5916
|
"detail-pane": {
|
|
@@ -5920,21 +5921,21 @@ var Rc = {
|
|
|
5920
5921
|
variant: "bordered-inline"
|
|
5921
5922
|
}
|
|
5922
5923
|
}, {
|
|
5923
|
-
default:
|
|
5924
|
+
default: H(() => [P(V(cn), {
|
|
5924
5925
|
"is-full-width": !0,
|
|
5925
5926
|
"has-vertical-padding": !0
|
|
5926
5927
|
}, {
|
|
5927
|
-
default:
|
|
5928
|
-
default:
|
|
5928
|
+
default: H(() => [P(V(on), { gap: "lg" }, {
|
|
5929
|
+
default: H(() => [At(e.$slots, "header"), At(e.$slots, "default")]),
|
|
5929
5930
|
_: 3
|
|
5930
5931
|
})]),
|
|
5931
5932
|
_: 3
|
|
5932
5933
|
})]),
|
|
5933
|
-
"detail-pane":
|
|
5934
|
+
"detail-pane": H(() => [At(e.$slots, "sidebar")]),
|
|
5934
5935
|
_: 3
|
|
5935
5936
|
}, 8, ["breadcrumbs", "title"]));
|
|
5936
5937
|
}
|
|
5937
|
-
}),
|
|
5938
|
+
}), Jc = /* @__PURE__ */ F({
|
|
5938
5939
|
__name: "BillingDocumentDetailPage",
|
|
5939
5940
|
props: {
|
|
5940
5941
|
title: {},
|
|
@@ -5943,20 +5944,20 @@ var Rc = {
|
|
|
5943
5944
|
},
|
|
5944
5945
|
setup(e) {
|
|
5945
5946
|
let t = e, n = f();
|
|
5946
|
-
return
|
|
5947
|
+
return Kn(k(() => [])), n.set(() => t.billingDocument.subject ?? t.billingDocument.sequence ?? t.title), (e, n) => (R(), A(qc, {
|
|
5947
5948
|
breadcrumbs: t.breadcrumbs,
|
|
5948
5949
|
title: t.title
|
|
5949
5950
|
}, {
|
|
5950
|
-
header:
|
|
5951
|
-
default:
|
|
5952
|
-
sidebar:
|
|
5951
|
+
header: H(() => [At(e.$slots, "header")]),
|
|
5952
|
+
default: H(() => [At(e.$slots, "default")]),
|
|
5953
|
+
sidebar: H(() => [At(e.$slots, "sidebar")]),
|
|
5953
5954
|
_: 3
|
|
5954
5955
|
}, 8, ["breadcrumbs", "title"]));
|
|
5955
5956
|
}
|
|
5956
5957
|
});
|
|
5957
5958
|
//#endregion
|
|
5958
5959
|
//#region src/ui/billing-document/billingDocumentPdfPreviewRoute.util.ts
|
|
5959
|
-
function
|
|
5960
|
+
function Yc(t) {
|
|
5960
5961
|
return t.type === e.CREDIT_NOTE ? {
|
|
5961
5962
|
name: "invoicing-credit-note-pdf-preview",
|
|
5962
5963
|
params: { creditNoteUuid: t.uuid }
|
|
@@ -5967,16 +5968,16 @@ function Jc(t) {
|
|
|
5967
5968
|
}
|
|
5968
5969
|
//#endregion
|
|
5969
5970
|
//#region src/ui/billing-document/BillingDocumentPdfViewer.vue?vue&type=script&setup=true&lang.ts
|
|
5970
|
-
var
|
|
5971
|
+
var Xc = { class: "text-sm font-semibold text-primary" }, Zc = { class: "w-10 text-xs text-primary" }, Qc = { class: "text-xs text-secondary" }, $c = 25, el = 200, tl = 10, nl = /* @__PURE__ */ F({
|
|
5971
5972
|
__name: "BillingDocumentPdfViewer",
|
|
5972
5973
|
props: { billingDocument: {} },
|
|
5973
5974
|
setup(t) {
|
|
5974
|
-
let n = t, r = D(), i =
|
|
5975
|
+
let n = t, r = D(), i = Qt(), a = b(), o = z(75), s = z(1), c = z(null), l = z(0), u = k(() => a.invoicePdfComponent.value), d = k(() => n.billingDocument.type === e.CREDIT_NOTE ? r.t("wise_invoicing.common.credit_note_pdf") : r.t("wise_invoicing.common.invoice_pdf"));
|
|
5975
5976
|
function f() {
|
|
5976
|
-
o.value = Math.min(
|
|
5977
|
+
o.value = Math.min(el, o.value + tl);
|
|
5977
5978
|
}
|
|
5978
5979
|
function p() {
|
|
5979
|
-
o.value = Math.max(
|
|
5980
|
+
o.value = Math.max($c, o.value - tl);
|
|
5980
5981
|
}
|
|
5981
5982
|
function m() {
|
|
5982
5983
|
return Array.from(c.value?.querySelectorAll("[data-pdf-page]") ?? []);
|
|
@@ -5996,29 +5997,29 @@ var Yc = { class: "text-sm font-semibold text-primary" }, Xc = { class: "w-10 te
|
|
|
5996
5997
|
s.value < l.value && g(s.value + 1);
|
|
5997
5998
|
}
|
|
5998
5999
|
function y() {
|
|
5999
|
-
let e = i.resolve(
|
|
6000
|
+
let e = i.resolve(Yc(n.billingDocument));
|
|
6000
6001
|
window.open(e.href, "_blank", "noopener,noreferrer");
|
|
6001
6002
|
}
|
|
6002
6003
|
let x = null;
|
|
6003
|
-
return
|
|
6004
|
+
return Tt(() => {
|
|
6004
6005
|
h(), c.value !== null && (x = new MutationObserver(h), x.observe(c.value, {
|
|
6005
6006
|
childList: !0,
|
|
6006
6007
|
subtree: !0
|
|
6007
6008
|
}));
|
|
6008
|
-
}),
|
|
6009
|
+
}), Et(() => {
|
|
6009
6010
|
x?.disconnect();
|
|
6010
|
-
}), (e, t) => (
|
|
6011
|
+
}), (e, t) => (R(), A(V(on), {
|
|
6011
6012
|
gap: "none",
|
|
6012
6013
|
class: "flex-1 overflow-hidden rounded-xl border border-secondary"
|
|
6013
6014
|
}, {
|
|
6014
|
-
default:
|
|
6015
|
-
P(
|
|
6015
|
+
default: H(() => [
|
|
6016
|
+
P(V(U), {
|
|
6016
6017
|
justify: "between",
|
|
6017
6018
|
class: "w-full border-b border-secondary bg-primary px-lg py-md"
|
|
6018
6019
|
}, {
|
|
6019
|
-
default:
|
|
6020
|
-
icon:
|
|
6021
|
-
label:
|
|
6020
|
+
default: H(() => [N("p", Xc, B(d.value), 1), P(V(wn), {
|
|
6021
|
+
icon: V(Ie),
|
|
6022
|
+
label: V(r).t("wise_invoicing.common.pdf_viewer.expand"),
|
|
6022
6023
|
variant: "tertiary",
|
|
6023
6024
|
onClick: y
|
|
6024
6025
|
}, null, 8, ["icon", "label"])]),
|
|
@@ -6029,25 +6030,25 @@ var Yc = { class: "text-sm font-semibold text-primary" }, Xc = { class: "w-10 te
|
|
|
6029
6030
|
ref: c,
|
|
6030
6031
|
class: "flex min-h-0 w-full flex-1 flex-col overflow-y-auto bg-tertiary py-lg"
|
|
6031
6032
|
}, [N("div", {
|
|
6032
|
-
style:
|
|
6033
|
+
style: Ct({ zoom: o.value / 100 }),
|
|
6033
6034
|
class: "p-2xl **:data-pdf-page:mt-0"
|
|
6034
|
-
}, [u.value === null ? (
|
|
6035
|
+
}, [u.value === null ? (R(), A(ct, {
|
|
6035
6036
|
key: 1,
|
|
6036
6037
|
"billing-document": n.billingDocument
|
|
6037
|
-
}, null, 8, ["billing-document"])) : (
|
|
6038
|
+
}, null, 8, ["billing-document"])) : (R(), A(jt(u.value), {
|
|
6038
6039
|
key: 0,
|
|
6039
6040
|
invoice: n.billingDocument
|
|
6040
6041
|
}, null, 8, ["invoice"]))], 4)], 512),
|
|
6041
|
-
P(
|
|
6042
|
+
P(V(U), {
|
|
6042
6043
|
justify: "between",
|
|
6043
6044
|
class: "w-full border-t border-secondary bg-primary p-md"
|
|
6044
6045
|
}, {
|
|
6045
|
-
default:
|
|
6046
|
-
default:
|
|
6047
|
-
P(
|
|
6046
|
+
default: H(() => [P(V(U), { gap: "xs" }, {
|
|
6047
|
+
default: H(() => [
|
|
6048
|
+
P(V(wn), {
|
|
6048
6049
|
disabled: s.value <= 1,
|
|
6049
|
-
icon:
|
|
6050
|
-
label:
|
|
6050
|
+
icon: V(Be),
|
|
6051
|
+
label: V(r).t("wise_invoicing.common.pdf_viewer.previous_page"),
|
|
6051
6052
|
variant: "tertiary",
|
|
6052
6053
|
onClick: _
|
|
6053
6054
|
}, null, 8, [
|
|
@@ -6055,10 +6056,10 @@ var Yc = { class: "text-sm font-semibold text-primary" }, Xc = { class: "w-10 te
|
|
|
6055
6056
|
"icon",
|
|
6056
6057
|
"label"
|
|
6057
6058
|
]),
|
|
6058
|
-
P(
|
|
6059
|
+
P(V(wn), {
|
|
6059
6060
|
disabled: s.value >= l.value,
|
|
6060
|
-
icon:
|
|
6061
|
-
label:
|
|
6061
|
+
icon: V(ae),
|
|
6062
|
+
label: V(r).t("wise_invoicing.common.pdf_viewer.next_page"),
|
|
6062
6063
|
size: "sm",
|
|
6063
6064
|
variant: "tertiary",
|
|
6064
6065
|
onClick: v
|
|
@@ -6067,16 +6068,16 @@ var Yc = { class: "text-sm font-semibold text-primary" }, Xc = { class: "w-10 te
|
|
|
6067
6068
|
"icon",
|
|
6068
6069
|
"label"
|
|
6069
6070
|
]),
|
|
6070
|
-
N("p",
|
|
6071
|
+
N("p", Zc, B(s.value) + " / " + B(l.value), 1)
|
|
6071
6072
|
]),
|
|
6072
6073
|
_: 1
|
|
6073
|
-
}), P(
|
|
6074
|
-
default:
|
|
6075
|
-
N("p",
|
|
6076
|
-
P(
|
|
6077
|
-
"is-disabled": o.value >=
|
|
6078
|
-
icon:
|
|
6079
|
-
label:
|
|
6074
|
+
}), P(V(U), { gap: "xs" }, {
|
|
6075
|
+
default: H(() => [
|
|
6076
|
+
N("p", Qc, B(o.value) + "% ", 1),
|
|
6077
|
+
P(V(wn), {
|
|
6078
|
+
"is-disabled": o.value >= el,
|
|
6079
|
+
icon: V(ie),
|
|
6080
|
+
label: V(r).t("wise_invoicing.common.pdf_viewer.zoom_in"),
|
|
6080
6081
|
size: "sm",
|
|
6081
6082
|
variant: "tertiary",
|
|
6082
6083
|
onClick: f
|
|
@@ -6085,10 +6086,10 @@ var Yc = { class: "text-sm font-semibold text-primary" }, Xc = { class: "w-10 te
|
|
|
6085
6086
|
"icon",
|
|
6086
6087
|
"label"
|
|
6087
6088
|
]),
|
|
6088
|
-
P(
|
|
6089
|
-
"is-disabled": o.value <=
|
|
6090
|
-
icon:
|
|
6091
|
-
label:
|
|
6089
|
+
P(V(wn), {
|
|
6090
|
+
"is-disabled": o.value <= $c,
|
|
6091
|
+
icon: V(Me),
|
|
6092
|
+
label: V(r).t("wise_invoicing.common.pdf_viewer.zoom_out"),
|
|
6092
6093
|
variant: "tertiary",
|
|
6093
6094
|
onClick: p
|
|
6094
6095
|
}, null, 8, [
|
|
@@ -6105,7 +6106,7 @@ var Yc = { class: "text-sm font-semibold text-primary" }, Xc = { class: "w-10 te
|
|
|
6105
6106
|
_: 1
|
|
6106
6107
|
}));
|
|
6107
6108
|
}
|
|
6108
|
-
}),
|
|
6109
|
+
}), rl = /* @__PURE__ */ F({
|
|
6109
6110
|
__name: "BillingDocumentDetailViewDataProvider",
|
|
6110
6111
|
props: {
|
|
6111
6112
|
customFieldDefinitionsQuery: {},
|
|
@@ -6114,18 +6115,18 @@ var Yc = { class: "text-sm font-semibold text-primary" }, Xc = { class: "w-10 te
|
|
|
6114
6115
|
},
|
|
6115
6116
|
setup(e) {
|
|
6116
6117
|
let t = e;
|
|
6117
|
-
return (e, n) => (
|
|
6118
|
+
return (e, n) => (R(), A($e, { queries: {
|
|
6118
6119
|
billingDocument: t.query,
|
|
6119
6120
|
customFieldDefinitions: t.customFieldDefinitionsQuery
|
|
6120
6121
|
} }, {
|
|
6121
|
-
default:
|
|
6122
|
+
default: H(({ data: t }) => [At(e.$slots, "default", St(gt({
|
|
6122
6123
|
billingDocument: t.billingDocument,
|
|
6123
6124
|
customFieldDefinitions: t.customFieldDefinitions
|
|
6124
6125
|
})))]),
|
|
6125
|
-
loading:
|
|
6126
|
+
loading: H(() => [P(V(at).PageLoadingState, { breadcrumbs: t.loadingBreadcrumbs }, null, 8, ["breadcrumbs"])]),
|
|
6126
6127
|
_: 3
|
|
6127
6128
|
}, 8, ["queries"]));
|
|
6128
6129
|
}
|
|
6129
6130
|
});
|
|
6130
6131
|
//#endregion
|
|
6131
|
-
export {
|
|
6132
|
+
export { Qn as C, Yn as E, er as S, Xn as T, or as _, Lc as a, nr as b, wc as c, ni as d, Hr as f, Cr as g, wr as h, Kc as i, Cc as l, Tr as m, nl as n, Ac as o, Br as p, Jc as r, Oc as s, rl as t, Ri as u, ar as v, Zn as w, tr as x, ir as y };
|