New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jjsontree.js

Package Overview
Dependencies
Maintainers
0
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jjsontree.js - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

src/ts/area/trigger.ts

765

dist/jsontree.esm.js

@@ -14,3 +14,3 @@ var __getOwnPropNames = Object.getOwnPropertyNames;

var init_enum = __esm({
"src/ts/enum.ts"() {
"src/ts/data/enum.ts"() {
"use strict";

@@ -23,3 +23,3 @@ }

var init_is = __esm({
"src/ts/is.ts"() {
"src/ts/data/is.ts"() {
"use strict";

@@ -44,14 +44,14 @@ init_enum();

e.definedString = o;
function a(e) {
function i(e) {
return t(e) && typeof e === "function";
}
e.definedFunction = a;
function i(e) {
e.definedFunction = i;
function l(e) {
return t(e) && typeof e === "number";
}
e.definedNumber = i;
function l(e) {
e.definedNumber = l;
function a(e) {
return n(e) && e instanceof Array;
}
e.definedArray = l;
e.definedArray = a;
function s(e) {

@@ -66,6 +66,6 @@ return n(e) && e instanceof Date;

function c(e, t = 1) {
return !l(e) || e.length < t;
return !a(e) || e.length < t;
}
e.invalidOptionArray = c;
function f(e) {
function d(e) {
let t = e.length >= 2 && e.length <= 7;

@@ -77,3 +77,3 @@ if (t && e[0] === "#") {

}
e.hexColor = f;
e.hexColor = d;
})(Is || (Is = {}));

@@ -83,6 +83,6 @@ }

var Data;
var Default;
var init_data = __esm({
"src/ts/data.ts"() {
var init_default = __esm({
"src/ts/data/default.ts"() {
"use strict";

@@ -92,56 +92,31 @@ init_enum();

(e => {
let t;
(e => {
function t() {
const e = [];
for (let t = 0; t < 32; t++) {
if (t === 8 || t === 12 || t === 16 || t === 20) {
e.push("-");
}
const n = Math.floor(Math.random() * 16).toString(16);
e.push(n);
}
return e.join("");
}
e.newGuid = t;
function n(e, t = 1) {
const n = e.toString();
let r = n;
if (n.length < t) {
const e = t - n.length + 1;
r = Array(e).join("0") + n;
}
return r;
}
e.padNumber = n;
})(t = e.String || (e.String = {}));
function n(e, t) {
function t(e, t) {
return typeof e === "string" ? e : t;
}
e.getDefaultAnyString = n;
function r(e, t) {
e.getAnyString = t;
function n(e, t) {
return Is.definedString(e) ? e : t;
}
e.getDefaultString = r;
function o(e, t) {
e.getString = n;
function r(e, t) {
return Is.definedBoolean(e) ? e : t;
}
e.getDefaultBoolean = o;
function a(e, t) {
e.getBoolean = r;
function o(e, t) {
return Is.definedNumber(e) ? e : t;
}
e.getDefaultNumber = a;
e.getNumber = o;
function i(e, t) {
return Is.definedFunction(e) ? e : t;
}
e.getDefaultFunction = i;
e.getFunction = i;
function l(e, t) {
return Is.definedArray(e) ? e : t;
}
e.getDefaultArray = l;
function s(e, t) {
e.getArray = l;
function a(e, t) {
return Is.definedObject(e) ? e : t;
}
e.getDefaultObject = s;
function u(e, t) {
e.getObject = a;
function s(e, t) {
let n = t;

@@ -160,10 +135,23 @@ if (Is.definedString(e)) {

}
e.getDefaultStringOrArray = u;
function c(e, t) {
e.getStringOrArray = s;
function u(e, t) {
var n;
const r = new RegExp("^-?\\d+(?:.\\d{0," + (t || -1) + "})?");
const r = new RegExp(`^-?\\d+(?:.\\d{0,${t || -1}})?`);
return ((n = e.toString().match(r)) == null ? void 0 : n[0]) || "";
}
e.getFixedDecimalPlacesValue = c;
})(Data || (Data = {}));
e.getFixedDecimalPlacesValue = u;
function c(e) {
let t;
const n = e.toString().split("(");
const r = n[0].split(" ");
if (r.length === 2) {
t = r[1];
} else {
t = r[0];
}
t += "()";
return t;
}
e.getFunctionName = c;
})(Default || (Default = {}));
}

@@ -175,3 +163,3 @@ });

var init_dom = __esm({
"src/ts/dom.ts"() {
"src/ts/dom/dom.ts"() {
"use strict";

@@ -183,19 +171,19 @@ init_enum();

const o = t.toLowerCase();
const a = o === "text";
let i = a ? document.createTextNode("") : document.createElement(o);
const i = o === "text";
let l = i ? document.createTextNode("") : document.createElement(o);
if (Is.defined(n)) {
i.className = n;
l.className = n;
}
if (Is.defined(r)) {
e.insertBefore(i, r);
e.insertBefore(l, r);
} else {
e.appendChild(i);
e.appendChild(l);
}
return i;
return l;
}
e.create = t;
function n(e, n, r, o, a = null) {
const i = t(e, n, r, a);
i.innerHTML = o;
return i;
function n(e, n, r, o, i = null) {
const l = t(e, n, r, i);
l.innerHTML = o;
return l;
}

@@ -211,8 +199,41 @@ e.createWithHTML = n;

var Str;
var init_str = __esm({
"src/ts/data/str.ts"() {
"use strict";
init_enum();
(e => {
function t() {
const e = [];
for (let t = 0; t < 32; t++) {
if (t === 8 || t === 12 || t === 16 || t === 20) {
e.push("-");
}
const n = Math.floor(Math.random() * 16).toString(16);
e.push(n);
}
return e.join("");
}
e.newGuid = t;
function n(e, t = 1) {
const n = e.toString();
let r = n;
if (n.length < t) {
const e = t - n.length + 1;
r = Array(e).join("0") + n;
}
return r;
}
e.padNumber = n;
})(Str || (Str = {}));
}
});
var DateTime;
var init_datetime = __esm({
"src/ts/datetime.ts"() {
"src/ts/data/datetime.ts"() {
"use strict";
init_data();
init_str();
(e => {

@@ -224,9 +245,9 @@ function t(e) {

function n(e, t) {
let n = e.thText;
let n = e.text.thText;
if (t === 31 || t === 21 || t === 1) {
n = e.stText;
n = e.text.stText;
} else if (t === 22 || t === 2) {
n = e.ndText;
n = e.text.ndText;
} else if (t === 23 || t === 3) {
n = e.rdText;
n = e.text.rdText;
}

@@ -237,24 +258,24 @@ return n;

function r(e, r, o) {
let a = o;
const i = t(r);
a = a.replace("{hh}", Data.String.padNumber(r.getHours(), 2));
a = a.replace("{h}", r.getHours().toString());
a = a.replace("{MM}", Data.String.padNumber(r.getMinutes(), 2));
a = a.replace("{M}", r.getMinutes().toString());
a = a.replace("{ss}", Data.String.padNumber(r.getSeconds(), 2));
a = a.replace("{s}", r.getSeconds().toString());
a = a.replace("{dddd}", e.dayNames[i]);
a = a.replace("{ddd}", e.dayNamesAbbreviated[i]);
a = a.replace("{dd}", Data.String.padNumber(r.getDate()));
a = a.replace("{d}", r.getDate().toString());
a = a.replace("{o}", n(e, r.getDate()));
a = a.replace("{mmmm}", e.monthNames[r.getMonth()]);
a = a.replace("{mmm}", e.monthNamesAbbreviated[r.getMonth()]);
a = a.replace("{mm}", Data.String.padNumber(r.getMonth() + 1));
a = a.replace("{m}", (r.getMonth() + 1).toString());
a = a.replace("{yyyy}", r.getFullYear().toString());
a = a.replace("{yyy}", r.getFullYear().toString().substring(1));
a = a.replace("{yy}", r.getFullYear().toString().substring(2));
a = a.replace("{y}", Number.parseInt(r.getFullYear().toString().substring(2)).toString());
return a;
let i = o;
const l = t(r);
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));
i = i.replace("{M}", r.getMinutes().toString());
i = i.replace("{ss}", Str.padNumber(r.getSeconds(), 2));
i = i.replace("{s}", r.getSeconds().toString());
i = i.replace("{dddd}", e.text.dayNames[l]);
i = i.replace("{ddd}", e.text.dayNamesAbbreviated[l]);
i = i.replace("{dd}", Str.padNumber(r.getDate()));
i = i.replace("{d}", r.getDate().toString());
i = i.replace("{o}", n(e, r.getDate()));
i = i.replace("{mmmm}", e.text.monthNames[r.getMonth()]);
i = i.replace("{mmm}", e.text.monthNamesAbbreviated[r.getMonth()]);
i = i.replace("{mm}", Str.padNumber(r.getMonth() + 1));
i = i.replace("{m}", (r.getMonth() + 1).toString());
i = i.replace("{yyyy}", r.getFullYear().toString());
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());
return i;
}

@@ -277,5 +298,173 @@ e.getCustomFormattedDateText = r;

var Binding;
var init_binding = __esm({
"src/ts/options/binding.ts"() {
"use strict";
init_default();
(e => {
let t;
(t => {
function n(t, n) {
const r = e.Options.get(t);
r._currentView = {};
r._currentView.element = n;
r._currentView.dataArrayCurrentIndex = 0;
return r;
}
t.getForNewInstance = n;
function r(e) {
let t = Default.getObject(e, {});
t.data = Default.getObject(t.data, null);
t.showCounts = Default.getBoolean(t.showCounts, true);
t.useZeroIndexingForArrays = Default.getBoolean(t.useZeroIndexingForArrays, true);
t.dateTimeFormat = Default.getString(t.dateTimeFormat, "{dd}{o} {mmmm} {yyyy} {hh}:{MM}:{ss}");
t.showArrowToggles = Default.getBoolean(t.showArrowToggles, true);
t.showStringQuotes = Default.getBoolean(t.showStringQuotes, true);
t.showAllAsClosed = Default.getBoolean(t.showAllAsClosed, false);
t.sortPropertyNames = Default.getBoolean(t.sortPropertyNames, true);
t.sortPropertyNamesInAlphabeticalOrder = Default.getBoolean(t.sortPropertyNamesInAlphabeticalOrder, true);
t.showCommas = Default.getBoolean(t.showCommas, false);
t.reverseArrayValues = Default.getBoolean(t.reverseArrayValues, false);
t.addArrayIndexPadding = Default.getBoolean(t.addArrayIndexPadding, false);
t.showValueColors = Default.getBoolean(t.showValueColors, true);
t.maximumDecimalPlaces = Default.getNumber(t.maximumDecimalPlaces, 2);
t.maximumStringLength = Default.getNumber(t.maximumStringLength, 0);
t.showStringHexColors = Default.getBoolean(t.showStringHexColors, false);
t.showArrayItemsAsSeparateObjects = Default.getBoolean(t.showArrayItemsAsSeparateObjects, false);
t.copyOnlyCurrentPage = Default.getBoolean(t.copyOnlyCurrentPage, false);
t = o(t);
t = i(t);
t = l(t);
return t;
}
t.get = r;
function o(e) {
e.title = Default.getObject(e.title, {});
e.title.text = Default.getString(e.title.text, "JsonTree.js");
e.title.show = Default.getBoolean(e.title.show, true);
e.title.showTreeControls = Default.getBoolean(e.title.showTreeControls, true);
e.title.showCopyButton = Default.getBoolean(e.title.showCopyButton, true);
return e;
}
function i(e) {
e.ignore = Default.getObject(e.ignore, {});
e.ignore.nullValues = Default.getBoolean(e.ignore.nullValues, false);
e.ignore.functionValues = Default.getBoolean(e.ignore.functionValues, false);
e.ignore.unknownValues = Default.getBoolean(e.ignore.unknownValues, false);
e.ignore.booleanValues = Default.getBoolean(e.ignore.booleanValues, false);
e.ignore.decimalValues = Default.getBoolean(e.ignore.decimalValues, false);
e.ignore.numberValues = Default.getBoolean(e.ignore.numberValues, false);
e.ignore.stringValues = Default.getBoolean(e.ignore.stringValues, false);
e.ignore.dateValues = Default.getBoolean(e.ignore.dateValues, false);
e.ignore.objectValues = Default.getBoolean(e.ignore.objectValues, false);
e.ignore.arrayValues = Default.getBoolean(e.ignore.arrayValues, false);
return e;
}
function l(e) {
e.events = Default.getObject(e.events, {});
e.events.onBeforeRender = Default.getFunction(e.events.onBeforeRender, null);
e.events.onRenderComplete = Default.getFunction(e.events.onRenderComplete, null);
e.events.onValueClick = Default.getFunction(e.events.onValueClick, null);
e.events.onRefresh = Default.getFunction(e.events.onRefresh, null);
e.events.onCopyAll = Default.getFunction(e.events.onCopyAll, null);
e.events.onOpenAll = Default.getFunction(e.events.onOpenAll, null);
e.events.onCloseAll = Default.getFunction(e.events.onCloseAll, null);
e.events.onDestroy = Default.getFunction(e.events.onDestroy, null);
e.events.onBooleanRender = Default.getFunction(e.events.onBooleanRender, null);
e.events.onDecimalRender = Default.getFunction(e.events.onDecimalRender, null);
e.events.onNumberRender = Default.getFunction(e.events.onNumberRender, null);
e.events.onStringRender = Default.getFunction(e.events.onStringRender, null);
e.events.onDateRender = Default.getFunction(e.events.onDateRender, null);
e.events.onFunctionRender = Default.getFunction(e.events.onFunctionRender, null);
e.events.onNullRender = Default.getFunction(e.events.onNullRender, null);
e.events.onUnknownRender = Default.getFunction(e.events.onUnknownRender, null);
return e;
}
})(t = e.Options || (e.Options = {}));
})(Binding || (Binding = {}));
}
});
var Config;
var init_config = __esm({
"src/ts/options/config.ts"() {
"use strict";
init_default();
init_is();
(e => {
let t;
(e => {
function t(e = null) {
let t = Default.getObject(e, {});
t.safeMode = Default.getBoolean(t.safeMode, true);
t.domElementTypes = Default.getStringOrArray(t.domElementTypes, [ "*" ]);
t = n(t);
return t;
}
e.get = t;
function n(e) {
e.text = Default.getObject(e.text, {});
e.text.objectText = Default.getAnyString(e.text.objectText, "object");
e.text.arrayText = Default.getAnyString(e.text.arrayText, "array");
e.text.closeAllButtonText = Default.getAnyString(e.text.closeAllButtonText, "Close All");
e.text.openAllButtonText = Default.getAnyString(e.text.openAllButtonText, "Open All");
e.text.copyAllButtonText = Default.getAnyString(e.text.copyAllButtonText, "Copy All");
e.text.objectErrorText = Default.getAnyString(e.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}");
e.text.attributeNotValidErrorText = Default.getAnyString(e.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object.");
e.text.attributeNotSetErrorText = Default.getAnyString(e.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly.");
e.text.stText = Default.getAnyString(e.text.stText, "st");
e.text.ndText = Default.getAnyString(e.text.ndText, "nd");
e.text.rdText = Default.getAnyString(e.text.rdText, "rd");
e.text.thText = Default.getAnyString(e.text.thText, "th");
e.text.ellipsisText = Default.getAnyString(e.text.ellipsisText, "...");
e.text.closeAllButtonSymbolText = Default.getAnyString(e.text.closeAllButtonSymbolText, "↑");
e.text.openAllButtonSymbolText = Default.getAnyString(e.text.openAllButtonSymbolText, "↓");
e.text.copyAllButtonSymbolText = Default.getAnyString(e.text.copyAllButtonSymbolText, "❐");
e.text.backButtonText = Default.getAnyString(e.text.backButtonText, "Back");
e.text.nextButtonText = Default.getAnyString(e.text.nextButtonText, "Next");
e.text.backButtonSymbolText = Default.getAnyString(e.text.backButtonSymbolText, "←");
e.text.nextButtonSymbolText = Default.getAnyString(e.text.nextButtonSymbolText, "→");
if (Is.invalidOptionArray(e.text.dayNames, 7)) {
e.text.dayNames = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ];
}
if (Is.invalidOptionArray(e.text.dayNamesAbbreviated, 7)) {
e.text.dayNamesAbbreviated = [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ];
}
if (Is.invalidOptionArray(e.text.monthNames, 12)) {
e.text.monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
}
if (Is.invalidOptionArray(e.text.monthNamesAbbreviated, 12)) {
e.text.monthNamesAbbreviated = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
}
return e;
}
})(t = e.Options || (e.Options = {}));
})(Config || (Config = {}));
}
});
var Trigger;
var init_trigger = __esm({
"src/ts/area/trigger.ts"() {
"use strict";
init_is();
(e => {
function t(e, ...t) {
let n = null;
if (Is.definedFunction(e)) {
n = e.apply(null, [].slice.call(t, 0));
}
return n;
}
e.customEvent = t;
})(Trigger || (Trigger = {}));
}
});
var require_jsontree = __commonJS({
"src/jsontree.ts"(exports, module) {
init_data();
init_default();
init_is();

@@ -286,2 +475,6 @@ init_dom();

init_constant();
init_str();
init_binding();
init_config();
init_trigger();
(() => {

@@ -311,6 +504,6 @@ let _configuration = {};

if (r.parsed && Is.definedObject(r.object)) {
renderControl(renderBindingOptions(r.object, e));
renderControl(Binding.Options.getForNewInstance(r.object, e));
} else {
if (!_configuration.safeMode) {
console.error(_configuration.attributeNotValidErrorText.replace("{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME));
console.error(_configuration.text.attributeNotValidErrorText.replace("{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME));
t = false;

@@ -321,3 +514,3 @@ }

if (!_configuration.safeMode) {
console.error(_configuration.attributeNotSetErrorText.replace("{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME));
console.error(_configuration.text.attributeNotSetErrorText.replace("{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME));
t = false;

@@ -329,12 +522,6 @@ }

}
function renderBindingOptions(e, t) {
const n = buildAttributeOptions(e);
n._currentView = {};
n._currentView.element = t;
return n;
}
function renderControl(e) {
fireCustomTriggerEvent(e.events.onBeforeRender, e._currentView.element);
Trigger.customEvent(e.events.onBeforeRender, e._currentView.element);
if (!Is.definedString(e._currentView.element.id)) {
e._currentView.element.id = Data.String.newGuid();
e._currentView.element.id = Str.newGuid();
}

@@ -347,10 +534,13 @@ e._currentView.element.className = "json-tree-js";

renderControlContainer(e);
fireCustomTriggerEvent(e.events.onRenderComplete, e._currentView.element);
Trigger.customEvent(e.events.onRenderComplete, e._currentView.element);
}
function renderControlContainer(e) {
const t = _elements_Data[e._currentView.element.id].data;
let t = _elements_Data[e._currentView.element.id].data;
e._currentView.element.innerHTML = "";
renderControlTitleBar(e);
renderControlTitleBar(e, t);
if (e.showArrayItemsAsSeparateObjects) {
t = t[e._currentView.dataArrayCurrentIndex];
}
if (Is.definedObject(t) && !Is.definedArray(t)) {
renderObject(e._currentView.element, e, t);
renderObject(e._currentView.element, e, t, true);
} else if (Is.definedArray(t)) {

@@ -360,27 +550,59 @@ renderArray(e._currentView.element, e, t);

}
function renderControlTitleBar(e) {
function renderControlTitleBar(e, t) {
if (e.title.show || e.title.showTreeControls || e.title.showCopyButton) {
const t = DomElement.create(e._currentView.element, "div", "title-bar");
const n = DomElement.create(t, "div", "controls");
const n = DomElement.create(e._currentView.element, "div", "title-bar");
const r = DomElement.create(n, "div", "controls");
if (e.title.show) {
DomElement.createWithHTML(t, "div", "title", e.title.text, n);
DomElement.createWithHTML(n, "div", "title", e.title.text, r);
}
if (e.title.showCopyButton) {
const t = DomElement.createWithHTML(n, "button", "copy-all", _configuration.copyAllButtonText);
const t = DomElement.createWithHTML(r, "button", "copy-all", _configuration.text.copyAllButtonSymbolText);
t.title = _configuration.text.copyAllButtonText;
t.onclick = () => {
const t = JSON.stringify(_elements_Data[e._currentView.element.id].data);
let t = null;
if (e.copyOnlyCurrentPage && e.showArrayItemsAsSeparateObjects) {
t = JSON.stringify(_elements_Data[e._currentView.element.id].data[e._currentView.dataArrayCurrentIndex], null, 2);
} else {
t = JSON.stringify(_elements_Data[e._currentView.element.id].data, null, 2);
}
navigator.clipboard.writeText(t);
fireCustomTriggerEvent(e.events.onCopyAll, t);
Trigger.customEvent(e.events.onCopyAll, t);
};
}
if (e.title.showTreeControls) {
const t = DomElement.createWithHTML(n, "button", "openAll", _configuration.openAllButtonText);
const r = DomElement.createWithHTML(n, "button", "closeAll", _configuration.closeAllButtonText);
const t = DomElement.createWithHTML(r, "button", "openAll", _configuration.text.openAllButtonSymbolText);
t.title = _configuration.text.openAllButtonText;
const n = DomElement.createWithHTML(r, "button", "closeAll", _configuration.text.closeAllButtonSymbolText);
n.title = _configuration.text.closeAllButtonText;
t.onclick = () => {
openAllNodes(e);
};
r.onclick = () => {
n.onclick = () => {
closeAllNodes(e);
};
}
if (e.showArrayItemsAsSeparateObjects && Is.definedArray(t) && t.length > 1) {
const n = DomElement.createWithHTML(r, "button", "back", _configuration.text.backButtonSymbolText);
n.title = _configuration.text.backButtonText;
if (e._currentView.dataArrayCurrentIndex > 0) {
n.onclick = () => {
e._currentView.dataArrayCurrentIndex--;
renderControlContainer(e);
};
} else {
n.disabled = true;
}
const o = DomElement.createWithHTML(r, "button", "next", _configuration.text.nextButtonSymbolText);
o.title = _configuration.text.nextButtonText;
if (e._currentView.dataArrayCurrentIndex < t.length - 1) {
o.onclick = () => {
e._currentView.dataArrayCurrentIndex++;
renderControlContainer(e);
};
} else {
o.disabled = true;
}
} else {
e.showArrayItemsAsSeparateObjects = false;
}
}

@@ -391,3 +613,3 @@ }

renderControlContainer(e);
fireCustomTriggerEvent(e.events.onOpenAll, e._currentView.element);
Trigger.customEvent(e.events.onOpenAll, e._currentView.element);
}

@@ -397,13 +619,17 @@ function closeAllNodes(e) {

renderControlContainer(e);
fireCustomTriggerEvent(e.events.onCloseAll, e._currentView.element);
Trigger.customEvent(e.events.onCloseAll, e._currentView.element);
}
function renderObject(e, t, n) {
const r = DomElement.create(e, "div", "object-type-title");
const o = DomElement.create(e, "div", "object-type-contents");
const a = t.showArrowToggles ? DomElement.create(r, "div", "down-arrow") : null;
const i = renderObjectValues(a, o, t, n);
DomElement.createWithHTML(r, "span", t.showValueColors ? "object" : "", _configuration.objectText);
if (t.showCounts && i > 0) {
DomElement.createWithHTML(r, "span", t.showValueColors ? "object count" : "count", "{" + i + "}");
function renderObject(e, t, n, r = false) {
const o = DomElement.create(e, "div", "object-type-title");
const i = DomElement.create(e, "div", "object-type-contents");
const l = t.showArrowToggles ? DomElement.create(o, "div", "down-arrow") : null;
const a = renderObjectValues(l, i, t, n);
const s = DomElement.createWithHTML(o, "span", t.showValueColors ? "object" : "", _configuration.text.objectText);
if (r && t.showArrayItemsAsSeparateObjects) {
let e = t.useZeroIndexingForArrays ? t._currentView.dataArrayCurrentIndex.toString() : (t._currentView.dataArrayCurrentIndex + 1).toString();
DomElement.createWithHTML(o, "span", t.showValueColors ? "object data-array-index" : "data-array-index", `[${e}]:`, s);
}
if (t.showCounts && a > 0) {
DomElement.createWithHTML(o, "span", t.showValueColors ? "object count" : "count", `{${a}}`);
}
}

@@ -413,7 +639,7 @@ function renderArray(e, t, n) {

const o = DomElement.create(e, "div", "object-type-contents");
const a = t.showArrowToggles ? DomElement.create(r, "div", "down-arrow") : null;
DomElement.createWithHTML(r, "span", t.showValueColors ? "array" : "", _configuration.arrayText);
renderArrayValues(a, o, t, n);
const i = t.showArrowToggles ? DomElement.create(r, "div", "down-arrow") : null;
DomElement.createWithHTML(r, "span", t.showValueColors ? "array" : "", _configuration.text.arrayText);
renderArrayValues(i, o, t, n);
if (t.showCounts) {
DomElement.createWithHTML(r, "span", t.showValueColors ? "array count" : "count", "[" + n.length + "]");
DomElement.createWithHTML(r, "span", t.showValueColors ? "array count" : "count", `[${n.length}]`);
}

@@ -423,19 +649,19 @@ }

let o = 0;
let a = [];
let i = [];
for (let e in r) {
if (r.hasOwnProperty(e)) {
a.push(e);
i.push(e);
}
}
if (n.sortPropertyNames) {
a = a.sort();
i = i.sort();
if (!n.sortPropertyNamesInAlphabeticalOrder) {
a = a.reverse();
i = i.reverse();
}
}
const i = a.length;
for (let e = 0; e < i; e++) {
const l = a[e];
if (r.hasOwnProperty(l)) {
renderValue(t, n, l, r[l], e === i - 1);
const l = i.length;
for (let e = 0; e < l; e++) {
const a = i[e];
if (r.hasOwnProperty(a)) {
renderValue(t, n, a, r[a], e === l - 1);
o++;

@@ -461,20 +687,20 @@ }

function renderValue(e, t, n, r, o) {
const a = DomElement.create(e, "div", "object-type-value");
const i = t.showArrowToggles ? DomElement.create(a, "div", "no-arrow") : null;
let l = null;
const i = DomElement.create(e, "div", "object-type-value");
const l = t.showArrowToggles ? DomElement.create(i, "div", "no-arrow") : null;
let a = null;
let s = null;
let u = false;
let c = null;
let f = true;
DomElement.createWithHTML(a, "span", "title", n);
DomElement.createWithHTML(a, "span", "split", ":");
let d = true;
DomElement.createWithHTML(i, "span", "title", n);
DomElement.createWithHTML(i, "span", "split", ":");
if (!Is.defined(r)) {
if (!t.ignore.nullValues) {
l = t.showValueColors ? "null" : "";
s = DomElement.createWithHTML(a, "span", l, "null");
f = false;
a = t.showValueColors ? "null" : "";
s = DomElement.createWithHTML(i, "span", a, "null");
d = false;
if (Is.definedFunction(t.events.onNullRender)) {
fireCustomTriggerEvent(t.events.onNullRender, s);
Trigger.customEvent(t.events.onNullRender, s);
}
createComma(t, a, o);
createComma(t, i, o);
} else {

@@ -485,9 +711,9 @@ u = true;

if (!t.ignore.functionValues) {
l = t.showValueColors ? "function" : "";
s = DomElement.createWithHTML(a, "span", l, getFunctionName(r));
a = t.showValueColors ? "function" : "";
s = DomElement.createWithHTML(i, "span", a, Default.getFunctionName(r));
c = "function";
if (Is.definedFunction(t.events.onFunctionRender)) {
fireCustomTriggerEvent(t.events.onFunctionRender, s);
Trigger.customEvent(t.events.onFunctionRender, s);
}
createComma(t, a, o);
createComma(t, i, o);
} else {

@@ -498,9 +724,9 @@ u = true;

if (!t.ignore.booleanValues) {
l = t.showValueColors ? "boolean" : "";
s = DomElement.createWithHTML(a, "span", l, r);
a = t.showValueColors ? "boolean" : "";
s = DomElement.createWithHTML(i, "span", a, r);
c = "boolean";
if (Is.definedFunction(t.events.onBooleanRender)) {
fireCustomTriggerEvent(t.events.onBooleanRender, s);
Trigger.customEvent(t.events.onBooleanRender, s);
}
createComma(t, a, o);
createComma(t, i, o);
} else {

@@ -511,10 +737,10 @@ u = true;

if (!t.ignore.decimalValues) {
const e = Data.getFixedDecimalPlacesValue(r, t.maximumDecimalPlaces);
l = t.showValueColors ? "decimal" : "";
s = DomElement.createWithHTML(a, "span", l, e);
const e = Default.getFixedDecimalPlacesValue(r, t.maximumDecimalPlaces);
a = t.showValueColors ? "decimal" : "";
s = DomElement.createWithHTML(i, "span", a, e);
c = "decimal";
if (Is.definedFunction(t.events.onDecimalRender)) {
fireCustomTriggerEvent(t.events.onDecimalRender, s);
Trigger.customEvent(t.events.onDecimalRender, s);
}
createComma(t, a, o);
createComma(t, i, o);
} else {

@@ -525,9 +751,9 @@ u = true;

if (!t.ignore.numberValues) {
l = t.showValueColors ? "number" : "";
s = DomElement.createWithHTML(a, "span", l, r);
a = t.showValueColors ? "number" : "";
s = DomElement.createWithHTML(i, "span", a, r);
c = "number";
if (Is.definedFunction(t.events.onNumberRender)) {
fireCustomTriggerEvent(t.events.onNumberRender, s);
Trigger.customEvent(t.events.onNumberRender, s);
}
createComma(t, a, o);
createComma(t, i, o);
} else {

@@ -543,8 +769,8 @@ u = true;

if (t.maximumStringLength > 0 && r.length > t.maximumStringLength) {
r = r.substring(0, t.maximumStringLength) + _configuration.ellipsisText;
r = r.substring(0, t.maximumStringLength) + _configuration.text.ellipsisText;
}
}
const n = t.showStringQuotes ? '"' + r + '"' : r;
l = t.showValueColors ? "string" : "";
s = DomElement.createWithHTML(a, "span", l, n);
const n = t.showStringQuotes ? `"${r}"` : r;
a = t.showValueColors ? "string" : "";
s = DomElement.createWithHTML(i, "span", a, n);
c = "string";

@@ -555,5 +781,5 @@ if (Is.definedString(e)) {

if (Is.definedFunction(t.events.onStringRender)) {
fireCustomTriggerEvent(t.events.onStringRender, s);
Trigger.customEvent(t.events.onStringRender, s);
}
createComma(t, a, o);
createComma(t, i, o);
} else {

@@ -564,9 +790,9 @@ u = true;

if (!t.ignore.dateValues) {
l = t.showValueColors ? "date" : "";
s = DomElement.createWithHTML(a, "span", l, DateTime.getCustomFormattedDateText(_configuration, r, t.dateTimeFormat));
a = t.showValueColors ? "date" : "";
s = DomElement.createWithHTML(i, "span", a, DateTime.getCustomFormattedDateText(_configuration, r, t.dateTimeFormat));
c = "date";
if (Is.definedFunction(t.events.onDateRender)) {
fireCustomTriggerEvent(t.events.onDateRender, s);
Trigger.customEvent(t.events.onDateRender, s);
}
createComma(t, a, o);
createComma(t, i, o);
} else {

@@ -577,8 +803,8 @@ u = true;

if (!t.ignore.objectValues) {
const e = DomElement.create(a, "span", t.showValueColors ? "object" : "");
const n = DomElement.create(a, "div", "object-type-contents");
const l = renderObjectValues(i, n, t, r);
DomElement.createWithHTML(e, "span", "title", _configuration.objectText);
if (t.showCounts && l > 0) {
DomElement.createWithHTML(e, "span", "count", "{" + l + "}");
const e = DomElement.create(i, "span", t.showValueColors ? "object" : "");
const n = DomElement.create(i, "div", "object-type-contents");
const a = renderObjectValues(l, n, t, r);
DomElement.createWithHTML(e, "span", "title", _configuration.text.objectText);
if (t.showCounts && a > 0) {
DomElement.createWithHTML(e, "span", "count", `{${a}}`);
}

@@ -592,10 +818,10 @@ createComma(t, e, o);

if (!t.ignore.arrayValues) {
const e = DomElement.create(a, "span", t.showValueColors ? "array" : "");
const n = DomElement.create(a, "div", "object-type-contents");
DomElement.createWithHTML(e, "span", "title", _configuration.arrayText);
const e = DomElement.create(i, "span", t.showValueColors ? "array" : "");
const n = DomElement.create(i, "div", "object-type-contents");
DomElement.createWithHTML(e, "span", "title", _configuration.text.arrayText);
if (t.showCounts) {
DomElement.createWithHTML(e, "span", "count", "[" + r.length + "]");
DomElement.createWithHTML(e, "span", "count", `[${r.length}]`);
}
createComma(t, e, o);
renderArrayValues(i, n, t, r);
renderArrayValues(l, n, t, r);
c = "array";

@@ -607,9 +833,9 @@ } else {

if (!t.ignore.unknownValues) {
l = t.showValueColors ? "unknown" : "";
s = DomElement.createWithHTML(a, "span", l, r.toString());
a = t.showValueColors ? "unknown" : "";
s = DomElement.createWithHTML(i, "span", a, r.toString());
c = "unknown";
if (Is.definedFunction(t.events.onUnknownRender)) {
fireCustomTriggerEvent(t.events.onUnknownRender, s);
Trigger.customEvent(t.events.onUnknownRender, s);
}
createComma(t, a, o);
createComma(t, i, o);
} else {

@@ -620,6 +846,6 @@ u = true;

if (u) {
e.removeChild(a);
e.removeChild(i);
} else {
if (Is.defined(s)) {
addValueClickEvent(t, s, r, c, f);
addValueClickEvent(t, s, r, c, d);
}

@@ -631,3 +857,3 @@ }

t.onclick = () => {
fireCustomTriggerEvent(e.events.onValueClick, n, r);
Trigger.customEvent(e.events.onValueClick, n, r);
};

@@ -657,14 +883,2 @@ } else {

}
function getFunctionName(e) {
let t;
const n = e.toString().split("(");
const r = n[0].split(" ");
if (r.length === 2) {
t = r[1];
} else {
t = r[0];
}
t += "()";
return t;
}
function createComma(e, t, n) {

@@ -678,76 +892,6 @@ if (e.showCommas && !n) {

if (!e.addArrayIndexPadding) {
r = Data.String.padNumber(parseInt(r), n.toString().length);
r = Str.padNumber(parseInt(r), n.toString().length);
}
return r;
return `[${r}]`;
}
function buildAttributeOptions(e) {
let t = Data.getDefaultObject(e, {});
t.data = Data.getDefaultObject(t.data, null);
t.showCounts = Data.getDefaultBoolean(t.showCounts, true);
t.useZeroIndexingForArrays = Data.getDefaultBoolean(t.useZeroIndexingForArrays, true);
t.dateTimeFormat = Data.getDefaultString(t.dateTimeFormat, "{dd}{o} {mmmm} {yyyy} {hh}:{MM}:{ss}");
t.showArrowToggles = Data.getDefaultBoolean(t.showArrowToggles, true);
t.showStringQuotes = Data.getDefaultBoolean(t.showStringQuotes, true);
t.showAllAsClosed = Data.getDefaultBoolean(t.showAllAsClosed, false);
t.sortPropertyNames = Data.getDefaultBoolean(t.sortPropertyNames, true);
t.sortPropertyNamesInAlphabeticalOrder = Data.getDefaultBoolean(t.sortPropertyNamesInAlphabeticalOrder, true);
t.showCommas = Data.getDefaultBoolean(t.showCommas, false);
t.reverseArrayValues = Data.getDefaultBoolean(t.reverseArrayValues, false);
t.addArrayIndexPadding = Data.getDefaultBoolean(t.addArrayIndexPadding, false);
t.showValueColors = Data.getDefaultBoolean(t.showValueColors, true);
t.maximumDecimalPlaces = Data.getDefaultNumber(t.maximumDecimalPlaces, 2);
t.maximumStringLength = Data.getDefaultNumber(t.maximumStringLength, 0);
t.showStringHexColors = Data.getDefaultBoolean(t.showStringHexColors, false);
t = buildAttributeOptionTitle(t);
t = buildAttributeOptionIgnore(t);
t = buildAttributeOptionCustomTriggers(t);
return t;
}
function buildAttributeOptionTitle(e) {
e.title = Data.getDefaultObject(e.title, {});
e.title.text = Data.getDefaultString(e.title.text, "JsonTree.js");
e.title.show = Data.getDefaultBoolean(e.title.show, true);
e.title.showTreeControls = Data.getDefaultBoolean(e.title.showTreeControls, true);
e.title.showCopyButton = Data.getDefaultBoolean(e.title.showCopyButton, false);
return e;
}
function buildAttributeOptionIgnore(e) {
e.ignore = Data.getDefaultObject(e.ignore, {});
e.ignore.nullValues = Data.getDefaultBoolean(e.ignore.nullValues, false);
e.ignore.functionValues = Data.getDefaultBoolean(e.ignore.functionValues, false);
e.ignore.unknownValues = Data.getDefaultBoolean(e.ignore.unknownValues, false);
e.ignore.booleanValues = Data.getDefaultBoolean(e.ignore.booleanValues, false);
e.ignore.decimalValues = Data.getDefaultBoolean(e.ignore.decimalValues, false);
e.ignore.numberValues = Data.getDefaultBoolean(e.ignore.numberValues, false);
e.ignore.stringValues = Data.getDefaultBoolean(e.ignore.stringValues, false);
e.ignore.dateValues = Data.getDefaultBoolean(e.ignore.dateValues, false);
e.ignore.objectValues = Data.getDefaultBoolean(e.ignore.objectValues, false);
e.ignore.arrayValues = Data.getDefaultBoolean(e.ignore.arrayValues, false);
return e;
}
function buildAttributeOptionCustomTriggers(e) {
e.events = Data.getDefaultObject(e.events, {});
e.events.onBeforeRender = Data.getDefaultFunction(e.events.onBeforeRender, null);
e.events.onRenderComplete = Data.getDefaultFunction(e.events.onRenderComplete, null);
e.events.onValueClick = Data.getDefaultFunction(e.events.onValueClick, null);
e.events.onRefresh = Data.getDefaultFunction(e.events.onRefresh, null);
e.events.onCopyAll = Data.getDefaultFunction(e.events.onCopyAll, null);
e.events.onOpenAll = Data.getDefaultFunction(e.events.onOpenAll, null);
e.events.onCloseAll = Data.getDefaultFunction(e.events.onCloseAll, null);
e.events.onDestroy = Data.getDefaultFunction(e.events.onDestroy, null);
e.events.onBooleanRender = Data.getDefaultFunction(e.events.onBooleanRender, null);
e.events.onDecimalRender = Data.getDefaultFunction(e.events.onDecimalRender, null);
e.events.onNumberRender = Data.getDefaultFunction(e.events.onNumberRender, null);
e.events.onStringRender = Data.getDefaultFunction(e.events.onStringRender, null);
e.events.onDateRender = Data.getDefaultFunction(e.events.onDateRender, null);
e.events.onFunctionRender = Data.getDefaultFunction(e.events.onFunctionRender, null);
e.events.onNullRender = Data.getDefaultFunction(e.events.onNullRender, null);
e.events.onUnknownRender = Data.getDefaultFunction(e.events.onUnknownRender, null);
return e;
}
function fireCustomTriggerEvent(e, ...t) {
if (Is.definedFunction(e)) {
e.apply(null, [].slice.call(t, 0));
}
}
function getObjectFromString(objectString) {

@@ -764,3 +908,3 @@ const result = {

try {
result.object = eval("(" + objectString + ")");
result.object = eval(`(${objectString})`);
if (Is.definedFunction(result.object)) {

@@ -771,3 +915,3 @@ result.object = result.object();

if (!_configuration.safeMode) {
console.error(_configuration.objectErrorText.replace("{{error_1}}", e1.message).replace("{{error_2}}", e.message));
console.error(_configuration.text.objectErrorText.replace("{{error_1}}", e1.message).replace("{{error_2}}", e.message));
result.parsed = false;

@@ -783,37 +927,4 @@ }

e._currentView.element.className = "";
fireCustomTriggerEvent(e.events.onDestroy, e._currentView.element);
Trigger.customEvent(e.events.onDestroy, e._currentView.element);
}
function buildDefaultConfiguration(e = null) {
_configuration = Data.getDefaultObject(e, {});
_configuration.safeMode = Data.getDefaultBoolean(_configuration.safeMode, true);
_configuration.domElementTypes = Data.getDefaultStringOrArray(_configuration.domElementTypes, [ "*" ]);
buildDefaultConfigurationStrings();
}
function buildDefaultConfigurationStrings() {
_configuration.objectText = Data.getDefaultAnyString(_configuration.objectText, "object");
_configuration.arrayText = Data.getDefaultAnyString(_configuration.arrayText, "array");
_configuration.closeAllButtonText = Data.getDefaultAnyString(_configuration.closeAllButtonText, "Close All");
_configuration.openAllButtonText = Data.getDefaultAnyString(_configuration.openAllButtonText, "Open All");
_configuration.copyAllButtonText = Data.getDefaultAnyString(_configuration.copyAllButtonText, "Copy All");
_configuration.objectErrorText = Data.getDefaultAnyString(_configuration.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}");
_configuration.attributeNotValidErrorText = Data.getDefaultAnyString(_configuration.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object.");
_configuration.attributeNotSetErrorText = Data.getDefaultAnyString(_configuration.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly.");
_configuration.stText = Data.getDefaultAnyString(_configuration.stText, "st");
_configuration.ndText = Data.getDefaultAnyString(_configuration.ndText, "nd");
_configuration.rdText = Data.getDefaultAnyString(_configuration.rdText, "rd");
_configuration.thText = Data.getDefaultAnyString(_configuration.thText, "th");
_configuration.ellipsisText = Data.getDefaultAnyString(_configuration.ellipsisText, "...");
if (Is.invalidOptionArray(_configuration.dayNames, 7)) {
_configuration.dayNames = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ];
}
if (Is.invalidOptionArray(_configuration.dayNamesAbbreviated, 7)) {
_configuration.dayNamesAbbreviated = [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ];
}
if (Is.invalidOptionArray(_configuration.monthNames, 12)) {
_configuration.monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
}
if (Is.invalidOptionArray(_configuration.monthNamesAbbreviated, 12)) {
_configuration.monthNamesAbbreviated = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
}
}
const _public = {

@@ -824,3 +935,3 @@ refresh: function(e) {

renderControlContainer(t);
fireCustomTriggerEvent(t.events.onRefresh, t._currentView.element);
Trigger.customEvent(t.events.onRefresh, t._currentView.element);
}

@@ -834,3 +945,3 @@ return _public;

renderControlContainer(t);
fireCustomTriggerEvent(t.events.onRefresh, t._currentView.element);
Trigger.customEvent(t.events.onRefresh, t._currentView.element);
}

@@ -842,3 +953,3 @@ }

if (Is.definedObject(e) && Is.definedObject(t)) {
renderControl(renderBindingOptions(t, e));
renderControl(Binding.Options.getForNewInstance(t, e));
}

@@ -890,3 +1001,3 @@ return _public;

if (t) {
buildDefaultConfiguration(n);
_configuration = Config.Options.get(n);
}

@@ -906,7 +1017,7 @@ }

getVersion: function() {
return "2.0.0";
return "2.1.0";
}
};
(() => {
buildDefaultConfiguration();
_configuration = Config.Options.get();
document.addEventListener("DOMContentLoaded", (function() {

@@ -913,0 +1024,0 @@ render();

@@ -22,14 +22,14 @@ "use strict";

e.definedString = o;
function a(e) {
function l(e) {
return t(e) && typeof e === "function";
}
e.definedFunction = a;
function i(e) {
e.definedFunction = l;
function a(e) {
return t(e) && typeof e === "number";
}
e.definedNumber = i;
function l(e) {
e.definedNumber = a;
function i(e) {
return n(e) && e instanceof Array;
}
e.definedArray = l;
e.definedArray = i;
function s(e) {

@@ -44,6 +44,6 @@ return n(e) && e instanceof Date;

function c(e, t = 1) {
return !l(e) || e.length < t;
return !i(e) || e.length < t;
}
e.invalidOptionArray = c;
function f(e) {
function d(e) {
let t = e.length >= 2 && e.length <= 7;

@@ -55,62 +55,37 @@ if (t && e[0] === "#") {

}
e.hexColor = f;
e.hexColor = d;
})(Is || (Is = {}));
var Data;
var Default;
(e => {
let t;
(e => {
function t() {
const e = [];
for (let t = 0; t < 32; t++) {
if (t === 8 || t === 12 || t === 16 || t === 20) {
e.push("-");
}
const n = Math.floor(Math.random() * 16).toString(16);
e.push(n);
}
return e.join("");
}
e.newGuid = t;
function n(e, t = 1) {
const n = e.toString();
let r = n;
if (n.length < t) {
const e = t - n.length + 1;
r = Array(e).join("0") + n;
}
return r;
}
e.padNumber = n;
})(t = e.String || (e.String = {}));
function n(e, t) {
function t(e, t) {
return typeof e === "string" ? e : t;
}
e.getDefaultAnyString = n;
function r(e, t) {
e.getAnyString = t;
function n(e, t) {
return Is.definedString(e) ? e : t;
}
e.getDefaultString = r;
function o(e, t) {
e.getString = n;
function r(e, t) {
return Is.definedBoolean(e) ? e : t;
}
e.getDefaultBoolean = o;
function a(e, t) {
e.getBoolean = r;
function o(e, t) {
return Is.definedNumber(e) ? e : t;
}
e.getDefaultNumber = a;
function i(e, t) {
e.getNumber = o;
function l(e, t) {
return Is.definedFunction(e) ? e : t;
}
e.getDefaultFunction = i;
function l(e, t) {
e.getFunction = l;
function a(e, t) {
return Is.definedArray(e) ? e : t;
}
e.getDefaultArray = l;
function s(e, t) {
e.getArray = a;
function i(e, t) {
return Is.definedObject(e) ? e : t;
}
e.getDefaultObject = s;
function u(e, t) {
e.getObject = i;
function s(e, t) {
let n = t;

@@ -125,14 +100,27 @@ if (Is.definedString(e)) {

} else {
n = l(e, t);
n = a(e, t);
}
return n;
}
e.getDefaultStringOrArray = u;
function c(e, t) {
e.getStringOrArray = s;
function u(e, t) {
var n;
const r = new RegExp("^-?\\d+(?:.\\d{0," + (t || -1) + "})?");
const r = new RegExp(`^-?\\d+(?:.\\d{0,${t || -1}})?`);
return ((n = e.toString().match(r)) == null ? void 0 : n[0]) || "";
}
e.getFixedDecimalPlacesValue = c;
})(Data || (Data = {}));
e.getFixedDecimalPlacesValue = u;
function c(e) {
let t;
const n = e.toString().split("(");
const r = n[0].split(" ");
if (r.length === 2) {
t = r[1];
} else {
t = r[0];
}
t += "()";
return t;
}
e.getFunctionName = c;
})(Default || (Default = {}));

@@ -144,19 +132,19 @@ var DomElement;

const o = t.toLowerCase();
const a = o === "text";
let i = a ? document.createTextNode("") : document.createElement(o);
const l = o === "text";
let a = l ? document.createTextNode("") : document.createElement(o);
if (Is.defined(n)) {
i.className = n;
a.className = n;
}
if (Is.defined(r)) {
e.insertBefore(i, r);
e.insertBefore(a, r);
} else {
e.appendChild(i);
e.appendChild(a);
}
return i;
return a;
}
e.create = t;
function n(e, n, r, o, a = null) {
const i = t(e, n, r, a);
i.innerHTML = o;
return i;
function n(e, n, r, o, l = null) {
const a = t(e, n, r, l);
a.innerHTML = o;
return a;
}

@@ -170,2 +158,29 @@ e.createWithHTML = n;

var Str;
(e => {
function t() {
const e = [];
for (let t = 0; t < 32; t++) {
if (t === 8 || t === 12 || t === 16 || t === 20) {
e.push("-");
}
const n = Math.floor(Math.random() * 16).toString(16);
e.push(n);
}
return e.join("");
}
e.newGuid = t;
function n(e, t = 1) {
const n = e.toString();
let r = n;
if (n.length < t) {
const e = t - n.length + 1;
r = Array(e).join("0") + n;
}
return r;
}
e.padNumber = n;
})(Str || (Str = {}));
var DateTime;

@@ -179,9 +194,9 @@

function n(e, t) {
let n = e.thText;
let n = e.text.thText;
if (t === 31 || t === 21 || t === 1) {
n = e.stText;
n = e.text.stText;
} else if (t === 22 || t === 2) {
n = e.ndText;
n = e.text.ndText;
} else if (t === 23 || t === 3) {
n = e.rdText;
n = e.text.rdText;
}

@@ -192,24 +207,24 @@ return n;

function r(e, r, o) {
let a = o;
const i = t(r);
a = a.replace("{hh}", Data.String.padNumber(r.getHours(), 2));
a = a.replace("{h}", r.getHours().toString());
a = a.replace("{MM}", Data.String.padNumber(r.getMinutes(), 2));
a = a.replace("{M}", r.getMinutes().toString());
a = a.replace("{ss}", Data.String.padNumber(r.getSeconds(), 2));
a = a.replace("{s}", r.getSeconds().toString());
a = a.replace("{dddd}", e.dayNames[i]);
a = a.replace("{ddd}", e.dayNamesAbbreviated[i]);
a = a.replace("{dd}", Data.String.padNumber(r.getDate()));
a = a.replace("{d}", r.getDate().toString());
a = a.replace("{o}", n(e, r.getDate()));
a = a.replace("{mmmm}", e.monthNames[r.getMonth()]);
a = a.replace("{mmm}", e.monthNamesAbbreviated[r.getMonth()]);
a = a.replace("{mm}", Data.String.padNumber(r.getMonth() + 1));
a = a.replace("{m}", (r.getMonth() + 1).toString());
a = a.replace("{yyyy}", r.getFullYear().toString());
a = a.replace("{yyy}", r.getFullYear().toString().substring(1));
a = a.replace("{yy}", r.getFullYear().toString().substring(2));
a = a.replace("{y}", Number.parseInt(r.getFullYear().toString().substring(2)).toString());
return a;
let l = o;
const a = t(r);
l = l.replace("{hh}", Str.padNumber(r.getHours(), 2));
l = l.replace("{h}", r.getHours().toString());
l = l.replace("{MM}", Str.padNumber(r.getMinutes(), 2));
l = l.replace("{M}", r.getMinutes().toString());
l = l.replace("{ss}", Str.padNumber(r.getSeconds(), 2));
l = l.replace("{s}", r.getSeconds().toString());
l = l.replace("{dddd}", e.text.dayNames[a]);
l = l.replace("{ddd}", e.text.dayNamesAbbreviated[a]);
l = l.replace("{dd}", Str.padNumber(r.getDate()));
l = l.replace("{d}", r.getDate().toString());
l = l.replace("{o}", n(e, r.getDate()));
l = l.replace("{mmmm}", e.text.monthNames[r.getMonth()]);
l = l.replace("{mmm}", e.text.monthNamesAbbreviated[r.getMonth()]);
l = l.replace("{mm}", Str.padNumber(r.getMonth() + 1));
l = l.replace("{m}", (r.getMonth() + 1).toString());
l = l.replace("{yyyy}", r.getFullYear().toString());
l = l.replace("{yyy}", r.getFullYear().toString().substring(1));
l = l.replace("{yy}", r.getFullYear().toString().substring(2));
l = l.replace("{y}", Number.parseInt(r.getFullYear().toString().substring(2)).toString());
return l;
}

@@ -225,2 +240,151 @@ e.getCustomFormattedDateText = r;

var Binding;
(e => {
let t;
(t => {
function n(t, n) {
const r = e.Options.get(t);
r._currentView = {};
r._currentView.element = n;
r._currentView.dataArrayCurrentIndex = 0;
return r;
}
t.getForNewInstance = n;
function r(e) {
let t = Default.getObject(e, {});
t.data = Default.getObject(t.data, null);
t.showCounts = Default.getBoolean(t.showCounts, true);
t.useZeroIndexingForArrays = Default.getBoolean(t.useZeroIndexingForArrays, true);
t.dateTimeFormat = Default.getString(t.dateTimeFormat, "{dd}{o} {mmmm} {yyyy} {hh}:{MM}:{ss}");
t.showArrowToggles = Default.getBoolean(t.showArrowToggles, true);
t.showStringQuotes = Default.getBoolean(t.showStringQuotes, true);
t.showAllAsClosed = Default.getBoolean(t.showAllAsClosed, false);
t.sortPropertyNames = Default.getBoolean(t.sortPropertyNames, true);
t.sortPropertyNamesInAlphabeticalOrder = Default.getBoolean(t.sortPropertyNamesInAlphabeticalOrder, true);
t.showCommas = Default.getBoolean(t.showCommas, false);
t.reverseArrayValues = Default.getBoolean(t.reverseArrayValues, false);
t.addArrayIndexPadding = Default.getBoolean(t.addArrayIndexPadding, false);
t.showValueColors = Default.getBoolean(t.showValueColors, true);
t.maximumDecimalPlaces = Default.getNumber(t.maximumDecimalPlaces, 2);
t.maximumStringLength = Default.getNumber(t.maximumStringLength, 0);
t.showStringHexColors = Default.getBoolean(t.showStringHexColors, false);
t.showArrayItemsAsSeparateObjects = Default.getBoolean(t.showArrayItemsAsSeparateObjects, false);
t.copyOnlyCurrentPage = Default.getBoolean(t.copyOnlyCurrentPage, false);
t = o(t);
t = l(t);
t = a(t);
return t;
}
t.get = r;
function o(e) {
e.title = Default.getObject(e.title, {});
e.title.text = Default.getString(e.title.text, "JsonTree.js");
e.title.show = Default.getBoolean(e.title.show, true);
e.title.showTreeControls = Default.getBoolean(e.title.showTreeControls, true);
e.title.showCopyButton = Default.getBoolean(e.title.showCopyButton, true);
return e;
}
function l(e) {
e.ignore = Default.getObject(e.ignore, {});
e.ignore.nullValues = Default.getBoolean(e.ignore.nullValues, false);
e.ignore.functionValues = Default.getBoolean(e.ignore.functionValues, false);
e.ignore.unknownValues = Default.getBoolean(e.ignore.unknownValues, false);
e.ignore.booleanValues = Default.getBoolean(e.ignore.booleanValues, false);
e.ignore.decimalValues = Default.getBoolean(e.ignore.decimalValues, false);
e.ignore.numberValues = Default.getBoolean(e.ignore.numberValues, false);
e.ignore.stringValues = Default.getBoolean(e.ignore.stringValues, false);
e.ignore.dateValues = Default.getBoolean(e.ignore.dateValues, false);
e.ignore.objectValues = Default.getBoolean(e.ignore.objectValues, false);
e.ignore.arrayValues = Default.getBoolean(e.ignore.arrayValues, false);
return e;
}
function a(e) {
e.events = Default.getObject(e.events, {});
e.events.onBeforeRender = Default.getFunction(e.events.onBeforeRender, null);
e.events.onRenderComplete = Default.getFunction(e.events.onRenderComplete, null);
e.events.onValueClick = Default.getFunction(e.events.onValueClick, null);
e.events.onRefresh = Default.getFunction(e.events.onRefresh, null);
e.events.onCopyAll = Default.getFunction(e.events.onCopyAll, null);
e.events.onOpenAll = Default.getFunction(e.events.onOpenAll, null);
e.events.onCloseAll = Default.getFunction(e.events.onCloseAll, null);
e.events.onDestroy = Default.getFunction(e.events.onDestroy, null);
e.events.onBooleanRender = Default.getFunction(e.events.onBooleanRender, null);
e.events.onDecimalRender = Default.getFunction(e.events.onDecimalRender, null);
e.events.onNumberRender = Default.getFunction(e.events.onNumberRender, null);
e.events.onStringRender = Default.getFunction(e.events.onStringRender, null);
e.events.onDateRender = Default.getFunction(e.events.onDateRender, null);
e.events.onFunctionRender = Default.getFunction(e.events.onFunctionRender, null);
e.events.onNullRender = Default.getFunction(e.events.onNullRender, null);
e.events.onUnknownRender = Default.getFunction(e.events.onUnknownRender, null);
return e;
}
})(t = e.Options || (e.Options = {}));
})(Binding || (Binding = {}));
var Config;
(e => {
let t;
(e => {
function t(e = null) {
let t = Default.getObject(e, {});
t.safeMode = Default.getBoolean(t.safeMode, true);
t.domElementTypes = Default.getStringOrArray(t.domElementTypes, [ "*" ]);
t = n(t);
return t;
}
e.get = t;
function n(e) {
e.text = Default.getObject(e.text, {});
e.text.objectText = Default.getAnyString(e.text.objectText, "object");
e.text.arrayText = Default.getAnyString(e.text.arrayText, "array");
e.text.closeAllButtonText = Default.getAnyString(e.text.closeAllButtonText, "Close All");
e.text.openAllButtonText = Default.getAnyString(e.text.openAllButtonText, "Open All");
e.text.copyAllButtonText = Default.getAnyString(e.text.copyAllButtonText, "Copy All");
e.text.objectErrorText = Default.getAnyString(e.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}");
e.text.attributeNotValidErrorText = Default.getAnyString(e.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object.");
e.text.attributeNotSetErrorText = Default.getAnyString(e.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly.");
e.text.stText = Default.getAnyString(e.text.stText, "st");
e.text.ndText = Default.getAnyString(e.text.ndText, "nd");
e.text.rdText = Default.getAnyString(e.text.rdText, "rd");
e.text.thText = Default.getAnyString(e.text.thText, "th");
e.text.ellipsisText = Default.getAnyString(e.text.ellipsisText, "...");
e.text.closeAllButtonSymbolText = Default.getAnyString(e.text.closeAllButtonSymbolText, "↑");
e.text.openAllButtonSymbolText = Default.getAnyString(e.text.openAllButtonSymbolText, "↓");
e.text.copyAllButtonSymbolText = Default.getAnyString(e.text.copyAllButtonSymbolText, "❐");
e.text.backButtonText = Default.getAnyString(e.text.backButtonText, "Back");
e.text.nextButtonText = Default.getAnyString(e.text.nextButtonText, "Next");
e.text.backButtonSymbolText = Default.getAnyString(e.text.backButtonSymbolText, "←");
e.text.nextButtonSymbolText = Default.getAnyString(e.text.nextButtonSymbolText, "→");
if (Is.invalidOptionArray(e.text.dayNames, 7)) {
e.text.dayNames = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ];
}
if (Is.invalidOptionArray(e.text.dayNamesAbbreviated, 7)) {
e.text.dayNamesAbbreviated = [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ];
}
if (Is.invalidOptionArray(e.text.monthNames, 12)) {
e.text.monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
}
if (Is.invalidOptionArray(e.text.monthNamesAbbreviated, 12)) {
e.text.monthNamesAbbreviated = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
}
return e;
}
})(t = e.Options || (e.Options = {}));
})(Config || (Config = {}));
var Trigger;
(e => {
function t(e, ...t) {
let n = null;
if (Is.definedFunction(e)) {
n = e.apply(null, [].slice.call(t, 0));
}
return n;
}
e.customEvent = t;
})(Trigger || (Trigger = {}));
(() => {

@@ -250,6 +414,6 @@ let _configuration = {};

if (r.parsed && Is.definedObject(r.object)) {
renderControl(renderBindingOptions(r.object, e));
renderControl(Binding.Options.getForNewInstance(r.object, e));
} else {
if (!_configuration.safeMode) {
console.error(_configuration.attributeNotValidErrorText.replace("{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME));
console.error(_configuration.text.attributeNotValidErrorText.replace("{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME));
t = false;

@@ -260,3 +424,3 @@ }

if (!_configuration.safeMode) {
console.error(_configuration.attributeNotSetErrorText.replace("{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME));
console.error(_configuration.text.attributeNotSetErrorText.replace("{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME));
t = false;

@@ -268,12 +432,6 @@ }

}
function renderBindingOptions(e, t) {
const n = buildAttributeOptions(e);
n._currentView = {};
n._currentView.element = t;
return n;
}
function renderControl(e) {
fireCustomTriggerEvent(e.events.onBeforeRender, e._currentView.element);
Trigger.customEvent(e.events.onBeforeRender, e._currentView.element);
if (!Is.definedString(e._currentView.element.id)) {
e._currentView.element.id = Data.String.newGuid();
e._currentView.element.id = Str.newGuid();
}

@@ -286,10 +444,13 @@ e._currentView.element.className = "json-tree-js";

renderControlContainer(e);
fireCustomTriggerEvent(e.events.onRenderComplete, e._currentView.element);
Trigger.customEvent(e.events.onRenderComplete, e._currentView.element);
}
function renderControlContainer(e) {
const t = _elements_Data[e._currentView.element.id].data;
let t = _elements_Data[e._currentView.element.id].data;
e._currentView.element.innerHTML = "";
renderControlTitleBar(e);
renderControlTitleBar(e, t);
if (e.showArrayItemsAsSeparateObjects) {
t = t[e._currentView.dataArrayCurrentIndex];
}
if (Is.definedObject(t) && !Is.definedArray(t)) {
renderObject(e._currentView.element, e, t);
renderObject(e._currentView.element, e, t, true);
} else if (Is.definedArray(t)) {

@@ -299,27 +460,59 @@ renderArray(e._currentView.element, e, t);

}
function renderControlTitleBar(e) {
function renderControlTitleBar(e, t) {
if (e.title.show || e.title.showTreeControls || e.title.showCopyButton) {
const t = DomElement.create(e._currentView.element, "div", "title-bar");
const n = DomElement.create(t, "div", "controls");
const n = DomElement.create(e._currentView.element, "div", "title-bar");
const r = DomElement.create(n, "div", "controls");
if (e.title.show) {
DomElement.createWithHTML(t, "div", "title", e.title.text, n);
DomElement.createWithHTML(n, "div", "title", e.title.text, r);
}
if (e.title.showCopyButton) {
const t = DomElement.createWithHTML(n, "button", "copy-all", _configuration.copyAllButtonText);
const t = DomElement.createWithHTML(r, "button", "copy-all", _configuration.text.copyAllButtonSymbolText);
t.title = _configuration.text.copyAllButtonText;
t.onclick = () => {
const t = JSON.stringify(_elements_Data[e._currentView.element.id].data);
let t = null;
if (e.copyOnlyCurrentPage && e.showArrayItemsAsSeparateObjects) {
t = JSON.stringify(_elements_Data[e._currentView.element.id].data[e._currentView.dataArrayCurrentIndex], null, 2);
} else {
t = JSON.stringify(_elements_Data[e._currentView.element.id].data, null, 2);
}
navigator.clipboard.writeText(t);
fireCustomTriggerEvent(e.events.onCopyAll, t);
Trigger.customEvent(e.events.onCopyAll, t);
};
}
if (e.title.showTreeControls) {
const t = DomElement.createWithHTML(n, "button", "openAll", _configuration.openAllButtonText);
const r = DomElement.createWithHTML(n, "button", "closeAll", _configuration.closeAllButtonText);
const t = DomElement.createWithHTML(r, "button", "openAll", _configuration.text.openAllButtonSymbolText);
t.title = _configuration.text.openAllButtonText;
const n = DomElement.createWithHTML(r, "button", "closeAll", _configuration.text.closeAllButtonSymbolText);
n.title = _configuration.text.closeAllButtonText;
t.onclick = () => {
openAllNodes(e);
};
r.onclick = () => {
n.onclick = () => {
closeAllNodes(e);
};
}
if (e.showArrayItemsAsSeparateObjects && Is.definedArray(t) && t.length > 1) {
const n = DomElement.createWithHTML(r, "button", "back", _configuration.text.backButtonSymbolText);
n.title = _configuration.text.backButtonText;
if (e._currentView.dataArrayCurrentIndex > 0) {
n.onclick = () => {
e._currentView.dataArrayCurrentIndex--;
renderControlContainer(e);
};
} else {
n.disabled = true;
}
const o = DomElement.createWithHTML(r, "button", "next", _configuration.text.nextButtonSymbolText);
o.title = _configuration.text.nextButtonText;
if (e._currentView.dataArrayCurrentIndex < t.length - 1) {
o.onclick = () => {
e._currentView.dataArrayCurrentIndex++;
renderControlContainer(e);
};
} else {
o.disabled = true;
}
} else {
e.showArrayItemsAsSeparateObjects = false;
}
}

@@ -330,3 +523,3 @@ }

renderControlContainer(e);
fireCustomTriggerEvent(e.events.onOpenAll, e._currentView.element);
Trigger.customEvent(e.events.onOpenAll, e._currentView.element);
}

@@ -336,12 +529,16 @@ function closeAllNodes(e) {

renderControlContainer(e);
fireCustomTriggerEvent(e.events.onCloseAll, e._currentView.element);
Trigger.customEvent(e.events.onCloseAll, e._currentView.element);
}
function renderObject(e, t, n) {
const r = DomElement.create(e, "div", "object-type-title");
const o = DomElement.create(e, "div", "object-type-contents");
const a = t.showArrowToggles ? DomElement.create(r, "div", "down-arrow") : null;
const i = renderObjectValues(a, o, t, n);
DomElement.createWithHTML(r, "span", t.showValueColors ? "object" : "", _configuration.objectText);
function renderObject(e, t, n, r = false) {
const o = DomElement.create(e, "div", "object-type-title");
const l = DomElement.create(e, "div", "object-type-contents");
const a = t.showArrowToggles ? DomElement.create(o, "div", "down-arrow") : null;
const i = renderObjectValues(a, l, t, n);
const s = DomElement.createWithHTML(o, "span", t.showValueColors ? "object" : "", _configuration.text.objectText);
if (r && t.showArrayItemsAsSeparateObjects) {
let e = t.useZeroIndexingForArrays ? t._currentView.dataArrayCurrentIndex.toString() : (t._currentView.dataArrayCurrentIndex + 1).toString();
DomElement.createWithHTML(o, "span", t.showValueColors ? "object data-array-index" : "data-array-index", `[${e}]:`, s);
}
if (t.showCounts && i > 0) {
DomElement.createWithHTML(r, "span", t.showValueColors ? "object count" : "count", "{" + i + "}");
DomElement.createWithHTML(o, "span", t.showValueColors ? "object count" : "count", `{${i}}`);
}

@@ -352,7 +549,7 @@ }

const o = DomElement.create(e, "div", "object-type-contents");
const a = t.showArrowToggles ? DomElement.create(r, "div", "down-arrow") : null;
DomElement.createWithHTML(r, "span", t.showValueColors ? "array" : "", _configuration.arrayText);
renderArrayValues(a, o, t, n);
const l = t.showArrowToggles ? DomElement.create(r, "div", "down-arrow") : null;
DomElement.createWithHTML(r, "span", t.showValueColors ? "array" : "", _configuration.text.arrayText);
renderArrayValues(l, o, t, n);
if (t.showCounts) {
DomElement.createWithHTML(r, "span", t.showValueColors ? "array count" : "count", "[" + n.length + "]");
DomElement.createWithHTML(r, "span", t.showValueColors ? "array count" : "count", `[${n.length}]`);
}

@@ -362,19 +559,19 @@ }

let o = 0;
let a = [];
let l = [];
for (let e in r) {
if (r.hasOwnProperty(e)) {
a.push(e);
l.push(e);
}
}
if (n.sortPropertyNames) {
a = a.sort();
l = l.sort();
if (!n.sortPropertyNamesInAlphabeticalOrder) {
a = a.reverse();
l = l.reverse();
}
}
const i = a.length;
for (let e = 0; e < i; e++) {
const l = a[e];
if (r.hasOwnProperty(l)) {
renderValue(t, n, l, r[l], e === i - 1);
const a = l.length;
for (let e = 0; e < a; e++) {
const i = l[e];
if (r.hasOwnProperty(i)) {
renderValue(t, n, i, r[i], e === a - 1);
o++;

@@ -400,20 +597,20 @@ }

function renderValue(e, t, n, r, o) {
const a = DomElement.create(e, "div", "object-type-value");
const i = t.showArrowToggles ? DomElement.create(a, "div", "no-arrow") : null;
let l = null;
const l = DomElement.create(e, "div", "object-type-value");
const a = t.showArrowToggles ? DomElement.create(l, "div", "no-arrow") : null;
let i = null;
let s = null;
let u = false;
let c = null;
let f = true;
DomElement.createWithHTML(a, "span", "title", n);
DomElement.createWithHTML(a, "span", "split", ":");
let d = true;
DomElement.createWithHTML(l, "span", "title", n);
DomElement.createWithHTML(l, "span", "split", ":");
if (!Is.defined(r)) {
if (!t.ignore.nullValues) {
l = t.showValueColors ? "null" : "";
s = DomElement.createWithHTML(a, "span", l, "null");
f = false;
i = t.showValueColors ? "null" : "";
s = DomElement.createWithHTML(l, "span", i, "null");
d = false;
if (Is.definedFunction(t.events.onNullRender)) {
fireCustomTriggerEvent(t.events.onNullRender, s);
Trigger.customEvent(t.events.onNullRender, s);
}
createComma(t, a, o);
createComma(t, l, o);
} else {

@@ -424,9 +621,9 @@ u = true;

if (!t.ignore.functionValues) {
l = t.showValueColors ? "function" : "";
s = DomElement.createWithHTML(a, "span", l, getFunctionName(r));
i = t.showValueColors ? "function" : "";
s = DomElement.createWithHTML(l, "span", i, Default.getFunctionName(r));
c = "function";
if (Is.definedFunction(t.events.onFunctionRender)) {
fireCustomTriggerEvent(t.events.onFunctionRender, s);
Trigger.customEvent(t.events.onFunctionRender, s);
}
createComma(t, a, o);
createComma(t, l, o);
} else {

@@ -437,9 +634,9 @@ u = true;

if (!t.ignore.booleanValues) {
l = t.showValueColors ? "boolean" : "";
s = DomElement.createWithHTML(a, "span", l, r);
i = t.showValueColors ? "boolean" : "";
s = DomElement.createWithHTML(l, "span", i, r);
c = "boolean";
if (Is.definedFunction(t.events.onBooleanRender)) {
fireCustomTriggerEvent(t.events.onBooleanRender, s);
Trigger.customEvent(t.events.onBooleanRender, s);
}
createComma(t, a, o);
createComma(t, l, o);
} else {

@@ -450,10 +647,10 @@ u = true;

if (!t.ignore.decimalValues) {
const e = Data.getFixedDecimalPlacesValue(r, t.maximumDecimalPlaces);
l = t.showValueColors ? "decimal" : "";
s = DomElement.createWithHTML(a, "span", l, e);
const e = Default.getFixedDecimalPlacesValue(r, t.maximumDecimalPlaces);
i = t.showValueColors ? "decimal" : "";
s = DomElement.createWithHTML(l, "span", i, e);
c = "decimal";
if (Is.definedFunction(t.events.onDecimalRender)) {
fireCustomTriggerEvent(t.events.onDecimalRender, s);
Trigger.customEvent(t.events.onDecimalRender, s);
}
createComma(t, a, o);
createComma(t, l, o);
} else {

@@ -464,9 +661,9 @@ u = true;

if (!t.ignore.numberValues) {
l = t.showValueColors ? "number" : "";
s = DomElement.createWithHTML(a, "span", l, r);
i = t.showValueColors ? "number" : "";
s = DomElement.createWithHTML(l, "span", i, r);
c = "number";
if (Is.definedFunction(t.events.onNumberRender)) {
fireCustomTriggerEvent(t.events.onNumberRender, s);
Trigger.customEvent(t.events.onNumberRender, s);
}
createComma(t, a, o);
createComma(t, l, o);
} else {

@@ -482,8 +679,8 @@ u = true;

if (t.maximumStringLength > 0 && r.length > t.maximumStringLength) {
r = r.substring(0, t.maximumStringLength) + _configuration.ellipsisText;
r = r.substring(0, t.maximumStringLength) + _configuration.text.ellipsisText;
}
}
const n = t.showStringQuotes ? '"' + r + '"' : r;
l = t.showValueColors ? "string" : "";
s = DomElement.createWithHTML(a, "span", l, n);
const n = t.showStringQuotes ? `"${r}"` : r;
i = t.showValueColors ? "string" : "";
s = DomElement.createWithHTML(l, "span", i, n);
c = "string";

@@ -494,5 +691,5 @@ if (Is.definedString(e)) {

if (Is.definedFunction(t.events.onStringRender)) {
fireCustomTriggerEvent(t.events.onStringRender, s);
Trigger.customEvent(t.events.onStringRender, s);
}
createComma(t, a, o);
createComma(t, l, o);
} else {

@@ -503,9 +700,9 @@ u = true;

if (!t.ignore.dateValues) {
l = t.showValueColors ? "date" : "";
s = DomElement.createWithHTML(a, "span", l, DateTime.getCustomFormattedDateText(_configuration, r, t.dateTimeFormat));
i = t.showValueColors ? "date" : "";
s = DomElement.createWithHTML(l, "span", i, DateTime.getCustomFormattedDateText(_configuration, r, t.dateTimeFormat));
c = "date";
if (Is.definedFunction(t.events.onDateRender)) {
fireCustomTriggerEvent(t.events.onDateRender, s);
Trigger.customEvent(t.events.onDateRender, s);
}
createComma(t, a, o);
createComma(t, l, o);
} else {

@@ -516,8 +713,8 @@ u = true;

if (!t.ignore.objectValues) {
const e = DomElement.create(a, "span", t.showValueColors ? "object" : "");
const n = DomElement.create(a, "div", "object-type-contents");
const l = renderObjectValues(i, n, t, r);
DomElement.createWithHTML(e, "span", "title", _configuration.objectText);
if (t.showCounts && l > 0) {
DomElement.createWithHTML(e, "span", "count", "{" + l + "}");
const e = DomElement.create(l, "span", t.showValueColors ? "object" : "");
const n = DomElement.create(l, "div", "object-type-contents");
const i = renderObjectValues(a, n, t, r);
DomElement.createWithHTML(e, "span", "title", _configuration.text.objectText);
if (t.showCounts && i > 0) {
DomElement.createWithHTML(e, "span", "count", `{${i}}`);
}

@@ -531,10 +728,10 @@ createComma(t, e, o);

if (!t.ignore.arrayValues) {
const e = DomElement.create(a, "span", t.showValueColors ? "array" : "");
const n = DomElement.create(a, "div", "object-type-contents");
DomElement.createWithHTML(e, "span", "title", _configuration.arrayText);
const e = DomElement.create(l, "span", t.showValueColors ? "array" : "");
const n = DomElement.create(l, "div", "object-type-contents");
DomElement.createWithHTML(e, "span", "title", _configuration.text.arrayText);
if (t.showCounts) {
DomElement.createWithHTML(e, "span", "count", "[" + r.length + "]");
DomElement.createWithHTML(e, "span", "count", `[${r.length}]`);
}
createComma(t, e, o);
renderArrayValues(i, n, t, r);
renderArrayValues(a, n, t, r);
c = "array";

@@ -546,9 +743,9 @@ } else {

if (!t.ignore.unknownValues) {
l = t.showValueColors ? "unknown" : "";
s = DomElement.createWithHTML(a, "span", l, r.toString());
i = t.showValueColors ? "unknown" : "";
s = DomElement.createWithHTML(l, "span", i, r.toString());
c = "unknown";
if (Is.definedFunction(t.events.onUnknownRender)) {
fireCustomTriggerEvent(t.events.onUnknownRender, s);
Trigger.customEvent(t.events.onUnknownRender, s);
}
createComma(t, a, o);
createComma(t, l, o);
} else {

@@ -559,6 +756,6 @@ u = true;

if (u) {
e.removeChild(a);
e.removeChild(l);
} else {
if (Is.defined(s)) {
addValueClickEvent(t, s, r, c, f);
addValueClickEvent(t, s, r, c, d);
}

@@ -570,3 +767,3 @@ }

t.onclick = () => {
fireCustomTriggerEvent(e.events.onValueClick, n, r);
Trigger.customEvent(e.events.onValueClick, n, r);
};

@@ -596,14 +793,2 @@ } else {

}
function getFunctionName(e) {
let t;
const n = e.toString().split("(");
const r = n[0].split(" ");
if (r.length === 2) {
t = r[1];
} else {
t = r[0];
}
t += "()";
return t;
}
function createComma(e, t, n) {

@@ -617,76 +802,6 @@ if (e.showCommas && !n) {

if (!e.addArrayIndexPadding) {
r = Data.String.padNumber(parseInt(r), n.toString().length);
r = Str.padNumber(parseInt(r), n.toString().length);
}
return r;
return `[${r}]`;
}
function buildAttributeOptions(e) {
let t = Data.getDefaultObject(e, {});
t.data = Data.getDefaultObject(t.data, null);
t.showCounts = Data.getDefaultBoolean(t.showCounts, true);
t.useZeroIndexingForArrays = Data.getDefaultBoolean(t.useZeroIndexingForArrays, true);
t.dateTimeFormat = Data.getDefaultString(t.dateTimeFormat, "{dd}{o} {mmmm} {yyyy} {hh}:{MM}:{ss}");
t.showArrowToggles = Data.getDefaultBoolean(t.showArrowToggles, true);
t.showStringQuotes = Data.getDefaultBoolean(t.showStringQuotes, true);
t.showAllAsClosed = Data.getDefaultBoolean(t.showAllAsClosed, false);
t.sortPropertyNames = Data.getDefaultBoolean(t.sortPropertyNames, true);
t.sortPropertyNamesInAlphabeticalOrder = Data.getDefaultBoolean(t.sortPropertyNamesInAlphabeticalOrder, true);
t.showCommas = Data.getDefaultBoolean(t.showCommas, false);
t.reverseArrayValues = Data.getDefaultBoolean(t.reverseArrayValues, false);
t.addArrayIndexPadding = Data.getDefaultBoolean(t.addArrayIndexPadding, false);
t.showValueColors = Data.getDefaultBoolean(t.showValueColors, true);
t.maximumDecimalPlaces = Data.getDefaultNumber(t.maximumDecimalPlaces, 2);
t.maximumStringLength = Data.getDefaultNumber(t.maximumStringLength, 0);
t.showStringHexColors = Data.getDefaultBoolean(t.showStringHexColors, false);
t = buildAttributeOptionTitle(t);
t = buildAttributeOptionIgnore(t);
t = buildAttributeOptionCustomTriggers(t);
return t;
}
function buildAttributeOptionTitle(e) {
e.title = Data.getDefaultObject(e.title, {});
e.title.text = Data.getDefaultString(e.title.text, "JsonTree.js");
e.title.show = Data.getDefaultBoolean(e.title.show, true);
e.title.showTreeControls = Data.getDefaultBoolean(e.title.showTreeControls, true);
e.title.showCopyButton = Data.getDefaultBoolean(e.title.showCopyButton, false);
return e;
}
function buildAttributeOptionIgnore(e) {
e.ignore = Data.getDefaultObject(e.ignore, {});
e.ignore.nullValues = Data.getDefaultBoolean(e.ignore.nullValues, false);
e.ignore.functionValues = Data.getDefaultBoolean(e.ignore.functionValues, false);
e.ignore.unknownValues = Data.getDefaultBoolean(e.ignore.unknownValues, false);
e.ignore.booleanValues = Data.getDefaultBoolean(e.ignore.booleanValues, false);
e.ignore.decimalValues = Data.getDefaultBoolean(e.ignore.decimalValues, false);
e.ignore.numberValues = Data.getDefaultBoolean(e.ignore.numberValues, false);
e.ignore.stringValues = Data.getDefaultBoolean(e.ignore.stringValues, false);
e.ignore.dateValues = Data.getDefaultBoolean(e.ignore.dateValues, false);
e.ignore.objectValues = Data.getDefaultBoolean(e.ignore.objectValues, false);
e.ignore.arrayValues = Data.getDefaultBoolean(e.ignore.arrayValues, false);
return e;
}
function buildAttributeOptionCustomTriggers(e) {
e.events = Data.getDefaultObject(e.events, {});
e.events.onBeforeRender = Data.getDefaultFunction(e.events.onBeforeRender, null);
e.events.onRenderComplete = Data.getDefaultFunction(e.events.onRenderComplete, null);
e.events.onValueClick = Data.getDefaultFunction(e.events.onValueClick, null);
e.events.onRefresh = Data.getDefaultFunction(e.events.onRefresh, null);
e.events.onCopyAll = Data.getDefaultFunction(e.events.onCopyAll, null);
e.events.onOpenAll = Data.getDefaultFunction(e.events.onOpenAll, null);
e.events.onCloseAll = Data.getDefaultFunction(e.events.onCloseAll, null);
e.events.onDestroy = Data.getDefaultFunction(e.events.onDestroy, null);
e.events.onBooleanRender = Data.getDefaultFunction(e.events.onBooleanRender, null);
e.events.onDecimalRender = Data.getDefaultFunction(e.events.onDecimalRender, null);
e.events.onNumberRender = Data.getDefaultFunction(e.events.onNumberRender, null);
e.events.onStringRender = Data.getDefaultFunction(e.events.onStringRender, null);
e.events.onDateRender = Data.getDefaultFunction(e.events.onDateRender, null);
e.events.onFunctionRender = Data.getDefaultFunction(e.events.onFunctionRender, null);
e.events.onNullRender = Data.getDefaultFunction(e.events.onNullRender, null);
e.events.onUnknownRender = Data.getDefaultFunction(e.events.onUnknownRender, null);
return e;
}
function fireCustomTriggerEvent(e, ...t) {
if (Is.definedFunction(e)) {
e.apply(null, [].slice.call(t, 0));
}
}
function getObjectFromString(objectString) {

@@ -703,3 +818,3 @@ const result = {

try {
result.object = eval("(" + objectString + ")");
result.object = eval(`(${objectString})`);
if (Is.definedFunction(result.object)) {

@@ -710,3 +825,3 @@ result.object = result.object();

if (!_configuration.safeMode) {
console.error(_configuration.objectErrorText.replace("{{error_1}}", e1.message).replace("{{error_2}}", e.message));
console.error(_configuration.text.objectErrorText.replace("{{error_1}}", e1.message).replace("{{error_2}}", e.message));
result.parsed = false;

@@ -722,37 +837,4 @@ }

e._currentView.element.className = "";
fireCustomTriggerEvent(e.events.onDestroy, e._currentView.element);
Trigger.customEvent(e.events.onDestroy, e._currentView.element);
}
function buildDefaultConfiguration(e = null) {
_configuration = Data.getDefaultObject(e, {});
_configuration.safeMode = Data.getDefaultBoolean(_configuration.safeMode, true);
_configuration.domElementTypes = Data.getDefaultStringOrArray(_configuration.domElementTypes, [ "*" ]);
buildDefaultConfigurationStrings();
}
function buildDefaultConfigurationStrings() {
_configuration.objectText = Data.getDefaultAnyString(_configuration.objectText, "object");
_configuration.arrayText = Data.getDefaultAnyString(_configuration.arrayText, "array");
_configuration.closeAllButtonText = Data.getDefaultAnyString(_configuration.closeAllButtonText, "Close All");
_configuration.openAllButtonText = Data.getDefaultAnyString(_configuration.openAllButtonText, "Open All");
_configuration.copyAllButtonText = Data.getDefaultAnyString(_configuration.copyAllButtonText, "Copy All");
_configuration.objectErrorText = Data.getDefaultAnyString(_configuration.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}");
_configuration.attributeNotValidErrorText = Data.getDefaultAnyString(_configuration.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object.");
_configuration.attributeNotSetErrorText = Data.getDefaultAnyString(_configuration.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly.");
_configuration.stText = Data.getDefaultAnyString(_configuration.stText, "st");
_configuration.ndText = Data.getDefaultAnyString(_configuration.ndText, "nd");
_configuration.rdText = Data.getDefaultAnyString(_configuration.rdText, "rd");
_configuration.thText = Data.getDefaultAnyString(_configuration.thText, "th");
_configuration.ellipsisText = Data.getDefaultAnyString(_configuration.ellipsisText, "...");
if (Is.invalidOptionArray(_configuration.dayNames, 7)) {
_configuration.dayNames = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ];
}
if (Is.invalidOptionArray(_configuration.dayNamesAbbreviated, 7)) {
_configuration.dayNamesAbbreviated = [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ];
}
if (Is.invalidOptionArray(_configuration.monthNames, 12)) {
_configuration.monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
}
if (Is.invalidOptionArray(_configuration.monthNamesAbbreviated, 12)) {
_configuration.monthNamesAbbreviated = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
}
}
const _public = {

@@ -763,3 +845,3 @@ refresh: function(e) {

renderControlContainer(t);
fireCustomTriggerEvent(t.events.onRefresh, t._currentView.element);
Trigger.customEvent(t.events.onRefresh, t._currentView.element);
}

@@ -773,3 +855,3 @@ return _public;

renderControlContainer(t);
fireCustomTriggerEvent(t.events.onRefresh, t._currentView.element);
Trigger.customEvent(t.events.onRefresh, t._currentView.element);
}

@@ -781,3 +863,3 @@ }

if (Is.definedObject(e) && Is.definedObject(t)) {
renderControl(renderBindingOptions(t, e));
renderControl(Binding.Options.getForNewInstance(t, e));
}

@@ -829,3 +911,3 @@ return _public;

if (t) {
buildDefaultConfiguration(n);
_configuration = Config.Options.get(n);
}

@@ -845,7 +927,7 @@ }

getVersion: function() {
return "2.0.0";
return "2.1.0";
}
};
(() => {
buildDefaultConfiguration();
_configuration = Config.Options.get();
document.addEventListener("DOMContentLoaded", (function() {

@@ -852,0 +934,0 @@ render();

@@ -1,1 +0,1 @@

"use strict";var Is,Data,DomElement,DateTime,Constants;(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}function o(e){return n(e)&&e instanceof Array}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=o,e.definedDate=function(e){return n(e)&&e instanceof Date},e.definedDecimal=function(e){return t(e)&&"number"==typeof e&&e%1!=0},e.invalidOptionArray=function(e,t=1){return!o(e)||e.length<t},e.hexColor=function(e){let t=e.length>=2&&e.length<=7;return t&&"#"===e[0]&&(t=isNaN(+e.substring(1,e.length-1))),t}})(Is||(Is={})),(e=>{let t;var n;function o(e,t){return Is.definedArray(e)?e:t}(n=t=e.String||(e.String={})).newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},n.padNumber=function(e,t=1){const n=e.toString();let o=n;if(n.length<t){const e=t-n.length+1;o=Array(e).join("0")+n}return o},e.getDefaultAnyString=function(e,t){return"string"==typeof e?e:t},e.getDefaultString=function(e,t){return Is.definedString(e)?e:t},e.getDefaultBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getDefaultNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getDefaultFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getDefaultArray=o,e.getDefaultObject=function(e,t){return Is.definedObject(e)?e:t},e.getDefaultStringOrArray=function(e,t){let n=t;if(Is.definedString(e)){const o=e.toString().split(" ");0===o.length?e=t:n=o}else n=o(e,t);return n},e.getFixedDecimalPlacesValue=function(e,t){var n;const o=new RegExp("^-?\\d+(?:.\\d{0,"+(t||-1)+"})?");return(null==(n=e.toString().match(o))?void 0:n[0])||""}})(Data||(Data={})),(e=>{function t(e,t,n="",o=null){const r=t.toLowerCase();let a="text"===r?document.createTextNode(""):document.createElement(r);return Is.defined(n)&&(a.className=n),Is.defined(o)?e.insertBefore(a,o):e.appendChild(a),a}e.create=t,e.createWithHTML=function(e,n,o,r,a=null){const i=t(e,n,o,a);return i.innerHTML=r,i},e.addClass=function(e,t){e.classList.add(t)}})(DomElement||(DomElement={})),(e=>{function t(e){return e.getDay()-1<0?6:e.getDay()-1}function n(e,t){let n=e.thText;return 31===t||21===t||1===t?n=e.stText:22===t||2===t?n=e.ndText:23!==t&&3!==t||(n=e.rdText),n}e.getWeekdayNumber=t,e.getDayOrdinal=n,e.getCustomFormattedDateText=function(e,o,r){let a=r;const i=t(o);return a=a.replace("{hh}",Data.String.padNumber(o.getHours(),2)),a=a.replace("{h}",o.getHours().toString()),a=a.replace("{MM}",Data.String.padNumber(o.getMinutes(),2)),a=a.replace("{M}",o.getMinutes().toString()),a=a.replace("{ss}",Data.String.padNumber(o.getSeconds(),2)),a=a.replace("{s}",o.getSeconds().toString()),a=a.replace("{dddd}",e.dayNames[i]),a=a.replace("{ddd}",e.dayNamesAbbreviated[i]),a=a.replace("{dd}",Data.String.padNumber(o.getDate())),a=a.replace("{d}",o.getDate().toString()),a=a.replace("{o}",n(e,o.getDate())),a=a.replace("{mmmm}",e.monthNames[o.getMonth()]),a=a.replace("{mmm}",e.monthNamesAbbreviated[o.getMonth()]),a=a.replace("{mm}",Data.String.padNumber(o.getMonth()+1)),a=a.replace("{m}",(o.getMonth()+1).toString()),a=a.replace("{yyyy}",o.getFullYear().toString()),a=a.replace("{yyy}",o.getFullYear().toString().substring(1)),a=a.replace("{yy}",o.getFullYear().toString().substring(2)),a=a.replace("{y}",Number.parseInt(o.getFullYear().toString().substring(2)).toString()),a}})(DateTime||(DateTime={})),(Constants||(Constants={})).JSONTREE_JS_ATTRIBUTE_NAME="data-jsontree-js",(()=>{let _configuration={},_elements_Data={};function render(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n<t;n++){const t=document.getElementsByTagName(e[n]),o=[].slice.call(t),r=o.length;for(let e=0;e<r&&renderElement(o[e]);e++);}}function renderElement(e){let t=!0;if(Is.defined(e)&&e.hasAttribute(Constants.JSONTREE_JS_ATTRIBUTE_NAME)){const n=e.getAttribute(Constants.JSONTREE_JS_ATTRIBUTE_NAME);if(Is.definedString(n)){const o=getObjectFromString(n);o.parsed&&Is.definedObject(o.object)?renderControl(renderBindingOptions(o.object,e)):_configuration.safeMode||(console.error(_configuration.attributeNotValidErrorText.replace("{{attribute_name}}",Constants.JSONTREE_JS_ATTRIBUTE_NAME)),t=!1)}else _configuration.safeMode||(console.error(_configuration.attributeNotSetErrorText.replace("{{attribute_name}}",Constants.JSONTREE_JS_ATTRIBUTE_NAME)),t=!1)}return t}function renderBindingOptions(e,t){const n=buildAttributeOptions(e);return n._currentView={},n._currentView.element=t,n}function renderControl(e){fireCustomTriggerEvent(e.events.onBeforeRender,e._currentView.element),Is.definedString(e._currentView.element.id)||(e._currentView.element.id=Data.String.newGuid()),e._currentView.element.className="json-tree-js",e._currentView.element.removeAttribute(Constants.JSONTREE_JS_ATTRIBUTE_NAME),_elements_Data.hasOwnProperty(e._currentView.element.id)||(_elements_Data[e._currentView.element.id]=e),renderControlContainer(e),fireCustomTriggerEvent(e.events.onRenderComplete,e._currentView.element)}function renderControlContainer(e){const t=_elements_Data[e._currentView.element.id].data;e._currentView.element.innerHTML="",renderControlTitleBar(e),Is.definedObject(t)&&!Is.definedArray(t)?renderObject(e._currentView.element,e,t):Is.definedArray(t)&&renderArray(e._currentView.element,e,t)}function renderControlTitleBar(e){if(e.title.show||e.title.showTreeControls||e.title.showCopyButton){const t=DomElement.create(e._currentView.element,"div","title-bar"),n=DomElement.create(t,"div","controls");if(e.title.show&&DomElement.createWithHTML(t,"div","title",e.title.text,n),e.title.showCopyButton){DomElement.createWithHTML(n,"button","copy-all",_configuration.copyAllButtonText).onclick=()=>{const t=JSON.stringify(_elements_Data[e._currentView.element.id].data);navigator.clipboard.writeText(t),fireCustomTriggerEvent(e.events.onCopyAll,t)}}if(e.title.showTreeControls){const t=DomElement.createWithHTML(n,"button","openAll",_configuration.openAllButtonText),o=DomElement.createWithHTML(n,"button","closeAll",_configuration.closeAllButtonText);t.onclick=()=>{openAllNodes(e)},o.onclick=()=>{closeAllNodes(e)}}}}function openAllNodes(e){e.showAllAsClosed=!1,renderControlContainer(e),fireCustomTriggerEvent(e.events.onOpenAll,e._currentView.element)}function closeAllNodes(e){e.showAllAsClosed=!0,renderControlContainer(e),fireCustomTriggerEvent(e.events.onCloseAll,e._currentView.element)}function renderObject(e,t,n){const o=DomElement.create(e,"div","object-type-title"),r=DomElement.create(e,"div","object-type-contents"),a=renderObjectValues(t.showArrowToggles?DomElement.create(o,"div","down-arrow"):null,r,t,n);DomElement.createWithHTML(o,"span",t.showValueColors?"object":"",_configuration.objectText),t.showCounts&&a>0&&DomElement.createWithHTML(o,"span",t.showValueColors?"object count":"count","{"+a+"}")}function renderArray(e,t,n){const o=DomElement.create(e,"div","object-type-title"),r=DomElement.create(e,"div","object-type-contents"),a=t.showArrowToggles?DomElement.create(o,"div","down-arrow"):null;DomElement.createWithHTML(o,"span",t.showValueColors?"array":"",_configuration.arrayText),renderArrayValues(a,r,t,n),t.showCounts&&DomElement.createWithHTML(o,"span",t.showValueColors?"array count":"count","["+n.length+"]")}function renderObjectValues(e,t,n,o){let r=0,a=[];for(let e in o)o.hasOwnProperty(e)&&a.push(e);n.sortPropertyNames&&(a=a.sort(),n.sortPropertyNamesInAlphabeticalOrder||(a=a.reverse()));const i=a.length;for(let e=0;e<i;e++){const l=a[e];o.hasOwnProperty(l)&&(renderValue(t,n,l,o[l],e===i-1),r++)}return addArrowEvent(n,e,t),r}function renderArrayValues(e,t,n,o){const r=o.length;if(n.reverseArrayValues)for(let e=r;e--;)renderValue(t,n,getIndexName(n,e,r),o[e],0===e);else for(let e=0;e<r;e++)renderValue(t,n,getIndexName(n,e,r),o[e],e===r-1);addArrowEvent(n,e,t)}function renderValue(e,t,n,o,r){const a=DomElement.create(e,"div","object-type-value"),i=t.showArrowToggles?DomElement.create(a,"div","no-arrow"):null;let l=null,s=null,u=!1,c=null,d=!0;if(DomElement.createWithHTML(a,"span","title",n),DomElement.createWithHTML(a,"span","split",":"),Is.defined(o))if(Is.definedFunction(o))t.ignore.functionValues?u=!0:(l=t.showValueColors?"function":"",s=DomElement.createWithHTML(a,"span",l,getFunctionName(o)),c="function",Is.definedFunction(t.events.onFunctionRender)&&fireCustomTriggerEvent(t.events.onFunctionRender,s),createComma(t,a,r));else if(Is.definedBoolean(o))t.ignore.booleanValues?u=!0:(l=t.showValueColors?"boolean":"",s=DomElement.createWithHTML(a,"span",l,o),c="boolean",Is.definedFunction(t.events.onBooleanRender)&&fireCustomTriggerEvent(t.events.onBooleanRender,s),createComma(t,a,r));else if(Is.definedDecimal(o))if(t.ignore.decimalValues)u=!0;else{const e=Data.getFixedDecimalPlacesValue(o,t.maximumDecimalPlaces);l=t.showValueColors?"decimal":"",s=DomElement.createWithHTML(a,"span",l,e),c="decimal",Is.definedFunction(t.events.onDecimalRender)&&fireCustomTriggerEvent(t.events.onDecimalRender,s),createComma(t,a,r)}else if(Is.definedNumber(o))t.ignore.numberValues?u=!0:(l=t.showValueColors?"number":"",s=DomElement.createWithHTML(a,"span",l,o),c="number",Is.definedFunction(t.events.onNumberRender)&&fireCustomTriggerEvent(t.events.onNumberRender,s),createComma(t,a,r));else if(Is.definedString(o))if(t.ignore.stringValues)u=!0;else{let e=null;t.showValueColors&&t.showStringHexColors&&Is.hexColor(o)?e=o:t.maximumStringLength>0&&o.length>t.maximumStringLength&&(o=o.substring(0,t.maximumStringLength)+_configuration.ellipsisText);const n=t.showStringQuotes?'"'+o+'"':o;l=t.showValueColors?"string":"",s=DomElement.createWithHTML(a,"span",l,n),c="string",Is.definedString(e)&&(s.style.color=e),Is.definedFunction(t.events.onStringRender)&&fireCustomTriggerEvent(t.events.onStringRender,s),createComma(t,a,r)}else if(Is.definedDate(o))t.ignore.dateValues?u=!0:(l=t.showValueColors?"date":"",s=DomElement.createWithHTML(a,"span",l,DateTime.getCustomFormattedDateText(_configuration,o,t.dateTimeFormat)),c="date",Is.definedFunction(t.events.onDateRender)&&fireCustomTriggerEvent(t.events.onDateRender,s),createComma(t,a,r));else if(Is.definedObject(o)&&!Is.definedArray(o))if(t.ignore.objectValues)u=!0;else{const e=DomElement.create(a,"span",t.showValueColors?"object":""),n=renderObjectValues(i,DomElement.create(a,"div","object-type-contents"),t,o);DomElement.createWithHTML(e,"span","title",_configuration.objectText),t.showCounts&&n>0&&DomElement.createWithHTML(e,"span","count","{"+n+"}"),createComma(t,e,r),c="object"}else if(Is.definedArray(o))if(t.ignore.arrayValues)u=!0;else{const e=DomElement.create(a,"span",t.showValueColors?"array":""),n=DomElement.create(a,"div","object-type-contents");DomElement.createWithHTML(e,"span","title",_configuration.arrayText),t.showCounts&&DomElement.createWithHTML(e,"span","count","["+o.length+"]"),createComma(t,e,r),renderArrayValues(i,n,t,o),c="array"}else t.ignore.unknownValues?u=!0:(l=t.showValueColors?"unknown":"",s=DomElement.createWithHTML(a,"span",l,o.toString()),c="unknown",Is.definedFunction(t.events.onUnknownRender)&&fireCustomTriggerEvent(t.events.onUnknownRender,s),createComma(t,a,r));else t.ignore.nullValues?u=!0:(l=t.showValueColors?"null":"",s=DomElement.createWithHTML(a,"span",l,"null"),d=!1,Is.definedFunction(t.events.onNullRender)&&fireCustomTriggerEvent(t.events.onNullRender,s),createComma(t,a,r));u?e.removeChild(a):Is.defined(s)&&addValueClickEvent(t,s,o,c,d)}function addValueClickEvent(e,t,n,o,r){r&&Is.definedFunction(e.events.onValueClick)?t.onclick=()=>{fireCustomTriggerEvent(e.events.onValueClick,n,o)}:DomElement.addClass(t,"no-hover")}function addArrowEvent(e,t,n){Is.defined(t)&&(t.onclick=()=>{"down-arrow"===t.className?(n.style.display="none",t.className="right-arrow"):(n.style.display="block",t.className="down-arrow")},e.showAllAsClosed?(n.style.display="none",t.className="right-arrow"):t.className="down-arrow")}function getFunctionName(e){let t;const n=e.toString().split("(")[0].split(" ");return t=2===n.length?n[1]:n[0],t+="()",t}function createComma(e,t,n){e.showCommas&&!n&&DomElement.createWithHTML(t,"span","comma",",")}function getIndexName(e,t,n){let o=e.useZeroIndexingForArrays?t.toString():(t+1).toString();return e.addArrayIndexPadding||(o=Data.String.padNumber(parseInt(o),n.toString().length)),o}function buildAttributeOptions(e){let t=Data.getDefaultObject(e,{});return t.data=Data.getDefaultObject(t.data,null),t.showCounts=Data.getDefaultBoolean(t.showCounts,!0),t.useZeroIndexingForArrays=Data.getDefaultBoolean(t.useZeroIndexingForArrays,!0),t.dateTimeFormat=Data.getDefaultString(t.dateTimeFormat,"{dd}{o} {mmmm} {yyyy} {hh}:{MM}:{ss}"),t.showArrowToggles=Data.getDefaultBoolean(t.showArrowToggles,!0),t.showStringQuotes=Data.getDefaultBoolean(t.showStringQuotes,!0),t.showAllAsClosed=Data.getDefaultBoolean(t.showAllAsClosed,!1),t.sortPropertyNames=Data.getDefaultBoolean(t.sortPropertyNames,!0),t.sortPropertyNamesInAlphabeticalOrder=Data.getDefaultBoolean(t.sortPropertyNamesInAlphabeticalOrder,!0),t.showCommas=Data.getDefaultBoolean(t.showCommas,!1),t.reverseArrayValues=Data.getDefaultBoolean(t.reverseArrayValues,!1),t.addArrayIndexPadding=Data.getDefaultBoolean(t.addArrayIndexPadding,!1),t.showValueColors=Data.getDefaultBoolean(t.showValueColors,!0),t.maximumDecimalPlaces=Data.getDefaultNumber(t.maximumDecimalPlaces,2),t.maximumStringLength=Data.getDefaultNumber(t.maximumStringLength,0),t.showStringHexColors=Data.getDefaultBoolean(t.showStringHexColors,!1),t=buildAttributeOptionTitle(t),t=buildAttributeOptionIgnore(t),t=buildAttributeOptionCustomTriggers(t),t}function buildAttributeOptionTitle(e){return e.title=Data.getDefaultObject(e.title,{}),e.title.text=Data.getDefaultString(e.title.text,"JsonTree.js"),e.title.show=Data.getDefaultBoolean(e.title.show,!0),e.title.showTreeControls=Data.getDefaultBoolean(e.title.showTreeControls,!0),e.title.showCopyButton=Data.getDefaultBoolean(e.title.showCopyButton,!1),e}function buildAttributeOptionIgnore(e){return e.ignore=Data.getDefaultObject(e.ignore,{}),e.ignore.nullValues=Data.getDefaultBoolean(e.ignore.nullValues,!1),e.ignore.functionValues=Data.getDefaultBoolean(e.ignore.functionValues,!1),e.ignore.unknownValues=Data.getDefaultBoolean(e.ignore.unknownValues,!1),e.ignore.booleanValues=Data.getDefaultBoolean(e.ignore.booleanValues,!1),e.ignore.decimalValues=Data.getDefaultBoolean(e.ignore.decimalValues,!1),e.ignore.numberValues=Data.getDefaultBoolean(e.ignore.numberValues,!1),e.ignore.stringValues=Data.getDefaultBoolean(e.ignore.stringValues,!1),e.ignore.dateValues=Data.getDefaultBoolean(e.ignore.dateValues,!1),e.ignore.objectValues=Data.getDefaultBoolean(e.ignore.objectValues,!1),e.ignore.arrayValues=Data.getDefaultBoolean(e.ignore.arrayValues,!1),e}function buildAttributeOptionCustomTriggers(e){return e.events=Data.getDefaultObject(e.events,{}),e.events.onBeforeRender=Data.getDefaultFunction(e.events.onBeforeRender,null),e.events.onRenderComplete=Data.getDefaultFunction(e.events.onRenderComplete,null),e.events.onValueClick=Data.getDefaultFunction(e.events.onValueClick,null),e.events.onRefresh=Data.getDefaultFunction(e.events.onRefresh,null),e.events.onCopyAll=Data.getDefaultFunction(e.events.onCopyAll,null),e.events.onOpenAll=Data.getDefaultFunction(e.events.onOpenAll,null),e.events.onCloseAll=Data.getDefaultFunction(e.events.onCloseAll,null),e.events.onDestroy=Data.getDefaultFunction(e.events.onDestroy,null),e.events.onBooleanRender=Data.getDefaultFunction(e.events.onBooleanRender,null),e.events.onDecimalRender=Data.getDefaultFunction(e.events.onDecimalRender,null),e.events.onNumberRender=Data.getDefaultFunction(e.events.onNumberRender,null),e.events.onStringRender=Data.getDefaultFunction(e.events.onStringRender,null),e.events.onDateRender=Data.getDefaultFunction(e.events.onDateRender,null),e.events.onFunctionRender=Data.getDefaultFunction(e.events.onFunctionRender,null),e.events.onNullRender=Data.getDefaultFunction(e.events.onNullRender,null),e.events.onUnknownRender=Data.getDefaultFunction(e.events.onUnknownRender,null),e}function fireCustomTriggerEvent(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval("("+objectString+")"),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(console.error(_configuration.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function destroyElement(e){e._currentView.element.innerHTML="",e._currentView.element.className="",fireCustomTriggerEvent(e.events.onDestroy,e._currentView.element)}function buildDefaultConfiguration(e=null){_configuration=Data.getDefaultObject(e,{}),_configuration.safeMode=Data.getDefaultBoolean(_configuration.safeMode,!0),_configuration.domElementTypes=Data.getDefaultStringOrArray(_configuration.domElementTypes,["*"]),buildDefaultConfigurationStrings()}function buildDefaultConfigurationStrings(){_configuration.objectText=Data.getDefaultAnyString(_configuration.objectText,"object"),_configuration.arrayText=Data.getDefaultAnyString(_configuration.arrayText,"array"),_configuration.closeAllButtonText=Data.getDefaultAnyString(_configuration.closeAllButtonText,"Close All"),_configuration.openAllButtonText=Data.getDefaultAnyString(_configuration.openAllButtonText,"Open All"),_configuration.copyAllButtonText=Data.getDefaultAnyString(_configuration.copyAllButtonText,"Copy All"),_configuration.objectErrorText=Data.getDefaultAnyString(_configuration.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),_configuration.attributeNotValidErrorText=Data.getDefaultAnyString(_configuration.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),_configuration.attributeNotSetErrorText=Data.getDefaultAnyString(_configuration.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly."),_configuration.stText=Data.getDefaultAnyString(_configuration.stText,"st"),_configuration.ndText=Data.getDefaultAnyString(_configuration.ndText,"nd"),_configuration.rdText=Data.getDefaultAnyString(_configuration.rdText,"rd"),_configuration.thText=Data.getDefaultAnyString(_configuration.thText,"th"),_configuration.ellipsisText=Data.getDefaultAnyString(_configuration.ellipsisText,"..."),Is.invalidOptionArray(_configuration.dayNames,7)&&(_configuration.dayNames=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]),Is.invalidOptionArray(_configuration.dayNamesAbbreviated,7)&&(_configuration.dayNamesAbbreviated=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]),Is.invalidOptionArray(_configuration.monthNames,12)&&(_configuration.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"]),Is.invalidOptionArray(_configuration.monthNamesAbbreviated,12)&&(_configuration.monthNamesAbbreviated=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"])}const _public={refresh:function(e){if(Is.definedString(e)&&_elements_Data.hasOwnProperty(e)){const t=_elements_Data[e];renderControlContainer(t),fireCustomTriggerEvent(t.events.onRefresh,t._currentView.element)}return _public},refreshAll:function(){for(let e in _elements_Data)if(_elements_Data.hasOwnProperty(e)){const t=_elements_Data[e];renderControlContainer(t),fireCustomTriggerEvent(t.events.onRefresh,t._currentView.element)}return _public},render:function(e,t){return Is.definedObject(e)&&Is.definedObject(t)&&renderControl(renderBindingOptions(t,e)),_public},renderAll:function(){return render(),_public},openAll:function(e){return Is.definedString(e)&&_elements_Data.hasOwnProperty(e)&&openAllNodes(_elements_Data[e]),_public},closeAll:function(e){return Is.definedString(e)&&_elements_Data.hasOwnProperty(e)&&closeAllNodes(_elements_Data[e]),_public},destroy:function(e){return Is.definedString(e)&&_elements_Data.hasOwnProperty(e)&&(destroyElement(_elements_Data[e]),delete _elements_Data[e]),_public},destroyAll:function(){for(let e in _elements_Data)_elements_Data.hasOwnProperty(e)&&destroyElement(_elements_Data[e]);return _elements_Data={},_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let o in e)e.hasOwnProperty(o)&&_configuration.hasOwnProperty(o)&&n[o]!==e[o]&&(n[o]=e[o],t=!0);t&&buildDefaultConfiguration(n)}return _public},getIds:function(){const e=[];for(let t in _elements_Data)_elements_Data.hasOwnProperty(t)&&e.push(t);return e},getVersion:function(){return"2.0.0"}};buildDefaultConfiguration(),document.addEventListener("DOMContentLoaded",(function(){render()})),Is.defined(window.$jsontree)||(window.$jsontree=_public)})();
"use strict";var Is,Default,DomElement,Str,Str2,DateTime,Constants,Binding,Config,Trigger;(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}function r(e){return n(e)&&e instanceof Array}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=r,e.definedDate=function(e){return n(e)&&e instanceof Date},e.definedDecimal=function(e){return t(e)&&"number"==typeof e&&e%1!=0},e.invalidOptionArray=function(e,t=1){return!r(e)||e.length<t},e.hexColor=function(e){let t=e.length>=2&&e.length<=7;return t&&"#"===e[0]&&(t=isNaN(+e.substring(1,e.length-1))),t}})(Is||(Is={})),(e=>{function t(e,t){return Is.definedArray(e)?e:t}e.getAnyString=function(e,t){return"string"==typeof e?e:t},e.getString=function(e,t){return Is.definedString(e)?e:t},e.getBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getArray=t,e.getObject=function(e,t){return Is.definedObject(e)?e:t},e.getStringOrArray=function(e,n){let r=n;if(Is.definedString(e)){const t=e.toString().split(" ");0===t.length?e=n:r=t}else r=t(e,n);return r},e.getFixedDecimalPlacesValue=function(e,t){var n;const r=new RegExp(`^-?\\d+(?:.\\d{0,${t||-1}})?`);return(null==(n=e.toString().match(r))?void 0:n[0])||""},e.getFunctionName=function(e){let t;const n=e.toString().split("(")[0].split(" ");return t=2===n.length?n[1]:n[0],t+="()",t}})(Default||(Default={})),(e=>{function t(e,t,n="",r=null){const o=t.toLowerCase();let l="text"===o?document.createTextNode(""):document.createElement(o);return Is.defined(n)&&(l.className=n),Is.defined(r)?e.insertBefore(l,r):e.appendChild(l),l}e.create=t,e.createWithHTML=function(e,n,r,o,l=null){const a=t(e,n,r,l);return a.innerHTML=o,a},e.addClass=function(e,t){e.classList.add(t)}})(DomElement||(DomElement={})),Str2=Str||(Str={}),Str2.newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},Str2.padNumber=function(e,t=1){const n=e.toString();let r=n;if(n.length<t){const e=t-n.length+1;r=Array(e).join("0")+n}return r},(e=>{function t(e){return e.getDay()-1<0?6:e.getDay()-1}function n(e,t){let n=e.text.thText;return 31===t||21===t||1===t?n=e.text.stText:22===t||2===t?n=e.text.ndText:23!==t&&3!==t||(n=e.text.rdText),n}e.getWeekdayNumber=t,e.getDayOrdinal=n,e.getCustomFormattedDateText=function(e,r,o){let l=o;const a=t(r);return l=l.replace("{hh}",Str.padNumber(r.getHours(),2)),l=l.replace("{h}",r.getHours().toString()),l=l.replace("{MM}",Str.padNumber(r.getMinutes(),2)),l=l.replace("{M}",r.getMinutes().toString()),l=l.replace("{ss}",Str.padNumber(r.getSeconds(),2)),l=l.replace("{s}",r.getSeconds().toString()),l=l.replace("{dddd}",e.text.dayNames[a]),l=l.replace("{ddd}",e.text.dayNamesAbbreviated[a]),l=l.replace("{dd}",Str.padNumber(r.getDate())),l=l.replace("{d}",r.getDate().toString()),l=l.replace("{o}",n(e,r.getDate())),l=l.replace("{mmmm}",e.text.monthNames[r.getMonth()]),l=l.replace("{mmm}",e.text.monthNamesAbbreviated[r.getMonth()]),l=l.replace("{mm}",Str.padNumber(r.getMonth()+1)),l=l.replace("{m}",(r.getMonth()+1).toString()),l=l.replace("{yyyy}",r.getFullYear().toString()),l=l.replace("{yyy}",r.getFullYear().toString().substring(1)),l=l.replace("{yy}",r.getFullYear().toString().substring(2)),l=l.replace("{y}",Number.parseInt(r.getFullYear().toString().substring(2)).toString()),l}})(DateTime||(DateTime={})),(Constants||(Constants={})).JSONTREE_JS_ATTRIBUTE_NAME="data-jsontree-js",(e=>{let t;var n;(n=t=e.Options||(e.Options={})).getForNewInstance=function(t,n){const r=e.Options.get(t);return r._currentView={},r._currentView.element=n,r._currentView.dataArrayCurrentIndex=0,r},n.get=function(e){let t=Default.getObject(e,{});return t.data=Default.getObject(t.data,null),t.showCounts=Default.getBoolean(t.showCounts,!0),t.useZeroIndexingForArrays=Default.getBoolean(t.useZeroIndexingForArrays,!0),t.dateTimeFormat=Default.getString(t.dateTimeFormat,"{dd}{o} {mmmm} {yyyy} {hh}:{MM}:{ss}"),t.showArrowToggles=Default.getBoolean(t.showArrowToggles,!0),t.showStringQuotes=Default.getBoolean(t.showStringQuotes,!0),t.showAllAsClosed=Default.getBoolean(t.showAllAsClosed,!1),t.sortPropertyNames=Default.getBoolean(t.sortPropertyNames,!0),t.sortPropertyNamesInAlphabeticalOrder=Default.getBoolean(t.sortPropertyNamesInAlphabeticalOrder,!0),t.showCommas=Default.getBoolean(t.showCommas,!1),t.reverseArrayValues=Default.getBoolean(t.reverseArrayValues,!1),t.addArrayIndexPadding=Default.getBoolean(t.addArrayIndexPadding,!1),t.showValueColors=Default.getBoolean(t.showValueColors,!0),t.maximumDecimalPlaces=Default.getNumber(t.maximumDecimalPlaces,2),t.maximumStringLength=Default.getNumber(t.maximumStringLength,0),t.showStringHexColors=Default.getBoolean(t.showStringHexColors,!1),t.showArrayItemsAsSeparateObjects=Default.getBoolean(t.showArrayItemsAsSeparateObjects,!1),t.copyOnlyCurrentPage=Default.getBoolean(t.copyOnlyCurrentPage,!1),t=function(e){return e.title=Default.getObject(e.title,{}),e.title.text=Default.getString(e.title.text,"JsonTree.js"),e.title.show=Default.getBoolean(e.title.show,!0),e.title.showTreeControls=Default.getBoolean(e.title.showTreeControls,!0),e.title.showCopyButton=Default.getBoolean(e.title.showCopyButton,!0),e}(t),t=function(e){return e.ignore=Default.getObject(e.ignore,{}),e.ignore.nullValues=Default.getBoolean(e.ignore.nullValues,!1),e.ignore.functionValues=Default.getBoolean(e.ignore.functionValues,!1),e.ignore.unknownValues=Default.getBoolean(e.ignore.unknownValues,!1),e.ignore.booleanValues=Default.getBoolean(e.ignore.booleanValues,!1),e.ignore.decimalValues=Default.getBoolean(e.ignore.decimalValues,!1),e.ignore.numberValues=Default.getBoolean(e.ignore.numberValues,!1),e.ignore.stringValues=Default.getBoolean(e.ignore.stringValues,!1),e.ignore.dateValues=Default.getBoolean(e.ignore.dateValues,!1),e.ignore.objectValues=Default.getBoolean(e.ignore.objectValues,!1),e.ignore.arrayValues=Default.getBoolean(e.ignore.arrayValues,!1),e}(t),t=function(e){return e.events=Default.getObject(e.events,{}),e.events.onBeforeRender=Default.getFunction(e.events.onBeforeRender,null),e.events.onRenderComplete=Default.getFunction(e.events.onRenderComplete,null),e.events.onValueClick=Default.getFunction(e.events.onValueClick,null),e.events.onRefresh=Default.getFunction(e.events.onRefresh,null),e.events.onCopyAll=Default.getFunction(e.events.onCopyAll,null),e.events.onOpenAll=Default.getFunction(e.events.onOpenAll,null),e.events.onCloseAll=Default.getFunction(e.events.onCloseAll,null),e.events.onDestroy=Default.getFunction(e.events.onDestroy,null),e.events.onBooleanRender=Default.getFunction(e.events.onBooleanRender,null),e.events.onDecimalRender=Default.getFunction(e.events.onDecimalRender,null),e.events.onNumberRender=Default.getFunction(e.events.onNumberRender,null),e.events.onStringRender=Default.getFunction(e.events.onStringRender,null),e.events.onDateRender=Default.getFunction(e.events.onDateRender,null),e.events.onFunctionRender=Default.getFunction(e.events.onFunctionRender,null),e.events.onNullRender=Default.getFunction(e.events.onNullRender,null),e.events.onUnknownRender=Default.getFunction(e.events.onUnknownRender,null),e}(t),t}})(Binding||(Binding={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e=null){let t=Default.getObject(e,{});return t.safeMode=Default.getBoolean(t.safeMode,!0),t.domElementTypes=Default.getStringOrArray(t.domElementTypes,["*"]),t=function(e){return e.text=Default.getObject(e.text,{}),e.text.objectText=Default.getAnyString(e.text.objectText,"object"),e.text.arrayText=Default.getAnyString(e.text.arrayText,"array"),e.text.closeAllButtonText=Default.getAnyString(e.text.closeAllButtonText,"Close All"),e.text.openAllButtonText=Default.getAnyString(e.text.openAllButtonText,"Open All"),e.text.copyAllButtonText=Default.getAnyString(e.text.copyAllButtonText,"Copy All"),e.text.objectErrorText=Default.getAnyString(e.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),e.text.attributeNotValidErrorText=Default.getAnyString(e.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),e.text.attributeNotSetErrorText=Default.getAnyString(e.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly."),e.text.stText=Default.getAnyString(e.text.stText,"st"),e.text.ndText=Default.getAnyString(e.text.ndText,"nd"),e.text.rdText=Default.getAnyString(e.text.rdText,"rd"),e.text.thText=Default.getAnyString(e.text.thText,"th"),e.text.ellipsisText=Default.getAnyString(e.text.ellipsisText,"..."),e.text.closeAllButtonSymbolText=Default.getAnyString(e.text.closeAllButtonSymbolText,"↑"),e.text.openAllButtonSymbolText=Default.getAnyString(e.text.openAllButtonSymbolText,"↓"),e.text.copyAllButtonSymbolText=Default.getAnyString(e.text.copyAllButtonSymbolText,"❐"),e.text.backButtonText=Default.getAnyString(e.text.backButtonText,"Back"),e.text.nextButtonText=Default.getAnyString(e.text.nextButtonText,"Next"),e.text.backButtonSymbolText=Default.getAnyString(e.text.backButtonSymbolText,"←"),e.text.nextButtonSymbolText=Default.getAnyString(e.text.nextButtonSymbolText,"→"),Is.invalidOptionArray(e.text.dayNames,7)&&(e.text.dayNames=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]),Is.invalidOptionArray(e.text.dayNamesAbbreviated,7)&&(e.text.dayNamesAbbreviated=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]),Is.invalidOptionArray(e.text.monthNames,12)&&(e.text.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"]),Is.invalidOptionArray(e.text.monthNamesAbbreviated,12)&&(e.text.monthNamesAbbreviated=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),e}(t),t}})(Config||(Config={})),(Trigger||(Trigger={})).customEvent=function(e,...t){let n=null;return Is.definedFunction(e)&&(n=e.apply(null,[].slice.call(t,0))),n},(()=>{let _configuration={},_elements_Data={};function render(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n<t;n++){const t=document.getElementsByTagName(e[n]),r=[].slice.call(t),o=r.length;for(let e=0;e<o&&renderElement(r[e]);e++);}}function renderElement(e){let t=!0;if(Is.defined(e)&&e.hasAttribute(Constants.JSONTREE_JS_ATTRIBUTE_NAME)){const n=e.getAttribute(Constants.JSONTREE_JS_ATTRIBUTE_NAME);if(Is.definedString(n)){const r=getObjectFromString(n);r.parsed&&Is.definedObject(r.object)?renderControl(Binding.Options.getForNewInstance(r.object,e)):_configuration.safeMode||(console.error(_configuration.text.attributeNotValidErrorText.replace("{{attribute_name}}",Constants.JSONTREE_JS_ATTRIBUTE_NAME)),t=!1)}else _configuration.safeMode||(console.error(_configuration.text.attributeNotSetErrorText.replace("{{attribute_name}}",Constants.JSONTREE_JS_ATTRIBUTE_NAME)),t=!1)}return t}function renderControl(e){Trigger.customEvent(e.events.onBeforeRender,e._currentView.element),Is.definedString(e._currentView.element.id)||(e._currentView.element.id=Str.newGuid()),e._currentView.element.className="json-tree-js",e._currentView.element.removeAttribute(Constants.JSONTREE_JS_ATTRIBUTE_NAME),_elements_Data.hasOwnProperty(e._currentView.element.id)||(_elements_Data[e._currentView.element.id]=e),renderControlContainer(e),Trigger.customEvent(e.events.onRenderComplete,e._currentView.element)}function renderControlContainer(e){let t=_elements_Data[e._currentView.element.id].data;e._currentView.element.innerHTML="",renderControlTitleBar(e,t),e.showArrayItemsAsSeparateObjects&&(t=t[e._currentView.dataArrayCurrentIndex]),Is.definedObject(t)&&!Is.definedArray(t)?renderObject(e._currentView.element,e,t,!0):Is.definedArray(t)&&renderArray(e._currentView.element,e,t)}function renderControlTitleBar(e,t){if(e.title.show||e.title.showTreeControls||e.title.showCopyButton){const n=DomElement.create(e._currentView.element,"div","title-bar"),r=DomElement.create(n,"div","controls");if(e.title.show&&DomElement.createWithHTML(n,"div","title",e.title.text,r),e.title.showCopyButton){const t=DomElement.createWithHTML(r,"button","copy-all",_configuration.text.copyAllButtonSymbolText);t.title=_configuration.text.copyAllButtonText,t.onclick=()=>{let t=null;t=e.copyOnlyCurrentPage&&e.showArrayItemsAsSeparateObjects?JSON.stringify(_elements_Data[e._currentView.element.id].data[e._currentView.dataArrayCurrentIndex],null,2):JSON.stringify(_elements_Data[e._currentView.element.id].data,null,2),navigator.clipboard.writeText(t),Trigger.customEvent(e.events.onCopyAll,t)}}if(e.title.showTreeControls){const t=DomElement.createWithHTML(r,"button","openAll",_configuration.text.openAllButtonSymbolText);t.title=_configuration.text.openAllButtonText;const n=DomElement.createWithHTML(r,"button","closeAll",_configuration.text.closeAllButtonSymbolText);n.title=_configuration.text.closeAllButtonText,t.onclick=()=>{openAllNodes(e)},n.onclick=()=>{closeAllNodes(e)}}if(e.showArrayItemsAsSeparateObjects&&Is.definedArray(t)&&t.length>1){const n=DomElement.createWithHTML(r,"button","back",_configuration.text.backButtonSymbolText);n.title=_configuration.text.backButtonText,e._currentView.dataArrayCurrentIndex>0?n.onclick=()=>{e._currentView.dataArrayCurrentIndex--,renderControlContainer(e)}:n.disabled=!0;const o=DomElement.createWithHTML(r,"button","next",_configuration.text.nextButtonSymbolText);o.title=_configuration.text.nextButtonText,e._currentView.dataArrayCurrentIndex<t.length-1?o.onclick=()=>{e._currentView.dataArrayCurrentIndex++,renderControlContainer(e)}:o.disabled=!0}else e.showArrayItemsAsSeparateObjects=!1}}function openAllNodes(e){e.showAllAsClosed=!1,renderControlContainer(e),Trigger.customEvent(e.events.onOpenAll,e._currentView.element)}function closeAllNodes(e){e.showAllAsClosed=!0,renderControlContainer(e),Trigger.customEvent(e.events.onCloseAll,e._currentView.element)}function renderObject(e,t,n,r=!1){const o=DomElement.create(e,"div","object-type-title"),l=DomElement.create(e,"div","object-type-contents"),a=renderObjectValues(t.showArrowToggles?DomElement.create(o,"div","down-arrow"):null,l,t,n),i=DomElement.createWithHTML(o,"span",t.showValueColors?"object":"",_configuration.text.objectText);if(r&&t.showArrayItemsAsSeparateObjects){let e=t.useZeroIndexingForArrays?t._currentView.dataArrayCurrentIndex.toString():(t._currentView.dataArrayCurrentIndex+1).toString();DomElement.createWithHTML(o,"span",t.showValueColors?"object data-array-index":"data-array-index",`[${e}]:`,i)}t.showCounts&&a>0&&DomElement.createWithHTML(o,"span",t.showValueColors?"object count":"count",`{${a}}`)}function renderArray(e,t,n){const r=DomElement.create(e,"div","object-type-title"),o=DomElement.create(e,"div","object-type-contents"),l=t.showArrowToggles?DomElement.create(r,"div","down-arrow"):null;DomElement.createWithHTML(r,"span",t.showValueColors?"array":"",_configuration.text.arrayText),renderArrayValues(l,o,t,n),t.showCounts&&DomElement.createWithHTML(r,"span",t.showValueColors?"array count":"count",`[${n.length}]`)}function renderObjectValues(e,t,n,r){let o=0,l=[];for(let e in r)r.hasOwnProperty(e)&&l.push(e);n.sortPropertyNames&&(l=l.sort(),n.sortPropertyNamesInAlphabeticalOrder||(l=l.reverse()));const a=l.length;for(let e=0;e<a;e++){const i=l[e];r.hasOwnProperty(i)&&(renderValue(t,n,i,r[i],e===a-1),o++)}return addArrowEvent(n,e,t),o}function renderArrayValues(e,t,n,r){const o=r.length;if(n.reverseArrayValues)for(let e=o;e--;)renderValue(t,n,getIndexName(n,e,o),r[e],0===e);else for(let e=0;e<o;e++)renderValue(t,n,getIndexName(n,e,o),r[e],e===o-1);addArrowEvent(n,e,t)}function renderValue(e,t,n,r,o){const l=DomElement.create(e,"div","object-type-value"),a=t.showArrowToggles?DomElement.create(l,"div","no-arrow"):null;let i=null,s=null,u=!1,c=null,d=!0;if(DomElement.createWithHTML(l,"span","title",n),DomElement.createWithHTML(l,"span","split",":"),Is.defined(r))if(Is.definedFunction(r))t.ignore.functionValues?u=!0:(i=t.showValueColors?"function":"",s=DomElement.createWithHTML(l,"span",i,Default.getFunctionName(r)),c="function",Is.definedFunction(t.events.onFunctionRender)&&Trigger.customEvent(t.events.onFunctionRender,s),createComma(t,l,o));else if(Is.definedBoolean(r))t.ignore.booleanValues?u=!0:(i=t.showValueColors?"boolean":"",s=DomElement.createWithHTML(l,"span",i,r),c="boolean",Is.definedFunction(t.events.onBooleanRender)&&Trigger.customEvent(t.events.onBooleanRender,s),createComma(t,l,o));else if(Is.definedDecimal(r))if(t.ignore.decimalValues)u=!0;else{const e=Default.getFixedDecimalPlacesValue(r,t.maximumDecimalPlaces);i=t.showValueColors?"decimal":"",s=DomElement.createWithHTML(l,"span",i,e),c="decimal",Is.definedFunction(t.events.onDecimalRender)&&Trigger.customEvent(t.events.onDecimalRender,s),createComma(t,l,o)}else if(Is.definedNumber(r))t.ignore.numberValues?u=!0:(i=t.showValueColors?"number":"",s=DomElement.createWithHTML(l,"span",i,r),c="number",Is.definedFunction(t.events.onNumberRender)&&Trigger.customEvent(t.events.onNumberRender,s),createComma(t,l,o));else if(Is.definedString(r))if(t.ignore.stringValues)u=!0;else{let e=null;t.showValueColors&&t.showStringHexColors&&Is.hexColor(r)?e=r:t.maximumStringLength>0&&r.length>t.maximumStringLength&&(r=r.substring(0,t.maximumStringLength)+_configuration.text.ellipsisText);const n=t.showStringQuotes?`"${r}"`:r;i=t.showValueColors?"string":"",s=DomElement.createWithHTML(l,"span",i,n),c="string",Is.definedString(e)&&(s.style.color=e),Is.definedFunction(t.events.onStringRender)&&Trigger.customEvent(t.events.onStringRender,s),createComma(t,l,o)}else if(Is.definedDate(r))t.ignore.dateValues?u=!0:(i=t.showValueColors?"date":"",s=DomElement.createWithHTML(l,"span",i,DateTime.getCustomFormattedDateText(_configuration,r,t.dateTimeFormat)),c="date",Is.definedFunction(t.events.onDateRender)&&Trigger.customEvent(t.events.onDateRender,s),createComma(t,l,o));else if(Is.definedObject(r)&&!Is.definedArray(r))if(t.ignore.objectValues)u=!0;else{const e=DomElement.create(l,"span",t.showValueColors?"object":""),n=renderObjectValues(a,DomElement.create(l,"div","object-type-contents"),t,r);DomElement.createWithHTML(e,"span","title",_configuration.text.objectText),t.showCounts&&n>0&&DomElement.createWithHTML(e,"span","count",`{${n}}`),createComma(t,e,o),c="object"}else if(Is.definedArray(r))if(t.ignore.arrayValues)u=!0;else{const e=DomElement.create(l,"span",t.showValueColors?"array":""),n=DomElement.create(l,"div","object-type-contents");DomElement.createWithHTML(e,"span","title",_configuration.text.arrayText),t.showCounts&&DomElement.createWithHTML(e,"span","count",`[${r.length}]`),createComma(t,e,o),renderArrayValues(a,n,t,r),c="array"}else t.ignore.unknownValues?u=!0:(i=t.showValueColors?"unknown":"",s=DomElement.createWithHTML(l,"span",i,r.toString()),c="unknown",Is.definedFunction(t.events.onUnknownRender)&&Trigger.customEvent(t.events.onUnknownRender,s),createComma(t,l,o));else t.ignore.nullValues?u=!0:(i=t.showValueColors?"null":"",s=DomElement.createWithHTML(l,"span",i,"null"),d=!1,Is.definedFunction(t.events.onNullRender)&&Trigger.customEvent(t.events.onNullRender,s),createComma(t,l,o));u?e.removeChild(l):Is.defined(s)&&addValueClickEvent(t,s,r,c,d)}function addValueClickEvent(e,t,n,r,o){o&&Is.definedFunction(e.events.onValueClick)?t.onclick=()=>{Trigger.customEvent(e.events.onValueClick,n,r)}:DomElement.addClass(t,"no-hover")}function addArrowEvent(e,t,n){Is.defined(t)&&(t.onclick=()=>{"down-arrow"===t.className?(n.style.display="none",t.className="right-arrow"):(n.style.display="block",t.className="down-arrow")},e.showAllAsClosed?(n.style.display="none",t.className="right-arrow"):t.className="down-arrow")}function createComma(e,t,n){e.showCommas&&!n&&DomElement.createWithHTML(t,"span","comma",",")}function getIndexName(e,t,n){let r=e.useZeroIndexingForArrays?t.toString():(t+1).toString();return e.addArrayIndexPadding||(r=Str.padNumber(parseInt(r),n.toString().length)),`[${r}]`}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(console.error(_configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function destroyElement(e){e._currentView.element.innerHTML="",e._currentView.element.className="",Trigger.customEvent(e.events.onDestroy,e._currentView.element)}const _public={refresh:function(e){if(Is.definedString(e)&&_elements_Data.hasOwnProperty(e)){const t=_elements_Data[e];renderControlContainer(t),Trigger.customEvent(t.events.onRefresh,t._currentView.element)}return _public},refreshAll:function(){for(let e in _elements_Data)if(_elements_Data.hasOwnProperty(e)){const t=_elements_Data[e];renderControlContainer(t),Trigger.customEvent(t.events.onRefresh,t._currentView.element)}return _public},render:function(e,t){return Is.definedObject(e)&&Is.definedObject(t)&&renderControl(Binding.Options.getForNewInstance(t,e)),_public},renderAll:function(){return render(),_public},openAll:function(e){return Is.definedString(e)&&_elements_Data.hasOwnProperty(e)&&openAllNodes(_elements_Data[e]),_public},closeAll:function(e){return Is.definedString(e)&&_elements_Data.hasOwnProperty(e)&&closeAllNodes(_elements_Data[e]),_public},destroy:function(e){return Is.definedString(e)&&_elements_Data.hasOwnProperty(e)&&(destroyElement(_elements_Data[e]),delete _elements_Data[e]),_public},destroyAll:function(){for(let e in _elements_Data)_elements_Data.hasOwnProperty(e)&&destroyElement(_elements_Data[e]);return _elements_Data={},_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let r in e)e.hasOwnProperty(r)&&_configuration.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=e[r],t=!0);t&&(_configuration=Config.Options.get(n))}return _public},getIds:function(){const e=[];for(let t in _elements_Data)_elements_Data.hasOwnProperty(t)&&e.push(t);return e},getVersion:function(){return"2.1.0"}};_configuration=Config.Options.get(),document.addEventListener("DOMContentLoaded",(function(){render()})),Is.defined(window.$jsontree)||(window.$jsontree=_public)})();

@@ -5,3 +5,3 @@ {

"description": "A lightweight JavaScript library that generates customizable tree views to better visualize JSON data.",
"version": "2.0.0",
"version": "2.1.0",
"homepage": "https://www.william-troup.com/jsontree-js/",

@@ -43,8 +43,8 @@ "author": {

"devDependencies": {
"@swc/core": "^1.6.7",
"sass": "^1.77.6",
"terser": "^5.31.1",
"tsup": "^8.1.0",
"typescript": "^5.5.2"
"@swc/core": "^1.7.0",
"sass": "^1.77.8",
"terser": "^5.31.3",
"tsup": "^8.2.0",
"typescript": "^5.5.3"
}
}

@@ -5,4 +5,4 @@ <h1 align="center">

[![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-v2.0.0-blue)](https://www.npmjs.com/package/jjsontree.js)
[![nuget](https://img.shields.io/badge/nuget-v2.0.0-purple)](https://www.nuget.org/packages/jJsonTree.js/)
[![npm](https://img.shields.io/badge/npmjs-v2.1.0-blue)](https://www.npmjs.com/package/jjsontree.js)
[![nuget](https://img.shields.io/badge/nuget-v2.1.0-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)

@@ -14,3 +14,3 @@ [![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/JsonTree.js/discussions)

> <p align="center">🔗 A lightweight JavaScript library that generates customizable tree views to better visualize JSON data.</p>
> <p align="center">v2.0.0</p>
> <p align="center">v2.1.0</p>
<br />

@@ -33,2 +33,3 @@

- Custom value rendering.
- Array paging support (show array objects on different pages)!
<br />

@@ -70,4 +71,4 @@ <br />

```markdown
https://cdn.jsdelivr.net/gh/williamtroup/JsonTree.js@2.0.0/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/JsonTree.js@2.0.0/dist/jsontree.js.min.css
https://cdn.jsdelivr.net/gh/williamtroup/JsonTree.js@2.1.0/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/JsonTree.js@2.1.0/dist/jsontree.js.min.css
```

@@ -74,0 +75,0 @@ <br>

@@ -7,3 +7,3 @@ /**

* @file jsontree.ts
* @version v2.0.0
* @version v2.1.0
* @author Bunoon

@@ -15,17 +15,14 @@ * @license MIT License

import {
type BindingOptions,
type Events,
type Ignore,
type Title,
type Configuration,
type CurrentView } from "./ts/type";
import { PublicApi } from "./ts/api";
import { Data } from "./ts/data";
import { Is } from "./ts/is";
import { DomElement } from "./ts/dom";
import { Char } from "./ts/enum";
import { DateTime } from "./ts/datetime";
import { type BindingOptions, type Configuration } from "./ts/type";
import { type PublicApi } from "./ts/api";
import { Default } from "./ts/data/default";
import { Is } from "./ts/data/is";
import { DomElement } from "./ts/dom/dom";
import { Char } from "./ts/data/enum";
import { DateTime } from "./ts/data/datetime";
import { Constants } from "./ts/constant";
import { Str } from "./ts/data/str";
import { Binding } from "./ts/options/binding";
import { Config } from "./ts/options/config";
import { Trigger } from "./ts/area/trigger";

@@ -82,7 +79,7 @@

if ( bindingOptions.parsed && Is.definedObject( bindingOptions.object ) ) {
renderControl( renderBindingOptions( bindingOptions.object, element ) );
renderControl( Binding.Options.getForNewInstance( bindingOptions.object, element ) );
} else {
if ( !_configuration.safeMode ) {
console.error( _configuration.attributeNotValidErrorText!.replace( "{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME ) );
console.error( _configuration.text!.attributeNotValidErrorText!.replace( "{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME ) );
result = false;

@@ -94,3 +91,3 @@ }

if ( !_configuration.safeMode ) {
console.error( _configuration.attributeNotSetErrorText!.replace( "{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME ) );
console.error( _configuration.text!.attributeNotSetErrorText!.replace( "{{attribute_name}}", Constants.JSONTREE_JS_ATTRIBUTE_NAME ) );
result = false;

@@ -104,15 +101,7 @@ }

function renderBindingOptions( data: any, element: HTMLElement ) : BindingOptions {
const bindingOptions: BindingOptions = buildAttributeOptions( data );
bindingOptions._currentView = {} as CurrentView;
bindingOptions._currentView.element = element;
return bindingOptions;
}
function renderControl( bindingOptions: BindingOptions ) : void {
fireCustomTriggerEvent( bindingOptions.events!.onBeforeRender!, bindingOptions._currentView.element );
Trigger.customEvent( bindingOptions.events!.onBeforeRender!, bindingOptions._currentView.element );
if ( !Is.definedString( bindingOptions._currentView.element.id ) ) {
bindingOptions._currentView.element.id = Data.String.newGuid();
bindingOptions._currentView.element.id = Str.newGuid();
}

@@ -128,14 +117,18 @@

renderControlContainer( bindingOptions );
fireCustomTriggerEvent( bindingOptions.events!.onRenderComplete!, bindingOptions._currentView.element );
Trigger.customEvent( bindingOptions.events!.onRenderComplete!, bindingOptions._currentView.element );
}
function renderControlContainer( bindingOptions: BindingOptions ) : void {
const data: any = _elements_Data[ bindingOptions._currentView.element.id ].data;
let data: any = _elements_Data[ bindingOptions._currentView.element.id ].data;
bindingOptions._currentView.element.innerHTML = Char.empty;
renderControlTitleBar( bindingOptions );
renderControlTitleBar( bindingOptions, data );
if ( bindingOptions.showArrayItemsAsSeparateObjects ) {
data = data[ bindingOptions._currentView.dataArrayCurrentIndex ];
}
if ( Is.definedObject( data ) && !Is.definedArray( data ) ) {
renderObject( bindingOptions._currentView.element, bindingOptions, data );
renderObject( bindingOptions._currentView.element, bindingOptions, data, true );
} else if ( Is.definedArray( data ) ) {

@@ -153,3 +146,3 @@ renderArray( bindingOptions._currentView.element, bindingOptions, data );

function renderControlTitleBar( bindingOptions: BindingOptions ) : void {
function renderControlTitleBar( bindingOptions: BindingOptions, data: any ) : void {
if ( bindingOptions.title!.show || bindingOptions.title!.showTreeControls || bindingOptions.title!.showCopyButton ) {

@@ -164,10 +157,18 @@ const titleBar: HTMLElement = DomElement.create( bindingOptions._currentView.element, "div", "title-bar" );

if ( bindingOptions.title!.showCopyButton ) {
const copy: HTMLElement = DomElement.createWithHTML( controls, "button", "copy-all", _configuration.copyAllButtonText! );
const copy: HTMLButtonElement = DomElement.createWithHTML( controls, "button", "copy-all", _configuration.text!.copyAllButtonSymbolText! ) as HTMLButtonElement;
copy.title = _configuration.text!.copyAllButtonText!
copy.onclick = () => {
const copyData: string = JSON.stringify( _elements_Data[ bindingOptions._currentView.element.id ].data );
let copyData: string = null!;
if ( bindingOptions.copyOnlyCurrentPage && bindingOptions.showArrayItemsAsSeparateObjects ) {
copyData = JSON.stringify( _elements_Data[ bindingOptions._currentView.element.id ].data[ bindingOptions._currentView.dataArrayCurrentIndex ], null, 2 );
}
else {
copyData = JSON.stringify( _elements_Data[ bindingOptions._currentView.element.id ].data, null, 2 );
}
navigator.clipboard.writeText( copyData );
fireCustomTriggerEvent( bindingOptions.events!.onCopyAll!, copyData );
Trigger.customEvent( bindingOptions.events!.onCopyAll!, copyData );
};

@@ -177,5 +178,8 @@ }

if ( bindingOptions.title!.showTreeControls ) {
const openAll: HTMLElement = DomElement.createWithHTML( controls, "button", "openAll", _configuration.openAllButtonText! );
const closeAll: HTMLElement = DomElement.createWithHTML( controls, "button", "closeAll", _configuration.closeAllButtonText! );
const openAll: HTMLButtonElement = DomElement.createWithHTML( controls, "button", "openAll", _configuration.text!.openAllButtonSymbolText! ) as HTMLButtonElement;
openAll.title = _configuration.text!.openAllButtonText!
const closeAll: HTMLButtonElement = DomElement.createWithHTML( controls, "button", "closeAll", _configuration.text!.closeAllButtonSymbolText! ) as HTMLButtonElement;
closeAll.title = _configuration.text!.closeAllButtonText!
openAll.onclick = () => {

@@ -189,2 +193,35 @@ openAllNodes( bindingOptions );

}
if ( bindingOptions.showArrayItemsAsSeparateObjects && Is.definedArray( data ) && data.length > 1 ) {
const back: HTMLButtonElement = DomElement.createWithHTML( controls, "button", "back", _configuration.text!.backButtonSymbolText! ) as HTMLButtonElement;
back.title = _configuration.text!.backButtonText!
if ( bindingOptions._currentView.dataArrayCurrentIndex > 0 ) {
back.onclick = () => {
bindingOptions._currentView.dataArrayCurrentIndex--;
renderControlContainer( bindingOptions );
};
} else {
back.disabled = true;
}
const next: HTMLButtonElement = DomElement.createWithHTML( controls, "button", "next", _configuration.text!.nextButtonSymbolText! ) as HTMLButtonElement;
next.title = _configuration.text!.nextButtonText!
if ( bindingOptions._currentView.dataArrayCurrentIndex < data.length - 1 ) {
next.onclick = () => {
bindingOptions._currentView.dataArrayCurrentIndex++;
renderControlContainer( bindingOptions );
};
} else {
next.disabled = true;
}
} else {
bindingOptions.showArrayItemsAsSeparateObjects = false;
}
}

@@ -197,3 +234,3 @@ }

renderControlContainer( bindingOptions );
fireCustomTriggerEvent( bindingOptions.events!.onOpenAll!, bindingOptions._currentView.element );
Trigger.customEvent( bindingOptions.events!.onOpenAll!, bindingOptions._currentView.element );
}

@@ -205,3 +242,3 @@

renderControlContainer( bindingOptions );
fireCustomTriggerEvent( bindingOptions.events!.onCloseAll!, bindingOptions._currentView.element );
Trigger.customEvent( bindingOptions.events!.onCloseAll!, bindingOptions._currentView.element );
}

@@ -216,3 +253,3 @@

function renderObject( container: HTMLElement, bindingOptions: BindingOptions, data: any ) : void {
function renderObject( container: HTMLElement, bindingOptions: BindingOptions, data: any, showPagingIndex: boolean = false ) : void {
const objectTypeTitle: HTMLElement = DomElement.create( container, "div", "object-type-title" );

@@ -223,6 +260,12 @@ const objectTypeContents: HTMLElement = DomElement.create( container, "div", "object-type-contents" );

DomElement.createWithHTML( objectTypeTitle, "span", bindingOptions.showValueColors ? "object" : Char.empty, _configuration.objectText! );
const titleText: HTMLSpanElement = DomElement.createWithHTML( objectTypeTitle, "span", bindingOptions.showValueColors ? "object" : Char.empty, _configuration.text!.objectText! ) as HTMLSpanElement;
if ( showPagingIndex && bindingOptions.showArrayItemsAsSeparateObjects ) {
let dataArrayIndex: string = bindingOptions.useZeroIndexingForArrays ? bindingOptions._currentView.dataArrayCurrentIndex.toString() : ( bindingOptions._currentView.dataArrayCurrentIndex + 1 ).toString();
DomElement.createWithHTML( objectTypeTitle, "span", bindingOptions.showValueColors ? "object data-array-index" : "data-array-index", `[${dataArrayIndex}]:`, titleText );
}
if ( bindingOptions.showCounts && propertyCount > 0 ) {
DomElement.createWithHTML( objectTypeTitle, "span", bindingOptions.showValueColors ? "object count" : "count", "{" + propertyCount + "}" );
DomElement.createWithHTML( objectTypeTitle, "span", bindingOptions.showValueColors ? "object count" : "count", `{${propertyCount}}` );
}

@@ -236,3 +279,3 @@ }

DomElement.createWithHTML( objectTypeTitle, "span", bindingOptions.showValueColors ? "array" : Char.empty, _configuration.arrayText! );
DomElement.createWithHTML( objectTypeTitle, "span", bindingOptions.showValueColors ? "array" : Char.empty, _configuration.text!.arrayText! );

@@ -242,3 +285,3 @@ renderArrayValues( arrow, objectTypeContents, bindingOptions, data );

if ( bindingOptions.showCounts ) {
DomElement.createWithHTML( objectTypeTitle, "span", bindingOptions.showValueColors ? "array count" : "count", "[" + data.length + "]" );
DomElement.createWithHTML( objectTypeTitle, "span", bindingOptions.showValueColors ? "array count" : "count", `[${data.length}]` );
}

@@ -317,3 +360,3 @@ }

if ( Is.definedFunction( bindingOptions.events!.onNullRender ) ) {
fireCustomTriggerEvent( bindingOptions.events!.onNullRender!, valueElement );
Trigger.customEvent( bindingOptions.events!.onNullRender!, valueElement );
}

@@ -330,7 +373,7 @@

valueClass = bindingOptions.showValueColors ? "function" : Char.empty;
valueElement = DomElement.createWithHTML( objectTypeValue, "span", valueClass, getFunctionName( value ) );
valueElement = DomElement.createWithHTML( objectTypeValue, "span", valueClass, Default.getFunctionName( value ) );
type = "function";
if ( Is.definedFunction( bindingOptions.events!.onFunctionRender ) ) {
fireCustomTriggerEvent( bindingOptions.events!.onFunctionRender!, valueElement );
Trigger.customEvent( bindingOptions.events!.onFunctionRender!, valueElement );
}

@@ -351,3 +394,3 @@

if ( Is.definedFunction( bindingOptions.events!.onBooleanRender ) ) {
fireCustomTriggerEvent( bindingOptions.events!.onBooleanRender!, valueElement );
Trigger.customEvent( bindingOptions.events!.onBooleanRender!, valueElement );
}

@@ -363,3 +406,3 @@

if ( !bindingOptions.ignore!.decimalValues ) {
const newValue: string = Data.getFixedDecimalPlacesValue( value, bindingOptions.maximumDecimalPlaces! );
const newValue: string = Default.getFixedDecimalPlacesValue( value, bindingOptions.maximumDecimalPlaces! );

@@ -371,3 +414,3 @@ valueClass = bindingOptions.showValueColors ? "decimal" : Char.empty;

if ( Is.definedFunction( bindingOptions.events!.onDecimalRender ) ) {
fireCustomTriggerEvent( bindingOptions.events!.onDecimalRender!, valueElement );
Trigger.customEvent( bindingOptions.events!.onDecimalRender!, valueElement );
}

@@ -388,3 +431,3 @@

if ( Is.definedFunction( bindingOptions.events!.onNumberRender ) ) {
fireCustomTriggerEvent( bindingOptions.events!.onNumberRender!, valueElement );
Trigger.customEvent( bindingOptions.events!.onNumberRender!, valueElement );
}

@@ -407,7 +450,7 @@

if ( bindingOptions.maximumStringLength! > 0 && value.length > bindingOptions.maximumStringLength! ) {
value = value.substring( 0, bindingOptions.maximumStringLength ) + _configuration.ellipsisText;
value = value.substring( 0, bindingOptions.maximumStringLength ) + _configuration.text!.ellipsisText;
}
}
const newStringValue: string = bindingOptions.showStringQuotes ? "\"" + value + "\"" : value;
const newStringValue: string = bindingOptions.showStringQuotes ? `\"${value}\"` : value;

@@ -423,3 +466,3 @@ valueClass = bindingOptions.showValueColors ? "string" : Char.empty;

if ( Is.definedFunction( bindingOptions.events!.onStringRender ) ) {
fireCustomTriggerEvent( bindingOptions.events!.onStringRender!, valueElement );
Trigger.customEvent( bindingOptions.events!.onStringRender!, valueElement );
}

@@ -440,3 +483,3 @@

if ( Is.definedFunction( bindingOptions.events!.onDateRender ) ) {
fireCustomTriggerEvent( bindingOptions.events!.onDateRender!, valueElement );
Trigger.customEvent( bindingOptions.events!.onDateRender!, valueElement );
}

@@ -456,6 +499,6 @@

DomElement.createWithHTML( objectTitle, "span", "title", _configuration.objectText! );
DomElement.createWithHTML( objectTitle, "span", "title", _configuration.text!.objectText! );
if ( bindingOptions.showCounts && propertyCount > 0 ) {
DomElement.createWithHTML( objectTitle, "span", "count", "{" + propertyCount + "}" );
DomElement.createWithHTML( objectTitle, "span", "count", `{${propertyCount}}` );
}

@@ -477,6 +520,6 @@

DomElement.createWithHTML( arrayTitle, "span", "title", _configuration.arrayText! );
DomElement.createWithHTML( arrayTitle, "span", "title", _configuration.text!.arrayText! );
if ( bindingOptions.showCounts ) {
DomElement.createWithHTML( arrayTitle, "span", "count", "[" + value.length + "]" );
DomElement.createWithHTML( arrayTitle, "span", "count", `[${value.length}]` );
}

@@ -500,3 +543,3 @@

if ( Is.definedFunction( bindingOptions.events!.onUnknownRender ) ) {
fireCustomTriggerEvent( bindingOptions.events!.onUnknownRender!, valueElement );
Trigger.customEvent( bindingOptions.events!.onUnknownRender!, valueElement );
}

@@ -524,3 +567,3 @@

valueElement.onclick = () => {
fireCustomTriggerEvent( bindingOptions.events!.onValueClick!, value, type );
Trigger.customEvent( bindingOptions.events!.onValueClick!, value, type );
};

@@ -554,18 +597,2 @@

function getFunctionName( value: any ) : string {
let result: string;
const valueParts: string[] = value.toString().split( "(" );
const valueNameParts: string[] = valueParts[ 0 ].split( Char.space );
if ( valueNameParts.length === 2 ) {
result = valueNameParts[ 1 ];
} else {
result = valueNameParts[ 0 ];
}
result += "()";
return result;
}
function createComma( bindingOptions: BindingOptions, objectTypeValue: HTMLElement, isLastItem: boolean ) : void {

@@ -581,6 +608,6 @@ if ( bindingOptions.showCommas && !isLastItem ) {

if ( !bindingOptions.addArrayIndexPadding ) {
result = Data.String.padNumber( parseInt( result ), largestValue.toString().length );
result = Str.padNumber( parseInt( result ), largestValue.toString().length );
}
return result;
return `[${result}]`;
}

@@ -591,96 +618,2 @@

* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* Options
* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*/
function buildAttributeOptions( newOptions: any ) : BindingOptions {
let options: BindingOptions = Data.getDefaultObject( newOptions, {} as BindingOptions );
options.data = Data.getDefaultObject( options.data, null! );
options.showCounts = Data.getDefaultBoolean( options.showCounts, true );
options.useZeroIndexingForArrays = Data.getDefaultBoolean( options.useZeroIndexingForArrays, true );
options.dateTimeFormat = Data.getDefaultString( options.dateTimeFormat, "{dd}{o} {mmmm} {yyyy} {hh}:{MM}:{ss}" );
options.showArrowToggles = Data.getDefaultBoolean( options.showArrowToggles, true );
options.showStringQuotes = Data.getDefaultBoolean( options.showStringQuotes, true );
options.showAllAsClosed = Data.getDefaultBoolean( options.showAllAsClosed, false );
options.sortPropertyNames = Data.getDefaultBoolean( options.sortPropertyNames, true );
options.sortPropertyNamesInAlphabeticalOrder = Data.getDefaultBoolean( options.sortPropertyNamesInAlphabeticalOrder, true );
options.showCommas = Data.getDefaultBoolean( options.showCommas, false );
options.reverseArrayValues = Data.getDefaultBoolean( options.reverseArrayValues, false );
options.addArrayIndexPadding = Data.getDefaultBoolean( options.addArrayIndexPadding, false );
options.showValueColors = Data.getDefaultBoolean( options.showValueColors, true );
options.maximumDecimalPlaces = Data.getDefaultNumber( options.maximumDecimalPlaces, 2 );
options.maximumStringLength = Data.getDefaultNumber( options.maximumStringLength, 0 );
options.showStringHexColors = Data.getDefaultBoolean( options.showStringHexColors, false );
options = buildAttributeOptionTitle( options );
options = buildAttributeOptionIgnore( options );
options = buildAttributeOptionCustomTriggers( options );
return options;
}
function buildAttributeOptionTitle( options: BindingOptions ) : BindingOptions {
options.title = Data.getDefaultObject( options.title, {} as Title );
options.title!.text = Data.getDefaultString( options.title!.text, "JsonTree.js" );
options.title!.show = Data.getDefaultBoolean( options.title!.show, true );
options.title!.showTreeControls = Data.getDefaultBoolean( options.title!.showTreeControls, true );
options.title!.showCopyButton = Data.getDefaultBoolean( options.title!.showCopyButton, false );
return options;
}
function buildAttributeOptionIgnore( options: BindingOptions ) : BindingOptions {
options.ignore = Data.getDefaultObject( options.ignore, {} as Ignore );
options.ignore!.nullValues = Data.getDefaultBoolean( options.ignore!.nullValues, false );
options.ignore!.functionValues = Data.getDefaultBoolean( options.ignore!.functionValues, false );
options.ignore!.unknownValues = Data.getDefaultBoolean( options.ignore!.unknownValues, false );
options.ignore!.booleanValues = Data.getDefaultBoolean( options.ignore!.booleanValues, false );
options.ignore!.decimalValues = Data.getDefaultBoolean( options.ignore!.decimalValues, false );
options.ignore!.numberValues = Data.getDefaultBoolean( options.ignore!.numberValues, false );
options.ignore!.stringValues = Data.getDefaultBoolean( options.ignore!.stringValues, false );
options.ignore!.dateValues = Data.getDefaultBoolean( options.ignore!.dateValues, false );
options.ignore!.objectValues = Data.getDefaultBoolean( options.ignore!.objectValues, false );
options.ignore!.arrayValues = Data.getDefaultBoolean( options.ignore!.arrayValues, false );
return options;
}
function buildAttributeOptionCustomTriggers( options: BindingOptions ) : BindingOptions {
options.events = Data.getDefaultObject( options.events, {} as Events );
options.events!.onBeforeRender = Data.getDefaultFunction( options.events!.onBeforeRender, null! );
options.events!.onRenderComplete = Data.getDefaultFunction( options.events!.onRenderComplete, null! );
options.events!.onValueClick = Data.getDefaultFunction( options.events!.onValueClick, null! );
options.events!.onRefresh = Data.getDefaultFunction( options.events!.onRefresh, null! );
options.events!.onCopyAll = Data.getDefaultFunction( options.events!.onCopyAll, null! );
options.events!.onOpenAll = Data.getDefaultFunction( options.events!.onOpenAll, null! );
options.events!.onCloseAll = Data.getDefaultFunction( options.events!.onCloseAll, null! );
options.events!.onDestroy = Data.getDefaultFunction( options.events!.onDestroy, null! );
options.events!.onBooleanRender = Data.getDefaultFunction( options.events!.onBooleanRender, null! );
options.events!.onDecimalRender = Data.getDefaultFunction( options.events!.onDecimalRender, null! );
options.events!.onNumberRender =Data.getDefaultFunction( options.events!.onNumberRender, null! );
options.events!.onStringRender = Data.getDefaultFunction( options.events!.onStringRender, null! );
options.events!.onDateRender = Data.getDefaultFunction( options.events!.onDateRender, null! );
options.events!.onFunctionRender = Data.getDefaultFunction( options.events!.onFunctionRender, null! );
options.events!.onNullRender = Data.getDefaultFunction( options.events!.onNullRender, null! );
options.events!.onUnknownRender = Data.getDefaultFunction( options.events!.onUnknownRender, null! );
return options;
}
/*
* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* Triggering Custom Events
* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*/
function fireCustomTriggerEvent( triggerFunction: Function, ...args : any[] ) : void {
if ( Is.definedFunction( triggerFunction ) ) {
triggerFunction.apply( null, [].slice.call( args, 0 ) );
}
}
/*
* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* Default Parameter/Option Handling

@@ -703,3 +636,3 @@ * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

try {
result.object = eval( "(" + objectString + ")" );
result.object = eval( `(${objectString})` );

@@ -712,3 +645,3 @@ if ( Is.definedFunction( result.object ) ) {

if ( !_configuration.safeMode ) {
console.error( _configuration.objectErrorText!.replace( "{{error_1}}", e1.message ).replace( "{{error_2}}", e2.message ) );
console.error( _configuration.text!.objectErrorText!.replace( "{{error_1}}", e1.message ).replace( "{{error_2}}", e2.message ) );
result.parsed = false;

@@ -735,94 +668,6 @@ }

fireCustomTriggerEvent( bindingOptions.events!.onDestroy!, bindingOptions._currentView.element );
Trigger.customEvent( bindingOptions.events!.onDestroy!, bindingOptions._currentView.element );
}
/*
* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* Public API Functions: Helpers: Configuration
* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*/
function buildDefaultConfiguration( newConfiguration: any = null ) : void {
_configuration = Data.getDefaultObject( newConfiguration, {} as Configuration );
_configuration.safeMode = Data.getDefaultBoolean( _configuration.safeMode, true );
_configuration.domElementTypes = Data.getDefaultStringOrArray( _configuration.domElementTypes, [ "*" ] );
buildDefaultConfigurationStrings();
}
function buildDefaultConfigurationStrings() : void {
_configuration.objectText = Data.getDefaultAnyString( _configuration.objectText, "object" );
_configuration.arrayText = Data.getDefaultAnyString( _configuration.arrayText, "array" );
_configuration.closeAllButtonText = Data.getDefaultAnyString( _configuration.closeAllButtonText, "Close All" );
_configuration.openAllButtonText = Data.getDefaultAnyString( _configuration.openAllButtonText, "Open All" );
_configuration.copyAllButtonText = Data.getDefaultAnyString( _configuration.copyAllButtonText, "Copy All" );
_configuration.objectErrorText = Data.getDefaultAnyString( _configuration.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}" );
_configuration.attributeNotValidErrorText = Data.getDefaultAnyString( _configuration.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object." );
_configuration.attributeNotSetErrorText = Data.getDefaultAnyString( _configuration.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly." );
_configuration.stText = Data.getDefaultAnyString( _configuration.stText, "st" );
_configuration.ndText = Data.getDefaultAnyString( _configuration.ndText, "nd" );
_configuration.rdText = Data.getDefaultAnyString( _configuration.rdText, "rd" );
_configuration.thText = Data.getDefaultAnyString( _configuration.thText, "th" );
_configuration.ellipsisText = Data.getDefaultAnyString( _configuration.ellipsisText, "..." );
if ( Is.invalidOptionArray( _configuration.dayNames, 7 ) ) {
_configuration.dayNames = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
];
}
if ( Is.invalidOptionArray( _configuration.dayNamesAbbreviated, 7 ) ) {
_configuration.dayNamesAbbreviated = [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
];
}
if ( Is.invalidOptionArray( _configuration.monthNames, 12 ) ) {
_configuration.monthNames = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
];
}
if ( Is.invalidOptionArray( _configuration.monthNamesAbbreviated, 12 ) ) {
_configuration.monthNamesAbbreviated = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
];
}
}
/*

@@ -846,3 +691,3 @@ * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

renderControlContainer( bindingOptions );
fireCustomTriggerEvent( bindingOptions.events!.onRefresh!, bindingOptions._currentView.element );
Trigger.customEvent( bindingOptions.events!.onRefresh!, bindingOptions._currentView.element );
}

@@ -859,3 +704,3 @@

renderControlContainer( bindingOptions );
fireCustomTriggerEvent( bindingOptions.events!.onRefresh!, bindingOptions._currentView.element );
Trigger.customEvent( bindingOptions.events!.onRefresh!, bindingOptions._currentView.element );
}

@@ -869,3 +714,3 @@ }

if ( Is.definedObject( element ) && Is.definedObject( options ) ) {
renderControl( renderBindingOptions( options, element ) );
renderControl( Binding.Options.getForNewInstance( options, element ) );
}

@@ -947,3 +792,3 @@

if ( configurationHasChanged ) {
buildDefaultConfiguration( newInternalConfiguration );
_configuration = Config.Options.get( newInternalConfiguration );
}

@@ -975,3 +820,3 @@ }

getVersion: function () : string {
return "2.0.0";
return "2.1.0";
}

@@ -988,3 +833,3 @@ };

( () => {
buildDefaultConfiguration();
_configuration = Config.Options.get();

@@ -991,0 +836,0 @@ document.addEventListener( "DOMContentLoaded", function() {

@@ -7,3 +7,3 @@ /**

* @file api.ts
* @version v2.0.0
* @version v2.1.0
* @author Bunoon

@@ -10,0 +10,0 @@ * @license MIT License

@@ -7,3 +7,3 @@ /**

* @file constant.ts
* @version v2.0.0
* @version v2.1.0
* @author Bunoon

@@ -10,0 +10,0 @@ * @license MIT License

@@ -7,3 +7,3 @@ /**

* @file type.ts
* @version v2.0.0
* @version v2.1.0
* @author Bunoon

@@ -18,2 +18,6 @@ * @license MIT License

domElementTypes?: string[] | string;
text?: ConfigurationText;
};
export type ConfigurationText = {
objectText?: string;

@@ -36,7 +40,14 @@ arrayText?: string;

monthNamesAbbreviated?: string[];
closeAllButtonSymbolText?: string;
openAllButtonSymbolText?: string;
copyAllButtonSymbolText?: string;
backButtonText?: string;
nextButtonText?: string;
backButtonSymbolText?: string;
nextButtonSymbolText?: string;
};
export type BindingOptions = {
_currentView: CurrentView;
data?: object;
_currentView: BindingOptionsCurrentView;
data?: any;
showCounts?: boolean;

@@ -57,12 +68,15 @@ useZeroIndexingForArrays?: boolean;

showStringHexColors?: boolean;
title?: Title;
ignore?: Ignore;
events?: Events;
showArrayItemsAsSeparateObjects: boolean;
copyOnlyCurrentPage: boolean;
title?: BindingOptionsTitle;
ignore?: BindingOptionsIgnore;
events?: BindingOptionsEvents;
};
export type CurrentView = {
export type BindingOptionsCurrentView = {
element: HTMLElement;
dataArrayCurrentIndex: number;
};
export type Title = {
export type BindingOptionsTitle = {
text?: string;

@@ -74,3 +88,3 @@ show?: boolean;

export type Ignore = {
export type BindingOptionsIgnore = {
nullValues?: boolean;

@@ -88,3 +102,3 @@ functionValues?: boolean;

export type Events = {
export type BindingOptionsEvents = {
onBeforeRender?: ( element: HTMLElement ) => void;

@@ -91,0 +105,0 @@ onRenderComplete?: ( element: HTMLElement ) => void;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc