@dso-toolkit/core 35.0.0 → 36.0.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/dist/cjs/dso-alert.cjs.entry.js +1 -1
- package/dist/cjs/dso-attachments-counter.cjs.entry.js +1 -1
- package/dist/cjs/dso-autosuggest.cjs.entry.js +2 -2
- package/dist/cjs/dso-badge.cjs.entry.js +1 -1
- package/dist/cjs/dso-banner.cjs.entry.js +1 -1
- package/dist/cjs/dso-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +2 -2
- package/dist/cjs/dso-header.cjs.entry.js +16 -7
- package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +1 -1
- package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
- package/dist/cjs/dso-icon.cjs.entry.js +1 -1
- package/dist/cjs/dso-image-overlay.cjs.entry.js +4 -4
- package/dist/cjs/dso-info-button.cjs.entry.js +1 -1
- package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
- package/dist/cjs/dso-label.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-base-layers.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-controls.cjs.entry.js +22 -19
- package/dist/cjs/dso-map-overlays.cjs.entry.js +1 -1
- package/dist/cjs/dso-ozon-content.cjs.entry.js +36 -24
- package/dist/cjs/dso-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/dso-progress-indicator.cjs.entry.js +1 -1
- package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +2 -2
- package/dist/cjs/dso-tooltip.cjs.entry.js +8 -4
- package/dist/cjs/dso-tree-view.cjs.entry.js +9 -9
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +4 -4
- package/dist/cjs/{focus-trap.esm-8d3e3fb6.js → focus-trap.esm-a85643b0.js} +102 -68
- package/dist/cjs/{index-5ea63531.js → index-dfb4ea62.js} +73 -64
- package/dist/cjs/index.esm-3520a2a6.js +427 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/alert/alert.template.js +1 -1
- package/dist/collection/components/anchor/anchor.template.js +1 -1
- package/dist/collection/components/autosuggest/autosuggest.css +1 -1
- package/dist/collection/components/badge/badge.template.js +1 -1
- package/dist/collection/components/button/button.template.js +1 -1
- package/dist/collection/components/date-picker/date-picker.css +6 -6
- package/dist/collection/components/date-picker/date-picker.template.js +1 -1
- package/dist/collection/components/definition-list/definition-list.template.js +2 -2
- package/dist/collection/components/dropdown-menu/dropdown-menu.template.js +1 -1
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/header/header.js +38 -9
- package/dist/collection/components/header/header.template.js +4 -2
- package/dist/collection/components/helpcenter-panel/helpcenter-panel.template.js +2 -2
- package/dist/collection/components/highlight-box/highlight-box.template.js +2 -2
- package/dist/collection/components/icon/icon.template.js +1 -1
- package/dist/collection/components/image-overlay/image-overlay.css +1 -1
- package/dist/collection/components/label/label.template.js +2 -2
- package/dist/collection/components/list/list.template.js +1 -1
- package/dist/collection/components/map-controls/map-controls.js +17 -19
- package/dist/collection/components/ozon-content/get-node-name.function.js +9 -0
- package/dist/collection/components/ozon-content/nodes/al.node.js +2 -1
- package/dist/collection/components/ozon-content/nodes/fallback.node.js +2 -1
- package/dist/collection/components/ozon-content/nodes/noot.node.js +15 -15
- package/dist/collection/components/ozon-content/ozon-content-mapper.js +9 -5
- package/dist/collection/components/ozon-content/ozon-content.css +76 -23
- package/dist/collection/components/progress-bar/progress-bar.template.js +1 -1
- package/dist/collection/components/progress-indicator/progress-indicator.template.js +1 -1
- package/dist/collection/components/selectable/selectable.css +7 -1
- package/dist/collection/components/selectable/selectable.template.js +1 -1
- package/dist/collection/components/toggletip/toggletip.template.js +2 -2
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/components/tooltip/tooltip.template.js +1 -1
- package/dist/collection/components/tree-view/tree-item.js +7 -7
- package/dist/collection/components/tree-view/tree-view.css +86 -15
- package/dist/collection/components/viewer-grid/viewer-grid.css +2 -2
- package/dist/custom-elements/index.js +438 -216
- package/dist/dso-toolkit/dso-toolkit.css +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-016ed5a8.entry.js +1 -0
- package/dist/dso-toolkit/{p-c6f467b3.entry.js → p-0216f283.entry.js} +1 -1
- package/dist/dso-toolkit/{p-348414bf.entry.js → p-09bcacd0.entry.js} +1 -1
- package/dist/dso-toolkit/{p-2b6a3dfa.entry.js → p-117a31fe.entry.js} +1 -1
- package/dist/dso-toolkit/p-131d54e3.js +5 -0
- package/dist/dso-toolkit/{p-50b63cf4.entry.js → p-1eeadd3e.entry.js} +1 -1
- package/dist/dso-toolkit/{p-ad540748.entry.js → p-2279329b.entry.js} +1 -1
- package/dist/dso-toolkit/p-258e8371.entry.js +1 -0
- package/dist/dso-toolkit/{p-bc14cafd.entry.js → p-3ced438e.entry.js} +1 -1
- package/dist/dso-toolkit/{p-c54ecae1.entry.js → p-406b179d.entry.js} +1 -1
- package/dist/dso-toolkit/{p-225bbb28.entry.js → p-4b5f6b4c.entry.js} +1 -1
- package/dist/dso-toolkit/{p-3b493a2c.entry.js → p-527a85b6.entry.js} +1 -1
- package/dist/dso-toolkit/{p-94dffa65.entry.js → p-52f159e7.entry.js} +1 -1
- package/dist/dso-toolkit/{p-dc86d830.entry.js → p-58f5e092.entry.js} +1 -1
- package/dist/dso-toolkit/p-5e5fbd41.js +5 -0
- package/dist/dso-toolkit/{p-f0b67246.entry.js → p-639228f6.entry.js} +1 -1
- package/dist/dso-toolkit/{p-951f5872.entry.js → p-6a8452bd.entry.js} +1 -1
- package/dist/dso-toolkit/{p-4e573fc5.entry.js → p-98ef5f8c.entry.js} +1 -1
- package/dist/dso-toolkit/{p-94b79e43.entry.js → p-a1c9bb35.entry.js} +1 -1
- package/dist/dso-toolkit/{p-3c4dbd89.entry.js → p-a5008a4e.entry.js} +1 -1
- package/dist/dso-toolkit/{p-c95108fe.entry.js → p-a59dcbb0.entry.js} +1 -1
- package/dist/dso-toolkit/p-b06c275a.entry.js +1 -0
- package/dist/dso-toolkit/p-b4222d6e.entry.js +1 -0
- package/dist/dso-toolkit/{p-dad72605.js → p-b9eb3491.js} +1 -1
- package/dist/dso-toolkit/p-bec38cf5.entry.js +1 -0
- package/dist/dso-toolkit/{p-ad2210ad.entry.js → p-d0d3ca99.entry.js} +1 -1
- package/dist/dso-toolkit/{p-5037944e.entry.js → p-d72edd80.entry.js} +1 -1
- package/dist/dso-toolkit/{p-1fefbf8c.entry.js → p-e1934ab6.entry.js} +1 -1
- package/dist/esm/dso-alert.entry.js +1 -1
- package/dist/esm/dso-attachments-counter.entry.js +1 -1
- package/dist/esm/dso-autosuggest.entry.js +2 -2
- package/dist/esm/dso-badge.entry.js +1 -1
- package/dist/esm/dso-banner.entry.js +1 -1
- package/dist/esm/dso-date-picker.entry.js +2 -2
- package/dist/esm/dso-dropdown-menu.entry.js +2 -2
- package/dist/esm/dso-header.entry.js +16 -7
- package/dist/esm/dso-helpcenter-panel.entry.js +1 -1
- package/dist/esm/dso-highlight-box.entry.js +1 -1
- package/dist/esm/dso-icon.entry.js +1 -1
- package/dist/esm/dso-image-overlay.entry.js +4 -4
- package/dist/esm/dso-info-button.entry.js +1 -1
- package/dist/esm/dso-info_2.entry.js +2 -2
- package/dist/esm/dso-label.entry.js +1 -1
- package/dist/esm/dso-map-base-layers.entry.js +1 -1
- package/dist/esm/dso-map-controls.entry.js +22 -19
- package/dist/esm/dso-map-overlays.entry.js +1 -1
- package/dist/esm/dso-ozon-content.entry.js +36 -24
- package/dist/esm/dso-progress-bar.entry.js +1 -1
- package/dist/esm/dso-progress-indicator.entry.js +1 -1
- package/dist/esm/dso-toggletip.entry.js +1 -1
- package/dist/esm/dso-toolkit.js +2 -2
- package/dist/esm/dso-tooltip.entry.js +8 -4
- package/dist/esm/dso-tree-view.entry.js +9 -9
- package/dist/esm/dso-viewer-grid.entry.js +4 -4
- package/dist/esm/{focus-trap.esm-299989f2.js → focus-trap.esm-a01ad6c9.js} +102 -68
- package/dist/esm/{index-d54cae76.js → index-9ec8c07f.js} +73 -64
- package/dist/esm/index.esm-45465af7.js +422 -0
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/header/header.d.ts +7 -1
- package/dist/types/components/header/header.template.d.ts +1 -1
- package/dist/types/components/ozon-content/get-node-name.function.d.ts +1 -0
- package/dist/types/components/ozon-content/nodes/noot.node.d.ts +2 -2
- package/dist/types/components/ozon-content/ozon-content-mapper.d.ts +0 -1
- package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +0 -1
- package/dist/types/components/ozon-content/ozon-content-node.interface.d.ts +0 -1
- package/dist/types/components/ozon-content/ozon-content.d.ts +0 -1
- package/dist/types/components.d.ts +3 -2
- package/dist/types/icon/dso-icon-sass-function.d.ts +1 -1
- package/package.json +28 -26
- package/dist/cjs/index.esm-2ac7081c.js +0 -267
- package/dist/dso-toolkit/p-44905fb1.js +0 -5
- package/dist/dso-toolkit/p-88bc5873.entry.js +0 -1
- package/dist/dso-toolkit/p-8b6e3abc.entry.js +0 -1
- package/dist/dso-toolkit/p-8bf3a60e.js +0 -5
- package/dist/dso-toolkit/p-a7306b7b.entry.js +0 -1
- package/dist/dso-toolkit/p-daa1e29d.entry.js +0 -1
- package/dist/dso-toolkit/p-f193c258.entry.js +0 -1
- package/dist/esm/index.esm-a1362957.js +0 -262
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index_esm = require('./index.esm-
|
|
3
|
+
const index_esm = require('./index.esm-3520a2a6.js');
|
|
4
4
|
|
|
5
5
|
/*!
|
|
6
|
-
* focus-trap 6.
|
|
6
|
+
* focus-trap 6.8.1
|
|
7
7
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -154,20 +154,28 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
154
154
|
}, userOptions);
|
|
155
155
|
|
|
156
156
|
var state = {
|
|
157
|
+
// containers given to createFocusTrap()
|
|
157
158
|
// @type {Array<HTMLElement>}
|
|
158
159
|
containers: [],
|
|
159
|
-
// list of objects identifying
|
|
160
|
-
// the trap
|
|
160
|
+
// list of objects identifying tabbable nodes in `containers` in the trap
|
|
161
161
|
// NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
|
|
162
162
|
// is active, but the trap should never get to a state where there isn't at least one group
|
|
163
163
|
// with at least one tabbable node in it (that would lead to an error condition that would
|
|
164
164
|
// result in an error being thrown)
|
|
165
165
|
// @type {Array<{
|
|
166
166
|
// container: HTMLElement,
|
|
167
|
+
// tabbableNodes: Array<HTMLElement>, // empty if none
|
|
168
|
+
// focusableNodes: Array<HTMLElement>, // empty if none
|
|
167
169
|
// firstTabbableNode: HTMLElement|null,
|
|
168
170
|
// lastTabbableNode: HTMLElement|null,
|
|
169
171
|
// nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
|
|
170
172
|
// }>}
|
|
173
|
+
containerGroups: [],
|
|
174
|
+
// same order/length as `containers` list
|
|
175
|
+
// references to objects in `containerGroups`, but only those that actually have
|
|
176
|
+
// tabbable nodes in them
|
|
177
|
+
// NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
|
|
178
|
+
// the same length
|
|
171
179
|
tabbableGroups: [],
|
|
172
180
|
nodeFocusedBeforeActivation: null,
|
|
173
181
|
mostRecentlyFocusedNode: null,
|
|
@@ -179,14 +187,42 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
179
187
|
};
|
|
180
188
|
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
|
|
181
189
|
|
|
190
|
+
/**
|
|
191
|
+
* Gets a configuration option value.
|
|
192
|
+
* @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,
|
|
193
|
+
* value will be taken from this object. Otherwise, value will be taken from base configuration.
|
|
194
|
+
* @param {string} optionName Name of the option whose value is sought.
|
|
195
|
+
* @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
|
|
196
|
+
* IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
|
|
197
|
+
*/
|
|
198
|
+
|
|
182
199
|
var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
|
|
183
200
|
return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
|
|
184
201
|
};
|
|
202
|
+
/**
|
|
203
|
+
* Finds the index of the container that contains the element.
|
|
204
|
+
* @param {HTMLElement} element
|
|
205
|
+
* @returns {number} Index of the container in either `state.containers` or
|
|
206
|
+
* `state.containerGroups` (the order/length of these lists are the same); -1
|
|
207
|
+
* if the element isn't found.
|
|
208
|
+
*/
|
|
209
|
+
|
|
185
210
|
|
|
186
|
-
var
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
211
|
+
var findContainerIndex = function findContainerIndex(element) {
|
|
212
|
+
// NOTE: search `containerGroups` because it's possible a group contains no tabbable
|
|
213
|
+
// nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
|
|
214
|
+
// and we still need to find the element in there
|
|
215
|
+
return state.containerGroups.findIndex(function (_ref) {
|
|
216
|
+
var container = _ref.container,
|
|
217
|
+
tabbableNodes = _ref.tabbableNodes;
|
|
218
|
+
return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any
|
|
219
|
+
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
220
|
+
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
221
|
+
// look inside web components even if open)
|
|
222
|
+
tabbableNodes.find(function (node) {
|
|
223
|
+
return node === element;
|
|
224
|
+
});
|
|
225
|
+
});
|
|
190
226
|
};
|
|
191
227
|
/**
|
|
192
228
|
* Gets the node for the given option, which is expected to be an option that
|
|
@@ -245,7 +281,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
245
281
|
|
|
246
282
|
if (node === undefined) {
|
|
247
283
|
// option not specified: use fallback options
|
|
248
|
-
if (
|
|
284
|
+
if (findContainerIndex(doc.activeElement) >= 0) {
|
|
249
285
|
node = doc.activeElement;
|
|
250
286
|
} else {
|
|
251
287
|
var firstTabbableGroup = state.tabbableGroups[0];
|
|
@@ -263,60 +299,61 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
263
299
|
};
|
|
264
300
|
|
|
265
301
|
var updateTabbableNodes = function updateTabbableNodes() {
|
|
266
|
-
state.
|
|
267
|
-
var tabbableNodes = index_esm.tabbable(container); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
|
|
302
|
+
state.containerGroups = state.containers.map(function (container) {
|
|
303
|
+
var tabbableNodes = index_esm.tabbable(container, config.tabbableOptions); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
|
|
268
304
|
// are a superset of tabbable nodes
|
|
269
305
|
|
|
270
|
-
var focusableNodes = index_esm.focusable(container);
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
});
|
|
306
|
-
}
|
|
306
|
+
var focusableNodes = index_esm.focusable(container, config.tabbableOptions);
|
|
307
|
+
return {
|
|
308
|
+
container: container,
|
|
309
|
+
tabbableNodes: tabbableNodes,
|
|
310
|
+
focusableNodes: focusableNodes,
|
|
311
|
+
firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
|
|
312
|
+
lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
316
|
+
* in this container, if any.
|
|
317
|
+
* @param {HTMLElement} node
|
|
318
|
+
* @param {boolean} [forward] True if going in forward tab order; false if going
|
|
319
|
+
* in reverse.
|
|
320
|
+
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
|
321
|
+
*/
|
|
322
|
+
nextTabbableNode: function nextTabbableNode(node) {
|
|
323
|
+
var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
324
|
+
// NOTE: If tabindex is positive (in order to manipulate the tab order separate
|
|
325
|
+
// from the DOM order), this __will not work__ because the list of focusableNodes,
|
|
326
|
+
// while it contains tabbable nodes, does not sort its nodes in any order other
|
|
327
|
+
// than DOM order, because it can't: Where would you place focusable (but not
|
|
328
|
+
// tabbable) nodes in that order? They have no order, because they aren't tabbale...
|
|
329
|
+
// Support for positive tabindex is already broken and hard to manage (possibly
|
|
330
|
+
// not supportable, TBD), so this isn't going to make things worse than they
|
|
331
|
+
// already are, and at least makes things better for the majority of cases where
|
|
332
|
+
// tabindex is either 0/unset or negative.
|
|
333
|
+
// FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
|
|
334
|
+
var nodeIdx = focusableNodes.findIndex(function (n) {
|
|
335
|
+
return n === node;
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
if (nodeIdx < 0) {
|
|
339
|
+
return undefined;
|
|
340
|
+
}
|
|
307
341
|
|
|
308
|
-
|
|
309
|
-
|
|
342
|
+
if (forward) {
|
|
343
|
+
return focusableNodes.slice(nodeIdx + 1).find(function (n) {
|
|
344
|
+
return index_esm.isTabbable(n, config.tabbableOptions);
|
|
310
345
|
});
|
|
311
346
|
}
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
347
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
348
|
+
return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
|
|
349
|
+
return index_esm.isTabbable(n, config.tabbableOptions);
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
});
|
|
354
|
+
state.tabbableGroups = state.containerGroups.filter(function (group) {
|
|
355
|
+
return group.tabbableNodes.length > 0;
|
|
356
|
+
}); // throw if no groups have tabbable nodes and we don't have a fallback focus node either
|
|
320
357
|
|
|
321
358
|
if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
|
|
322
359
|
) {
|
|
@@ -358,7 +395,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
358
395
|
var checkPointerDown = function checkPointerDown(e) {
|
|
359
396
|
var target = getActualTarget(e);
|
|
360
397
|
|
|
361
|
-
if (
|
|
398
|
+
if (findContainerIndex(target) >= 0) {
|
|
362
399
|
// allow the click since it ocurred inside the trap
|
|
363
400
|
return;
|
|
364
401
|
}
|
|
@@ -377,7 +414,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
377
414
|
// that was clicked, whether it's focusable or not; by setting
|
|
378
415
|
// `returnFocus: true`, we'll attempt to re-focus the node originally-focused
|
|
379
416
|
// on activation (or the configured `setReturnFocus` node)
|
|
380
|
-
returnFocus: config.returnFocusOnDeactivate && !index_esm.isFocusable(target)
|
|
417
|
+
returnFocus: config.returnFocusOnDeactivate && !index_esm.isFocusable(target, config.tabbableOptions)
|
|
381
418
|
});
|
|
382
419
|
return;
|
|
383
420
|
} // This is needed for mobile devices.
|
|
@@ -397,7 +434,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
397
434
|
|
|
398
435
|
var checkFocusIn = function checkFocusIn(e) {
|
|
399
436
|
var target = getActualTarget(e);
|
|
400
|
-
var targetContained =
|
|
437
|
+
var targetContained = findContainerIndex(target) >= 0; // In Firefox when you Tab out of an iframe the Document is briefly focused.
|
|
401
438
|
|
|
402
439
|
if (targetContained || target instanceof Document) {
|
|
403
440
|
if (targetContained) {
|
|
@@ -423,11 +460,8 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
423
460
|
// make sure the target is actually contained in a group
|
|
424
461
|
// NOTE: the target may also be the container itself if it's focusable
|
|
425
462
|
// with tabIndex='-1' and was given initial focus
|
|
426
|
-
var containerIndex =
|
|
427
|
-
|
|
428
|
-
return container.contains(target);
|
|
429
|
-
});
|
|
430
|
-
var containerGroup = containerIndex >= 0 ? state.tabbableGroups[containerIndex] : undefined;
|
|
463
|
+
var containerIndex = findContainerIndex(target);
|
|
464
|
+
var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
|
|
431
465
|
|
|
432
466
|
if (containerIndex < 0) {
|
|
433
467
|
// target not found in any group: quite possible focus has escaped the trap,
|
|
@@ -447,7 +481,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
447
481
|
return target === firstTabbableNode;
|
|
448
482
|
});
|
|
449
483
|
|
|
450
|
-
if (startOfGroupIndex < 0 && (containerGroup.container === target || index_esm.isFocusable(target) && !index_esm.isTabbable(target) && !containerGroup.nextTabbableNode(target, false))) {
|
|
484
|
+
if (startOfGroupIndex < 0 && (containerGroup.container === target || index_esm.isFocusable(target, config.tabbableOptions) && !index_esm.isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
|
|
451
485
|
// an exception case where the target is either the container itself, or
|
|
452
486
|
// a non-tabbable node that was given focus (i.e. tabindex is negative
|
|
453
487
|
// and user clicked on it or node was programmatically given focus)
|
|
@@ -473,7 +507,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
473
507
|
return target === lastTabbableNode;
|
|
474
508
|
});
|
|
475
509
|
|
|
476
|
-
if (lastOfGroupIndex < 0 && (containerGroup.container === target || index_esm.isFocusable(target) && !index_esm.isTabbable(target) && !containerGroup.nextTabbableNode(target))) {
|
|
510
|
+
if (lastOfGroupIndex < 0 && (containerGroup.container === target || index_esm.isFocusable(target, config.tabbableOptions) && !index_esm.isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
|
|
477
511
|
// an exception case where the target is the container itself, or
|
|
478
512
|
// a non-tabbable node that was given focus (i.e. tabindex is negative
|
|
479
513
|
// and user clicked on it or node was programmatically given focus)
|
|
@@ -525,7 +559,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
525
559
|
|
|
526
560
|
var target = getActualTarget(e);
|
|
527
561
|
|
|
528
|
-
if (
|
|
562
|
+
if (findContainerIndex(target) >= 0) {
|
|
529
563
|
return;
|
|
530
564
|
}
|
|
531
565
|
|
|
@@ -432,7 +432,6 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
432
432
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
433
433
|
if (memberName === 'list') {
|
|
434
434
|
isProp = false;
|
|
435
|
-
// tslint:disable-next-line: triple-equals
|
|
436
435
|
}
|
|
437
436
|
else if (oldValue == null || elm[memberName] != n) {
|
|
438
437
|
elm[memberName] = n;
|
|
@@ -1601,14 +1600,14 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1601
1600
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1602
1601
|
plt.jmp(() => {
|
|
1603
1602
|
const propName = attrNameToPropName.get(attrName);
|
|
1604
|
-
// In a
|
|
1603
|
+
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1605
1604
|
// in the case where an attribute was set inline.
|
|
1606
1605
|
// ```html
|
|
1607
1606
|
// <my-component some-attribute="some-value"></my-component>
|
|
1608
1607
|
// ```
|
|
1609
1608
|
//
|
|
1610
|
-
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1611
|
-
// changes it before it has been upgraded as shown below:
|
|
1609
|
+
// There is an edge case where a developer sets the attribute inline on a custom element and then
|
|
1610
|
+
// programmatically changes it before it has been upgraded as shown below:
|
|
1612
1611
|
//
|
|
1613
1612
|
// ```html
|
|
1614
1613
|
// <!-- this component has _not_ been upgraded yet -->
|
|
@@ -1618,13 +1617,13 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1618
1617
|
// el = document.querySelector("#test");
|
|
1619
1618
|
// el.someAttribute = "another-value";
|
|
1620
1619
|
// // upgrade component
|
|
1621
|
-
//
|
|
1620
|
+
// customElements.define('my-component', MyComponent);
|
|
1622
1621
|
// </script>
|
|
1623
1622
|
// ```
|
|
1624
1623
|
// In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1625
1624
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1626
1625
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1627
|
-
// the connectedCallback attempts to unshadow it will use "some-value" as the
|
|
1626
|
+
// the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
|
|
1628
1627
|
//
|
|
1629
1628
|
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
|
|
1630
1629
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
@@ -1638,6 +1637,14 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1638
1637
|
newValue = this[propName];
|
|
1639
1638
|
delete this[propName];
|
|
1640
1639
|
}
|
|
1640
|
+
else if (prototype.hasOwnProperty(propName) &&
|
|
1641
|
+
typeof this[propName] === 'number' &&
|
|
1642
|
+
this[propName] == newValue) {
|
|
1643
|
+
// if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
|
|
1644
|
+
// APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
|
|
1645
|
+
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1646
|
+
return;
|
|
1647
|
+
}
|
|
1641
1648
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1642
1649
|
});
|
|
1643
1650
|
};
|
|
@@ -1724,7 +1731,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1724
1731
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1725
1732
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1726
1733
|
if (ancestorComponent && ancestorComponent['s-rc']) {
|
|
1727
|
-
// this is the
|
|
1734
|
+
// this is the initial load and this component it has an ancestor component
|
|
1728
1735
|
// but the ancestor component has NOT fired its will update lifecycle yet
|
|
1729
1736
|
// so let's just cool our jets and wait for the ancestor to continue first
|
|
1730
1737
|
// this will get fired off when the ancestor component
|
|
@@ -1864,71 +1871,73 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1864
1871
|
registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
|
|
1865
1872
|
}
|
|
1866
1873
|
}
|
|
1867
|
-
lazyBundles.map((lazyBundle) =>
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1874
|
+
lazyBundles.map((lazyBundle) => {
|
|
1875
|
+
lazyBundle[1].map((compactMeta) => {
|
|
1876
|
+
const cmpMeta = {
|
|
1877
|
+
$flags$: compactMeta[0],
|
|
1878
|
+
$tagName$: compactMeta[1],
|
|
1879
|
+
$members$: compactMeta[2],
|
|
1880
|
+
$listeners$: compactMeta[3],
|
|
1881
|
+
};
|
|
1882
|
+
{
|
|
1883
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
1884
|
+
}
|
|
1885
|
+
{
|
|
1886
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1887
|
+
}
|
|
1888
|
+
{
|
|
1889
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1890
|
+
}
|
|
1891
|
+
{
|
|
1892
|
+
cmpMeta.$watchers$ = {};
|
|
1893
|
+
}
|
|
1894
|
+
const tagName = cmpMeta.$tagName$;
|
|
1895
|
+
const HostElement = class extends HTMLElement {
|
|
1896
|
+
// StencilLazyHost
|
|
1897
|
+
constructor(self) {
|
|
1898
|
+
// @ts-ignore
|
|
1899
|
+
super(self);
|
|
1900
|
+
self = this;
|
|
1901
|
+
registerHost(self, cmpMeta);
|
|
1902
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1903
|
+
// this component is using shadow dom
|
|
1904
|
+
// and this browser supports shadow dom
|
|
1905
|
+
// add the read-only property "shadowRoot" to the host element
|
|
1906
|
+
// adding the shadow root build conditionals to minimize runtime
|
|
1900
1907
|
{
|
|
1901
|
-
|
|
1908
|
+
{
|
|
1909
|
+
self.attachShadow({ mode: 'open' });
|
|
1910
|
+
}
|
|
1902
1911
|
}
|
|
1903
1912
|
}
|
|
1904
1913
|
}
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1914
|
+
connectedCallback() {
|
|
1915
|
+
if (appLoadFallback) {
|
|
1916
|
+
clearTimeout(appLoadFallback);
|
|
1917
|
+
appLoadFallback = null;
|
|
1918
|
+
}
|
|
1919
|
+
if (isBootstrapping) {
|
|
1920
|
+
// connectedCallback will be processed once all components have been registered
|
|
1921
|
+
deferredConnectedCallbacks.push(this);
|
|
1922
|
+
}
|
|
1923
|
+
else {
|
|
1924
|
+
plt.jmp(() => connectedCallback(this));
|
|
1925
|
+
}
|
|
1910
1926
|
}
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
deferredConnectedCallbacks.push(this);
|
|
1927
|
+
disconnectedCallback() {
|
|
1928
|
+
plt.jmp(() => disconnectedCallback(this));
|
|
1914
1929
|
}
|
|
1915
|
-
|
|
1916
|
-
|
|
1930
|
+
componentOnReady() {
|
|
1931
|
+
return getHostRef(this).$onReadyPromise$;
|
|
1917
1932
|
}
|
|
1933
|
+
};
|
|
1934
|
+
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1935
|
+
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1936
|
+
cmpTags.push(tagName);
|
|
1937
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1918
1938
|
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
}
|
|
1922
|
-
componentOnReady() {
|
|
1923
|
-
return getHostRef(this).$onReadyPromise$;
|
|
1924
|
-
}
|
|
1925
|
-
};
|
|
1926
|
-
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1927
|
-
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1928
|
-
cmpTags.push(tagName);
|
|
1929
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1930
|
-
}
|
|
1931
|
-
}));
|
|
1939
|
+
});
|
|
1940
|
+
});
|
|
1932
1941
|
{
|
|
1933
1942
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1934
1943
|
visibilityStyle.setAttribute('data-styles', '');
|