@4i/modal-manager 1.1.0 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4i/modal-manager",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
package/src/styles.css CHANGED
@@ -45,4 +45,5 @@
45
45
  position: relative;
46
46
  z-index: 1001;
47
47
  animation: bg_opacity_scale 150ms ease-in-out forwards;
48
+ width: 100%;
48
49
  }
@@ -54,11 +54,11 @@ var ModalManager = /** @class */ (function (_super) {
54
54
  }));
55
55
  };
56
56
  ModalManager.prototype.close = function (position) {
57
- var _a;
58
- this.emitter.emit(exports.constants.CLOSE, position);
57
+ var _a, _b;
58
+ this.emitter.emit(exports.constants.CLOSE, position !== null && position !== void 0 ? position : ((_a = this.queue) === null || _a === void 0 ? void 0 : _a.length) - 1);
59
59
  var closedModalName = this.queue[this.queue.length - 1];
60
60
  this.queue.pop();
61
- (_a = this._openModalStateCallback) === null || _a === void 0 ? void 0 : _a.call(this, this.getQueueState({
61
+ (_b = this._openModalStateCallback) === null || _b === void 0 ? void 0 : _b.call(this, this.getQueueState({
62
62
  queue: this.queue,
63
63
  closedModalName: closedModalName,
64
64
  }));
@@ -54,7 +54,7 @@ export class ModalManager extends Manager {
54
54
  }
55
55
 
56
56
  close<T>(position?: T) {
57
- this.emitter.emit(constants.CLOSE, position);
57
+ this.emitter.emit(constants.CLOSE, position ?? this.queue?.length - 1);
58
58
  const closedModalName = this.queue[this.queue.length - 1];
59
59
  this.queue.pop();
60
60