@melodicdev/components 2.0.0 → 2.0.2
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 +22 -3
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.js +185 -163
- package/lib/components/overlays/dialog/dialog.component.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.component.js +6 -1
- package/lib/components/overlays/dialog/dialog.service.d.ts +9 -1
- package/lib/components/overlays/dialog/dialog.service.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.service.js +16 -1
- package/package.json +1 -1
|
@@ -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;AAKzE,qBAMa,eAAgB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IAChE,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;IAErB,QAAQ,IAAI,IAAI;IAIvB,OAAO,CAAC,cAAc;IAaf,SAAS,IAAI,IAAI;
|
|
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;AAKzE,qBAMa,eAAgB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IAChE,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;IAErB,QAAQ,IAAI,IAAI;IAIvB,OAAO,CAAC,cAAc;IAaf,SAAS,IAAI,IAAI;IAQjB,IAAI,IAAI,IAAI;IAKZ,KAAK,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI;IAI3C,OAAO,CAAC,cAAc;CAQtB"}
|
|
@@ -33,7 +33,12 @@ let DialogComponent = class DialogComponent {
|
|
|
33
33
|
this._registered = true;
|
|
34
34
|
}
|
|
35
35
|
onDestroy() {
|
|
36
|
-
this.
|
|
36
|
+
// Only this element should be able to remove its own registration. On a
|
|
37
|
+
// re-render the new instance registers (same id) before this stale one
|
|
38
|
+
// tears down; passing our element lets the service ignore that delete.
|
|
39
|
+
if (!this._registered)
|
|
40
|
+
return;
|
|
41
|
+
this._dialogService.removeDialog(this._dialogID, this._dialogEl);
|
|
37
42
|
}
|
|
38
43
|
open() {
|
|
39
44
|
this.registerDialog();
|
|
@@ -4,7 +4,15 @@ import type { IDialogConfig } from './dialog-config.interface';
|
|
|
4
4
|
export declare class DialogService {
|
|
5
5
|
private readonly _dialogs;
|
|
6
6
|
addDialog(dialogID: UniqueID, dialogEl: HTMLDialogElement): DialogRef;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Remove a dialog's registration.
|
|
9
|
+
*
|
|
10
|
+
* When `dialogEl` is supplied (component teardown), the entry is only
|
|
11
|
+
* deleted if it still belongs to that element. This prevents a stale
|
|
12
|
+
* `<ml-dialog>`'s late `onDestroy` from wiping the registration a freshly
|
|
13
|
+
* re-rendered instance (same id) just created.
|
|
14
|
+
*/
|
|
15
|
+
removeDialog(dialogID: UniqueID, dialogEl?: HTMLDialogElement): void;
|
|
8
16
|
open<TResult = unknown, TData = unknown>(dialogComponent: new (...args: any[]) => any, config?: IDialogConfig<TData>): DialogRef<TResult, TData>;
|
|
9
17
|
open<TResult = unknown, TData = unknown>(dialogID: UniqueID): DialogRef<TResult, TData>;
|
|
10
18
|
close<T = unknown>(dialogID: UniqueID, result?: T): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.service.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/dialog/dialog.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"dialog.service.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/dialog/dialog.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAY/D,qBACa,aAAa;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwC;IAE1D,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,SAAS;IAgB5E;;;;;;;OAOG;IACI,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAWpE,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,KAAK,GAAG,OAAO,EAAE,eAAe,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,MAAM,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC;IAChJ,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,KAAK,GAAG,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC;IA2BvF,KAAK,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI;IAO/D,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,aAAa;CAGrB"}
|
|
@@ -14,6 +14,7 @@ let DialogService = class DialogService {
|
|
|
14
14
|
const dialogRef = new DialogRef(dialogID, dialogEl);
|
|
15
15
|
this._dialogs.set(dialogID, {
|
|
16
16
|
dialogRef,
|
|
17
|
+
dialogEl,
|
|
17
18
|
dialogComponent: undefined
|
|
18
19
|
});
|
|
19
20
|
dialogEl.addEventListener('close', () => {
|
|
@@ -22,7 +23,21 @@ let DialogService = class DialogService {
|
|
|
22
23
|
});
|
|
23
24
|
return dialogRef;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Remove a dialog's registration.
|
|
28
|
+
*
|
|
29
|
+
* When `dialogEl` is supplied (component teardown), the entry is only
|
|
30
|
+
* deleted if it still belongs to that element. This prevents a stale
|
|
31
|
+
* `<ml-dialog>`'s late `onDestroy` from wiping the registration a freshly
|
|
32
|
+
* re-rendered instance (same id) just created.
|
|
33
|
+
*/
|
|
34
|
+
removeDialog(dialogID, dialogEl) {
|
|
35
|
+
if (dialogEl) {
|
|
36
|
+
const elements = this._dialogs.get(dialogID);
|
|
37
|
+
if (!elements || elements.dialogEl !== dialogEl) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
26
41
|
this._dialogs.delete(dialogID);
|
|
27
42
|
}
|
|
28
43
|
open(dialogComponentOrID, config) {
|