@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
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/*!
|
|
4
|
+
* tabbable 5.3.1
|
|
5
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
6
|
+
*/
|
|
7
|
+
var candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]:not(slot)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])', 'details>summary:first-of-type', 'details'];
|
|
8
|
+
var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
|
|
9
|
+
var NoElement = typeof Element === 'undefined';
|
|
10
|
+
var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
11
|
+
var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
|
|
12
|
+
return element.getRootNode();
|
|
13
|
+
} : function (element) {
|
|
14
|
+
return element.ownerDocument;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @param {Element} el container to check in
|
|
18
|
+
* @param {boolean} includeContainer add container to check
|
|
19
|
+
* @param {(node: Element) => boolean} filter filter candidates
|
|
20
|
+
* @returns {Element[]}
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
var getCandidates = function getCandidates(el, includeContainer, filter) {
|
|
24
|
+
var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
|
|
25
|
+
|
|
26
|
+
if (includeContainer && matches.call(el, candidateSelector)) {
|
|
27
|
+
candidates.unshift(el);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
candidates = candidates.filter(filter);
|
|
31
|
+
return candidates;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @callback GetShadowRoot
|
|
35
|
+
* @param {Element} element to check for shadow root
|
|
36
|
+
* @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @typedef {Object} CandidatesScope
|
|
41
|
+
* @property {Element} scope contains inner candidates
|
|
42
|
+
* @property {Element[]} candidates
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @typedef {Object} IterativeOptions
|
|
47
|
+
* @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
|
|
48
|
+
* if a function, implies shadow support is enabled and either returns the shadow root of an element
|
|
49
|
+
* or a boolean stating if it has an undisclosed shadow root
|
|
50
|
+
* @property {(node: Element) => boolean} filter filter candidates
|
|
51
|
+
* @property {boolean} flatten if true then result will flatten any CandidatesScope into the returned list
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @param {Element[]} elements list of element containers to match candidates from
|
|
56
|
+
* @param {boolean} includeContainer add container list to check
|
|
57
|
+
* @param {IterativeOptions} options
|
|
58
|
+
* @returns {Array.<Element|CandidatesScope>}
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
|
|
63
|
+
var candidates = [];
|
|
64
|
+
var elementsToCheck = Array.from(elements);
|
|
65
|
+
|
|
66
|
+
while (elementsToCheck.length) {
|
|
67
|
+
var element = elementsToCheck.shift();
|
|
68
|
+
|
|
69
|
+
if (element.tagName === 'SLOT') {
|
|
70
|
+
// add shadow dom slot scope (slot itself cannot be focusable)
|
|
71
|
+
var assigned = element.assignedElements();
|
|
72
|
+
var content = assigned.length ? assigned : element.children;
|
|
73
|
+
var nestedCandidates = getCandidatesIteratively(content, true, options);
|
|
74
|
+
|
|
75
|
+
if (options.flatten) {
|
|
76
|
+
candidates.push.apply(candidates, nestedCandidates);
|
|
77
|
+
} else {
|
|
78
|
+
candidates.push({
|
|
79
|
+
scope: element,
|
|
80
|
+
candidates: nestedCandidates
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
// check candidate element
|
|
85
|
+
var validCandidate = matches.call(element, candidateSelector);
|
|
86
|
+
|
|
87
|
+
if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
|
|
88
|
+
candidates.push(element);
|
|
89
|
+
} // iterate over shadow content if possible
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
var shadowRoot = element.shadowRoot || // check for an undisclosed shadow
|
|
93
|
+
typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
|
|
94
|
+
|
|
95
|
+
if (shadowRoot) {
|
|
96
|
+
// add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
|
|
97
|
+
// shadow exists, so look at light dom children as fallback BUT create a scope for any
|
|
98
|
+
// child candidates found because they're likely slotted elements (elements that are
|
|
99
|
+
// children of the web component element (which has the shadow), in the light dom, but
|
|
100
|
+
// slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
|
|
101
|
+
// _after_ we return from this recursive call
|
|
102
|
+
var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
|
|
103
|
+
|
|
104
|
+
if (options.flatten) {
|
|
105
|
+
candidates.push.apply(candidates, _nestedCandidates);
|
|
106
|
+
} else {
|
|
107
|
+
candidates.push({
|
|
108
|
+
scope: element,
|
|
109
|
+
candidates: _nestedCandidates
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
// there's not shadow so just dig into the element's (light dom) children
|
|
114
|
+
// __without__ giving the element special scope treatment
|
|
115
|
+
elementsToCheck.unshift.apply(elementsToCheck, element.children);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return candidates;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
var getTabindex = function getTabindex(node, isScope) {
|
|
124
|
+
if (node.tabIndex < 0) {
|
|
125
|
+
// in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
|
|
126
|
+
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
|
|
127
|
+
// yet they are still part of the regular tab order; in FF, they get a default
|
|
128
|
+
// `tabIndex` of 0; since Chrome still puts those elements in the regular tab
|
|
129
|
+
// order, consider their tab index to be 0.
|
|
130
|
+
// Also browsers do not return `tabIndex` correctly for contentEditable nodes;
|
|
131
|
+
// so if they don't have a tabindex attribute specifically set, assume it's 0.
|
|
132
|
+
//
|
|
133
|
+
// isScope is positive for custom element with shadow root or slot that by default
|
|
134
|
+
// have tabIndex -1, but need to be sorted by document order in order for their
|
|
135
|
+
// content to be inserted in the correct position
|
|
136
|
+
if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
|
|
137
|
+
return 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return node.tabIndex;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
|
|
145
|
+
return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
var isInput = function isInput(node) {
|
|
149
|
+
return node.tagName === 'INPUT';
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
var isHiddenInput = function isHiddenInput(node) {
|
|
153
|
+
return isInput(node) && node.type === 'hidden';
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
var isDetailsWithSummary = function isDetailsWithSummary(node) {
|
|
157
|
+
var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
|
|
158
|
+
return child.tagName === 'SUMMARY';
|
|
159
|
+
});
|
|
160
|
+
return r;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
var getCheckedRadio = function getCheckedRadio(nodes, form) {
|
|
164
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
165
|
+
if (nodes[i].checked && nodes[i].form === form) {
|
|
166
|
+
return nodes[i];
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
var isTabbableRadio = function isTabbableRadio(node) {
|
|
172
|
+
if (!node.name) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
var radioScope = node.form || getRootNode(node);
|
|
177
|
+
|
|
178
|
+
var queryRadios = function queryRadios(name) {
|
|
179
|
+
return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
var radioSet;
|
|
183
|
+
|
|
184
|
+
if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
|
|
185
|
+
radioSet = queryRadios(window.CSS.escape(node.name));
|
|
186
|
+
} else {
|
|
187
|
+
try {
|
|
188
|
+
radioSet = queryRadios(node.name);
|
|
189
|
+
} catch (err) {
|
|
190
|
+
// eslint-disable-next-line no-console
|
|
191
|
+
console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
var checked = getCheckedRadio(radioSet, node.form);
|
|
197
|
+
return !checked || checked === node;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
var isRadio = function isRadio(node) {
|
|
201
|
+
return isInput(node) && node.type === 'radio';
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
var isNonTabbableRadio = function isNonTabbableRadio(node) {
|
|
205
|
+
return isRadio(node) && !isTabbableRadio(node);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
var isZeroArea = function isZeroArea(node) {
|
|
209
|
+
var _node$getBoundingClie = node.getBoundingClientRect(),
|
|
210
|
+
width = _node$getBoundingClie.width,
|
|
211
|
+
height = _node$getBoundingClie.height;
|
|
212
|
+
|
|
213
|
+
return width === 0 && height === 0;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
var isHidden = function isHidden(node, _ref) {
|
|
217
|
+
var displayCheck = _ref.displayCheck,
|
|
218
|
+
getShadowRoot = _ref.getShadowRoot;
|
|
219
|
+
|
|
220
|
+
if (getComputedStyle(node).visibility === 'hidden') {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
|
|
225
|
+
var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
|
|
226
|
+
|
|
227
|
+
if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (!displayCheck || displayCheck === 'full') {
|
|
232
|
+
if (typeof getShadowRoot === 'function') {
|
|
233
|
+
// figure out if we should consider the node to be in an undisclosed shadow and use the
|
|
234
|
+
// 'non-zero-area' fallback
|
|
235
|
+
var originalNode = node;
|
|
236
|
+
|
|
237
|
+
while (node) {
|
|
238
|
+
var parentElement = node.parentElement;
|
|
239
|
+
var rootNode = getRootNode(node);
|
|
240
|
+
|
|
241
|
+
if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
|
|
242
|
+
) {
|
|
243
|
+
// node has an undisclosed shadow which means we can only treat it as a black box, so we
|
|
244
|
+
// fall back to a non-zero-area test
|
|
245
|
+
return isZeroArea(node);
|
|
246
|
+
} else if (node.assignedSlot) {
|
|
247
|
+
// iterate up slot
|
|
248
|
+
node = node.assignedSlot;
|
|
249
|
+
} else if (!parentElement && rootNode !== node.ownerDocument) {
|
|
250
|
+
// cross shadow boundary
|
|
251
|
+
node = rootNode.host;
|
|
252
|
+
} else {
|
|
253
|
+
// iterate up normal dom
|
|
254
|
+
node = parentElement;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
node = originalNode;
|
|
259
|
+
} // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
|
|
260
|
+
// (i.e. it does not also presume that all nodes might have undisclosed shadows); or
|
|
261
|
+
// it might be a falsy value, which means shadow DOM support is disabled
|
|
262
|
+
// didn't find it sitting in an undisclosed shadow (or shadows are disabled) so now we
|
|
263
|
+
// can just test to see if it would normally be visible or not
|
|
264
|
+
// this works wherever the node is: if there's at least one client rect, it's
|
|
265
|
+
// somehow displayed; it also covers the CSS 'display: contents' case where the
|
|
266
|
+
// node itself is hidden in place of its contents; and there's no need to search
|
|
267
|
+
// up the hierarchy either
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
return !node.getClientRects().length;
|
|
271
|
+
} else if (displayCheck === 'non-zero-area') {
|
|
272
|
+
return isZeroArea(node);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return false;
|
|
276
|
+
}; // form fields (nested) inside a disabled fieldset are not focusable/tabbable
|
|
277
|
+
// unless they are in the _first_ <legend> element of the top-most disabled
|
|
278
|
+
// fieldset
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
|
|
282
|
+
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
|
|
283
|
+
var parentNode = node.parentElement; // check if `node` is contained in a disabled <fieldset>
|
|
284
|
+
|
|
285
|
+
while (parentNode) {
|
|
286
|
+
if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
|
|
287
|
+
// look for the first <legend> among the children of the disabled <fieldset>
|
|
288
|
+
for (var i = 0; i < parentNode.children.length; i++) {
|
|
289
|
+
var child = parentNode.children.item(i); // when the first <legend> (in document order) is found
|
|
290
|
+
|
|
291
|
+
if (child.tagName === 'LEGEND') {
|
|
292
|
+
// if its parent <fieldset> is not nested in another disabled <fieldset>,
|
|
293
|
+
// return whether `node` is a descendant of its first <legend>
|
|
294
|
+
return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
|
|
295
|
+
}
|
|
296
|
+
} // the disabled <fieldset> containing `node` has no <legend>
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
parentNode = parentNode.parentElement;
|
|
303
|
+
}
|
|
304
|
+
} // else, node's tabbable/focusable state should not be affected by a fieldset's
|
|
305
|
+
// enabled/disabled state
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
return false;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
|
|
312
|
+
if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus
|
|
313
|
+
isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
|
|
314
|
+
return false;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return true;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
|
|
321
|
+
if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return true;
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* @param {Array.<Element|CandidatesScope>} candidates
|
|
329
|
+
* @returns Element[]
|
|
330
|
+
*/
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
var sortByOrder = function sortByOrder(candidates) {
|
|
334
|
+
var regularTabbables = [];
|
|
335
|
+
var orderedTabbables = [];
|
|
336
|
+
candidates.forEach(function (item, i) {
|
|
337
|
+
var isScope = !!item.scope;
|
|
338
|
+
var element = isScope ? item.scope : item;
|
|
339
|
+
var candidateTabindex = getTabindex(element, isScope);
|
|
340
|
+
var elements = isScope ? sortByOrder(item.candidates) : element;
|
|
341
|
+
|
|
342
|
+
if (candidateTabindex === 0) {
|
|
343
|
+
isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
|
|
344
|
+
} else {
|
|
345
|
+
orderedTabbables.push({
|
|
346
|
+
documentOrder: i,
|
|
347
|
+
tabIndex: candidateTabindex,
|
|
348
|
+
item: item,
|
|
349
|
+
isScope: isScope,
|
|
350
|
+
content: elements
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
|
|
355
|
+
sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
|
|
356
|
+
return acc;
|
|
357
|
+
}, []).concat(regularTabbables);
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
var tabbable = function tabbable(el, options) {
|
|
361
|
+
options = options || {};
|
|
362
|
+
var candidates;
|
|
363
|
+
|
|
364
|
+
if (options.getShadowRoot) {
|
|
365
|
+
candidates = getCandidatesIteratively([el], options.includeContainer, {
|
|
366
|
+
filter: isNodeMatchingSelectorTabbable.bind(null, options),
|
|
367
|
+
flatten: false,
|
|
368
|
+
getShadowRoot: options.getShadowRoot
|
|
369
|
+
});
|
|
370
|
+
} else {
|
|
371
|
+
candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
return sortByOrder(candidates);
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
var focusable = function focusable(el, options) {
|
|
378
|
+
options = options || {};
|
|
379
|
+
var candidates;
|
|
380
|
+
|
|
381
|
+
if (options.getShadowRoot) {
|
|
382
|
+
candidates = getCandidatesIteratively([el], options.includeContainer, {
|
|
383
|
+
filter: isNodeMatchingSelectorFocusable.bind(null, options),
|
|
384
|
+
flatten: true,
|
|
385
|
+
getShadowRoot: options.getShadowRoot
|
|
386
|
+
});
|
|
387
|
+
} else {
|
|
388
|
+
candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
return candidates;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
var isTabbable = function isTabbable(node, options) {
|
|
395
|
+
options = options || {};
|
|
396
|
+
|
|
397
|
+
if (!node) {
|
|
398
|
+
throw new Error('No node provided');
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (matches.call(node, candidateSelector) === false) {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
return isNodeMatchingSelectorTabbable(options, node);
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
var focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');
|
|
409
|
+
|
|
410
|
+
var isFocusable = function isFocusable(node, options) {
|
|
411
|
+
options = options || {};
|
|
412
|
+
|
|
413
|
+
if (!node) {
|
|
414
|
+
throw new Error('No node provided');
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
if (matches.call(node, focusableCandidateSelector) === false) {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
return isNodeMatchingSelectorFocusable(options, node);
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
exports.focusable = focusable;
|
|
425
|
+
exports.isFocusable = isFocusable;
|
|
426
|
+
exports.isTabbable = isTabbable;
|
|
427
|
+
exports.tabbable = tabbable;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-dfb4ea62.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.10.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html, nothing } from 'lit-html';
|
|
2
|
-
import { unsafeHTML } from 'lit-html/directives/unsafe-html';
|
|
2
|
+
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
|
|
3
3
|
export function alertTemplate({ status, message, onClick, withRoleAlert }) {
|
|
4
4
|
return html `
|
|
5
5
|
<dso-alert status=${status} ?role-alert=${withRoleAlert}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html, nothing } from 'lit-html';
|
|
2
|
-
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
3
|
import { iconTemplate } from '../icon/icon.template';
|
|
4
4
|
export function anchorTemplate({ icon, iconMode, label, modifier, url }) {
|
|
5
5
|
return html `<a
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from 'lit-html';
|
|
2
|
-
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
3
|
export function badgeTemplate({ status, message }) {
|
|
4
4
|
return html `
|
|
5
5
|
<dso-badge status=${ifDefined(status)}>${message}</dso-badge>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html, nothing } from 'lit-html';
|
|
2
|
-
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
3
|
import { iconTemplate } from '../icon/icon.template';
|
|
4
4
|
export function buttonTemplate(button) {
|
|
5
5
|
return 'url' in button
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
top: 50%;
|
|
97
97
|
user-select: none;
|
|
98
98
|
width: 38px;
|
|
99
|
-
z-index:
|
|
99
|
+
z-index: 101;
|
|
100
100
|
}
|
|
101
101
|
.dso-date__toggle:disabled {
|
|
102
102
|
color: #afcf9d;
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
transition: transform 300ms ease, opacity 300ms ease, visibility 300ms ease;
|
|
117
117
|
visibility: hidden;
|
|
118
118
|
will-change: transform, opacity, visibility;
|
|
119
|
-
z-index:
|
|
119
|
+
z-index: 210;
|
|
120
120
|
}
|
|
121
121
|
@media (max-width: 35.9375em) {
|
|
122
122
|
.dso-date__dialog {
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
position: relative;
|
|
156
156
|
transform: none;
|
|
157
157
|
width: 100%;
|
|
158
|
-
z-index:
|
|
158
|
+
z-index: 210;
|
|
159
159
|
}
|
|
160
160
|
@media (max-width: 35.9375em) {
|
|
161
161
|
.dso-date__dialog-content {
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
text-align: center;
|
|
234
234
|
vertical-align: middle;
|
|
235
235
|
width: 38px;
|
|
236
|
-
z-index:
|
|
236
|
+
z-index: 100;
|
|
237
237
|
}
|
|
238
238
|
.dso-date__day.is-today {
|
|
239
239
|
background: transparent;
|
|
@@ -372,7 +372,7 @@
|
|
|
372
372
|
position: absolute;
|
|
373
373
|
top: 0;
|
|
374
374
|
width: 100%;
|
|
375
|
-
z-index:
|
|
375
|
+
z-index: 101;
|
|
376
376
|
}
|
|
377
377
|
.dso-date__select select:focus + .dso-date__select-label {
|
|
378
378
|
box-shadow: 0 0 0 2px #275937;
|
|
@@ -390,7 +390,7 @@
|
|
|
390
390
|
pointer-events: none;
|
|
391
391
|
position: relative;
|
|
392
392
|
width: 100%;
|
|
393
|
-
z-index:
|
|
393
|
+
z-index: 100;
|
|
394
394
|
}
|
|
395
395
|
.dso-date__select-label span {
|
|
396
396
|
font-size: 1.25rem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from 'lit-html';
|
|
2
|
-
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
3
|
export function datePickerTemplate({ id, onDateChange, value, min, max, disabled, autofocus, direction }) {
|
|
4
4
|
return html `
|
|
5
5
|
<dso-date-picker
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html } from 'lit-html';
|
|
2
|
-
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
3
|
-
import { unsafeHTML } from 'lit-html/directives/unsafe-html';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
|
+
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
|
|
4
4
|
import { listTemplate } from '../list/list.template';
|
|
5
5
|
function definitionTemplate({ term, descriptions }, useSrOnlyColon) {
|
|
6
6
|
return html `
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from "lit-html";
|
|
2
|
-
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
3
|
export function dropdownMenuTemplate({ id, button, dropdownAlign, isCheckable, children }) {
|
|
4
4
|
return html `
|
|
5
5
|
<dso-dropdown-menu
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Component, Element, Fragment, h, Prop, State, Watch, } from "@stencil/core";
|
|
1
|
+
import { Component, Element, Event, Fragment, h, Prop, State, Watch, } from "@stencil/core";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import debounce from "debounce";
|
|
4
4
|
const minDesktopViewportWidth = 992;
|
|
5
5
|
export class Header {
|
|
6
6
|
constructor() {
|
|
7
|
+
this.mainMenu = [];
|
|
7
8
|
this.useDropDownMenu = "auto";
|
|
8
9
|
this.showDropDown = false;
|
|
9
10
|
this.isLoggedIn = false;
|
|
@@ -13,6 +14,17 @@ export class Header {
|
|
|
13
14
|
this.setDropDownMenu();
|
|
14
15
|
this.setOverflowMenu();
|
|
15
16
|
}, 100);
|
|
17
|
+
this.MenuItem = (item) => {
|
|
18
|
+
const click = (event) => {
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
this.menuItemClick.emit({
|
|
21
|
+
originalEvent: event,
|
|
22
|
+
menuItem: item,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
return (h("li", { class: item.active ? "dso-active" : undefined },
|
|
26
|
+
h("a", { href: item.url, "aria-current": item.active ? "page" : undefined, onClick: click }, item.label)));
|
|
27
|
+
};
|
|
16
28
|
}
|
|
17
29
|
watchUseDropDownMenu(value) {
|
|
18
30
|
if (value === "auto") {
|
|
@@ -64,10 +76,6 @@ export class Header {
|
|
|
64
76
|
disconnectedCallback() {
|
|
65
77
|
window.removeEventListener("resize", this.onWindowResize);
|
|
66
78
|
}
|
|
67
|
-
MenuItem(item) {
|
|
68
|
-
return (h("li", { class: item.active ? "dso-active" : undefined },
|
|
69
|
-
h("a", { href: item.url, "aria-current": item.active ? "page" : undefined }, item.label)));
|
|
70
|
-
}
|
|
71
79
|
render() {
|
|
72
80
|
return (h(Fragment, null,
|
|
73
81
|
h("div", { class: clsx("dso-header", {
|
|
@@ -79,7 +87,7 @@ export class Header {
|
|
|
79
87
|
h("slot", { name: "logo" })),
|
|
80
88
|
h("div", { class: "sub-logo" },
|
|
81
89
|
h("slot", { name: "sub-logo" }))),
|
|
82
|
-
this.showDropDown && (h("div", { class: "dropdown" },
|
|
90
|
+
this.showDropDown && this.mainMenu.length > 0 && (h("div", { class: "dropdown" },
|
|
83
91
|
h("dso-dropdown-menu", { "dropdown-align": "right" },
|
|
84
92
|
h("button", { type: "button", class: "tertiary", slot: "toggle" },
|
|
85
93
|
h("span", null, "Menu")),
|
|
@@ -99,7 +107,7 @@ export class Header {
|
|
|
99
107
|
h("span", { class: "profile-label" }, "- Mijn profiel")))),
|
|
100
108
|
this.logoutUrl && this.isLoggedIn && (h("li", null,
|
|
101
109
|
h("a", { href: this.logoutUrl }, "Uitloggen"))))))))),
|
|
102
|
-
!this.showDropDown && (h(Fragment, null,
|
|
110
|
+
!this.showDropDown && this.mainMenu.length > 0 && (h(Fragment, null,
|
|
103
111
|
h("div", { class: "dso-header-session" },
|
|
104
112
|
this.userProfileUrl &&
|
|
105
113
|
this.userProfileName &&
|
|
@@ -186,12 +194,13 @@ export class Header {
|
|
|
186
194
|
}
|
|
187
195
|
}
|
|
188
196
|
},
|
|
189
|
-
"required":
|
|
197
|
+
"required": false,
|
|
190
198
|
"optional": false,
|
|
191
199
|
"docs": {
|
|
192
200
|
"tags": [],
|
|
193
201
|
"text": ""
|
|
194
|
-
}
|
|
202
|
+
},
|
|
203
|
+
"defaultValue": "[]"
|
|
195
204
|
},
|
|
196
205
|
"useDropDownMenu": {
|
|
197
206
|
"type": "string",
|
|
@@ -286,6 +295,26 @@ export class Header {
|
|
|
286
295
|
"hasSubLogo": {},
|
|
287
296
|
"overflowMenuItems": {}
|
|
288
297
|
}; }
|
|
298
|
+
static get events() { return [{
|
|
299
|
+
"method": "menuItemClick",
|
|
300
|
+
"name": "menuItemClick",
|
|
301
|
+
"bubbles": true,
|
|
302
|
+
"cancelable": true,
|
|
303
|
+
"composed": true,
|
|
304
|
+
"docs": {
|
|
305
|
+
"tags": [],
|
|
306
|
+
"text": ""
|
|
307
|
+
},
|
|
308
|
+
"complexType": {
|
|
309
|
+
"original": "HeaderMenuItemClickEvent",
|
|
310
|
+
"resolved": "HeaderMenuItemClickEvent",
|
|
311
|
+
"references": {
|
|
312
|
+
"HeaderMenuItemClickEvent": {
|
|
313
|
+
"location": "local"
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}]; }
|
|
289
318
|
static get elementRef() { return "host"; }
|
|
290
319
|
static get watchers() { return [{
|
|
291
320
|
"propName": "useDropDownMenu",
|