@cling-se/widget 0.14.3 → 0.14.4

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.
Files changed (134) hide show
  1. package/.eslintrc.cjs +4 -4
  2. package/README.md +40 -40
  3. package/package.json +1 -1
  4. package/tsconfig.json +26 -26
  5. package/tsconfig.node.json +10 -10
  6. package/tsconfig.paths.json +17 -17
  7. package/vite.config.ts +61 -61
  8. package/dist/AddClientCallout-DKH-LP5B.js +0 -46
  9. package/dist/AnswerModal-BCbq8wc4.js +0 -3869
  10. package/dist/AttachmentItem-60CSZnkF.js +0 -78
  11. package/dist/BaseDatePicker-Cl8SnC1k.js +0 -3183
  12. package/dist/BaseUpload-D4FCjlhL.js +0 -1977
  13. package/dist/BlockMedia-CqkwdGnE.js +0 -76
  14. package/dist/CCallout-BTBgU8f-.js +0 -59
  15. package/dist/CCurrencyDropdown-CL32Mo-Y.js +0 -246
  16. package/dist/CDropdownItem-DlWtQwO6.js +0 -538
  17. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
  18. package/dist/CFormField-BxJv-nUO.js +0 -241
  19. package/dist/CPhoneFormat-CJ9kndtJ.js +0 -62
  20. package/dist/CPriceInput-BpXI5X2j.js +0 -112
  21. package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
  22. package/dist/ClientAutocomplete-D9Dj9iBW.js +0 -78
  23. package/dist/ClientModal-JOt8NGcR.js +0 -625
  24. package/dist/ColorPicker-uPKD-Gvm.js +0 -2879
  25. package/dist/CompanyModal-7bG0iIRd.js +0 -141
  26. package/dist/ContentWrapper-B2nyZHL4.js +0 -183
  27. package/dist/CoverBlockSettings-C1O_FAde.js +0 -275
  28. package/dist/DocAnswer-B9G-y4Px.js +0 -36
  29. package/dist/DocDetails-DYHxKChO.js +0 -246
  30. package/dist/DocForm-BktEXjML.js +0 -7273
  31. package/dist/DocFormSend-DM6QgUOj.js +0 -143
  32. package/dist/DocLinks-BIGwfB3H.js +0 -38
  33. package/dist/DocModalBase-D5GdwTI7.js +0 -28
  34. package/dist/DocPrint-HqbaIGms.js +0 -240
  35. package/dist/DocReceipt-WXo6vWyW.js +0 -210
  36. package/dist/DocSendReminder-C8dNEpLg.js +0 -137
  37. package/dist/DocTextEditor-BfOZFDTP.js +0 -17177
  38. package/dist/DocTimeline-CitwS9px.js +0 -481
  39. package/dist/DocumentClient-CQ_z8ajY.js +0 -136
  40. package/dist/DocumentLayout-BA7mFfZh.js +0 -4909
  41. package/dist/DocumentLogotype-woc_hfll.js +0 -87
  42. package/dist/DocumentVoided-DC4FzpxG.js +0 -25
  43. package/dist/EmbedInput-CheqYcNr.js +0 -113
  44. package/dist/EmbedSettings-YcwM8hJw.js +0 -72
  45. package/dist/ErrorCallout-6pCYcx00.js +0 -28
  46. package/dist/FilePreviewModal-T8AiphqO.js +0 -81
  47. package/dist/Flag-Ddm6a4Il.js +0 -114
  48. package/dist/HeaderSettings-DHdZweJH.js +0 -392
  49. package/dist/ImageSelectModal-CAoBhnI8.js +0 -84
  50. package/dist/ImageUploadWrapper-CNv59Lhh.js +0 -1604
  51. package/dist/Index-B6S9U4Z-.js +0 -26
  52. package/dist/Index-BHX0D5fW.js +0 -559
  53. package/dist/Index-BL_7m5Ca.js +0 -70
  54. package/dist/Index-BXMXEUfo.js +0 -223
  55. package/dist/Index-BhVBvMu6.js +0 -32
  56. package/dist/Index-Bl_SNW80.js +0 -25
  57. package/dist/Index-BsguntKl.js +0 -21
  58. package/dist/Index-CGYjPfsf.js +0 -2402
  59. package/dist/Index-CKrGb3of.js +0 -61
  60. package/dist/Index-CMNrQo5a.js +0 -140
  61. package/dist/Index-CU50Al5c.js +0 -642
  62. package/dist/Index-CdqrrZxd.js +0 -77
  63. package/dist/Index-CfnL9dAw.js +0 -58
  64. package/dist/Index-CuW0MYrT.js +0 -171
  65. package/dist/Index-D-z8JSn6.js +0 -154
  66. package/dist/Index-D8giJ_bs.js +0 -84
  67. package/dist/Index-DDvfqy_h.js +0 -24
  68. package/dist/Index-DQDalqZ-.js +0 -107
  69. package/dist/Index-DTIPKKkV.js +0 -150
  70. package/dist/Index-DWxzUBff.js +0 -754
  71. package/dist/Index-DaNGeDQw.js +0 -144
  72. package/dist/Index-DfLU_AyN.js +0 -49
  73. package/dist/Index-DkVav_I7.js +0 -25
  74. package/dist/Index-Dxp8QAtB.js +0 -57
  75. package/dist/Index-DzjxFkcv.js +0 -52
  76. package/dist/Index-EwUJJWaB.js +0 -69
  77. package/dist/Index-I60qAqLl.js +0 -31
  78. package/dist/Index-LfF-7lQK.js +0 -292
  79. package/dist/Index-P0_dyc2V.js +0 -45
  80. package/dist/Index-RQMPSeHw.js +0 -98
  81. package/dist/Index-oipNLl3Y.js +0 -46
  82. package/dist/Index-sJq2Iyvt.js +0 -62
  83. package/dist/Index-uubi3NHX.js +0 -33
  84. package/dist/Index-vNj2kYZT.js +0 -55
  85. package/dist/InputToggleRow-B2pWvVyx.js +0 -57
  86. package/dist/ManualPopover-BI_Sf1zG.js +0 -54
  87. package/dist/MediaWrapper-eFpWxv3n.js +0 -23
  88. package/dist/NotBindingText-DA5NpePz.js +0 -32
  89. package/dist/PackageGroup-DOSijBdN.js +0 -699
  90. package/dist/PdfTerms-Q5YuVtrJ.js +0 -36
  91. package/dist/PdfViewer-zcWl8XZT.js +0 -374
  92. package/dist/PlainHtml-BmA83UAm.js +0 -20
  93. package/dist/PriceHeader-C14L5zgG.js +0 -339
  94. package/dist/SearchApi-CGT7-jVf.js +0 -161
  95. package/dist/Setup-RJQvZlDO.js +0 -50
  96. package/dist/SmartList-YosKRPVn.js +0 -83
  97. package/dist/TermsSettings-C5JTv7rT.js +0 -102
  98. package/dist/ThemeColorRow-D-C_tm2f.js +0 -63
  99. package/dist/ToggleBinding-KEVHHvKf.js +0 -38
  100. package/dist/UploadModal-DOYoWELI.js +0 -95
  101. package/dist/VideoPlayerInput-Dxb6CNk-.js +0 -93
  102. package/dist/VideoPlayerSettings-DsVN4Ix-.js +0 -61
  103. package/dist/VideoSelectModal-BpfzNx61.js +0 -100
  104. package/dist/anime.es-BrPTThYb.js +0 -858
  105. package/dist/answerDocumentMixin-BJMGrfUs.js +0 -51
  106. package/dist/color-TdtKxwVa.js +0 -19
  107. package/dist/debounce-BN83gOVd.js +0 -84
  108. package/dist/dom-CJxkno7i.js +0 -91
  109. package/dist/favicon.ico +0 -0
  110. package/dist/focusDrawerMixin-CawyQaGq.js +0 -22
  111. package/dist/formComponentsInstall-jcnyQ1zw.js +0 -2494
  112. package/dist/formDrawerState-BdNohvZH.js +0 -20
  113. package/dist/formValidationMixin-DOwgebZk.js +0 -49
  114. package/dist/i18nMessages-Chz_lxGG.js +0 -17
  115. package/dist/index-BBJIOkm_.js +0 -347
  116. package/dist/index-BNq9YCWc.js +0 -166
  117. package/dist/index-BdhbkLLU.js +0 -81
  118. package/dist/index-COf8F6CL.js +0 -3916
  119. package/dist/index-D0WvZHX_.js +0 -102
  120. package/dist/index-DTzZP4yq.js +0 -492
  121. package/dist/index.es.js +0 -35
  122. package/dist/index.umd.js +0 -3148
  123. package/dist/main-DE5THsiR.js +0 -56739
  124. package/dist/mapFormMixin-y2txvLw9.js +0 -72
  125. package/dist/omit-BrsWQAtU.js +0 -31
  126. package/dist/publicSenderState-BYsq95Vt.js +0 -21
  127. package/dist/splitpanes-BHUVsCZF.js +0 -382
  128. package/dist/style.css +0 -4
  129. package/dist/throttle-C2srA2wa.js +0 -18
  130. package/dist/tinycolor-SjV_ROuP.js +0 -633
  131. package/dist/tippy.esm-Dj7DQppr.js +0 -1799
  132. package/dist/utils-16HMuRfY.js +0 -108
  133. package/dist/vuedraggable.umd-Cd1g2Hr7.js +0 -3161
  134. package/dist/vuex.esm-DKGl8mcw.js +0 -467
@@ -1,2494 +0,0 @@
1
- import { m } from "./mapFormMixin-y2txvLw9.js";
2
- import { I as L, a as H, r as l } from "./index-COf8F6CL.js";
3
- import { az as v, h as q, n as o, b as c, aA as j, t as K, aB as B, aC as W, q as I, aD as P, f as T, aE as R, J as y } from "./main-DE5THsiR.js";
4
- import { B as M } from "./BaseDatePicker-Cl8SnC1k.js";
5
- import { E as X } from "./ErrorCallout-6pCYcx00.js";
6
- import { s as U, F as Q } from "./Flag-Ddm6a4Il.js";
7
- import { b as Y, m as g } from "./vuex.esm-DKGl8mcw.js";
8
- import G from "./AddClientCallout-DKH-LP5B.js";
9
- import J from "./ClientModal-JOt8NGcR.js";
10
- import { c as Z, r as ee, g as te, C as h, a as f, b as p } from "./CDropdownItem-DlWtQwO6.js";
11
- import "./CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js";
12
- import { C as _ } from "./CCallout-BTBgU8f-.js";
13
- import { a as ie, C as se } from "./CFormField-BxJv-nUO.js";
14
- import { S as ne } from "./SmartList-YosKRPVn.js";
15
- function z(t, e) {
16
- const i = new Date(t.getTime());
17
- return i.setDate(
18
- t.getDate() + (7 + e - t.getDay() - 1) % 7 + 1
19
- ), i.setHours(8, 0, 0, 0), i;
20
- }
21
- function E(t) {
22
- const e = new Date(t.getTime());
23
- return e.setDate(e.getDate() + 1), e.setHours(10, 0, 0, 0), e;
24
- }
25
- let b = E(/* @__PURE__ */ new Date()), C = z(/* @__PURE__ */ new Date(), 1);
26
- const ae = {
27
- name: "DocumentSendLater",
28
- i18nOptions: {
29
- namespaces: "documentSendLater",
30
- messages: {
31
- en: {
32
- title: "Schedule Delivery",
33
- tomorrowMorning: "Tomorrow morning",
34
- mondayMorning: "Monday morning",
35
- custom: {
36
- title: "Set time & date",
37
- invalid: "Time & date can't be in the past"
38
- }
39
- },
40
- sv: {
41
- title: "Skicka med schemaläggning",
42
- tomorrowMorning: "Imorgon förmiddag",
43
- mondayMorning: "Måndag morgon",
44
- custom: {
45
- title: "Välj datum & tid",
46
- invalid: "Välj en tid & datum längre fram i tiden."
47
- }
48
- }
49
- }
50
- },
51
- components: {
52
- BaseDatePicker: M
53
- },
54
- props: {
55
- _document: {
56
- type: Object,
57
- default: () => ({})
58
- },
59
- setFormValue: {
60
- type: Function,
61
- required: !0
62
- },
63
- removeFormValue: {
64
- type: Function,
65
- required: !0
66
- },
67
- onSaveDocument: {
68
- type: Function,
69
- required: !0
70
- }
71
- },
72
- data() {
73
- return {
74
- sendAt: v(/* @__PURE__ */ new Date(), 5).toISOString(),
75
- showCustom: !1,
76
- backupSentFlag: !1
77
- // needed since doc/project flags not instant on double clicks
78
- };
79
- },
80
- validations: {
81
- sendAt: {
82
- minValue: (t) => t > v(/* @__PURE__ */ new Date(), 2).toISOString()
83
- // two minutes as safety
84
- }
85
- },
86
- computed: {
87
- ...Y("forms", {
88
- formData: (t) => t.document2.data
89
- }),
90
- ...g({
91
- deliveryTypes: "forms/deliveryTypes",
92
- isPostingDocument: "documents2/isPosting",
93
- feature: "application/feature"
94
- }),
95
- tomorrowMorning() {
96
- return b.toISOString();
97
- },
98
- mondayMorning() {
99
- return C.toISOString();
100
- },
101
- reminderDeliveryTypes() {
102
- const t = ["email"];
103
- return this.feature("sms") && t.push("sms"), this.deliveryTypes ? [
104
- ...this.deliveryTypes.sms && this.feature("sms") ? ["sms"] : [],
105
- ...this.deliveryTypes.email ? ["email"] : []
106
- ] : t;
107
- }
108
- },
109
- created() {
110
- b = E(/* @__PURE__ */ new Date()), C = z(/* @__PURE__ */ new Date(), 1);
111
- },
112
- methods: {
113
- setTime(t) {
114
- const e = t.split(":"), i = new Date(this.sendAt).setHours(e[0], e[1]);
115
- i && (this.sendAt = new Date(i).toISOString());
116
- },
117
- setDate(t) {
118
- const e = new Date(this.sendAt), i = new Date(t).setHours(e.getHours(), e.getMinutes());
119
- this.sendAt = new Date(i).toISOString();
120
- },
121
- async onSendAt(t) {
122
- try {
123
- if (this.$v.$invalid || this.isPostingDocument || this.backupSentFlag)
124
- return;
125
- this.backupSentFlag = !0;
126
- const e = {
127
- type: "first",
128
- status: "new",
129
- sendDays: 0,
130
- sendAt: t,
131
- deliveryTypes: this.reminderDeliveryTypes,
132
- tries: 0
133
- }, i = this.formData.reminders.findIndex(
134
- (n) => n.type === "first"
135
- ), s = i >= 0 ? `data.reminders[${i}]` : "data.reminders";
136
- this.setFormValue({ key: s, value: e }), await this.onSaveDocument({ doSend: !0 }), this.backupSentFlag = !1;
137
- } catch (e) {
138
- q(e);
139
- } finally {
140
- this.backupSentFlag = !1;
141
- }
142
- }
143
- }
144
- };
145
- var re = function() {
146
- var e = this, i = e._self._c;
147
- return i("div", { staticClass: "overflow-hidden rounded-xl bg-white" }, [i("div", { staticClass: "px-6 pb-3 pt-8" }, [i("div", { staticClass: "text-md text-center font-semibold" }, [e._v(" " + e._s(e.$t("title")) + " ")]), i("div", { staticClass: "pt-8" }, e._l([
148
- [e.tomorrowMorning, "tomorrowMorning"],
149
- [e.mondayMorning, "mondayMorning"]
150
- ], function(s, n) {
151
- return i("div", { key: n, staticClass: "mb-4 flex cursor-pointer select-none items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4 text-sm hover:border-gray-300 hover:bg-gray-100 active:border-gray-400 active:bg-gray-200", on: { click: () => e.onSendAt(s[0]) } }, [i("div", { staticClass: "font-medium" }, [e._v(e._s(e.$t(s[1])))]), i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$formatDate(s[0], "p, d MMM")) + " ")])]);
152
- }), 0)]), i("div", { staticClass: "border-t border-gray-200 bg-gray-100 px-8 py-6", class: e.showCustom ? "" : "cursor-pointer hover:bg-gray-200", on: { click: function(s) {
153
- e.showCustom = !0;
154
- } } }, [i("div", { staticClass: "flex items-center text-sm" }, [i("CIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar", size: "18" } }), i("div", { staticClass: "font-medium", domProps: { textContent: e._s(e.$t("custom.title")) } })], 1), i("Animation", [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.showCustom, expression: "showCustom" }], staticClass: "mt-4" }, [i("div", { staticClass: "grid grid-cols-2 gap-4" }, [i("BaseDatePicker", { attrs: { value: e.sendAt }, on: { input: e.setDate } }), i("CInput", { attrs: { value: e.$formatDate(e.sendAt, "HH:mm"), type: "time" }, on: { input: e.setTime } })], 1), e.$v.$invalid ? i("div", { staticClass: "error-wrapper" }, [i("CIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar" } }), e._v(" " + e._s(e.$t("custom.invalid")) + " ")], 1) : e._e(), i("CButton", { staticStyle: { "margin-top": "calc(1.5 * var(--rem))" }, attrs: { loading: e.isPostingDocument, type: "secondary", wide: "" }, on: { click: function(s) {
155
- return e.onSendAt(e.sendAt);
156
- } } }, [e._v(" " + e._s(e.$t("_common:send")) + " " + e._s(e.$formatDate(e.sendAt, "d MMM - p")) + " ")])], 1)])], 1)]);
157
- }, oe = [], le = /* @__PURE__ */ o(
158
- ae,
159
- re,
160
- oe,
161
- !1,
162
- null,
163
- "dcfae061"
164
- );
165
- const de = le.exports, ce = {
166
- sv: {
167
- title: "Skicka dokument",
168
- nameLabel: "Dokumentnamn",
169
- namePlaceholder: "Namn",
170
- sendAs: "Skicka som",
171
- validityPeriod: "Giltighetstid",
172
- manualDelivery: "Manuell leverans",
173
- manualDeliveryTooltip: "Skicka ut dokument till din mottagare själv. Du kan dela en länk eller en PDF.",
174
- scheduledTooltip: "Schemalägg utskick",
175
- clientsAreMissingContactInfo: "En eller flera mottagare saknar e-post eller mobiltelefon-nr. Dokumentet kommer inte att kunna skickas till dem.",
176
- missingDeliveryMethod: "Välj en eller fler leveransmetoder",
177
- sendButton: "Skicka dokument",
178
- signMethod: {
179
- title: "Signeringsmetod",
180
- tooltip: "Hur ska din mottagare signera?",
181
- button: {
182
- title: "Standard - knapptryck",
183
- content: "Bevisnivå: IP-adress, tidpunkt och enhet."
184
- },
185
- bankId: {
186
- title: "BankId",
187
- content: "Samma säkerhetsgrad som bankerna har."
188
- },
189
- signature: {
190
- title: "Standard",
191
- content: "Bevisnivå: IP-adress, tidpunkt och enhet."
192
- },
193
- inPerson: {
194
- title: "Fysisk underskrift",
195
- content: "Signatur på utskrivet dokument"
196
- }
197
- }
198
- },
199
- en: {
200
- title: "Send document",
201
- nameLabel: "Document name",
202
- namePlaceholder: "Name",
203
- sendAs: "Send as",
204
- validityPeriod: "Expiration",
205
- manualDelivery: "Manual delivery",
206
- manualDeliveryTooltip: "Share the document with your recipient yourself. You can share a link or a PDF.",
207
- scheduledTooltip: "Schedule delivery",
208
- clientsAreMissingContactInfo: "Note that one or more recipients are missing an email or cellphone number. The document will not be sent to them.",
209
- missingDeliveryMethod: "Please select one or more delivery methods",
210
- sendButton: "Send document",
211
- signMethod: {
212
- title: "Signing method",
213
- tooltip: "How do you want your client to sign?",
214
- button: {
215
- title: "Standard - button",
216
- content: "Level of proof: IP address, timestamp and device."
217
- },
218
- bankId: {
219
- title: "BankID",
220
- content: "Same level of proof as the banks use."
221
- },
222
- signature: {
223
- title: "Signature",
224
- content: "Level of proof: IP address, timestamp and device."
225
- },
226
- inPerson: {
227
- title: "In person",
228
- content: "Signature on print document"
229
- }
230
- }
231
- }
232
- }, ue = {
233
- sv: {
234
- addFirstButton: "Lägg till mottagare",
235
- addButton: "Lägg till mottagare",
236
- signOrder: {
237
- label: "Signeringsordning",
238
- tooltip: "Signeringsordning låter dig bestämma i vilken ordning dina mottagare tar emot och signerar dokumentet."
239
- }
240
- },
241
- en: {
242
- addFirstButton: "Add recipient",
243
- addButton: "Add recipient",
244
- signOrder: {
245
- label: "Signing order",
246
- tooltip: "Signing order lets you decide the order in which your recipients receive and sign your documents."
247
- }
248
- }
249
- }, me = {
250
- name: "ClientSendListItem",
251
- props: {
252
- client: {
253
- type: Object,
254
- default: () => ({})
255
- },
256
- isOrder: {
257
- type: Boolean,
258
- default: !1
259
- },
260
- isSender: {
261
- type: Boolean,
262
- default: !1
263
- },
264
- compact: {
265
- type: Boolean,
266
- default: !1
267
- },
268
- allowEditClients: {
269
- type: Boolean,
270
- default: !0
271
- },
272
- rightButton: {
273
- // TODO temporary in order to disable sender sign for widget context
274
- type: Boolean,
275
- default: !0
276
- }
277
- },
278
- data() {
279
- return {
280
- isHover: !1,
281
- isDropdownOpen: !1
282
- };
283
- },
284
- methods: {
285
- onClick() {
286
- var t;
287
- if (this.rightButton && this.isSender)
288
- return (t = this.$refs.dropdown) == null ? void 0 : t.toggle();
289
- this.allowEditClients && this.$emit("open");
290
- }
291
- }
292
- };
293
- var pe = function() {
294
- var s;
295
- var e = this, i = e._self._c;
296
- return i("div", { staticClass: "rc-card flex items-center", class: {
297
- "is-hover": e.isHover,
298
- "has-controls": e.isOrder
299
- }, staticStyle: { "padding-left": "8px" }, on: { click: e.onClick, "&mouseover": function(n) {
300
- e.isHover = !0;
301
- }, "&mouseleave": function(n) {
302
- e.isHover = !1;
303
- } } }, [e.compact ? i("div", { staticStyle: { "font-size": "14px" } }, [i("div", [e._v(e._s(e.client.name || e.client.companyName))]), e.client.name && e.client.companyName ? i("div", { staticStyle: { "font-size": "12px", "font-weight": "500" } }, [e._v(" " + e._s(e.client.companyName) + " ")]) : e._e(), e.client.documentRole ? i("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "13px", "margin-top": "4px" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.isOrder ? i("div", { staticClass: "compact-order" }, [i("CIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-up" }, on: { click: function(n) {
304
- return n.preventDefault(), n.stopPropagation(), e.$emit("move", -1);
305
- } } }), i("div", { staticClass: "rc-order", staticStyle: { width: "20px", height: "20px" } }, [e._v(" " + e._s(e.client.signOrder) + " ")]), i("CIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-down" }, on: { click: function(n) {
306
- return n.preventDefault(), n.stopPropagation(), e.$emit("move", 1);
307
- } } })], 1) : e._e()]) : [i("div", { staticStyle: { width: "34px", flex: "0 0 34px", display: "inline-flex", "justify-content": "center" } }, [e.isOrder ? i("div", { staticStyle: { position: "relative", display: "inline-block" } }, [i("CButton", { staticClass: "rc-order__button up", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "minus" }, on: { click: function(n) {
308
- return n.preventDefault(), n.stopPropagation(), e.$emit("move", -1);
309
- } } }), i("CButton", { staticClass: "rc-order__button down", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "plus" }, on: { click: function(n) {
310
- return n.preventDefault(), n.stopPropagation(), e.$emit("move", 1);
311
- } } }), i("div", { staticClass: "rc-order" }, [e._v(" " + e._s(e.client.signOrder) + " ")])], 1) : i("CIcon", { staticClass: "text-primary-500", staticStyle: { "margin-right": "8px", flex: "0 0 18px" }, attrs: { type: e.isSender ? "send" : ["signee", "approver"].includes(e.client.documentRole) ? "pen-tool" : "eye", size: "18" } })], 1), i("div", { staticClass: "rc-data truncate-text" }, [e.client.name || e.client.companyName ? i("div", { staticStyle: { "font-weight": "500" } }, [e._v(" " + e._s(e.client.name || e.client.companyName) + " ")]) : e.isSender ? i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:empty", { thing: e.$t("_common:reference") })) + " ")]) : i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:missing", { thing: e.$t("_common:name") })) + " ")]), i("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "12px" } }, [e.isSender ? [e.isSender ? i("span", [e._v(" " + e._s(e.$t("_common:documentRole.sender.description")) + " ")]) : e._e(), e.client.documentRole === "signee" ? i("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e()] : [((s = e.client.answerMethod) == null ? void 0 : s.accept) === "inPerson" ? i("span", { staticClass: "text-red-500" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + ": "), i("span", [e._v(" " + e._s(e.$t("_common:signMethod.inPerson")) + " ")])]) : e._e(), e.client.documentRole ? i("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.client.email ? i("span", [e._v(e._s(e.client.email))]) : e._e(), e.client.cellphone ? i("span", [e._v(e._s(e.client.cellphone))]) : e._e()]], 2)])], e.rightButton ? i("transition", { attrs: { name: "fade-100" } }, [e.isHover || e.isDropdownOpen ? [e.isSender ? i("CDropdown", { ref: "dropdown", staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { position: "is-bottom-left", "menu-styling": {
312
- minWidth: "220px"
313
- }, "append-to-body": "" }, on: { "active-change": function(n) {
314
- e.isDropdownOpen = n;
315
- } }, nativeOn: { click: function(n) {
316
- n.stopPropagation();
317
- } } }, [i("CButton", { attrs: { slot: "trigger", circle: "", size: "small", type: "none", pattern: "secondary", raised: "", icon: "more-horizontal" }, slot: "trigger" }), e._t("dropdownOptions")], 2) : e.allowEditClients ? i("CButton", { staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { circle: "", size: "small", icon: "x", type: "none", pattern: "secondary", raised: "" }, on: { click: function(n) {
318
- return n.stopPropagation(), e.$emit("remove");
319
- } } }) : e._e()] : e._e()], 2) : e._e()], 2);
320
- }, he = [], fe = /* @__PURE__ */ o(
321
- me,
322
- pe,
323
- he,
324
- !1,
325
- null,
326
- "47fa5bc0"
327
- );
328
- const N = fe.exports, ge = {
329
- name: "SenderBlockItem",
330
- i18nOptions: {
331
- namespaces: "senderBlockItem",
332
- messages: {
333
- en: {
334
- toggle: {
335
- label: "Sign the document",
336
- description: "Toggle to add your own signature to the document."
337
- }
338
- },
339
- sv: {
340
- toggle: {
341
- label: "Signera dokumentet",
342
- description: "Aktivera för att lägga till din signatur på dokumentet."
343
- }
344
- }
345
- }
346
- },
347
- components: {
348
- RecipientBlockItem: N
349
- },
350
- mixins: [
351
- m(["senderClient"], {
352
- useEmit: !1,
353
- setFnName: "setFormValue"
354
- })
355
- ],
356
- inject: {
357
- allowSenderSign: {
358
- default: !0
359
- }
360
- },
361
- props: {
362
- setFormValue: {
363
- type: Function,
364
- required: !0
365
- },
366
- defaultAddSenderClient: {
367
- type: Boolean,
368
- default: !1
369
- }
370
- },
371
- data() {
372
- return {
373
- senderClientData: null
374
- };
375
- },
376
- computed: {
377
- ...g({
378
- feature: "application/feature"
379
- })
380
- },
381
- created() {
382
- this.generateSenderClient(), this._document.id || this._document.isDirty("senderClient") ? this.toggleSenderSign(!!this.senderClient) : this.defaultAddSenderClient && this.toggleSenderSign(!0);
383
- },
384
- methods: {
385
- get: c,
386
- generateSenderClient() {
387
- const { company: t, user: e } = this._document.sender || {}, i = c(
388
- this._document,
389
- "data.defaultAnswerMethod"
390
- );
391
- this.senderClientData = {
392
- ...j(),
393
- documentRole: "recipient",
394
- ...i && { answerMethod: i },
395
- ...this.senderClient,
396
- // latest sender values in the document
397
- type: "company",
398
- companyName: t.name,
399
- name: e.name,
400
- email: e.email,
401
- cellphone: e.cellphone
402
- };
403
- },
404
- toggleSenderSign(t) {
405
- this.senderClientData.documentRole = t ? "signee" : "recipient", this.senderClient = t ? this.senderClientData : null, this._document.setDirty("senderClient");
406
- },
407
- setSenderMethod(t) {
408
- const e = {
409
- ...this.senderClient,
410
- answerMethod: {
411
- accept: t,
412
- deny: "button"
413
- }
414
- };
415
- this.senderClient = e, this.senderClientData = { ...e };
416
- }
417
- }
418
- };
419
- var ve = function() {
420
- var e = this, i = e._self._c;
421
- return e.senderClientData ? i("RecipientBlockItem", { staticClass: "first-of-group last-of-group", staticStyle: { display: "inline-flex", width: "auto", "padding-right": "2em", "min-width": "220px" }, attrs: { client: e.senderClientData, "right-button": e.allowSenderSign, "is-sender": !0 } }, [i("template", { slot: "dropdownOptions" }, [i("CDropdownItem", { attrs: { value: !!e.senderClient, "close-on-click": !1, toggle: "" }, on: { input: e.toggleSenderSign } }, [e._v(" " + e._s(e.$t("toggle.label")) + " ")]), e.senderClient ? [i("CDropdownItem", { attrs: { separator: "" } }), i("div", { staticClass: "text-gray-400", staticStyle: { "font-size": "13px", padding: "calc(0.5 * var(--rem)) 0 calc(0.25 * var(--rem))", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + " ")]), e._l([
422
- "login",
423
- "signature",
424
- ...e.feature("bankId") ? ["bankId"] : []
425
- ], function(s) {
426
- return i("CDropdownItem", { key: s, attrs: { "icon-right": e.get(e.senderClient, "answerMethod.accept") === s ? "check" : "" }, on: { click: function(n) {
427
- return e.setSenderMethod(s);
428
- } } }, [e._v(" " + e._s(e.$t(`_common:signMethod.${s}`)) + " ")]);
429
- })] : i("div", { staticClass: "bg-gray-100 text-gray-700", staticStyle: { padding: "calc(0.5 * var(--rem))", margin: "calc(0.5 * var(--rem))", "font-size": "13px", "border-radius": "4px", "line-height": "1.25", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("toggle.description")) + " ")])], 2)], 2) : e._e();
430
- }, ye = [], _e = /* @__PURE__ */ o(
431
- ge,
432
- ve,
433
- ye,
434
- !1,
435
- null,
436
- "dad49914"
437
- );
438
- const be = _e.exports, Ce = {
439
- name: "RecipientBlock",
440
- i18nOptions: {
441
- namespaces: "recipientBlock",
442
- messages: ue
443
- },
444
- components: {
445
- AddClientCallout: G,
446
- RecipientBlockItem: N,
447
- SenderBlockItem: be
448
- },
449
- mixins: [
450
- m(["clients"], {
451
- useEmit: !1,
452
- setFnName: "setFormValue"
453
- })
454
- ],
455
- props: {
456
- compact: {
457
- type: Boolean,
458
- default: !1
459
- },
460
- setFormValue: {
461
- type: Function,
462
- required: !0
463
- },
464
- removeFormValue: {
465
- type: Function,
466
- required: !0
467
- },
468
- defaultAddSenderClient: {
469
- type: Boolean,
470
- default: !1
471
- },
472
- allowEditClients: {
473
- type: Boolean,
474
- default: !0
475
- },
476
- isPublicForm: {
477
- type: Boolean,
478
- default: !1
479
- }
480
- },
481
- computed: {
482
- sortedClients() {
483
- return [...this.clients].map((t, e) => ({ ...t, index: e })).sort((t, e) => t.signOrder - e.signOrder);
484
- },
485
- maxSignOrder() {
486
- if (!this.useSignOrder || this.sortedClients.length === 0)
487
- return 0;
488
- const { signOrder: t } = this.sortedClients[this.sortedClients.length - 1];
489
- return t;
490
- },
491
- useSignOrder() {
492
- return c(this._document, "useSignOrder", !1);
493
- }
494
- },
495
- methods: {
496
- onMoveRecipient({ index: t, direction: e }) {
497
- this.clients = K(this.clients).set(
498
- {
499
- ...this.clients[t],
500
- signOrder: Math.max(this.clients[t].signOrder + e, 0)
501
- },
502
- t
503
- );
504
- },
505
- toggleSignOrder(t) {
506
- let e = [];
507
- if (t) {
508
- const i = !this.clients.every(
509
- ({ signOrder: s }) => !s
510
- );
511
- this.clients = this.clients.map((s, n) => ({
512
- ...s,
513
- signOrder: i ? s.signOrder : n + 1
514
- }));
515
- } else
516
- e = c(this._document, "template.reminders", []), e.length || (e = B.default);
517
- this.setFormValue({ key: "data.reminders", value: e }), this.setFormValue({ key: "useSignOrder", value: t });
518
- },
519
- removeClient(t) {
520
- this.removeFormValue(`clients[${t}]`);
521
- },
522
- openClientModal(t = 0) {
523
- var i;
524
- const e = c(this, `clients[${t}].signOrder`);
525
- this.$modal.show(J, {
526
- documentClientIndex: t,
527
- ...this.useSignOrder && {
528
- signOrder: W(e) === "number" ? e : this.maxSignOrder + 1
529
- },
530
- signOptions: (i = this._document) == null ? void 0 : i.signOptions,
531
- setFormValue: this.setFormValue,
532
- removeFormValue: this.removeFormValue,
533
- isPublicForm: this.isPublicForm
534
- });
535
- },
536
- setClient(t) {
537
- this.setFormValue({ key: `clients[${this.clients.length}]`, value: t });
538
- }
539
- }
540
- };
541
- var we = function() {
542
- var e = this, i = e._self._c;
543
- return i("div", [e.compact ? e._e() : [i("div", { staticClass: "pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:from").capitalize()) + ": ")]), i("SenderBlockItem", { attrs: { _document: e._document, _value: { senderClient: "senderClient" }, "set-form-value": e.setFormValue, "default-add-sender-client": e.defaultAddSenderClient } })], i("div", { staticClass: "block-title flex pb-0.5 pt-2 text-xs text-gray-500", class: { "block-title__line": !e.compact } }, [e.compact ? e._e() : i("div", { staticClass: "font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:to").capitalize()) + ": ")]), e.clients && e.clients.length ? i("div", { staticClass: "ml-auto inline-flex items-center justify-end" }, [i("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signOrder.tooltip"), expression: "$t('signOrder.tooltip')" }], staticClass: "mr-1", attrs: { type: "info", size: "14" } }), i("div", { staticClass: "mr-2 font-medium" }, [e._v(" " + e._s(e.$t("signOrder.label")) + " ")]), i("CSwitch", { staticClass: "!mr-0", attrs: { value: e.useSignOrder, size: "tiny", type: "success" }, on: { input: e.toggleSignOrder } })], 1) : e._e()]), e.clients && e.clients.length ? [e.useSignOrder ? i("transition-group", { staticClass: "list-move", attrs: { name: "list-move" } }, [e._l(e.sortedClients, function(s, n) {
544
- return [n > 0 && s.signOrder !== e.sortedClients[n - 1].signOrder ? i("div", { key: n, staticClass: "h-2 pl-6" }, [i("div", { staticClass: "bg-primary-500 h-full w-0.5 rounded-sm" })]) : e._e(), i("div", { key: s._uniqueId, staticClass: "mb-0.5 mt-px" }, [i("RecipientBlockItem", { class: {
545
- "first-of-group": n === 0 || n > 0 && s.signOrder !== e.sortedClients[n - 1].signOrder,
546
- "last-of-group": n === e.sortedClients.length - 1 || e.sortedClients[n + 1] && s.signOrder !== e.sortedClients[n + 1].signOrder
547
- }, attrs: { client: s, "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients }, on: { move: function(a) {
548
- return e.onMoveRecipient({ index: s.index, direction: a });
549
- }, open: function(a) {
550
- return e.openClientModal(s.index);
551
- }, remove: function(a) {
552
- return e.removeClient(s.index);
553
- } } })], 1)];
554
- })], 2) : e._l(e.clients, function(s, n) {
555
- return i("RecipientBlockItem", { key: s._uniqueId, staticClass: "mb-0.5 mt-px", class: {
556
- "first-of-group": n === 0,
557
- "last-of-group": n === e.clients.length - 1
558
- }, attrs: { "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients, client: s }, on: { open: function(a) {
559
- return e.openClientModal(n);
560
- }, remove: function(a) {
561
- return e.removeClient(n);
562
- } } });
563
- }), !e.compact && e.allowEditClients ? i("CButton", { staticClass: "is-thinner !text-sm", attrs: { type: "secondary", pattern: "tertiary", "icon-left": "plus", size: "normal" }, on: { click: function(s) {
564
- return e.openClientModal(e.clients.length);
565
- } } }, [e._v(" " + e._s(e.$t("addButton")) + " ")]) : e._e()] : (e.$view === "widget" || e.viewSettings.isPublicForm) && e.allowEditClients ? i("CButton", { staticClass: "!px-4 font-medium", attrs: { type: "secondary", raised: "", size: "small", taller: "", "icon-left": "person" }, on: { click: function(s) {
566
- return e.openClientModal(e.clients.length);
567
- } } }, [e._v(" " + e._s(e.$t("addFirstButton")) + " ")]) : !e.compact && e.allowEditClients ? i("AddClientCallout", { attrs: { compact: !0 }, on: { add: function(s) {
568
- return e.openClientModal(e.clients.length);
569
- }, setClient: e.setClient } }) : e._e()], 2);
570
- }, xe = [], Se = /* @__PURE__ */ o(
571
- Ce,
572
- we,
573
- xe,
574
- !1,
575
- null,
576
- "51e072f2"
577
- );
578
- const $e = Se.exports, ke = {
579
- name: "DocumentSendReminderItem",
580
- props: {
581
- label: {
582
- type: String,
583
- required: !0
584
- },
585
- value: {
586
- type: [Number, String],
587
- default: 0
588
- },
589
- done: {
590
- type: Boolean,
591
- default: !1
592
- }
593
- }
594
- };
595
- var De = function() {
596
- var e = this, i = e._self._c;
597
- return i("div", { staticClass: "mb-4 flex min-h-[2.5em] select-none items-center rounded-md bg-gray-100 px-4 py-2 text-sm font-medium" }, [i("div", { staticClass: "mr-6 flex-auto select-none text-gray-700" }, [e._v(" " + e._s(e.label) + " ")]), i("div", { staticClass: "flex flex-nowrap items-center justify-center text-sm" }, [e.done ? i("span", { staticClass: "text-green-500" }, [i("CIcon", { attrs: { type: "check", size: "18" } }), e._v(" " + e._s(e.$t("sent")) + " ")], 1) : [i("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "minus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
598
- e.$emit("input", Math.max(e.value - 1, 0));
599
- } } }), i("div", { staticClass: "min-w-[8ch] py-4 text-center text-sm font-medium text-gray-800" }, [e.value ? [e._v(" " + e._s(e.$tc("day", { count: Number(e.value) })) + " ")] : i("span", { staticClass: "text-xs text-gray-500" }, [e._v(" " + e._s(e.$t("disabled").capitalize()) + " ")])], 2), i("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "plus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
600
- return e.$emit("input", e.value + 1);
601
- } } })]], 2)]);
602
- }, Ve = [], Fe = /* @__PURE__ */ o(
603
- ke,
604
- De,
605
- Ve,
606
- !1,
607
- null,
608
- null
609
- );
610
- const Ae = Fe.exports, Oe = {
611
- name: "DocumentSendReminders",
612
- i18nOptions: {
613
- namespaces: "documentSendReminders",
614
- messages: {
615
- en: {
616
- description: "Edit when smart reminders should be sent to client",
617
- notViewed: "Not viewed after",
618
- notAnswered: "No reply after",
619
- expires: "When expiration date is within"
620
- },
621
- sv: {
622
- description: "Ställ in när smarta påminnelser ska skickas ut till mottagaren",
623
- notViewed: "Inte öppnat efter",
624
- notAnswered: "Inte svarat efter",
625
- expires: "När giltighetstiden är inom"
626
- }
627
- }
628
- },
629
- components: {
630
- DocumentSendReminderItem: Ae
631
- },
632
- mixins: [m()],
633
- props: {
634
- setFormValue: {
635
- type: Function,
636
- required: !0
637
- },
638
- removeFormValue: {
639
- type: Function,
640
- required: !0
641
- }
642
- },
643
- computed: {
644
- reminders() {
645
- const t = {
646
- first: null,
647
- notViewed: null,
648
- notAnswered: null,
649
- expires: null
650
- };
651
- return this._document.reminders.forEach((e, i) => {
652
- e.type === "first" ? t.first = { ...e, index: i } : e.type === "viewed" ? t.notViewed = { ...e, index: i } : e.type === "expires" ? t.expires = { ...e, index: i } : t.notAnswered = { ...e, index: i };
653
- }), t;
654
- }
655
- },
656
- methods: {
657
- getDefaultReminders() {
658
- if (!this._document.template)
659
- return [];
660
- const t = this._document.template.getDefaultData({
661
- path: "properties.data.properties.reminders"
662
- });
663
- return t && Array.isArray(t) ? t : [];
664
- },
665
- setReminder(t, e) {
666
- let i = "sendDays";
667
- if (typeof e == "string" && (i = "sendAt"), !e) {
668
- this.removeFormValue(`data.reminders[${t.index}]`);
669
- return;
670
- }
671
- if (typeof t == "string") {
672
- let s = this.getDefaultReminders().find(
673
- (n) => n.type === t
674
- );
675
- if (s || (s = B.default.find((n) => n.type === t)), !s)
676
- throw new Error("Could not find default reminder");
677
- s[i] = e, this.setFormValue({ key: "data.reminders", value: s });
678
- return;
679
- }
680
- this.setFormValue({
681
- key: `data.reminders[${t.index}].${i}`,
682
- value: e
683
- });
684
- }
685
- }
686
- };
687
- var Be = function() {
688
- var e = this, i = e._self._c;
689
- return i("div", { staticStyle: { "background-color": "white", "border-radius": "calc(0.5 * var(--rem))", padding: "calc(2 * var(--rem))", "font-size": "16px" } }, [i("div", { staticStyle: { "font-size": "1.25em", "font-weight": "700", "margin-bottom": "0.25em", "text-align": "center" } }, [e._v(" " + e._s(e.$t("_common:reminder_plural").capitalize()) + " ")]), i("div", { staticClass: "text-center text-gray-600", staticStyle: { "max-width": "calc(20 * var(--rem))", margin: "0 auto calc(2 * var(--rem)) auto" } }, [e._v(" " + e._s(e.$t("description")) + " ")]), e._l([
690
- { type: "notViewed", fallbackKey: "viewed" },
691
- { type: "notAnswered", fallbackKey: "reminder" },
692
- { type: "expires", fallbackKey: "expires" }
693
- ], function(s, n) {
694
- return i("DocumentSendReminderItem", { key: n, attrs: { label: e.$t(s.type), value: e.reminders[s.type] ? e.reminders[s.type].sendDays : 0, done: e.reminders[s.type] && e.reminders[s.type].status === "successful" }, on: { input: function(a) {
695
- return e.setReminder(e.reminders[s.type] || s.fallbackKey, a);
696
- } } });
697
- }), i("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { "margin-top": "calc(2.5 * var(--rem))" } }, [i("CButton", { attrs: { type: "secondary", expanded: "" }, on: { click: function(s) {
698
- return e.$emit("close");
699
- } } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])], 1)], 2);
700
- }, Ie = [], Pe = /* @__PURE__ */ o(
701
- Oe,
702
- Be,
703
- Ie,
704
- !1,
705
- null,
706
- null
707
- );
708
- const Te = Pe.exports, Re = {
709
- name: "SendForm",
710
- i18nOptions: {
711
- namespaces: "sendForm",
712
- messages: ce
713
- },
714
- components: {
715
- Simplebar: U,
716
- BaseDatePicker: M,
717
- RecipientBlock: $e,
718
- ErrorCallout: X,
719
- IsPremiumPreStep: L,
720
- IsPremium: H
721
- },
722
- mixins: [
723
- m(
724
- ["expiresAt", "clients", "defaultAnswerMethod", "reminders", "name"],
725
- {
726
- useEmit: !1,
727
- setFnName: "setFormValue"
728
- }
729
- )
730
- ],
731
- props: {
732
- showName: {
733
- type: Boolean,
734
- default: !0
735
- },
736
- showSave: {
737
- type: Boolean,
738
- default: !0
739
- },
740
- showSchedule: {
741
- type: Boolean,
742
- default: !0
743
- },
744
- allowManualDelivery: {
745
- type: Boolean,
746
- default: !0
747
- },
748
- allowEditClients: {
749
- type: Boolean,
750
- default: !0
751
- },
752
- setFormValue: {
753
- type: Function,
754
- required: !0
755
- },
756
- removeFormValue: {
757
- type: Function,
758
- required: !0
759
- },
760
- useScroll: {
761
- type: Boolean,
762
- default: !1
763
- },
764
- onSaveDocument: {
765
- type: Function,
766
- required: !0
767
- }
768
- },
769
- data() {
770
- return {
771
- localIsPosting: !1,
772
- clientHoverIndex: null
773
- };
774
- },
775
- computed: {
776
- ...g({
777
- deliveryTypes: "forms/deliveryTypes",
778
- isPostingDocument: "documents2/isPosting",
779
- documentSenderSign: "settings/documentSenderSign",
780
- // todo: could be moved to load form action
781
- getCompanySetting: "settings/getCompanySetting",
782
- feature: "application/feature"
783
- }),
784
- isPosting() {
785
- return this.isPostingDocument || this.localIsPosting;
786
- },
787
- isPublicForm() {
788
- return !!(this.viewSettings && this.viewSettings.isPublicForm);
789
- },
790
- useSignOrder() {
791
- var t;
792
- return ((t = this._document) == null ? void 0 : t.useSignOrder) || !1;
793
- },
794
- noOfReminders() {
795
- return Object.values(this.reminders || []).reduce(
796
- (t, e) => e && (e.sendDays || e.sendAt) && e.type !== "first" ? t + 1 : t,
797
- 0
798
- );
799
- },
800
- smsActivated() {
801
- return this.deliveryTypes.sms;
802
- },
803
- emailActivated() {
804
- return this.deliveryTypes.email;
805
- },
806
- isManualDelivery() {
807
- return !this.smsActivated && !this.emailActivated;
808
- },
809
- sendTypesText() {
810
- return this.emailActivated || this.smsActivated ? [
811
- ...this.emailActivated ? [this.$t("_common:email").capitalize()] : [],
812
- ...this.smsActivated ? [this.$t("_common:sms")] : []
813
- ].join(" & ") : this._document.isDirty("isManualDelivery") && this.clients.length ? this.$t("manualDelivery") : " ";
814
- },
815
- clientsAreMissingContactInfo() {
816
- return this.isManualDelivery ? !1 : this.clients.some((t) => !(t.email || t.cellphone));
817
- },
818
- signMethods() {
819
- var t, e;
820
- return ((e = (t = this._document.signOptions) == null ? void 0 : t.filter((i) => i !== "inPerson")) == null ? void 0 : e.map((i) => ({
821
- value: i,
822
- title: this.$t(`signMethod.${i}.title`),
823
- content: this.$t(`signMethod.${i}.content`)
824
- }))) || [];
825
- }
826
- },
827
- created() {
828
- var t;
829
- if (!this.expiresAt && !this._document.isDirty("expiresAt")) {
830
- const e = this.getCompanySetting("defaultExpireDays");
831
- if (e && Number.isInteger(e) && e > 0) {
832
- const i = /* @__PURE__ */ new Date();
833
- i.setDate(i.getDate() + e), this.setField({
834
- field: "expiresAt",
835
- value: i.toISOString(),
836
- options: { ignoreChanges: !0 }
837
- });
838
- }
839
- }
840
- if (((t = this.defaultAnswerMethod) == null ? void 0 : t.accept) === "button") {
841
- const [e] = this._document.signOptions || ["signature"];
842
- this.setAnswerMethod(e, { ignoreChanges: !0 });
843
- }
844
- },
845
- validations() {
846
- const t = {
847
- clients: {
848
- required: (e) => e && e.length
849
- }
850
- };
851
- return !this.allowManualDelivery && this.clients.length && (t.isManualDelivery = {
852
- checked: (e) => !e
853
- }), t;
854
- },
855
- methods: {
856
- async doSaveDocument({ doSend: t }) {
857
- try {
858
- this.localIsPosting = !0, await this.onSaveDocument({ doSend: t });
859
- } finally {
860
- this.localIsPosting = !1;
861
- }
862
- },
863
- async doSendDocument() {
864
- var t;
865
- this.$v.$touch(), !this.$v.$invalid && (["denied", "expired", "voided"].includes((t = this._document) == null ? void 0 : t.status) && this.resetDeniedDocument(), await this.doSaveDocument({ doSend: !0 }));
866
- },
867
- setDeliveryMethod(t, e) {
868
- const i = this.deliveryTypes;
869
- i[t] = e;
870
- const s = Object.keys(i).filter((n) => i[n]);
871
- (this.clients || []).forEach((n, a) => {
872
- this.setFormValue({
873
- key: `clients[${a}].deliveryTypes`,
874
- value: s
875
- });
876
- });
877
- },
878
- setAnswerMethod(t, e = {}) {
879
- this.setField({
880
- field: "defaultAnswerMethod",
881
- value: { ...this.defaultAnswerMethod, accept: t },
882
- options: e
883
- }), (this.clients || []).forEach((i, s) => {
884
- var n;
885
- ((n = i.answerMethod) == null ? void 0 : n.accept) !== "inPerson" && this.setField({
886
- key: `clients[${s}].answerMethod.accept`,
887
- value: t,
888
- options: e
889
- });
890
- });
891
- },
892
- openReminders() {
893
- this.useSignOrder || this.$modal.show(
894
- Te,
895
- {
896
- _document: this._document,
897
- setFormValue: this.setFormValue,
898
- removeFormValue: this.removeFormValue
899
- },
900
- {
901
- adaptive: !0,
902
- height: "auto",
903
- width: "90%",
904
- maxWidth: 360
905
- }
906
- );
907
- },
908
- openSendLater() {
909
- this.$v.$touch(), !this.$v.$invalid && this.$modal.show(
910
- de,
911
- {
912
- _document: this._document,
913
- setFormValue: this.setFormValue,
914
- removeFormValue: this.removeFormValue,
915
- onSaveDocument: this.doSaveDocument
916
- },
917
- {
918
- adaptive: !0,
919
- height: "auto",
920
- width: "90%",
921
- maxWidth: 360
922
- }
923
- );
924
- },
925
- resetDeniedDocument() {
926
- (this.clients || []).forEach((t, e) => {
927
- this.setFormValue({ key: `clients[${e}].answer`, value: null });
928
- }), this.setFormValue({ key: "data.rejectReasons", value: [] }), this.setFormValue({ key: "status", value: "sent" });
929
- },
930
- shouldShowUpgradeModal({ canUseBankId: t, canUseSms: e }) {
931
- var i;
932
- return !!(this.smsActivated && !e || ((i = this.defaultAnswerMethod) == null ? void 0 : i.accept) === "bankId" && !t);
933
- }
934
- }
935
- };
936
- var Me = function() {
937
- var e = this, i = e._self._c;
938
- return i("IsPremium", { scopedSlots: e._u([{ key: "default", fn: function({ canUseBankId: s, canUseSms: n }) {
939
- var a;
940
- return [i("div", { staticClass: "@container flex h-full flex-col" }, [i(e.useScroll ? "Simplebar" : "div", { tag: "component", staticClass: "main-container" }, [i("div", { staticClass: "@md:px-8 @md:pb-8 @xl:px-16 @xl:pb-16 relative px-4 pb-4 pt-6" }, [i("div", { staticClass: "pb-4 text-lg font-bold" }, [e._v(" " + e._s(e.$t("title")) + " ")]), e.showName ? i("div", { staticClass: "mb-6" }, [i("div", { staticClass: "pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("nameLabel")) + " ")]), i("CInput", { attrs: { placeholder: e.$t("namePlaceholder"), filled: "" }, model: { value: e.name, callback: function(r) {
941
- e.name = r;
942
- }, expression: "name" } })], 1) : e._e(), i("div", { staticClass: "mb-6" }, [i("RecipientBlock", { attrs: { _value: {
943
- clients: "clients"
944
- }, _document: e._document, "set-form-value": e.setFormValue, "remove-form-value": e.removeFormValue, "default-add-sender-client": e.documentSenderSign, "allow-edit-clients": e.allowEditClients, "is-public-form": e.isPublicForm } })], 1), e._t("default"), e.defaultAnswerMethod && e.signMethods.length > 1 ? i("div", { staticClass: "mb-8" }, [i("div", { staticClass: "block-title pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("signMethod.title")) + " "), i("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signMethod.tooltip"), expression: "$t('signMethod.tooltip')" }], staticClass: "ml-px text-gray-500", attrs: { type: "info", size: "14" } })], 1), i("div", { staticClass: "cb-card-group" }, e._l(e.signMethods, function(r) {
945
- return i("div", { key: r.value, staticClass: "cb-card flex border-2 border-transparent hover:border-gray-300/30 hover:bg-gray-200", class: {
946
- checked: e.defaultAnswerMethod.accept === r.value
947
- }, on: { click: function(d) {
948
- e.defaultAnswerMethod.accept !== r.value && e.setAnswerMethod(r.value);
949
- } } }, [i("CRadio", { staticClass: "sign-radio pointer-events-none mr-3", attrs: { value: e.defaultAnswerMethod.accept, "native-value": r.value, type: "secondary", size: "small" } }), i("div", { staticClass: "flex-grow" }, [i("div", { staticClass: "cb-card-title flex items-center justify-between" }, [e._v(" " + e._s(r.title) + " "), r.value === "bankId" && !s ? i("div", { staticClass: "bg-primary-500 ml-2 rounded-full px-1.5 py-1 text-[10px] font-semibold leading-none text-white" }, [e._v(" Pro ")]) : e._e()]), i("div", { directives: [{ name: "show", rawName: "v-show", value: e.defaultAnswerMethod.accept === r.value, expression: "defaultAnswerMethod.accept === signMethod.value" }], staticClass: "cb-card-body" }, [e._v(" " + e._s(r.content) + " ")])])], 1);
950
- }), 0)]) : e._e(), i("div", { staticClass: "grid items-center gap-2", staticStyle: { "grid-template-columns": "repeat(auto-fit, minmax(200px, 1fr))" } }, [i("div", [i("BaseDatePicker", { staticClass: "psuedo-input relative", attrs: { "custom-el": !0, direction: "end", tabindex: "0" }, model: { value: e.expiresAt, callback: function(r) {
951
- e.expiresAt = r;
952
- }, expression: "expiresAt" } }, [i("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("validityPeriod")))]), i("div", [e._v(" " + e._s(e.expiresAt ? e.$formatDate(e.expiresAt) : e.$t("_common:disabled").capitalize()) + " ")]), e.expiresAt ? i("CButton", { staticClass: "absolute right-3 top-3 z-10", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(r) {
953
- r.preventDefault(), r.stopPropagation(), e.expiresAt = void 0, e._document.setDirty("expiresAt");
954
- } } }) : e._e()], 1)], 1), i("CDropdown", { staticStyle: { flex: "1 0 200px" }, attrs: { disabled: !e.clients.length, "mobile-label": e.$t("sendAs"), expanded: "" } }, [i("div", { staticClass: "psuedo-input", attrs: { slot: "trigger", tabindex: "0" }, slot: "trigger" }, [i("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("sendAs")))]), i("div", { domProps: { innerHTML: e._s(e.sendTypesText) } })]), i("CDropdownItem", { attrs: { value: e.emailActivated, "close-on-click": !1, toggle: "" }, on: { click: function(r) {
955
- return e.setDeliveryMethod("email", !e.emailActivated);
956
- } } }, [e._v(" " + e._s(e.$t("_common:email").capitalize()) + " ")]), e.feature("sms") ? i("CDropdownItem", { attrs: { value: e.smsActivated, "close-on-click": !1, toggle: "" }, on: { click: function(r) {
957
- return e.setDeliveryMethod("sms", !e.smsActivated);
958
- } } }, [e._v(" " + e._s(e.$t("_common:sms")) + " "), n ? e._e() : i("div", { staticClass: "bg-primary-500 ml-2 rounded-full px-1.5 py-1 text-[10px] font-semibold leading-none text-white" }, [e._v(" Pro ")])]) : e._e(), e.allowManualDelivery ? i("CDropdownItem", { attrs: { value: "", tooltip: {
959
- content: e.$t("manualDeliveryTooltip")
960
- } }, domProps: { textContent: e._s(e.$t("manualDelivery")) }, on: { click: () => {
961
- e.setDeliveryMethod("sms", !1), e.setDeliveryMethod("email", !1), e._document.setDirty("isManualDelivery");
962
- } } }) : e._e()], 1), !e.useSignOrder && !e.isManualDelivery ? i("div", { staticClass: "psuedo-input relative", attrs: { tabindex: "0" }, on: { click: e.openReminders } }, [i("div", { staticClass: "psuedo-input-label" }, [e._v(" " + e._s(e.$t("_common:reminder_plural").capitalize()) + " ")]), i("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 ? i("CButton", { staticClass: "absolute right-3 top-3", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(r) {
963
- r.preventDefault(), r.stopPropagation(), e.reminders = [];
964
- } } }) : e._e()], 1) : e._e()], 1), e.clientsAreMissingContactInfo || (a = e.$v.isManualDelivery) != null && a.$invalid ? i("ErrorCallout", { attrs: { message: e.clientsAreMissingContactInfo ? e.$t("clientsAreMissingContactInfo") : e.$t("missingDeliveryMethod"), size: "small" } }) : e._e(), e._t("content")], 2)]), i("div", { staticClass: "@md:px-8 @xl:px-16 px-4 pb-4" }, [e._t("send", function() {
965
- return [i("IsPremiumPreStep", { attrs: { feature: "bankIdAndSms" }, scopedSlots: e._u([{ key: "default", fn: function({ onClick: r }) {
966
- return [i("div", { staticClass: "flex" }, [e.showSave ? i("CButton", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("_common:save", {
967
- thing: e.$t("_common:document").toLowerCase()
968
- }), expression: `
969
- $t('_common:save', {
970
- thing: $t('_common:document').toLowerCase()
971
- })
972
- ` }], staticClass: "mr-2 w-12", attrs: { loading: e.isPosting, type: "none", icon: "save", pattern: "secondary" }, on: { click: function(d) {
973
- return e.doSaveDocument({ doSend: !1 });
974
- } } }) : e._e(), e.showSchedule && !e.useSignOrder && !e.isManualDelivery ? i("CButton", { staticClass: "@md:w-auto mr-2 w-12", 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 } }, [i("span", { staticClass: "@md:!block !hidden", domProps: { textContent: e._s(e.$t("scheduledTooltip")) } }), i("CIcon", { staticClass: "@md:!hidden", attrs: { type: "calendar", size: "16" } })], 1) : e._e(), i("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$v.$invalid ? {
975
- content: e.clients.length ? e.$t("missingDeliveryMethod") : e.$t(
976
- "components:account.documentForm.clients.errorMessage"
977
- )
978
- } : {}, expression: `
979
- $v.$invalid
980
- ? {
981
- content: !clients.length
982
- ? $t(
983
- 'components:account.documentForm.clients.errorMessage'
984
- )
985
- : $t('missingDeliveryMethod')
986
- }
987
- : {}
988
- ` }], staticClass: "flex-auto" }, [i("CButton", { staticStyle: { padding: "14px 16px", "border-radius": "8px", height: "100%", "font-size": "14px", "font-weight": "600", "box-shadow": "0 2px 4px -1px rgba(0, 0, 0, 0.1)" }, attrs: { disabled: e.$v.$invalid, loading: e.isPosting, type: "secondary", wide: "" }, on: { click: function(d) {
989
- e.shouldShowUpgradeModal({ canUseBankId: s, canUseSms: n }) ? r() : e.doSendDocument();
990
- } } }, [e._v(" " + e._s(e.$t("sendButton")) + " ")])], 1)], 1)];
991
- } }], null, !0) })];
992
- }), e._t("footer")], 2)], 1)];
993
- } }], null, !0) });
994
- }, ze = [], Ee = /* @__PURE__ */ o(
995
- Re,
996
- Me,
997
- ze,
998
- !1,
999
- null,
1000
- "8a4ea99d"
1001
- );
1002
- const ii = Ee.exports, Ne = {
1003
- name: "CAutocomplete",
1004
- components: {
1005
- CInput: I
1006
- },
1007
- mixins: [P],
1008
- inheritAttrs: !1,
1009
- props: {
1010
- value: {
1011
- type: [Number, String],
1012
- default: null
1013
- },
1014
- data: {
1015
- type: Array,
1016
- default: () => []
1017
- },
1018
- field: {
1019
- type: String,
1020
- default: "value"
1021
- },
1022
- keepFirst: Boolean,
1023
- clearOnSelect: Boolean,
1024
- openOnFocus: Boolean,
1025
- customFormatter: {
1026
- type: Function,
1027
- default: () => {
1028
- }
1029
- },
1030
- checkInfiniteScroll: Boolean,
1031
- keepOpen: Boolean,
1032
- clearable: Boolean,
1033
- maxHeight: {
1034
- type: [String, Number],
1035
- default: null
1036
- },
1037
- dropdownPosition: {
1038
- type: String,
1039
- default: "auto"
1040
- },
1041
- iconRight: {
1042
- type: String,
1043
- default: null
1044
- },
1045
- iconRightClickable: Boolean,
1046
- appendToBody: Boolean
1047
- },
1048
- data() {
1049
- return {
1050
- selected: null,
1051
- hovered: null,
1052
- isActive: !1,
1053
- newValue: this.value,
1054
- newAutocomplete: this.autocomplete || "off",
1055
- isListInViewportVertically: !0,
1056
- hasFocus: !1,
1057
- style: {},
1058
- _isAutocomplete: !0,
1059
- _elementRef: "input",
1060
- _bodyEl: void 0
1061
- // Used to append to body
1062
- };
1063
- },
1064
- computed: {
1065
- /**
1066
- * White-listed items to not close when clicked.
1067
- * Add input, dropdown and all children.
1068
- */
1069
- whiteList() {
1070
- const t = [];
1071
- if (t.push(this.$refs.input.$el.querySelector("input")), t.push(this.$refs.dropdown), this.$refs.dropdown !== void 0) {
1072
- const e = this.$refs.dropdown.querySelectorAll("*");
1073
- for (const i of e)
1074
- t.push(i);
1075
- }
1076
- if (this.$parent.$data._isTaginput) {
1077
- t.push(this.$parent.$el);
1078
- const e = this.$parent.$el.querySelectorAll("*");
1079
- for (const i of e)
1080
- t.push(i);
1081
- }
1082
- return t;
1083
- },
1084
- /**
1085
- * Check if exists default slot
1086
- */
1087
- hasDefaultSlot() {
1088
- return !!this.$scopedSlots.default;
1089
- },
1090
- /**
1091
- * Check if exists "empty" slot
1092
- */
1093
- hasEmptySlot() {
1094
- return !!this.$slots.empty;
1095
- },
1096
- /**
1097
- * Check if exists "header" slot
1098
- */
1099
- hasHeaderSlot() {
1100
- return !!this.$slots.header;
1101
- },
1102
- /**
1103
- * Check if exists "footer" slot
1104
- */
1105
- hasFooterSlot() {
1106
- return !!this.$slots.footer;
1107
- },
1108
- /**
1109
- * Apply dropdownPosition property
1110
- */
1111
- isOpenedTop() {
1112
- return this.dropdownPosition === "top" || this.dropdownPosition === "auto" && !this.isListInViewportVertically;
1113
- },
1114
- newIconRight() {
1115
- return this.clearable && this.newValue ? "close-circle" : this.iconRight;
1116
- },
1117
- newIconRightClickable() {
1118
- return this.clearable ? !0 : this.iconRightClickable;
1119
- },
1120
- contentStyle() {
1121
- return {
1122
- maxHeight: this.maxHeight === void 0 ? null : isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`
1123
- };
1124
- },
1125
- isDropdownOpen() {
1126
- return this.isActive && (this.data.length > 0 || this.hasEmptySlot || this.hasHeaderSlot);
1127
- }
1128
- },
1129
- watch: {
1130
- /**
1131
- * When dropdown is toggled, check the visibility to know when
1132
- * to open upwards.
1133
- */
1134
- isActive(t) {
1135
- this.dropdownPosition === "auto" && (t ? this.calcDropdownInViewportVertical() : setTimeout(() => {
1136
- this.calcDropdownInViewportVertical();
1137
- }, 100)), t && this.$nextTick(() => this.setHovered(null));
1138
- },
1139
- /**
1140
- * When updating input's value
1141
- * 1. Emit changes
1142
- * 2. If value isn't the same as selected, set null
1143
- * 3. Close dropdown if value is clear or else open it
1144
- */
1145
- newValue(t) {
1146
- this.$emit("input", t);
1147
- const e = this.getValue(this.selected);
1148
- e && e !== t && this.setSelected(null, !1), this.hasFocus && (!this.openOnFocus || t) && (this.isActive = !!t);
1149
- },
1150
- /**
1151
- * When v-model is changed:
1152
- * 1. Update internal value.
1153
- * 2. If it's invalid, validate again.
1154
- */
1155
- value(t) {
1156
- this.newValue = t;
1157
- },
1158
- /**
1159
- * Select first option if "keep-first
1160
- */
1161
- data(t) {
1162
- this.keepFirst && this.selectFirstOption(t);
1163
- }
1164
- },
1165
- created() {
1166
- typeof window < "u" && (document.addEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.addEventListener("resize", this.calcDropdownInViewportVertical));
1167
- },
1168
- mounted() {
1169
- if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content")) {
1170
- const t = this.$refs.dropdown.querySelector(".dropdown-content");
1171
- t.addEventListener(
1172
- "scroll",
1173
- () => this.checkIfReachedTheEndOfScroll(t)
1174
- );
1175
- }
1176
- this.appendToBody && (this.$data._bodyEl = Z(this.$refs.dropdown), this.updateAppendToBody());
1177
- },
1178
- beforeDestroy() {
1179
- typeof window < "u" && (document.removeEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.removeEventListener(
1180
- "resize",
1181
- this.calcDropdownInViewportVertical
1182
- )), this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content") && this.$refs.dropdown.querySelector(".dropdown-content").removeEventListener("scroll", this.checkIfReachedTheEndOfScroll), this.appendToBody && ee(this.$data._bodyEl);
1183
- },
1184
- methods: {
1185
- /**
1186
- * Set which option is currently hovered.
1187
- */
1188
- setHovered(t) {
1189
- t !== void 0 && (this.hovered = t);
1190
- },
1191
- /**
1192
- * Set which option is currently selected, update v-model,
1193
- * update input value and close dropdown.
1194
- */
1195
- setSelected(t, e = !0) {
1196
- t !== void 0 && (this.selected = t, this.$emit("select", this.selected), this.selected !== null && (this.newValue = this.clearOnSelect ? "" : this.getValue(this.selected), this.setHovered(this.clearOnSelect ? null : this.hovered)), e && this.$nextTick(() => {
1197
- this.isActive = !1;
1198
- }), this.checkValidity());
1199
- },
1200
- /**
1201
- * Select first option
1202
- */
1203
- selectFirstOption(t) {
1204
- this.$nextTick(() => {
1205
- t.length ? (this.openOnFocus || this.newValue !== "" && this.hovered !== t[0]) && this.setHovered(t[0]) : this.setHovered(null);
1206
- });
1207
- },
1208
- /**
1209
- * Enter key listener.
1210
- * Select the hovered option.
1211
- */
1212
- enterPressed(t) {
1213
- this.isDropdownOpen && (t.preventDefault(), this.hovered !== null && this.setSelected(this.hovered, !this.keepOpen));
1214
- },
1215
- /**
1216
- * Tab key listener.
1217
- * Select hovered option if it exists, close dropdown, then allow
1218
- * native handling to move to next tabbable element.
1219
- */
1220
- tabPressed() {
1221
- if (this.hovered === null) {
1222
- this.isActive = !1;
1223
- return;
1224
- }
1225
- this.setSelected(this.hovered, !this.keepOpen);
1226
- },
1227
- /**
1228
- * Close dropdown if clicked outside.
1229
- */
1230
- clickedOutside(t) {
1231
- var i;
1232
- const e = ((i = t.path) == null ? void 0 : i[0]) || t.target;
1233
- this.whiteList.indexOf(e) < 0 && (this.isActive = !1);
1234
- },
1235
- /**
1236
- * Return display text for the input.
1237
- * If object, get value from path, or else just the value.
1238
- */
1239
- getValue(t) {
1240
- if (t !== null)
1241
- return typeof this.customFormatter < "u" ? this.customFormatter(t) : typeof t == "object" ? te(t, this.field) : t;
1242
- },
1243
- /**
1244
- * Check if the scroll list inside the dropdown
1245
- * reached it's end.
1246
- */
1247
- checkIfReachedTheEndOfScroll(t) {
1248
- t.clientHeight !== t.scrollHeight && t.scrollTop + t.clientHeight >= t.scrollHeight && this.$emit("infinite-scroll");
1249
- },
1250
- /**
1251
- * Calculate if the dropdown is vertically visible when activated,
1252
- * otherwise it is openened upwards.
1253
- */
1254
- calcDropdownInViewportVertical() {
1255
- this.$nextTick(() => {
1256
- if (this.$refs.dropdown === void 0)
1257
- return;
1258
- const t = this.$refs.dropdown.getBoundingClientRect();
1259
- this.isListInViewportVertically = t.top >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight), this.appendToBody && this.updateAppendToBody();
1260
- });
1261
- },
1262
- /**
1263
- * Arrows keys listener.
1264
- * If dropdown is active, set hovered option, or else just open.
1265
- */
1266
- keyArrows(t) {
1267
- const e = t === "down" ? 1 : -1;
1268
- if (this.isActive) {
1269
- let i = this.data.indexOf(this.hovered) + e;
1270
- i = i > this.data.length - 1 ? this.data.length : i, i = i < 0 ? 0 : i, this.setHovered(this.data[i]);
1271
- const s = this.$refs.dropdown.querySelector(".dropdown-content"), n = s.querySelectorAll(
1272
- "a.dropdown-item:not(.is-disabled)"
1273
- )[i];
1274
- if (!n)
1275
- return;
1276
- const a = s.scrollTop, r = s.scrollTop + s.clientHeight - n.clientHeight;
1277
- n.offsetTop < a ? s.scrollTop = n.offsetTop : n.offsetTop >= r && (s.scrollTop = n.offsetTop - s.clientHeight + n.clientHeight);
1278
- } else
1279
- this.isActive = !0;
1280
- },
1281
- /**
1282
- * Focus listener.
1283
- * If value is the same as selected, select all text.
1284
- */
1285
- focused(t) {
1286
- this.getValue(this.selected) === this.newValue && this.$el.querySelector("input").select(), this.openOnFocus && (this.isActive = !0, this.keepFirst && this.selectFirstOption(this.data)), this.hasFocus = !0, this.$emit("focus", t);
1287
- },
1288
- /**
1289
- * Blur listener.
1290
- */
1291
- onBlur(t) {
1292
- this.hasFocus = !1, this.$emit("blur", t);
1293
- },
1294
- onInput() {
1295
- const t = this.getValue(this.selected);
1296
- t && t === this.newValue || (this.$emit("typing", this.newValue), this.checkValidity());
1297
- },
1298
- rightIconClick(t) {
1299
- this.clearable ? this.newValue = "" : this.$emit("icon-right-click", t);
1300
- },
1301
- checkValidity() {
1302
- this.useHtml5Validation && this.$nextTick(() => {
1303
- this.checkHtml5Validity();
1304
- });
1305
- },
1306
- updateAppendToBody() {
1307
- const t = this.$refs.dropdown, e = this.$refs.input.$el;
1308
- if (t && e) {
1309
- const i = this.$data._bodyEl;
1310
- i.classList.forEach((r) => i.classList.remove(r)), i.classList.add("autocomplete"), i.classList.add("control"), this.expandend && i.classList.add("is-expandend");
1311
- const s = e.getBoundingClientRect();
1312
- let n = s.top + window.scrollY;
1313
- const a = s.left + window.scrollX;
1314
- this.isOpenedTop ? n -= t.clientHeight : n += e.clientHeight, this.style = {
1315
- position: "absolute",
1316
- top: `${n}px`,
1317
- left: `${a}px`,
1318
- width: `${e.clientWidth}px`,
1319
- maxWidth: `${e.clientWidth}px`,
1320
- zIndex: "99"
1321
- };
1322
- }
1323
- }
1324
- }
1325
- };
1326
- var Le = function() {
1327
- var e = this, i = e._self._c;
1328
- return i("div", { staticClass: "autocomplete control", class: { "is-expanded": e.expanded } }, [i("CInput", e._b({ ref: "input", attrs: { size: e.size, loading: e.loading, rounded: e.rounded, icon: e.icon, "icon-right": e.newIconRight, "icon-right-clickable": e.newIconRightClickable, "icon-pack": e.iconPack, maxlength: e.maxlength, autocomplete: e.newAutocomplete, "use-html5-validation": !1, type: "text" }, on: { input: e.onInput, focus: e.focused, blur: e.onBlur, "icon-right-click": e.rightIconClick, "icon-click": (s) => e.$emit("icon-click", s) }, nativeOn: { keyup: function(s) {
1329
- if (!s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]))
1330
- return null;
1331
- s.preventDefault(), e.isActive = !1;
1332
- }, keydown: [function(s) {
1333
- return !s.type.indexOf("key") && e._k(s.keyCode, "tab", 9, s.key, "Tab") ? null : e.tabPressed.apply(null, arguments);
1334
- }, function(s) {
1335
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.enterPressed.apply(null, arguments);
1336
- }, function(s) {
1337
- return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.keyArrows("up"));
1338
- }, function(s) {
1339
- return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.keyArrows("down"));
1340
- }] }, model: { value: e.newValue, callback: function(s) {
1341
- e.newValue = s;
1342
- }, expression: "newValue" } }, "CInput", e.$attrs, !1)), i("transition", { attrs: { name: "fade" } }, [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.isDropdownOpen, expression: "isDropdownOpen" }], ref: "dropdown", staticClass: "dropdown-menu", class: { "is-opened-top": e.isOpenedTop && !e.appendToBody }, style: e.style }, [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.isActive, expression: "isActive" }], staticClass: "dropdown-content", style: e.contentStyle }, [e.hasHeaderSlot ? i("div", { staticClass: "dropdown-item" }, [e._t("header")], 2) : e._e(), e._l(e.data, function(s, n) {
1343
- return i("a", { key: n, staticClass: "dropdown-item", class: { "is-hovered": s === e.hovered }, on: { click: function(a) {
1344
- return e.setSelected(s, void 0, a);
1345
- } } }, [e.hasDefaultSlot ? e._t("default", null, { option: s, index: n }) : i("span", [e._v(" " + e._s(e.getValue(s, !0)) + " ")])], 2);
1346
- }), e.data.length === 0 && e.hasEmptySlot ? i("div", { staticClass: "dropdown-item is-disabled" }, [e._t("empty")], 2) : e._e(), e.hasFooterSlot ? i("div", { staticClass: "dropdown-item" }, [e._t("footer")], 2) : e._e()], 2)])])], 1);
1347
- }, He = [], qe = /* @__PURE__ */ o(
1348
- Ne,
1349
- Le,
1350
- He,
1351
- !1,
1352
- null,
1353
- null
1354
- );
1355
- const je = qe.exports, Ke = {
1356
- name: "CMessage",
1357
- props: {
1358
- type: {
1359
- type: String,
1360
- default: "secondary"
1361
- },
1362
- badge: {
1363
- type: String,
1364
- default: ""
1365
- },
1366
- text: {
1367
- type: String,
1368
- default: ""
1369
- }
1370
- }
1371
- };
1372
- var We = function(e, i) {
1373
- return e("div", { class: [i.data.class, i.data.staticClass], staticStyle: { padding: "0.75em 1em", display: "flex", "align-items": "flex-start", "border-radius": "0.6em", "background-color": "hsl(var(--gray-color-100) / 1)" }, style: { ...i.data.staticStyle } }, [e("div", { class: [`has-background-${i.props.type}`], staticStyle: { display: "inline-block", padding: "0.5em", "border-radius": "0.45em", "font-weight": "700", color: "white", "line-height": "1", "font-size": "12px", "margin-right": "1.25em" } }, [i._v(" " + i._s(i.props.badge || i.parent.$t("components:cling.message.tip")) + " ")]), e("div", { staticStyle: { color: "hsl(0, 0%, 25%)" } }, [i.props.text ? [i._v(" " + i._s(i.props.text) + " ")] : i._e(), i._t("default")], 2)]);
1374
- }, Xe = [], Ue = /* @__PURE__ */ o(
1375
- Ke,
1376
- We,
1377
- Xe,
1378
- !0,
1379
- null,
1380
- "9be3b227"
1381
- );
1382
- const w = Ue.exports, Qe = {
1383
- name: "CPhoneInput",
1384
- components: {
1385
- Flag: Q,
1386
- CInput: I,
1387
- CDropdown: h,
1388
- CDropdownItem: f,
1389
- CButton: T,
1390
- CField: ie,
1391
- SmartList: ne
1392
- },
1393
- props: {
1394
- value: {
1395
- type: [String, Number],
1396
- default: ""
1397
- },
1398
- region: {
1399
- type: String,
1400
- default: ""
1401
- },
1402
- // Region to fallback to if prefix is not found in value
1403
- defaultRegion: {
1404
- type: String,
1405
- required: !0
1406
- },
1407
- label: {
1408
- type: String,
1409
- default: ""
1410
- },
1411
- labelPosition: {
1412
- type: String,
1413
- default: ""
1414
- }
1415
- },
1416
- data() {
1417
- return {
1418
- internalPrefix: null,
1419
- // Used to remember prefix when value is changed to empty
1420
- searchQuery: ""
1421
- };
1422
- },
1423
- computed: {
1424
- defaultPrefix() {
1425
- return l[this.internalRegion].callingCode;
1426
- },
1427
- currentRegion() {
1428
- return this.getRegionByCallingCode(this.prefix);
1429
- },
1430
- internalRegion: {
1431
- get() {
1432
- if (this.region)
1433
- return this.region;
1434
- if (this.value) {
1435
- const t = (Object.keys(l) || []).find(
1436
- (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
1437
- );
1438
- if (t)
1439
- return t;
1440
- }
1441
- return this.internalPrefix ? this.getRegionByCallingCode(this.internalPrefix) : this.defaultRegion;
1442
- },
1443
- set(t) {
1444
- this.$emit("update:region", t), this.updateValue({ prefix: l[t].callingCode });
1445
- }
1446
- },
1447
- prefix() {
1448
- if (!this.value)
1449
- return this.internalPrefix || this.defaultPrefix;
1450
- const t = (Object.keys(l) || []).find(
1451
- (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
1452
- );
1453
- return t ? l[t].callingCode : this.defaultPrefix;
1454
- },
1455
- phone: {
1456
- get() {
1457
- return this.prefix && this.value && this.value.startsWith(this.prefix) ? this.value.substring(this.prefix.length) : this.value;
1458
- },
1459
- set(t) {
1460
- this.updateValue({ phone: t });
1461
- }
1462
- },
1463
- sortedRegions() {
1464
- return (Object.keys(l) || []).map((t) => ({
1465
- key: t,
1466
- title: `${l[t].name} (${t})`,
1467
- callingCode: l[t].callingCode
1468
- })).sort((t, e) => t.title.localeCompare(e.title));
1469
- }
1470
- },
1471
- methods: {
1472
- getRegionByCallingCode(t) {
1473
- return t ? (Object.keys(l) || []).find(
1474
- (i) => t === l[i].callingCode
1475
- ) : null;
1476
- },
1477
- updateValue({ prefix: t, phone: e }) {
1478
- const i = t !== void 0 ? t : this.prefix || "", s = e !== void 0 ? e : this.phone || "", n = `${i}${s}`;
1479
- n !== i ? (this.$emit("input", n), this.region || this.$emit("update:region", this.internalRegion), this.internalPrefix = null) : (this.internalPrefix = i, this.$emit("input", ""));
1480
- }
1481
- }
1482
- };
1483
- var Ye = function() {
1484
- var e = this, i = e._self._c;
1485
- return i("CField", { staticClass: "has-addons", attrs: { expanded: "" } }, [i("div", { staticClass: "control" }, [i("SmartList", { attrs: { query: e.searchQuery, items: e.sortedRegions }, scopedSlots: e._u([{ key: "default", fn: function({ items: s }) {
1486
- return [i("CDropdown", { staticClass: "control", staticStyle: { height: "100%" }, attrs: { size: e.$attrs.size, disabled: e.$attrs.disabled, "menu-styling": {
1487
- maxWidth: "300px"
1488
- }, scrollable: !0, position: "is-bottom-right", "max-height": "240px" }, model: { value: e.internalRegion, callback: function(n) {
1489
- e.internalRegion = n;
1490
- }, expression: "internalRegion" } }, [i("CButton", { staticStyle: { height: "100%" }, attrs: { slot: "trigger", size: e.$attrs.size, type: "none", pattern: "secondary" }, slot: "trigger" }, [i("Flag", { staticStyle: { "margin-right": "0.35em" }, attrs: { region: e.internalRegion } }), e._v(" " + e._s(e.prefix) + " ")], 1), i("CInput", { staticStyle: { "margin-bottom": "0.25em" }, attrs: { slot: "header", placeholder: e.$t("_common:search"), filled: "" }, slot: "header", model: { value: e.searchQuery, callback: function(n) {
1491
- e.searchQuery = n;
1492
- }, expression: "searchQuery" } }), e._l(s, function({ key: n, title: a, callingCode: r }) {
1493
- return i("CDropdownItem", { key: n, staticClass: "truncate-text", attrs: { value: n } }, [i("Flag", { staticStyle: { "margin-right": "0.75em", flex: "0 0 auto" }, attrs: { region: n, title: a } }), i("span", { staticClass: "truncate-text" }, [e._v(" " + e._s(a) + " (" + e._s(r) + ") ")])], 1);
1494
- })], 2)];
1495
- } }]) })], 1), i("CField", { staticClass: "control", attrs: { label: e.label, "label-position": e.labelPosition, expanded: "" } }, [i("CInput", e._b({ attrs: { size: e.$attrs.size, placeholder: e.$attrs.placeholder, type: "tel" }, model: { value: e.phone, callback: function(s) {
1496
- e.phone = s;
1497
- }, expression: "phone" } }, "CInput", { ...e.$attrs, ...e.$props }, !1))], 1)], 1);
1498
- }, Ge = [], Je = /* @__PURE__ */ o(
1499
- Qe,
1500
- Ye,
1501
- Ge,
1502
- !1,
1503
- null,
1504
- null
1505
- );
1506
- const x = Je.exports, Ze = {
1507
- name: "CRadio",
1508
- mixins: [R]
1509
- };
1510
- var et = function() {
1511
- var e = this, i = e._self._c;
1512
- return i("label", { ref: "label", staticClass: "b-radio radio", class: [`is-${e.size}`, { "is-disabled": e.disabled }], attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
1513
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
1514
- } } }, [i("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, required: e.required, name: e.name, type: "radio" }, domProps: { value: e.nativeValue, checked: e._q(e.computedValue, e.nativeValue) }, on: { click: function(s) {
1515
- s.stopPropagation();
1516
- }, change: function(s) {
1517
- e.computedValue = e.nativeValue;
1518
- } } }), i("span", { staticClass: "check", class: `is-${e.type}` }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
1519
- }, tt = [], it = /* @__PURE__ */ o(
1520
- Ze,
1521
- et,
1522
- tt,
1523
- !1,
1524
- null,
1525
- null
1526
- );
1527
- const S = it.exports, st = {
1528
- name: "CRadioButton",
1529
- components: {
1530
- CButton: T
1531
- },
1532
- mixins: [R],
1533
- props: {
1534
- type: {
1535
- type: String,
1536
- default: "primary"
1537
- },
1538
- expanded: Boolean
1539
- },
1540
- data() {
1541
- return {
1542
- isFocused: !1
1543
- };
1544
- }
1545
- };
1546
- var nt = function() {
1547
- var e = this, i = e._self._c;
1548
- return i("div", { staticClass: "control", class: { "is-expanded": e.expanded } }, [i("CButton", { ref: "label", staticClass: "c-radio radio button", class: [{ "is-disabled": e.disabled, "is-focused": e.isFocused }], attrs: { tag: "label", type: e.newValue === e.nativeValue ? e.type : null, size: e.size, disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
1549
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.$el.label.click());
1550
- } } }, [e._t("default"), i("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, required: e.required, name: e.name, type: "radio" }, domProps: { value: e.nativeValue, checked: e._q(e.computedValue, e.nativeValue) }, on: { click: function(s) {
1551
- s.stopPropagation();
1552
- }, focus: function(s) {
1553
- e.isFocused = !0;
1554
- }, blur: function(s) {
1555
- e.isFocused = !1;
1556
- }, change: function(s) {
1557
- e.computedValue = e.nativeValue;
1558
- } } })], 2)], 1);
1559
- }, at = [], rt = /* @__PURE__ */ o(
1560
- st,
1561
- nt,
1562
- at,
1563
- !1,
1564
- null,
1565
- null
1566
- );
1567
- const $ = rt.exports, ot = {
1568
- name: "CSelect",
1569
- mixins: [P],
1570
- inheritAttrs: !1,
1571
- props: {
1572
- value: {
1573
- type: [String, Number, Boolean, Object, Array, Function],
1574
- default: null
1575
- },
1576
- placeholder: {
1577
- type: String,
1578
- default: ""
1579
- },
1580
- multiple: Boolean,
1581
- selectClass: {
1582
- type: [String, Object, Array],
1583
- default: ""
1584
- },
1585
- nativeSize: {
1586
- type: [String, Number],
1587
- default: null
1588
- }
1589
- },
1590
- data() {
1591
- return {
1592
- selected: this.value,
1593
- _elementRef: "select"
1594
- };
1595
- },
1596
- computed: {
1597
- computedValue: {
1598
- get() {
1599
- return this.selected;
1600
- },
1601
- set(t) {
1602
- this.selected = t, this.$emit("input", t), !this.isValid && this.checkHtml5Validity();
1603
- }
1604
- },
1605
- spanClasses() {
1606
- return [
1607
- this.size,
1608
- this.statusType,
1609
- {
1610
- "is-fullwidth": this.expanded,
1611
- "is-loading": this.loading,
1612
- "is-multiple": this.multiple,
1613
- "is-rounded": this.rounded,
1614
- "is-empty": this.selected === null
1615
- }
1616
- ];
1617
- }
1618
- },
1619
- watch: {
1620
- /**
1621
- * When v-model is changed:
1622
- * 1. Set the selected option.
1623
- * 2. If it's invalid, validate again.
1624
- */
1625
- value(t) {
1626
- this.selected = t, !this.isValid && this.checkHtml5Validity();
1627
- }
1628
- }
1629
- };
1630
- var lt = function() {
1631
- var e = this, i = e._self._c;
1632
- return i("div", { staticClass: "control", class: { "is-expanded": e.expanded, "has-icons-left": e.icon } }, [i("span", { staticClass: "select", class: e.spanClasses }, [i("select", e._b({ directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "select", class: e.selectClass, attrs: { multiple: e.multiple, size: e.nativeSize }, on: { blur: function(s) {
1633
- e.$emit("blur", s) && e.checkHtml5Validity();
1634
- }, focus: function(s) {
1635
- return e.$emit("focus", s);
1636
- }, change: function(s) {
1637
- var n = Array.prototype.filter.call(s.target.options, function(a) {
1638
- return a.selected;
1639
- }).map(function(a) {
1640
- var r = "_value" in a ? a._value : a.value;
1641
- return r;
1642
- });
1643
- e.computedValue = s.target.multiple ? n : n[0];
1644
- } } }, "select", e.$attrs, !1), [e.placeholder && e.computedValue == null ? i("option", { attrs: { disabled: "", hidden: "" }, domProps: { value: null } }, [e._v(" " + e._s(e.placeholder) + " ")]) : e._e(), e._t("default")], 2)])]);
1645
- }, dt = [], ct = /* @__PURE__ */ o(
1646
- ot,
1647
- lt,
1648
- dt,
1649
- !1,
1650
- null,
1651
- "23e48013"
1652
- );
1653
- const k = ct.exports, ut = {
1654
- name: "CSkeleton",
1655
- functional: !0,
1656
- props: {
1657
- active: {
1658
- type: Boolean,
1659
- default: !0
1660
- },
1661
- animated: {
1662
- type: Boolean,
1663
- default: !1
1664
- },
1665
- width: [Number, String],
1666
- height: [Number, String],
1667
- circle: Boolean,
1668
- rounded: {
1669
- type: Boolean,
1670
- default: !0
1671
- },
1672
- count: {
1673
- type: Number,
1674
- default: 1
1675
- },
1676
- hidden: {
1677
- type: [Boolean, String],
1678
- default: !1
1679
- },
1680
- color: {
1681
- type: String,
1682
- default: null
1683
- }
1684
- },
1685
- render(t, e) {
1686
- if (!e.props.active)
1687
- return;
1688
- const i = [], s = e.props.width, n = e.props.height;
1689
- for (let a = 0; a < e.props.count; a++)
1690
- i.push(
1691
- t("div", {
1692
- staticClass: "c-skeleton-item",
1693
- class: { "is-rounded": e.props.rounded },
1694
- key: a,
1695
- style: {
1696
- height: n === void 0 ? null : isNaN(n) ? n : n + "px",
1697
- width: s === void 0 ? null : isNaN(s) ? s : s + "px",
1698
- borderRadius: e.props.circle ? "50%" : null,
1699
- background: e.props.color ? e.props.color : null
1700
- }
1701
- })
1702
- );
1703
- return t(
1704
- "div",
1705
- {
1706
- staticStyle: e.data.staticStyle,
1707
- staticClass: "c-skeleton",
1708
- class: [
1709
- e.data.staticClass,
1710
- {
1711
- "is-animated": e.props.animated,
1712
- "is-invisible": e.props.hidden
1713
- }
1714
- ]
1715
- },
1716
- i
1717
- );
1718
- }
1719
- }, mt = null, pt = null;
1720
- var ht = /* @__PURE__ */ o(
1721
- ut,
1722
- mt,
1723
- pt,
1724
- !1,
1725
- null,
1726
- null
1727
- );
1728
- const D = ht.exports, ft = {
1729
- name: "CSliderThumb",
1730
- inheritAttrs: !1,
1731
- props: {
1732
- value: {
1733
- type: Number,
1734
- default: 0
1735
- },
1736
- type: {
1737
- type: String,
1738
- default: ""
1739
- },
1740
- tooltip: {
1741
- type: Boolean,
1742
- default: !0
1743
- },
1744
- customFormatter: {
1745
- type: Function,
1746
- default: null
1747
- }
1748
- },
1749
- data() {
1750
- return {
1751
- isFocused: !1,
1752
- dragging: !1,
1753
- startX: 0,
1754
- startPosition: 0,
1755
- newPosition: null,
1756
- oldValue: this.value
1757
- };
1758
- },
1759
- computed: {
1760
- disabled() {
1761
- return this.$parent.disabled;
1762
- },
1763
- max() {
1764
- return this.$parent.max;
1765
- },
1766
- min() {
1767
- return this.$parent.min;
1768
- },
1769
- step() {
1770
- return this.$parent.step;
1771
- },
1772
- precision() {
1773
- return this.$parent.precision;
1774
- },
1775
- currentPosition() {
1776
- return `${(this.value - this.min) / (this.max - this.min) * 100}%`;
1777
- },
1778
- wrapperStyle() {
1779
- return { left: this.currentPosition };
1780
- },
1781
- tooltipLabel() {
1782
- return typeof this.customFormatter == "function" ? this.customFormatter(this.value) : this.value.toString();
1783
- }
1784
- },
1785
- methods: {
1786
- onFocus() {
1787
- this.isFocused = !0;
1788
- },
1789
- onBlur() {
1790
- this.isFocused = !1;
1791
- },
1792
- onButtonDown(t) {
1793
- this.disabled || (t.preventDefault(), this.onDragStart(t), typeof window < "u" && (document.addEventListener("mousemove", this.onDragging), document.addEventListener("touchmove", this.onDragging), document.addEventListener("mouseup", this.onDragEnd), document.addEventListener("touchend", this.onDragEnd), document.addEventListener("contextmenu", this.onDragEnd)));
1794
- },
1795
- onLeftKeyDown() {
1796
- this.disabled || this.value === this.min || (this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1797
- },
1798
- onRightKeyDown() {
1799
- this.disabled || this.value === this.max || (this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1800
- },
1801
- onHomeKeyDown() {
1802
- this.disabled || this.value === this.min || (this.newPosition = 0, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1803
- },
1804
- onEndKeyDown() {
1805
- this.disabled || this.value === this.max || (this.newPosition = 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1806
- },
1807
- onDragStart(t) {
1808
- this.dragging = !0, this.$emit("dragstart"), t.type === "touchstart" && (t.clientX = t.touches[0].clientX), this.startX = t.clientX, this.startPosition = parseFloat(this.currentPosition), this.newPosition = this.startPosition;
1809
- },
1810
- onDragging(t) {
1811
- if (this.dragging) {
1812
- t.type === "touchmove" && (t.clientX = t.touches[0].clientX);
1813
- const e = (t.clientX - this.startX) / this.$parent.sliderSize() * 100;
1814
- this.newPosition = this.startPosition + e, this.setPosition(this.newPosition);
1815
- }
1816
- },
1817
- onDragEnd() {
1818
- this.dragging = !1, this.$emit("dragend"), this.value !== this.oldValue && this.$parent.emitValue("change"), this.setPosition(this.newPosition), typeof window < "u" && (document.removeEventListener("mousemove", this.onDragging), document.removeEventListener("touchmove", this.onDragging), document.removeEventListener("mouseup", this.onDragEnd), document.removeEventListener("touchend", this.onDragEnd), document.removeEventListener("contextmenu", this.onDragEnd));
1819
- },
1820
- setPosition(t) {
1821
- if (t === null || isNaN(t))
1822
- return;
1823
- t < 0 ? t = 0 : t > 100 && (t = 100);
1824
- const e = 100 / ((this.max - this.min) / this.step);
1825
- let s = Math.round(t / e) * e / 100 * (this.max - this.min) + this.min;
1826
- s = parseFloat(s.toFixed(this.precision)), this.$emit("input", s), !this.dragging && s !== this.oldValue && (this.oldValue = s);
1827
- }
1828
- }
1829
- };
1830
- var gt = function() {
1831
- var e = this, i = e._self._c;
1832
- return i("div", { staticClass: "c-slider-thumb-wrapper", class: { "is-dragging": e.dragging }, style: e.wrapperStyle }, [i("div", e._b({ staticClass: "c-slider-thumb", attrs: { tabindex: e.disabled ? !1 : 0 }, on: { mousedown: e.onButtonDown, touchstart: e.onButtonDown, focus: e.onFocus, blur: e.onBlur, keydown: [function(s) {
1833
- return !s.type.indexOf("key") && e._k(s.keyCode, "left", 37, s.key, ["Left", "ArrowLeft"]) || "button" in s && s.button !== 0 ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
1834
- }, function(s) {
1835
- return !s.type.indexOf("key") && e._k(s.keyCode, "right", 39, s.key, ["Right", "ArrowRight"]) || "button" in s && s.button !== 2 ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
1836
- }, function(s) {
1837
- return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
1838
- }, function(s) {
1839
- return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
1840
- }, function(s) {
1841
- return !s.type.indexOf("key") && e._k(s.keyCode, "home", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onHomeKeyDown.apply(null, arguments));
1842
- }, function(s) {
1843
- return !s.type.indexOf("key") && e._k(s.keyCode, "end", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onEndKeyDown.apply(null, arguments));
1844
- }] } }, "div", e.$attrs, !1))]);
1845
- }, vt = [], yt = /* @__PURE__ */ o(
1846
- ft,
1847
- gt,
1848
- vt,
1849
- !1,
1850
- null,
1851
- null
1852
- );
1853
- const _t = yt.exports, bt = {
1854
- name: "CSliderTick",
1855
- props: {
1856
- value: {
1857
- type: Number,
1858
- default: 0
1859
- }
1860
- },
1861
- computed: {
1862
- position() {
1863
- const t = (this.value - this.$parent.min) / (this.$parent.max - this.$parent.min) * 100;
1864
- return t >= 0 && t <= 100 ? t : 0;
1865
- },
1866
- hidden() {
1867
- return this.value === this.$parent.min || this.value === this.$parent.max;
1868
- }
1869
- },
1870
- created() {
1871
- if (!this.$parent.$data._isSlider)
1872
- throw this.$destroy(), new Error("You should wrap bSliderTick on a bSlider");
1873
- },
1874
- methods: {
1875
- getTickStyle(t) {
1876
- return { left: `${t}%` };
1877
- }
1878
- }
1879
- };
1880
- var Ct = function() {
1881
- var e = this, i = e._self._c;
1882
- return i("div", { staticClass: "c-slider-tick", class: { "is-tick-hidden": e.hidden }, style: e.getTickStyle(e.position) }, [e.$slots.default ? i("span", { staticClass: "c-slider-tick-label" }, [e._t("default")], 2) : e._e()]);
1883
- }, wt = [], xt = /* @__PURE__ */ o(
1884
- bt,
1885
- Ct,
1886
- wt,
1887
- !1,
1888
- null,
1889
- null
1890
- );
1891
- const St = xt.exports, $t = {
1892
- name: "CSlider",
1893
- components: {
1894
- CSliderThumb: _t,
1895
- CSliderTick: St
1896
- },
1897
- props: {
1898
- value: {
1899
- type: [Number, Array],
1900
- default: 0
1901
- },
1902
- min: {
1903
- type: Number,
1904
- default: 0
1905
- },
1906
- max: {
1907
- type: Number,
1908
- default: 100
1909
- },
1910
- step: {
1911
- type: Number,
1912
- default: 1
1913
- },
1914
- type: {
1915
- type: String,
1916
- default: "primary"
1917
- },
1918
- size: {
1919
- type: String,
1920
- default: ""
1921
- },
1922
- ticks: {
1923
- type: Boolean,
1924
- default: !1
1925
- },
1926
- tooltip: {
1927
- type: Boolean,
1928
- default: !0
1929
- },
1930
- tooltipType: {
1931
- type: String,
1932
- default: ""
1933
- },
1934
- rounded: {
1935
- type: Boolean,
1936
- default: !1
1937
- },
1938
- disabled: {
1939
- type: Boolean,
1940
- default: !1
1941
- },
1942
- lazy: {
1943
- type: Boolean,
1944
- default: !1
1945
- },
1946
- customFormatter: {
1947
- type: Function,
1948
- default: null
1949
- },
1950
- ariaLabel: {
1951
- type: [String, Array],
1952
- default: ""
1953
- },
1954
- biggerSliderFocus: {
1955
- type: Boolean,
1956
- default: !1
1957
- }
1958
- },
1959
- data() {
1960
- return {
1961
- value1: null,
1962
- value2: null,
1963
- dragging: !1,
1964
- isRange: !1,
1965
- _isSlider: !0
1966
- // Used by Thumb and Tick
1967
- };
1968
- },
1969
- computed: {
1970
- newTooltipType() {
1971
- return this.tooltipType ? this.tooltipType : this.type;
1972
- },
1973
- tickValues() {
1974
- if (!this.ticks || this.min > this.max || this.step === 0)
1975
- return [];
1976
- const t = [];
1977
- for (let e = this.min + this.step; e < this.max; e += this.step)
1978
- t.push(e);
1979
- return t;
1980
- },
1981
- minValue() {
1982
- return Math.min(this.value1, this.value2);
1983
- },
1984
- maxValue() {
1985
- return Math.max(this.value1, this.value2);
1986
- },
1987
- barSize() {
1988
- return this.isRange ? `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%` : `${100 * (this.value1 - this.min) / (this.max - this.min)}%`;
1989
- },
1990
- barStart() {
1991
- return this.isRange ? `${100 * (this.minValue - this.min) / (this.max - this.min)}%` : "0%";
1992
- },
1993
- precision() {
1994
- const t = [this.min, this.max, this.step].map((e) => {
1995
- const i = `${e}`.split(".")[1];
1996
- return i ? i.length : 0;
1997
- });
1998
- return Math.max(...t);
1999
- },
2000
- barStyle() {
2001
- return {
2002
- width: this.barSize,
2003
- left: this.barStart
2004
- };
2005
- },
2006
- rootClasses() {
2007
- return {
2008
- "is-rounded": this.rounded,
2009
- "is-dragging": this.dragging,
2010
- "is-disabled": this.disabled,
2011
- "slider-focus": this.biggerSliderFocus
2012
- };
2013
- }
2014
- },
2015
- watch: {
2016
- /**
2017
- * When v-model is changed set the new active step.
2018
- */
2019
- value(t) {
2020
- this.setValues(t);
2021
- },
2022
- value1() {
2023
- this.onInternalValueUpdate();
2024
- },
2025
- value2() {
2026
- this.onInternalValueUpdate();
2027
- },
2028
- min() {
2029
- this.setValues(this.value);
2030
- },
2031
- max() {
2032
- this.setValues(this.value);
2033
- }
2034
- },
2035
- created() {
2036
- this.isThumbReversed = !1, this.isTrackClickDisabled = !1, this.setValues(this.value);
2037
- },
2038
- methods: {
2039
- setValues(t) {
2040
- if (!(this.min > this.max))
2041
- if (Array.isArray(t)) {
2042
- this.isRange = !0;
2043
- const e = typeof t[0] != "number" || isNaN(t[0]) ? this.min : p(t[0], this.min, this.max), i = typeof t[1] != "number" || isNaN(t[1]) ? this.max : p(t[1], this.min, this.max);
2044
- this.value1 = this.isThumbReversed ? i : e, this.value2 = this.isThumbReversed ? e : i;
2045
- } else
2046
- this.isRange = !1, this.value1 = isNaN(t) ? this.min : p(t, this.min, this.max), this.value2 = null;
2047
- },
2048
- onInternalValueUpdate() {
2049
- this.isRange && (this.isThumbReversed = this.value1 > this.value2), (!this.lazy || !this.dragging) && this.emitValue("input"), this.dragging && this.emitValue("dragging");
2050
- },
2051
- sliderSize() {
2052
- return this.$refs.slider.getBoundingClientRect().width;
2053
- },
2054
- onSliderClick(t) {
2055
- if (this.disabled || this.isTrackClickDisabled)
2056
- return;
2057
- const e = this.$refs.slider.getBoundingClientRect().left, i = (t.clientX - e) / this.sliderSize() * 100, s = this.min + i * (this.max - this.min) / 100, n = Math.abs(s - this.value1);
2058
- if (this.isRange) {
2059
- const a = Math.abs(s - this.value2);
2060
- if (n <= a) {
2061
- if (n < this.step / 2)
2062
- return;
2063
- this.$refs.button1.setPosition(i);
2064
- } else {
2065
- if (a < this.step / 2)
2066
- return;
2067
- this.$refs.button2.setPosition(i);
2068
- }
2069
- } else {
2070
- if (n < this.step / 2)
2071
- return;
2072
- this.$refs.button1.setPosition(i);
2073
- }
2074
- this.emitValue("change");
2075
- },
2076
- onDragStart() {
2077
- this.dragging = !0, this.$emit("dragstart");
2078
- },
2079
- onDragEnd() {
2080
- this.isTrackClickDisabled = !0, setTimeout(() => {
2081
- this.isTrackClickDisabled = !1;
2082
- }, 0), this.dragging = !1, this.$emit("dragend"), this.lazy && this.emitValue("input");
2083
- },
2084
- emitValue(t) {
2085
- this.$emit(
2086
- t,
2087
- this.isRange ? [this.minValue, this.maxValue] : this.value1
2088
- );
2089
- }
2090
- }
2091
- };
2092
- var kt = function() {
2093
- var e = this, i = e._self._c;
2094
- return i("div", { staticClass: "c-slider", class: [`is-${e.size}`, `is-${e.type}`, e.rootClasses], on: { click: e.onSliderClick } }, [i("div", { ref: "slider", staticClass: "c-slider-track" }, [i("div", { staticClass: "c-slider-fill", style: e.barStyle }), e.ticks ? e._l(e.tickValues, function(s, n) {
2095
- return i("CSliderTick", { key: n, attrs: { value: s } });
2096
- }) : e._e(), e._t("default"), i("CSliderThumb", { ref: "button1", attrs: { type: `is-${e.newTooltipType}`, tooltip: e.tooltip, "custom-formatter": e.customFormatter, "aria-valuenow": e.value1, "aria-valuemin": e.min, "aria-valuemax": e.max, "aria-label": Array.isArray(e.ariaLabel) ? e.ariaLabel[0] : e.ariaLabel, "aria-disabled": e.disabled, role: "slider", "aria-orientation": "horizontal" }, on: { dragstart: e.onDragStart, dragend: e.onDragEnd }, model: { value: e.value1, callback: function(s) {
2097
- e.value1 = s;
2098
- }, expression: "value1" } }), e.isRange ? i("CSliderThumb", { ref: "button2", attrs: { type: e.newTooltipType, tooltip: e.tooltip, "custom-formatter": e.customFormatter, "aria-valuenow": e.value2, "aria-valuemin": e.min, "aria-valuemax": e.max, "aria-label": Array.isArray(e.ariaLabel) ? e.ariaLabel[1] : "", "aria-disabled": e.disabled, role: "slider", "aria-orientation": "horizontal" }, on: { dragstart: e.onDragStart, dragend: e.onDragEnd }, model: { value: e.value2, callback: function(s) {
2099
- e.value2 = s;
2100
- }, expression: "value2" } }) : e._e()], 2)]);
2101
- }, Dt = [], Vt = /* @__PURE__ */ o(
2102
- $t,
2103
- kt,
2104
- Dt,
2105
- !1,
2106
- null,
2107
- null
2108
- );
2109
- const V = Vt.exports, Ft = {
2110
- name: "CSwitch",
2111
- props: {
2112
- value: {
2113
- type: [String, Number, Boolean, Function, Object, Array, Date],
2114
- default: null
2115
- },
2116
- nativeValue: {
2117
- type: [String, Number, Boolean, Function, Object, Array, Date],
2118
- default: null
2119
- },
2120
- disabled: Boolean,
2121
- type: {
2122
- type: String,
2123
- default: ""
2124
- },
2125
- name: {
2126
- type: String,
2127
- default: ""
2128
- },
2129
- required: Boolean,
2130
- size: {
2131
- type: String,
2132
- default: ""
2133
- },
2134
- trueValue: {
2135
- type: [String, Number, Boolean, Function, Object, Array, Date],
2136
- default: !0
2137
- },
2138
- falseValue: {
2139
- type: [String, Number, Boolean, Function, Object, Array, Date],
2140
- default: !1
2141
- },
2142
- rounded: {
2143
- type: Boolean,
2144
- default: !0
2145
- }
2146
- },
2147
- data() {
2148
- return {
2149
- newValue: this.value
2150
- };
2151
- },
2152
- computed: {
2153
- computedValue: {
2154
- get() {
2155
- return this.newValue;
2156
- },
2157
- set(t) {
2158
- this.newValue = t, this.$emit("input", t);
2159
- }
2160
- },
2161
- newClass() {
2162
- return [
2163
- `is-${this.size}`,
2164
- {
2165
- "is-disabled": this.disabled,
2166
- "is-rounded": this.rounded
2167
- }
2168
- ];
2169
- }
2170
- },
2171
- watch: {
2172
- /**
2173
- * When v-model change, set internal value.
2174
- */
2175
- value(t) {
2176
- this.newValue = t;
2177
- }
2178
- },
2179
- methods: {
2180
- focus() {
2181
- this.$refs.input.focus();
2182
- }
2183
- }
2184
- };
2185
- var At = function() {
2186
- var e = this, i = e._self._c;
2187
- return i("label", { ref: "label", staticClass: "switch", class: e.newClass, attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
2188
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
2189
- } } }, [i("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, name: e.name, required: e.required, "true-value": e.trueValue, "false-value": e.falseValue, type: "checkbox" }, domProps: { value: e.nativeValue, checked: Array.isArray(e.computedValue) ? e._i(e.computedValue, e.nativeValue) > -1 : e._q(e.computedValue, e.trueValue) }, on: { click: function(s) {
2190
- s.stopPropagation();
2191
- }, change: function(s) {
2192
- var n = e.computedValue, a = s.target, r = a.checked ? e.trueValue : e.falseValue;
2193
- if (Array.isArray(n)) {
2194
- var d = e.nativeValue, u = e._i(n, d);
2195
- a.checked ? u < 0 && (e.computedValue = n.concat([d])) : u > -1 && (e.computedValue = n.slice(0, u).concat(n.slice(u + 1)));
2196
- } else
2197
- e.computedValue = r;
2198
- } } }), i("span", { staticClass: "check", class: [`is-${e.type}`] }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
2199
- }, Ot = [], Bt = /* @__PURE__ */ o(
2200
- Ft,
2201
- At,
2202
- Ot,
2203
- !1,
2204
- null,
2205
- "4cdd239d"
2206
- );
2207
- const F = Bt.exports, It = {
2208
- name: "CTabItem",
2209
- props: {
2210
- label: String,
2211
- icon: String,
2212
- iconPack: String,
2213
- disabled: Boolean,
2214
- visible: {
2215
- type: Boolean,
2216
- default: !0
2217
- },
2218
- value: [String, Number]
2219
- },
2220
- data() {
2221
- return {
2222
- isActive: !1,
2223
- transitionName: null,
2224
- _isTabItem: !0
2225
- // Used internally by Tab
2226
- };
2227
- },
2228
- created() {
2229
- if (!this.$parent.$data._isTabs)
2230
- throw this.$destroy(), new Error("You should wrap bTabItem on a bTabs");
2231
- this.$parent.refreshSlots();
2232
- },
2233
- beforeDestroy() {
2234
- this.$parent.refreshSlots();
2235
- },
2236
- methods: {
2237
- /**
2238
- * Activate tab, alter animation name based on the index.
2239
- */
2240
- activate(t, e) {
2241
- this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !0;
2242
- },
2243
- /**
2244
- * Deactivate tab, alter animation name based on the index.
2245
- */
2246
- deactivate(t, e) {
2247
- this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !1;
2248
- }
2249
- },
2250
- render(t) {
2251
- if (this.$parent.destroyOnHide && (!this.isActive || !this.visible))
2252
- return;
2253
- const e = t(
2254
- "div",
2255
- {
2256
- directives: [
2257
- {
2258
- name: "show",
2259
- value: this.isActive && this.visible
2260
- }
2261
- ],
2262
- class: "tab-item"
2263
- },
2264
- this.$slots.default
2265
- );
2266
- return this.$parent.animated ? t(
2267
- "transition",
2268
- {
2269
- props: {
2270
- name: this.transitionName,
2271
- mode: "out-in"
2272
- },
2273
- on: {
2274
- "before-enter": () => {
2275
- this.$parent.isTransitioning = !0;
2276
- },
2277
- "after-enter": () => {
2278
- this.$parent.isTransitioning = !1;
2279
- }
2280
- }
2281
- },
2282
- [e]
2283
- ) : e;
2284
- }
2285
- }, Pt = null, Tt = null;
2286
- var Rt = /* @__PURE__ */ o(
2287
- It,
2288
- Pt,
2289
- Tt,
2290
- !1,
2291
- null,
2292
- null
2293
- );
2294
- const A = Rt.exports, Mt = {
2295
- name: "CSlotComponent",
2296
- props: {
2297
- component: {
2298
- type: Object,
2299
- required: !0
2300
- },
2301
- name: {
2302
- type: String,
2303
- default: "default"
2304
- },
2305
- scoped: {
2306
- type: Boolean
2307
- },
2308
- props: {
2309
- type: Object
2310
- },
2311
- tag: {
2312
- type: String,
2313
- default: "div"
2314
- },
2315
- event: {
2316
- type: String,
2317
- default: "hook:updated"
2318
- }
2319
- },
2320
- methods: {
2321
- refresh() {
2322
- this.$forceUpdate();
2323
- },
2324
- isVueComponent() {
2325
- return this.component && this.component._isVue;
2326
- }
2327
- },
2328
- created() {
2329
- this.isVueComponent() && this.component.$on(this.event, this.refresh);
2330
- },
2331
- beforeDestroy() {
2332
- this.isVueComponent() && this.component.$off(this.event, this.refresh);
2333
- },
2334
- render(t) {
2335
- if (this.isVueComponent())
2336
- return t(
2337
- this.tag,
2338
- {},
2339
- this.scoped ? this.component.$scopedSlots[this.name](this.props) : this.component.$slots[this.name]
2340
- );
2341
- }
2342
- }, zt = {
2343
- name: "CTabs",
2344
- components: {
2345
- CSlotComponent: Mt
2346
- },
2347
- props: {
2348
- value: {
2349
- type: [Number, String],
2350
- default: null
2351
- },
2352
- expanded: Boolean,
2353
- type: {
2354
- type: String,
2355
- default: null
2356
- },
2357
- size: {
2358
- type: String,
2359
- default: null
2360
- },
2361
- position: {
2362
- type: String,
2363
- validator(t) {
2364
- return ["left", "right", "center"].indexOf(t) > -1;
2365
- },
2366
- default: null
2367
- },
2368
- animated: {
2369
- type: Boolean,
2370
- default: !0
2371
- },
2372
- destroyOnHide: {
2373
- type: Boolean,
2374
- default: !1
2375
- },
2376
- vertical: Boolean,
2377
- multiline: Boolean
2378
- },
2379
- data() {
2380
- return {
2381
- activeTab: 0,
2382
- defaultSlots: [],
2383
- contentHeight: 0,
2384
- isTransitioning: !1,
2385
- _isTabs: !0
2386
- // Used internally by TabItem
2387
- };
2388
- },
2389
- computed: {
2390
- mainClasses() {
2391
- return {
2392
- "is-fullwidth": this.expanded,
2393
- "is-vertical": this.vertical,
2394
- "is-multiline": this.multiline,
2395
- [`is-${this.position}`]: this.position && this.vertical
2396
- };
2397
- },
2398
- navClasses() {
2399
- return [
2400
- this.type,
2401
- {
2402
- [`is-${this.size}`]: !!this.size,
2403
- [`is-${this.position}`]: this.position && !this.vertical,
2404
- "is-fullwidth": this.expanded,
2405
- "is-toggle-rounded is-toggle": this.type === "is-toggle-rounded"
2406
- }
2407
- ];
2408
- },
2409
- tabItems() {
2410
- return this.defaultSlots.filter(
2411
- (t) => t.componentInstance && t.componentInstance.$data && t.componentInstance.$data._isTabItem
2412
- ).map((t) => t.componentInstance);
2413
- }
2414
- },
2415
- watch: {
2416
- /**
2417
- * When v-model is changed set the new active tab.
2418
- */
2419
- value(t) {
2420
- const e = this.getIndexByValue(t, t);
2421
- this.changeTab(e);
2422
- },
2423
- /**
2424
- * When tab-items are updated, set active one.
2425
- */
2426
- tabItems() {
2427
- if (this.activeTab < this.tabItems.length) {
2428
- let t = this.activeTab;
2429
- this.tabItems.map((e, i) => {
2430
- e.isActive && (t = i, t < this.tabItems.length && (this.tabItems[t].isActive = !1));
2431
- }), this.tabItems[this.activeTab].isActive = !0;
2432
- } else
2433
- this.activeTab > 0 && this.changeTab(this.activeTab - 1);
2434
- }
2435
- },
2436
- mounted() {
2437
- this.activeTab = this.getIndexByValue(this.value || 0), this.activeTab < this.tabItems.length && (this.tabItems[this.activeTab].isActive = !0), this.refreshSlots();
2438
- },
2439
- methods: {
2440
- /**
2441
- * Change the active tab and emit change event.
2442
- */
2443
- changeTab(t) {
2444
- this.activeTab === t || this.tabItems[t] === void 0 || (this.activeTab < this.tabItems.length && this.tabItems[this.activeTab].deactivate(this.activeTab, t), this.tabItems[t].activate(this.activeTab, t), this.activeTab = t, this.$emit("change", this.getValueByIndex(t)));
2445
- },
2446
- /**
2447
- * Tab click listener, emit input event and change active tab.
2448
- */
2449
- tabClick(t) {
2450
- this.activeTab !== t && (this.$emit("input", this.getValueByIndex(t)), this.changeTab(t));
2451
- },
2452
- refreshSlots() {
2453
- this.defaultSlots = this.$slots.default || [];
2454
- },
2455
- getIndexByValue(t) {
2456
- const e = this.tabItems.map(
2457
- (i) => i.$options.propsData ? i.$options.propsData.value : void 0
2458
- ).indexOf(t);
2459
- return e >= 0 ? e : t;
2460
- },
2461
- getValueByIndex(t) {
2462
- const { propsData: e } = this.tabItems[t].$options;
2463
- return e && e.value ? e.value : t;
2464
- }
2465
- }
2466
- };
2467
- var Et = function() {
2468
- var e = this, i = e._self._c;
2469
- return i("div", { staticClass: "c-tabs", class: e.mainClasses }, [i("nav", { staticClass: "tabs", class: e.navClasses }, [i("ul", e._l(e.tabItems, function(s, n) {
2470
- return i("li", { directives: [{ name: "show", rawName: "v-show", value: s.visible, expression: "tabItem.visible" }], key: n, class: {
2471
- "is-active": e.activeTab === n,
2472
- "is-disabled": s.disabled
2473
- } }, [s.$slots.header ? i("CSlotComponent", { attrs: { component: s, name: "header", tag: "a" }, nativeOn: { click: function(a) {
2474
- return e.tabClick(n);
2475
- } } }) : i("a", { on: { click: function(a) {
2476
- return e.tabClick(n);
2477
- } } }, [s.icon ? i("CIcon", { attrs: { size: e.size, type: s.icon } }) : e._e(), i("span", [e._v(e._s(s.label))])], 1)], 1);
2478
- }), 0)]), i("section", { staticClass: "tab-content", class: { "is-transitioning": e.isTransitioning } }, [e._t("default")], 2)]);
2479
- }, Nt = [], Lt = /* @__PURE__ */ o(
2480
- zt,
2481
- Et,
2482
- Nt,
2483
- !1,
2484
- null,
2485
- "e02a6440"
2486
- );
2487
- const O = Lt.exports;
2488
- function si(t) {
2489
- t.component(D.name, D), t.component("CAutocomplete", je), t.component(y.name, y), t.component(S.name, S), t.component($.name, $), t.component(h.name, h), t.component(f.name, f), t.component(k.name, k), t.component(_.name, _), t.component(F.name, F), t.component(O.name, O), t.component(A.name, A), t.component("CField", se), t.component(w.name, w), t.component(x.name, x), t.component(V.name, V);
2490
- }
2491
- export {
2492
- ii as S,
2493
- si as i
2494
- };