@dso-toolkit/core 31.0.0 → 32.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 (90) hide show
  1. package/dist/cjs/dso-alert.cjs.entry.js +1 -1
  2. package/dist/cjs/dso-banner.cjs.entry.js +1 -1
  3. package/dist/cjs/dso-date-picker.cjs.entry.js +54 -14
  4. package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +44 -0
  5. package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
  6. package/dist/cjs/dso-icon.cjs.entry.js +29 -5
  7. package/dist/cjs/dso-info-button.cjs.entry.js +2 -2
  8. package/dist/cjs/dso-info_2.cjs.entry.js +1 -1
  9. package/dist/cjs/dso-label.cjs.entry.js +1 -1
  10. package/dist/cjs/dso-ozon-content.cjs.entry.js +48 -11
  11. package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
  12. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  13. package/dist/cjs/dso-tree-view.cjs.entry.js +23 -19
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/collection/collection-manifest.json +1 -0
  16. package/dist/collection/components/alert/alert.css +2 -0
  17. package/dist/collection/components/banner/banner.css +2 -0
  18. package/dist/collection/components/date-picker/date-localization.js +1 -1
  19. package/dist/collection/components/date-picker/date-picker.css +0 -3
  20. package/dist/collection/components/date-picker/date-picker.js +108 -14
  21. package/dist/collection/components/date-picker/date-picker.template.js +2 -1
  22. package/dist/collection/components/helpcenter-panel/helpcenter-panel.css +312 -0
  23. package/dist/collection/components/helpcenter-panel/helpcenter-panel.js +92 -0
  24. package/dist/collection/components/helpcenter-panel/helpcenter-panel.template.js +13 -0
  25. package/dist/collection/components/highlight-box/highlight-box.css +1 -1
  26. package/dist/collection/components/icon/icon.js +8 -0
  27. package/dist/collection/components/info/info.css +4 -4
  28. package/dist/collection/components/info-button/info-button.css +8 -0
  29. package/dist/collection/components/info-button/info-button.js +18 -1
  30. package/dist/collection/components/info-button/info-button.template.js +2 -1
  31. package/dist/collection/components/label/label.decorator.js +6 -0
  32. package/dist/collection/components/label/label.js +1 -0
  33. package/dist/collection/components/label/label.template.js +10 -2
  34. package/dist/collection/components/ozon-content/ozon-content.transformer.js +1 -1
  35. package/dist/collection/components/toggletip/toggletip.js +18 -1
  36. package/dist/collection/components/toggletip/toggletip.template.js +2 -1
  37. package/dist/collection/components/tree-view/tree-item.js +10 -11
  38. package/dist/collection/components/tree-view/tree-view.interfaces.js +1 -0
  39. package/dist/collection/components/tree-view/tree-view.js +18 -13
  40. package/dist/custom-elements/index.d.ts +6 -0
  41. package/dist/custom-elements/index.js +207 -61
  42. package/dist/dso-toolkit/dso-toolkit.css +1 -1
  43. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  44. package/dist/dso-toolkit/{p-968d9e1d.entry.js → p-19de4cc7.entry.js} +1 -1
  45. package/dist/dso-toolkit/p-5665f1ee.entry.js +1 -0
  46. package/dist/dso-toolkit/p-75233655.entry.js +1 -0
  47. package/dist/dso-toolkit/{p-d748df48.entry.js → p-83f166b3.entry.js} +1 -1
  48. package/dist/dso-toolkit/p-9e9f8bcf.entry.js +1 -0
  49. package/dist/dso-toolkit/p-a52d3623.entry.js +1 -0
  50. package/dist/dso-toolkit/p-ad8f467f.entry.js +1 -0
  51. package/dist/dso-toolkit/p-affe82e6.entry.js +1 -0
  52. package/dist/dso-toolkit/p-b07991b9.entry.js +1 -0
  53. package/dist/dso-toolkit/{p-ae6209c6.entry.js → p-be5682cc.entry.js} +1 -1
  54. package/dist/dso-toolkit/p-e03d7741.entry.js +1 -0
  55. package/dist/dso-toolkit/{p-69f366a9.entry.js → p-e2dc97c4.entry.js} +1 -1
  56. package/dist/esm/dso-alert.entry.js +1 -1
  57. package/dist/esm/dso-banner.entry.js +1 -1
  58. package/dist/esm/dso-date-picker.entry.js +54 -14
  59. package/dist/esm/dso-helpcenter-panel.entry.js +40 -0
  60. package/dist/esm/dso-highlight-box.entry.js +1 -1
  61. package/dist/esm/dso-icon.entry.js +29 -5
  62. package/dist/esm/dso-info-button.entry.js +2 -2
  63. package/dist/esm/dso-info_2.entry.js +1 -1
  64. package/dist/esm/dso-label.entry.js +1 -1
  65. package/dist/esm/dso-ozon-content.entry.js +48 -11
  66. package/dist/esm/dso-toggletip.entry.js +1 -1
  67. package/dist/esm/dso-toolkit.js +1 -1
  68. package/dist/esm/dso-tree-view.entry.js +24 -20
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/types/components/date-picker/date-picker.d.ts +20 -0
  71. package/dist/types/components/date-picker/date-picker.template.d.ts +1 -1
  72. package/dist/types/components/helpcenter-panel/helpcenter-panel.d.ts +11 -0
  73. package/dist/types/components/helpcenter-panel/helpcenter-panel.template.d.ts +2 -0
  74. package/dist/types/components/info-button/info-button.d.ts +1 -0
  75. package/dist/types/components/info-button/info-button.template.d.ts +1 -1
  76. package/dist/types/components/label/label.decorator.d.ts +3 -0
  77. package/dist/types/components/label/label.template.d.ts +1 -1
  78. package/dist/types/components/toggletip/toggletip.d.ts +1 -0
  79. package/dist/types/components/toggletip/toggletip.template.d.ts +1 -1
  80. package/dist/types/components/tree-view/tree-view.d.ts +1 -1
  81. package/dist/types/components/tree-view/tree-view.interfaces.d.ts +24 -0
  82. package/dist/types/components.d.ts +39 -2
  83. package/package.json +1 -1
  84. package/dist/dso-toolkit/p-187782ee.entry.js +0 -1
  85. package/dist/dso-toolkit/p-2c6e9460.entry.js +0 -1
  86. package/dist/dso-toolkit/p-378fb428.entry.js +0 -1
  87. package/dist/dso-toolkit/p-453e2c6f.entry.js +0 -1
  88. package/dist/dso-toolkit/p-5a67f3f7.entry.js +0 -1
  89. package/dist/dso-toolkit/p-6fcc89f9.entry.js +0 -1
  90. package/dist/dso-toolkit/p-faf19a1d.entry.js +0 -1
@@ -1,21 +1,20 @@
1
- import { h } from '@stencil/core';
1
+ import { h, Fragment } from '@stencil/core';
2
2
  import clsx from 'clsx';
3
3
  export const DsoTreeItem = ({ owner, ancestors, item, index, level, setSize }) => {
4
- var _a, _b;
5
- return (h("li", { key: item.reference, class: clsx('tree-item', { 'has-child': item.hasItems }), role: "treeitem", "aria-expanded": item.hasItems ? '' + !!item.open : undefined, "aria-level": level, "aria-setsize": setSize, "aria-posinset": index + 1 },
4
+ var _a, _b, _c;
5
+ return (h("li", { key: item.reference, class: clsx('tree-item', { 'has-child': item.hasItems }), role: 'none' },
6
6
  h("div", { class: "tree-branch-control" }, item.hasItems
7
7
  ?
8
8
  h("div", { onClick: (e) => owner.itemClick(e, ancestors, item) },
9
9
  h("dso-icon", { icon: item.open ? 'chevron-down' : 'chevron-right' }))
10
10
  : h("dso-icon", null)),
11
- h("p", { class: "tree-content", tabindex: level === 1 && index === 0 ? 0 : -1, onClick: (e) => owner.itemClick(e, ancestors, item) },
11
+ h("p", { class: "tree-content", tabindex: level === 1 && index === 0 ? 0 : -1, role: "treeitem", "aria-expanded": item.hasItems ? '' + (!!item.open && !!((_a = item.items) === null || _a === void 0 ? void 0 : _a.length)) : undefined, "aria-level": level, "aria-setsize": setSize, "aria-posinset": index + 1, "aria-busy": item.loading ? 'true' : undefined, onClick: (e) => owner.itemClick(e, ancestors, item) },
12
12
  item.href
13
- ? h("a", { href: item.href }, item.label)
14
- : h("span", null, item.label), (_a = item.icons) === null || _a === void 0 ? void 0 :
15
- _a.map((icon) => h("dso-icon", { icon: icon.icon, title: icon.label }))),
16
- h("ul", { role: "group", "aria-busy": item.loading ? 'true' : undefined },
17
- item.hasItems && !item.items && item.loading
13
+ ? h("a", { href: item.href, tabindex: "-1" }, item.label)
14
+ : h("span", null, item.label), (_b = item.icons) === null || _b === void 0 ? void 0 :
15
+ _b.map((icon) => h("dso-icon", { icon: icon.icon, title: icon.label }))),
16
+ item.open &&
17
+ h(Fragment, null, item.hasItems && !item.items && item.loading
18
18
  ? h("dso-progress-indicator", { size: "small", label: "Resultaten laden: een moment geduld alstublieft." })
19
- : undefined,
20
- item.open && ((_b = item.items) === null || _b === void 0 ? void 0 : _b.map((childItem, index, org) => h(DsoTreeItem, { owner: owner, ancestors: [...ancestors, item], item: childItem, index: index, level: level + 1, setSize: org.length }))))));
19
+ : h("ul", { role: "group" }, (_c = item.items) === null || _c === void 0 ? void 0 : _c.map((childItem, index, org) => h(DsoTreeItem, { owner: owner, ancestors: [...ancestors, item], item: childItem, index: index, level: level + 1, setSize: org.length }))))));
21
20
  };
@@ -45,11 +45,16 @@ export class TreeView {
45
45
  event.preventDefault();
46
46
  };
47
47
  this.itemClick = (event, ancestors, item) => {
48
- var _a;
49
48
  if (!(event.target instanceof HTMLElement)) {
50
49
  return;
51
50
  }
52
- if (event.target.classList.contains('tree-content') || ((_a = event.target.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains('tree-content'))) {
51
+ const contentElement = event.target.closest('.tree-content');
52
+ if (contentElement) {
53
+ const tree = event.composedPath().find(item => (item instanceof HTMLElement) ? item.className === 'dso-tree' : false);
54
+ if (!(contentElement instanceof HTMLParagraphElement) || !(tree instanceof HTMLElement)) {
55
+ return;
56
+ }
57
+ TreeView.setFocus(tree, contentElement);
53
58
  this.clickItem.emit([...ancestors, item]);
54
59
  return;
55
60
  }
@@ -91,27 +96,27 @@ export class TreeView {
91
96
  TreeView.setFocus(tree, focusableItems[index]);
92
97
  }
93
98
  static expandItemOrFocusChild(tree, target) {
94
- var _a, _b;
95
- if (((_a = target === null || target === void 0 ? void 0 : target.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-expanded')) === 'true') {
99
+ var _a;
100
+ if ((target === null || target === void 0 ? void 0 : target.getAttribute('aria-expanded')) === 'true') {
96
101
  TreeView.moveFocus(tree, target, 'next');
97
102
  }
98
103
  else {
99
- const controlElement = (_b = target.previousElementSibling) === null || _b === void 0 ? void 0 : _b.firstElementChild;
104
+ const controlElement = (_a = target.previousElementSibling) === null || _a === void 0 ? void 0 : _a.firstElementChild;
100
105
  if (controlElement instanceof HTMLElement) {
101
106
  controlElement.click();
102
107
  }
103
108
  }
104
109
  }
105
110
  static collapseItemOrFocusParent(tree, target) {
106
- var _a, _b, _c, _d;
107
- if (((_a = target === null || target === void 0 ? void 0 : target.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-expanded')) === 'true') {
108
- const controlElement = (_b = target.previousElementSibling) === null || _b === void 0 ? void 0 : _b.firstElementChild;
111
+ var _a, _b, _c;
112
+ if ((target === null || target === void 0 ? void 0 : target.getAttribute('aria-expanded')) === 'true') {
113
+ const controlElement = (_a = target.previousElementSibling) === null || _a === void 0 ? void 0 : _a.firstElementChild;
109
114
  if (controlElement instanceof HTMLElement) {
110
115
  controlElement.click();
111
116
  }
112
117
  }
113
118
  else {
114
- const parentTarget = (_d = (_c = target === null || target === void 0 ? void 0 : target.parentElement) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.previousElementSibling;
119
+ const parentTarget = (_c = (_b = target === null || target === void 0 ? void 0 : target.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.previousElementSibling;
115
120
  if (parentTarget instanceof HTMLElement) {
116
121
  TreeView.setFocus(tree, parentTarget);
117
122
  }
@@ -158,7 +163,7 @@ export class TreeView {
158
163
  "references": {
159
164
  "TreeViewItem": {
160
165
  "location": "import",
161
- "path": "@dso-toolkit/sources"
166
+ "path": "./tree-view.interfaces"
162
167
  }
163
168
  }
164
169
  },
@@ -186,7 +191,7 @@ export class TreeView {
186
191
  "references": {
187
192
  "TreeViewItem": {
188
193
  "location": "import",
189
- "path": "@dso-toolkit/sources"
194
+ "path": "./tree-view.interfaces"
190
195
  }
191
196
  }
192
197
  }
@@ -206,7 +211,7 @@ export class TreeView {
206
211
  "references": {
207
212
  "TreeViewItem": {
208
213
  "location": "import",
209
- "path": "@dso-toolkit/sources"
214
+ "path": "./tree-view.interfaces"
210
215
  }
211
216
  }
212
217
  }
@@ -226,7 +231,7 @@ export class TreeView {
226
231
  "references": {
227
232
  "TreeViewItem": {
228
233
  "location": "import",
229
- "path": "@dso-toolkit/sources"
234
+ "path": "./tree-view.interfaces"
230
235
  }
231
236
  }
232
237
  }
@@ -44,6 +44,12 @@ export const DsoDropdownMenu: {
44
44
  new (): DsoDropdownMenu;
45
45
  };
46
46
 
47
+ interface DsoHelpcenterPanel extends Components.DsoHelpcenterPanel, HTMLElement {}
48
+ export const DsoHelpcenterPanel: {
49
+ prototype: DsoHelpcenterPanel;
50
+ new (): DsoHelpcenterPanel;
51
+ };
52
+
47
53
  interface DsoHighlightBox extends Components.DsoHighlightBox, HTMLElement {}
48
54
  export const DsoHighlightBox: {
49
55
  prototype: DsoHighlightBox;