jpf 5.0.3 → 5.0.7
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/dist/controls/codeMirror/Editor/Editor.d.ts +19 -0
- package/dist/controls/codeMirror/Editor/Editor.js +151 -0
- package/dist/controls/codeMirror/Editor/Editor.js.map +1 -0
- package/dist/controls/codeMirror/index.d.ts +1 -2
- package/dist/controls/codeMirror/index.js +1 -2
- package/dist/controls/codeMirror/index.js.map +1 -1
- package/dist/controls/custom/FileSelector/FileSelector.d.ts +18 -18
- package/dist/controls/custom/FileSelector/FileSelector.js +47 -46
- package/dist/controls/custom/FileSelector/FileSelector.js.map +1 -1
- package/dist/controls/custom/LabeledControl/LabeledControl.d.ts +15 -15
- package/dist/controls/custom/LabeledControl/LabeledControl.js +31 -36
- package/dist/controls/custom/LabeledControl/LabeledControl.js.map +1 -1
- package/dist/controls/custom/ListItem/ListItem.d.ts +37 -36
- package/dist/controls/custom/ListItem/ListItem.js +62 -62
- package/dist/controls/custom/ListItem/ListItem.js.map +1 -1
- package/dist/controls/custom/index.d.ts +3 -3
- package/dist/controls/custom/index.js +3 -3
- package/dist/controls/html/Button/Button.d.ts +16 -16
- package/dist/controls/html/Button/Button.js +47 -50
- package/dist/controls/html/Button/Button.js.map +1 -1
- package/dist/controls/html/Div/Div.d.ts +14 -14
- package/dist/controls/html/Div/Div.js +23 -24
- package/dist/controls/html/Div/Div.js.map +1 -1
- package/dist/controls/html/Image/Image.d.ts +16 -16
- package/dist/controls/html/Image/Image.js +29 -28
- package/dist/controls/html/Image/Image.js.map +1 -1
- package/dist/controls/html/Input/Input.d.ts +34 -34
- package/dist/controls/html/Input/Input.js +166 -170
- package/dist/controls/html/Input/Input.js.map +1 -1
- package/dist/controls/html/Select/Select.d.ts +30 -30
- package/dist/controls/html/Select/Select.js +109 -110
- package/dist/controls/html/Select/Select.js.map +1 -1
- package/dist/controls/html/Span/Span.d.ts +11 -11
- package/dist/controls/html/Span/Span.js +22 -22
- package/dist/controls/html/Span/Span.js.map +1 -1
- package/dist/controls/html/index.d.ts +6 -6
- package/dist/controls/html/index.js +6 -6
- package/dist/controls/index.d.ts +14 -14
- package/dist/controls/index.js +14 -14
- package/dist/controls/index.js.map +1 -1
- package/dist/controls/{jsonViewAwesome → jsonViewerAwesome}/index.d.ts +1 -1
- package/dist/controls/{jsonViewAwesome → jsonViewerAwesome}/index.js +1 -1
- package/dist/controls/jsonViewerAwesome/index.js.map +1 -0
- package/dist/controls/jsonViewerAwesome/jsonFormatter/JsonFormatter.d.ts +28 -0
- package/dist/controls/{jsonViewAwesome → jsonViewerAwesome}/jsonFormatter/JsonFormatter.js +65 -65
- package/dist/controls/jsonViewerAwesome/jsonFormatter/JsonFormatter.js.map +1 -0
- package/dist/controls/kendo/Chart/Chart.d.ts +19 -19
- package/dist/controls/kendo/Chart/Chart.js +62 -62
- package/dist/controls/kendo/Chart/Chart.js.map +1 -1
- package/dist/controls/kendo/Culture/Culture.d.ts +1 -1
- package/dist/controls/kendo/Culture/Culture.js +25 -25
- package/dist/controls/kendo/Culture/Culture.js.map +1 -1
- package/dist/controls/kendo/DataSource/DataSource.d.ts +4 -4
- package/dist/controls/kendo/DataSource/DataSource.js +1 -1
- package/dist/controls/kendo/Editor/Editor.d.ts +14 -19
- package/dist/controls/kendo/Editor/Editor.js +94 -104
- package/dist/controls/kendo/Editor/Editor.js.map +1 -1
- package/dist/controls/kendo/Grid/Grid.d.ts +54 -54
- package/dist/controls/kendo/Grid/Grid.js +201 -218
- package/dist/controls/kendo/Grid/Grid.js.map +1 -1
- package/dist/controls/kendo/Menu/Menu.d.ts +15 -15
- package/dist/controls/kendo/Menu/Menu.js +90 -90
- package/dist/controls/kendo/Menu/Menu.js.map +1 -1
- package/dist/controls/kendo/ObservableObject/ObservableObject.d.ts +0 -5
- package/dist/controls/kendo/ObservableObject/ObservableObject.js +0 -34
- package/dist/controls/kendo/ObservableObject/ObservableObject.js.map +1 -1
- package/dist/controls/kendo/Treeview/Treeview.d.ts +17 -0
- package/dist/controls/kendo/{Tree/Tree.js → Treeview/Treeview.js} +107 -107
- package/dist/controls/kendo/Treeview/Treeview.js.map +1 -0
- package/dist/controls/kendo/Window/Window.d.ts +14 -0
- package/dist/controls/kendo/{Dialog/Dialog.js → Window/Window.js} +49 -49
- package/dist/controls/kendo/Window/Window.js.map +1 -0
- package/dist/controls/kendo/index.d.ts +8 -9
- package/dist/controls/kendo/index.js +8 -9
- package/dist/controls/kendo/index.js.map +1 -1
- package/dist/controls/leaflet/LabelControl/LabelControl.d.ts +12 -12
- package/dist/controls/leaflet/LabelControl/LabelControl.js +33 -33
- package/dist/controls/leaflet/LabelControl/LabelControl.js.map +1 -1
- package/dist/controls/leaflet/Map/Map.d.ts +45 -45
- package/dist/controls/leaflet/Map/Map.js +116 -115
- package/dist/controls/leaflet/Map/Map.js.map +1 -1
- package/dist/controls/leaflet/OpenStreetMapTileLayer/OpenStreetMapTileLayer.d.ts +8 -8
- package/dist/controls/leaflet/OpenStreetMapTileLayer/OpenStreetMapTileLayer.js +13 -13
- package/dist/controls/leaflet/OpenStreetMapTileLayer/OpenStreetMapTileLayer.js.map +1 -1
- package/dist/controls/leaflet/PointerEvent/PointerEvent.d.ts +2 -2
- package/dist/controls/leaflet/PointerEvent/PointerEvent.js +7 -7
- package/dist/controls/leaflet/PointerEvent/PointerEvent.js.map +1 -1
- package/dist/controls/leaflet/index.d.ts +4 -4
- package/dist/controls/leaflet/index.js +4 -4
- package/dist/controls/svg/Circle/Circle.d.ts +12 -12
- package/dist/controls/svg/Circle/Circle.js +20 -20
- package/dist/controls/svg/Circle/Circle.js.map +1 -1
- package/dist/controls/svg/Ellipse/Ellipse.d.ts +13 -13
- package/dist/controls/svg/Ellipse/Ellipse.js +21 -21
- package/dist/controls/svg/Ellipse/Ellipse.js.map +1 -1
- package/dist/controls/svg/ForeignObject/ForeignObject.d.ts +15 -14
- package/dist/controls/svg/ForeignObject/ForeignObject.js +21 -22
- package/dist/controls/svg/ForeignObject/ForeignObject.js.map +1 -1
- package/dist/controls/svg/Group/Group.d.ts +15 -14
- package/dist/controls/svg/Group/Group.js +21 -22
- package/dist/controls/svg/Group/Group.js.map +1 -1
- package/dist/controls/svg/Line/Line.d.ts +13 -13
- package/dist/controls/svg/Line/Line.js +21 -21
- package/dist/controls/svg/Line/Line.js.map +1 -1
- package/dist/controls/svg/Pattern/Pattern.d.ts +22 -22
- package/dist/controls/svg/Pattern/Pattern.js +22 -23
- package/dist/controls/svg/Pattern/Pattern.js.map +1 -1
- package/dist/controls/svg/Polygon/Polygon.d.ts +11 -11
- package/dist/controls/svg/Polygon/Polygon.js +20 -20
- package/dist/controls/svg/Polygon/Polygon.js.map +1 -1
- package/dist/controls/svg/Polyline/Polyline.d.ts +11 -11
- package/dist/controls/svg/Polyline/Polyline.js +19 -19
- package/dist/controls/svg/Polyline/Polyline.js.map +1 -1
- package/dist/controls/svg/Rectangle/Rectangle.d.ts +13 -13
- package/dist/controls/svg/Rectangle/Rectangle.js +21 -21
- package/dist/controls/svg/Rectangle/Rectangle.js.map +1 -1
- package/dist/controls/svg/Svg/Svg.d.ts +17 -17
- package/dist/controls/svg/Svg/Svg.js +23 -24
- package/dist/controls/svg/Svg/Svg.js.map +1 -1
- package/dist/controls/svg/Text/Text.d.ts +14 -14
- package/dist/controls/svg/Text/Text.js +22 -22
- package/dist/controls/svg/Text/Text.js.map +1 -1
- package/dist/controls/svg/Title/Title.d.ts +10 -10
- package/dist/controls/svg/Title/Title.js +16 -16
- package/dist/controls/svg/Title/Title.js.map +1 -1
- package/dist/controls/svg/index.d.ts +13 -13
- package/dist/controls/svg/index.js +13 -13
- package/dist/controls/svg/svg.d.ts +6 -6
- package/dist/controls/svg/svg.js +12 -12
- package/dist/controls/svg/svg.js.map +1 -1
- package/dist/framework/attributes.d.ts +90 -90
- package/dist/framework/attributes.js +1 -1
- package/dist/framework/{View.d.ts → element.d.ts} +61 -62
- package/dist/framework/{View.js → element.js} +157 -150
- package/dist/framework/element.js.map +1 -0
- package/dist/framework/event.d.ts +80 -80
- package/dist/framework/event.js +25 -25
- package/dist/framework/event.js.map +1 -1
- package/dist/framework/observable.d.ts +37 -12
- package/dist/framework/observable.js +66 -58
- package/dist/framework/observable.js.map +1 -1
- package/dist/framework/properties.d.ts +40 -0
- package/dist/framework/{ViewModel.js → properties.js} +303 -312
- package/dist/framework/properties.js.map +1 -0
- package/dist/framework/root.d.ts +9 -0
- package/dist/framework/root.js +38 -0
- package/dist/framework/root.js.map +1 -0
- package/dist/framework/style.d.ts +657 -658
- package/dist/framework/style.js +146 -153
- package/dist/framework/style.js.map +1 -1
- package/dist/framework/types.d.ts +87 -87
- package/dist/framework/types.js +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/utilities/blob/blob.d.ts +1 -1
- package/dist/utilities/blob/blob.js +17 -17
- package/dist/utilities/blob/blob.js.map +1 -1
- package/dist/utilities/contextMenu/contextMenu.d.ts +2 -0
- package/dist/utilities/contextMenu/contextMenu.js +11 -0
- package/dist/utilities/contextMenu/contextMenu.js.map +1 -0
- package/dist/utilities/cookie/cookie.d.ts +3 -3
- package/dist/utilities/cookie/cookie.js +26 -26
- package/dist/utilities/cookie/cookie.js.map +1 -1
- package/dist/utilities/dataReaderTable/dataReaderTable.d.ts +9 -9
- package/dist/utilities/dataReaderTable/dataReaderTable.js +23 -23
- package/dist/utilities/dataReaderTable/dataReaderTable.js.map +1 -1
- package/dist/utilities/fetch/fetch.d.ts +7 -8
- package/dist/utilities/fetch/fetch.js +139 -137
- package/dist/utilities/fetch/fetch.js.map +1 -1
- package/dist/utilities/float/float.d.ts +1 -1
- package/dist/utilities/float/float.js +3 -3
- package/dist/utilities/formData/formData.d.ts +1 -1
- package/dist/utilities/formData/formData.js +11 -11
- package/dist/utilities/formData/formData.js.map +1 -1
- package/dist/utilities/formatting/formatting.d.ts +4 -0
- package/dist/utilities/formatting/formatting.js +26 -0
- package/dist/utilities/formatting/formatting.js.map +1 -0
- package/dist/utilities/htmlElement/htmlElement.d.ts +1 -1
- package/dist/utilities/htmlElement/htmlElement.js +16 -16
- package/dist/utilities/htmlElement/htmlElement.js.map +1 -1
- package/dist/utilities/image/image.d.ts +1 -1
- package/dist/utilities/image/image.js +1 -1
- package/dist/utilities/index.d.ts +40 -36
- package/dist/utilities/index.js +40 -36
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/integer/integer.d.ts +3 -3
- package/dist/utilities/integer/integer.js +27 -27
- package/dist/utilities/integer/integer.js.map +1 -1
- package/dist/utilities/key/key.d.ts +2 -2
- package/dist/utilities/key/key.js +6 -6
- package/dist/utilities/navigator/navigator.d.ts +1 -1
- package/dist/utilities/navigator/navigator.js +8 -8
- package/dist/utilities/navigator/navigator.js.map +1 -1
- package/dist/utilities/notification/notification.d.ts +5 -5
- package/dist/utilities/notification/notification.js +66 -66
- package/dist/utilities/notification/notification.js.map +1 -1
- package/dist/utilities/querystring/querystring.d.ts +6 -6
- package/dist/utilities/querystring/querystring.js +53 -53
- package/dist/utilities/querystring/querystring.js.map +1 -1
- package/dist/utilities/router/router.d.ts +19 -19
- package/dist/utilities/router/router.js +80 -80
- package/dist/utilities/router/router.js.map +1 -1
- package/dist/utilities/stylesheet/stylesheet.d.ts +2 -2
- package/dist/utilities/stylesheet/stylesheet.js +47 -47
- package/dist/utilities/stylesheet/stylesheet.js.map +1 -1
- package/dist/utilities/uniqueId/uniqueId.d.ts +1 -1
- package/dist/utilities/uniqueId/uniqueId.js +4 -4
- package/dist/{framework → utilities/userAgent}/userAgent.d.ts +31 -31
- package/dist/{framework → utilities/userAgent}/userAgent.js +46 -46
- package/dist/utilities/userAgent/userAgent.js.map +1 -0
- package/dist/utilities/webSocket/webSocket.d.ts +1 -1
- package/dist/utilities/webSocket/webSocket.js +54 -54
- package/dist/utilities/webSocket/webSocket.js.map +1 -1
- package/package.json +15 -11
- package/src/controls/codeMirror/Editor/Editor.ts +207 -0
- package/src/controls/codeMirror/index.ts +1 -2
- package/src/controls/custom/FileSelector/FileSelector.ts +30 -28
- package/src/controls/custom/LabeledControl/LabeledControl.ts +32 -36
- package/src/controls/custom/ListItem/ListItem.ts +37 -37
- package/src/controls/html/Button/Button.ts +37 -30
- package/src/controls/html/Div/Div.ts +20 -21
- package/src/controls/html/Image/Image.ts +22 -20
- package/src/controls/html/Input/Input.ts +63 -65
- package/src/controls/html/Select/Select.ts +39 -41
- package/src/controls/html/Span/Span.ts +14 -14
- package/src/controls/index.ts +2 -2
- package/src/controls/{jsonViewAwesome → jsonViewerAwesome}/jsonFormatter/JsonFormatter.ts +24 -24
- package/src/controls/kendo/Chart/Chart.ts +37 -37
- package/src/controls/kendo/DataSource/DataSource.ts +1 -1
- package/src/controls/kendo/Editor/Editor.ts +59 -69
- package/src/controls/kendo/Grid/Grid.ts +81 -84
- package/src/controls/kendo/Menu/Menu.ts +24 -24
- package/src/controls/kendo/ObservableObject/ObservableObject.ts +45 -45
- package/src/controls/kendo/{Tree/Tree.ts → Treeview/Treeview.ts} +17 -17
- package/src/controls/kendo/{Dialog/Dialog.ts → Window/Window.ts} +21 -19
- package/src/controls/kendo/index.ts +3 -3
- package/src/controls/leaflet/LabelControl/LabelControl.ts +10 -10
- package/src/controls/leaflet/Map/Map.ts +44 -41
- package/src/controls/leaflet/OpenStreetMapTileLayer/OpenStreetMapTileLayer.ts +3 -3
- package/src/controls/svg/Circle/Circle.ts +14 -14
- package/src/controls/svg/Ellipse/Ellipse.ts +15 -15
- package/src/controls/svg/ForeignObject/ForeignObject.ts +19 -20
- package/src/controls/svg/Group/Group.ts +19 -19
- package/src/controls/svg/Line/Line.ts +15 -15
- package/src/controls/svg/Pattern/Pattern.ts +25 -25
- package/src/controls/svg/Polygon/Polygon.ts +13 -13
- package/src/controls/svg/Polyline/Polyline.ts +13 -13
- package/src/controls/svg/Rectangle/Rectangle.ts +15 -15
- package/src/controls/svg/Svg/Svg.ts +19 -19
- package/src/controls/svg/Text/Text.ts +16 -16
- package/src/controls/svg/Title/Title.ts +12 -12
- package/src/controls/svg/svg.ts +4 -4
- package/src/framework/attributes.ts +46 -46
- package/src/framework/{View.ts → element.ts} +54 -41
- package/src/framework/event.ts +7 -7
- package/src/framework/observable.ts +93 -60
- package/src/framework/properties.ts +393 -0
- package/src/framework/root.ts +45 -0
- package/src/framework/style.ts +330 -340
- package/src/index.ts +4 -4
- package/src/utilities/contextMenu/contextMenu.ts +16 -0
- package/src/utilities/fetch/fetch.ts +16 -14
- package/src/utilities/formatting/formatting.ts +29 -0
- package/src/utilities/index.ts +7 -3
- package/src/utilities/router/router.ts +3 -3
- package/dist/controls/codeMirror/HtmlEditor/HtmlEditor.d.ts +0 -16
- package/dist/controls/codeMirror/HtmlEditor/HtmlEditor.js +0 -120
- package/dist/controls/codeMirror/HtmlEditor/HtmlEditor.js.map +0 -1
- package/dist/controls/codeMirror/JsonEditor/JsonEditor.d.ts +0 -16
- package/dist/controls/codeMirror/JsonEditor/JsonEditor.js +0 -104
- package/dist/controls/codeMirror/JsonEditor/JsonEditor.js.map +0 -1
- package/dist/controls/jsonViewAwesome/index.js.map +0 -1
- package/dist/controls/jsonViewAwesome/jsonFormatter/JsonFormatter.d.ts +0 -28
- package/dist/controls/jsonViewAwesome/jsonFormatter/JsonFormatter.js.map +0 -1
- package/dist/controls/kendo/Dialog/Dialog.d.ts +0 -14
- package/dist/controls/kendo/Dialog/Dialog.js.map +0 -1
- package/dist/controls/kendo/Tree/Tree.d.ts +0 -17
- package/dist/controls/kendo/Tree/Tree.js.map +0 -1
- package/dist/framework/View.js.map +0 -1
- package/dist/framework/ViewModel.d.ts +0 -42
- package/dist/framework/ViewModel.js.map +0 -1
- package/dist/framework/userAgent.js.map +0 -1
- package/dist/utilities/html/html.d.ts +0 -1
- package/dist/utilities/html/html.js +0 -8
- package/dist/utilities/html/html.js.map +0 -1
- package/src/controls/codeMirror/HtmlEditor/HtmlEditor.ts +0 -153
- package/src/controls/codeMirror/JsonEditor/JsonEditor.ts +0 -136
- package/src/framework/ViewModel.ts +0 -528
- package/src/utilities/html/html.ts +0 -8
- /package/src/controls/{jsonViewAwesome → jsonViewerAwesome}/index.ts +0 -0
- /package/src/{framework → utilities/userAgent}/userAgent.ts +0 -0
|
@@ -1,111 +1,110 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
emptyOption.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
option.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
registerView(SelectViewModel, SelectView);
|
|
1
|
+
import { Element, registerElement } from "../../../framework/element";
|
|
2
|
+
import { Properties, extendProperties } from "../../../framework/properties";
|
|
3
|
+
import { unwrap, isSubscribable, isObservableValue } from "../../../framework/observable";
|
|
4
|
+
export class SelectElement extends Element {
|
|
5
|
+
constructor(properties) {
|
|
6
|
+
super({
|
|
7
|
+
tagName: "select",
|
|
8
|
+
properties: extendProperties(properties, {
|
|
9
|
+
elementType: "Select"
|
|
10
|
+
})
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
build() {
|
|
14
|
+
super.build();
|
|
15
|
+
const select = this.element;
|
|
16
|
+
const properties = this.properties;
|
|
17
|
+
this.setItems(unwrap(properties.items));
|
|
18
|
+
if (isSubscribable(properties.items)) {
|
|
19
|
+
this.disposers.push(properties.items.subscribe((items) => {
|
|
20
|
+
this.setItems(items);
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
this.setSelectedValue(unwrap(properties.value));
|
|
24
|
+
if (isSubscribable(properties.value)) {
|
|
25
|
+
this.disposers.push(properties.value.subscribe((value) => {
|
|
26
|
+
this.setSelectedValue(value);
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
this.element.addEventListener("change", async (event) => {
|
|
30
|
+
let selectedValue = select.value;
|
|
31
|
+
let selectedItem = null;
|
|
32
|
+
if (selectedValue + "" === "") {
|
|
33
|
+
selectedValue = null;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
selectedItem = this.itemDictionary[selectedValue.toString()];
|
|
37
|
+
selectedValue = this.properties.valueFunction(selectedItem);
|
|
38
|
+
}
|
|
39
|
+
if (properties.inputValidator) {
|
|
40
|
+
if (!await properties.inputValidator(event, properties, selectedValue)) {
|
|
41
|
+
select.value = unwrap(properties.value);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
;
|
|
45
|
+
}
|
|
46
|
+
if (isObservableValue(properties.value)) {
|
|
47
|
+
if (properties.setFunction) {
|
|
48
|
+
const setValue = properties.setFunction(selectedItem);
|
|
49
|
+
properties.value.setValueInAction(setValue);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
properties.value.setValueInAction(selectedValue);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
itemDictionary;
|
|
58
|
+
setItems(items) {
|
|
59
|
+
if (this.element) {
|
|
60
|
+
this.itemDictionary = {};
|
|
61
|
+
if (items) {
|
|
62
|
+
const select = this.element;
|
|
63
|
+
select.innerHTML = null;
|
|
64
|
+
if (this.properties.emptyItemText) {
|
|
65
|
+
const emptyOption = document.createElement("option");
|
|
66
|
+
emptyOption.value = "";
|
|
67
|
+
emptyOption.text = this.properties.emptyItemText;
|
|
68
|
+
select.options.add(emptyOption);
|
|
69
|
+
}
|
|
70
|
+
items.forEach((item) => {
|
|
71
|
+
const value = this.properties.valueFunction(item).toString();
|
|
72
|
+
this.itemDictionary[value] = item;
|
|
73
|
+
var option = document.createElement("option");
|
|
74
|
+
option.value = value;
|
|
75
|
+
option.text = this.properties.textFunction(item);
|
|
76
|
+
select.options.add(option);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
setSelectedValue(value) {
|
|
82
|
+
if (this.element) {
|
|
83
|
+
const select = this.element;
|
|
84
|
+
if (value === null || value === undefined) {
|
|
85
|
+
select.value = "";
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
select.value = value.toString();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export function createSelect(properties) {
|
|
94
|
+
return new SelectElement(properties);
|
|
95
|
+
}
|
|
96
|
+
export class SelectProperties extends Properties {
|
|
97
|
+
constructor(properties) {
|
|
98
|
+
super();
|
|
99
|
+
this.setProperties(this, properties);
|
|
100
|
+
}
|
|
101
|
+
value;
|
|
102
|
+
items;
|
|
103
|
+
textFunction;
|
|
104
|
+
valueFunction;
|
|
105
|
+
setFunction;
|
|
106
|
+
inputValidator;
|
|
107
|
+
emptyItemText;
|
|
108
|
+
}
|
|
109
|
+
registerElement(SelectProperties.prototype.constructor, SelectElement);
|
|
111
110
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/controls/html/Select/Select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/controls/html/Select/Select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAe,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAiB,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAWzG,MAAM,OAAO,aAA+C,SAAQ,OAAkD;IAClH,YAAY,UAAqD;QAC7D,KAAK,CACD;YACI,OAAO,EAAE,QAAQ;YACjB,UAAU,EAAE,gBAAgB,CACxB,UAAU,EACV;gBACI,WAAW,EAAE,QAAQ;aACxB,CACJ;SACJ,CACJ,CAAC;IACN,CAAC;IAGS,KAAK;QACX,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,MAAM,MAAM,GAAG,IAAI,CAAC,OAA4B,CAAC;QAEjD,MAAM,UAAU,GAAG,IAAI,CAAC,UAA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AC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export interface
|
|
4
|
-
}
|
|
5
|
-
export declare class
|
|
6
|
-
constructor(properties:
|
|
7
|
-
}
|
|
8
|
-
export declare function
|
|
9
|
-
export declare class
|
|
10
|
-
constructor(properties: SpanProperties);
|
|
11
|
-
}
|
|
1
|
+
import { Element } from "../../../framework/element";
|
|
2
|
+
import { Properties, IProperties } from "../../../framework/properties";
|
|
3
|
+
export interface ISpanProperties extends IProperties {
|
|
4
|
+
}
|
|
5
|
+
export declare class SpanElement extends Element<ISpanProperties> {
|
|
6
|
+
constructor(properties: ISpanProperties);
|
|
7
|
+
}
|
|
8
|
+
export declare function createSpan(properties: ISpanProperties): SpanElement;
|
|
9
|
+
export declare class SpanProperties extends Properties implements ISpanProperties {
|
|
10
|
+
constructor(properties: SpanProperties);
|
|
11
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export class
|
|
4
|
-
constructor(properties) {
|
|
5
|
-
super({
|
|
6
|
-
tagName: "span",
|
|
7
|
-
properties: extendProperties({
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export function
|
|
14
|
-
return new
|
|
15
|
-
}
|
|
16
|
-
export class
|
|
17
|
-
constructor(properties) {
|
|
18
|
-
super();
|
|
19
|
-
this.setProperties(this, properties);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
1
|
+
import { Element, registerElement } from "../../../framework/element";
|
|
2
|
+
import { Properties, extendProperties } from "../../../framework/properties";
|
|
3
|
+
export class SpanElement extends Element {
|
|
4
|
+
constructor(properties) {
|
|
5
|
+
super({
|
|
6
|
+
tagName: "span",
|
|
7
|
+
properties: extendProperties(properties, {
|
|
8
|
+
elementType: "Span"
|
|
9
|
+
})
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function createSpan(properties) {
|
|
14
|
+
return new SpanElement(properties);
|
|
15
|
+
}
|
|
16
|
+
export class SpanProperties extends Properties {
|
|
17
|
+
constructor(properties) {
|
|
18
|
+
super();
|
|
19
|
+
this.setProperties(this, properties);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
registerElement(SpanProperties.prototype.constructor, SpanElement);
|
|
23
23
|
//# sourceMappingURL=Span.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Span.js","sourceRoot":"","sources":["../../../../src/controls/html/Span/Span.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Span.js","sourceRoot":"","sources":["../../../../src/controls/html/Span/Span.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAe,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAM1F,MAAM,OAAO,WAAY,SAAQ,OAAwB;IACrD,YAAY,UAA2B;QACnC,KAAK,CACD;YACI,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,gBAAgB,CACxB,UAAU,EACV;gBACI,WAAW,EAAE,MAAM;aACtB,CACJ;SACJ,CACJ,CAAC;IACN,CAAC;CACJ;AAED,MAAM,UAAU,UAAU,CAAC,UAA2B;IAClD,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,OAAO,cAAe,SAAQ,UAAU;IAC1C,YAAY,UAA0B;QAClC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACzC,CAAC;CACJ;AAED,eAAe,CACX,cAAc,CAAC,SAAS,CAAC,WAAW,EACpC,WAAW,CACd,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./Button/Button";
|
|
2
|
-
export * from "./Div/Div";
|
|
3
|
-
export * from "./Image/Image";
|
|
4
|
-
export * from "./Input/Input";
|
|
5
|
-
export * from "./Select/Select";
|
|
6
|
-
export * from "./Span/Span";
|
|
1
|
+
export * from "./Button/Button";
|
|
2
|
+
export * from "./Div/Div";
|
|
3
|
+
export * from "./Image/Image";
|
|
4
|
+
export * from "./Input/Input";
|
|
5
|
+
export * from "./Select/Select";
|
|
6
|
+
export * from "./Span/Span";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./Button/Button";
|
|
2
|
-
export * from "./Div/Div";
|
|
3
|
-
export * from "./Image/Image";
|
|
4
|
-
export * from "./Input/Input";
|
|
5
|
-
export * from "./Select/Select";
|
|
6
|
-
export * from "./Span/Span";
|
|
1
|
+
export * from "./Button/Button";
|
|
2
|
+
export * from "./Div/Div";
|
|
3
|
+
export * from "./Image/Image";
|
|
4
|
+
export * from "./Input/Input";
|
|
5
|
+
export * from "./Select/Select";
|
|
6
|
+
export * from "./Span/Span";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/controls/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as codeMirror from "./codeMirror/index";
|
|
2
|
-
import * as custom from "./custom/index";
|
|
3
|
-
import * as html from "./html/index";
|
|
4
|
-
import * as
|
|
5
|
-
import * as kendo from "./kendo/index";
|
|
6
|
-
import * as leaflet from "./leaflet/index";
|
|
7
|
-
import * as svg from "./svg/index";
|
|
8
|
-
export { codeMirror };
|
|
9
|
-
export { custom };
|
|
10
|
-
export { html };
|
|
11
|
-
export {
|
|
12
|
-
export { kendo };
|
|
13
|
-
export { leaflet };
|
|
14
|
-
export { svg };
|
|
1
|
+
import * as codeMirror from "./codeMirror/index";
|
|
2
|
+
import * as custom from "./custom/index";
|
|
3
|
+
import * as html from "./html/index";
|
|
4
|
+
import * as jsonViewerAwesome from "./jsonViewerAwesome/index";
|
|
5
|
+
import * as kendo from "./kendo/index";
|
|
6
|
+
import * as leaflet from "./leaflet/index";
|
|
7
|
+
import * as svg from "./svg/index";
|
|
8
|
+
export { codeMirror };
|
|
9
|
+
export { custom };
|
|
10
|
+
export { html };
|
|
11
|
+
export { jsonViewerAwesome };
|
|
12
|
+
export { kendo };
|
|
13
|
+
export { leaflet };
|
|
14
|
+
export { svg };
|
package/dist/controls/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as codeMirror from "./codeMirror/index";
|
|
2
|
-
import * as custom from "./custom/index";
|
|
3
|
-
import * as html from "./html/index";
|
|
4
|
-
import * as
|
|
5
|
-
import * as kendo from "./kendo/index";
|
|
6
|
-
import * as leaflet from "./leaflet/index";
|
|
7
|
-
import * as svg from "./svg/index";
|
|
8
|
-
export { codeMirror };
|
|
9
|
-
export { custom };
|
|
10
|
-
export { html };
|
|
11
|
-
export {
|
|
12
|
-
export { kendo };
|
|
13
|
-
export { leaflet };
|
|
14
|
-
export { svg };
|
|
1
|
+
import * as codeMirror from "./codeMirror/index";
|
|
2
|
+
import * as custom from "./custom/index";
|
|
3
|
+
import * as html from "./html/index";
|
|
4
|
+
import * as jsonViewerAwesome from "./jsonViewerAwesome/index";
|
|
5
|
+
import * as kendo from "./kendo/index";
|
|
6
|
+
import * as leaflet from "./leaflet/index";
|
|
7
|
+
import * as svg from "./svg/index";
|
|
8
|
+
export { codeMirror };
|
|
9
|
+
export { custom };
|
|
10
|
+
export { html };
|
|
11
|
+
export { jsonViewerAwesome };
|
|
12
|
+
export { kendo };
|
|
13
|
+
export { leaflet };
|
|
14
|
+
export { svg };
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/controls/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/controls/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,iBAAiB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./jsonFormatter/JsonFormatter";
|
|
1
|
+
export * from "./jsonFormatter/JsonFormatter";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./jsonFormatter/JsonFormatter";
|
|
1
|
+
export * from "./jsonFormatter/JsonFormatter";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controls/jsonViewerAwesome/index.ts"],"names":[],"mappings":"AAAA,cAAe,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Element } from "../../../framework/element";
|
|
2
|
+
import { Properties, IProperties } from "../../../framework/properties";
|
|
3
|
+
import { ISubscribable } from "../../../framework/observable";
|
|
4
|
+
export interface IJsonFormatterProperties extends IProperties {
|
|
5
|
+
json: object | ISubscribable<object>;
|
|
6
|
+
showArrayIndex?: boolean;
|
|
7
|
+
quotesOnKeys?: boolean;
|
|
8
|
+
displayDataTypes?: boolean;
|
|
9
|
+
displayObjectSize?: boolean;
|
|
10
|
+
sortKeys?: boolean;
|
|
11
|
+
collapsed?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class JsonFormatterElement extends Element<IJsonFormatterProperties> {
|
|
14
|
+
constructor(properties: IJsonFormatterProperties);
|
|
15
|
+
build(): void;
|
|
16
|
+
private setJson;
|
|
17
|
+
}
|
|
18
|
+
export declare function createJsonFormatter(properties: IJsonFormatterProperties): JsonFormatterElement;
|
|
19
|
+
export declare class JsonFormatterProperties extends Properties implements IJsonFormatterProperties {
|
|
20
|
+
constructor(properties: IJsonFormatterProperties);
|
|
21
|
+
json: object | ISubscribable<object>;
|
|
22
|
+
showArrayIndex?: boolean;
|
|
23
|
+
quotesOnKeys?: boolean;
|
|
24
|
+
displayDataTypes?: boolean;
|
|
25
|
+
displayObjectSize?: boolean;
|
|
26
|
+
sortKeys?: boolean;
|
|
27
|
+
collapsed?: boolean;
|
|
28
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { unwrap,
|
|
4
|
-
import { JSONFormatter } from "json-viewer-awesome/lib/json-formatter";
|
|
5
|
-
export class
|
|
6
|
-
constructor(properties) {
|
|
7
|
-
super({
|
|
8
|
-
tagName: "div",
|
|
9
|
-
properties: extendProperties({
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
build() {
|
|
15
|
-
super.build();
|
|
16
|
-
const
|
|
17
|
-
this.setJson(unwrap(
|
|
18
|
-
if (
|
|
19
|
-
this.
|
|
20
|
-
this.setJson(json);
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
setJson(json) {
|
|
25
|
-
if (json) {
|
|
26
|
-
if (typeof json === "object") {
|
|
27
|
-
const jsonFormatter = new JSONFormatter({
|
|
28
|
-
showArrayIndex: this.properties.showArrayIndex,
|
|
29
|
-
quotesOnKeys: this.properties.quotesOnKeys,
|
|
30
|
-
displayDataTypes: this.properties.displayDataTypes,
|
|
31
|
-
displayObjectSize: this.properties.displayObjectSize,
|
|
32
|
-
sortKeys: false,
|
|
33
|
-
collapsed: true,
|
|
34
|
-
iconStyle: 0,
|
|
35
|
-
theme: undefined,
|
|
36
|
-
src: json
|
|
37
|
-
});
|
|
38
|
-
this.element.replaceChildren(jsonFormatter.render());
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this.element.innerHTML = json.toString();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
this.empty();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
export function
|
|
50
|
-
return new
|
|
51
|
-
}
|
|
52
|
-
export class
|
|
53
|
-
constructor(properties) {
|
|
54
|
-
super();
|
|
55
|
-
this.setProperties(this, properties);
|
|
56
|
-
}
|
|
57
|
-
json;
|
|
58
|
-
showArrayIndex;
|
|
59
|
-
quotesOnKeys;
|
|
60
|
-
displayDataTypes;
|
|
61
|
-
displayObjectSize;
|
|
62
|
-
sortKeys;
|
|
63
|
-
collapsed;
|
|
64
|
-
}
|
|
65
|
-
|
|
1
|
+
import { Element, registerElement } from "../../../framework/element";
|
|
2
|
+
import { Properties, extendProperties } from "../../../framework/properties";
|
|
3
|
+
import { unwrap, isSubscribable } from "../../../framework/observable";
|
|
4
|
+
import { JSONFormatter } from "json-viewer-awesome/lib/json-formatter";
|
|
5
|
+
export class JsonFormatterElement extends Element {
|
|
6
|
+
constructor(properties) {
|
|
7
|
+
super({
|
|
8
|
+
tagName: "div",
|
|
9
|
+
properties: extendProperties(properties, {
|
|
10
|
+
elementType: "JsonFormatter"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
build() {
|
|
15
|
+
super.build();
|
|
16
|
+
const properties = this.properties;
|
|
17
|
+
this.setJson(unwrap(properties.json));
|
|
18
|
+
if (isSubscribable(properties.json)) {
|
|
19
|
+
this.disposers.push(properties.json.subscribe((json) => {
|
|
20
|
+
this.setJson(json);
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
setJson(json) {
|
|
25
|
+
if (json) {
|
|
26
|
+
if (typeof json === "object") {
|
|
27
|
+
const jsonFormatter = new JSONFormatter({
|
|
28
|
+
showArrayIndex: this.properties.showArrayIndex,
|
|
29
|
+
quotesOnKeys: this.properties.quotesOnKeys,
|
|
30
|
+
displayDataTypes: this.properties.displayDataTypes,
|
|
31
|
+
displayObjectSize: this.properties.displayObjectSize,
|
|
32
|
+
sortKeys: false,
|
|
33
|
+
collapsed: true,
|
|
34
|
+
iconStyle: 0,
|
|
35
|
+
theme: undefined,
|
|
36
|
+
src: json
|
|
37
|
+
});
|
|
38
|
+
this.element.replaceChildren(jsonFormatter.render());
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.element.innerHTML = json.toString();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.empty();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export function createJsonFormatter(properties) {
|
|
50
|
+
return new JsonFormatterElement(properties);
|
|
51
|
+
}
|
|
52
|
+
export class JsonFormatterProperties extends Properties {
|
|
53
|
+
constructor(properties) {
|
|
54
|
+
super();
|
|
55
|
+
this.setProperties(this, properties);
|
|
56
|
+
}
|
|
57
|
+
json;
|
|
58
|
+
showArrayIndex;
|
|
59
|
+
quotesOnKeys;
|
|
60
|
+
displayDataTypes;
|
|
61
|
+
displayObjectSize;
|
|
62
|
+
sortKeys;
|
|
63
|
+
collapsed;
|
|
64
|
+
}
|
|
65
|
+
registerElement(JsonFormatterProperties.prototype.constructor, JsonFormatterElement);
|
|
66
66
|
//# sourceMappingURL=JsonFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|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