@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
|
@@ -3,93 +3,101 @@ import { CancelToken } from "./types.js";
|
|
|
3
3
|
const key = DateTime.now.msSinceEpoch;
|
|
4
4
|
let id = 1;
|
|
5
5
|
export default class EventScope {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
static create() {
|
|
7
|
+
return new EventScope(`eventScopeE${key}${id++}`);
|
|
8
|
+
}
|
|
9
|
+
bindEvent(fx) {
|
|
10
|
+
return {
|
|
11
|
+
[this.eventName]: fx
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
constructor(eventType) {
|
|
15
|
+
this.eventType = eventType;
|
|
16
|
+
this.eventName = `event-${this.eventType}`;
|
|
17
|
+
}
|
|
18
|
+
subscribe(control, handler) {
|
|
19
|
+
return control.bindEvent(window, this.eventType, handler);
|
|
20
|
+
}
|
|
21
|
+
listen(fx) {
|
|
22
|
+
const asyncHandler = ce => {
|
|
23
|
+
if (ce.defaultPrevented) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const p = fx(ce);
|
|
28
|
+
if (p?.catch) {
|
|
29
|
+
p.catch(r => {
|
|
30
|
+
if (CancelToken.isCancelled(r)) {
|
|
31
|
+
return;
|
|
25
32
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
console.error(r);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
} catch (e) {
|
|
37
|
+
if (CancelToken.isCancelled(e)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
console.error(e);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
window.addEventListener(this.eventType, asyncHandler);
|
|
44
|
+
return {
|
|
45
|
+
dispose: () => {
|
|
46
|
+
window.removeEventListener(this.eventType, asyncHandler);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
listenOn(target, fx) {
|
|
51
|
+
const asyncHandler = ce => {
|
|
52
|
+
if (ce.defaultPrevented) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const p = fx(ce);
|
|
57
|
+
if (p?.catch) {
|
|
58
|
+
p.catch(r => {
|
|
59
|
+
if (CancelToken.isCancelled(r)) {
|
|
60
|
+
return;
|
|
36
61
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
dispatch(target, detail, { cancelable = true, bubbles = true } = {}) {
|
|
82
|
-
const ce = new CustomEvent(this.eventType, { detail, cancelable, bubbles });
|
|
83
|
-
target.dispatchEvent(ce);
|
|
84
|
-
return ce;
|
|
85
|
-
}
|
|
86
|
-
dispatchEvent(detail, cancelable = true) {
|
|
87
|
-
const ce = new CustomEvent(this.eventType, { detail, cancelable, bubbles: false });
|
|
88
|
-
window.dispatchEvent(ce);
|
|
89
|
-
return ce;
|
|
90
|
-
}
|
|
91
|
-
toString() {
|
|
92
|
-
return this.eventType;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=EventScope.js.map
|
|
62
|
+
console.error(r);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
} catch (e) {
|
|
66
|
+
if (CancelToken.isCancelled(e)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
console.error(e);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
target.addEventListener(this.eventType, asyncHandler);
|
|
73
|
+
return {
|
|
74
|
+
dispose: () => {
|
|
75
|
+
target.removeEventListener(this.eventType, asyncHandler);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
dispatch(target, detail, {
|
|
80
|
+
cancelable = true,
|
|
81
|
+
bubbles = true
|
|
82
|
+
} = {}) {
|
|
83
|
+
const ce = new CustomEvent(this.eventType, {
|
|
84
|
+
detail,
|
|
85
|
+
cancelable,
|
|
86
|
+
bubbles
|
|
87
|
+
});
|
|
88
|
+
target.dispatchEvent(ce);
|
|
89
|
+
return ce;
|
|
90
|
+
}
|
|
91
|
+
dispatchEvent(detail, cancelable = true) {
|
|
92
|
+
const ce = new CustomEvent(this.eventType, {
|
|
93
|
+
detail,
|
|
94
|
+
cancelable,
|
|
95
|
+
bubbles: false
|
|
96
|
+
});
|
|
97
|
+
window.dispatchEvent(ce);
|
|
98
|
+
return ce;
|
|
99
|
+
}
|
|
100
|
+
toString() {
|
|
101
|
+
return this.eventType;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -1,161 +1,149 @@
|
|
|
1
1
|
const viewModelParseWatchCache = {};
|
|
2
2
|
function trimRegEx(t, r) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const m = r.exec(t);
|
|
4
|
+
if (m && m.length) {
|
|
5
|
+
return [true, t.substring(m[0].length).trim(), m[0]];
|
|
6
|
+
}
|
|
7
|
+
return [false, t, ""];
|
|
8
8
|
}
|
|
9
9
|
function extractTill(text, search, returnOriginal = false) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const index = text.indexOf(search);
|
|
11
|
+
if (index <= 0) {
|
|
12
|
+
return returnOriginal ? text : "";
|
|
13
|
+
}
|
|
14
|
+
return text.substring(0, index);
|
|
15
15
|
}
|
|
16
16
|
export function parsePath(f, parseThis) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
let str = f.toString().trim();
|
|
18
|
+
str = str.split("\n").filter(s => !/^\/\//.test(s.trim())).join("\n");
|
|
19
|
+
const key = (parseThis === undefined ? "un:" : parseThis ? "_this:" : "_noThis:") + str;
|
|
20
|
+
const px1 = viewModelParseWatchCache[key];
|
|
21
|
+
if (px1) {
|
|
22
|
+
return px1;
|
|
23
|
+
}
|
|
24
|
+
if (str.endsWith("}")) {
|
|
25
|
+
str = str.substr(0, str.length - 1);
|
|
26
|
+
}
|
|
27
|
+
const functionRegEx = /^\w+\s*\(/;
|
|
28
|
+
const lambdaRegEx = /^\(?(\w+)?(\s?\,\s?\w+)*\)?\s?\=\>/;
|
|
29
|
+
let arg = "";
|
|
30
|
+
const original = str;
|
|
31
|
+
let [success, remaining] = trimRegEx(str, functionRegEx);
|
|
32
|
+
if (success) {
|
|
33
|
+
str = remaining;
|
|
34
|
+
remaining = extractTill(remaining, ")");
|
|
35
|
+
str = str.substring(remaining.length);
|
|
36
|
+
arg = extractTill(remaining, ",", true);
|
|
37
|
+
} else {
|
|
38
|
+
[success, str, remaining] = trimRegEx(str, lambdaRegEx);
|
|
32
39
|
if (success) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
remaining = remaining.trim();
|
|
41
|
+
remaining = remaining.substring(0, remaining.length - 2);
|
|
42
|
+
remaining = extractTill(remaining, ")", true);
|
|
43
|
+
arg = extractTill(remaining, ",", true);
|
|
44
|
+
if (arg.startsWith("(")) {
|
|
45
|
+
arg = arg.substring(1);
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
if (parseThis !== undefined && parseThis === false) {
|
|
49
|
+
return [];
|
|
50
|
+
} else {
|
|
51
|
+
parseThis = true;
|
|
52
|
+
}
|
|
37
53
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
}
|
|
55
|
+
str = str.trim();
|
|
56
|
+
const isThis = parseThis === undefined ? (arg ? false : true) || parseThis : parseThis;
|
|
57
|
+
const p = (isThis ? "(\\_this|this)" : arg || "").trim();
|
|
58
|
+
if (p.length === 0) {
|
|
59
|
+
const empty = [];
|
|
60
|
+
viewModelParseWatchCache[key] = empty;
|
|
61
|
+
return empty;
|
|
62
|
+
}
|
|
63
|
+
const regExp = `(?:(\\b${p})(?:(\\.[a-zA-Z_][a-zA-Z_0-9]*)+)\\s?(?:(\\(|\\=\\=\\=|\\=\\=|\\=)?))`;
|
|
64
|
+
const re = new RegExp(regExp, "gi");
|
|
65
|
+
let path = [];
|
|
66
|
+
const ms = str.replace(re, m => {
|
|
67
|
+
let px = m;
|
|
68
|
+
if (px.startsWith("this.")) {
|
|
69
|
+
if (parseThis !== true) {
|
|
70
|
+
px = px.substr(5);
|
|
71
|
+
}
|
|
72
|
+
} else if (px.startsWith("_this.")) {
|
|
73
|
+
if (parseThis !== true) {
|
|
74
|
+
px = px.substr(6);
|
|
75
|
+
} else {
|
|
76
|
+
px = px.substr(1);
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
px = px.substr(p.length + 1);
|
|
57
80
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
: parseThis;
|
|
62
|
-
const p = (isThis ? "(\\_this|this)" : (arg || "")).trim();
|
|
63
|
-
if (p.length === 0) {
|
|
64
|
-
const empty = [];
|
|
65
|
-
viewModelParseWatchCache[key] = empty;
|
|
66
|
-
return empty;
|
|
81
|
+
px = px.split(".").filter(s => !s.endsWith("(")).join(".");
|
|
82
|
+
if (!path.find(y => y === px)) {
|
|
83
|
+
path.push(px);
|
|
67
84
|
}
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (parseThis !== true) {
|
|
80
|
-
px = px.substr(6);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
px = px.substr(1);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
px = px.substr(p.length + 1);
|
|
88
|
-
}
|
|
89
|
-
px = px.split(".").filter((s) => !s.endsWith("(")).join(".");
|
|
90
|
-
if (!path.find((y) => y === px)) {
|
|
91
|
-
path.push(px);
|
|
92
|
-
}
|
|
93
|
-
const filtered = [];
|
|
94
|
-
for (const iterator of path) {
|
|
95
|
-
if (iterator.endsWith("==") || !(iterator.endsWith("(") || iterator.endsWith("="))) {
|
|
96
|
-
filtered.push((iterator.endsWith("===") ? iterator.substr(0, iterator.length - 3) :
|
|
97
|
-
(iterator.endsWith("==") ? iterator.substr(0, iterator.length - 2) : iterator)).trim());
|
|
98
|
-
}
|
|
85
|
+
const filtered = [];
|
|
86
|
+
for (const iterator of path) {
|
|
87
|
+
if (iterator.endsWith("==") || !(iterator.endsWith("(") || iterator.endsWith("="))) {
|
|
88
|
+
filtered.push((iterator.endsWith("===") ? iterator.substr(0, iterator.length - 3) : iterator.endsWith("==") ? iterator.substr(0, iterator.length - 2) : iterator).trim());
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
path = filtered.filter(px11 => {
|
|
92
|
+
const search = px11 + ".";
|
|
93
|
+
for (const iterator of filtered) {
|
|
94
|
+
if (px11 !== iterator && iterator.indexOf(search) !== -1) {
|
|
95
|
+
return false;
|
|
99
96
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
for (const iterator of filtered) {
|
|
103
|
-
if (px11 !== iterator && iterator.indexOf(search) !== -1) {
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return true;
|
|
108
|
-
});
|
|
109
|
-
return m;
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
110
99
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
100
|
+
return m;
|
|
101
|
+
});
|
|
102
|
+
path = path.sort((a, b) => b.localeCompare(a));
|
|
103
|
+
const duplicates = path;
|
|
104
|
+
path = [];
|
|
105
|
+
for (const iterator of duplicates) {
|
|
106
|
+
if (path.find(px2 => px2 === iterator)) {
|
|
107
|
+
continue;
|
|
119
108
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
109
|
+
path.push(iterator);
|
|
110
|
+
}
|
|
111
|
+
const rp = [];
|
|
112
|
+
for (const rpItem of path) {
|
|
113
|
+
if (rp.find(x => x.startsWith(rpItem))) {
|
|
114
|
+
continue;
|
|
126
115
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
116
|
+
rp.push(rpItem);
|
|
117
|
+
}
|
|
118
|
+
const pl = path.filter(p1 => p1).map(p1 => p1.split("."));
|
|
119
|
+
viewModelParseWatchCache[key] = pl;
|
|
120
|
+
return pl;
|
|
130
121
|
}
|
|
131
122
|
const viewModelParseWatchCache2 = {};
|
|
132
123
|
export function parsePathLists(f) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return pl;
|
|
160
|
-
}
|
|
161
|
-
//# sourceMappingURL=ExpressionParser.js.map
|
|
124
|
+
const str = f.toString().trim();
|
|
125
|
+
const key = str;
|
|
126
|
+
const px1 = viewModelParseWatchCache2[key];
|
|
127
|
+
if (px1) {
|
|
128
|
+
return px1;
|
|
129
|
+
}
|
|
130
|
+
const pl = {
|
|
131
|
+
pathList: parsePath(str, false),
|
|
132
|
+
thisPath: parsePath(str, true),
|
|
133
|
+
combined: []
|
|
134
|
+
};
|
|
135
|
+
if (pl.thisPath.length && pl.pathList.length) {
|
|
136
|
+
pl.combined = pl.thisPath.map(x => {
|
|
137
|
+
x[0] = "t";
|
|
138
|
+
x.splice(0, 0, "this");
|
|
139
|
+
return x;
|
|
140
|
+
}).concat(pl.pathList.map(x => {
|
|
141
|
+
x.splice(0, 0, "this", "x");
|
|
142
|
+
return x;
|
|
143
|
+
}));
|
|
144
|
+
pl.thisPath = [];
|
|
145
|
+
pl.pathList = [];
|
|
146
|
+
}
|
|
147
|
+
viewModelParseWatchCache2[key] = pl;
|
|
148
|
+
return pl;
|
|
149
|
+
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export default function ExtendControl(ctrl) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
2
|
+
class ExtendedControl extends ctrl {
|
|
3
|
+
constructor(...args) {
|
|
4
|
+
super(...args);
|
|
5
|
+
this.runAfterInit(() => this.app.runAsync(() => this.init()));
|
|
7
6
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
}
|
|
8
|
+
return ExtendedControl;
|
|
9
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export default class FormattedError {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=FormattedError.js.map
|
|
2
|
+
constructor(msg) {
|
|
3
|
+
const e = new Error(msg.toString());
|
|
4
|
+
e.formattedMessage = msg;
|
|
5
|
+
e.__proto__ = FormattedError.prototype;
|
|
6
|
+
return e;
|
|
7
|
+
}
|
|
8
|
+
}
|
package/dist-esm/core/Hacks.js
CHANGED
|
@@ -1,54 +1,53 @@
|
|
|
1
1
|
import { ChildEnumerator } from "../web/core/AtomUI.js";
|
|
2
2
|
import { AtomBinder } from "./AtomBinder.js";
|
|
3
3
|
export const visitDescendents = (element, action) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
visitDescendents(iterator, action);
|
|
4
|
+
for (const iterator of ChildEnumerator.enumerate(element)) {
|
|
5
|
+
const eAny = iterator;
|
|
6
|
+
const ac = eAny ? eAny.atomControl : undefined;
|
|
7
|
+
if (!action(iterator, ac)) {
|
|
8
|
+
continue;
|
|
11
9
|
}
|
|
10
|
+
visitDescendents(iterator, action);
|
|
11
|
+
}
|
|
12
12
|
};
|
|
13
13
|
export const refreshInherited = (target, name, fieldName) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
AtomBinder.refreshValue(target, name);
|
|
15
|
+
if (!fieldName) {
|
|
16
|
+
fieldName = "m" + name[0].toUpperCase() + name.substr(1);
|
|
17
|
+
}
|
|
18
|
+
if (!target.element) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
visitDescendents(target.element, (e, ac) => {
|
|
22
|
+
if (ac) {
|
|
23
|
+
if (ac[fieldName] === undefined) {
|
|
24
|
+
refreshInherited(ac, name, fieldName);
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
17
27
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
visitDescendents(target.element, (e, ac) => {
|
|
22
|
-
if (ac) {
|
|
23
|
-
if (ac[fieldName] === undefined) {
|
|
24
|
-
refreshInherited(ac, name, fieldName);
|
|
25
|
-
}
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
return true;
|
|
29
|
-
});
|
|
28
|
+
return true;
|
|
29
|
+
});
|
|
30
30
|
};
|
|
31
31
|
export const watchProperty = (element, name, events, f) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
if (events.indexOf("change") === -1) {
|
|
33
|
+
events.push("change");
|
|
34
|
+
}
|
|
35
|
+
const l = e => {
|
|
36
|
+
const e1 = element;
|
|
37
|
+
const v = e1.type === "checkbox" ? e1.checked : e1.value;
|
|
38
|
+
f(v);
|
|
39
|
+
};
|
|
40
|
+
for (const iterator of events) {
|
|
41
|
+
element.addEventListener(iterator, l, false);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
dispose: () => {
|
|
45
|
+
for (const iterator of events) {
|
|
46
|
+
element.removeEventListener(iterator, l, false);
|
|
47
|
+
}
|
|
42
48
|
}
|
|
43
|
-
|
|
44
|
-
dispose: () => {
|
|
45
|
-
for (const iterator of events) {
|
|
46
|
-
element.removeEventListener(iterator, l, false);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
49
|
+
};
|
|
50
50
|
};
|
|
51
51
|
export const setValue = (element, name, value) => {
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=Hacks.js.map
|
|
52
|
+
element[name] = value;
|
|
53
|
+
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=IFetchEvent.js.map
|
|
1
|
+
export {};
|
package/dist-esm/core/IScreen.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=IScreen.js.map
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=IValueConverter.js.map
|
|
1
|
+
export {};
|