@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,9 +1,8 @@
1
1
  import { AtomControl } from "./AtomControl.js";
2
2
  export class AtomPage extends AtomControl {
3
- preCreate() {
4
- this.title = null;
5
- this.tag = null;
6
- this.bind(this.element, "title", [["viewModel", "title"]]);
7
- }
8
- }
9
- //# sourceMappingURL=AtomPage.js.map
3
+ preCreate() {
4
+ this.title = null;
5
+ this.tag = null;
6
+ this.bind(this.element, "title", [["viewModel", "title"]]);
7
+ }
8
+ }
@@ -1,4 +1,2 @@
1
1
  import { AtomControl } from "./AtomControl.js";
2
- export class AtomTemplate extends AtomControl {
3
- }
4
- //# sourceMappingURL=AtomTemplate.js.map
2
+ export class AtomTemplate extends AtomControl {}
@@ -1,35 +1,34 @@
1
1
  import { AtomControl } from "./AtomControl.js";
2
2
  export class AtomTemplateControl extends AtomControl {
3
- onPropertyChanged(name) {
4
- if (name === "contentTemplate") {
5
- this.createContent();
6
- }
3
+ onPropertyChanged(name) {
4
+ if (name === "contentTemplate") {
5
+ this.createContent();
7
6
  }
8
- onUpdateUI() {
9
- super.onUpdateUI();
10
- if (this.content) {
11
- return;
12
- }
13
- if (this.contentTemplate) {
14
- this.createContent();
15
- }
7
+ }
8
+ onUpdateUI() {
9
+ super.onUpdateUI();
10
+ if (this.content) {
11
+ return;
16
12
  }
17
- preCreate() {
18
- this.contentTemplate = null;
19
- this.content = null;
13
+ if (this.contentTemplate) {
14
+ this.createContent();
20
15
  }
21
- createContent() {
22
- const t = this.contentTemplate;
23
- if (!t) {
24
- return;
25
- }
26
- const tc = this.content;
27
- if (tc) {
28
- tc.dispose();
29
- this.content = null;
30
- }
31
- const ntc = this.content = new (t)(this.app);
32
- this.append(ntc);
16
+ }
17
+ preCreate() {
18
+ this.contentTemplate = null;
19
+ this.content = null;
20
+ }
21
+ createContent() {
22
+ const t = this.contentTemplate;
23
+ if (!t) {
24
+ return;
33
25
  }
34
- }
35
- //# sourceMappingURL=AtomTemplateControl.js.map
26
+ const tc = this.content;
27
+ if (tc) {
28
+ tc.dispose();
29
+ this.content = null;
30
+ }
31
+ const ntc = this.content = new t(this.app);
32
+ this.append(ntc);
33
+ }
34
+ }
@@ -1,23 +1,22 @@
1
1
  import { AtomControl } from "./AtomControl.js";
2
2
  export class AtomViewStack extends AtomControl {
3
- append(e) {
4
- const ee = e instanceof AtomControl ? e.element : e;
5
- ee._logicalParent = this.element;
6
- this.children = this.children || [];
7
- const index = this.children.length;
8
- this.children.push(e instanceof AtomControl ? e.element : e);
9
- if (this.selectedIndex === undefined) {
10
- this.selectedIndex = 0;
11
- }
12
- const style = ee.style;
13
- style.position = "absolute";
14
- style.top = style.left = style.right = style.bottom = "0";
15
- this.bind(ee, "styleVisibility", [["selectedIndex"]], false, (v) => v === index ? "visible" : "hidden");
16
- this.element.appendChild(ee);
17
- return this;
3
+ append(e) {
4
+ const ee = e instanceof AtomControl ? e.element : e;
5
+ ee._logicalParent = this.element;
6
+ this.children = this.children || [];
7
+ const index = this.children.length;
8
+ this.children.push(e instanceof AtomControl ? e.element : e);
9
+ if (this.selectedIndex === undefined) {
10
+ this.selectedIndex = 0;
18
11
  }
19
- preCreate() {
20
- this.selectedIndex = -1;
21
- }
22
- }
23
- //# sourceMappingURL=AtomViewStack.js.map
12
+ const style = ee.style;
13
+ style.position = "absolute";
14
+ style.top = style.left = style.right = style.bottom = "0";
15
+ this.bind(ee, "styleVisibility", [["selectedIndex"]], false, v => v === index ? "visible" : "hidden");
16
+ this.element.appendChild(ee);
17
+ return this;
18
+ }
19
+ preCreate() {
20
+ this.selectedIndex = -1;
21
+ }
22
+ }
@@ -1,209 +1,209 @@
1
1
  export class AncestorEnumerator {
2
- static find(e, filter) {
3
- let start = e?.parentElement;
4
- while (start) {
5
- if (filter(start)) {
6
- return start;
7
- }
8
- start = start.parentElement;
9
- }
10
- }
11
- static findSelector(e, selector) {
12
- let start = e?.parentElement;
13
- while (start) {
14
- const found = start.matches(selector);
15
- if (found) {
16
- return start;
17
- }
18
- start = start.parentElement;
19
- }
20
- }
2
+ static find(e, filter) {
3
+ let start = e?.parentElement;
4
+ while (start) {
5
+ if (filter(start)) {
6
+ return start;
7
+ }
8
+ start = start.parentElement;
9
+ }
10
+ }
11
+ static findSelector(e, selector) {
12
+ let start = e?.parentElement;
13
+ while (start) {
14
+ const found = start.matches(selector);
15
+ if (found) {
16
+ return start;
17
+ }
18
+ start = start.parentElement;
19
+ }
20
+ }
21
21
  }
22
22
  export class ChildEnumerator {
23
- static find(e, filter) {
24
- let item = e?.firstElementChild;
25
- while (item) {
26
- const next = item.nextElementSibling;
27
- if (filter(item)) {
28
- return item;
29
- }
30
- item = next;
31
- }
32
- }
33
- static *where(e, filter) {
34
- let item = e?.firstElementChild;
35
- while (item) {
36
- const next = item.nextElementSibling;
37
- if (filter(item)) {
38
- yield item;
39
- }
40
- item = next;
41
- }
42
- }
43
- static *enumerate(e) {
44
- let item = e?.firstElementChild;
45
- while (item) {
46
- const next = item.nextElementSibling;
47
- yield item;
48
- item = next;
49
- }
50
- }
51
- get current() {
52
- return this.item;
53
- }
54
- constructor(e) {
55
- this.e = e;
56
- }
57
- next() {
58
- if (!this.item) {
59
- this.item = this.e?.firstElementChild;
60
- }
61
- else {
62
- this.item = this.item.nextElementSibling;
63
- }
64
- return this.item ? true : false;
65
- }
23
+ static find(e, filter) {
24
+ let item = e?.firstElementChild;
25
+ while (item) {
26
+ const next = item.nextElementSibling;
27
+ if (filter(item)) {
28
+ return item;
29
+ }
30
+ item = next;
31
+ }
32
+ }
33
+ static *where(e, filter) {
34
+ let item = e?.firstElementChild;
35
+ while (item) {
36
+ const next = item.nextElementSibling;
37
+ if (filter(item)) {
38
+ yield item;
39
+ }
40
+ item = next;
41
+ }
42
+ }
43
+ static *enumerate(e) {
44
+ let item = e?.firstElementChild;
45
+ while (item) {
46
+ const next = item.nextElementSibling;
47
+ yield item;
48
+ item = next;
49
+ }
50
+ }
51
+ get current() {
52
+ return this.item;
53
+ }
54
+ constructor(e) {
55
+ this.e = e;
56
+ }
57
+ next() {
58
+ if (!this.item) {
59
+ this.item = this.e?.firstElementChild;
60
+ } else {
61
+ this.item = this.item.nextElementSibling;
62
+ }
63
+ return this.item ? true : false;
64
+ }
66
65
  }
67
66
  export function* descendentElementIterator(e) {
68
- const stack = [];
69
- const start = e;
70
- if (start) {
71
- stack.push(start);
72
- }
73
- while (stack.length) {
74
- const pop = stack.pop();
75
- const next = pop.nextElementSibling;
76
- yield pop;
77
- if (next) {
78
- stack.push(next);
79
- }
80
- const child = pop.firstElementChild;
81
- if (child) {
82
- stack.push(child);
83
- }
84
- }
67
+ const stack = [];
68
+ const start = e;
69
+ if (start) {
70
+ stack.push(start);
71
+ }
72
+ while (stack.length) {
73
+ const pop = stack.pop();
74
+ const next = pop.nextElementSibling;
75
+ yield pop;
76
+ if (next) {
77
+ stack.push(next);
78
+ }
79
+ const child = pop.firstElementChild;
80
+ if (child) {
81
+ stack.push(child);
82
+ }
83
+ }
85
84
  }
86
85
  export function* descendentIterator(e) {
87
- const stack = [];
88
- const start = e;
89
- if (start) {
90
- stack.push(start);
91
- }
92
- while (stack.length) {
93
- const pop = stack.pop();
94
- const next = pop.nextSibling;
95
- yield pop;
96
- if (next) {
97
- stack.push(next);
98
- }
99
- const child = pop.firstChild;
100
- if (child) {
101
- stack.push(child);
102
- }
103
- }
86
+ const stack = [];
87
+ const start = e;
88
+ if (start) {
89
+ stack.push(start);
90
+ }
91
+ while (stack.length) {
92
+ const pop = stack.pop();
93
+ const next = pop.nextSibling;
94
+ yield pop;
95
+ if (next) {
96
+ stack.push(next);
97
+ }
98
+ const child = pop.firstChild;
99
+ if (child) {
100
+ stack.push(child);
101
+ }
102
+ }
104
103
  }
105
104
  export class AtomUI {
106
- static outerHeight(el, margin = false) {
107
- let height = el.offsetHeight;
108
- if (!margin) {
109
- return height;
110
- }
111
- const style = getComputedStyle(el);
112
- height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);
113
- return height;
114
- }
115
- static outerWidth(el, margin = false) {
116
- let width = el.offsetWidth;
117
- if (!margin) {
118
- return width;
119
- }
120
- const style = getComputedStyle(el);
121
- width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
122
- return width;
123
- }
124
- static innerWidth(el) {
125
- return el.clientWidth;
126
- }
127
- static innerHeight(el) {
128
- return el.clientHeight;
129
- }
130
- static scrollTop(el, y) {
131
- el.scrollTo(0, y);
132
- }
133
- static screenOffset(e) {
134
- const r = {
135
- x: e.offsetLeft,
136
- y: e.offsetTop,
137
- width: e.offsetWidth,
138
- height: e.offsetHeight
139
- };
140
- if (e.offsetParent) {
141
- const p = this.screenOffset(e.offsetParent);
142
- r.x += p.x;
143
- r.y += p.y;
144
- }
145
- return r;
146
- }
147
- static parseUrl(url) {
148
- const r = {};
149
- const plist = url.split("&");
150
- for (const item of plist) {
151
- const p = item.split("=");
152
- const key = decodeURIComponent(p[0]);
153
- if (!key) {
154
- continue;
155
- }
156
- let val = p[1];
157
- if (val) {
158
- val = decodeURIComponent(val);
159
- }
160
- r[key] = this.parseValue(val);
161
- }
162
- return r;
163
- }
164
- static parseValue(val) {
165
- let n;
166
- if (/^[0-9]+$/.test(val)) {
167
- n = parseInt(val, 10);
168
- if (!isNaN(n)) {
169
- return n;
170
- }
171
- return val;
172
- }
173
- if (/^[0-9]+\.[0-9]+/gi.test(val)) {
174
- n = parseFloat(val);
175
- if (!isNaN(n)) {
176
- return n;
177
- }
178
- return val;
179
- }
180
- if (val === "true") {
181
- return true;
182
- }
183
- if (val === "false") {
184
- return false;
185
- }
186
- return val;
187
- }
188
- static assignID(element) {
189
- if (!element.id) {
190
- element.id = "__waID" + AtomUI.getNewIndex();
191
- }
192
- return element.id;
193
- }
194
- static toNumber(text) {
195
- if (!text) {
196
- return 0;
197
- }
198
- if (text.constructor === String) {
199
- return parseFloat(text);
200
- }
201
- return 0;
202
- }
203
- static getNewIndex() {
204
- AtomUI.index = AtomUI.index + 1;
205
- return AtomUI.index;
206
- }
207
- static { this.index = 1001; }
208
- }
209
- //# sourceMappingURL=AtomUI.js.map
105
+ static outerHeight(el, margin = false) {
106
+ let height = el.offsetHeight;
107
+ if (!margin) {
108
+ return height;
109
+ }
110
+ const style = getComputedStyle(el);
111
+ height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);
112
+ return height;
113
+ }
114
+ static outerWidth(el, margin = false) {
115
+ let width = el.offsetWidth;
116
+ if (!margin) {
117
+ return width;
118
+ }
119
+ const style = getComputedStyle(el);
120
+ width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
121
+ return width;
122
+ }
123
+ static innerWidth(el) {
124
+ return el.clientWidth;
125
+ }
126
+ static innerHeight(el) {
127
+ return el.clientHeight;
128
+ }
129
+ static scrollTop(el, y) {
130
+ el.scrollTo(0, y);
131
+ }
132
+ static screenOffset(e) {
133
+ const r = {
134
+ x: e.offsetLeft,
135
+ y: e.offsetTop,
136
+ width: e.offsetWidth,
137
+ height: e.offsetHeight
138
+ };
139
+ if (e.offsetParent) {
140
+ const p = this.screenOffset(e.offsetParent);
141
+ r.x += p.x;
142
+ r.y += p.y;
143
+ }
144
+ return r;
145
+ }
146
+ static parseUrl(url) {
147
+ const r = {};
148
+ const plist = url.split("&");
149
+ for (const item of plist) {
150
+ const p = item.split("=");
151
+ const key = decodeURIComponent(p[0]);
152
+ if (!key) {
153
+ continue;
154
+ }
155
+ let val = p[1];
156
+ if (val) {
157
+ val = decodeURIComponent(val);
158
+ }
159
+ r[key] = this.parseValue(val);
160
+ }
161
+ return r;
162
+ }
163
+ static parseValue(val) {
164
+ let n;
165
+ if (/^[0-9]+$/.test(val)) {
166
+ n = parseInt(val, 10);
167
+ if (!isNaN(n)) {
168
+ return n;
169
+ }
170
+ return val;
171
+ }
172
+ if (/^[0-9]+\.[0-9]+/gi.test(val)) {
173
+ n = parseFloat(val);
174
+ if (!isNaN(n)) {
175
+ return n;
176
+ }
177
+ return val;
178
+ }
179
+ if (val === "true") {
180
+ return true;
181
+ }
182
+ if (val === "false") {
183
+ return false;
184
+ }
185
+ return val;
186
+ }
187
+ static assignID(element) {
188
+ if (!element.id) {
189
+ element.id = "__waID" + AtomUI.getNewIndex();
190
+ }
191
+ return element.id;
192
+ }
193
+ static toNumber(text) {
194
+ if (!text) {
195
+ return 0;
196
+ }
197
+ if (text.constructor === String) {
198
+ return parseFloat(text);
199
+ }
200
+ return 0;
201
+ }
202
+ static getNewIndex() {
203
+ AtomUI.index = AtomUI.index + 1;
204
+ return AtomUI.index;
205
+ }
206
+ static {
207
+ this.index = 1001;
208
+ }
209
+ }