@dso-toolkit/core 31.0.0 → 32.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-banner.cjs.entry.js +1 -1
- package/dist/cjs/dso-date-picker.cjs.entry.js +54 -14
- package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +44 -0
- package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
- package/dist/cjs/dso-icon.cjs.entry.js +29 -5
- package/dist/cjs/dso-info-button.cjs.entry.js +2 -2
- package/dist/cjs/dso-info_2.cjs.entry.js +1 -1
- package/dist/cjs/dso-label.cjs.entry.js +1 -1
- package/dist/cjs/dso-ozon-content.cjs.entry.js +48 -11
- package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/dso-tree-view.cjs.entry.js +23 -19
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/alert/alert.css +2 -0
- package/dist/collection/components/banner/banner.css +2 -0
- package/dist/collection/components/date-picker/date-localization.js +1 -1
- package/dist/collection/components/date-picker/date-picker.css +0 -3
- package/dist/collection/components/date-picker/date-picker.js +108 -14
- package/dist/collection/components/date-picker/date-picker.template.js +2 -1
- package/dist/collection/components/helpcenter-panel/helpcenter-panel.css +312 -0
- package/dist/collection/components/helpcenter-panel/helpcenter-panel.js +92 -0
- package/dist/collection/components/helpcenter-panel/helpcenter-panel.template.js +13 -0
- package/dist/collection/components/highlight-box/highlight-box.css +1 -1
- package/dist/collection/components/icon/icon.js +8 -0
- package/dist/collection/components/info/info.css +4 -4
- package/dist/collection/components/info-button/info-button.css +8 -0
- package/dist/collection/components/info-button/info-button.js +18 -1
- package/dist/collection/components/info-button/info-button.template.js +2 -1
- package/dist/collection/components/label/label.decorator.js +6 -0
- package/dist/collection/components/label/label.js +1 -0
- package/dist/collection/components/label/label.template.js +10 -2
- package/dist/collection/components/ozon-content/ozon-content.transformer.js +1 -1
- package/dist/collection/components/toggletip/toggletip.js +18 -1
- package/dist/collection/components/toggletip/toggletip.template.js +2 -1
- package/dist/collection/components/tree-view/tree-item.js +10 -11
- package/dist/collection/components/tree-view/tree-view.interfaces.js +1 -0
- package/dist/collection/components/tree-view/tree-view.js +18 -13
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +207 -61
- package/dist/dso-toolkit/dso-toolkit.css +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/{p-968d9e1d.entry.js → p-19de4cc7.entry.js} +1 -1
- package/dist/dso-toolkit/p-5665f1ee.entry.js +1 -0
- package/dist/dso-toolkit/p-75233655.entry.js +1 -0
- package/dist/dso-toolkit/{p-d748df48.entry.js → p-83f166b3.entry.js} +1 -1
- package/dist/dso-toolkit/p-9e9f8bcf.entry.js +1 -0
- package/dist/dso-toolkit/p-a52d3623.entry.js +1 -0
- package/dist/dso-toolkit/p-ad8f467f.entry.js +1 -0
- package/dist/dso-toolkit/p-affe82e6.entry.js +1 -0
- package/dist/dso-toolkit/p-b07991b9.entry.js +1 -0
- package/dist/dso-toolkit/{p-ae6209c6.entry.js → p-be5682cc.entry.js} +1 -1
- package/dist/dso-toolkit/p-e03d7741.entry.js +1 -0
- package/dist/dso-toolkit/{p-69f366a9.entry.js → p-e2dc97c4.entry.js} +1 -1
- package/dist/esm/dso-alert.entry.js +1 -1
- package/dist/esm/dso-banner.entry.js +1 -1
- package/dist/esm/dso-date-picker.entry.js +54 -14
- package/dist/esm/dso-helpcenter-panel.entry.js +40 -0
- package/dist/esm/dso-highlight-box.entry.js +1 -1
- package/dist/esm/dso-icon.entry.js +29 -5
- package/dist/esm/dso-info-button.entry.js +2 -2
- package/dist/esm/dso-info_2.entry.js +1 -1
- package/dist/esm/dso-label.entry.js +1 -1
- package/dist/esm/dso-ozon-content.entry.js +48 -11
- package/dist/esm/dso-toggletip.entry.js +1 -1
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/dso-tree-view.entry.js +24 -20
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts +20 -0
- package/dist/types/components/date-picker/date-picker.template.d.ts +1 -1
- package/dist/types/components/helpcenter-panel/helpcenter-panel.d.ts +11 -0
- package/dist/types/components/helpcenter-panel/helpcenter-panel.template.d.ts +2 -0
- package/dist/types/components/info-button/info-button.d.ts +1 -0
- package/dist/types/components/info-button/info-button.template.d.ts +1 -1
- package/dist/types/components/label/label.decorator.d.ts +3 -0
- package/dist/types/components/label/label.template.d.ts +1 -1
- package/dist/types/components/toggletip/toggletip.d.ts +1 -0
- package/dist/types/components/toggletip/toggletip.template.d.ts +1 -1
- package/dist/types/components/tree-view/tree-view.d.ts +1 -1
- package/dist/types/components/tree-view/tree-view.interfaces.d.ts +24 -0
- package/dist/types/components.d.ts +39 -2
- package/package.json +1 -1
- package/dist/dso-toolkit/p-187782ee.entry.js +0 -1
- package/dist/dso-toolkit/p-2c6e9460.entry.js +0 -1
- package/dist/dso-toolkit/p-378fb428.entry.js +0 -1
- package/dist/dso-toolkit/p-453e2c6f.entry.js +0 -1
- package/dist/dso-toolkit/p-5a67f3f7.entry.js +0 -1
- package/dist/dso-toolkit/p-6fcc89f9.entry.js +0 -1
- package/dist/dso-toolkit/p-faf19a1d.entry.js +0 -1
|
@@ -6,23 +6,22 @@ const index = require('./index-fcdfdd38.js');
|
|
|
6
6
|
const clsx_m = require('./clsx.m-b00fa5e1.js');
|
|
7
7
|
|
|
8
8
|
const DsoTreeItem = ({ owner, ancestors, item, index: index$1, level, setSize }) => {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
return (index.h("li", { key: item.reference, class: clsx_m.clsx('tree-item', { 'has-child': item.hasItems }), role:
|
|
9
|
+
var _a, _b, _c;
|
|
10
|
+
return (index.h("li", { key: item.reference, class: clsx_m.clsx('tree-item', { 'has-child': item.hasItems }), role: 'none' },
|
|
11
11
|
index.h("div", { class: "tree-branch-control" }, item.hasItems
|
|
12
12
|
?
|
|
13
13
|
index.h("div", { onClick: (e) => owner.itemClick(e, ancestors, item) },
|
|
14
14
|
index.h("dso-icon", { icon: item.open ? 'chevron-down' : 'chevron-right' }))
|
|
15
15
|
: index.h("dso-icon", null)),
|
|
16
|
-
index.h("p", { class: "tree-content", tabindex: level === 1 && index$1 === 0 ? 0 : -1, onClick: (e) => owner.itemClick(e, ancestors, item) },
|
|
16
|
+
index.h("p", { class: "tree-content", tabindex: level === 1 && index$1 === 0 ? 0 : -1, role: "treeitem", "aria-expanded": item.hasItems ? '' + (!!item.open && !!((_a = item.items) === null || _a === void 0 ? void 0 : _a.length)) : undefined, "aria-level": level, "aria-setsize": setSize, "aria-posinset": index$1 + 1, "aria-busy": item.loading ? 'true' : undefined, onClick: (e) => owner.itemClick(e, ancestors, item) },
|
|
17
17
|
item.href
|
|
18
|
-
? index.h("a", { href: item.href }, item.label)
|
|
19
|
-
: index.h("span", null, item.label), (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
item.hasItems && !item.items && item.loading
|
|
18
|
+
? index.h("a", { href: item.href, tabindex: "-1" }, item.label)
|
|
19
|
+
: index.h("span", null, item.label), (_b = item.icons) === null || _b === void 0 ? void 0 :
|
|
20
|
+
_b.map((icon) => index.h("dso-icon", { icon: icon.icon, title: icon.label }))),
|
|
21
|
+
item.open &&
|
|
22
|
+
index.h(index.Fragment, null, item.hasItems && !item.items && item.loading
|
|
23
23
|
? index.h("dso-progress-indicator", { size: "small", label: "Resultaten laden: een moment geduld alstublieft." })
|
|
24
|
-
:
|
|
25
|
-
item.open && ((_b = item.items) === null || _b === void 0 ? void 0 : _b.map((childItem, index$1, org) => index.h(DsoTreeItem, { owner: owner, ancestors: [...ancestors, item], item: childItem, index: index$1, level: level + 1, setSize: org.length }))))));
|
|
24
|
+
: index.h("ul", { role: "group" }, (_c = item.items) === null || _c === void 0 ? void 0 : _c.map((childItem, index$1, org) => index.h(DsoTreeItem, { owner: owner, ancestors: [...ancestors, item], item: childItem, index: index$1, level: level + 1, setSize: org.length }))))));
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
const treeViewCss = ":host ul{list-style-type:none}:host ul[role=tree]{padding-left:0}:host li[role=treeitem]>ul{padding-left:1.5em}:host .tree-branch-control{cursor:pointer;display:inline-block}:host .tree-content{cursor:pointer;display:inline-block;margin:8px 0}:host .tree-content a,:host .tree-content a:visited{color:#39870c;text-decoration:none}:host .tree-content a:hover,:host .tree-content a:focus{color:#676cb0;text-decoration:underline}:host .tree-content a:active{text-decoration:none}:host .tree-content dso-icon{vertical-align:text-bottom;font-size:0.75em;margin-left:0.5em}*,*::after,*::before{box-sizing:border-box}";
|
|
@@ -76,11 +75,16 @@ let TreeView = class {
|
|
|
76
75
|
event.preventDefault();
|
|
77
76
|
};
|
|
78
77
|
this.itemClick = (event, ancestors, item) => {
|
|
79
|
-
var _a;
|
|
80
78
|
if (!(event.target instanceof HTMLElement)) {
|
|
81
79
|
return;
|
|
82
80
|
}
|
|
83
|
-
|
|
81
|
+
const contentElement = event.target.closest('.tree-content');
|
|
82
|
+
if (contentElement) {
|
|
83
|
+
const tree = event.composedPath().find(item => (item instanceof HTMLElement) ? item.className === 'dso-tree' : false);
|
|
84
|
+
if (!(contentElement instanceof HTMLParagraphElement) || !(tree instanceof HTMLElement)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
TreeView.setFocus(tree, contentElement);
|
|
84
88
|
this.clickItem.emit([...ancestors, item]);
|
|
85
89
|
return;
|
|
86
90
|
}
|
|
@@ -122,27 +126,27 @@ let TreeView = class {
|
|
|
122
126
|
TreeView.setFocus(tree, focusableItems[index]);
|
|
123
127
|
}
|
|
124
128
|
static expandItemOrFocusChild(tree, target) {
|
|
125
|
-
var _a
|
|
126
|
-
if ((
|
|
129
|
+
var _a;
|
|
130
|
+
if ((target === null || target === void 0 ? void 0 : target.getAttribute('aria-expanded')) === 'true') {
|
|
127
131
|
TreeView.moveFocus(tree, target, 'next');
|
|
128
132
|
}
|
|
129
133
|
else {
|
|
130
|
-
const controlElement = (
|
|
134
|
+
const controlElement = (_a = target.previousElementSibling) === null || _a === void 0 ? void 0 : _a.firstElementChild;
|
|
131
135
|
if (controlElement instanceof HTMLElement) {
|
|
132
136
|
controlElement.click();
|
|
133
137
|
}
|
|
134
138
|
}
|
|
135
139
|
}
|
|
136
140
|
static collapseItemOrFocusParent(tree, target) {
|
|
137
|
-
var _a, _b, _c
|
|
138
|
-
if ((
|
|
139
|
-
const controlElement = (
|
|
141
|
+
var _a, _b, _c;
|
|
142
|
+
if ((target === null || target === void 0 ? void 0 : target.getAttribute('aria-expanded')) === 'true') {
|
|
143
|
+
const controlElement = (_a = target.previousElementSibling) === null || _a === void 0 ? void 0 : _a.firstElementChild;
|
|
140
144
|
if (controlElement instanceof HTMLElement) {
|
|
141
145
|
controlElement.click();
|
|
142
146
|
}
|
|
143
147
|
}
|
|
144
148
|
else {
|
|
145
|
-
const parentTarget = (
|
|
149
|
+
const parentTarget = (_c = (_b = target === null || target === void 0 ? void 0 : target.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.previousElementSibling;
|
|
146
150
|
if (parentTarget instanceof HTMLElement) {
|
|
147
151
|
TreeView.setFocus(tree, parentTarget);
|
|
148
152
|
}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["dso-map-base-layers.cjs",[[1,"dso-map-base-layers",{"baseLayers":[16],"selectedBaseLayer":[1040]}]]],["dso-map-overlays.cjs",[[1,"dso-map-overlays",{"overlays":[16],"checkedOverlays":[1040]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"active":[32]}]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16]}]]],["dso-date-picker.cjs",[[1,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[4],"value":[
|
|
17
|
+
return index.bootstrapLazy([["dso-map-base-layers.cjs",[[1,"dso-map-base-layers",{"baseLayers":[16],"selectedBaseLayer":[1040]}]]],["dso-map-overlays.cjs",[[1,"dso-map-overlays",{"overlays":[16],"checkedOverlays":[1040]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16]}]]],["dso-date-picker.cjs",[[1,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[4],"dsoAutofocus":[4,"dso-autofocus"],"value":[1537],"min":[1],"max":[1],"activeFocus":[32],"focusedDay":[32],"open":[32],"setFocus":[64],"show":[64],"hide":[64]},[[6,"click","handleDocumentClick"]]]]],["dso-helpcenter-panel.cjs",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]}]]],["dso-label.cjs",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"hover":[32]}]]],["dso-map-controls.cjs",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-alert.cjs",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter.cjs",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-autosuggest.cjs",[[6,"dso-autosuggest",{"suggestions":[16],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32]},[[4,"click","onDocumentClick"]]]]],["dso-badge.cjs",[[1,"dso-badge",{"status":[1]}]]],["dso-banner.cjs",[[1,"dso-banner",{"status":[1]}]]],["dso-dropdown-menu.cjs",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-highlight-box.cjs",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content.cjs",[[0,"dso-ozon-content",{"content":[1]},[[0,"click","handleClick"]]]]],["dso-progress-bar.cjs",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-progress-indicator.cjs",[[1,"dso-progress-indicator",{"label":[1],"size":[1],"block":[4]}]]],["dso-tooltip.cjs",[[1,"dso-tooltip",{"position":[1],"for":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32],"activate":[64],"deactivate":[64]},[[0,"click","listenClick"]]]]],["dso-info-button.cjs",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1]}]]],["dso-info_2.cjs",[[1,"dso-selectable",{"type":[1],"identifier":[1],"name":[1],"value":[1],"invalid":[4],"describedById":[1,"described-by-id"],"disabled":[4],"required":[4],"checked":[4],"indeterminate":[4],"infoFixed":[4,"info-fixed"],"infoActive":[32]}],[1,"dso-info",{"fixed":[516],"active":[516]}]]],["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"./components/badge/badge.js",
|
|
10
10
|
"./components/banner/banner.js",
|
|
11
11
|
"./components/dropdown-menu/dropdown-menu.js",
|
|
12
|
+
"./components/helpcenter-panel/helpcenter-panel.js",
|
|
12
13
|
"./components/highlight-box/highlight-box.js",
|
|
13
14
|
"./components/icon/icon.js",
|
|
14
15
|
"./components/info/info.js",
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
--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");
|
|
18
18
|
--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");
|
|
19
19
|
--di-status-info: url("data:image/svg+xml,%3csvg id='status-info' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e %3cg%3e %3ccircle cx='12' cy='12' r='11' style='fill: %232b5780'/%3e %3cpath d='M12%2c1A11%2c11%2c0%2c1%2c1%2c1%2c12%2c11%2c11%2c0%2c0%2c1%2c12%2c1m0-1A12%2c12%2c0%2c1%2c0%2c24%2c12%2c12%2c12%2c0%2c0%2c0%2c12%2c0Z' style='fill: white'/%3e %3c/g%3e %3cpath d='M11%2c8a1%2c1%2c0%2c1%2c1%2c1%2c1A1%2c1%2c0%2c0%2c1%2c11%2c8Zm2%2c8.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z' style='fill: white'/%3e %3c/svg%3e");
|
|
20
|
+
--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");
|
|
21
|
+
--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");
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
:host(:not(:first-child)) {
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
display: block;
|
|
6
6
|
--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");
|
|
7
7
|
--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");
|
|
8
|
+
--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");
|
|
9
|
+
--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");
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
*,
|
|
@@ -6,7 +6,7 @@ const localization = {
|
|
|
6
6
|
nextMonthLabel: 'Volgende maand',
|
|
7
7
|
monthSelectLabel: 'Maand',
|
|
8
8
|
yearSelectLabel: 'Jaar',
|
|
9
|
-
closeLabel: '
|
|
9
|
+
closeLabel: 'Sluiten',
|
|
10
10
|
keyboardInstruction: 'Gebruik de pijltjestoetsen om een dag te kiezen',
|
|
11
11
|
calendarHeading: 'Kies een datum',
|
|
12
12
|
dayNames: [
|
|
@@ -63,6 +63,10 @@ export class DsoDatePicker {
|
|
|
63
63
|
* Should the input be marked as required?
|
|
64
64
|
*/
|
|
65
65
|
this.required = false;
|
|
66
|
+
/**
|
|
67
|
+
* Should the input be focused on load?
|
|
68
|
+
*/
|
|
69
|
+
this.dsoAutofocus = false;
|
|
66
70
|
/**
|
|
67
71
|
* Date value. Must be in Dutch date format: DD-MM-YYYY.
|
|
68
72
|
*/
|
|
@@ -91,6 +95,20 @@ export class DsoDatePicker {
|
|
|
91
95
|
component: "dso-date-picker",
|
|
92
96
|
});
|
|
93
97
|
};
|
|
98
|
+
this.handleKeyUp = (event) => {
|
|
99
|
+
event.stopPropagation();
|
|
100
|
+
this.dsoKeyUp.emit({
|
|
101
|
+
component: "dso-date-picker",
|
|
102
|
+
originalEvent: event
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
this.handleKeyDown = (event) => {
|
|
106
|
+
event.stopPropagation();
|
|
107
|
+
this.dsoKeyDown.emit({
|
|
108
|
+
component: "dso-date-picker",
|
|
109
|
+
originalEvent: event
|
|
110
|
+
});
|
|
111
|
+
};
|
|
94
112
|
this.handleFocus = (event) => {
|
|
95
113
|
event.stopPropagation();
|
|
96
114
|
this.dsoFocus.emit({
|
|
@@ -211,12 +229,8 @@ export class DsoDatePicker {
|
|
|
211
229
|
};
|
|
212
230
|
this.handleInputChange = (e) => {
|
|
213
231
|
const target = e.target;
|
|
214
|
-
// clean up any invalid characters
|
|
215
232
|
target.value = target.value.replace(DISALLOWED_CHARACTERS, "");
|
|
216
|
-
|
|
217
|
-
if (parsed || target.value === "") {
|
|
218
|
-
this.setValue(parsed);
|
|
219
|
-
}
|
|
233
|
+
this.setValue(target.value);
|
|
220
234
|
};
|
|
221
235
|
this.processFocusedDayNode = (element) => {
|
|
222
236
|
this.focusedDayNode = element;
|
|
@@ -308,13 +322,37 @@ export class DsoDatePicker {
|
|
|
308
322
|
setFocusedDay(day) {
|
|
309
323
|
this.focusedDay = clamp(day, parseDutchDate(this.min), parseDutchDate(this.max));
|
|
310
324
|
}
|
|
311
|
-
setValue(
|
|
312
|
-
|
|
313
|
-
this.dateChange.emit({
|
|
325
|
+
setValue(value) {
|
|
326
|
+
var event = {
|
|
314
327
|
component: "dso-date-picker",
|
|
315
|
-
value:
|
|
316
|
-
valueAsDate:
|
|
317
|
-
}
|
|
328
|
+
value: "",
|
|
329
|
+
valueAsDate: undefined
|
|
330
|
+
};
|
|
331
|
+
if (value instanceof Date) {
|
|
332
|
+
event.valueAsDate = value;
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
event.value = value;
|
|
336
|
+
event.valueAsDate = parseDutchDate(value);
|
|
337
|
+
}
|
|
338
|
+
if (event.valueAsDate) {
|
|
339
|
+
event.value = this.value = printDutchDate(event.valueAsDate);
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
this.value = "";
|
|
343
|
+
}
|
|
344
|
+
if (!event.valueAsDate && this.required) {
|
|
345
|
+
event.error = "required";
|
|
346
|
+
}
|
|
347
|
+
if (event.value && !event.valueAsDate) {
|
|
348
|
+
event.error = "invalid";
|
|
349
|
+
}
|
|
350
|
+
this.dateChange.emit(event);
|
|
351
|
+
}
|
|
352
|
+
componentDidLoad() {
|
|
353
|
+
if (this.dsoAutofocus) {
|
|
354
|
+
this.setFocus();
|
|
355
|
+
}
|
|
318
356
|
}
|
|
319
357
|
/**
|
|
320
358
|
* render() function
|
|
@@ -341,7 +379,7 @@ export class DsoDatePicker {
|
|
|
341
379
|
return (h(Host, null,
|
|
342
380
|
h("div", { class: "dso-date" },
|
|
343
381
|
h("div", { class: "dso-date__input-wrapper" },
|
|
344
|
-
h("input", { class: "dso-date__input", value: formattedDate, 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, autoComplete: "off", ref: element => (this.datePickerInput = element) }),
|
|
382
|
+
h("input", { class: "dso-date__input", value: formattedDate, 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) }),
|
|
345
383
|
h("button", { type: "button", class: "dso-date__toggle", onClick: this.toggleOpen, disabled: this.disabled, ref: element => (this.datePickerButton = element) },
|
|
346
384
|
h("span", { class: "dso-date__toggle-icon" },
|
|
347
385
|
h("dso-icon", { icon: "calendar" })),
|
|
@@ -510,9 +548,27 @@ export class DsoDatePicker {
|
|
|
510
548
|
"reflect": false,
|
|
511
549
|
"defaultValue": "false"
|
|
512
550
|
},
|
|
551
|
+
"dsoAutofocus": {
|
|
552
|
+
"type": "boolean",
|
|
553
|
+
"mutable": false,
|
|
554
|
+
"complexType": {
|
|
555
|
+
"original": "boolean",
|
|
556
|
+
"resolved": "boolean",
|
|
557
|
+
"references": {}
|
|
558
|
+
},
|
|
559
|
+
"required": false,
|
|
560
|
+
"optional": false,
|
|
561
|
+
"docs": {
|
|
562
|
+
"tags": [],
|
|
563
|
+
"text": "Should the input be focused on load?"
|
|
564
|
+
},
|
|
565
|
+
"attribute": "dso-autofocus",
|
|
566
|
+
"reflect": false,
|
|
567
|
+
"defaultValue": "false"
|
|
568
|
+
},
|
|
513
569
|
"value": {
|
|
514
570
|
"type": "string",
|
|
515
|
-
"mutable":
|
|
571
|
+
"mutable": true,
|
|
516
572
|
"complexType": {
|
|
517
573
|
"original": "string",
|
|
518
574
|
"resolved": "string",
|
|
@@ -580,7 +636,7 @@ export class DsoDatePicker {
|
|
|
580
636
|
},
|
|
581
637
|
"complexType": {
|
|
582
638
|
"original": "DsoDatePickerChangeEvent",
|
|
583
|
-
"resolved": "{ component: \"dso-date-picker\"; valueAsDate: Date | undefined; value: string; }",
|
|
639
|
+
"resolved": "{ component: \"dso-date-picker\"; valueAsDate: Date | undefined; value: string; error?: \"invalid\" | \"required\" | undefined; }",
|
|
584
640
|
"references": {
|
|
585
641
|
"DsoDatePickerChangeEvent": {
|
|
586
642
|
"location": "local"
|
|
@@ -606,6 +662,44 @@ export class DsoDatePicker {
|
|
|
606
662
|
}
|
|
607
663
|
}
|
|
608
664
|
}
|
|
665
|
+
}, {
|
|
666
|
+
"method": "dsoKeyUp",
|
|
667
|
+
"name": "dsoKeyUp",
|
|
668
|
+
"bubbles": true,
|
|
669
|
+
"cancelable": true,
|
|
670
|
+
"composed": true,
|
|
671
|
+
"docs": {
|
|
672
|
+
"tags": [],
|
|
673
|
+
"text": "Event emitted on key up in the date picker input."
|
|
674
|
+
},
|
|
675
|
+
"complexType": {
|
|
676
|
+
"original": "DsoDatePickerKeyboardEvent",
|
|
677
|
+
"resolved": "{ component: \"dso-date-picker\"; originalEvent: KeyboardEvent; }",
|
|
678
|
+
"references": {
|
|
679
|
+
"DsoDatePickerKeyboardEvent": {
|
|
680
|
+
"location": "local"
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}, {
|
|
685
|
+
"method": "dsoKeyDown",
|
|
686
|
+
"name": "dsoKeyDown",
|
|
687
|
+
"bubbles": true,
|
|
688
|
+
"cancelable": true,
|
|
689
|
+
"composed": true,
|
|
690
|
+
"docs": {
|
|
691
|
+
"tags": [],
|
|
692
|
+
"text": "Event emitted on key down in the date picker input."
|
|
693
|
+
},
|
|
694
|
+
"complexType": {
|
|
695
|
+
"original": "DsoDatePickerKeyboardEvent",
|
|
696
|
+
"resolved": "{ component: \"dso-date-picker\"; originalEvent: KeyboardEvent; }",
|
|
697
|
+
"references": {
|
|
698
|
+
"DsoDatePickerKeyboardEvent": {
|
|
699
|
+
"location": "local"
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
609
703
|
}, {
|
|
610
704
|
"method": "dsoFocus",
|
|
611
705
|
"name": "dsoFocus",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html } from 'lit-html';
|
|
2
2
|
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
3
|
-
export function datePickerTemplate({ id, onDateChange, value, min, max, disabled }) {
|
|
3
|
+
export function datePickerTemplate({ id, onDateChange, value, min, max, disabled, autofocus }) {
|
|
4
4
|
return html `
|
|
5
5
|
<dso-date-picker
|
|
6
6
|
@dateChange=${(e) => onDateChange(e)}
|
|
@@ -8,6 +8,7 @@ export function datePickerTemplate({ id, onDateChange, value, min, max, disabled
|
|
|
8
8
|
value=${ifDefined(value || undefined)}
|
|
9
9
|
min=${ifDefined(min || undefined)}
|
|
10
10
|
max=${ifDefined(max || undefined)}
|
|
11
|
+
dso-autofocus=${ifDefined(autofocus || undefined)}
|
|
11
12
|
?disabled=${disabled}
|
|
12
13
|
></dso-date-picker>
|
|
13
14
|
`;
|