@cling-se/widget 0.4.0 → 0.5.1

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.ed2b323d.js";
2
2
  const fe = {
3
3
  AD: {
4
4
  name: "Andorra",
@@ -8553,6 +8553,14 @@ const EM = {
8553
8553
  )
8554
8554
  ],
8555
8555
  props: {
8556
+ showSave: {
8557
+ type: Boolean,
8558
+ default: !0
8559
+ },
8560
+ showSchedule: {
8561
+ type: Boolean,
8562
+ default: !0
8563
+ },
8556
8564
  setFormValue: {
8557
8565
  type: Function,
8558
8566
  required: !0
@@ -8754,9 +8762,9 @@ var TM = function() {
8754
8762
  } } })], 1), !e.useSignOrder && !e.isManualDelivery ? r("div", { staticClass: "psuedo-input relative", attrs: { tabindex: "0" }, on: { click: e.openReminders } }, [r("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("_common:reminder_plural").capitalize()))]), r("div", [e._v(" " + e._s(e.noOfReminders ? `${e.noOfReminders} ${e.$i18n.lang === "sv" ? e.$t("_common:unitType.unit") : ""}` : e.$t("_common:disabled").capitalize()) + " ")]), e.noOfReminders ? r("CButton", { staticClass: "absolute right-3 top-3", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(n) {
8755
8763
  n.preventDefault(), n.stopPropagation(), e.reminders = [];
8756
8764
  } } }) : e._e()], 1) : e._e()], 1), e.clientsAreMissingContactInfo && !e.isManualDelivery ? r("ErrorCallout", { attrs: { message: e.$t("clientsAreMissingContactInfo"), size: "small" } }) : e._e()], 2)]), r("div", { staticClass: "px-4 pb-4 @md:px-8 @xl:px-16" }, [e._t("send", function() {
8757
- return [r("div", { staticClass: "flex" }, [r("CButton", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("_common:save", { thing: e.$t("_common:document").toLowerCase() }), expression: "$t('_common:save', { thing: $t('_common:document').toLowerCase() })" }], staticClass: "mr-2 w-12", attrs: { loading: e.isPosting, type: "none", icon: "save", pattern: "secondary" }, on: { click: function(n) {
8765
+ return [r("div", { staticClass: "flex" }, [e.showSave ? r("CButton", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("_common:save", { thing: e.$t("_common:document").toLowerCase() }), expression: "$t('_common:save', { thing: $t('_common:document').toLowerCase() })" }], staticClass: "mr-2 w-12", attrs: { loading: e.isPosting, type: "none", icon: "save", pattern: "secondary" }, on: { click: function(n) {
8758
8766
  return e.doSaveDocument();
8759
- } } }), !e.useSignOrder && !e.isManualDelivery ? r("CButton", { staticClass: "mr-2 w-12 @md:w-auto", staticStyle: { padding: "14px 16px", "border-radius": "8px", height: "initial", "font-size": "14px", "font-weight": "600" }, attrs: { disabled: e.isPosting || !e.clients.length, type: "none", pattern: "secondary" }, on: { click: e.openSendLater } }, [r("span", { staticClass: "!hidden @md:!block", domProps: { textContent: e._s(e.$t("scheduledTooltip")) } }), r("BaseIcon", { staticClass: "@md:!hidden", attrs: { type: "calendar", size: "16" } })], 1) : e._e(), r("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: {
8767
+ } } }) : e._e(), e.showSchedule && !e.useSignOrder && !e.isManualDelivery ? r("CButton", { staticClass: "mr-2 w-12 @md:w-auto", staticStyle: { padding: "14px 16px", "border-radius": "8px", height: "initial", "font-size": "14px", "font-weight": "600" }, attrs: { disabled: e.isPosting || !e.clients.length, type: "none", pattern: "secondary" }, on: { click: e.openSendLater } }, [r("span", { staticClass: "!hidden @md:!block", domProps: { textContent: e._s(e.$t("scheduledTooltip")) } }), r("BaseIcon", { staticClass: "@md:!hidden", attrs: { type: "calendar", size: "16" } })], 1) : e._e(), r("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: {
8760
8768
  content: e.clients.length ? "" : e.$t("components:account.documentForm.clients.errorMessage")
8761
8769
  }, expression: `{
8762
8770
  content: clients.length ? '' : $t('components:account.documentForm.clients.errorMessage'),
@@ -8770,7 +8778,7 @@ var TM = function() {
8770
8778
  RM,
8771
8779
  !1,
8772
8780
  null,
8773
- "ccf0eb53",
8781
+ "433b8516",
8774
8782
  null,
8775
8783
  null
8776
8784
  );
@@ -10869,6 +10877,16 @@ const Ec = Va.observable({
10869
10877
  SendForm: PM
10870
10878
  },
10871
10879
  provide: () => ({ viewSettings: Ec }),
10880
+ props: {
10881
+ showSave: {
10882
+ type: Boolean,
10883
+ default: !0
10884
+ },
10885
+ showSchedule: {
10886
+ type: Boolean,
10887
+ default: !0
10888
+ }
10889
+ },
10872
10890
  data() {
10873
10891
  return {
10874
10892
  document: null
@@ -10926,7 +10944,7 @@ var OT = function() {
10926
10944
  clients: "clients",
10927
10945
  reminders: "data.reminders",
10928
10946
  name: "data.name"
10929
- }, "set-form-value": e.setDocValue, "remove-form-value": e.removeDocValue, "use-scroll": "" } }) : r("div", { staticClass: "w-full h-full grid place-items-center" }, [r("BaseIcon", { staticClass: "animate-spin text-gray-400", attrs: { type: "loader", size: 28 } })], 1);
10947
+ }, "show-save": e.showSave, "show-schedule": e.showSchedule, "set-form-value": e.setDocValue, "remove-form-value": e.removeDocValue, "use-scroll": "" } }) : r("div", { staticClass: "w-full h-full grid place-items-center" }, [r("BaseIcon", { staticClass: "animate-spin text-gray-400", attrs: { type: "loader", size: 28 } })], 1);
10930
10948
  }, kT = [], DT = /* @__PURE__ */ N(
10931
10949
  xT,
10932
10950
  OT,
@@ -0,0 +1,189 @@
1
+ import { f as g, h as p, n as u } from "./main.ed2b323d.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.ed2b323d.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.ed2b323d.js";
2
2
  const $ = {
3
3
  name: "DynamicLink",
4
4
  props: {