jpf 4.2.18 → 5.0.6
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 +18 -14
- 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 +36 -36
- package/src/controls/html/Button/Button.ts +36 -29
- 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 +59 -61
- package/src/controls/html/Select/Select.ts +37 -39
- package/src/controls/html/Span/Span.ts +14 -14
- package/src/controls/index.ts +2 -2
- package/src/controls/{jsonViewAwesome → jsonViewerAwesome}/jsonFormatter/JsonFormatter.ts +23 -23
- package/src/controls/kendo/Chart/Chart.ts +34 -34
- package/src/controls/kendo/DataSource/DataSource.ts +1 -1
- package/src/controls/kendo/Editor/Editor.ts +58 -68
- package/src/controls/kendo/Grid/Grid.ts +77 -80
- package/src/controls/kendo/Menu/Menu.ts +22 -22
- package/src/controls/kendo/ObservableObject/ObservableObject.ts +45 -45
- package/src/controls/kendo/{Tree/Tree.ts → Treeview/Treeview.ts} +15 -15
- 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 +41 -38
- 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} +52 -39
- package/src/framework/event.ts +7 -7
- package/src/framework/observable.ts +94 -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,31 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { SvgPoint, serializePoints } from "../svg";
|
|
1
|
+
import { Element } from "../../../framework/element";
|
|
2
|
+
import { IProperties , extendProperties } from "../../../framework/properties";
|
|
3
|
+
import { ISubscribable } from "../../../framework/observable";
|
|
4
|
+
import { ISvgPoint as SvgPoint, serializePoints } from "../svg";
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
points: Array<SvgPoint> |
|
|
6
|
+
export interface IPolylineProperties extends IProperties {
|
|
7
|
+
points: Array<SvgPoint> | ISubscribable<Array<SvgPoint>>;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export class
|
|
11
|
-
constructor(properties:
|
|
10
|
+
export class PolylineElement extends Element<IPolylineProperties> {
|
|
11
|
+
constructor(properties: IPolylineProperties) {
|
|
12
12
|
super(
|
|
13
13
|
{
|
|
14
14
|
tagName: "polyline",
|
|
15
15
|
properties: extendProperties(
|
|
16
|
+
properties,
|
|
16
17
|
{
|
|
17
|
-
|
|
18
|
+
elementType: "Polyline",
|
|
18
19
|
attributes: {
|
|
19
20
|
points: serializePoints(properties.points)
|
|
20
21
|
}
|
|
21
|
-
}
|
|
22
|
-
properties
|
|
22
|
+
}
|
|
23
23
|
)
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export function
|
|
30
|
-
return new
|
|
29
|
+
export function createPolyline(properties: IPolylineProperties) {
|
|
30
|
+
return new PolylineElement(properties);
|
|
31
31
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Element } from "../../../framework/element";
|
|
2
|
+
import { IProperties, extendProperties } from "../../../framework/properties";
|
|
3
|
+
import { ISubscribable } from "../../../framework/observable";
|
|
4
4
|
|
|
5
|
-
export interface
|
|
6
|
-
x?: number | string |
|
|
7
|
-
y?: number | string |
|
|
8
|
-
width?: number | string |
|
|
9
|
-
height?: number | string |
|
|
5
|
+
export interface IRectangleProperties extends IProperties {
|
|
6
|
+
x?: number | string | ISubscribable<number | string>;
|
|
7
|
+
y?: number | string | ISubscribable<number | string>;
|
|
8
|
+
width?: number | string | ISubscribable<number | string>;
|
|
9
|
+
height?: number | string | ISubscribable<number | string>;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export class
|
|
13
|
-
constructor(properties:
|
|
12
|
+
export class RectangleElement extends Element<IRectangleProperties> {
|
|
13
|
+
constructor(properties: IRectangleProperties) {
|
|
14
14
|
super(
|
|
15
15
|
{
|
|
16
16
|
tagName: "rect",
|
|
17
17
|
properties: extendProperties(
|
|
18
|
+
properties,
|
|
18
19
|
{
|
|
19
|
-
|
|
20
|
+
elementType: "Rectangle",
|
|
20
21
|
attributes: {
|
|
21
22
|
x: properties.x,
|
|
22
23
|
y: properties.y,
|
|
23
24
|
width: properties.width,
|
|
24
25
|
height: properties.height
|
|
25
26
|
}
|
|
26
|
-
}
|
|
27
|
-
properties
|
|
27
|
+
}
|
|
28
28
|
)
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export function
|
|
35
|
-
return new
|
|
34
|
+
export function createRectangle(properties: IRectangleProperties) {
|
|
35
|
+
return new RectangleElement(properties);
|
|
36
36
|
}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Element, IElement } from "../../../framework/element";
|
|
2
|
+
import { IProperties, extendProperties } from "../../../framework/properties";
|
|
3
|
+
import { ISubscribable } from "../../../framework/observable";
|
|
4
4
|
import { PreserveAspectRatio } from "../../../framework/types";
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
x?: number | string |
|
|
8
|
-
y?: number | string |
|
|
9
|
-
height?: number | string |
|
|
10
|
-
width?: number | string |
|
|
6
|
+
export interface ISvgProperties extends IProperties {
|
|
7
|
+
x?: number | string | ISubscribable<number | string>;
|
|
8
|
+
y?: number | string | ISubscribable<number | string>;
|
|
9
|
+
height?: number | string | ISubscribable<number | string>;
|
|
10
|
+
width?: number | string | ISubscribable<number | string>;
|
|
11
11
|
viewBox?: string;
|
|
12
|
-
preserveAspectRatio?: PreserveAspectRatio |
|
|
13
|
-
children?: Array<
|
|
12
|
+
preserveAspectRatio?: PreserveAspectRatio | ISubscribable<PreserveAspectRatio>;
|
|
13
|
+
children?: Array<IElement> | ISubscribable<Array<IElement>>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export class
|
|
17
|
-
constructor(properties:
|
|
16
|
+
export class SvgElement extends Element<ISvgProperties> {
|
|
17
|
+
constructor(properties: ISvgProperties) {
|
|
18
18
|
super(
|
|
19
19
|
{
|
|
20
20
|
tagName: "svg",
|
|
21
21
|
properties: extendProperties(
|
|
22
|
+
properties,
|
|
22
23
|
{
|
|
23
|
-
|
|
24
|
+
elementType: "Svg",
|
|
24
25
|
attributes: {
|
|
25
26
|
x: properties.x,
|
|
26
27
|
y: properties.y,
|
|
@@ -29,15 +30,14 @@ export class SvgView extends View<SvgProperties> {
|
|
|
29
30
|
viewBox: properties.viewBox,
|
|
30
31
|
preserveAspectRatio: properties.preserveAspectRatio
|
|
31
32
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
),
|
|
35
|
-
children: properties.children
|
|
33
|
+
}
|
|
34
|
+
)
|
|
36
35
|
},
|
|
36
|
+
properties.children
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export function
|
|
42
|
-
return new
|
|
41
|
+
export function createSvg(properties: ISvgProperties) {
|
|
42
|
+
return new SvgElement(properties);
|
|
43
43
|
}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Element } from "../../../framework/element";
|
|
2
|
+
import { IProperties, extendProperties } from "../../../framework/properties";
|
|
3
|
+
import { ISubscribable } from "../../../framework/observable";
|
|
4
4
|
|
|
5
|
-
export interface
|
|
6
|
-
x?: number | string |
|
|
7
|
-
y?: number | string |
|
|
8
|
-
dx?: number | string |
|
|
9
|
-
dy?: number | string |
|
|
10
|
-
rotate?: string |
|
|
5
|
+
export interface ITextProperties extends IProperties {
|
|
6
|
+
x?: number | string | ISubscribable<number | string>;
|
|
7
|
+
y?: number | string | ISubscribable<number | string>;
|
|
8
|
+
dx?: number | string | ISubscribable<number | string>;
|
|
9
|
+
dy?: number | string | ISubscribable<number | string>;
|
|
10
|
+
rotate?: string | ISubscribable<string>;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export class
|
|
14
|
-
constructor(properties:
|
|
13
|
+
export class TextElement extends Element<ITextProperties> {
|
|
14
|
+
constructor(properties: ITextProperties) {
|
|
15
15
|
super(
|
|
16
16
|
{
|
|
17
17
|
tagName: "text",
|
|
18
18
|
properties: extendProperties(
|
|
19
|
+
properties,
|
|
19
20
|
{
|
|
20
|
-
|
|
21
|
+
elementType: "Text",
|
|
21
22
|
attributes: {
|
|
22
23
|
x: properties.x,
|
|
23
24
|
y: properties.y,
|
|
@@ -25,14 +26,13 @@ export class TextView extends View<TextProperties> {
|
|
|
25
26
|
dy: properties.dy,
|
|
26
27
|
rotate: properties.rotate
|
|
27
28
|
}
|
|
28
|
-
}
|
|
29
|
-
properties
|
|
29
|
+
}
|
|
30
30
|
)
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export function
|
|
37
|
-
return new
|
|
36
|
+
export function createText(properties: ITextProperties) {
|
|
37
|
+
return new TextElement(properties);
|
|
38
38
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Element } from "../../../framework/element";
|
|
2
|
+
import { IProperties, extendProperties } from "../../../framework/properties";
|
|
3
|
+
import { ISubscribable } from "../../../framework/observable";
|
|
4
4
|
|
|
5
|
-
export interface
|
|
6
|
-
title: string |
|
|
5
|
+
export interface ITitleProperties extends IProperties{
|
|
6
|
+
title: string | ISubscribable<string>
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export class
|
|
10
|
-
constructor(properties:
|
|
9
|
+
export class TitleElement extends Element<ITitleProperties> {
|
|
10
|
+
constructor(properties: ITitleProperties) {
|
|
11
11
|
super(
|
|
12
12
|
{
|
|
13
13
|
tagName: "title",
|
|
14
14
|
properties: extendProperties(
|
|
15
|
+
properties,
|
|
15
16
|
{
|
|
16
|
-
|
|
17
|
+
elementType: "Title",
|
|
17
18
|
textContent: properties.title
|
|
18
|
-
}
|
|
19
|
-
properties
|
|
19
|
+
}
|
|
20
20
|
)
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export function
|
|
27
|
-
return new
|
|
26
|
+
export function createTitle(properties: ITitleProperties) {
|
|
27
|
+
return new TitleElement(properties);
|
|
28
28
|
}
|
package/src/controls/svg/svg.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ISubscribable, isSubscribable, unwrap, computed } from "../../framework/observable";
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface ISvgPoint {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export function serializePoints(points: Array<
|
|
8
|
+
export function serializePoints(points: Array<ISvgPoint> | ISubscribable<Array<ISvgPoint>>): string | ISubscribable<string> {
|
|
9
9
|
if (points) {
|
|
10
10
|
if (isSubscribable(points)) {
|
|
11
11
|
return computed<string>(
|
|
@@ -14,7 +14,7 @@ export function serializePoints(points: Array<SvgPoint> | Subscribable<Array<Svg
|
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
|
-
return unwrap(points).map((point) => { return point.x + "," + point.y }).join(" ");
|
|
17
|
+
return unwrap<Array<ISvgPoint>>(points).map((point) => { return point.x + "," + point.y }).join(" ");
|
|
18
18
|
}
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PreserveAspectRatio } from "./types";
|
|
2
|
+
import { ISubscribable } from "./observable";
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface IAttributes {
|
|
5
5
|
alt?: string,
|
|
6
6
|
disabled?: string,
|
|
7
7
|
href?: string,
|
|
@@ -46,47 +46,47 @@ export interface Attributes {
|
|
|
46
46
|
xmlns?: string;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export interface
|
|
50
|
-
alt?: string |
|
|
51
|
-
disabled?: string |
|
|
52
|
-
href?: string |
|
|
53
|
-
target?: string |
|
|
54
|
-
id?: string |
|
|
55
|
-
src?: string |
|
|
56
|
-
title?: string |
|
|
57
|
-
class?: string |
|
|
58
|
-
tabindex?: number |
|
|
59
|
-
draggable?: string |
|
|
60
|
-
placeholder?: string |
|
|
61
|
-
for?: string |
|
|
62
|
-
type?: string |
|
|
63
|
-
value?: string |
|
|
64
|
-
view?: string |
|
|
65
|
-
checked?: string |
|
|
66
|
-
enctype?: string |
|
|
67
|
-
name?: string |
|
|
68
|
-
multiple?: boolean |
|
|
69
|
-
["aria-label"]?: string |
|
|
70
|
-
cx?: number | string |
|
|
71
|
-
cy?: number | string |
|
|
72
|
-
r?: number | string |
|
|
73
|
-
rx?: number | string |
|
|
74
|
-
ry?: number | string |
|
|
75
|
-
x?: number | string |
|
|
76
|
-
x1?: number | string |
|
|
77
|
-
x2?: number | string |
|
|
78
|
-
y?: number | string |
|
|
79
|
-
y1?: number | string |
|
|
80
|
-
y2?: number | string |
|
|
81
|
-
width?: number | string |
|
|
82
|
-
height?: number | string |
|
|
83
|
-
patternUnits?: string |
|
|
84
|
-
patternTransform?: string |
|
|
85
|
-
points?: string |
|
|
86
|
-
viewBox?: string |
|
|
87
|
-
dx?: number | string |
|
|
88
|
-
dy?: number | string |
|
|
89
|
-
rotate?: string |
|
|
90
|
-
preserveAspectRatio?: PreserveAspectRatio |
|
|
91
|
-
xmlns?: string|
|
|
49
|
+
export interface IAttributesSubscribable {
|
|
50
|
+
alt?: string | ISubscribable<string>,
|
|
51
|
+
disabled?: string | ISubscribable<string>,
|
|
52
|
+
href?: string | ISubscribable<string>,
|
|
53
|
+
target?: string | ISubscribable<string>,
|
|
54
|
+
id?: string | ISubscribable<string>,
|
|
55
|
+
src?: string | ISubscribable<string>,
|
|
56
|
+
title?: string | ISubscribable<string>,
|
|
57
|
+
class?: string | ISubscribable<string>,
|
|
58
|
+
tabindex?: number | ISubscribable<number>,
|
|
59
|
+
draggable?: string | ISubscribable<string>,
|
|
60
|
+
placeholder?: string | ISubscribable<string>,
|
|
61
|
+
for?: string | ISubscribable<string>,
|
|
62
|
+
type?: string | ISubscribable<string>,
|
|
63
|
+
value?: string | ISubscribable<string>,
|
|
64
|
+
view?: string | ISubscribable<string>,
|
|
65
|
+
checked?: string | ISubscribable<string>;
|
|
66
|
+
enctype?: string | ISubscribable<string>;
|
|
67
|
+
name?: string | ISubscribable<string>;
|
|
68
|
+
multiple?: boolean | ISubscribable<boolean>;
|
|
69
|
+
["aria-label"]?: string | ISubscribable<string>;
|
|
70
|
+
cx?: number | string | ISubscribable<number | string>;
|
|
71
|
+
cy?: number | string | ISubscribable<number | string>;
|
|
72
|
+
r?: number | string | ISubscribable<number | string>;
|
|
73
|
+
rx?: number | string | ISubscribable<number | string>;
|
|
74
|
+
ry?: number | string | ISubscribable<number | string>;
|
|
75
|
+
x?: number | string | ISubscribable<number | string>;
|
|
76
|
+
x1?: number | string | ISubscribable<number | string>;
|
|
77
|
+
x2?: number | string | ISubscribable<number | string>;
|
|
78
|
+
y?: number | string | ISubscribable<number | string>;
|
|
79
|
+
y1?: number | string | ISubscribable<number | string>;
|
|
80
|
+
y2?: number | string | ISubscribable<number | string>;
|
|
81
|
+
width?: number | string | ISubscribable<number | string>;
|
|
82
|
+
height?: number | string | ISubscribable<number | string>;
|
|
83
|
+
patternUnits?: string | ISubscribable<string>;
|
|
84
|
+
patternTransform?: string | ISubscribable<string>;
|
|
85
|
+
points?: string | ISubscribable<string>;
|
|
86
|
+
viewBox?: string | ISubscribable<string>;
|
|
87
|
+
dx?: number | string | ISubscribable<number | string>;
|
|
88
|
+
dy?: number | string | ISubscribable<number | string>;
|
|
89
|
+
rotate?: string | ISubscribable<string>;
|
|
90
|
+
preserveAspectRatio?: PreserveAspectRatio | ISubscribable<PreserveAspectRatio>;
|
|
91
|
+
xmlns?: string| ISubscribable<string>;
|
|
92
92
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "tocca";
|
|
2
|
-
import { unwrap, isSubscribable,
|
|
3
|
-
import {
|
|
2
|
+
import { unwrap, isSubscribable, ISubscription, ISubscribable } from "./observable";
|
|
3
|
+
import { IProperties, Properties, applyBindings } from "./properties";
|
|
4
4
|
|
|
5
5
|
const htmlTags = {
|
|
6
6
|
a: true,
|
|
@@ -34,39 +34,38 @@ type TagName = keyof typeof htmlTags | keyof typeof svgTags;
|
|
|
34
34
|
|
|
35
35
|
const svgNamespace = "http://www.w3.org/2000/svg";
|
|
36
36
|
|
|
37
|
-
//#region
|
|
38
|
-
export interface
|
|
37
|
+
//#region Element class
|
|
38
|
+
export interface IElement {
|
|
39
39
|
render(): HTMLElement;
|
|
40
|
-
|
|
40
|
+
unmount(): void;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export interface
|
|
43
|
+
export interface IElementOptions<TProperties> {
|
|
44
44
|
tagName: TagName;
|
|
45
45
|
properties?: TProperties;
|
|
46
|
-
children?: Array<IView> | Subscribable<Array<IView>>;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
export class
|
|
50
|
-
constructor(
|
|
51
|
-
this.tagName =
|
|
52
|
-
this.properties =
|
|
53
|
-
this.optionsChildren =
|
|
54
|
-
this.children = unwrap(
|
|
48
|
+
export class Element<TProperties = any> implements IElement {
|
|
49
|
+
constructor(options: IElementOptions<TProperties>, children?: Array<IElement> | ISubscribable<Array<IElement>>) {
|
|
50
|
+
this.tagName = options.tagName;
|
|
51
|
+
this.properties = options.properties;
|
|
52
|
+
this.optionsChildren = children;
|
|
53
|
+
this.children = unwrap(children);
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
// #region Private members
|
|
58
57
|
private readonly tagName: TagName;
|
|
59
|
-
private readonly optionsChildren: Array<
|
|
60
|
-
private children = new Array<
|
|
58
|
+
private readonly optionsChildren: Array<IElement> | ISubscribable<Array<IElement>>;
|
|
59
|
+
private children = new Array<IElement>();
|
|
61
60
|
|
|
62
61
|
|
|
63
62
|
private buildChildren() {
|
|
64
63
|
if (this.element && this.children && this.children.length > 0) {
|
|
65
64
|
//Create a documentFragment to reduce browser repaints
|
|
66
65
|
const documentFragment = document.createDocumentFragment();
|
|
67
|
-
this.children
|
|
68
|
-
|
|
69
|
-
}
|
|
66
|
+
for (let child of this.children) {
|
|
67
|
+
this.element.appendChild(child.render());
|
|
68
|
+
}
|
|
70
69
|
|
|
71
70
|
//Add the documentFragment to the dom
|
|
72
71
|
this.element.appendChild(documentFragment);
|
|
@@ -77,10 +76,10 @@ export class View<TProperties = any> implements IView {
|
|
|
77
76
|
// #region Protected members
|
|
78
77
|
protected element: HTMLElement;
|
|
79
78
|
protected readonly properties: TProperties;
|
|
80
|
-
protected readonly subscriptions = new Array<
|
|
79
|
+
protected readonly subscriptions = new Array<ISubscription>();
|
|
81
80
|
|
|
82
81
|
protected build(): void {
|
|
83
|
-
|
|
82
|
+
applyBindings(this.properties as IProperties, this.element, this.subscriptions);
|
|
84
83
|
|
|
85
84
|
if (this.children) {
|
|
86
85
|
this.buildChildren();
|
|
@@ -110,13 +109,13 @@ export class View<TProperties = any> implements IView {
|
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
|
|
113
|
-
protected addChild(child:
|
|
112
|
+
protected addChild(child: IElement): Element<TProperties> {
|
|
114
113
|
this.children.push(child);
|
|
115
114
|
this.buildChildren();
|
|
116
115
|
return this;
|
|
117
116
|
}
|
|
118
117
|
|
|
119
|
-
protected setChildren(...children: Array<
|
|
118
|
+
protected setChildren(...children: Array<IElement>): Element<TProperties> {
|
|
120
119
|
this.empty();
|
|
121
120
|
|
|
122
121
|
this.children = children;
|
|
@@ -164,13 +163,24 @@ export class View<TProperties = any> implements IView {
|
|
|
164
163
|
|
|
165
164
|
throw "The build method of this UiElement has not been defined";
|
|
166
165
|
}
|
|
167
|
-
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
//This method is used to dispose subscriptions before removing the element from the DOM to prevent memory leaks
|
|
169
|
+
unmount(): void {
|
|
170
|
+
const properties = this.properties as IProperties;
|
|
171
|
+
console.log("Unmount element " + properties.elementType);
|
|
172
|
+
|
|
173
|
+
//If the element has childeren then we unmount the children
|
|
174
|
+
if (this.children) {
|
|
175
|
+
for (let child of this.children) {
|
|
176
|
+
child.unmount();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
//If the element has subscriptions on observable we dispose the subscribtion
|
|
168
181
|
for (let subscription of this.subscriptions) {
|
|
169
182
|
subscription.dispose();
|
|
170
183
|
}
|
|
171
|
-
for (let child of this.children) {
|
|
172
|
-
child.dispose();
|
|
173
|
-
}
|
|
174
184
|
}
|
|
175
185
|
|
|
176
186
|
focus(options?: FocusOptions) {
|
|
@@ -180,31 +190,34 @@ export class View<TProperties = any> implements IView {
|
|
|
180
190
|
}
|
|
181
191
|
// #endregion
|
|
182
192
|
}
|
|
193
|
+
|
|
194
|
+
export function element<TProperties>(options: IElementOptions<TProperties>, children?: Array<IElement> | ISubscribable<Array<IElement>>) {
|
|
195
|
+
return new Element<TProperties>(options, children);
|
|
196
|
+
}
|
|
183
197
|
//#endregion
|
|
184
198
|
|
|
185
199
|
//#region View dictionary
|
|
186
|
-
|
|
200
|
+
var elementDictionary = new Map<Function, any>();
|
|
187
201
|
|
|
188
|
-
export function
|
|
189
|
-
|
|
202
|
+
export function registerElement(constructor: Function, element: any) {
|
|
203
|
+
elementDictionary.set(constructor, element);
|
|
190
204
|
}
|
|
191
205
|
|
|
192
|
-
export function
|
|
193
|
-
if (
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
196
|
-
|
|
197
|
-
return new view(viewModel);
|
|
206
|
+
export function getElement(properties: Properties): Element {
|
|
207
|
+
if (properties && properties.constructor) {
|
|
208
|
+
const element = elementDictionary.get(properties.constructor);
|
|
209
|
+
if (element.prototype) {
|
|
210
|
+
return new element(properties);
|
|
198
211
|
}
|
|
199
|
-
if (typeof
|
|
200
|
-
return
|
|
212
|
+
if (typeof element === "function") {
|
|
213
|
+
return element(properties);
|
|
201
214
|
}
|
|
202
215
|
}
|
|
203
216
|
return null;
|
|
204
217
|
}
|
|
205
218
|
|
|
206
|
-
export function render(
|
|
207
|
-
const view =
|
|
219
|
+
export function render(properties: Properties): HTMLElement {
|
|
220
|
+
const view = getElement(properties);
|
|
208
221
|
if (view && view.render) {
|
|
209
222
|
return view.render();
|
|
210
223
|
}
|
package/src/framework/event.ts
CHANGED
|
@@ -24,11 +24,11 @@ export const touchEvents = {
|
|
|
24
24
|
swipedown: true
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
export function isGlobalEvent(event: keyof
|
|
27
|
+
export function isGlobalEvent(event: keyof IUiElementEventMap): boolean {
|
|
28
28
|
return !(mouseEvents[event] || touchEvents[event]);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export interface
|
|
31
|
+
export interface IUiElementEventMap extends HTMLElementEventMap {
|
|
32
32
|
"tap": Event;
|
|
33
33
|
"dbltap": Event;
|
|
34
34
|
"longtap": Event;
|
|
@@ -63,24 +63,24 @@ export interface IEventListener {
|
|
|
63
63
|
options?: IEventListenerOptions
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export interface
|
|
66
|
+
export interface IMouseEventListeners {
|
|
67
67
|
click?: IMouseEventListener;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
export interface
|
|
70
|
+
export interface IFocusEventListeners {
|
|
71
71
|
focusout?: IFocusEventListener;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
export interface
|
|
74
|
+
export interface IContextMenuEventListeners {
|
|
75
75
|
contextMenu?: IContextMenuEventListener;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
export interface
|
|
78
|
+
export interface ILeafletEventListeners {
|
|
79
79
|
zoomend?: ILeafletEventListener;
|
|
80
80
|
moveend?: ILeafletEventListener;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export interface
|
|
83
|
+
export interface IEventListeners extends IMouseEventListeners, IFocusEventListeners, IContextMenuEventListeners, ILeafletEventListeners {
|
|
84
84
|
change?: IGenericEventListener;
|
|
85
85
|
load?: IGenericEventListener;
|
|
86
86
|
}
|