@eagami/ui 5.49.0 → 5.50.0
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/fesm2022/eagami-ui-testing.mjs +16 -39
- package/fesm2022/eagami-ui-testing.mjs.map +1 -1
- package/fesm2022/eagami-ui.mjs +52041 -30423
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eagami-ui-testing.d.ts +1 -3
- package/types/eagami-ui.d.ts +10316 -7462
|
@@ -1,42 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fills in the native `<dialog>` methods jsdom leaves unimplemented, so a spec
|
|
3
|
-
* can create a component that opens an `ea-dialog` or `ea-drawer` without the
|
|
4
|
-
* test runner throwing on `showModal()` or `close()`. Call once from the test
|
|
5
|
-
* setup file. Only missing methods are patched, so a runtime that implements
|
|
6
|
-
* the element keeps its own behavior.
|
|
7
|
-
*/
|
|
8
1
|
function installNativeDialogShim() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (typeof proto.close !== 'function') {
|
|
24
|
-
proto.close = function (returnValue) {
|
|
25
|
-
if (!this.open) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (returnValue !== undefined) {
|
|
29
|
-
this.returnValue = returnValue;
|
|
30
|
-
}
|
|
31
|
-
this.open = false;
|
|
32
|
-
this.dispatchEvent(new Event('close'));
|
|
33
|
-
};
|
|
34
|
-
}
|
|
2
|
+
if (typeof HTMLDialogElement === "undefined") return;
|
|
3
|
+
const proto = HTMLDialogElement.prototype;
|
|
4
|
+
if (typeof proto.show !== "function") proto.show = function() {
|
|
5
|
+
this.open = true;
|
|
6
|
+
};
|
|
7
|
+
if (typeof proto.showModal !== "function") proto.showModal = function() {
|
|
8
|
+
this.open = true;
|
|
9
|
+
};
|
|
10
|
+
if (typeof proto.close !== "function") proto.close = function(returnValue) {
|
|
11
|
+
if (!this.open) return;
|
|
12
|
+
if (returnValue !== void 0) this.returnValue = returnValue;
|
|
13
|
+
this.open = false;
|
|
14
|
+
this.dispatchEvent(new Event("close"));
|
|
15
|
+
};
|
|
35
16
|
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Generated bundle index. Do not edit.
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
17
|
export { installNativeDialogShim };
|
|
42
|
-
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=eagami-ui-testing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eagami-ui-testing.mjs","sources":["../../../testing/src/native-dialog.ts"
|
|
1
|
+
{"version":3,"file":"eagami-ui-testing.mjs","names":[],"sources":["../../../testing/src/native-dialog.ts"],"sourcesContent":["/**\n * Fills in the native `<dialog>` methods jsdom leaves unimplemented, so a spec\n * can create a component that opens an `ea-dialog` or `ea-drawer` without the\n * test runner throwing on `showModal()` or `close()`. Call once from the test\n * setup file. Only missing methods are patched, so a runtime that implements\n * the element keeps its own behavior.\n */\nexport function installNativeDialogShim(): void {\n if (typeof HTMLDialogElement === 'undefined') {\n return;\n }\n const proto = HTMLDialogElement.prototype;\n if (typeof proto.show !== 'function') {\n proto.show = function (this: HTMLDialogElement): void {\n this.open = true;\n };\n }\n if (typeof proto.showModal !== 'function') {\n proto.showModal = function (this: HTMLDialogElement): void {\n this.open = true;\n };\n }\n if (typeof proto.close !== 'function') {\n proto.close = function (this: HTMLDialogElement, returnValue?: string): void {\n if (!this.open) {\n return;\n }\n if (returnValue !== undefined) {\n this.returnValue = returnValue;\n }\n this.open = false;\n this.dispatchEvent(new Event('close'));\n };\n }\n}\n"],"mappings":"AAOA,SAAgB,0BAAuB;CACrC,IAAI,OAAO,sBAAsB,aAC/B;CAEF,MAAM,QAAQ,kBAAkB;CAChC,IAAI,OAAO,MAAM,SAAS,YACxB,MAAM,OAAO,WAAA;EACX,KAAK,OAAO;CACd;CAEF,IAAI,OAAO,MAAM,cAAc,YAC7B,MAAM,YAAY,WAAA;EAChB,KAAK,OAAO;CACd;CAEF,IAAI,OAAO,MAAM,UAAU,YACzB,MAAM,QAAQ,SAAmC,aAAoB;EACnE,IAAI,CAAC,KAAK,MACR;EAEF,IAAI,gBAAgB,QAClB,KAAK,cAAc;EAErB,KAAK,OAAO;EACZ,KAAK,cAAc,IAAI,MAAM,OAAO,CAAC;CACvC;AAEJ"}
|