@dso-toolkit/core 52.0.1 → 52.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/cjs/dso-date-picker.cjs.entry.js +44 -2
  2. package/dist/cjs/dso-label.cjs.entry.js +38 -46
  3. package/dist/cjs/dso-list-button.cjs.entry.js +1 -1
  4. package/dist/cjs/dso-map-controls.cjs.entry.js +1 -1
  5. package/dist/cjs/dso-ozon-content.cjs.entry.js +1 -1
  6. package/dist/cjs/dso-table.cjs.entry.js +1 -1
  7. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  8. package/dist/cjs/dso-tooltip.cjs.entry.js +75 -40
  9. package/dist/cjs/dso-viewer-grid.cjs.entry.js +2 -2
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/components/date-picker/date-picker.js +17 -9
  12. package/dist/collection/components/date-picker/utils/month-range.js +27 -0
  13. package/dist/collection/components/date-picker/utils/range.js +7 -0
  14. package/dist/collection/components/label/label.js +41 -27
  15. package/dist/collection/components/list-button/list-button.css +2 -2
  16. package/dist/collection/components/map-controls/map-controls.css +2 -2
  17. package/dist/collection/components/ozon-content/ozon-content.css +2 -2
  18. package/dist/collection/components/table/table.css +2 -2
  19. package/dist/collection/components/tooltip/tooltip.js +75 -40
  20. package/dist/collection/components/viewer-grid/viewer-grid.css +4 -5
  21. package/dist/collection/components/viewer-grid/viewer-grid.js +1 -1
  22. package/dist/components/dso-date-picker.js +44 -2
  23. package/dist/components/dso-label.js +36 -44
  24. package/dist/components/dso-list-button.js +1 -1
  25. package/dist/components/dso-map-controls.js +1 -1
  26. package/dist/components/dso-ozon-content.js +1 -1
  27. package/dist/components/dso-table.js +1 -1
  28. package/dist/components/dso-viewer-grid.js +2 -2
  29. package/dist/components/tooltip.js +76 -41
  30. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  31. package/dist/dso-toolkit/{p-96efc763.entry.js → p-092dde2f.entry.js} +1 -1
  32. package/dist/dso-toolkit/{p-e6e9f613.entry.js → p-0fcdc369.entry.js} +1 -1
  33. package/dist/dso-toolkit/p-3b83e9c6.entry.js +1 -0
  34. package/dist/dso-toolkit/{p-ba0da696.entry.js → p-aab458c4.entry.js} +1 -1
  35. package/dist/dso-toolkit/{p-4b18389c.entry.js → p-b7580ce3.entry.js} +1 -1
  36. package/dist/dso-toolkit/{p-4d70d9c0.entry.js → p-ba330644.entry.js} +1 -1
  37. package/dist/dso-toolkit/p-cece17a5.entry.js +1 -0
  38. package/dist/dso-toolkit/p-f2b76233.entry.js +1 -0
  39. package/dist/esm/dso-date-picker.entry.js +44 -2
  40. package/dist/esm/dso-label.entry.js +34 -42
  41. package/dist/esm/dso-list-button.entry.js +1 -1
  42. package/dist/esm/dso-map-controls.entry.js +1 -1
  43. package/dist/esm/dso-ozon-content.entry.js +1 -1
  44. package/dist/esm/dso-table.entry.js +1 -1
  45. package/dist/esm/dso-toolkit.js +1 -1
  46. package/dist/esm/dso-tooltip.entry.js +76 -41
  47. package/dist/esm/dso-viewer-grid.entry.js +2 -2
  48. package/dist/esm/loader.js +1 -1
  49. package/dist/types/components/date-picker/date-picker.d.ts +1 -0
  50. package/dist/types/components/date-picker/utils/month-range.d.ts +2 -0
  51. package/dist/types/components/date-picker/utils/range.d.ts +1 -0
  52. package/dist/types/components/label/label.d.ts +8 -4
  53. package/dist/types/components/tooltip/tooltip.d.ts +6 -3
  54. package/dist/types/components.d.ts +4 -1
  55. package/package.json +2 -2
  56. package/dist/collection/components/label/mutation-observer.js +0 -11
  57. package/dist/collection/components/label/resize-observer.js +0 -11
  58. package/dist/dso-toolkit/p-0f37693a.entry.js +0 -1
  59. package/dist/dso-toolkit/p-bdc3b14b.entry.js +0 -1
  60. package/dist/dso-toolkit/p-d05ea304.entry.js +0 -1
  61. package/dist/types/components/label/mutation-observer.d.ts +0 -1
  62. package/dist/types/components/label/resize-observer.d.ts +0 -1
@@ -1,7 +1,16 @@
1
- import { h, Host, } from "@stencil/core";
1
+ import { h, Fragment, } from "@stencil/core";
2
2
  import clsx from "clsx";
3
- import { mutationObserver } from "./mutation-observer";
4
- import { resizeObserver } from "./resize-observer";
3
+ import { debounce } from "debounce";
4
+ const resizeObserver = new ResizeObserver(debounce((entries) => {
5
+ entries.forEach(({ target }) => {
6
+ if (isDsoLabelComponent(target)) {
7
+ target.truncateLabel();
8
+ }
9
+ });
10
+ }, 150));
11
+ function isDsoLabelComponent(element) {
12
+ return element.truncateLabel !== undefined;
13
+ }
5
14
  function hasEllipses(el) {
6
15
  return el.scrollWidth > el.clientWidth;
7
16
  }
@@ -22,8 +31,8 @@ export class Label {
22
31
  this.truncate = undefined;
23
32
  this.textHover = undefined;
24
33
  this.textFocus = undefined;
25
- this.truncatedContent = undefined;
26
- this.labelText = undefined;
34
+ this.isTruncated = undefined;
35
+ this.labelText = null;
27
36
  }
28
37
  watchTruncate(truncate) {
29
38
  if (truncate) {
@@ -45,52 +54,57 @@ export class Label {
45
54
  }
46
55
  async truncateLabel() {
47
56
  setTimeout(() => {
48
- if (this.labelContent) {
49
- this.truncatedContent = hasEllipses(this.labelContent) ? this.host.innerText : undefined;
50
- }
57
+ this.isTruncated = this.labelContent && hasEllipses(this.labelContent);
51
58
  });
52
59
  }
53
- async updateTooltipText() {
54
- this.labelText = this.host.innerText;
55
- if (this.truncate) {
56
- this.truncateLabel();
57
- }
60
+ /** **[Internal]** Synchronizes the text on the remove button and tooltip. You should never have to use this. */
61
+ async syncLabelText() {
62
+ this.labelText = this.host.textContent;
58
63
  }
59
64
  componentDidLoad() {
60
- this.labelText = this.host.innerText;
61
- mutationObserver.observe(this.host, {
62
- attributes: true,
63
- subtree: true,
64
- });
65
65
  if (this.truncate) {
66
66
  this.startTruncate();
67
67
  }
68
+ if (this.removable) {
69
+ this.startMutationObserver();
70
+ }
68
71
  }
69
72
  disconnectedCallback() {
70
- mutationObserver === null || mutationObserver === void 0 ? void 0 : mutationObserver.disconnect();
71
73
  this.stopTruncate();
72
74
  }
75
+ /** The mutationObserver fetches the text placed inside the label, this is then used for the remove button and tooltip. */
76
+ startMutationObserver() {
77
+ if (this.mutationObserver) {
78
+ return;
79
+ }
80
+ this.mutationObserver = new MutationObserver((entries) => entries.forEach(() => this.syncLabelText()));
81
+ this.mutationObserver.observe(this.host, {
82
+ characterData: true,
83
+ subtree: true,
84
+ attributes: true,
85
+ });
86
+ this.labelText = this.host.textContent;
87
+ }
73
88
  startTruncate() {
74
89
  resizeObserver.observe(this.host);
90
+ this.startMutationObserver();
75
91
  this.truncateLabel();
76
92
  }
77
93
  stopTruncate() {
78
94
  document.removeEventListener("keydown", this.keyDownListener);
79
95
  resizeObserver.unobserve(this.host);
80
- this.truncatedContent = undefined;
96
+ this.isTruncated = undefined;
81
97
  this.keydownListenerActive = false;
82
98
  }
83
99
  render() {
84
100
  const status = this.status && Label.statusMap.get(this.status);
85
- return (h(Host, { "aria-roledescription": this.truncate && this.truncatedContent
86
- ? "Deze tekst is visueel afgekapt en wordt volledig zichtbaar bij focus."
87
- : undefined }, h("span", { "aria-describedby": "toggle-anchor", class: clsx("dso-label", {
101
+ return (h(Fragment, null, h("span", { "aria-describedby": "toggle-anchor", class: clsx("dso-label", {
88
102
  [`dso-label-${this.status}`]: this.status,
89
103
  "dso-compact": this.compact && !this.removable,
90
104
  "dso-hover": this.removeHover || this.removeFocus,
91
105
  }) }, h("slot", { name: "symbol" }), status && h("span", { class: "sr-only" }, status, ": "), h("span", { class: clsx("dso-label-content", {
92
106
  "dso-truncate": !!this.truncate,
93
- }), ref: (element) => (this.labelContent = element), tabindex: this.truncate && this.truncatedContent ? 0 : undefined, onMouseEnter: () => (this.textHover = true), onMouseLeave: () => (this.textHover = false), onFocus: () => (this.textFocus = true), onBlur: () => (this.textFocus = false) }, h("slot", null)), this.removable && (h("button", { type: "button", onClick: (e) => this.dsoRemoveClick.emit(e), onMouseEnter: () => (this.removeHover = true), onMouseLeave: () => (this.removeHover = false), onFocus: () => (this.removeFocus = true), onBlur: () => (this.removeFocus = false) }, h("span", { class: "sr-only" }, "Verwijder: ", this.labelText), h("dso-icon", { icon: "times" })))), h("dso-tooltip", { stateless: true, id: "toggle-anchor", active: !!this.truncatedContent && (this.textHover || this.textFocus), position: "top", strategy: "absolute" }, this.truncatedContent)));
107
+ }), ref: (element) => (this.labelContent = element), tabindex: this.truncate && this.isTruncated ? 0 : undefined, onMouseEnter: () => (this.textHover = true), onMouseLeave: () => (this.textHover = false), onFocus: () => (this.textFocus = true), onBlur: () => (this.textFocus = false) }, h("slot", null)), this.removable && (h("button", { type: "button", onClick: (e) => this.dsoRemoveClick.emit(e), onMouseEnter: () => (this.removeHover = true), onMouseLeave: () => (this.removeHover = false), onFocus: () => (this.removeFocus = true), onBlur: () => (this.removeFocus = false) }, h("span", { class: "sr-only" }, "Verwijder: ", this.labelText), h("dso-icon", { icon: "times" })))), this.isTruncated && (h("dso-tooltip", { stateless: true, id: "toggle-anchor", active: this.textHover || this.textFocus, position: "top", strategy: "absolute" }, this.labelText))));
94
108
  }
95
109
  static get is() { return "dso-label"; }
96
110
  static get encapsulation() { return "shadow"; }
@@ -182,7 +196,7 @@ export class Label {
182
196
  "removeFocus": {},
183
197
  "textHover": {},
184
198
  "textFocus": {},
185
- "truncatedContent": {},
199
+ "isTruncated": {},
186
200
  "labelText": {}
187
201
  };
188
202
  }
@@ -226,7 +240,7 @@ export class Label {
226
240
  "tags": []
227
241
  }
228
242
  },
229
- "updateTooltipText": {
243
+ "syncLabelText": {
230
244
  "complexType": {
231
245
  "signature": "() => Promise<void>",
232
246
  "parameters": [],
@@ -238,7 +252,7 @@ export class Label {
238
252
  "return": "Promise<void>"
239
253
  },
240
254
  "docs": {
241
- "text": "",
255
+ "text": "**[Internal]** Synchronizes the text on the remove button and tooltip. You should never have to use this.",
242
256
  "tags": []
243
257
  }
244
258
  }
@@ -49,12 +49,12 @@
49
49
  color: #39870c;
50
50
  }
51
51
  .dso-tertiary:not([disabled]):hover {
52
- color: #676cb0;
52
+ color: #275937;
53
53
  text-decoration: underline;
54
54
  text-underline-position: under;
55
55
  }
56
56
  .dso-tertiary:not([disabled]):active {
57
- color: #676cb0;
57
+ color: #173521;
58
58
  }
59
59
  .dso-tertiary.btn-align {
60
60
  line-height: calc(1.5em - 1px);
@@ -366,12 +366,12 @@ button::-moz-focus-inner {
366
366
  color: #39870c;
367
367
  }
368
368
  .close-button:not([disabled]):hover {
369
- color: #676cb0;
369
+ color: #275937;
370
370
  text-decoration: underline;
371
371
  text-underline-position: under;
372
372
  }
373
373
  .close-button:not([disabled]):active {
374
- color: #676cb0;
374
+ color: #173521;
375
375
  }
376
376
  .close-button.btn-align {
377
377
  line-height: calc(1.5em - 1px);
@@ -72,12 +72,12 @@ button.toggle-note[disabled].dso-spinner-left, button.toggle-note[disabled].dso-
72
72
  color: #39870c;
73
73
  }
74
74
  button.toggle-note:not([disabled]):hover {
75
- color: #676cb0;
75
+ color: #275937;
76
76
  text-decoration: underline;
77
77
  text-underline-position: under;
78
78
  }
79
79
  button.toggle-note:not([disabled]):active {
80
- color: #676cb0;
80
+ color: #173521;
81
81
  }
82
82
  button.toggle-note.btn-align {
83
83
  line-height: calc(1.5em - 1px);
@@ -227,12 +227,12 @@
227
227
  color: #39870c;
228
228
  }
229
229
  .dso-tertiary:not([disabled]):hover {
230
- color: #676cb0;
230
+ color: #275937;
231
231
  text-decoration: underline;
232
232
  text-underline-position: under;
233
233
  }
234
234
  .dso-tertiary:not([disabled]):active {
235
- color: #676cb0;
235
+ color: #173521;
236
236
  }
237
237
  .dso-tertiary.btn-align {
238
238
  line-height: calc(1.5em - 1px);
@@ -1,30 +1,59 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f)
3
+ throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
5
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
6
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7
+ };
8
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9
+ if (kind === "m")
10
+ throw new TypeError("Private method is not writable");
11
+ if (kind === "a" && !f)
12
+ throw new TypeError("Private accessor was defined without a setter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
14
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
+ };
17
+ var _Tooltip_target;
1
18
  import { beforeWrite, createPopper } from "@popperjs/core";
2
19
  import maxSize from "popper-max-size-modifier";
3
20
  import { h, Host } from "@stencil/core";
4
21
  import clsx from "clsx";
5
22
  import { hasOverflow } from "../../utils/has-overflow";
23
+ import debounce from "debounce";
6
24
  // Keep const in sync with $tooltip-transition-duration in dso-toolkit/src/components/tooltip/tooltip.scss tooltip_root() mixin
7
25
  const transitionDuration = 150;
26
+ const applyMaxSize = {
27
+ name: "applyMaxSize",
28
+ enabled: true,
29
+ phase: beforeWrite,
30
+ requires: ["maxSize"],
31
+ fn({ state }) {
32
+ let { width } = state.modifiersData.maxSize;
33
+ if (width < 160) {
34
+ width = 160;
35
+ }
36
+ state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), { maxWidth: `${width}px` });
37
+ },
38
+ };
8
39
  export class Tooltip {
9
40
  constructor() {
10
- this.applyMaxSize = {
11
- name: "applyMaxSize",
12
- enabled: true,
13
- phase: beforeWrite,
14
- requires: ["maxSize"],
15
- fn({ state }) {
16
- let { width } = state.modifiersData.maxSize;
17
- if (width < 160) {
18
- width = 160;
19
- }
20
- state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), { maxWidth: `${width}px` });
21
- },
41
+ this.callbacks = {
42
+ activate: () => (this.active = true),
43
+ deactivate: () => (this.active = false),
22
44
  };
23
45
  this.keyDownListener = (event) => {
24
46
  if (event.key === "Escape") {
25
47
  this.deactivate();
26
48
  }
27
49
  };
50
+ this.deactivatePopper = debounce(() => {
51
+ var _a;
52
+ this.hidden = true;
53
+ (_a = this.popper) === null || _a === void 0 ? void 0 : _a.destroy();
54
+ this.popper = undefined;
55
+ }, transitionDuration);
56
+ _Tooltip_target.set(this, void 0);
28
57
  this.descriptive = false;
29
58
  this.position = "top";
30
59
  this.strategy = "auto";
@@ -82,9 +111,8 @@ export class Tooltip {
82
111
  });
83
112
  }
84
113
  watchActive() {
85
- var _a;
86
114
  if (this.active) {
87
- this.hidden = false;
115
+ this.activatePopper();
88
116
  if (!this.stateless) {
89
117
  setTimeout(() => {
90
118
  var _a;
@@ -96,13 +124,8 @@ export class Tooltip {
96
124
  }
97
125
  }
98
126
  else {
99
- if (!this.stateless) {
100
- (_a = this.popper) === null || _a === void 0 ? void 0 : _a.setOptions({
101
- modifiers: [{ name: "eventListeners", enabled: false }],
102
- });
103
- document.removeEventListener("keydown", this.keyDownListener);
104
- }
105
- setTimeout(() => (this.hidden = true), transitionDuration);
127
+ document.removeEventListener("keydown", this.keyDownListener);
128
+ this.deactivatePopper();
106
129
  }
107
130
  }
108
131
  listenClick(e) {
@@ -110,25 +133,10 @@ export class Tooltip {
110
133
  }
111
134
  componentDidLoad() {
112
135
  var _a;
113
- if (this.popper) {
114
- return;
115
- }
116
136
  const tooltip = (_a = this.element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".tooltip");
117
137
  if (!(tooltip instanceof HTMLElement)) {
118
138
  throw new Error("tooltip element is not instanceof HTMLElement");
119
139
  }
120
- if (!this.element.id) {
121
- throw new Error("Unable to find reference tooltip has no [id] attribute.");
122
- }
123
- this.target = this.getTarget(this.element.id);
124
- this.popper = createPopper(this.target, tooltip, {
125
- placement: this.position,
126
- modifiers: [maxSize, this.applyMaxSize],
127
- });
128
- this.callbacks = {
129
- activate: () => (this.active = true),
130
- deactivate: () => (this.active = false),
131
- };
132
140
  if (!this.stateless) {
133
141
  this.target.addEventListener("mouseenter", this.callbacks.activate);
134
142
  this.target.addEventListener("mouseleave", this.callbacks.deactivate);
@@ -139,18 +147,16 @@ export class Tooltip {
139
147
  disconnectedCallback() {
140
148
  var _a;
141
149
  (_a = this.popper) === null || _a === void 0 ? void 0 : _a.destroy();
142
- if (!this.stateless && this.target && this.callbacks) {
150
+ if (!this.stateless && this.target) {
143
151
  this.target.removeEventListener("mouseenter", this.callbacks.activate);
144
152
  this.target.removeEventListener("mouseleave", this.callbacks.deactivate);
145
153
  this.target.removeEventListener("focus", this.callbacks.activate);
146
154
  this.target.removeEventListener("blur", this.callbacks.deactivate);
147
155
  }
148
- this.callbacks = undefined;
149
156
  this.target = undefined;
150
157
  }
151
158
  componentDidRender() {
152
159
  var _a;
153
- this.setStrategy();
154
160
  if (this.active) {
155
161
  (_a = this.popper) === null || _a === void 0 ? void 0 : _a.update();
156
162
  }
@@ -158,7 +164,34 @@ export class Tooltip {
158
164
  render() {
159
165
  return (h(Host, { class: { hidden: this.hidden }, role: "tooltip" }, h("div", { class: clsx("tooltip", { in: this.active }) }, !this.noArrow && h("div", { "data-popper-arrow": true, class: "tooltip-arrow" }), h("div", { "aria-hidden": !this.descriptive || undefined, class: clsx("tooltip-inner", { "dso-small": this.small }) }, h("slot", null)))));
160
166
  }
161
- getTarget(id) {
167
+ activatePopper() {
168
+ var _a;
169
+ this.hidden = false;
170
+ if (this.popper) {
171
+ return;
172
+ }
173
+ const tooltip = (_a = this.element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".tooltip");
174
+ if (!(tooltip instanceof HTMLElement)) {
175
+ throw new Error("tooltip element is not instanceof HTMLElement");
176
+ }
177
+ this.popper = createPopper(this.target, tooltip, {
178
+ placement: this.position,
179
+ modifiers: [maxSize, applyMaxSize, { name: "eventListeners", enabled: false }],
180
+ });
181
+ this.setStrategy();
182
+ }
183
+ get target() {
184
+ var _a;
185
+ return (_a = __classPrivateFieldGet(this, _Tooltip_target, "f")) !== null && _a !== void 0 ? _a : this.initializeTarget();
186
+ }
187
+ set target(element) {
188
+ __classPrivateFieldSet(this, _Tooltip_target, element, "f");
189
+ }
190
+ initializeTarget() {
191
+ const id = this.element.id;
192
+ if (!id) {
193
+ throw new Error("Unable to find reference tooltip has no [id] attribute.");
194
+ }
162
195
  const rootNode = this.element.getRootNode();
163
196
  if (!(rootNode instanceof Document || rootNode instanceof ShadowRoot)) {
164
197
  throw new Error(`rootNode is not instance of Document or ShadowRoot`);
@@ -167,6 +200,7 @@ export class Tooltip {
167
200
  if (!reference) {
168
201
  throw new Error(`Unable to find reference with aria-describedby ${id}`);
169
202
  }
203
+ __classPrivateFieldSet(this, _Tooltip_target, reference, "f");
170
204
  return reference;
171
205
  }
172
206
  static get is() { return "dso-tooltip"; }
@@ -373,3 +407,4 @@ export class Tooltip {
373
407
  }];
374
408
  }
375
409
  }
410
+ _Tooltip_target = new WeakMap();
@@ -129,14 +129,14 @@ button::-moz-focus-inner {
129
129
  .shrink:not([disabled]):hover,
130
130
  .expand:not([disabled]):hover,
131
131
  .overlay-close-button:not([disabled]):hover {
132
- color: #676cb0;
132
+ color: #275937;
133
133
  text-decoration: underline;
134
134
  text-underline-position: under;
135
135
  }
136
136
  .shrink:not([disabled]):active,
137
137
  .expand:not([disabled]):active,
138
138
  .overlay-close-button:not([disabled]):active {
139
- color: #676cb0;
139
+ color: #173521;
140
140
  }
141
141
  .shrink.btn-align,
142
142
  .expand.btn-align,
@@ -451,12 +451,11 @@ button::-moz-focus-inner {
451
451
  display: none !important;
452
452
  }
453
453
  }
454
- .filterpanel h2 {
454
+ .filterpanel h1 {
455
455
  color: #275937;
456
456
  margin-bottom: 16px;
457
457
  margin-top: 24px;
458
- color: #275937;
459
- font-size: 1.5rem;
458
+ font-size: 2rem;
460
459
  font-weight: 700;
461
460
  }
462
461
  .filterpanel::before {
@@ -116,7 +116,7 @@ export class ViewerGrid {
116
116
  this.dsoFilterpanelCancel.emit({ originalEvent: mouseEvent });
117
117
  }
118
118
  render() {
119
- return (h(Host, Object.assign({}, { [this.mainSize]: true }), h("div", { class: "dso-map-panel", ref: (element) => (this.mapPanel = element) }, h("div", { class: "sizing-buttons" }, h("span", { class: "sr-only", "aria-live": "polite", "aria-atomic": "true" }, "breedte tekstpaneel: ", this.sizeLabelMap[this.mainSize]), h("button", { type: "button", class: "shrink", disabled: this.mainSize === "small", onClick: this.shrinkMain }, h("span", { class: "sr-only" }, "Kaartpaneel smaller maken"), h("dso-icon", { icon: "chevron-left" })), h("button", { type: "button", class: "expand", disabled: this.mainSize === "large", onClick: this.expandMain }, h("span", { class: "sr-only" }, "Kaartpaneel breder maken"), h("dso-icon", { icon: "chevron-right" }))), h("div", { class: "main" }, h("slot", { name: "main" }))), h("div", { id: "filterpanel", class: "filterpanel", hidden: !this.filterpanelOpen || !this.filterpanelSlot, ref: (element) => (this.filterpanel = element) }, h("h2", null, "Uw keuzes"), h(ViewerGridFilterpanelButtons, { onApply: (e) => this.handleFilterpanelApply(e), onCancel: (e) => this.handleFilterpanelCancel(e) }), h("slot", { name: "filterpanel" }), h(ViewerGridFilterpanelButtons, { onApply: (e) => this.handleFilterpanelApply(e), onCancel: (e) => this.handleFilterpanelCancel(e) })), h("div", { class: "map" }, h("slot", { name: "map" })), h("div", { hidden: !this.overlayOpen || !this.overlaySlot, class: "dimscreen" }), h("div", { class: "overlay", hidden: !this.overlayOpen || !this.overlaySlot, ref: (element) => (this.overlay = element) }, h("button", { type: "button", class: "overlay-close-button", onClick: (e) => this.dsoCloseOverlay.emit(e) }, h("dso-icon", { icon: "times" }), h("span", { class: "sr-only" }, "sluiten")), h("slot", { name: "overlay" }), h("button", { "aria-hidden": "true", type: "button", class: "overlay-close-button", style: { zIndex: "-100" } }, h("dso-icon", { icon: "times" }), h("span", { class: "sr-only" }, "sluiten")))));
119
+ return (h(Host, Object.assign({}, { [this.mainSize]: true }), h("div", { class: "dso-map-panel", ref: (element) => (this.mapPanel = element) }, h("div", { class: "sizing-buttons" }, h("span", { class: "sr-only", "aria-live": "polite", "aria-atomic": "true" }, "breedte tekstpaneel: ", this.sizeLabelMap[this.mainSize]), h("button", { type: "button", class: "shrink", disabled: this.mainSize === "small", onClick: this.shrinkMain }, h("span", { class: "sr-only" }, "Kaartpaneel smaller maken"), h("dso-icon", { icon: "chevron-left" })), h("button", { type: "button", class: "expand", disabled: this.mainSize === "large", onClick: this.expandMain }, h("span", { class: "sr-only" }, "Kaartpaneel breder maken"), h("dso-icon", { icon: "chevron-right" }))), h("div", { class: "main" }, h("slot", { name: "main" }))), h("div", { id: "filterpanel", class: "filterpanel", hidden: !this.filterpanelOpen || !this.filterpanelSlot, ref: (element) => (this.filterpanel = element) }, h("h1", null, "Uw keuzes"), h(ViewerGridFilterpanelButtons, { onApply: (e) => this.handleFilterpanelApply(e), onCancel: (e) => this.handleFilterpanelCancel(e) }), h("slot", { name: "filterpanel" }), h(ViewerGridFilterpanelButtons, { onApply: (e) => this.handleFilterpanelApply(e), onCancel: (e) => this.handleFilterpanelCancel(e) })), h("div", { class: "map" }, h("slot", { name: "map" })), h("div", { hidden: !this.overlayOpen || !this.overlaySlot, class: "dimscreen" }), h("div", { class: "overlay", hidden: !this.overlayOpen || !this.overlaySlot, ref: (element) => (this.overlay = element) }, h("button", { type: "button", class: "overlay-close-button", onClick: (e) => this.dsoCloseOverlay.emit(e) }, h("dso-icon", { icon: "times" }), h("span", { class: "sr-only" }, "sluiten")), h("slot", { name: "overlay" }), h("button", { "aria-hidden": "true", type: "button", class: "overlay-close-button", style: { zIndex: "-100" } }, h("dso-icon", { icon: "times" }), h("span", { class: "sr-only" }, "sluiten")))));
120
120
  }
121
121
  static get is() { return "dso-viewer-grid"; }
122
122
  static get encapsulation() { return "shadow"; }
@@ -216,7 +216,33 @@ const localization = {
216
216
  monthNamesShort: ["Jan", "Feb", "Mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
217
217
  };
218
218
 
219
- const datePickerCss = ".sc-dso-date-picker-h{display:block}[invalid].sc-dso-date-picker-h .dso-date__input.sc-dso-date-picker{border-color:#ce3f51}.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.sc-dso-date-picker:not(.dso-visible) .dso-date__dialog.sc-dso-date-picker{display:none}.dso-date__input.sc-dso-date-picker{display:block;width:100%;height:40px;padding:6px 14px;font-size:1rem;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:101}.dso-date__toggle.sc-dso-date-picker:disabled{color:#afcf9d;cursor:default}.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:210}@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:210}@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-align:center;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:100}.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.sc-dso-date-picker:disabled{background:#fff;color:#ccc;cursor:default}.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:101}.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:100}.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}";
219
+ function monthRange(localization, selectedYear, minDate, maxDate) {
220
+ if (minDate && maxDate) {
221
+ const { minYear, minMonth } = { minYear: minDate.getFullYear(), minMonth: minDate.getMonth() };
222
+ const { maxYear, maxMonth } = { maxYear: maxDate.getFullYear(), maxMonth: maxDate.getMonth() };
223
+ return localization.monthNames.filter((_month, index) => {
224
+ if (minYear === selectedYear && maxYear === selectedYear) {
225
+ return index >= minMonth && index >= maxMonth;
226
+ }
227
+ if (minYear === selectedYear) {
228
+ return index >= minMonth;
229
+ }
230
+ if (maxYear === selectedYear) {
231
+ return index <= maxMonth;
232
+ }
233
+ return true;
234
+ });
235
+ }
236
+ if (minDate) {
237
+ const { minYear, minMonth } = { minYear: minDate.getFullYear(), minMonth: minDate.getMonth() };
238
+ return localization.monthNames.filter((_month, index) => minYear === selectedYear && index >= minMonth);
239
+ }
240
+ if (maxDate) {
241
+ const { maxYear, maxMonth } = { maxYear: maxDate.getFullYear(), maxMonth: maxDate.getMonth() };
242
+ return localization.monthNames.filter((_month, index) => maxYear === selectedYear && index <= maxMonth);
243
+ }
244
+ return localization.monthNames;
245
+ }
220
246
 
221
247
  function range(from, to) {
222
248
  const result = [];
@@ -225,6 +251,9 @@ function range(from, to) {
225
251
  }
226
252
  return result;
227
253
  }
254
+
255
+ const datePickerCss = ".sc-dso-date-picker-h{display:block}[invalid].sc-dso-date-picker-h .dso-date__input.sc-dso-date-picker{border-color:#ce3f51}.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.sc-dso-date-picker:not(.dso-visible) .dso-date__dialog.sc-dso-date-picker{display:none}.dso-date__input.sc-dso-date-picker{display:block;width:100%;height:40px;padding:6px 14px;font-size:1rem;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:101}.dso-date__toggle.sc-dso-date-picker:disabled{color:#afcf9d;cursor:default}.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:210}@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:210}@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-align:center;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:100}.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.sc-dso-date-picker:disabled{background:#fff;color:#ccc;cursor:default}.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:101}.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:100}.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}";
256
+
228
257
  const keyCode = {
229
258
  TAB: 9,
230
259
  ESC: 27,
@@ -597,6 +626,16 @@ const DsoDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
597
626
  this.previousValue = this.value;
598
627
  }
599
628
  }
629
+ componentWillLoad() {
630
+ const minDate = parseDutchDate(this.min);
631
+ const maxDate = parseDutchDate(this.max);
632
+ if (minDate && minDate > this.focusedDay) {
633
+ this.focusedDay = minDate;
634
+ }
635
+ if (maxDate && maxDate < this.focusedDay) {
636
+ this.focusedDay = maxDate;
637
+ }
638
+ }
600
639
  componentDidLoad() {
601
640
  const valueAsDate = parseDutchDate(this.value);
602
641
  if (valueAsDate) {
@@ -633,7 +672,10 @@ const DsoDatePicker$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
633
672
  "dso-date__dialog": true,
634
673
  "is-left": this.direction === "left",
635
674
  "is-active": this.open,
636
- }, role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? "false" : "true", "aria-labelledby": this.dialogLabelId, onTouchMove: this.handleTouchMove, onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd }, h("div", { class: "dso-date__dialog-content", onKeyDown: this.handleEscKey }, h("div", { class: "dso-date__vhidden dso-date__instructions", "aria-live": "polite" }, this.localization.keyboardInstruction), h("div", { class: "dso-date__mobile", onFocusin: this.disableActiveFocus }, h("label", { class: "dso-date__mobile-heading" }, this.localization.calendarHeading), h("button", { class: "dso-date__close", ref: (element) => (this.firstFocusableElement = element), onKeyDown: this.handleFirstFocusableKeydown, onClick: () => this.hide(), type: "button" }, h("dso-icon", { icon: "times" }), h("span", { class: "dso-date__vhidden" }, this.localization.closeLabel))), h("div", { class: "dso-date__header", onFocusin: this.disableActiveFocus }, h("div", null, h("h2", { id: this.dialogLabelId, class: "dso-date__vhidden", "aria-live": "polite" }, this.localization.monthNames[focusedMonth], " ", this.focusedDay.getFullYear()), h("label", { htmlFor: this.monthSelectId, class: "dso-date__vhidden" }, this.localization.monthSelectLabel), h("div", { class: "dso-date__select" }, h("select", { id: this.monthSelectId, class: "dso-date__select--month", ref: (element) => (this.monthSelectNode = element), onChange: this.handleMonthSelect }, this.localization.monthNames.map((month, i) => (h("option", { key: month, value: i, selected: i === focusedMonth }, month)))), h("div", { class: "dso-date__select-label", "aria-hidden": "true" }, h("span", null, this.localization.monthNamesShort[focusedMonth]), h("dso-icon", { icon: "chevron-down" }))), h("label", { htmlFor: this.yearSelectId, class: "dso-date__vhidden" }, this.localization.yearSelectLabel), h("div", { class: "dso-date__select" }, h("select", { id: this.yearSelectId, class: "dso-date__select--year", onChange: this.handleYearSelect }, range(minYear, maxYear).map((year) => (h("option", { key: year, selected: year === focusedYear }, year)))), h("div", { class: "dso-date__select-label", "aria-hidden": "true" }, h("span", null, this.focusedDay.getFullYear()), h("dso-icon", { icon: "chevron-down" })))), h("div", { class: "dso-date__nav" }, h("button", { class: "dso-date__prev", onClick: this.handlePreviousMonthClick, disabled: prevMonthDisabled, type: "button" }, h("dso-icon", { icon: "chevron-left" }), h("span", { class: "dso-date__vhidden" }, this.localization.prevMonthLabel)), h("button", { class: "dso-date__next", onClick: this.handleNextMonthClick, disabled: nextMonthDisabled, type: "button" }, h("dso-icon", { icon: "chevron-right" }), h("span", { class: "dso-date__vhidden" }, this.localization.nextMonthLabel)))), h(DatePickerMonth, { selectedDate: valueAsDate, focusedDate: this.focusedDay, onDateSelect: this.handleDaySelect, onKeyboardNavigation: this.handleKeyboardNavigation, labelledById: this.dialogLabelId, localization: this.localization, firstDayOfWeek: this.firstDayOfWeek, focusedDayRef: this.processFocusedDayNode, min: minDate, max: maxDate }))))));
675
+ }, role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? "false" : "true", "aria-labelledby": this.dialogLabelId, onTouchMove: this.handleTouchMove, onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd }, h("div", { class: "dso-date__dialog-content", onKeyDown: this.handleEscKey }, h("div", { class: "dso-date__vhidden dso-date__instructions", "aria-live": "polite" }, this.localization.keyboardInstruction), h("div", { class: "dso-date__mobile", onFocusin: this.disableActiveFocus }, h("label", { class: "dso-date__mobile-heading" }, this.localization.calendarHeading), h("button", { class: "dso-date__close", ref: (element) => (this.firstFocusableElement = element), onKeyDown: this.handleFirstFocusableKeydown, onClick: () => this.hide(), type: "button" }, h("dso-icon", { icon: "times" }), h("span", { class: "dso-date__vhidden" }, this.localization.closeLabel))), h("div", { class: "dso-date__header", onFocusin: this.disableActiveFocus }, h("div", null, h("h2", { id: this.dialogLabelId, class: "dso-date__vhidden", "aria-live": "polite" }, this.localization.monthNames[focusedMonth], " ", this.focusedDay.getFullYear()), h("label", { htmlFor: this.monthSelectId, class: "dso-date__vhidden" }, this.localization.monthSelectLabel), h("div", { class: "dso-date__select" }, h("select", { id: this.monthSelectId, class: "dso-date__select--month", ref: (element) => (this.monthSelectNode = element), onChange: this.handleMonthSelect }, monthRange(this.localization, selectedYear, minDate, maxDate).map((month) => {
676
+ const index = this.localization.monthNames.indexOf(month);
677
+ return (h("option", { key: month, value: index, selected: index === focusedMonth }, month));
678
+ })), h("div", { class: "dso-date__select-label", "aria-hidden": "true" }, h("span", null, this.localization.monthNamesShort[focusedMonth]), h("dso-icon", { icon: "chevron-down" }))), h("label", { htmlFor: this.yearSelectId, class: "dso-date__vhidden" }, this.localization.yearSelectLabel), h("div", { class: "dso-date__select" }, h("select", { id: this.yearSelectId, class: "dso-date__select--year", onChange: this.handleYearSelect }, range(minYear, maxYear).map((year) => (h("option", { key: year, selected: year === focusedYear }, year)))), h("div", { class: "dso-date__select-label", "aria-hidden": "true" }, h("span", null, this.focusedDay.getFullYear()), h("dso-icon", { icon: "chevron-down" })))), h("div", { class: "dso-date__nav" }, h("button", { class: "dso-date__prev", onClick: this.handlePreviousMonthClick, disabled: prevMonthDisabled, type: "button" }, h("dso-icon", { icon: "chevron-left" }), h("span", { class: "dso-date__vhidden" }, this.localization.prevMonthLabel)), h("button", { class: "dso-date__next", onClick: this.handleNextMonthClick, disabled: nextMonthDisabled, type: "button" }, h("dso-icon", { icon: "chevron-right" }), h("span", { class: "dso-date__vhidden" }, this.localization.nextMonthLabel)))), h(DatePickerMonth, { selectedDate: valueAsDate, focusedDate: this.focusedDay, onDateSelect: this.handleDaySelect, onKeyboardNavigation: this.handleKeyboardNavigation, labelledById: this.dialogLabelId, localization: this.localization, firstDayOfWeek: this.firstDayOfWeek, focusedDayRef: this.processFocusedDayNode, min: minDate, max: maxDate }))))));
637
679
  }
638
680
  get element() { return this; }
639
681
  static get style() { return datePickerCss; }