@melodicdev/components 1.0.8 → 1.0.9
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/assets/melodic-components.js +12 -1
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.js +10 -2
- package/lib/components/overlays/dialog/dialog.component.d.ts +5 -2
- package/lib/components/overlays/dialog/dialog.component.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.component.js +14 -1
- package/package.json +1 -1
|
@@ -16785,10 +16785,18 @@ var Bi = class {
|
|
|
16785
16785
|
Q = g([Z()], Q);
|
|
16786
16786
|
var nr, Re = class {
|
|
16787
16787
|
constructor() {
|
|
16788
|
-
this._dialogID = Zl();
|
|
16788
|
+
this._dialogID = Zl(), this._registered = !1;
|
|
16789
16789
|
}
|
|
16790
16790
|
onCreate() {
|
|
16791
|
-
this.
|
|
16791
|
+
this.registerDialog();
|
|
16792
|
+
}
|
|
16793
|
+
onRender() {
|
|
16794
|
+
this.registerDialog();
|
|
16795
|
+
}
|
|
16796
|
+
registerDialog() {
|
|
16797
|
+
if (this._registered) return;
|
|
16798
|
+
const t = this.elementRef.shadowRoot?.querySelector("dialog");
|
|
16799
|
+
t && (this._dialogEl = t, this._dialogID = this.createDialogID(), this._dialogEl.id = this._dialogID, this._dialogRef = this._dialogService.addDialog(this._dialogID, this._dialogEl), this._registered = !0);
|
|
16792
16800
|
}
|
|
16793
16801
|
onDestroy() {
|
|
16794
16802
|
this._dialogService.removeDialog(this._dialogID);
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import type { OnCreate, OnDestroy, IElementRef } from '@melodicdev/core';
|
|
2
|
-
export declare class DialogComponent implements IElementRef, OnCreate, OnDestroy {
|
|
1
|
+
import type { OnCreate, OnDestroy, OnRender, IElementRef } from '@melodicdev/core';
|
|
2
|
+
export declare class DialogComponent implements IElementRef, OnCreate, OnDestroy, OnRender {
|
|
3
3
|
elementRef: HTMLElement;
|
|
4
4
|
private readonly _dialogService;
|
|
5
5
|
private _dialogID;
|
|
6
6
|
private _dialogEl;
|
|
7
7
|
private _dialogRef;
|
|
8
|
+
private _registered;
|
|
8
9
|
onCreate(): void;
|
|
10
|
+
onRender(): void;
|
|
11
|
+
private registerDialog;
|
|
9
12
|
onDestroy(): void;
|
|
10
13
|
open(): void;
|
|
11
14
|
close<T = unknown>(result?: T): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/dialog/dialog.component.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/dialog/dialog.component.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKnF,qBAMa,eAAgB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;IAC1E,UAAU,EAAG,WAAW,CAAC;IAGhC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAEhD,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,WAAW,CAAS;IAE5B,QAAQ,IAAI,IAAI;IAIhB,QAAQ,IAAI,IAAI;IAIhB,OAAO,CAAC,cAAc;IAatB,SAAS,IAAI,IAAI;IAIjB,IAAI,IAAI,IAAI;IAIZ,KAAK,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI;IAIpC,OAAO,CAAC,cAAc;CAQtB"}
|
|
@@ -15,12 +15,25 @@ import { DialogService } from './dialog.service';
|
|
|
15
15
|
let DialogComponent = class DialogComponent {
|
|
16
16
|
constructor() {
|
|
17
17
|
this._dialogID = newID();
|
|
18
|
+
this._registered = false;
|
|
18
19
|
}
|
|
19
20
|
onCreate() {
|
|
20
|
-
this.
|
|
21
|
+
this.registerDialog();
|
|
22
|
+
}
|
|
23
|
+
onRender() {
|
|
24
|
+
this.registerDialog();
|
|
25
|
+
}
|
|
26
|
+
registerDialog() {
|
|
27
|
+
if (this._registered)
|
|
28
|
+
return;
|
|
29
|
+
const dialogEl = this.elementRef.shadowRoot?.querySelector('dialog');
|
|
30
|
+
if (!dialogEl)
|
|
31
|
+
return;
|
|
32
|
+
this._dialogEl = dialogEl;
|
|
21
33
|
this._dialogID = this.createDialogID();
|
|
22
34
|
this._dialogEl.id = this._dialogID;
|
|
23
35
|
this._dialogRef = this._dialogService.addDialog(this._dialogID, this._dialogEl);
|
|
36
|
+
this._registered = true;
|
|
24
37
|
}
|
|
25
38
|
onDestroy() {
|
|
26
39
|
this._dialogService.removeDialog(this._dialogID);
|