Skip to content

Commit 45cfa57

Browse files
committed
progress
1 parent bd4dea1 commit 45cfa57

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/pg/json/json.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@ import { Component, Prop, Part } from '@pictogrammers/element';
22

33
import PgJsonArray from '../jsonArray/jsonArray';
44
import PgJsonObject from '../jsonObject/jsonObject';
5+
import PgJsonString from '../jsonString/jsonString';
56

67
import template from './json.html';
78
import style from './json.css';
89

910
function unwrapObject(obj: any) {
1011
return {
12+
type: PgJsonObject,
1113
items: Object.keys(obj).map((key) => {
1214
return {
1315
key,
1416
value: obj[key],
17+
type: PgJsonString,
1518
}
1619
})
1720
};
1821
}
1922

2023
function unwrapArray(items: any) {
2124
return {
25+
type: PgJsonArray,
2226
items: items.map((item) => {
2327
if (Array.isArray(item)) {
2428
return unwrapArray(item);

src/pg/jsonString/jsonString.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
<div part="startLabel">{</div>
2-
<div part="items"></div>
3-
<div part="endLabel">}</div>
1+
<div part="key"></div>
2+
<div part="seperator">:</div>
3+
<div part="container">
4+
<part>&quot;</part>
5+
<div part="value"></div>
6+
<part>&quot;</part>
7+
</div>

0 commit comments

Comments
 (0)