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