vrembem 3.0.11 → 4.0.0-alpha.1

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.
@@ -307,10 +307,10 @@
307
307
  var _proto = Collection.prototype;
308
308
  _proto.register = function register(item) {
309
309
  try {
310
- var _this2 = this;
311
- return Promise.resolve(_this2.deregister(item)).then(function () {
312
- _this2.collection.push(item);
313
- return _this2.collection;
310
+ var _this = this;
311
+ return Promise.resolve(_this.deregister(item)).then(function () {
312
+ _this.collection.push(item);
313
+ return _this.collection;
314
314
  });
315
315
  } catch (e) {
316
316
  return Promise.reject(e);
@@ -318,29 +318,29 @@
318
318
  };
319
319
  _proto.deregister = function deregister(ref) {
320
320
  try {
321
- var _this4 = this;
322
- var index = _this4.collection.findIndex(function (entry) {
321
+ var _this2 = this;
322
+ var index = _this2.collection.findIndex(function (entry) {
323
323
  return entry === ref;
324
324
  });
325
325
  if (index >= 0) {
326
- var entry = _this4.collection[index];
326
+ var entry = _this2.collection[index];
327
327
  Object.getOwnPropertyNames(entry).forEach(function (prop) {
328
328
  delete entry[prop];
329
329
  });
330
- _this4.collection.splice(index, 1);
330
+ _this2.collection.splice(index, 1);
331
331
  }
332
- return Promise.resolve(_this4.collection);
332
+ return Promise.resolve(_this2.collection);
333
333
  } catch (e) {
334
334
  return Promise.reject(e);
335
335
  }
336
336
  };
337
337
  _proto.registerCollection = function registerCollection(items) {
338
338
  try {
339
- var _this6 = this;
339
+ var _this3 = this;
340
340
  return Promise.resolve(Promise.all(Array.from(items, function (item) {
341
- _this6.register(item);
341
+ _this3.register(item);
342
342
  }))).then(function () {
343
- return _this6.collection;
343
+ return _this3.collection;
344
344
  });
345
345
  } catch (e) {
346
346
  return Promise.reject(e);
@@ -348,16 +348,16 @@
348
348
  };
349
349
  _proto.deregisterCollection = function deregisterCollection() {
350
350
  try {
351
- var _temp3 = function _temp3() {
352
- return _this8.collection;
351
+ var _temp2 = function _temp2() {
352
+ return _this4.collection;
353
353
  };
354
- var _this8 = this;
355
- var _temp4 = _for(function () {
356
- return _this8.collection.length > 0;
354
+ var _this4 = this;
355
+ var _temp = _for(function () {
356
+ return _this4.collection.length > 0;
357
357
  }, void 0, function () {
358
- return Promise.resolve(_this8.deregister(_this8.collection[0])).then(function () {});
358
+ return Promise.resolve(_this4.deregister(_this4.collection[0])).then(function () {});
359
359
  });
360
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
360
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
361
361
  } catch (e) {
362
362
  return Promise.reject(e);
363
363
  }
@@ -373,19 +373,29 @@
373
373
  return Collection;
374
374
  }();
375
375
 
376
+ const not = {
377
+ inert: ':not([inert]):not([inert] *)',
378
+ negTabIndex: ':not([tabindex^="-"])',
379
+ disabled: ':not(:disabled)',
380
+ };
381
+
376
382
  var e = [
377
- 'a[href]:not([tabindex^="-"])',
378
- 'area[href]:not([tabindex^="-"])',
379
- 'input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])',
380
- 'input[type="radio"]:not([disabled]):not([tabindex^="-"])',
381
- 'select:not([disabled]):not([tabindex^="-"])',
382
- 'textarea:not([disabled]):not([tabindex^="-"])',
383
- 'button:not([disabled]):not([tabindex^="-"])',
384
- 'iframe:not([tabindex^="-"])',
385
- 'audio[controls]:not([tabindex^="-"])',
386
- 'video[controls]:not([tabindex^="-"])',
387
- '[contenteditable]:not([tabindex^="-"])',
388
- '[tabindex]:not([tabindex^="-"])',
383
+ `a[href]${not.inert}${not.negTabIndex}`,
384
+ `area[href]${not.inert}${not.negTabIndex}`,
385
+ `input:not([type="hidden"]):not([type="radio"])${not.inert}${not.negTabIndex}${not.disabled}`,
386
+ `input[type="radio"]${not.inert}${not.negTabIndex}${not.disabled}`,
387
+ `select${not.inert}${not.negTabIndex}${not.disabled}`,
388
+ `textarea${not.inert}${not.negTabIndex}${not.disabled}`,
389
+ `button${not.inert}${not.negTabIndex}${not.disabled}`,
390
+ `details${not.inert} > summary:first-of-type${not.negTabIndex}`,
391
+ // Discard until Firefox supports `:has()`
392
+ // See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
393
+ // `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
394
+ `iframe${not.inert}${not.negTabIndex}`,
395
+ `audio[controls]${not.inert}${not.negTabIndex}`,
396
+ `video[controls]${not.inert}${not.negTabIndex}`,
397
+ `[contenteditable]${not.inert}${not.negTabIndex}`,
398
+ `[tabindex]${not.inert}${not.negTabIndex}`,
389
399
  ];
390
400
 
391
401
  var _focusable = /*#__PURE__*/_classPrivateFieldLooseKey("focusable");
@@ -877,23 +887,23 @@
877
887
  close = true;
878
888
  }
879
889
  try {
880
- var _temp5 = function _temp5() {
890
+ var _temp4 = function _temp4() {
881
891
  // Return the modified collection.
882
- return _this2.collection;
892
+ return _this.collection;
883
893
  };
884
- var _this2 = this;
894
+ var _this = this;
885
895
  // Return collection if nothing was passed.
886
- if (!obj) return Promise.resolve(_this2.collection);
896
+ if (!obj) return Promise.resolve(_this.collection);
887
897
 
888
898
  // Check if entry has been registered in the collection.
889
- var index = _this2.collection.findIndex(function (entry) {
899
+ var index = _this.collection.findIndex(function (entry) {
890
900
  return entry.id === obj.id;
891
901
  });
892
- var _temp6 = function () {
902
+ var _temp3 = function () {
893
903
  if (index >= 0) {
894
- var _temp7 = function _temp7() {
904
+ var _temp2 = function _temp2() {
895
905
  // Remove entry from local store.
896
- _this2.store.set(_entry.id);
906
+ _this.store.set(_entry.id);
897
907
 
898
908
  // Unmount the MatchMedia functionality.
899
909
  _entry.unmountBreakpoint();
@@ -904,22 +914,22 @@
904
914
  });
905
915
 
906
916
  // Remove entry from collection.
907
- _this2.collection.splice(index, 1);
917
+ _this.collection.splice(index, 1);
908
918
  };
909
919
  // Get the collection entry.
910
- var _entry = _this2.collection[index];
920
+ var _entry = _this.collection[index];
911
921
 
912
922
  // If entry is in the opened state.
913
- var _temp8 = function () {
923
+ var _temp = function () {
914
924
  if (close && _entry.state === 'opened') {
915
925
  // Close the drawer.
916
926
  return Promise.resolve(_entry.close(false)).then(function () {});
917
927
  }
918
928
  }();
919
- return _temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8);
929
+ return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
920
930
  }
921
931
  }();
922
- return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6));
932
+ return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3));
923
933
  } catch (e) {
924
934
  return Promise.reject(e);
925
935
  }
@@ -1023,33 +1033,33 @@
1023
1033
 
1024
1034
  var initialState = function initialState(entry) {
1025
1035
  try {
1026
- var _this2 = this;
1027
- var _temp3 = function () {
1028
- if (_this2.store.get(entry.id)) {
1029
- var _temp4 = function () {
1030
- if (_this2.store.get(entry.id) === 'opened') {
1036
+ var _this = this;
1037
+ var _temp2 = function () {
1038
+ if (_this.store.get(entry.id)) {
1039
+ var _temp = function () {
1040
+ if (_this.store.get(entry.id) === 'opened') {
1031
1041
  return Promise.resolve(entry.open(false, false)).then(function () {});
1032
1042
  } else {
1033
1043
  return Promise.resolve(entry.close(false, false)).then(function () {});
1034
1044
  }
1035
1045
  }();
1036
- if (_temp4 && _temp4.then) return _temp4.then(function () {});
1037
- } else if (entry.el.classList.contains(_this2.settings.stateOpened)) {
1046
+ if (_temp && _temp.then) return _temp.then(function () {});
1047
+ } else if (entry.el.classList.contains(_this.settings.stateOpened)) {
1038
1048
  // Update drawer state.
1039
1049
  entry.state = 'opened';
1040
1050
  } else {
1041
1051
  // Remove transition state classes.
1042
- entry.el.classList.remove(_this2.settings.stateOpening);
1043
- entry.el.classList.remove(_this2.settings.stateClosing);
1052
+ entry.el.classList.remove(_this.settings.stateOpening);
1053
+ entry.el.classList.remove(_this.settings.stateClosing);
1044
1054
  // Add closed state class.
1045
- entry.el.classList.add(_this2.settings.stateClosed);
1055
+ entry.el.classList.add(_this.settings.stateClosed);
1046
1056
  }
1047
1057
  }();
1048
1058
  // Setup initial state using the following priority:
1049
1059
  // 1. If a store state is available, restore from local store.
1050
1060
  // 2. If opened state class is set, set state to opened.
1051
1061
  // 3. Else, initialize default state.
1052
- return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {}) : void 0);
1062
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
1053
1063
  } catch (e) {
1054
1064
  return Promise.reject(e);
1055
1065
  }
@@ -1079,33 +1089,33 @@
1079
1089
  focus = true;
1080
1090
  }
1081
1091
  try {
1082
- var _temp3 = function _temp3() {
1092
+ var _temp2 = function _temp2() {
1083
1093
  // Set focus to the drawer element if the focus param is true.
1084
1094
  if (focus) {
1085
- updateFocusState$1.call(_this2, drawer);
1095
+ updateFocusState$1.call(_this, drawer);
1086
1096
  }
1087
1097
 
1088
1098
  // Dispatch custom opened event.
1089
1099
  drawer.el.dispatchEvent(new CustomEvent(config.customEventPrefix + 'opened', {
1090
- detail: _this2,
1100
+ detail: _this,
1091
1101
  bubbles: true
1092
1102
  }));
1093
1103
 
1094
1104
  // Return the drawer.
1095
1105
  return drawer;
1096
1106
  };
1097
- var _this2 = this;
1107
+ var _this = this;
1098
1108
  // Get the drawer from collection.
1099
- var drawer = getDrawer.call(_this2, query);
1109
+ var drawer = getDrawer.call(_this, query);
1100
1110
 
1101
1111
  // Get the modal configuration.
1102
- var config = _extends({}, _this2.settings, drawer.settings);
1112
+ var config = _extends({}, _this.settings, drawer.settings);
1103
1113
 
1104
1114
  // Add transition parameter to configuration.
1105
1115
  if (transition !== undefined) config.transition = transition;
1106
1116
 
1107
1117
  // If drawer is closed.
1108
- var _temp4 = function () {
1118
+ var _temp = function () {
1109
1119
  if (drawer.state === 'closed') {
1110
1120
  // Update drawer state.
1111
1121
  drawer.state = 'opening';
@@ -1120,7 +1130,7 @@
1120
1130
  });
1121
1131
  }
1122
1132
  }();
1123
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
1133
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
1124
1134
  } catch (e) {
1125
1135
  return Promise.reject(e);
1126
1136
  }
@@ -1131,18 +1141,18 @@
1131
1141
  focus = true;
1132
1142
  }
1133
1143
  try {
1134
- var _this2 = this;
1144
+ var _this = this;
1135
1145
  // Get the drawer from collection.
1136
- var drawer = getDrawer.call(_this2, query);
1146
+ var drawer = getDrawer.call(_this, query);
1137
1147
 
1138
1148
  // Get the modal configuration.
1139
- var config = _extends({}, _this2.settings, drawer.settings);
1149
+ var config = _extends({}, _this.settings, drawer.settings);
1140
1150
 
1141
1151
  // Add transition parameter to configuration.
1142
1152
  if (transition !== undefined) config.transition = transition;
1143
1153
 
1144
1154
  // If drawer is opened.
1145
- var _temp2 = function () {
1155
+ var _temp = function () {
1146
1156
  if (drawer.state === 'opened') {
1147
1157
  // Update drawer state.
1148
1158
  drawer.state = 'closing';
@@ -1157,7 +1167,7 @@
1157
1167
 
1158
1168
  // Set focus to the trigger element if the focus param is true.
1159
1169
  if (focus) {
1160
- updateFocusState$1.call(_this2, drawer);
1170
+ updateFocusState$1.call(_this, drawer);
1161
1171
  }
1162
1172
 
1163
1173
  // Update drawer state.
@@ -1165,13 +1175,13 @@
1165
1175
 
1166
1176
  // Dispatch custom closed event.
1167
1177
  drawer.el.dispatchEvent(new CustomEvent(config.customEventPrefix + 'closed', {
1168
- detail: _this2,
1178
+ detail: _this,
1169
1179
  bubbles: true
1170
1180
  }));
1171
1181
  });
1172
1182
  }
1173
1183
  }();
1174
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {
1184
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {
1175
1185
  // Return the drawer.
1176
1186
  return drawer;
1177
1187
  }) : drawer);
@@ -1182,15 +1192,15 @@
1182
1192
 
1183
1193
  var toggle = function toggle(query, transition, focus) {
1184
1194
  try {
1185
- var _this2 = this;
1195
+ var _this = this;
1186
1196
  // Get the drawer from collection.
1187
- var drawer = getDrawer.call(_this2, query);
1197
+ var drawer = getDrawer.call(_this, query);
1188
1198
 
1189
1199
  // Open or close the drawer based on its current state.
1190
1200
  if (drawer.state === 'closed') {
1191
- return Promise.resolve(open$2.call(_this2, drawer, transition, focus));
1201
+ return Promise.resolve(open$2.call(_this, drawer, transition, focus));
1192
1202
  } else {
1193
- return Promise.resolve(close$2.call(_this2, drawer, transition, focus));
1203
+ return Promise.resolve(close$2.call(_this, drawer, transition, focus));
1194
1204
  }
1195
1205
  } catch (e) {
1196
1206
  return Promise.reject(e);
@@ -1199,7 +1209,7 @@
1199
1209
 
1200
1210
  var toModal = function toModal(entry) {
1201
1211
  try {
1202
- var _this4 = this;
1212
+ var _this2 = this;
1203
1213
  // Get the drawer configuration.
1204
1214
 
1205
1215
  // Add the modal class.
@@ -1209,16 +1219,16 @@
1209
1219
  entry.dialog.setAttribute('aria-modal', 'true');
1210
1220
 
1211
1221
  // If there isn't a stored state but also has the opened state class...
1212
- if (!_this4.store.get(entry.id) && entry.el.classList.contains(entry.getSetting('stateOpened'))) {
1222
+ if (!_this2.store.get(entry.id) && entry.el.classList.contains(entry.getSetting('stateOpened'))) {
1213
1223
  // Save the opened state in local store.
1214
- _this4.store.set(entry.id, 'opened');
1224
+ _this2.store.set(entry.id, 'opened');
1215
1225
  }
1216
1226
 
1217
1227
  // Modal drawer defaults to closed state.
1218
- return Promise.resolve(close$2.call(_this4, entry, false, false)).then(function () {
1228
+ return Promise.resolve(close$2.call(_this2, entry, false, false)).then(function () {
1219
1229
  // Dispatch custom switch event.
1220
1230
  entry.el.dispatchEvent(new CustomEvent(entry.getSetting('customEventPrefix') + 'switchMode', {
1221
- detail: _this4,
1231
+ detail: _this2,
1222
1232
  bubbles: true
1223
1233
  }));
1224
1234
 
@@ -1231,7 +1241,7 @@
1231
1241
  };
1232
1242
  var toInline = function toInline(entry) {
1233
1243
  try {
1234
- var _this2 = this;
1244
+ var _this = this;
1235
1245
  // Remove the modal class.
1236
1246
  entry.el.classList.remove(entry.getSetting('classModal'));
1237
1247
 
@@ -1239,16 +1249,16 @@
1239
1249
  entry.dialog.removeAttribute('aria-modal');
1240
1250
 
1241
1251
  // Update the global state.
1242
- updateGlobalState(false, _extends({}, _this2.settings, entry.settings));
1252
+ updateGlobalState(false, _extends({}, _this.settings, entry.settings));
1243
1253
 
1244
1254
  // Remove any focus traps.
1245
- _this2.focusTrap.unmount();
1255
+ _this.focusTrap.unmount();
1246
1256
 
1247
1257
  // Setup initial state.
1248
- return Promise.resolve(initialState.call(_this2, entry)).then(function () {
1258
+ return Promise.resolve(initialState.call(_this, entry)).then(function () {
1249
1259
  // Dispatch custom switch event.
1250
1260
  entry.el.dispatchEvent(new CustomEvent(entry.getSetting('customEventPrefix') + 'switchMode', {
1251
- detail: _this2,
1261
+ detail: _this,
1252
1262
  bubbles: true
1253
1263
  }));
1254
1264
 
@@ -1272,11 +1282,11 @@
1272
1282
 
1273
1283
  var register$2 = function register(el, dialog) {
1274
1284
  try {
1275
- var _this2 = this;
1285
+ var _this = this;
1276
1286
  // Deregister entry incase it has already been registered.
1277
- return Promise.resolve(deregister$2.call(_this2, el, false)).then(function () {
1287
+ return Promise.resolve(deregister$2.call(_this, el, false)).then(function () {
1278
1288
  // Save root this for use inside methods API.
1279
- var root = _this2;
1289
+ var root = _this;
1280
1290
 
1281
1291
  // Create an instance of the Breakpoint class.
1282
1292
  var breakpoint = new Breakpoint();
@@ -1320,7 +1330,7 @@
1320
1330
  el: el,
1321
1331
  dialog: dialog,
1322
1332
  trigger: null,
1323
- settings: getConfig$1(el, _this2.settings.dataConfig),
1333
+ settings: getConfig$1(el, _this.settings.dataConfig),
1324
1334
  get breakpoint() {
1325
1335
  return getBreakpoint.call(root, el);
1326
1336
  },
@@ -1364,7 +1374,7 @@
1364
1374
  }
1365
1375
 
1366
1376
  // Add entry to collection.
1367
- _this2.collection.push(entry);
1377
+ _this.collection.push(entry);
1368
1378
 
1369
1379
  // If the entry has a breakpoint...
1370
1380
  var _temp = function () {
@@ -1373,7 +1383,7 @@
1373
1383
  entry.mountBreakpoint();
1374
1384
  } else {
1375
1385
  // Else, Setup initial state.
1376
- return Promise.resolve(initialState.call(_this2, entry)).then(function () {});
1386
+ return Promise.resolve(initialState.call(_this, entry)).then(function () {});
1377
1387
  }
1378
1388
  }();
1379
1389
  return _temp && _temp.then ? _temp.then(function () {
@@ -1418,20 +1428,20 @@
1418
1428
  options = null;
1419
1429
  }
1420
1430
  try {
1421
- var _this3 = this;
1431
+ var _this2 = this;
1422
1432
  // Update settings with passed options.
1423
- if (options) _this3.settings = _extends({}, _this3.settings, options);
1433
+ if (options) _this2.settings = _extends({}, _this2.settings, options);
1424
1434
 
1425
1435
  // Get all the modals.
1426
- var drawers = document.querySelectorAll(_this3.settings.selectorDrawer);
1436
+ var drawers = document.querySelectorAll(_this2.settings.selectorDrawer);
1427
1437
 
1428
1438
  // Register the collections array with modal instances.
1429
- return Promise.resolve(_this3.registerCollection(drawers)).then(function () {
1439
+ return Promise.resolve(_this2.registerCollection(drawers)).then(function () {
1430
1440
  // If eventListeners are enabled, init event listeners.
1431
- if (_this3.settings.eventListeners) {
1432
- _this3.initEventListeners();
1441
+ if (_this2.settings.eventListeners) {
1442
+ _this2.initEventListeners();
1433
1443
  }
1434
- return _this3;
1444
+ return _this2;
1435
1445
  });
1436
1446
  } catch (e) {
1437
1447
  return Promise.reject(e);
@@ -1439,14 +1449,14 @@
1439
1449
  };
1440
1450
  _proto.destroy = function destroy() {
1441
1451
  try {
1442
- var _this5 = this;
1452
+ var _this3 = this;
1443
1453
  // Remove all entries from the collection.
1444
- return Promise.resolve(_this5.deregisterCollection()).then(function () {
1454
+ return Promise.resolve(_this3.deregisterCollection()).then(function () {
1445
1455
  // If eventListeners are enabled, init event listeners.
1446
- if (_this5.settings.eventListeners) {
1447
- _this5.destroyEventListeners();
1456
+ if (_this3.settings.eventListeners) {
1457
+ _this3.destroyEventListeners();
1448
1458
  }
1449
- return _this5;
1459
+ return _this3;
1450
1460
  });
1451
1461
  } catch (e) {
1452
1462
  return Promise.reject(e);
@@ -1614,33 +1624,33 @@
1614
1624
 
1615
1625
  var handleClick$1 = function handleClick(event) {
1616
1626
  try {
1617
- var _this2 = this;
1627
+ var _this = this;
1618
1628
  // If an open or replace button was clicked, open or replace the modal.
1619
- var trigger = event.target.closest("[data-" + _this2.settings.dataOpen + "], [data-" + _this2.settings.dataReplace + "]");
1629
+ var trigger = event.target.closest("[data-" + _this.settings.dataOpen + "], [data-" + _this.settings.dataReplace + "]");
1620
1630
  if (trigger) {
1621
1631
  event.preventDefault();
1622
1632
  // Save the trigger if it's not coming from inside a modal.
1623
- var fromModal = event.target.closest(_this2.settings.selectorModal);
1624
- if (!fromModal) _this2.trigger = trigger;
1633
+ var fromModal = event.target.closest(_this.settings.selectorModal);
1634
+ if (!fromModal) _this.trigger = trigger;
1625
1635
  // Get the modal.
1626
- var modal = _this2.get(getModalID.call(_this2, trigger));
1636
+ var modal = _this.get(getModalID.call(_this, trigger));
1627
1637
  // Depending on the button type, either open or replace the modal.
1628
- return Promise.resolve(trigger.matches("[data-" + _this2.settings.dataOpen + "]") ? modal.open() : modal.replace());
1638
+ return Promise.resolve(trigger.matches("[data-" + _this.settings.dataOpen + "]") ? modal.open() : modal.replace());
1629
1639
  }
1630
1640
 
1631
1641
  // If a close button was clicked, close the modal.
1632
- trigger = event.target.closest("[data-" + _this2.settings.dataClose + "]");
1642
+ trigger = event.target.closest("[data-" + _this.settings.dataClose + "]");
1633
1643
  if (trigger) {
1634
1644
  event.preventDefault();
1635
1645
  // Get the value of the data attribute.
1636
- var value = trigger.getAttribute("data-" + _this2.settings.dataClose);
1646
+ var value = trigger.getAttribute("data-" + _this.settings.dataClose);
1637
1647
  // Close all if * wildcard is passed, otherwise close a single modal.
1638
- return Promise.resolve(value === '*' ? _this2.closeAll() : _this2.close(value));
1648
+ return Promise.resolve(value === '*' ? _this.closeAll() : _this.close(value));
1639
1649
  }
1640
1650
 
1641
1651
  // If the modal screen was clicked, close the modal.
1642
- if (event.target.matches(_this2.settings.selectorModal) && !event.target.querySelector(_this2.settings.selectorRequired)) {
1643
- return Promise.resolve(_this2.close(getModalID.call(_this2, event.target)));
1652
+ if (event.target.matches(_this.settings.selectorModal) && !event.target.querySelector(_this.settings.selectorRequired)) {
1653
+ return Promise.resolve(_this.close(getModalID.call(_this, event.target)));
1644
1654
  }
1645
1655
  return Promise.resolve();
1646
1656
  } catch (e) {
@@ -1662,21 +1672,21 @@
1662
1672
  close = true;
1663
1673
  }
1664
1674
  try {
1665
- var _temp5 = function _temp5() {
1675
+ var _temp4 = function _temp4() {
1666
1676
  // Return the modified collection.
1667
- return _this2.collection;
1677
+ return _this.collection;
1668
1678
  };
1669
- var _this2 = this;
1679
+ var _this = this;
1670
1680
  // Return collection if nothing was passed.
1671
- if (!obj) return Promise.resolve(_this2.collection);
1681
+ if (!obj) return Promise.resolve(_this.collection);
1672
1682
 
1673
1683
  // Check if entry has been registered in the collection.
1674
- var index = _this2.collection.findIndex(function (entry) {
1684
+ var index = _this.collection.findIndex(function (entry) {
1675
1685
  return entry.id === obj.id;
1676
1686
  });
1677
- var _temp6 = function () {
1687
+ var _temp3 = function () {
1678
1688
  if (index >= 0) {
1679
- var _temp7 = function _temp7() {
1689
+ var _temp2 = function _temp2() {
1680
1690
  // Return teleported modal if a reference has been set.
1681
1691
  if (_entry.getSetting('teleport')) {
1682
1692
  _entry.teleportReturn();
@@ -1688,24 +1698,24 @@
1688
1698
  });
1689
1699
 
1690
1700
  // Remove entry from collection.
1691
- _this2.collection.splice(index, 1);
1701
+ _this.collection.splice(index, 1);
1692
1702
  };
1693
1703
  // Get the collection entry.
1694
- var _entry = _this2.collection[index];
1704
+ var _entry = _this.collection[index];
1695
1705
 
1696
1706
  // If entry is in the opened state, close it.
1697
- var _temp8 = function () {
1707
+ var _temp = function () {
1698
1708
  if (close && _entry.state === 'opened') {
1699
1709
  return Promise.resolve(_entry.close(false)).then(function () {});
1700
1710
  } else {
1701
1711
  // Remove modal from stack.
1702
- _this2.stack.remove(_entry);
1712
+ _this.stack.remove(_entry);
1703
1713
  }
1704
1714
  }();
1705
- return _temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8);
1715
+ return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
1706
1716
  }
1707
1717
  }();
1708
- return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6));
1718
+ return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3));
1709
1719
  } catch (e) {
1710
1720
  return Promise.reject(e);
1711
1721
  }
@@ -1716,42 +1726,42 @@
1716
1726
  focus = true;
1717
1727
  }
1718
1728
  try {
1719
- var _temp3 = function _temp3() {
1729
+ var _temp2 = function _temp2() {
1720
1730
  // Update focus if the focus param is true.
1721
1731
  if (focus) {
1722
- updateFocusState.call(_this2);
1732
+ updateFocusState.call(_this);
1723
1733
  }
1724
1734
 
1725
1735
  // Dispatch custom opened event.
1726
1736
  modal.el.dispatchEvent(new CustomEvent(config.customEventPrefix + 'opened', {
1727
- detail: _this2,
1737
+ detail: _this,
1728
1738
  bubbles: true
1729
1739
  }));
1730
1740
 
1731
1741
  // Return the modal.
1732
1742
  return modal;
1733
1743
  };
1734
- var _this2 = this;
1744
+ var _this = this;
1735
1745
  // Get the modal from collection.
1736
- var modal = getModal.call(_this2, query);
1746
+ var modal = getModal.call(_this, query);
1737
1747
 
1738
1748
  // Get the modal configuration.
1739
- var config = _extends({}, _this2.settings, modal.settings);
1749
+ var config = _extends({}, _this.settings, modal.settings);
1740
1750
 
1741
1751
  // Add transition parameter to configuration.
1742
1752
  if (transition !== undefined) config.transition = transition;
1743
1753
 
1744
1754
  // Maybe add modal to top of stack.
1745
- _this2.stack.moveToTop(modal);
1755
+ _this.stack.moveToTop(modal);
1746
1756
 
1747
1757
  // If modal is closed.
1748
- var _temp4 = function () {
1758
+ var _temp = function () {
1749
1759
  if (modal.state === 'closed') {
1750
1760
  // Update modal state.
1751
1761
  modal.state = 'opening';
1752
1762
 
1753
1763
  // Add modal to stack.
1754
- _this2.stack.add(modal);
1764
+ _this.stack.add(modal);
1755
1765
 
1756
1766
  // Run the open transition.
1757
1767
  return Promise.resolve(openTransition(modal.el, config)).then(function () {
@@ -1760,7 +1770,7 @@
1760
1770
  });
1761
1771
  }
1762
1772
  }();
1763
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
1773
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
1764
1774
  } catch (e) {
1765
1775
  return Promise.reject(e);
1766
1776
  }
@@ -1771,18 +1781,18 @@
1771
1781
  focus = true;
1772
1782
  }
1773
1783
  try {
1774
- var _this2 = this;
1784
+ var _this = this;
1775
1785
  // Get the modal from collection, or top modal in stack if no query is provided.
1776
- var modal = query ? getModal.call(_this2, query) : _this2.active;
1786
+ var modal = query ? getModal.call(_this, query) : _this.active;
1777
1787
 
1778
1788
  // If a modal exists and its state is opened.
1779
- var _temp2 = function () {
1789
+ var _temp = function () {
1780
1790
  if (modal && modal.state === 'opened') {
1781
1791
  // Update modal state.
1782
1792
  modal.state = 'closing';
1783
1793
 
1784
1794
  // Get the modal configuration.
1785
- var config = _extends({}, _this2.settings, modal.settings);
1795
+ var config = _extends({}, _this.settings, modal.settings);
1786
1796
 
1787
1797
  // Add transition parameter to configuration.
1788
1798
  if (transition !== undefined) config.transition = transition;
@@ -1793,11 +1803,11 @@
1793
1803
  // Run the close transition.
1794
1804
  return Promise.resolve(closeTransition(modal.el, config)).then(function () {
1795
1805
  // Remove modal from stack.
1796
- _this2.stack.remove(modal);
1806
+ _this.stack.remove(modal);
1797
1807
 
1798
1808
  // Update focus if the focus param is true.
1799
1809
  if (focus) {
1800
- updateFocusState.call(_this2);
1810
+ updateFocusState.call(_this);
1801
1811
  }
1802
1812
 
1803
1813
  // Update modal state.
@@ -1805,13 +1815,13 @@
1805
1815
 
1806
1816
  // Dispatch custom closed event.
1807
1817
  modal.el.dispatchEvent(new CustomEvent(config.customEventPrefix + 'closed', {
1808
- detail: _this2,
1818
+ detail: _this,
1809
1819
  bubbles: true
1810
1820
  }));
1811
1821
  });
1812
1822
  }
1813
1823
  }();
1814
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {
1824
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {
1815
1825
  // Return the modal.
1816
1826
  return modal;
1817
1827
  }) : modal);
@@ -1822,24 +1832,24 @@
1822
1832
 
1823
1833
  var closeAll$1 = function closeAll(exclude, transition) {
1824
1834
  try {
1825
- var _this2 = this;
1835
+ var _this = this;
1826
1836
  var result = [];
1827
- return Promise.resolve(Promise.all(_this2.stack.value.map(function (modal) {
1837
+ return Promise.resolve(Promise.all(_this.stack.value.map(function (modal) {
1828
1838
  try {
1829
- var _temp3 = function _temp3() {
1839
+ var _temp2 = function _temp2() {
1830
1840
  modal.trigger = null;
1831
1841
  };
1832
- var _temp4 = function () {
1842
+ var _temp = function () {
1833
1843
  if (exclude && exclude === modal.id) {
1834
1844
  Promise.resolve();
1835
1845
  } else {
1836
- var _push2 = result.push;
1837
- return Promise.resolve(close$1.call(_this2, modal, transition, false)).then(function (_close$call) {
1838
- _push2.call(result, _close$call);
1846
+ var _push = result.push;
1847
+ return Promise.resolve(close$1.call(_this, modal, transition, false)).then(function (_close$call) {
1848
+ _push.call(result, _close$call);
1839
1849
  });
1840
1850
  }
1841
1851
  }();
1842
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
1852
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
1843
1853
  } catch (e) {
1844
1854
  return Promise.reject(e);
1845
1855
  }
@@ -1856,10 +1866,10 @@
1856
1866
  focus = true;
1857
1867
  }
1858
1868
  try {
1859
- var _temp3 = function _temp3() {
1869
+ var _temp2 = function _temp2() {
1860
1870
  // Update focus if the focus param is true.
1861
1871
  if (focus) {
1862
- updateFocusState.call(_this2);
1872
+ updateFocusState.call(_this);
1863
1873
  }
1864
1874
 
1865
1875
  // Return the modals there were opened and closed.
@@ -1868,27 +1878,27 @@
1868
1878
  closed: resultClosed
1869
1879
  };
1870
1880
  };
1871
- var _this2 = this;
1881
+ var _this = this;
1872
1882
  // Get the modal from collection.
1873
- var modal = getModal.call(_this2, query);
1883
+ var modal = getModal.call(_this, query);
1874
1884
 
1875
1885
  // Setup results for return.
1876
1886
  var resultOpened, resultClosed;
1877
- var _temp4 = function () {
1887
+ var _temp = function () {
1878
1888
  if (modal.state === 'opened') {
1879
1889
  // If modal is open, close all modals except for replacement.
1880
1890
  resultOpened = modal;
1881
- return Promise.resolve(closeAll$1.call(_this2, modal.id, transition)).then(function (_closeAll$call) {
1891
+ return Promise.resolve(closeAll$1.call(_this, modal.id, transition)).then(function (_closeAll$call) {
1882
1892
  resultClosed = _closeAll$call;
1883
1893
  });
1884
1894
  } else {
1885
1895
  // If modal is closed, close all and open replacement at the same time.
1886
- resultOpened = open$1.call(_this2, modal, transition, false);
1887
- resultClosed = closeAll$1.call(_this2, false, transition);
1896
+ resultOpened = open$1.call(_this, modal, transition, false);
1897
+ resultClosed = closeAll$1.call(_this, false, transition);
1888
1898
  return Promise.resolve(Promise.all([resultOpened, resultClosed])).then(function () {});
1889
1899
  }
1890
1900
  }();
1891
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
1901
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
1892
1902
  } catch (e) {
1893
1903
  return Promise.reject(e);
1894
1904
  }
@@ -1896,11 +1906,11 @@
1896
1906
 
1897
1907
  var register$1 = function register(el, dialog) {
1898
1908
  try {
1899
- var _this2 = this;
1909
+ var _this = this;
1900
1910
  // Deregister entry incase it has already been registered.
1901
- return Promise.resolve(deregister$1.call(_this2, el, false)).then(function () {
1911
+ return Promise.resolve(deregister$1.call(_this, el, false)).then(function () {
1902
1912
  // Save root this for use inside methods API.
1903
- var root = _this2;
1913
+ var root = _this;
1904
1914
 
1905
1915
  // Setup methods API.
1906
1916
  var methods = {
@@ -1952,7 +1962,7 @@
1952
1962
  el: el,
1953
1963
  dialog: dialog,
1954
1964
  returnRef: null,
1955
- settings: getConfig$1(el, _this2.settings.dataConfig)
1965
+ settings: getConfig$1(el, _this.settings.dataConfig)
1956
1966
  }, methods);
1957
1967
 
1958
1968
  // Set aria-modal attribute to true.
@@ -1974,19 +1984,19 @@
1974
1984
  }
1975
1985
 
1976
1986
  // Add entry to collection.
1977
- _this2.collection.push(entry);
1987
+ _this.collection.push(entry);
1978
1988
 
1979
1989
  // Setup initial state.
1980
1990
  var _temp = function () {
1981
- if (entry.el.classList.contains(_this2.settings.stateOpened)) {
1991
+ if (entry.el.classList.contains(_this.settings.stateOpened)) {
1982
1992
  // Open entry with transitions disabled.
1983
1993
  return Promise.resolve(entry.open(false)).then(function () {});
1984
1994
  } else {
1985
1995
  // Remove transition state classes.
1986
- entry.el.classList.remove(_this2.settings.stateOpening);
1987
- entry.el.classList.remove(_this2.settings.stateClosing);
1996
+ entry.el.classList.remove(_this.settings.stateOpening);
1997
+ entry.el.classList.remove(_this.settings.stateClosing);
1988
1998
  // Add closed state class.
1989
- entry.el.classList.add(_this2.settings.stateClosed);
1999
+ entry.el.classList.add(_this.settings.stateClosed);
1990
2000
  }
1991
2001
  }();
1992
2002
  return _temp && _temp.then ? _temp.then(function () {
@@ -2097,20 +2107,20 @@
2097
2107
  var _proto = Modal.prototype;
2098
2108
  _proto.init = function init(options) {
2099
2109
  try {
2100
- var _this3 = this;
2110
+ var _this2 = this;
2101
2111
  // Update settings with passed options.
2102
- if (options) _this3.settings = _extends({}, _this3.settings, options);
2112
+ if (options) _this2.settings = _extends({}, _this2.settings, options);
2103
2113
 
2104
2114
  // Get all the modals.
2105
- var modals = document.querySelectorAll(_this3.settings.selectorModal);
2115
+ var modals = document.querySelectorAll(_this2.settings.selectorModal);
2106
2116
 
2107
2117
  // Register the collections array with modal instances.
2108
- return Promise.resolve(_this3.registerCollection(modals)).then(function () {
2118
+ return Promise.resolve(_this2.registerCollection(modals)).then(function () {
2109
2119
  // If eventListeners are enabled, init event listeners.
2110
- if (_this3.settings.eventListeners) {
2111
- _this3.initEventListeners();
2120
+ if (_this2.settings.eventListeners) {
2121
+ _this2.initEventListeners();
2112
2122
  }
2113
- return _this3;
2123
+ return _this2;
2114
2124
  });
2115
2125
  } catch (e) {
2116
2126
  return Promise.reject(e);
@@ -2118,17 +2128,17 @@
2118
2128
  };
2119
2129
  _proto.destroy = function destroy() {
2120
2130
  try {
2121
- var _this5 = this;
2131
+ var _this3 = this;
2122
2132
  // Clear stored trigger.
2123
- _this5.trigger = null;
2133
+ _this3.trigger = null;
2124
2134
 
2125
2135
  // Remove all entries from the collection.
2126
- return Promise.resolve(_this5.deregisterCollection()).then(function () {
2136
+ return Promise.resolve(_this3.deregisterCollection()).then(function () {
2127
2137
  // If eventListeners are enabled, destroy event listeners.
2128
- if (_this5.settings.eventListeners) {
2129
- _this5.destroyEventListeners();
2138
+ if (_this3.settings.eventListeners) {
2139
+ _this3.destroyEventListeners();
2130
2140
  }
2131
- return _this5;
2141
+ return _this3;
2132
2142
  });
2133
2143
  } catch (e) {
2134
2144
  return Promise.reject(e);
@@ -2168,11 +2178,11 @@
2168
2178
  focus = true;
2169
2179
  }
2170
2180
  try {
2171
- var _this7 = this;
2172
- return Promise.resolve(closeAll$1.call(_this7, exclude, transition)).then(function (result) {
2181
+ var _this4 = this;
2182
+ return Promise.resolve(closeAll$1.call(_this4, exclude, transition)).then(function (result) {
2173
2183
  // Update focus if the focus param is true.
2174
2184
  if (focus) {
2175
- updateFocusState.call(_this7);
2185
+ updateFocusState.call(_this4);
2176
2186
  }
2177
2187
  return result;
2178
2188
  });
@@ -2388,19 +2398,19 @@
2388
2398
 
2389
2399
  var closeAll = function closeAll() {
2390
2400
  try {
2391
- var _this4 = this;
2401
+ var _this2 = this;
2392
2402
  var result = [];
2393
- return Promise.resolve(Promise.all(_this4.collection.map(function (popover) {
2403
+ return Promise.resolve(Promise.all(_this2.collection.map(function (popover) {
2394
2404
  try {
2395
- var _temp4 = function () {
2405
+ var _temp2 = function () {
2396
2406
  if (popover.state === 'opened') {
2397
- var _push2 = result.push;
2398
- return Promise.resolve(close.call(_this4, popover)).then(function (_close$call) {
2399
- _push2.call(result, _close$call);
2407
+ var _push = result.push;
2408
+ return Promise.resolve(close.call(_this2, popover)).then(function (_close$call) {
2409
+ _push.call(result, _close$call);
2400
2410
  });
2401
2411
  }
2402
2412
  }();
2403
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
2413
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
2404
2414
  } catch (e) {
2405
2415
  return Promise.reject(e);
2406
2416
  }
@@ -2413,11 +2423,11 @@
2413
2423
  };
2414
2424
  var close = function close(query) {
2415
2425
  try {
2416
- var _temp2 = function _temp2(popover) {
2426
+ var _temp = function _temp(popover) {
2417
2427
  // If a modal exists and its state is opened.
2418
2428
  if (popover && popover.state === 'opened') {
2419
2429
  // Update state class.
2420
- popover.el.classList.remove(_this2.settings.stateActive);
2430
+ popover.el.classList.remove(_this.settings.stateActive);
2421
2431
 
2422
2432
  // Update accessibility attribute(s).
2423
2433
  if (popover.trigger.hasAttribute('aria-controls')) {
@@ -2436,17 +2446,17 @@
2436
2446
  popover.state = 'closed';
2437
2447
 
2438
2448
  // Clear root trigger if popover trigger matches.
2439
- if (popover.trigger === _this2.trigger) {
2440
- _this2.trigger = null;
2449
+ if (popover.trigger === _this.trigger) {
2450
+ _this.trigger = null;
2441
2451
  }
2442
2452
  }
2443
2453
 
2444
2454
  // Return the popover.
2445
2455
  return popover;
2446
2456
  };
2447
- var _this2 = this;
2457
+ var _this = this;
2448
2458
  // Get the popover from collection.
2449
- return Promise.resolve(query ? _temp2(getPopover.call(_this2, query)) : Promise.resolve(closeAll.call(_this2)).then(_temp2));
2459
+ return Promise.resolve(query ? _temp(getPopover.call(_this, query)) : Promise.resolve(closeAll.call(_this)).then(_temp));
2450
2460
  } catch (e) {
2451
2461
  return Promise.reject(e);
2452
2462
  }
@@ -4322,17 +4332,17 @@
4322
4332
 
4323
4333
  var deregister = function deregister(obj) {
4324
4334
  try {
4325
- var _this2 = this;
4335
+ var _this = this;
4326
4336
  // Return collection if nothing was passed.
4327
- if (!obj) return Promise.resolve(_this2.collection);
4337
+ if (!obj) return Promise.resolve(_this.collection);
4328
4338
 
4329
4339
  // Check if entry has been registered in the collection.
4330
- var index = _this2.collection.findIndex(function (entry) {
4340
+ var index = _this.collection.findIndex(function (entry) {
4331
4341
  return entry.id === obj.id;
4332
4342
  });
4333
4343
  if (index >= 0) {
4334
4344
  // Get the collection entry.
4335
- var entry = _this2.collection[index];
4345
+ var entry = _this.collection[index];
4336
4346
 
4337
4347
  // If entry is in the opened state, close it.
4338
4348
  if (entry.state === 'opened') {
@@ -4351,11 +4361,11 @@
4351
4361
  });
4352
4362
 
4353
4363
  // Remove entry from collection.
4354
- _this2.collection.splice(index, 1);
4364
+ _this.collection.splice(index, 1);
4355
4365
  }
4356
4366
 
4357
4367
  // Return the modified collection.
4358
- return Promise.resolve(_this2.collection);
4368
+ return Promise.resolve(_this.collection);
4359
4369
  } catch (e) {
4360
4370
  return Promise.reject(e);
4361
4371
  }
@@ -4382,12 +4392,12 @@
4382
4392
 
4383
4393
  var open = function open(query) {
4384
4394
  try {
4385
- var _this2 = this;
4395
+ var _this = this;
4386
4396
  // Get the popover from collection.
4387
- var popover = getPopover.call(_this2, query);
4397
+ var popover = getPopover.call(_this, query);
4388
4398
 
4389
4399
  // Update state class.
4390
- popover.el.classList.add(_this2.settings.stateActive);
4400
+ popover.el.classList.add(_this.settings.stateActive);
4391
4401
 
4392
4402
  // Update accessibility attribute(s).
4393
4403
  if (popover.trigger.hasAttribute('aria-controls')) {
@@ -4395,7 +4405,7 @@
4395
4405
  }
4396
4406
 
4397
4407
  // Update popover config.
4398
- popover.config = getConfig(popover.el, _this2.settings);
4408
+ popover.config = getConfig(popover.el, _this.settings);
4399
4409
 
4400
4410
  // Enable popper event listeners and set placement/modifiers.
4401
4411
  popover.popper.setOptions({
@@ -4421,12 +4431,12 @@
4421
4431
 
4422
4432
  var register = function register(el, trigger) {
4423
4433
  try {
4424
- var _this2 = this;
4434
+ var _this = this;
4425
4435
  // Deregister entry incase it has already been registered.
4426
- deregister.call(_this2, el);
4436
+ deregister.call(_this, el);
4427
4437
 
4428
4438
  // Save root this for use inside methods API.
4429
- var root = _this2;
4439
+ var root = _this;
4430
4440
 
4431
4441
  // Setup methods API.
4432
4442
  var methods = {
@@ -4448,7 +4458,7 @@
4448
4458
  el: el,
4449
4459
  trigger: trigger,
4450
4460
  popper: createPopper(trigger, el),
4451
- config: getConfig(el, _this2.settings)
4461
+ config: getConfig(el, _this.settings)
4452
4462
  }, methods);
4453
4463
 
4454
4464
  // Set aria-expanded to false if trigger has aria-controls attribute.
@@ -4457,20 +4467,20 @@
4457
4467
  }
4458
4468
 
4459
4469
  // Setup event listeners.
4460
- registerEventListeners.call(_this2, entry);
4470
+ registerEventListeners.call(_this, entry);
4461
4471
 
4462
4472
  // Add entry to collection.
4463
- _this2.collection.push(entry);
4473
+ _this.collection.push(entry);
4464
4474
 
4465
4475
  // Set initial state.
4466
- var _temp2 = function () {
4467
- if (entry.el.classList.contains(_this2.settings.stateActive)) {
4476
+ var _temp = function () {
4477
+ if (entry.el.classList.contains(_this.settings.stateActive)) {
4468
4478
  return Promise.resolve(entry.open()).then(function () {
4469
- handleDocumentClick.call(_this2, entry);
4479
+ handleDocumentClick.call(_this, entry);
4470
4480
  });
4471
4481
  }
4472
4482
  }();
4473
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {
4483
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {
4474
4484
  // Return the registered entry.
4475
4485
  return entry;
4476
4486
  }) : entry);
@@ -4551,22 +4561,22 @@
4551
4561
  var _proto = Popover.prototype;
4552
4562
  _proto.init = function init(options) {
4553
4563
  try {
4554
- var _this3 = this;
4564
+ var _this2 = this;
4555
4565
  // Update settings with passed options.
4556
- if (options) _this3.settings = _extends({}, _this3.settings, options);
4566
+ if (options) _this2.settings = _extends({}, _this2.settings, options);
4557
4567
 
4558
4568
  // Get all the popovers.
4559
- var popovers = document.querySelectorAll(_this3.settings.selectorPopover);
4569
+ var popovers = document.querySelectorAll(_this2.settings.selectorPopover);
4560
4570
 
4561
4571
  // Register the collections array with popover instances.
4562
- return Promise.resolve(_this3.registerCollection(popovers)).then(function () {
4572
+ return Promise.resolve(_this2.registerCollection(popovers)).then(function () {
4563
4573
  // If eventListeners are enabled, init event listeners.
4564
- if (_this3.settings.eventListeners) {
4574
+ if (_this2.settings.eventListeners) {
4565
4575
  // Pass false to initEventListeners() since registerCollection()
4566
4576
  // already adds event listeners to popovers.
4567
- _this3.initEventListeners(false);
4577
+ _this2.initEventListeners(false);
4568
4578
  }
4569
- return _this3;
4579
+ return _this2;
4570
4580
  });
4571
4581
  } catch (e) {
4572
4582
  return Promise.reject(e);
@@ -4574,33 +4584,33 @@
4574
4584
  };
4575
4585
  _proto.destroy = function destroy() {
4576
4586
  try {
4577
- var _this5 = this;
4587
+ var _this3 = this;
4578
4588
  // Clear stored trigger.
4579
- _this5.trigger = null;
4589
+ _this3.trigger = null;
4580
4590
 
4581
4591
  // Remove all entries from the collection.
4582
- return Promise.resolve(_this5.deregisterCollection()).then(function () {
4592
+ return Promise.resolve(_this3.deregisterCollection()).then(function () {
4583
4593
  // If eventListeners are enabled, destroy event listeners.
4584
- if (_this5.settings.eventListeners) {
4594
+ if (_this3.settings.eventListeners) {
4585
4595
  // Pass false to destroyEventListeners() since deregisterCollection()
4586
4596
  // already removes event listeners from popovers.
4587
- _this5.destroyEventListeners(false);
4597
+ _this3.destroyEventListeners(false);
4588
4598
  }
4589
- return _this5;
4599
+ return _this3;
4590
4600
  });
4591
4601
  } catch (e) {
4592
4602
  return Promise.reject(e);
4593
4603
  }
4594
4604
  };
4595
4605
  _proto.initEventListeners = function initEventListeners(processCollection) {
4596
- var _this6 = this;
4606
+ var _this4 = this;
4597
4607
  if (processCollection === void 0) {
4598
4608
  processCollection = true;
4599
4609
  }
4600
4610
  if (processCollection) {
4601
4611
  // Loop through collection and setup event listeners.
4602
4612
  this.collection.forEach(function (popover) {
4603
- registerEventListeners.call(_this6, popover);
4613
+ registerEventListeners.call(_this4, popover);
4604
4614
  });
4605
4615
  }
4606
4616