@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
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
import { m as x } from "./mapFormMixin-Ce3_WIKw.js";
|
|
2
|
-
import { T as w } from "./ThemeColorRow-HUN-QPY_.js";
|
|
3
|
-
import C from "./VideoPlayerInput-QFJfPoCf.js";
|
|
4
|
-
import _ from "./ImageUploadWrapper-21yldsj9.js";
|
|
5
|
-
import { B as k, a as b } from "./index-DH6SCEKQ.js";
|
|
6
|
-
import { c as v, n as y, o as d, H as S } from "./main-Bp2qcma0.js";
|
|
7
|
-
import { t as A } from "./tinycolor-DNK6zGoq.js";
|
|
8
|
-
const g = v.unsplash.id, L = v.pexels.id, z = {
|
|
9
|
-
name: "MediaSelectModal",
|
|
10
|
-
i18nOptions: {
|
|
11
|
-
namespaces: "mediaSelectModal",
|
|
12
|
-
messages: {
|
|
13
|
-
en: {
|
|
14
|
-
title: "Choose background",
|
|
15
|
-
creditVideos: "Videos from {{thing}}",
|
|
16
|
-
tabLink: "Use link",
|
|
17
|
-
minWidth: "Recommended minimum image width is 1200 pixels or greater."
|
|
18
|
-
},
|
|
19
|
-
sv: {
|
|
20
|
-
title: "Välj bakgrundsbild",
|
|
21
|
-
creditVideos: "Videor från {{thing}}",
|
|
22
|
-
tabLink: "Egen länk",
|
|
23
|
-
minWidth: "Rekommenderad minimum bredd på bilden är 1200 pixlar eller större."
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
components: {
|
|
28
|
-
BackgroundModal: k,
|
|
29
|
-
BackgroundList: b,
|
|
30
|
-
VideoPlayerInput: C,
|
|
31
|
-
ImageUploadWrapper: _
|
|
32
|
-
},
|
|
33
|
-
props: {
|
|
34
|
-
currentType: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: ""
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
data() {
|
|
40
|
-
return {
|
|
41
|
-
tabs: [
|
|
42
|
-
{
|
|
43
|
-
value: "unsplash",
|
|
44
|
-
label: "Unsplash",
|
|
45
|
-
icon: '<svg style="margin-right: calc(0.5 * var(--rem));" width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M10 9V0h12v9H10zm12 5h10v18H0V14h10v9h12v-9z"/></svg>'
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
value: "customImage",
|
|
49
|
-
label: this.$t("_common:upload"),
|
|
50
|
-
icon: '<svg style="margin-right: calc(0.5 * var(--rem));" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M20.4 14.5L16 10 4 20"/></svg>'
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
value: "pexels",
|
|
54
|
-
label: "Pexels",
|
|
55
|
-
icon: '<svg style="margin-right: calc(0.5 * var(--rem));" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 32 32"><path d="M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z" fill="#05A081"></path><path d="M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z" fill="#fff"></path></svg>'
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
value: "customVideo",
|
|
59
|
-
label: this.$t("tabLink"),
|
|
60
|
-
icon: '<svg style="margin-right: calc(0.5 * var(--rem));" width="28" height="28" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" xml:space="preserve" viewBox="0 0 71.412 50"><g transform="scale(.58824)"><path d="M118.9 13.3c-1.4-5.2-5.5-9.3-10.7-10.7C98.7 0 60.7 0 60.7 0s-38 0-47.5 2.5C8.1 3.9 3.9 8.1 2.5 13.3 0 22.8 0 42.5 0 42.5s0 19.8 2.5 29.2C3.9 76.9 8 81 13.2 82.4 22.8 85 60.7 85 60.7 85s38 0 47.5-2.5c5.2-1.4 9.3-5.5 10.7-10.7 2.5-9.5 2.5-29.2 2.5-29.2s.1-19.8-2.5-29.3z" fill="red" fill-opacity="1"/><path fill="#fff" d="M80.2 42.5L48.6 24.3v36.4z"/></g></svg>'
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
activeTab: "unsplash",
|
|
64
|
-
selectedImage: null,
|
|
65
|
-
preferredColor: null,
|
|
66
|
-
customImage: null,
|
|
67
|
-
selectedVideo: null,
|
|
68
|
-
customVideo: null
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
computed: {
|
|
72
|
-
isImage() {
|
|
73
|
-
return ["unsplash", "customImage"].includes(this.activeTab);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
created() {
|
|
77
|
-
this.currentType === "video" && (this.activeTab = "pexels");
|
|
78
|
-
},
|
|
79
|
-
methods: {
|
|
80
|
-
async fetchImage({ query: i, page: t }) {
|
|
81
|
-
const { data: e } = await d.get(
|
|
82
|
-
"https://api.unsplash.com/search/photos",
|
|
83
|
-
{
|
|
84
|
-
params: {
|
|
85
|
-
page: t,
|
|
86
|
-
per_page: 12,
|
|
87
|
-
client_id: g,
|
|
88
|
-
query: i
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
return {
|
|
93
|
-
items: (e.results || []).map((o) => ({
|
|
94
|
-
...o,
|
|
95
|
-
image: o.urls.regular,
|
|
96
|
-
minImage: o.urls.thumb
|
|
97
|
-
})),
|
|
98
|
-
total: e.total
|
|
99
|
-
};
|
|
100
|
-
},
|
|
101
|
-
async fetchVideo({ query: i, page: t }) {
|
|
102
|
-
const { data: e } = await d.get("https://api.pexels.com/videos/search", {
|
|
103
|
-
headers: {
|
|
104
|
-
Authorization: L
|
|
105
|
-
},
|
|
106
|
-
params: {
|
|
107
|
-
page: t,
|
|
108
|
-
per_page: 12,
|
|
109
|
-
query: i
|
|
110
|
-
}
|
|
111
|
-
}), o = (s, a) => s.height < a.height || s.width < a.width ? -1 : 1, r = (s) => (s.find(({ height: a }) => a > 1e3 && a < 1200) || {}).link;
|
|
112
|
-
return {
|
|
113
|
-
items: (e.videos || []).map(
|
|
114
|
-
({ id: s, image: a, video_files: u = [], user: m }) => {
|
|
115
|
-
const { sd: h, hd: p } = (u || []).sort(o).reduce(
|
|
116
|
-
(n, l) => (n[l.quality] && l.link && n[l.quality].push(l.link), n),
|
|
117
|
-
{ sd: [], hd: [] }
|
|
118
|
-
), [f] = h;
|
|
119
|
-
let c = r(u);
|
|
120
|
-
return c || ([c] = p.length ? p : h.slice(-1)), {
|
|
121
|
-
id: `${s}`,
|
|
122
|
-
image: a,
|
|
123
|
-
minImage: a,
|
|
124
|
-
video: c,
|
|
125
|
-
minVideo: f,
|
|
126
|
-
userName: m.name,
|
|
127
|
-
userLink: m.link
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
total: e.total_results
|
|
132
|
-
};
|
|
133
|
-
},
|
|
134
|
-
selectImage({ image: i, links: t, color: e }) {
|
|
135
|
-
this.selectedImage = S(i, { w: 1800 }), e && (this.preferredColor = e);
|
|
136
|
-
const o = new Image();
|
|
137
|
-
o.src = this.selectedImage, d.get(t.download_location, {
|
|
138
|
-
params: {
|
|
139
|
-
client_id: g
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
},
|
|
143
|
-
setCustomBackground({ response: i }) {
|
|
144
|
-
this.customImage = i.url;
|
|
145
|
-
},
|
|
146
|
-
selectVideo({ id: i, image: t, video: e }) {
|
|
147
|
-
this.selectedVideo = {
|
|
148
|
-
id: i,
|
|
149
|
-
url: e,
|
|
150
|
-
thumbnail: t,
|
|
151
|
-
provider: "pexels"
|
|
152
|
-
};
|
|
153
|
-
},
|
|
154
|
-
onSave() {
|
|
155
|
-
let i;
|
|
156
|
-
this.isImage ? i = {
|
|
157
|
-
type: "image",
|
|
158
|
-
value: this.activeTab === "unsplash" ? this.selectedImage : this.customImage
|
|
159
|
-
} : i = {
|
|
160
|
-
type: "video",
|
|
161
|
-
value: this.activeTab === "pexels" ? this.selectedVideo : this.customVideo
|
|
162
|
-
}, this.preferredColor && (i.preferredColor = this.preferredColor), this.$emit("input", i), this.$parent && this.$parent.$emit("input", i), this.$emit("close");
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
var I = function() {
|
|
167
|
-
var t = this, e = t._self._c;
|
|
168
|
-
return e("BackgroundModal", t._g({}, t.$listeners), [e("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { padding: "calc(0.25 * var(--rem)) calc(1 * var(--rem))", "border-bottom": "1px solid hsl(0, 0%, 88%)" }, attrs: { slot: "header" }, slot: "header" }, t._l(t.tabs, function(o, r) {
|
|
169
|
-
return e("CButton", { key: r, staticStyle: { "font-size": "15px", "font-weight": "700", opacity: "0.5", "box-shadow": "none" }, style: t.activeTab === o.value && { opacity: 1 }, on: { click: function(s) {
|
|
170
|
-
t.activeTab = o.value;
|
|
171
|
-
} } }, [e("span", { staticClass: "inline-flex items-center justify-center" }, [e("div", { domProps: { innerHTML: t._s(o.icon) } }), e("span", { staticClass: "max-md:!hidden" }, [t._v(t._s(o.label))])])]);
|
|
172
|
-
}), 1), ["unsplash", "pexels"].includes(t.activeTab) ? e("BackgroundList", { key: t.activeTab, attrs: { fetch: t.isImage ? t.fetchImage : t.fetchVideo, "credit-text": t.$t("creditVideos", { thing: t.activeTab.capitalize() }), "default-query": "nature" }, on: { select: function(o) {
|
|
173
|
-
t.isImage ? t.selectImage(o) : t.selectVideo(o);
|
|
174
|
-
} } }, [e("CButton", { staticStyle: { "margin-left": "0.5em" }, attrs: { slot: "footer", disabled: t.isImage ? !t.selectedImage : !t.selectedVideo, type: "secondary" }, on: { click: t.onSave }, slot: "footer" }, [t._v(" " + t._s(t.$t("_common:save")) + " ")])], 1) : t.activeTab === "customVideo" ? e("div", { staticClass: "flex w-full flex-col items-center justify-center" }, [e("div", { staticStyle: { "max-width": "500px", width: "100%", margin: "0 auto", "padding-top": "calc(3 * var(--rem))" } }, [e("div", { staticStyle: { position: "relative", width: "100%", "padding-top": "56.25%", "background-color": "hsl(var(--gray-color-100) / 1)", "border-radius": "0.5em", "margin-bottom": "calc(1.5 * var(--rem))" } }, [t.customVideo ? e("iframe", { staticClass: "custom-video-preview", attrs: { src: t.customVideo.url } }) : t._e()]), e("VideoPlayerInput", { attrs: { filled: !0, "video-options": { background: !0 } }, model: { value: t.customVideo, callback: function(o) {
|
|
175
|
-
t.customVideo = o;
|
|
176
|
-
}, expression: "customVideo" } }, [e("CButton", { attrs: { disabled: !t.customVideo, type: "secondary" }, on: { click: t.onSave } }, [t._v(" " + t._s(t.$t("_common:save")) + " ")])], 1)], 1)]) : e("div", { staticClass: "flex flex-col items-center justify-center" }, [e("div", { staticStyle: { "max-width": "500px", width: "100%", margin: "0 auto", "padding-top": "calc(3 * var(--rem))" } }, [e("ImageUploadWrapper", { ref: "uploadWrapper", attrs: { "on-image-upload": t.setCustomBackground }, scopedSlots: t._u([{ key: "default", fn: function({ progress: o }) {
|
|
177
|
-
return [e("div", { staticClass: "relative mb-6 w-full" }, [t.customImage ? e("img", { staticClass: "h-full w-full object-cover object-scale-down object-top", staticStyle: { "max-height": "500px" }, attrs: { src: t.customImage, alt: t.customImage } }) : e("div", { staticClass: "flex aspect-video flex-col items-center justify-center rounded-md bg-gray-100" }, [e("CButton", { style: t.customImage && { opacity: 0.5 }, attrs: { loading: !!o && o < 100, "icon-left": "upload", type: "none" } }, [t._v(" " + t._s(t.$t("_common:upload")) + " ")]), e("div", { staticClass: "text-center text-gray-600", staticStyle: { "padding-top": "calc(1 * var(--rem))", "font-size": "14px", "max-width": "40ch" } }, [t._v(" " + t._s(t.$t("minWidth")) + " ")])], 1)])];
|
|
178
|
-
} }]) }), e("div", { staticClass: "flex items-center justify-center" }, [e("CButton", { attrs: { disabled: !t.customImage, type: "secondary" }, on: { click: t.onSave } }, [t._v(" " + t._s(t.$t("_common:save")) + " ")])], 1)], 1)])], 1);
|
|
179
|
-
}, V = [], M = /* @__PURE__ */ y(
|
|
180
|
-
z,
|
|
181
|
-
I,
|
|
182
|
-
V,
|
|
183
|
-
!1,
|
|
184
|
-
null,
|
|
185
|
-
"459dc015"
|
|
186
|
-
);
|
|
187
|
-
const T = M.exports, $ = {
|
|
188
|
-
name: "HeaderSettings",
|
|
189
|
-
components: {
|
|
190
|
-
ThemeColorRow: w
|
|
191
|
-
},
|
|
192
|
-
mixins: [
|
|
193
|
-
x(
|
|
194
|
-
[
|
|
195
|
-
"layout",
|
|
196
|
-
"items",
|
|
197
|
-
"media",
|
|
198
|
-
"showPriceSummary",
|
|
199
|
-
"backgroundColor",
|
|
200
|
-
"textAlign",
|
|
201
|
-
"textColor"
|
|
202
|
-
],
|
|
203
|
-
{ useEmit: !1 }
|
|
204
|
-
)
|
|
205
|
-
],
|
|
206
|
-
data() {
|
|
207
|
-
return {
|
|
208
|
-
type: "image",
|
|
209
|
-
layoutOptions2: [
|
|
210
|
-
{
|
|
211
|
-
value: "left",
|
|
212
|
-
icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>'
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
value: "right",
|
|
216
|
-
icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="13" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>'
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
value: "top",
|
|
220
|
-
icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="18" height="7" rx="1" fill="currentColor"></rect>'
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
value: "bottom",
|
|
224
|
-
icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="14" width="18" height="5" rx="1" fill="currentColor"></rect>'
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
value: "center",
|
|
228
|
-
icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="8" y="12" width="8" height="2" rx="0" fill="currentColor"></rect>'
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
value: "price",
|
|
232
|
-
icon: '<rect x="4" y="6" width="16" height="7"></rect><rect x="4" y="16" width="16" height="3" style="fill: currentColor;"></rect>'
|
|
233
|
-
}
|
|
234
|
-
],
|
|
235
|
-
alignOptions: [
|
|
236
|
-
{
|
|
237
|
-
value: "left",
|
|
238
|
-
icon: '<path d="M 6 9 A 2.0002 2.0002 0 1 0 6 13 L 34 13 A 2.0002 2.0002 0 1 0 34 9 L 6 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 7 35 A 2.0002 2.0002 0 1 0 7 39 L 27 39 A 2.0002 2.0002 0 1 0 27 35 L 7 35 z" />'
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
value: "center",
|
|
242
|
-
icon: '<path d="M 10 9 A 2.0002 2.0002 0 1 0 10 13 L 38 13 A 2.0002 2.0002 0 1 0 38 9 L 10 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 14 35 A 2.0002 2.0002 0 1 0 14 39 L 34 39 A 2.0002 2.0002 0 1 0 34 35 L 14 35 z" />'
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
value: "right",
|
|
246
|
-
icon: '<path d="M 14 9 A 2.0002 2.0002 0 1 0 14 13 L 42 13 A 2.0002 2.0002 0 1 0 42 9 L 14 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 22 35 A 2.0002 2.0002 0 1 0 22 39 L 42 39 A 2.0002 2.0002 0 1 0 42 35 L 22 35 z" />'
|
|
247
|
-
}
|
|
248
|
-
]
|
|
249
|
-
};
|
|
250
|
-
},
|
|
251
|
-
computed: {
|
|
252
|
-
layoutOptions() {
|
|
253
|
-
var t;
|
|
254
|
-
const { type: i } = ((t = this.items) == null ? void 0 : t[0]) || {};
|
|
255
|
-
return [
|
|
256
|
-
{
|
|
257
|
-
// left
|
|
258
|
-
isActive: this.layout === "vertical" && i === "media",
|
|
259
|
-
icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>',
|
|
260
|
-
onClick: () => this.setLayout({ layout: "vertical", type: "media" })
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
// right
|
|
264
|
-
isActive: this.layout === "vertical" && i === "content",
|
|
265
|
-
icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="13" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>',
|
|
266
|
-
onClick: () => this.setLayout({ layout: "vertical", type: "content" })
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
// top
|
|
270
|
-
isActive: this.layout === "horizontal" && i === "media",
|
|
271
|
-
icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="18" height="7" rx="1" fill="currentColor"></rect>',
|
|
272
|
-
onClick: () => this.setLayout({ layout: "horizontal", type: "media" })
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
// bottom
|
|
276
|
-
isActive: this.layout === "horizontal" && i === "content",
|
|
277
|
-
icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="14" width="18" height="5" rx="1" fill="currentColor"></rect>',
|
|
278
|
-
onClick: () => this.setLayout({ layout: "horizontal", type: "content" })
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
// center
|
|
282
|
-
isActive: this.layout === "center",
|
|
283
|
-
icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="8" y="12" width="8" height="2" rx="0" fill="currentColor"></rect>',
|
|
284
|
-
onClick: () => this.setLayout({ layout: "center", type: "media" })
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
// price
|
|
288
|
-
isActive: this.layout === "price",
|
|
289
|
-
icon: '<rect x="4" y="6" width="16" height="7"></rect><rect x="4" y="16" width="16" height="3" style="fill: currentColor;"></rect>',
|
|
290
|
-
onClick: () => this.setLayout({ layout: "price" })
|
|
291
|
-
}
|
|
292
|
-
];
|
|
293
|
-
},
|
|
294
|
-
overlayColor: {
|
|
295
|
-
get() {
|
|
296
|
-
var i;
|
|
297
|
-
return ((i = this.media) == null ? void 0 : i.overlayColor) || "";
|
|
298
|
-
},
|
|
299
|
-
set(i) {
|
|
300
|
-
this.media = { ...this.media, overlay: !0, overlayColor: i };
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
background() {
|
|
304
|
-
let i = "";
|
|
305
|
-
const { type: t, resourceUrl: e, video: o = {} } = this.media || {};
|
|
306
|
-
return t === "image" && e ? i = e : t === "video" && o.thumbnail && (i = o.thumbnail), i;
|
|
307
|
-
},
|
|
308
|
-
theme() {
|
|
309
|
-
var i;
|
|
310
|
-
return ((i = this._document) == null ? void 0 : i.theme) || {};
|
|
311
|
-
},
|
|
312
|
-
showPriceToggle: {
|
|
313
|
-
get() {
|
|
314
|
-
return !!(typeof this.showPriceSummary == "boolean" ? this.showPriceSummary : this.theme.showPriceSummary);
|
|
315
|
-
},
|
|
316
|
-
set(i) {
|
|
317
|
-
this.showPriceSummary = i;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
},
|
|
321
|
-
watch: {
|
|
322
|
-
layout(i) {
|
|
323
|
-
this._document.isDirty(this._value.textAlign) || (this.textAlign = i === "center" ? i : "left");
|
|
324
|
-
},
|
|
325
|
-
backgroundColor(i) {
|
|
326
|
-
this._document.isDirty(this._value.textColor) || (this.textColor = A.readability(i, "#fff") < 1.8 ? "#111111" : "#FFFFFF");
|
|
327
|
-
}
|
|
328
|
-
},
|
|
329
|
-
methods: {
|
|
330
|
-
// Used for setting the correct array item order for specific layouts
|
|
331
|
-
// will place the given item type first in items
|
|
332
|
-
setLayout({ layout: i, type: t = "" }) {
|
|
333
|
-
const e = (o) => (r) => r.type === o ? -1 : 1;
|
|
334
|
-
t && (this.items = [...this.items].sort(e(t))), this.layout = i;
|
|
335
|
-
},
|
|
336
|
-
openBgModal() {
|
|
337
|
-
const { type: i = "image" } = this.media || {};
|
|
338
|
-
this.$modal.show(
|
|
339
|
-
T,
|
|
340
|
-
{
|
|
341
|
-
currentType: i
|
|
342
|
-
},
|
|
343
|
-
{},
|
|
344
|
-
{
|
|
345
|
-
input: ({ type: t, value: e, preferredColor: o }) => {
|
|
346
|
-
const r = t === "image" ? "resourceUrl" : "video";
|
|
347
|
-
this.media = {
|
|
348
|
-
...this.media,
|
|
349
|
-
type: t,
|
|
350
|
-
[r]: e
|
|
351
|
-
}, o && !this._document.isDirty(this._value.backgroundColor) && (this.backgroundColor = o);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
var B = function() {
|
|
359
|
-
var t = this, e = t._self._c;
|
|
360
|
-
return e("div", { staticClass: "d-root" }, [e("div", { staticClass: "d-option" }, [e("div", { staticClass: "d-option-title", staticStyle: { "padding-bottom": "calc(0.5 * var(--rem))" } }, [t._v(" Layouts ")]), e("div", { staticClass: "grid grid-cols-3 gap-2 p-1" }, t._l(t.layoutOptions, function({ isActive: o, onClick: r, icon: s }, a) {
|
|
361
|
-
return e("CButton", { key: a, staticStyle: { padding: "6px 10px", "border-radius": "3px", height: "initial" }, attrs: { type: o ? "secondary" : "none", pattern: o ? "primary" : "secondary", size: "normal" }, on: { click: r } }, [e("svg", { attrs: { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" }, domProps: { innerHTML: t._s(s) } })]);
|
|
362
|
-
}), 1)]), e("div", { staticClass: "d-option" }, [e("div", { staticClass: "d-option-title", staticStyle: { "padding-bottom": "calc(0.5 * var(--rem))" } }, [t._v(" " + t._s(t.$t("_common:background").capitalize()) + " ")]), e("div", { staticClass: "d-option-button-image", style: {
|
|
363
|
-
backgroundImage: `url(${t.background || t.theme.background})`
|
|
364
|
-
}, on: { click: t.openBgModal } })]), e("div", { staticClass: "d-option", staticStyle: { "padding-bottom": "0.5em" } }, [e("ThemeColorRow", { staticClass: "d-option-title", attrs: { value: t.overlayColor || t.theme.backgroundFilter || "", placement: "auto" }, on: { change: function(o) {
|
|
365
|
-
t.overlayColor = o;
|
|
366
|
-
} } }, [t._v(" " + t._s(t.$t("components:account.documentForm.settings.backgroundFilter")) + " ")])], 1), t.layout === "price" ? e("div", { staticClass: "d-option" }, [e("div", { staticClass: "d-option-title" }, [e("div", { staticStyle: { flex: "1 1 auto" } }, [t._v(" " + t._s(t.$t("components:account.documentForm.settings.priceSummaryBackground")) + " ")]), e("CSwitch", { staticStyle: { "margin-right": "0" }, attrs: { size: "small", type: "secondary" }, model: { value: t.showPriceToggle, callback: function(o) {
|
|
367
|
-
t.showPriceToggle = o;
|
|
368
|
-
}, expression: "showPriceToggle" } })], 1), t.showPriceToggle ? e("div", { staticClass: "d-option-row", staticStyle: { "padding-top": "1em" } }, [e("ThemeColorRow", { staticClass: "d-option-title", attrs: { value: t.backgroundColor || t.theme.priceSummaryBackground || "", "picker-options": { disableAlpha: !0 }, placement: "auto" }, on: { change: function(o) {
|
|
369
|
-
t.backgroundColor = o;
|
|
370
|
-
} } }, [t._v(" " + t._s(t.$t("_common:backgroundColor").capitalize()) + " ")])], 1) : t._e()]) : [t.layout !== "center" ? e("div", { staticClass: "d-option" }, [e("ThemeColorRow", { staticClass: "d-option-title", attrs: { value: t.backgroundColor || t.theme.priceSummaryBackground || "", "picker-options": { disableAlpha: !0 }, placement: "auto" }, on: { change: function(o) {
|
|
371
|
-
t.backgroundColor = o, t._document.setDirty(t._value.backgroundColor);
|
|
372
|
-
} } }, [t._v(" " + t._s(t.$t("_common:backgroundColor").capitalize()) + " ")])], 1) : t._e(), e("div", { staticClass: "d-option" }, [e("ThemeColorRow", { staticClass: "d-option-title", staticStyle: { "margin-top": "calc(0.5 * var(--rem))" }, attrs: { value: t.textColor || "", "picker-options": { disableAlpha: !0 }, placement: "auto" }, on: { change: function(o) {
|
|
373
|
-
t.textColor = o, t._document.setDirty(t._value.textColor);
|
|
374
|
-
} } }, [t._v(" " + t._s(t.$t("_common:textColor").capitalize()) + " ")])], 1), e("div", { staticClass: "d-option flex w-full" }, [e("div", { staticClass: "d-option-title", staticStyle: { "margin-top": "calc(0.5 * var(--rem))" } }, [t._v(" " + t._s(t.$t("_common:textAlign").capitalize()) + " ")]), e("CField", { staticStyle: { "margin-left": "auto" } }, t._l(t.alignOptions, function({ value: o, icon: r }, s) {
|
|
375
|
-
return e("CRadioButton", { key: s, class: !t.textAlign && "text-gray-400", attrs: { "native-value": o, type: t.textAlign ? "secondary" : "none", size: "small" }, on: { input: function(a) {
|
|
376
|
-
return t._document.setDirty(t._value.textAlign);
|
|
377
|
-
} }, model: { value: t.textAlign, callback: function(a) {
|
|
378
|
-
t.textAlign = a;
|
|
379
|
-
}, expression: "textAlign" } }, [e("svg", { staticStyle: { margin: "0" }, attrs: { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 48 48", fill: "currentColor", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }, domProps: { innerHTML: t._s(r) } })]);
|
|
380
|
-
}), 1)], 1)]], 2);
|
|
381
|
-
}, P = [], F = /* @__PURE__ */ y(
|
|
382
|
-
$,
|
|
383
|
-
B,
|
|
384
|
-
P,
|
|
385
|
-
!1,
|
|
386
|
-
null,
|
|
387
|
-
"adcf8352"
|
|
388
|
-
);
|
|
389
|
-
const q = F.exports;
|
|
390
|
-
export {
|
|
391
|
-
q as default
|
|
392
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import r from "./ImageUploadWrapper-21yldsj9.js";
|
|
2
|
-
import { B as l, a as i } from "./index-DH6SCEKQ.js";
|
|
3
|
-
import { c, n as m, o as n, H as d } from "./main-Bp2qcma0.js";
|
|
4
|
-
const o = c.unsplash.id, p = {
|
|
5
|
-
name: "ImageSelectModal",
|
|
6
|
-
i18nOptions: {
|
|
7
|
-
namespaces: "imageSelectModal",
|
|
8
|
-
messages: {
|
|
9
|
-
en: {
|
|
10
|
-
creditImages: "Images from {{thing}}"
|
|
11
|
-
},
|
|
12
|
-
sv: {
|
|
13
|
-
creditImages: "Bilder från {{thing}}"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
components: {
|
|
18
|
-
BackgroundModal: l,
|
|
19
|
-
BackgroundList: i,
|
|
20
|
-
ImageUploadWrapper: r
|
|
21
|
-
},
|
|
22
|
-
data() {
|
|
23
|
-
return {
|
|
24
|
-
selectedUrl: null
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
methods: {
|
|
28
|
-
async fetch({ query: a, page: e }) {
|
|
29
|
-
const { data: t } = await n.get(
|
|
30
|
-
"https://api.unsplash.com/search/photos",
|
|
31
|
-
{
|
|
32
|
-
params: {
|
|
33
|
-
page: e,
|
|
34
|
-
per_page: 12,
|
|
35
|
-
client_id: o,
|
|
36
|
-
query: a
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
return {
|
|
41
|
-
items: (t.results || []).map((s) => ({
|
|
42
|
-
...s,
|
|
43
|
-
image: s.urls.regular,
|
|
44
|
-
minImage: s.urls.thumb
|
|
45
|
-
})),
|
|
46
|
-
total: t.total
|
|
47
|
-
};
|
|
48
|
-
},
|
|
49
|
-
selectImage(a) {
|
|
50
|
-
this.selectedUrl = d(a.image, { w: 1800 });
|
|
51
|
-
const e = new Image();
|
|
52
|
-
e.src = this.selectedUrl, n.get(a.links.download_location, {
|
|
53
|
-
params: {
|
|
54
|
-
client_id: o
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
},
|
|
58
|
-
setCustomBackground({ response: a }) {
|
|
59
|
-
this.selectedUrl = a.url, this.onSave();
|
|
60
|
-
},
|
|
61
|
-
onSave() {
|
|
62
|
-
this.$emit("change"), this.$emit("input", this.selectedUrl), this.$parent && (this.$parent.$emit("change"), this.$parent.$emit("input", this.selectedUrl)), this.$emit("close");
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var u = function() {
|
|
67
|
-
var e = this, t = e._self._c;
|
|
68
|
-
return t("BackgroundModal", e._g({}, e.$listeners), [t("BackgroundList", { attrs: { fetch: e.fetch, "credit-text": e.$t("creditImages", { thing: "Unsplash" }), "default-query": "architecture" }, on: { select: e.selectImage } }, [t("template", { slot: "footer" }, [t("ImageUploadWrapper", { ref: "uploadWrapper", attrs: { "on-image-upload": e.setCustomBackground }, on: { upload: function(s) {
|
|
69
|
-
e.isUploadingImage = !0;
|
|
70
|
-
} }, scopedSlots: e._u([{ key: "default", fn: function({ progress: s }) {
|
|
71
|
-
return [t("CButton", { attrs: { loading: !!s, "icon-left": "upload", type: "none" } }, [e._v(" " + e._s(e.$t("_common:upload")) + " ")])];
|
|
72
|
-
} }]) }), t("CButton", { staticStyle: { "margin-left": "0.5em" }, attrs: { type: "secondary" }, on: { click: e.onSave } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])], 1)], 2)], 1);
|
|
73
|
-
}, g = [], h = /* @__PURE__ */ m(
|
|
74
|
-
p,
|
|
75
|
-
u,
|
|
76
|
-
g,
|
|
77
|
-
!1,
|
|
78
|
-
null,
|
|
79
|
-
"d3705339"
|
|
80
|
-
);
|
|
81
|
-
const v = h.exports;
|
|
82
|
-
export {
|
|
83
|
-
v as default
|
|
84
|
-
};
|