@dso-toolkit/core 43.1.0 → 44.0.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 (69) hide show
  1. package/dist/cjs/dso-autosuggest.cjs.entry.js +1 -1
  2. package/dist/cjs/dso-label.cjs.entry.js +16 -12
  3. package/dist/cjs/dso-ozon-content.cjs.entry.js +9 -4
  4. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  5. package/dist/cjs/dso-viewer-grid.cjs.entry.js +9 -4
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/alert/alert.template.js +0 -14
  8. package/dist/collection/components/autosuggest/autosuggest.js +1 -1
  9. package/dist/collection/components/date-picker/date-picker.template.js +1 -16
  10. package/dist/collection/components/dropdown-menu/dropdown-menu.template.js +22 -3
  11. package/dist/collection/components/label/label.css +5 -1
  12. package/dist/collection/components/label/label.js +21 -14
  13. package/dist/collection/components/label/label.template.js +3 -3
  14. package/dist/collection/components/ozon-content/nodes/ext-ref.node.js +2 -2
  15. package/dist/collection/components/ozon-content/ozon-content.css +7 -0
  16. package/dist/collection/components/ozon-content/ozon-content.js +10 -5
  17. package/dist/collection/components/ozon-content/ozon-content.template.js +1 -1
  18. package/dist/collection/components/viewer-grid/viewer-grid.css +11 -10
  19. package/dist/collection/components/viewer-grid/viewer-grid.js +10 -2
  20. package/dist/collection/components/viewer-grid/{templates/viewer-grid.template.js → viewer-grid.template.js} +0 -0
  21. package/dist/custom-elements/index.js +37 -23
  22. package/dist/dso-toolkit/dso-toolkit.css +1 -1
  23. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  24. package/dist/dso-toolkit/p-446dba5a.entry.js +1 -0
  25. package/dist/dso-toolkit/p-7bfc5267.entry.js +1 -0
  26. package/dist/dso-toolkit/p-814d9d78.entry.js +1 -0
  27. package/dist/dso-toolkit/p-cc45ecdf.entry.js +1 -0
  28. package/dist/esm/dso-autosuggest.entry.js +1 -1
  29. package/dist/esm/dso-label.entry.js +17 -13
  30. package/dist/esm/dso-ozon-content.entry.js +9 -4
  31. package/dist/esm/dso-toolkit.js +1 -1
  32. package/dist/esm/dso-viewer-grid.entry.js +9 -4
  33. package/dist/esm/loader.js +1 -1
  34. package/dist/types/components/alert/alert.template.d.ts +1 -2
  35. package/dist/types/components/date-picker/date-picker.template.d.ts +1 -4
  36. package/dist/types/components/dropdown-menu/dropdown-menu.template.d.ts +1 -2
  37. package/dist/types/components/label/label.d.ts +2 -1
  38. package/dist/types/components/label/label.template.d.ts +1 -1
  39. package/dist/types/components/ozon-content/ozon-content.d.ts +5 -1
  40. package/dist/types/components/viewer-grid/viewer-grid.d.ts +4 -0
  41. package/dist/types/components/viewer-grid/{templates/viewer-grid.template.d.ts → viewer-grid.template.d.ts} +0 -0
  42. package/dist/types/components.d.ts +4 -4
  43. package/package.json +2 -16
  44. package/dist/collection/components/anchor/anchor.template.js +0 -17
  45. package/dist/collection/components/button/button.template.js +0 -48
  46. package/dist/collection/components/context/context.template.js +0 -42
  47. package/dist/collection/components/definition-list/definition-list.template.js +0 -36
  48. package/dist/collection/components/label/label.decorator.js +0 -6
  49. package/dist/collection/components/label-group/label-group.template.js +0 -7
  50. package/dist/collection/components/list/list.template.js +0 -44
  51. package/dist/collection/components/viewer-grid/example-pages/viewer-grid-document-header.example-template.js +0 -22
  52. package/dist/collection/components/viewer-grid/example-pages/viewer-grid-document-list.example-template.js +0 -12
  53. package/dist/collection/components/viewer-grid/example-pages/viewer-grid-filterblok.example-template.js +0 -60
  54. package/dist/collection/components/viewer-grid/example-pages/viewer-grid-tiles.example-template.js +0 -17
  55. package/dist/dso-toolkit/p-1845b0ce.entry.js +0 -1
  56. package/dist/dso-toolkit/p-237cd551.entry.js +0 -1
  57. package/dist/dso-toolkit/p-93683c65.entry.js +0 -1
  58. package/dist/dso-toolkit/p-acc0620a.entry.js +0 -1
  59. package/dist/types/components/anchor/anchor.template.d.ts +0 -2
  60. package/dist/types/components/button/button.template.d.ts +0 -2
  61. package/dist/types/components/context/context.template.d.ts +0 -3
  62. package/dist/types/components/definition-list/definition-list.template.d.ts +0 -3
  63. package/dist/types/components/label/label.decorator.d.ts +0 -3
  64. package/dist/types/components/label-group/label-group.template.d.ts +0 -2
  65. package/dist/types/components/list/list.template.d.ts +0 -3
  66. package/dist/types/components/viewer-grid/example-pages/viewer-grid-document-header.example-template.d.ts +0 -2
  67. package/dist/types/components/viewer-grid/example-pages/viewer-grid-document-list.example-template.d.ts +0 -2
  68. package/dist/types/components/viewer-grid/example-pages/viewer-grid-filterblok.example-template.d.ts +0 -1
  69. package/dist/types/components/viewer-grid/example-pages/viewer-grid-tiles.example-template.d.ts +0 -2
@@ -1,10 +1,16 @@
1
- import { Component, h, Prop, Event, State, Element, Fragment, Watch } from '@stencil/core';
1
+ import { Component, h, Prop, Event, State, Element, Watch, Host } from '@stencil/core';
2
2
  import clsx from 'clsx';
3
3
  function hasEllipses(el) {
4
4
  return el.scrollWidth > el.clientWidth;
5
5
  }
6
6
  export class Label {
7
7
  constructor() {
8
+ this.mutationObserver = new MutationObserver(() => {
9
+ this.labelText = this.host.innerText;
10
+ if (this.truncate) {
11
+ this.truncateLabel();
12
+ }
13
+ });
8
14
  this.resizeObserver = new ResizeObserver(() => this.truncateLabel());
9
15
  this.keydownListenerActive = false;
10
16
  this.keyDownListener = (event) => {
@@ -40,35 +46,33 @@ export class Label {
40
46
  });
41
47
  }
42
48
  componentDidLoad() {
49
+ this.labelText = this.host.innerText;
50
+ this.mutationObserver.observe(this.host, {
51
+ attributes: true,
52
+ subtree: true
53
+ });
43
54
  if (this.truncate) {
44
55
  this.startTruncate();
45
56
  }
46
57
  }
47
58
  disconnectedCallback() {
59
+ var _a;
60
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
48
61
  this.stopTruncate();
49
62
  }
50
63
  startTruncate() {
51
- this.mutationObserver = new MutationObserver(() => {
52
- this.truncateLabel();
53
- });
54
- this.mutationObserver.observe(this.host, {
55
- attributes: true,
56
- subtree: true
57
- });
58
64
  this.resizeObserver.observe(this.host);
59
65
  this.truncateLabel();
60
66
  }
61
67
  stopTruncate() {
62
- var _a;
63
68
  document.removeEventListener('keydown', this.keyDownListener);
64
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
65
69
  this.resizeObserver.unobserve(this.host);
66
70
  this.truncatedContent = undefined;
67
71
  this.keydownListenerActive = false;
68
72
  }
69
73
  render() {
70
74
  const status = this.status && Label.statusMap.get(this.status);
71
- return (h(Fragment, null,
75
+ return (h(Host, { "aria-roledescription": (this.truncate && this.truncatedContent) ? 'Deze tekst is visueel afgekapt en wordt volledig zichtbaar bij focus.' : undefined },
72
76
  h("span", { id: "toggle-anchor", class: clsx('dso-label', {
73
77
  [`dso-label-${this.status}`]: this.status,
74
78
  'dso-compact': this.compact && !this.removable,
@@ -83,9 +87,11 @@ export class Label {
83
87
  }), ref: element => this.labelContent = element, tabindex: (this.truncate && this.truncatedContent) ? 0 : -1, onMouseEnter: () => this.textHover = true, onMouseLeave: () => this.textHover = false, onFocus: () => this.textFocus = true, onBlur: () => this.textFocus = false },
84
88
  h("slot", null)),
85
89
  this.removable && (h("button", { type: "button", onClick: e => this.removeClick.emit(e), onMouseEnter: () => this.removeHover = true, onMouseLeave: () => this.removeHover = false, onFocus: () => this.removeFocus = true, onBlur: () => this.removeFocus = false },
86
- h("span", { class: "sr-only" }, "Verwijder"),
90
+ h("span", { class: "sr-only" },
91
+ "Verwijder: ",
92
+ this.labelText),
87
93
  h("dso-icon", { icon: "times" })))),
88
- h("dso-tooltip", { stateless: true, for: "toggle-anchor", active: !!this.truncatedContent && (this.textHover || this.textFocus), position: "top" }, this.truncatedContent)));
94
+ h("dso-tooltip", { stateless: true, for: "toggle-anchor", active: !!this.truncatedContent && (this.textHover || this.textFocus), position: "top", strategy: "absolute" }, this.truncatedContent)));
89
95
  }
90
96
  static get is() { return "dso-label"; }
91
97
  static get encapsulation() { return "shadow"; }
@@ -170,7 +176,8 @@ export class Label {
170
176
  "removeFocus": {},
171
177
  "textHover": {},
172
178
  "textFocus": {},
173
- "truncatedContent": {}
179
+ "truncatedContent": {},
180
+ "labelText": {}
174
181
  }; }
175
182
  static get events() { return [{
176
183
  "method": "removeClick",
@@ -1,14 +1,14 @@
1
1
  import { html, nothing } from 'lit-html';
2
2
  import { ifDefined } from 'lit-html/directives/if-defined.js';
3
3
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
4
- export function labelTemplate({ status, label, button, compact, truncate, symbol }) {
4
+ export function labelTemplate({ status, label, removable, onRemoveClick, compact, truncate, symbol }) {
5
5
  return html `
6
6
  <dso-label
7
7
  status=${ifDefined(status)}
8
- @removeClick=${ifDefined(button === null || button === void 0 ? void 0 : button.onClick)}
8
+ @removeClick=${ifDefined(onRemoveClick)}
9
9
  ?truncate=${truncate}
10
10
  ?compact=${compact}
11
- ?removable=${button}
11
+ ?removable=${removable}
12
12
  >
13
13
  ${symbol
14
14
  ? html `
@@ -7,8 +7,8 @@ export class OzonContentExtRefNode {
7
7
  ];
8
8
  }
9
9
  render(node, { mapNodeToJsx }) {
10
- var _a;
11
- return (h("a", { target: "_blank", rel: "noopener noreferrer", href: (_a = node.getAttribute('ref')) !== null && _a !== void 0 ? _a : undefined },
10
+ const href = node.tagName === 'ExtIoRef' ? node.getAttribute('href') : node.getAttribute('ref');
11
+ return (h("a", { target: "_blank", rel: "noopener noreferrer", href: href !== null && href !== void 0 ? href : undefined },
12
12
  h("span", { class: "sr-only" }, "opent in nieuw venster"),
13
13
  mapNodeToJsx(node.childNodes)));
14
14
  }
@@ -15,6 +15,9 @@
15
15
  color: #39870c;
16
16
  text-decoration: underline;
17
17
  cursor: pointer;
18
+ color: #275937;
19
+ font-weight: 600;
20
+ text-decoration: none;
18
21
  }
19
22
  :host([interactive]):hover, :host([interactive]):focus {
20
23
  color: #676cb0;
@@ -24,6 +27,10 @@
24
27
  text-decoration: none;
25
28
  }
26
29
 
30
+ :host([interactive=sub]) {
31
+ color: #191919;
32
+ }
33
+
27
34
  .deleted-start,
28
35
  .deleted-end {
29
36
  position: absolute;
@@ -16,13 +16,18 @@ export class OzonContent {
16
16
  *
17
17
  * **Do not** use this without an accessible companion element! `interactive` is only
18
18
  * meant to ease the use of the companion element for mouse/touch users.
19
+ *
20
+ * * `true`: Interactive anchor-look-alike
21
+ * * `"sub"`: Interactive anchor-look-alike for sub navigation
22
+ * * `false | undefined`: Disabled
19
23
  */
20
24
  this.interactive = false;
21
25
  this.state = {};
22
26
  this.mapper = new Mapper();
23
27
  }
24
28
  handleHostOnClick(e) {
25
- if (!this.interactive) {
29
+ // '' is `true`: <dso-ozon-content interactive>
30
+ if (this.interactive !== '' && !this.interactive) {
26
31
  return;
27
32
  }
28
33
  const doIt = e.composedPath().find(e => e === this.host || (e instanceof HTMLElement && isTabbable(e))) === this.host;
@@ -114,18 +119,18 @@ export class OzonContent {
114
119
  "defaultValue": "false"
115
120
  },
116
121
  "interactive": {
117
- "type": "boolean",
122
+ "type": "any",
118
123
  "mutable": false,
119
124
  "complexType": {
120
- "original": "boolean",
121
- "resolved": "boolean",
125
+ "original": "'sub' | '' | boolean",
126
+ "resolved": "\"\" | \"sub\" | boolean",
122
127
  "references": {}
123
128
  },
124
129
  "required": false,
125
130
  "optional": false,
126
131
  "docs": {
127
132
  "tags": [],
128
- "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."
133
+ "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.\n\n* `true`: Interactive anchor-look-alike\n* `\"sub\"`: Interactive anchor-look-alike for sub navigation\n* `false | undefined`: Disabled"
129
134
  },
130
135
  "attribute": "interactive",
131
136
  "reflect": true,
@@ -3,9 +3,9 @@ import { ifDefined } from 'lit-html/directives/if-defined.js';
3
3
  export function ozonContentTemplate({ content, inline, interactive, deleted, prefix, suffix, onAnchorClick, onClick }) {
4
4
  return html `
5
5
  <dso-ozon-content
6
+ interactive=${ifDefined(interactive || undefined)}
6
7
  .content=${content}
7
8
  ?inline=${inline}
8
- ?interactive=${interactive}
9
9
  ?deleted=${deleted}
10
10
  @anchorClick=${onAnchorClick}
11
11
  @dsoClick=${ifDefined(interactive ? onClick : undefined)}
@@ -153,6 +153,17 @@ h6,
153
153
  }
154
154
  }
155
155
 
156
+ .sr-only {
157
+ position: absolute;
158
+ width: 1px;
159
+ height: 1px;
160
+ padding: 0;
161
+ margin: -1px;
162
+ overflow: hidden;
163
+ clip: rect(0, 0, 0, 0);
164
+ border: 0;
165
+ }
166
+
156
167
  .shrink,
157
168
  .expand,
158
169
  .overlay-close-button {
@@ -342,16 +353,6 @@ h6,
342
353
  top: 8px;
343
354
  right: 16px;
344
355
  }
345
- .overlay-close-button .sr-only {
346
- position: absolute;
347
- width: 1px;
348
- height: 1px;
349
- padding: 0;
350
- margin: -1px;
351
- overflow: hidden;
352
- clip: rect(0, 0, 0, 0);
353
- border: 0;
354
- }
355
356
 
356
357
  .dso-map-panel {
357
358
  background-color: #fff;
@@ -4,6 +4,11 @@ import { ViewerGridFilterpanelButtons } from './viewer-grid-filterpanel-buttons'
4
4
  const TRANSITION_TIME = 200; // Keep in sync with dso-viewer-grid.variables.scss:$dso-viewer-grid-transition-time;
5
5
  export class ViewerGrid {
6
6
  constructor() {
7
+ this.sizeLabelMap = {
8
+ small: 'smal',
9
+ medium: 'middel',
10
+ large: 'breed',
11
+ };
7
12
  this.filterpanelOpen = false;
8
13
  this.overlayOpen = false;
9
14
  /**
@@ -14,10 +19,10 @@ export class ViewerGrid {
14
19
  this.filterpanelSlot = null;
15
20
  this.overlaySlot = null;
16
21
  this.shrinkMain = () => {
17
- this.mainSize = this.mainSize == "large" ? "medium" : "small";
22
+ this.mainSize = this.mainSize === 'large' ? 'medium' : 'small';
18
23
  };
19
24
  this.expandMain = () => {
20
- this.mainSize = this.mainSize == "small" ? "medium" : "large";
25
+ this.mainSize = this.mainSize === 'small' ? 'medium' : 'large';
21
26
  };
22
27
  this.keyDownListener = (event) => {
23
28
  if (event.key != "Escape") {
@@ -104,6 +109,9 @@ export class ViewerGrid {
104
109
  return (h(Host, Object.assign({}, { [this.mainSize]: true }),
105
110
  h("div", { class: "dso-map-panel" },
106
111
  h("div", { class: "sizing-buttons" },
112
+ h("span", { class: "sr-only", "aria-live": "polite", "aria-atomic": "true" },
113
+ "breedte tekstpaneel: ",
114
+ this.sizeLabelMap[this.mainSize]),
107
115
  h("button", { type: "button", class: "shrink", disabled: this.mainSize == "small", onClick: this.shrinkMain },
108
116
  h("dso-icon", { icon: "chevron-left" })),
109
117
  h("button", { type: "button", class: "expand", disabled: this.mainSize == "large", onClick: this.expandMain },