Skip to content

Commit 7bfea9c

Browse files
fix: style placeholder list and params
1 parent c8417c8 commit 7bfea9c

File tree

2 files changed

+69
-19
lines changed

2 files changed

+69
-19
lines changed

resources/js/app/components/placeholder-list/placeholder-list.vue

+56-13
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,54 @@
1111
v-for="item in items"
1212
:key="itemKey(item)"
1313
>
14-
<app-icon v-if="item.obj?.type === 'audio'" icon="carbon:document-audio" height="24" />
15-
<app-icon v-if="item.obj?.type === 'documents'" icon="carbon:document" height="24" />
16-
<app-icon v-if="item.obj?.type === 'events'" icon="carbon:event" height="24" />
17-
<app-icon v-if="item.obj?.type === 'files'" icon="carbon:document-blank" height="24" />
18-
<app-icon v-if="item.obj?.type === 'images'" icon="carbon:image" height="24" />
19-
<app-icon v-if="item.obj?.type === 'links'" icon="carbon:link" height="24" />
20-
<app-icon v-if="item.obj?.type === 'locations'" icon="carbon:location" height="24" />
21-
<app-icon v-if="item.obj?.type === 'news'" icon="carbon:calendar" height="24" />
22-
<app-icon v-if="item.obj?.type === 'profiles'" icon="carbon:person" height="24" />
23-
<app-icon v-if="item.obj?.type === 'publications'" icon="carbon:wikis" height="24" />
24-
<app-icon v-if="item.obj?.type === 'videos'" icon="carbon:video" height="24" />
14+
<div class="placeholder-item-name">
15+
<app-icon icon="carbon:document-audio"
16+
height="24"
17+
v-if="item.obj?.type === 'audio'"
18+
/>
19+
<app-icon icon="carbon:document"
20+
height="24"
21+
v-if="item.obj?.type === 'documents'"
22+
/>
23+
<app-icon icon="carbon:event"
24+
height="24"
25+
v-if="item.obj?.type === 'events'"
26+
/>
27+
<app-icon icon="carbon:document-blank"
28+
height="24"
29+
v-if="item.obj?.type === 'files'"
30+
/>
31+
<app-icon icon="carbon:image"
32+
height="24"
33+
v-if="item.obj?.type === 'images'"
34+
/>
35+
<app-icon icon="carbon:link"
36+
height="24"
37+
v-if="item.obj?.type === 'links'"
38+
/>
39+
<app-icon icon="carbon:location"
40+
height="24"
41+
v-if="item.obj?.type === 'locations'"
42+
/>
43+
<app-icon icon="carbon:calendar"
44+
height="24"
45+
v-if="item.obj?.type === 'news'"
46+
/>
47+
<app-icon icon="carbon:person"
48+
height="24"
49+
v-if="item.obj?.type === 'profiles'"
50+
/>
51+
<app-icon icon="carbon:wikis"
52+
height="24"
53+
v-if="item.obj?.type === 'publications'"
54+
/>
55+
<app-icon icon="carbon:video"
56+
height="24"
57+
v-if="item.obj?.type === 'videos'"
58+
/>
2559

26-
<span>{{ item.obj?.title }}</span>
60+
<span>{{ item.obj?.title }}</span>
61+
</div>
2762
<placeholder-params
2863
:id="item.id"
2964
:field="field"
@@ -163,11 +198,19 @@ div.placeholdersList > div.header {
163198
}
164199
div.placeholdersList > div.placeholder-item {
165200
display: grid;
166-
grid-template-columns: 5% 60% 1fr;
201+
grid-template-columns: 35% 60% 1fr;
167202
text-align: left;
168203
align-items: center;
169204
gap: 8px;
205+
padding: 4px 0;
170206
margin: 4px 0;
171207
border-top: dotted 1px #ccc;
172208
}
209+
div.placeholdersList > div.placeholder-item > div.placeholder-item-name {
210+
display: flex;
211+
align-items: start;
212+
align-self: flex-start;
213+
gap: 8px;
214+
margin: 4px 0;
215+
}
173216
</style>

resources/js/app/components/placeholder-list/placeholder-params.vue

+13-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<template v-if="parameters[column] === 'boolean'">
2222
<input type="checkbox"
2323
v-model="decodedValue[column]"
24-
@click="changeParams"
24+
@change="changeParams"
2525
>
2626
</template>
2727
<template v-if="parameters[column] === 'richtext'">
@@ -96,6 +96,7 @@ export default {
9696
}
9797
try {
9898
this.decodedValue = JSON.parse(decoded);
99+
console.log(this.decodedValue);
99100
} catch(e) {
100101
console.error(e, decoded, this.value);
101102
}
@@ -113,6 +114,10 @@ export default {
113114
});
114115
this.oldValue = this.newValue;
115116
},
117+
changeParamsBoolean(value, column) {
118+
this.decodedValue[column] = value;
119+
this.changeParams();
120+
},
116121
changeRichText(value, column) {
117122
this.decodedValue[column] = value;
118123
this.changeParams();
@@ -125,13 +130,15 @@ export default {
125130
</script>
126131
<style>
127132
div.placeholderParams {
128-
display: grid;
129-
align-items: center;
133+
display: flex;
134+
flex-direction: column;
130135
gap: 8px;
131136
margin: 4px 0;
137+
}
132138
133-
.paramName {
134-
text-transform: capitalize;
135-
}
139+
.paramName {
140+
display: block;
141+
margin-bottom: 4px;
142+
text-transform: capitalize;
136143
}
137144
</style>

0 commit comments

Comments
 (0)