@cling-se/widget 0.14.2 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +4 -4
- package/README.md +40 -40
- package/package.json +1 -1
- package/tsconfig.json +26 -26
- package/tsconfig.node.json +10 -10
- package/tsconfig.paths.json +17 -17
- package/vite.config.ts +61 -61
- package/dist/AddClientCallout-BP2ip0A4.js +0 -46
- package/dist/AnswerModal-C8i3ldB_.js +0 -3869
- package/dist/AttachmentItem-BrvrAMae.js +0 -78
- package/dist/BaseDatePicker-BSkAllLg.js +0 -3183
- package/dist/BaseUpload-J2v3G0-q.js +0 -1977
- package/dist/BlockMedia-CAgKbN_k.js +0 -76
- package/dist/CCallout-D5Nk5DgN.js +0 -59
- package/dist/CCurrencyDropdown-CGYQfYSD.js +0 -246
- package/dist/CDropdownItem-DGES8E6l.js +0 -538
- package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
- package/dist/CFormField-CE4rV3cr.js +0 -241
- package/dist/CPhoneFormat-DXPrTit9.js +0 -62
- package/dist/CPriceInput-CYsf1n6T.js +0 -112
- package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
- package/dist/ClientAutocomplete-DPgOfPg1.js +0 -78
- package/dist/ClientModal-Dznh8Vvn.js +0 -625
- package/dist/ColorPicker-CWQEE8VR.js +0 -2879
- package/dist/CompanyModal-CeZ3GgLu.js +0 -141
- package/dist/ContentWrapper-DW7VHTdA.js +0 -183
- package/dist/CoverBlockSettings-DNSdXFgF.js +0 -275
- package/dist/DocAnswer-CPttkKAJ.js +0 -36
- package/dist/DocDetails-BCwWW_kM.js +0 -246
- package/dist/DocForm-BPjC08Ic.js +0 -7273
- package/dist/DocFormSend-BaC8IJCu.js +0 -143
- package/dist/DocLinks-DN-S8MY_.js +0 -38
- package/dist/DocModalBase-bFJp0T2Y.js +0 -28
- package/dist/DocPrint-Ci7Jyh-C.js +0 -240
- package/dist/DocReceipt-BYlXr6eS.js +0 -210
- package/dist/DocSendReminder-DFx4934a.js +0 -137
- package/dist/DocTextEditor-idQMnlIF.js +0 -17177
- package/dist/DocTimeline-ZmGSVRUB.js +0 -481
- package/dist/DocumentClient-DTRlyvLO.js +0 -136
- package/dist/DocumentLayout-BJAyNjNa.js +0 -4909
- package/dist/DocumentLogotype-pDJRc6Hj.js +0 -87
- package/dist/DocumentVoided-DfKewfe4.js +0 -25
- package/dist/EmbedInput-7hLNsnEV.js +0 -113
- package/dist/EmbedSettings-CpL24RhA.js +0 -72
- package/dist/ErrorCallout-CdJCe67q.js +0 -28
- package/dist/FilePreviewModal-B7qT3I7F.js +0 -81
- package/dist/Flag-DwW19zju.js +0 -114
- package/dist/HeaderSettings-C8SuuAwv.js +0 -392
- package/dist/ImageSelectModal-CAOh3YHc.js +0 -84
- package/dist/ImageUploadWrapper-21yldsj9.js +0 -1604
- package/dist/Index-B0BgYtWI.js +0 -150
- package/dist/Index-BC1AhlQ9.js +0 -98
- package/dist/Index-BZi6r2UN.js +0 -144
- package/dist/Index-BsD09y_2.js +0 -84
- package/dist/Index-Bu9SdKLP.js +0 -31
- package/dist/Index-BvsqZh2A.js +0 -26
- package/dist/Index-Bz4qd9uO.js +0 -55
- package/dist/Index-C--GiPc1.js +0 -171
- package/dist/Index-CC7qF0br.js +0 -77
- package/dist/Index-CGxOvTF4.js +0 -2402
- package/dist/Index-CI7_ktvb.js +0 -70
- package/dist/Index-COJZmxkX.js +0 -32
- package/dist/Index-CObEQ6G-.js +0 -140
- package/dist/Index-CP2bsXd-.js +0 -52
- package/dist/Index-CSvZBLnp.js +0 -49
- package/dist/Index-Ci-hGBbC.js +0 -33
- package/dist/Index-Ckzq1cEJ.js +0 -69
- package/dist/Index-CoIh5y2F.js +0 -62
- package/dist/Index-Couda8BX.js +0 -21
- package/dist/Index-CvXt3dm6.js +0 -292
- package/dist/Index-D95MNzAZ.js +0 -58
- package/dist/Index-DB5EG4EI.js +0 -223
- package/dist/Index-DDvRihXA.js +0 -24
- package/dist/Index-DIAntwBs.js +0 -61
- package/dist/Index-DUdJNcDT.js +0 -25
- package/dist/Index-DfANvO5d.js +0 -154
- package/dist/Index-Ds1Jv5Mr.js +0 -559
- package/dist/Index-FIWsRGmh.js +0 -57
- package/dist/Index-M3b7S4YX.js +0 -25
- package/dist/Index-NoN1_539.js +0 -642
- package/dist/Index-UGFm4yxI.js +0 -107
- package/dist/Index-aCBe0dXx.js +0 -754
- package/dist/Index-kJFtpJEP.js +0 -46
- package/dist/Index-rQKoLISX.js +0 -45
- package/dist/InputToggleRow-Ct8rvqAF.js +0 -57
- package/dist/ManualPopover-B0vp9ydC.js +0 -54
- package/dist/MediaWrapper-hmofOPLv.js +0 -23
- package/dist/NotBindingText-COpJPwHe.js +0 -32
- package/dist/PackageGroup-BdtslJL-.js +0 -699
- package/dist/PdfTerms-EDStBDhn.js +0 -36
- package/dist/PdfViewer-D1_Roqu2.js +0 -374
- package/dist/PlainHtml-C3JPvt4o.js +0 -20
- package/dist/PriceHeader-BdfozyN8.js +0 -339
- package/dist/SearchApi-CQtYh98a.js +0 -161
- package/dist/Setup-DHHMT6xu.js +0 -50
- package/dist/SmartList-BXeRj5NC.js +0 -83
- package/dist/TermsSettings-D1tDAu-r.js +0 -102
- package/dist/ThemeColorRow-HUN-QPY_.js +0 -63
- package/dist/ToggleBinding-CRoVM6Nw.js +0 -38
- package/dist/UploadModal-BD3pIiPT.js +0 -95
- package/dist/VideoPlayerInput-QFJfPoCf.js +0 -93
- package/dist/VideoPlayerSettings-CGq--niu.js +0 -61
- package/dist/VideoSelectModal-B61rBqdH.js +0 -100
- package/dist/anime.es-BrPTThYb.js +0 -858
- package/dist/answerDocumentMixin-DiONfM1s.js +0 -51
- package/dist/color-TdtKxwVa.js +0 -19
- package/dist/debounce-BIchuVwa.js +0 -84
- package/dist/dom-CJxkno7i.js +0 -91
- package/dist/favicon.ico +0 -0
- package/dist/focusDrawerMixin-CzvgKsOZ.js +0 -22
- package/dist/formComponentsInstall-EQLbqYqI.js +0 -2494
- package/dist/formDrawerState-CiKGHdNH.js +0 -20
- package/dist/formValidationMixin-5BVcxu38.js +0 -49
- package/dist/i18nMessages-Chz_lxGG.js +0 -17
- package/dist/index-BYTRIZIz.js +0 -81
- package/dist/index-Be__C37A.js +0 -102
- package/dist/index-CUydiL8B.js +0 -3919
- package/dist/index-DH6SCEKQ.js +0 -166
- package/dist/index-gtVGRKIX.js +0 -347
- package/dist/index-tNIrTnCx.js +0 -492
- package/dist/index.es.js +0 -35
- package/dist/index.umd.js +0 -3148
- package/dist/main-Bp2qcma0.js +0 -56697
- package/dist/mapFormMixin-Ce3_WIKw.js +0 -72
- package/dist/omit-21u5fFMx.js +0 -31
- package/dist/publicSenderState-BcN9kJJr.js +0 -21
- package/dist/splitpanes-BHUVsCZF.js +0 -382
- package/dist/style.css +0 -4
- package/dist/throttle-CfPxqhW_.js +0 -18
- package/dist/tinycolor-DNK6zGoq.js +0 -633
- package/dist/tippy.esm-B5TcTBWX.js +0 -1799
- package/dist/utils-GzwJPAEe.js +0 -108
- package/dist/vuedraggable.umd-2pmrPYml.js +0 -3161
- package/dist/vuex.esm-DKGl8mcw.js +0 -467
package/dist/index-DH6SCEKQ.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { s as n, F as o } from "./Flag-DwW19zju.js";
|
|
2
|
-
import { w as c } from "./CDropdownItem-DGES8E6l.js";
|
|
3
|
-
import { n as a } from "./main-Bp2qcma0.js";
|
|
4
|
-
import { i as d } from "./dom-CJxkno7i.js";
|
|
5
|
-
import { d as u } from "./debounce-BIchuVwa.js";
|
|
6
|
-
import { t as m } from "./throttle-CfPxqhW_.js";
|
|
7
|
-
const f = {
|
|
8
|
-
name: "BackgroundsModalList",
|
|
9
|
-
i18nOptions: {
|
|
10
|
-
namespaces: "backgroundsModalList",
|
|
11
|
-
messages: {
|
|
12
|
-
en: {
|
|
13
|
-
searchPlaceholder: "Search",
|
|
14
|
-
noMoreResults: "No more results"
|
|
15
|
-
},
|
|
16
|
-
sv: {
|
|
17
|
-
searchPlaceholder: "Sök efter en bild på engelska",
|
|
18
|
-
noMoreResults: "Inga fler resultat"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
components: {
|
|
23
|
-
simplebar: n,
|
|
24
|
-
Flag: o
|
|
25
|
-
},
|
|
26
|
-
mixins: [c],
|
|
27
|
-
props: {
|
|
28
|
-
/**
|
|
29
|
-
* @param {Object} options Input arguments
|
|
30
|
-
* @param {String} options.query Search/Query string
|
|
31
|
-
* @param {Number} options.page Current page number
|
|
32
|
-
*
|
|
33
|
-
* @returns {Object} containing:
|
|
34
|
-
* items {Array}
|
|
35
|
-
- item {Object}
|
|
36
|
-
- item.image {String} Url of image resource (REQUIRED)
|
|
37
|
-
- item.video {String} Url of video resource (OPTIONAL)
|
|
38
|
-
- item.lowQualityVideo {String} preview url of video file (OPTIONAL)
|
|
39
|
-
* total {Number} Number of results
|
|
40
|
-
*/
|
|
41
|
-
fetch: {
|
|
42
|
-
type: Function,
|
|
43
|
-
required: !0
|
|
44
|
-
},
|
|
45
|
-
defaultQuery: {
|
|
46
|
-
type: String,
|
|
47
|
-
required: !0
|
|
48
|
-
},
|
|
49
|
-
creditText: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: ""
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
data() {
|
|
55
|
-
return {
|
|
56
|
-
hoverIndex: null,
|
|
57
|
-
query: null,
|
|
58
|
-
items: [],
|
|
59
|
-
page: 1,
|
|
60
|
-
isLoading: !1,
|
|
61
|
-
allowMoreResults: !0,
|
|
62
|
-
searchTimeout: null,
|
|
63
|
-
selectedIndex: null,
|
|
64
|
-
selectedUrl: null,
|
|
65
|
-
noOfResults: null
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
watch: {
|
|
69
|
-
query() {
|
|
70
|
-
this.page = 0, this.items = [], this.allowMoreResults = !0, this.isLoading = !1, this.debouncedHandleFetch();
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
created() {
|
|
74
|
-
this.handleFetch(), this.debouncedHandleFetch = u(this.handleFetch, 1e3);
|
|
75
|
-
},
|
|
76
|
-
mounted() {
|
|
77
|
-
this.$refs.scrollbar.scrollElement.addEventListener(
|
|
78
|
-
"scroll",
|
|
79
|
-
this.scrollHandler,
|
|
80
|
-
{ passive: !0 }
|
|
81
|
-
);
|
|
82
|
-
},
|
|
83
|
-
beforeDestroy() {
|
|
84
|
-
this.$refs.scrollbar.scrollElement.removeEventListener(
|
|
85
|
-
"scroll",
|
|
86
|
-
this.scrollHandler,
|
|
87
|
-
{ passive: !0 }
|
|
88
|
-
);
|
|
89
|
-
},
|
|
90
|
-
methods: {
|
|
91
|
-
async handleFetch() {
|
|
92
|
-
if (!this.allowMoreResults || this.isLoading)
|
|
93
|
-
return;
|
|
94
|
-
this.isLoading = !0;
|
|
95
|
-
const i = this.query ? this.query : this.defaultQuery, { items: e, total: t } = await this.fetch({ query: i, page: this.page++ });
|
|
96
|
-
this.isLoading = !1, this.noOfResults = this.query ? t : null, this.items == null ? (this.selectedIndex = null, this.items = e) : this.items = [...this.items, ...e], this.allowMoreResults = t >= this.page * 12;
|
|
97
|
-
},
|
|
98
|
-
scrollHandler: m(async function() {
|
|
99
|
-
const e = this.$refs.item[this.$refs.item.length - 9 || 0];
|
|
100
|
-
e && d(e) && this.handleFetch();
|
|
101
|
-
}, 50),
|
|
102
|
-
selectItem(i, e) {
|
|
103
|
-
this.selectedIndex = e, this.$emit("select", i);
|
|
104
|
-
},
|
|
105
|
-
onSave() {
|
|
106
|
-
this.$emit("save");
|
|
107
|
-
},
|
|
108
|
-
playVideo(i) {
|
|
109
|
-
this.$refs.video[i] && this.$refs.video[i].play();
|
|
110
|
-
},
|
|
111
|
-
pauseVideo(i) {
|
|
112
|
-
const e = this.$refs.video[i];
|
|
113
|
-
e && (e.readyState === 4 ? e.pause() : e.addEventListener("playing", () => e.pause(), { once: !0 }));
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
var h = function() {
|
|
118
|
-
var e = this, t = e._self._c;
|
|
119
|
-
return t("div", { staticStyle: { "min-height": "0", display: "flex", "flex-direction": "column", height: "100%" } }, [t("div", { staticClass: "relative flex w-full shrink-0 py-1" }, [t("CInput", { staticClass: "flex-grow", staticStyle: { "border-bottom": "1px solid hsl(0, 0%, 92%)" }, attrs: { placeholder: e.$t("searchPlaceholder"), reset: !0, icon: "search", size: "medium" }, model: { value: e.query, callback: function(s) {
|
|
120
|
-
e.query = s;
|
|
121
|
-
}, expression: "query" } })], 1), t("div", { staticStyle: { overflow: "hidden", flex: "1", height: "100%" } }, [t("simplebar", { ref: "scrollbar", staticStyle: { width: "100%", height: "100%", padding: "3px 4px" } }, [t("div", { staticStyle: { display: "grid", "grid-template-columns": "repeat(auto-fit, minmax(210px, 1fr))", gap: "2px" } }, [!e.items.length && e.isLoading ? e._l(12, function(s) {
|
|
122
|
-
return t("div", { key: s, ref: "item", refInFor: !0, staticClass: "photo" });
|
|
123
|
-
}) : e._e(), e._l(e.items, function(s, l) {
|
|
124
|
-
return t("div", { key: l, ref: "item", refInFor: !0, staticClass: "photo", style: { backgroundImage: `url(${s.minImage})` }, on: { click: function(r) {
|
|
125
|
-
return e.selectItem(s, l);
|
|
126
|
-
} } }, [s.minVideo || s.video ? t("div", { staticClass: "video-bg__media", on: { "&mouseenter": function(r) {
|
|
127
|
-
return e.playVideo(l, s.minVideo || s.video);
|
|
128
|
-
}, "&mouseleave": function(r) {
|
|
129
|
-
return e.pauseVideo(l);
|
|
130
|
-
} } }, [t("video", { ref: "video", refInFor: !0, attrs: { src: s.minVideo || s.video, loop: "", muted: "", playsInline: "", preload: "none" }, domProps: { muted: !0 } })]) : e._e(), e.selectedIndex === l ? t("div", { staticClass: "select-wrapper" }) : e._e(), t("div", { staticClass: "photo__credit" }, [e._v(e._s(s.userName))])]);
|
|
131
|
-
})], 2), t("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { padding: "2em 1em" } }, [e.isLoading ? t("CIcon", { staticClass: "rotateSpin", attrs: { type: "loader" } }) : e.allowMoreResults ? e._e() : t("div", { staticClass: "flex w-full flex-col items-center justify-center text-gray-400" }, [t("div", [e._v(" " + e._s(e.$t("noMoreResults")) + " ")]), e.$i18n.lang !== "en" ? t("div", { staticClass: "flex flex-col items-center text-center", staticStyle: { "padding-top": "3.2rem" } }, [t("Flag", { staticClass: "mb-1 h-8 w-8", attrs: { region: "GB" } }), e._v(" Glöm inte att sökordet måste vara på engelska ")], 1) : e._e()])], 1)])], 1), t("div", { staticClass: "flex w-full items-center justify-end", staticStyle: { padding: "4px 4px 4px 8px", "flex-shrink": "0" } }, [t("div", { staticClass: "flex-grow text-gray-400" }, [e.mq !== "sm" ? [e.query && e.noOfResults && e.noOfResults > 0 ? t("div", [e._v(" " + e._s(e.$tc("_common:result", { count: e.noOfResults })) + " ")]) : e._e(), t("div", [e._v(" " + e._s(e.creditText) + " ")])] : e._e()], 2), e._t("footer", function() {
|
|
132
|
-
return [t("CButton", { staticStyle: { "margin-left": "0.5em" }, attrs: { type: "secondary" }, on: { click: e.onSave } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])];
|
|
133
|
-
})], 2)]);
|
|
134
|
-
}, p = [], v = /* @__PURE__ */ a(
|
|
135
|
-
f,
|
|
136
|
-
h,
|
|
137
|
-
p,
|
|
138
|
-
!1,
|
|
139
|
-
null,
|
|
140
|
-
"70d28101"
|
|
141
|
-
);
|
|
142
|
-
const g = v.exports, _ = {
|
|
143
|
-
name: "BackgroundsModal"
|
|
144
|
-
};
|
|
145
|
-
var y = function() {
|
|
146
|
-
var e = this, t = e._self._c;
|
|
147
|
-
return t("div", { staticClass: "font-primary fixed inset-0 z-[1000] flex items-center justify-center overflow-auto bg-black bg-opacity-10 max-sm:block max-sm:min-h-full max-sm:w-full max-sm:overflow-auto", on: { click: function(s) {
|
|
148
|
-
return s.target !== s.currentTarget ? null : e.$emit("close");
|
|
149
|
-
} } }, [t("div", { staticClass: "relative flex h-[90%] max-h-[700px] w-[90%] max-w-3xl flex-col rounded-lg bg-white max-sm:h-full max-sm:max-h-full max-sm:w-full max-sm:rounded-none", on: { click: function(s) {
|
|
150
|
-
s.stopPropagation();
|
|
151
|
-
} } }, [t("CButton", { staticClass: "absolute right-3 top-3 z-10", attrs: { pattern: "tertiary", type: "none", size: "small", circle: "", icon: "x" }, on: { click: function(s) {
|
|
152
|
-
return e.$emit("close");
|
|
153
|
-
} } }), e._t("header"), e._t("default")], 2)]);
|
|
154
|
-
}, x = [], w = /* @__PURE__ */ a(
|
|
155
|
-
_,
|
|
156
|
-
y,
|
|
157
|
-
x,
|
|
158
|
-
!1,
|
|
159
|
-
null,
|
|
160
|
-
"4a6a378b"
|
|
161
|
-
);
|
|
162
|
-
const b = w.exports, R = g, L = b;
|
|
163
|
-
export {
|
|
164
|
-
L as B,
|
|
165
|
-
R as a
|
|
166
|
-
};
|
package/dist/index-gtVGRKIX.js
DELETED
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
import { w as m } from "./CDropdownItem-DGES8E6l.js";
|
|
2
|
-
import { n as o, E as f, S as v, g as i, h as l } from "./main-Bp2qcma0.js";
|
|
3
|
-
import { m as h, a as d, b as _ } from "./vuex.esm-DKGl8mcw.js";
|
|
4
|
-
import { B as p } from "./DocTextEditor-idQMnlIF.js";
|
|
5
|
-
import { v as r } from "./index-tNIrTnCx.js";
|
|
6
|
-
import { S as g } from "./SmartList-BXeRj5NC.js";
|
|
7
|
-
const x = {
|
|
8
|
-
mixins: [m],
|
|
9
|
-
props: {
|
|
10
|
-
placement: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: "top-start"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
data() {
|
|
16
|
-
return {
|
|
17
|
-
isOpen: !1
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
methods: {
|
|
21
|
-
onOpen() {
|
|
22
|
-
this.$emit("open"), this.isOpen = !0;
|
|
23
|
-
},
|
|
24
|
-
onClose() {
|
|
25
|
-
this.$emit("close"), this.isOpen = !1;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var C = function() {
|
|
30
|
-
var e = this, t = e._self._c;
|
|
31
|
-
return e.mq === "sm" ? t("div", [t("div", { on: { click: e.onOpen } }, [e._t("default")], 2), e.isOpen ? t("portal", { attrs: { to: "modal" } }, [t("div", { staticClass: "modal-overlay", on: { click: function(a) {
|
|
32
|
-
return a.target !== a.currentTarget ? null : e.onClose.apply(null, arguments);
|
|
33
|
-
} } }, [t("div", { staticClass: "modal-container" }, [e._t("popover", null, { close: e.onClose })], 2)])]) : e._e()], 1) : t("v-popover", e._b({ attrs: { open: e.isOpen, placement: e.placement, "popover-class": "reset" }, on: { close: function(a) {
|
|
34
|
-
return e.onClose();
|
|
35
|
-
}, "update:open": function(a) {
|
|
36
|
-
a ? e.onOpen() : e.onClose();
|
|
37
|
-
} } }, "v-popover", e.$props, !1), [e._t("default"), t("div", { staticClass: "popover-container", attrs: { slot: "popover" }, slot: "popover" }, [e.isOpen ? t("portal", { attrs: { to: "modal" } }, [t("div", { staticClass: "overlay" })]) : e._e(), e._t("popover", null, { close: e.onClose })], 2)], 2);
|
|
38
|
-
}, T = [], $ = /* @__PURE__ */ o(
|
|
39
|
-
x,
|
|
40
|
-
C,
|
|
41
|
-
T,
|
|
42
|
-
!1,
|
|
43
|
-
null,
|
|
44
|
-
"da5fd556"
|
|
45
|
-
);
|
|
46
|
-
const S = $.exports, { mapFields: y } = f({
|
|
47
|
-
getterType: "forms/getField",
|
|
48
|
-
mutationType: "forms/updateField"
|
|
49
|
-
}), b = {
|
|
50
|
-
i18nOptions: {
|
|
51
|
-
namespaces: "TextTemplatesForm",
|
|
52
|
-
messages: {
|
|
53
|
-
en: {
|
|
54
|
-
textLabel: "Snippet",
|
|
55
|
-
name: {
|
|
56
|
-
label: "Template Name",
|
|
57
|
-
placeholder: "Name"
|
|
58
|
-
},
|
|
59
|
-
placeholderType: {
|
|
60
|
-
default: "Write here..."
|
|
61
|
-
},
|
|
62
|
-
validations: {
|
|
63
|
-
name: {
|
|
64
|
-
required: "Name is required",
|
|
65
|
-
maxLength: "Maximum length is 256 characters"
|
|
66
|
-
},
|
|
67
|
-
textContent: {
|
|
68
|
-
required: "Add some content"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
sv: {
|
|
73
|
-
textLabel: "Mallens innehåll",
|
|
74
|
-
name: {
|
|
75
|
-
label: "Namn på mallen",
|
|
76
|
-
placeholder: "Mallens namn"
|
|
77
|
-
},
|
|
78
|
-
placeholderType: {
|
|
79
|
-
default: "Skriv här..."
|
|
80
|
-
},
|
|
81
|
-
validations: {
|
|
82
|
-
name: {
|
|
83
|
-
required: "Ge mallen ett namn",
|
|
84
|
-
maxLength: "Får max vara 256 tecken långt"
|
|
85
|
-
},
|
|
86
|
-
textContent: {
|
|
87
|
-
required: "Skriv vad mallen ska innehålla"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
name: "TextTemplatesForm",
|
|
94
|
-
components: {
|
|
95
|
-
BaseTextEditor: p,
|
|
96
|
-
Spinner: v
|
|
97
|
-
},
|
|
98
|
-
props: {
|
|
99
|
-
id: {
|
|
100
|
-
type: [String, Number],
|
|
101
|
-
default: null
|
|
102
|
-
},
|
|
103
|
-
predefinedTextContent: {
|
|
104
|
-
type: String,
|
|
105
|
-
default: null
|
|
106
|
-
},
|
|
107
|
-
onAfterSubmit: {
|
|
108
|
-
type: Function,
|
|
109
|
-
default: null
|
|
110
|
-
},
|
|
111
|
-
showFixedCloseButton: {
|
|
112
|
-
type: Boolean,
|
|
113
|
-
default: !1
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
validations: {
|
|
117
|
-
name: {
|
|
118
|
-
required: r.required,
|
|
119
|
-
maxLength: r.maxLength(255)
|
|
120
|
-
},
|
|
121
|
-
textContent: {
|
|
122
|
-
required: r.required
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
computed: {
|
|
126
|
-
...h({
|
|
127
|
-
isPosting: "templateMessages/isPosting",
|
|
128
|
-
isFetching: "templateMessages/isFetching",
|
|
129
|
-
checkFormChanged: "forms/hasChanged"
|
|
130
|
-
}),
|
|
131
|
-
...y({
|
|
132
|
-
templateMessage: "templateMessage",
|
|
133
|
-
name: "templateMessage.name",
|
|
134
|
-
textContent: "templateMessage.message"
|
|
135
|
-
}),
|
|
136
|
-
messages() {
|
|
137
|
-
return {
|
|
138
|
-
name: {
|
|
139
|
-
required: this.$t("validations.name.required"),
|
|
140
|
-
maxLength: this.$t("validations.name.maxLength")
|
|
141
|
-
},
|
|
142
|
-
textContent: {
|
|
143
|
-
required: this.$t("validations.textContent.required")
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
},
|
|
147
|
-
hasChanged() {
|
|
148
|
-
return this.checkFormChanged("templateMessage");
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
watch: {
|
|
152
|
-
id() {
|
|
153
|
-
this.load();
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
mounted() {
|
|
157
|
-
this.load(), this.predefinedTextContent && (this.textContent = this.predefinedTextContent);
|
|
158
|
-
},
|
|
159
|
-
methods: {
|
|
160
|
-
...d({
|
|
161
|
-
loadTemplate: i.LOAD_TEMPLATE_MESSAGE,
|
|
162
|
-
deleteTemplate: i.DELETE_TEMPLATE_MESSAGE,
|
|
163
|
-
formNewTemplate: i.FORM_NEW_TEMPLATE_MESSAGE,
|
|
164
|
-
formEditTemplate: i.FORM_EDIT_TEMPLATE_MESSAGE,
|
|
165
|
-
formSubmitTemplate: i.FORM_SUBMIT_TEMPLATE_MESSAGE
|
|
166
|
-
}),
|
|
167
|
-
canLeave() {
|
|
168
|
-
return !this.hasChanged;
|
|
169
|
-
},
|
|
170
|
-
async load() {
|
|
171
|
-
try {
|
|
172
|
-
this.id ? (await this.loadTemplate({
|
|
173
|
-
id: this.id
|
|
174
|
-
}), await this.formEditTemplate({
|
|
175
|
-
id: this.id
|
|
176
|
-
})) : await this.formNewTemplate();
|
|
177
|
-
} catch (s) {
|
|
178
|
-
l(s);
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
validateBeforeSubmit() {
|
|
182
|
-
return this.$v.$touch(), this.$v.$invalid ? !1 : this.submit();
|
|
183
|
-
},
|
|
184
|
-
async submit() {
|
|
185
|
-
if (this.hasChanged)
|
|
186
|
-
try {
|
|
187
|
-
await this.formSubmitTemplate(), typeof this.onAfterSubmit == "function" && this.onAfterSubmit();
|
|
188
|
-
} catch (s) {
|
|
189
|
-
l(s);
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
async remove() {
|
|
193
|
-
try {
|
|
194
|
-
await this.deleteTemplate({ id: this.id }), typeof this.onAfterSubmit == "function" && this.onAfterSubmit();
|
|
195
|
-
} catch (s) {
|
|
196
|
-
l(s);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
var M = function() {
|
|
202
|
-
var e = this, t = e._self._c;
|
|
203
|
-
return t("div", { staticStyle: { position: "relative" } }, [e.showFixedCloseButton ? t("CButton", { staticClass: "fixed-close-button", attrs: { circle: "", icon: "x" }, on: { click: function(a) {
|
|
204
|
-
return e.$emit("close");
|
|
205
|
-
} } }) : e._e(), e.isFetching ? t("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { padding: "calc(3 * var(--rem)) 0" } }, [t("Spinner")], 1) : e.templateMessage !== void 0 ? t("form", [t("CField", { attrs: { validator: e.$v.name, messages: e.messages.name, label: e.$t("name.label") } }, [t("CInput", { attrs: { placeholder: e.$t("name.placeholder") }, on: { blur: function(a) {
|
|
206
|
-
return e.$v.name.$touch();
|
|
207
|
-
} }, model: { value: e.name, callback: function(a) {
|
|
208
|
-
e.name = a;
|
|
209
|
-
}, expression: "name" } })], 1), t("CField", { attrs: { validator: e.$v.textContent, messages: e.messages.textContent, label: e.$t("textLabel") } }, [t("BaseTextEditor", { attrs: { placeholder: e.$t("placeholderType.default"), "class-list": "large" }, on: { blur: function(a) {
|
|
210
|
-
return e.$v.textContent.$touch();
|
|
211
|
-
} }, model: { value: e.textContent, callback: function(a) {
|
|
212
|
-
e.textContent = a;
|
|
213
|
-
}, expression: "textContent" } })], 1), t("CButton", { staticStyle: { "margin-top": "calc(1 * var(--rem))" }, attrs: { loading: e.isPosting, disabled: !e.hasChanged, type: "secondary", icon: "save", wide: "" }, on: { click: function(a) {
|
|
214
|
-
return e.validateBeforeSubmit();
|
|
215
|
-
} } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")]), e.id ? t("CButton", { staticStyle: { "margin-top": "calc(1 * var(--rem))" }, attrs: { loading: e.isPosting, type: "secondary", pattern: "tertiary", wide: "" }, on: { click: function(a) {
|
|
216
|
-
return e.remove();
|
|
217
|
-
} } }, [e._v(" " + e._s(e.$t("_common:remove")) + " ")]) : e._e()], 1) : e._e()], 1);
|
|
218
|
-
}, E = [], w = /* @__PURE__ */ o(
|
|
219
|
-
b,
|
|
220
|
-
M,
|
|
221
|
-
E,
|
|
222
|
-
!1,
|
|
223
|
-
null,
|
|
224
|
-
"e14860e7"
|
|
225
|
-
);
|
|
226
|
-
const F = w.exports, k = {
|
|
227
|
-
name: "TextTemplatesModal",
|
|
228
|
-
components: {
|
|
229
|
-
SmartList: g,
|
|
230
|
-
BaseTextEditor: p
|
|
231
|
-
},
|
|
232
|
-
mixins: [m],
|
|
233
|
-
data() {
|
|
234
|
-
return {
|
|
235
|
-
selectedIndex: 0,
|
|
236
|
-
query: ""
|
|
237
|
-
};
|
|
238
|
-
},
|
|
239
|
-
computed: {
|
|
240
|
-
..._("templateMessages", {
|
|
241
|
-
templateMessages: (s) => s.data
|
|
242
|
-
}),
|
|
243
|
-
templates() {
|
|
244
|
-
return Object.values(this.templateMessages);
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
methods: {
|
|
248
|
-
onSelect(s) {
|
|
249
|
-
this.$emit("select", s), this.close();
|
|
250
|
-
},
|
|
251
|
-
close() {
|
|
252
|
-
this.$emit("close");
|
|
253
|
-
},
|
|
254
|
-
openCreateModal() {
|
|
255
|
-
this.close(), this.$modal.show(
|
|
256
|
-
F,
|
|
257
|
-
{
|
|
258
|
-
predefinedTextContent: "",
|
|
259
|
-
showFixedCloseButton: !0,
|
|
260
|
-
onAfterSubmit: () => this.$modal.hide("saveTemplateModal")
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
name: "saveTemplateModal",
|
|
264
|
-
delay: 100,
|
|
265
|
-
adaptive: !0,
|
|
266
|
-
height: "auto",
|
|
267
|
-
width: "90%",
|
|
268
|
-
maxWidth: 500,
|
|
269
|
-
scrollable: !0,
|
|
270
|
-
classes: "overflow-visible default"
|
|
271
|
-
}
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
var q = function() {
|
|
277
|
-
var e = this, t = e._self._c;
|
|
278
|
-
return t("SmartList", { attrs: { items: e.templates, "sort-key": "position", query: e.query }, scopedSlots: e._u([{ key: "default", fn: function({ items: a }) {
|
|
279
|
-
return [t("div", { ref: "modal-container", staticClass: "font-inter t-modal" }, [t("div", { staticClass: "t-nav" }, [t("CInput", { ref: "searchInput", staticClass: "search-input focus:text-gray-500", attrs: { placeholder: e.$t("search"), icon: "search" }, on: { input: function(n) {
|
|
280
|
-
e.selectedIndex = 0;
|
|
281
|
-
} }, model: { value: e.query, callback: function(n) {
|
|
282
|
-
e.query = n;
|
|
283
|
-
}, expression: "query" } })], 1), t("div", { staticClass: "t-main" }, [t("div", { staticClass: "t-list" }, e._l(a, function(n, c) {
|
|
284
|
-
return t("div", { key: n.id, staticClass: "t-list-item truncate-text", class: { selected: c === e.selectedIndex }, on: { "&mouseover": function(u) {
|
|
285
|
-
e.selectedIndex = c;
|
|
286
|
-
}, click: function(u) {
|
|
287
|
-
return e.onSelect(a[e.selectedIndex].message || "");
|
|
288
|
-
} } }, [e._v(" " + e._s(n.name) + " ")]);
|
|
289
|
-
}), 0), e.mq !== "sm" ? t("div", { staticClass: "t-text quill-format" }, [a[e.selectedIndex] ? t("BaseTextEditor", { attrs: { value: a[e.selectedIndex].message || "", editable: !1, extensions: "all", "class-list": "document-form", unstyled: "" } }) : t("div", [e._v(" " + e._s(e.$t("noResults")) + " ")])], 1) : e._e()]), t("div", { staticClass: "t-footer flex w-full items-center justify-between" }, [t("div", { staticStyle: { display: "inline-flex", "align-items": "center" } }), t("div", [t("CButton", { staticClass: "t-footer-button", attrs: { to: { name: "settingsTemplates" }, target: "_blank", size: "small" } }, [e._v(" " + e._s(e.$t("handle")) + " "), t("CIcon", { staticStyle: { "margin-left": "0.5em" }, attrs: { type: "new-window", size: "16" } })], 1), t("CButton", { staticClass: "t-footer-button", attrs: { size: "small" }, on: { click: e.openCreateModal } }, [e._v(" " + e._s(e.$t("create", { thing: e.$t("template") })) + " ")])], 1)])])];
|
|
290
|
-
} }]) });
|
|
291
|
-
}, A = [], L = /* @__PURE__ */ o(
|
|
292
|
-
k,
|
|
293
|
-
q,
|
|
294
|
-
A,
|
|
295
|
-
!1,
|
|
296
|
-
null,
|
|
297
|
-
"9d6f8cd8"
|
|
298
|
-
);
|
|
299
|
-
const B = L.exports, O = {
|
|
300
|
-
name: "TextTemplates",
|
|
301
|
-
components: {
|
|
302
|
-
ContextModal: S,
|
|
303
|
-
TextTemplatesModal: B
|
|
304
|
-
},
|
|
305
|
-
inject: {
|
|
306
|
-
viewSettings: {
|
|
307
|
-
default: () => ({ isPublicForm: !1 })
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
props: {
|
|
311
|
-
placement: {
|
|
312
|
-
type: String,
|
|
313
|
-
default: "left"
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
created() {
|
|
317
|
-
this.viewSettings.isPublicForm || this.loadTemplateMessages();
|
|
318
|
-
},
|
|
319
|
-
methods: {
|
|
320
|
-
...d({
|
|
321
|
-
loadTemplateMessages: i.LOAD_TEMPLATE_MESSAGES
|
|
322
|
-
})
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
var I = function() {
|
|
326
|
-
var e = this, t = e._self._c;
|
|
327
|
-
return e.viewSettings.isPublicForm ? e._e() : t("div", { staticClass: "t-list" }, [t("ContextModal", { attrs: { "break-point": 1e3, placement: e.placement }, on: { open: function(a) {
|
|
328
|
-
return e.$emit("open");
|
|
329
|
-
}, close: function(a) {
|
|
330
|
-
return e.$emit("close");
|
|
331
|
-
} }, scopedSlots: e._u([{ key: "popover", fn: function({ close: a }) {
|
|
332
|
-
return [t("TextTemplatesModal", { on: { close: a, select: function(n) {
|
|
333
|
-
return e.$emit("select", n);
|
|
334
|
-
} } })];
|
|
335
|
-
} }], null, !1, 1240188552) }, [t("div", { staticClass: "t-option main" }, [e._t("default")], 2)])], 1);
|
|
336
|
-
}, P = [], G = /* @__PURE__ */ o(
|
|
337
|
-
O,
|
|
338
|
-
I,
|
|
339
|
-
P,
|
|
340
|
-
!1,
|
|
341
|
-
null,
|
|
342
|
-
null
|
|
343
|
-
);
|
|
344
|
-
const H = G.exports;
|
|
345
|
-
export {
|
|
346
|
-
H as default
|
|
347
|
-
};
|