@dso-toolkit/core 35.0.0 → 36.2.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.
Files changed (154) hide show
  1. package/dist/cjs/dso-alert.cjs.entry.js +1 -1
  2. package/dist/cjs/dso-attachments-counter.cjs.entry.js +1 -1
  3. package/dist/cjs/dso-autosuggest.cjs.entry.js +2 -2
  4. package/dist/cjs/dso-badge.cjs.entry.js +1 -1
  5. package/dist/cjs/dso-banner.cjs.entry.js +1 -1
  6. package/dist/cjs/dso-date-picker.cjs.entry.js +21 -12
  7. package/dist/cjs/dso-dropdown-menu.cjs.entry.js +3 -3
  8. package/dist/cjs/dso-header.cjs.entry.js +16 -7
  9. package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +1 -1
  10. package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
  11. package/dist/cjs/dso-icon.cjs.entry.js +1 -1
  12. package/dist/cjs/dso-image-overlay.cjs.entry.js +4 -4
  13. package/dist/cjs/dso-info-button.cjs.entry.js +1 -1
  14. package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
  15. package/dist/cjs/dso-label.cjs.entry.js +1 -1
  16. package/dist/cjs/dso-map-base-layers.cjs.entry.js +1 -1
  17. package/dist/cjs/dso-map-controls.cjs.entry.js +22 -19
  18. package/dist/cjs/dso-map-overlays.cjs.entry.js +1 -1
  19. package/dist/cjs/dso-ozon-content.cjs.entry.js +36 -24
  20. package/dist/cjs/dso-progress-bar.cjs.entry.js +1 -1
  21. package/dist/cjs/dso-progress-indicator.cjs.entry.js +1 -1
  22. package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
  23. package/dist/cjs/dso-toolkit.cjs.js +3 -3
  24. package/dist/cjs/dso-tooltip.cjs.entry.js +8 -4
  25. package/dist/cjs/dso-tree-view.cjs.entry.js +9 -9
  26. package/dist/cjs/dso-viewer-grid.cjs.entry.js +4 -4
  27. package/dist/cjs/{focus-trap.esm-8d3e3fb6.js → focus-trap.esm-a85643b0.js} +102 -68
  28. package/dist/cjs/{index-5ea63531.js → index-0a7c679a.js} +73 -67
  29. package/dist/cjs/index.esm-3520a2a6.js +427 -0
  30. package/dist/cjs/loader.cjs.js +3 -3
  31. package/dist/collection/collection-manifest.json +2 -2
  32. package/dist/collection/components/alert/alert.template.js +1 -1
  33. package/dist/collection/components/anchor/anchor.template.js +1 -1
  34. package/dist/collection/components/autosuggest/autosuggest.css +1 -1
  35. package/dist/collection/components/badge/badge.template.js +1 -1
  36. package/dist/collection/components/button/button.template.js +1 -1
  37. package/dist/collection/components/date-picker/date-picker.css +9 -6
  38. package/dist/collection/components/date-picker/date-picker.js +21 -11
  39. package/dist/collection/components/date-picker/date-picker.template.js +1 -1
  40. package/dist/collection/components/definition-list/definition-list.template.js +2 -2
  41. package/dist/collection/components/dropdown-menu/dropdown-menu.js +1 -1
  42. package/dist/collection/components/dropdown-menu/dropdown-menu.template.js +1 -1
  43. package/dist/collection/components/header/header.css +1 -1
  44. package/dist/collection/components/header/header.js +38 -9
  45. package/dist/collection/components/header/header.template.js +4 -2
  46. package/dist/collection/components/helpcenter-panel/helpcenter-panel.template.js +2 -2
  47. package/dist/collection/components/highlight-box/highlight-box.template.js +2 -2
  48. package/dist/collection/components/icon/icon.template.js +1 -1
  49. package/dist/collection/components/image-overlay/image-overlay.css +1 -1
  50. package/dist/collection/components/label/label.template.js +2 -2
  51. package/dist/collection/components/list/list.template.js +1 -1
  52. package/dist/collection/components/map-controls/map-controls.js +17 -19
  53. package/dist/collection/components/ozon-content/get-node-name.function.js +9 -0
  54. package/dist/collection/components/ozon-content/nodes/al.node.js +2 -1
  55. package/dist/collection/components/ozon-content/nodes/fallback.node.js +2 -1
  56. package/dist/collection/components/ozon-content/nodes/noot.node.js +15 -15
  57. package/dist/collection/components/ozon-content/ozon-content-mapper.js +9 -5
  58. package/dist/collection/components/ozon-content/ozon-content.css +76 -23
  59. package/dist/collection/components/progress-bar/progress-bar.template.js +1 -1
  60. package/dist/collection/components/progress-indicator/progress-indicator.template.js +1 -1
  61. package/dist/collection/components/selectable/selectable.css +7 -1
  62. package/dist/collection/components/selectable/selectable.template.js +1 -1
  63. package/dist/collection/components/toggletip/toggletip.template.js +2 -2
  64. package/dist/collection/components/tooltip/tooltip.css +1 -1
  65. package/dist/collection/components/tooltip/tooltip.template.js +1 -1
  66. package/dist/collection/components/tree-view/tree-item.js +7 -7
  67. package/dist/collection/components/tree-view/tree-view.css +86 -15
  68. package/dist/collection/components/viewer-grid/viewer-grid.css +2 -2
  69. package/dist/custom-elements/index.js +460 -229
  70. package/dist/dso-toolkit/dso-toolkit.css +1 -1
  71. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  72. package/dist/dso-toolkit/{p-5037944e.entry.js → p-121c3588.entry.js} +1 -1
  73. package/dist/dso-toolkit/p-131d54e3.js +5 -0
  74. package/dist/dso-toolkit/p-1a3db1cd.entry.js +1 -0
  75. package/dist/dso-toolkit/p-1fd3d18d.entry.js +1 -0
  76. package/dist/dso-toolkit/{p-ad540748.entry.js → p-2a611af3.entry.js} +1 -1
  77. package/dist/dso-toolkit/{p-2b6a3dfa.entry.js → p-3cb44a36.entry.js} +1 -1
  78. package/dist/dso-toolkit/{p-1fefbf8c.entry.js → p-4f904355.entry.js} +1 -1
  79. package/dist/dso-toolkit/p-5e5fbd41.js +5 -0
  80. package/dist/dso-toolkit/{p-4e573fc5.entry.js → p-5e614420.entry.js} +1 -1
  81. package/dist/dso-toolkit/p-72e47943.entry.js +1 -0
  82. package/dist/dso-toolkit/{p-50b63cf4.entry.js → p-746d70f9.entry.js} +1 -1
  83. package/dist/dso-toolkit/p-7abe091d.entry.js +1 -0
  84. package/dist/dso-toolkit/p-7b67e324.entry.js +1 -0
  85. package/dist/dso-toolkit/{p-3c4dbd89.entry.js → p-8bb8148f.entry.js} +1 -1
  86. package/dist/dso-toolkit/p-a58b3108.entry.js +1 -0
  87. package/dist/dso-toolkit/{p-225bbb28.entry.js → p-abd32847.entry.js} +1 -1
  88. package/dist/dso-toolkit/{p-c6f467b3.entry.js → p-af8a4337.entry.js} +1 -1
  89. package/dist/dso-toolkit/{p-348414bf.entry.js → p-b29184e1.entry.js} +1 -1
  90. package/dist/dso-toolkit/{p-bc14cafd.entry.js → p-b86128b3.entry.js} +1 -1
  91. package/dist/dso-toolkit/p-c62606a3.js +1 -0
  92. package/dist/dso-toolkit/{p-f0b67246.entry.js → p-d0d279cc.entry.js} +1 -1
  93. package/dist/dso-toolkit/{p-c95108fe.entry.js → p-d1f62081.entry.js} +1 -1
  94. package/dist/dso-toolkit/{p-3b493a2c.entry.js → p-d6c47662.entry.js} +1 -1
  95. package/dist/dso-toolkit/{p-c54ecae1.entry.js → p-daf049bd.entry.js} +1 -1
  96. package/dist/dso-toolkit/p-e01b1657.entry.js +1 -0
  97. package/dist/dso-toolkit/{p-94dffa65.entry.js → p-ea14647b.entry.js} +1 -1
  98. package/dist/dso-toolkit/{p-dc86d830.entry.js → p-efa4a33d.entry.js} +1 -1
  99. package/dist/dso-toolkit/{p-951f5872.entry.js → p-efb7575f.entry.js} +1 -1
  100. package/dist/esm/dso-alert.entry.js +1 -1
  101. package/dist/esm/dso-attachments-counter.entry.js +1 -1
  102. package/dist/esm/dso-autosuggest.entry.js +2 -2
  103. package/dist/esm/dso-badge.entry.js +1 -1
  104. package/dist/esm/dso-banner.entry.js +1 -1
  105. package/dist/esm/dso-date-picker.entry.js +21 -12
  106. package/dist/esm/dso-dropdown-menu.entry.js +3 -3
  107. package/dist/esm/dso-header.entry.js +16 -7
  108. package/dist/esm/dso-helpcenter-panel.entry.js +1 -1
  109. package/dist/esm/dso-highlight-box.entry.js +1 -1
  110. package/dist/esm/dso-icon.entry.js +1 -1
  111. package/dist/esm/dso-image-overlay.entry.js +4 -4
  112. package/dist/esm/dso-info-button.entry.js +1 -1
  113. package/dist/esm/dso-info_2.entry.js +2 -2
  114. package/dist/esm/dso-label.entry.js +1 -1
  115. package/dist/esm/dso-map-base-layers.entry.js +1 -1
  116. package/dist/esm/dso-map-controls.entry.js +22 -19
  117. package/dist/esm/dso-map-overlays.entry.js +1 -1
  118. package/dist/esm/dso-ozon-content.entry.js +36 -24
  119. package/dist/esm/dso-progress-bar.entry.js +1 -1
  120. package/dist/esm/dso-progress-indicator.entry.js +1 -1
  121. package/dist/esm/dso-toggletip.entry.js +1 -1
  122. package/dist/esm/dso-toolkit.js +3 -3
  123. package/dist/esm/dso-tooltip.entry.js +8 -4
  124. package/dist/esm/dso-tree-view.entry.js +9 -9
  125. package/dist/esm/dso-viewer-grid.entry.js +4 -4
  126. package/dist/esm/{focus-trap.esm-299989f2.js → focus-trap.esm-a01ad6c9.js} +102 -68
  127. package/dist/esm/{index-d54cae76.js → index-1602fde1.js} +73 -67
  128. package/dist/esm/index.esm-45465af7.js +422 -0
  129. package/dist/esm/loader.js +3 -3
  130. package/dist/types/components/date-picker/date-picker.d.ts +2 -0
  131. package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +1 -1
  132. package/dist/types/components/header/header.d.ts +7 -1
  133. package/dist/types/components/header/header.template.d.ts +1 -1
  134. package/dist/types/components/ozon-content/get-node-name.function.d.ts +1 -0
  135. package/dist/types/components/ozon-content/nodes/noot.node.d.ts +2 -2
  136. package/dist/types/components/ozon-content/ozon-content-mapper.d.ts +0 -1
  137. package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +0 -1
  138. package/dist/types/components/ozon-content/ozon-content-node.interface.d.ts +0 -1
  139. package/dist/types/components/ozon-content/ozon-content.d.ts +0 -1
  140. package/dist/types/components.d.ts +3 -2
  141. package/dist/types/icon/dso-icon-sass-function.d.ts +1 -1
  142. package/package.json +30 -26
  143. package/dist/cjs/index.esm-2ac7081c.js +0 -267
  144. package/dist/dso-toolkit/p-44905fb1.js +0 -5
  145. package/dist/dso-toolkit/p-88bc5873.entry.js +0 -1
  146. package/dist/dso-toolkit/p-8b6e3abc.entry.js +0 -1
  147. package/dist/dso-toolkit/p-8bf3a60e.js +0 -5
  148. package/dist/dso-toolkit/p-94b79e43.entry.js +0 -1
  149. package/dist/dso-toolkit/p-a7306b7b.entry.js +0 -1
  150. package/dist/dso-toolkit/p-ad2210ad.entry.js +0 -1
  151. package/dist/dso-toolkit/p-daa1e29d.entry.js +0 -1
  152. package/dist/dso-toolkit/p-dad72605.js +0 -1
  153. package/dist/dso-toolkit/p-f193c258.entry.js +0 -1
  154. package/dist/esm/index.esm-a1362957.js +0 -262
@@ -1,7 +1,7 @@
1
- import { t as tabbable, f as focusable, i as isTabbable, a as isFocusable } from './index.esm-a1362957.js';
1
+ import { t as tabbable, f as focusable, i as isTabbable, a as isFocusable } from './index.esm-45465af7.js';
2
2
 
3
3
  /*!
4
- * focus-trap 6.7.3
4
+ * focus-trap 6.8.1
5
5
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
6
6
  */
7
7
 
@@ -152,20 +152,28 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
152
152
  }, userOptions);
153
153
 
154
154
  var state = {
155
+ // containers given to createFocusTrap()
155
156
  // @type {Array<HTMLElement>}
156
157
  containers: [],
157
- // list of objects identifying the first and last tabbable nodes in all containers/groups in
158
- // the trap
158
+ // list of objects identifying tabbable nodes in `containers` in the trap
159
159
  // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
160
160
  // is active, but the trap should never get to a state where there isn't at least one group
161
161
  // with at least one tabbable node in it (that would lead to an error condition that would
162
162
  // result in an error being thrown)
163
163
  // @type {Array<{
164
164
  // container: HTMLElement,
165
+ // tabbableNodes: Array<HTMLElement>, // empty if none
166
+ // focusableNodes: Array<HTMLElement>, // empty if none
165
167
  // firstTabbableNode: HTMLElement|null,
166
168
  // lastTabbableNode: HTMLElement|null,
167
169
  // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
168
170
  // }>}
171
+ containerGroups: [],
172
+ // same order/length as `containers` list
173
+ // references to objects in `containerGroups`, but only those that actually have
174
+ // tabbable nodes in them
175
+ // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
176
+ // the same length
169
177
  tabbableGroups: [],
170
178
  nodeFocusedBeforeActivation: null,
171
179
  mostRecentlyFocusedNode: null,
@@ -177,14 +185,42 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
177
185
  };
178
186
  var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
179
187
 
188
+ /**
189
+ * Gets a configuration option value.
190
+ * @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,
191
+ * value will be taken from this object. Otherwise, value will be taken from base configuration.
192
+ * @param {string} optionName Name of the option whose value is sought.
193
+ * @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
194
+ * IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
195
+ */
196
+
180
197
  var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
181
198
  return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
182
199
  };
200
+ /**
201
+ * Finds the index of the container that contains the element.
202
+ * @param {HTMLElement} element
203
+ * @returns {number} Index of the container in either `state.containers` or
204
+ * `state.containerGroups` (the order/length of these lists are the same); -1
205
+ * if the element isn't found.
206
+ */
207
+
183
208
 
184
- var containersContain = function containersContain(element) {
185
- return !!(element && state.containers.some(function (container) {
186
- return container.contains(element);
187
- }));
209
+ var findContainerIndex = function findContainerIndex(element) {
210
+ // NOTE: search `containerGroups` because it's possible a group contains no tabbable
211
+ // nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
212
+ // and we still need to find the element in there
213
+ return state.containerGroups.findIndex(function (_ref) {
214
+ var container = _ref.container,
215
+ tabbableNodes = _ref.tabbableNodes;
216
+ return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any
217
+ // web components if the `tabbableOptions.getShadowRoot` option was used for
218
+ // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
219
+ // look inside web components even if open)
220
+ tabbableNodes.find(function (node) {
221
+ return node === element;
222
+ });
223
+ });
188
224
  };
189
225
  /**
190
226
  * Gets the node for the given option, which is expected to be an option that
@@ -243,7 +279,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
243
279
 
244
280
  if (node === undefined) {
245
281
  // option not specified: use fallback options
246
- if (containersContain(doc.activeElement)) {
282
+ if (findContainerIndex(doc.activeElement) >= 0) {
247
283
  node = doc.activeElement;
248
284
  } else {
249
285
  var firstTabbableGroup = state.tabbableGroups[0];
@@ -261,60 +297,61 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
261
297
  };
262
298
 
263
299
  var updateTabbableNodes = function updateTabbableNodes() {
264
- state.tabbableGroups = state.containers.map(function (container) {
265
- var tabbableNodes = tabbable(container); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
300
+ state.containerGroups = state.containers.map(function (container) {
301
+ var tabbableNodes = tabbable(container, config.tabbableOptions); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
266
302
  // are a superset of tabbable nodes
267
303
 
268
- var focusableNodes = focusable(container);
269
-
270
- if (tabbableNodes.length > 0) {
271
- return {
272
- container: container,
273
- firstTabbableNode: tabbableNodes[0],
274
- lastTabbableNode: tabbableNodes[tabbableNodes.length - 1],
275
-
276
- /**
277
- * Finds the __tabbable__ node that follows the given node in the specified direction,
278
- * in this container, if any.
279
- * @param {HTMLElement} node
280
- * @param {boolean} [forward] True if going in forward tab order; false if going
281
- * in reverse.
282
- * @returns {HTMLElement|undefined} The next tabbable node, if any.
283
- */
284
- nextTabbableNode: function nextTabbableNode(node) {
285
- var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
286
- // NOTE: If tabindex is positive (in order to manipulate the tab order separate
287
- // from the DOM order), this __will not work__ because the list of focusableNodes,
288
- // while it contains tabbable nodes, does not sort its nodes in any order other
289
- // than DOM order, because it can't: Where would you place focusable (but not
290
- // tabbable) nodes in that order? They have no order, because they aren't tabbale...
291
- // Support for positive tabindex is already broken and hard to manage (possibly
292
- // not supportable, TBD), so this isn't going to make things worse than they
293
- // already are, and at least makes things better for the majority of cases where
294
- // tabindex is either 0/unset or negative.
295
- // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
296
- var nodeIdx = focusableNodes.findIndex(function (n) {
297
- return n === node;
298
- });
299
-
300
- if (forward) {
301
- return focusableNodes.slice(nodeIdx + 1).find(function (n) {
302
- return isTabbable(n);
303
- });
304
- }
304
+ var focusableNodes = focusable(container, config.tabbableOptions);
305
+ return {
306
+ container: container,
307
+ tabbableNodes: tabbableNodes,
308
+ focusableNodes: focusableNodes,
309
+ firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
310
+ lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
311
+
312
+ /**
313
+ * Finds the __tabbable__ node that follows the given node in the specified direction,
314
+ * in this container, if any.
315
+ * @param {HTMLElement} node
316
+ * @param {boolean} [forward] True if going in forward tab order; false if going
317
+ * in reverse.
318
+ * @returns {HTMLElement|undefined} The next tabbable node, if any.
319
+ */
320
+ nextTabbableNode: function nextTabbableNode(node) {
321
+ var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
322
+ // NOTE: If tabindex is positive (in order to manipulate the tab order separate
323
+ // from the DOM order), this __will not work__ because the list of focusableNodes,
324
+ // while it contains tabbable nodes, does not sort its nodes in any order other
325
+ // than DOM order, because it can't: Where would you place focusable (but not
326
+ // tabbable) nodes in that order? They have no order, because they aren't tabbale...
327
+ // Support for positive tabindex is already broken and hard to manage (possibly
328
+ // not supportable, TBD), so this isn't going to make things worse than they
329
+ // already are, and at least makes things better for the majority of cases where
330
+ // tabindex is either 0/unset or negative.
331
+ // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
332
+ var nodeIdx = focusableNodes.findIndex(function (n) {
333
+ return n === node;
334
+ });
335
+
336
+ if (nodeIdx < 0) {
337
+ return undefined;
338
+ }
305
339
 
306
- return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
307
- return isTabbable(n);
340
+ if (forward) {
341
+ return focusableNodes.slice(nodeIdx + 1).find(function (n) {
342
+ return isTabbable(n, config.tabbableOptions);
308
343
  });
309
344
  }
310
- };
311
- }
312
345
 
313
- return undefined;
314
- }).filter(function (group) {
315
- return !!group;
316
- }); // remove groups with no tabbable nodes
317
- // throw if no groups have tabbable nodes and we don't have a fallback focus node either
346
+ return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
347
+ return isTabbable(n, config.tabbableOptions);
348
+ });
349
+ }
350
+ };
351
+ });
352
+ state.tabbableGroups = state.containerGroups.filter(function (group) {
353
+ return group.tabbableNodes.length > 0;
354
+ }); // throw if no groups have tabbable nodes and we don't have a fallback focus node either
318
355
 
319
356
  if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
320
357
  ) {
@@ -356,7 +393,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
356
393
  var checkPointerDown = function checkPointerDown(e) {
357
394
  var target = getActualTarget(e);
358
395
 
359
- if (containersContain(target)) {
396
+ if (findContainerIndex(target) >= 0) {
360
397
  // allow the click since it ocurred inside the trap
361
398
  return;
362
399
  }
@@ -375,7 +412,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
375
412
  // that was clicked, whether it's focusable or not; by setting
376
413
  // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
377
414
  // on activation (or the configured `setReturnFocus` node)
378
- returnFocus: config.returnFocusOnDeactivate && !isFocusable(target)
415
+ returnFocus: config.returnFocusOnDeactivate && !isFocusable(target, config.tabbableOptions)
379
416
  });
380
417
  return;
381
418
  } // This is needed for mobile devices.
@@ -395,7 +432,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
395
432
 
396
433
  var checkFocusIn = function checkFocusIn(e) {
397
434
  var target = getActualTarget(e);
398
- var targetContained = containersContain(target); // In Firefox when you Tab out of an iframe the Document is briefly focused.
435
+ var targetContained = findContainerIndex(target) >= 0; // In Firefox when you Tab out of an iframe the Document is briefly focused.
399
436
 
400
437
  if (targetContained || target instanceof Document) {
401
438
  if (targetContained) {
@@ -421,11 +458,8 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
421
458
  // make sure the target is actually contained in a group
422
459
  // NOTE: the target may also be the container itself if it's focusable
423
460
  // with tabIndex='-1' and was given initial focus
424
- var containerIndex = findIndex(state.tabbableGroups, function (_ref) {
425
- var container = _ref.container;
426
- return container.contains(target);
427
- });
428
- var containerGroup = containerIndex >= 0 ? state.tabbableGroups[containerIndex] : undefined;
461
+ var containerIndex = findContainerIndex(target);
462
+ var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
429
463
 
430
464
  if (containerIndex < 0) {
431
465
  // target not found in any group: quite possible focus has escaped the trap,
@@ -445,7 +479,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
445
479
  return target === firstTabbableNode;
446
480
  });
447
481
 
448
- if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target) && !isTabbable(target) && !containerGroup.nextTabbableNode(target, false))) {
482
+ if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
449
483
  // an exception case where the target is either the container itself, or
450
484
  // a non-tabbable node that was given focus (i.e. tabindex is negative
451
485
  // and user clicked on it or node was programmatically given focus)
@@ -471,7 +505,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
471
505
  return target === lastTabbableNode;
472
506
  });
473
507
 
474
- if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target) && !isTabbable(target) && !containerGroup.nextTabbableNode(target))) {
508
+ if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
475
509
  // an exception case where the target is the container itself, or
476
510
  // a non-tabbable node that was given focus (i.e. tabindex is negative
477
511
  // and user clicked on it or node was programmatically given focus)
@@ -523,7 +557,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
523
557
 
524
558
  var target = getActualTarget(e);
525
559
 
526
- if (containersContain(target)) {
560
+ if (findContainerIndex(target) >= 0) {
527
561
  return;
528
562
  }
529
563
 
@@ -410,7 +410,6 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
410
410
  // Workaround for Safari, moving the <input> caret when re-assigning the same valued
411
411
  if (memberName === 'list') {
412
412
  isProp = false;
413
- // tslint:disable-next-line: triple-equals
414
413
  }
415
414
  else if (oldValue == null || elm[memberName] != n) {
416
415
  elm[memberName] = n;
@@ -1116,9 +1115,6 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
1116
1115
  promise = safeCall(instance, 'componentWillLoad');
1117
1116
  }
1118
1117
  }
1119
- {
1120
- promise = then(promise, () => safeCall(instance, 'componentWillRender'));
1121
- }
1122
1118
  endSchedule();
1123
1119
  return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
1124
1120
  };
@@ -1579,14 +1575,14 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1579
1575
  prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1580
1576
  plt.jmp(() => {
1581
1577
  const propName = attrNameToPropName.get(attrName);
1582
- // In a webcomponent lifecyle the attributeChangedCallback runs prior to connectedCallback
1578
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1583
1579
  // in the case where an attribute was set inline.
1584
1580
  // ```html
1585
1581
  // <my-component some-attribute="some-value"></my-component>
1586
1582
  // ```
1587
1583
  //
1588
- // There is an edge case where a developer sets the attribute inline on a custom element and then programatically
1589
- // changes it before it has been upgraded as shown below:
1584
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
1585
+ // programmatically changes it before it has been upgraded as shown below:
1590
1586
  //
1591
1587
  // ```html
1592
1588
  // <!-- this component has _not_ been upgraded yet -->
@@ -1596,13 +1592,13 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1596
1592
  // el = document.querySelector("#test");
1597
1593
  // el.someAttribute = "another-value";
1598
1594
  // // upgrade component
1599
- // cutsomElements.define('my-component', MyComponent);
1595
+ // customElements.define('my-component', MyComponent);
1600
1596
  // </script>
1601
1597
  // ```
1602
1598
  // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
1603
1599
  // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1604
1600
  // to the value that was set inline i.e. "some-value" from above example. When
1605
- // the connectedCallback attempts to unshadow it will use "some-value" as the intial value rather than "another-value"
1601
+ // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
1606
1602
  //
1607
1603
  // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
1608
1604
  // by connectedCallback as this attributeChangedCallback will not fire.
@@ -1616,6 +1612,14 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1616
1612
  newValue = this[propName];
1617
1613
  delete this[propName];
1618
1614
  }
1615
+ else if (prototype.hasOwnProperty(propName) &&
1616
+ typeof this[propName] === 'number' &&
1617
+ this[propName] == newValue) {
1618
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1619
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1620
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1621
+ return;
1622
+ }
1619
1623
  this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1620
1624
  });
1621
1625
  };
@@ -1702,7 +1706,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1702
1706
  const ancestorComponent = hostRef.$ancestorComponent$;
1703
1707
  const schedule = () => scheduleUpdate(hostRef, true);
1704
1708
  if (ancestorComponent && ancestorComponent['s-rc']) {
1705
- // this is the intial load and this component it has an ancestor component
1709
+ // this is the initial load and this component it has an ancestor component
1706
1710
  // but the ancestor component has NOT fired its will update lifecycle yet
1707
1711
  // so let's just cool our jets and wait for the ancestor to continue first
1708
1712
  // this will get fired off when the ancestor component
@@ -1842,71 +1846,73 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1842
1846
  registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
1843
1847
  }
1844
1848
  }
1845
- lazyBundles.map((lazyBundle) => lazyBundle[1].map((compactMeta) => {
1846
- const cmpMeta = {
1847
- $flags$: compactMeta[0],
1848
- $tagName$: compactMeta[1],
1849
- $members$: compactMeta[2],
1850
- $listeners$: compactMeta[3],
1851
- };
1852
- {
1853
- cmpMeta.$members$ = compactMeta[2];
1854
- }
1855
- {
1856
- cmpMeta.$listeners$ = compactMeta[3];
1857
- }
1858
- {
1859
- cmpMeta.$attrsToReflect$ = [];
1860
- }
1861
- {
1862
- cmpMeta.$watchers$ = {};
1863
- }
1864
- const tagName = cmpMeta.$tagName$;
1865
- const HostElement = class extends HTMLElement {
1866
- // StencilLazyHost
1867
- constructor(self) {
1868
- // @ts-ignore
1869
- super(self);
1870
- self = this;
1871
- registerHost(self, cmpMeta);
1872
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1873
- // this component is using shadow dom
1874
- // and this browser supports shadow dom
1875
- // add the read-only property "shadowRoot" to the host element
1876
- // adding the shadow root build conditionals to minimize runtime
1877
- {
1849
+ lazyBundles.map((lazyBundle) => {
1850
+ lazyBundle[1].map((compactMeta) => {
1851
+ const cmpMeta = {
1852
+ $flags$: compactMeta[0],
1853
+ $tagName$: compactMeta[1],
1854
+ $members$: compactMeta[2],
1855
+ $listeners$: compactMeta[3],
1856
+ };
1857
+ {
1858
+ cmpMeta.$members$ = compactMeta[2];
1859
+ }
1860
+ {
1861
+ cmpMeta.$listeners$ = compactMeta[3];
1862
+ }
1863
+ {
1864
+ cmpMeta.$attrsToReflect$ = [];
1865
+ }
1866
+ {
1867
+ cmpMeta.$watchers$ = {};
1868
+ }
1869
+ const tagName = cmpMeta.$tagName$;
1870
+ const HostElement = class extends HTMLElement {
1871
+ // StencilLazyHost
1872
+ constructor(self) {
1873
+ // @ts-ignore
1874
+ super(self);
1875
+ self = this;
1876
+ registerHost(self, cmpMeta);
1877
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1878
+ // this component is using shadow dom
1879
+ // and this browser supports shadow dom
1880
+ // add the read-only property "shadowRoot" to the host element
1881
+ // adding the shadow root build conditionals to minimize runtime
1878
1882
  {
1879
- self.attachShadow({ mode: 'open' });
1883
+ {
1884
+ self.attachShadow({ mode: 'open' });
1885
+ }
1880
1886
  }
1881
1887
  }
1882
1888
  }
1883
- }
1884
- connectedCallback() {
1885
- if (appLoadFallback) {
1886
- clearTimeout(appLoadFallback);
1887
- appLoadFallback = null;
1889
+ connectedCallback() {
1890
+ if (appLoadFallback) {
1891
+ clearTimeout(appLoadFallback);
1892
+ appLoadFallback = null;
1893
+ }
1894
+ if (isBootstrapping) {
1895
+ // connectedCallback will be processed once all components have been registered
1896
+ deferredConnectedCallbacks.push(this);
1897
+ }
1898
+ else {
1899
+ plt.jmp(() => connectedCallback(this));
1900
+ }
1888
1901
  }
1889
- if (isBootstrapping) {
1890
- // connectedCallback will be processed once all components have been registered
1891
- deferredConnectedCallbacks.push(this);
1902
+ disconnectedCallback() {
1903
+ plt.jmp(() => disconnectedCallback(this));
1892
1904
  }
1893
- else {
1894
- plt.jmp(() => connectedCallback(this));
1905
+ componentOnReady() {
1906
+ return getHostRef(this).$onReadyPromise$;
1895
1907
  }
1908
+ };
1909
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
1910
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1911
+ cmpTags.push(tagName);
1912
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1896
1913
  }
1897
- disconnectedCallback() {
1898
- plt.jmp(() => disconnectedCallback(this));
1899
- }
1900
- componentOnReady() {
1901
- return getHostRef(this).$onReadyPromise$;
1902
- }
1903
- };
1904
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
1905
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1906
- cmpTags.push(tagName);
1907
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1908
- }
1909
- }));
1914
+ });
1915
+ });
1910
1916
  {
1911
1917
  visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1912
1918
  visibilityStyle.setAttribute('data-styles', '');