@web-atoms/core 2.6.21 → 2.6.25
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/App.d.ts +1 -1
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js.map +1 -1
- package/dist/core/SingleInvoker.d.ts.map +1 -1
- package/dist/core/SingleInvoker.js.map +1 -1
- package/dist/core/sleep.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist-esm/App.d.ts +1 -1
- package/dist-esm/App.d.ts.map +1 -1
- package/dist-esm/App.js +231 -235
- package/dist-esm/App.js.map +1 -1
- package/dist-esm/Atom.js +93 -96
- package/dist-esm/MockApp.js +17 -18
- package/dist-esm/Pack.js +1 -3
- package/dist-esm/core/AtomBinder.js +189 -187
- package/dist-esm/core/AtomComponent.js +479 -502
- package/dist-esm/core/AtomDispatcher.js +46 -48
- package/dist-esm/core/AtomDisposableList.js +24 -25
- package/dist-esm/core/AtomEnumerator.js +15 -16
- package/dist-esm/core/AtomList.js +193 -192
- package/dist-esm/core/AtomLoader.js +229 -215
- package/dist-esm/core/AtomMap.js +7 -8
- package/dist-esm/core/AtomOnce.js +22 -24
- package/dist-esm/core/AtomSelectableList.js +240 -243
- package/dist-esm/core/AtomUri.js +70 -72
- package/dist-esm/core/AtomWatcher.js +105 -111
- package/dist-esm/core/Bind.js +271 -269
- package/dist-esm/core/BindableProperty.js +26 -27
- package/dist-esm/core/CancelTokenFactory.js +21 -24
- package/dist-esm/core/Color.js +1 -2
- package/dist-esm/core/Colors.js +545 -231
- package/dist-esm/core/Command.js +236 -223
- package/dist-esm/core/Defer.js +21 -22
- package/dist-esm/core/EventScope.js +96 -88
- package/dist-esm/core/ExpressionParser.js +132 -144
- package/dist-esm/core/ExtendControl.js +7 -8
- package/dist-esm/core/FormattedError.js +7 -8
- package/dist-esm/core/FormattedString.js +4 -5
- package/dist-esm/core/Hacks.js +41 -42
- package/dist-esm/core/IFetchEvent.js +1 -2
- package/dist-esm/core/IScreen.js +1 -2
- package/dist-esm/core/IValueConverter.js +1 -2
- package/dist-esm/core/InheritedProperty.js +61 -63
- package/dist-esm/core/InjectProperty.js +12 -13
- package/dist-esm/core/KeyValuePairs.js +1 -2
- package/dist-esm/core/Markdown.js +14 -17
- package/dist-esm/core/MarkdownError.js +6 -7
- package/dist-esm/core/PropertyBinding.js +1 -2
- package/dist-esm/core/PropertyMap.js +28 -27
- package/dist-esm/core/Route.js +149 -148
- package/dist-esm/core/SingleInvoker.d.ts.map +1 -1
- package/dist-esm/core/SingleInvoker.js +32 -35
- package/dist-esm/core/SingleInvoker.js.map +1 -1
- package/dist-esm/core/StringHelper.js +49 -51
- package/dist-esm/core/TransientDisposable.js +14 -16
- package/dist-esm/core/WatchProperty.js +18 -17
- package/dist-esm/core/WebImage.js +7 -8
- package/dist-esm/core/XNode.js +134 -117
- package/dist-esm/core/sleep.js +21 -24
- package/dist-esm/core/sleep.js.map +1 -1
- package/dist-esm/core/types.js +102 -103
- package/dist-esm/di/DISingleton.js +7 -5
- package/dist-esm/di/DITransient.js +7 -5
- package/dist-esm/di/IMockOrInject.js +1 -2
- package/dist-esm/di/IServiceProvider.js +1 -2
- package/dist-esm/di/Inject.js +67 -67
- package/dist-esm/di/Register.js +25 -26
- package/dist-esm/di/RegisterScoped.js +4 -3
- package/dist-esm/di/RegisterSingleton.js +4 -3
- package/dist-esm/di/ServiceCollection.js +38 -37
- package/dist-esm/di/ServiceProvider.js +94 -94
- package/dist-esm/di/TypeKey.js +13 -12
- package/dist-esm/services/BusyIndicatorService.js +7 -11
- package/dist-esm/services/CacheService.js +54 -62
- package/dist-esm/services/FetchBuilder.js +327 -278
- package/dist-esm/services/JsonService.js +118 -116
- package/dist-esm/services/MockNavigationService.js +127 -126
- package/dist-esm/services/NavigationService.js +95 -102
- package/dist-esm/services/ReferenceService.js +30 -33
- package/dist-esm/services/http/AjaxOptions.js +1 -3
- package/dist-esm/services/http/JsonError.js +16 -15
- package/dist-esm/services/http/RestService.js +314 -323
- package/dist-esm/style/StyleRule.js +1 -2
- package/dist-esm/test.js +0 -1
- package/dist-esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist-esm/unit/AtomTest.js +10 -11
- package/dist-esm/view-model/Action.js +258 -223
- package/dist-esm/view-model/AtomViewModel.js +234 -232
- package/dist-esm/view-model/AtomWindowViewModel.js +13 -14
- package/dist-esm/view-model/BindableUrlParameter.js +7 -8
- package/dist-esm/view-model/Delay.js +21 -25
- package/dist-esm/view-model/Disposable.js +28 -29
- package/dist-esm/view-model/Load.js +72 -73
- package/dist-esm/view-model/Once.js +33 -35
- package/dist-esm/view-model/baseTypes.js +4 -5
- package/dist-esm/view-model/bindPromise.js +24 -27
- package/dist-esm/view-model/bindProperty.js +3 -4
- package/dist-esm/view-model/bindUrlParameter.js +39 -43
- package/dist-esm/web/controls/AtomComboBox.js +56 -63
- package/dist-esm/web/controls/AtomControl.js +485 -490
- package/dist-esm/web/controls/AtomGridSplitter.js +57 -50
- package/dist-esm/web/controls/AtomGridView.js +230 -222
- package/dist-esm/web/controls/AtomItemsControl.js +677 -688
- package/dist-esm/web/controls/AtomPage.js +6 -7
- package/dist-esm/web/controls/AtomTemplate.js +1 -3
- package/dist-esm/web/controls/AtomTemplateControl.js +28 -29
- package/dist-esm/web/controls/AtomViewStack.js +19 -20
- package/dist-esm/web/core/AtomUI.js +200 -200
- package/dist-esm/web/core/Encoder.js +142 -152
- package/dist-esm/web/core/HtmlNode.js +141 -139
- package/dist-esm/web/images/Busy.js +1 -2
- package/dist-esm/web/images/BusyDataUrl.js +2 -869
- package/dist-esm/web/images/Button.js +1 -2
- package/dist-esm/web/images/ButtonDataUrl.js +2 -30
- package/dist-esm/web/images/CloseButton.js +1 -2
- package/dist-esm/web/images/CloseButtonDataUrl.js +2 -30
- package/dist-esm/web/images/CloseButtonHover.js +1 -2
- package/dist-esm/web/images/CloseButtonHoverDataUrl.js +2 -24
- package/dist-esm/web/services/LastTarget.js +31 -29
- package/dist-esm/web/services/MarkdownService.js +19 -31
- package/dist-esm/web/services/NotificationPopup.js +28 -21
- package/dist-esm/web/services/PopupService.js +512 -478
- package/dist-esm/web/services/PopupWindow.js +266 -247
- package/dist-esm/web/styles/AtomAlertWindowStyle.js +39 -40
- package/dist-esm/web/styles/AtomFrameStyle.js +15 -16
- package/dist-esm/web/styles/AtomNotificationStyle.js +19 -20
- package/dist-esm/web/styles/AtomPageLinkStyle.js +11 -12
- package/dist-esm/web/styles/AtomPopupStyle.js +9 -10
- package/dist-esm/web/styles/AtomStyle.js +61 -64
- package/dist-esm/web/styles/AtomStyleSheet.js +50 -51
- package/dist-esm/web/styles/AtomWindowStyle.js +116 -117
- package/dist-esm/web/styles/IStyleDeclaration.js +1 -2
- package/dist-esm/web/styles/StyleBuilder.js +79 -80
- package/package.json +3 -1
- package/src/App.ts +1 -1
- package/src/core/SingleInvoker.ts +1 -1
- package/src/core/sleep.ts +1 -1
|
@@ -1,125 +1,119 @@
|
|
|
1
1
|
import { AtomBinder } from "./AtomBinder.js";
|
|
2
2
|
import { parsePath } from "./ExpressionParser.js";
|
|
3
3
|
export class ObjectProperty {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
constructor(name) {
|
|
5
|
+
this.name = name;
|
|
6
|
+
}
|
|
7
|
+
toString() {
|
|
8
|
+
return this.name;
|
|
9
|
+
}
|
|
10
10
|
}
|
|
11
11
|
export class AtomWatcher {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.func = onChanged;
|
|
25
|
-
}
|
|
26
|
-
this.runEvaluate = () => {
|
|
27
|
-
this.evaluate();
|
|
28
|
-
};
|
|
29
|
-
this.runEvaluate.watcher = this;
|
|
30
|
-
this.path = path.map((x) => x.map((y) => new ObjectProperty(y)));
|
|
31
|
-
if (!this.path.length) {
|
|
32
|
-
debugger;
|
|
33
|
-
console.warn("There is nothing to watch, do not use one way binding without any binding expression");
|
|
34
|
-
}
|
|
12
|
+
constructor(target, path, onChanged, source) {
|
|
13
|
+
this.source = source;
|
|
14
|
+
this.isExecuting = false;
|
|
15
|
+
this.target = target;
|
|
16
|
+
this.forValidation = true;
|
|
17
|
+
if (path instanceof Function) {
|
|
18
|
+
const f = path;
|
|
19
|
+
path = parsePath(path);
|
|
20
|
+
this.func = onChanged || f;
|
|
21
|
+
this.funcText = f.toString();
|
|
22
|
+
} else {
|
|
23
|
+
this.func = onChanged;
|
|
35
24
|
}
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
this.runEvaluate = () => {
|
|
26
|
+
this.evaluate();
|
|
27
|
+
};
|
|
28
|
+
this.runEvaluate.watcher = this;
|
|
29
|
+
this.path = path.map(x => x.map(y => new ObjectProperty(y)));
|
|
30
|
+
if (!this.path.length) {
|
|
31
|
+
debugger;
|
|
32
|
+
console.warn("There is nothing to watch, do not use one way binding without any binding expression");
|
|
38
33
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
op.watcher.dispose();
|
|
47
|
-
op.watcher = null;
|
|
48
|
-
op.target = null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
this.func = null;
|
|
53
|
-
this.path = null;
|
|
54
|
-
this.source = null;
|
|
34
|
+
}
|
|
35
|
+
toString() {
|
|
36
|
+
return this.func.toString();
|
|
37
|
+
}
|
|
38
|
+
dispose() {
|
|
39
|
+
if (!this.path) {
|
|
40
|
+
return;
|
|
55
41
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this.evaluatePath(this.target, iterator);
|
|
63
|
-
}
|
|
42
|
+
for (const p of this.path) {
|
|
43
|
+
for (const op of p) {
|
|
44
|
+
if (op.watcher) {
|
|
45
|
+
op.watcher.dispose();
|
|
46
|
+
op.watcher = null;
|
|
47
|
+
op.target = null;
|
|
64
48
|
}
|
|
49
|
+
}
|
|
65
50
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
p.watcher = AtomBinder.watch(target, p.name, this.runEvaluate);
|
|
79
|
-
}
|
|
80
|
-
else if (p.target !== target) {
|
|
81
|
-
if (p.watcher) {
|
|
82
|
-
p.watcher.dispose();
|
|
83
|
-
}
|
|
84
|
-
p.watcher = AtomBinder.watch(target, p.name, this.runEvaluate);
|
|
85
|
-
}
|
|
86
|
-
p.target = target;
|
|
87
|
-
target = newTarget;
|
|
88
|
-
if (newTarget === undefined || newTarget === null) {
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return newTarget;
|
|
51
|
+
this.func = null;
|
|
52
|
+
this.path = null;
|
|
53
|
+
this.source = null;
|
|
54
|
+
}
|
|
55
|
+
init(evaluate) {
|
|
56
|
+
if (evaluate) {
|
|
57
|
+
this.evaluate(true);
|
|
58
|
+
} else {
|
|
59
|
+
for (const iterator of this.path) {
|
|
60
|
+
this.evaluatePath(this.target, iterator);
|
|
61
|
+
}
|
|
93
62
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
63
|
+
}
|
|
64
|
+
evaluatePath(target, path) {
|
|
65
|
+
let newTarget = null;
|
|
66
|
+
for (const p of path) {
|
|
67
|
+
if (this.source && p.name === "this") {
|
|
68
|
+
target = this.source;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
newTarget = target[p.name];
|
|
72
|
+
if (!p.target) {
|
|
73
|
+
if (p.watcher) {
|
|
74
|
+
p.watcher.dispose();
|
|
101
75
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const logs = [];
|
|
107
|
-
for (const p of this.path) {
|
|
108
|
-
values.push(this.evaluatePath(this.target, p));
|
|
109
|
-
}
|
|
110
|
-
try {
|
|
111
|
-
this.func.apply(this.target, values);
|
|
112
|
-
}
|
|
113
|
-
catch (e) {
|
|
114
|
-
console.warn(e);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
finally {
|
|
118
|
-
this.isExecuting = false;
|
|
119
|
-
for (const d of disposeWatchers) {
|
|
120
|
-
d.dispose();
|
|
121
|
-
}
|
|
76
|
+
p.watcher = AtomBinder.watch(target, p.name, this.runEvaluate);
|
|
77
|
+
} else if (p.target !== target) {
|
|
78
|
+
if (p.watcher) {
|
|
79
|
+
p.watcher.dispose();
|
|
122
80
|
}
|
|
81
|
+
p.watcher = AtomBinder.watch(target, p.name, this.runEvaluate);
|
|
82
|
+
}
|
|
83
|
+
p.target = target;
|
|
84
|
+
target = newTarget;
|
|
85
|
+
if (newTarget === undefined || newTarget === null) {
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
123
88
|
}
|
|
124
|
-
|
|
125
|
-
|
|
89
|
+
return newTarget;
|
|
90
|
+
}
|
|
91
|
+
evaluate(force) {
|
|
92
|
+
if (!this.path) {
|
|
93
|
+
console.warn(`Watcher is not disposed properly, please watch for any memory leak`);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (this.isExecuting) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const disposeWatchers = [];
|
|
100
|
+
this.isExecuting = true;
|
|
101
|
+
try {
|
|
102
|
+
const values = [];
|
|
103
|
+
const logs = [];
|
|
104
|
+
for (const p of this.path) {
|
|
105
|
+
values.push(this.evaluatePath(this.target, p));
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
this.func.apply(this.target, values);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
console.warn(e);
|
|
111
|
+
}
|
|
112
|
+
} finally {
|
|
113
|
+
this.isExecuting = false;
|
|
114
|
+
for (const d of disposeWatchers) {
|
|
115
|
+
d.dispose();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|