dso-toolkit 43.0.0 → 43.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.
Files changed (152) hide show
  1. package/dist/library/@dso-toolkit/core/cjs/dso-alert.cjs.entry.js +1 -1
  2. package/dist/library/@dso-toolkit/core/cjs/dso-autosuggest.cjs.entry.js +13 -2
  3. package/dist/library/@dso-toolkit/core/cjs/dso-date-picker.cjs.entry.js +1 -1
  4. package/dist/library/@dso-toolkit/core/cjs/dso-header.cjs.entry.js +1 -1
  5. package/dist/library/@dso-toolkit/core/cjs/dso-helpcenter-panel.cjs.entry.js +1 -1
  6. package/dist/library/@dso-toolkit/core/cjs/dso-highlight-box.cjs.entry.js +1 -1
  7. package/dist/library/@dso-toolkit/core/cjs/dso-image-overlay.cjs.entry.js +46 -8
  8. package/dist/library/@dso-toolkit/core/cjs/dso-info-button.cjs.entry.js +5 -1
  9. package/dist/library/@dso-toolkit/core/cjs/dso-label.cjs.entry.js +1 -1
  10. package/dist/library/@dso-toolkit/core/cjs/dso-map-controls.cjs.entry.js +1 -1
  11. package/dist/library/@dso-toolkit/core/cjs/dso-ozon-content.cjs.entry.js +56 -34
  12. package/dist/library/@dso-toolkit/core/cjs/dso-pagination.cjs.entry.js +1 -1
  13. package/dist/library/@dso-toolkit/core/cjs/dso-progress-bar.cjs.entry.js +1 -1
  14. package/dist/library/@dso-toolkit/core/cjs/dso-toggletip.cjs.entry.js +3 -15
  15. package/dist/library/@dso-toolkit/core/cjs/dso-toolkit.cjs.js +1 -1
  16. package/dist/library/@dso-toolkit/core/cjs/dso-tooltip.cjs.entry.js +1 -1
  17. package/dist/library/@dso-toolkit/core/cjs/dso-viewer-grid.cjs.entry.js +1 -1
  18. package/dist/library/@dso-toolkit/core/cjs/loader.cjs.js +1 -1
  19. package/dist/library/@dso-toolkit/core/collection/components/alert/alert.css +1 -1
  20. package/dist/library/@dso-toolkit/core/collection/components/autosuggest/autosuggest.js +32 -3
  21. package/dist/library/@dso-toolkit/core/collection/components/autosuggest/autosuggest.stories.js +21 -9
  22. package/dist/library/@dso-toolkit/core/collection/components/autosuggest/autosuggest.template.js +2 -1
  23. package/dist/library/@dso-toolkit/core/collection/components/date-picker/date-picker.css +3 -3
  24. package/dist/library/@dso-toolkit/core/collection/components/header/header.css +3 -3
  25. package/dist/library/@dso-toolkit/core/collection/components/helpcenter-panel/helpcenter-panel.css +2 -2
  26. package/dist/library/@dso-toolkit/core/collection/components/highlight-box/highlight-box.css +11 -6
  27. package/dist/library/@dso-toolkit/core/collection/components/image-overlay/image-overlay.css +2 -2
  28. package/dist/library/@dso-toolkit/core/collection/components/image-overlay/image-overlay.js +57 -11
  29. package/dist/library/@dso-toolkit/core/collection/components/info-button/info-button.js +24 -2
  30. package/dist/library/@dso-toolkit/core/collection/components/label/label.css +1 -1
  31. package/dist/library/@dso-toolkit/core/collection/components/map-controls/map-controls.css +2 -2
  32. package/dist/library/@dso-toolkit/core/collection/components/ozon-content/nodes/figuur.node.js +22 -0
  33. package/dist/library/@dso-toolkit/core/collection/components/ozon-content/nodes/{illustratie.node.js → inline-tekst-afbeelding.node.js} +2 -2
  34. package/dist/library/@dso-toolkit/core/collection/components/ozon-content/ozon-content-mapper.js +5 -3
  35. package/dist/library/@dso-toolkit/core/collection/components/ozon-content/ozon-content.css +2 -8
  36. package/dist/library/@dso-toolkit/core/collection/components/pagination/pagination.css +4 -4
  37. package/dist/library/@dso-toolkit/core/collection/components/progress-bar/progress-bar.css +1 -1
  38. package/dist/library/@dso-toolkit/core/collection/components/toggletip/toggletip.js +3 -15
  39. package/dist/library/@dso-toolkit/core/collection/components/tooltip/tooltip.css +1 -1
  40. package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/viewer-grid.css +5 -5
  41. package/dist/library/@dso-toolkit/core/custom-elements/index.js +135 -73
  42. package/dist/library/@dso-toolkit/core/dso-toolkit/dso-toolkit.css +1 -1
  43. package/dist/library/@dso-toolkit/core/dso-toolkit/dso-toolkit.esm.js +1 -1
  44. package/dist/{toolkit/core/packages/core/dist/dso-toolkit/p-04b8814d.entry.js → library/@dso-toolkit/core/dso-toolkit/p-1845b0ce.entry.js} +1 -1
  45. package/dist/library/@dso-toolkit/core/dso-toolkit/p-237cd551.entry.js +1 -0
  46. package/dist/{toolkit/core/packages/core/dist/dso-toolkit/p-0777c1c4.entry.js → library/@dso-toolkit/core/dso-toolkit/p-363b56b1.entry.js} +1 -1
  47. package/dist/library/@dso-toolkit/core/dso-toolkit/{p-3cb44a36.entry.js → p-6505be7d.entry.js} +1 -1
  48. package/dist/library/@dso-toolkit/core/dso-toolkit/{p-8e6ee9f0.entry.js → p-68d49733.entry.js} +1 -1
  49. package/dist/library/@dso-toolkit/core/dso-toolkit/{p-1e92e29d.entry.js → p-7b716383.entry.js} +1 -1
  50. package/dist/{toolkit/core/packages/core/dist/dso-toolkit/p-63e0f10d.entry.js → library/@dso-toolkit/core/dso-toolkit/p-80b5c915.entry.js} +1 -1
  51. package/dist/{toolkit/core/packages/core/dist/dso-toolkit/p-1d52d4f2.entry.js → library/@dso-toolkit/core/dso-toolkit/p-93683c65.entry.js} +1 -1
  52. package/dist/library/@dso-toolkit/core/dso-toolkit/p-acc0620a.entry.js +1 -0
  53. package/dist/library/@dso-toolkit/core/dso-toolkit/{p-1bd0e0c3.entry.js → p-ba835421.entry.js} +1 -1
  54. package/dist/library/@dso-toolkit/core/dso-toolkit/p-bd1ee63c.entry.js +1 -0
  55. package/dist/library/@dso-toolkit/core/dso-toolkit/p-bf4d6f63.entry.js +1 -0
  56. package/dist/library/@dso-toolkit/core/dso-toolkit/{p-17e9802f.entry.js → p-d60876c2.entry.js} +1 -1
  57. package/dist/{toolkit/core/packages/core/dist/dso-toolkit/p-a7bcd356.entry.js → library/@dso-toolkit/core/dso-toolkit/p-d84c166c.entry.js} +1 -1
  58. package/dist/library/@dso-toolkit/core/dso-toolkit/p-e98f049e.entry.js +1 -0
  59. package/dist/library/@dso-toolkit/core/dso-toolkit/{p-553bd3aa.entry.js → p-f726111e.entry.js} +1 -1
  60. package/dist/library/@dso-toolkit/core/esm/dso-alert.entry.js +1 -1
  61. package/dist/library/@dso-toolkit/core/esm/dso-autosuggest.entry.js +13 -2
  62. package/dist/library/@dso-toolkit/core/esm/dso-date-picker.entry.js +1 -1
  63. package/dist/library/@dso-toolkit/core/esm/dso-header.entry.js +1 -1
  64. package/dist/library/@dso-toolkit/core/esm/dso-helpcenter-panel.entry.js +1 -1
  65. package/dist/library/@dso-toolkit/core/esm/dso-highlight-box.entry.js +1 -1
  66. package/dist/library/@dso-toolkit/core/esm/dso-image-overlay.entry.js +46 -8
  67. package/dist/library/@dso-toolkit/core/esm/dso-info-button.entry.js +5 -1
  68. package/dist/library/@dso-toolkit/core/esm/dso-label.entry.js +1 -1
  69. package/dist/library/@dso-toolkit/core/esm/dso-map-controls.entry.js +1 -1
  70. package/dist/library/@dso-toolkit/core/esm/dso-ozon-content.entry.js +56 -34
  71. package/dist/library/@dso-toolkit/core/esm/dso-pagination.entry.js +1 -1
  72. package/dist/library/@dso-toolkit/core/esm/dso-progress-bar.entry.js +1 -1
  73. package/dist/library/@dso-toolkit/core/esm/dso-toggletip.entry.js +3 -15
  74. package/dist/library/@dso-toolkit/core/esm/dso-toolkit.js +1 -1
  75. package/dist/library/@dso-toolkit/core/esm/dso-tooltip.entry.js +1 -1
  76. package/dist/library/@dso-toolkit/core/esm/dso-viewer-grid.entry.js +1 -1
  77. package/dist/library/@dso-toolkit/core/esm/loader.js +1 -1
  78. package/dist/library/@dso-toolkit/core/types/components/autosuggest/autosuggest.d.ts +11 -1
  79. package/dist/library/@dso-toolkit/core/types/components/autosuggest/autosuggest.template.d.ts +1 -1
  80. package/dist/library/@dso-toolkit/core/types/components/image-overlay/image-overlay.d.ts +5 -0
  81. package/dist/library/@dso-toolkit/core/types/components/info-button/info-button.d.ts +2 -0
  82. package/dist/library/@dso-toolkit/core/types/components/ozon-content/nodes/{illustratie.node.d.ts → figuur.node.d.ts} +1 -1
  83. package/dist/library/@dso-toolkit/core/types/components/ozon-content/nodes/inline-tekst-afbeelding.node.d.ts +5 -0
  84. package/dist/library/@dso-toolkit/core/types/components/toggletip/toggletip.d.ts +1 -3
  85. package/dist/library/@dso-toolkit/core/types/components.d.ts +9 -0
  86. package/dist/library/components/detail/form--autocomplete.html +1 -1
  87. package/dist/library/components/detail/form--form-horizontal.html +1 -1
  88. package/dist/library/components/detail/form--form-vertical.html +1 -1
  89. package/dist/library/components/detail/form--header-in-legend.html +1 -1
  90. package/dist/library/components/detail/form--multi-page.html +1 -1
  91. package/dist/library/components/detail/form--sections.html +1 -1
  92. package/dist/library/components/detail/form--simple-form.html +1 -1
  93. package/dist/library/components/detail/form--single-page.html +1 -1
  94. package/dist/library/components/detail/form.html +1 -1
  95. package/dist/library/styles/dso.css +85 -78
  96. package/dist/toolkit/core/packages/core/dist/dso-toolkit/dso-toolkit.css +1 -1
  97. package/dist/toolkit/core/packages/core/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  98. package/dist/{library/@dso-toolkit/core/dso-toolkit/p-04b8814d.entry.js → toolkit/core/packages/core/dist/dso-toolkit/p-1845b0ce.entry.js} +1 -1
  99. package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-237cd551.entry.js +1 -0
  100. package/dist/{library/@dso-toolkit/core/dso-toolkit/p-0777c1c4.entry.js → toolkit/core/packages/core/dist/dso-toolkit/p-363b56b1.entry.js} +1 -1
  101. package/dist/toolkit/core/packages/core/dist/dso-toolkit/{p-3cb44a36.entry.js → p-6505be7d.entry.js} +1 -1
  102. package/dist/toolkit/core/packages/core/dist/dso-toolkit/{p-8e6ee9f0.entry.js → p-68d49733.entry.js} +1 -1
  103. package/dist/toolkit/core/packages/core/dist/dso-toolkit/{p-1e92e29d.entry.js → p-7b716383.entry.js} +1 -1
  104. package/dist/{library/@dso-toolkit/core/dso-toolkit/p-63e0f10d.entry.js → toolkit/core/packages/core/dist/dso-toolkit/p-80b5c915.entry.js} +1 -1
  105. package/dist/{library/@dso-toolkit/core/dso-toolkit/p-1d52d4f2.entry.js → toolkit/core/packages/core/dist/dso-toolkit/p-93683c65.entry.js} +1 -1
  106. package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-acc0620a.entry.js +1 -0
  107. package/dist/toolkit/core/packages/core/dist/dso-toolkit/{p-1bd0e0c3.entry.js → p-ba835421.entry.js} +1 -1
  108. package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-bd1ee63c.entry.js +1 -0
  109. package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-bf4d6f63.entry.js +1 -0
  110. package/dist/toolkit/core/packages/core/dist/dso-toolkit/{p-17e9802f.entry.js → p-d60876c2.entry.js} +1 -1
  111. package/dist/{library/@dso-toolkit/core/dso-toolkit/p-a7bcd356.entry.js → toolkit/core/packages/core/dist/dso-toolkit/p-d84c166c.entry.js} +1 -1
  112. package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-e98f049e.entry.js +1 -0
  113. package/dist/toolkit/core/packages/core/dist/dso-toolkit/{p-553bd3aa.entry.js → p-f726111e.entry.js} +1 -1
  114. package/dist/toolkit/styles/dso.css +85 -78
  115. package/hydrate/index.js +141 -75
  116. package/libs/@dso-toolkit/css/src/components/document-list/document-list.scss +10 -10
  117. package/libs/@dso-toolkit/css/src/components/form/form-groups/files/form-group-files.scss +1 -1
  118. package/libs/@dso-toolkit/css/src/components/form/form-groups/static/form-group-static.scss +1 -1
  119. package/libs/@dso-toolkit/css/src/components/navbar/navbar.scss +1 -1
  120. package/libs/@dso-toolkit/css/src/components/search-bar/search-bar.scss +13 -12
  121. package/libs/@dso-toolkit/sources/src/components/alert/alert.scss +1 -1
  122. package/libs/@dso-toolkit/sources/src/components/autosuggest/autosuggest.args.ts +6 -0
  123. package/libs/@dso-toolkit/sources/src/components/autosuggest/autosuggest.models.ts +1 -0
  124. package/libs/@dso-toolkit/sources/src/components/autosuggest/autosuggest.stories.ts +3 -2
  125. package/libs/@dso-toolkit/sources/src/components/banner/banner.scss +1 -1
  126. package/libs/@dso-toolkit/sources/src/components/button/button.scss +1 -1
  127. package/libs/@dso-toolkit/sources/src/components/dropdown-menu/dropdown-menu.scss +1 -1
  128. package/libs/@dso-toolkit/sources/src/components/input-number/input-number.scss +2 -8
  129. package/libs/@dso-toolkit/sources/src/components/label/label.scss +1 -1
  130. package/libs/@dso-toolkit/sources/src/components/ozon-content/ozon-content.content.ts +20 -0
  131. package/libs/@dso-toolkit/sources/src/components/pagination/pagination.scss +2 -2
  132. package/libs/@dso-toolkit/sources/src/components/progress-bar/progress-bar.scss +1 -1
  133. package/libs/@dso-toolkit/sources/src/components/tooltip/tooltip.scss +1 -1
  134. package/libs/@dso-toolkit/sources/src/styling/global/body.scss +1 -1
  135. package/libs/@dso-toolkit/sources/src/styling/global/code.scss +3 -0
  136. package/libs/@dso-toolkit/sources/src/styling/global/fieldset.scss +1 -1
  137. package/libs/@dso-toolkit/sources/src/styling/global/html.scss +1 -1
  138. package/libs/@dso-toolkit/sources/src/styling/mixins/form-control.scss +2 -2
  139. package/libs/@dso-toolkit/sources/src/styling/mixins/step-counter.scss +15 -6
  140. package/libs/@dso-toolkit/sources/src/styling/variables/typography.scss +5 -8
  141. package/libs/@dso-toolkit/sources/src/styling/variables/units.scss +13 -1
  142. package/package.json +2 -2
  143. package/dist/library/@dso-toolkit/core/dso-toolkit/p-14fc5767.entry.js +0 -1
  144. package/dist/library/@dso-toolkit/core/dso-toolkit/p-a5705dd1.entry.js +0 -1
  145. package/dist/library/@dso-toolkit/core/dso-toolkit/p-aa098949.entry.js +0 -1
  146. package/dist/library/@dso-toolkit/core/dso-toolkit/p-c282135e.entry.js +0 -1
  147. package/dist/library/@dso-toolkit/core/dso-toolkit/p-daf049bd.entry.js +0 -1
  148. package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-14fc5767.entry.js +0 -1
  149. package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-a5705dd1.entry.js +0 -1
  150. package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-aa098949.entry.js +0 -1
  151. package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-c282135e.entry.js +0 -1
  152. package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-daf049bd.entry.js +0 -1
@@ -26,15 +26,25 @@ export class Autosuggest {
26
26
  this.suggestOnFocus = false;
27
27
  this.showSuggestions = false;
28
28
  this.notFound = false;
29
+ this.showLoading = false;
29
30
  this.listboxId = v4();
30
31
  this.inputId = v4();
31
32
  this.labelId = v4();
32
- this.debouncedEmitValue = debounce((value) => this.changeEmitter.emit(value), 200);
33
+ this.debouncedEmitValue = debounce((value) => {
34
+ this.changeEmitter.emit(value);
35
+ this.debouncedShowLoading();
36
+ }, 200);
37
+ this.debouncedShowLoading = debounce(() => {
38
+ if (this.inputValue) {
39
+ this.showLoading = true;
40
+ }
41
+ }, this.loadingDelayed);
33
42
  this.inputValue = '';
34
43
  this.onInput = (event) => {
35
44
  if (!(event.target instanceof HTMLInputElement)) {
36
45
  throw new Error("event.target is not instanceof HTMLInputElement");
37
46
  }
47
+ this.showLoading = !this.loadingDelayed;
38
48
  this.inputValue = event.target.value;
39
49
  this.debouncedEmitValue(event.target.value.match(/(\S+)/g) ? event.target.value : '');
40
50
  };
@@ -186,6 +196,7 @@ export class Autosuggest {
186
196
  }
187
197
  }
188
198
  resetSelectedSuggestion() {
199
+ this.showLoading = !this.loadingDelayed;
189
200
  this.selectedSuggestion = undefined;
190
201
  this.input.setAttribute('aria-activedescendant', '');
191
202
  }
@@ -222,7 +233,7 @@ export class Autosuggest {
222
233
  const terms = this.input.value.split(' ').filter(t => t);
223
234
  return (h(Fragment, null,
224
235
  h("slot", null),
225
- this.loading
236
+ this.loading && this.showLoading
226
237
  ? h("div", { class: "autosuggest-progress-box" },
227
238
  h("dso-progress-indicator", { label: this.loadingLabel }))
228
239
  : h("ul", { role: "listbox", id: this.listboxId, "aria-labelledby": this.labelId, ref: element => this.listbox = element, hidden: !this.showSuggestions && !this.notFound }, this.showSuggestions
@@ -303,6 +314,23 @@ export class Autosuggest {
303
314
  "reflect": false,
304
315
  "defaultValue": "\"Een moment geduld.\""
305
316
  },
317
+ "loadingDelayed": {
318
+ "type": "number",
319
+ "mutable": false,
320
+ "complexType": {
321
+ "original": "number",
322
+ "resolved": "number | undefined",
323
+ "references": {}
324
+ },
325
+ "required": false,
326
+ "optional": true,
327
+ "docs": {
328
+ "tags": [],
329
+ "text": "To delay progress indicator showing (in ms)."
330
+ },
331
+ "attribute": "loading-delayed",
332
+ "reflect": false
333
+ },
306
334
  "notFoundLabel": {
307
335
  "type": "string",
308
336
  "mutable": false,
@@ -342,7 +370,8 @@ export class Autosuggest {
342
370
  static get states() { return {
343
371
  "showSuggestions": {},
344
372
  "selectedSuggestion": {},
345
- "notFound": {}
373
+ "notFound": {},
374
+ "showLoading": {}
346
375
  }; }
347
376
  static get events() { return [{
348
377
  "method": "selectEmitter",
@@ -3,14 +3,19 @@ import { storiesOf } from "@storybook/web-components";
3
3
  import { html } from 'lit-html';
4
4
  import { autosuggestTemplate } from "./autosuggest.template";
5
5
  import readme from "./readme.md";
6
- const autosuggestConnector = ([fetchSuggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, notFoundLabel]) => ({
6
+ const autosuggestConnector = ([fetchSuggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, loadingDelayed, notFoundLabel]) => ({
7
7
  suggestions: [],
8
8
  onChange: function (e) {
9
9
  onChange(e);
10
- this.suggestions = fetchSuggestions(e.detail);
11
- const suggestionsDemoPreElement = document.getElementById('suggestions-demo');
12
- if (suggestionsDemoPreElement) {
13
- suggestionsDemoPreElement.textContent = JSON.stringify(this.suggestions, null, 2);
10
+ if (loadingDelayed) {
11
+ setTimeout(() => {
12
+ this.suggestions = fetchSuggestions(e.detail);
13
+ processSuggestions(this.suggestions);
14
+ }, loadingDelayed + 1500);
15
+ }
16
+ else {
17
+ this.suggestions = fetchSuggestions(e.detail);
18
+ processSuggestions(this.suggestions);
14
19
  }
15
20
  },
16
21
  onSelect,
@@ -18,26 +23,33 @@ const autosuggestConnector = ([fetchSuggestions, onSelect, onChange, onSearch, s
18
23
  suggestOnFocus,
19
24
  loading,
20
25
  loadingLabel,
26
+ loadingDelayed,
21
27
  notFoundLabel
22
28
  });
29
+ const processSuggestions = (suggestions) => {
30
+ const suggestionsDemoPreElement = document.getElementById('suggestions-demo');
31
+ if (suggestionsDemoPreElement) {
32
+ suggestionsDemoPreElement.textContent = JSON.stringify(suggestions, null, 2);
33
+ }
34
+ };
23
35
  storiesOfAutosuggest({
24
36
  module,
25
37
  storiesOf,
26
38
  readme,
27
39
  }, {
28
- autosuggestDemoTemplate: (fetchSuggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, notFoundLabel) => html `
40
+ autosuggestDemoTemplate: (fetchSuggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, loadingDelayed, notFoundLabel) => html `
29
41
  <label for="autosuggestInputId">Label voor input</label>
30
- ${autosuggestTemplate(autosuggestConnector([fetchSuggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, notFoundLabel]), html `
42
+ ${autosuggestTemplate(autosuggestConnector([fetchSuggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, loadingDelayed, notFoundLabel]), html `
31
43
  <input id="autosuggestInputId" type="text" class="form-control">
32
44
  `)}
33
45
  <pre id="suggestions-demo">[]</pre>
34
46
  `,
35
- autosuggestInSearchBarTemplate: (fetchSuggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, notFoundLabel) => html `
47
+ autosuggestInSearchBarTemplate: (fetchSuggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, loadingDelayed, notFoundLabel) => html `
36
48
  <div class="dso-search-bar">
37
49
  <div class="dso-search-bar-input">
38
50
  <label for="search-bar--with-value">Label</label>
39
51
  <span class="dso-search-icon" aria-hidden="true"></span>
40
- ${autosuggestTemplate(autosuggestConnector([fetchSuggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, notFoundLabel]), html `
52
+ ${autosuggestTemplate(autosuggestConnector([fetchSuggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, loadingDelayed, notFoundLabel]), html `
41
53
  <input type="text" id="search-bar--with-value" placeholder="Bijvoorbeeld 'Rotterdam'">
42
54
  `)}
43
55
  <button type="button">
@@ -1,6 +1,6 @@
1
1
  import { html } from 'lit-html';
2
2
  import { ifDefined } from 'lit-html/directives/if-defined.js';
3
- export function autosuggestTemplate({ suggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, notFoundLabel }, children) {
3
+ export function autosuggestTemplate({ suggestions, onSelect, onChange, onSearch, suggestOnFocus, loading, loadingLabel, loadingDelayed, notFoundLabel }, children) {
4
4
  return html `
5
5
  <dso-autosuggest
6
6
  .suggestions=${suggestions}
@@ -10,6 +10,7 @@ export function autosuggestTemplate({ suggestions, onSelect, onChange, onSearch,
10
10
  ?suggest-on-focus=${suggestOnFocus}
11
11
  ?loading=${loading}
12
12
  loading-label=${ifDefined(loadingLabel)}
13
+ loading-delayed=${ifDefined(loadingDelayed)}
13
14
  not-found-label=${ifDefined(notFoundLabel)}
14
15
  >
15
16
  ${children}
@@ -25,9 +25,9 @@
25
25
  .dso-date__input {
26
26
  display: block;
27
27
  width: 100%;
28
- height: 40px;
28
+ height: calc(16px + 1.5rem);
29
29
  padding: 6px 14px;
30
- font-size: 16px;
30
+ font-size: 1rem;
31
31
  line-height: 1.5;
32
32
  color: #191919;
33
33
  background-color: #fff;
@@ -70,7 +70,7 @@
70
70
  border-width: 1px;
71
71
  }
72
72
  .dso-date__input[type=text] {
73
- line-height: 40px;
73
+ line-height: calc(16px + 1.5rem);
74
74
  }
75
75
  .dso-date__input[size] {
76
76
  width: auto;
@@ -304,7 +304,7 @@ dso-dropdown-menu .dso-dropdown-options {
304
304
  border-radius: 4px;
305
305
  border: 1px solid rgba(0, 0, 0, 0.15);
306
306
  box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.4);
307
- font-size: 16px;
307
+ font-size: 1rem;
308
308
  margin: 2px 0 0;
309
309
  min-width: 160px;
310
310
  padding: 5px 0;
@@ -490,7 +490,7 @@ dso-dropdown-menu .dso-dropdown-options dso-dropdown-options li + li {
490
490
  }
491
491
  .dropdown dso-dropdown-menu button {
492
492
  color: #39870c;
493
- font-size: 16px;
493
+ font-size: 1rem;
494
494
  font-weight: 600;
495
495
  position: relative;
496
496
  }
@@ -568,7 +568,7 @@ dso-dropdown-menu .dso-dropdown-options dso-dropdown-options li + li {
568
568
  }
569
569
  .dso-nav.dso-nav-sub > li > a {
570
570
  text-decoration: none;
571
- font-size: 16px;
571
+ font-size: 1rem;
572
572
  margin-top: 4px;
573
573
  padding: 4px 8px 3px;
574
574
  }
@@ -113,7 +113,7 @@
113
113
  color: #fff;
114
114
  }
115
115
  .open-button.btn-sm {
116
- line-height: 16px;
116
+ line-height: 1rem;
117
117
  }
118
118
  .open-button.btn-sm dso-icon,
119
119
  .open-button.btn-sm svg.di, .open-button.btn-sm.extern::after, .open-button.btn-sm.download::after, .open-button.btn-sm.dso-spinner::before {
@@ -246,7 +246,7 @@
246
246
  color: #afcf9d;
247
247
  }
248
248
  .close-button.btn-sm {
249
- line-height: 16px;
249
+ line-height: 1rem;
250
250
  }
251
251
  .close-button.btn-sm dso-icon,
252
252
  .close-button.btn-sm svg.di, .close-button.btn-sm.extern::after, .close-button.btn-sm.download::after, .close-button.btn-sm.dso-spinner::before {
@@ -48,7 +48,7 @@
48
48
  margin-top: 48px;
49
49
  }
50
50
  .dso-highlight-box.dso-has-counter {
51
- padding-top: 40px;
51
+ padding-top: 2.5rem;
52
52
  position: relative;
53
53
  }
54
54
  .dso-highlight-box .dso-step-counter {
@@ -57,15 +57,20 @@
57
57
  border-radius: 50%;
58
58
  box-sizing: content-box;
59
59
  color: #fff;
60
- font-size: 1.25em;
60
+ font-size: 1.25rem;
61
61
  font-weight: 500;
62
- height: 32px;
62
+ height: 2rem;
63
63
  left: 16px;
64
- line-height: 32px;
64
+ line-height: 2rem;
65
65
  position: absolute;
66
66
  text-align: center;
67
- top: -24px;
68
- width: 32px;
67
+ top: -1.5rem;
68
+ width: 2rem;
69
+ }
70
+ .dso-highlight-box .dso-step-counter svg.di {
71
+ height: 1.5rem;
72
+ margin-top: 0.25rem;
73
+ width: 1.5rem;
69
74
  }
70
75
  .dso-highlight-box dso-icon {
71
76
  vertical-align: text-top;
@@ -86,7 +86,7 @@ button::-moz-focus-inner {
86
86
  color: #afcf9d;
87
87
  }
88
88
  .open.btn-sm {
89
- line-height: 16px;
89
+ line-height: 1rem;
90
90
  }
91
91
  .open.btn-sm dso-icon,
92
92
  .open.btn-sm svg.di, .open.btn-sm.extern::after, .open.btn-sm.download::after, .open.btn-sm.dso-spinner::before {
@@ -277,7 +277,7 @@ button::-moz-focus-inner {
277
277
  color: #afcf9d;
278
278
  }
279
279
  .close.btn-sm {
280
- line-height: 16px;
280
+ line-height: 1rem;
281
281
  }
282
282
  .close.btn-sm dso-icon,
283
283
  .close.btn-sm svg.di, .close.btn-sm.extern::after, .close.btn-sm.download::after, .close.btn-sm.dso-spinner::before {
@@ -1,29 +1,67 @@
1
- import { Component, Element, forceUpdate, h, Host, State } from "@stencil/core";
1
+ import { Component, Element, forceUpdate, h, Host, Listen, State } from "@stencil/core";
2
+ import debounce from 'debounce';
2
3
  import { createFocusTrap } from 'focus-trap';
3
4
  export class ImageOverlay {
4
5
  constructor() {
5
6
  this.active = false;
6
7
  this.focused = false;
8
+ this.zoomable = false;
9
+ }
10
+ loadListener(event) {
11
+ if (event.target instanceof HTMLImageElement) {
12
+ this.setZoomable(event.target);
13
+ }
7
14
  }
8
15
  componentDidLoad() {
9
- this.mutationObserver = new MutationObserver(() => forceUpdate(this.host));
16
+ this.resizeObserver = new ResizeObserver(debounce(() => {
17
+ const imgElement = this.host.querySelector('img');
18
+ if (imgElement instanceof HTMLImageElement) {
19
+ this.setZoomable(imgElement);
20
+ }
21
+ }, 200));
22
+ this.mutationObserver = new MutationObserver((e) => {
23
+ var _a, _b;
24
+ forceUpdate(this.host);
25
+ if (((_a = e[0]) === null || _a === void 0 ? void 0 : _a.type) === 'childList') {
26
+ (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
27
+ // <img> is gone or a new element.
28
+ this.initZoomableImage();
29
+ }
30
+ });
10
31
  this.mutationObserver.observe(this.host, {
11
32
  attributes: true,
12
- subtree: true
33
+ subtree: true,
34
+ attributeFilter: ['src', 'alt'],
35
+ childList: true,
13
36
  });
37
+ this.initZoomableImage();
14
38
  }
15
39
  disconnectedCallback() {
16
- var _a, _b;
40
+ var _a, _b, _c;
17
41
  (_a = this.trap) === null || _a === void 0 ? void 0 : _a.deactivate();
18
42
  (_b = this.mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
43
+ (_c = this.resizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
44
+ }
45
+ initZoomableImage() {
46
+ var _a;
47
+ const imgElement = this.host.querySelector('img');
48
+ if (!(imgElement instanceof HTMLImageElement)) {
49
+ return;
50
+ }
51
+ // Due to timing issues where the image is loaded before we listen to load events we double check if the image is already complete.
52
+ if (imgElement.complete) {
53
+ this.setZoomable(imgElement);
54
+ }
55
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(imgElement);
56
+ }
57
+ setZoomable(imageElement) {
58
+ const { width, naturalWidth, height, naturalHeight } = imageElement;
59
+ this.zoomable = width < naturalWidth || height < naturalHeight;
19
60
  }
20
61
  render() {
21
62
  var _a;
22
63
  const { src, alt } = (_a = this.host.querySelector('img')) !== null && _a !== void 0 ? _a : {};
23
- return (h(Host, { tabindex: this.focused ? -1 : 0, onFocus: () => {
24
- var _a;
25
- (_a = this.buttonElement) === null || _a === void 0 ? void 0 : _a.focus();
26
- } },
64
+ return (h(Host, { tabindex: this.focused || !this.zoomable ? -1 : 0, onFocus: () => { var _a; return (_a = this.buttonElement) === null || _a === void 0 ? void 0 : _a.focus(); } },
27
65
  this.active && src && alt && (h("div", { class: "dimmer", ref: element => this.wrapperElement = element },
28
66
  h("div", { class: "wrapper" },
29
67
  h("img", { src: src, alt: alt }),
@@ -31,9 +69,9 @@ export class ImageOverlay {
31
69
  h("dso-icon", { icon: "times" }),
32
70
  h("span", null, "Sluiten"))))),
33
71
  h("slot", null),
34
- h("button", { type: "button", class: "open", ref: element => this.buttonElement = element, onClick: () => this.active = true, onFocus: () => this.focused = true, onBlur: () => this.focused = false },
72
+ this.zoomable && (h("button", { type: "button", class: "open", ref: element => this.buttonElement = element, onClick: () => this.active = true, onFocus: () => this.focused = true, onBlur: () => this.focused = false },
35
73
  h("dso-icon", { icon: "external-link" }),
36
- h("span", null, "Afbeelding vergroot weergeven"))));
74
+ h("span", null, "Afbeelding vergroot weergeven")))));
37
75
  }
38
76
  componentDidRender() {
39
77
  var _a, _b;
@@ -66,7 +104,15 @@ export class ImageOverlay {
66
104
  }; }
67
105
  static get states() { return {
68
106
  "active": {},
69
- "focused": {}
107
+ "focused": {},
108
+ "zoomable": {}
70
109
  }; }
71
110
  static get elementRef() { return "host"; }
111
+ static get listeners() { return [{
112
+ "name": "load",
113
+ "method": "loadListener",
114
+ "target": undefined,
115
+ "capture": true,
116
+ "passive": false
117
+ }]; }
72
118
  }
@@ -1,15 +1,19 @@
1
- import { h, Component, Event, Prop } from '@stencil/core';
1
+ import { h, Component, Event, Prop, Method } from '@stencil/core';
2
2
  import clsx from 'clsx';
3
3
  export class InfoButton {
4
4
  constructor() {
5
5
  this.label = 'Toelichting bij optie';
6
6
  }
7
+ async setFocus() {
8
+ var _a;
9
+ (_a = this.button) === null || _a === void 0 ? void 0 : _a.focus();
10
+ }
7
11
  handleToggle(e) {
8
12
  this.active = !this.active;
9
13
  this.toggle.emit({ originalEvent: e, active: this.active });
10
14
  }
11
15
  render() {
12
- return (h("button", { type: "button", class: clsx('btn', { 'dso-open': !!this.active, 'dso-info-secondary': !!this.secondary }), "aria-expanded": typeof this.active === 'boolean' ? this.active.toString() : undefined, onClick: e => this.handleToggle(e) },
16
+ return (h("button", { type: "button", class: clsx('btn', { 'dso-open': !!this.active, 'dso-info-secondary': !!this.secondary }), "aria-expanded": typeof this.active === 'boolean' ? this.active.toString() : undefined, onClick: e => this.handleToggle(e), ref: element => (this.button = element) },
13
17
  h("span", { class: "sr-only" }, this.label)));
14
18
  }
15
19
  static get is() { return "dso-info-button"; }
@@ -94,4 +98,22 @@ export class InfoButton {
94
98
  }
95
99
  }
96
100
  }]; }
101
+ static get methods() { return {
102
+ "setFocus": {
103
+ "complexType": {
104
+ "signature": "() => Promise<void>",
105
+ "parameters": [],
106
+ "references": {
107
+ "Promise": {
108
+ "location": "global"
109
+ }
110
+ },
111
+ "return": "Promise<void>"
112
+ },
113
+ "docs": {
114
+ "text": "",
115
+ "tags": []
116
+ }
117
+ }
118
+ }; }
97
119
  }
@@ -39,7 +39,7 @@
39
39
  border-radius: 0 4px 4px 0;
40
40
  color: inherit;
41
41
  float: right;
42
- font-size: 16px;
42
+ font-size: 1rem;
43
43
  margin-bottom: -4px;
44
44
  margin-left: 8px;
45
45
  margin-right: -4px;
@@ -104,7 +104,7 @@ button::-moz-focus-inner {
104
104
  color: #afcf9d;
105
105
  }
106
106
  #toggle-visibility-button.btn-sm {
107
- line-height: 16px;
107
+ line-height: 1rem;
108
108
  }
109
109
  #toggle-visibility-button.btn-sm dso-icon,
110
110
  #toggle-visibility-button.btn-sm svg.di, #toggle-visibility-button.btn-sm.extern::after, #toggle-visibility-button.btn-sm.download::after, #toggle-visibility-button.btn-sm.dso-spinner::before {
@@ -286,7 +286,7 @@ button::-moz-focus-inner {
286
286
  color: #afcf9d;
287
287
  }
288
288
  #zoom-buttons button.btn-sm {
289
- line-height: 16px;
289
+ line-height: 1rem;
290
290
  }
291
291
  #zoom-buttons button.btn-sm dso-icon,
292
292
  #zoom-buttons button.btn-sm svg.di, #zoom-buttons button.btn-sm.extern::after, #zoom-buttons button.btn-sm.download::after, #zoom-buttons button.btn-sm.dso-spinner::before {
@@ -0,0 +1,22 @@
1
+ import { h } from '@stencil/core';
2
+ import { getNodeName } from '../get-node-name.function';
3
+ export class OzonContentFiguurNode {
4
+ constructor() {
5
+ this.name = [
6
+ 'Figuur',
7
+ ];
8
+ }
9
+ render(node) {
10
+ var _a, _b, _c, _d, _e;
11
+ const childNodes = Array.from(node.childNodes);
12
+ const titel = (_a = childNodes.find(n => getNodeName(n) === 'Titel')) === null || _a === void 0 ? void 0 : _a.textContent;
13
+ const bijschrift = (_b = childNodes.find(n => getNodeName(n) === 'Bijschrift')) === null || _b === void 0 ? void 0 : _b.textContent;
14
+ const illustratieNode = childNodes.find(n => getNodeName(n) === 'Illustratie');
15
+ if (illustratieNode instanceof Element) {
16
+ return (h("div", { class: "dso-ozon-figuur" },
17
+ h("dso-image-overlay", null,
18
+ h("img", { src: (_c = illustratieNode.getAttribute('naam')) !== null && _c !== void 0 ? _c : undefined, alt: (_e = (_d = titel !== null && titel !== void 0 ? titel : illustratieNode.getAttribute('alt')) !== null && _d !== void 0 ? _d : illustratieNode.getAttribute('naam')) !== null && _e !== void 0 ? _e : undefined })),
19
+ bijschrift && (h("span", { class: "figuur-bijschrift" }, bijschrift))));
20
+ }
21
+ }
22
+ }
@@ -1,9 +1,9 @@
1
1
  import { h } from '@stencil/core';
2
- export class OzonContentIllustratieNode {
2
+ export class OzonContentInlineTekstAfbeeldingNode {
3
3
  constructor() {
4
4
  this.name = [
5
+ 'InlineTekstAfbeelding',
5
6
  'Illustratie',
6
- 'InlineTekstAfbeelding'
7
7
  ];
8
8
  }
9
9
  render(node) {
@@ -2,17 +2,18 @@ import { Fragment, h } from '@stencil/core';
2
2
  import { OzonContentAlNode } from './nodes/al.node';
3
3
  import { OzonContentDocumentNode } from './nodes/document.node';
4
4
  import { OzonContentExtRefNode } from './nodes/ext-ref.node';
5
- import { OzonContentIllustratieNode } from './nodes/illustratie.node';
5
+ import { OzonContentFiguurNode } from './nodes/figuur.node';
6
6
  import { OzonContentInhoudNode } from './nodes/inhoud.node';
7
+ import { OzonContentInlineTekstAfbeeldingNode } from './nodes/inline-tekst-afbeelding.node';
7
8
  import { OzonContentOpschriftNode } from './nodes/opschrift.node';
8
9
  import { OzonContentInlineNodes } from './nodes/inline.nodes';
10
+ import { OzonContentIntIoRefNode } from './nodes/int-io-ref.node';
9
11
  import { OzonContentIntRefNode } from './nodes/int-ref.node';
10
12
  import { OzonContentNootNode } from './nodes/noot.node';
11
13
  import { OzonContentTableNode } from './nodes/table.node';
12
14
  import { OzonContentTextNode } from './nodes/text.node';
13
15
  import { getNodeName } from './get-node-name.function';
14
16
  import { OzonContentFallbackNode } from './nodes/fallback.node';
15
- import { OzonContentIntIoRefNode } from './nodes/int-io-ref.node';
16
17
  export class Mapper {
17
18
  constructor() {
18
19
  this.mappers = [
@@ -24,10 +25,11 @@ export class Mapper {
24
25
  new OzonContentExtRefNode(),
25
26
  new OzonContentAlNode(),
26
27
  new OzonContentInlineNodes(),
27
- new OzonContentIllustratieNode(),
28
+ new OzonContentInlineTekstAfbeeldingNode(),
28
29
  new OzonContentNootNode(),
29
30
  new OzonContentTableNode(),
30
31
  new OzonContentIntIoRefNode(),
32
+ new OzonContentFiguurNode(),
31
33
  ];
32
34
  this.skip = this.mappers.reduce((t, m) => {
33
35
  if (m.handles) {
@@ -192,15 +192,9 @@ span[role=paragraph] {
192
192
  text-align: right;
193
193
  }
194
194
 
195
- .od-Figuur img {
196
- margin-left: 25px;
197
- max-width: 100%;
198
- height: auto;
199
- }
200
-
201
- .od-Figuur .od-Bijschrift {
195
+ .dso-ozon-figuur .figuur-bijschrift {
196
+ display: block;
202
197
  font-size: 0.75rem;
203
- margin-left: 25px;
204
198
  padding-bottom: 2.5rem;
205
199
  }
206
200
 
@@ -14,7 +14,7 @@
14
14
  .pagination > li {
15
15
  display: inline-block;
16
16
  font-weight: bold;
17
- line-height: 28px;
17
+ line-height: calc(2rem - 4px);
18
18
  text-align: center;
19
19
  vertical-align: middle;
20
20
  }
@@ -23,10 +23,10 @@
23
23
  align-items: center;
24
24
  color: #39870c;
25
25
  display: flex;
26
- height: 32px;
26
+ height: 2rem;
27
27
  justify-content: center;
28
28
  position: relative;
29
- width: 32px;
29
+ width: 2rem;
30
30
  }
31
31
  .pagination > li > a:active,
32
32
  .pagination > li > span:active {
@@ -37,7 +37,7 @@
37
37
  border-radius: 50%;
38
38
  }
39
39
  .pagination > li a {
40
- line-height: 32px;
40
+ line-height: 2rem;
41
41
  text-decoration: none;
42
42
  }
43
43
  .pagination > li a:hover, .pagination > li a:focus {
@@ -30,7 +30,7 @@
30
30
  background-color: #39870c;
31
31
  color: #fff;
32
32
  float: left;
33
- font-size: 14px;
33
+ font-size: 0.875rem;
34
34
  height: 100%;
35
35
  line-height: 16px;
36
36
  text-align: center;
@@ -23,30 +23,18 @@ export class Toggletip {
23
23
  }
24
24
  };
25
25
  this.keyDownListener = (event) => {
26
+ var _a;
26
27
  if (!event.defaultPrevented && event.key == "Escape") {
27
28
  this.close();
28
- this.button.focus();
29
+ (_a = this.infoButton) === null || _a === void 0 ? void 0 : _a.setFocus();
29
30
  event.preventDefault();
30
31
  }
31
32
  return;
32
33
  };
33
34
  }
34
- componentDidRender() {
35
- var _a, _b, _c;
36
- const infoButton = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("dso-info-button");
37
- if (!infoButton) {
38
- throw Error("dso-info-button not found");
39
- }
40
- this.infoButton = infoButton;
41
- const button = (_c = (_b = this.infoButton) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector("button");
42
- if (!button) {
43
- throw Error("button not found");
44
- }
45
- this.button = button;
46
- }
47
35
  render() {
48
36
  return (h(Fragment, null,
49
- h("dso-info-button", { id: "toggle", onClick: this.click, label: this.label, active: this.active, secondary: this.secondary }),
37
+ h("dso-info-button", { id: "toggle", onClick: this.click, label: this.label, active: this.active, secondary: this.secondary, ref: element => this.infoButton = element }),
50
38
  h("dso-tooltip", { stateless: true, descriptive: true, for: "toggle", active: this.active, position: this.position, small: this.small },
51
39
  h("slot", null))));
52
40
  }
@@ -59,7 +59,7 @@
59
59
  border-radius: 4px;
60
60
  color: #191919;
61
61
  display: inline-block;
62
- font-size: 16px;
62
+ font-size: 1rem;
63
63
  max-width: 640px;
64
64
  padding: 8px 16px;
65
65
  position: relative;