@dso-toolkit/core 33.2.0 → 34.1.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 +2 -2
- package/dist/cjs/dso-autosuggest.cjs.entry.js +3 -71
- 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 +49 -28
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +19 -232
- package/dist/cjs/dso-header.cjs.entry.js +101 -0
- 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-info-button.cjs.entry.js +2 -2
- 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 +7 -6
- package/dist/cjs/dso-map-controls.cjs.entry.js +3 -3
- package/dist/cjs/dso-map-overlays.cjs.entry.js +9 -10
- package/dist/cjs/dso-ozon-content.cjs.entry.js +1 -1
- 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 +169 -76
- package/dist/cjs/dso-tree-view.cjs.entry.js +2 -2
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +778 -0
- package/dist/cjs/{index-fcdfdd38.js → index-5ea63531.js} +26 -2
- package/dist/cjs/index-794ad37a.js +72 -0
- package/dist/cjs/index.esm-2ac7081c.js +267 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/alert/alert.css +0 -3
- package/dist/collection/components/anchor/anchor.template.js +17 -0
- package/dist/collection/components/attachments-counter/attachments-counter.css +0 -4
- package/dist/collection/components/autosuggest/autosuggest.css +0 -3
- package/dist/collection/components/badge/badge.css +0 -3
- package/dist/collection/components/banner/banner.css +0 -3
- package/dist/collection/components/button/button.template.js +48 -0
- package/dist/collection/components/context/context.template.js +42 -0
- package/dist/collection/components/date-picker/date-picker.css +3 -5
- package/dist/collection/components/date-picker/date-picker.js +49 -28
- package/dist/collection/components/date-picker/date-picker.template.js +2 -1
- package/dist/collection/components/definition-list/definition-list.template.js +36 -0
- package/dist/collection/components/dropdown-menu/dropdown-menu.css +0 -3
- package/dist/collection/components/dropdown-menu/dropdown-menu.js +15 -4
- package/dist/collection/components/header/header.css +433 -0
- package/dist/collection/components/header/header.js +294 -0
- package/dist/collection/components/header/header.template.js +32 -0
- package/dist/collection/components/helpcenter-panel/helpcenter-panel.css +0 -3
- package/dist/collection/components/highlight-box/highlight-box.css +0 -3
- package/dist/collection/components/icon/icon.css +0 -4
- package/dist/collection/components/info/info.css +1 -4
- package/dist/collection/components/info-button/info-button.css +1 -3
- package/dist/collection/components/label/label.css +0 -3
- package/dist/collection/components/label-group/label-group.template.js +7 -0
- package/dist/collection/components/list/list.template.js +37 -0
- package/dist/collection/components/map-base-layers/map-base-layers.css +4 -3
- package/dist/collection/components/map-base-layers/map-base-layers.js +10 -27
- package/dist/collection/components/map-controls/map-controls.css +30 -11
- package/dist/collection/components/map-controls/map-controls.js +10 -11
- package/dist/collection/components/map-controls/map-controls.template.js +12 -20
- package/dist/collection/components/map-overlays/map-overlays.css +4 -3
- package/dist/collection/components/map-overlays/map-overlays.js +13 -35
- package/dist/collection/components/ozon-content/ozon-content.css +0 -3
- package/dist/collection/components/progress-bar/progress-bar.css +0 -3
- package/dist/collection/components/progress-indicator/progress-indicator.css +0 -3
- package/dist/collection/components/selectable/selectable.css +0 -3
- package/dist/collection/components/toggletip/toggletip.css +0 -3
- package/dist/collection/components/tooltip/tooltip.css +34 -15
- package/dist/collection/components/tooltip/tooltip.js +19 -4
- package/dist/collection/components/tooltip/tooltip.template.js +3 -5
- package/dist/collection/components/tree-view/tree-view.css +3 -3
- package/dist/collection/components/viewer-grid/viewer-grid-document-header.template.js +39 -0
- package/dist/collection/components/viewer-grid/viewer-grid-document-list-item.template.js +19 -0
- package/dist/collection/components/viewer-grid/viewer-grid-filterblok.template.js +28 -0
- package/dist/collection/components/viewer-grid/viewer-grid.css +386 -0
- package/dist/collection/components/viewer-grid/viewer-grid.js +128 -0
- package/dist/collection/components/viewer-grid/viewer-grid.template.js +23 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +1162 -132
- package/dist/dso-toolkit/dso-toolkit.css +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-06de0fa1.entry.js +1 -0
- package/dist/dso-toolkit/p-17f073d1.entry.js +1 -0
- package/dist/dso-toolkit/p-1805f5b0.js +1 -0
- package/dist/dso-toolkit/{p-75233655.entry.js → p-1fefbf8c.entry.js} +1 -1
- package/dist/dso-toolkit/{p-a52d3623.entry.js → p-20856f91.entry.js} +1 -1
- package/dist/dso-toolkit/{p-262858dd.entry.js → p-2b6a3dfa.entry.js} +1 -1
- package/dist/dso-toolkit/{p-be5682cc.entry.js → p-348414bf.entry.js} +1 -1
- package/dist/dso-toolkit/{p-984551a8.entry.js → p-3b493a2c.entry.js} +1 -1
- package/dist/dso-toolkit/{p-0a08ac9f.entry.js → p-4e573fc5.entry.js} +1 -1
- package/dist/dso-toolkit/{p-c9c1bc8f.entry.js → p-5037944e.entry.js} +1 -1
- package/dist/dso-toolkit/p-7b006b11.entry.js +1 -0
- package/dist/dso-toolkit/p-88bc5873.entry.js +1 -0
- package/dist/dso-toolkit/p-8bf3a60e.js +5 -0
- package/dist/dso-toolkit/p-94b79e43.entry.js +1 -0
- package/dist/dso-toolkit/{p-83f166b3.entry.js → p-94dffa65.entry.js} +1 -1
- package/dist/dso-toolkit/{p-b07991b9.entry.js → p-951f5872.entry.js} +1 -1
- package/dist/dso-toolkit/p-a7306b7b.entry.js +1 -0
- package/dist/dso-toolkit/p-aadc4f8e.entry.js +1 -0
- package/dist/dso-toolkit/p-ad2210ad.entry.js +1 -0
- package/dist/dso-toolkit/p-b69134ed.entry.js +5 -0
- package/dist/dso-toolkit/{p-b5b946de.entry.js → p-bc14cafd.entry.js} +1 -1
- package/dist/dso-toolkit/{p-5665f1ee.entry.js → p-c54ecae1.entry.js} +1 -1
- package/dist/dso-toolkit/p-c95108fe.entry.js +1 -0
- package/dist/dso-toolkit/{p-e814d644.entry.js → p-daa1e29d.entry.js} +1 -1
- package/dist/dso-toolkit/p-dad72605.js +1 -0
- package/dist/dso-toolkit/{p-2e7d535c.entry.js → p-dc86d830.entry.js} +1 -1
- package/dist/dso-toolkit/{p-19de4cc7.entry.js → p-f0b67246.entry.js} +1 -1
- package/dist/esm/dso-alert.entry.js +1 -1
- package/dist/esm/dso-attachments-counter.entry.js +2 -2
- package/dist/esm/dso-autosuggest.entry.js +2 -70
- 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 +49 -28
- package/dist/esm/dso-dropdown-menu.entry.js +17 -230
- package/dist/esm/dso-header.entry.js +97 -0
- 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-info-button.entry.js +2 -2
- 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 +7 -6
- package/dist/esm/dso-map-controls.entry.js +3 -3
- package/dist/esm/dso-map-overlays.entry.js +9 -10
- package/dist/esm/dso-ozon-content.entry.js +1 -1
- 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 +169 -76
- package/dist/esm/dso-tree-view.entry.js +2 -2
- package/dist/esm/dso-viewer-grid.entry.js +774 -0
- package/dist/esm/{index-61410be2.js → index-d54cae76.js} +26 -2
- package/dist/esm/index-f2bf58ce.js +70 -0
- package/dist/esm/index.esm-a1362957.js +262 -0
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/anchor/anchor.template.d.ts +2 -0
- package/dist/types/components/button/button.template.d.ts +2 -0
- package/dist/types/components/context/context.template.d.ts +3 -0
- package/dist/types/components/date-picker/date-picker.d.ts +3 -1
- package/dist/types/components/date-picker/date-picker.template.d.ts +1 -1
- package/dist/types/components/definition-list/definition-list.template.d.ts +3 -0
- package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/types/components/header/header.d.ts +36 -0
- package/dist/types/components/header/header.template.d.ts +2 -0
- package/dist/types/components/label-group/label-group.template.d.ts +2 -0
- package/dist/types/components/list/list.template.d.ts +3 -0
- package/dist/types/components/map-base-layers/map-base-layers.d.ts +3 -4
- package/dist/types/components/map-base-layers/map-base-layers.interfaces.d.ts +6 -1
- package/dist/types/components/map-controls/map-controls.template.d.ts +1 -1
- package/dist/types/components/map-overlays/map-overlays.d.ts +4 -4
- package/dist/types/components/map-overlays/map-overlays.interfaces.d.ts +7 -1
- package/dist/types/components/tooltip/tooltip.d.ts +1 -0
- package/dist/types/components/viewer-grid/viewer-grid-document-header.template.d.ts +3 -0
- package/dist/types/components/viewer-grid/viewer-grid-document-list-item.template.d.ts +3 -0
- package/dist/types/components/viewer-grid/viewer-grid-filterblok.template.d.ts +3 -0
- package/dist/types/components/viewer-grid/viewer-grid.d.ts +22 -0
- package/dist/types/components/viewer-grid/viewer-grid.template.d.ts +3 -0
- package/dist/types/components.d.ts +50 -8
- package/package.json +4 -2
- package/dist/dso-toolkit/p-08427682.entry.js +0 -1
- package/dist/dso-toolkit/p-731a9631.entry.js +0 -1
- package/dist/dso-toolkit/p-741e96de.entry.js +0 -5
- package/dist/dso-toolkit/p-759920d0.entry.js +0 -1
- package/dist/dso-toolkit/p-a40eeb32.js +0 -1
- package/dist/dso-toolkit/p-affe82e6.entry.js +0 -1
- package/dist/dso-toolkit/p-e4269e02.entry.js +0 -1
- package/dist/dso-toolkit/p-e7700d9e.entry.js +0 -1
- package/dist/dso-toolkit/p-fd5e24c9.entry.js +0 -1
|
@@ -1,75 +1,7 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-d54cae76.js';
|
|
2
|
+
import { d as debounce_1 } from './index-f2bf58ce.js';
|
|
2
3
|
import { v as v4 } from './v4-fa4bb814.js';
|
|
3
4
|
|
|
4
|
-
/**
|
|
5
|
-
* Returns a function, that, as long as it continues to be invoked, will not
|
|
6
|
-
* be triggered. The function will be called after it stops being called for
|
|
7
|
-
* N milliseconds. If `immediate` is passed, trigger the function on the
|
|
8
|
-
* leading edge, instead of the trailing. The function also has a property 'clear'
|
|
9
|
-
* that is a function which will clear the timer to prevent previously scheduled executions.
|
|
10
|
-
*
|
|
11
|
-
* @source underscore.js
|
|
12
|
-
* @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
|
|
13
|
-
* @param {Function} function to wrap
|
|
14
|
-
* @param {Number} timeout in ms (`100`)
|
|
15
|
-
* @param {Boolean} whether to execute at the beginning (`false`)
|
|
16
|
-
* @api public
|
|
17
|
-
*/
|
|
18
|
-
function debounce(func, wait, immediate){
|
|
19
|
-
var timeout, args, context, timestamp, result;
|
|
20
|
-
if (null == wait) wait = 100;
|
|
21
|
-
|
|
22
|
-
function later() {
|
|
23
|
-
var last = Date.now() - timestamp;
|
|
24
|
-
|
|
25
|
-
if (last < wait && last >= 0) {
|
|
26
|
-
timeout = setTimeout(later, wait - last);
|
|
27
|
-
} else {
|
|
28
|
-
timeout = null;
|
|
29
|
-
if (!immediate) {
|
|
30
|
-
result = func.apply(context, args);
|
|
31
|
-
context = args = null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
var debounced = function(){
|
|
36
|
-
context = this;
|
|
37
|
-
args = arguments;
|
|
38
|
-
timestamp = Date.now();
|
|
39
|
-
var callNow = immediate && !timeout;
|
|
40
|
-
if (!timeout) timeout = setTimeout(later, wait);
|
|
41
|
-
if (callNow) {
|
|
42
|
-
result = func.apply(context, args);
|
|
43
|
-
context = args = null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return result;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
debounced.clear = function() {
|
|
50
|
-
if (timeout) {
|
|
51
|
-
clearTimeout(timeout);
|
|
52
|
-
timeout = null;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
debounced.flush = function() {
|
|
57
|
-
if (timeout) {
|
|
58
|
-
result = func.apply(context, args);
|
|
59
|
-
context = args = null;
|
|
60
|
-
|
|
61
|
-
clearTimeout(timeout);
|
|
62
|
-
timeout = null;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
return debounced;
|
|
67
|
-
}
|
|
68
|
-
// Adds compatibility for ES modules
|
|
69
|
-
debounce.debounce = debounce;
|
|
70
|
-
|
|
71
|
-
var debounce_1 = debounce;
|
|
72
|
-
|
|
73
5
|
function escapeStringRegexp(string) {
|
|
74
6
|
if (typeof string !== 'string') {
|
|
75
7
|
throw new TypeError('Expected a string');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-d54cae76.js';
|
|
2
2
|
import { c as clsx } from './clsx.m-071989db.js';
|
|
3
3
|
|
|
4
4
|
const badgeCss = ":host{display:inline-block}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.dso-badge{background-color:#666;border-radius:1em;color:#fff;display:inline-block;font-size:0.875em;line-height:1em;padding:4px 8px}.dso-badge.badge-info{background-color:#6ca4d9;color:#191919}.dso-badge.badge-primary{background-color:#275937;color:#fff}.dso-badge.badge-success{background-color:#39870c;color:#fff}.dso-badge.badge-warning{background-color:#dcd400;color:#191919}.dso-badge.badge-danger{background-color:#ce3f51;color:#fff}";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-d54cae76.js';
|
|
2
2
|
import { c as clsx } from './clsx.m-071989db.js';
|
|
3
3
|
|
|
4
4
|
const bannerCss = ":host{display:block;--di-status-danger:url(\"data:image/svg+xml,%3csvg id='status-danger-line' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e %3cg%3e %3cpath d='M22.6%2c18.51c.86%2c1.37.29%2c2.49-1.25%2c2.49H2.65C1.11%2c21%2c.54%2c19.88%2c1.4%2c18.51L10.44%2c4a1.7%2c1.7%2c0%2c0%2c1%2c3.12%2c0Z' style='fill: %23ce3f51'/%3e %3cpath d='M12%2c3a1.9%2c1.9%2c0%2c0%2c1%2c1.56%2c1l9%2c14.48c.86%2c1.37.29%2c2.49-1.25%2c2.49H2.65C1.11%2c21%2c.54%2c19.88%2c1.4%2c18.51L10.44%2c4A1.9%2c1.9%2c0%2c0%2c1%2c12%2c3m0-1A2.89%2c2.89%2c0%2c0%2c0%2c9.6%2c3.5L.55%2c18a2.75%2c2.75%2c0%2c0%2c0-.28%2c2.81A2.59%2c2.59%2c0%2c0%2c0%2c2.65%2c22h18.7a2.59%2c2.59%2c0%2c0%2c0%2c2.38-1.21A2.75%2c2.75%2c0%2c0%2c0%2c23.45%2c18L14.4%2c3.5A2.89%2c2.89%2c0%2c0%2c0%2c12%2c2Z' style='fill: white'/%3e %3c/g%3e %3cpath d='M12%2c16a1%2c1%2c0%2c0%2c1-1-.91V8.91a1%2c1%2c0%2c0%2c1%2c2%2c0v6.18A1%2c1%2c0%2c0%2c1%2c12%2c16Zm0%2c1a1%2c1%2c0%2c1%2c0%2c1%2c1A1%2c1%2c0%2c0%2c0%2c12%2c17Z' style='fill: white'/%3e %3c/svg%3e\");--di-status-warning:url(\"data:image/svg+xml,%3csvg id='status-warning' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e %3cg%3e %3cpath d='M22.6%2c18.51c.86%2c1.37.29%2c2.49-1.25%2c2.49H2.65C1.11%2c21%2c.54%2c19.88%2c1.4%2c18.51L10.44%2c4a1.7%2c1.7%2c0%2c0%2c1%2c3.12%2c0Z' style='fill: %23dcd400'/%3e %3cpath d='M12%2c3a1.9%2c1.9%2c0%2c0%2c1%2c1.56%2c1l9%2c14.48c.86%2c1.37.29%2c2.49-1.25%2c2.49H2.65C1.11%2c21%2c.54%2c19.88%2c1.4%2c18.51L10.44%2c4A1.9%2c1.9%2c0%2c0%2c1%2c12%2c3m0-1A2.89%2c2.89%2c0%2c0%2c0%2c9.6%2c3.5L.55%2c18a2.75%2c2.75%2c0%2c0%2c0-.28%2c2.81A2.59%2c2.59%2c0%2c0%2c0%2c2.65%2c22h18.7a2.59%2c2.59%2c0%2c0%2c0%2c2.38-1.21A2.75%2c2.75%2c0%2c0%2c0%2c23.45%2c18L14.4%2c3.5A2.89%2c2.89%2c0%2c0%2c0%2c12%2c2Z' style='fill: white'/%3e %3c/g%3e %3cpath d='M11.73%2c15.85a1%2c1%2c0%2c0%2c1-1-.91V8.76a1%2c1%2c0%2c0%2c1%2c2%2c0v6.18A1%2c1%2c0%2c0%2c1%2c11.73%2c15.85Zm0%2c1a1%2c1%2c0%2c1%2c0%2c1%2c1A1%2c1%2c0%2c0%2c0%2c11.73%2c16.85Z'/%3e %3c/svg%3e\");--di-download-grijs90:url(\"data:image/svg+xml,%3csvg id='download' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23191919%3b'%3e %3cpath fill='currentColor' d='M18.72%2c10.44%2c12%2c17l-6.7-6.52C4.8%2c10%2c5%2c9.63%2c5.63%2c9.63H8.5V1.82A.8.8%2c0%2c0%2c1%2c9.28%2c1h5.44a.8.8%2c0%2c0%2c1%2c.78.82V9.61h2.87C19%2c9.6%2c19.2%2c10%2c18.72%2c10.44ZM1%2c17v6H23V17Zm16%2c3a2%2c2%2c0%2c1%2c1-2-2A2%2c2%2c0%2c0%2c1%2c17%2c20Zm5%2c0a2%2c2%2c0%2c1%2c1-2-2A2%2c2%2c0%2c0%2c1%2c22%2c20Z'/%3e %3c/svg%3e\");--di-external-link-grijs90:url(\"data:image/svg+xml,%3csvg id='external-link' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23191919%3b'%3e %3cpath fill='currentColor' d='M19%2c6V9.69c0%2c.33-.2.41-.43.17L17.06%2c8.35l-3.35%2c3.36a1%2c1%2c0%2c0%2c1-1.42%2c0%2c1%2c1%2c0%2c0%2c1%2c0-1.42l3.36-3.35L14.14%2c5.43C13.9%2c5.19%2c14%2c5%2c14.31%2c5H19V6ZM18%2c17V13a1%2c1%2c0%2c0%2c0-2%2c0v4a1%2c1%2c0%2c0%2c1-1%2c1H7a1%2c1%2c0%2c0%2c1-1-1V9A1%2c1%2c0%2c0%2c1%2c7%2c8h4a1%2c1%2c0%2c0%2c0%2c0-2H7A3%2c3%2c0%2c0%2c0%2c4%2c9v8a3%2c3%2c0%2c0%2c0%2c3%2c3h8A3%2c3%2c0%2c0%2c0%2c18%2c17Z'/%3e %3c/svg%3e\")}*,*::after,*::before{box-sizing:border-box}.dso-banner{padding:16px 0;position:relative}";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-
|
|
1
|
+
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-d54cae76.js';
|
|
2
2
|
import { c as createIdentifier } from './create-identifier-22acd3a3.js';
|
|
3
3
|
|
|
4
4
|
var DaysOfWeek;
|
|
@@ -240,7 +240,7 @@ const localization = {
|
|
|
240
240
|
]
|
|
241
241
|
};
|
|
242
242
|
|
|
243
|
-
const datePickerCss = "
|
|
243
|
+
const datePickerCss = ".sc-dso-date-picker-h{display:block}.dso-date.sc-dso-date-picker *.sc-dso-date-picker,.dso-date.sc-dso-date-picker *.sc-dso-date-picker::before,.dso-date.sc-dso-date-picker *.sc-dso-date-picker::after{box-sizing:border-box}.dso-date.sc-dso-date-picker{box-sizing:border-box;color:#191919;display:block;font-family:\"Asap\", sans-serif;margin:0;position:relative;text-align:left;width:100%}.dso-date__input.sc-dso-date-picker{display:block;width:100%;height:40px;padding:6px 14px;font-size:16px;line-height:1.5;color:#191919;background-color:#fff;background-image:none;border:1px solid #275937;border-radius:4px;transition:border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s}.dso-date__input.sc-dso-date-picker::-moz-placeholder{color:#666;opacity:1}.dso-date__input.sc-dso-date-picker:-ms-input-placeholder{color:#666}.dso-date__input.sc-dso-date-picker::-webkit-input-placeholder{color:#666}.dso-date__input.sc-dso-date-picker::-ms-expand{background-color:transparent;border:0}.dso-date__input.sc-dso-date-picker:focus{border-color:#275937;outline:0;box-shadow:inset 0 0 0 1px #275937}.dso-date__input[disabled].sc-dso-date-picker,.dso-date__input[readonly].sc-dso-date-picker,fieldset[disabled].sc-dso-date-picker .dso-date__input.sc-dso-date-picker{background-color:#fff;opacity:1}.dso-date__input[disabled].sc-dso-date-picker,fieldset[disabled].sc-dso-date-picker .dso-date__input.sc-dso-date-picker{cursor:default}.dso-date__input[disabled].sc-dso-date-picker{border-color:#e5e5e5;color:#999}.dso-date__input[readonly].sc-dso-date-picker{border-width:1px}.dso-date__input[type=text].sc-dso-date-picker{line-height:40px}.dso-date__input[size].sc-dso-date-picker{width:auto}.dso-date__toggle.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;border-radius:0;border-bottom-right-radius:4px;border-top-right-radius:4px;color:#39870c;cursor:pointer;display:flex;height:38px;justify-content:center;padding:0;position:absolute;right:0;transform:translateY(-50%);top:50%;user-select:none;width:38px;z-index:2}.dso-date__toggle.sc-dso-date-picker:disabled{color:#afcf9d;cursor:pointer}.dso-date__dialog.sc-dso-date-picker{border-width:1px;display:flex;right:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;will-change:transform, opacity, visibility;z-index:600}@media (max-width: 35.9375em){.dso-date__dialog.sc-dso-date-picker{background:rgba(25, 25, 25, 0.5);bottom:0;position:fixed;left:0;right:0;top:0;transform:translateZ(0);transform-origin:bottom center}}.dso-date__dialog.is-left.sc-dso-date-picker{left:-11px;right:auto;width:auto}.dso-date__dialog.is-active.sc-dso-date-picker{opacity:1;transform:scale(1.0001) translateZ(0) translateY(0);visibility:visible}.dso-date__dialog-content.sc-dso-date-picker{background:#fff;border:1px solid rgba(0, 0, 0, 0.1);border-radius:4px;box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.4);margin-left:auto;margin-right:-1px;margin-top:8px;max-width:310px;min-width:290px;padding:16px;position:relative;transform:none;width:100%;z-index:600}@media (max-width: 35.9375em){.dso-date__dialog-content.sc-dso-date-picker{border:0;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px;bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active.sc-dso-date-picker .dso-date__dialog-content.sc-dso-date-picker{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.dso-date__table.sc-dso-date-picker{border-collapse:collapse;border-spacing:0;color:#191919;font-size:1rem;font-weight:400;line-height:1.25;min-width:280px;table-layout:fixed;text-align:center;width:100%}.dso-date__table-header.sc-dso-date-picker{font-size:0.875em;font-weight:600;height:36px;line-height:36px;text-decoration:none;text-transform:uppercase}.dso-date__cell.sc-dso-date-picker{height:40px;padding:1px;text-align:center;width:40px}.dso-date__day.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;box-shadow:0 0 0 1px transparent;color:#191919;cursor:pointer;display:inline-block;font-family:\"Asap\", sans-serif;font-variant-numeric:tabular-nums;font-weight:400;height:38px;line-height:0;padding:0;position:relative;text-align:center;vertical-align:middle;width:38px;z-index:1}.dso-date__day.is-today.sc-dso-date-picker{background:transparent;height:36px;box-shadow:0 0 0 1px #39870c;width:36px}.dso-date__day.sc-dso-date-picker:hover,.dso-date__day.sc-dso-date-picker:active{background:#39870c;color:#fff}.dso-date__day.sc-dso-date-picker:focus{background:transparent;box-shadow:0 0 0 2px #275937;color:#191919;height:34px;outline:0;width:34px}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker{background:#39870c;color:#fff}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker:focus{background:transparent}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker:focus span[aria-hidden=true].sc-dso-date-picker{background:#39870c;border:1px solid #fff;line-height:32px}.dso-date__day.is-outside.sc-dso-date-picker{background:#f2f2f2;box-shadow:none;color:#666;cursor:default;pointer-events:none}.dso-date__day.is-disabled.sc-dso-date-picker{background:#fff;cursor:default}.dso-date__day.is-disabled.sc-dso-date-picker:hover{color:#666}.dso-date__day.sc-dso-date-picker span[aria-hidden=true].sc-dso-date-picker{border-radius:50%;display:inline-block;height:34px;line-height:34px;width:34px}.dso-date__header.sc-dso-date-picker{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.dso-date__header.sc-dso-date-picker span.sc-dso-date-picker{font-size:0.875rem}.dso-date__nav.sc-dso-date-picker{white-space:nowrap}.dso-date__prev.sc-dso-date-picker,.dso-date__next.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:transparent;border:1px solid #39870c;border-radius:4px;box-sizing:border-box;color:#39870c;cursor:pointer;display:inline-flex;font-size:1em;height:32px;justify-content:center;margin-left:8px;padding:0;width:32px}@media (max-width: 35.9375em){.dso-date__prev.sc-dso-date-picker,.dso-date__next.sc-dso-date-picker{height:40px;width:40px}}.dso-date__prev.sc-dso-date-picker:hover,.dso-date__prev.sc-dso-date-picker:active,.dso-date__next.sc-dso-date-picker:hover,.dso-date__next.sc-dso-date-picker:active{background-color:#39870c;color:#fff}.dso-date__prev.sc-dso-date-picker:focus,.dso-date__next.sc-dso-date-picker:focus{background:transparent;color:#39870c}.dso-date__prev.sc-dso-date-picker:disabled,.dso-date__prev.sc-dso-date-picker:disabled:hover,.dso-date__next.sc-dso-date-picker:disabled,.dso-date__next.sc-dso-date-picker:disabled:hover{background-color:#fff;border-color:#afcf9d;color:#afcf9d;opacity:1}.dso-date__prev.sc-dso-date-picker svg.sc-dso-date-picker,.dso-date__next.sc-dso-date-picker svg.sc-dso-date-picker{margin:0 auto}.dso-date__select.sc-dso-date-picker{display:inline-flex;height:28px;line-height:28px;position:relative}.dso-date__select.sc-dso-date-picker span.sc-dso-date-picker{margin-right:4px}.dso-date__select.sc-dso-date-picker select.sc-dso-date-picker{color:#275937;cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.dso-date__select.sc-dso-date-picker select.sc-dso-date-picker:focus+.dso-date__select-label.sc-dso-date-picker{box-shadow:0 0 0 2px #275937}.dso-date__select.sc-dso-date-picker select.sc-dso-date-picker:disabled{color:#afcf9d}.dso-date__select-label.sc-dso-date-picker{align-items:center;border-radius:4px;color:#39870c;display:flex;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.dso-date__select-label.sc-dso-date-picker span.sc-dso-date-picker{font-size:1.25rem;font-weight:600;line-height:1.25}.dso-date__select-label.sc-dso-date-picker svg.sc-dso-date-picker{width:16px;height:16px}.dso-date__mobile.sc-dso-date-picker{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;font-size:1em;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.dso-date__mobile.sc-dso-date-picker{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-16px;top:-16px;width:auto}}.dso-date__mobile-heading.sc-dso-date-picker{display:inline-block;font-weight:600;max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.dso-date__mobile-heading.sc-dso-date-picker{display:none}}.dso-date__close.sc-dso-date-picker{-webkit-appearance:none;align-items:center;appearance:none;background-color:#fff;border:0;border-radius:50%;color:#39870c;cursor:pointer;display:flex;font-size:1em;height:32px;justify-content:center;margin-right:-4px;padding:0;width:32px}@media (min-width: 36em){.dso-date__close.sc-dso-date-picker{margin-right:0;opacity:0}}.dso-date__close.sc-dso-date-picker:focus{box-shadow:0 0 0 2px #275937;outline:none}@media (min-width: 36em){.dso-date__close.sc-dso-date-picker:focus{opacity:1}}.dso-date__vhidden.sc-dso-date-picker{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}";
|
|
244
244
|
|
|
245
245
|
function range(from, to) {
|
|
246
246
|
var result = [];
|
|
@@ -262,7 +262,7 @@ const keyCode = {
|
|
|
262
262
|
RIGHT: 39,
|
|
263
263
|
DOWN: 40,
|
|
264
264
|
};
|
|
265
|
-
const DISALLOWED_CHARACTERS = /[^0-9
|
|
265
|
+
const DISALLOWED_CHARACTERS = /[^0-9\-]+/g;
|
|
266
266
|
const TRANSITION_MS = 300;
|
|
267
267
|
let DsoDatePicker = class {
|
|
268
268
|
constructor(hostRef) {
|
|
@@ -474,7 +474,49 @@ let DsoDatePicker = class {
|
|
|
474
474
|
};
|
|
475
475
|
this.handleInputChange = (e) => {
|
|
476
476
|
const target = e.target;
|
|
477
|
-
this.setValue(target.value
|
|
477
|
+
this.setValue(target.value);
|
|
478
|
+
};
|
|
479
|
+
this.handleKeyPress = (e) => {
|
|
480
|
+
if (e.key.search(DISALLOWED_CHARACTERS) > -1) {
|
|
481
|
+
e.preventDefault();
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
this.prepareEvent = (value) => {
|
|
485
|
+
var event = {
|
|
486
|
+
component: "dso-date-picker",
|
|
487
|
+
value: "",
|
|
488
|
+
valueAsDate: undefined
|
|
489
|
+
};
|
|
490
|
+
if (value instanceof Date) {
|
|
491
|
+
event.valueAsDate = value;
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
event.value = value;
|
|
495
|
+
event.valueAsDate = parseDutchDate(value);
|
|
496
|
+
}
|
|
497
|
+
if (event.valueAsDate) {
|
|
498
|
+
event.value = printDutchDate(event.valueAsDate);
|
|
499
|
+
}
|
|
500
|
+
if (!event.valueAsDate && this.required) {
|
|
501
|
+
event.error = "required";
|
|
502
|
+
}
|
|
503
|
+
if (event.value && !event.valueAsDate) {
|
|
504
|
+
event.error = "invalid";
|
|
505
|
+
}
|
|
506
|
+
if (event.valueAsDate && (this.min || this.max)) {
|
|
507
|
+
const min = parseDutchDate(this.min);
|
|
508
|
+
const max = parseDutchDate(this.max);
|
|
509
|
+
const clampValue = clamp(event.valueAsDate, min, max);
|
|
510
|
+
if (clampValue !== event.valueAsDate && clampValue === min) {
|
|
511
|
+
event.valueAsDate = undefined;
|
|
512
|
+
event.error = "min-range";
|
|
513
|
+
}
|
|
514
|
+
else if (clampValue !== event.valueAsDate && clampValue === max) {
|
|
515
|
+
event.valueAsDate = undefined;
|
|
516
|
+
event.error = "max-range";
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return event;
|
|
478
520
|
};
|
|
479
521
|
this.processFocusedDayNode = (element) => {
|
|
480
522
|
this.focusedDayNode = element;
|
|
@@ -487,13 +529,12 @@ let DsoDatePicker = class {
|
|
|
487
529
|
* Component event handling.
|
|
488
530
|
*/
|
|
489
531
|
handleDocumentClick(e) {
|
|
490
|
-
var _a;
|
|
491
532
|
if (!this.open) {
|
|
492
533
|
return;
|
|
493
534
|
}
|
|
494
535
|
const path = e.composedPath();
|
|
495
536
|
for (const target of path) {
|
|
496
|
-
if (target instanceof Node &&
|
|
537
|
+
if (target instanceof Node && this.element.contains(target)) {
|
|
497
538
|
return;
|
|
498
539
|
}
|
|
499
540
|
}
|
|
@@ -567,27 +608,7 @@ let DsoDatePicker = class {
|
|
|
567
608
|
this.focusedDay = clamp(day, parseDutchDate(this.min), parseDutchDate(this.max));
|
|
568
609
|
}
|
|
569
610
|
setValue(value) {
|
|
570
|
-
|
|
571
|
-
component: "dso-date-picker",
|
|
572
|
-
value: "",
|
|
573
|
-
valueAsDate: undefined
|
|
574
|
-
};
|
|
575
|
-
if (value instanceof Date) {
|
|
576
|
-
event.valueAsDate = value;
|
|
577
|
-
}
|
|
578
|
-
else {
|
|
579
|
-
event.value = value;
|
|
580
|
-
event.valueAsDate = parseDutchDate(value);
|
|
581
|
-
}
|
|
582
|
-
if (event.valueAsDate) {
|
|
583
|
-
event.value = printDutchDate(event.valueAsDate);
|
|
584
|
-
}
|
|
585
|
-
if (!event.valueAsDate && this.required) {
|
|
586
|
-
event.error = "required";
|
|
587
|
-
}
|
|
588
|
-
if (event.value && !event.valueAsDate) {
|
|
589
|
-
event.error = "invalid";
|
|
590
|
-
}
|
|
611
|
+
const event = this.prepareEvent(value);
|
|
591
612
|
this.value = event.value;
|
|
592
613
|
this.dateChange.emit(event);
|
|
593
614
|
}
|
|
@@ -622,7 +643,7 @@ let DsoDatePicker = class {
|
|
|
622
643
|
if (maxDate) {
|
|
623
644
|
maxYear = Math.min(maxYear, maxDate.getFullYear());
|
|
624
645
|
}
|
|
625
|
-
return (h(Host, null, h("div", { class: "dso-date" }, h("div", { class: "dso-date__input-wrapper" }, h("input", { class: "dso-date__input", value: this.value, placeholder: this.localization.placeholder, id: this.identifier, disabled: this.disabled, role: this.role, required: this.required ? true : undefined, "aria-autocomplete": "none", onInput: this.handleInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown, autoComplete: "off", ref: element => (this.datePickerInput = element) }), h("button", { type: "button", class: "dso-date__toggle", onClick: this.toggleOpen, disabled: this.disabled, ref: element => (this.datePickerButton = element) }, h("span", { class: "dso-date__toggle-icon" }, h("dso-icon", { icon: "calendar" })), h("span", { class: "dso-date__vhidden" }, this.localization.buttonLabel, formattedDate && (h("span", null, ", ", this.localization.selectedDateMessage, " ", formattedDate))))), h("div", { class: {
|
|
646
|
+
return (h(Host, null, h("div", { class: "dso-date" }, h("div", { class: "dso-date__input-wrapper" }, h("input", { class: "dso-date__input", value: this.value, placeholder: this.localization.placeholder, id: this.identifier, disabled: this.disabled, role: this.role, required: this.required ? true : undefined, "aria-autocomplete": "none", onKeyPress: this.handleKeyPress, onInput: this.handleInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown, autoComplete: "off", ref: element => (this.datePickerInput = element) }), h("button", { type: "button", class: "dso-date__toggle", onClick: this.toggleOpen, disabled: this.disabled, ref: element => (this.datePickerButton = element) }, h("span", { class: "dso-date__toggle-icon" }, h("dso-icon", { icon: "calendar" })), h("span", { class: "dso-date__vhidden" }, this.localization.buttonLabel, formattedDate && (h("span", null, ", ", this.localization.selectedDateMessage, " ", formattedDate))))), h("div", { class: {
|
|
626
647
|
"dso-date__dialog": true,
|
|
627
648
|
"is-left": this.direction === "left",
|
|
628
649
|
"is-active": this.open,
|
|
@@ -1,231 +1,7 @@
|
|
|
1
|
-
import { r as registerInstance, h, F as Fragment, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, F as Fragment, g as getElement } from './index-d54cae76.js';
|
|
2
|
+
import { t as tabbable } from './index.esm-a1362957.js';
|
|
2
3
|
import { v as v4 } from './v4-fa4bb814.js';
|
|
3
4
|
|
|
4
|
-
/*!
|
|
5
|
-
* tabbable 5.2.1
|
|
6
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
7
|
-
*/
|
|
8
|
-
var candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])', 'details>summary:first-of-type', 'details'];
|
|
9
|
-
var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
|
|
10
|
-
var matches = typeof Element === 'undefined' ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
11
|
-
|
|
12
|
-
var getCandidates = function getCandidates(el, includeContainer, filter) {
|
|
13
|
-
var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
|
|
14
|
-
|
|
15
|
-
if (includeContainer && matches.call(el, candidateSelector)) {
|
|
16
|
-
candidates.unshift(el);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
candidates = candidates.filter(filter);
|
|
20
|
-
return candidates;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var isContentEditable = function isContentEditable(node) {
|
|
24
|
-
return node.contentEditable === 'true';
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var getTabindex = function getTabindex(node) {
|
|
28
|
-
var tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);
|
|
29
|
-
|
|
30
|
-
if (!isNaN(tabindexAttr)) {
|
|
31
|
-
return tabindexAttr;
|
|
32
|
-
} // Browsers do not return `tabIndex` correctly for contentEditable nodes;
|
|
33
|
-
// so if they don't have a tabindex attribute specifically set, assume it's 0.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (isContentEditable(node)) {
|
|
37
|
-
return 0;
|
|
38
|
-
} // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
|
|
39
|
-
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
|
|
40
|
-
// yet they are still part of the regular tab order; in FF, they get a default
|
|
41
|
-
// `tabIndex` of 0; since Chrome still puts those elements in the regular tab
|
|
42
|
-
// order, consider their tab index to be 0.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if ((node.nodeName === 'AUDIO' || node.nodeName === 'VIDEO' || node.nodeName === 'DETAILS') && node.getAttribute('tabindex') === null) {
|
|
46
|
-
return 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return node.tabIndex;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
|
|
53
|
-
return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var isInput = function isInput(node) {
|
|
57
|
-
return node.tagName === 'INPUT';
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
var isHiddenInput = function isHiddenInput(node) {
|
|
61
|
-
return isInput(node) && node.type === 'hidden';
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var isDetailsWithSummary = function isDetailsWithSummary(node) {
|
|
65
|
-
var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
|
|
66
|
-
return child.tagName === 'SUMMARY';
|
|
67
|
-
});
|
|
68
|
-
return r;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
var getCheckedRadio = function getCheckedRadio(nodes, form) {
|
|
72
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
73
|
-
if (nodes[i].checked && nodes[i].form === form) {
|
|
74
|
-
return nodes[i];
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
var isTabbableRadio = function isTabbableRadio(node) {
|
|
80
|
-
if (!node.name) {
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
var radioScope = node.form || node.ownerDocument;
|
|
85
|
-
|
|
86
|
-
var queryRadios = function queryRadios(name) {
|
|
87
|
-
return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
var radioSet;
|
|
91
|
-
|
|
92
|
-
if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
|
|
93
|
-
radioSet = queryRadios(window.CSS.escape(node.name));
|
|
94
|
-
} else {
|
|
95
|
-
try {
|
|
96
|
-
radioSet = queryRadios(node.name);
|
|
97
|
-
} catch (err) {
|
|
98
|
-
// eslint-disable-next-line no-console
|
|
99
|
-
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);
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
var checked = getCheckedRadio(radioSet, node.form);
|
|
105
|
-
return !checked || checked === node;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
var isRadio = function isRadio(node) {
|
|
109
|
-
return isInput(node) && node.type === 'radio';
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
var isNonTabbableRadio = function isNonTabbableRadio(node) {
|
|
113
|
-
return isRadio(node) && !isTabbableRadio(node);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
var isHidden = function isHidden(node, displayCheck) {
|
|
117
|
-
if (getComputedStyle(node).visibility === 'hidden') {
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
|
|
122
|
-
var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
|
|
123
|
-
|
|
124
|
-
if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (!displayCheck || displayCheck === 'full') {
|
|
129
|
-
while (node) {
|
|
130
|
-
if (getComputedStyle(node).display === 'none') {
|
|
131
|
-
return true;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
node = node.parentElement;
|
|
135
|
-
}
|
|
136
|
-
} else if (displayCheck === 'non-zero-area') {
|
|
137
|
-
var _node$getBoundingClie = node.getBoundingClientRect(),
|
|
138
|
-
width = _node$getBoundingClie.width,
|
|
139
|
-
height = _node$getBoundingClie.height;
|
|
140
|
-
|
|
141
|
-
return width === 0 && height === 0;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return false;
|
|
145
|
-
}; // form fields (nested) inside a disabled fieldset are not focusable/tabbable
|
|
146
|
-
// unless they are in the _first_ <legend> element of the top-most disabled
|
|
147
|
-
// fieldset
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
|
|
151
|
-
if (isInput(node) || node.tagName === 'SELECT' || node.tagName === 'TEXTAREA' || node.tagName === 'BUTTON') {
|
|
152
|
-
var parentNode = node.parentElement;
|
|
153
|
-
|
|
154
|
-
while (parentNode) {
|
|
155
|
-
if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
|
|
156
|
-
// look for the first <legend> as an immediate child of the disabled
|
|
157
|
-
// <fieldset>: if the node is in that legend, it'll be enabled even
|
|
158
|
-
// though the fieldset is disabled; otherwise, the node is in a
|
|
159
|
-
// secondary/subsequent legend, or somewhere else within the fieldset
|
|
160
|
-
// (however deep nested) and it'll be disabled
|
|
161
|
-
for (var i = 0; i < parentNode.children.length; i++) {
|
|
162
|
-
var child = parentNode.children.item(i);
|
|
163
|
-
|
|
164
|
-
if (child.tagName === 'LEGEND') {
|
|
165
|
-
if (child.contains(node)) {
|
|
166
|
-
return false;
|
|
167
|
-
} // the node isn't in the first legend (in doc order), so no matter
|
|
168
|
-
// where it is now, it'll be disabled
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
return true;
|
|
172
|
-
}
|
|
173
|
-
} // the node isn't in a legend, so no matter where it is now, it'll be disabled
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
parentNode = parentNode.parentElement;
|
|
180
|
-
}
|
|
181
|
-
} // else, node's tabbable/focusable state should not be affected by a fieldset's
|
|
182
|
-
// enabled/disabled state
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return false;
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
|
|
189
|
-
if (node.disabled || isHiddenInput(node) || isHidden(node, options.displayCheck) || // For a details element with a summary, the summary element gets the focus
|
|
190
|
-
isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
|
|
191
|
-
return false;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return true;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
|
|
198
|
-
if (!isNodeMatchingSelectorFocusable(options, node) || isNonTabbableRadio(node) || getTabindex(node) < 0) {
|
|
199
|
-
return false;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
return true;
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
var tabbable = function tabbable(el, options) {
|
|
206
|
-
options = options || {};
|
|
207
|
-
var regularTabbables = [];
|
|
208
|
-
var orderedTabbables = [];
|
|
209
|
-
var candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
|
|
210
|
-
candidates.forEach(function (candidate, i) {
|
|
211
|
-
var candidateTabindex = getTabindex(candidate);
|
|
212
|
-
|
|
213
|
-
if (candidateTabindex === 0) {
|
|
214
|
-
regularTabbables.push(candidate);
|
|
215
|
-
} else {
|
|
216
|
-
orderedTabbables.push({
|
|
217
|
-
documentOrder: i,
|
|
218
|
-
tabIndex: candidateTabindex,
|
|
219
|
-
node: candidate
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
var tabbableNodes = orderedTabbables.sort(sortOrderedTabbables).map(function (a) {
|
|
224
|
-
return a.node;
|
|
225
|
-
}).concat(regularTabbables);
|
|
226
|
-
return tabbableNodes;
|
|
227
|
-
};
|
|
228
|
-
|
|
229
5
|
const dropdownMenuCss = ":host(:focus){outline:none}:host{--di-check-wit:url(\"data:image/svg+xml,%3csvg id='check' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M10.11%2c18%2c5.29%2c13.31A.92.92%2c0%2c0%2c1%2c5.3%2c12a1%2c1%2c0%2c0%2c1%2c1.41%2c0l3.4%2c3.3%2c7.18-7a1%2c1%2c0%2c0%2c1%2c1.41%2c0%2c.92.92%2c0%2c0%2c1%2c0%2c1.35Z'/%3e %3c/svg%3e\");--di-chevron-down:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-down-scampi:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23676cb0%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-down-wit:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-up:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");--di-chevron-up-scampi:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23676cb0%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");--di-chevron-up-wit:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");display:inline-block;position:relative}";
|
|
230
6
|
|
|
231
7
|
let DropdownMenu = class {
|
|
@@ -321,9 +97,6 @@ let DropdownMenu = class {
|
|
|
321
97
|
this.openPopup();
|
|
322
98
|
}
|
|
323
99
|
}
|
|
324
|
-
componentDidRender() {
|
|
325
|
-
this.host.setAttribute("tabindex", "-1");
|
|
326
|
-
}
|
|
327
100
|
componentWillRender() {
|
|
328
101
|
for (const li of Array.from(this.host.getElementsByTagName("li"))) {
|
|
329
102
|
for (const tab of tabbable(li)) {
|
|
@@ -338,6 +111,7 @@ let DropdownMenu = class {
|
|
|
338
111
|
}
|
|
339
112
|
}
|
|
340
113
|
openPopup() {
|
|
114
|
+
this.host.setAttribute("tabindex", "-1");
|
|
341
115
|
this.host.addEventListener("keydown", this.keyDownListener);
|
|
342
116
|
this.host.addEventListener("focusout", this.focusOutListener);
|
|
343
117
|
this.button.setAttribute("aria-expanded", "true");
|
|
@@ -347,11 +121,24 @@ let DropdownMenu = class {
|
|
|
347
121
|
this.host.removeEventListener("keydown", this.keyDownListener);
|
|
348
122
|
this.host.removeEventListener("focusout", this.focusOutListener);
|
|
349
123
|
this.button.setAttribute("aria-expanded", "false");
|
|
124
|
+
this.host.removeAttribute("tabindex");
|
|
350
125
|
this.tabbables.forEach((tabbable) => tabbable.removeEventListener("click", this.escape));
|
|
351
126
|
}
|
|
127
|
+
getActiveElement(root = document) {
|
|
128
|
+
const activeEl = root.activeElement;
|
|
129
|
+
if (!activeEl) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
if (activeEl.shadowRoot) {
|
|
133
|
+
return this.getActiveElement(activeEl.shadowRoot);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return activeEl;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
352
139
|
tabInPopup(direction) {
|
|
353
140
|
const tabs = this.tabbables;
|
|
354
|
-
const currentIndex = tabs.findIndex((e) => e ===
|
|
141
|
+
const currentIndex = tabs.findIndex((e) => e === this.getActiveElement());
|
|
355
142
|
let nextIndex = currentIndex + direction;
|
|
356
143
|
if (nextIndex >= tabs.length) {
|
|
357
144
|
nextIndex = 0;
|