dso-toolkit 32.2.0 → 33.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.
- package/assets/dummy/images/{Medewerker.png → medewerker.png} +0 -0
- package/components/Componenten/form-elements/group-input-number.config.yml +2 -0
- package/components/Componenten/form-elements/group-input-number.njk +8 -3
- package/components/Componenten/input-number/input-number.config.yml +3 -3
- package/components/Componenten/input-number/input-number.njk +9 -8
- package/components/Componenten/list-button/list-button.njk +2 -2
- package/dist/library/@dso-toolkit/core/cjs/dso-dropdown-menu.cjs.entry.js +4 -1
- package/dist/library/@dso-toolkit/core/cjs/dso-toggletip.cjs.entry.js +2 -1
- package/dist/library/@dso-toolkit/core/cjs/dso-tree-view.cjs.entry.js +5 -4
- package/dist/library/@dso-toolkit/core/collection/components/dropdown-menu/dropdown-menu.css +4 -0
- package/dist/library/@dso-toolkit/core/collection/components/dropdown-menu/dropdown-menu.js +3 -0
- package/dist/library/@dso-toolkit/core/collection/components/toggletip/toggletip.css +4 -0
- package/dist/library/@dso-toolkit/core/collection/components/toggletip/toggletip.js +1 -0
- package/dist/library/@dso-toolkit/core/collection/components/tree-view/tree-item.js +3 -2
- package/dist/library/@dso-toolkit/core/collection/components/tree-view/tree-view.css +33 -5
- package/dist/library/@dso-toolkit/core/collection/components/tree-view/tree-view.js +11 -11
- package/dist/library/@dso-toolkit/core/collection/components/tree-view/tree-view.stories.js +23 -3
- package/dist/library/@dso-toolkit/core/custom-elements/index.js +11 -6
- package/dist/library/@dso-toolkit/core/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/library/@dso-toolkit/core/dso-toolkit/p-741e96de.entry.js +5 -0
- package/dist/{toolkit/core/p-e2dc97c4.entry.js → library/@dso-toolkit/core/dso-toolkit/p-984551a8.entry.js} +1 -1
- package/dist/library/@dso-toolkit/core/dso-toolkit/p-e814d644.entry.js +1 -0
- package/dist/library/@dso-toolkit/core/esm/dso-dropdown-menu.entry.js +4 -1
- package/dist/library/@dso-toolkit/core/esm/dso-toggletip.entry.js +2 -1
- package/dist/library/@dso-toolkit/core/esm/dso-tree-view.entry.js +5 -4
- package/dist/library/@dso-toolkit/core/types/components/dropdown-menu/dropdown-menu.d.ts +1 -0
- package/dist/library/@dso-toolkit/core/types/components/tree-view/tree-item.d.ts +4 -4
- package/dist/library/@dso-toolkit/core/types/components/tree-view/tree-view.d.ts +12 -9
- package/dist/library/@dso-toolkit/core/types/components/tree-view/tree-view.interfaces.d.ts +14 -4
- package/dist/library/@dso-toolkit/core/types/components/tree-view/tree-view.template.d.ts +1 -1
- package/dist/library/@dso-toolkit/core/types/components.d.ts +7 -7
- package/dist/library/components/detail/activiteiten.html +2 -1
- package/dist/library/components/detail/form--autocomplete.html +1 -1
- package/dist/library/components/detail/form--form-horizontal.html +4 -1
- package/dist/library/components/detail/form--form-vertical.html +4 -1
- package/dist/library/components/detail/form--multi-page.html +1 -1
- package/dist/library/components/detail/form--sections.html +1 -1
- package/dist/library/components/detail/form--simple-form.html +1 -1
- package/dist/library/components/detail/form--single-page.html +1 -1
- package/dist/library/components/detail/form.html +7 -1
- package/dist/library/components/detail/group-input-number--default.html +11 -3
- package/dist/library/components/detail/group-input-number--input-number-inactive.html +11 -3
- package/dist/library/components/detail/group-input-number--input-number-maximum-limit.html +13 -4
- package/dist/library/components/detail/group-input-number--input-number-minimum-limit.html +13 -4
- package/dist/library/components/detail/group-input-number--no-label.html +10 -6
- package/dist/library/components/detail/group-input-number.html +26 -8
- package/dist/library/components/detail/input-number--default.html +8 -7
- package/dist/library/components/detail/input-number--input-number-inactive.html +8 -7
- package/dist/library/components/detail/input-number--input-number-maximum-limit.html +9 -8
- package/dist/library/components/detail/input-number--input-number-minimum-limit.html +9 -8
- package/dist/library/components/detail/input-number--no-label.html +10 -9
- package/dist/library/components/detail/input-number.html +12 -11
- package/dist/library/components/detail/list-button--button-disabled.html +2 -2
- package/dist/library/components/detail/list-button--button-met-extra-label-disabled.html +2 -2
- package/dist/library/components/detail/list-button--button-met-extra-label-en-input-number.html +4 -3
- package/dist/library/components/detail/list-button--button-met-extra-label-selected.html +2 -2
- package/dist/library/components/detail/list-button--button-met-extra-label.html +2 -2
- package/dist/library/components/detail/list-button--button-met-input-number-selected.html +4 -3
- package/dist/library/components/detail/list-button--button-met-input-number.html +4 -3
- package/dist/library/components/detail/list-button--button-met-lange-optionele-tekst-en-extra-label.html +2 -2
- package/dist/library/components/detail/list-button--button-met-lange-optionele-tekst-en-input-number-en-extra-label.html +4 -3
- package/dist/library/components/detail/list-button--button-met-lange-optionele-tekst-en-input-number.html +4 -3
- package/dist/library/components/detail/list-button--button-met-lange-optionele-tekst.html +2 -2
- package/dist/library/components/detail/list-button--button-met-optionele-tekst-disabled.html +2 -2
- package/dist/library/components/detail/list-button--button-met-optionele-tekst-en-extra-label-disabled.html +2 -2
- package/dist/library/components/detail/list-button--button-met-optionele-tekst-en-extra-label-selected.html +2 -2
- package/dist/library/components/detail/list-button--button-met-optionele-tekst-en-extra-label.html +2 -2
- package/dist/library/components/detail/list-button--button-met-optionele-tekst-en-input-number-en-extra-label.html +4 -3
- package/dist/library/components/detail/list-button--button-met-optionele-tekst-en-input-number.html +4 -3
- package/dist/library/components/detail/list-button--button-met-optionele-tekst-selected.html +2 -2
- package/dist/library/components/detail/list-button--button-met-optionele-tekst.html +2 -2
- package/dist/library/components/detail/list-button--button-selected.html +2 -2
- package/dist/library/components/detail/list-button--default.html +2 -2
- package/dist/library/components/detail/list-button.html +16 -9
- package/dist/library/components/preview/activiteiten.html +2 -0
- package/dist/library/components/preview/group-input-number--default.html +14 -10
- package/dist/library/components/preview/group-input-number--input-number-inactive.html +14 -10
- package/dist/library/components/preview/group-input-number--input-number-maximum-limit.html +14 -10
- package/dist/library/components/preview/group-input-number--input-number-minimum-limit.html +14 -10
- package/dist/library/components/preview/group-input-number--no-label.html +10 -10
- package/dist/library/components/preview/group-input-number.html +66 -50
- package/dist/library/components/preview/input-number--default.html +9 -7
- package/dist/library/components/preview/input-number--input-number-inactive.html +9 -7
- package/dist/library/components/preview/input-number--input-number-maximum-limit.html +9 -7
- package/dist/library/components/preview/input-number--input-number-minimum-limit.html +9 -7
- package/dist/library/components/preview/input-number--no-label.html +9 -7
- package/dist/library/components/preview/input-number.html +40 -35
- package/dist/library/components/preview/list-button--button-met-extra-label-en-input-number.html +10 -8
- package/dist/library/components/preview/list-button--button-met-input-number-selected.html +10 -8
- package/dist/library/components/preview/list-button--button-met-input-number.html +10 -8
- package/dist/library/components/preview/list-button--button-met-lange-optionele-tekst-en-input-number-en-extra-label.html +10 -8
- package/dist/library/components/preview/list-button--button-met-lange-optionele-tekst-en-input-number.html +10 -8
- package/dist/library/components/preview/list-button--button-met-optionele-tekst-en-input-number-en-extra-label.html +10 -8
- package/dist/library/components/preview/list-button--button-met-optionele-tekst-en-input-number.html +10 -8
- package/dist/library/components/preview/list-button.html +63 -49
- package/dist/library/components/render/activiteiten.html +10 -8
- package/dist/library/components/render/form--form-horizontal.html +14 -10
- package/dist/library/components/render/form--form-vertical.html +14 -10
- package/dist/library/components/render/form.html +28 -20
- package/dist/library/components/render/group-input-number--default.html +14 -10
- package/dist/library/components/render/group-input-number--input-number-inactive.html +14 -10
- package/dist/library/components/render/group-input-number--input-number-maximum-limit.html +14 -10
- package/dist/library/components/render/group-input-number--input-number-minimum-limit.html +14 -10
- package/dist/library/components/render/group-input-number--no-label.html +10 -10
- package/dist/library/components/render/group-input-number.html +66 -50
- package/dist/library/components/render/input-number--default.html +9 -7
- package/dist/library/components/render/input-number--input-number-inactive.html +9 -7
- package/dist/library/components/render/input-number--input-number-maximum-limit.html +9 -7
- package/dist/library/components/render/input-number--input-number-minimum-limit.html +9 -7
- package/dist/library/components/render/input-number--no-label.html +9 -7
- package/dist/library/components/render/input-number.html +40 -35
- package/dist/library/components/render/list-button--button-met-extra-label-en-input-number.html +10 -8
- package/dist/library/components/render/list-button--button-met-input-number-selected.html +10 -8
- package/dist/library/components/render/list-button--button-met-input-number.html +10 -8
- package/dist/library/components/render/list-button--button-met-lange-optionele-tekst-en-input-number-en-extra-label.html +10 -8
- package/dist/library/components/render/list-button--button-met-lange-optionele-tekst-en-input-number.html +10 -8
- package/dist/library/components/render/list-button--button-met-optionele-tekst-en-input-number-en-extra-label.html +10 -8
- package/dist/library/components/render/list-button--button-met-optionele-tekst-en-input-number.html +10 -8
- package/dist/library/components/render/list-button.html +63 -49
- package/dist/library/dummy/images/{Medewerker.png → medewerker.png} +0 -0
- package/dist/toolkit/core/dso-toolkit.esm.js +1 -1
- package/dist/toolkit/core/p-741e96de.entry.js +5 -0
- package/dist/{library/@dso-toolkit/core/dso-toolkit/p-e2dc97c4.entry.js → toolkit/core/p-984551a8.entry.js} +1 -1
- package/dist/toolkit/core/p-e814d644.entry.js +1 -0
- package/dist/toolkit/dummy/images/{Medewerker.png → medewerker.png} +0 -0
- package/hydrate/index.js +11 -6
- package/libs/@dso-toolkit/sources/src/components/input-number/input-number.stories.ts +1 -1
- package/libs/@dso-toolkit/sources/src/components/tree-view/tree-view.content.ts +40 -39
- package/libs/@dso-toolkit/sources/src/components/tree-view/tree-view.demo.ts +92 -9
- package/libs/@dso-toolkit/sources/src/components/tree-view/tree-view.models.ts +20 -9
- package/libs/@dso-toolkit/sources/src/components/tree-view/tree-view.stories.ts +16 -5
- package/package.json +2 -2
- package/reference/render/activiteiten.html +1 -1
- package/reference/render/group-input-number--input-number-maximum-limit.html +1 -1
- package/reference/render/group-input-number--input-number-minimum-limit.html +1 -1
- package/reference/render/group-input-number--no-label.html +1 -3
- package/reference/render/input-number--no-label.html +1 -1
- package/reference/render/list-button--button-met-extra-label-en-input-number.html +1 -1
- package/reference/render/list-button--button-met-input-number-selected.html +1 -1
- package/reference/render/list-button--button-met-input-number.html +1 -1
- package/reference/render/list-button--button-met-lange-optionele-tekst-en-input-number-en-extra-label.html +1 -1
- package/reference/render/list-button--button-met-lange-optionele-tekst-en-input-number.html +1 -1
- package/reference/render/list-button--button-met-optionele-tekst-en-input-number-en-extra-label.html +1 -1
- package/reference/render/list-button--button-met-optionele-tekst-en-input-number.html +1 -1
- package/dist/library/@dso-toolkit/core/dso-toolkit/p-12f7e7d7.entry.js +0 -5
- package/dist/library/@dso-toolkit/core/dso-toolkit/p-ad8f467f.entry.js +0 -1
- package/dist/toolkit/core/p-12f7e7d7.entry.js +0 -5
- package/dist/toolkit/core/p-ad8f467f.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,F as t,r as o,c as n}from"./p-a40eeb32.js";import{c as r}from"./p-4070c1e5.js";const i=({owner:o,ancestors:n,item:s,index:a,level:l,setSize:c})=>{var d,u,v;return e("li",{key:s.id,class:r("tree-item",{"has-child":s.hasItems}),role:"none"},e("div",{class:"tree-branch-control"},s.hasItems?e("div",{onClick:e=>o.itemClick(e,n,s)},e("dso-icon",{icon:s.open?"chevron-down":"chevron-right"})):e("dso-icon",null)),e("p",{class:r("tree-content",{active:s.active},{selected:s.selected}),tabindex:1===l&&0===a?0:-1,role:"treeitem","aria-expanded":s.hasItems?""+(!!s.open&&!!(null===(d=s.items)||void 0===d?void 0:d.length)):void 0,"aria-current":s.active?"true":void 0,"aria-level":l,"aria-setsize":c,"aria-posinset":a+1,"aria-busy":s.loading?"true":void 0,onClick:e=>o.itemClick(e,n,s)},s.selected&&e("span",{class:"sr-only"},"Resultaat: "),s.href?e("a",{href:s.href,tabindex:"-1"},s.label):e("span",null,s.label),null===(u=s.icons)||void 0===u?void 0:u.map((t=>e("dso-icon",{icon:t.icon,title:t.label})))),s.open&&e(t,null,s.hasItems&&!s.items&&s.loading?e("dso-progress-indicator",{size:"small",label:"Resultaten laden: een moment geduld alstublieft."}):e("ul",{role:"group"},null===(v=s.items)||void 0===v?void 0:v.map(((t,r,a)=>e(i,{owner:o,ancestors:[...n,s],item:t,index:r,level:l+1,setSize:a.length}))))))};let s=class{constructor(e){o(this,e),this.openItem=n(this,"openItem",7),this.closeItem=n(this,"closeItem",7),this.clickItem=n(this,"clickItem",7),this.keyDownListener=e=>{if(e.defaultPrevented)return;const t=e.composedPath().find((e=>e instanceof HTMLElement&&"dso-tree"===e.className));if(e.target instanceof HTMLParagraphElement&&t instanceof HTMLElement){switch(e.key){case"ArrowDown":s.moveFocus(t,e.target,"next");break;case"ArrowUp":s.moveFocus(t,e.target,"previous");break;case"ArrowRight":s.expandItemOrFocusChild(t,e.target);break;case"ArrowLeft":s.collapseItemOrFocusParent(t,e.target);break;case"End":s.moveFocus(t,e.target,"last");break;case"Home":s.moveFocus(t,e.target,"first");break;case"Enter":case" ":e.target.click();break;default:if(1===(o=e.key).length&&o.match(/\S/)&&s.setFocusByFirstCharacter(t,e.target,e.key,e.shiftKey))break;return}var o;e.preventDefault()}},this.itemClick=(e,t,o)=>{if(!(e.target instanceof HTMLElement))return;const n=e.target.closest(".tree-content");if(n){const r=e.composedPath().find((e=>e instanceof HTMLElement&&"dso-tree"===e.className));if(!(n instanceof HTMLParagraphElement&&r instanceof HTMLElement))return;return s.setFocus(r,n),void this.clickItem.emit({path:[...t,o],originalEvent:e})}o.open?this.closeItem.emit([...t,o]):this.openItem.emit([...t,o])}}static setFocus(e,t){t&&(Array.from(e.querySelectorAll("p")).filter((e=>0===e.tabIndex)).forEach((e=>e.tabIndex=-1)),t.tabIndex=0,t.focus())}static moveFocus(e,t,o){const n=Array.from(e.querySelectorAll("p")).filter((e=>e.offsetWidth>0&&e.offsetHeight>0));let r=0;switch(o){case"first":r=0;break;case"previous":r=n.indexOf(t)-1;break;case"next":r=n.indexOf(t)+1;break;case"last":r=n.length-1}s.setFocus(e,n[r])}static expandItemOrFocusChild(e,t){var o;if("true"===(null==t?void 0:t.getAttribute("aria-expanded")))s.moveFocus(e,t,"next");else{const e=null===(o=t.previousElementSibling)||void 0===o?void 0:o.firstElementChild;e instanceof HTMLElement&&e.click()}}static collapseItemOrFocusParent(e,t){var o,n,r;if("true"===(null==t?void 0:t.getAttribute("aria-expanded"))){const e=null===(o=t.previousElementSibling)||void 0===o?void 0:o.firstElementChild;e instanceof HTMLElement&&e.click()}else{const o=null===(r=null===(n=null==t?void 0:t.parentElement)||void 0===n?void 0:n.parentElement)||void 0===r?void 0:r.previousElementSibling;o instanceof HTMLElement&&s.setFocus(e,o)}}static setFocusByFirstCharacter(e,t,o,n){const r=Array.from(e.querySelectorAll("p")).filter((e=>e.offsetWidth>0&&e.offsetHeight>0));n&&r.reverse();const i=r.indexOf(t);o=o.toLowerCase();let a=r.find(((e,t)=>{var n;return t>i&&(null===(n=e.textContent)||void 0===n?void 0:n.toLowerCase().startsWith(o))}));return a||(a=r.find(((e,t)=>{var n;return t<i&&(null===(n=e.textContent)||void 0===n?void 0:n.toLowerCase().startsWith(o))}))),!!a&&(s.setFocus(e,a),!0)}render(){var t;return e("div",{id:"tree",class:"dso-tree",onKeyDown:e=>this.keyDownListener(e)},e("ul",{role:"tree","aria-label":"Objectenboom"},null===(t=this.collection)||void 0===t?void 0:t.map(((t,o)=>e(i,{owner:this,ancestors:[],item:t,index:o,level:1,setSize:this.collection.length})))))}};s.style=":host ul{list-style-type:none}:host ul[role=tree]{padding-left:0}:host li[role=treeitem]>ul{padding-left:1.5em}:host .tree-branch-control{cursor:pointer;display:inline-block}:host .tree-content{cursor:pointer;display:inline-block;margin:8px 0}:host .tree-content.active{font-weight:700}:host .tree-content.active:hover{text-decoration:underline}:host .tree-content.active a{text-decoration:none}:host .tree-content.selected{color:#191919;font-weight:700;text-decoration:underline}:host .tree-content.selected:hover,:host .tree-content.selected:focus{text-decoration:none}:host .tree-content a,:host .tree-content a:visited{color:#191919;text-decoration:underline}:host .tree-content a:hover,:host .tree-content a:focus{color:#191919;text-decoration:none}:host .tree-content a:active{text-decoration:none}:host .tree-content dso-icon{font-size:0.75em;margin-left:0.5em;vertical-align:text-bottom}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";export{s as dso_tree_view}
|
|
File without changes
|
package/hydrate/index.js
CHANGED
|
@@ -6258,7 +6258,7 @@ var tabbable = function tabbable(el, options) {
|
|
|
6258
6258
|
return tabbableNodes;
|
|
6259
6259
|
};
|
|
6260
6260
|
|
|
6261
|
-
const dropdownMenuCss = "/*!@:host*/.sc-dso-dropdown-menu-h{--di-check-wit:url(\"data:image/svg+xml,%3csvg id='check' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M10.11%2c18%2c5.29%2c13.31A.92.92%2c0%2c0%2c1%2c5.3%2c12a1%2c1%2c0%2c0%2c1%2c1.41%2c0l3.4%2c3.3%2c7.18-7a1%2c1%2c0%2c0%2c1%2c1.41%2c0%2c.92.92%2c0%2c0%2c1%2c0%2c1.35Z'/%3e %3c/svg%3e\");--di-chevron-down:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-down-scampi:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23676cb0%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-down-wit:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-up:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");--di-chevron-up-scampi:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23676cb0%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");--di-chevron-up-wit:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");display:inline-block;position:relative}";
|
|
6261
|
+
const dropdownMenuCss = "/*!@:host(:focus)*/.sc-dso-dropdown-menu-h:focus{outline:none}/*!@:host*/.sc-dso-dropdown-menu-h{--di-check-wit:url(\"data:image/svg+xml,%3csvg id='check' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M10.11%2c18%2c5.29%2c13.31A.92.92%2c0%2c0%2c1%2c5.3%2c12a1%2c1%2c0%2c0%2c1%2c1.41%2c0l3.4%2c3.3%2c7.18-7a1%2c1%2c0%2c0%2c1%2c1.41%2c0%2c.92.92%2c0%2c0%2c1%2c0%2c1.35Z'/%3e %3c/svg%3e\");--di-chevron-down:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-down-scampi:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23676cb0%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-down-wit:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-up:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");--di-chevron-up-scampi:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23676cb0%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");--di-chevron-up-wit:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");display:inline-block;position:relative}";
|
|
6262
6262
|
|
|
6263
6263
|
class DropdownMenu {
|
|
6264
6264
|
constructor(hostRef) {
|
|
@@ -6353,6 +6353,9 @@ class DropdownMenu {
|
|
|
6353
6353
|
this.openPopup();
|
|
6354
6354
|
}
|
|
6355
6355
|
}
|
|
6356
|
+
componentDidRender() {
|
|
6357
|
+
this.host.setAttribute("tabindex", "-1");
|
|
6358
|
+
}
|
|
6356
6359
|
componentWillRender() {
|
|
6357
6360
|
for (const li of Array.from(this.host.getElementsByTagName("li"))) {
|
|
6358
6361
|
for (const tab of tabbable(li)) {
|
|
@@ -8602,7 +8605,7 @@ class Selectable {
|
|
|
8602
8605
|
}; }
|
|
8603
8606
|
}
|
|
8604
8607
|
|
|
8605
|
-
const toggletipCss = "/*!@*,\n*::after,\n*::before*/*.sc-dso-toggletip,*.sc-dso-toggletip::after,*.sc-dso-toggletip::before{box-sizing:border-box}";
|
|
8608
|
+
const toggletipCss = "/*!@*,\n*::after,\n*::before*/*.sc-dso-toggletip,*.sc-dso-toggletip::after,*.sc-dso-toggletip::before{box-sizing:border-box}/*!@:host(:focus)*/.sc-dso-toggletip-h:focus{outline:none}";
|
|
8606
8609
|
|
|
8607
8610
|
class Toggletip {
|
|
8608
8611
|
constructor(hostRef) {
|
|
@@ -8649,6 +8652,7 @@ class Toggletip {
|
|
|
8649
8652
|
throw Error("button not found");
|
|
8650
8653
|
}
|
|
8651
8654
|
this.button = button;
|
|
8655
|
+
this.host.setAttribute("tabindex", "-1");
|
|
8652
8656
|
}
|
|
8653
8657
|
render() {
|
|
8654
8658
|
return (hAsync(Fragment, null, hAsync("dso-info-button", { id: "toggle", onClick: this.click, label: this.label, active: this.active, secondary: this.secondary }), hAsync("dso-tooltip", { stateless: true, for: "toggle", active: this.active, position: this.position, small: this.small }, hAsync("slot", null))));
|
|
@@ -10569,13 +10573,14 @@ class Tooltip {
|
|
|
10569
10573
|
|
|
10570
10574
|
const DsoTreeItem = ({ owner, ancestors, item, index, level, setSize }) => {
|
|
10571
10575
|
var _a, _b, _c;
|
|
10572
|
-
return (hAsync("li", { key: item.
|
|
10576
|
+
return (hAsync("li", { key: item.id, class: clsx('tree-item', { 'has-child': item.hasItems }), role: 'none' },
|
|
10573
10577
|
hAsync("div", { class: "tree-branch-control" }, item.hasItems
|
|
10574
10578
|
?
|
|
10575
10579
|
hAsync("div", { onClick: (e) => owner.itemClick(e, ancestors, item) },
|
|
10576
10580
|
hAsync("dso-icon", { icon: item.open ? 'chevron-down' : 'chevron-right' }))
|
|
10577
10581
|
: hAsync("dso-icon", null)),
|
|
10578
|
-
hAsync("p", { class:
|
|
10582
|
+
hAsync("p", { class: clsx('tree-content', { 'active': item.active }, { 'selected': item.selected }), 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-current": item.active ? 'true' : undefined, "aria-level": level, "aria-setsize": setSize, "aria-posinset": index + 1, "aria-busy": item.loading ? 'true' : undefined, onClick: (e) => owner.itemClick(e, ancestors, item) },
|
|
10583
|
+
item.selected && hAsync("span", { class: "sr-only" }, "Resultaat: "),
|
|
10579
10584
|
item.href
|
|
10580
10585
|
? hAsync("a", { href: item.href, tabindex: "-1" }, item.label)
|
|
10581
10586
|
: hAsync("span", null, item.label), (_b = item.icons) === null || _b === void 0 ? void 0 :
|
|
@@ -10586,7 +10591,7 @@ const DsoTreeItem = ({ owner, ancestors, item, index, level, setSize }) => {
|
|
|
10586
10591
|
: hAsync("ul", { role: "group" }, (_c = item.items) === null || _c === void 0 ? void 0 : _c.map((childItem, index, org) => hAsync(DsoTreeItem, { owner: owner, ancestors: [...ancestors, item], item: childItem, index: index, level: level + 1, setSize: org.length }))))));
|
|
10587
10592
|
};
|
|
10588
10593
|
|
|
10589
|
-
const treeViewCss = "/*!@:host ul*/.sc-dso-tree-view-h ul.sc-dso-tree-view{list-style-type:none}/*!@:host ul[role=tree]*/.sc-dso-tree-view-h ul[role=tree].sc-dso-tree-view{padding-left:0}/*!@:host li[role=treeitem] > ul*/.sc-dso-tree-view-h li[role=treeitem].sc-dso-tree-view>ul.sc-dso-tree-view{padding-left:1.5em}/*!@:host .tree-branch-control*/.sc-dso-tree-view-h .tree-branch-control.sc-dso-tree-view{cursor:pointer;display:inline-block}/*!@:host .tree-content*/.sc-dso-tree-view-h .tree-content.sc-dso-tree-view{cursor:pointer;display:inline-block;margin:8px 0}/*!@:host .tree-content a, :host .tree-content a:visited*/.sc-dso-tree-view-h .tree-content.sc-dso-tree-view a.sc-dso-tree-view,.sc-dso-tree-view-h .tree-content.sc-dso-tree-view a.sc-dso-tree-view:visited{color:#
|
|
10594
|
+
const treeViewCss = "/*!@:host ul*/.sc-dso-tree-view-h ul.sc-dso-tree-view{list-style-type:none}/*!@:host ul[role=tree]*/.sc-dso-tree-view-h ul[role=tree].sc-dso-tree-view{padding-left:0}/*!@:host li[role=treeitem] > ul*/.sc-dso-tree-view-h li[role=treeitem].sc-dso-tree-view>ul.sc-dso-tree-view{padding-left:1.5em}/*!@:host .tree-branch-control*/.sc-dso-tree-view-h .tree-branch-control.sc-dso-tree-view{cursor:pointer;display:inline-block}/*!@:host .tree-content*/.sc-dso-tree-view-h .tree-content.sc-dso-tree-view{cursor:pointer;display:inline-block;margin:8px 0}/*!@:host .tree-content.active*/.sc-dso-tree-view-h .tree-content.active.sc-dso-tree-view{font-weight:700}/*!@:host .tree-content.active:hover*/.sc-dso-tree-view-h .tree-content.active.sc-dso-tree-view:hover{text-decoration:underline}/*!@:host .tree-content.active a*/.sc-dso-tree-view-h .tree-content.active.sc-dso-tree-view a.sc-dso-tree-view{text-decoration:none}/*!@:host .tree-content.selected*/.sc-dso-tree-view-h .tree-content.selected.sc-dso-tree-view{color:#191919;font-weight:700;text-decoration:underline}/*!@:host .tree-content.selected:hover, :host .tree-content.selected:focus*/.sc-dso-tree-view-h .tree-content.selected.sc-dso-tree-view:hover,.sc-dso-tree-view-h .tree-content.selected.sc-dso-tree-view:focus{text-decoration:none}/*!@:host .tree-content a, :host .tree-content a:visited*/.sc-dso-tree-view-h .tree-content.sc-dso-tree-view a.sc-dso-tree-view,.sc-dso-tree-view-h .tree-content.sc-dso-tree-view a.sc-dso-tree-view:visited{color:#191919;text-decoration:underline}/*!@:host .tree-content a:hover, :host .tree-content a:focus*/.sc-dso-tree-view-h .tree-content.sc-dso-tree-view a.sc-dso-tree-view:hover,.sc-dso-tree-view-h .tree-content.sc-dso-tree-view a.sc-dso-tree-view:focus{color:#191919;text-decoration:none}/*!@:host .tree-content a:active*/.sc-dso-tree-view-h .tree-content.sc-dso-tree-view a.sc-dso-tree-view:active{text-decoration:none}/*!@:host .tree-content dso-icon*/.sc-dso-tree-view-h .tree-content.sc-dso-tree-view dso-icon.sc-dso-tree-view{font-size:0.75em;margin-left:0.5em;vertical-align:text-bottom}/*!@*,\n*::after,\n*::before*/*.sc-dso-tree-view,*.sc-dso-tree-view::after,*.sc-dso-tree-view::before{box-sizing:border-box}/*!@.sr-only*/.sr-only.sc-dso-tree-view{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";
|
|
10590
10595
|
|
|
10591
10596
|
class TreeView {
|
|
10592
10597
|
constructor(hostRef) {
|
|
@@ -10647,7 +10652,7 @@ class TreeView {
|
|
|
10647
10652
|
return;
|
|
10648
10653
|
}
|
|
10649
10654
|
TreeView.setFocus(tree, contentElement);
|
|
10650
|
-
this.clickItem.emit([...ancestors, item]);
|
|
10655
|
+
this.clickItem.emit({ path: [...ancestors, item], originalEvent: event });
|
|
10651
10656
|
return;
|
|
10652
10657
|
}
|
|
10653
10658
|
if (item.open) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TreeViewItem } from './tree-view.models';
|
|
2
2
|
|
|
3
|
-
export const items: TreeViewItem
|
|
3
|
+
export const items: TreeViewItem[] = [
|
|
4
4
|
{
|
|
5
|
-
|
|
5
|
+
id: 'item.1',
|
|
6
6
|
label: 'Bebouwde omgeving',
|
|
7
7
|
open: true,
|
|
8
8
|
hasItems: true,
|
|
@@ -18,12 +18,12 @@ export const items: TreeViewItem<string>[] = [
|
|
|
18
18
|
],
|
|
19
19
|
items: [
|
|
20
20
|
{
|
|
21
|
-
|
|
21
|
+
id: 'item.1.1',
|
|
22
22
|
label: 'bouwelementen',
|
|
23
23
|
hasItems: true,
|
|
24
24
|
items: [
|
|
25
25
|
{
|
|
26
|
-
|
|
26
|
+
id: 'item.1.1.1',
|
|
27
27
|
label: 'afvoerbuizen',
|
|
28
28
|
href: 'https://nl.wikipedia.org/wiki/afvoerbuizen',
|
|
29
29
|
hasItems: false,
|
|
@@ -35,13 +35,14 @@ export const items: TreeViewItem<string>[] = [
|
|
|
35
35
|
]
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
|
|
38
|
+
id: 'item.1.1.2',
|
|
39
39
|
label: 'ankers',
|
|
40
40
|
hasItems: true,
|
|
41
41
|
items: [
|
|
42
42
|
{
|
|
43
|
-
|
|
43
|
+
id: 'item.1.1.2.1',
|
|
44
44
|
label: 'brugankers',
|
|
45
|
+
href: 'wiki:Muuranker',
|
|
45
46
|
hasItems: false
|
|
46
47
|
}
|
|
47
48
|
]
|
|
@@ -49,7 +50,7 @@ export const items: TreeViewItem<string>[] = [
|
|
|
49
50
|
]
|
|
50
51
|
},
|
|
51
52
|
{
|
|
52
|
-
|
|
53
|
+
id: 'item.1.2',
|
|
53
54
|
label: 'bouwonderdelen',
|
|
54
55
|
hasItems: true,
|
|
55
56
|
icons: [
|
|
@@ -60,76 +61,76 @@ export const items: TreeViewItem<string>[] = [
|
|
|
60
61
|
],
|
|
61
62
|
items: [
|
|
62
63
|
{
|
|
63
|
-
|
|
64
|
+
id: 'item.1.2.1',
|
|
64
65
|
label: 'aanbouwsels',
|
|
65
66
|
hasItems: false
|
|
66
67
|
},
|
|
67
68
|
{
|
|
68
|
-
|
|
69
|
+
id: 'item.1.2.2',
|
|
69
70
|
label: 'balkons',
|
|
70
71
|
hasItems: false
|
|
71
72
|
},
|
|
72
73
|
{
|
|
73
|
-
|
|
74
|
+
id: 'item.1.2.3',
|
|
74
75
|
label: 'binnenplaatsen',
|
|
75
76
|
hasItems: true,
|
|
76
77
|
items: [
|
|
77
78
|
{
|
|
78
|
-
|
|
79
|
+
id: 'item.1.2.3.1',
|
|
79
80
|
label: 'hofjes',
|
|
80
81
|
hasItems: false
|
|
81
82
|
},
|
|
82
83
|
{
|
|
83
|
-
|
|
84
|
+
id: 'item.1.2.3.2',
|
|
84
85
|
label: 'patio\'s',
|
|
85
86
|
hasItems: false
|
|
86
87
|
},
|
|
87
88
|
]
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
|
-
|
|
91
|
+
id: 'item.1.2.4',
|
|
91
92
|
label: 'binnenplaatsen',
|
|
92
93
|
hasItems: false
|
|
93
94
|
},
|
|
94
95
|
{
|
|
95
|
-
|
|
96
|
+
id: 'item.1.2.5',
|
|
96
97
|
label: 'boxen',
|
|
97
98
|
hasItems: false
|
|
98
99
|
},
|
|
99
100
|
{
|
|
100
|
-
|
|
101
|
+
id: 'item.1.2.6',
|
|
101
102
|
label: 'eetzalen',
|
|
102
103
|
hasItems: false
|
|
103
104
|
},
|
|
104
105
|
{
|
|
105
|
-
|
|
106
|
+
id: 'item.1.2.7',
|
|
106
107
|
label: 'flieringen',
|
|
107
108
|
hasItems: false
|
|
108
109
|
},
|
|
109
110
|
{
|
|
110
|
-
|
|
111
|
+
id: 'item.1.2.8',
|
|
111
112
|
label: 'gangen',
|
|
112
113
|
hasItems: false
|
|
113
114
|
},
|
|
114
115
|
{
|
|
115
|
-
|
|
116
|
+
id: 'item.1.2.9',
|
|
116
117
|
label: 'hallen',
|
|
117
118
|
hasItems: false
|
|
118
119
|
},
|
|
119
120
|
{
|
|
120
|
-
|
|
121
|
+
id: 'item.1.2.10',
|
|
121
122
|
label: 'kamers',
|
|
122
123
|
hasItems: false
|
|
123
124
|
},
|
|
124
125
|
{
|
|
125
|
-
|
|
126
|
+
id: 'item.1.2.11',
|
|
126
127
|
label: 'kelders',
|
|
127
128
|
hasItems: false
|
|
128
129
|
},
|
|
129
130
|
]
|
|
130
131
|
},
|
|
131
132
|
{
|
|
132
|
-
|
|
133
|
+
id: 'item.1.3',
|
|
133
134
|
label: 'bouwwerken',
|
|
134
135
|
hasItems: true,
|
|
135
136
|
icons: [
|
|
@@ -144,14 +145,14 @@ export const items: TreeViewItem<string>[] = [
|
|
|
144
145
|
],
|
|
145
146
|
},
|
|
146
147
|
{
|
|
147
|
-
|
|
148
|
+
id: 'item.1.4',
|
|
148
149
|
label: 'complexen',
|
|
149
150
|
hasItems: true,
|
|
150
151
|
},
|
|
151
152
|
]
|
|
152
153
|
},
|
|
153
154
|
{
|
|
154
|
-
|
|
155
|
+
id: 'item.2',
|
|
155
156
|
label: 'Woninginrichting',
|
|
156
157
|
hasItems: true,
|
|
157
158
|
icons: [
|
|
@@ -162,19 +163,19 @@ export const items: TreeViewItem<string>[] = [
|
|
|
162
163
|
],
|
|
163
164
|
items: [
|
|
164
165
|
{
|
|
165
|
-
|
|
166
|
+
id: 'item.2.1',
|
|
166
167
|
label: 'Beddengoed',
|
|
167
168
|
hasItems: true,
|
|
168
169
|
items: [
|
|
169
170
|
{
|
|
170
|
-
|
|
171
|
+
id: 'item.2.1.1',
|
|
171
172
|
label: 'Lakens',
|
|
172
173
|
hasItems: false
|
|
173
174
|
},
|
|
174
175
|
]
|
|
175
176
|
},
|
|
176
177
|
{
|
|
177
|
-
|
|
178
|
+
id: 'item.2.2',
|
|
178
179
|
label: 'Doeken',
|
|
179
180
|
hasItems: false
|
|
180
181
|
}
|
|
@@ -182,37 +183,37 @@ export const items: TreeViewItem<string>[] = [
|
|
|
182
183
|
},
|
|
183
184
|
];
|
|
184
185
|
|
|
185
|
-
export const subItems: Record<string, TreeViewItem
|
|
186
|
+
export const subItems: Record<string, TreeViewItem[]> = {
|
|
186
187
|
['item.1.3']: [
|
|
187
188
|
{
|
|
188
|
-
|
|
189
|
+
id: 'item.1.3.1',
|
|
189
190
|
label: 'bebouwing',
|
|
190
191
|
hasItems: true,
|
|
191
192
|
items: [
|
|
192
193
|
{
|
|
193
|
-
|
|
194
|
+
id: 'item.1.3.1.1',
|
|
194
195
|
label: 'hoogbouw',
|
|
195
196
|
hasItems: false
|
|
196
197
|
},
|
|
197
198
|
{
|
|
198
|
-
|
|
199
|
+
id: 'item.1.3.1.2',
|
|
199
200
|
label: 'laagbouw',
|
|
200
201
|
hasItems: false
|
|
201
202
|
},
|
|
202
203
|
]
|
|
203
204
|
},
|
|
204
205
|
{
|
|
205
|
-
|
|
206
|
+
id: 'item.1.3.2',
|
|
206
207
|
label: 'begraafplaatsen',
|
|
207
208
|
hasItems: false
|
|
208
209
|
},
|
|
209
210
|
{
|
|
210
|
-
|
|
211
|
+
id: 'item.1.3.3',
|
|
211
212
|
label: 'bouwvallen',
|
|
212
213
|
hasItems: false
|
|
213
214
|
},
|
|
214
215
|
{
|
|
215
|
-
|
|
216
|
+
id: 'item.1.3.4',
|
|
216
217
|
label: 'communicatiemasten',
|
|
217
218
|
hasItems: false,
|
|
218
219
|
icons: [
|
|
@@ -225,34 +226,34 @@ export const subItems: Record<string, TreeViewItem<string>[]> = {
|
|
|
225
226
|
],
|
|
226
227
|
['item.1.4']: [
|
|
227
228
|
{
|
|
228
|
-
|
|
229
|
+
id: 'item.1.4.1',
|
|
229
230
|
label: 'buurten',
|
|
230
231
|
hasItems: true,
|
|
231
232
|
items: [
|
|
232
233
|
{
|
|
233
|
-
|
|
234
|
+
id: 'item.1.4.1.1',
|
|
234
235
|
label: 'achterbuurten',
|
|
235
236
|
hasItems: false
|
|
236
237
|
},
|
|
237
238
|
{
|
|
238
|
-
|
|
239
|
+
id: 'item.1.4.1.2',
|
|
239
240
|
label: 'volksbuurten',
|
|
240
241
|
hasItems: false
|
|
241
242
|
},
|
|
242
243
|
]
|
|
243
244
|
},
|
|
244
245
|
{
|
|
245
|
-
|
|
246
|
+
id: 'item.1.4.2',
|
|
246
247
|
label: 'campussen',
|
|
247
248
|
hasItems: false
|
|
248
249
|
},
|
|
249
250
|
{
|
|
250
|
-
|
|
251
|
+
id: 'item.1.4.3',
|
|
251
252
|
label: 'stadsdelen',
|
|
252
253
|
hasItems: false
|
|
253
254
|
},
|
|
254
255
|
{
|
|
255
|
-
|
|
256
|
+
id: 'item.1.4.4',
|
|
256
257
|
label: 'woonwijken',
|
|
257
258
|
hasItems: false,
|
|
258
259
|
icons: [
|
|
@@ -4,14 +4,14 @@ import { items, subItems } from './tree-view.content';
|
|
|
4
4
|
export namespace TreeViewDemo {
|
|
5
5
|
export let collection = items;
|
|
6
6
|
|
|
7
|
-
export function onOpenItem(path: TreeViewItem
|
|
7
|
+
export function onOpenItem(path: TreeViewItem[], callback: (collection: TreeViewItem[]) => void): void {
|
|
8
8
|
const actionItem = path[path.length - 1];
|
|
9
9
|
const actionBehaviour = new Map(
|
|
10
10
|
[
|
|
11
11
|
['item.1.3', { loading: false, loadTime: 250 }],
|
|
12
12
|
['item.1.4', { loading: true, loadTime: 2500 }]
|
|
13
13
|
]
|
|
14
|
-
).get(actionItem.
|
|
14
|
+
).get(actionItem.id);
|
|
15
15
|
|
|
16
16
|
if (actionBehaviour && actionItem.hasItems && !actionItem.items && !actionItem.loading) {
|
|
17
17
|
collection = updateDeepTree(
|
|
@@ -23,7 +23,7 @@ export namespace TreeViewDemo {
|
|
|
23
23
|
callback(collection);
|
|
24
24
|
|
|
25
25
|
window.setTimeout(() => {
|
|
26
|
-
const newItems = subItems[actionItem.
|
|
26
|
+
const newItems = subItems[actionItem.id];
|
|
27
27
|
collection = updateDeepTree(
|
|
28
28
|
collection,
|
|
29
29
|
path,
|
|
@@ -44,7 +44,7 @@ export namespace TreeViewDemo {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export function onCloseItem(path: TreeViewItem
|
|
47
|
+
export function onCloseItem(path: TreeViewItem[], callback: (collection: TreeViewItem[]) => void) {
|
|
48
48
|
collection = updateDeepTree(
|
|
49
49
|
collection,
|
|
50
50
|
path,
|
|
@@ -54,12 +54,44 @@ export namespace TreeViewDemo {
|
|
|
54
54
|
callback(collection);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
export function onClickItem(path: TreeViewItem[], originalEvent: MouseEvent, callback: (collection: TreeViewItem[]) => void) {
|
|
58
|
+
const currentItem = path.length > 0 ? path[path.length - 1] : null;
|
|
59
|
+
|
|
60
|
+
// demo click behaviour: hrefs with wiki:[subject] will open the wikipedia page about [subject] in a new window
|
|
61
|
+
if (currentItem && currentItem?.href?.slice(0, 5) === 'wiki:') {
|
|
62
|
+
window.open(`https://nl.wikipedia.org/wiki/${currentItem.href?.slice(5)}`, '_blank');
|
|
63
|
+
originalEvent.preventDefault();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// set active = false for all items except current item
|
|
67
|
+
collection = updateTree(collection, item => ({ ...item, active: item.id === currentItem?.id }));
|
|
68
|
+
|
|
69
|
+
callback(collection);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function onFilter(value: string, callback: (collection: TreeViewItem[], resultText: string) => void): void {
|
|
73
|
+
// set selected = false for all items except when value is not empty and label contains text value
|
|
74
|
+
collection = updateTree(collection, item => ({ ...item, selected: !!value && item.label.toLowerCase().indexOf(value.toLowerCase()) > -1 }));
|
|
75
|
+
|
|
76
|
+
const itemCount = openItems(collection, false);
|
|
77
|
+
|
|
78
|
+
const resultText = `${(itemCount > 0 ? itemCount : 'geen')} resulta${(itemCount === 1 ? 'at' : 'ten')} gevonden ${(value ? ` voor "${value}"` : '')}`;
|
|
79
|
+
|
|
80
|
+
callback(collection, resultText);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Updates a single item in a tree view item collection.
|
|
85
|
+
* @param collection {TreeViewItem[]} the collection
|
|
86
|
+
* @param path {TreeViewItem[]} the path to the item that will be changed
|
|
87
|
+
* @param updater the updater function
|
|
88
|
+
*/
|
|
57
89
|
function updateDeepTree(
|
|
58
|
-
collection: TreeViewItem
|
|
59
|
-
path: TreeViewItem
|
|
60
|
-
updater: (item: TreeViewItem
|
|
61
|
-
): TreeViewItem
|
|
62
|
-
const item = collection.find(item => item.
|
|
90
|
+
collection: TreeViewItem[],
|
|
91
|
+
path: TreeViewItem[],
|
|
92
|
+
updater: (item: TreeViewItem) => TreeViewItem
|
|
93
|
+
): TreeViewItem[] {
|
|
94
|
+
const item = collection.find(item => item.id === path[0].id);
|
|
63
95
|
|
|
64
96
|
return collection.map(root => {
|
|
65
97
|
if (root !== item) {
|
|
@@ -80,4 +112,55 @@ export namespace TreeViewDemo {
|
|
|
80
112
|
throw new Error('Updating items collection encountered an error.');
|
|
81
113
|
});
|
|
82
114
|
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Updates all items in a tree view item collection.
|
|
118
|
+
* @param collection {TreeViewItem[]} the collection
|
|
119
|
+
* @param updater the updater function
|
|
120
|
+
*/
|
|
121
|
+
function updateTree(
|
|
122
|
+
collection: TreeViewItem[],
|
|
123
|
+
updater: (item: TreeViewItem) => TreeViewItem
|
|
124
|
+
): TreeViewItem[] {
|
|
125
|
+
|
|
126
|
+
return collection.map(root => {
|
|
127
|
+
const item = updater(root);
|
|
128
|
+
return {
|
|
129
|
+
...item,
|
|
130
|
+
items: item.items ? updateTree(item.items, updater) : item.items
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Opens all items in a tree view item collection that has a descendant with selected state.
|
|
137
|
+
* @param collection {TreeViewItem[]} the collection
|
|
138
|
+
* @param collapse {boolean} if true items with no selected descendants will be closed
|
|
139
|
+
*/
|
|
140
|
+
function openItems(
|
|
141
|
+
collection: TreeViewItem[],
|
|
142
|
+
collapse: boolean
|
|
143
|
+
): number {
|
|
144
|
+
const flatten = (data: any, level: number) => data ? data.flatMap((item: any) => ([{ level, item}, ...flatten(item.items, level + 1)])) : [];
|
|
145
|
+
|
|
146
|
+
const list: Array<{ level: number, item: TreeViewItem }> = flatten(collection, 0).reverse();
|
|
147
|
+
|
|
148
|
+
let levelOpen: boolean[] = [];
|
|
149
|
+
|
|
150
|
+
list.forEach(row => {
|
|
151
|
+
if (levelOpen[row.level + 1]) {
|
|
152
|
+
row.item.open = true;
|
|
153
|
+
levelOpen[row.level + 1] = false;
|
|
154
|
+
}
|
|
155
|
+
else if (collapse) {
|
|
156
|
+
row.item.open = false;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (row.item.selected || row.item.open) {
|
|
160
|
+
levelOpen[row.level] = true;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
return list.filter(row => row.item.selected).length;
|
|
165
|
+
}
|
|
83
166
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface TreeViewItem
|
|
2
|
-
/** The
|
|
3
|
-
|
|
1
|
+
export interface TreeViewItem {
|
|
2
|
+
/** The id of the item */
|
|
3
|
+
id: string;
|
|
4
4
|
/** The label of the item */
|
|
5
5
|
label: string;
|
|
6
6
|
/** The optional href of the item (creates a link) */
|
|
@@ -8,11 +8,15 @@ export interface TreeViewItem<T> {
|
|
|
8
8
|
/** Indicates whether the item has children */
|
|
9
9
|
hasItems: boolean;
|
|
10
10
|
/** The array of child items */
|
|
11
|
-
items?: TreeViewItem
|
|
11
|
+
items?: TreeViewItem[];
|
|
12
12
|
/** Indicates whether the node is open and child items are shown */
|
|
13
13
|
open?: boolean;
|
|
14
14
|
/** Indicates the node is loading child items */
|
|
15
15
|
loading?: boolean;
|
|
16
|
+
/** Indicates the node is active, only one item should be active */
|
|
17
|
+
active?: boolean;
|
|
18
|
+
/** Indicates the node is selected, multiple items can be selected */
|
|
19
|
+
selected?: boolean;
|
|
16
20
|
/** An optional array of icons */
|
|
17
21
|
icons?: TreeViewItemIcon[];
|
|
18
22
|
}
|
|
@@ -24,12 +28,19 @@ export interface TreeViewItemIcon {
|
|
|
24
28
|
label: string;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
|
-
export interface
|
|
28
|
-
|
|
31
|
+
export interface TreeViewPointerEvent {
|
|
32
|
+
/** The path to the clicked item */
|
|
33
|
+
path: TreeViewItem[],
|
|
34
|
+
/** The original pointer event */
|
|
35
|
+
originalEvent: MouseEvent
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface TreeView {
|
|
39
|
+
collection: TreeViewItem[];
|
|
29
40
|
/** Emitted when a node is opened */
|
|
30
|
-
onOpenItem: (e: CustomEvent<TreeViewItem
|
|
41
|
+
onOpenItem: (e: CustomEvent<TreeViewItem[]>) => void;
|
|
31
42
|
/** Emitted when a node is closed */
|
|
32
|
-
onCloseItem: (e: CustomEvent<TreeViewItem
|
|
43
|
+
onCloseItem: (e: CustomEvent<TreeViewItem[]>) => void;
|
|
33
44
|
/** Emitted when an item is clicked */
|
|
34
|
-
onClickItem: (e: CustomEvent<
|
|
45
|
+
onClickItem: (e: CustomEvent<TreeViewPointerEvent>) => void;
|
|
35
46
|
}
|
|
@@ -7,10 +7,11 @@ import { TreeViewItem } from './tree-view.models';
|
|
|
7
7
|
|
|
8
8
|
export interface TreeViewParameters<TemplateFnReturnType> {
|
|
9
9
|
treeViewDemoTemplate: (
|
|
10
|
-
collection: TreeViewItem
|
|
11
|
-
onOpenItem: (path: TreeViewItem
|
|
12
|
-
onCloseItem: (path: TreeViewItem
|
|
13
|
-
onClickItem: (path: TreeViewItem
|
|
10
|
+
collection: TreeViewItem[],
|
|
11
|
+
onOpenItem: (path: TreeViewItem[], callback: (collection: TreeViewItem[]) => void) => void,
|
|
12
|
+
onCloseItem: (path: TreeViewItem[], callback: (collection: TreeViewItem[]) => void) => void,
|
|
13
|
+
onClickItem: (path: TreeViewItem[], originalEvent: MouseEvent, callback: (collection: TreeViewItem[]) => void) => void,
|
|
14
|
+
onFilterInput: (text: string, callback: (collection: TreeViewItem[], resultText: string) => void) => void,
|
|
14
15
|
) => TemplateFnReturnType;
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -48,7 +49,17 @@ export function storiesOfTreeView<TemplateFnReturnType>(
|
|
|
48
49
|
|
|
49
50
|
const args = a as TreeViewArgs;
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
const click = (path: TreeViewItem[], originalEvent: MouseEvent, callback: (collection: TreeViewItem[]) => void) => {
|
|
53
|
+
args.onClickItem(path, originalEvent, callback);
|
|
54
|
+
TreeViewDemo.onClickItem(path, originalEvent, callback);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return treeViewDemoTemplate(
|
|
58
|
+
TreeViewDemo.collection,
|
|
59
|
+
TreeViewDemo.onOpenItem,
|
|
60
|
+
TreeViewDemo.onCloseItem,
|
|
61
|
+
click,
|
|
62
|
+
TreeViewDemo.onFilter);
|
|
52
63
|
}
|
|
53
64
|
);
|
|
54
65
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dso-toolkit",
|
|
3
3
|
"description": "DSO Toolkit and Component Library",
|
|
4
4
|
"license": "SEE LICENSE IN DISCLAIMER.txt",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "33.0.0",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "gulp",
|
|
8
8
|
"build": "gulp build",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@babel/core": "^7.15.8",
|
|
22
22
|
"@babel/preset-env": "^7.15.8",
|
|
23
|
-
"@dso-toolkit/core": "
|
|
23
|
+
"@dso-toolkit/core": "33.0.0",
|
|
24
24
|
"@dso-toolkit/css": "0.0.0",
|
|
25
25
|
"@dso-toolkit/sources": "0.0.0",
|
|
26
26
|
"@frctl/fractal": "1.5.11",
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
<button type="button" class="dso-tertiary"><span class="sr-only">Aantal verlagen</span>
|
|
208
208
|
<dso-icon icon="minus-square"></dso-icon>
|
|
209
209
|
</button>
|
|
210
|
-
<input type="number" id="in-stand-houden-van-bouwwerken" readonly tabindex="-1" class="dso-input-step-counter" value="0">
|
|
210
|
+
<input type="number" id="in-stand-houden-van-bouwwerken" readonly tabindex="-1" aria-label="Aantal" class="dso-input-step-counter" value="0">
|
|
211
211
|
<button type="button" class="dso-tertiary"><span class="sr-only">Aantal verhogen</span>
|
|
212
212
|
<dso-icon icon="plus-square"></dso-icon>
|
|
213
213
|
</button>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<button type="button" class="dso-tertiary"><span class="sr-only">Aantal verlagen</span>
|
|
10
10
|
<dso-icon icon="minus-square"></dso-icon>
|
|
11
11
|
</button>
|
|
12
|
-
<input type="number" id="maximum-limit" readonly tabindex="-1" class="dso-input-step-counter" value="99">
|
|
12
|
+
<input type="number" id="maximum-limit" readonly tabindex="-1" max="99" class="dso-input-step-counter" value="99">
|
|
13
13
|
<button type="button" disabled class="dso-tertiary"><span class="sr-only">Aantal verhogen (disabled)</span>
|
|
14
14
|
<dso-icon icon="plus-square"></dso-icon>
|
|
15
15
|
</button>
|