@cling-se/widget 0.4.0 → 0.5.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.
@@ -1,4 +1,4 @@
1
- import { c as se, g as Se, a as jf, n as N, C as Ya, s as Wf, e as Yf, i as Vf, r as Tc, b as Xs, m as Rc, d as Lt, f as mn, h as nt, _ as Uf, j as Ic, k as Hf, p as Gf, l as qf, o as Kf, q as Pc, V as Va, t as Ac, A as Xf, u as Zf, v as Jf, w as Qf, x as eh, F as Fc, y as Nc, z as Ua, B as th, D as rh, E as Zs, G as nh, H as ih, I as ah } from "./main.5aaccd3f.js";
1
+ import { c as se, g as Se, a as jf, n as N, C as Ya, s as Wf, e as Yf, i as Vf, r as Tc, b as Xs, m as Rc, d as Lt, f as mn, h as nt, _ as Uf, j as Ic, k as Hf, p as Gf, l as qf, o as Kf, q as Pc, V as Va, t as Ac, A as Xf, u as Zf, v as Jf, w as Qf, x as eh, F as Fc, y as Nc, z as Ua, B as th, D as rh, E as Zs, G as nh, H as ih, I as ah } from "./main.819722de.js";
2
2
  const fe = {
3
3
  AD: {
4
4
  name: "Andorra",
@@ -0,0 +1,189 @@
1
+ import { f as g, h as p, n as u } from "./main.819722de.js";
2
+ const _ = {
3
+ name: "DocumentReceipt",
4
+ i18nOptions: {
5
+ namespaces: "DocumentReceipt",
6
+ messages: {
7
+ en: {
8
+ title: "Signature verification",
9
+ waitingForSign: "Waiting for signature",
10
+ signMethod: "Sign method",
11
+ remaining: "{{count}} signatures are remaining before the document is completely signed.",
12
+ confirmChangeMessage: "Do you really want to change sign method for {{- name}}?",
13
+ bankIdHint: "Identity and signature confirmed with BankID"
14
+ },
15
+ sv: {
16
+ title: "Verifikat p\xE5 signering",
17
+ waitingForSign: "V\xE4ntar p\xE5 signatur",
18
+ signMethod: "Signeringsmetod",
19
+ remaining: "{{count}} st signaturer kvarst\xE5r innan dokumentet \xE4r helt signerat.",
20
+ confirmChangeMessage: "Vill du verkligen byta signeringsmetod f\xF6r {{- name}}?",
21
+ bankIdHint: "Identifiering och signering s\xE4kerst\xE4lld med BankID."
22
+ }
23
+ }
24
+ },
25
+ props: {
26
+ document: {
27
+ type: Object,
28
+ required: !0
29
+ },
30
+ allowSignMethodUpdate: {
31
+ type: Boolean,
32
+ default: !0
33
+ }
34
+ },
35
+ computed: {
36
+ signees() {
37
+ const { senderClient: a, clients: t } = this.document;
38
+ return [
39
+ ...a ? [a] : [],
40
+ ...(t || []).map((n, s) => ({ ...n, index: s }))
41
+ ].filter(
42
+ (n) => {
43
+ var s;
44
+ return ["signee", "approver"].includes(n.documentRole) || ((s = n.answer) == null ? void 0 : s.didAccept);
45
+ }
46
+ ).map(
47
+ ({
48
+ name: n = "",
49
+ companyName: s,
50
+ email: o,
51
+ socialNo: c = null,
52
+ answerMethod: i,
53
+ answer: d,
54
+ documentRole: l,
55
+ index: m
56
+ }) => ({
57
+ name: n || s || o,
58
+ socialNo: c,
59
+ method: (i == null ? void 0 : i.accept) || "",
60
+ documentRole: l,
61
+ ...d,
62
+ index: m
63
+ })
64
+ );
65
+ },
66
+ waitingFor() {
67
+ return this.document.recipients.reduce(
68
+ (a, t) => {
69
+ var e;
70
+ return t.answer || !["signee", "approver"].includes(t.documentRole) || ((e = t.answerMethod) == null ? void 0 : e.accept) === "inPerson" ? a : [...a, t];
71
+ },
72
+ []
73
+ );
74
+ },
75
+ documentName() {
76
+ return this.document.name || "";
77
+ },
78
+ sentByName() {
79
+ var a, t;
80
+ return ((t = (a = this.document.sender) == null ? void 0 : a.user) == null ? void 0 : t.name) || "";
81
+ }
82
+ },
83
+ methods: {
84
+ ...g({
85
+ showMessage: p.SHOW_MESSAGE,
86
+ updateDocument: p.UPDATE_DOCUMENT2
87
+ }),
88
+ getIconType(a) {
89
+ return a === "signee" ? "pen-tool" : a === "recipient" ? "eye" : a === "approver" ? "check" : "shield";
90
+ },
91
+ getBrowserString({ browser: a, os: t, device: e }) {
92
+ return [a == null ? void 0 : a.name, t == null ? void 0 : t.name, e == null ? void 0 : e.model].filter((n) => !!n).join(", ");
93
+ },
94
+ onUpdate(a, t) {
95
+ this.showMessage({
96
+ displayType: "dialog",
97
+ type: "secondary",
98
+ title: this.$t("_common:change", { thing: this.$t("_common:signMethod.title").toLowerCase() }),
99
+ message: this.$t("confirmChangeMessage", { name: a.name }),
100
+ actions: {
101
+ cancel: {
102
+ text: this.$t("_common:cancel"),
103
+ callback: "cancel"
104
+ },
105
+ submit: {
106
+ text: this.$t("actions:updateDocumentDialog.submit"),
107
+ callback: () => this.updateSignMethod(a.index, t)
108
+ }
109
+ }
110
+ });
111
+ },
112
+ async updateSignMethod(a, t) {
113
+ const { id: e } = this.document || {}, n = { [`clients.${a}.answerMethod.accept`]: t };
114
+ await this.updateDocument({
115
+ id: e,
116
+ body: n,
117
+ params: { type: "paths" }
118
+ });
119
+ }
120
+ }
121
+ };
122
+ var f = function() {
123
+ var t = this, e = t._self._c;
124
+ return e("div", { staticClass: "rounded-lg text-gray-600 pt-4 px-1 pb-1 bg-gray-100 border border-gray-200" }, [e("div", { staticClass: "mb-1 relative leading-5" }, [e("div", { staticClass: "pl-4 pb-1" }, [e("div", { staticClass: "font-medium text-black" }, [t._v(t._s(t.$t("title")))]), e("div", { staticClass: "data-label" }, [t._v(t._s(t.documentName))]), e("div", { staticClass: "grid grid-cols-3 gap-2 pb-1 pt-4", staticStyle: { "grid-template-columns": "repeat(auto-fit, minmax(200px, 1fr))" } }, [t._l([
125
+ [t.$t("_common:sentByName"), t.sentByName],
126
+ [t.$t("_components:status.sent"), t.$formatDate(t.document.sentAt, "Pp")],
127
+ [t.$t("_components:replyBy"), t.document.status === "sent" && t.$formatDate(t.document.expiresAt)],
128
+ [t.$t("_components:status.accepted"), t.$formatDate(t.document.acceptedAt, "Pp")]
129
+ ], function([n, s], o) {
130
+ return [s ? e("div", { key: o }, [e("div", { staticClass: "text-gray-900 text-xs", domProps: { textContent: t._s(n) } }), e("div", { staticClass: "text-gray-600 mr-1.5", domProps: { textContent: t._s(s) } })]) : t._e()];
131
+ })], 2)]), t.waitingFor.length ? e("div", { staticClass: "mt-2 inline-flex items-center text-xs font-medium bg-orange-50 border border-orange-200/90 px-1 py-0.5 rounded-full ml-3 text-black/80" }, [e("BaseIcon", { staticClass: "text-orange-500/80", attrs: { type: "info", size: "14" } }), e("div", { staticClass: "px-1.5" }, [t._v(" " + t._s(t.$t("remaining", { count: t.waitingFor.length })) + " ")])], 1) : t._e(), e("BaseIcon", { staticClass: "absolute top-1 right-5 text-gray-500", attrs: { type: "lock", size: "18" } })], 1), e("div", { staticClass: "flex flex-col gap-2 p-2" }, t._l(t.signees, function(n, s) {
132
+ var o, c;
133
+ return e("div", { key: s, staticClass: "bg-white relative text-gray-700 border border-gray-200 rounded-md" }, [e("div", { staticClass: "px-4 py-3" }, [n.didAccept && n.method === "bankId" ? e("BaseIcon", { staticClass: "absolute top-3 right-4", attrs: { type: "bankIdColor", size: "22" } }) : n.didAccept ? e("BaseIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: t.$t(`_common:documentRole.${n.documentRole}.label`), expression: "$t(`_common:documentRole.${signee.documentRole}.label`)" }], staticClass: "lock-icon absolute right-6 top-4 opacity-70", attrs: { size: 18, type: t.getIconType(n.documentRole) } }) : t._e(), n.didAccept === !1 ? e("div", { staticClass: "absolute right-3 top-3 bg-red-200 border border-red-400/50 rounded-full text-xs py-0.5 px-2 inline-flex font-medium text-red-700" }, [t._v(" " + t._s(t.$t("_common:denied").capitalize()) + " ")]) : !n.didAccept && n.method !== "inPerson" ? e("div", { staticClass: "absolute right-3 top-3 bg-orange-50 border border-orange-200/70 rounded-full text-xs py-0.5 px-2 inline-flex font-medium text-black/80" }, [t._v(" " + t._s(t.$t("waitingForSign")) + " ")]) : t._e(), e("div", { staticClass: "font-medium text-[15px] text-black pb-1" }, [t._v(t._s(((o = n.response) == null ? void 0 : o.name) || n.name))]), e("div", { staticClass: "grid grid-cols-3 gap-2 py-1", staticStyle: { "grid-template-columns": "repeat(auto-fit, minmax(190px, 1fr))" } }, [t._l([
134
+ [t.$t("_common:socialNo").capitalize(), n.socialNo],
135
+ [t.$t("signMethod"), t.$t(`_common:signMethod.${n.method}`), "signMethod"],
136
+ [`${t.$t("_common:date").capitalize()} & ${t.$t("_common:time.time")}`, t.$formatDate(n.didAnswerAt, "Pp")],
137
+ ["IP-" + t.$t("_common:address"), n.ip],
138
+ [`${t.$t("_common:browser")}, OS & ${t.$t("_common:device")}`, t.getBrowserString(n)]
139
+ ], function([i, d, l], m) {
140
+ return [d ? e("div", { key: m, staticClass: "text-[13px]" }, [e("div", { staticClass: "text-gray-900", domProps: { textContent: t._s(i) } }), e("div", { staticClass: "flex items-center" }, [e("div", { staticClass: "text-gray-500 mr-1.5", domProps: { textContent: t._s(d) } }), l === "signMethod" && n.method && t.allowSignMethodUpdate && t.document.status !== "accepted" && n.didAccept === void 0 ? e("CDropdown", { attrs: { "append-to-body": !0, "menu-styling": { width: "180px" } } }, [e("div", { staticClass: "underline text-primary-500 font-medium text-xs", attrs: { slot: "trigger" }, domProps: { textContent: t._s(t.$t("_common:change")) }, slot: "trigger" }), t._l([
141
+ ...t.$feature("bankId") ? ["bankId"] : [],
142
+ "signature",
143
+ "inPerson"
144
+ ], function(r) {
145
+ return e("CDropdownItem", { key: r, attrs: { "icon-right": n.method === r ? "check" : "" }, on: { click: function(k) {
146
+ n.method !== r && t.onUpdate(n, r);
147
+ } } }, [t._v(" " + t._s(t.$t(`_common:signMethod.${r}`)) + " ")]);
148
+ })], 2) : t._e()], 1)]) : t._e()];
149
+ })], 2)], 1), n.signatureDataURL ? e("div", { staticClass: "h-20 mx-4 border-t border-gray-100" }, [e("img", { staticClass: "h-full", attrs: { src: n.signatureDataURL } })]) : n.didAccept && n.method === "bankId" ? e("div", { staticClass: "bg-gray-300 mx-4 mb-4 text-white/90 flex items-center p-1.5 rounded-md", staticStyle: { background: "linear-gradient(45deg, hsl(200deg 35% 17%), hsl(199deg 25% 30%))", border: "1px solid #35677e" } }, [e("div", { staticClass: "rounded-md w-9 h-9 flex items-center justify-center mr-2 ml-0.5 bg-[#183e4f] border border-[#275369]" }, [e("BaseIcon", { attrs: { type: "bankId", size: "22" } })], 1), e("div", [e("div", { staticClass: "text-xs font-medium", domProps: { textContent: t._s(t.$t("bankIdHint")) } }), e("div", { staticClass: "text-xs opacity-70" }, [t._v(t._s(((c = n.response) == null ? void 0 : c.name) || n.name) + " \xB7 " + t._s(n.socialNo))])])]) : t._e()]);
150
+ }), 0)]);
151
+ }, x = [], h = /* @__PURE__ */ u(
152
+ _,
153
+ f,
154
+ x,
155
+ !1,
156
+ null,
157
+ null,
158
+ null,
159
+ null
160
+ );
161
+ const b = h.exports, y = {
162
+ name: "DocReceipt",
163
+ components: {
164
+ DocumentReceipt: b
165
+ },
166
+ props: {
167
+ document: {
168
+ type: Object,
169
+ required: !0
170
+ }
171
+ }
172
+ };
173
+ var v = function() {
174
+ var t = this, e = t._self._c;
175
+ return e("div", [e("DocumentReceipt", { attrs: { document: t.document, "allow-sign-method-update": !1 } })], 1);
176
+ }, C = [], $ = /* @__PURE__ */ u(
177
+ y,
178
+ v,
179
+ C,
180
+ !1,
181
+ null,
182
+ null,
183
+ null,
184
+ null
185
+ );
186
+ const w = $.exports;
187
+ export {
188
+ w as default
189
+ };
@@ -1,4 +1,4 @@
1
- import { d, f as c, h as l, n as r } from "./main.5aaccd3f.js";
1
+ import { d, f as c, h as l, n as r } from "./main.819722de.js";
2
2
  const m = {
3
3
  name: "DocumentSendReminderModal",
4
4
  props: {
@@ -1,4 +1,4 @@
1
- import { n as p, i as g, J as f, d as x } from "./main.5aaccd3f.js";
1
+ import { n as p, i as g, J as f, d as x } from "./main.819722de.js";
2
2
  const $ = {
3
3
  name: "DynamicLink",
4
4
  props: {