@dso-toolkit/core 37.0.0 → 38.1.1

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 (65) hide show
  1. package/dist/cjs/dso-autosuggest.cjs.entry.js +17 -7
  2. package/dist/cjs/dso-dropdown-menu.cjs.entry.js +11 -28
  3. package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +2 -2
  4. package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
  5. package/dist/cjs/dso-ozon-content.cjs.entry.js +22 -3
  6. package/dist/cjs/dso-toggletip.cjs.entry.js +1 -2
  7. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  8. package/dist/cjs/dso-tooltip.cjs.entry.js +5 -1
  9. package/dist/cjs/dso-viewer-grid.cjs.entry.js +5 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/components/autosuggest/autosuggest.css +11 -2
  12. package/dist/collection/components/autosuggest/autosuggest.js +55 -8
  13. package/dist/collection/components/autosuggest/autosuggest.template.js +4 -1
  14. package/dist/collection/components/dropdown-menu/dropdown-menu.js +12 -30
  15. package/dist/collection/components/helpcenter-panel/helpcenter-panel.css +1 -0
  16. package/dist/collection/components/helpcenter-panel/helpcenter-panel.js +4 -4
  17. package/dist/collection/components/highlight-box/highlight-box.css +1 -1
  18. package/dist/collection/components/ozon-content/nodes/noot.node.js +1 -1
  19. package/dist/collection/components/ozon-content/ozon-content.css +14 -0
  20. package/dist/collection/components/ozon-content/ozon-content.js +58 -2
  21. package/dist/collection/components/ozon-content/ozon-content.template.js +4 -1
  22. package/dist/collection/components/selectable/selectable.template.js +1 -1
  23. package/dist/collection/components/toggletip/toggletip.js +1 -2
  24. package/dist/collection/components/tooltip/tooltip.js +24 -2
  25. package/dist/collection/components/tooltip/tooltip.template.js +2 -2
  26. package/dist/collection/components/viewer-grid/viewer-grid.js +27 -1
  27. package/dist/collection/components/viewer-grid/viewer-grid.template.js +4 -1
  28. package/dist/custom-elements/index.js +67 -49
  29. package/dist/dso-toolkit/dso-toolkit.css +1 -1
  30. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  31. package/dist/dso-toolkit/{p-d6c47662.entry.js → p-14fc5767.entry.js} +1 -1
  32. package/dist/dso-toolkit/{p-7b67e324.entry.js → p-150fe323.entry.js} +1 -1
  33. package/dist/dso-toolkit/{p-2daedd0a.entry.js → p-1e92e29d.entry.js} +1 -1
  34. package/dist/dso-toolkit/p-2f64bded.entry.js +1 -0
  35. package/dist/dso-toolkit/p-49938275.entry.js +1 -0
  36. package/dist/dso-toolkit/p-7f41f2a1.entry.js +1 -0
  37. package/dist/dso-toolkit/p-a8cf15cf.entry.js +1 -0
  38. package/dist/dso-toolkit/p-e1496a15.entry.js +1 -0
  39. package/dist/esm/dso-autosuggest.entry.js +17 -7
  40. package/dist/esm/dso-dropdown-menu.entry.js +12 -29
  41. package/dist/esm/dso-helpcenter-panel.entry.js +2 -2
  42. package/dist/esm/dso-highlight-box.entry.js +1 -1
  43. package/dist/esm/dso-ozon-content.entry.js +23 -4
  44. package/dist/esm/dso-toggletip.entry.js +1 -2
  45. package/dist/esm/dso-toolkit.js +1 -1
  46. package/dist/esm/dso-tooltip.entry.js +5 -1
  47. package/dist/esm/dso-viewer-grid.entry.js +5 -1
  48. package/dist/esm/loader.js +1 -1
  49. package/dist/types/components/autosuggest/autosuggest.d.ts +8 -0
  50. package/dist/types/components/autosuggest/autosuggest.template.d.ts +1 -1
  51. package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +0 -3
  52. package/dist/types/components/ozon-content/ozon-content.d.ts +14 -1
  53. package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +3 -0
  54. package/dist/types/components/ozon-content/ozon-content.template.d.ts +1 -1
  55. package/dist/types/components/tooltip/tooltip.d.ts +4 -0
  56. package/dist/types/components/tooltip/tooltip.template.d.ts +1 -1
  57. package/dist/types/components/viewer-grid/viewer-grid.d.ts +5 -2
  58. package/dist/types/components/viewer-grid/viewer-grid.template.d.ts +1 -1
  59. package/dist/types/components.d.ts +46 -2
  60. package/package.json +10 -11
  61. package/dist/dso-toolkit/p-0e535c2b.entry.js +0 -1
  62. package/dist/dso-toolkit/p-1a3db1cd.entry.js +0 -1
  63. package/dist/dso-toolkit/p-1dc02e51.entry.js +0 -1
  64. package/dist/dso-toolkit/p-50c71bd2.entry.js +0 -1
  65. package/dist/dso-toolkit/p-d1f62081.entry.js +0 -1
@@ -29,13 +29,13 @@ export class HelpcenterPanel {
29
29
  }
30
30
  render() {
31
31
  return (h(Fragment, null,
32
- h("button", { type: "button", onClick: this.openClick, class: `open-button ${this.isOpen}` },
32
+ h("button", { type: "button", onClick: this.openClick, class: `open-button ${this.isOpen}`, "aria-expanded": "false", "aria-haspopup": "dialog" },
33
33
  h("dso-icon", { icon: "help" }),
34
34
  h("span", null, this.label)),
35
35
  h("div", { class: `wrapper ${this.visibility}` },
36
- h("div", { class: "dimscreen" }),
37
- h("div", { class: `iframe-container ${this.slideState}` }, this.loadIframe ? h("iframe", { src: this.url }) : h("div", null)),
38
- h("button", { type: "button", class: `close-button ${this.isOpen}`, onClick: this.closeClick },
36
+ h("div", { class: "dimscreen", onClick: this.closeClick }),
37
+ h("div", { class: `iframe-container ${this.slideState}`, "aria-live": "polite" }, this.loadIframe ? h("iframe", { src: this.url }) : h("div", null)),
38
+ h("button", { type: "button", class: `close-button ${this.isOpen}`, onClick: this.closeClick, "aria-expanded": "true" },
39
39
  h("span", { class: "sr-only" }, "sluiten")))));
40
40
  }
41
41
  static get is() { return "dso-helpcenter-panel"; }
@@ -28,7 +28,7 @@
28
28
  background-color: #f2f2f2;
29
29
  margin-top: 16px;
30
30
  padding: 16px;
31
- margin-bottom: 16px;
31
+ margin-bottom: 24px;
32
32
  }
33
33
  .dso-highlight-box.dso-white {
34
34
  background-color: #fff;
@@ -21,7 +21,7 @@ export class OzonContentNootNode {
21
21
  return (h(Fragment, null,
22
22
  h("sup", null,
23
23
  h("button", { type: "button", class: "toggle-note", id: noteControlsId, onClick: () => setState === null || setState === void 0 ? void 0 : setState(openNoteId === noteId ? undefined : noteId), onBlur: () => setState === null || setState === void 0 ? void 0 : setState(undefined), "aria-expanded": openNoteId === noteId ? 'true' : 'false' }, nootNummer)),
24
- h("dso-tooltip", { active: openNoteId === noteId, for: noteControlsId, stateless: true },
24
+ h("dso-tooltip", { active: openNoteId === noteId, for: noteControlsId, stateless: true, descriptive: true },
25
25
  h("span", { role: "section" }, mapNodeToJsx(Array.from(node.querySelectorAll(':scope > Al')))))));
26
26
  }
27
27
  }
@@ -10,6 +10,20 @@
10
10
  text-decoration: line-through !important;
11
11
  }
12
12
 
13
+ :host([interactive]) {
14
+ background-color: transparent;
15
+ color: #39870c;
16
+ text-decoration: underline;
17
+ cursor: pointer;
18
+ }
19
+ :host([interactive]):hover, :host([interactive]):focus {
20
+ color: #676cb0;
21
+ text-decoration: underline;
22
+ }
23
+ :host([interactive]):active {
24
+ text-decoration: none;
25
+ }
26
+
13
27
  .deleted-start,
14
28
  .deleted-end {
15
29
  position: absolute;
@@ -1,4 +1,5 @@
1
- import { h, Component, Event, Prop, State } from '@stencil/core';
1
+ import { h, Component, Element, Event, Prop, State, Host } from '@stencil/core';
2
+ import { isTabbable } from 'tabbable';
2
3
  import { Mapper } from './ozon-content-mapper';
3
4
  export class OzonContent {
4
5
  constructor() {
@@ -10,9 +11,25 @@ export class OzonContent {
10
11
  * Marks content as deleted using visual and accessible clues.
11
12
  */
12
13
  this.deleted = false;
14
+ /**
15
+ * Visualize the component as interactive. This means that the component will emit `dsoClick` events when the user clicks non-interactive elements.
16
+ *
17
+ * **Do not** use this without an accessible companion element! `interactive` is only
18
+ * meant to ease the use of the companion element for mouse/touch users.
19
+ */
20
+ this.interactive = false;
13
21
  this.state = {};
14
22
  this.mapper = new Mapper();
15
23
  }
24
+ handleHostOnClick(e) {
25
+ if (!this.interactive) {
26
+ return;
27
+ }
28
+ const doIt = e.composedPath().find(e => e === this.host || (e instanceof HTMLElement && isTabbable(e))) === this.host;
29
+ if (doIt) {
30
+ this.dsoClick.emit({ originalEvent: e });
31
+ }
32
+ }
16
33
  render() {
17
34
  var _a;
18
35
  const context = {
@@ -27,7 +44,7 @@ export class OzonContent {
27
44
  transformed,
28
45
  h("span", { class: "deleted-end" }, "Einde verwijderd element")));
29
46
  }
30
- return transformed;
47
+ return (h(Host, { onClick: (e) => this.handleHostOnClick(e) }, transformed));
31
48
  }
32
49
  static get is() { return "dso-ozon-content"; }
33
50
  static get encapsulation() { return "scoped"; }
@@ -90,6 +107,24 @@ export class OzonContent {
90
107
  "attribute": "deleted",
91
108
  "reflect": true,
92
109
  "defaultValue": "false"
110
+ },
111
+ "interactive": {
112
+ "type": "boolean",
113
+ "mutable": false,
114
+ "complexType": {
115
+ "original": "boolean",
116
+ "resolved": "boolean",
117
+ "references": {}
118
+ },
119
+ "required": false,
120
+ "optional": false,
121
+ "docs": {
122
+ "tags": [],
123
+ "text": "Visualize the component as interactive. This means that the component will emit `dsoClick` events when the user clicks non-interactive elements.\n\n**Do not** use this without an accessible companion element! `interactive` is only\nmeant to ease the use of the companion element for mouse/touch users."
124
+ },
125
+ "attribute": "interactive",
126
+ "reflect": true,
127
+ "defaultValue": "false"
93
128
  }
94
129
  }; }
95
130
  static get states() { return {
@@ -115,5 +150,26 @@ export class OzonContent {
115
150
  }
116
151
  }
117
152
  }
153
+ }, {
154
+ "method": "dsoClick",
155
+ "name": "dsoClick",
156
+ "bubbles": true,
157
+ "cancelable": true,
158
+ "composed": true,
159
+ "docs": {
160
+ "tags": [],
161
+ "text": "These events are only emitted when the component is `interactive`."
162
+ },
163
+ "complexType": {
164
+ "original": "OzonContentClick",
165
+ "resolved": "OzonContentClick",
166
+ "references": {
167
+ "OzonContentClick": {
168
+ "location": "import",
169
+ "path": "./ozon-content.interfaces"
170
+ }
171
+ }
172
+ }
118
173
  }]; }
174
+ static get elementRef() { return "host"; }
119
175
  }
@@ -1,11 +1,14 @@
1
1
  import { html } from 'lit-html';
2
- export function ozonContentTemplate({ content, inline, deleted, onAnchorClick }) {
2
+ import { ifDefined } from 'lit-html/directives/if-defined.js';
3
+ export function ozonContentTemplate({ content, inline, interactive, deleted, onAnchorClick, onClick }) {
3
4
  return html `
4
5
  <dso-ozon-content
5
6
  .content=${content}
6
7
  ?inline=${inline}
8
+ ?interactive=${interactive}
7
9
  ?deleted=${deleted}
8
10
  @anchorClick=${onAnchorClick}
11
+ @dsoClick=${ifDefined(interactive ? onClick : undefined)}
9
12
  ></dso-ozon-content>
10
13
  `;
11
14
  }
@@ -15,7 +15,7 @@ export function selectableTemplate({ type, id, name, label, value, required, inv
15
15
  ?checked=${checked}
16
16
  ?indeterminate=${indeterminate}
17
17
  ?info-fixed=${info === null || info === void 0 ? void 0 : info.fixed}
18
- @dsoChange=${(e) => onChange(e.detail)}
18
+ @dsoChange=${(e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.detail)}
19
19
  >
20
20
  ${label}
21
21
  ${(_a = info === null || info === void 0 ? void 0 : info.richContent) !== null && _a !== void 0 ? _a : nothing}
@@ -43,12 +43,11 @@ export class Toggletip {
43
43
  throw Error("button not found");
44
44
  }
45
45
  this.button = button;
46
- this.host.setAttribute("tabindex", "-1");
47
46
  }
48
47
  render() {
49
48
  return (h(Fragment, null,
50
49
  h("dso-info-button", { id: "toggle", onClick: this.click, label: this.label, active: this.active, secondary: this.secondary }),
51
- h("dso-tooltip", { stateless: true, for: "toggle", active: this.active, position: this.position, small: this.small },
50
+ h("dso-tooltip", { stateless: true, descriptive: true, for: "toggle", active: this.active, position: this.position, small: this.small },
52
51
  h("slot", null))));
53
52
  }
54
53
  static get is() { return "dso-toggletip"; }
@@ -6,6 +6,10 @@ import clsx from 'clsx';
6
6
  const transitionDuration = 150;
7
7
  export class Tooltip {
8
8
  constructor() {
9
+ /**
10
+ * Defines if the tooltip is descriptive. A descriptive tooltip contains a meaningful message. Tooltips that are not descriptive are hidden from screenreaders using `aria-hidden`.
11
+ */
12
+ this.descriptive = false;
9
13
  /**
10
14
  * Set position of tooltip relative to target
11
15
  */
@@ -123,9 +127,9 @@ export class Tooltip {
123
127
  }
124
128
  render() {
125
129
  return (h(Host, { class: { 'hidden': this.hidden } },
126
- h("div", { class: clsx('tooltip', { in: this.active }), role: "tooltip" },
130
+ h("div", { class: clsx('tooltip', { in: this.active }) },
127
131
  !this.noArrow && h("div", { "data-popper-arrow": true, class: "tooltip-arrow" }),
128
- h("div", { class: clsx('tooltip-inner', { 'dso-small': this.small }) },
132
+ h("div", { "aria-hidden": !this.descriptive || undefined, class: clsx('tooltip-inner', { 'dso-small': this.small }) },
129
133
  h("slot", null)))));
130
134
  }
131
135
  getTarget() {
@@ -158,6 +162,24 @@ export class Tooltip {
158
162
  "$": ["tooltip.css"]
159
163
  }; }
160
164
  static get properties() { return {
165
+ "descriptive": {
166
+ "type": "boolean",
167
+ "mutable": false,
168
+ "complexType": {
169
+ "original": "boolean",
170
+ "resolved": "boolean",
171
+ "references": {}
172
+ },
173
+ "required": false,
174
+ "optional": false,
175
+ "docs": {
176
+ "tags": [],
177
+ "text": "Defines if the tooltip is descriptive. A descriptive tooltip contains a meaningful message. Tooltips that are not descriptive are hidden from screenreaders using `aria-hidden`."
178
+ },
179
+ "attribute": "descriptive",
180
+ "reflect": true,
181
+ "defaultValue": "false"
182
+ },
161
183
  "position": {
162
184
  "type": "string",
163
185
  "mutable": false,
@@ -1,7 +1,7 @@
1
1
  import { html } from 'lit-html';
2
2
  import { ifDefined } from 'lit-html/directives/if-defined.js';
3
- export function tooltipTemplate({ active, position, label, id }) {
4
- return html `<dso-tooltip position=${position} for=${ifDefined(id)} ?active=${active}>
3
+ export function tooltipTemplate({ active, descriptive, position, label, id }) {
4
+ return html `<dso-tooltip ?descriptive=${ifDefined(descriptive)} position=${position} for=${ifDefined(id)} ?active=${active}>
5
5
  ${label}
6
6
  </dso-tooltip>`;
7
7
  }
@@ -6,7 +6,11 @@ export class ViewerGrid {
6
6
  constructor() {
7
7
  this.filterpanelOpen = false;
8
8
  this.overlayOpen = false;
9
- this.mainSize = "large";
9
+ /**
10
+ * Size of the main content panel when component loads. Changing this attribute afterwards has no effect.
11
+ */
12
+ this.initialMainSize = "large";
13
+ this.mainSize = this.initialMainSize;
10
14
  this.filterpanelSlot = null;
11
15
  this.overlaySlot = null;
12
16
  this.shrinkMain = () => {
@@ -163,6 +167,28 @@ export class ViewerGrid {
163
167
  "attribute": "overlay-open",
164
168
  "reflect": true,
165
169
  "defaultValue": "false"
170
+ },
171
+ "initialMainSize": {
172
+ "type": "string",
173
+ "mutable": false,
174
+ "complexType": {
175
+ "original": "MainSize",
176
+ "resolved": "\"large\" | \"medium\" | \"small\"",
177
+ "references": {
178
+ "MainSize": {
179
+ "location": "local"
180
+ }
181
+ }
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "Size of the main content panel when component loads. Changing this attribute afterwards has no effect."
188
+ },
189
+ "attribute": "initial-main-size",
190
+ "reflect": false,
191
+ "defaultValue": "\"large\""
166
192
  }
167
193
  }; }
168
194
  static get states() { return {
@@ -1,9 +1,11 @@
1
1
  import { html } from "lit-html";
2
- export function viewerGridTemplate({ filterpanel, main, map, overlay, noOverlay, filterpanelOpen, overlayOpen, mainSizeChange, filterpanelApply, filterpanelCancel, closeOverlay, }) {
2
+ import { ifDefined } from 'lit-html/directives/if-defined.js';
3
+ export function viewerGridTemplate({ filterpanel, main, map, overlay, noOverlay, filterpanelOpen, overlayOpen, initialMainSize, mainSizeChange, filterpanelApply, filterpanelCancel, closeOverlay, }) {
3
4
  return noOverlay
4
5
  ? html `
5
6
  <dso-viewer-grid
6
7
  ?overlay-open=${overlayOpen}
8
+ initial-main-size=${ifDefined(initialMainSize)}
7
9
  @closeOverlay=${closeOverlay}
8
10
  >
9
11
  <div slot="main">${main}</div>
@@ -14,6 +16,7 @@ export function viewerGridTemplate({ filterpanel, main, map, overlay, noOverlay,
14
16
  <dso-viewer-grid
15
17
  ?filterpanel-open=${filterpanelOpen}
16
18
  ?overlay-open=${overlayOpen}
19
+ initial-main-size=${ifDefined(initialMainSize)}
17
20
  @mainSizeChange=${mainSizeChange}
18
21
  @closeOverlay=${closeOverlay}
19
22
  @filterpanelApply=${filterpanelApply}