@lingshugroup/web-plus 0.0.7-beta → 0.0.8-beta
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.
- package/lib/packages/ls-components/components/jsonEditor/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/jsonEditor/Index.vue/index2.js +4 -4
- package/lib/packages/ls-components/components/jsonEditor/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/jsonEditor/Index.vue/index2.js.gz +0 -0
- package/package.json +116 -2
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/__commonjsHelpers__-f3sTPFkQ/index.cjs +0 -1
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/__commonjsHelpers__-f3sTPFkQ/index.js +0 -11
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/full-width-button-handler-wnoSIg42/index.cjs +0 -1
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/full-width-button-handler-wnoSIg42/index.js +0 -7
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/index/index.cjs +0 -15
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/index/index.js +0 -598
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/index/index.js.br +0 -0
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/index/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/string-styles-MN5CgF9s/index.cjs +0 -117
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/string-styles-MN5CgF9s/index.js +0 -121
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/string-styles-MN5CgF9s/index.js.br +0 -0
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/string-styles-MN5CgF9s/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/styles-handler-G8NSk43t/index.cjs +0 -1
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/styles-handler-G8NSk43t/index.js +0 -18
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-jsoneditor-HKMtDzoB/index.cjs +0 -167
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-jsoneditor-HKMtDzoB/index.js +0 -47804
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-jsoneditor-HKMtDzoB/index.js.br +0 -0
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-jsoneditor-HKMtDzoB/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-picker-NKbIFE8h/index.cjs +0 -8
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-picker-NKbIFE8h/index.js +0 -551
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-picker-NKbIFE8h/index.js.br +0 -0
- package/lib/node_modules/.pnpm/vue3-ts-jsoneditor@2.11.2_@lezer_common@1.2.2_typescript@5.5.4/node_modules/vue3-ts-jsoneditor/dist/vanilla-picker-NKbIFE8h/index.js.gz +0 -0
|
@@ -1,598 +0,0 @@
|
|
|
1
|
-
var G = Object.defineProperty;
|
|
2
|
-
var n = (a, i) => G(a, "name", { value: i, configurable: !0 });
|
|
3
|
-
import { defineComponent as X, inject as Y, ref as v, computed as m, reactive as Z, watch as y, onMounted as ee, nextTick as T, onBeforeUnmount as te, openBlock as ae, createElementBlock as ne, normalizeClass as oe, normalizeStyle as le, withModifiers as re, renderSlot as ue, createCommentVNode as ie } from "vue";
|
|
4
|
-
const se = [
|
|
5
|
-
"selection",
|
|
6
|
-
"mainMenuBar",
|
|
7
|
-
"navigationBar",
|
|
8
|
-
"statusBar",
|
|
9
|
-
"askToFormat",
|
|
10
|
-
"readOnly",
|
|
11
|
-
"indentation",
|
|
12
|
-
"tabSize",
|
|
13
|
-
"escapeControlCharacters",
|
|
14
|
-
"escapeUnicodeCharacters",
|
|
15
|
-
"flattenColumns",
|
|
16
|
-
"validator",
|
|
17
|
-
"onClassName",
|
|
18
|
-
"onRenderValue",
|
|
19
|
-
"onRenderMenu"
|
|
20
|
-
], de = [
|
|
21
|
-
"selection",
|
|
22
|
-
"mode",
|
|
23
|
-
"mainMenuBar",
|
|
24
|
-
"navigationBar",
|
|
25
|
-
"statusBar",
|
|
26
|
-
"askToFormat",
|
|
27
|
-
"readOnly",
|
|
28
|
-
"indentation",
|
|
29
|
-
"tabSize",
|
|
30
|
-
"escapeControlCharacters",
|
|
31
|
-
"escapeUnicodeCharacters",
|
|
32
|
-
"flattenColumns",
|
|
33
|
-
"validator",
|
|
34
|
-
"parser",
|
|
35
|
-
"validationParser",
|
|
36
|
-
"pathParser",
|
|
37
|
-
"onClassName",
|
|
38
|
-
"onRenderValue",
|
|
39
|
-
"onRenderMenu"
|
|
40
|
-
], ce = /* @__PURE__ */ n((a = {}, i) => {
|
|
41
|
-
const r = {};
|
|
42
|
-
for (const o of de) {
|
|
43
|
-
const c = i[o] !== void 0 ? i[o] : a[o];
|
|
44
|
-
c !== void 0 && (r[o] = c);
|
|
45
|
-
}
|
|
46
|
-
return r;
|
|
47
|
-
}, "de"), ve = `
|
|
48
|
-
<svg
|
|
49
|
-
class="fa-icon svelte-1dof0an"
|
|
50
|
-
viewBox="0 0 1024 1024"
|
|
51
|
-
version="1.1"
|
|
52
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
53
|
-
p-id="1927" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
54
|
-
width="24"
|
|
55
|
-
height="24"
|
|
56
|
-
>
|
|
57
|
-
<path d="M63.989383 105.442494l0 268.396843c0 18.935258 15.368012 34.304294 34.304294 34.304294 18.936281 0 34.304294-15.369036 34.304294-34.304294L132.597971 180.156126l218.107483 218.176045c12.82919 12.830213 33.618679 12.830213 46.515407 0 12.830213-12.897751 12.830213-33.686217 0-46.51643l-218.176045-218.107483 193.683211 0c18.935258 0 34.304294-15.369036 34.304294-34.304294 0-18.935258-15.369036-34.304294-34.304294-34.304294L104.331183 65.09967C79.288834 65.09967 63.989383 77.999468 63.989383 105.442494L63.989383 105.442494z" p-id="1928" fill="#e6e6e6"></path><path d="M917.688719 65.09967 649.290853 65.09967c-18.935258 0-34.304294 15.369036-34.304294 34.304294 0 18.936281 15.369036 34.304294 34.304294 34.304294l193.683211 0-218.176045 218.107483c-12.830213 12.82919-12.830213 33.618679 0 46.51643 12.897751 12.830213 33.686217 12.830213 46.515407 0L889.420909 180.156126l0 193.683211c0 18.935258 15.369036 34.304294 34.304294 34.304294 18.936281 0 34.304294-15.369036 34.304294-34.304294L958.029496 105.442494C958.029496 77.999468 942.79963 65.09967 917.688719 65.09967L917.688719 65.09967z" p-id="1929" fill="#e6e6e6"></path>
|
|
58
|
-
<path d="M104.331183 957.013353l268.397866 0c18.935258 0 34.304294-15.368012 34.304294-34.304294 0-18.936281-15.369036-34.304294-34.304294-34.304294L179.045839 888.404766l218.176045-218.107483c12.830213-12.82919 12.830213-33.618679 0-46.515407-12.897751-12.830213-33.686217-12.830213-46.515407 0l-218.107483 218.176045L132.598994 648.27471c0-18.935258-15.368012-34.304294-34.304294-34.304294-18.936281 0-34.304294 15.369036-34.304294 34.304294l0 268.397866C63.989383 944.115602 79.288834 957.013353 104.331183 957.013353L104.331183 957.013353z" p-id="1930" fill="#e6e6e6"></path>
|
|
59
|
-
<path d="M958.029496 916.671553 958.029496 648.27471c0-18.935258-15.368012-34.304294-34.304294-34.304294-18.935258 0-34.304294 15.369036-34.304294 34.304294l0 193.683211L671.313425 623.781876c-12.82919-12.830213-33.618679-12.830213-46.515407 0-12.830213 12.897751-12.830213 33.686217 0 46.515407l218.176045 218.107483L649.290853 888.404766c-18.935258 0-34.304294 15.368012-34.304294 34.304294 0 18.936281 15.369036 34.304294 34.304294 34.304294l268.397866 0C942.79963 957.013353 958.029496 944.115602 958.029496 916.671553L958.029496 916.671553z" p-id="1931" fill="#e6e6e6"></path>
|
|
60
|
-
</svg>
|
|
61
|
-
`, O = /* @__PURE__ */ n((a, i, r = !1) => {
|
|
62
|
-
const o = a && typeof a[i] < "u";
|
|
63
|
-
return !o && r && console.warn("Typeguard warn!!! The object has no property: ", i), o;
|
|
64
|
-
}, "T"), pe = X({
|
|
65
|
-
name: "JsonEditor",
|
|
66
|
-
props: {
|
|
67
|
-
/**
|
|
68
|
-
* ### modelValue: unknown
|
|
69
|
-
* Pass the JSON value or string to be rendered in the JSONEditor.
|
|
70
|
-
* */
|
|
71
|
-
modelValue: [Object, Array, Number, String, Boolean, String, null],
|
|
72
|
-
/**
|
|
73
|
-
* ### value: unknown
|
|
74
|
-
* props value is an alternative to modelValue
|
|
75
|
-
* Pass the JSON value or string to be rendered in the JSONEditor.
|
|
76
|
-
* */
|
|
77
|
-
value: [Object, Array, Number, String, Boolean, String, null],
|
|
78
|
-
/**
|
|
79
|
-
* ### json: unknown
|
|
80
|
-
* Pass the JSON value to be rendered in the JSONEditor.
|
|
81
|
-
* */
|
|
82
|
-
json: [Object, Array, Number, String, Boolean, null],
|
|
83
|
-
/**
|
|
84
|
-
* ### text: string
|
|
85
|
-
* Pass the JSON string to be rendered in the JSONEditor.
|
|
86
|
-
* */
|
|
87
|
-
text: String,
|
|
88
|
-
/**
|
|
89
|
-
* ### jsonString: string
|
|
90
|
-
* Same as prop 'text'. Pass the JSON string to be rendered in the JSONEditor.
|
|
91
|
-
* */
|
|
92
|
-
jsonString: String,
|
|
93
|
-
/**
|
|
94
|
-
* ### selection: JSONEditorSelection | null.
|
|
95
|
-
* The current selected contents. You can use two-way binding using bind:selection. The tree mode
|
|
96
|
-
* supports MultiSelection, KeySelection, ValueSelection, InsideSelection, or AfterSelection. The
|
|
97
|
-
* table mode supports ValueSelection, and text mode supports TextSelection.
|
|
98
|
-
* */
|
|
99
|
-
selection: {
|
|
100
|
-
type: Object,
|
|
101
|
-
default: null
|
|
102
|
-
},
|
|
103
|
-
/**
|
|
104
|
-
* ### mode: 'tree' | 'text' | 'table'.
|
|
105
|
-
* Open the editor in 'tree' mode (default) or 'text' mode (formerly: code mode).
|
|
106
|
-
* */
|
|
107
|
-
mode: {
|
|
108
|
-
type: String,
|
|
109
|
-
default: "tree"
|
|
110
|
-
},
|
|
111
|
-
/**
|
|
112
|
-
* ### mainMenuBar: boolean
|
|
113
|
-
* Show the main menu bar. Default value is true.
|
|
114
|
-
* */
|
|
115
|
-
mainMenuBar: {
|
|
116
|
-
type: Boolean,
|
|
117
|
-
default: void 0
|
|
118
|
-
},
|
|
119
|
-
/**
|
|
120
|
-
* ### navigationBar: boolean
|
|
121
|
-
* Show the navigation bar with, where you can see the selected path and navigate through your
|
|
122
|
-
* document from there. Default value is true.
|
|
123
|
-
* */
|
|
124
|
-
navigationBar: {
|
|
125
|
-
type: Boolean,
|
|
126
|
-
default: void 0
|
|
127
|
-
},
|
|
128
|
-
/**
|
|
129
|
-
* ### statusBar: boolean
|
|
130
|
-
* Show a status bar at the bottom of the 'text' editor, showing information about the cursor
|
|
131
|
-
* location and selected contents. Default value is true.
|
|
132
|
-
* */
|
|
133
|
-
statusBar: {
|
|
134
|
-
type: Boolean,
|
|
135
|
-
default: void 0
|
|
136
|
-
},
|
|
137
|
-
/**
|
|
138
|
-
* ### askToFormat: boolean
|
|
139
|
-
* When true (default), the user will be asked whether he/she wants to format the JSON document
|
|
140
|
-
* when a compact document is loaded or pasted in 'text' mode. Only applicable to 'text' mode.
|
|
141
|
-
*/
|
|
142
|
-
askToFormat: {
|
|
143
|
-
type: Boolean,
|
|
144
|
-
default: void 0
|
|
145
|
-
},
|
|
146
|
-
/**
|
|
147
|
-
* ### readOnly: boolean
|
|
148
|
-
* Open the editor in read-only mode: no changes can be made, non-relevant buttons are hidden
|
|
149
|
-
* from the menu, and the context menu is not enabled. Default value is false.
|
|
150
|
-
* */
|
|
151
|
-
readOnly: {
|
|
152
|
-
type: Boolean,
|
|
153
|
-
default: void 0
|
|
154
|
-
},
|
|
155
|
-
/**
|
|
156
|
-
* ### indentation: number | string
|
|
157
|
-
* Number of spaces use for indentation when stringifying JSON, or a string to be used as indentation
|
|
158
|
-
* like '\t' to use a tab as indentation, or ' ' to use 4 spaces (which is equivalent to configuring
|
|
159
|
-
* indentation: 4). See also property tabSize.
|
|
160
|
-
* */
|
|
161
|
-
indentation: [String, Number],
|
|
162
|
-
/**
|
|
163
|
-
* ### tabSize: number
|
|
164
|
-
* When indentation is configured as a tab character (indentation: '\t'), tabSize configures how
|
|
165
|
-
* large a tab character is rendered. Default value is 4. Only applicable to text mode.
|
|
166
|
-
* */
|
|
167
|
-
tabSize: Number,
|
|
168
|
-
/**
|
|
169
|
-
* ### escapeControlCharacters: boolean.
|
|
170
|
-
* False by default. When true, control characters like newline and tab are rendered as escaped
|
|
171
|
-
* characters \n and \t. Only applicable for 'tree' mode, in 'text' mode control characters are
|
|
172
|
-
* always escaped.
|
|
173
|
-
* */
|
|
174
|
-
escapeControlCharacters: {
|
|
175
|
-
type: Boolean,
|
|
176
|
-
default: void 0
|
|
177
|
-
},
|
|
178
|
-
/**
|
|
179
|
-
* ### escapeUnicodeCharacters: boolean.
|
|
180
|
-
* False by default. When true, unicode characters like ☎ and 😀 are rendered escaped
|
|
181
|
-
* like \u260e and \ud83d\ude00.
|
|
182
|
-
* */
|
|
183
|
-
escapeUnicodeCharacters: {
|
|
184
|
-
type: Boolean,
|
|
185
|
-
default: void 0
|
|
186
|
-
},
|
|
187
|
-
/**
|
|
188
|
-
* ### flattenColumns: boolean.
|
|
189
|
-
* True by default. Only applicable to 'table' mode. When true, nested object properties
|
|
190
|
-
* will be displayed each in their own column, with the nested path as column name. When false,
|
|
191
|
-
* nested objects will be rendered inline, and double-clicking them will open them in a popup
|
|
192
|
-
* */
|
|
193
|
-
flattenColumns: {
|
|
194
|
-
type: Boolean,
|
|
195
|
-
default: void 0
|
|
196
|
-
},
|
|
197
|
-
/**
|
|
198
|
-
* ### validator: function (json: unknown): ValidationError[].
|
|
199
|
-
* Validate the JSON document. For example use the built-in JSON Schema validator
|
|
200
|
-
* powered by Ajv:
|
|
201
|
-
* ```ts
|
|
202
|
-
* import { createAjvValidator } from 'svelte-jsoneditor'
|
|
203
|
-
* const validator = createAjvValidator(schema, schemaDefinitions)
|
|
204
|
-
* ```
|
|
205
|
-
* */
|
|
206
|
-
validator: Function,
|
|
207
|
-
/**
|
|
208
|
-
* ### parser: JSON = JSON
|
|
209
|
-
* Configure a custom JSON parser, like lossless-json. By default, the native JSON
|
|
210
|
-
* parser of JavaScript is used. The JSON interface is an object with a parse and
|
|
211
|
-
* stringify function.
|
|
212
|
-
* */
|
|
213
|
-
parser: Object,
|
|
214
|
-
/**
|
|
215
|
-
* ### validationParser: JSONParser = JSON
|
|
216
|
-
* Only applicable when a validator is provided. This is the same as parser, except
|
|
217
|
-
* that this parser is used to parse the data before sending it to the validator.
|
|
218
|
-
* Configure a custom JSON parser that is used to parse JSON before passing it to the
|
|
219
|
-
* validator. By default, the built-in JSON parser is used. When passing a custom
|
|
220
|
-
* validationParser, make sure the output of the parser is supported by the configured
|
|
221
|
-
* validator. So, when the validationParser can output bigint numbers or other numeric
|
|
222
|
-
* types, the validator must also support that. In tree mode, when parser is not equal
|
|
223
|
-
* to validationParser, the JSON document will be converted before it is passed to the
|
|
224
|
-
* validator via validationParser.parse(parser.stringify(json))
|
|
225
|
-
* */
|
|
226
|
-
validationParser: Object,
|
|
227
|
-
/**
|
|
228
|
-
* ### pathParser: JSONPathParser
|
|
229
|
-
* An optional object with a parse and stringify method to parse and stringify a JSONPath,
|
|
230
|
-
* which is an array with property names. The pathParser is used in the path editor in the
|
|
231
|
-
* navigation bar, which is opened by clicking the edit button on the right side of the
|
|
232
|
-
* navigation bar. The pathParser.parse function is allowed to throw an Error when the input
|
|
233
|
-
* is invalid. By default, a JSON Path notation is used, which looks like $.data[2].nested.property.
|
|
234
|
-
* Alternatively, it is possible to use for example a JSON Pointer notation
|
|
235
|
-
* like /data/2/nested/property or something custom-made. Related helper functions:
|
|
236
|
-
* parseJSONPath and stringifyJSONPath, parseJSONPointer and compileJSONPointer
|
|
237
|
-
* */
|
|
238
|
-
pathParser: Object,
|
|
239
|
-
/**
|
|
240
|
-
* ### queryLanguagesIds: QueryLanguageId[].
|
|
241
|
-
* Configure one or multiple query language that can be used in the Transform modal.
|
|
242
|
-
* An array of available query languages id's
|
|
243
|
-
* [javascript', 'lodash', 'jmespath']
|
|
244
|
-
* */
|
|
245
|
-
queryLanguagesIds: Array,
|
|
246
|
-
/**
|
|
247
|
-
* ### queryLanguageId: string.
|
|
248
|
-
* The id of the currently selected query language.
|
|
249
|
-
* 'javascript' | 'lodash' | 'jmespath'
|
|
250
|
-
* */
|
|
251
|
-
queryLanguageId: String,
|
|
252
|
-
/**
|
|
253
|
-
* ### onClassName(path: Path, value: any): string | undefined.
|
|
254
|
-
* Add a custom class name to specific nodes, based on their path and/or value.
|
|
255
|
-
* */
|
|
256
|
-
onClassName: Function,
|
|
257
|
-
/**
|
|
258
|
-
* ### onRenderValue(props: RenderValueProps) : RenderValueComponentDescription[]
|
|
259
|
-
*
|
|
260
|
-
* ## EXPERIMENTAL! This API will most likely change in future versions.
|
|
261
|
-
* Customize rendering of the values. By default, renderValue is used, which renders a value as an
|
|
262
|
-
* editable div and depending on the value can also render a boolean toggle, a color picker, and a
|
|
263
|
-
* timestamp tag. Multiple components can be rendered alongside each other, like the boolean toggle
|
|
264
|
-
* and color picker being rendered left from the editable div. Built in value renderer components:
|
|
265
|
-
*
|
|
266
|
-
* > EditableValue, ReadonlyValue, BooleanToggle, ColorPicker, TimestampTag, EnumValue.
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
* ```ts
|
|
270
|
-
* import { renderJSONSchemaEnum, renderValue } from 'svelte-jsoneditor'
|
|
271
|
-
*
|
|
272
|
-
* function onRenderValue(props) {
|
|
273
|
-
* // use the enum renderer, and fallback on the default renderer
|
|
274
|
-
* return renderJSONSchemaEnum(props, schema, schemaDefinitions) || renderValue(props)
|
|
275
|
-
* }
|
|
276
|
-
* ```
|
|
277
|
-
* */
|
|
278
|
-
onRenderValue: Function,
|
|
279
|
-
/**
|
|
280
|
-
* ### onRenderMenu(items: MenuItem[], context: { mode: 'tree' | 'text' | 'table', modal: boolean }) : MenuItem[] | undefined.
|
|
281
|
-
* Callback which can be used to make changes to the menu items. New items can be added, or existing items can be removed or
|
|
282
|
-
* reorganized. When the function returns undefined, the original items will be applied. Using the context values mode and
|
|
283
|
-
* modal, different actions can be taken depending on the mode of the editor and whether the editor is rendered inside a
|
|
284
|
-
* modal or not.
|
|
285
|
-
*
|
|
286
|
-
* A menu item MenuItem can be one of the following types:
|
|
287
|
-
*
|
|
288
|
-
* - Button:
|
|
289
|
-
* ```ts
|
|
290
|
-
* interface MenuButtonItem {
|
|
291
|
-
* onClick: () => void
|
|
292
|
-
* icon?: FontAwesomeIcon
|
|
293
|
-
* text?: string
|
|
294
|
-
* title?: string
|
|
295
|
-
* className?: string
|
|
296
|
-
* disabled?: boolean
|
|
297
|
-
* }
|
|
298
|
-
* ```
|
|
299
|
-
*
|
|
300
|
-
* - Separator (gray vertical line between a group of items):
|
|
301
|
-
* ```ts
|
|
302
|
-
* interface MenuSeparatorItem {
|
|
303
|
-
* separator: true
|
|
304
|
-
* }
|
|
305
|
-
* ```
|
|
306
|
-
*
|
|
307
|
-
* - Space (fills up empty space):
|
|
308
|
-
* ```ts
|
|
309
|
-
* interface MenuSpaceItem {
|
|
310
|
-
* space: true
|
|
311
|
-
* }
|
|
312
|
-
* ```
|
|
313
|
-
* */
|
|
314
|
-
onRenderMenu: Function,
|
|
315
|
-
/**
|
|
316
|
-
* ### height: string | number
|
|
317
|
-
* Height of render container
|
|
318
|
-
* */
|
|
319
|
-
height: [String, Number],
|
|
320
|
-
/**
|
|
321
|
-
* ### fullWidthButton: boolean
|
|
322
|
-
* Show full screen button
|
|
323
|
-
* */
|
|
324
|
-
fullWidthButton: {
|
|
325
|
-
type: Boolean,
|
|
326
|
-
default: void 0
|
|
327
|
-
},
|
|
328
|
-
/**
|
|
329
|
-
* ### darkTheme: boolean
|
|
330
|
-
* Switch to dark theme
|
|
331
|
-
* */
|
|
332
|
-
darkTheme: {
|
|
333
|
-
type: Boolean,
|
|
334
|
-
default: void 0
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
emits: [
|
|
338
|
-
"update:modelValue",
|
|
339
|
-
"update:json",
|
|
340
|
-
"update:text",
|
|
341
|
-
"update:jsonString",
|
|
342
|
-
"update:selection",
|
|
343
|
-
"change",
|
|
344
|
-
"error",
|
|
345
|
-
"change-mode",
|
|
346
|
-
"update:mode",
|
|
347
|
-
"change-query-language",
|
|
348
|
-
"focus",
|
|
349
|
-
"blur"
|
|
350
|
-
],
|
|
351
|
-
setup(a, { expose: i, emit: r }) {
|
|
352
|
-
const o = Y("jsonEditorOptions", {}), c = v(), s = v(null), p = v(!1), h = v(!1), w = v(!1), f = v("tree"), l = v(null), E = m(() => {
|
|
353
|
-
const e = a.height || (o == null ? void 0 : o.height);
|
|
354
|
-
return e && !p.value ? {
|
|
355
|
-
height: e + "px"
|
|
356
|
-
} : {};
|
|
357
|
-
}), B = m(() => a.darkTheme || (o == null ? void 0 : o.darkTheme)), j = m(() => a.queryLanguagesIds || (o == null ? void 0 : o.queryLanguagesIds)), A = m(() => a.queryLanguageId || (o == null ? void 0 : o.queryLanguageId)), g = Z({}), N = /* @__PURE__ */ n(async () => {
|
|
358
|
-
var e;
|
|
359
|
-
if (typeof window > "u" || typeof j.value > "u" || !((e = j.value) != null && e.length))
|
|
360
|
-
return;
|
|
361
|
-
for (const d of j.value)
|
|
362
|
-
if (!g[d])
|
|
363
|
-
switch (d) {
|
|
364
|
-
case "javascript": {
|
|
365
|
-
const { javascriptQueryLanguage: u } = await import("../vanilla-jsoneditor-HKMtDzoB/index.js");
|
|
366
|
-
g[d] = u;
|
|
367
|
-
break;
|
|
368
|
-
}
|
|
369
|
-
case "lodash": {
|
|
370
|
-
const { lodashQueryLanguage: u } = await import("../vanilla-jsoneditor-HKMtDzoB/index.js");
|
|
371
|
-
g[d] = u;
|
|
372
|
-
break;
|
|
373
|
-
}
|
|
374
|
-
case "jmespath": {
|
|
375
|
-
const { jmespathQueryLanguage: u } = await import("../vanilla-jsoneditor-HKMtDzoB/index.js");
|
|
376
|
-
g[d] = u;
|
|
377
|
-
break;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
const t = Object.values(g);
|
|
381
|
-
if (t.length !== 0)
|
|
382
|
-
return t;
|
|
383
|
-
}, "N"), L = /* @__PURE__ */ n(() => {
|
|
384
|
-
s.value && (s.value.removeEventListener("click", b), s.value = null);
|
|
385
|
-
}, "L"), R = /* @__PURE__ */ n(async () => {
|
|
386
|
-
if (typeof window > "u")
|
|
387
|
-
return;
|
|
388
|
-
const { getElement: e, createElement: t } = await import("../full-width-button-handler-wnoSIg42/index.js"), { setFullWidthButtonStyle: d } = await import("../styles-handler-G8NSk43t/index.js");
|
|
389
|
-
await d();
|
|
390
|
-
const u = e(".jse-full-width"), D = (o == null ? void 0 : o.fullWidthButton) !== void 0 ? o == null ? void 0 : o.fullWidthButton : !0;
|
|
391
|
-
if (!(a.fullWidthButton !== void 0 ? a.fullWidthButton : D) || u)
|
|
392
|
-
return;
|
|
393
|
-
s.value && L();
|
|
394
|
-
const $ = e(".jse-menu"), _ = Array.from($.classList).find((K) => K.startsWith("svelte-"));
|
|
395
|
-
s.value = t("button"), s.value.classList.add("jse-full-width"), s.value.classList.add("jse-button"), s.value.classList.add(_), s.value.innerHTML += ve, $.appendChild(s.value), s.value.addEventListener("click", b);
|
|
396
|
-
}, "V"), b = /* @__PURE__ */ n(() => {
|
|
397
|
-
var e, t;
|
|
398
|
-
p.value = !p.value, p.value ? (e = s.value) == null || e.classList.add("jse-full-width--active") : (t = s.value) == null || t.classList.remove("jse-full-width--active");
|
|
399
|
-
}, "b"), S = /* @__PURE__ */ n(async (e) => {
|
|
400
|
-
var t;
|
|
401
|
-
f.value === "tree" && await ((t = l.value) == null ? void 0 : t.expand(() => e));
|
|
402
|
-
}, "C"), q = /* @__PURE__ */ n((e, t, d) => {
|
|
403
|
-
if (w.value) {
|
|
404
|
-
w.value = !1;
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
h.value = !0, O(e, "json") && (r("update:json", e.json), r("update:modelValue", e.json)), O(e, "text") && (r("update:text", e.text), r("update:jsonString", e.text), r("update:modelValue", e.text)), r("change", e, t, d);
|
|
408
|
-
}, "W"), V = /* @__PURE__ */ n((e) => {
|
|
409
|
-
r("error", e);
|
|
410
|
-
}, "q"), z = /* @__PURE__ */ n((e) => {
|
|
411
|
-
f.value = e, r("change-mode", e), r("update:mode", e);
|
|
412
|
-
}, "A"), F = /* @__PURE__ */ n((e) => {
|
|
413
|
-
r("change-query-language", e);
|
|
414
|
-
}, "I"), W = /* @__PURE__ */ n(() => {
|
|
415
|
-
r("focus");
|
|
416
|
-
}, "R"), I = /* @__PURE__ */ n(() => {
|
|
417
|
-
r("blur");
|
|
418
|
-
}, "z"), P = /* @__PURE__ */ n((e) => {
|
|
419
|
-
r("update:selection", e);
|
|
420
|
-
}, "J"), U = /* @__PURE__ */ n((e, t) => (T(() => {
|
|
421
|
-
R();
|
|
422
|
-
}), typeof a.onRenderMenu == "function" ? a.onRenderMenu(e, t) : e), "Q"), x = /* @__PURE__ */ n(async () => {
|
|
423
|
-
const e = { fullWidthButton: !0, ...o || {} }, t = await N();
|
|
424
|
-
return {
|
|
425
|
-
...ce(e, a),
|
|
426
|
-
queryLanguages: t,
|
|
427
|
-
queryLanguageId: A.value,
|
|
428
|
-
onChange: q,
|
|
429
|
-
onError: V,
|
|
430
|
-
onChangeMode: z,
|
|
431
|
-
onChangeQueryLanguage: F,
|
|
432
|
-
onFocus: W,
|
|
433
|
-
onBlur: I,
|
|
434
|
-
onRenderMenu: U,
|
|
435
|
-
onSelect: P
|
|
436
|
-
};
|
|
437
|
-
}, "j"), C = v(!0), k = /* @__PURE__ */ n(() => {
|
|
438
|
-
const e = /* @__PURE__ */ n((u = {}) => u === null || typeof u > "u" || typeof u == "number" || typeof u == "bigint" || typeof u == "string" || typeof u == "boolean" ? {
|
|
439
|
-
json: u
|
|
440
|
-
} : Array.isArray(u) ? {
|
|
441
|
-
json: [...u]
|
|
442
|
-
} : {
|
|
443
|
-
json: { ...u }
|
|
444
|
-
}, "e"), t = /* @__PURE__ */ n((u = "") => ({
|
|
445
|
-
text: u || ""
|
|
446
|
-
}), "t"), d = a.modelValue || a.value;
|
|
447
|
-
return d ? f.value === "text" && typeof d == "string" ? t(d) : e(d) : a.json ? e(a.json) : a.text ? t(a.text) : a.jsonString ? t(a.jsonString) : t();
|
|
448
|
-
}, "S"), Q = /* @__PURE__ */ n(async () => {
|
|
449
|
-
if (!(typeof window > "u")) {
|
|
450
|
-
if (!l.value) {
|
|
451
|
-
const e = await x(), { JSONEditor: t } = await import("../vanilla-jsoneditor-HKMtDzoB/index.js");
|
|
452
|
-
C.value = !1, l.value = new t({
|
|
453
|
-
target: c.value,
|
|
454
|
-
props: e
|
|
455
|
-
}), await l.value.set(k());
|
|
456
|
-
}
|
|
457
|
-
await l.value.focus();
|
|
458
|
-
}
|
|
459
|
-
}, "U"), M = /* @__PURE__ */ n(async () => {
|
|
460
|
-
const e = await x();
|
|
461
|
-
l.value.updateProps(e);
|
|
462
|
-
}, "x"), H = /* @__PURE__ */ n(() => {
|
|
463
|
-
if (h.value) {
|
|
464
|
-
h.value = !1;
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
w.value = !0, l.value.update(k());
|
|
468
|
-
}, "O"), J = /* @__PURE__ */ n(() => {
|
|
469
|
-
l.value && (l.value.destroy(), l.value = null), L();
|
|
470
|
-
}, "_");
|
|
471
|
-
return y(
|
|
472
|
-
[
|
|
473
|
-
...se.map((e) => () => a[e])
|
|
474
|
-
],
|
|
475
|
-
M,
|
|
476
|
-
{ deep: !0 }
|
|
477
|
-
), y(
|
|
478
|
-
[() => a.modelValue, () => a.value, () => a.json, () => a.text, () => a.jsonString],
|
|
479
|
-
H,
|
|
480
|
-
{
|
|
481
|
-
deep: !0
|
|
482
|
-
}
|
|
483
|
-
), y(
|
|
484
|
-
() => a.mode,
|
|
485
|
-
(e) => {
|
|
486
|
-
e !== f.value && (f.value = e, M());
|
|
487
|
-
}
|
|
488
|
-
), y(
|
|
489
|
-
() => B.value,
|
|
490
|
-
async (e) => {
|
|
491
|
-
if (e) {
|
|
492
|
-
const { setDarkThemeStyle: t } = await import("../styles-handler-G8NSk43t/index.js");
|
|
493
|
-
await t();
|
|
494
|
-
}
|
|
495
|
-
},
|
|
496
|
-
{ immediate: !0 }
|
|
497
|
-
), ee(() => {
|
|
498
|
-
T(() => {
|
|
499
|
-
Q();
|
|
500
|
-
});
|
|
501
|
-
}), te(() => {
|
|
502
|
-
J();
|
|
503
|
-
}), i({
|
|
504
|
-
async $collapseAll() {
|
|
505
|
-
await S(!1);
|
|
506
|
-
},
|
|
507
|
-
async $expandAll() {
|
|
508
|
-
await S(!0);
|
|
509
|
-
},
|
|
510
|
-
async $expand(e) {
|
|
511
|
-
var t;
|
|
512
|
-
await ((t = l.value) == null ? void 0 : t.expand(e));
|
|
513
|
-
},
|
|
514
|
-
$get() {
|
|
515
|
-
var e;
|
|
516
|
-
return (e = l.value) == null ? void 0 : e.get();
|
|
517
|
-
},
|
|
518
|
-
async $set(e) {
|
|
519
|
-
var t;
|
|
520
|
-
await ((t = l.value) == null ? void 0 : t.set(e));
|
|
521
|
-
},
|
|
522
|
-
async $update(e) {
|
|
523
|
-
var t;
|
|
524
|
-
await ((t = l.value) == null ? void 0 : t.update(e));
|
|
525
|
-
},
|
|
526
|
-
async $updateProps(e) {
|
|
527
|
-
var t;
|
|
528
|
-
await ((t = l.value) == null ? void 0 : t.updateProps(e));
|
|
529
|
-
},
|
|
530
|
-
async $refresh() {
|
|
531
|
-
var e;
|
|
532
|
-
await ((e = l.value) == null ? void 0 : e.refresh());
|
|
533
|
-
},
|
|
534
|
-
async $focus() {
|
|
535
|
-
var e;
|
|
536
|
-
await ((e = l.value) == null ? void 0 : e.focus());
|
|
537
|
-
},
|
|
538
|
-
async $destroy() {
|
|
539
|
-
var e;
|
|
540
|
-
await ((e = l.value) == null ? void 0 : e.destroy());
|
|
541
|
-
},
|
|
542
|
-
async $patch(e) {
|
|
543
|
-
var t;
|
|
544
|
-
return await ((t = l.value) == null ? void 0 : t.patch(e));
|
|
545
|
-
},
|
|
546
|
-
$transform(e) {
|
|
547
|
-
var t;
|
|
548
|
-
(t = l.value) == null || t.transform(e);
|
|
549
|
-
},
|
|
550
|
-
async $scrollTo(e) {
|
|
551
|
-
var t;
|
|
552
|
-
await ((t = l.value) == null ? void 0 : t.scrollTo(e));
|
|
553
|
-
},
|
|
554
|
-
$findElement(e) {
|
|
555
|
-
var t;
|
|
556
|
-
return (t = l.value) == null ? void 0 : t.findElement(e);
|
|
557
|
-
},
|
|
558
|
-
async $acceptAutoRepair() {
|
|
559
|
-
var e;
|
|
560
|
-
return await ((e = l.value) == null ? void 0 : e.acceptAutoRepair());
|
|
561
|
-
},
|
|
562
|
-
$validate() {
|
|
563
|
-
var e;
|
|
564
|
-
return (e = l.value) == null ? void 0 : e.validate();
|
|
565
|
-
}
|
|
566
|
-
}), {
|
|
567
|
-
max: p,
|
|
568
|
-
getHeight: E,
|
|
569
|
-
container: c,
|
|
570
|
-
darkThemeStyle: B,
|
|
571
|
-
fallbackSlot: C
|
|
572
|
-
};
|
|
573
|
-
}
|
|
574
|
-
}), fe = /* @__PURE__ */ n((a, i) => {
|
|
575
|
-
const r = a.__vccOpts || a;
|
|
576
|
-
for (const [o, c] of i)
|
|
577
|
-
r[o] = c;
|
|
578
|
-
return r;
|
|
579
|
-
}, "ve");
|
|
580
|
-
function ge(a, i, r, o, c, s) {
|
|
581
|
-
return ae(), ne("div", {
|
|
582
|
-
class: oe(["vue-ts-json-editor", { "vue-ts-json-editor--max-box": a.max, "jse-theme-dark": a.darkThemeStyle }]),
|
|
583
|
-
style: le(a.getHeight),
|
|
584
|
-
ref: "container",
|
|
585
|
-
onKeydown: i[0] || (i[0] = re(() => {
|
|
586
|
-
}, ["stop"]))
|
|
587
|
-
}, [
|
|
588
|
-
a.fallbackSlot ? ue(a.$slots, "default", { key: 0 }) : ie("", !0)
|
|
589
|
-
], 38);
|
|
590
|
-
}
|
|
591
|
-
n(ge, "ge");
|
|
592
|
-
const me = /* @__PURE__ */ fe(pe, [["render", ge]]);
|
|
593
|
-
me.install = () => {
|
|
594
|
-
console.error(`Default import not working!!! Use "import {JsonEditorPlugin} from 'vue3-ts-jsoneditor';"`);
|
|
595
|
-
};
|
|
596
|
-
export {
|
|
597
|
-
me as default
|
|
598
|
-
};
|
|
Binary file
|