@cling-se/widget 0.6.0 → 0.7.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 { f as g, h as p, n as u } from "./main.44d450fa.js";
1
+ import { f as g, h as p, n as u } from "./main.e2cbf475.js";
2
2
  const _ = {
3
3
  sv: {
4
4
  title: "Verifikat p\xE5 signering",
@@ -1,4 +1,4 @@
1
- import { d as m, f as c, h as d, n as a } from "./main.44d450fa.js";
1
+ import { d as m, f as c, h as d, n as a } from "./main.e2cbf475.js";
2
2
  const l = {
3
3
  name: "DocumentSendReminderModal",
4
4
  i18nOptions: {
@@ -1,5 +1,87 @@
1
- import { n as p, i as g, J as f, d as x } from "./main.44d450fa.js";
2
- const $ = {
1
+ import { n as m, J as v, g as $, i as _, K as f, d as C } from "./main.e2cbf475.js";
2
+ const g = {
3
+ new: {
4
+ statusClass: "draft",
5
+ icon: "statusDraft"
6
+ },
7
+ draft: {
8
+ statusClass: "draft",
9
+ icon: "statusDraft"
10
+ },
11
+ scheduled: {
12
+ statusClass: "scheduled",
13
+ icon: "statusScheduled"
14
+ },
15
+ sent: {
16
+ statusClass: "sent",
17
+ icon: "statusSent"
18
+ },
19
+ denied: {
20
+ statusClass: "denied",
21
+ icon: "statusDenied"
22
+ },
23
+ accepted: {
24
+ statusClass: "accepted",
25
+ icon: "statusAccepted"
26
+ },
27
+ signed: {
28
+ statusClass: "accepted",
29
+ icon: "statusAccepted"
30
+ },
31
+ semiSigned: {
32
+ statusClass: "accepted",
33
+ icon: "statusSemiSigned"
34
+ },
35
+ active: {
36
+ statusClass: "active",
37
+ icon: "statusActive"
38
+ },
39
+ completed: {
40
+ statusClass: "completed",
41
+ icon: "statusCompleted"
42
+ },
43
+ archived: {
44
+ statusClass: "archived",
45
+ icon: "statusArchive"
46
+ }
47
+ }, b = {
48
+ props: {
49
+ status: {
50
+ type: String,
51
+ default: ""
52
+ },
53
+ split: {
54
+ type: String,
55
+ default: ""
56
+ }
57
+ },
58
+ computed: {
59
+ text() {
60
+ return this.status ? v.t(`_common:status.${this.status}`) : "";
61
+ },
62
+ className() {
63
+ const { statusClass: s = "" } = g[this.status] || {};
64
+ return s;
65
+ },
66
+ icon() {
67
+ return $(g, `${this.status}.icon`);
68
+ }
69
+ }
70
+ };
71
+ var S = function() {
72
+ var t = this, e = t._self._c;
73
+ return e("div", { staticClass: "inline-flex items-center h-6 pl-1 pr-2 text-xs font-medium leading-none rounded-full c-badge_status", class: t.className }, [t.icon ? e("BaseIcon", { staticClass: "mr-1 status-icon", attrs: { type: t.icon, size: "16" } }) : t._e(), e("span", [t._v(t._s(t.text))])], 1);
74
+ }, D = [], k = /* @__PURE__ */ m(
75
+ b,
76
+ S,
77
+ D,
78
+ !1,
79
+ null,
80
+ null,
81
+ null,
82
+ null
83
+ );
84
+ const w = k.exports, z = {
3
85
  name: "DynamicLink",
4
86
  props: {
5
87
  template: {
@@ -13,23 +95,23 @@ const $ = {
13
95
  }
14
96
  }
15
97
  };
16
- var v = function() {
98
+ var B = function() {
17
99
  var t = this, e = t._self._c;
18
100
  return e(t.transformed, { tag: "component" });
19
- }, b = [], C = /* @__PURE__ */ p(
20
- $,
21
- v,
22
- b,
101
+ }, I = [], M = /* @__PURE__ */ m(
102
+ z,
103
+ B,
104
+ I,
23
105
  !1,
24
106
  null,
25
107
  null,
26
108
  null,
27
109
  null
28
110
  );
29
- const k = C.exports, S = {
111
+ const T = M.exports, N = {
30
112
  name: "EventItem",
31
113
  components: {
32
- DynamicLink: k
114
+ DynamicLink: T
33
115
  },
34
116
  props: {
35
117
  title: {
@@ -63,7 +145,7 @@ const k = C.exports, S = {
63
145
  color: {
64
146
  type: String,
65
147
  default: "gray",
66
- validator: (n) => ["blue", "teal", "orange", "green", "red", "purple", "gray", "primary"].indexOf(n) !== -1
148
+ validator: (s) => ["blue", "teal", "orange", "green", "red", "purple", "gray", "primary"].indexOf(s) !== -1
67
149
  },
68
150
  isFuture: {
69
151
  type: Boolean,
@@ -76,16 +158,16 @@ const k = C.exports, S = {
76
158
  },
77
159
  computed: {
78
160
  date() {
79
- return g(f(this.createdAt)) ? this.$formatDate(this.createdAt, "Pp") : null;
161
+ return _(f(this.createdAt)) ? this.$formatDate(this.createdAt, "Pp") : null;
80
162
  },
81
163
  dayOfMonth() {
82
- return g(f(this.createdAt)) ? this.$formatDate(this.createdAt, "d") : null;
164
+ return _(f(this.createdAt)) ? this.$formatDate(this.createdAt, "d") : null;
83
165
  },
84
166
  month() {
85
- return g(f(this.createdAt)) ? this.$formatDate(this.createdAt, "MMM") : null;
167
+ return _(f(this.createdAt)) ? this.$formatDate(this.createdAt, "MMM") : null;
86
168
  },
87
169
  iconClasses() {
88
- const n = {
170
+ const s = {
89
171
  blue: "text-blue-600 bg-blue-50",
90
172
  teal: "text-cyan-600 bg-cyan-50",
91
173
  orange: "text-orange-600 bg-orange-50",
@@ -95,7 +177,7 @@ const k = C.exports, S = {
95
177
  gray: "text-gray-500 bg-gray-100",
96
178
  primary: "text-primary-500 bg-primary-50"
97
179
  };
98
- return this.isFuture ? "bg-purple-100 text-purple-500" : n[this.color] || n.gray;
180
+ return this.isFuture ? "bg-purple-100 text-purple-500" : s[this.color] || s.gray;
99
181
  },
100
182
  titleSize() {
101
183
  return this.size === "large" ? "text-base" : "text-sm";
@@ -108,20 +190,20 @@ const k = C.exports, S = {
108
190
  }
109
191
  }
110
192
  };
111
- var D = function() {
193
+ var O = function() {
112
194
  var t = this, e = t._self._c;
113
195
  return e("div", { staticClass: "flex flex-nowrap relative text-primary-500 cursor-default pb-5 ml-4 event before:content-[''] before:absolute before:w-px before:h-full before:bg-gray-300 before:-left-px before:top-4 last:before:hidden" }, [e("div", { staticClass: "m-0 h-[23px] relative", staticStyle: { "--bg": "#fff" } }, [e("div", { staticClass: "rounded-full absolute left-1/2 top-1/2 z-[1] w-7 h-7 flex items-center justify-center border-none bg-gray-100", class: t.iconClasses, staticStyle: { transform: "translate(-50%, calc(-50% + 8px))", "box-shadow": "0 0 0 2px var(--bg)" } }, [t.loading ? t._e() : e("BaseIcon", { attrs: { type: t.icon, size: "14" } })], 1)]), e("div", { staticClass: "ml-7 min-w-0 flex-grow flex flex-col pt-1" }, [t.loading ? [e("CSkeleton", { staticClass: "max-w-md text-gray-900 font-medium", class: t.titleSize, attrs: { width: "80%" } }), e("CSkeleton", { staticClass: "text-gray-600", class: t.textSize, attrs: { width: "40%" } }), e("CSkeleton", { staticClass: "text-center text-gray-500 text-xs inline-flex pt-0.5", class: t.dateSize, attrs: { hidden: "" } })] : t._e(), e("div", { staticClass: "max-w-md font-medium", class: [t.isFuture ? "text-gray-500" : "text-gray-700", t.titleSize] }, [t.template ? e("DynamicLink", { attrs: { template: t.template } }) : [t._v(t._s(t.title))]], 2), t.content ? e("div", { class: [t.isFuture ? "text-gray-400" : "text-gray-600", t.textSize] }, [e("div", { domProps: { innerHTML: t._s(t.content) } })]) : t._e(), e("div", { staticClass: "text-center text-gray-500 inline-flex pt-1", class: t.dateSize }, [e("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: t.date, expression: "date" }] }, [t._v(t._s(t.dayOfMonth) + " " + t._s(t.month))])])], 2)]);
114
- }, w = [], z = /* @__PURE__ */ p(
115
- S,
116
- D,
117
- w,
196
+ }, E = [], A = /* @__PURE__ */ m(
197
+ N,
198
+ O,
199
+ E,
118
200
  !1,
119
201
  null,
120
202
  null,
121
203
  null,
122
204
  null
123
205
  );
124
- const I = z.exports, M = {
206
+ const F = A.exports, q = {
125
207
  sv: {
126
208
  clientName: "Kunden",
127
209
  byName: "Av {{- name}}",
@@ -129,10 +211,8 @@ const I = z.exports, M = {
129
211
  propertyDesignation: "Beg\xE4ran om fastighetsbeteckning",
130
212
  viewed: "Granskat",
131
213
  viewedContent: "{{- name}} har visat dokumentet",
132
- signed: "Signerat",
133
- denied: "Nekat",
134
- accepted: "godk\xE4nt",
135
- statusChanged: "Dokumentet blev",
214
+ statusChangedAccepted: "Dokumentet har blivit signerat",
215
+ statusChangedDenied: "Dokumentet har blivit nekat",
136
216
  requestChange: "Markerades manuellt som",
137
217
  mailOpened: "Mail visat",
138
218
  mailOpenedContent: "{{email}} visat",
@@ -148,10 +228,8 @@ const I = z.exports, M = {
148
228
  propertyDesignation: "Request for property designation",
149
229
  viewed: "Viewed",
150
230
  viewedContent: "{{- name}} has viewed the document",
151
- signed: "Signed",
152
- denied: "denied",
153
- accepted: "accepted",
154
- statusChanged: "Document was",
231
+ statusChangedAccepted: "The document has been signed",
232
+ statusChangedDenied: "The document has been denied",
155
233
  requestChange: "Manually marked as",
156
234
  mailOpened: "Email opened",
157
235
  mailOpenedContent: "{{email}} viewed",
@@ -160,14 +238,15 @@ const I = z.exports, M = {
160
238
  expired: "Expired",
161
239
  expiredContent: "Marked as declined - expiration date has passed"
162
240
  }
163
- }, B = {
241
+ }, R = {
164
242
  name: "DocumentTimeline",
165
243
  i18nOptions: {
166
244
  namespaces: "documentTimeline",
167
- messages: M
245
+ messages: q
168
246
  },
169
247
  components: {
170
- EventItem: I
248
+ StatusBadge: w,
249
+ EventItem: F
171
250
  },
172
251
  props: {
173
252
  id: {
@@ -176,7 +255,7 @@ const I = z.exports, M = {
176
255
  }
177
256
  },
178
257
  computed: {
179
- ...x({
258
+ ...C({
180
259
  docById: "documents2/byId",
181
260
  userById: "companyUsers/byId"
182
261
  }),
@@ -184,18 +263,18 @@ const I = z.exports, M = {
184
263
  return this.docById(this.id);
185
264
  },
186
265
  events() {
187
- var i;
188
- const n = [
266
+ var n;
267
+ const s = [
189
268
  this.formatEvent({
190
269
  code: "created",
191
- createdAt: (i = this.document) == null ? void 0 : i.createdAt
270
+ createdAt: (n = this.document) == null ? void 0 : n.createdAt
192
271
  })
193
272
  ], { events: t, scheduledFirstDelivery: e } = this.document || {};
194
273
  if ((e == null ? void 0 : e.status) === "active") {
195
274
  const r = e.deliveryTypes.join(
196
275
  ` ${this.$t("_common:and")} `
197
276
  );
198
- n.push({
277
+ s.push({
199
278
  title: this.$t("_common:scheduledDelivery"),
200
279
  content: `${this.$t(
201
280
  "_common:via"
@@ -207,20 +286,20 @@ const I = z.exports, M = {
207
286
  color: "primary"
208
287
  });
209
288
  }
210
- return t == null || t.forEach((r) => n.push(this.formatEvent(r))), n;
289
+ return t == null || t.forEach((r) => s.push(this.formatEvent(r))), s;
211
290
  }
212
291
  },
213
292
  methods: {
214
- formatEvent({ code: n, data: t, createdAt: e, children: i = [] }) {
293
+ formatEvent({ code: s, data: t, createdAt: e, children: n = [] }) {
215
294
  const {
216
295
  client: r = {},
217
- clients: u,
296
+ clients: p,
218
297
  email: c,
219
298
  status: d,
220
- counter: _,
299
+ counter: x,
221
300
  sendSource: h,
222
301
  companyUserId: y
223
- } = t || {}, m = _ || i.length + 1, o = r.name;
302
+ } = t || {}, u = x || n.length + 1, o = r.name;
224
303
  return {
225
304
  created: () => ({
226
305
  title: this.$t("_common:created"),
@@ -230,21 +309,21 @@ const I = z.exports, M = {
230
309
  }),
231
310
  viewed: () => ({
232
311
  title: this.$t("viewed"),
233
- content: (o ? this.$t("viewedContent", { name: o }) : "") + (m ? ` ${this.$tc("_common:times", { count: m })}` : ""),
312
+ content: (o ? this.$t("viewedContent", { name: o }) : "") + (u ? ` ${this.$tc("_common:times", { count: u })}` : ""),
234
313
  createdAt: e,
235
314
  icon: "eye",
236
315
  color: "primary"
237
316
  }),
238
317
  accepted: () => {
239
318
  var a;
240
- const s = {
319
+ const i = {
241
320
  title: this.$t("_common:status.signed"),
242
321
  content: o ? this.$t("byName", { name: o }) : "",
243
322
  createdAt: e,
244
323
  icon: "check",
245
324
  color: "primary"
246
325
  };
247
- return s.content && ((a = r.answerMethod) == null ? void 0 : a.accept) === "bankId" && (s.content += ` ${this.$t("withBankId")}`), s;
326
+ return i.content && ((a = r.answerMethod) == null ? void 0 : a.accept) === "bankId" && (i.content += ` ${this.$t("withBankId")}`), i;
248
327
  },
249
328
  denied: () => ({
250
329
  title: this.$t("_common:status.denied"),
@@ -254,12 +333,12 @@ const I = z.exports, M = {
254
333
  color: "primary"
255
334
  }),
256
335
  sent: () => {
257
- let s = this.$t("_common:sent");
258
- return ["reminder", "propertyDesignation"].includes(h) && (s = this.$t("_common:sentThing", {
336
+ let i = this.$t("_common:sent");
337
+ return ["reminder", "propertyDesignation"].includes(h) && (i = this.$t("_common:sentThing", {
259
338
  thing: h === "reminder" ? this.$t("_common:reminder") : this.$t("propertyDesignation")
260
339
  })), {
261
- title: s,
262
- content: u == null ? void 0 : u.map(
340
+ title: i,
341
+ content: p == null ? void 0 : p.map(
263
342
  (a) => ["email", "cellphone"].filter((l) => !!a[l]).map((l) => a[l]).join(` ${this.$t("_common:and")} `)
264
343
  ).reduce(
265
344
  (a, l) => a ? `${a}<div>${l}</div>` : `${this.$t("_common:to")}: ${l}`.capitalize(),
@@ -271,21 +350,19 @@ const I = z.exports, M = {
271
350
  };
272
351
  },
273
352
  statusChanged: () => ["accepted", "denied"].includes(d) ? {
274
- title: `${this.$t("statusChanged")} ${this.$t(
275
- `_common:status.${d}`
276
- )}`,
353
+ title: d === "accepted" ? this.$t("statusChangedAccepted") : this.$t("statusChangedDenied"),
277
354
  createdAt: e,
278
355
  icon: d === "accepted" ? "check" : "x",
279
356
  color: d === "accepted" ? "green" : "red"
280
357
  } : null,
281
358
  requestChange: () => {
282
359
  var a;
283
- const s = ((a = this.userById(y)) == null ? void 0 : a.fullName) || "";
360
+ const i = ((a = this.userById(y)) == null ? void 0 : a.fullName) || "";
284
361
  return {
285
362
  title: `${this.$t("requestChange")} ${this.$t(
286
363
  `_common:status.${d}`
287
364
  )}`,
288
- content: s && this.$t("byName", { name: s }),
365
+ content: i && this.$t("byName", { name: i }),
289
366
  createdAt: e,
290
367
  icon: "tool",
291
368
  color: "primary"
@@ -302,7 +379,7 @@ const I = z.exports, M = {
302
379
  }),
303
380
  mailOpened: () => ({
304
381
  title: this.$t("mailOpened"),
305
- content: `${this.$t("mailOpenedContent", { email: c })} ${m ? this.$tc("_common:times", { count: m }) : ""}`,
382
+ content: `${this.$t("mailOpenedContent", { email: c })} ${u ? this.$tc("_common:times", { count: u }) : ""}`,
306
383
  createdAt: e,
307
384
  icon: "email",
308
385
  color: "primary"
@@ -328,29 +405,29 @@ const I = z.exports, M = {
328
405
  icon: "x",
329
406
  color: "red"
330
407
  })
331
- }[n]();
408
+ }[s]();
332
409
  }
333
410
  }
334
411
  };
335
- var O = function() {
412
+ var L = function() {
336
413
  var t = this, e = t._self._c;
337
- return e("div", [e("div", { staticClass: "border-b mb-4 pb-4" }, [e("div", { staticClass: "mb-2" }, [e("div", { staticClass: "text-xs text-gray-600", domProps: { textContent: t._s(t.$t("_common:document").capitalize()) } }), e("div", { staticClass: "font-semibold text-lg" }, [t._v(t._s(t.document.name))])]), e("div", { staticClass: "inline-flex items-center rounded-full bg-gray-100 border-gray-200 -ml-2" }, [e("div", { staticClass: "text-xs text-gray-600 mr-1 py-1 pl-2", domProps: { textContent: t._s(t.$t("_common:status.status")) } }), e("div", { staticClass: "text-xs font-semibold py-1 px-2 bg-gray-300 rounded-r-full", domProps: { textContent: t._s(t.$t(`_common:status.${t.document.status}`)) } })])]), t._l(t.events, function(i, r) {
338
- return e("EventItem", { key: r, attrs: { title: i.title, content: i.content, createdAt: i.createdAt, icon: i.icon, color: i.color, "is-future": i.isFuture, size: "large" } });
414
+ return e("div", [e("div", { staticClass: "border-b mb-4 pb-4" }, [e("div", { staticClass: "mb-2" }, [e("div", { staticClass: "text-xs text-gray-600", domProps: { textContent: t._s(t.$t("_common:document").capitalize()) } }), e("div", { staticClass: "font-semibold text-lg" }, [t._v(t._s(t.document.name))])]), e("div", { staticClass: "inline-flex items-center -ml-2" }, [e("div", { staticClass: "text-xs text-gray-600 mr-1.5 py-1 pl-2", domProps: { textContent: t._s(t.$t("_common:status.status")) } }), e("StatusBadge", { attrs: { status: t.document.status } })], 1)]), t._l(t.events, function(n, r) {
415
+ return e("EventItem", { key: r, attrs: { title: n.title, content: n.content, createdAt: n.createdAt, icon: n.icon, color: n.color, "is-future": n.isFuture, size: "large" } });
339
416
  })], 2);
340
- }, E = [], N = /* @__PURE__ */ p(
341
- B,
342
- O,
343
- E,
417
+ }, P = [], j = /* @__PURE__ */ m(
418
+ R,
419
+ L,
420
+ P,
344
421
  !1,
345
422
  null,
346
423
  null,
347
424
  null,
348
425
  null
349
426
  );
350
- const T = N.exports, q = {
427
+ const U = j.exports, G = {
351
428
  name: "DocTimeline",
352
429
  components: {
353
- DocumentTimeline: T
430
+ DocumentTimeline: U
354
431
  },
355
432
  props: {
356
433
  id: {
@@ -359,20 +436,20 @@ const T = N.exports, q = {
359
436
  }
360
437
  }
361
438
  };
362
- var F = function() {
439
+ var K = function() {
363
440
  var t = this, e = t._self._c;
364
441
  return e("div", { staticClass: "p-8" }, [e("DocumentTimeline", { attrs: { id: t.id } })], 1);
365
- }, P = [], R = /* @__PURE__ */ p(
366
- q,
367
- F,
368
- P,
442
+ }, V = [], H = /* @__PURE__ */ m(
443
+ G,
444
+ K,
445
+ V,
369
446
  !1,
370
447
  null,
371
448
  null,
372
449
  null,
373
450
  null
374
451
  );
375
- const A = R.exports;
452
+ const W = H.exports;
376
453
  export {
377
- A as default
454
+ W as default
378
455
  };