jpf 5.0.62 → 5.0.63
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 +4 -5
- package/dist/controls/codeMirror/Editor/Editor.js +8 -9
- package/dist/controls/codeMirror/Editor/Editor.js.map +1 -1
- package/dist/controls/custom/FileSelector/FileSelector.d.ts +3 -4
- package/dist/controls/custom/FileSelector/FileSelector.js +5 -6
- package/dist/controls/custom/FileSelector/FileSelector.js.map +1 -1
- package/dist/controls/custom/LabeledControl/LabeledControl.d.ts +5 -6
- package/dist/controls/custom/LabeledControl/LabeledControl.js +3 -4
- package/dist/controls/custom/LabeledControl/LabeledControl.js.map +1 -1
- package/dist/controls/custom/ListItem/ListItem.d.ts +8 -9
- package/dist/controls/custom/ListItem/ListItem.js +8 -9
- package/dist/controls/custom/ListItem/ListItem.js.map +1 -1
- package/dist/controls/html/Button/Button.d.ts +6 -7
- package/dist/controls/html/Button/Button.js +8 -9
- package/dist/controls/html/Button/Button.js.map +1 -1
- package/dist/controls/html/Div/Div.d.ts +4 -5
- package/dist/controls/html/Div/Div.js +2 -3
- package/dist/controls/html/Div/Div.js.map +1 -1
- package/dist/controls/html/Image/Image.d.ts +4 -5
- package/dist/controls/html/Image/Image.js +2 -3
- package/dist/controls/html/Image/Image.js.map +1 -1
- package/dist/controls/html/Input/Input.d.ts +4 -5
- package/dist/controls/html/Input/Input.js +23 -23
- package/dist/controls/html/Input/Input.js.map +1 -1
- package/dist/controls/html/Select/Select.d.ts +4 -5
- package/dist/controls/html/Select/Select.js +15 -16
- package/dist/controls/html/Select/Select.js.map +1 -1
- package/dist/controls/html/Span/Span.d.ts +3 -4
- package/dist/controls/html/Span/Span.js +2 -3
- package/dist/controls/html/Span/Span.js.map +1 -1
- package/dist/controls/jsonViewerAwesome/jsonFormatter/JsonFormatter.d.ts +4 -5
- package/dist/controls/jsonViewerAwesome/jsonFormatter/JsonFormatter.js +7 -8
- package/dist/controls/jsonViewerAwesome/jsonFormatter/JsonFormatter.js.map +1 -1
- package/dist/controls/kendo/Chart/Chart.d.ts +3 -4
- package/dist/controls/kendo/Chart/Chart.js +9 -10
- package/dist/controls/kendo/Chart/Chart.js.map +1 -1
- package/dist/controls/kendo/Editor/Editor.d.ts +3 -4
- package/dist/controls/kendo/Editor/Editor.js +13 -14
- package/dist/controls/kendo/Editor/Editor.js.map +1 -1
- package/dist/controls/kendo/Grid/Grid.d.ts +4 -5
- package/dist/controls/kendo/Grid/Grid.js +12 -13
- package/dist/controls/kendo/Grid/Grid.js.map +1 -1
- package/dist/controls/kendo/Menu/Menu.d.ts +3 -4
- package/dist/controls/kendo/Menu/Menu.js +9 -10
- package/dist/controls/kendo/Menu/Menu.js.map +1 -1
- package/dist/controls/kendo/Treeview/Treeview.d.ts +3 -4
- package/dist/controls/kendo/Treeview/Treeview.js +9 -10
- package/dist/controls/kendo/Treeview/Treeview.js.map +1 -1
- package/dist/controls/leaflet/LabelControl/LabelControl.d.ts +2 -3
- package/dist/controls/leaflet/LabelControl/LabelControl.js +1 -2
- package/dist/controls/leaflet/LabelControl/LabelControl.js.map +1 -1
- package/dist/controls/leaflet/Map/Map.d.ts +4 -5
- package/dist/controls/leaflet/Map/Map.js +9 -10
- package/dist/controls/leaflet/Map/Map.js.map +1 -1
- package/dist/controls/svg/Circle/Circle.d.ts +3 -4
- package/dist/controls/svg/Circle/Circle.js +1 -2
- package/dist/controls/svg/Circle/Circle.js.map +1 -1
- package/dist/controls/svg/Ellipse/Ellipse.d.ts +3 -4
- package/dist/controls/svg/Ellipse/Ellipse.js +1 -2
- package/dist/controls/svg/Ellipse/Ellipse.js.map +1 -1
- package/dist/controls/svg/ForeignObject/ForeignObject.d.ts +3 -4
- package/dist/controls/svg/ForeignObject/ForeignObject.js +1 -2
- package/dist/controls/svg/ForeignObject/ForeignObject.js.map +1 -1
- package/dist/controls/svg/Group/Group.d.ts +3 -4
- package/dist/controls/svg/Group/Group.js +1 -2
- package/dist/controls/svg/Group/Group.js.map +1 -1
- package/dist/controls/svg/Line/Line.d.ts +3 -4
- package/dist/controls/svg/Line/Line.js +1 -2
- package/dist/controls/svg/Line/Line.js.map +1 -1
- package/dist/controls/svg/Pattern/Pattern.d.ts +3 -4
- package/dist/controls/svg/Pattern/Pattern.js +1 -2
- package/dist/controls/svg/Pattern/Pattern.js.map +1 -1
- package/dist/controls/svg/Polygon/Polygon.d.ts +3 -4
- package/dist/controls/svg/Polygon/Polygon.js +3 -4
- package/dist/controls/svg/Polygon/Polygon.js.map +1 -1
- package/dist/controls/svg/Polyline/Polyline.d.ts +3 -4
- package/dist/controls/svg/Polyline/Polyline.js +1 -2
- package/dist/controls/svg/Polyline/Polyline.js.map +1 -1
- package/dist/controls/svg/Rectangle/Rectangle.d.ts +3 -4
- package/dist/controls/svg/Rectangle/Rectangle.js +1 -2
- package/dist/controls/svg/Rectangle/Rectangle.js.map +1 -1
- package/dist/controls/svg/Svg/Svg.d.ts +3 -4
- package/dist/controls/svg/Svg/Svg.js +1 -2
- package/dist/controls/svg/Svg/Svg.js.map +1 -1
- package/dist/controls/svg/Text/Text.d.ts +3 -4
- package/dist/controls/svg/Text/Text.js +1 -2
- package/dist/controls/svg/Text/Text.js.map +1 -1
- package/dist/controls/svg/Title/Title.d.ts +3 -4
- package/dist/controls/svg/Title/Title.js +1 -2
- package/dist/controls/svg/Title/Title.js.map +1 -1
- package/dist/controls/svg/svg.d.ts +1 -1
- package/dist/controls/svg/svg.js +5 -5
- package/dist/controls/svg/svg.js.map +1 -1
- package/dist/framework/attributes.d.ts +1 -1
- package/dist/framework/css.d.ts +1 -4
- package/dist/framework/element.d.ts +48 -15
- package/dist/framework/element.js +279 -29
- package/dist/framework/element.js.map +1 -1
- package/dist/framework/observable.d.ts +41 -0
- package/dist/framework/observable.js +46 -0
- package/dist/framework/observable.js.map +1 -0
- package/dist/framework/observablelmplementations.d.ts +1 -24
- package/dist/framework/observablelmplementations.js +0 -110
- package/dist/framework/observablelmplementations.js.map +1 -1
- package/dist/framework/properties.d.ts +1 -40
- package/dist/framework/properties.js +0 -265
- package/dist/framework/properties.js.map +1 -1
- package/dist/framework/style.d.ts +1 -328
- package/dist/index.d.ts +2 -4
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/utilities/object/object.d.ts +5 -0
- package/dist/utilities/object/object.js +47 -0
- package/dist/utilities/object/object.js.map +1 -0
- package/dist/utilities/value/value.d.ts +1 -0
- package/dist/utilities/value/value.js +7 -0
- package/dist/utilities/value/value.js.map +1 -0
- package/package.json +1 -1
- package/src/controls/codeMirror/Editor/Editor.ts +9 -11
- package/src/controls/custom/FileSelector/FileSelector.ts +5 -6
- package/src/controls/custom/LabeledControl/LabeledControl.ts +5 -6
- package/src/controls/custom/ListItem/ListItem.ts +13 -15
- package/src/controls/html/Button/Button.ts +13 -15
- package/src/controls/html/Div/Div.ts +4 -5
- package/src/controls/html/Image/Image.ts +4 -5
- package/src/controls/html/Input/Input.ts +21 -22
- package/src/controls/html/Select/Select.ts +16 -18
- package/src/controls/html/Span/Span.ts +3 -4
- package/src/controls/jsonViewerAwesome/jsonFormatter/JsonFormatter.ts +10 -12
- package/src/controls/kendo/Chart/Chart.ts +17 -19
- package/src/controls/kendo/Editor/Editor.ts +14 -16
- package/src/controls/kendo/Grid/Grid.ts +13 -15
- package/src/controls/kendo/Menu/Menu.ts +11 -13
- package/src/controls/kendo/Treeview/Treeview.ts +9 -11
- package/src/controls/leaflet/LabelControl/LabelControl.ts +4 -5
- package/src/controls/leaflet/Map/Map.ts +10 -12
- package/src/controls/svg/Circle/Circle.ts +3 -4
- package/src/controls/svg/Ellipse/Ellipse.ts +3 -4
- package/src/controls/svg/ForeignObject/ForeignObject.ts +3 -4
- package/src/controls/svg/Group/Group.ts +3 -4
- package/src/controls/svg/Line/Line.ts +3 -4
- package/src/controls/svg/Pattern/Pattern.ts +3 -4
- package/src/controls/svg/Polygon/Polygon.ts +4 -6
- package/src/controls/svg/Polyline/Polyline.ts +3 -4
- package/src/controls/svg/Rectangle/Rectangle.ts +3 -4
- package/src/controls/svg/Svg/Svg.ts +3 -4
- package/src/controls/svg/Text/Text.ts +3 -4
- package/src/controls/svg/Title/Title.ts +3 -4
- package/src/controls/svg/svg.ts +5 -6
- package/src/framework/attributes.ts +1 -47
- package/src/framework/css.ts +3 -5
- package/src/framework/element.ts +380 -44
- package/src/framework/observable.ts +100 -0
- package/src/framework/observablelmplementations.ts +135 -135
- package/src/framework/properties.ts +1 -342
- package/src/framework/style.ts +1556 -1556
- package/src/index.ts +2 -4
- package/src/utilities/object/object.ts +56 -0
- package/src/utilities/value/value.ts +3 -0
- package/src/framework/observableInterfaces.ts +0 -39
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { Element, addElementToDictionary } from "../../../framework/element";
|
|
2
|
-
import {
|
|
3
|
-
import { ISubscribable } from "../../../framework/observableInterfaces";
|
|
4
|
-
import { isSubscribable, unwrap , isObservableValue} from "../../../framework/observablelmplementations";
|
|
1
|
+
import { Element, addElementToDictionary, ElementProperties, IElementProperties, extendProperties } from "../../../framework/element";
|
|
2
|
+
import { ISubscribable, observable } from "../../../framework/observable";
|
|
5
3
|
|
|
6
|
-
export interface ISelectProperties<TItem, TValue, TSetter = TValue> extends
|
|
4
|
+
export interface ISelectProperties<TItem, TValue, TSetter = TValue> extends IElementProperties {
|
|
7
5
|
value?: TValue | ISubscribable<TValue>;
|
|
8
6
|
items?: Array<TItem> | ISubscribable<Array<TItem>>;
|
|
9
7
|
textFunction: (item: TItem) => string;
|
|
@@ -30,12 +28,12 @@ export class SelectElement<TItem, TValue, TSetter = TValue> extends Element<ISel
|
|
|
30
28
|
//Protected members
|
|
31
29
|
protected build() {
|
|
32
30
|
super.build();
|
|
33
|
-
const select = this.
|
|
31
|
+
const select = this.htmlElement as HTMLSelectElement;
|
|
34
32
|
|
|
35
33
|
const properties = this.properties;
|
|
36
34
|
|
|
37
|
-
this.setItems(unwrap(properties.items) as Array<TItem>);
|
|
38
|
-
if (isSubscribable(properties.items)) {
|
|
35
|
+
this.setItems(observable.unwrap(properties.items) as Array<TItem>);
|
|
36
|
+
if (observable.isSubscribable(properties.items)) {
|
|
39
37
|
this.disposers.push(
|
|
40
38
|
properties.items.subscribe((items) => {
|
|
41
39
|
this.setItems(items);
|
|
@@ -43,8 +41,8 @@ export class SelectElement<TItem, TValue, TSetter = TValue> extends Element<ISel
|
|
|
43
41
|
);
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
this.setSelectedValue(unwrap(properties.value) as TValue);
|
|
47
|
-
if (isSubscribable(properties.value)) {
|
|
44
|
+
this.setSelectedValue(observable.unwrap(properties.value) as TValue);
|
|
45
|
+
if (observable.isSubscribable(properties.value)) {
|
|
48
46
|
this.disposers.push(
|
|
49
47
|
properties.value.subscribe((value) => {
|
|
50
48
|
this.setSelectedValue(value);
|
|
@@ -52,7 +50,7 @@ export class SelectElement<TItem, TValue, TSetter = TValue> extends Element<ISel
|
|
|
52
50
|
);
|
|
53
51
|
}
|
|
54
52
|
|
|
55
|
-
this.
|
|
53
|
+
this.htmlElement.addEventListener(
|
|
56
54
|
"change",
|
|
57
55
|
async (event: Event) => {
|
|
58
56
|
let selectedValue = select.value as unknown as TValue;
|
|
@@ -65,12 +63,12 @@ export class SelectElement<TItem, TValue, TSetter = TValue> extends Element<ISel
|
|
|
65
63
|
}
|
|
66
64
|
if (properties.inputValidator) {
|
|
67
65
|
if (!await properties.inputValidator(event, properties, selectedValue)) {
|
|
68
|
-
select.value = unwrap(properties.value) as unknown as string;
|
|
66
|
+
select.value = observable.unwrap(properties.value) as unknown as string;
|
|
69
67
|
return;
|
|
70
68
|
};
|
|
71
69
|
}
|
|
72
70
|
|
|
73
|
-
if (isObservableValue(properties.value)) {
|
|
71
|
+
if (observable.isObservableValue(properties.value)) {
|
|
74
72
|
if (properties.setFunction) {
|
|
75
73
|
const setValue = properties.setFunction(selectedItem) as unknown as TValue;
|
|
76
74
|
properties.value.setValueInAction(setValue);
|
|
@@ -85,10 +83,10 @@ export class SelectElement<TItem, TValue, TSetter = TValue> extends Element<ISel
|
|
|
85
83
|
private itemDictionary: { [key: string]: TItem };
|
|
86
84
|
|
|
87
85
|
private setItems(items: Array<TItem>) {
|
|
88
|
-
if (this.
|
|
86
|
+
if (this.htmlElement) {
|
|
89
87
|
this.itemDictionary = {};
|
|
90
88
|
if (items) {
|
|
91
|
-
const select = this.
|
|
89
|
+
const select = this.htmlElement as HTMLSelectElement;
|
|
92
90
|
select.innerHTML = null;
|
|
93
91
|
if (this.properties.emptyItemText) {
|
|
94
92
|
const emptyOption = document.createElement("option") as HTMLOptionElement;
|
|
@@ -110,8 +108,8 @@ export class SelectElement<TItem, TValue, TSetter = TValue> extends Element<ISel
|
|
|
110
108
|
}
|
|
111
109
|
|
|
112
110
|
private setSelectedValue(value: TValue) {
|
|
113
|
-
if (this.
|
|
114
|
-
const select = this.
|
|
111
|
+
if (this.htmlElement) {
|
|
112
|
+
const select = this.htmlElement as HTMLSelectElement;
|
|
115
113
|
if (value === null || value === undefined) {
|
|
116
114
|
select.value = "";
|
|
117
115
|
} else {
|
|
@@ -125,7 +123,7 @@ export function createSelect<TItem, TValue, TSetter = TValue>(properties: ISelec
|
|
|
125
123
|
return new SelectElement(properties);
|
|
126
124
|
}
|
|
127
125
|
|
|
128
|
-
export class SelectProperties<TItem, TValue, TSetter = TValue> extends
|
|
126
|
+
export class SelectProperties<TItem, TValue, TSetter = TValue> extends ElementProperties implements ISelectProperties<TItem, TValue, TSetter> {
|
|
129
127
|
constructor(properties: ISelectProperties<TItem, TValue, TSetter>) {
|
|
130
128
|
super();
|
|
131
129
|
this.setProperties(this, properties);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Element, addElementToDictionary } from "../../../framework/element";
|
|
2
|
-
import { Properties, IProperties, extendProperties } from "../../../framework/properties";
|
|
1
|
+
import { Element, addElementToDictionary,ElementProperties, IElementProperties, extendProperties } from "../../../framework/element";
|
|
3
2
|
|
|
4
3
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
5
|
-
export interface ISpanProperties extends
|
|
4
|
+
export interface ISpanProperties extends IElementProperties {
|
|
6
5
|
|
|
7
6
|
}
|
|
8
7
|
|
|
@@ -26,7 +25,7 @@ export function createSpan(properties: ISpanProperties) {
|
|
|
26
25
|
return new SpanElement(properties);
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
export class SpanProperties extends
|
|
28
|
+
export class SpanProperties extends ElementProperties implements ISpanProperties {
|
|
30
29
|
constructor(properties: SpanProperties) {
|
|
31
30
|
super();
|
|
32
31
|
this.setProperties(this, properties);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { Element, addElementToDictionary } from "../../../framework/element";
|
|
2
|
-
import { Properties, IProperties, extendProperties } from "../../../framework/properties";
|
|
1
|
+
import { Element, ElementProperties, IElementProperties, extendProperties, addElementToDictionary } from "../../../framework/element";
|
|
3
2
|
import { JSONFormatter } from "json-viewer-awesome/lib/json-formatter";
|
|
4
|
-
import { ISubscribable } from "../../../framework/
|
|
5
|
-
import { isSubscribable, unwrap } from "../../../framework/observablelmplementations";
|
|
3
|
+
import { ISubscribable, observable } from "../../../framework/observable";
|
|
6
4
|
|
|
7
|
-
export interface IJsonFormatterProperties extends
|
|
5
|
+
export interface IJsonFormatterProperties extends IElementProperties {
|
|
8
6
|
json: object | ISubscribable<object>;
|
|
9
7
|
showArrayIndex?: boolean;
|
|
10
8
|
quotesOnKeys?: boolean;
|
|
@@ -33,11 +31,11 @@ export class JsonFormatterElement extends Element<IJsonFormatterProperties> {
|
|
|
33
31
|
super.build();
|
|
34
32
|
|
|
35
33
|
const properties = this.properties;
|
|
36
|
-
this.setJson(unwrap(properties.json));
|
|
37
|
-
if (isSubscribable(properties.json)) {
|
|
34
|
+
this.setJson(observable.unwrap(properties.json));
|
|
35
|
+
if (observable.isSubscribable(properties.json)) {
|
|
38
36
|
this.disposers.push(
|
|
39
|
-
properties.json.subscribe((json)=>{
|
|
40
|
-
|
|
37
|
+
properties.json.subscribe((json) => {
|
|
38
|
+
this.setJson(json as unknown as object);
|
|
41
39
|
})
|
|
42
40
|
);
|
|
43
41
|
}
|
|
@@ -58,9 +56,9 @@ export class JsonFormatterElement extends Element<IJsonFormatterProperties> {
|
|
|
58
56
|
src: json
|
|
59
57
|
});
|
|
60
58
|
|
|
61
|
-
this.
|
|
59
|
+
this.htmlElement.replaceChildren(jsonFormatter.render());
|
|
62
60
|
} else {
|
|
63
|
-
this.
|
|
61
|
+
this.htmlElement.innerHTML = (json as unknown).toString();
|
|
64
62
|
}
|
|
65
63
|
} else {
|
|
66
64
|
this.empty();
|
|
@@ -72,7 +70,7 @@ export function createJsonFormatter(properties: IJsonFormatterProperties) {
|
|
|
72
70
|
return new JsonFormatterElement(properties);
|
|
73
71
|
}
|
|
74
72
|
|
|
75
|
-
export class JsonFormatterProperties extends
|
|
73
|
+
export class JsonFormatterProperties extends ElementProperties implements IJsonFormatterProperties {
|
|
76
74
|
constructor(properties: IJsonFormatterProperties) {
|
|
77
75
|
super();
|
|
78
76
|
this.setProperties(this, properties);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as kendo from "@progress/kendo-ui/js/kendo.dataviz.chart";
|
|
2
|
-
import { Element } from "../../../framework/element";
|
|
3
|
-
import {
|
|
4
|
-
import { ISubscribable } from "../../../framework/observableInterfaces";
|
|
5
|
-
import { isSubscribable, unwrap } from "../../../framework/observablelmplementations";
|
|
2
|
+
import { Element, IElementProperties, extendProperties } from "../../../framework/element";
|
|
3
|
+
import { ISubscribable, observable } from "../../../framework/observable";
|
|
6
4
|
|
|
7
|
-
export interface IChartProperties extends
|
|
5
|
+
export interface IChartProperties extends IElementProperties {
|
|
8
6
|
data?: Array<unknown> | ISubscribable<Array<unknown>>;
|
|
9
7
|
chartArea?: kendo.dataviz.ui.ChartChartArea | undefined;
|
|
10
8
|
series?: kendo.dataviz.ui.ChartSeriesItem[] | ISubscribable<kendo.dataviz.ui.ChartSeriesItem[]>;
|
|
@@ -13,7 +11,7 @@ export interface IChartProperties extends IProperties {
|
|
|
13
11
|
legend?: kendo.dataviz.ui.ChartLegend | undefined;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
export class ChartElement extends Element<IChartProperties>{
|
|
14
|
+
export class ChartElement extends Element<IChartProperties> {
|
|
17
15
|
constructor(properties: IChartProperties) {
|
|
18
16
|
super(
|
|
19
17
|
{
|
|
@@ -39,12 +37,12 @@ export class ChartElement extends Element<IChartProperties>{
|
|
|
39
37
|
if (properties.data) {
|
|
40
38
|
this.dataSource = new kendo.data.DataSource(
|
|
41
39
|
{
|
|
42
|
-
data: unwrap(properties.data)
|
|
40
|
+
data: observable.unwrap(properties.data)
|
|
43
41
|
}
|
|
44
42
|
);
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
if (isSubscribable(properties.data)) {
|
|
45
|
+
if (observable.isSubscribable(properties.data)) {
|
|
48
46
|
this.disposers.push(
|
|
49
47
|
properties.data.subscribe((data) => {
|
|
50
48
|
this.dataSource.data(data);
|
|
@@ -54,20 +52,20 @@ export class ChartElement extends Element<IChartProperties>{
|
|
|
54
52
|
|
|
55
53
|
setTimeout(() => {
|
|
56
54
|
this.chart = new kendo.dataviz.ui.Chart(
|
|
57
|
-
this.
|
|
55
|
+
this.htmlElement,
|
|
58
56
|
{
|
|
59
57
|
autoBind: false,
|
|
60
58
|
legend: properties.legend,
|
|
61
59
|
dataSource: this.dataSource,
|
|
62
60
|
chartArea: properties.chartArea,
|
|
63
|
-
series: unwrap(properties.series),
|
|
64
|
-
categoryAxis: unwrap(properties.categoryAxis),
|
|
61
|
+
series: observable.unwrap(properties.series),
|
|
62
|
+
categoryAxis: observable.unwrap(properties.categoryAxis),
|
|
65
63
|
valueAxis: properties.valueAxis
|
|
66
64
|
}
|
|
67
65
|
);
|
|
68
66
|
});
|
|
69
67
|
|
|
70
|
-
if (isSubscribable(properties.series)) {
|
|
68
|
+
if (observable.isSubscribable(properties.series)) {
|
|
71
69
|
this.disposers.push(
|
|
72
70
|
properties.series.subscribe((series) => {
|
|
73
71
|
if (this.chart) {
|
|
@@ -79,14 +77,14 @@ export class ChartElement extends Element<IChartProperties>{
|
|
|
79
77
|
);
|
|
80
78
|
}
|
|
81
79
|
|
|
82
|
-
if (isSubscribable(properties.categoryAxis)) {
|
|
80
|
+
if (observable.isSubscribable(properties.categoryAxis)) {
|
|
83
81
|
this.disposers.push(
|
|
84
|
-
properties.categoryAxis.subscribe((categoryAxis)=>{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
properties.categoryAxis.subscribe((categoryAxis) => {
|
|
83
|
+
if (this.chart) {
|
|
84
|
+
this.chart.setOptions({
|
|
85
|
+
categoryAxis: categoryAxis
|
|
86
|
+
});
|
|
87
|
+
}
|
|
90
88
|
})
|
|
91
89
|
);
|
|
92
90
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import * as kendo from "@progress/kendo-ui/js/kendo.editor.js";
|
|
2
|
-
import { Element,
|
|
2
|
+
import { Element, createElement, IElementProperties, extendProperties } from "../../../framework/element";
|
|
3
3
|
import { createClickEvent } from "../../../framework/event";
|
|
4
|
-
import { IProperties, extendProperties } from "../../../framework/properties";
|
|
5
4
|
import { createDiv } from "../../html/Div/Div";
|
|
6
5
|
import { createButton } from "../../html/Button/Button";
|
|
7
6
|
import { formatHtml } from "../../../utilities/formatting/formatting";
|
|
8
|
-
import { ISubscribable } from "../../../framework/
|
|
9
|
-
import { isSubscribable, unwrap, observableValue, computed, isObservableValue } from "../../../framework/observablelmplementations";
|
|
7
|
+
import { ISubscribable, observable } from "../../../framework/observable";
|
|
10
8
|
|
|
11
|
-
export interface IEditorProperties extends
|
|
9
|
+
export interface IEditorProperties extends IElementProperties {
|
|
12
10
|
value?: string | ISubscribable<string>;
|
|
13
11
|
tools?: string[] | kendo.ui.EditorTool[];
|
|
14
12
|
}
|
|
@@ -39,13 +37,13 @@ export class EditorElement extends Element<IEditorProperties> {
|
|
|
39
37
|
|
|
40
38
|
const viewModel = this.properties;
|
|
41
39
|
|
|
42
|
-
const htmlMode = observableValue<boolean>(false);
|
|
40
|
+
const htmlMode = observable.observableValue<boolean>(false);
|
|
43
41
|
|
|
44
42
|
const divHeader = createDiv(
|
|
45
43
|
{
|
|
46
44
|
children: [
|
|
47
45
|
createButton({
|
|
48
|
-
content: computed<string>(() => {
|
|
46
|
+
content: observable.computed<string>(() => {
|
|
49
47
|
return htmlMode.get() ? "wysiwyg" : "view html source";
|
|
50
48
|
}),
|
|
51
49
|
eventListeners: [
|
|
@@ -63,7 +61,7 @@ export class EditorElement extends Element<IEditorProperties> {
|
|
|
63
61
|
).render();
|
|
64
62
|
|
|
65
63
|
const div = createDiv({
|
|
66
|
-
visible: computed<boolean>(() => {
|
|
64
|
+
visible: observable.computed<boolean>(() => {
|
|
67
65
|
return !htmlMode.get();
|
|
68
66
|
}),
|
|
69
67
|
style: {
|
|
@@ -71,7 +69,7 @@ export class EditorElement extends Element<IEditorProperties> {
|
|
|
71
69
|
}
|
|
72
70
|
}).render();
|
|
73
71
|
|
|
74
|
-
const textAreaElement =
|
|
72
|
+
const textAreaElement = createElement({
|
|
75
73
|
tagName: "textarea",
|
|
76
74
|
properties: {
|
|
77
75
|
visible: htmlMode,
|
|
@@ -83,15 +81,15 @@ export class EditorElement extends Element<IEditorProperties> {
|
|
|
83
81
|
}
|
|
84
82
|
}).render() as HTMLTextAreaElement;
|
|
85
83
|
|
|
86
|
-
this.
|
|
87
|
-
this.
|
|
88
|
-
this.
|
|
84
|
+
this.htmlElement.appendChild(div);
|
|
85
|
+
this.htmlElement.appendChild(textAreaElement);
|
|
86
|
+
this.htmlElement.appendChild(divHeader);
|
|
89
87
|
|
|
90
|
-
const html = unwrap<string>(viewModel.value);
|
|
88
|
+
const html = observable.unwrap<string>(viewModel.value);
|
|
91
89
|
div.innerHTML = html;
|
|
92
90
|
textAreaElement.value = formatHtml(html);
|
|
93
91
|
|
|
94
|
-
if (isSubscribable(viewModel.value)) {
|
|
92
|
+
if (observable.isSubscribable(viewModel.value)) {
|
|
95
93
|
|
|
96
94
|
this.disposers.push(
|
|
97
95
|
viewModel.value.subscribe((value) => {
|
|
@@ -111,7 +109,7 @@ export class EditorElement extends Element<IEditorProperties> {
|
|
|
111
109
|
this.editor.bind(
|
|
112
110
|
"change",
|
|
113
111
|
() => {
|
|
114
|
-
if (isObservableValue(viewModel.value)) {
|
|
112
|
+
if (observable.isObservableValue(viewModel.value)) {
|
|
115
113
|
viewModel.value.setValue(div.innerHTML);
|
|
116
114
|
}
|
|
117
115
|
}
|
|
@@ -120,7 +118,7 @@ export class EditorElement extends Element<IEditorProperties> {
|
|
|
120
118
|
textAreaElement.addEventListener(
|
|
121
119
|
"change",
|
|
122
120
|
() => {
|
|
123
|
-
if (isObservableValue(viewModel.value)) {
|
|
121
|
+
if (observable.isObservableValue(viewModel.value)) {
|
|
124
122
|
viewModel.value.setValue(textAreaElement.value);
|
|
125
123
|
}
|
|
126
124
|
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as kendo from "@progress/kendo-ui/js/kendo.grid.js";
|
|
2
|
-
import { Element, addElementToDictionary } from "../../../framework/element";
|
|
3
|
-
import { Properties, IProperties, extendProperties } from "../../../framework/properties";
|
|
2
|
+
import { Element, ElementProperties, IElementProperties, extendProperties, addElementToDictionary } from "../../../framework/element";
|
|
4
3
|
import { IChangedItem } from "../DataSource/DataSource";
|
|
5
|
-
import { ISubscribable } from "../../../framework/
|
|
6
|
-
import { isSubscribable, unwrap, isObservableValue, isObservableArray } from "../../../framework/observablelmplementations";
|
|
4
|
+
import { ISubscribable, observable } from "../../../framework/observable";
|
|
7
5
|
|
|
8
|
-
export interface IGridProperties<TItem> extends
|
|
6
|
+
export interface IGridProperties<TItem> extends IElementProperties {
|
|
9
7
|
items?: Array<TItem> | ISubscribable<Array<TItem>>;
|
|
10
8
|
idProperty?: keyof TItem;
|
|
11
9
|
columns?: Array<kendo.ui.GridColumn>;
|
|
@@ -60,7 +58,7 @@ export class GridElement<TItem> extends Element<IGridProperties<TItem>> {
|
|
|
60
58
|
const properties = this.properties;
|
|
61
59
|
|
|
62
60
|
this.dataSource = new kendo.data.DataSource({
|
|
63
|
-
data: unwrap(properties.items),
|
|
61
|
+
data: observable.unwrap(properties.items),
|
|
64
62
|
pageSize: this.properties.pageSize || 30,
|
|
65
63
|
change: (event: kendo.data.DataSourceChangeEvent) => {
|
|
66
64
|
const items = event.items as Array<IChangedItem>;
|
|
@@ -86,21 +84,21 @@ export class GridElement<TItem> extends Element<IGridProperties<TItem>> {
|
|
|
86
84
|
}
|
|
87
85
|
});
|
|
88
86
|
|
|
89
|
-
this.grid = new kendo.ui.Grid(this.
|
|
87
|
+
this.grid = new kendo.ui.Grid(this.htmlElement, {
|
|
90
88
|
dataSource: this.dataSource,
|
|
91
89
|
columns: this.properties.columns,
|
|
92
90
|
toolbar: this.properties.toolbar,
|
|
93
91
|
scrollable: this.properties.scrollable,
|
|
94
92
|
sortable: this.properties.sortable,
|
|
95
93
|
editable: this.properties.editable,
|
|
96
|
-
filterable: unwrap(this.properties.filterable),
|
|
94
|
+
filterable: observable.unwrap(this.properties.filterable),
|
|
97
95
|
change: (event: kendo.ui.GridChangeEvent) => {
|
|
98
|
-
if (isObservableValue(properties.selectedItem)) {
|
|
96
|
+
if (observable.isObservableValue(properties.selectedItem)) {
|
|
99
97
|
const selectedItem = getSelectedDataItem(event.sender) as TItem;
|
|
100
98
|
properties.selectedItem.setValue(selectedItem);
|
|
101
99
|
}
|
|
102
100
|
|
|
103
|
-
if (isObservableArray(properties.selectedItems)) {
|
|
101
|
+
if (observable.isObservableArray(properties.selectedItems)) {
|
|
104
102
|
properties.selectedItems.setItems(getSelectedDataItems<TItem>(event.sender));
|
|
105
103
|
}
|
|
106
104
|
|
|
@@ -145,7 +143,7 @@ export class GridElement<TItem> extends Element<IGridProperties<TItem>> {
|
|
|
145
143
|
});
|
|
146
144
|
}
|
|
147
145
|
|
|
148
|
-
if (isSubscribable(properties.items)) {
|
|
146
|
+
if (observable.isSubscribable(properties.items)) {
|
|
149
147
|
this.disposers.push(
|
|
150
148
|
properties.items.subscribe((items) => {
|
|
151
149
|
if (items) {
|
|
@@ -157,7 +155,7 @@ export class GridElement<TItem> extends Element<IGridProperties<TItem>> {
|
|
|
157
155
|
);
|
|
158
156
|
}
|
|
159
157
|
|
|
160
|
-
if (isSubscribable(properties.filterable)) {
|
|
158
|
+
if (observable.isSubscribable(properties.filterable)) {
|
|
161
159
|
this.disposers.push(
|
|
162
160
|
properties.filterable.subscribe((filterable) => {
|
|
163
161
|
this.grid.setOptions({ filterable: filterable });
|
|
@@ -165,7 +163,7 @@ export class GridElement<TItem> extends Element<IGridProperties<TItem>> {
|
|
|
165
163
|
);
|
|
166
164
|
}
|
|
167
165
|
|
|
168
|
-
if (isSubscribable(properties.selectedItem)) {
|
|
166
|
+
if (observable.isSubscribable(properties.selectedItem)) {
|
|
169
167
|
this.disposers.push(
|
|
170
168
|
properties.selectedItem.subscribe((selectedItem) => {
|
|
171
169
|
if (selectedItem && properties.idProperty) {
|
|
@@ -186,7 +184,7 @@ export class GridElement<TItem> extends Element<IGridProperties<TItem>> {
|
|
|
186
184
|
);
|
|
187
185
|
}
|
|
188
186
|
|
|
189
|
-
if (isSubscribable(properties.selectedItems)) {
|
|
187
|
+
if (observable.isSubscribable(properties.selectedItems)) {
|
|
190
188
|
this.disposers.push(
|
|
191
189
|
properties.selectedItems.subscribe((selectedItems) => {
|
|
192
190
|
if (selectedItems && selectedItems.length > 0 && properties.idProperty) {
|
|
@@ -257,7 +255,7 @@ export function getSelectedDataItems<TItem>(grid: kendo.ui.Grid): Array<TItem> {
|
|
|
257
255
|
return selectedDataItems;
|
|
258
256
|
}
|
|
259
257
|
|
|
260
|
-
export class GridProperties<TItem = unknown> extends
|
|
258
|
+
export class GridProperties<TItem = unknown> extends ElementProperties implements IGridProperties<TItem> {
|
|
261
259
|
constructor(properties: IGridProperties<TItem>) {
|
|
262
260
|
super();
|
|
263
261
|
this.setProperties(this, properties);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import * as kendo from "@progress/kendo-ui/js/kendo.menu.js";
|
|
2
|
-
import { Element, render } from "../../../framework/element";
|
|
3
|
-
import { Properties, IProperties, applyBindings, extendProperties } from "../../../framework/properties";
|
|
2
|
+
import { Element,ElementProperties, IElementProperties, extendProperties, render, applyBindings } from "../../../framework/element";
|
|
4
3
|
import { HierarchicalListItemProperties, IHierarchicalListItemProperties } from "../../custom/ListItem/ListItem";
|
|
5
|
-
import { ISubscribable } from "../../../framework/
|
|
6
|
-
import { isSubscribable, unwrap } from "../../../framework/observablelmplementations";
|
|
4
|
+
import { ISubscribable, observable } from "../../../framework/observable";
|
|
7
5
|
const getContent = "getContent";
|
|
8
6
|
|
|
9
|
-
export interface IMenuProperties extends
|
|
7
|
+
export interface IMenuProperties extends IElementProperties {
|
|
10
8
|
items?: Array<IHierarchicalListItemProperties> | ISubscribable<Array<IHierarchicalListItemProperties>>;
|
|
11
9
|
}
|
|
12
10
|
|
|
@@ -35,7 +33,7 @@ export class MenuElement extends Element<IMenuProperties> {
|
|
|
35
33
|
const viewModel = this.properties;
|
|
36
34
|
|
|
37
35
|
this.dataSource = new kendo.data.HierarchicalDataSource({});
|
|
38
|
-
this.menu = new kendo.ui.Menu(this.
|
|
36
|
+
this.menu = new kendo.ui.Menu(this.htmlElement, {
|
|
39
37
|
dataTextField: "text",
|
|
40
38
|
dataSource: this.dataSource
|
|
41
39
|
});
|
|
@@ -53,7 +51,7 @@ export class MenuElement extends Element<IMenuProperties> {
|
|
|
53
51
|
|
|
54
52
|
if (hierarchicalListItemViewModel[getContent]) {
|
|
55
53
|
const content = hierarchicalListItemViewModel[getContent]();
|
|
56
|
-
if (content instanceof
|
|
54
|
+
if (content instanceof ElementProperties) {
|
|
57
55
|
const firstChild = element.firstElementChild as HTMLElement;
|
|
58
56
|
firstChild.style.padding = "0";
|
|
59
57
|
firstChild.innerHTML = "";
|
|
@@ -66,11 +64,11 @@ export class MenuElement extends Element<IMenuProperties> {
|
|
|
66
64
|
}
|
|
67
65
|
);
|
|
68
66
|
|
|
69
|
-
this.buildItems(unwrap(viewModel.items));
|
|
70
|
-
if (isSubscribable(viewModel.items)) {
|
|
67
|
+
this.buildItems(observable.unwrap(viewModel.items));
|
|
68
|
+
if (observable.isSubscribable(viewModel.items)) {
|
|
71
69
|
this.disposers.push(
|
|
72
|
-
viewModel.items.subscribe((items)=>{
|
|
73
|
-
|
|
70
|
+
viewModel.items.subscribe((items) => {
|
|
71
|
+
this.buildItems(items);
|
|
74
72
|
})
|
|
75
73
|
);
|
|
76
74
|
}
|
|
@@ -83,7 +81,7 @@ export class MenuElement extends Element<IMenuProperties> {
|
|
|
83
81
|
if (listItems) {
|
|
84
82
|
//Add all visible menuItems to a dictionary
|
|
85
83
|
listItems.forEach((listItem) => {
|
|
86
|
-
if (listItem as unknown instanceof
|
|
84
|
+
if (listItem as unknown instanceof ElementProperties) {
|
|
87
85
|
listItem["attr"] = { postrender: true };
|
|
88
86
|
}
|
|
89
87
|
|
|
@@ -92,7 +90,7 @@ export class MenuElement extends Element<IMenuProperties> {
|
|
|
92
90
|
listItem[getContent] = () => { return content };
|
|
93
91
|
listItem.text = "<post>";
|
|
94
92
|
}
|
|
95
|
-
if (unwrap(listItem.visible) !== false) {
|
|
93
|
+
if (observable.unwrap(listItem.visible) !== false) {
|
|
96
94
|
itemDictionary[listItem.id] = listItem;
|
|
97
95
|
}
|
|
98
96
|
});
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import * as kendo from "@progress/kendo-ui/js/kendo.treeview.js";
|
|
2
|
-
import { Element, render } from "../../../framework/element";
|
|
3
|
-
import { Properties, IProperties, applyBindings, extendProperties } from "../../../framework/properties";
|
|
2
|
+
import { Element,ElementProperties, IElementProperties, extendProperties, applyBindings, render } from "../../../framework/element";
|
|
4
3
|
import { HierarchicalListItemProperties } from "../../custom/ListItem/ListItem";
|
|
5
|
-
import { ISubscribable } from "../../../framework/
|
|
6
|
-
import { isSubscribable, unwrap } from "../../../framework/observablelmplementations";
|
|
4
|
+
import { ISubscribable, observable } from "../../../framework/observable";
|
|
7
5
|
const getContent = "getContent";
|
|
8
6
|
|
|
9
|
-
export interface ITreeviewProperties extends
|
|
7
|
+
export interface ITreeviewProperties extends IElementProperties {
|
|
10
8
|
items?: Array<HierarchicalListItemProperties> | ISubscribable<Array<HierarchicalListItemProperties>>;
|
|
11
9
|
selectedItem?: HierarchicalListItemProperties | ISubscribable<HierarchicalListItemProperties>;
|
|
12
10
|
select?: (dataItem: unknown) => void;
|
|
@@ -39,7 +37,7 @@ export class TreeviewElement extends Element<ITreeviewProperties> {
|
|
|
39
37
|
sort: { field: "order", dir: "asc" }
|
|
40
38
|
});
|
|
41
39
|
|
|
42
|
-
this.treeView = new kendo.ui.TreeView(this.
|
|
40
|
+
this.treeView = new kendo.ui.TreeView(this.htmlElement, {
|
|
43
41
|
dataSource: this.dataSource
|
|
44
42
|
});
|
|
45
43
|
|
|
@@ -59,7 +57,7 @@ export class TreeviewElement extends Element<ITreeviewProperties> {
|
|
|
59
57
|
"dataBound",
|
|
60
58
|
(event) => {
|
|
61
59
|
//Find all menuitems that needs to be post rendered.
|
|
62
|
-
const selectedItem = unwrap(viewModel.selectedItem);
|
|
60
|
+
const selectedItem = observable.unwrap(viewModel.selectedItem);
|
|
63
61
|
if (selectedItem) {
|
|
64
62
|
event.sender.wrapper.find(".k-item").each((index, element: HTMLElement) => {
|
|
65
63
|
const uid = element.getAttribute("data-uid");
|
|
@@ -78,7 +76,7 @@ export class TreeviewElement extends Element<ITreeviewProperties> {
|
|
|
78
76
|
|
|
79
77
|
if (hierarchicalListItemViewModel[getContent]) {
|
|
80
78
|
const content = hierarchicalListItemViewModel[getContent]();
|
|
81
|
-
if (content instanceof
|
|
79
|
+
if (content instanceof ElementProperties) {
|
|
82
80
|
const firstChild = element.firstElementChild as HTMLElement;
|
|
83
81
|
firstChild.style.padding = "0";
|
|
84
82
|
firstChild.innerHTML = "";
|
|
@@ -91,8 +89,8 @@ export class TreeviewElement extends Element<ITreeviewProperties> {
|
|
|
91
89
|
}
|
|
92
90
|
);
|
|
93
91
|
|
|
94
|
-
this.buildItems(unwrap(viewModel.items));
|
|
95
|
-
if (isSubscribable(viewModel.items)) {
|
|
92
|
+
this.buildItems(observable.unwrap(viewModel.items));
|
|
93
|
+
if (observable.isSubscribable(viewModel.items)) {
|
|
96
94
|
this.disposers.push(
|
|
97
95
|
viewModel.items.subscribe((items) => {
|
|
98
96
|
this.buildItems(items);
|
|
@@ -114,7 +112,7 @@ export class TreeviewElement extends Element<ITreeviewProperties> {
|
|
|
114
112
|
listItem[getContent] = () => { return content };
|
|
115
113
|
listItem.text = "<post>";
|
|
116
114
|
}
|
|
117
|
-
if (unwrap(listItem.visible) !== false) {
|
|
115
|
+
if (observable.unwrap(listItem.visible) !== false) {
|
|
118
116
|
itemDictionary[listItem.id] = listItem;
|
|
119
117
|
}
|
|
120
118
|
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as leaflet from "leaflet";
|
|
2
|
-
import { IElement, getElement } from "../../../framework/element";
|
|
3
|
-
import { Properties } from "../../../framework/properties";
|
|
2
|
+
import { IElement, getElement, ElementProperties } from "../../../framework/element";
|
|
4
3
|
|
|
5
4
|
export interface ILeafletLabelControlOptions extends leaflet.ControlOptions {
|
|
6
|
-
content: string | IElement |
|
|
5
|
+
content: string | IElement | ElementProperties
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
export class LeafletLabelControl extends leaflet.Control {
|
|
@@ -13,13 +12,13 @@ export class LeafletLabelControl extends leaflet.Control {
|
|
|
13
12
|
this.content = options.content;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
private readonly content: string | IElement |
|
|
15
|
+
private readonly content: string | IElement | ElementProperties;
|
|
17
16
|
|
|
18
17
|
onAdd(): HTMLElement {
|
|
19
18
|
const div = document.createElement("div");
|
|
20
19
|
|
|
21
20
|
let view;
|
|
22
|
-
if (this.content instanceof
|
|
21
|
+
if (this.content instanceof ElementProperties) {
|
|
23
22
|
view = getElement(this.content);
|
|
24
23
|
if (view) {
|
|
25
24
|
div.appendChild(view.render());
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ISubscribable } from "../../../framework/
|
|
2
|
-
import { isSubscribable, unwrap } from "../../../framework/observablelmplementations";
|
|
1
|
+
import { ISubscribable, observable } from "../../../framework/observable";
|
|
3
2
|
import * as leaflet from "leaflet";
|
|
4
|
-
import { Element,
|
|
5
|
-
import { Properties, IProperties, extendProperties } from "../../../framework/properties";
|
|
3
|
+
import { Element,addElementToDictionary, ElementProperties, IElementProperties, extendProperties } from "../../../framework/element";
|
|
6
4
|
|
|
7
|
-
export interface IMapProperties extends
|
|
5
|
+
export interface IMapProperties extends IElementProperties {
|
|
8
6
|
renderer?: leaflet.Renderer;
|
|
9
7
|
center?: leaflet.LatLngExpression | ISubscribable<leaflet.LatLngExpression>;
|
|
10
8
|
zoom?: number;
|
|
@@ -55,7 +53,7 @@ export class MapElement extends Element<IMapProperties> {
|
|
|
55
53
|
//Leaflet can not handle rendering from an element not attached to the DOM
|
|
56
54
|
setTimeout(
|
|
57
55
|
() => {
|
|
58
|
-
this.map = leaflet.map(this.
|
|
56
|
+
this.map = leaflet.map(this.htmlElement, options).setView(observable.unwrap(properties.center), this.properties.zoom);
|
|
59
57
|
|
|
60
58
|
//Add the language specific zoom element
|
|
61
59
|
leaflet.control.zoom({
|
|
@@ -86,8 +84,8 @@ export class MapElement extends Element<IMapProperties> {
|
|
|
86
84
|
|
|
87
85
|
this.setTileLayers(properties.tileLayers);
|
|
88
86
|
|
|
89
|
-
this.setLayers(unwrap(properties.layers));
|
|
90
|
-
if (isSubscribable(properties.layers)) {
|
|
87
|
+
this.setLayers(observable.unwrap(properties.layers));
|
|
88
|
+
if (observable.isSubscribable(properties.layers)) {
|
|
91
89
|
this.disposers.push(
|
|
92
90
|
properties.layers.subscribe((layers) => {
|
|
93
91
|
this.setLayers(layers);
|
|
@@ -95,8 +93,8 @@ export class MapElement extends Element<IMapProperties> {
|
|
|
95
93
|
);
|
|
96
94
|
}
|
|
97
95
|
|
|
98
|
-
this.setControls(unwrap(properties.controls));
|
|
99
|
-
if (isSubscribable(properties.controls)) {
|
|
96
|
+
this.setControls(observable.unwrap(properties.controls));
|
|
97
|
+
if (observable.isSubscribable(properties.controls)) {
|
|
100
98
|
this.disposers.push(
|
|
101
99
|
properties.controls.subscribe((controls) => {
|
|
102
100
|
this.setControls(controls);
|
|
@@ -104,7 +102,7 @@ export class MapElement extends Element<IMapProperties> {
|
|
|
104
102
|
);
|
|
105
103
|
}
|
|
106
104
|
|
|
107
|
-
if (isSubscribable(properties.center)) {
|
|
105
|
+
if (observable.isSubscribable(properties.center)) {
|
|
108
106
|
this.disposers.push(
|
|
109
107
|
properties.center.subscribe((center) => {
|
|
110
108
|
this.map.panTo(center);
|
|
@@ -165,7 +163,7 @@ export function createMap(properties: IMapProperties) {
|
|
|
165
163
|
|
|
166
164
|
export const burtonville: leaflet.LatLngExpression = [50.283939, 5.964070];
|
|
167
165
|
|
|
168
|
-
export class MapProperties extends
|
|
166
|
+
export class MapProperties extends ElementProperties implements IMapProperties {
|
|
169
167
|
constructor(properties: IMapProperties) {
|
|
170
168
|
super();
|
|
171
169
|
this.setProperties(this, properties);
|