Skip to content

Commit 82ba91a

Browse files
committed
chore(core): finalize toolbar
1 parent d4f5d72 commit 82ba91a

File tree

9 files changed

+2742
-157
lines changed

9 files changed

+2742
-157
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
},
4949
"devDependencies": {
5050
"@eslint/js": "^9.32.0",
51+
"@testing-library/jest-dom": "^6.6.4",
5152
"@types/node": "^22.14.1",
5253
"@typescript-eslint/eslint-plugin": "^8.38.0",
5354
"@typescript-eslint/parser": "^8.38.0",

pnpm-lock.yaml

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/demo/index.html

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,23 @@ <h2>Interactive Example</h2>
5151
placeholder="Enter JSON here..."></textarea>
5252
<button id="parse-button">Parse JSON</button>
5353
</div>
54-
<andypf-json-viewer id="interactive-demo" show-toolbar>{"key":"value"}</andypf-json-viewer>
55-
<!-- <andypf-json-viewer id="interactive-demo2" data="https://microsoftedge.github.io/Demos/json-dummy-data/64KB.json"></andypf-json-viewer> -->
54+
<andypf-json-viewer
55+
id="interactive-demo"
56+
show-toolbar
57+
expanded
58+
show-copy
59+
show-size
60+
toolbar-show-copy
61+
toolbar-show-size
62+
toolbar-show-search
63+
toolbar-show-expand-controls
64+
toolbar-show-indent-controls
65+
toolbar-show-theme-select
66+
toolbar-show-infos
67+
>
68+
{"test":"ètest"}
69+
</andypf-json-viewer>
70+
<andypf-json-viewer show-toolbar id="interactive-demo2" data="https://microsoftedge.github.io/Demos/json-dummy-data/64KB.json"></andypf-json-viewer>
5671
</div>
5772
<script>
5873
const textArea = document.getElementById('json-input');
@@ -68,7 +83,7 @@ <h2>Interactive Example</h2>
6883
const interactiveDemo = document.getElementById('interactive-demo');
6984
const indentValue = parseInt(indentInput.value, 10);
7085
if (!isNaN(indentValue) && indentValue >= 1 && indentValue <= 10) {
71-
interactiveDemo.setAttribute('indent', indentValue);
86+
interactiveDemo.indent = indentValue
7287
} else {
7388
console.warn('Indent value must be between 1 and 10');
7489
}

0 commit comments

Comments
 (0)