@web-atoms/core 2.2.49 → 2.2.51
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/core/Command.js +1 -1
- package/dist/core/Command.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/services/PopupService.d.ts +4 -20
- package/dist/web/services/PopupService.d.ts.map +1 -1
- package/dist/web/services/PopupService.js +6 -224
- package/dist/web/services/PopupService.js.map +1 -1
- package/dist/web/services/PopupWindow.d.ts +45 -0
- package/dist/web/services/PopupWindow.d.ts.map +1 -0
- package/dist/web/services/PopupWindow.js +378 -0
- package/dist/web/services/PopupWindow.js.map +1 -0
- package/package.json +1 -1
- package/src/core/Command.ts +1 -1
- package/src/web/services/PopupService.tsx +350 -346
- package/src/web/services/PopupWindow.tsx +456 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
System.register(["tslib", "../../core/Bind", "../../core/BindableProperty", "../../core/XNode", "../../core/sleep", "../../style/styled", "../controls/AtomControl", "../core/AtomUI"], function (_export, _context) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var __awaiter, __decorate, __metadata, Bind, BindableProperty, XNode, sleep, styled, AtomControl, ChildEnumerator, PopupWindow, ConfirmPopup, popupService, loadPopupService;
|
|
5
|
+
_export({
|
|
6
|
+
default: void 0,
|
|
7
|
+
ConfirmPopup: void 0
|
|
8
|
+
});
|
|
9
|
+
return {
|
|
10
|
+
setters: [function (_tslib) {
|
|
11
|
+
__awaiter = _tslib.__awaiter;
|
|
12
|
+
__decorate = _tslib.__decorate;
|
|
13
|
+
__metadata = _tslib.__metadata;
|
|
14
|
+
}, function (_coreBind) {
|
|
15
|
+
Bind = _coreBind.default;
|
|
16
|
+
}, function (_coreBindableProperty) {
|
|
17
|
+
BindableProperty = _coreBindableProperty.BindableProperty;
|
|
18
|
+
}, function (_coreXNode) {
|
|
19
|
+
XNode = _coreXNode.default;
|
|
20
|
+
}, function (_coreSleep) {
|
|
21
|
+
sleep = _coreSleep.default;
|
|
22
|
+
}, function (_styleStyled) {
|
|
23
|
+
styled = _styleStyled.default;
|
|
24
|
+
}, function (_controlsAtomControl) {
|
|
25
|
+
AtomControl = _controlsAtomControl.AtomControl;
|
|
26
|
+
}, function (_coreAtomUI) {
|
|
27
|
+
ChildEnumerator = _coreAtomUI.ChildEnumerator;
|
|
28
|
+
}],
|
|
29
|
+
execute: function () {
|
|
30
|
+
loadPopupService = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
if (popupService) {
|
|
32
|
+
return popupService;
|
|
33
|
+
}
|
|
34
|
+
return popupService = (yield _context.import("./PopupService")).default;
|
|
35
|
+
});
|
|
36
|
+
styled.css`
|
|
37
|
+
position: absolute;
|
|
38
|
+
border: solid 1px lightgray;
|
|
39
|
+
border-radius: 5px;
|
|
40
|
+
background-color: white;
|
|
41
|
+
top: 50%;
|
|
42
|
+
left: 50%;
|
|
43
|
+
transform: translate(-50%, -50%);
|
|
44
|
+
box-shadow: 0 0 20px 1px rgba(0 0 0 / 75%);
|
|
45
|
+
|
|
46
|
+
display: grid;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-items: center;
|
|
49
|
+
grid-template-rows: auto auto 1fr auto;
|
|
50
|
+
grid-template-columns: auto 1fr auto;
|
|
51
|
+
opacity: 0;
|
|
52
|
+
transition: opacity 0.3s cubic-bezier(0.55, 0.09, 0.97, 0.32) ;
|
|
53
|
+
|
|
54
|
+
&[data-ready=true] {
|
|
55
|
+
opacity: 1;
|
|
56
|
+
}
|
|
57
|
+
&[data-dragging=true] {
|
|
58
|
+
opacity: 0.5;
|
|
59
|
+
}
|
|
60
|
+
& > [data-window-element=icon] {
|
|
61
|
+
grid-row: 1;
|
|
62
|
+
grid-column: 1;
|
|
63
|
+
}
|
|
64
|
+
& > [data-window-element=title] {
|
|
65
|
+
grid-row: 1;
|
|
66
|
+
grid-column: 2;
|
|
67
|
+
font-size: medium;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
text-overflow: ellipsis;
|
|
71
|
+
cursor: move;
|
|
72
|
+
padding: var(--spacing, 5px);
|
|
73
|
+
}
|
|
74
|
+
& > [data-window-element=close-button] {
|
|
75
|
+
grid-row: 1;
|
|
76
|
+
grid-column: 3;
|
|
77
|
+
}
|
|
78
|
+
& > [data-window-element=action-bar] {
|
|
79
|
+
grid-row: 1;
|
|
80
|
+
grid-column: 1 / span 3;
|
|
81
|
+
align-self: stretch;
|
|
82
|
+
justify-self: stretch;
|
|
83
|
+
background-color: var(--accent-color, rgba(211, 211, 211, 0.2))
|
|
84
|
+
}
|
|
85
|
+
& > [data-window-element=header] {
|
|
86
|
+
margin-top: 5px;
|
|
87
|
+
grid-row: 2;
|
|
88
|
+
grid-column: 1 / span 3;
|
|
89
|
+
}
|
|
90
|
+
& > [data-window-element=content] {
|
|
91
|
+
margin-top: 5px;
|
|
92
|
+
grid-row: 3;
|
|
93
|
+
grid-column: 1 / span 3;
|
|
94
|
+
position: relative;
|
|
95
|
+
}
|
|
96
|
+
& > [data-window-element=footer] {
|
|
97
|
+
margin-top: 5px;
|
|
98
|
+
grid-row: 3;
|
|
99
|
+
grid-column: 1 / span 3;
|
|
100
|
+
margin-bottom: 5px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
`.installGlobal("[data-popup-window=popup=window]");
|
|
104
|
+
_export("default", PopupWindow = class PopupWindow extends AtomControl {
|
|
105
|
+
static showWindow(window, options) {
|
|
106
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
107
|
+
if (arguments.length <= 1) {
|
|
108
|
+
options = arguments[0];
|
|
109
|
+
window = this;
|
|
110
|
+
}
|
|
111
|
+
yield sleep(1);
|
|
112
|
+
const PS = yield loadPopupService();
|
|
113
|
+
return PS.showWindow(PS.lastTarget, window, options);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
static showModal(window, options) {
|
|
117
|
+
var _a;
|
|
118
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
119
|
+
if (arguments.length <= 1) {
|
|
120
|
+
options = arguments[0];
|
|
121
|
+
window = this;
|
|
122
|
+
}
|
|
123
|
+
options !== null && options !== void 0 ? options : options = {};
|
|
124
|
+
(_a = options.modal) !== null && _a !== void 0 ? _a : options.modal = true;
|
|
125
|
+
yield sleep(1);
|
|
126
|
+
const PS = yield loadPopupService();
|
|
127
|
+
return PS.showWindow(PS.lastTarget, window, options);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
onPropertyChanged(name) {
|
|
131
|
+
super.onPropertyChanged(name);
|
|
132
|
+
switch (name) {
|
|
133
|
+
case "iconRenderer":
|
|
134
|
+
this.recreate(name, "icon");
|
|
135
|
+
break;
|
|
136
|
+
case "actionBarRenderer":
|
|
137
|
+
this.recreate(name, "action-bar");
|
|
138
|
+
break;
|
|
139
|
+
case "footerRenderer":
|
|
140
|
+
this.recreate(name, "footer");
|
|
141
|
+
break;
|
|
142
|
+
case "titleRenderer":
|
|
143
|
+
this.recreate(name, "title");
|
|
144
|
+
break;
|
|
145
|
+
case "headerRenderer":
|
|
146
|
+
this.recreate(name, "header");
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
init() {}
|
|
151
|
+
requestCancel() {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
if (this.closeWarning) {
|
|
154
|
+
if (!(yield ConfirmPopup.confirm({
|
|
155
|
+
message: this.closeWarning
|
|
156
|
+
}))) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
this.cancel();
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
recreate(renderer, name) {
|
|
164
|
+
var _a, _b, _c;
|
|
165
|
+
const node = (_b = (_a = this[renderer]) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : undefined;
|
|
166
|
+
for (const e of ChildEnumerator.enumerate(this.element)) {
|
|
167
|
+
if (e.dataset.pageElement === name) {
|
|
168
|
+
this.dispose(e);
|
|
169
|
+
e.remove();
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (node) {
|
|
174
|
+
const na = (_c = node.attributes) !== null && _c !== void 0 ? _c : node.attributes = {};
|
|
175
|
+
na["data-window-element"] = name;
|
|
176
|
+
super.render(XNode.create("div", null, node));
|
|
177
|
+
return this.element.querySelector(`[data-window-element="${name}"]`);
|
|
178
|
+
}
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
preCreate() {
|
|
182
|
+
this.title = null;
|
|
183
|
+
this.viewModelTitle = null;
|
|
184
|
+
const handler = e => {
|
|
185
|
+
if (e.key === "Escape") {
|
|
186
|
+
this.app.runAsync(() => this.requestCancel());
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
this.bindEvent(this.element, "keydown", handler);
|
|
192
|
+
this.element.dataset.popupWindow = "popup-window";
|
|
193
|
+
this.runAfterInit(() => this.app.runAsync(() => this.init()));
|
|
194
|
+
setTimeout(p => {
|
|
195
|
+
p.dataset.ready = "true";
|
|
196
|
+
}, 10, this.element);
|
|
197
|
+
}
|
|
198
|
+
render(node, e, creator) {
|
|
199
|
+
var _a, _b, _c, _d, _e;
|
|
200
|
+
this.render = super.render;
|
|
201
|
+
const titleContent = (_b = (_a = this.titleRenderer) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : XNode.create("span", {
|
|
202
|
+
class: "title-text",
|
|
203
|
+
text: Bind.oneWay(() => this.title || this.viewModelTitle)
|
|
204
|
+
});
|
|
205
|
+
const closeButton = (_d = (_c = this.closeButtonRenderer) === null || _c === void 0 ? void 0 : _c.call(this)) !== null && _d !== void 0 ? _d : XNode.create("button", {
|
|
206
|
+
class: "popup-close-button",
|
|
207
|
+
text: "x",
|
|
208
|
+
eventClick: Bind.event(() => this.requestCancel())
|
|
209
|
+
});
|
|
210
|
+
const a = (_e = node.attributes) !== null && _e !== void 0 ? _e : node.attributes = {};
|
|
211
|
+
a["data-window-content"] = "window-content";
|
|
212
|
+
a["data-window-element"] = "content";
|
|
213
|
+
titleContent["data-window-element"] = "title";
|
|
214
|
+
closeButton["data-window-element"] = "close";
|
|
215
|
+
const extracted = this.extractControlProperties(node);
|
|
216
|
+
super.render(XNode.create("div", Object.assign({
|
|
217
|
+
viewModelTitle: Bind.oneWay(() => this.viewModel.title)
|
|
218
|
+
}, extracted), XNode.create("div", {
|
|
219
|
+
"data-window-element": "action-bar"
|
|
220
|
+
}), titleContent, closeButton, node));
|
|
221
|
+
this.runAfterInit(() => {
|
|
222
|
+
if (!this.element) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const host = this.element.getElementsByClassName("title-host")[0];
|
|
226
|
+
this.setupDragging(host);
|
|
227
|
+
const anyAutofocus = this.element.querySelector(`*[autofocus]`);
|
|
228
|
+
if (!anyAutofocus) {
|
|
229
|
+
const windowContent = this.element.querySelector("[data-window-content]");
|
|
230
|
+
if (windowContent) {
|
|
231
|
+
const firstInput = windowContent.querySelector("input,button,a");
|
|
232
|
+
if (firstInput) {
|
|
233
|
+
firstInput.focus();
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const cb = this.element.querySelector(".popup-close-button");
|
|
238
|
+
if (cb) {
|
|
239
|
+
cb.focus();
|
|
240
|
+
}
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
setupDragging(tp) {
|
|
246
|
+
this.bindEvent(tp, "mousedown", startEvent => {
|
|
247
|
+
if (startEvent.target.tagName === "BUTTON") {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
startEvent.preventDefault();
|
|
251
|
+
const disposables = [];
|
|
252
|
+
const element = this.element;
|
|
253
|
+
const offset = {
|
|
254
|
+
x: element.offsetLeft,
|
|
255
|
+
y: element.offsetTop
|
|
256
|
+
};
|
|
257
|
+
if (element.style.transform !== "none") {
|
|
258
|
+
offset.x -= element.offsetWidth / 2;
|
|
259
|
+
offset.y -= element.offsetHeight / 2;
|
|
260
|
+
element.style.left = offset.x + "px";
|
|
261
|
+
element.style.top = offset.y + "px";
|
|
262
|
+
element.style.transform = "none";
|
|
263
|
+
}
|
|
264
|
+
this.element.dataset.dragging = "true";
|
|
265
|
+
const rect = {
|
|
266
|
+
x: startEvent.clientX,
|
|
267
|
+
y: startEvent.clientY
|
|
268
|
+
};
|
|
269
|
+
const cursor = tp.style.cursor;
|
|
270
|
+
tp.style.cursor = "move";
|
|
271
|
+
disposables.push(this.bindEvent(document.body, "mousemove", moveEvent => {
|
|
272
|
+
const {
|
|
273
|
+
clientX,
|
|
274
|
+
clientY
|
|
275
|
+
} = moveEvent;
|
|
276
|
+
const dx = clientX - rect.x;
|
|
277
|
+
const dy = clientY - rect.y;
|
|
278
|
+
const finalX = offset.x + dx;
|
|
279
|
+
const finalY = offset.y + dy;
|
|
280
|
+
if (finalX < 5 || finalY < 5) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
offset.x = finalX;
|
|
284
|
+
offset.y = finalY;
|
|
285
|
+
this.element.style.left = offset.x + "px";
|
|
286
|
+
this.element.style.top = offset.y + "px";
|
|
287
|
+
rect.x = clientX;
|
|
288
|
+
rect.y = clientY;
|
|
289
|
+
}));
|
|
290
|
+
disposables.push(this.bindEvent(document.body, "mouseup", endEvent => {
|
|
291
|
+
tp.style.cursor = cursor;
|
|
292
|
+
this.element.removeAttribute("data-dragging");
|
|
293
|
+
for (const iterator of disposables) {
|
|
294
|
+
iterator.dispose();
|
|
295
|
+
}
|
|
296
|
+
}));
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
__decorate([BindableProperty, __metadata("design:type", String)], PopupWindow.prototype, "title", void 0);
|
|
301
|
+
__decorate([BindableProperty, __metadata("design:type", String)], PopupWindow.prototype, "closeWarning", void 0);
|
|
302
|
+
delete PopupWindow.prototype.init;
|
|
303
|
+
styled.css`
|
|
304
|
+
& > .buttons[data-window-element=footer] > button{
|
|
305
|
+
border-radius: 9999px;
|
|
306
|
+
padding-left: 10px;
|
|
307
|
+
padding-right: 10px;
|
|
308
|
+
border-width: 1px;
|
|
309
|
+
border-color: transparent;
|
|
310
|
+
margin: 5px;
|
|
311
|
+
margin-right: 5px;
|
|
312
|
+
}
|
|
313
|
+
& > .buttons > .yes {
|
|
314
|
+
background-color: lightgreen;
|
|
315
|
+
color: white;
|
|
316
|
+
}
|
|
317
|
+
& > .buttons > .no {
|
|
318
|
+
background-color: red;
|
|
319
|
+
color: white;
|
|
320
|
+
}
|
|
321
|
+
& > .buttons > .cancel {
|
|
322
|
+
background-color: gray;
|
|
323
|
+
color: white;
|
|
324
|
+
}
|
|
325
|
+
`.installGlobal("[data-confirm-popup=confirm-popup]");
|
|
326
|
+
_export("ConfirmPopup", ConfirmPopup = class ConfirmPopup extends PopupWindow {
|
|
327
|
+
static confirm({
|
|
328
|
+
message,
|
|
329
|
+
title = "Confirm",
|
|
330
|
+
yesLabel = "Yes",
|
|
331
|
+
noLabel = "No",
|
|
332
|
+
cancelLabel = null
|
|
333
|
+
}) {
|
|
334
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
335
|
+
const PS = yield loadPopupService();
|
|
336
|
+
return PS.confirm({
|
|
337
|
+
title,
|
|
338
|
+
message,
|
|
339
|
+
yesLabel,
|
|
340
|
+
noLabel,
|
|
341
|
+
cancelLabel
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
preCreate() {
|
|
346
|
+
super.preCreate();
|
|
347
|
+
this.yesLabel = "Yes";
|
|
348
|
+
this.noLabel = "No";
|
|
349
|
+
this.cancelLabel = null;
|
|
350
|
+
this.element.dataset.confirmPopup = "confirm-popup";
|
|
351
|
+
this.footerRenderer = () => XNode.create("div", null, XNode.create("button", {
|
|
352
|
+
class: "yes",
|
|
353
|
+
autofocus: true,
|
|
354
|
+
text: Bind.oneWay(() => this.yesLabel),
|
|
355
|
+
eventClick: () => this.close(true),
|
|
356
|
+
"style-display": Bind.oneWay(() => !!this.yesLabel)
|
|
357
|
+
}), XNode.create("button", {
|
|
358
|
+
class: "no",
|
|
359
|
+
text: Bind.oneWay(() => this.noLabel),
|
|
360
|
+
eventClick: () => this.close(false),
|
|
361
|
+
"style-display": Bind.oneWay(() => !!this.noLabel)
|
|
362
|
+
}), XNode.create("button", {
|
|
363
|
+
class: "cancel",
|
|
364
|
+
text: Bind.oneWay(() => this.cancelLabel),
|
|
365
|
+
eventClick: () => this.requestCancel(),
|
|
366
|
+
"style-display": Bind.oneWay(() => !!this.cancelLabel)
|
|
367
|
+
}));
|
|
368
|
+
this.closeButtonRenderer = () => XNode.create("div", null);
|
|
369
|
+
}
|
|
370
|
+
requestCancel() {
|
|
371
|
+
this.cancel();
|
|
372
|
+
return Promise.resolve();
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
});
|
|
378
|
+
//# sourceMappingURL=PopupWindow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PopupWindow","ConfirmPopup","popupService","loadPopupService","_export","default","setters","_tslib","Bind","_coreBind","_coreBindableProperty","BindableProperty","_coreXNode","XNode","_coreSleep","sleep","_styleStyled","styled","_controlsAtomControl","AtomControl","_coreAtomUI","ChildEnumerator","execute","__awaiter","_context","import","css","installGlobal","showWindow","window","options","arguments","length","PS","lastTarget","showModal","_a","modal","onPropertyChanged","name","recreate","init","requestCancel","closeWarning","confirm","message","cancel","renderer","node","_b","call","undefined","e","enumerate","element","dataset","pageElement","dispose","remove","na","_c","attributes","render","create","querySelector","preCreate","title","viewModelTitle","handler","key","app","runAsync","preventDefault","bindEvent","popupWindow","runAfterInit","setTimeout","p","ready","creator","titleContent","titleRenderer","class","text","oneWay","closeButton","_d","closeButtonRenderer","eventClick","event","a","_e","extracted","extractControlProperties","Object","assign","viewModel","host","getElementsByClassName","setupDragging","anyAutofocus","windowContent","firstInput","focus","cb","tp","startEvent","target","tagName","disposables","offset","x","offsetLeft","y","offsetTop","style","transform","offsetWidth","offsetHeight","left","top","dragging","rect","clientX","clientY","cursor","push","document","body","moveEvent","dx","dy","finalX","finalY","endEvent","removeAttribute","iterator","__decorate","prototype","yesLabel","noLabel","cancelLabel","confirmPopup","footerRenderer","autofocus","close","Promise","resolve"],"sources":["../../../src/web/services/PopupWindow.tsx"],"sourcesContent":[null],"mappings":";;;qHAyFqBA,WAAY,EAgRpBC,YAAa,EAAAC,YAAA,EAAAC,gBAAA;EAAAC,OAAA;IAAAC,OAAA;IAAAJ,YAAA;EAAA;EAAA;IAAAK,OAAA,aAAAC,MAAA;;;;;MAzWnBC,IAAI,GAAAC,SAAA,CAAAJ,OAAA;IAAA,aAAAK,qBAAA;MACFC,gBAAgB,GAAAD,qBAAA,CAAhBC,gBAAgB;IAAA,aAAAC,UAAA;MAClBC,KAAK,GAAAD,UAAA,CAAAP,OAAA;IAAA,aAAAS,UAAA;MACLC,KAAK,GAAAD,UAAA,CAAAT,OAAA;IAAA,aAAAW,YAAA;MAELC,MAAM,GAAAD,YAAA,CAAAX,OAAA;IAAA,aAAAa,oBAAA;MACJC,WAAW,GAAAD,oBAAA,CAAXC,WAAW;IAAA,aAAAC,WAAA;MACXC,eAAe,GAAAD,WAAA,CAAfC,eAAe;IAAA;IAAAC,OAAA,WAAAA,CAAA;MAMlBnB,gBAAgB,GAAGA,CAAA,KAAWoB,SAAA;QAChC,IAAIrB,YAAY,EAAE;UACd,OAAOA,YAAY;;QAEvB,OAAOA,YAAY,GAAG,CAAC,MAAAsB,QAAA,CAAAC,MAAA,CAAc,gBAAgB,CAAE,EAAEpB,OAAO;MACpE,CAAC;MAEGY,MAAM,CAACS,GAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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<T = any, TR = any> {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
public async dispatchAsync(detail?: T, cancelable?: boolean) {
|
|
75
|
-
const ce = new CustomEvent(this.eventScope.
|
|
75
|
+
const ce = new CustomEvent(this.eventScope.eventType, { detail, cancelable}) as any as CustomEventEx<T, TR>;
|
|
76
76
|
ce.returnResult = true;
|
|
77
77
|
window.dispatchEvent(ce);
|
|
78
78
|
if(ce.executed) {
|