@cling-se/widget 0.15.2 → 0.15.5

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 (137) hide show
  1. package/README.md +43 -43
  2. package/dist/{AddClientCallout-CSxN7XFh.js → AddClientCallout-CrZF5j7A.js} +15 -13
  3. package/dist/{AnswerModal-DEwMlsT8.js → AnswerModal-C3r9vyki.js} +71 -71
  4. package/dist/{AttachmentItem-R7YMKqQ2.js → AttachmentItem-BVXrxCnv.js} +20 -13
  5. package/dist/{BaseDatePicker-Bd1maWgF.js → BaseDatePicker-DxL2l3QC.js} +561 -557
  6. package/dist/{BaseUpload-C9Jd1JBo.js → BaseUpload-B7259IaQ.js} +3 -3
  7. package/dist/{BlockMedia-CUCZYVdZ.js → BlockMedia-BSKtZMwa.js} +2 -2
  8. package/dist/{CCallout-_k7FPbsE.js → CCallout-BNvM6gNJ.js} +4 -5
  9. package/dist/{CCurrencyDropdown-DejfeYVY.js → CCurrencyDropdown-xmqmb8gW.js} +24 -20
  10. package/dist/{CDropdownItem-b6ZzOnv-.js → CDropdownItem-DiLisSei.js} +139 -37
  11. package/dist/{CFormField-BjGICSv5.js → CFormField-DcZVdj3a.js} +3 -4
  12. package/dist/{CPhoneFormat-Bf2fgYtr.js → CPhoneFormat-BeYxRN0i.js} +1 -1
  13. package/dist/CPhoneInput-UzZkxbC6.js +138 -0
  14. package/dist/{CPriceInput-myrETXfz.js → CPriceInput-C2y_3PM7.js} +20 -16
  15. package/dist/CSelect-BmP1UsQA.js +91 -0
  16. package/dist/CSkeleton-BNbft-NE.js +55 -0
  17. package/dist/ClientAutocomplete-BnredOme.js +438 -0
  18. package/dist/{ClientModal-DSmFJ9bu.js → ClientModal-DNcf4APF.js} +92 -51
  19. package/dist/{ColorPicker-B1MJicqo.js → ColorPicker-BupC4jvI.js} +2 -2
  20. package/dist/{CompanyModal-BXs3aAYm.js → CompanyModal-Bh8mEHE1.js} +25 -19
  21. package/dist/{ContentWrapper-BKWZy4Bp.js → ContentWrapper-Bs3nrJda.js} +63 -55
  22. package/dist/CoverBlockSettings-WYZsCdky.js +659 -0
  23. package/dist/{DocAnswer-CaoTYUNh.js → DocAnswer--FfsnnTB.js} +2 -2
  24. package/dist/{DocDetails-C9EEpNg2.js → DocDetails-Ce7bj-qO.js} +43 -39
  25. package/dist/{DocForm-Dww8Ust9.js → DocForm-FR_Vlq_C.js} +801 -755
  26. package/dist/{DocFormSend-DKAqaT50.js → DocFormSend-DcSv3JNg.js} +18 -15
  27. package/dist/{DocLinks-DFUO03dk.js → DocLinks-Bvhc62aJ.js} +2 -2
  28. package/dist/{DocModalBase-QZosNhiK.js → DocModalBase-DkfUBRi3.js} +2 -2
  29. package/dist/{DocPrint--T278pDE.js → DocPrint-BrKY6rOy.js} +3 -3
  30. package/dist/{DocReceipt-CPg45_I7.js → DocReceipt-oGrM6t_k.js} +29 -22
  31. package/dist/{DocSendReminder-DQAaiUrs.js → DocSendReminder-veEC_yHK.js} +19 -16
  32. package/dist/{DocTextEditor-CM1f8eMD.js → DocTextEditor-CNRwxPEx.js} +72 -70
  33. package/dist/{DocTimeline-Ce0OZgGP.js → DocTimeline-e2Xf_QZ7.js} +38 -34
  34. package/dist/{DocumentClient-DHU-Rg3r.js → DocumentClient-Dx4Uyxkh.js} +5 -5
  35. package/dist/{DocumentLayout-GYCBw2F_.js → DocumentLayout-DmjmsTcx.js} +1506 -1538
  36. package/dist/{DocumentLogotype-Cilc0ElE.js → DocumentLogotype-ddYHM9wn.js} +25 -20
  37. package/dist/{DocumentVoided-BH8pkv85.js → DocumentVoided-WCk7XuxH.js} +1 -1
  38. package/dist/{EmbedInput-lMSVQSey.js → EmbedInput-CMueXdFs.js} +25 -21
  39. package/dist/{EmbedSettings-D65Y2AZL.js → EmbedSettings-BRuLCWr0.js} +13 -11
  40. package/dist/{ErrorCallout-BBNHzuhf.js → ErrorCallout-CDtZceLU.js} +6 -6
  41. package/dist/{FilePreviewModal-iPIuaIor.js → FilePreviewModal-BzAUuY58.js} +3 -3
  42. package/dist/Flag-DkJgyDQK.js +46 -0
  43. package/dist/{HeaderSettings-WKUIBCfF.js → HeaderSettings-CoKK5Mbt.js} +159 -110
  44. package/dist/{ImageSelectModal-BTMFM3o9.js → ImageSelectModal-De64vGSr.js} +15 -13
  45. package/dist/{ImageUploadWrapper-BaLjUZF5.js → ImageUploadWrapper-CE6KTze0.js} +3 -3
  46. package/dist/{Index-DS1PwlDq.js → Index-50KxppUS.js} +4 -4
  47. package/dist/{Index-DJeZiYxr.js → Index-B7vVIRFn.js} +7 -7
  48. package/dist/{Index-ivhPuQy5.js → Index-BUQ75xOU.js} +6 -6
  49. package/dist/{Index-BUEXgHEE.js → Index-BVKCCkQY.js} +57 -50
  50. package/dist/{Index-BBTn35Kj.js → Index-BiGT3iEX.js} +21 -17
  51. package/dist/{Index-B-UWz1IM.js → Index-BoDKKVvL.js} +4 -4
  52. package/dist/{Index-DrSgVUyo.js → Index-BotY9nbP.js} +2 -2
  53. package/dist/{Index-B-YqdbQX.js → Index-BwaJW9CY.js} +3 -3
  54. package/dist/{Index-BepvyGqo.js → Index-ByqCyUgx.js} +9 -9
  55. package/dist/{Index-Bsv15ctO.js → Index-C7pge7E9.js} +23 -21
  56. package/dist/{Index-CEaZgZqg.js → Index-CBRJ-AZi.js} +2 -2
  57. package/dist/{Index-GrrsUUz1.js → Index-CFQMtx5w.js} +5 -5
  58. package/dist/{Index-CtQo0b8t.js → Index-CJKyHWiO.js} +15 -15
  59. package/dist/{Index-Dv1fkHWQ.js → Index-CK_5l1kP.js} +2 -2
  60. package/dist/{Index-BVt3pj58.js → Index-CLc_11Bc.js} +276 -232
  61. package/dist/{Index-cPIqnY80.js → Index-CTokKHJA.js} +5 -5
  62. package/dist/Index-Cf45UGbc.js +28 -0
  63. package/dist/{Index-B51tj7qY.js → Index-CfLPq-yA.js} +5 -5
  64. package/dist/{Index-B_ta4yT_.js → Index-Ci7y3O0G.js} +7 -7
  65. package/dist/{Index-ZKkQzVOj.js → Index-CmV8oF4Q.js} +4 -4
  66. package/dist/{Index-C6tGNKAk.js → Index-CoRuYEYW.js} +5 -5
  67. package/dist/Index-CtKNyVUB.js +56 -0
  68. package/dist/{Index-rL3fz1Ew.js → Index-DCf6_Zd2.js} +2 -2
  69. package/dist/{Index-CEHhYmLe.js → Index-DGdlZzVO.js} +7 -7
  70. package/dist/{Index-B5XaBVyJ.js → Index-DbKB8sTh.js} +18 -12
  71. package/dist/{Index-9PMrT3eB.js → Index-DgBOq2MJ.js} +3 -3
  72. package/dist/{Index-BBOJRRgx.js → Index-DvNxOHHu.js} +6 -6
  73. package/dist/{Index-DS7xellB.js → Index-M2Mce2_m.js} +124 -123
  74. package/dist/{Index-2PGn8Pnv.js → Index-QMkjG7hk.js} +4 -4
  75. package/dist/{Index-oKRUWCcJ.js → Index-QmX5pv-V.js} +17 -15
  76. package/dist/{Index-0aZtDWyk.js → Index-h5xDFYM9.js} +4 -4
  77. package/dist/{Index-CtZMlBfK.js → Index-hkGYloih.js} +5 -5
  78. package/dist/{Index-DK3b6Cv-.js → Index-q3gLm4b1.js} +6 -6
  79. package/dist/{Index-BQ3kapHk.js → Index-sqI1TF7Z.js} +2 -2
  80. package/dist/{InputToggleRow-CJF0vwk3.js → InputToggleRow-DLFIMIdx.js} +2 -2
  81. package/dist/{ManualPopover-CEF7LMpn.js → ManualPopover-Cf8DotlW.js} +13 -11
  82. package/dist/{MediaWrapper-CM6vWCoZ.js → MediaWrapper-BgWmA3kS.js} +3 -3
  83. package/dist/{NotBindingText-Cee9yA0M.js → NotBindingText-DhsHxvkX.js} +2 -2
  84. package/dist/{PackageGroup-CFXogKPM.js → PackageGroup-EbOSxv69.js} +26 -20
  85. package/dist/PdfTerms-im6uTd5E.js +31 -0
  86. package/dist/{PdfViewer-Cd0Jm2VB.js → PdfViewer-DY0rcZjo.js} +22 -22
  87. package/dist/{PlainHtml-CucWAcOU.js → PlainHtml-o031pfp-.js} +1 -1
  88. package/dist/{PriceHeader-DdMZUaq5.js → PriceHeader-NdFa0Sqs.js} +15 -15
  89. package/dist/{SearchApi-knNqVduO.js → SearchApi-Bw5E9IPj.js} +2 -2
  90. package/dist/SendForm-BDY5VDkS.js +1023 -0
  91. package/dist/{Setup-7HIAWuiK.js → Setup-BsYqPmOm.js} +1 -1
  92. package/dist/{SmartList-cSmGbybV.js → SmartList-CP2wHig-.js} +1 -1
  93. package/dist/{TermsSettings-CAB-08E3.js → TermsSettings-CUlSayCJ.js} +20 -13
  94. package/dist/{ThemeColorRow-DxcMvBGq.js → ThemeColorRow-D3fav4Sl.js} +14 -12
  95. package/dist/ToggleBinding-B715OVl2.js +42 -0
  96. package/dist/{UploadModal-CvoSMExA.js → UploadModal-THDJ-UNp.js} +6 -6
  97. package/dist/{VideoPlayerInput-X5baUH3q.js → VideoPlayerInput-Cm3KoRnR.js} +15 -11
  98. package/dist/{VideoPlayerSettings-DsIvpufB.js → VideoPlayerSettings-BFAjczuw.js} +3 -3
  99. package/dist/VideoSelectModal-CzO8EMg9.js +104 -0
  100. package/dist/{answerDocumentMixin-B8HB1WAX.js → answerDocumentMixin-D12xJRhx.js} +3 -3
  101. package/dist/{debounce-B2lqFJg2.js → debounce-DLiv1sQX.js} +16 -16
  102. package/dist/{focusDrawerMixin-B2djM7ql.js → focusDrawerMixin-khaScuSu.js} +1 -1
  103. package/dist/{formDrawerState-CchCpZRc.js → formDrawerState-CJ6kjaD_.js} +1 -1
  104. package/dist/{formValidationMixin-Dz9Mabvi.js → formValidationMixin-Bri1WflH.js} +1 -1
  105. package/dist/{index-Dk6sZCYv.js → index-B0Zu30kF.js} +2 -2
  106. package/dist/{index-twnaU4rC.js → index-C1Ngv-v3.js} +1 -1
  107. package/dist/{index-BCrDgR_4.js → index-CMT3coT-.js} +785 -2001
  108. package/dist/{index-H1Kx9sJM.js → index-DJOUQneq.js} +42 -38
  109. package/dist/{index-BaGtbWcA.js → index-DLa3QER7.js} +18 -17
  110. package/dist/{index-kV9OZ5y0.js → index-Dygy9XlG.js} +1 -1
  111. package/dist/index.es.js +10 -10
  112. package/dist/index.umd.js +179 -175
  113. package/dist/{main-CerYX9PA.js → main-U22_wtg0.js} +13008 -11358
  114. package/dist/{mapFormMixin-Hj1Y7rVt.js → mapFormMixin-BZf4RJIE.js} +1 -1
  115. package/dist/omit-RBXmF_Fo.js +31 -0
  116. package/dist/{publicSenderState-t7Gu53cA.js → publicSenderState-DKuvxj4_.js} +1 -1
  117. package/dist/regions-BdZt9Srn.js +1250 -0
  118. package/dist/simplebar.min-Bnrne5ZK.js +71 -0
  119. package/dist/style.css +2 -2
  120. package/dist/{throttle-B8hI9bkk.js → throttle-Fkuqk26x.js} +2 -2
  121. package/dist/{tinycolor-BaK26Ky-.js → tinycolor-BZ8wGctU.js} +1 -1
  122. package/dist/{tippy.esm-BuWRbveV.js → tippy.esm-BJe845c1.js} +246 -240
  123. package/dist/{utils-Pmm0DT8o.js → utils-BOWVR87A.js} +1 -1
  124. package/dist/{vuedraggable.umd-Besz6Tlv.js → vuedraggable.umd-CJL8TWxZ.js} +1 -1
  125. package/package.json +2 -11
  126. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
  127. package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
  128. package/dist/ClientAutocomplete-DyXQEfcS.js +0 -78
  129. package/dist/CoverBlockSettings-7Ivt9zN0.js +0 -275
  130. package/dist/Flag-CwnrA4SV.js +0 -114
  131. package/dist/Index-B0pgh8nR.js +0 -21
  132. package/dist/Index-Ccx9wHcb.js +0 -52
  133. package/dist/PdfTerms-ChtDfzne.js +0 -36
  134. package/dist/ToggleBinding-CTTYdrkp.js +0 -38
  135. package/dist/VideoSelectModal-VMcSU3bM.js +0 -100
  136. package/dist/formComponentsInstall-CdjgjI6y.js +0 -2495
  137. package/dist/omit-DGBewD2h.js +0 -31
@@ -1,2495 +0,0 @@
1
- import { m as p } from "./mapFormMixin-Hj1Y7rVt.js";
2
- import { I as L, a as H, r as l } from "./index-BCrDgR_4.js";
3
- import { aD as y, h as q, n as o, b as c, aE as j, t as K, aF as B, aG as W, q as I, aH as T, F as X, X as U, T as m, ai as Q, f as P, aI as M, K as _ } from "./main-CerYX9PA.js";
4
- import { B as R } from "./BaseDatePicker-Bd1maWgF.js";
5
- import { E as Y } from "./ErrorCallout-BBNHzuhf.js";
6
- import { s as G, F as J } from "./Flag-CwnrA4SV.js";
7
- import { b as Z, m as v } from "./vuex.esm-DKGl8mcw.js";
8
- import ee from "./AddClientCallout-CSxN7XFh.js";
9
- import te from "./ClientModal-DSmFJ9bu.js";
10
- import { c as ie, r as se, g as ne, C as f, a as g, b as h } from "./CDropdownItem-b6ZzOnv-.js";
11
- import "./CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js";
12
- import { C as b } from "./CCallout-_k7FPbsE.js";
13
- import { a as ae, C as re } from "./CFormField-BjGICSv5.js";
14
- import { S as oe } from "./SmartList-cSmGbybV.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 C = E(/* @__PURE__ */ new Date()), w = z(/* @__PURE__ */ new Date(), 1);
26
- const le = {
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: R
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: y(/* @__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 > y(/* @__PURE__ */ new Date(), 2).toISOString()
83
- // two minutes as safety
84
- }
85
- },
86
- computed: {
87
- ...Z("forms", {
88
- formData: (t) => t.document2.data
89
- }),
90
- ...v({
91
- deliveryTypes: "forms/deliveryTypes",
92
- isPostingDocument: "documents2/isPosting",
93
- feature: "application/feature"
94
- }),
95
- tomorrowMorning() {
96
- return C.toISOString();
97
- },
98
- mondayMorning() {
99
- return w.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
- C = E(/* @__PURE__ */ new Date()), w = 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 de = 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
- }, ce = [], ue = /* @__PURE__ */ o(
158
- le,
159
- de,
160
- ce,
161
- !1,
162
- null,
163
- "dcfae061"
164
- );
165
- const me = ue.exports, pe = {
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
- }, he = {
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
- }, fe = {
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 ge = 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
- }, ve = [], ye = /* @__PURE__ */ o(
321
- fe,
322
- ge,
323
- ve,
324
- !1,
325
- null,
326
- "47fa5bc0"
327
- );
328
- const N = ye.exports, _e = {
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
- p(["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
- ...v({
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 be = 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
- }, Ce = [], we = /* @__PURE__ */ o(
431
- _e,
432
- be,
433
- Ce,
434
- !1,
435
- null,
436
- "dad49914"
437
- );
438
- const xe = we.exports, Se = {
439
- name: "RecipientBlock",
440
- i18nOptions: {
441
- namespaces: "recipientBlock",
442
- messages: he
443
- },
444
- components: {
445
- AddClientCallout: ee,
446
- RecipientBlockItem: N,
447
- SenderBlockItem: xe
448
- },
449
- mixins: [
450
- p(["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(te, {
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 $e = 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
- }, ke = [], De = /* @__PURE__ */ o(
571
- Se,
572
- $e,
573
- ke,
574
- !1,
575
- null,
576
- "51e072f2"
577
- );
578
- const Ve = De.exports, Fe = {
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 Ae = 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
- }, Oe = [], Be = /* @__PURE__ */ o(
603
- Fe,
604
- Ae,
605
- Oe,
606
- !1,
607
- null,
608
- null
609
- );
610
- const Ie = Be.exports, Te = {
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: Ie
631
- },
632
- mixins: [p()],
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 Pe = 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
- }, Me = [], Re = /* @__PURE__ */ o(
701
- Te,
702
- Pe,
703
- Me,
704
- !1,
705
- null,
706
- null
707
- );
708
- const ze = Re.exports, Ee = {
709
- name: "SendForm",
710
- i18nOptions: {
711
- namespaces: "sendForm",
712
- messages: pe
713
- },
714
- components: {
715
- Simplebar: G,
716
- BaseDatePicker: R,
717
- RecipientBlock: Ve,
718
- ErrorCallout: Y,
719
- IsPremiumPreStep: L,
720
- IsPremium: H
721
- },
722
- mixins: [
723
- p(
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
- ...v({
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
- ze,
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
- me,
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 Ne = 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({
990
- data: {
991
- bankIdBlocked: !s,
992
- smsBlocked: !n
993
- }
994
- }) : e.doSendDocument();
995
- } } }, [e._v(" " + e._s(e.$t("sendButton")) + " ")])], 1)], 1)];
996
- } }], null, !0) })];
997
- }), e._t("footer")], 2)], 1)];
998
- } }], null, !0) });
999
- }, Le = [], He = /* @__PURE__ */ o(
1000
- Ee,
1001
- Ne,
1002
- Le,
1003
- !1,
1004
- null,
1005
- "7ec7fd0b"
1006
- );
1007
- const ri = He.exports, qe = {
1008
- name: "CAutocomplete",
1009
- components: {
1010
- CInput: I
1011
- },
1012
- mixins: [T],
1013
- inheritAttrs: !1,
1014
- props: {
1015
- value: {
1016
- type: [Number, String],
1017
- default: null
1018
- },
1019
- data: {
1020
- type: Array,
1021
- default: () => []
1022
- },
1023
- field: {
1024
- type: String,
1025
- default: "value"
1026
- },
1027
- keepFirst: Boolean,
1028
- clearOnSelect: Boolean,
1029
- openOnFocus: Boolean,
1030
- customFormatter: {
1031
- type: Function,
1032
- default: () => {
1033
- }
1034
- },
1035
- checkInfiniteScroll: Boolean,
1036
- keepOpen: Boolean,
1037
- clearable: Boolean,
1038
- maxHeight: {
1039
- type: [String, Number],
1040
- default: null
1041
- },
1042
- dropdownPosition: {
1043
- type: String,
1044
- default: "auto"
1045
- },
1046
- iconRight: {
1047
- type: String,
1048
- default: null
1049
- },
1050
- iconRightClickable: Boolean,
1051
- appendToBody: Boolean
1052
- },
1053
- data() {
1054
- return {
1055
- selected: null,
1056
- hovered: null,
1057
- isActive: !1,
1058
- newValue: this.value,
1059
- newAutocomplete: this.autocomplete || "off",
1060
- isListInViewportVertically: !0,
1061
- hasFocus: !1,
1062
- style: {},
1063
- _isAutocomplete: !0,
1064
- _elementRef: "input",
1065
- _bodyEl: void 0
1066
- // Used to append to body
1067
- };
1068
- },
1069
- computed: {
1070
- /**
1071
- * White-listed items to not close when clicked.
1072
- * Add input, dropdown and all children.
1073
- */
1074
- whiteList() {
1075
- const t = [];
1076
- if (t.push(this.$refs.input.$el.querySelector("input")), t.push(this.$refs.dropdown), this.$refs.dropdown !== void 0) {
1077
- const e = this.$refs.dropdown.querySelectorAll("*");
1078
- for (const i of e)
1079
- t.push(i);
1080
- }
1081
- if (this.$parent.$data._isTaginput) {
1082
- t.push(this.$parent.$el);
1083
- const e = this.$parent.$el.querySelectorAll("*");
1084
- for (const i of e)
1085
- t.push(i);
1086
- }
1087
- return t;
1088
- },
1089
- /**
1090
- * Check if exists default slot
1091
- */
1092
- hasDefaultSlot() {
1093
- return !!this.$scopedSlots.default;
1094
- },
1095
- /**
1096
- * Check if exists "empty" slot
1097
- */
1098
- hasEmptySlot() {
1099
- return !!this.$slots.empty;
1100
- },
1101
- /**
1102
- * Check if exists "header" slot
1103
- */
1104
- hasHeaderSlot() {
1105
- return !!this.$slots.header;
1106
- },
1107
- /**
1108
- * Check if exists "footer" slot
1109
- */
1110
- hasFooterSlot() {
1111
- return !!this.$slots.footer;
1112
- },
1113
- /**
1114
- * Apply dropdownPosition property
1115
- */
1116
- isOpenedTop() {
1117
- return this.dropdownPosition === "top" || this.dropdownPosition === "auto" && !this.isListInViewportVertically;
1118
- },
1119
- newIconRight() {
1120
- return this.clearable && this.newValue ? "close-circle" : this.iconRight;
1121
- },
1122
- newIconRightClickable() {
1123
- return this.clearable ? !0 : this.iconRightClickable;
1124
- },
1125
- contentStyle() {
1126
- return {
1127
- maxHeight: this.maxHeight === void 0 ? null : isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`
1128
- };
1129
- },
1130
- isDropdownOpen() {
1131
- return this.isActive && (this.data.length > 0 || this.hasEmptySlot || this.hasHeaderSlot);
1132
- }
1133
- },
1134
- watch: {
1135
- /**
1136
- * When dropdown is toggled, check the visibility to know when
1137
- * to open upwards.
1138
- */
1139
- isActive(t) {
1140
- this.dropdownPosition === "auto" && (t ? this.calcDropdownInViewportVertical() : setTimeout(() => {
1141
- this.calcDropdownInViewportVertical();
1142
- }, 100)), t && this.$nextTick(() => this.setHovered(null));
1143
- },
1144
- /**
1145
- * When updating input's value
1146
- * 1. Emit changes
1147
- * 2. If value isn't the same as selected, set null
1148
- * 3. Close dropdown if value is clear or else open it
1149
- */
1150
- newValue(t) {
1151
- this.$emit("input", t);
1152
- const e = this.getValue(this.selected);
1153
- e && e !== t && this.setSelected(null, !1), this.hasFocus && (!this.openOnFocus || t) && (this.isActive = !!t);
1154
- },
1155
- /**
1156
- * When v-model is changed:
1157
- * 1. Update internal value.
1158
- * 2. If it's invalid, validate again.
1159
- */
1160
- value(t) {
1161
- this.newValue = t;
1162
- },
1163
- /**
1164
- * Select first option if "keep-first
1165
- */
1166
- data(t) {
1167
- this.keepFirst && this.selectFirstOption(t);
1168
- }
1169
- },
1170
- created() {
1171
- typeof window < "u" && (document.addEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.addEventListener("resize", this.calcDropdownInViewportVertical));
1172
- },
1173
- mounted() {
1174
- if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content")) {
1175
- const t = this.$refs.dropdown.querySelector(".dropdown-content");
1176
- t.addEventListener(
1177
- "scroll",
1178
- () => this.checkIfReachedTheEndOfScroll(t)
1179
- );
1180
- }
1181
- this.appendToBody && (this.$data._bodyEl = ie(this.$refs.dropdown), this.updateAppendToBody());
1182
- },
1183
- beforeDestroy() {
1184
- typeof window < "u" && (document.removeEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.removeEventListener(
1185
- "resize",
1186
- this.calcDropdownInViewportVertical
1187
- )), this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content") && this.$refs.dropdown.querySelector(".dropdown-content").removeEventListener("scroll", this.checkIfReachedTheEndOfScroll), this.appendToBody && se(this.$data._bodyEl);
1188
- },
1189
- methods: {
1190
- /**
1191
- * Set which option is currently hovered.
1192
- */
1193
- setHovered(t) {
1194
- t !== void 0 && (this.hovered = t);
1195
- },
1196
- /**
1197
- * Set which option is currently selected, update v-model,
1198
- * update input value and close dropdown.
1199
- */
1200
- setSelected(t, e = !0) {
1201
- 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(() => {
1202
- this.isActive = !1;
1203
- }), this.checkValidity());
1204
- },
1205
- /**
1206
- * Select first option
1207
- */
1208
- selectFirstOption(t) {
1209
- this.$nextTick(() => {
1210
- t.length ? (this.openOnFocus || this.newValue !== "" && this.hovered !== t[0]) && this.setHovered(t[0]) : this.setHovered(null);
1211
- });
1212
- },
1213
- /**
1214
- * Enter key listener.
1215
- * Select the hovered option.
1216
- */
1217
- enterPressed(t) {
1218
- this.isDropdownOpen && (t.preventDefault(), this.hovered !== null && this.setSelected(this.hovered, !this.keepOpen));
1219
- },
1220
- /**
1221
- * Tab key listener.
1222
- * Select hovered option if it exists, close dropdown, then allow
1223
- * native handling to move to next tabbable element.
1224
- */
1225
- tabPressed() {
1226
- if (this.hovered === null) {
1227
- this.isActive = !1;
1228
- return;
1229
- }
1230
- this.setSelected(this.hovered, !this.keepOpen);
1231
- },
1232
- /**
1233
- * Close dropdown if clicked outside.
1234
- */
1235
- clickedOutside(t) {
1236
- var i;
1237
- const e = ((i = t.path) == null ? void 0 : i[0]) || t.target;
1238
- this.whiteList.indexOf(e) < 0 && (this.isActive = !1);
1239
- },
1240
- /**
1241
- * Return display text for the input.
1242
- * If object, get value from path, or else just the value.
1243
- */
1244
- getValue(t) {
1245
- if (t !== null)
1246
- return typeof this.customFormatter < "u" ? this.customFormatter(t) : typeof t == "object" ? ne(t, this.field) : t;
1247
- },
1248
- /**
1249
- * Check if the scroll list inside the dropdown
1250
- * reached it's end.
1251
- */
1252
- checkIfReachedTheEndOfScroll(t) {
1253
- t.clientHeight !== t.scrollHeight && t.scrollTop + t.clientHeight >= t.scrollHeight && this.$emit("infinite-scroll");
1254
- },
1255
- /**
1256
- * Calculate if the dropdown is vertically visible when activated,
1257
- * otherwise it is openened upwards.
1258
- */
1259
- calcDropdownInViewportVertical() {
1260
- this.$nextTick(() => {
1261
- if (this.$refs.dropdown === void 0)
1262
- return;
1263
- const t = this.$refs.dropdown.getBoundingClientRect();
1264
- this.isListInViewportVertically = t.top >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight), this.appendToBody && this.updateAppendToBody();
1265
- });
1266
- },
1267
- /**
1268
- * Arrows keys listener.
1269
- * If dropdown is active, set hovered option, or else just open.
1270
- */
1271
- keyArrows(t) {
1272
- const e = t === "down" ? 1 : -1;
1273
- if (this.isActive) {
1274
- let i = this.data.indexOf(this.hovered) + e;
1275
- i = i > this.data.length - 1 ? this.data.length : i, i = i < 0 ? 0 : i, this.setHovered(this.data[i]);
1276
- const s = this.$refs.dropdown.querySelector(".dropdown-content"), n = s.querySelectorAll(
1277
- "a.dropdown-item:not(.is-disabled)"
1278
- )[i];
1279
- if (!n)
1280
- return;
1281
- const a = s.scrollTop, r = s.scrollTop + s.clientHeight - n.clientHeight;
1282
- n.offsetTop < a ? s.scrollTop = n.offsetTop : n.offsetTop >= r && (s.scrollTop = n.offsetTop - s.clientHeight + n.clientHeight);
1283
- } else
1284
- this.isActive = !0;
1285
- },
1286
- /**
1287
- * Focus listener.
1288
- * If value is the same as selected, select all text.
1289
- */
1290
- focused(t) {
1291
- 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);
1292
- },
1293
- /**
1294
- * Blur listener.
1295
- */
1296
- onBlur(t) {
1297
- this.hasFocus = !1, this.$emit("blur", t);
1298
- },
1299
- onInput() {
1300
- const t = this.getValue(this.selected);
1301
- t && t === this.newValue || (this.$emit("typing", this.newValue), this.checkValidity());
1302
- },
1303
- rightIconClick(t) {
1304
- this.clearable ? this.newValue = "" : this.$emit("icon-right-click", t);
1305
- },
1306
- checkValidity() {
1307
- this.useHtml5Validation && this.$nextTick(() => {
1308
- this.checkHtml5Validity();
1309
- });
1310
- },
1311
- updateAppendToBody() {
1312
- const t = this.$refs.dropdown, e = this.$refs.input.$el;
1313
- if (t && e) {
1314
- const i = this.$data._bodyEl;
1315
- i.classList.forEach((r) => i.classList.remove(r)), i.classList.add("autocomplete"), i.classList.add("control"), this.expandend && i.classList.add("is-expandend");
1316
- const s = e.getBoundingClientRect();
1317
- let n = s.top + window.scrollY;
1318
- const a = s.left + window.scrollX;
1319
- this.isOpenedTop ? n -= t.clientHeight : n += e.clientHeight, this.style = {
1320
- position: "absolute",
1321
- top: `${n}px`,
1322
- left: `${a}px`,
1323
- width: `${e.clientWidth}px`,
1324
- maxWidth: `${e.clientWidth}px`,
1325
- zIndex: "99"
1326
- };
1327
- }
1328
- }
1329
- }
1330
- };
1331
- var je = function() {
1332
- var e = this, i = e._self._c;
1333
- 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) {
1334
- if (!s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]))
1335
- return null;
1336
- s.preventDefault(), e.isActive = !1;
1337
- }, keydown: [function(s) {
1338
- return !s.type.indexOf("key") && e._k(s.keyCode, "tab", 9, s.key, "Tab") ? null : e.tabPressed.apply(null, arguments);
1339
- }, function(s) {
1340
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.enterPressed.apply(null, arguments);
1341
- }, function(s) {
1342
- return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.keyArrows("up"));
1343
- }, function(s) {
1344
- return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.keyArrows("down"));
1345
- }] }, model: { value: e.newValue, callback: function(s) {
1346
- e.newValue = s;
1347
- }, 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) {
1348
- return i("a", { key: n, staticClass: "dropdown-item", class: { "is-hovered": s === e.hovered }, on: { click: function(a) {
1349
- return e.setSelected(s, void 0, a);
1350
- } } }, [e.hasDefaultSlot ? e._t("default", null, { option: s, index: n }) : i("span", [e._v(" " + e._s(e.getValue(s, !0)) + " ")])], 2);
1351
- }), 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);
1352
- }, Ke = [], We = /* @__PURE__ */ o(
1353
- qe,
1354
- je,
1355
- Ke,
1356
- !1,
1357
- null,
1358
- null
1359
- );
1360
- const Xe = We.exports, Ue = /* @__PURE__ */ X({
1361
- __name: "CMessage",
1362
- props: {
1363
- type: { default: "secondary" },
1364
- badge: { default: "" },
1365
- text: { default: "" }
1366
- },
1367
- setup(t) {
1368
- const e = U(), i = m(() => e.style), s = m(() => e.staticClass), n = m(() => e.class), a = m(() => Q.t("components:cling.message.tip"));
1369
- return { __sfc: !0, attrs: e, staticStyle: i, staticClass: s, styleClass: n, messageTip: a };
1370
- }
1371
- });
1372
- var Qe = function() {
1373
- var e = this, i = e._self._c, s = e._self._setupProxy;
1374
- return i("div", { class: [s.styleClass, s.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: [s.staticStyle] }, [i("div", { class: [`has-background-${e.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" } }, [e._v(" " + e._s(e.badge || s.messageTip) + " ")]), i("div", { staticStyle: { color: "hsl(0, 0%, 25%)" } }, [e.text ? [e._v(" " + e._s(e.text) + " ")] : e._e(), e._t("default")], 2)]);
1375
- }, Ye = [], Ge = /* @__PURE__ */ o(
1376
- Ue,
1377
- Qe,
1378
- Ye,
1379
- !1,
1380
- null,
1381
- null
1382
- );
1383
- const Je = Ge.exports, Ze = {
1384
- name: "CPhoneInput",
1385
- components: {
1386
- Flag: J,
1387
- CInput: I,
1388
- CDropdown: f,
1389
- CDropdownItem: g,
1390
- CButton: P,
1391
- CField: ae,
1392
- SmartList: oe
1393
- },
1394
- props: {
1395
- value: {
1396
- type: [String, Number],
1397
- default: ""
1398
- },
1399
- region: {
1400
- type: String,
1401
- default: ""
1402
- },
1403
- // Region to fallback to if prefix is not found in value
1404
- defaultRegion: {
1405
- type: String,
1406
- required: !0
1407
- },
1408
- label: {
1409
- type: String,
1410
- default: ""
1411
- },
1412
- labelPosition: {
1413
- type: String,
1414
- default: ""
1415
- }
1416
- },
1417
- data() {
1418
- return {
1419
- internalPrefix: null,
1420
- // Used to remember prefix when value is changed to empty
1421
- searchQuery: ""
1422
- };
1423
- },
1424
- computed: {
1425
- defaultPrefix() {
1426
- return l[this.internalRegion].callingCode;
1427
- },
1428
- currentRegion() {
1429
- return this.getRegionByCallingCode(this.prefix);
1430
- },
1431
- internalRegion: {
1432
- get() {
1433
- if (this.region)
1434
- return this.region;
1435
- if (this.value) {
1436
- const t = (Object.keys(l) || []).find(
1437
- (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
1438
- );
1439
- if (t)
1440
- return t;
1441
- }
1442
- return this.internalPrefix ? this.getRegionByCallingCode(this.internalPrefix) : this.defaultRegion;
1443
- },
1444
- set(t) {
1445
- this.$emit("update:region", t), this.updateValue({ prefix: l[t].callingCode });
1446
- }
1447
- },
1448
- prefix() {
1449
- if (!this.value)
1450
- return this.internalPrefix || this.defaultPrefix;
1451
- const t = (Object.keys(l) || []).find(
1452
- (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
1453
- );
1454
- return t ? l[t].callingCode : this.defaultPrefix;
1455
- },
1456
- phone: {
1457
- get() {
1458
- return this.prefix && this.value && this.value.startsWith(this.prefix) ? this.value.substring(this.prefix.length) : this.value;
1459
- },
1460
- set(t) {
1461
- this.updateValue({ phone: t });
1462
- }
1463
- },
1464
- sortedRegions() {
1465
- return (Object.keys(l) || []).map((t) => ({
1466
- key: t,
1467
- title: `${l[t].name} (${t})`,
1468
- callingCode: l[t].callingCode
1469
- })).sort((t, e) => t.title.localeCompare(e.title));
1470
- }
1471
- },
1472
- methods: {
1473
- getRegionByCallingCode(t) {
1474
- return t ? (Object.keys(l) || []).find(
1475
- (i) => t === l[i].callingCode
1476
- ) : null;
1477
- },
1478
- updateValue({ prefix: t, phone: e }) {
1479
- const i = t !== void 0 ? t : this.prefix || "", s = e !== void 0 ? e : this.phone || "", n = `${i}${s}`;
1480
- n !== i ? (this.$emit("input", n), this.region || this.$emit("update:region", this.internalRegion), this.internalPrefix = null) : (this.internalPrefix = i, this.$emit("input", ""));
1481
- }
1482
- }
1483
- };
1484
- var et = function() {
1485
- var e = this, i = e._self._c;
1486
- 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 }) {
1487
- return [i("CDropdown", { staticClass: "control", staticStyle: { height: "100%" }, attrs: { size: e.$attrs.size, disabled: e.$attrs.disabled, "menu-styling": {
1488
- maxWidth: "300px"
1489
- }, scrollable: !0, position: "is-bottom-right", "max-height": "240px" }, model: { value: e.internalRegion, callback: function(n) {
1490
- e.internalRegion = n;
1491
- }, 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) {
1492
- e.searchQuery = n;
1493
- }, expression: "searchQuery" } }), e._l(s, function({ key: n, title: a, callingCode: r }) {
1494
- 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);
1495
- })], 2)];
1496
- } }]) })], 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) {
1497
- e.phone = s;
1498
- }, expression: "phone" } }, "CInput", { ...e.$attrs, ...e.$props }, !1))], 1)], 1);
1499
- }, tt = [], it = /* @__PURE__ */ o(
1500
- Ze,
1501
- et,
1502
- tt,
1503
- !1,
1504
- null,
1505
- null
1506
- );
1507
- const x = it.exports, st = {
1508
- name: "CRadio",
1509
- mixins: [M]
1510
- };
1511
- var nt = function() {
1512
- var e = this, i = e._self._c;
1513
- 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) {
1514
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
1515
- } } }, [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) {
1516
- s.stopPropagation();
1517
- }, change: function(s) {
1518
- e.computedValue = e.nativeValue;
1519
- } } }), i("span", { staticClass: "check", class: `is-${e.type}` }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
1520
- }, at = [], rt = /* @__PURE__ */ o(
1521
- st,
1522
- nt,
1523
- at,
1524
- !1,
1525
- null,
1526
- null
1527
- );
1528
- const S = rt.exports, ot = {
1529
- name: "CRadioButton",
1530
- components: {
1531
- CButton: P
1532
- },
1533
- mixins: [M],
1534
- props: {
1535
- type: {
1536
- type: String,
1537
- default: "primary"
1538
- },
1539
- expanded: Boolean
1540
- },
1541
- data() {
1542
- return {
1543
- isFocused: !1
1544
- };
1545
- }
1546
- };
1547
- var lt = function() {
1548
- var e = this, i = e._self._c;
1549
- 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) {
1550
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.$el.label.click());
1551
- } } }, [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) {
1552
- s.stopPropagation();
1553
- }, focus: function(s) {
1554
- e.isFocused = !0;
1555
- }, blur: function(s) {
1556
- e.isFocused = !1;
1557
- }, change: function(s) {
1558
- e.computedValue = e.nativeValue;
1559
- } } })], 2)], 1);
1560
- }, dt = [], ct = /* @__PURE__ */ o(
1561
- ot,
1562
- lt,
1563
- dt,
1564
- !1,
1565
- null,
1566
- null
1567
- );
1568
- const $ = ct.exports, ut = {
1569
- name: "CSelect",
1570
- mixins: [T],
1571
- inheritAttrs: !1,
1572
- props: {
1573
- value: {
1574
- type: [String, Number, Boolean, Object, Array, Function],
1575
- default: null
1576
- },
1577
- placeholder: {
1578
- type: String,
1579
- default: ""
1580
- },
1581
- multiple: Boolean,
1582
- selectClass: {
1583
- type: [String, Object, Array],
1584
- default: ""
1585
- },
1586
- nativeSize: {
1587
- type: [String, Number],
1588
- default: null
1589
- }
1590
- },
1591
- data() {
1592
- return {
1593
- selected: this.value,
1594
- _elementRef: "select"
1595
- };
1596
- },
1597
- computed: {
1598
- computedValue: {
1599
- get() {
1600
- return this.selected;
1601
- },
1602
- set(t) {
1603
- this.selected = t, this.$emit("input", t), !this.isValid && this.checkHtml5Validity();
1604
- }
1605
- },
1606
- spanClasses() {
1607
- return [
1608
- this.size,
1609
- this.statusType,
1610
- {
1611
- "is-fullwidth": this.expanded,
1612
- "is-loading": this.loading,
1613
- "is-multiple": this.multiple,
1614
- "is-rounded": this.rounded,
1615
- "is-empty": this.selected === null
1616
- }
1617
- ];
1618
- }
1619
- },
1620
- watch: {
1621
- /**
1622
- * When v-model is changed:
1623
- * 1. Set the selected option.
1624
- * 2. If it's invalid, validate again.
1625
- */
1626
- value(t) {
1627
- this.selected = t, !this.isValid && this.checkHtml5Validity();
1628
- }
1629
- }
1630
- };
1631
- var mt = function() {
1632
- var e = this, i = e._self._c;
1633
- 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) {
1634
- e.$emit("blur", s) && e.checkHtml5Validity();
1635
- }, focus: function(s) {
1636
- return e.$emit("focus", s);
1637
- }, change: function(s) {
1638
- var n = Array.prototype.filter.call(s.target.options, function(a) {
1639
- return a.selected;
1640
- }).map(function(a) {
1641
- var r = "_value" in a ? a._value : a.value;
1642
- return r;
1643
- });
1644
- e.computedValue = s.target.multiple ? n : n[0];
1645
- } } }, "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)])]);
1646
- }, pt = [], ht = /* @__PURE__ */ o(
1647
- ut,
1648
- mt,
1649
- pt,
1650
- !1,
1651
- null,
1652
- "23e48013"
1653
- );
1654
- const k = ht.exports, ft = {
1655
- name: "CSkeleton",
1656
- functional: !0,
1657
- props: {
1658
- active: {
1659
- type: Boolean,
1660
- default: !0
1661
- },
1662
- animated: {
1663
- type: Boolean,
1664
- default: !1
1665
- },
1666
- width: [Number, String],
1667
- height: [Number, String],
1668
- circle: Boolean,
1669
- rounded: {
1670
- type: Boolean,
1671
- default: !0
1672
- },
1673
- count: {
1674
- type: Number,
1675
- default: 1
1676
- },
1677
- hidden: {
1678
- type: [Boolean, String],
1679
- default: !1
1680
- },
1681
- color: {
1682
- type: String,
1683
- default: null
1684
- }
1685
- },
1686
- render(t, e) {
1687
- if (!e.props.active)
1688
- return;
1689
- const i = [], s = e.props.width, n = e.props.height;
1690
- for (let a = 0; a < e.props.count; a++)
1691
- i.push(
1692
- t("div", {
1693
- staticClass: "c-skeleton-item",
1694
- class: { "is-rounded": e.props.rounded },
1695
- key: a,
1696
- style: {
1697
- height: n === void 0 ? null : isNaN(n) ? n : n + "px",
1698
- width: s === void 0 ? null : isNaN(s) ? s : s + "px",
1699
- borderRadius: e.props.circle ? "50%" : null,
1700
- background: e.props.color ? e.props.color : null
1701
- }
1702
- })
1703
- );
1704
- return t(
1705
- "div",
1706
- {
1707
- staticStyle: e.data.staticStyle,
1708
- staticClass: "c-skeleton",
1709
- class: [
1710
- e.data.staticClass,
1711
- {
1712
- "is-animated": e.props.animated,
1713
- "is-invisible": e.props.hidden
1714
- }
1715
- ]
1716
- },
1717
- i
1718
- );
1719
- }
1720
- }, gt = null, vt = null;
1721
- var yt = /* @__PURE__ */ o(
1722
- ft,
1723
- gt,
1724
- vt,
1725
- !1,
1726
- null,
1727
- null
1728
- );
1729
- const D = yt.exports, _t = {
1730
- name: "CSliderThumb",
1731
- inheritAttrs: !1,
1732
- props: {
1733
- value: {
1734
- type: Number,
1735
- default: 0
1736
- },
1737
- type: {
1738
- type: String,
1739
- default: ""
1740
- },
1741
- tooltip: {
1742
- type: Boolean,
1743
- default: !0
1744
- },
1745
- customFormatter: {
1746
- type: Function,
1747
- default: null
1748
- }
1749
- },
1750
- data() {
1751
- return {
1752
- isFocused: !1,
1753
- dragging: !1,
1754
- startX: 0,
1755
- startPosition: 0,
1756
- newPosition: null,
1757
- oldValue: this.value
1758
- };
1759
- },
1760
- computed: {
1761
- disabled() {
1762
- return this.$parent.disabled;
1763
- },
1764
- max() {
1765
- return this.$parent.max;
1766
- },
1767
- min() {
1768
- return this.$parent.min;
1769
- },
1770
- step() {
1771
- return this.$parent.step;
1772
- },
1773
- precision() {
1774
- return this.$parent.precision;
1775
- },
1776
- currentPosition() {
1777
- return `${(this.value - this.min) / (this.max - this.min) * 100}%`;
1778
- },
1779
- wrapperStyle() {
1780
- return { left: this.currentPosition };
1781
- },
1782
- tooltipLabel() {
1783
- return typeof this.customFormatter == "function" ? this.customFormatter(this.value) : this.value.toString();
1784
- }
1785
- },
1786
- methods: {
1787
- onFocus() {
1788
- this.isFocused = !0;
1789
- },
1790
- onBlur() {
1791
- this.isFocused = !1;
1792
- },
1793
- onButtonDown(t) {
1794
- 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)));
1795
- },
1796
- onLeftKeyDown() {
1797
- 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"));
1798
- },
1799
- onRightKeyDown() {
1800
- 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"));
1801
- },
1802
- onHomeKeyDown() {
1803
- this.disabled || this.value === this.min || (this.newPosition = 0, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1804
- },
1805
- onEndKeyDown() {
1806
- this.disabled || this.value === this.max || (this.newPosition = 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1807
- },
1808
- onDragStart(t) {
1809
- 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;
1810
- },
1811
- onDragging(t) {
1812
- if (this.dragging) {
1813
- t.type === "touchmove" && (t.clientX = t.touches[0].clientX);
1814
- const e = (t.clientX - this.startX) / this.$parent.sliderSize() * 100;
1815
- this.newPosition = this.startPosition + e, this.setPosition(this.newPosition);
1816
- }
1817
- },
1818
- onDragEnd() {
1819
- 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));
1820
- },
1821
- setPosition(t) {
1822
- if (t === null || isNaN(t))
1823
- return;
1824
- t < 0 ? t = 0 : t > 100 && (t = 100);
1825
- const e = 100 / ((this.max - this.min) / this.step);
1826
- let s = Math.round(t / e) * e / 100 * (this.max - this.min) + this.min;
1827
- s = parseFloat(s.toFixed(this.precision)), this.$emit("input", s), !this.dragging && s !== this.oldValue && (this.oldValue = s);
1828
- }
1829
- }
1830
- };
1831
- var bt = function() {
1832
- var e = this, i = e._self._c;
1833
- 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) {
1834
- 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));
1835
- }, function(s) {
1836
- 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));
1837
- }, function(s) {
1838
- return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
1839
- }, function(s) {
1840
- return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
1841
- }, function(s) {
1842
- return !s.type.indexOf("key") && e._k(s.keyCode, "home", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onHomeKeyDown.apply(null, arguments));
1843
- }, function(s) {
1844
- return !s.type.indexOf("key") && e._k(s.keyCode, "end", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onEndKeyDown.apply(null, arguments));
1845
- }] } }, "div", e.$attrs, !1))]);
1846
- }, Ct = [], wt = /* @__PURE__ */ o(
1847
- _t,
1848
- bt,
1849
- Ct,
1850
- !1,
1851
- null,
1852
- null
1853
- );
1854
- const xt = wt.exports, St = {
1855
- name: "CSliderTick",
1856
- props: {
1857
- value: {
1858
- type: Number,
1859
- default: 0
1860
- }
1861
- },
1862
- computed: {
1863
- position() {
1864
- const t = (this.value - this.$parent.min) / (this.$parent.max - this.$parent.min) * 100;
1865
- return t >= 0 && t <= 100 ? t : 0;
1866
- },
1867
- hidden() {
1868
- return this.value === this.$parent.min || this.value === this.$parent.max;
1869
- }
1870
- },
1871
- created() {
1872
- if (!this.$parent.$data._isSlider)
1873
- throw this.$destroy(), new Error("You should wrap bSliderTick on a bSlider");
1874
- },
1875
- methods: {
1876
- getTickStyle(t) {
1877
- return { left: `${t}%` };
1878
- }
1879
- }
1880
- };
1881
- var $t = function() {
1882
- var e = this, i = e._self._c;
1883
- 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()]);
1884
- }, kt = [], Dt = /* @__PURE__ */ o(
1885
- St,
1886
- $t,
1887
- kt,
1888
- !1,
1889
- null,
1890
- null
1891
- );
1892
- const Vt = Dt.exports, Ft = {
1893
- name: "CSlider",
1894
- components: {
1895
- CSliderThumb: xt,
1896
- CSliderTick: Vt
1897
- },
1898
- props: {
1899
- value: {
1900
- type: [Number, Array],
1901
- default: 0
1902
- },
1903
- min: {
1904
- type: Number,
1905
- default: 0
1906
- },
1907
- max: {
1908
- type: Number,
1909
- default: 100
1910
- },
1911
- step: {
1912
- type: Number,
1913
- default: 1
1914
- },
1915
- type: {
1916
- type: String,
1917
- default: "primary"
1918
- },
1919
- size: {
1920
- type: String,
1921
- default: ""
1922
- },
1923
- ticks: {
1924
- type: Boolean,
1925
- default: !1
1926
- },
1927
- tooltip: {
1928
- type: Boolean,
1929
- default: !0
1930
- },
1931
- tooltipType: {
1932
- type: String,
1933
- default: ""
1934
- },
1935
- rounded: {
1936
- type: Boolean,
1937
- default: !1
1938
- },
1939
- disabled: {
1940
- type: Boolean,
1941
- default: !1
1942
- },
1943
- lazy: {
1944
- type: Boolean,
1945
- default: !1
1946
- },
1947
- customFormatter: {
1948
- type: Function,
1949
- default: null
1950
- },
1951
- ariaLabel: {
1952
- type: [String, Array],
1953
- default: ""
1954
- },
1955
- biggerSliderFocus: {
1956
- type: Boolean,
1957
- default: !1
1958
- }
1959
- },
1960
- data() {
1961
- return {
1962
- value1: null,
1963
- value2: null,
1964
- dragging: !1,
1965
- isRange: !1,
1966
- _isSlider: !0
1967
- // Used by Thumb and Tick
1968
- };
1969
- },
1970
- computed: {
1971
- newTooltipType() {
1972
- return this.tooltipType ? this.tooltipType : this.type;
1973
- },
1974
- tickValues() {
1975
- if (!this.ticks || this.min > this.max || this.step === 0)
1976
- return [];
1977
- const t = [];
1978
- for (let e = this.min + this.step; e < this.max; e += this.step)
1979
- t.push(e);
1980
- return t;
1981
- },
1982
- minValue() {
1983
- return Math.min(this.value1, this.value2);
1984
- },
1985
- maxValue() {
1986
- return Math.max(this.value1, this.value2);
1987
- },
1988
- barSize() {
1989
- return this.isRange ? `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%` : `${100 * (this.value1 - this.min) / (this.max - this.min)}%`;
1990
- },
1991
- barStart() {
1992
- return this.isRange ? `${100 * (this.minValue - this.min) / (this.max - this.min)}%` : "0%";
1993
- },
1994
- precision() {
1995
- const t = [this.min, this.max, this.step].map((e) => {
1996
- const i = `${e}`.split(".")[1];
1997
- return i ? i.length : 0;
1998
- });
1999
- return Math.max(...t);
2000
- },
2001
- barStyle() {
2002
- return {
2003
- width: this.barSize,
2004
- left: this.barStart
2005
- };
2006
- },
2007
- rootClasses() {
2008
- return {
2009
- "is-rounded": this.rounded,
2010
- "is-dragging": this.dragging,
2011
- "is-disabled": this.disabled,
2012
- "slider-focus": this.biggerSliderFocus
2013
- };
2014
- }
2015
- },
2016
- watch: {
2017
- /**
2018
- * When v-model is changed set the new active step.
2019
- */
2020
- value(t) {
2021
- this.setValues(t);
2022
- },
2023
- value1() {
2024
- this.onInternalValueUpdate();
2025
- },
2026
- value2() {
2027
- this.onInternalValueUpdate();
2028
- },
2029
- min() {
2030
- this.setValues(this.value);
2031
- },
2032
- max() {
2033
- this.setValues(this.value);
2034
- }
2035
- },
2036
- created() {
2037
- this.isThumbReversed = !1, this.isTrackClickDisabled = !1, this.setValues(this.value);
2038
- },
2039
- methods: {
2040
- setValues(t) {
2041
- if (!(this.min > this.max))
2042
- if (Array.isArray(t)) {
2043
- this.isRange = !0;
2044
- const e = typeof t[0] != "number" || isNaN(t[0]) ? this.min : h(t[0], this.min, this.max), i = typeof t[1] != "number" || isNaN(t[1]) ? this.max : h(t[1], this.min, this.max);
2045
- this.value1 = this.isThumbReversed ? i : e, this.value2 = this.isThumbReversed ? e : i;
2046
- } else
2047
- this.isRange = !1, this.value1 = isNaN(t) ? this.min : h(t, this.min, this.max), this.value2 = null;
2048
- },
2049
- onInternalValueUpdate() {
2050
- this.isRange && (this.isThumbReversed = this.value1 > this.value2), (!this.lazy || !this.dragging) && this.emitValue("input"), this.dragging && this.emitValue("dragging");
2051
- },
2052
- sliderSize() {
2053
- return this.$refs.slider.getBoundingClientRect().width;
2054
- },
2055
- onSliderClick(t) {
2056
- if (this.disabled || this.isTrackClickDisabled)
2057
- return;
2058
- 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);
2059
- if (this.isRange) {
2060
- const a = Math.abs(s - this.value2);
2061
- if (n <= a) {
2062
- if (n < this.step / 2)
2063
- return;
2064
- this.$refs.button1.setPosition(i);
2065
- } else {
2066
- if (a < this.step / 2)
2067
- return;
2068
- this.$refs.button2.setPosition(i);
2069
- }
2070
- } else {
2071
- if (n < this.step / 2)
2072
- return;
2073
- this.$refs.button1.setPosition(i);
2074
- }
2075
- this.emitValue("change");
2076
- },
2077
- onDragStart() {
2078
- this.dragging = !0, this.$emit("dragstart");
2079
- },
2080
- onDragEnd() {
2081
- this.isTrackClickDisabled = !0, setTimeout(() => {
2082
- this.isTrackClickDisabled = !1;
2083
- }, 0), this.dragging = !1, this.$emit("dragend"), this.lazy && this.emitValue("input");
2084
- },
2085
- emitValue(t) {
2086
- this.$emit(
2087
- t,
2088
- this.isRange ? [this.minValue, this.maxValue] : this.value1
2089
- );
2090
- }
2091
- }
2092
- };
2093
- var At = function() {
2094
- var e = this, i = e._self._c;
2095
- 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) {
2096
- return i("CSliderTick", { key: n, attrs: { value: s } });
2097
- }) : 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) {
2098
- e.value1 = s;
2099
- }, 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) {
2100
- e.value2 = s;
2101
- }, expression: "value2" } }) : e._e()], 2)]);
2102
- }, Ot = [], Bt = /* @__PURE__ */ o(
2103
- Ft,
2104
- At,
2105
- Ot,
2106
- !1,
2107
- null,
2108
- null
2109
- );
2110
- const V = Bt.exports, It = {
2111
- name: "CSwitch",
2112
- props: {
2113
- value: {
2114
- type: [String, Number, Boolean, Function, Object, Array, Date],
2115
- default: null
2116
- },
2117
- nativeValue: {
2118
- type: [String, Number, Boolean, Function, Object, Array, Date],
2119
- default: null
2120
- },
2121
- disabled: Boolean,
2122
- type: {
2123
- type: String,
2124
- default: ""
2125
- },
2126
- name: {
2127
- type: String,
2128
- default: ""
2129
- },
2130
- required: Boolean,
2131
- size: {
2132
- type: String,
2133
- default: ""
2134
- },
2135
- trueValue: {
2136
- type: [String, Number, Boolean, Function, Object, Array, Date],
2137
- default: !0
2138
- },
2139
- falseValue: {
2140
- type: [String, Number, Boolean, Function, Object, Array, Date],
2141
- default: !1
2142
- },
2143
- rounded: {
2144
- type: Boolean,
2145
- default: !0
2146
- }
2147
- },
2148
- data() {
2149
- return {
2150
- newValue: this.value
2151
- };
2152
- },
2153
- computed: {
2154
- computedValue: {
2155
- get() {
2156
- return this.newValue;
2157
- },
2158
- set(t) {
2159
- this.newValue = t, this.$emit("input", t);
2160
- }
2161
- },
2162
- newClass() {
2163
- return [
2164
- `is-${this.size}`,
2165
- {
2166
- "is-disabled": this.disabled,
2167
- "is-rounded": this.rounded
2168
- }
2169
- ];
2170
- }
2171
- },
2172
- watch: {
2173
- /**
2174
- * When v-model change, set internal value.
2175
- */
2176
- value(t) {
2177
- this.newValue = t;
2178
- }
2179
- },
2180
- methods: {
2181
- focus() {
2182
- this.$refs.input.focus();
2183
- }
2184
- }
2185
- };
2186
- var Tt = function() {
2187
- var e = this, i = e._self._c;
2188
- return i("label", { ref: "label", staticClass: "switch", class: e.newClass, attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
2189
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
2190
- } } }, [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) {
2191
- s.stopPropagation();
2192
- }, change: function(s) {
2193
- var n = e.computedValue, a = s.target, r = a.checked ? e.trueValue : e.falseValue;
2194
- if (Array.isArray(n)) {
2195
- var d = e.nativeValue, u = e._i(n, d);
2196
- a.checked ? u < 0 && (e.computedValue = n.concat([d])) : u > -1 && (e.computedValue = n.slice(0, u).concat(n.slice(u + 1)));
2197
- } else
2198
- e.computedValue = r;
2199
- } } }), i("span", { staticClass: "check", class: [`is-${e.type}`] }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
2200
- }, Pt = [], Mt = /* @__PURE__ */ o(
2201
- It,
2202
- Tt,
2203
- Pt,
2204
- !1,
2205
- null,
2206
- "4cdd239d"
2207
- );
2208
- const F = Mt.exports, Rt = {
2209
- name: "CTabItem",
2210
- props: {
2211
- label: String,
2212
- icon: String,
2213
- iconPack: String,
2214
- disabled: Boolean,
2215
- visible: {
2216
- type: Boolean,
2217
- default: !0
2218
- },
2219
- value: [String, Number]
2220
- },
2221
- data() {
2222
- return {
2223
- isActive: !1,
2224
- transitionName: null,
2225
- _isTabItem: !0
2226
- // Used internally by Tab
2227
- };
2228
- },
2229
- created() {
2230
- if (!this.$parent.$data._isTabs)
2231
- throw this.$destroy(), new Error("You should wrap bTabItem on a bTabs");
2232
- this.$parent.refreshSlots();
2233
- },
2234
- beforeDestroy() {
2235
- this.$parent.refreshSlots();
2236
- },
2237
- methods: {
2238
- /**
2239
- * Activate tab, alter animation name based on the index.
2240
- */
2241
- activate(t, e) {
2242
- this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !0;
2243
- },
2244
- /**
2245
- * Deactivate tab, alter animation name based on the index.
2246
- */
2247
- deactivate(t, e) {
2248
- this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !1;
2249
- }
2250
- },
2251
- render(t) {
2252
- if (this.$parent.destroyOnHide && (!this.isActive || !this.visible))
2253
- return;
2254
- const e = t(
2255
- "div",
2256
- {
2257
- directives: [
2258
- {
2259
- name: "show",
2260
- value: this.isActive && this.visible
2261
- }
2262
- ],
2263
- class: "tab-item"
2264
- },
2265
- this.$slots.default
2266
- );
2267
- return this.$parent.animated ? t(
2268
- "transition",
2269
- {
2270
- props: {
2271
- name: this.transitionName,
2272
- mode: "out-in"
2273
- },
2274
- on: {
2275
- "before-enter": () => {
2276
- this.$parent.isTransitioning = !0;
2277
- },
2278
- "after-enter": () => {
2279
- this.$parent.isTransitioning = !1;
2280
- }
2281
- }
2282
- },
2283
- [e]
2284
- ) : e;
2285
- }
2286
- }, zt = null, Et = null;
2287
- var Nt = /* @__PURE__ */ o(
2288
- Rt,
2289
- zt,
2290
- Et,
2291
- !1,
2292
- null,
2293
- null
2294
- );
2295
- const A = Nt.exports, Lt = {
2296
- name: "CSlotComponent",
2297
- props: {
2298
- component: {
2299
- type: Object,
2300
- required: !0
2301
- },
2302
- name: {
2303
- type: String,
2304
- default: "default"
2305
- },
2306
- scoped: {
2307
- type: Boolean
2308
- },
2309
- props: {
2310
- type: Object
2311
- },
2312
- tag: {
2313
- type: String,
2314
- default: "div"
2315
- },
2316
- event: {
2317
- type: String,
2318
- default: "hook:updated"
2319
- }
2320
- },
2321
- methods: {
2322
- refresh() {
2323
- this.$forceUpdate();
2324
- },
2325
- isVueComponent() {
2326
- return this.component && this.component._isVue;
2327
- }
2328
- },
2329
- created() {
2330
- this.isVueComponent() && this.component.$on(this.event, this.refresh);
2331
- },
2332
- beforeDestroy() {
2333
- this.isVueComponent() && this.component.$off(this.event, this.refresh);
2334
- },
2335
- render(t) {
2336
- if (this.isVueComponent())
2337
- return t(
2338
- this.tag,
2339
- {},
2340
- this.scoped ? this.component.$scopedSlots[this.name](this.props) : this.component.$slots[this.name]
2341
- );
2342
- }
2343
- }, Ht = {
2344
- name: "CTabs",
2345
- components: {
2346
- CSlotComponent: Lt
2347
- },
2348
- props: {
2349
- value: {
2350
- type: [Number, String],
2351
- default: null
2352
- },
2353
- expanded: Boolean,
2354
- type: {
2355
- type: String,
2356
- default: null
2357
- },
2358
- size: {
2359
- type: String,
2360
- default: null
2361
- },
2362
- position: {
2363
- type: String,
2364
- validator(t) {
2365
- return ["left", "right", "center"].indexOf(t) > -1;
2366
- },
2367
- default: null
2368
- },
2369
- animated: {
2370
- type: Boolean,
2371
- default: !0
2372
- },
2373
- destroyOnHide: {
2374
- type: Boolean,
2375
- default: !1
2376
- },
2377
- vertical: Boolean,
2378
- multiline: Boolean
2379
- },
2380
- data() {
2381
- return {
2382
- activeTab: 0,
2383
- defaultSlots: [],
2384
- contentHeight: 0,
2385
- isTransitioning: !1,
2386
- _isTabs: !0
2387
- // Used internally by TabItem
2388
- };
2389
- },
2390
- computed: {
2391
- mainClasses() {
2392
- return {
2393
- "is-fullwidth": this.expanded,
2394
- "is-vertical": this.vertical,
2395
- "is-multiline": this.multiline,
2396
- [`is-${this.position}`]: this.position && this.vertical
2397
- };
2398
- },
2399
- navClasses() {
2400
- return [
2401
- this.type,
2402
- {
2403
- [`is-${this.size}`]: !!this.size,
2404
- [`is-${this.position}`]: this.position && !this.vertical,
2405
- "is-fullwidth": this.expanded,
2406
- "is-toggle-rounded is-toggle": this.type === "is-toggle-rounded"
2407
- }
2408
- ];
2409
- },
2410
- tabItems() {
2411
- return this.defaultSlots.filter(
2412
- (t) => t.componentInstance && t.componentInstance.$data && t.componentInstance.$data._isTabItem
2413
- ).map((t) => t.componentInstance);
2414
- }
2415
- },
2416
- watch: {
2417
- /**
2418
- * When v-model is changed set the new active tab.
2419
- */
2420
- value(t) {
2421
- const e = this.getIndexByValue(t, t);
2422
- this.changeTab(e);
2423
- },
2424
- /**
2425
- * When tab-items are updated, set active one.
2426
- */
2427
- tabItems() {
2428
- if (this.activeTab < this.tabItems.length) {
2429
- let t = this.activeTab;
2430
- this.tabItems.map((e, i) => {
2431
- e.isActive && (t = i, t < this.tabItems.length && (this.tabItems[t].isActive = !1));
2432
- }), this.tabItems[this.activeTab].isActive = !0;
2433
- } else
2434
- this.activeTab > 0 && this.changeTab(this.activeTab - 1);
2435
- }
2436
- },
2437
- mounted() {
2438
- this.activeTab = this.getIndexByValue(this.value || 0), this.activeTab < this.tabItems.length && (this.tabItems[this.activeTab].isActive = !0), this.refreshSlots();
2439
- },
2440
- methods: {
2441
- /**
2442
- * Change the active tab and emit change event.
2443
- */
2444
- changeTab(t) {
2445
- 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)));
2446
- },
2447
- /**
2448
- * Tab click listener, emit input event and change active tab.
2449
- */
2450
- tabClick(t) {
2451
- this.activeTab !== t && (this.$emit("input", this.getValueByIndex(t)), this.changeTab(t));
2452
- },
2453
- refreshSlots() {
2454
- this.defaultSlots = this.$slots.default || [];
2455
- },
2456
- getIndexByValue(t) {
2457
- const e = this.tabItems.map(
2458
- (i) => i.$options.propsData ? i.$options.propsData.value : void 0
2459
- ).indexOf(t);
2460
- return e >= 0 ? e : t;
2461
- },
2462
- getValueByIndex(t) {
2463
- const { propsData: e } = this.tabItems[t].$options;
2464
- return e && e.value ? e.value : t;
2465
- }
2466
- }
2467
- };
2468
- var qt = function() {
2469
- var e = this, i = e._self._c;
2470
- 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) {
2471
- return i("li", { directives: [{ name: "show", rawName: "v-show", value: s.visible, expression: "tabItem.visible" }], key: n, class: {
2472
- "is-active": e.activeTab === n,
2473
- "is-disabled": s.disabled
2474
- } }, [s.$slots.header ? i("CSlotComponent", { attrs: { component: s, name: "header", tag: "a" }, nativeOn: { click: function(a) {
2475
- return e.tabClick(n);
2476
- } } }) : i("a", { on: { click: function(a) {
2477
- return e.tabClick(n);
2478
- } } }, [s.icon ? i("CIcon", { attrs: { size: e.size, type: s.icon } }) : e._e(), i("span", [e._v(e._s(s.label))])], 1)], 1);
2479
- }), 0)]), i("section", { staticClass: "tab-content", class: { "is-transitioning": e.isTransitioning } }, [e._t("default")], 2)]);
2480
- }, jt = [], Kt = /* @__PURE__ */ o(
2481
- Ht,
2482
- qt,
2483
- jt,
2484
- !1,
2485
- null,
2486
- "e02a6440"
2487
- );
2488
- const O = Kt.exports;
2489
- function oi(t) {
2490
- t.component(D.name, D), t.component("CAutocomplete", Xe), t.component(_.name, _), t.component(S.name, S), t.component($.name, $), t.component(f.name, f), t.component(g.name, g), t.component(k.name, k), t.component(b.name, b), t.component(F.name, F), t.component(O.name, O), t.component(A.name, A), t.component("CField", re), t.component("CMessage", Je), t.component(x.name, x), t.component(V.name, V);
2491
- }
2492
- export {
2493
- ri as S,
2494
- oi as i
2495
- };