@web-atoms/core 2.2.50 → 2.2.52

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.
@@ -13,6 +13,10 @@ import { AtomWindowViewModel } from "../../view-model/AtomWindowViewModel";
13
13
  import { AtomControl } from "../controls/AtomControl";
14
14
  import CSS from "../styles/CSS";
15
15
 
16
+ import PopupWindowA, { ConfirmPopup } from "./PopupWindow";
17
+
18
+ export const PopupWindow = PopupWindowA;
19
+
16
20
  // let lastTarget = null;
17
21
  document.body.addEventListener("click", (e) => {
18
22
  if ((e.target as HTMLElement).offsetParent) {
@@ -149,91 +153,91 @@ export interface IDialogOptions {
149
153
  maximize?: boolean;
150
154
  }
151
155
 
152
- CSS(StyleRule()
153
- .position("absolute")
154
- .border("solid 1px lightgray")
155
- .borderRadius(5)
156
- .backgroundColor(Colors.white)
157
- .top("50%")
158
- .left("50%")
159
- .transform("translate(-50%,-50%)" as any)
160
- .boxShadow("0 0 20px 1px rgb(0 0 0 / 75%)")
161
- .display("grid")
162
- .alignItems("center")
163
- .justifyItems("center")
164
- .gridTemplateRows("auto 1fr")
165
- .gridTemplateColumns("1fr")
166
- .opacity("0")
167
- .transition("opacity 0.3s cubic-bezier(0.55, 0.09, 0.97, 0.32)")
168
- .and(StyleRule("[data-ready=true]")
169
- .opacity("1")
170
- )
171
- .and(StyleRule("[data-dragging=true]")
172
- .opacity("0.5")
173
- )
174
- .child(StyleRule(".title")
175
- .justifySelf("stretch")
176
- .display("flex")
177
- .minWidth(0)
178
- .backgroundColor(Colors.lightGray.withAlphaPercent(0.2))
179
- .padding(5)
180
- .alignItems("center")
181
- .justifyItems("center")
182
- .child(
183
- StyleRule(".title-text")
184
- .cursor("move")
185
- .flexStretch()
186
- .textEllipsis()
187
- )
188
- .child(StyleRule("*")
189
- .flex("1 1 100%")
190
- )
191
- .child(StyleRule(".popup-close-button")
192
- .fontFamily("arial")
193
- .fontSize(15)
194
- .flex("1 0 auto")
195
- .cursor("pointer")
196
- .width(30)
197
- .height(30)
198
- .backgroundColor(Colors.red.withAlphaPercent(0.1))
199
- .border("none")
200
- .borderRadius(9999)
201
- .textTransform("capitalize")
202
- .hoverBackgroundColor(Colors.red)
203
- )
204
- )
205
- .child(StyleRule("*[data-window-content=window-content]")
206
- .margin(5)
207
- .alignSelf("stretch")
208
- .justifySelf("stretch")
209
- .flexStretch()
210
- .overflow("auto")
211
- // This is done to avoid absolute position
212
- // to run out of content area
213
- .position("relative")
214
- // .display("flex")
215
- // .child(StyleRule("*")
216
- // .flex("1 1 100%")
217
- // )
218
- // .and(StyleRule("[data-window-content-fill] > *")
219
- // .maximizeAbsolute()
220
- // )
221
- )
222
- .child(StyleRule(" * > .command-bar")
223
- .backgroundColor(Colors.lightGray.withAlphaPercent(0.6))
224
- .display("flex")
225
- .margin(0)
226
- .padding(5)
227
- .gap(5)
228
- .nested(StyleRule("button")
229
- .borderWidth(1)
230
- .borderRadius(9999)
231
- .padding(5)
232
- .paddingLeft(10)
233
- .paddingRight(10)
234
- )
235
- )
236
- , "*[data-popup-window=popup-window]");
156
+ // CSS(StyleRule()
157
+ // .position("absolute")
158
+ // .border("solid 1px lightgray")
159
+ // .borderRadius(5)
160
+ // .backgroundColor(Colors.white)
161
+ // .top("50%")
162
+ // .left("50%")
163
+ // .transform("translate(-50%,-50%)" as any)
164
+ // .boxShadow("0 0 20px 1px rgb(0 0 0 / 75%)")
165
+ // .display("grid")
166
+ // .alignItems("center")
167
+ // .justifyItems("center")
168
+ // .gridTemplateRows("auto 1fr")
169
+ // .gridTemplateColumns("1fr")
170
+ // .opacity("0")
171
+ // .transition("opacity 0.3s cubic-bezier(0.55, 0.09, 0.97, 0.32)")
172
+ // .and(StyleRule("[data-ready=true]")
173
+ // .opacity("1")
174
+ // )
175
+ // .and(StyleRule("[data-dragging=true]")
176
+ // .opacity("0.5")
177
+ // )
178
+ // .child(StyleRule(".title")
179
+ // .justifySelf("stretch")
180
+ // .display("flex")
181
+ // .minWidth(0)
182
+ // .backgroundColor(Colors.lightGray.withAlphaPercent(0.2))
183
+ // .padding(5)
184
+ // .alignItems("center")
185
+ // .justifyItems("center")
186
+ // .child(
187
+ // StyleRule(".title-text")
188
+ // .cursor("move")
189
+ // .flexStretch()
190
+ // .textEllipsis()
191
+ // )
192
+ // .child(StyleRule("*")
193
+ // .flex("1 1 100%")
194
+ // )
195
+ // .child(StyleRule(".popup-close-button")
196
+ // .fontFamily("arial")
197
+ // .fontSize(15)
198
+ // .flex("1 0 auto")
199
+ // .cursor("pointer")
200
+ // .width(30)
201
+ // .height(30)
202
+ // .backgroundColor(Colors.red.withAlphaPercent(0.1))
203
+ // .border("none")
204
+ // .borderRadius(9999)
205
+ // .textTransform("capitalize")
206
+ // .hoverBackgroundColor(Colors.red)
207
+ // )
208
+ // )
209
+ // .child(StyleRule("*[data-window-content=window-content]")
210
+ // .margin(5)
211
+ // .alignSelf("stretch")
212
+ // .justifySelf("stretch")
213
+ // .flexStretch()
214
+ // .overflow("auto")
215
+ // // This is done to avoid absolute position
216
+ // // to run out of content area
217
+ // .position("relative")
218
+ // // .display("flex")
219
+ // // .child(StyleRule("*")
220
+ // // .flex("1 1 100%")
221
+ // // )
222
+ // // .and(StyleRule("[data-window-content-fill] > *")
223
+ // // .maximizeAbsolute()
224
+ // // )
225
+ // )
226
+ // .child(StyleRule(" * > .command-bar")
227
+ // .backgroundColor(Colors.lightGray.withAlphaPercent(0.6))
228
+ // .display("flex")
229
+ // .margin(0)
230
+ // .padding(5)
231
+ // .gap(5)
232
+ // .nested(StyleRule("button")
233
+ // .borderWidth(1)
234
+ // .borderRadius(9999)
235
+ // .padding(5)
236
+ // .paddingLeft(10)
237
+ // .paddingRight(10)
238
+ // )
239
+ // )
240
+ // , "*[data-popup-window=popup-window]");
237
241
 
238
242
  export class PopupControl extends AtomControl {
239
243
 
@@ -300,198 +304,198 @@ export class PopupControl extends AtomControl {
300
304
 
301
305
  }
302
306
 
303
- export class PopupWindow extends AtomControl {
304
-
305
- public static async showWindow<T>(options?: IDialogOptions): Promise<T>;
306
- public static async showWindow<T>(window: IClassOf<PopupWindow>, options?: IDialogOptions): Promise<T>;
307
- public static async showWindow<T>(
308
- window: IClassOf<PopupWindow> | IDialogOptions,
309
- options?: IDialogOptions): Promise<T> {
310
- if (arguments.length <= 1) {
311
- options = arguments[0];
312
- window = this;
313
- }
314
- // this will force lastTarget to be set
315
- await sleep(1);
316
- return PopupService.showWindow<T>(PopupService.lastTarget, window as any, options);
317
- }
318
-
319
- public static async showModal<T>(options?: IDialogOptions): Promise<T>;
320
- public static async showModal<T>(window: IClassOf<PopupWindow>, options?: IDialogOptions): Promise<T>;
321
- public static async showModal<T>(
322
- window: IClassOf<PopupWindow> | IDialogOptions,
323
- options?: IDialogOptions): Promise<T> {
324
- if (arguments.length <= 1) {
325
- options = arguments[0];
326
- window = this;
327
- }
328
- options ??= {};
329
- options.modal ??= true;
330
- // this will force lastTarget to be set
331
- await sleep(1);
332
- return PopupService.showWindow<T>(PopupService.lastTarget, window as any, options);
333
- }
334
-
335
- @BindableProperty
336
- public title?: string;
337
-
338
- public viewModelTitle?: string;
339
-
340
- public close: (r?) => void;
341
-
342
- public cancel: (r?) => void;
343
-
344
- public titleRenderer: () => XNode;
345
-
346
- public closeButtonRenderer: () => XNode;
347
-
348
- @BindableProperty
349
- public closeWarning: string;
350
-
351
- protected init() {
352
- // do nothing...
353
- }
354
-
355
- protected async requestCancel() {
356
- if (this.closeWarning) {
357
- if (!await ConfirmPopup.confirm({
358
- message : this.closeWarning
359
- })) {
360
- return;
361
- }
362
- }
363
- this.cancel();
364
- }
365
-
366
- protected preCreate(): void {
367
- this.title = null;
368
- this.viewModelTitle = null;
369
- const handler = (e: KeyboardEvent) => {
370
- if (e.key === "Escape") {
371
- this.app.runAsync(() => this.requestCancel());
372
- e.preventDefault();
373
- return;
374
- }
375
- };
376
- this.bindEvent(this.element, "keydown", handler);
377
- // document.body.addEventListener("keydown", handler);
378
- // this.registerDisposable({
379
- // dispose() {
380
- // document.body.removeEventListener("keydown", handler);
381
- // }
382
- // });
383
- this.element.dataset.popupWindow = "popup-window";
384
-
385
- setTimeout((p) => {
386
- p.dataset.ready = "true";
387
- }, 10, this.element);
388
- }
389
-
390
- protected render(node: XNode, e?: any, creator?: any): void {
391
- this.render = super.render;
392
- const titleContent = this.titleRenderer?.() ?? <span
393
- class="title-text" text={Bind.oneWay(() => this.title || this.viewModelTitle)}/>;
394
- const closeButton = this.closeButtonRenderer?.() ?? <button
395
- class="popup-close-button"
396
- text="x"
397
- eventClick={Bind.event(() => this.requestCancel())}/>;
398
- const a = node.attributes ??= {};
399
- a["data-window-content"] = "window-content";
400
- const extracted = this.extractControlProperties(node);
401
- super.render(<div
402
- viewModelTitle={Bind.oneWay(() => this.viewModel.title)}
403
- { ... extracted }>
404
- <div class="title title-host">
405
- { titleContent }
406
- { closeButton }
407
- </div>
408
- { node }
409
- </div>);
410
-
411
- this.runAfterInit(() => {
412
- if (!this.element) {
413
- return;
414
- }
415
- const host = this.element.getElementsByClassName("title-host")[0];
416
- this.setupDragging(host as HTMLElement);
417
- // this.element may become null if it was immediately
418
- // closed, very rare case, but possible if
419
- // supplied cancelToken was cancelled
420
- const anyAutofocus = this.element.querySelector(`*[autofocus]`);
421
- if (!anyAutofocus) {
422
- const windowContent = this.element.querySelector("[data-window-content]");
423
- if (windowContent) {
424
- const firstInput = windowContent.querySelector("input,button,a") as HTMLInputElement;
425
- if (firstInput) {
426
- firstInput.focus();
427
- return;
428
- }
429
- }
430
-
431
- const cb = this.element.querySelector(".popup-close-button") as HTMLButtonElement;
432
- if (cb) {
433
- cb.focus();
434
- }
435
- return;
436
- }
437
- });
438
- }
439
-
440
- protected setupDragging(tp: HTMLElement): void {
441
- this.bindEvent(tp, "mousedown", (startEvent: MouseEvent) => {
442
- if ((startEvent.target as HTMLElement).tagName === "BUTTON") {
443
- return;
444
- }
445
- startEvent.preventDefault();
446
- const disposables: IDisposable[] = [];
447
- // const offset = AtomUI.screenOffset(tp);
448
- const element = this.element;
449
- const offset = { x: element.offsetLeft, y: element.offsetTop };
450
- if (element.style.transform !== "none") {
451
- offset.x -= element.offsetWidth / 2;
452
- offset.y -= element.offsetHeight / 2;
453
- element.style.left = offset.x + "px";
454
- element.style.top = offset.y + "px";
455
- element.style.transform = "none";
456
- }
457
- this.element.dataset.dragging = "true";
458
- const rect: IRect = { x: startEvent.clientX, y: startEvent.clientY };
459
- const cursor = tp.style.cursor;
460
- tp.style.cursor = "move";
461
- disposables.push(this.bindEvent(document.body, "mousemove", (moveEvent: MouseEvent) => {
462
- const { clientX, clientY } = moveEvent;
463
- const dx = clientX - rect.x;
464
- const dy = clientY - rect.y;
465
-
466
- const finalX = offset.x + dx;
467
- const finalY = offset.y + dy;
468
- if (finalX < 5 || finalY < 5) {
469
- return;
470
- }
471
-
472
- offset.x = finalX;
473
- offset.y = finalY;
474
-
475
- this.element.style.left = offset.x + "px";
476
- this.element.style.top = offset.y + "px";
477
-
478
- rect.x = clientX;
479
- rect.y = clientY;
480
- }));
481
- disposables.push(this.bindEvent(document.body, "mouseup", (endEvent: MouseEvent) => {
482
- tp.style.cursor = cursor;
483
- this.element.removeAttribute("data-dragging");
484
- for (const iterator of disposables) {
485
- iterator.dispose();
486
- }
487
- }));
488
- });
489
- }
490
-
491
- }
492
-
493
- // @ts-ignore
494
- delete PopupWindow.prototype.init;
307
+ // export class PopupWindow extends AtomControl {
308
+
309
+ // public static async showWindow<T>(options?: IDialogOptions): Promise<T>;
310
+ // public static async showWindow<T>(window: IClassOf<PopupWindow>, options?: IDialogOptions): Promise<T>;
311
+ // public static async showWindow<T>(
312
+ // window: IClassOf<PopupWindow> | IDialogOptions,
313
+ // options?: IDialogOptions): Promise<T> {
314
+ // if (arguments.length <= 1) {
315
+ // options = arguments[0];
316
+ // window = this;
317
+ // }
318
+ // // this will force lastTarget to be set
319
+ // await sleep(1);
320
+ // return PopupService.showWindow<T>(PopupService.lastTarget, window as any, options);
321
+ // }
322
+
323
+ // public static async showModal<T>(options?: IDialogOptions): Promise<T>;
324
+ // public static async showModal<T>(window: IClassOf<PopupWindow>, options?: IDialogOptions): Promise<T>;
325
+ // public static async showModal<T>(
326
+ // window: IClassOf<PopupWindow> | IDialogOptions,
327
+ // options?: IDialogOptions): Promise<T> {
328
+ // if (arguments.length <= 1) {
329
+ // options = arguments[0];
330
+ // window = this;
331
+ // }
332
+ // options ??= {};
333
+ // options.modal ??= true;
334
+ // // this will force lastTarget to be set
335
+ // await sleep(1);
336
+ // return PopupService.showWindow<T>(PopupService.lastTarget, window as any, options);
337
+ // }
338
+
339
+ // @BindableProperty
340
+ // public title?: string;
341
+
342
+ // public viewModelTitle?: string;
343
+
344
+ // public close: (r?) => void;
345
+
346
+ // public cancel: (r?) => void;
347
+
348
+ // public titleRenderer: () => XNode;
349
+
350
+ // public closeButtonRenderer: () => XNode;
351
+
352
+ // @BindableProperty
353
+ // public closeWarning: string;
354
+
355
+ // protected init() {
356
+ // // do nothing...
357
+ // }
358
+
359
+ // protected async requestCancel() {
360
+ // if (this.closeWarning) {
361
+ // if (!await ConfirmPopup.confirm({
362
+ // message : this.closeWarning
363
+ // })) {
364
+ // return;
365
+ // }
366
+ // }
367
+ // this.cancel();
368
+ // }
369
+
370
+ // protected preCreate(): void {
371
+ // this.title = null;
372
+ // this.viewModelTitle = null;
373
+ // const handler = (e: KeyboardEvent) => {
374
+ // if (e.key === "Escape") {
375
+ // this.app.runAsync(() => this.requestCancel());
376
+ // e.preventDefault();
377
+ // return;
378
+ // }
379
+ // };
380
+ // this.bindEvent(this.element, "keydown", handler);
381
+ // // document.body.addEventListener("keydown", handler);
382
+ // // this.registerDisposable({
383
+ // // dispose() {
384
+ // // document.body.removeEventListener("keydown", handler);
385
+ // // }
386
+ // // });
387
+ // this.element.dataset.popupWindow = "popup-window";
388
+
389
+ // setTimeout((p) => {
390
+ // p.dataset.ready = "true";
391
+ // }, 10, this.element);
392
+ // }
393
+
394
+ // protected render(node: XNode, e?: any, creator?: any): void {
395
+ // this.render = super.render;
396
+ // const titleContent = this.titleRenderer?.() ?? <span
397
+ // class="title-text" text={Bind.oneWay(() => this.title || this.viewModelTitle)}/>;
398
+ // const closeButton = this.closeButtonRenderer?.() ?? <button
399
+ // class="popup-close-button"
400
+ // text="x"
401
+ // eventClick={Bind.event(() => this.requestCancel())}/>;
402
+ // const a = node.attributes ??= {};
403
+ // a["data-window-content"] = "window-content";
404
+ // const extracted = this.extractControlProperties(node);
405
+ // super.render(<div
406
+ // viewModelTitle={Bind.oneWay(() => this.viewModel.title)}
407
+ // { ... extracted }>
408
+ // <div class="title title-host">
409
+ // { titleContent }
410
+ // { closeButton }
411
+ // </div>
412
+ // { node }
413
+ // </div>);
414
+
415
+ // this.runAfterInit(() => {
416
+ // if (!this.element) {
417
+ // return;
418
+ // }
419
+ // const host = this.element.getElementsByClassName("title-host")[0];
420
+ // this.setupDragging(host as HTMLElement);
421
+ // // this.element may become null if it was immediately
422
+ // // closed, very rare case, but possible if
423
+ // // supplied cancelToken was cancelled
424
+ // const anyAutofocus = this.element.querySelector(`*[autofocus]`);
425
+ // if (!anyAutofocus) {
426
+ // const windowContent = this.element.querySelector("[data-window-content]");
427
+ // if (windowContent) {
428
+ // const firstInput = windowContent.querySelector("input,button,a") as HTMLInputElement;
429
+ // if (firstInput) {
430
+ // firstInput.focus();
431
+ // return;
432
+ // }
433
+ // }
434
+
435
+ // const cb = this.element.querySelector(".popup-close-button") as HTMLButtonElement;
436
+ // if (cb) {
437
+ // cb.focus();
438
+ // }
439
+ // return;
440
+ // }
441
+ // });
442
+ // }
443
+
444
+ // protected setupDragging(tp: HTMLElement): void {
445
+ // this.bindEvent(tp, "mousedown", (startEvent: MouseEvent) => {
446
+ // if ((startEvent.target as HTMLElement).tagName === "BUTTON") {
447
+ // return;
448
+ // }
449
+ // startEvent.preventDefault();
450
+ // const disposables: IDisposable[] = [];
451
+ // // const offset = AtomUI.screenOffset(tp);
452
+ // const element = this.element;
453
+ // const offset = { x: element.offsetLeft, y: element.offsetTop };
454
+ // if (element.style.transform !== "none") {
455
+ // offset.x -= element.offsetWidth / 2;
456
+ // offset.y -= element.offsetHeight / 2;
457
+ // element.style.left = offset.x + "px";
458
+ // element.style.top = offset.y + "px";
459
+ // element.style.transform = "none";
460
+ // }
461
+ // this.element.dataset.dragging = "true";
462
+ // const rect: IRect = { x: startEvent.clientX, y: startEvent.clientY };
463
+ // const cursor = tp.style.cursor;
464
+ // tp.style.cursor = "move";
465
+ // disposables.push(this.bindEvent(document.body, "mousemove", (moveEvent: MouseEvent) => {
466
+ // const { clientX, clientY } = moveEvent;
467
+ // const dx = clientX - rect.x;
468
+ // const dy = clientY - rect.y;
469
+
470
+ // const finalX = offset.x + dx;
471
+ // const finalY = offset.y + dy;
472
+ // if (finalX < 5 || finalY < 5) {
473
+ // return;
474
+ // }
475
+
476
+ // offset.x = finalX;
477
+ // offset.y = finalY;
478
+
479
+ // this.element.style.left = offset.x + "px";
480
+ // this.element.style.top = offset.y + "px";
481
+
482
+ // rect.x = clientX;
483
+ // rect.y = clientY;
484
+ // }));
485
+ // disposables.push(this.bindEvent(document.body, "mouseup", (endEvent: MouseEvent) => {
486
+ // tp.style.cursor = cursor;
487
+ // this.element.removeAttribute("data-dragging");
488
+ // for (const iterator of disposables) {
489
+ // iterator.dispose();
490
+ // }
491
+ // }));
492
+ // });
493
+ // }
494
+
495
+ // }
496
+
497
+ // // @ts-ignore
498
+ // delete PopupWindow.prototype.init;
495
499
 
496
500
  CSS(StyleRule()
497
501
  .display("grid")
@@ -531,74 +535,74 @@ CSS(StyleRule()
531
535
  )
532
536
  , "div[data-confirm-popup=confirm-popup]");
533
537
 
534
- class ConfirmPopup extends PopupWindow {
535
-
536
- public static async confirm({
537
- message,
538
- title = "Confirm",
539
- yesLabel = "Yes",
540
- noLabel = "No",
541
- cancelLabel = null
542
- }): Promise<boolean> {
543
- return PopupService.confirm({ title, message, yesLabel, noLabel, cancelLabel});
544
- }
545
-
546
- public message: string;
547
-
548
- public messageRenderer: () => XNode;
549
-
550
- public yesLabel: string;
551
-
552
- public noLabel: string;
553
-
554
- public cancelLabel: string;
555
-
556
- protected preCreate(): void {
557
- super.preCreate();
558
- this.yesLabel = "Yes";
559
- this.noLabel = "No";
560
- this.cancelLabel = null;
561
- }
562
-
563
- protected requestCancel(): Promise<void> {
564
- this.cancel();
565
- return Promise.resolve();
566
- }
567
-
568
- protected render(node: XNode, e?: any, creator?: any) {
569
- this.render = super.render;
570
- this.element.dataset.confirmPopup = "confirm-popup";
571
- this.closeButtonRenderer = () => <div/>;
572
- const extracted = this.extractControlProperties(node);
573
- const na = node.attributes ??= {};
574
- na["data-element"] = "message";
575
- super.render(<div { ... extracted }>
576
- { node }
577
- <div data-element="buttons">
578
- <button
579
- class="yes"
580
- autofocus={true}
581
- text={Bind.oneWay(() => this.yesLabel)}
582
- eventClick={() => this.close(true)}
583
- style-display={Bind.oneWay(() => !!this.yesLabel)}
584
- />
585
- <button
586
- class="no"
587
- text={Bind.oneWay(() => this.noLabel)}
588
- eventClick={() => this.close(false)}
589
- style-display={Bind.oneWay(() => !!this.noLabel)}
590
- />
591
- <button
592
- class="cancel"
593
- text={Bind.oneWay(() => this.cancelLabel)}
594
- eventClick={() => this.requestCancel()}
595
- style-display={Bind.oneWay(() => !!this.cancelLabel)}
596
- />
597
- </div>
598
- </div>);
599
- }
600
-
601
- }
538
+ // class ConfirmPopup extends PopupWindow {
539
+
540
+ // public static async confirm({
541
+ // message,
542
+ // title = "Confirm",
543
+ // yesLabel = "Yes",
544
+ // noLabel = "No",
545
+ // cancelLabel = null
546
+ // }): Promise<boolean> {
547
+ // return PopupService.confirm({ title, message, yesLabel, noLabel, cancelLabel});
548
+ // }
549
+
550
+ // public message: string;
551
+
552
+ // public messageRenderer: () => XNode;
553
+
554
+ // public yesLabel: string;
555
+
556
+ // public noLabel: string;
557
+
558
+ // public cancelLabel: string;
559
+
560
+ // protected preCreate(): void {
561
+ // super.preCreate();
562
+ // this.yesLabel = "Yes";
563
+ // this.noLabel = "No";
564
+ // this.cancelLabel = null;
565
+ // }
566
+
567
+ // protected requestCancel(): Promise<void> {
568
+ // this.cancel();
569
+ // return Promise.resolve();
570
+ // }
571
+
572
+ // protected render(node: XNode, e?: any, creator?: any) {
573
+ // this.render = super.render;
574
+ // this.element.dataset.confirmPopup = "confirm-popup";
575
+ // this.closeButtonRenderer = () => <div/>;
576
+ // const extracted = this.extractControlProperties(node);
577
+ // const na = node.attributes ??= {};
578
+ // na["data-element"] = "message";
579
+ // super.render(<div { ... extracted }>
580
+ // { node }
581
+ // <div data-element="buttons">
582
+ // <button
583
+ // class="yes"
584
+ // autofocus={true}
585
+ // text={Bind.oneWay(() => this.yesLabel)}
586
+ // eventClick={() => this.close(true)}
587
+ // style-display={Bind.oneWay(() => !!this.yesLabel)}
588
+ // />
589
+ // <button
590
+ // class="no"
591
+ // text={Bind.oneWay(() => this.noLabel)}
592
+ // eventClick={() => this.close(false)}
593
+ // style-display={Bind.oneWay(() => !!this.noLabel)}
594
+ // />
595
+ // <button
596
+ // class="cancel"
597
+ // text={Bind.oneWay(() => this.cancelLabel)}
598
+ // eventClick={() => this.requestCancel()}
599
+ // style-display={Bind.oneWay(() => !!this.cancelLabel)}
600
+ // />
601
+ // </div>
602
+ // </div>);
603
+ // }
604
+
605
+ // }
602
606
 
603
607
  function findHostAndPosition(opener: HTMLElement) {
604
608
  let root = opener;
@@ -833,7 +837,7 @@ export default class PopupService {
833
837
 
834
838
  public static showWindow<T>(
835
839
  opener: HTMLElement,
836
- popupClass: IClassOf<PopupWindow>,
840
+ popupClass: typeof PopupWindow,
837
841
  popupOptions?: IDialogOptions
838
842
  ): Promise<T> {
839
843
  return new Promise<T>((resolve, reject) => {