File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed
etc/js/components/widgets/inspector Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -271,8 +271,9 @@ div.component-name-pending-delete {
271271}
272272
273273div .component-value {
274- padding-left : 42 px ;
274+ padding-left : 20 px ;
275275 padding-right : 16px ;
276+ overflow-x : auto ;
276277}
277278
278279div .component-base {
Original file line number Diff line number Diff line change 6565 </color-preview >
6666 </div >
6767 </template >
68+ <template v-else-if =" previewTypeKind === ' object' " >
69+ <div :class =" objectClass()" >
70+ <entity-inspector-field
71+ :value =" objectToField(value)"
72+ :type =" {}"
73+ :readonly =" true"
74+ :class =" fieldClass"
75+ :compact =" true"
76+ :shrink_to_content =" compact" >
77+ </entity-inspector-field >
78+ </div >
79+ </template >
6880 </div >
6981</template >
7082
@@ -134,7 +146,11 @@ const previewTypeKind = computed(() => {
134146
135147 if (isVector) {
136148 return " vector" ;
149+ } else {
150+ return " object" ;
137151 }
152+ } else {
153+ return " object" ;
138154 }
139155
140156 return undefined ;
@@ -185,6 +201,29 @@ function colorClass() {
185201 return classes;
186202}
187203
204+ function objectClass () {
205+ let classes = [" component-preview-object" ];
206+ if (props .compact ) {
207+ classes .push (" component-preview-compact" );
208+ }
209+ return classes;
210+ }
211+
212+ function objectToField (value ) {
213+ let result = [];
214+ for (var k in value) {
215+ const v = value[k];
216+ if (typeof v === " number" ) {
217+ result .push (v .toFixed (2 ));
218+ } else if (typeof v === " object" ) {
219+ result .push (" {..}" );
220+ } else {
221+ result .push (v);
222+ }
223+ }
224+ return result .join (" , " );
225+ }
226+
188227 </script >
189228
190229<style scoped>
You can’t perform that action at this time.
0 commit comments