@forge/bridge 2.1.3 → 2.2.0-next.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/CHANGELOG.md +6 -0
- package/out/modal/modal.d.ts +4 -0
- package/out/modal/modal.d.ts.map +1 -1
- package/out/modal/modal.js +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/out/modal/modal.d.ts
CHANGED
|
@@ -3,12 +3,16 @@ export interface ModalOptions {
|
|
|
3
3
|
onClose?: (payload: any) => any;
|
|
4
4
|
size?: string;
|
|
5
5
|
context?: any;
|
|
6
|
+
closeOnEscape?: boolean;
|
|
7
|
+
closeOnOverlayClick?: boolean;
|
|
6
8
|
}
|
|
7
9
|
export declare class Modal {
|
|
8
10
|
resource: string | null;
|
|
9
11
|
onClose: NonNullable<ModalOptions['onClose']>;
|
|
10
12
|
size: string;
|
|
11
13
|
context: any;
|
|
14
|
+
closeOnEscape: boolean;
|
|
15
|
+
closeOnOverlayClick: boolean;
|
|
12
16
|
constructor(opts?: ModalOptions);
|
|
13
17
|
open(): Promise<void>;
|
|
14
18
|
}
|
package/out/modal/modal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/modal/modal.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,GAAG,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/modal/modal.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,GAAG,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAKD,qBAAa,KAAK;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;IACb,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;gBACjB,IAAI,CAAC,EAAE,YAAY;IASzB,IAAI;CAkBX"}
|
package/out/modal/modal.js
CHANGED
|
@@ -8,10 +8,13 @@ const callBridge = bridge_1.getCallBridge();
|
|
|
8
8
|
const noop = () => { };
|
|
9
9
|
class Modal {
|
|
10
10
|
constructor(opts) {
|
|
11
|
+
var _a, _b;
|
|
11
12
|
this.resource = (opts === null || opts === void 0 ? void 0 : opts.resource) || null;
|
|
12
13
|
this.onClose = (opts === null || opts === void 0 ? void 0 : opts.onClose) || noop;
|
|
13
14
|
this.size = (opts === null || opts === void 0 ? void 0 : opts.size) || 'medium';
|
|
14
15
|
this.context = (opts === null || opts === void 0 ? void 0 : opts.context) || {};
|
|
16
|
+
this.closeOnEscape = (_a = opts === null || opts === void 0 ? void 0 : opts.closeOnEscape) !== null && _a !== void 0 ? _a : true;
|
|
17
|
+
this.closeOnOverlayClick = (_b = opts === null || opts === void 0 ? void 0 : opts.closeOnOverlayClick) !== null && _b !== void 0 ? _b : true;
|
|
15
18
|
}
|
|
16
19
|
open() {
|
|
17
20
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -20,7 +23,9 @@ class Modal {
|
|
|
20
23
|
resource: this.resource,
|
|
21
24
|
onClose: this.onClose,
|
|
22
25
|
size: this.size,
|
|
23
|
-
context: this.context
|
|
26
|
+
context: this.context,
|
|
27
|
+
closeOnEscape: this.closeOnEscape,
|
|
28
|
+
closeOnOverlayClick: this.closeOnOverlayClick
|
|
24
29
|
});
|
|
25
30
|
if (success === false) {
|
|
26
31
|
throw new errors_1.BridgeAPIError('Unable to open modal.');
|