@dso-toolkit/core 53.0.0 → 54.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 (144) hide show
  1. package/dist/cjs/dso-accordion-section.cjs.entry.js +39 -1404
  2. package/dist/cjs/dso-action-list-item.cjs.entry.js +27 -0
  3. package/dist/cjs/dso-action-list.cjs.entry.js +20 -0
  4. package/dist/cjs/dso-annotation-output.cjs.entry.js +1 -1
  5. package/dist/cjs/dso-date-picker.cjs.entry.js +1 -1
  6. package/dist/cjs/dso-dropdown-menu.cjs.entry.js +18 -3
  7. package/dist/cjs/dso-expandable-heading.cjs.entry.js +1 -1
  8. package/dist/cjs/dso-expandable.cjs.entry.js +1433 -2
  9. package/dist/cjs/dso-header.cjs.entry.js +16 -1
  10. package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +2 -2
  11. package/dist/cjs/dso-image-overlay.cjs.entry.js +2 -2
  12. package/dist/cjs/dso-info_2.cjs.entry.js +3 -2
  13. package/dist/cjs/dso-list-button.cjs.entry.js +13 -5
  14. package/dist/cjs/dso-modal.cjs.entry.js +4 -2
  15. package/dist/cjs/dso-ozon-content.cjs.entry.js +1 -1
  16. package/dist/cjs/dso-table.cjs.entry.js +2 -2
  17. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  18. package/dist/cjs/dso-tooltip.cjs.entry.js +1 -1
  19. package/dist/cjs/dso-viewer-grid.cjs.entry.js +2 -2
  20. package/dist/cjs/expandable.interfaces-19b608b9.js +7 -0
  21. package/dist/cjs/{focus-trap.esm-c501d382.js → focus-trap.esm-a5b7273f.js} +134 -51
  22. package/dist/cjs/{has-overflow-b1b4f3f3.js → has-overflow-dd552ec8.js} +3 -4
  23. package/dist/cjs/index.cjs.js +6 -1
  24. package/dist/cjs/{index.esm-03a9e0b4.js → index.esm-0e935715.js} +97 -17
  25. package/dist/cjs/loader.cjs.js +1 -1
  26. package/dist/collection/collection-manifest.json +2 -0
  27. package/dist/collection/components/accordion/accordion.js +1 -1
  28. package/dist/collection/components/accordion/components/accordion-section.css +60 -10
  29. package/dist/collection/components/accordion/components/accordion-section.js +41 -100
  30. package/dist/collection/components/action-list/action-list.css +25 -0
  31. package/dist/collection/components/action-list/action-list.js +42 -0
  32. package/dist/collection/components/action-list/components/action-list-item.css +81 -0
  33. package/dist/collection/components/action-list/components/action-list-item.js +120 -0
  34. package/dist/collection/components/annotation-output/annotation-output.js +1 -1
  35. package/dist/collection/components/date-picker/date-picker.css +1 -1
  36. package/dist/collection/components/date-picker/date-picker.js +1 -1
  37. package/dist/collection/components/dropdown-menu/dropdown-menu.js +36 -1
  38. package/dist/collection/components/expandable/expandable.css +12 -1
  39. package/dist/collection/components/expandable/expandable.interfaces.js +3 -0
  40. package/dist/collection/components/expandable/expandable.js +246 -2
  41. package/dist/collection/components/expandable-heading/expandable-heading.js +1 -1
  42. package/dist/collection/components/header/header.js +18 -2
  43. package/dist/collection/components/list-button/list-button.css +2 -17
  44. package/dist/collection/components/list-button/list-button.js +31 -19
  45. package/dist/collection/components/modal/modal.controller.js +4 -1
  46. package/dist/collection/components/modal/modal.js +36 -3
  47. package/dist/collection/components/selectable/selectable.css +22 -9
  48. package/dist/collection/components/selectable/selectable.js +2 -1
  49. package/dist/collection/index.js +1 -0
  50. package/dist/components/dropdown-menu.js +17 -1
  51. package/dist/components/dso-accordion-section.js +52 -1407
  52. package/dist/components/dso-action-list-item.d.ts +11 -0
  53. package/dist/components/dso-action-list-item.js +53 -0
  54. package/dist/components/dso-action-list.d.ts +11 -0
  55. package/dist/components/dso-action-list.js +36 -0
  56. package/dist/components/dso-annotation-output.js +1 -1
  57. package/dist/components/dso-date-picker.js +2 -2
  58. package/dist/components/dso-expandable-heading.js +1 -1
  59. package/dist/components/dso-header.js +18 -2
  60. package/dist/components/dso-list-button.js +12 -4
  61. package/dist/components/dso-modal.js +3 -0
  62. package/dist/components/expandable.js +1440 -4
  63. package/dist/components/focus-trap.esm.js +133 -50
  64. package/dist/components/has-overflow.js +3 -4
  65. package/dist/components/index.d.ts +2 -0
  66. package/dist/components/index.esm.js +97 -17
  67. package/dist/components/index.js +7 -2
  68. package/dist/components/selectable.js +3 -2
  69. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  70. package/dist/dso-toolkit/index.esm.js +1 -1
  71. package/dist/dso-toolkit/p-3238f7ee.entry.js +1 -0
  72. package/dist/dso-toolkit/p-36224d6f.entry.js +1 -0
  73. package/dist/dso-toolkit/{p-9b07b034.entry.js → p-398a8e0b.entry.js} +1 -1
  74. package/dist/dso-toolkit/{p-d2805c02.entry.js → p-3b91c3e9.entry.js} +1 -1
  75. package/dist/dso-toolkit/p-452b1234.js +1 -0
  76. package/dist/dso-toolkit/p-5950644a.js +5 -0
  77. package/dist/dso-toolkit/{p-b3f4645f.entry.js → p-5de8b79a.entry.js} +1 -1
  78. package/dist/dso-toolkit/p-5e50b616.entry.js +1 -0
  79. package/dist/dso-toolkit/p-6a99d7f8.entry.js +1 -0
  80. package/dist/dso-toolkit/p-91963e3d.js +5 -0
  81. package/dist/dso-toolkit/p-96f44d35.entry.js +1 -0
  82. package/dist/dso-toolkit/p-975c172a.entry.js +1 -0
  83. package/dist/dso-toolkit/{p-092dde2f.entry.js → p-a1616935.entry.js} +1 -1
  84. package/dist/dso-toolkit/{p-ba330644.entry.js → p-bb90ea4c.entry.js} +1 -1
  85. package/dist/dso-toolkit/p-bf750b97.js +1 -0
  86. package/dist/dso-toolkit/{p-f2b76233.entry.js → p-cf9b79df.entry.js} +1 -1
  87. package/dist/dso-toolkit/{p-43f3d736.entry.js → p-d10ec2b3.entry.js} +1 -1
  88. package/dist/dso-toolkit/p-e04d87e0.entry.js +1 -0
  89. package/dist/dso-toolkit/p-e8a6ccf5.entry.js +1 -0
  90. package/dist/dso-toolkit/p-eaae698e.entry.js +1 -0
  91. package/dist/dso-toolkit/p-fa2f1a1c.entry.js +1 -0
  92. package/dist/dso-toolkit/p-fe7ca25f.entry.js +1 -0
  93. package/dist/esm/dso-accordion-section.entry.js +39 -1404
  94. package/dist/esm/dso-action-list-item.entry.js +23 -0
  95. package/dist/esm/dso-action-list.entry.js +16 -0
  96. package/dist/esm/dso-annotation-output.entry.js +1 -1
  97. package/dist/esm/dso-date-picker.entry.js +1 -1
  98. package/dist/esm/dso-dropdown-menu.entry.js +18 -3
  99. package/dist/esm/dso-expandable-heading.entry.js +1 -1
  100. package/dist/esm/dso-expandable.entry.js +1434 -3
  101. package/dist/esm/dso-header.entry.js +16 -1
  102. package/dist/esm/dso-helpcenter-panel.entry.js +2 -2
  103. package/dist/esm/dso-image-overlay.entry.js +2 -2
  104. package/dist/esm/dso-info_2.entry.js +3 -2
  105. package/dist/esm/dso-list-button.entry.js +13 -5
  106. package/dist/esm/dso-modal.entry.js +4 -2
  107. package/dist/esm/dso-ozon-content.entry.js +1 -1
  108. package/dist/esm/dso-table.entry.js +2 -2
  109. package/dist/esm/dso-toolkit.js +1 -1
  110. package/dist/esm/dso-tooltip.entry.js +1 -1
  111. package/dist/esm/dso-viewer-grid.entry.js +2 -2
  112. package/dist/esm/expandable.interfaces-9b1afbe8.js +5 -0
  113. package/dist/esm/{focus-trap.esm-94794d92.js → focus-trap.esm-2a49a38f.js} +134 -51
  114. package/dist/esm/{has-overflow-c44a8a0a.js → has-overflow-fdc85d8f.js} +3 -4
  115. package/dist/esm/{index.esm-8fc07ad8.js → index.esm-3d6c8190.js} +97 -17
  116. package/dist/esm/index.js +5 -1
  117. package/dist/esm/loader.js +1 -1
  118. package/dist/types/components/accordion/accordion.interfaces.d.ts +1 -1
  119. package/dist/types/components/accordion/components/accordion-section.d.ts +4 -8
  120. package/dist/types/components/action-list/action-list.d.ts +5 -0
  121. package/dist/types/components/action-list/components/action-list-item.d.ts +15 -0
  122. package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +5 -0
  123. package/dist/types/components/expandable/expandable.d.ts +25 -1
  124. package/dist/types/components/expandable/expandable.interfaces.d.ts +10 -0
  125. package/dist/types/components/header/header.d.ts +3 -0
  126. package/dist/types/components/list-button/list-button.d.ts +7 -1
  127. package/dist/types/components/modal/modal.controller.d.ts +2 -3
  128. package/dist/types/components/modal/modal.d.ts +7 -2
  129. package/dist/types/components/modal/modal.interfaces.d.ts +13 -1
  130. package/dist/types/components.d.ts +97 -5
  131. package/dist/types/index.d.ts +1 -0
  132. package/package.json +11 -11
  133. package/dist/dso-toolkit/p-147ec7bd.entry.js +0 -1
  134. package/dist/dso-toolkit/p-3635427a.js +0 -5
  135. package/dist/dso-toolkit/p-452c7fbb.entry.js +0 -1
  136. package/dist/dso-toolkit/p-460e6134.entry.js +0 -1
  137. package/dist/dso-toolkit/p-4ae40ddc.entry.js +0 -1
  138. package/dist/dso-toolkit/p-4c8426b7.entry.js +0 -1
  139. package/dist/dso-toolkit/p-57ceabab.js +0 -5
  140. package/dist/dso-toolkit/p-aab458c4.entry.js +0 -1
  141. package/dist/dso-toolkit/p-d3ed00f6.js +0 -1
  142. package/dist/dso-toolkit/p-e3bd7689.entry.js +0 -1
  143. package/dist/dso-toolkit/p-e4f667b3.entry.js +0 -1
  144. package/dist/dso-toolkit/p-f3f0d6c9.entry.js +0 -1
@@ -40,6 +40,7 @@ export class DropdownMenu {
40
40
  };
41
41
  this.open = false;
42
42
  this.dropdownAlign = "left";
43
+ this.dropdownOptionsOffset = 2;
43
44
  this.checkable = false;
44
45
  this.boundary = undefined;
45
46
  this.strategy = "auto";
@@ -52,6 +53,19 @@ export class DropdownMenu {
52
53
  placement: this.dropdownAlign === "right" ? "bottom-end" : "bottom-start",
53
54
  });
54
55
  }
56
+ watchOptionsOffset() {
57
+ var _a;
58
+ (_a = this.popper) === null || _a === void 0 ? void 0 : _a.setOptions({
59
+ modifiers: [
60
+ {
61
+ name: "offset",
62
+ options: {
63
+ offset: [0, this.dropdownOptionsOffset],
64
+ },
65
+ },
66
+ ],
67
+ });
68
+ }
55
69
  watchStrategy() {
56
70
  this.setStrategy();
57
71
  }
@@ -124,7 +138,7 @@ export class DropdownMenu {
124
138
  {
125
139
  name: "offset",
126
140
  options: {
127
- offset: [0, 2], // 2px margin between button and options
141
+ offset: [0, this.dropdownOptionsOffset],
128
142
  },
129
143
  },
130
144
  {
@@ -242,6 +256,24 @@ export class DropdownMenu {
242
256
  "reflect": false,
243
257
  "defaultValue": "\"left\""
244
258
  },
259
+ "dropdownOptionsOffset": {
260
+ "type": "number",
261
+ "mutable": false,
262
+ "complexType": {
263
+ "original": "number",
264
+ "resolved": "number",
265
+ "references": {}
266
+ },
267
+ "required": false,
268
+ "optional": false,
269
+ "docs": {
270
+ "tags": [],
271
+ "text": "Space between button and dropdown options"
272
+ },
273
+ "attribute": "dropdown-options-offset",
274
+ "reflect": false,
275
+ "defaultValue": "2"
276
+ },
245
277
  "checkable": {
246
278
  "type": "boolean",
247
279
  "mutable": false,
@@ -302,6 +334,9 @@ export class DropdownMenu {
302
334
  return [{
303
335
  "propName": "dropdownAlign",
304
336
  "methodName": "watchPosition"
337
+ }, {
338
+ "propName": "dropdownOptionsOffset",
339
+ "methodName": "watchOptionsOffset"
305
340
  }, {
306
341
  "propName": "strategy",
307
342
  "methodName": "watchStrategy"
@@ -1,9 +1,20 @@
1
1
  :host {
2
+ display: block;
3
+ overflow-y: hidden;
4
+ }
5
+
6
+ :host(.dso-hide) {
2
7
  display: none;
3
8
  }
4
9
 
10
+ :host(:not(.dso-animate-ready)) {
11
+ position: absolute;
12
+ visibility: hidden;
13
+ }
14
+
5
15
  :host([open]) {
6
- display: block;
16
+ position: inherit;
17
+ visibility: inherit;
7
18
  }
8
19
 
9
20
  *,
@@ -0,0 +1,3 @@
1
+ export function isExpandable(element) {
2
+ return element instanceof HTMLElement && "getAnimeInstance" in element;
3
+ }
@@ -1,10 +1,127 @@
1
- import { h, Host } from "@stencil/core";
1
+ import { h, Host, } from "@stencil/core";
2
+ import anime from "animejs";
3
+ import clsx from "clsx";
4
+ import debounce from "debounce";
2
5
  export class Expandable {
3
6
  constructor() {
4
7
  this.open = undefined;
8
+ this.enableAnimation = false;
9
+ this.minimumHeight = undefined;
10
+ this.animationReady = false;
11
+ }
12
+ toggleOpen() {
13
+ if (this.enableAnimation) {
14
+ this.activateAnimation();
15
+ }
16
+ }
17
+ toggleEnableAnimation(enableAnimation) {
18
+ var _a;
19
+ if (enableAnimation) {
20
+ this.prepareAnimationResizeObserver();
21
+ this.activateObserver();
22
+ }
23
+ else {
24
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
25
+ delete this.animeInstance;
26
+ this.host.removeAttribute("style");
27
+ }
28
+ }
29
+ async getAnimeInstance() {
30
+ return this.animeInstance;
31
+ }
32
+ async getBodyHeight() {
33
+ return this.bodyHeight;
34
+ }
35
+ componentWillLoad() {
36
+ if (this.enableAnimation) {
37
+ this.prepareAnimationResizeObserver();
38
+ }
39
+ }
40
+ componentDidLoad() {
41
+ this.activateObserver();
42
+ }
43
+ activateObserver() {
44
+ var _a;
45
+ const bodyContentElement = this.host.querySelector(`[slot="expandable-content"]`);
46
+ if (bodyContentElement) {
47
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(bodyContentElement);
48
+ }
49
+ }
50
+ disconnectedCallback() {
51
+ var _a;
52
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
5
53
  }
6
54
  render() {
7
- return (h(Host, { "aria-hidden": this.open ? "false" : "true" }, h("slot", null)));
55
+ return (h(Host, { "aria-hidden": this.open ? "false" : "true", class: clsx({
56
+ "dso-animate-ready": this.enableAnimation && this.animationReady,
57
+ "dso-hide": !this.enableAnimation && !this.open,
58
+ }) }, h("slot", { name: "expandable-content" })));
59
+ }
60
+ prepareAnimationResizeObserver() {
61
+ this.resizeObserver = new ResizeObserver(debounce(([entry]) => {
62
+ // entry.contentRect does not include padding, so we use getBoundingClientRect.
63
+ const height = entry.target.getBoundingClientRect().height;
64
+ if (this.bodyHeight !== height) {
65
+ this.bodyHeight = height;
66
+ }
67
+ this.instantiateAnimation();
68
+ }, 150));
69
+ }
70
+ instantiateAnimation() {
71
+ var _a;
72
+ this.animeInstance = anime({
73
+ targets: this.host,
74
+ height: (_a = this.minimumHeight) !== null && _a !== void 0 ? _a : 0,
75
+ easing: "cubicBezier(0.4, 0, 0.2, 1)",
76
+ duration: 260,
77
+ autoplay: false,
78
+ direction: "normal",
79
+ begin: () => {
80
+ if (this.host) {
81
+ if (this.open) {
82
+ this.host.style.visibility = "";
83
+ this.host.style.position = "";
84
+ this.host.style.bottom = "";
85
+ }
86
+ }
87
+ },
88
+ complete: () => {
89
+ if (this.host) {
90
+ this.host.style.height = "";
91
+ if (!this.open) {
92
+ this.host.style.visibility = "hidden";
93
+ this.host.style.position = "absolute";
94
+ this.host.style.bottom = "100%";
95
+ }
96
+ }
97
+ },
98
+ });
99
+ if (!this.open) {
100
+ this.animeInstance.reverse();
101
+ this.animeInstance.play();
102
+ }
103
+ if (this.host) {
104
+ this.host.style.height = "";
105
+ }
106
+ this.animationReady = !!this.animeInstance;
107
+ this.animationInstantiated.emit();
108
+ }
109
+ activateAnimation() {
110
+ if (this.animeInstance) {
111
+ if (this.animeInstance.progress > 0 && this.animeInstance.progress < 100) {
112
+ this.animeInstance.reverse();
113
+ }
114
+ else {
115
+ if (this.open) {
116
+ this.animeInstance.direction = "reverse";
117
+ this.animeInstance.play();
118
+ }
119
+ else {
120
+ this.animeInstance.direction = "normal";
121
+ this.animeInstance.play();
122
+ }
123
+ }
124
+ }
8
125
  }
9
126
  static get is() { return "dso-expandable"; }
10
127
  static get encapsulation() { return "shadow"; }
@@ -36,7 +153,134 @@ export class Expandable {
36
153
  },
37
154
  "attribute": "open",
38
155
  "reflect": true
156
+ },
157
+ "enableAnimation": {
158
+ "type": "boolean",
159
+ "mutable": false,
160
+ "complexType": {
161
+ "original": "boolean",
162
+ "resolved": "boolean",
163
+ "references": {}
164
+ },
165
+ "required": false,
166
+ "optional": false,
167
+ "docs": {
168
+ "tags": [],
169
+ "text": ""
170
+ },
171
+ "attribute": "enable-animation",
172
+ "reflect": false,
173
+ "defaultValue": "false"
174
+ },
175
+ "minimumHeight": {
176
+ "type": "number",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "number",
180
+ "resolved": "number | undefined",
181
+ "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": true,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "When enableAnimation is set to `true`, this property specifies the height of this element at which the animation will expand from / collapse to"
188
+ },
189
+ "attribute": "minimum-height",
190
+ "reflect": false
191
+ }
192
+ };
193
+ }
194
+ static get states() {
195
+ return {
196
+ "animationReady": {}
197
+ };
198
+ }
199
+ static get events() {
200
+ return [{
201
+ "method": "dsoToggle",
202
+ "name": "dsoToggle",
203
+ "bubbles": true,
204
+ "cancelable": true,
205
+ "composed": true,
206
+ "docs": {
207
+ "tags": [],
208
+ "text": ""
209
+ },
210
+ "complexType": {
211
+ "original": "ExpandableToggleEvent",
212
+ "resolved": "ExpandableToggleEvent",
213
+ "references": {
214
+ "ExpandableToggleEvent": {
215
+ "location": "import",
216
+ "path": "./expandable.interfaces"
217
+ }
218
+ }
219
+ }
220
+ }, {
221
+ "method": "animationInstantiated",
222
+ "name": "animationInstantiated",
223
+ "bubbles": true,
224
+ "cancelable": true,
225
+ "composed": true,
226
+ "docs": {
227
+ "tags": [],
228
+ "text": ""
229
+ },
230
+ "complexType": {
231
+ "original": "void",
232
+ "resolved": "void",
233
+ "references": {}
234
+ }
235
+ }];
236
+ }
237
+ static get methods() {
238
+ return {
239
+ "getAnimeInstance": {
240
+ "complexType": {
241
+ "signature": "() => Promise<anime.AnimeInstance | undefined>",
242
+ "parameters": [],
243
+ "references": {
244
+ "Promise": {
245
+ "location": "global"
246
+ },
247
+ "anime": {
248
+ "location": "global"
249
+ }
250
+ },
251
+ "return": "Promise<AnimeInstance | undefined>"
252
+ },
253
+ "docs": {
254
+ "text": "",
255
+ "tags": []
256
+ }
257
+ },
258
+ "getBodyHeight": {
259
+ "complexType": {
260
+ "signature": "() => Promise<number | undefined>",
261
+ "parameters": [],
262
+ "references": {
263
+ "Promise": {
264
+ "location": "global"
265
+ }
266
+ },
267
+ "return": "Promise<number | undefined>"
268
+ },
269
+ "docs": {
270
+ "text": "",
271
+ "tags": []
272
+ }
39
273
  }
40
274
  };
41
275
  }
276
+ static get elementRef() { return "host"; }
277
+ static get watchers() {
278
+ return [{
279
+ "propName": "open",
280
+ "methodName": "toggleOpen"
281
+ }, {
282
+ "propName": "enableAnimation",
283
+ "methodName": "toggleEnableAnimation"
284
+ }];
285
+ }
42
286
  }
@@ -19,7 +19,7 @@ export class ExpandableHeading {
19
19
  return (h(Host, { class: clsx({
20
20
  "dso-del": this.editAction === "delete",
21
21
  "dso-ins": this.editAction === "insert",
22
- }) }, this.editAction === "delete" && (h("p", { class: "dso-edit-action-text" }, h("span", null, "verwijderd:"))), this.editAction === "insert" && (h("p", { class: "dso-edit-action-text" }, h("span", null, "toegevoegd:"))), h("div", { class: clsx("expandable-heading", this.color === "black" ? "dso-expandable-heading-black" : "") }, h(Heading, { heading: this.heading }, h("button", { type: "button", "aria-expanded": this.open ? "true" : "false", "aria-controls": this.identifier, onClick: (e) => this.toggle(e) }, h("dso-icon", { icon: this.open ? "chevron-down" : "chevron-right" }), h("slot", { name: "title" }))), h("slot", { name: "addons-start" }), h("div", { class: "addons-end" }, h("slot", { name: "addons-end" }))), h("dso-expandable", Object.assign({ id: this.identifier }, expandableProperties), h("slot", null))));
22
+ }) }, this.editAction === "delete" && (h("p", { class: "dso-edit-action-text" }, h("span", null, "verwijderd:"))), this.editAction === "insert" && (h("p", { class: "dso-edit-action-text" }, h("span", null, "toegevoegd:"))), h("div", { class: clsx("expandable-heading", this.color === "black" ? "dso-expandable-heading-black" : "") }, h(Heading, { heading: this.heading }, h("button", { type: "button", "aria-expanded": this.open ? "true" : "false", "aria-controls": this.identifier, onClick: (e) => this.toggle(e) }, h("dso-icon", { icon: this.open ? "chevron-down" : "chevron-right" }), h("slot", { name: "title" }))), h("slot", { name: "addons-start" }), h("div", { class: "addons-end" }, h("slot", { name: "addons-end" }))), h("dso-expandable", Object.assign({ id: this.identifier }, expandableProperties), h("slot", { slot: "expandable-content" }))));
23
23
  }
24
24
  static get is() { return "dso-expandable-heading"; }
25
25
  static get encapsulation() { return "shadow"; }
@@ -23,6 +23,7 @@ export class Header {
23
23
  this.showDropDown = undefined;
24
24
  this.hasSubLogo = false;
25
25
  this.overflowMenuItems = 0;
26
+ this.dropdownOptionsOffset = 0;
26
27
  }
27
28
  clickHandler(e, type, options) {
28
29
  var _a, _b;
@@ -58,12 +59,16 @@ export class Header {
58
59
  }
59
60
  componentDidRender() {
60
61
  if (this.showDropDown) {
62
+ this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();
61
63
  return;
62
64
  }
63
65
  window.setTimeout(() => this.shrinkMenuToFit(), 0);
64
66
  }
65
67
  componentDidLoad() {
66
68
  this.setShowDropDown(this.useDropDownMenu);
69
+ if (this.showDropDown) {
70
+ this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();
71
+ }
67
72
  }
68
73
  setOverflowMenu() {
69
74
  if (this.showDropDown) {
@@ -81,6 +86,14 @@ export class Header {
81
86
  }
82
87
  this.showDropDown = window.innerWidth < minDesktopViewportWidth;
83
88
  }
89
+ calculateDropdownOptionsOffset() {
90
+ var _a;
91
+ if (!this.dropdownElement) {
92
+ return 0;
93
+ }
94
+ return (this.host.clientHeight -
95
+ (((_a = this.dropdownElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().bottom) - this.host.getBoundingClientRect().top));
96
+ }
84
97
  connectedCallback() {
85
98
  window.addEventListener("resize", this.onWindowResize);
86
99
  }
@@ -95,7 +108,9 @@ export class Header {
95
108
  return (h(Fragment, null, h("div", { class: clsx("dso-header", {
96
109
  ["use-drop-down"]: this.showDropDown,
97
110
  ["has-sub-logo"]: this.hasSubLogo,
98
- }), ref: (element) => (this.wrapper = element) }, h("div", { class: "logo-container" }, h("div", { class: "logo" }, h("slot", { name: "logo" })), h("div", { class: "sub-logo" }, h("slot", { name: "sub-logo" }))), this.showDropDown && this.mainMenu && this.mainMenu.length > 0 && (h("div", { class: "dropdown" }, h("dso-dropdown-menu", { "dropdown-align": "right" }, h("button", { type: "button", slot: "toggle" }, h("span", null, "Menu")), h("div", { class: "dso-dropdown-options" }, h("ul", null, this.mainMenu.map(this.MenuItem), this.userHomeUrl && (h("li", null, h("a", { href: this.userHomeUrl, onClick: (e) => this.clickHandler(e, "userHome", { url: this.userHomeUrl }) }, "Mijn Omgevingsloket"))), this.userProfileUrl && this.userProfileName && this.authStatus === "loggedIn" && (h("li", null, h("a", { href: this.userProfileUrl, onClick: (e) => this.clickHandler(e, "profile", { url: this.userProfileUrl }) }, this.userProfileName, h("span", { class: "profile-label" }, " - Mijn profiel")))), this.authStatus === "loggedOut" && (h("li", null, this.loginUrl ? (h("a", { href: this.loginUrl, onClick: (e) => this.clickHandler(e, "login", { url: this.loginUrl }) }, "Inloggen")) : (h("button", { type: "button", onClick: (e) => this.clickHandler(e, "login") }, "Inloggen")))), this.authStatus === "loggedIn" && (h("li", null, this.logoutUrl ? (h("a", { href: this.logoutUrl, onClick: (e) => this.clickHandler(e, "logout", { url: this.logoutUrl }) }, "Uitloggen")) : (h("button", { type: "button", onClick: (e) => this.clickHandler(e, "logout") }, "Uitloggen"))))))))), !this.showDropDown && (h(Fragment, null, h("div", { class: "dso-header-session" }, this.userProfileUrl && this.userProfileName && this.authStatus === "loggedIn" && (h("div", { class: "profile" }, h("span", { class: "profile-label" }, "Welkom:"), h("a", { href: this.userProfileUrl, onClick: (e) => this.clickHandler(e, "profile", { url: this.userProfileUrl }) }, this.userProfileName))), this.authStatus === "loggedOut" && (h("div", { class: "login" }, this.loginUrl ? (h("a", { href: this.loginUrl, onClick: (e) => this.clickHandler(e, "login", { url: this.loginUrl }) }, "Inloggen")) : (h("button", { class: "dso-tertiary", type: "button", onClick: (e) => this.clickHandler(e, "login") }, "Inloggen")))), this.authStatus === "loggedIn" && (h("div", { class: "logout" }, this.logoutUrl ? (h("a", { href: this.logoutUrl, onClick: (e) => this.clickHandler(e, "logout", { url: this.logoutUrl }) }, "Uitloggen")) : (h("button", { class: "dso-tertiary", type: "button", onClick: (e) => this.clickHandler(e, "logout") }, "Uitloggen"))))), ((this.mainMenu && this.mainMenu.length > 0) || this.userHomeUrl) && (h("nav", { class: "dso-navbar" }, h("ul", { class: "dso-nav dso-nav-main", ref: (element) => (this.nav = element) }, this.mainMenu &&
111
+ }), ref: (element) => (this.wrapper = element) }, h("div", { class: "logo-container" }, h("div", { class: "logo" }, h("slot", { name: "logo" })), h("div", { class: "sub-logo" }, h("slot", { name: "sub-logo" }))), this.showDropDown &&
112
+ this.mainMenu &&
113
+ (this.mainMenu.length > 0 || this.userHomeUrl || this.authStatus !== "none") && (h("div", { class: "dropdown" }, h("dso-dropdown-menu", { "dropdown-align": "right", strategy: "absolute", dropdownOptionsOffset: this.dropdownOptionsOffset, ref: (element) => (this.dropdownElement = element) }, h("button", { type: "button", slot: "toggle" }, h("span", null, "Menu")), h("div", { class: "dso-dropdown-options" }, h("ul", null, this.mainMenu.map(this.MenuItem), this.userHomeUrl && (h("li", null, h("a", { href: this.userHomeUrl, onClick: (e) => this.clickHandler(e, "userHome", { url: this.userHomeUrl }) }, "Mijn Omgevingsloket"))), this.userProfileUrl && this.userProfileName && this.authStatus === "loggedIn" && (h("li", null, h("a", { href: this.userProfileUrl, onClick: (e) => this.clickHandler(e, "profile", { url: this.userProfileUrl }) }, this.userProfileName, h("span", { class: "profile-label" }, " - Mijn profiel")))), this.authStatus === "loggedOut" && (h("li", null, this.loginUrl ? (h("a", { href: this.loginUrl, onClick: (e) => this.clickHandler(e, "login", { url: this.loginUrl }) }, "Inloggen")) : (h("button", { type: "button", onClick: (e) => this.clickHandler(e, "login") }, "Inloggen")))), this.authStatus === "loggedIn" && (h("li", null, this.logoutUrl ? (h("a", { href: this.logoutUrl, onClick: (e) => this.clickHandler(e, "logout", { url: this.logoutUrl }) }, "Uitloggen")) : (h("button", { type: "button", onClick: (e) => this.clickHandler(e, "logout") }, "Uitloggen"))))))))), !this.showDropDown && (h(Fragment, null, h("div", { class: "dso-header-session" }, this.userProfileUrl && this.userProfileName && this.authStatus === "loggedIn" && (h("div", { class: "profile" }, h("span", { class: "profile-label" }, "Welkom:"), h("a", { href: this.userProfileUrl, onClick: (e) => this.clickHandler(e, "profile", { url: this.userProfileUrl }) }, this.userProfileName))), this.authStatus === "loggedOut" && (h("div", { class: "login" }, this.loginUrl ? (h("a", { href: this.loginUrl, onClick: (e) => this.clickHandler(e, "login", { url: this.loginUrl }) }, "Inloggen")) : (h("button", { class: "dso-tertiary", type: "button", onClick: (e) => this.clickHandler(e, "login") }, "Inloggen")))), this.authStatus === "loggedIn" && (h("div", { class: "logout" }, this.logoutUrl ? (h("a", { href: this.logoutUrl, onClick: (e) => this.clickHandler(e, "logout", { url: this.logoutUrl }) }, "Uitloggen")) : (h("button", { class: "dso-tertiary", type: "button", onClick: (e) => this.clickHandler(e, "logout") }, "Uitloggen"))))), ((this.mainMenu && this.mainMenu.length > 0) || this.userHomeUrl) && (h("nav", { class: "dso-navbar" }, h("ul", { class: "dso-nav dso-nav-main", ref: (element) => (this.nav = element) }, this.mainMenu &&
99
114
  this.mainMenu
100
115
  .filter((_, index) => this.mainMenu && index < this.mainMenu.length - this.overflowMenuItems)
101
116
  .map(this.MenuItem), this.overflowMenuItems > 0 && (h("li", null, h("dso-dropdown-menu", { "dropdown-align": "left" }, h("button", { type: "button", slot: "toggle" }, h("span", null, "Meer")), h("div", { class: "dso-dropdown-options" }, h("ul", null, this.mainMenu &&
@@ -265,7 +280,8 @@ export class Header {
265
280
  return {
266
281
  "showDropDown": {},
267
282
  "hasSubLogo": {},
268
- "overflowMenuItems": {}
283
+ "overflowMenuItems": {},
284
+ "dropdownOptionsOffset": {}
269
285
  };
270
286
  }
271
287
  static get events() {
@@ -370,8 +370,8 @@
370
370
  }
371
371
  .dso-selectable > dso-info {
372
372
  float: none;
373
- margin: 8px 16px 0 -32px;
374
- width: calc(100% + 32px);
373
+ margin: 8px 16px 0 0;
374
+ width: 100%;
375
375
  }
376
376
  .dso-selectable label {
377
377
  font-weight: 700;
@@ -438,17 +438,6 @@
438
438
  font-weight: 400;
439
439
  width: 100%;
440
440
  }
441
- .dso-list-button .dso-subcontent {
442
- color: #666;
443
- font-weight: 400;
444
- padding: 16px 0 0 16px;
445
- }
446
- .dso-list-button .dso-subcontent mark {
447
- background-color: transparent;
448
- color: #666;
449
- font-weight: 700;
450
- padding: 0;
451
- }
452
441
  .dso-list-button dso-icon,
453
442
  .dso-list-button svg.di,
454
443
  .dso-list-button .dso-count {
@@ -474,10 +463,6 @@
474
463
  .dso-list-button .dso-sublabel {
475
464
  padding-left: 32px;
476
465
  }
477
- .dso-list-button .dso-subcontent {
478
- padding-left: 48px;
479
- padding-top: 8px;
480
- }
481
466
 
482
467
  .dso-list-button + .dso-list-button,
483
468
  .dso-list-button + .dso-btn-group,
@@ -7,12 +7,17 @@ export class ListButton {
7
7
  this.manualCount = undefined;
8
8
  this.label = undefined;
9
9
  this.sublabel = undefined;
10
- this.subcontent = undefined;
11
10
  this.count = undefined;
12
11
  this.min = undefined;
13
12
  this.max = undefined;
14
13
  this.checked = false;
15
14
  this.disabled = false;
15
+ this.manual = true;
16
+ }
17
+ watchManualCallback() {
18
+ if (!this.manual && this.manualCount) {
19
+ this.stopManualCountInput();
20
+ }
16
21
  }
17
22
  componentDidRender() {
18
23
  var _a;
@@ -95,7 +100,7 @@ export class ListButton {
95
100
  render() {
96
101
  const showButtonInputs = this.manualCount === undefined;
97
102
  const selected = this.checked || (this.count !== undefined && this.count > 0);
98
- return (h("div", { class: clsx(["dso-btn-group", { "dso-disabled": this.disabled }]) }, h("div", { class: clsx(["dso-list-button", { "dso-selected": selected, "dso-single-count": this.count === 1 }]), onClick: (e) => this.handleSelectClick(e) }, h("div", { class: "dso-selectable" }, h("input", { id: "dso-list-button-checkbox", type: "checkbox", value: "list-button", name: "naam", checked: selected, disabled: this.disabled, "aria-label": this.label }), h("label", { htmlFor: "dso-list-button-checkbox" }, this.label)), this.sublabel && h("span", { class: "dso-sublabel" }, this.sublabel), this.subcontent && h("span", { class: "dso-subcontent" }, this.subcontent)), this.count !== undefined && this.count > 0 && (h("div", { class: "dso-input-number" }, this.manualCount === undefined && this.count > 1 && (h("button", { type: "button", class: "dso-tertiary", disabled: this.count === Number(this.min) || this.disabled, onClick: (e) => this.stepValue(e, "decrement") }, h("dso-icon", { icon: "minus-circle" }), h("span", { class: "sr-only" }, "Aantal verlagen"))), h("div", { class: "dso-input-wrapper" }, this.manualCount === undefined && this.count > 1 && (h("input", { class: "dso-input-step-counter", type: "number", tabIndex: -1, "aria-label": "Aantal", value: this.count, readOnly: true })), h("form", { onSubmit: (e) => this.setCount(e) }, h("div", { ref: (element) => (this.manualInputWrapperElement = element) }, h("input", { class: clsx("form-control", { hidden: showButtonInputs }), type: "number", "aria-label": "Aantal", value: this.manualCount, min: this.min, max: this.max, onInput: (e) => this.handleOnChange(e) })), h("button", { class: clsx("dso-manual-input-button", { "sr-only": !showButtonInputs }), type: !showButtonInputs ? "submit" : "button", disabled: this.disabled, onClick: () => showButtonInputs && this.startManualCountInput() }, showButtonInputs ? (h("span", { class: "sr-only" }, "Handmatig aantal invullen")) : (h("span", { class: "sr-only" }, "Zet waarde"))))), showButtonInputs && (h("button", { type: "button", class: "dso-tertiary", disabled: this.count === Number(this.max) || this.disabled, onClick: (e) => this.stepValue(e, "increment") }, h("dso-icon", { icon: "plus-circle" }), h("span", { class: "sr-only" }, "Aantal verhogen")))))));
103
+ return (h("div", { class: clsx(["dso-btn-group", { "dso-disabled": this.disabled }]) }, h("div", { class: clsx(["dso-list-button", { "dso-selected": selected, "dso-single-count": this.count === 1 }]), onClick: (e) => this.handleSelectClick(e) }, h("div", { class: "dso-selectable" }, h("input", { id: "dso-list-button-checkbox", type: "checkbox", value: "list-button", name: "naam", checked: selected, disabled: this.disabled, "aria-label": this.label }), h("label", { htmlFor: "dso-list-button-checkbox" }, this.label)), this.sublabel && h("span", { class: "dso-sublabel" }, this.sublabel), h("slot", { name: "subcontent" })), this.count !== undefined && this.count > 0 && (h("div", { class: "dso-input-number" }, this.manualCount === undefined && this.count > 1 && (h("button", { type: "button", class: "dso-tertiary", disabled: this.count === Number(this.min) || this.disabled, onClick: (e) => this.stepValue(e, "decrement") }, h("dso-icon", { icon: "minus-circle" }), h("span", { class: "sr-only" }, "Aantal verlagen"))), h("div", { class: "dso-input-wrapper" }, this.manualCount === undefined && this.count > 1 && (h("input", { class: "dso-input-step-counter", type: "number", tabIndex: -1, "aria-label": "Aantal", value: this.count, readOnly: true })), h("form", { onSubmit: (e) => this.setCount(e) }, h("div", { ref: (element) => (this.manualInputWrapperElement = element) }, h("input", { class: clsx("form-control", { hidden: showButtonInputs }), type: "number", "aria-label": "Aantal", value: this.manualCount, min: this.min, max: this.max, onInput: (e) => this.handleOnChange(e) })), this.manual === true && (h("button", { class: clsx("dso-manual-input-button", { "sr-only": !showButtonInputs }), type: !showButtonInputs ? "submit" : "button", disabled: this.disabled, onClick: () => showButtonInputs && this.startManualCountInput() }, showButtonInputs ? (h("span", { class: "sr-only" }, "Handmatig aantal invullen")) : (h("span", { class: "sr-only" }, "Zet waarde")))))), showButtonInputs && (h("button", { type: "button", class: "dso-tertiary", disabled: this.count === Number(this.max) || this.disabled, onClick: (e) => this.stepValue(e, "increment") }, h("dso-icon", { icon: "plus-circle" }), h("span", { class: "sr-only" }, "Aantal verhogen")))))));
99
104
  }
100
105
  static get is() { return "dso-list-button"; }
101
106
  static get encapsulation() { return "shadow"; }
@@ -145,23 +150,6 @@ export class ListButton {
145
150
  "attribute": "sublabel",
146
151
  "reflect": false
147
152
  },
148
- "subcontent": {
149
- "type": "string",
150
- "mutable": false,
151
- "complexType": {
152
- "original": "string",
153
- "resolved": "string | undefined",
154
- "references": {}
155
- },
156
- "required": false,
157
- "optional": true,
158
- "docs": {
159
- "tags": [],
160
- "text": ""
161
- },
162
- "attribute": "subcontent",
163
- "reflect": false
164
- },
165
153
  "count": {
166
154
  "type": "number",
167
155
  "mutable": false,
@@ -248,6 +236,24 @@ export class ListButton {
248
236
  "attribute": "disabled",
249
237
  "reflect": true,
250
238
  "defaultValue": "false"
239
+ },
240
+ "manual": {
241
+ "type": "boolean",
242
+ "mutable": false,
243
+ "complexType": {
244
+ "original": "boolean",
245
+ "resolved": "boolean",
246
+ "references": {}
247
+ },
248
+ "required": false,
249
+ "optional": false,
250
+ "docs": {
251
+ "tags": [],
252
+ "text": "Allow user to directly input a value.\r\n\r\nSet to `false` to force users to use plus/minus buttons."
253
+ },
254
+ "attribute": "manual",
255
+ "reflect": false,
256
+ "defaultValue": "true"
251
257
  }
252
258
  };
253
259
  }
@@ -300,4 +306,10 @@ export class ListButton {
300
306
  }
301
307
  }];
302
308
  }
309
+ static get watchers() {
310
+ return [{
311
+ "propName": "manual",
312
+ "methodName": "watchManualCallback"
313
+ }];
314
+ }
303
315
  }
@@ -11,7 +11,7 @@ export class DsoModalController {
11
11
  element.setAttribute("modal-title", title);
12
12
  }
13
13
  if (options) {
14
- const { role, showCloseButton, initialFocus } = options;
14
+ const { role, showCloseButton, initialFocus, returnFocus } = options;
15
15
  if (role) {
16
16
  element.role = role;
17
17
  }
@@ -21,6 +21,9 @@ export class DsoModalController {
21
21
  if (initialFocus) {
22
22
  element.setAttribute("initial-focus", initialFocus);
23
23
  }
24
+ if (returnFocus) {
25
+ element.returnFocus = returnFocus;
26
+ }
24
27
  }
25
28
  const bodyDiv = document.createElement("div");
26
29
  bodyDiv.setAttribute("slot", "body");
@@ -9,6 +9,7 @@ export class Modal {
9
9
  this.role = "dialog";
10
10
  this.showCloseButton = true;
11
11
  this.initialFocus = undefined;
12
+ this.returnFocus = undefined;
12
13
  }
13
14
  componentWillLoad() {
14
15
  this.hasFooter = this.host.querySelector("*[slot = 'footer']") !== null;
@@ -40,6 +41,7 @@ export class Modal {
40
41
  return ((_c = (_a = this.host.querySelector("div[slot='footer'] .dso-primary")) !== null && _a !== void 0 ? _a : (_b = this.modalElement) === null || _b === void 0 ? void 0 : _b.querySelector(".dso-close")) !== null && _c !== void 0 ? _c : false);
41
42
  },
42
43
  allowOutsideClick: true,
44
+ setReturnFocus: (e) => { var _a, _b; return (_b = (_a = this.returnFocus) === null || _a === void 0 ? void 0 : _a.call(this, e)) !== null && _b !== void 0 ? _b : e; },
43
45
  escapeDeactivates: true,
44
46
  tabbableOptions: {
45
47
  getShadowRoot: true,
@@ -92,9 +94,14 @@ export class Modal {
92
94
  "type": "string",
93
95
  "mutable": false,
94
96
  "complexType": {
95
- "original": "string",
96
- "resolved": "string",
97
- "references": {}
97
+ "original": "ModalRole",
98
+ "resolved": "\"alert\" | \"alertdialog\" | \"dialog\"",
99
+ "references": {
100
+ "ModalRole": {
101
+ "location": "import",
102
+ "path": "./modal.interfaces"
103
+ }
104
+ }
98
105
  },
99
106
  "required": false,
100
107
  "optional": false,
@@ -140,6 +147,32 @@ export class Modal {
140
147
  },
141
148
  "attribute": "initial-focus",
142
149
  "reflect": false
150
+ },
151
+ "returnFocus": {
152
+ "type": "unknown",
153
+ "mutable": false,
154
+ "complexType": {
155
+ "original": "(nodeFocusedBeforeActivation: HTMLElement | SVGElement) => FocusTargetValueOrFalse",
156
+ "resolved": "((nodeFocusedBeforeActivation: HTMLElement | SVGElement) => FocusTargetValueOrFalse) | undefined",
157
+ "references": {
158
+ "HTMLElement": {
159
+ "location": "global"
160
+ },
161
+ "SVGElement": {
162
+ "location": "global"
163
+ },
164
+ "FocusTargetValueOrFalse": {
165
+ "location": "import",
166
+ "path": "focus-trap"
167
+ }
168
+ }
169
+ },
170
+ "required": false,
171
+ "optional": true,
172
+ "docs": {
173
+ "tags": [],
174
+ "text": "Function that returns the element to focus on Modal close. Return `false` for no focus restore."
175
+ }
143
176
  }
144
177
  };
145
178
  }