datafolder 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/README.md +169 -0
  2. package/index.js +3 -0
  3. package/package.json +27 -0
  4. package/sample.js +37 -0
  5. package/scripts/airbnb.js +73 -0
  6. package/scripts/airbnb2.js +74 -0
  7. package/scripts/airbnb2_queries.js +231 -0
  8. package/scripts/airbnb_queries.js +264 -0
  9. package/scripts/downloadFile.js +42 -0
  10. package/scripts/express.js +46 -0
  11. package/scripts/fastify.js +79 -0
  12. package/scripts/flights.js +75 -0
  13. package/scripts/flights2.js +81 -0
  14. package/scripts/flights2_queries.js +453 -0
  15. package/scripts/flights_queries.js +403 -0
  16. package/src/QyAcl.js +252 -0
  17. package/src/QyAclSaver.js +14 -0
  18. package/src/QyAclSaver_Worker.js +29 -0
  19. package/src/QyAclWriter.js +19 -0
  20. package/src/QyBatch.js +501 -0
  21. package/src/QyBinWriter.js +140 -0
  22. package/src/QyCD.js +61 -0
  23. package/src/QyCache.js +212 -0
  24. package/src/QyCompressor.js +60 -0
  25. package/src/QyCompressor_Worker.js +13 -0
  26. package/src/QyDB.js +122 -0
  27. package/src/QyDefaultOptions.js +59 -0
  28. package/src/QyDir.js +192 -0
  29. package/src/QyFetch.js +38 -0
  30. package/src/QyFile.js +124 -0
  31. package/src/QyFileContentUtils.js +175 -0
  32. package/src/QyFileLogger.js +58 -0
  33. package/src/QyIndex.js +237 -0
  34. package/src/QyIndexPropTree.js +92 -0
  35. package/src/QyIntersectNode.js +48 -0
  36. package/src/QyItem.js +105 -0
  37. package/src/QyJsonSaver.js +20 -0
  38. package/src/QyKVData.js +289 -0
  39. package/src/QyKVDataCleaner.js +17 -0
  40. package/src/QyKVDataCleaner_Worker.js +94 -0
  41. package/src/QyKVDataLoader.js +65 -0
  42. package/src/QyKVDataSaver.js +17 -0
  43. package/src/QyKVDataSaver_Worker.js +81 -0
  44. package/src/QyLogFileSaver.js +14 -0
  45. package/src/QyLogFileSaver_Worker.js +26 -0
  46. package/src/QyLogger.js +76 -0
  47. package/src/QyMessageWorker.js +41 -0
  48. package/src/QyMessager.js +84 -0
  49. package/src/QyMessager_Run.js +13 -0
  50. package/src/QyMod.js +15 -0
  51. package/src/QyOpRunner.js +73 -0
  52. package/src/QyQueue.js +60 -0
  53. package/src/QySaver.js +83 -0
  54. package/src/QySnapshotCompactor.js +17 -0
  55. package/src/QySnapshotCompactor_Worker.js +151 -0
  56. package/src/QySnapshotSaver.js +17 -0
  57. package/src/QySnapshotSaver_Worker.js +164 -0
  58. package/src/QySnapshots.js +354 -0
  59. package/src/QyStructure.js +50 -0
  60. package/src/QyTrigger.js +133 -0
  61. package/src/QyUnionNode.js +105 -0
  62. package/src/QyUtils.js +250 -0
  63. package/src/QyWorker.js +33 -0
  64. package/src/hackernews.js +93 -0
  65. package/src/rpc/evalCode.js +9 -0
  66. package/src/rpc/getFileContent.js +16 -0
  67. package/src/rpc/getSubItems.js +32 -0
  68. package/src/rpc/queryFiles.js +33 -0
  69. package/src/rpc/reloadRpc.js +1 -0
  70. package/src/simulate.js +114 -0
  71. package/src/simulate2.js +110 -0
  72. package/src/soc_pokec.js +43 -0
  73. package/static/bootstrap-5.3.8-dist/css/bootstrap.min.css +6 -0
  74. package/static/bootstrap-5.3.8-dist/js/bootstrap.bundle.js +6312 -0
  75. package/static/datafolderui/QyStyledElement.js +30 -0
  76. package/static/datafolderui/QyUIFolderTree.js +203 -0
  77. package/static/datafolderui/QyUIUtils.js +42 -0
  78. package/static/datafolderui/display-tree.js +108 -0
  79. package/static/datafolderui/explore-tree.js +122 -0
  80. package/static/datafolderui/folder-tree.js +5 -0
  81. package/static/datafolderui/hscrpt.js +25 -0
  82. package/static/datafolderui/index.css +6 -0
  83. package/static/datafolderui/index.html +20 -0
  84. package/static/datafolderui/json-view.js +74 -0
  85. package/static/datafolderui/kv-input.js +66 -0
  86. package/static/datafolderui/list-input.js +52 -0
  87. package/static/datafolderui/main-page.js +98 -0
  88. package/static/datafolderui/num-input.js +27 -0
  89. package/static/datafolderui/query-editor.js +229 -0
  90. package/static/datafolderui/querySelectorShadowRoot.js +24 -0
  91. package/static/datafolderui/resizable-input.js +67 -0
  92. package/static/favicon.ico +0 -0
  93. package/static/icons-1.13.1/font/bootstrap-icons.min.css +5 -0
  94. package/static/icons-1.13.1/font/fonts/bootstrap-icons.woff +0 -0
  95. package/static/icons-1.13.1/font/fonts/bootstrap-icons.woff2 +0 -0
  96. package/static/json-view/dist/jsonview.js +433 -0
  97. package/static/tree.js/tree.css +106 -0
  98. package/static/tree.js/tree.js +374 -0
  99. package/static/w2ui/dist/w2ui.min.css +2 -0
  100. package/static/w2ui/src/less/icons/icons.json +1 -0
  101. package/static/w2ui/src/less/icons/preview.html +33 -0
  102. package/static/w2ui/src/less/icons/readme.md +15 -0
  103. package/static/w2ui/src/less/icons/svg/box.svg +3 -0
  104. package/static/w2ui/src/less/icons/svg/check.svg +3 -0
  105. package/static/w2ui/src/less/icons/svg/colors.svg +3 -0
  106. package/static/w2ui/src/less/icons/svg/columns.svg +5 -0
  107. package/static/w2ui/src/less/icons/svg/cross.svg +4 -0
  108. package/static/w2ui/src/less/icons/svg/drop.svg +6 -0
  109. package/static/w2ui/src/less/icons/svg/empty.svg +3 -0
  110. package/static/w2ui/src/less/icons/svg/eye-dropper.svg +4 -0
  111. package/static/w2ui/src/less/icons/svg/info.svg +8 -0
  112. package/static/w2ui/src/less/icons/svg/paste.svg +4 -0
  113. package/static/w2ui/src/less/icons/svg/pencil.svg +5 -0
  114. package/static/w2ui/src/less/icons/svg/plus.svg +3 -0
  115. package/static/w2ui/src/less/icons/svg/reload.svg +5 -0
  116. package/static/w2ui/src/less/icons/svg/search.svg +3 -0
  117. package/static/w2ui/src/less/icons/svg/settings.svg +8 -0
  118. package/static/w2ui/src/less/icons/w2ui-font.css +36 -0
  119. package/static/w2ui/src/less/icons/w2ui-font.woff +0 -0
  120. package/static/w2ui/src/less/src/buttons.less +184 -0
  121. package/static/w2ui/src/less/src/common.less +541 -0
  122. package/static/w2ui/src/less/src/fields.less +302 -0
  123. package/static/w2ui/src/less/src/form.less +319 -0
  124. package/static/w2ui/src/less/src/grid.less +1057 -0
  125. package/static/w2ui/src/less/src/icons.less +37 -0
  126. package/static/w2ui/src/less/src/layout.less +86 -0
  127. package/static/w2ui/src/less/src/mixins.less +87 -0
  128. package/static/w2ui/src/less/src/popup.less +277 -0
  129. package/static/w2ui/src/less/src/sidebar.less +343 -0
  130. package/static/w2ui/src/less/src/tabs.less +145 -0
  131. package/static/w2ui/src/less/src/toolbar.less +219 -0
  132. package/static/w2ui/src/less/src/tooltip.less +948 -0
  133. package/static/w2ui/src/less/w2ui.less +196 -0
  134. package/static/w2ui/src/locale/az-az.json +114 -0
  135. package/static/w2ui/src/locale/ba-ba.json +114 -0
  136. package/static/w2ui/src/locale/bg-bg.json +114 -0
  137. package/static/w2ui/src/locale/ca-es.json +114 -0
  138. package/static/w2ui/src/locale/da-dk.json +114 -0
  139. package/static/w2ui/src/locale/de-de.json +114 -0
  140. package/static/w2ui/src/locale/en-gb.json +17 -0
  141. package/static/w2ui/src/locale/en-us.json +17 -0
  142. package/static/w2ui/src/locale/es-ar.json +115 -0
  143. package/static/w2ui/src/locale/es-cr.json +119 -0
  144. package/static/w2ui/src/locale/es-es.json +114 -0
  145. package/static/w2ui/src/locale/es-mx.json +114 -0
  146. package/static/w2ui/src/locale/fr-fr.json +114 -0
  147. package/static/w2ui/src/locale/gl-es.json +114 -0
  148. package/static/w2ui/src/locale/hr-hr.json +114 -0
  149. package/static/w2ui/src/locale/hu-hu.json +114 -0
  150. package/static/w2ui/src/locale/id-id.json +114 -0
  151. package/static/w2ui/src/locale/it-it.json +114 -0
  152. package/static/w2ui/src/locale/ja-jp.json +114 -0
  153. package/static/w2ui/src/locale/kk-kz.json +116 -0
  154. package/static/w2ui/src/locale/ko-kr.json +114 -0
  155. package/static/w2ui/src/locale/lt-lt.json +114 -0
  156. package/static/w2ui/src/locale/nl-nl.json +114 -0
  157. package/static/w2ui/src/locale/no-no.json +114 -0
  158. package/static/w2ui/src/locale/pl-pl.json +114 -0
  159. package/static/w2ui/src/locale/pt-br.json +114 -0
  160. package/static/w2ui/src/locale/ru-ru.json +116 -0
  161. package/static/w2ui/src/locale/sk-sk.json +114 -0
  162. package/static/w2ui/src/locale/sl-si.json +116 -0
  163. package/static/w2ui/src/locale/sr-rs.json +114 -0
  164. package/static/w2ui/src/locale/tr-tr.json +114 -0
  165. package/static/w2ui/src/locale/uk-ua.json +114 -0
  166. package/static/w2ui/src/locale/zh-cn.json +114 -0
  167. package/static/w2ui/src/locale/zh-tw.json +114 -0
  168. package/static/w2ui/src/query.js +583 -0
  169. package/static/w2ui/src/readme.md +11 -0
  170. package/static/w2ui/src/w2base.js +311 -0
  171. package/static/w2ui/src/w2compat.js +207 -0
  172. package/static/w2ui/src/w2field.js +1854 -0
  173. package/static/w2ui/src/w2form.js +2411 -0
  174. package/static/w2ui/src/w2grid.js +8916 -0
  175. package/static/w2ui/src/w2layout.js +1194 -0
  176. package/static/w2ui/src/w2locale.js +129 -0
  177. package/static/w2ui/src/w2popup.js +909 -0
  178. package/static/w2ui/src/w2sidebar.js +1769 -0
  179. package/static/w2ui/src/w2tabs.js +669 -0
  180. package/static/w2ui/src/w2toolbar.js +1180 -0
  181. package/static/w2ui/src/w2tooltip.js +3134 -0
  182. package/static/w2ui/src/w2utils.js +2457 -0
@@ -0,0 +1,433 @@
1
+ !(function (e, n) {
2
+ "object" == typeof exports && "object" == typeof module
3
+ ? (module.exports = n())
4
+ : "function" == typeof define && define.amd
5
+ ? define([], n)
6
+ : "object" == typeof exports
7
+ ? (exports.jsonview = n())
8
+ : (e.jsonview = n());
9
+ })(self, () =>
10
+ (() => {
11
+ "use strict";
12
+ var e = {
13
+ 767: (e, n, t) => {
14
+ t.d(n, { Z: () => s });
15
+ var r = t(81),
16
+ o = t.n(r),
17
+ i = t(645),
18
+ a = t.n(i)()(o());
19
+ const s = a;
20
+ },
21
+ 645: (e) => {
22
+ e.exports = function (e) {
23
+ var n = [];
24
+ return (
25
+ (n.toString = function () {
26
+ return this.map(function (n) {
27
+ var t = "",
28
+ r = void 0 !== n[5];
29
+ return (
30
+ n[4] && (t += "@supports (".concat(n[4], ") {")),
31
+ n[2] && (t += "@media ".concat(n[2], " {")),
32
+ r && (t += "@layer".concat(n[5].length > 0 ? " ".concat(n[5]) : "", " {")),
33
+ (t += e(n)),
34
+ r && (t += "}"),
35
+ n[2] && (t += "}"),
36
+ n[4] && (t += "}"),
37
+ t
38
+ );
39
+ }).join("");
40
+ }),
41
+ (n.i = function (e, t, r, o, i) {
42
+ "string" == typeof e && (e = [[null, e, void 0]]);
43
+ var a = {};
44
+ if (r)
45
+ for (var s = 0; s < this.length; s++) {
46
+ var c = this[s][0];
47
+ null != c && (a[c] = !0);
48
+ }
49
+ for (var l = 0; l < e.length; l++) {
50
+ var d = [].concat(e[l]);
51
+ (r && a[d[0]]) ||
52
+ (void 0 !== i &&
53
+ (void 0 === d[5] ||
54
+ (d[1] = "@layer"
55
+ .concat(d[5].length > 0 ? " ".concat(d[5]) : "", " {")
56
+ .concat(d[1], "}")),
57
+ (d[5] = i)),
58
+ t &&
59
+ (d[2]
60
+ ? ((d[1] = "@media ".concat(d[2], " {").concat(d[1], "}")), (d[2] = t))
61
+ : (d[2] = t)),
62
+ o &&
63
+ (d[4]
64
+ ? ((d[1] = "@supports (".concat(d[4], ") {").concat(d[1], "}")),
65
+ (d[4] = o))
66
+ : (d[4] = "".concat(o))),
67
+ n.push(d));
68
+ }
69
+ }),
70
+ n
71
+ );
72
+ };
73
+ },
74
+ 81: (e) => {
75
+ e.exports = function (e) {
76
+ return e[1];
77
+ };
78
+ },
79
+ 379: (e) => {
80
+ var n = [];
81
+ function t(e) {
82
+ for (var t = -1, r = 0; r < n.length; r++)
83
+ if (n[r].identifier === e) {
84
+ t = r;
85
+ break;
86
+ }
87
+ return t;
88
+ }
89
+ function r(e, r) {
90
+ for (var i = {}, a = [], s = 0; s < e.length; s++) {
91
+ var c = e[s],
92
+ l = r.base ? c[0] + r.base : c[0],
93
+ d = i[l] || 0,
94
+ u = "".concat(l, " ").concat(d);
95
+ i[l] = d + 1;
96
+ var p = t(u),
97
+ f = { css: c[1], media: c[2], sourceMap: c[3], supports: c[4], layer: c[5] };
98
+ if (-1 !== p) n[p].references++, n[p].updater(f);
99
+ else {
100
+ var v = o(f, r);
101
+ (r.byIndex = s), n.splice(s, 0, { identifier: u, updater: v, references: 1 });
102
+ }
103
+ a.push(u);
104
+ }
105
+ return a;
106
+ }
107
+ function o(e, n) {
108
+ var t = n.domAPI(n);
109
+ return (
110
+ t.update(e),
111
+ function (n) {
112
+ if (n) {
113
+ if (
114
+ n.css === e.css &&
115
+ n.media === e.media &&
116
+ n.sourceMap === e.sourceMap &&
117
+ n.supports === e.supports &&
118
+ n.layer === e.layer
119
+ )
120
+ return;
121
+ t.update((e = n));
122
+ } else t.remove();
123
+ }
124
+ );
125
+ }
126
+ e.exports = function (e, o) {
127
+ var i = r((e = e || []), (o = o || {}));
128
+ return function (e) {
129
+ e = e || [];
130
+ for (var a = 0; a < i.length; a++) {
131
+ var s = t(i[a]);
132
+ n[s].references--;
133
+ }
134
+ for (var c = r(e, o), l = 0; l < i.length; l++) {
135
+ var d = t(i[l]);
136
+ 0 === n[d].references && (n[d].updater(), n.splice(d, 1));
137
+ }
138
+ i = c;
139
+ };
140
+ };
141
+ },
142
+ 569: (e) => {
143
+ var n = {};
144
+ e.exports = function (e, t) {
145
+ var r = (function (e) {
146
+ if (void 0 === n[e]) {
147
+ var t = document.querySelector(e);
148
+ if (window.HTMLIFrameElement && t instanceof window.HTMLIFrameElement)
149
+ try {
150
+ t = t.contentDocument.head;
151
+ } catch (e) {
152
+ t = null;
153
+ }
154
+ n[e] = t;
155
+ }
156
+ return n[e];
157
+ })(e);
158
+ if (!r)
159
+ throw new Error(
160
+ "Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.",
161
+ );
162
+ r.appendChild(t);
163
+ };
164
+ },
165
+ 216: (e) => {
166
+ e.exports = function (e) {
167
+ var n = document.createElement("style");
168
+ return e.setAttributes(n, e.attributes), e.insert(n, e.options), n;
169
+ };
170
+ },
171
+ 565: (e, n, t) => {
172
+ e.exports = function (e) {
173
+ var n = t.nc;
174
+ n && e.setAttribute("nonce", n);
175
+ };
176
+ },
177
+ 795: (e) => {
178
+ e.exports = function (e) {
179
+ if ("undefined" == typeof document) return { update: function () {}, remove: function () {} };
180
+ var n = e.insertStyleElement(e);
181
+ return {
182
+ update: function (t) {
183
+ !(function (e, n, t) {
184
+ var r = "";
185
+ t.supports && (r += "@supports (".concat(t.supports, ") {")),
186
+ t.media && (r += "@media ".concat(t.media, " {"));
187
+ var o = void 0 !== t.layer;
188
+ o && (r += "@layer".concat(t.layer.length > 0 ? " ".concat(t.layer) : "", " {")),
189
+ (r += t.css),
190
+ o && (r += "}"),
191
+ t.media && (r += "}"),
192
+ t.supports && (r += "}");
193
+ var i = t.sourceMap;
194
+ i &&
195
+ "undefined" != typeof btoa &&
196
+ (r += "\n/*# sourceMappingURL=data:application/json;base64,".concat(
197
+ btoa(unescape(encodeURIComponent(JSON.stringify(i)))),
198
+ " */",
199
+ )),
200
+ n.styleTagTransform(r, e, n.options);
201
+ })(n, e, t);
202
+ },
203
+ remove: function () {
204
+ !(function (e) {
205
+ if (null === e.parentNode) return !1;
206
+ e.parentNode.removeChild(e);
207
+ })(n);
208
+ },
209
+ };
210
+ };
211
+ },
212
+ 589: (e) => {
213
+ e.exports = function (e, n) {
214
+ if (n.styleSheet) n.styleSheet.cssText = e;
215
+ else {
216
+ for (; n.firstChild; ) n.removeChild(n.firstChild);
217
+ n.appendChild(document.createTextNode(e));
218
+ }
219
+ };
220
+ },
221
+ },
222
+ n = {};
223
+ function t(r) {
224
+ var o = n[r];
225
+ if (void 0 !== o) return o.exports;
226
+ var i = (n[r] = { id: r, exports: {} });
227
+ return e[r](i, i.exports, t), i.exports;
228
+ }
229
+ (t.n = (e) => {
230
+ var n = e && e.__esModule ? () => e.default : () => e;
231
+ return t.d(n, { a: n }), n;
232
+ }),
233
+ (t.d = (e, n) => {
234
+ for (var r in n) t.o(n, r) && !t.o(e, r) && Object.defineProperty(e, r, { enumerable: !0, get: n[r] });
235
+ }),
236
+ (t.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)),
237
+ (t.r = (e) => {
238
+ "undefined" != typeof Symbol &&
239
+ Symbol.toStringTag &&
240
+ Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }),
241
+ Object.defineProperty(e, "__esModule", { value: !0 });
242
+ }),
243
+ (t.nc = void 0);
244
+ var r = {};
245
+ return (
246
+ (() => {
247
+ t.r(r),
248
+ t.d(r, {
249
+ collapse: () => A,
250
+ create: () => S,
251
+ default: () => H,
252
+ destroy: () => L,
253
+ expand: () => D,
254
+ render: () => w,
255
+ renderJSON: () => k,
256
+ toggleNode: () => N,
257
+ traverse: () => C,
258
+ });
259
+ var e = t(379),
260
+ n = t.n(e),
261
+ o = t(795),
262
+ i = t.n(o),
263
+ a = t(569),
264
+ s = t.n(a),
265
+ c = t(565),
266
+ l = t.n(c),
267
+ d = t(216),
268
+ u = t.n(d),
269
+ p = t(589),
270
+ f = t.n(p),
271
+ v = t(767),
272
+ y = {};
273
+ function h(e) {
274
+ return Array.isArray(e) ? "array" : null === e ? "null" : typeof e;
275
+ }
276
+ function m(e) {
277
+ return document.createElement(e);
278
+ }
279
+ (y.styleTagTransform = f()),
280
+ (y.setAttributes = l()),
281
+ (y.insert = s().bind(null, "head")),
282
+ (y.domAPI = i()),
283
+ (y.insertStyleElement = u()),
284
+ n()(v.Z, y),
285
+ v.Z && v.Z.locals && v.Z.locals;
286
+ const g = {
287
+ HIDDEN: "hidden",
288
+ CARET_ICON: "caret-icon",
289
+ CARET_RIGHT: "fa-caret-right",
290
+ CARET_DOWN: "fa-caret-down",
291
+ ICON: "fas",
292
+ };
293
+ function x(e) {
294
+ e.children.forEach((e) => {
295
+ e.el.classList.add(g.HIDDEN), e.isExpanded && x(e);
296
+ });
297
+ }
298
+ function j(e) {
299
+ e.children.forEach((e) => {
300
+ e.el.classList.remove(g.HIDDEN), e.isExpanded && j(e);
301
+ });
302
+ }
303
+ function b(e) {
304
+ if (e.children.length > 0) {
305
+ const n = e.el.querySelector("." + g.ICON);
306
+ n && n.classList.replace(g.CARET_RIGHT, g.CARET_DOWN);
307
+ }
308
+ }
309
+ function E(e) {
310
+ if (e.children.length > 0) {
311
+ const n = e.el.querySelector("." + g.ICON);
312
+ n && n.classList.replace(g.CARET_DOWN, g.CARET_RIGHT);
313
+ }
314
+ }
315
+ function N(e) {
316
+ e.isExpanded ? ((e.isExpanded = !1), E(e), x(e)) : ((e.isExpanded = !0), b(e), j(e));
317
+ }
318
+ function C(e, n) {
319
+ n(e),
320
+ e.children.length > 0 &&
321
+ e.children.forEach((e) => {
322
+ C(e, n);
323
+ });
324
+ }
325
+ function T(e = {}) {
326
+ let n = e.hasOwnProperty("value") ? e.value : null;
327
+ return (
328
+ ((e) => "object" === h(e) && 0 === Object.keys(e).length)(n) && (n = "{}"),
329
+ {
330
+ key: e.key || null,
331
+ parent: e.parent || null,
332
+ value: n,
333
+ isExpanded: e.isExpanded || !1,
334
+ type: e.type || null,
335
+ children: e.children || [],
336
+ el: e.el || null,
337
+ depth: e.depth || 0,
338
+ dispose: null,
339
+ }
340
+ );
341
+ }
342
+ function I(e, n) {
343
+ if ("object" == typeof e)
344
+ for (let t in e) {
345
+ const r = T({ value: e[t], key: t, depth: n.depth + 1, type: h(e[t]), parent: n });
346
+ n.children.push(r), I(e[t], r);
347
+ }
348
+ }
349
+ function O(e) {
350
+ return "string" == typeof e ? JSON.parse(e) : e;
351
+ }
352
+ function S(e) {
353
+ const n = O(e),
354
+ t = T({ value: n, key: h(n), type: h(n) });
355
+ return I(n, t), t;
356
+ }
357
+ function k(e, n) {
358
+ const t = S(O(e));
359
+ return w(t, n), t;
360
+ }
361
+ function w(e, n) {
362
+ const t = (function () {
363
+ const e = m("div");
364
+ return (e.className = "json-container"), e;
365
+ })();
366
+ C(e, function (e) {
367
+ (e.el = (function (e) {
368
+ let n = m("div");
369
+ const t = (e) => {
370
+ const n = e.children.length;
371
+ return "array" === e.type ? `[${n}]` : "object" === e.type ? `{${n}}` : null;
372
+ };
373
+ if (e.children.length > 0) {
374
+ n.innerHTML = (function (e = {}) {
375
+ const { key: n, size: t } = e;
376
+ return `\n <div class="line">\n <div class="caret-icon"><i class="fas fa-caret-right"></i></div>\n <div class="json-key">${n}</div>\n <div class="json-size">${t}</div>\n </div>\n `;
377
+ })({ key: e.key, size: t(e) });
378
+ const r = n.querySelector("." + g.CARET_ICON);
379
+ e.dispose = (function (e, n, t) {
380
+ return e.addEventListener(n, t), () => e.removeEventListener(n, t);
381
+ })(r, "click", () => N(e));
382
+ } else
383
+ n.innerHTML = (function (e = {}) {
384
+ const { key: n, value: t, type: r } = e;
385
+ return `\n <div class="line">\n <div class="empty-icon"></div>\n <div class="json-key">${n}</div>\n <div class="json-separator">:</div>\n <div class="json-value json-${r}">${t}</div>\n </div>\n `;
386
+ })({
387
+ key: e.key,
388
+ value: "" === e.value ? '""' : e.value,
389
+ type: "{}" === e.value ? "object" : typeof e.value,
390
+ });
391
+ const r = n.children[0];
392
+ return (
393
+ null !== e.parent && r.classList.add(g.HIDDEN),
394
+ (r.style = "margin-left: " + 18 * e.depth + "px;"),
395
+ r
396
+ );
397
+ })(e)),
398
+ t.appendChild(e.el);
399
+ }),
400
+ n.appendChild(t);
401
+ }
402
+ function D(e) {
403
+ C(e, function (e) {
404
+ e.el.classList.remove(g.HIDDEN), (e.isExpanded = !0), b(e);
405
+ });
406
+ }
407
+ function A(e) {
408
+ C(e, function (n) {
409
+ (n.isExpanded = !1), n.depth > e.depth && n.el.classList.add(g.HIDDEN), E(n);
410
+ });
411
+ }
412
+ function L(e) {
413
+ var n;
414
+ C(e, (e) => {
415
+ e.dispose && e.dispose();
416
+ }),
417
+ (n = e.el.parentNode).parentNode.removeChild(n);
418
+ }
419
+ const H = {
420
+ toggleNode: N,
421
+ render: w,
422
+ create: S,
423
+ renderJSON: k,
424
+ expand: D,
425
+ collapse: A,
426
+ traverse: C,
427
+ destroy: L,
428
+ };
429
+ })(),
430
+ r
431
+ );
432
+ })(),
433
+ );
@@ -0,0 +1,106 @@
1
+ /* simple tree */
2
+ .simple-tree {
3
+ user-select: none;
4
+ -moz-user-select: none;
5
+ }
6
+ .simple-tree>details>summary {
7
+ display: none;
8
+ }
9
+ .simple-tree a,
10
+ .simple-tree summary {
11
+ display: block;
12
+ width: fit-content;
13
+ width: -moz-fit-content;
14
+ border: solid 1px transparent;
15
+ padding: 0 2px;
16
+ outline: none;
17
+ cursor: pointer;
18
+ }
19
+ .simple-tree a {
20
+ text-decoration: none;
21
+ color: inherit;
22
+ }
23
+ .simple-tree ::-webkit-details-marker {
24
+ display: none;
25
+ }
26
+ .simple-tree summary {
27
+ list-style-type: none;
28
+ background-color: #eee;
29
+ outline: none;
30
+ }
31
+ .simple-tree.dark summary {
32
+ background-color: #444;
33
+ }
34
+ .simple-tree details>:not(details),
35
+ .simple-tree details {
36
+ position: relative;
37
+ }
38
+ .simple-tree details :not(summary) {
39
+ margin-left: 20px;
40
+ }
41
+ .simple-tree.nodots details :not(summary) {
42
+ margin-left: 12px;
43
+ }
44
+ .simple-tree details::before,
45
+ .simple-tree details>:not(details)::before {
46
+ content: '';
47
+ width: 10px;
48
+ display: block;
49
+ position: absolute;
50
+ }
51
+ .simple-tree details::before,
52
+ .simple-tree details>:not(details)::before {
53
+ background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 2 2" xmlns="http://www.w3.org/2000/svg"><g><rect x="0" y="0" width="1" height="1"/></g></svg>') left top / 2px 2px;
54
+ }
55
+ .simple-tree.dark details::before,
56
+ .simple-tree.dark details>:not(summary)::before {
57
+ background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 2 2" xmlns="http://www.w3.org/2000/svg"><g><rect x="0" y="0" width="1" height="1" fill="white"/></g></svg>');
58
+ }
59
+ .simple-tree.nodots details::before,
60
+ .simple-tree.nodots details>:not(summary)::before {
61
+ background-image: none;
62
+ }
63
+ .simple-tree details::before {
64
+ top: 0;
65
+ height: 100%;
66
+ background-repeat: repeat-y;
67
+ left: 5px;
68
+ z-index: -1;
69
+ }
70
+ .simple-tree details>:not(details)::before {
71
+ top: 8px;
72
+ height: calc(100% - 8px);
73
+ background-repeat: repeat-x;
74
+ left: -15px;
75
+ }
76
+ .simple-tree details>summary::before {
77
+ background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><g><rect x="0" y="0" width="12" height="12" fill="white" stroke="gray" stroke-width="1"/><line x1="3" y1="6" x2="9" y2="6" stroke="black" stroke-width="2"/><line x1="6" y1="3" x2="6" y2="9" stroke="black" stroke-width="2"/></g></svg>') center center / 12px 12px no-repeat;
78
+ left: -22px;
79
+ top: 2px;
80
+ width: 16px;
81
+ height: 16px;
82
+ }
83
+ .simple-tree details[open]>summary::before {
84
+ background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><title/><g><rect x="0" y="0" width="12" height="12" fill="white" stroke="gray" stroke-width="1"/><line x1="3" y1="6" x2="9" y2="6" stroke="black" stroke-width="2"/></g></svg>');
85
+ }
86
+ /* async tree */
87
+ .async-tree details[open][data-loaded=false] {
88
+ pointer-events: none;
89
+ }
90
+ .async-tree details[open][data-loaded=false]>summary::before {
91
+ background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><g><animateTransform attributeName="transform" type="rotate" from="0 32 32" to="360 32 32" dur="1s" repeatCount="indefinite"/><circle cx="32" cy="32" r="32" fill="whitesmoke"/><path d="M 62 32 A 30 30 0 0 0 32 2" style="stroke: black; stroke-width:6; fill:none;"/></g></svg>');
92
+ }
93
+ .async-tree.black details[open][data-loaded=false]>summary::before {
94
+ background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><g><animateTransform attributeName="transform" type="rotate" from="0 32 32" to="360 32 32" dur="1s" repeatCount="indefinite"/><circle cx="32" cy="32" r="32" fill="whitesmoke"/><path d="M 62 32 A 30 30 0 0 0 32 2" style="stroke: white; stroke-width:6; fill:none;"/></g></svg>');
95
+ }
96
+ /* select tree */
97
+ .select-tree .selected {
98
+ background-color: #beebff;
99
+ border-color: #99defd;
100
+ z-index: 1;
101
+ }
102
+
103
+ .select-tree.dark .selected {
104
+ background-color: #3a484e;
105
+ border-color: #99defd;
106
+ }