Skip to content

Commit

Permalink
Merge pull request #46 from williamtroup/4.6.1
Browse files Browse the repository at this point in the history
4.6.1
  • Loading branch information
william-troup authored Nov 21, 2024
2 parents 62e2f82 + b7b0aab commit 66b3c2a
Show file tree
Hide file tree
Showing 85 changed files with 211 additions and 151 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
JsonTree.js

[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=JsonTree.js%2C%20a%20free%20JavaScript%json%20treeview&url=https://github.com/williamtroup/JsonTree.js&hashtags=javascript,treeview,json)
[![npm](https://img.shields.io/badge/npmjs-v4.6.0-blue)](https://www.npmjs.com/package/jjsontree.js)
[![nuget](https://img.shields.io/badge/nuget-v4.6.0-purple)](https://www.nuget.org/packages/jJsonTree.js/)
[![npm](https://img.shields.io/badge/npmjs-v4.6.1-blue)](https://www.npmjs.com/package/jjsontree.js)
[![nuget](https://img.shields.io/badge/nuget-v4.6.1-purple)](https://www.nuget.org/packages/jJsonTree.js/)
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/JsonTree.js/blob/main/LICENSE.txt)
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/JsonTree.js/discussions)
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://william-troup.com/)
</h1>

> <p align="center">🔗 A lightweight JavaScript library that generates customizable tree views to better visualize, and edit, JSON data.</p>
> <p align="center">v4.6.0</p>
> <p align="center">v4.6.1</p>
<br />
![JsonTree.js](docs/images/main.png)
Expand Down Expand Up @@ -173,8 +173,8 @@ Or, you can download the latest zipped up version [here](https://www.william-tro
Or, you can also use the following CDN links:

```markdown
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].0/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].0/dist/jsontree.js.min.css
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].1/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].1/dist/jsontree.js.min.css
```
<br>
<br>
Expand Down
10 changes: 5 additions & 5 deletions README_NUGET.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# JsonTree.js v4.6.0
# JsonTree.js v4.6.1

[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=JsonTree.js%2C%20a%20free%20JavaScript%json%20treeview&url=https://github.com/williamtroup/JsonTree.js&hashtags=javascript,treeview,json)
[![npm](https://img.shields.io/badge/npmjs-v4.6.0-blue)](https://www.npmjs.com/package/jjsontree.js)
[![nuget](https://img.shields.io/badge/nuget-v4.6.0-purple)](https://www.nuget.org/packages/jJsonTree.js/)
[![npm](https://img.shields.io/badge/npmjs-v4.6.1-blue)](https://www.npmjs.com/package/jjsontree.js)
[![nuget](https://img.shields.io/badge/nuget-v4.6.1-purple)](https://www.nuget.org/packages/jJsonTree.js/)
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/JsonTree.js/blob/main/LICENSE.txt)
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/JsonTree.js/discussions)
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://william-troup.com/)
Expand Down Expand Up @@ -152,8 +152,8 @@ Or, you can download the latest zipped up version [here](https://www.william-tro
Or, you can also use the following CDN links:

```markdown
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].0/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].0/dist/jsontree.js.min.css
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].1/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].1/dist/jsontree.js.min.css
```


Expand Down
50 changes: 33 additions & 17 deletions dist/jsontree.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ var Convert2;
return t;
}
Convert.symbolToSpacedOutString = symbolToSpacedOutString;
function colorToSpacedOutString(e) {
return e.toString().replace(" ", "").replace("(", `(${" "}`).replace(")", `${" "})`).replace(",", `${" "}${","}`);
}
Convert.colorToSpacedOutString = colorToSpacedOutString;
})(Convert2 || (Convert2 = {}));

var Str;
Expand Down Expand Up @@ -674,8 +678,11 @@ var DateTime;
e.getDayOrdinal = n;
function o(e, o, l) {
const r = isNaN(+o) ? new Date : o;
let i = l;
let i = l.dateTimeFormat;
const a = t(r);
let s = r.getHours() % 12;
s = s === 0 ? 12 : s;
i = i.replace("{hhh}", Str.padNumber(s, 2));
i = i.replace("{hh}", Str.padNumber(r.getHours(), 2));
i = i.replace("{h}", r.getHours().toString());
i = i.replace("{MM}", Str.padNumber(r.getMinutes(), 2));
Expand All @@ -698,6 +705,7 @@ var DateTime;
i = i.replace("{yyy}", r.getFullYear().toString().substring(1));
i = i.replace("{yy}", r.getFullYear().toString().substring(2));
i = i.replace("{y}", Number.parseInt(r.getFullYear().toString().substring(2)).toString());
i = i.replace("{aa}", r.getHours() >= 12 ? "PM" : "AM");
return i;
}
e.getCustomFormattedDateText = o;
Expand Down Expand Up @@ -1472,7 +1480,8 @@ var ContextMenu;
Trigger.customEvent(e.events.onRenderComplete, e._currentView.element);
}
function i(n, o = false) {
let l = t[n._currentView.element.id].data;
const l = t[n._currentView.element.id].data;
n._currentView.currentColumnBuildingIndex = 0;
if (Is.definedUrl(l)) {
Default.getObjectFromUrl(l, e, (e => {
a(n, o, e);
Expand Down Expand Up @@ -1523,7 +1532,6 @@ var ContextMenu;
}
function s(t, n, o, l, r, i, a) {
const s = DomElement.create(n, "div", i > 1 ? "contents-column-multiple" : "contents-column");
const c = o._currentView.currentColumnBuildingIndex;
if (!Is.defined(t)) {
const t = DomElement.create(s, "div", "no-json");
DomElement.createWithHTML(t, "span", "no-json-text", e.text.noJsonToViewText);
Expand All @@ -1532,7 +1540,6 @@ var ContextMenu;
n.onclick = () => P(o);
}
} else {
s.onscroll = () => d(s, o, c);
if (o.paging.enabled && Is.definedNumber(l)) {
s.setAttribute(Constants.JSONTREE_JS_ATTRIBUTE_ARRAY_INDEX_NAME, l.toString());
}
Expand All @@ -1551,14 +1558,16 @@ var ContextMenu;
i = DomElement.create(s, "div", "contents-column-lines");
e = i;
}
const p = {
const c = {
column: s,
lineNumbers: n,
lines: i,
controlButtons: null
};
o._currentView.currentContentColumns.push(p);
o._currentView.currentContentColumns.push(c);
o._currentView.currentColumnBuildingIndex = o._currentView.currentContentColumns.length - 1;
const p = o._currentView.currentColumnBuildingIndex;
s.onscroll = () => d(s, o, p);
if (Is.definedArray(t)) {
Y(e, o, t, "array");
} else if (Is.definedSet(t)) {
Expand Down Expand Up @@ -1703,6 +1712,12 @@ var ContextMenu;
if (!Is.defined(s)) {
s = {};
}
if (!Is.defined(u)) {
u = true;
}
if (!Is.defined(c)) {
c = true;
}
t.data[o] = r;
t.data[n] = l;
t._currentView.contentPanelsOpen[o] = s;
Expand Down Expand Up @@ -2065,7 +2080,7 @@ var ContextMenu;
ToolTip.add(l, t, e.text.closeButtonText);
if (Is.definedObject(t.data)) {
const e = DomElement.create(t._currentView.sideMenu, "div", "side-menu-contents");
F(e, t);
H(e, t);
}
}
}
Expand Down Expand Up @@ -2108,16 +2123,16 @@ var ContextMenu;
i(t);
Z(t, e.text.jsonUpdatedText);
}
function F(t, n) {
function H(t, n) {
const o = [];
const l = DomElement.create(t, "div", "settings-panel");
const r = DomElement.create(l, "div", "settings-panel-title-bar");
DomElement.createWithHTML(r, "div", "settings-panel-title-text", `${e.text.showDataTypesText}:`);
const i = DomElement.create(r, "div", "settings-panel-control-buttons");
const a = DomElement.create(i, "div", "settings-panel-control-button settings-panel-fill");
const s = DomElement.create(i, "div", "settings-panel-control-button");
a.onclick = () => H(n, o, true);
s.onclick = () => H(n, o, false);
a.onclick = () => F(n, o, true);
s.onclick = () => F(n, o, false);
ToolTip.add(a, n, e.text.selectAllText);
ToolTip.add(s, n, e.text.selectNoneText);
const u = DomElement.create(l, "div", "settings-panel-contents");
Expand All @@ -2136,7 +2151,7 @@ var ContextMenu;
}
}));
}
function H(e, t, n) {
function F(e, t, n) {
const o = t.length;
const l = e.ignore;
for (let e = 0; e < o; e++) {
Expand Down Expand Up @@ -2586,9 +2601,10 @@ var ContextMenu;
} else if (Is.definedBigInt(r)) {
y = "bigint";
if (!o.ignore.bigintValues) {
let n = Str.getMaximumLengthDisplay(r.toString(), o.maximum.bigIntLength, e.text.ellipsisText);
let n = `${r.toString()}n`;
let s = Str.getMaximumLengthDisplay(n, o.maximum.bigIntLength, e.text.ellipsisText);
p = o.showValueColors ? `${y} value` : "value";
x = DomElement.createWithHTML(g, "span", p, n);
x = DomElement.createWithHTML(g, "span", p, s);
w = o.allowEditing.bigIntValues && !c;
le(o, t, l, r, x, a, w);
Trigger.customEvent(o.events.onBigIntRender, o._currentView.element, x);
Expand All @@ -2612,7 +2628,7 @@ var ContextMenu;
y = "color";
if (!o.ignore.colorValues) {
p = o.showValueColors ? `${y} value` : "value";
x = DomElement.createWithHTML(g, "span", p, r);
x = DomElement.createWithHTML(g, "span", p, Convert2.colorToSpacedOutString(r));
w = o.allowEditing.colorValues && !c;
if (o.showValueColors) {
x.style.color = r;
Expand Down Expand Up @@ -2700,7 +2716,7 @@ var ContextMenu;
y = "date";
if (!o.ignore.dateValues) {
p = o.showValueColors ? `${y} value` : "value";
x = DomElement.createWithHTML(g, "span", p, DateTime.getCustomFormattedDateText(e, r, o.dateTimeFormat));
x = DomElement.createWithHTML(g, "span", p, DateTime.getCustomFormattedDateText(e, r, o));
w = o.allowEditing.dateValues && !c;
le(o, t, l, r, x, a, w);
Trigger.customEvent(o.events.onDateRender, o._currentView.element, x);
Expand Down Expand Up @@ -3486,7 +3502,7 @@ var ContextMenu;
}
function Ve(t) {
const n = new Date;
const o = DateTime.getCustomFormattedDateText(e, n, t.exportFilenameFormat);
const o = DateTime.getCustomFormattedDateText(e, n, t);
return o;
}
function ve(e, t = true) {
Expand Down Expand Up @@ -3727,7 +3743,7 @@ var ContextMenu;
return e;
},
getVersion: function() {
return "4.6.0";
return "4.6.1";
}
};
(() => {
Expand Down
2 changes: 1 addition & 1 deletion dist/jsontree.esm.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 66b3c2a

Please sign in to comment.