@web-atoms/core 2.6.24 → 2.6.26

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