@cling-se/widget 0.15.3 → 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 (134) hide show
  1. package/README.md +43 -43
  2. package/dist/{AddClientCallout-8s5a1_CZ.js → AddClientCallout-CrZF5j7A.js} +15 -13
  3. package/dist/{AnswerModal-Cnp43tGo.js → AnswerModal-C3r9vyki.js} +71 -71
  4. package/dist/{AttachmentItem-BP85gcjP.js → AttachmentItem-BVXrxCnv.js} +17 -12
  5. package/dist/{BaseDatePicker-C27CsTzy.js → BaseDatePicker-DxL2l3QC.js} +2 -2
  6. package/dist/{BaseUpload-DnhS3hGx.js → BaseUpload-B7259IaQ.js} +3 -3
  7. package/dist/{BlockMedia-D4nhek2s.js → BlockMedia-BSKtZMwa.js} +2 -2
  8. package/dist/{CCallout-CQjRcxpC.js → CCallout-BNvM6gNJ.js} +4 -5
  9. package/dist/{CCurrencyDropdown-BT01qBGg.js → CCurrencyDropdown-xmqmb8gW.js} +4 -4
  10. package/dist/{CDropdownItem-BSPNul90.js → CDropdownItem-DiLisSei.js} +139 -37
  11. package/dist/{CFormField-Cz_jNazS.js → CFormField-DcZVdj3a.js} +3 -4
  12. package/dist/{CPhoneFormat-C017AoM0.js → CPhoneFormat-BeYxRN0i.js} +1 -1
  13. package/dist/CPhoneInput-UzZkxbC6.js +138 -0
  14. package/dist/{CPriceInput-jktMjvwx.js → CPriceInput-C2y_3PM7.js} +2 -2
  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-DLtFhJya.js → ClientModal-DNcf4APF.js} +77 -42
  19. package/dist/{ColorPicker-MQmVGbvm.js → ColorPicker-BupC4jvI.js} +2 -2
  20. package/dist/{CompanyModal-Qx5xMku0.js → CompanyModal-Bh8mEHE1.js} +25 -19
  21. package/dist/{ContentWrapper-B9NQqp2q.js → ContentWrapper-Bs3nrJda.js} +11 -11
  22. package/dist/CoverBlockSettings-WYZsCdky.js +659 -0
  23. package/dist/{DocAnswer-BlxFv_Gc.js → DocAnswer--FfsnnTB.js} +2 -2
  24. package/dist/{DocDetails-dGcYGJpp.js → DocDetails-Ce7bj-qO.js} +10 -10
  25. package/dist/{DocForm-C6o_XBcW.js → DocForm-FR_Vlq_C.js} +512 -498
  26. package/dist/{DocFormSend-_prtxNIf.js → DocFormSend-DcSv3JNg.js} +14 -15
  27. package/dist/{DocLinks-Dp495SCS.js → DocLinks-Bvhc62aJ.js} +2 -2
  28. package/dist/{DocModalBase-B0wYq3ft.js → DocModalBase-DkfUBRi3.js} +2 -2
  29. package/dist/{DocPrint-CURxofeU.js → DocPrint-BrKY6rOy.js} +3 -3
  30. package/dist/{DocReceipt-DgGcBRVH.js → DocReceipt-oGrM6t_k.js} +25 -20
  31. package/dist/{DocSendReminder-CPty4svi.js → DocSendReminder-veEC_yHK.js} +19 -16
  32. package/dist/{DocTextEditor-BYsXFRLg.js → DocTextEditor-CNRwxPEx.js} +13 -15
  33. package/dist/{DocTimeline-CHg1QykR.js → DocTimeline-e2Xf_QZ7.js} +36 -34
  34. package/dist/{DocumentClient-CZ6N73pQ.js → DocumentClient-Dx4Uyxkh.js} +5 -5
  35. package/dist/{DocumentLayout-CiszuoQc.js → DocumentLayout-DmjmsTcx.js} +1503 -1539
  36. package/dist/{DocumentLogotype-BgFCWcwC.js → DocumentLogotype-ddYHM9wn.js} +18 -15
  37. package/dist/{DocumentVoided-DT2hhHk2.js → DocumentVoided-WCk7XuxH.js} +1 -1
  38. package/dist/{EmbedInput-aLmvzK1I.js → EmbedInput-CMueXdFs.js} +25 -21
  39. package/dist/{EmbedSettings-BZipciy9.js → EmbedSettings-BRuLCWr0.js} +13 -11
  40. package/dist/{ErrorCallout-CNxSDsr_.js → ErrorCallout-CDtZceLU.js} +6 -6
  41. package/dist/{FilePreviewModal-DxdksQiy.js → FilePreviewModal-BzAUuY58.js} +3 -3
  42. package/dist/Flag-DkJgyDQK.js +46 -0
  43. package/dist/{HeaderSettings-DeoSRi6O.js → HeaderSettings-CoKK5Mbt.js} +155 -110
  44. package/dist/{ImageSelectModal-DvQz2VPi.js → ImageSelectModal-De64vGSr.js} +6 -6
  45. package/dist/{ImageUploadWrapper-CNQRdHF9.js → ImageUploadWrapper-CE6KTze0.js} +3 -3
  46. package/dist/{Index-PUFeH_1z.js → Index-50KxppUS.js} +4 -4
  47. package/dist/{Index-FC1UsElU.js → Index-B7vVIRFn.js} +7 -7
  48. package/dist/{Index-Cfc0Q0AG.js → Index-BUQ75xOU.js} +6 -6
  49. package/dist/{Index-CWj2vDHc.js → Index-BVKCCkQY.js} +49 -44
  50. package/dist/{Index-BglKAnNq.js → Index-BiGT3iEX.js} +7 -7
  51. package/dist/{Index-B3Q09phm.js → Index-BoDKKVvL.js} +4 -4
  52. package/dist/{Index-Ch5j2tqD.js → Index-BotY9nbP.js} +2 -2
  53. package/dist/{Index-D-l3i9vY.js → Index-BwaJW9CY.js} +3 -3
  54. package/dist/{Index-BIv8flFB.js → Index-ByqCyUgx.js} +9 -9
  55. package/dist/{Index-B9_POjpY.js → Index-C7pge7E9.js} +23 -21
  56. package/dist/{Index-CJeSVpRh.js → Index-CBRJ-AZi.js} +2 -2
  57. package/dist/{Index-CePHdKi2.js → Index-CFQMtx5w.js} +5 -5
  58. package/dist/{Index-CXibuEkU.js → Index-CJKyHWiO.js} +15 -15
  59. package/dist/{Index-BDCgilFk.js → Index-CK_5l1kP.js} +2 -2
  60. package/dist/{Index-jIIHHGh3.js → Index-CLc_11Bc.js} +489 -471
  61. package/dist/{Index-D1NwTUs-.js → Index-CTokKHJA.js} +5 -5
  62. package/dist/Index-Cf45UGbc.js +28 -0
  63. package/dist/{Index-CjfCyQlB.js → Index-CfLPq-yA.js} +5 -5
  64. package/dist/{Index-CTk6Nh-I.js → Index-Ci7y3O0G.js} +7 -7
  65. package/dist/{Index-BEpKb8IR.js → Index-CmV8oF4Q.js} +4 -4
  66. package/dist/{Index-C-CE21WK.js → Index-CoRuYEYW.js} +5 -5
  67. package/dist/{Index-S3LqU0A0.js → Index-CtKNyVUB.js} +12 -10
  68. package/dist/{Index-BiVwDgqW.js → Index-DCf6_Zd2.js} +2 -2
  69. package/dist/{Index-3bD76d9q.js → Index-DGdlZzVO.js} +7 -7
  70. package/dist/{Index-CTqdaykO.js → Index-DbKB8sTh.js} +18 -12
  71. package/dist/{Index-BNJ2KHKc.js → Index-DgBOq2MJ.js} +3 -3
  72. package/dist/{Index-BeMeWDIf.js → Index-DvNxOHHu.js} +6 -6
  73. package/dist/{Index-CvRNeJ4U.js → Index-M2Mce2_m.js} +124 -123
  74. package/dist/{Index-CDKq7Fx6.js → Index-QMkjG7hk.js} +4 -4
  75. package/dist/{Index-q04Dwxrr.js → Index-QmX5pv-V.js} +7 -7
  76. package/dist/{Index-w5DWfGOc.js → Index-h5xDFYM9.js} +4 -4
  77. package/dist/{Index-CPjAXBMU.js → Index-hkGYloih.js} +5 -5
  78. package/dist/{Index-B0n1UOOA.js → Index-q3gLm4b1.js} +6 -6
  79. package/dist/{Index-BjdxeF4C.js → Index-sqI1TF7Z.js} +2 -2
  80. package/dist/{InputToggleRow-CvHvRdsn.js → InputToggleRow-DLFIMIdx.js} +2 -2
  81. package/dist/{ManualPopover-DxE-6-Sp.js → ManualPopover-Cf8DotlW.js} +1 -1
  82. package/dist/{MediaWrapper-DNi80fbw.js → MediaWrapper-BgWmA3kS.js} +3 -3
  83. package/dist/{NotBindingText-D2rYFVxr.js → NotBindingText-DhsHxvkX.js} +2 -2
  84. package/dist/{PackageGroup-6ar8HjPo.js → PackageGroup-EbOSxv69.js} +26 -20
  85. package/dist/PdfTerms-im6uTd5E.js +31 -0
  86. package/dist/{PdfViewer-B5qbLLtd.js → PdfViewer-DY0rcZjo.js} +5 -5
  87. package/dist/{PlainHtml-CIMtcn2F.js → PlainHtml-o031pfp-.js} +1 -1
  88. package/dist/{PriceHeader-BSpj_-5M.js → PriceHeader-NdFa0Sqs.js} +15 -15
  89. package/dist/{SearchApi-Cwgf52EV.js → SearchApi-Bw5E9IPj.js} +2 -2
  90. package/dist/SendForm-BDY5VDkS.js +1023 -0
  91. package/dist/{Setup-CRmiH9lD.js → Setup-BsYqPmOm.js} +1 -1
  92. package/dist/{SmartList-D6AvxfSL.js → SmartList-CP2wHig-.js} +1 -1
  93. package/dist/{TermsSettings-DEO1O460.js → TermsSettings-CUlSayCJ.js} +17 -12
  94. package/dist/{ThemeColorRow-Cy1NKEIG.js → ThemeColorRow-D3fav4Sl.js} +4 -4
  95. package/dist/{ToggleBinding-BvIUt1Jx.js → ToggleBinding-B715OVl2.js} +12 -10
  96. package/dist/{UploadModal-C1j-GeMD.js → UploadModal-THDJ-UNp.js} +6 -6
  97. package/dist/{VideoPlayerInput-BmbrquN6.js → VideoPlayerInput-Cm3KoRnR.js} +15 -11
  98. package/dist/{VideoPlayerSettings-B7HpBoWX.js → VideoPlayerSettings-BFAjczuw.js} +3 -3
  99. package/dist/{VideoSelectModal-CeaG2tME.js → VideoSelectModal-CzO8EMg9.js} +4 -4
  100. package/dist/{answerDocumentMixin-AcDG8Byi.js → answerDocumentMixin-D12xJRhx.js} +3 -3
  101. package/dist/{debounce-HJoaSvIY.js → debounce-DLiv1sQX.js} +16 -16
  102. package/dist/{focusDrawerMixin-CBYjpEGL.js → focusDrawerMixin-khaScuSu.js} +1 -1
  103. package/dist/{formDrawerState-DYSBcjo4.js → formDrawerState-CJ6kjaD_.js} +1 -1
  104. package/dist/{formValidationMixin-Dqlhg0R2.js → formValidationMixin-Bri1WflH.js} +1 -1
  105. package/dist/{index-zzCfHTf8.js → index-B0Zu30kF.js} +2 -2
  106. package/dist/{index-CFx0cpeM.js → index-C1Ngv-v3.js} +1 -1
  107. package/dist/{index-CKZmpLr6.js → index-CMT3coT-.js} +781 -2021
  108. package/dist/{index-CLOsPxCh.js → index-DJOUQneq.js} +35 -33
  109. package/dist/{index-CFwLDxbi.js → index-DLa3QER7.js} +18 -17
  110. package/dist/{index-CFe1BJZJ.js → index-Dygy9XlG.js} +1 -1
  111. package/dist/index.es.js +10 -10
  112. package/dist/index.umd.js +177 -173
  113. package/dist/{main-BIwKzAN8.js → main-U22_wtg0.js} +13008 -11358
  114. package/dist/{mapFormMixin-e2PJ431T.js → mapFormMixin-BZf4RJIE.js} +1 -1
  115. package/dist/omit-RBXmF_Fo.js +31 -0
  116. package/dist/{publicSenderState-D-_7UwjT.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-B2yMLA5N.js → throttle-Fkuqk26x.js} +2 -2
  121. package/dist/{tinycolor-vIxz4Xgi.js → tinycolor-BZ8wGctU.js} +1 -1
  122. package/dist/{tippy.esm-DiOYviyf.js → tippy.esm-BJe845c1.js} +208 -206
  123. package/dist/{utils-CFXqaEy7.js → utils-BOWVR87A.js} +1 -1
  124. package/dist/{vuedraggable.umd-DDT8qZBI.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-B3z6RPXr.js +0 -82
  129. package/dist/CoverBlockSettings-Bcz_W5I3.js +0 -275
  130. package/dist/Flag-3OyFDPsP.js +0 -114
  131. package/dist/Index-Cr6DlYGN.js +0 -21
  132. package/dist/PdfTerms-B-lbU_6H.js +0 -36
  133. package/dist/formComponentsInstall-DMoWrprH.js +0 -2505
  134. package/dist/omit-CpamclWf.js +0 -31
@@ -1,2505 +0,0 @@
1
- import { m as p } from "./mapFormMixin-e2PJ431T.js";
2
- import { I as L, a as H, r as l } from "./index-CKZmpLr6.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-BIwKzAN8.js";
4
- import { B as R } from "./BaseDatePicker-C27CsTzy.js";
5
- import { E as Y } from "./ErrorCallout-CNxSDsr_.js";
6
- import { s as G, F as J } from "./Flag-3OyFDPsP.js";
7
- import { b as Z, m as v } from "./vuex.esm-DKGl8mcw.js";
8
- import ee from "./AddClientCallout-8s5a1_CZ.js";
9
- import te from "./ClientModal-DLtFhJya.js";
10
- import { c as ie, r as se, g as ne, C as f, a as g, b as h } from "./CDropdownItem-BSPNul90.js";
11
- import "./CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js";
12
- import { C as b } from "./CCallout-CQjRcxpC.js";
13
- import { a as ae, C as re } from "./CFormField-Cz_jNazS.js";
14
- import { S as oe } from "./SmartList-D6AvxfSL.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
- } }, scopedSlots: e._u([{ key: "trigger", fn: function() {
318
- return [i("CButton", { attrs: { circle: "", size: "small", type: "none", pattern: "secondary", raised: "", icon: "more-horizontal" } })];
319
- }, proxy: !0 }], null, !1, 383536082) }, [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) {
320
- return n.stopPropagation(), e.$emit("remove");
321
- } } }) : e._e()] : e._e()], 2) : e._e()], 2);
322
- }, ve = [], ye = /* @__PURE__ */ o(
323
- fe,
324
- ge,
325
- ve,
326
- !1,
327
- null,
328
- "cc1fbfb5"
329
- );
330
- const N = ye.exports, _e = {
331
- name: "SenderBlockItem",
332
- i18nOptions: {
333
- namespaces: "senderBlockItem",
334
- messages: {
335
- en: {
336
- toggle: {
337
- label: "Sign the document",
338
- description: "Toggle to add your own signature to the document."
339
- }
340
- },
341
- sv: {
342
- toggle: {
343
- label: "Signera dokumentet",
344
- description: "Aktivera för att lägga till din signatur på dokumentet."
345
- }
346
- }
347
- }
348
- },
349
- components: {
350
- RecipientBlockItem: N
351
- },
352
- mixins: [
353
- p(["senderClient"], {
354
- useEmit: !1,
355
- setFnName: "setFormValue"
356
- })
357
- ],
358
- inject: {
359
- allowSenderSign: {
360
- default: !0
361
- }
362
- },
363
- props: {
364
- setFormValue: {
365
- type: Function,
366
- required: !0
367
- },
368
- defaultAddSenderClient: {
369
- type: Boolean,
370
- default: !1
371
- }
372
- },
373
- data() {
374
- return {
375
- senderClientData: null
376
- };
377
- },
378
- computed: {
379
- ...v({
380
- feature: "application/feature"
381
- })
382
- },
383
- created() {
384
- this.generateSenderClient(), this._document.id || this._document.isDirty("senderClient") ? this.toggleSenderSign(!!this.senderClient) : this.defaultAddSenderClient && this.toggleSenderSign(!0);
385
- },
386
- methods: {
387
- get: c,
388
- generateSenderClient() {
389
- const { company: t, user: e } = this._document.sender || {}, i = c(
390
- this._document,
391
- "data.defaultAnswerMethod"
392
- );
393
- this.senderClientData = {
394
- ...j(),
395
- documentRole: "recipient",
396
- ...i && { answerMethod: i },
397
- ...this.senderClient,
398
- // latest sender values in the document
399
- type: "company",
400
- companyName: t.name,
401
- name: e.name,
402
- email: e.email,
403
- cellphone: e.cellphone
404
- };
405
- },
406
- toggleSenderSign(t) {
407
- this.senderClientData.documentRole = t ? "signee" : "recipient", this.senderClient = t ? this.senderClientData : null, this._document.setDirty("senderClient");
408
- },
409
- setSenderMethod(t) {
410
- const e = {
411
- ...this.senderClient,
412
- answerMethod: {
413
- accept: t,
414
- deny: "button"
415
- }
416
- };
417
- this.senderClient = e, this.senderClientData = { ...e };
418
- }
419
- }
420
- };
421
- var be = function() {
422
- var e = this, i = e._self._c;
423
- 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 }, scopedSlots: e._u([{ key: "dropdownOptions", fn: function() {
424
- return [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([
425
- "login",
426
- "signature",
427
- ...e.feature("bankId") ? ["bankId"] : []
428
- ], function(s) {
429
- return i("CDropdownItem", { key: s, attrs: { "icon-right": e.get(e.senderClient, "answerMethod.accept") === s ? "check" : "" }, on: { click: function(n) {
430
- return e.setSenderMethod(s);
431
- } } }, [e._v(" " + e._s(e.$t(`_common:signMethod.${s}`)) + " ")]);
432
- })] : 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")) + " ")])];
433
- }, proxy: !0 }], null, !1, 407561968) }) : e._e();
434
- }, Ce = [], we = /* @__PURE__ */ o(
435
- _e,
436
- be,
437
- Ce,
438
- !1,
439
- null,
440
- "2303d81a"
441
- );
442
- const xe = we.exports, Se = {
443
- name: "RecipientBlock",
444
- i18nOptions: {
445
- namespaces: "recipientBlock",
446
- messages: he
447
- },
448
- components: {
449
- AddClientCallout: ee,
450
- RecipientBlockItem: N,
451
- SenderBlockItem: xe
452
- },
453
- mixins: [
454
- p(["clients"], {
455
- useEmit: !1,
456
- setFnName: "setFormValue"
457
- })
458
- ],
459
- props: {
460
- compact: {
461
- type: Boolean,
462
- default: !1
463
- },
464
- setFormValue: {
465
- type: Function,
466
- required: !0
467
- },
468
- removeFormValue: {
469
- type: Function,
470
- required: !0
471
- },
472
- defaultAddSenderClient: {
473
- type: Boolean,
474
- default: !1
475
- },
476
- allowEditClients: {
477
- type: Boolean,
478
- default: !0
479
- },
480
- isPublicForm: {
481
- type: Boolean,
482
- default: !1
483
- }
484
- },
485
- computed: {
486
- sortedClients() {
487
- return [...this.clients].map((t, e) => ({ ...t, index: e })).sort((t, e) => t.signOrder - e.signOrder);
488
- },
489
- maxSignOrder() {
490
- if (!this.useSignOrder || this.sortedClients.length === 0)
491
- return 0;
492
- const { signOrder: t } = this.sortedClients[this.sortedClients.length - 1];
493
- return t;
494
- },
495
- useSignOrder() {
496
- return c(this._document, "useSignOrder", !1);
497
- }
498
- },
499
- methods: {
500
- onMoveRecipient({ index: t, direction: e }) {
501
- this.clients = K(this.clients).set(
502
- {
503
- ...this.clients[t],
504
- signOrder: Math.max(this.clients[t].signOrder + e, 0)
505
- },
506
- t
507
- );
508
- },
509
- toggleSignOrder(t) {
510
- let e = [];
511
- if (t) {
512
- const i = !this.clients.every(
513
- ({ signOrder: s }) => !s
514
- );
515
- this.clients = this.clients.map((s, n) => ({
516
- ...s,
517
- signOrder: i ? s.signOrder : n + 1
518
- }));
519
- } else
520
- e = c(this._document, "template.reminders", []), e.length || (e = B.default);
521
- this.setFormValue({ key: "data.reminders", value: e }), this.setFormValue({ key: "useSignOrder", value: t });
522
- },
523
- removeClient(t) {
524
- this.removeFormValue(`clients[${t}]`);
525
- },
526
- openClientModal(t = 0) {
527
- var i;
528
- const e = c(this, `clients[${t}].signOrder`);
529
- this.$modal.show(te, {
530
- documentClientIndex: t,
531
- ...this.useSignOrder && {
532
- signOrder: W(e) === "number" ? e : this.maxSignOrder + 1
533
- },
534
- signOptions: (i = this._document) == null ? void 0 : i.signOptions,
535
- setFormValue: this.setFormValue,
536
- removeFormValue: this.removeFormValue,
537
- isPublicForm: this.isPublicForm
538
- });
539
- },
540
- setClient(t) {
541
- this.setFormValue({ key: `clients[${this.clients.length}]`, value: t });
542
- }
543
- }
544
- };
545
- var ke = function() {
546
- var e = this, i = e._self._c;
547
- 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) {
548
- 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: {
549
- "first-of-group": n === 0 || n > 0 && s.signOrder !== e.sortedClients[n - 1].signOrder,
550
- "last-of-group": n === e.sortedClients.length - 1 || e.sortedClients[n + 1] && s.signOrder !== e.sortedClients[n + 1].signOrder
551
- }, attrs: { client: s, "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients }, on: { move: function(a) {
552
- return e.onMoveRecipient({ index: s.index, direction: a });
553
- }, open: function(a) {
554
- return e.openClientModal(s.index);
555
- }, remove: function(a) {
556
- return e.removeClient(s.index);
557
- } } })], 1)];
558
- })], 2) : e._l(e.clients, function(s, n) {
559
- return i("RecipientBlockItem", { key: s._uniqueId, staticClass: "mb-0.5 mt-px", class: {
560
- "first-of-group": n === 0,
561
- "last-of-group": n === e.clients.length - 1
562
- }, attrs: { "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients, client: s }, on: { open: function(a) {
563
- return e.openClientModal(n);
564
- }, remove: function(a) {
565
- return e.removeClient(n);
566
- } } });
567
- }), !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) {
568
- return e.openClientModal(e.clients.length);
569
- } } }, [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) {
570
- return e.openClientModal(e.clients.length);
571
- } } }, [e._v(" " + e._s(e.$t("addFirstButton")) + " ")]) : !e.compact && e.allowEditClients ? i("AddClientCallout", { attrs: { compact: !0 }, on: { add: function(s) {
572
- return e.openClientModal(e.clients.length);
573
- }, setClient: e.setClient } }) : e._e()], 2);
574
- }, $e = [], De = /* @__PURE__ */ o(
575
- Se,
576
- ke,
577
- $e,
578
- !1,
579
- null,
580
- "51e072f2"
581
- );
582
- const Ve = De.exports, Fe = {
583
- name: "DocumentSendReminderItem",
584
- props: {
585
- label: {
586
- type: String,
587
- required: !0
588
- },
589
- value: {
590
- type: [Number, String],
591
- default: 0
592
- },
593
- done: {
594
- type: Boolean,
595
- default: !1
596
- }
597
- }
598
- };
599
- var Ae = function() {
600
- var e = this, i = e._self._c;
601
- 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) {
602
- e.$emit("input", Math.max(e.value - 1, 0));
603
- } } }), 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) {
604
- return e.$emit("input", e.value + 1);
605
- } } })]], 2)]);
606
- }, Oe = [], Be = /* @__PURE__ */ o(
607
- Fe,
608
- Ae,
609
- Oe,
610
- !1,
611
- null,
612
- null
613
- );
614
- const Ie = Be.exports, Te = {
615
- name: "DocumentSendReminders",
616
- i18nOptions: {
617
- namespaces: "documentSendReminders",
618
- messages: {
619
- en: {
620
- description: "Edit when smart reminders should be sent to client",
621
- notViewed: "Not viewed after",
622
- notAnswered: "No reply after",
623
- expires: "When expiration date is within"
624
- },
625
- sv: {
626
- description: "Ställ in när smarta påminnelser ska skickas ut till mottagaren",
627
- notViewed: "Inte öppnat efter",
628
- notAnswered: "Inte svarat efter",
629
- expires: "När giltighetstiden är inom"
630
- }
631
- }
632
- },
633
- components: {
634
- DocumentSendReminderItem: Ie
635
- },
636
- mixins: [p()],
637
- props: {
638
- setFormValue: {
639
- type: Function,
640
- required: !0
641
- },
642
- removeFormValue: {
643
- type: Function,
644
- required: !0
645
- }
646
- },
647
- computed: {
648
- reminders() {
649
- const t = {
650
- first: null,
651
- notViewed: null,
652
- notAnswered: null,
653
- expires: null
654
- };
655
- return this._document.reminders.forEach((e, i) => {
656
- 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 };
657
- }), t;
658
- }
659
- },
660
- methods: {
661
- getDefaultReminders() {
662
- if (!this._document.template)
663
- return [];
664
- const t = this._document.template.getDefaultData({
665
- path: "properties.data.properties.reminders"
666
- });
667
- return t && Array.isArray(t) ? t : [];
668
- },
669
- setReminder(t, e) {
670
- let i = "sendDays";
671
- if (typeof e == "string" && (i = "sendAt"), !e) {
672
- this.removeFormValue(`data.reminders[${t.index}]`);
673
- return;
674
- }
675
- if (typeof t == "string") {
676
- let s = this.getDefaultReminders().find(
677
- (n) => n.type === t
678
- );
679
- if (s || (s = B.default.find((n) => n.type === t)), !s)
680
- throw new Error("Could not find default reminder");
681
- s[i] = e, this.setFormValue({ key: "data.reminders", value: s });
682
- return;
683
- }
684
- this.setFormValue({
685
- key: `data.reminders[${t.index}].${i}`,
686
- value: e
687
- });
688
- }
689
- }
690
- };
691
- var Pe = function() {
692
- var e = this, i = e._self._c;
693
- 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([
694
- { type: "notViewed", fallbackKey: "viewed" },
695
- { type: "notAnswered", fallbackKey: "reminder" },
696
- { type: "expires", fallbackKey: "expires" }
697
- ], function(s, n) {
698
- 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) {
699
- return e.setReminder(e.reminders[s.type] || s.fallbackKey, a);
700
- } } });
701
- }), 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) {
702
- return e.$emit("close");
703
- } } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])], 1)], 2);
704
- }, Me = [], Re = /* @__PURE__ */ o(
705
- Te,
706
- Pe,
707
- Me,
708
- !1,
709
- null,
710
- null
711
- );
712
- const ze = Re.exports, Ee = {
713
- name: "SendForm",
714
- i18nOptions: {
715
- namespaces: "sendForm",
716
- messages: pe
717
- },
718
- components: {
719
- Simplebar: G,
720
- BaseDatePicker: R,
721
- RecipientBlock: Ve,
722
- ErrorCallout: Y,
723
- IsPremiumPreStep: L,
724
- IsPremium: H
725
- },
726
- mixins: [
727
- p(
728
- ["expiresAt", "clients", "defaultAnswerMethod", "reminders", "name"],
729
- {
730
- useEmit: !1,
731
- setFnName: "setFormValue"
732
- }
733
- )
734
- ],
735
- props: {
736
- showName: {
737
- type: Boolean,
738
- default: !0
739
- },
740
- showSave: {
741
- type: Boolean,
742
- default: !0
743
- },
744
- showSchedule: {
745
- type: Boolean,
746
- default: !0
747
- },
748
- allowManualDelivery: {
749
- type: Boolean,
750
- default: !0
751
- },
752
- allowEditClients: {
753
- type: Boolean,
754
- default: !0
755
- },
756
- setFormValue: {
757
- type: Function,
758
- required: !0
759
- },
760
- removeFormValue: {
761
- type: Function,
762
- required: !0
763
- },
764
- useScroll: {
765
- type: Boolean,
766
- default: !1
767
- },
768
- onSaveDocument: {
769
- type: Function,
770
- required: !0
771
- }
772
- },
773
- data() {
774
- return {
775
- localIsPosting: !1,
776
- clientHoverIndex: null
777
- };
778
- },
779
- computed: {
780
- ...v({
781
- deliveryTypes: "forms/deliveryTypes",
782
- isPostingDocument: "documents2/isPosting",
783
- documentSenderSign: "settings/documentSenderSign",
784
- // todo: could be moved to load form action
785
- getCompanySetting: "settings/getCompanySetting",
786
- feature: "application/feature"
787
- }),
788
- isPosting() {
789
- return this.isPostingDocument || this.localIsPosting;
790
- },
791
- isPublicForm() {
792
- return !!(this.viewSettings && this.viewSettings.isPublicForm);
793
- },
794
- useSignOrder() {
795
- var t;
796
- return ((t = this._document) == null ? void 0 : t.useSignOrder) || !1;
797
- },
798
- noOfReminders() {
799
- return Object.values(this.reminders || []).reduce(
800
- (t, e) => e && (e.sendDays || e.sendAt) && e.type !== "first" ? t + 1 : t,
801
- 0
802
- );
803
- },
804
- smsActivated() {
805
- return this.deliveryTypes.sms;
806
- },
807
- emailActivated() {
808
- return this.deliveryTypes.email;
809
- },
810
- isManualDelivery() {
811
- return !this.smsActivated && !this.emailActivated;
812
- },
813
- sendTypesText() {
814
- return this.emailActivated || this.smsActivated ? [
815
- ...this.emailActivated ? [this.$t("_common:email").capitalize()] : [],
816
- ...this.smsActivated ? [this.$t("_common:sms")] : []
817
- ].join(" & ") : this._document.isDirty("isManualDelivery") && this.clients.length ? this.$t("manualDelivery") : " ";
818
- },
819
- clientsAreMissingContactInfo() {
820
- return this.isManualDelivery ? !1 : this.clients.some((t) => !(t.email || t.cellphone));
821
- },
822
- signMethods() {
823
- var t, e;
824
- return ((e = (t = this._document.signOptions) == null ? void 0 : t.filter((i) => i !== "inPerson")) == null ? void 0 : e.map((i) => ({
825
- value: i,
826
- title: this.$t(`signMethod.${i}.title`),
827
- content: this.$t(`signMethod.${i}.content`)
828
- }))) || [];
829
- }
830
- },
831
- created() {
832
- var t;
833
- if (!this.expiresAt && !this._document.isDirty("expiresAt")) {
834
- const e = this.getCompanySetting("defaultExpireDays");
835
- if (e && Number.isInteger(e) && e > 0) {
836
- const i = /* @__PURE__ */ new Date();
837
- i.setDate(i.getDate() + e), this.setField({
838
- field: "expiresAt",
839
- value: i.toISOString(),
840
- options: { ignoreChanges: !0 }
841
- });
842
- }
843
- }
844
- if (((t = this.defaultAnswerMethod) == null ? void 0 : t.accept) === "button") {
845
- const [e] = this._document.signOptions || ["signature"];
846
- this.setAnswerMethod(e, { ignoreChanges: !0 });
847
- }
848
- },
849
- validations() {
850
- const t = {
851
- clients: {
852
- required: (e) => e && e.length
853
- }
854
- };
855
- return !this.allowManualDelivery && this.clients.length && (t.isManualDelivery = {
856
- checked: (e) => !e
857
- }), t;
858
- },
859
- methods: {
860
- async doSaveDocument({ doSend: t }) {
861
- try {
862
- this.localIsPosting = !0, await this.onSaveDocument({ doSend: t });
863
- } finally {
864
- this.localIsPosting = !1;
865
- }
866
- },
867
- async doSendDocument() {
868
- var t;
869
- 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 }));
870
- },
871
- setDeliveryMethod(t, e) {
872
- const i = this.deliveryTypes;
873
- i[t] = e;
874
- const s = Object.keys(i).filter((n) => i[n]);
875
- (this.clients || []).forEach((n, a) => {
876
- this.setFormValue({
877
- key: `clients[${a}].deliveryTypes`,
878
- value: s
879
- });
880
- });
881
- },
882
- setAnswerMethod(t, e = {}) {
883
- this.setField({
884
- field: "defaultAnswerMethod",
885
- value: { ...this.defaultAnswerMethod, accept: t },
886
- options: e
887
- }), (this.clients || []).forEach((i, s) => {
888
- var n;
889
- ((n = i.answerMethod) == null ? void 0 : n.accept) !== "inPerson" && this.setField({
890
- key: `clients[${s}].answerMethod.accept`,
891
- value: t,
892
- options: e
893
- });
894
- });
895
- },
896
- openReminders() {
897
- this.useSignOrder || this.$modal.show(
898
- ze,
899
- {
900
- _document: this._document,
901
- setFormValue: this.setFormValue,
902
- removeFormValue: this.removeFormValue
903
- },
904
- {
905
- adaptive: !0,
906
- height: "auto",
907
- width: "90%",
908
- maxWidth: 360
909
- }
910
- );
911
- },
912
- openSendLater() {
913
- this.$v.$touch(), !this.$v.$invalid && this.$modal.show(
914
- me,
915
- {
916
- _document: this._document,
917
- setFormValue: this.setFormValue,
918
- removeFormValue: this.removeFormValue,
919
- onSaveDocument: this.doSaveDocument
920
- },
921
- {
922
- adaptive: !0,
923
- height: "auto",
924
- width: "90%",
925
- maxWidth: 360
926
- }
927
- );
928
- },
929
- resetDeniedDocument() {
930
- (this.clients || []).forEach((t, e) => {
931
- this.setFormValue({ key: `clients[${e}].answer`, value: null });
932
- }), this.setFormValue({ key: "data.rejectReasons", value: [] }), this.setFormValue({ key: "status", value: "sent" });
933
- },
934
- shouldShowUpgradeModal({ canUseBankId: t, canUseSms: e }) {
935
- var i;
936
- return !!(this.smsActivated && !e || ((i = this.defaultAnswerMethod) == null ? void 0 : i.accept) === "bankId" && !t);
937
- }
938
- }
939
- };
940
- var Ne = function() {
941
- var e = this, i = e._self._c;
942
- return i("IsPremium", { scopedSlots: e._u([{ key: "default", fn: function({ canUseBankId: s, canUseSms: n }) {
943
- var a;
944
- 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) {
945
- e.name = r;
946
- }, expression: "name" } })], 1) : e._e(), i("div", { staticClass: "mb-6" }, [i("RecipientBlock", { attrs: { _value: {
947
- clients: "clients"
948
- }, _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) {
949
- return i("div", { key: r.value, staticClass: "cb-card flex border-2 border-transparent hover:border-gray-300/30 hover:bg-gray-200", class: {
950
- checked: e.defaultAnswerMethod.accept === r.value
951
- }, on: { click: function(d) {
952
- e.defaultAnswerMethod.accept !== r.value && e.setAnswerMethod(r.value);
953
- } } }, [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);
954
- }), 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) {
955
- e.expiresAt = r;
956
- }, 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) {
957
- r.preventDefault(), r.stopPropagation(), e.expiresAt = void 0, e._document.setDirty("expiresAt");
958
- } } }) : e._e()], 1)], 1), i("CDropdown", { staticStyle: { flex: "1 0 200px" }, attrs: { disabled: !e.clients.length, "mobile-label": e.$t("sendAs"), expanded: "" }, scopedSlots: e._u([{ key: "trigger", fn: function() {
959
- return [i("div", { staticClass: "psuedo-input", attrs: { tabindex: "0" } }, [i("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("sendAs")))]), i("div", { domProps: { innerHTML: e._s(e.sendTypesText) } })])];
960
- }, proxy: !0 }], null, !0) }, [i("CDropdownItem", { attrs: { value: e.emailActivated, "close-on-click": !1, toggle: "" }, on: { click: function(r) {
961
- return e.setDeliveryMethod("email", !e.emailActivated);
962
- } } }, [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) {
963
- return e.setDeliveryMethod("sms", !e.smsActivated);
964
- } } }, [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: {
965
- content: e.$t("manualDeliveryTooltip")
966
- } }, domProps: { textContent: e._s(e.$t("manualDelivery")) }, on: { click: () => {
967
- e.setDeliveryMethod("sms", !1), e.setDeliveryMethod("email", !1), e._document.setDirty("isManualDelivery");
968
- } } }) : 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) {
969
- r.preventDefault(), r.stopPropagation(), e.reminders = [];
970
- } } }) : 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() {
971
- return [i("IsPremiumPreStep", { attrs: { feature: "bankIdAndSms" }, scopedSlots: e._u([{ key: "default", fn: function({ onClick: r }) {
972
- return [i("div", { staticClass: "flex" }, [e.showSave ? i("CButton", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("_common:save", {
973
- thing: e.$t("_common:document").toLowerCase()
974
- }), expression: `
975
- $t('_common:save', {
976
- thing: $t('_common:document').toLowerCase()
977
- })
978
- ` }], staticClass: "mr-2 w-12", attrs: { loading: e.isPosting, type: "none", icon: "save", pattern: "secondary" }, on: { click: function(d) {
979
- return e.doSaveDocument({ doSend: !1 });
980
- } } }) : 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 ? {
981
- content: e.clients.length ? e.$t("missingDeliveryMethod") : e.$t(
982
- "components:account.documentForm.clients.errorMessage"
983
- )
984
- } : {}, expression: `
985
- $v.$invalid
986
- ? {
987
- content: !clients.length
988
- ? $t(
989
- 'components:account.documentForm.clients.errorMessage'
990
- )
991
- : $t('missingDeliveryMethod')
992
- }
993
- : {}
994
- ` }], 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) {
995
- e.shouldShowUpgradeModal({ canUseBankId: s, canUseSms: n }) ? r({
996
- data: {
997
- bankIdBlocked: !s,
998
- smsBlocked: !n
999
- }
1000
- }) : e.doSendDocument();
1001
- } } }, [e._v(" " + e._s(e.$t("sendButton")) + " ")])], 1)], 1)];
1002
- } }], null, !0) })];
1003
- }), e._t("footer")], 2)], 1)];
1004
- } }], null, !0) });
1005
- }, Le = [], He = /* @__PURE__ */ o(
1006
- Ee,
1007
- Ne,
1008
- Le,
1009
- !1,
1010
- null,
1011
- "daaaa86f"
1012
- );
1013
- const ri = He.exports, qe = {
1014
- name: "CAutocomplete",
1015
- components: {
1016
- CInput: I
1017
- },
1018
- mixins: [T],
1019
- inheritAttrs: !1,
1020
- props: {
1021
- value: {
1022
- type: [Number, String],
1023
- default: null
1024
- },
1025
- data: {
1026
- type: Array,
1027
- default: () => []
1028
- },
1029
- field: {
1030
- type: String,
1031
- default: "value"
1032
- },
1033
- keepFirst: Boolean,
1034
- clearOnSelect: Boolean,
1035
- openOnFocus: Boolean,
1036
- customFormatter: {
1037
- type: Function,
1038
- default: () => {
1039
- }
1040
- },
1041
- checkInfiniteScroll: Boolean,
1042
- keepOpen: Boolean,
1043
- clearable: Boolean,
1044
- maxHeight: {
1045
- type: [String, Number],
1046
- default: null
1047
- },
1048
- dropdownPosition: {
1049
- type: String,
1050
- default: "auto"
1051
- },
1052
- iconRight: {
1053
- type: String,
1054
- default: null
1055
- },
1056
- iconRightClickable: Boolean,
1057
- appendToBody: Boolean
1058
- },
1059
- data() {
1060
- return {
1061
- selected: null,
1062
- hovered: null,
1063
- isActive: !1,
1064
- newValue: this.value,
1065
- newAutocomplete: this.autocomplete || "off",
1066
- isListInViewportVertically: !0,
1067
- hasFocus: !1,
1068
- style: {},
1069
- _isAutocomplete: !0,
1070
- _elementRef: "input",
1071
- _bodyEl: void 0
1072
- // Used to append to body
1073
- };
1074
- },
1075
- computed: {
1076
- /**
1077
- * White-listed items to not close when clicked.
1078
- * Add input, dropdown and all children.
1079
- */
1080
- whiteList() {
1081
- const t = [];
1082
- if (t.push(this.$refs.input.$el.querySelector("input")), t.push(this.$refs.dropdown), this.$refs.dropdown !== void 0) {
1083
- const e = this.$refs.dropdown.querySelectorAll("*");
1084
- for (const i of e)
1085
- t.push(i);
1086
- }
1087
- if (this.$parent.$data._isTaginput) {
1088
- t.push(this.$parent.$el);
1089
- const e = this.$parent.$el.querySelectorAll("*");
1090
- for (const i of e)
1091
- t.push(i);
1092
- }
1093
- return t;
1094
- },
1095
- /**
1096
- * Check if exists default slot
1097
- */
1098
- hasDefaultSlot() {
1099
- return !!this.$scopedSlots.default;
1100
- },
1101
- /**
1102
- * Check if exists "empty" slot
1103
- */
1104
- hasEmptySlot() {
1105
- return !!this.$slots.empty;
1106
- },
1107
- /**
1108
- * Check if exists "header" slot
1109
- */
1110
- hasHeaderSlot() {
1111
- return !!this.$slots.header;
1112
- },
1113
- /**
1114
- * Check if exists "footer" slot
1115
- */
1116
- hasFooterSlot() {
1117
- return !!this.$slots.footer;
1118
- },
1119
- /**
1120
- * Apply dropdownPosition property
1121
- */
1122
- isOpenedTop() {
1123
- return this.dropdownPosition === "top" || this.dropdownPosition === "auto" && !this.isListInViewportVertically;
1124
- },
1125
- newIconRight() {
1126
- return this.clearable && this.newValue ? "close-circle" : this.iconRight;
1127
- },
1128
- newIconRightClickable() {
1129
- return this.clearable ? !0 : this.iconRightClickable;
1130
- },
1131
- contentStyle() {
1132
- return {
1133
- maxHeight: this.maxHeight === void 0 ? null : isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`
1134
- };
1135
- },
1136
- isDropdownOpen() {
1137
- return this.isActive && (this.data.length > 0 || this.hasEmptySlot || this.hasHeaderSlot);
1138
- }
1139
- },
1140
- watch: {
1141
- /**
1142
- * When dropdown is toggled, check the visibility to know when
1143
- * to open upwards.
1144
- */
1145
- isActive(t) {
1146
- this.dropdownPosition === "auto" && (t ? this.calcDropdownInViewportVertical() : setTimeout(() => {
1147
- this.calcDropdownInViewportVertical();
1148
- }, 100)), t && this.$nextTick(() => this.setHovered(null));
1149
- },
1150
- /**
1151
- * When updating input's value
1152
- * 1. Emit changes
1153
- * 2. If value isn't the same as selected, set null
1154
- * 3. Close dropdown if value is clear or else open it
1155
- */
1156
- newValue(t) {
1157
- this.$emit("input", t);
1158
- const e = this.getValue(this.selected);
1159
- e && e !== t && this.setSelected(null, !1), this.hasFocus && (!this.openOnFocus || t) && (this.isActive = !!t);
1160
- },
1161
- /**
1162
- * When v-model is changed:
1163
- * 1. Update internal value.
1164
- * 2. If it's invalid, validate again.
1165
- */
1166
- value(t) {
1167
- this.newValue = t;
1168
- },
1169
- /**
1170
- * Select first option if "keep-first
1171
- */
1172
- data(t) {
1173
- this.keepFirst && this.selectFirstOption(t);
1174
- }
1175
- },
1176
- created() {
1177
- typeof window < "u" && (document.addEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.addEventListener("resize", this.calcDropdownInViewportVertical));
1178
- },
1179
- mounted() {
1180
- if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content")) {
1181
- const t = this.$refs.dropdown.querySelector(".dropdown-content");
1182
- t.addEventListener(
1183
- "scroll",
1184
- () => this.checkIfReachedTheEndOfScroll(t)
1185
- );
1186
- }
1187
- this.appendToBody && (this.$data._bodyEl = ie(this.$refs.dropdown), this.updateAppendToBody());
1188
- },
1189
- beforeDestroy() {
1190
- typeof window < "u" && (document.removeEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.removeEventListener(
1191
- "resize",
1192
- this.calcDropdownInViewportVertical
1193
- )), 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);
1194
- },
1195
- methods: {
1196
- /**
1197
- * Set which option is currently hovered.
1198
- */
1199
- setHovered(t) {
1200
- t !== void 0 && (this.hovered = t);
1201
- },
1202
- /**
1203
- * Set which option is currently selected, update v-model,
1204
- * update input value and close dropdown.
1205
- */
1206
- setSelected(t, e = !0) {
1207
- 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(() => {
1208
- this.isActive = !1;
1209
- }), this.checkValidity());
1210
- },
1211
- /**
1212
- * Select first option
1213
- */
1214
- selectFirstOption(t) {
1215
- this.$nextTick(() => {
1216
- t.length ? (this.openOnFocus || this.newValue !== "" && this.hovered !== t[0]) && this.setHovered(t[0]) : this.setHovered(null);
1217
- });
1218
- },
1219
- /**
1220
- * Enter key listener.
1221
- * Select the hovered option.
1222
- */
1223
- enterPressed(t) {
1224
- this.isDropdownOpen && (t.preventDefault(), this.hovered !== null && this.setSelected(this.hovered, !this.keepOpen));
1225
- },
1226
- /**
1227
- * Tab key listener.
1228
- * Select hovered option if it exists, close dropdown, then allow
1229
- * native handling to move to next tabbable element.
1230
- */
1231
- tabPressed() {
1232
- if (this.hovered === null) {
1233
- this.isActive = !1;
1234
- return;
1235
- }
1236
- this.setSelected(this.hovered, !this.keepOpen);
1237
- },
1238
- /**
1239
- * Close dropdown if clicked outside.
1240
- */
1241
- clickedOutside(t) {
1242
- var i;
1243
- const e = ((i = t.path) == null ? void 0 : i[0]) || t.target;
1244
- this.whiteList.indexOf(e) < 0 && (this.isActive = !1);
1245
- },
1246
- /**
1247
- * Return display text for the input.
1248
- * If object, get value from path, or else just the value.
1249
- */
1250
- getValue(t) {
1251
- if (t !== null)
1252
- return typeof this.customFormatter < "u" ? this.customFormatter(t) : typeof t == "object" ? ne(t, this.field) : t;
1253
- },
1254
- /**
1255
- * Check if the scroll list inside the dropdown
1256
- * reached it's end.
1257
- */
1258
- checkIfReachedTheEndOfScroll(t) {
1259
- t.clientHeight !== t.scrollHeight && t.scrollTop + t.clientHeight >= t.scrollHeight && this.$emit("infinite-scroll");
1260
- },
1261
- /**
1262
- * Calculate if the dropdown is vertically visible when activated,
1263
- * otherwise it is openened upwards.
1264
- */
1265
- calcDropdownInViewportVertical() {
1266
- this.$nextTick(() => {
1267
- if (this.$refs.dropdown === void 0)
1268
- return;
1269
- const t = this.$refs.dropdown.getBoundingClientRect();
1270
- this.isListInViewportVertically = t.top >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight), this.appendToBody && this.updateAppendToBody();
1271
- });
1272
- },
1273
- /**
1274
- * Arrows keys listener.
1275
- * If dropdown is active, set hovered option, or else just open.
1276
- */
1277
- keyArrows(t) {
1278
- const e = t === "down" ? 1 : -1;
1279
- if (this.isActive) {
1280
- let i = this.data.indexOf(this.hovered) + e;
1281
- i = i > this.data.length - 1 ? this.data.length : i, i = i < 0 ? 0 : i, this.setHovered(this.data[i]);
1282
- const s = this.$refs.dropdown.querySelector(".dropdown-content"), n = s.querySelectorAll(
1283
- "a.dropdown-item:not(.is-disabled)"
1284
- )[i];
1285
- if (!n)
1286
- return;
1287
- const a = s.scrollTop, r = s.scrollTop + s.clientHeight - n.clientHeight;
1288
- n.offsetTop < a ? s.scrollTop = n.offsetTop : n.offsetTop >= r && (s.scrollTop = n.offsetTop - s.clientHeight + n.clientHeight);
1289
- } else
1290
- this.isActive = !0;
1291
- },
1292
- /**
1293
- * Focus listener.
1294
- * If value is the same as selected, select all text.
1295
- */
1296
- focused(t) {
1297
- 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);
1298
- },
1299
- /**
1300
- * Blur listener.
1301
- */
1302
- onBlur(t) {
1303
- this.hasFocus = !1, this.$emit("blur", t);
1304
- },
1305
- onInput() {
1306
- const t = this.getValue(this.selected);
1307
- t && t === this.newValue || (this.$emit("typing", this.newValue), this.checkValidity());
1308
- },
1309
- rightIconClick(t) {
1310
- this.clearable ? this.newValue = "" : this.$emit("icon-right-click", t);
1311
- },
1312
- checkValidity() {
1313
- this.useHtml5Validation && this.$nextTick(() => {
1314
- this.checkHtml5Validity();
1315
- });
1316
- },
1317
- updateAppendToBody() {
1318
- const t = this.$refs.dropdown, e = this.$refs.input.$el;
1319
- if (t && e) {
1320
- const i = this.$data._bodyEl;
1321
- i.classList.forEach((r) => i.classList.remove(r)), i.classList.add("autocomplete"), i.classList.add("control"), this.expandend && i.classList.add("is-expandend");
1322
- const s = e.getBoundingClientRect();
1323
- let n = s.top + window.scrollY;
1324
- const a = s.left + window.scrollX;
1325
- this.isOpenedTop ? n -= t.clientHeight : n += e.clientHeight, this.style = {
1326
- position: "absolute",
1327
- top: `${n}px`,
1328
- left: `${a}px`,
1329
- width: `${e.clientWidth}px`,
1330
- maxWidth: `${e.clientWidth}px`,
1331
- zIndex: "99"
1332
- };
1333
- }
1334
- }
1335
- }
1336
- };
1337
- var je = function() {
1338
- var e = this, i = e._self._c;
1339
- 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) {
1340
- if (!s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]))
1341
- return null;
1342
- s.preventDefault(), e.isActive = !1;
1343
- }, keydown: [function(s) {
1344
- return !s.type.indexOf("key") && e._k(s.keyCode, "tab", 9, s.key, "Tab") ? null : e.tabPressed.apply(null, arguments);
1345
- }, function(s) {
1346
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.enterPressed.apply(null, arguments);
1347
- }, function(s) {
1348
- return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.keyArrows("up"));
1349
- }, function(s) {
1350
- return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.keyArrows("down"));
1351
- }] }, model: { value: e.newValue, callback: function(s) {
1352
- e.newValue = s;
1353
- }, 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) {
1354
- return i("a", { key: n, staticClass: "dropdown-item", class: { "is-hovered": s === e.hovered }, on: { click: function(a) {
1355
- return e.setSelected(s, void 0, a);
1356
- } } }, [e.hasDefaultSlot ? e._t("default", null, { option: s, index: n }) : i("span", [e._v(" " + e._s(e.getValue(s, !0)) + " ")])], 2);
1357
- }), 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);
1358
- }, Ke = [], We = /* @__PURE__ */ o(
1359
- qe,
1360
- je,
1361
- Ke,
1362
- !1,
1363
- null,
1364
- null
1365
- );
1366
- const Xe = We.exports, Ue = /* @__PURE__ */ X({
1367
- __name: "CMessage",
1368
- props: {
1369
- type: { default: "secondary" },
1370
- badge: { default: "" },
1371
- text: { default: "" }
1372
- },
1373
- setup(t) {
1374
- const e = U(), i = m(() => e.style), s = m(() => e.staticClass), n = m(() => e.class), a = m(() => Q.t("components:cling.message.tip"));
1375
- return { __sfc: !0, attrs: e, staticStyle: i, staticClass: s, styleClass: n, messageTip: a };
1376
- }
1377
- });
1378
- var Qe = function() {
1379
- var e = this, i = e._self._c, s = e._self._setupProxy;
1380
- 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)]);
1381
- }, Ye = [], Ge = /* @__PURE__ */ o(
1382
- Ue,
1383
- Qe,
1384
- Ye,
1385
- !1,
1386
- null,
1387
- null
1388
- );
1389
- const Je = Ge.exports, Ze = {
1390
- name: "CPhoneInput",
1391
- components: {
1392
- Flag: J,
1393
- CInput: I,
1394
- CDropdown: f,
1395
- CDropdownItem: g,
1396
- CButton: P,
1397
- CField: ae,
1398
- SmartList: oe
1399
- },
1400
- props: {
1401
- value: {
1402
- type: [String, Number],
1403
- default: ""
1404
- },
1405
- region: {
1406
- type: String,
1407
- default: ""
1408
- },
1409
- // Region to fallback to if prefix is not found in value
1410
- defaultRegion: {
1411
- type: String,
1412
- required: !0
1413
- },
1414
- label: {
1415
- type: String,
1416
- default: ""
1417
- },
1418
- labelPosition: {
1419
- type: String,
1420
- default: ""
1421
- }
1422
- },
1423
- data() {
1424
- return {
1425
- internalPrefix: null,
1426
- // Used to remember prefix when value is changed to empty
1427
- searchQuery: ""
1428
- };
1429
- },
1430
- computed: {
1431
- defaultPrefix() {
1432
- return l[this.internalRegion].callingCode;
1433
- },
1434
- currentRegion() {
1435
- return this.getRegionByCallingCode(this.prefix);
1436
- },
1437
- internalRegion: {
1438
- get() {
1439
- if (this.region)
1440
- return this.region;
1441
- if (this.value) {
1442
- const t = (Object.keys(l) || []).find(
1443
- (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
1444
- );
1445
- if (t)
1446
- return t;
1447
- }
1448
- return this.internalPrefix ? this.getRegionByCallingCode(this.internalPrefix) : this.defaultRegion;
1449
- },
1450
- set(t) {
1451
- this.$emit("update:region", t), this.updateValue({ prefix: l[t].callingCode });
1452
- }
1453
- },
1454
- prefix() {
1455
- if (!this.value)
1456
- return this.internalPrefix || this.defaultPrefix;
1457
- const t = (Object.keys(l) || []).find(
1458
- (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
1459
- );
1460
- return t ? l[t].callingCode : this.defaultPrefix;
1461
- },
1462
- phone: {
1463
- get() {
1464
- return this.prefix && this.value && this.value.startsWith(this.prefix) ? this.value.substring(this.prefix.length) : this.value;
1465
- },
1466
- set(t) {
1467
- this.updateValue({ phone: t });
1468
- }
1469
- },
1470
- sortedRegions() {
1471
- return (Object.keys(l) || []).map((t) => ({
1472
- key: t,
1473
- title: `${l[t].name} (${t})`,
1474
- callingCode: l[t].callingCode
1475
- })).sort((t, e) => t.title.localeCompare(e.title));
1476
- }
1477
- },
1478
- methods: {
1479
- getRegionByCallingCode(t) {
1480
- return t ? (Object.keys(l) || []).find(
1481
- (i) => t === l[i].callingCode
1482
- ) : null;
1483
- },
1484
- updateValue({ prefix: t, phone: e }) {
1485
- const i = t !== void 0 ? t : this.prefix || "", s = e !== void 0 ? e : this.phone || "", n = `${i}${s}`;
1486
- n !== i ? (this.$emit("input", n), this.region || this.$emit("update:region", this.internalRegion), this.internalPrefix = null) : (this.internalPrefix = i, this.$emit("input", ""));
1487
- }
1488
- }
1489
- };
1490
- var et = function() {
1491
- var e = this, i = e._self._c;
1492
- 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 }) {
1493
- return [i("CDropdown", { staticClass: "control", staticStyle: { height: "100%" }, attrs: { size: e.$attrs.size, disabled: e.$attrs.disabled, "menu-styling": {
1494
- maxWidth: "300px"
1495
- }, scrollable: !0, position: "is-bottom-right", "max-height": "240px" }, scopedSlots: e._u([{ key: "trigger", fn: function() {
1496
- return [i("CButton", { staticStyle: { height: "100%" }, attrs: { size: e.$attrs.size, type: "none", pattern: "secondary" } }, [i("Flag", { staticStyle: { "margin-right": "0.35em" }, attrs: { region: e.internalRegion } }), e._v(" " + e._s(e.prefix) + " ")], 1)];
1497
- }, proxy: !0 }, { key: "header", fn: function() {
1498
- return [i("CInput", { staticStyle: { "margin-bottom": "0.25em" }, attrs: { placeholder: e.$t("_common:search"), filled: "" }, model: { value: e.searchQuery, callback: function(n) {
1499
- e.searchQuery = n;
1500
- }, expression: "searchQuery" } })];
1501
- }, proxy: !0 }], null, !0), model: { value: e.internalRegion, callback: function(n) {
1502
- e.internalRegion = n;
1503
- }, expression: "internalRegion" } }, e._l(s, function({ key: n, title: a, callingCode: r }) {
1504
- 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);
1505
- }), 1)];
1506
- } }]) })], 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) {
1507
- e.phone = s;
1508
- }, expression: "phone" } }, "CInput", { ...e.$attrs, ...e.$props }, !1))], 1)], 1);
1509
- }, tt = [], it = /* @__PURE__ */ o(
1510
- Ze,
1511
- et,
1512
- tt,
1513
- !1,
1514
- null,
1515
- null
1516
- );
1517
- const x = it.exports, st = {
1518
- name: "CRadio",
1519
- mixins: [M]
1520
- };
1521
- var nt = function() {
1522
- var e = this, i = e._self._c;
1523
- 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) {
1524
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
1525
- } } }, [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) {
1526
- s.stopPropagation();
1527
- }, change: function(s) {
1528
- e.computedValue = e.nativeValue;
1529
- } } }), i("span", { staticClass: "check", class: `is-${e.type}` }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
1530
- }, at = [], rt = /* @__PURE__ */ o(
1531
- st,
1532
- nt,
1533
- at,
1534
- !1,
1535
- null,
1536
- null
1537
- );
1538
- const S = rt.exports, ot = {
1539
- name: "CRadioButton",
1540
- components: {
1541
- CButton: P
1542
- },
1543
- mixins: [M],
1544
- props: {
1545
- type: {
1546
- type: String,
1547
- default: "primary"
1548
- },
1549
- expanded: Boolean
1550
- },
1551
- data() {
1552
- return {
1553
- isFocused: !1
1554
- };
1555
- }
1556
- };
1557
- var lt = function() {
1558
- var e = this, i = e._self._c;
1559
- 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) {
1560
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.$el.label.click());
1561
- } } }, [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) {
1562
- s.stopPropagation();
1563
- }, focus: function(s) {
1564
- e.isFocused = !0;
1565
- }, blur: function(s) {
1566
- e.isFocused = !1;
1567
- }, change: function(s) {
1568
- e.computedValue = e.nativeValue;
1569
- } } })], 2)], 1);
1570
- }, dt = [], ct = /* @__PURE__ */ o(
1571
- ot,
1572
- lt,
1573
- dt,
1574
- !1,
1575
- null,
1576
- null
1577
- );
1578
- const k = ct.exports, ut = {
1579
- name: "CSelect",
1580
- mixins: [T],
1581
- inheritAttrs: !1,
1582
- props: {
1583
- value: {
1584
- type: [String, Number, Boolean, Object, Array, Function],
1585
- default: null
1586
- },
1587
- placeholder: {
1588
- type: String,
1589
- default: ""
1590
- },
1591
- multiple: Boolean,
1592
- selectClass: {
1593
- type: [String, Object, Array],
1594
- default: ""
1595
- },
1596
- nativeSize: {
1597
- type: [String, Number],
1598
- default: null
1599
- }
1600
- },
1601
- data() {
1602
- return {
1603
- selected: this.value,
1604
- _elementRef: "select"
1605
- };
1606
- },
1607
- computed: {
1608
- computedValue: {
1609
- get() {
1610
- return this.selected;
1611
- },
1612
- set(t) {
1613
- this.selected = t, this.$emit("input", t), !this.isValid && this.checkHtml5Validity();
1614
- }
1615
- },
1616
- spanClasses() {
1617
- return [
1618
- this.size,
1619
- this.statusType,
1620
- {
1621
- "is-fullwidth": this.expanded,
1622
- "is-loading": this.loading,
1623
- "is-multiple": this.multiple,
1624
- "is-rounded": this.rounded,
1625
- "is-empty": this.selected === null
1626
- }
1627
- ];
1628
- }
1629
- },
1630
- watch: {
1631
- /**
1632
- * When v-model is changed:
1633
- * 1. Set the selected option.
1634
- * 2. If it's invalid, validate again.
1635
- */
1636
- value(t) {
1637
- this.selected = t, !this.isValid && this.checkHtml5Validity();
1638
- }
1639
- }
1640
- };
1641
- var mt = function() {
1642
- var e = this, i = e._self._c;
1643
- 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) {
1644
- e.$emit("blur", s) && e.checkHtml5Validity();
1645
- }, focus: function(s) {
1646
- return e.$emit("focus", s);
1647
- }, change: function(s) {
1648
- var n = Array.prototype.filter.call(s.target.options, function(a) {
1649
- return a.selected;
1650
- }).map(function(a) {
1651
- var r = "_value" in a ? a._value : a.value;
1652
- return r;
1653
- });
1654
- e.computedValue = s.target.multiple ? n : n[0];
1655
- } } }, "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)])]);
1656
- }, pt = [], ht = /* @__PURE__ */ o(
1657
- ut,
1658
- mt,
1659
- pt,
1660
- !1,
1661
- null,
1662
- "23e48013"
1663
- );
1664
- const $ = ht.exports, ft = {
1665
- name: "CSkeleton",
1666
- functional: !0,
1667
- props: {
1668
- active: {
1669
- type: Boolean,
1670
- default: !0
1671
- },
1672
- animated: {
1673
- type: Boolean,
1674
- default: !1
1675
- },
1676
- width: [Number, String],
1677
- height: [Number, String],
1678
- circle: Boolean,
1679
- rounded: {
1680
- type: Boolean,
1681
- default: !0
1682
- },
1683
- count: {
1684
- type: Number,
1685
- default: 1
1686
- },
1687
- hidden: {
1688
- type: [Boolean, String],
1689
- default: !1
1690
- },
1691
- color: {
1692
- type: String,
1693
- default: null
1694
- }
1695
- },
1696
- render(t, e) {
1697
- if (!e.props.active)
1698
- return;
1699
- const i = [], s = e.props.width, n = e.props.height;
1700
- for (let a = 0; a < e.props.count; a++)
1701
- i.push(
1702
- t("div", {
1703
- staticClass: "c-skeleton-item",
1704
- class: { "is-rounded": e.props.rounded },
1705
- key: a,
1706
- style: {
1707
- height: n === void 0 ? null : isNaN(n) ? n : n + "px",
1708
- width: s === void 0 ? null : isNaN(s) ? s : s + "px",
1709
- borderRadius: e.props.circle ? "50%" : null,
1710
- background: e.props.color ? e.props.color : null
1711
- }
1712
- })
1713
- );
1714
- return t(
1715
- "div",
1716
- {
1717
- staticStyle: e.data.staticStyle,
1718
- staticClass: "c-skeleton",
1719
- class: [
1720
- e.data.staticClass,
1721
- {
1722
- "is-animated": e.props.animated,
1723
- "is-invisible": e.props.hidden
1724
- }
1725
- ]
1726
- },
1727
- i
1728
- );
1729
- }
1730
- }, gt = null, vt = null;
1731
- var yt = /* @__PURE__ */ o(
1732
- ft,
1733
- gt,
1734
- vt,
1735
- !1,
1736
- null,
1737
- null
1738
- );
1739
- const D = yt.exports, _t = {
1740
- name: "CSliderThumb",
1741
- inheritAttrs: !1,
1742
- props: {
1743
- value: {
1744
- type: Number,
1745
- default: 0
1746
- },
1747
- type: {
1748
- type: String,
1749
- default: ""
1750
- },
1751
- tooltip: {
1752
- type: Boolean,
1753
- default: !0
1754
- },
1755
- customFormatter: {
1756
- type: Function,
1757
- default: null
1758
- }
1759
- },
1760
- data() {
1761
- return {
1762
- isFocused: !1,
1763
- dragging: !1,
1764
- startX: 0,
1765
- startPosition: 0,
1766
- newPosition: null,
1767
- oldValue: this.value
1768
- };
1769
- },
1770
- computed: {
1771
- disabled() {
1772
- return this.$parent.disabled;
1773
- },
1774
- max() {
1775
- return this.$parent.max;
1776
- },
1777
- min() {
1778
- return this.$parent.min;
1779
- },
1780
- step() {
1781
- return this.$parent.step;
1782
- },
1783
- precision() {
1784
- return this.$parent.precision;
1785
- },
1786
- currentPosition() {
1787
- return `${(this.value - this.min) / (this.max - this.min) * 100}%`;
1788
- },
1789
- wrapperStyle() {
1790
- return { left: this.currentPosition };
1791
- },
1792
- tooltipLabel() {
1793
- return typeof this.customFormatter == "function" ? this.customFormatter(this.value) : this.value.toString();
1794
- }
1795
- },
1796
- methods: {
1797
- onFocus() {
1798
- this.isFocused = !0;
1799
- },
1800
- onBlur() {
1801
- this.isFocused = !1;
1802
- },
1803
- onButtonDown(t) {
1804
- 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)));
1805
- },
1806
- onLeftKeyDown() {
1807
- 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"));
1808
- },
1809
- onRightKeyDown() {
1810
- 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"));
1811
- },
1812
- onHomeKeyDown() {
1813
- this.disabled || this.value === this.min || (this.newPosition = 0, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1814
- },
1815
- onEndKeyDown() {
1816
- this.disabled || this.value === this.max || (this.newPosition = 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1817
- },
1818
- onDragStart(t) {
1819
- 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;
1820
- },
1821
- onDragging(t) {
1822
- if (this.dragging) {
1823
- t.type === "touchmove" && (t.clientX = t.touches[0].clientX);
1824
- const e = (t.clientX - this.startX) / this.$parent.sliderSize() * 100;
1825
- this.newPosition = this.startPosition + e, this.setPosition(this.newPosition);
1826
- }
1827
- },
1828
- onDragEnd() {
1829
- 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));
1830
- },
1831
- setPosition(t) {
1832
- if (t === null || isNaN(t))
1833
- return;
1834
- t < 0 ? t = 0 : t > 100 && (t = 100);
1835
- const e = 100 / ((this.max - this.min) / this.step);
1836
- let s = Math.round(t / e) * e / 100 * (this.max - this.min) + this.min;
1837
- s = parseFloat(s.toFixed(this.precision)), this.$emit("input", s), !this.dragging && s !== this.oldValue && (this.oldValue = s);
1838
- }
1839
- }
1840
- };
1841
- var bt = function() {
1842
- var e = this, i = e._self._c;
1843
- 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) {
1844
- 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));
1845
- }, function(s) {
1846
- 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));
1847
- }, function(s) {
1848
- return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
1849
- }, function(s) {
1850
- return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
1851
- }, function(s) {
1852
- return !s.type.indexOf("key") && e._k(s.keyCode, "home", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onHomeKeyDown.apply(null, arguments));
1853
- }, function(s) {
1854
- return !s.type.indexOf("key") && e._k(s.keyCode, "end", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onEndKeyDown.apply(null, arguments));
1855
- }] } }, "div", e.$attrs, !1))]);
1856
- }, Ct = [], wt = /* @__PURE__ */ o(
1857
- _t,
1858
- bt,
1859
- Ct,
1860
- !1,
1861
- null,
1862
- null
1863
- );
1864
- const xt = wt.exports, St = {
1865
- name: "CSliderTick",
1866
- props: {
1867
- value: {
1868
- type: Number,
1869
- default: 0
1870
- }
1871
- },
1872
- computed: {
1873
- position() {
1874
- const t = (this.value - this.$parent.min) / (this.$parent.max - this.$parent.min) * 100;
1875
- return t >= 0 && t <= 100 ? t : 0;
1876
- },
1877
- hidden() {
1878
- return this.value === this.$parent.min || this.value === this.$parent.max;
1879
- }
1880
- },
1881
- created() {
1882
- if (!this.$parent.$data._isSlider)
1883
- throw this.$destroy(), new Error("You should wrap bSliderTick on a bSlider");
1884
- },
1885
- methods: {
1886
- getTickStyle(t) {
1887
- return { left: `${t}%` };
1888
- }
1889
- }
1890
- };
1891
- var kt = function() {
1892
- var e = this, i = e._self._c;
1893
- 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()]);
1894
- }, $t = [], Dt = /* @__PURE__ */ o(
1895
- St,
1896
- kt,
1897
- $t,
1898
- !1,
1899
- null,
1900
- null
1901
- );
1902
- const Vt = Dt.exports, Ft = {
1903
- name: "CSlider",
1904
- components: {
1905
- CSliderThumb: xt,
1906
- CSliderTick: Vt
1907
- },
1908
- props: {
1909
- value: {
1910
- type: [Number, Array],
1911
- default: 0
1912
- },
1913
- min: {
1914
- type: Number,
1915
- default: 0
1916
- },
1917
- max: {
1918
- type: Number,
1919
- default: 100
1920
- },
1921
- step: {
1922
- type: Number,
1923
- default: 1
1924
- },
1925
- type: {
1926
- type: String,
1927
- default: "primary"
1928
- },
1929
- size: {
1930
- type: String,
1931
- default: ""
1932
- },
1933
- ticks: {
1934
- type: Boolean,
1935
- default: !1
1936
- },
1937
- tooltip: {
1938
- type: Boolean,
1939
- default: !0
1940
- },
1941
- tooltipType: {
1942
- type: String,
1943
- default: ""
1944
- },
1945
- rounded: {
1946
- type: Boolean,
1947
- default: !1
1948
- },
1949
- disabled: {
1950
- type: Boolean,
1951
- default: !1
1952
- },
1953
- lazy: {
1954
- type: Boolean,
1955
- default: !1
1956
- },
1957
- customFormatter: {
1958
- type: Function,
1959
- default: null
1960
- },
1961
- ariaLabel: {
1962
- type: [String, Array],
1963
- default: ""
1964
- },
1965
- biggerSliderFocus: {
1966
- type: Boolean,
1967
- default: !1
1968
- }
1969
- },
1970
- data() {
1971
- return {
1972
- value1: null,
1973
- value2: null,
1974
- dragging: !1,
1975
- isRange: !1,
1976
- _isSlider: !0
1977
- // Used by Thumb and Tick
1978
- };
1979
- },
1980
- computed: {
1981
- newTooltipType() {
1982
- return this.tooltipType ? this.tooltipType : this.type;
1983
- },
1984
- tickValues() {
1985
- if (!this.ticks || this.min > this.max || this.step === 0)
1986
- return [];
1987
- const t = [];
1988
- for (let e = this.min + this.step; e < this.max; e += this.step)
1989
- t.push(e);
1990
- return t;
1991
- },
1992
- minValue() {
1993
- return Math.min(this.value1, this.value2);
1994
- },
1995
- maxValue() {
1996
- return Math.max(this.value1, this.value2);
1997
- },
1998
- barSize() {
1999
- return this.isRange ? `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%` : `${100 * (this.value1 - this.min) / (this.max - this.min)}%`;
2000
- },
2001
- barStart() {
2002
- return this.isRange ? `${100 * (this.minValue - this.min) / (this.max - this.min)}%` : "0%";
2003
- },
2004
- precision() {
2005
- const t = [this.min, this.max, this.step].map((e) => {
2006
- const i = `${e}`.split(".")[1];
2007
- return i ? i.length : 0;
2008
- });
2009
- return Math.max(...t);
2010
- },
2011
- barStyle() {
2012
- return {
2013
- width: this.barSize,
2014
- left: this.barStart
2015
- };
2016
- },
2017
- rootClasses() {
2018
- return {
2019
- "is-rounded": this.rounded,
2020
- "is-dragging": this.dragging,
2021
- "is-disabled": this.disabled,
2022
- "slider-focus": this.biggerSliderFocus
2023
- };
2024
- }
2025
- },
2026
- watch: {
2027
- /**
2028
- * When v-model is changed set the new active step.
2029
- */
2030
- value(t) {
2031
- this.setValues(t);
2032
- },
2033
- value1() {
2034
- this.onInternalValueUpdate();
2035
- },
2036
- value2() {
2037
- this.onInternalValueUpdate();
2038
- },
2039
- min() {
2040
- this.setValues(this.value);
2041
- },
2042
- max() {
2043
- this.setValues(this.value);
2044
- }
2045
- },
2046
- created() {
2047
- this.isThumbReversed = !1, this.isTrackClickDisabled = !1, this.setValues(this.value);
2048
- },
2049
- methods: {
2050
- setValues(t) {
2051
- if (!(this.min > this.max))
2052
- if (Array.isArray(t)) {
2053
- this.isRange = !0;
2054
- 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);
2055
- this.value1 = this.isThumbReversed ? i : e, this.value2 = this.isThumbReversed ? e : i;
2056
- } else
2057
- this.isRange = !1, this.value1 = isNaN(t) ? this.min : h(t, this.min, this.max), this.value2 = null;
2058
- },
2059
- onInternalValueUpdate() {
2060
- this.isRange && (this.isThumbReversed = this.value1 > this.value2), (!this.lazy || !this.dragging) && this.emitValue("input"), this.dragging && this.emitValue("dragging");
2061
- },
2062
- sliderSize() {
2063
- return this.$refs.slider.getBoundingClientRect().width;
2064
- },
2065
- onSliderClick(t) {
2066
- if (this.disabled || this.isTrackClickDisabled)
2067
- return;
2068
- 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);
2069
- if (this.isRange) {
2070
- const a = Math.abs(s - this.value2);
2071
- if (n <= a) {
2072
- if (n < this.step / 2)
2073
- return;
2074
- this.$refs.button1.setPosition(i);
2075
- } else {
2076
- if (a < this.step / 2)
2077
- return;
2078
- this.$refs.button2.setPosition(i);
2079
- }
2080
- } else {
2081
- if (n < this.step / 2)
2082
- return;
2083
- this.$refs.button1.setPosition(i);
2084
- }
2085
- this.emitValue("change");
2086
- },
2087
- onDragStart() {
2088
- this.dragging = !0, this.$emit("dragstart");
2089
- },
2090
- onDragEnd() {
2091
- this.isTrackClickDisabled = !0, setTimeout(() => {
2092
- this.isTrackClickDisabled = !1;
2093
- }, 0), this.dragging = !1, this.$emit("dragend"), this.lazy && this.emitValue("input");
2094
- },
2095
- emitValue(t) {
2096
- this.$emit(
2097
- t,
2098
- this.isRange ? [this.minValue, this.maxValue] : this.value1
2099
- );
2100
- }
2101
- }
2102
- };
2103
- var At = function() {
2104
- var e = this, i = e._self._c;
2105
- 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) {
2106
- return i("CSliderTick", { key: n, attrs: { value: s } });
2107
- }) : 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) {
2108
- e.value1 = s;
2109
- }, 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) {
2110
- e.value2 = s;
2111
- }, expression: "value2" } }) : e._e()], 2)]);
2112
- }, Ot = [], Bt = /* @__PURE__ */ o(
2113
- Ft,
2114
- At,
2115
- Ot,
2116
- !1,
2117
- null,
2118
- null
2119
- );
2120
- const V = Bt.exports, It = {
2121
- name: "CSwitch",
2122
- props: {
2123
- value: {
2124
- type: [String, Number, Boolean, Function, Object, Array, Date],
2125
- default: null
2126
- },
2127
- nativeValue: {
2128
- type: [String, Number, Boolean, Function, Object, Array, Date],
2129
- default: null
2130
- },
2131
- disabled: Boolean,
2132
- type: {
2133
- type: String,
2134
- default: ""
2135
- },
2136
- name: {
2137
- type: String,
2138
- default: ""
2139
- },
2140
- required: Boolean,
2141
- size: {
2142
- type: String,
2143
- default: ""
2144
- },
2145
- trueValue: {
2146
- type: [String, Number, Boolean, Function, Object, Array, Date],
2147
- default: !0
2148
- },
2149
- falseValue: {
2150
- type: [String, Number, Boolean, Function, Object, Array, Date],
2151
- default: !1
2152
- },
2153
- rounded: {
2154
- type: Boolean,
2155
- default: !0
2156
- }
2157
- },
2158
- data() {
2159
- return {
2160
- newValue: this.value
2161
- };
2162
- },
2163
- computed: {
2164
- computedValue: {
2165
- get() {
2166
- return this.newValue;
2167
- },
2168
- set(t) {
2169
- this.newValue = t, this.$emit("input", t);
2170
- }
2171
- },
2172
- newClass() {
2173
- return [
2174
- `is-${this.size}`,
2175
- {
2176
- "is-disabled": this.disabled,
2177
- "is-rounded": this.rounded
2178
- }
2179
- ];
2180
- }
2181
- },
2182
- watch: {
2183
- /**
2184
- * When v-model change, set internal value.
2185
- */
2186
- value(t) {
2187
- this.newValue = t;
2188
- }
2189
- },
2190
- methods: {
2191
- focus() {
2192
- this.$refs.input.focus();
2193
- }
2194
- }
2195
- };
2196
- var Tt = function() {
2197
- var e = this, i = e._self._c;
2198
- return i("label", { ref: "label", staticClass: "switch", class: e.newClass, attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
2199
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
2200
- } } }, [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) {
2201
- s.stopPropagation();
2202
- }, change: function(s) {
2203
- var n = e.computedValue, a = s.target, r = a.checked ? e.trueValue : e.falseValue;
2204
- if (Array.isArray(n)) {
2205
- var d = e.nativeValue, u = e._i(n, d);
2206
- a.checked ? u < 0 && (e.computedValue = n.concat([d])) : u > -1 && (e.computedValue = n.slice(0, u).concat(n.slice(u + 1)));
2207
- } else
2208
- e.computedValue = r;
2209
- } } }), i("span", { staticClass: "check", class: [`is-${e.type}`] }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
2210
- }, Pt = [], Mt = /* @__PURE__ */ o(
2211
- It,
2212
- Tt,
2213
- Pt,
2214
- !1,
2215
- null,
2216
- "4cdd239d"
2217
- );
2218
- const F = Mt.exports, Rt = {
2219
- name: "CTabItem",
2220
- props: {
2221
- label: String,
2222
- icon: String,
2223
- iconPack: String,
2224
- disabled: Boolean,
2225
- visible: {
2226
- type: Boolean,
2227
- default: !0
2228
- },
2229
- value: [String, Number]
2230
- },
2231
- data() {
2232
- return {
2233
- isActive: !1,
2234
- transitionName: null,
2235
- _isTabItem: !0
2236
- // Used internally by Tab
2237
- };
2238
- },
2239
- created() {
2240
- if (!this.$parent.$data._isTabs)
2241
- throw this.$destroy(), new Error("You should wrap bTabItem on a bTabs");
2242
- this.$parent.refreshSlots();
2243
- },
2244
- beforeDestroy() {
2245
- this.$parent.refreshSlots();
2246
- },
2247
- methods: {
2248
- /**
2249
- * Activate tab, alter animation name based on the index.
2250
- */
2251
- activate(t, e) {
2252
- this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !0;
2253
- },
2254
- /**
2255
- * Deactivate tab, alter animation name based on the index.
2256
- */
2257
- deactivate(t, e) {
2258
- this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !1;
2259
- }
2260
- },
2261
- render(t) {
2262
- if (this.$parent.destroyOnHide && (!this.isActive || !this.visible))
2263
- return;
2264
- const e = t(
2265
- "div",
2266
- {
2267
- directives: [
2268
- {
2269
- name: "show",
2270
- value: this.isActive && this.visible
2271
- }
2272
- ],
2273
- class: "tab-item"
2274
- },
2275
- this.$slots.default
2276
- );
2277
- return this.$parent.animated ? t(
2278
- "transition",
2279
- {
2280
- props: {
2281
- name: this.transitionName,
2282
- mode: "out-in"
2283
- },
2284
- on: {
2285
- "before-enter": () => {
2286
- this.$parent.isTransitioning = !0;
2287
- },
2288
- "after-enter": () => {
2289
- this.$parent.isTransitioning = !1;
2290
- }
2291
- }
2292
- },
2293
- [e]
2294
- ) : e;
2295
- }
2296
- }, zt = null, Et = null;
2297
- var Nt = /* @__PURE__ */ o(
2298
- Rt,
2299
- zt,
2300
- Et,
2301
- !1,
2302
- null,
2303
- null
2304
- );
2305
- const A = Nt.exports, Lt = {
2306
- name: "CSlotComponent",
2307
- props: {
2308
- component: {
2309
- type: Object,
2310
- required: !0
2311
- },
2312
- name: {
2313
- type: String,
2314
- default: "default"
2315
- },
2316
- scoped: {
2317
- type: Boolean
2318
- },
2319
- props: {
2320
- type: Object
2321
- },
2322
- tag: {
2323
- type: String,
2324
- default: "div"
2325
- },
2326
- event: {
2327
- type: String,
2328
- default: "hook:updated"
2329
- }
2330
- },
2331
- methods: {
2332
- refresh() {
2333
- this.$forceUpdate();
2334
- },
2335
- isVueComponent() {
2336
- return this.component && this.component._isVue;
2337
- }
2338
- },
2339
- created() {
2340
- this.isVueComponent() && this.component.$on(this.event, this.refresh);
2341
- },
2342
- beforeDestroy() {
2343
- this.isVueComponent() && this.component.$off(this.event, this.refresh);
2344
- },
2345
- render(t) {
2346
- if (this.isVueComponent())
2347
- return t(
2348
- this.tag,
2349
- {},
2350
- this.scoped ? this.component.$scopedSlots[this.name](this.props) : this.component.$slots[this.name]
2351
- );
2352
- }
2353
- }, Ht = {
2354
- name: "CTabs",
2355
- components: {
2356
- CSlotComponent: Lt
2357
- },
2358
- props: {
2359
- value: {
2360
- type: [Number, String],
2361
- default: null
2362
- },
2363
- expanded: Boolean,
2364
- type: {
2365
- type: String,
2366
- default: null
2367
- },
2368
- size: {
2369
- type: String,
2370
- default: null
2371
- },
2372
- position: {
2373
- type: String,
2374
- validator(t) {
2375
- return ["left", "right", "center"].indexOf(t) > -1;
2376
- },
2377
- default: null
2378
- },
2379
- animated: {
2380
- type: Boolean,
2381
- default: !0
2382
- },
2383
- destroyOnHide: {
2384
- type: Boolean,
2385
- default: !1
2386
- },
2387
- vertical: Boolean,
2388
- multiline: Boolean
2389
- },
2390
- data() {
2391
- return {
2392
- activeTab: 0,
2393
- defaultSlots: [],
2394
- contentHeight: 0,
2395
- isTransitioning: !1,
2396
- _isTabs: !0
2397
- // Used internally by TabItem
2398
- };
2399
- },
2400
- computed: {
2401
- mainClasses() {
2402
- return {
2403
- "is-fullwidth": this.expanded,
2404
- "is-vertical": this.vertical,
2405
- "is-multiline": this.multiline,
2406
- [`is-${this.position}`]: this.position && this.vertical
2407
- };
2408
- },
2409
- navClasses() {
2410
- return [
2411
- this.type,
2412
- {
2413
- [`is-${this.size}`]: !!this.size,
2414
- [`is-${this.position}`]: this.position && !this.vertical,
2415
- "is-fullwidth": this.expanded,
2416
- "is-toggle-rounded is-toggle": this.type === "is-toggle-rounded"
2417
- }
2418
- ];
2419
- },
2420
- tabItems() {
2421
- return this.defaultSlots.filter(
2422
- (t) => t.componentInstance && t.componentInstance.$data && t.componentInstance.$data._isTabItem
2423
- ).map((t) => t.componentInstance);
2424
- }
2425
- },
2426
- watch: {
2427
- /**
2428
- * When v-model is changed set the new active tab.
2429
- */
2430
- value(t) {
2431
- const e = this.getIndexByValue(t, t);
2432
- this.changeTab(e);
2433
- },
2434
- /**
2435
- * When tab-items are updated, set active one.
2436
- */
2437
- tabItems() {
2438
- if (this.activeTab < this.tabItems.length) {
2439
- let t = this.activeTab;
2440
- this.tabItems.map((e, i) => {
2441
- e.isActive && (t = i, t < this.tabItems.length && (this.tabItems[t].isActive = !1));
2442
- }), this.tabItems[this.activeTab].isActive = !0;
2443
- } else
2444
- this.activeTab > 0 && this.changeTab(this.activeTab - 1);
2445
- }
2446
- },
2447
- mounted() {
2448
- this.activeTab = this.getIndexByValue(this.value || 0), this.activeTab < this.tabItems.length && (this.tabItems[this.activeTab].isActive = !0), this.refreshSlots();
2449
- },
2450
- methods: {
2451
- /**
2452
- * Change the active tab and emit change event.
2453
- */
2454
- changeTab(t) {
2455
- 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)));
2456
- },
2457
- /**
2458
- * Tab click listener, emit input event and change active tab.
2459
- */
2460
- tabClick(t) {
2461
- this.activeTab !== t && (this.$emit("input", this.getValueByIndex(t)), this.changeTab(t));
2462
- },
2463
- refreshSlots() {
2464
- this.defaultSlots = this.$slots.default || [];
2465
- },
2466
- getIndexByValue(t) {
2467
- const e = this.tabItems.map(
2468
- (i) => i.$options.propsData ? i.$options.propsData.value : void 0
2469
- ).indexOf(t);
2470
- return e >= 0 ? e : t;
2471
- },
2472
- getValueByIndex(t) {
2473
- const { propsData: e } = this.tabItems[t].$options;
2474
- return e && e.value ? e.value : t;
2475
- }
2476
- }
2477
- };
2478
- var qt = function() {
2479
- var e = this, i = e._self._c;
2480
- 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) {
2481
- return i("li", { directives: [{ name: "show", rawName: "v-show", value: s.visible, expression: "tabItem.visible" }], key: n, class: {
2482
- "is-active": e.activeTab === n,
2483
- "is-disabled": s.disabled
2484
- } }, [s.$slots.header ? i("CSlotComponent", { attrs: { component: s, name: "header", tag: "a" }, nativeOn: { click: function(a) {
2485
- return e.tabClick(n);
2486
- } } }) : i("a", { on: { click: function(a) {
2487
- return e.tabClick(n);
2488
- } } }, [s.icon ? i("CIcon", { attrs: { size: e.size, type: s.icon } }) : e._e(), i("span", [e._v(e._s(s.label))])], 1)], 1);
2489
- }), 0)]), i("section", { staticClass: "tab-content", class: { "is-transitioning": e.isTransitioning } }, [e._t("default")], 2)]);
2490
- }, jt = [], Kt = /* @__PURE__ */ o(
2491
- Ht,
2492
- qt,
2493
- jt,
2494
- !1,
2495
- null,
2496
- "e02a6440"
2497
- );
2498
- const O = Kt.exports;
2499
- function oi(t) {
2500
- t.component(D.name, D), t.component("CAutocomplete", Xe), t.component(_.name, _), t.component(S.name, S), t.component(k.name, k), t.component(f.name, f), t.component(g.name, g), t.component($.name, $), 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);
2501
- }
2502
- export {
2503
- ri as S,
2504
- oi as i
2505
- };