@dcodegroup-au/page-builder 0.2.4 → 0.2.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="item-edit">
|
|
3
|
-
<div class="flex items-start gap-4 px-6 pt-4 h-full">
|
|
3
|
+
<div class="flex items-start gap-4 px-6 pt-4 h-full min-h-[90vh]">
|
|
4
4
|
<div class="flex flex-1 flex-col gap-4">
|
|
5
5
|
<card title="Description">
|
|
6
6
|
<div class="flex flex-col gap-8">
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
</input-wrapper>
|
|
34
34
|
</div>
|
|
35
35
|
</card>
|
|
36
|
-
<card v-if="form.hasOwnProperty('primary_button')" :title="
|
|
36
|
+
<card v-if="form.hasOwnProperty('primary_button')" :title="form?.primary_button?.name ?? 'Primary button'">
|
|
37
37
|
<div class="flex flex-col gap-8">
|
|
38
38
|
<VToggle name="show" v-model="form.primary_button.show" title="Show Button" />
|
|
39
39
|
<input-wrapper
|
|
@@ -62,35 +62,33 @@
|
|
|
62
62
|
/>
|
|
63
63
|
</div>
|
|
64
64
|
</card>
|
|
65
|
-
<card v-if="form.hasOwnProperty('secondary_button')" :title="
|
|
65
|
+
<card v-if="form.hasOwnProperty('secondary_button')" :title="form?.secondary_button?.name ?? 'Secondary button'">
|
|
66
66
|
<div class="flex flex-col gap-4">
|
|
67
67
|
<VToggle name="show" v-model="form.secondary_button.show" title="Show Button" />
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
class="border-1 border-solid border-gray-300 rounded-lg bg-white w-full"
|
|
84
|
-
/>
|
|
85
|
-
</input-wrapper>
|
|
86
|
-
<linked-to
|
|
87
|
-
name="secondary"
|
|
88
|
-
v-model:type="form.secondary_button.type"
|
|
89
|
-
v-model:url="form.secondary_button.url"
|
|
90
|
-
v-model:openInNewTab="form.secondary_button.open_in_new_tab"
|
|
91
|
-
:sites="sites"
|
|
68
|
+
<input-wrapper
|
|
69
|
+
is-vertical
|
|
70
|
+
field="secondary_button.label"
|
|
71
|
+
label-text="Button Label *"
|
|
72
|
+
class="w-full mb-4"
|
|
73
|
+
:value="form.secondary_button.label"
|
|
74
|
+
:limit="20"
|
|
75
|
+
>
|
|
76
|
+
<input
|
|
77
|
+
v-model="form.secondary_button.label"
|
|
78
|
+
name="secondary_button.label"
|
|
79
|
+
type="text"
|
|
80
|
+
placeholder="Label"
|
|
81
|
+
:maxlength="20"
|
|
82
|
+
class="border-1 border-solid border-gray-300 rounded-lg bg-white w-full"
|
|
92
83
|
/>
|
|
93
|
-
</
|
|
84
|
+
</input-wrapper>
|
|
85
|
+
<linked-to
|
|
86
|
+
name="secondary"
|
|
87
|
+
v-model:type="form.secondary_button.type"
|
|
88
|
+
v-model:url="form.secondary_button.url"
|
|
89
|
+
v-model:openInNewTab="form.secondary_button.open_in_new_tab"
|
|
90
|
+
:sites="sites"
|
|
91
|
+
/>
|
|
94
92
|
</div>
|
|
95
93
|
</card>
|
|
96
94
|
</div>
|
|
@@ -87,8 +87,7 @@ const toggleItem = (index) => {
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
const addItem = () => {
|
|
90
|
-
|
|
91
|
-
dataRef.value.data.push(createItem({}, type.value === 'sliders'));
|
|
90
|
+
dataRef.value.data.push(createItem({}, type === 'sliders'));
|
|
92
91
|
emit("update", false);
|
|
93
92
|
};
|
|
94
93
|
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
export function createItem(overrides = {}, withSecondary = true) {
|
|
2
2
|
let data = {
|
|
3
3
|
title: "New Item",
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
description: "New description",
|
|
5
|
+
public: false,
|
|
6
|
+
featured_image: "",
|
|
7
|
+
primary_button: {
|
|
8
8
|
show: false,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
label: "",
|
|
10
|
+
type: "site-content",
|
|
11
|
+
url: '',
|
|
12
|
+
is_new_tab: false,
|
|
13
13
|
...(overrides.primary_button || {}),
|
|
14
14
|
},
|
|
15
15
|
}
|
|
16
|
-
|
|
17
16
|
if (!withSecondary) {
|
|
18
17
|
data.primary_button.name = 'Linked to';
|
|
19
18
|
}
|