@json-editor/json-editor 2.9.1 → 2.10.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.
- package/CHANGELOG.md +18 -0
- package/README.md +47 -1
- package/dist/jsoneditor.js +1 -1
- package/dist/jsoneditor.js.LICENSE.txt +1 -1
- package/dist/nonmin/jsoneditor.js +445 -124
- package/dist/nonmin/jsoneditor.js.map +1 -1
- package/docs/css_integration.html +17 -15
- package/docs/custom-editor.html +92 -0
- package/docs/index.html +4 -1
- package/docs/meta_schema.json +426 -398
- package/package.json +1 -1
- package/src/defaults.js +15 -1
- package/src/editor.js +23 -6
- package/src/editors/multiple.js +64 -7
- package/src/editors/object.js +0 -1
- package/src/iconlibs/bootstrap.js +28 -0
- package/src/iconlibs/index.js +2 -0
- package/src/resolvers.js +5 -2
- package/src/schemaloader.js +3 -1
- package/src/themes/bootstrap3.js +1 -1
- package/src/utilities.js +22 -0
- package/src/validator.js +93 -0
- package/tests/codeceptjs/constrains/contains_test.js +36 -0
- package/tests/codeceptjs/constrains/dependentSchemas_test.js +15 -0
- package/tests/codeceptjs/constrains/if-then-else_test.js +143 -0
- package/tests/codeceptjs/core_test.js +27 -27
- package/tests/codeceptjs/editors/advanced_test.js +11 -10
- package/tests/codeceptjs/editors/array_any_of_test.js +35 -35
- package/tests/codeceptjs/editors/array_test.js +757 -767
- package/tests/codeceptjs/editors/autocomplete_test.js +1 -3
- package/tests/codeceptjs/editors/button_test.js +25 -24
- package/tests/codeceptjs/editors/checkbox_test.js +17 -16
- package/tests/codeceptjs/editors/colorpicker_test.js +18 -16
- package/tests/codeceptjs/editors/datetime_test.js +7 -7
- package/tests/codeceptjs/editors/inheritance_test.js +7 -8
- package/tests/codeceptjs/editors/integer_test.js +71 -72
- package/tests/codeceptjs/editors/jodit_test.js +16 -17
- package/tests/codeceptjs/editors/multiselect_test.js +5 -5
- package/tests/codeceptjs/editors/number_test.js +64 -65
- package/tests/codeceptjs/editors/object_test.js +39 -13
- package/tests/codeceptjs/editors/option-no_default_values_test.js +4 -4
- package/tests/codeceptjs/editors/programmatic-changes_test.js +2 -3
- package/tests/codeceptjs/editors/range_test.js +1 -3
- package/tests/codeceptjs/editors/select_test.js +3 -5
- package/tests/codeceptjs/editors/stepper_test.js +5 -7
- package/tests/codeceptjs/editors/string_test.js +8 -8
- package/tests/codeceptjs/editors/table-confirm-delete_test.js +7 -9
- package/tests/codeceptjs/editors/uuid_test.js +10 -10
- package/tests/codeceptjs/editors/validation_test.js +1 -1
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1133_test.js +1 -3
- package/tests/codeceptjs/issues/issue-gh-1158-2_test.js +10 -0
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1158_test.js +0 -2
- package/tests/codeceptjs/issues/issue-gh-1164_test.js +10 -0
- package/tests/codeceptjs/issues/issue-gh-1211_test.js +17 -0
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1257_test.js +2 -4
- package/tests/codeceptjs/issues/issue-gh-1338_test.js +16 -0
- package/tests/codeceptjs/issues/issue-gh-1347_test.js +8 -0
- package/tests/codeceptjs/issues/issue-gh-795_test.js +13 -0
- package/tests/codeceptjs/issues/issue-gh-810_test.js +52 -0
- package/tests/codeceptjs/issues/issue-gh-812_test.js +25 -0
- package/tests/codeceptjs/meta-schema_test.js +10 -10
- package/tests/codeceptjs/schemaloader_test.js +7 -7
- package/tests/codeceptjs/themes_test.js +31 -0
- package/tests/pages/autocomplete.html +1 -0
- package/tests/pages/contains.html +38 -0
- package/tests/pages/dependentSchemas.html +52 -0
- package/tests/pages/if-else.html +57 -0
- package/tests/pages/if-then-else-allOf.html +117 -0
- package/tests/pages/if-then-else.html +64 -0
- package/tests/pages/if-then.html +57 -0
- package/tests/pages/issues/issue-gh-1158-2.html +189 -0
- package/tests/pages/issues/issue-gh-1165.html +63 -0
- package/tests/pages/issues/issue-gh-1165.json +8 -0
- package/tests/pages/issues/issue-gh-1211.html +1022 -0
- package/tests/pages/issues/issue-gh-1338.html +74 -0
- package/tests/pages/issues/issue-gh-1347.html +142 -0
- package/tests/pages/issues/issue-gh-795.html +58 -0
- package/tests/pages/issues/issue-gh-810.html +149 -0
- package/tests/pages/maxContains.html +39 -0
- package/tests/pages/meta-schema.html +28 -0
- package/tests/pages/meta_schema.json +426 -398
- package/tests/pages/minContains.html +39 -0
- package/tests/pages/option-dependencies.html +106 -0
- package/tests/pages/themes.html +3 -1
- package/tests/unit/core.spec.js +2 -5
- package/tests/codeceptjs/editors/issues/issue-gh-1164_test.js +0 -12
- package/tests/codeceptjs/editors/issues/issue-gh-812_test.js +0 -32
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>GitHub Issue 1158-2</title>
|
|
6
|
+
<link rel="stylesheet" id="theme-link" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
|
|
7
|
+
<link rel="stylesheet" id="iconlib-link" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css">
|
|
8
|
+
<script src="../../../dist/jsoneditor.js"></script>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div class="container">
|
|
12
|
+
<a href="https://github.com/json-editor/json-editor/issues/1158">GitHub Issue 1158</a>
|
|
13
|
+
<div id='editor_holder'></div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
var defaultSchema = {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"title": "Registro Telemático",
|
|
20
|
+
"description": "Formulario para automatizar el registo telemático de bienes muebles.",
|
|
21
|
+
"properties": {
|
|
22
|
+
"arrendatarios": {
|
|
23
|
+
"$ref": "#/definitions/arrendatarios"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"definitions": {
|
|
27
|
+
"idsuj": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"options": {
|
|
30
|
+
"keep_oneof_values": false
|
|
31
|
+
},
|
|
32
|
+
"properties": {
|
|
33
|
+
"type": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"options": {
|
|
36
|
+
"hidden": true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"oneOf": [
|
|
41
|
+
{
|
|
42
|
+
"title": "Full Name",
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"properties": {
|
|
45
|
+
"type": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"enum": [
|
|
48
|
+
"fullName"
|
|
49
|
+
],
|
|
50
|
+
"options": {
|
|
51
|
+
"hidden": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"fullName": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"title": "Full name"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"type": "object",
|
|
60
|
+
"options": {
|
|
61
|
+
"keep_oneof_values": false
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"title": "First and Last Name",
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"properties": {
|
|
68
|
+
"type": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"enum": [
|
|
71
|
+
"first-last-name"
|
|
72
|
+
],
|
|
73
|
+
"options": {
|
|
74
|
+
"hidden": true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"firstName": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"title": "First name"
|
|
80
|
+
},
|
|
81
|
+
"lastName": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"title": "Last name"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"type": "object",
|
|
87
|
+
"options": {
|
|
88
|
+
"keep_oneof_values": false
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"title": "Other name",
|
|
93
|
+
"additionalProperties": false,
|
|
94
|
+
"properties": {
|
|
95
|
+
"type": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"enum": [
|
|
98
|
+
"other-name"
|
|
99
|
+
],
|
|
100
|
+
"options": {
|
|
101
|
+
"hidden": true
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"otherFirstName": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
},
|
|
107
|
+
"otherLastName": {
|
|
108
|
+
"type": "string"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"type": "object",
|
|
112
|
+
"options": {
|
|
113
|
+
"keep_oneof_values": false
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"title": "More name",
|
|
118
|
+
"additionalProperties": false,
|
|
119
|
+
"properties": {
|
|
120
|
+
"type": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"enum": [
|
|
123
|
+
"more-name"
|
|
124
|
+
],
|
|
125
|
+
"options": {
|
|
126
|
+
"hidden": true
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"moreFullName": {
|
|
130
|
+
"type": "string"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"type": "object",
|
|
134
|
+
"options": {
|
|
135
|
+
"keep_oneof_values": false
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"arrendatarios": {
|
|
141
|
+
"title": "ARRENDATARIOS",
|
|
142
|
+
"description": "Arrendatarios del contrato",
|
|
143
|
+
"type": "array",
|
|
144
|
+
"items": {
|
|
145
|
+
"title": "ARRENDATARIO",
|
|
146
|
+
"type": "object",
|
|
147
|
+
"properties": {
|
|
148
|
+
"LSR04": {
|
|
149
|
+
"title": "Identificación del sujeto",
|
|
150
|
+
"$ref": "#/definitions/idsuj"
|
|
151
|
+
},
|
|
152
|
+
"representantes": {
|
|
153
|
+
"title": "Representantes",
|
|
154
|
+
"type": "array",
|
|
155
|
+
"items": {
|
|
156
|
+
"title": "REPRESENTANTE",
|
|
157
|
+
"properties": {
|
|
158
|
+
"LSR07": {
|
|
159
|
+
"$ref": "#/definitions/rep"
|
|
160
|
+
},
|
|
161
|
+
"LSR10": {
|
|
162
|
+
"$ref": "#/definitions/idsuj"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"defaultProperties": [
|
|
169
|
+
"LSR04",
|
|
170
|
+
"representantes"
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"defaultProperties": [
|
|
176
|
+
"arrendatarios"
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
var editor = new JSONEditor(document.getElementById('editor_holder'),{
|
|
181
|
+
iconlib: 'fontawesome5',
|
|
182
|
+
object_layout: 'normal',
|
|
183
|
+
schema: defaultSchema,
|
|
184
|
+
show_errors: 'always',
|
|
185
|
+
theme: 'bootstrap4'
|
|
186
|
+
});
|
|
187
|
+
</script>
|
|
188
|
+
</body>
|
|
189
|
+
</html>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>GitHub Issue 1165</title>
|
|
6
|
+
<script src="../../../dist/jsoneditor.js"></script>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<h1><a href="https://github.com/json-editor/json-editor/issues/1165">GitHub Issue 1165</a></h1>
|
|
10
|
+
<div id='editor_holder'></div>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
href = window.location.href.split('/')
|
|
14
|
+
href.pop()
|
|
15
|
+
href = href.join('/')
|
|
16
|
+
var refURL = href + "/issue-gh-1165.json"
|
|
17
|
+
|
|
18
|
+
var schema = {
|
|
19
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
20
|
+
"type": "object",
|
|
21
|
+
"properties": {
|
|
22
|
+
"selections": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": {
|
|
25
|
+
"oneOf": [
|
|
26
|
+
{
|
|
27
|
+
"$ref": refURL
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"other": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": {
|
|
38
|
+
"$ref": refURL
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"required": [
|
|
43
|
+
"selections"
|
|
44
|
+
],
|
|
45
|
+
"definitions": {
|
|
46
|
+
"objectDef": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"properties": {
|
|
49
|
+
"value": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
var editor = new JSONEditor(document.getElementById('editor_holder'),{
|
|
58
|
+
schema: schema,
|
|
59
|
+
ajax: true
|
|
60
|
+
})
|
|
61
|
+
</script>
|
|
62
|
+
</body>
|
|
63
|
+
</html>
|