@dso-toolkit/core 38.1.1 → 40.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.
- package/dist/cjs/dso-badge.cjs.entry.js +1 -1
- package/dist/cjs/dso-date-picker.cjs.entry.js +25 -10
- package/dist/cjs/dso-header.cjs.entry.js +3 -2
- package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
- package/dist/cjs/dso-map-base-layers.cjs.entry.js +3 -1
- package/dist/cjs/dso-map-controls.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-overlays.cjs.entry.js +3 -1
- package/dist/cjs/dso-ozon-content.cjs.entry.js +1 -1
- package/dist/cjs/dso-pagination.cjs.entry.js +38 -0
- package/dist/cjs/dso-responsive-element.cjs.entry.js +44 -0
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/dso-tooltip.cjs.entry.js +40 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/badge/badge.css +1 -1
- package/dist/collection/components/date-picker/date-picker.js +25 -10
- package/dist/collection/components/header/header.js +21 -2
- package/dist/collection/components/image-overlay/image-overlay.template.js +1 -1
- package/dist/collection/components/map-base-layers/map-base-layers.js +21 -1
- package/dist/collection/components/map-controls/map-controls.css +1 -1
- package/dist/collection/components/map-overlays/map-overlays.js +21 -1
- package/dist/collection/components/ozon-content/ozon-content.js +4 -1
- package/dist/collection/components/ozon-content/ozon-content.template.js +3 -3
- package/dist/collection/components/pagination/pagination.css +68 -0
- package/dist/collection/components/pagination/pagination.interfaces.js +1 -0
- package/dist/collection/components/pagination/pagination.js +114 -0
- package/dist/collection/components/pagination/pagination.template.js +11 -0
- package/dist/collection/components/responsive-element/responsive-element.css +3 -0
- package/dist/collection/components/responsive-element/responsive-element.js +46 -0
- package/dist/collection/components/responsive-element/responsive-element.template.js +8 -0
- package/dist/collection/components/selectable/selectable.js +5 -4
- package/dist/collection/components/tooltip/tooltip.js +60 -0
- package/dist/collection/components/viewer-grid/example-pages/viewer-grid-document-header.example-template.js +22 -0
- package/dist/collection/components/viewer-grid/example-pages/viewer-grid-document-list.example-template.js +12 -0
- package/dist/collection/components/viewer-grid/example-pages/viewer-grid-filterblok.example-template.js +60 -0
- package/dist/collection/components/viewer-grid/example-pages/viewer-grid-tiles.example-template.js +17 -0
- package/dist/collection/components/viewer-grid/templates/viewer-grid.template.js +20 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +159 -26
- package/dist/dso-toolkit/dso-toolkit.css +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-02272301.entry.js +1 -0
- package/dist/dso-toolkit/p-0777c1c4.entry.js +1 -0
- package/dist/dso-toolkit/p-09b53589.entry.js +1 -0
- package/dist/dso-toolkit/p-202bd676.entry.js +1 -0
- package/dist/dso-toolkit/p-336bf5b9.entry.js +1 -0
- package/dist/dso-toolkit/{p-150fe323.entry.js → p-37e12c3c.entry.js} +1 -1
- package/dist/dso-toolkit/p-3ad06d9d.entry.js +1 -0
- package/dist/dso-toolkit/p-4a41728e.entry.js +1 -0
- package/dist/dso-toolkit/{p-6ec616ee.entry.js → p-60679db4.entry.js} +1 -1
- package/dist/dso-toolkit/{p-1894c7ae.entry.js → p-7796687c.entry.js} +1 -1
- package/dist/dso-toolkit/{p-a8cf15cf.entry.js → p-f1026921.entry.js} +1 -1
- package/dist/esm/dso-badge.entry.js +1 -1
- package/dist/esm/dso-date-picker.entry.js +25 -10
- package/dist/esm/dso-header.entry.js +3 -2
- package/dist/esm/dso-info_2.entry.js +2 -2
- package/dist/esm/dso-map-base-layers.entry.js +3 -1
- package/dist/esm/dso-map-controls.entry.js +1 -1
- package/dist/esm/dso-map-overlays.entry.js +3 -1
- package/dist/esm/dso-ozon-content.entry.js +2 -2
- package/dist/esm/dso-pagination.entry.js +34 -0
- package/dist/esm/dso-responsive-element.entry.js +40 -0
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/dso-tooltip.entry.js +40 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/header/header.d.ts +7 -0
- package/dist/types/components/map-base-layers/map-base-layers.d.ts +1 -0
- package/dist/types/components/map-overlays/map-overlays.d.ts +1 -0
- package/dist/types/components/ozon-content/ozon-content.template.d.ts +1 -1
- package/dist/types/components/pagination/pagination.d.ts +22 -0
- package/dist/types/components/pagination/pagination.interfaces.d.ts +6 -0
- package/dist/types/components/pagination/pagination.template.d.ts +2 -0
- package/dist/types/components/responsive-element/responsive-element.d.ts +10 -0
- package/dist/types/components/responsive-element/responsive-element.template.d.ts +3 -0
- package/dist/types/components/tooltip/tooltip.d.ts +6 -0
- package/dist/types/components/viewer-grid/example-pages/viewer-grid-document-header.example-template.d.ts +2 -0
- package/dist/types/components/viewer-grid/example-pages/viewer-grid-document-list.example-template.d.ts +2 -0
- package/dist/types/components/viewer-grid/example-pages/viewer-grid-filterblok.example-template.d.ts +1 -0
- package/dist/types/components/viewer-grid/example-pages/viewer-grid-tiles.example-template.d.ts +2 -0
- package/dist/types/components/viewer-grid/templates/viewer-grid.template.d.ts +3 -0
- package/dist/types/components.d.ts +72 -1
- package/package.json +10 -10
- package/dist/collection/components/viewer-grid/viewer-grid-document-header.template.js +0 -39
- package/dist/collection/components/viewer-grid/viewer-grid-document-list-item.template.js +0 -19
- package/dist/collection/components/viewer-grid/viewer-grid-filterblok.template.js +0 -28
- package/dist/collection/components/viewer-grid/viewer-grid.template.js +0 -31
- package/dist/dso-toolkit/p-746d70f9.entry.js +0 -1
- package/dist/dso-toolkit/p-7abe091d.entry.js +0 -1
- package/dist/dso-toolkit/p-8bb8148f.entry.js +0 -1
- package/dist/dso-toolkit/p-c32860a3.entry.js +0 -1
- package/dist/dso-toolkit/p-d76c1151.entry.js +0 -1
- package/dist/types/components/viewer-grid/viewer-grid-document-header.template.d.ts +0 -3
- package/dist/types/components/viewer-grid/viewer-grid-document-list-item.template.d.ts +0 -3
- package/dist/types/components/viewer-grid/viewer-grid-filterblok.template.d.ts +0 -3
- package/dist/types/components/viewer-grid/viewer-grid.template.d.ts +0 -3
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Component, h, Prop, Event } from '@stencil/core';
|
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
3
|
export class MapBaseLayers {
|
|
3
4
|
constructor() {
|
|
4
5
|
this.selectableRefs = {};
|
|
6
|
+
this.group = uuidv4();
|
|
5
7
|
}
|
|
6
8
|
baseLayerChangeHandler(baseLayer) {
|
|
7
9
|
this.baseLayerChange.emit({ activeBaseLayer: baseLayer });
|
|
@@ -23,7 +25,7 @@ export class MapBaseLayers {
|
|
|
23
25
|
h("legend", { class: "sr-only" }, "Achtergrond"),
|
|
24
26
|
h("div", { class: "dso-label-container" },
|
|
25
27
|
h("span", { class: "control-label", "aria-hidden": "true" }, "Achtergrond")),
|
|
26
|
-
h("div", { class: "dso-field-container" }, this.baseLayers.map(baseLayer => (h("dso-selectable", { key: baseLayer.id, type: "radio", value: baseLayer.name, checked: baseLayer.checked, disabled: baseLayer.disabled, ref: ref => this.selectableRefs[baseLayer.id] = ref, onDsoChange: () => this.baseLayerChangeHandler(baseLayer) },
|
|
28
|
+
h("div", { class: "dso-field-container" }, this.baseLayers.map(baseLayer => (h("dso-selectable", { key: baseLayer.id, type: "radio", value: baseLayer.name, checked: baseLayer.checked, disabled: baseLayer.disabled, name: this.group, ref: ref => this.selectableRefs[baseLayer.id] = ref, onDsoChange: () => this.baseLayerChangeHandler(baseLayer) },
|
|
27
29
|
baseLayer.name,
|
|
28
30
|
baseLayer.info
|
|
29
31
|
? h("p", { slot: "info" }, baseLayer.info)
|
|
@@ -38,6 +40,24 @@ export class MapBaseLayers {
|
|
|
38
40
|
"$": ["map-base-layers.css"]
|
|
39
41
|
}; }
|
|
40
42
|
static get properties() { return {
|
|
43
|
+
"group": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"mutable": false,
|
|
46
|
+
"complexType": {
|
|
47
|
+
"original": "string",
|
|
48
|
+
"resolved": "string",
|
|
49
|
+
"references": {}
|
|
50
|
+
},
|
|
51
|
+
"required": false,
|
|
52
|
+
"optional": false,
|
|
53
|
+
"docs": {
|
|
54
|
+
"tags": [],
|
|
55
|
+
"text": ""
|
|
56
|
+
},
|
|
57
|
+
"attribute": "group",
|
|
58
|
+
"reflect": false,
|
|
59
|
+
"defaultValue": "uuidv4()"
|
|
60
|
+
},
|
|
41
61
|
"baseLayers": {
|
|
42
62
|
"type": "unknown",
|
|
43
63
|
"mutable": false,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Component, Event, Prop, h } from '@stencil/core';
|
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
3
|
export class MapOverlays {
|
|
3
4
|
constructor() {
|
|
4
5
|
this.selectableRefs = {};
|
|
6
|
+
this.group = uuidv4();
|
|
5
7
|
}
|
|
6
8
|
overlayChangeHandler(overlay, e) {
|
|
7
9
|
const checked = e.detail.target instanceof HTMLInputElement ? !!e.detail.target.checked : false;
|
|
@@ -24,7 +26,7 @@ export class MapOverlays {
|
|
|
24
26
|
h("legend", { class: "sr-only" }, "Kaartlagen"),
|
|
25
27
|
h("div", { class: "dso-label-container" },
|
|
26
28
|
h("span", { class: "control-label", "aria-hidden": "true" }, "Kaartlagen")),
|
|
27
|
-
h("div", { class: "dso-field-container" }, this.overlays.map(overlay => (h("dso-selectable", { key: overlay.id, type: "checkbox", value: overlay.name, checked: overlay.checked, disabled: overlay.disabled, ref: ref => this.selectableRefs[overlay.id] = ref, onDsoChange: e => this.overlayChangeHandler(overlay, e) },
|
|
29
|
+
h("div", { class: "dso-field-container" }, this.overlays.map(overlay => (h("dso-selectable", { key: overlay.id, type: "checkbox", value: overlay.name, checked: overlay.checked, disabled: overlay.disabled, name: this.group, ref: ref => this.selectableRefs[overlay.id] = ref, onDsoChange: e => this.overlayChangeHandler(overlay, e) },
|
|
28
30
|
overlay.name,
|
|
29
31
|
overlay.info
|
|
30
32
|
? h("p", { slot: "info" }, overlay.info)
|
|
@@ -39,6 +41,24 @@ export class MapOverlays {
|
|
|
39
41
|
"$": ["map-overlays.css"]
|
|
40
42
|
}; }
|
|
41
43
|
static get properties() { return {
|
|
44
|
+
"group": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"mutable": false,
|
|
47
|
+
"complexType": {
|
|
48
|
+
"original": "string",
|
|
49
|
+
"resolved": "string",
|
|
50
|
+
"references": {}
|
|
51
|
+
},
|
|
52
|
+
"required": false,
|
|
53
|
+
"optional": false,
|
|
54
|
+
"docs": {
|
|
55
|
+
"tags": [],
|
|
56
|
+
"text": ""
|
|
57
|
+
},
|
|
58
|
+
"attribute": "group",
|
|
59
|
+
"reflect": false,
|
|
60
|
+
"defaultValue": "uuidv4()"
|
|
61
|
+
},
|
|
42
62
|
"overlays": {
|
|
43
63
|
"type": "unknown",
|
|
44
64
|
"mutable": false,
|
|
@@ -44,7 +44,10 @@ export class OzonContent {
|
|
|
44
44
|
transformed,
|
|
45
45
|
h("span", { class: "deleted-end" }, "Einde verwijderd element")));
|
|
46
46
|
}
|
|
47
|
-
return (h(Host, { onClick: (e) => this.handleHostOnClick(e) },
|
|
47
|
+
return (h(Host, { onClick: (e) => this.handleHostOnClick(e) },
|
|
48
|
+
h("slot", { name: "prefix" }),
|
|
49
|
+
transformed,
|
|
50
|
+
h("slot", { name: "suffix" })));
|
|
48
51
|
}
|
|
49
52
|
static get is() { return "dso-ozon-content"; }
|
|
50
53
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { html } from 'lit-html';
|
|
1
|
+
import { html, nothing } from 'lit-html';
|
|
2
2
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
|
-
export function ozonContentTemplate({ content, inline, interactive, deleted, onAnchorClick, onClick }) {
|
|
3
|
+
export function ozonContentTemplate({ content, inline, interactive, deleted, prefix, suffix, onAnchorClick, onClick }) {
|
|
4
4
|
return html `
|
|
5
5
|
<dso-ozon-content
|
|
6
6
|
.content=${content}
|
|
@@ -9,6 +9,6 @@ export function ozonContentTemplate({ content, inline, interactive, deleted, onA
|
|
|
9
9
|
?deleted=${deleted}
|
|
10
10
|
@anchorClick=${onAnchorClick}
|
|
11
11
|
@dsoClick=${ifDefined(interactive ? onClick : undefined)}
|
|
12
|
-
|
|
12
|
+
>${prefix ? html `<span slot="prefix">${prefix}</span>` : nothing}${suffix ? html `<span slot="suffix">${suffix}</span>` : nothing}</dso-ozon-content>
|
|
13
13
|
`;
|
|
14
14
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
*,
|
|
6
|
+
*::after,
|
|
7
|
+
*::before {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.pagination {
|
|
12
|
+
text-align: center;
|
|
13
|
+
}
|
|
14
|
+
.pagination > li {
|
|
15
|
+
display: inline-block;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
line-height: 28px;
|
|
18
|
+
text-align: center;
|
|
19
|
+
vertical-align: middle;
|
|
20
|
+
}
|
|
21
|
+
.pagination > li > a,
|
|
22
|
+
.pagination > li > span {
|
|
23
|
+
align-items: center;
|
|
24
|
+
color: #39870c;
|
|
25
|
+
display: flex;
|
|
26
|
+
height: 32px;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
position: relative;
|
|
29
|
+
width: 32px;
|
|
30
|
+
}
|
|
31
|
+
.pagination > li > a:active,
|
|
32
|
+
.pagination > li > span:active {
|
|
33
|
+
background-color: #ebf3e6;
|
|
34
|
+
}
|
|
35
|
+
.pagination > li > span {
|
|
36
|
+
border: 2px solid transparent;
|
|
37
|
+
border-radius: 50%;
|
|
38
|
+
}
|
|
39
|
+
.pagination > li a {
|
|
40
|
+
line-height: 32px;
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
}
|
|
43
|
+
.pagination > li a:hover, .pagination > li a:focus {
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
}
|
|
46
|
+
.pagination > li a:hover::after, .pagination > li a:focus::after {
|
|
47
|
+
border-bottom-color: #39870c;
|
|
48
|
+
}
|
|
49
|
+
.pagination > li a::after {
|
|
50
|
+
border-bottom: 3px solid transparent;
|
|
51
|
+
bottom: 0;
|
|
52
|
+
content: "";
|
|
53
|
+
display: inline-block;
|
|
54
|
+
left: 0;
|
|
55
|
+
position: absolute;
|
|
56
|
+
width: 100%;
|
|
57
|
+
}
|
|
58
|
+
.pagination > li.active span {
|
|
59
|
+
background-color: #39870c;
|
|
60
|
+
color: #fff;
|
|
61
|
+
}
|
|
62
|
+
.pagination > li + li {
|
|
63
|
+
margin-left: 8px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.dso-page-hidden {
|
|
67
|
+
visibility: hidden;
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { h, Component, Event, Prop } from '@stencil/core';
|
|
2
|
+
export class Pagination {
|
|
3
|
+
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* This function is called to format the href
|
|
6
|
+
*/
|
|
7
|
+
this.formatHref = (page) => '#' + page;
|
|
8
|
+
}
|
|
9
|
+
clickHandler(e, page) {
|
|
10
|
+
if (e.button !== 0 || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
this.selectPage.emit({ originalEvent: e, page });
|
|
15
|
+
}
|
|
16
|
+
;
|
|
17
|
+
render() {
|
|
18
|
+
if (!this.totalPages) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const pages = Array.from({ length: this.totalPages }, (_value, i) => i + 1);
|
|
22
|
+
return (h("ul", { class: "pagination" },
|
|
23
|
+
h("li", { class: this.currentPage === pages[0] ? 'dso-page-hidden' : undefined },
|
|
24
|
+
h("a", { href: this.formatHref(pages[0]), "aria-label": "Vorige", onClick: e => this.clickHandler(e, pages[0]) },
|
|
25
|
+
h("dso-icon", { icon: "chevron-left" }))),
|
|
26
|
+
pages.map(page => (h("li", { key: page, class: this.currentPage === page ? 'active' : undefined }, this.currentPage === page
|
|
27
|
+
? (h("span", { "aria-current": "page" }, page))
|
|
28
|
+
: (h("a", { href: this.formatHref(page), onClick: e => this.clickHandler(e, page) }, page))))),
|
|
29
|
+
h("li", { class: this.currentPage === pages[pages.length - 1] ? 'dso-page-hidden' : undefined },
|
|
30
|
+
h("a", { href: this.formatHref(pages[pages.length - 1]), "aria-label": "Volgende", onClick: e => this.clickHandler(e, pages[pages.length - 1]) },
|
|
31
|
+
h("dso-icon", { icon: "chevron-right" })))));
|
|
32
|
+
}
|
|
33
|
+
static get is() { return "dso-pagination"; }
|
|
34
|
+
static get encapsulation() { return "shadow"; }
|
|
35
|
+
static get originalStyleUrls() { return {
|
|
36
|
+
"$": ["pagination.scss"]
|
|
37
|
+
}; }
|
|
38
|
+
static get styleUrls() { return {
|
|
39
|
+
"$": ["pagination.css"]
|
|
40
|
+
}; }
|
|
41
|
+
static get properties() { return {
|
|
42
|
+
"totalPages": {
|
|
43
|
+
"type": "number",
|
|
44
|
+
"mutable": false,
|
|
45
|
+
"complexType": {
|
|
46
|
+
"original": "number",
|
|
47
|
+
"resolved": "number | undefined",
|
|
48
|
+
"references": {}
|
|
49
|
+
},
|
|
50
|
+
"required": false,
|
|
51
|
+
"optional": true,
|
|
52
|
+
"docs": {
|
|
53
|
+
"tags": [],
|
|
54
|
+
"text": "Total pages"
|
|
55
|
+
},
|
|
56
|
+
"attribute": "total-pages",
|
|
57
|
+
"reflect": false
|
|
58
|
+
},
|
|
59
|
+
"currentPage": {
|
|
60
|
+
"type": "number",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "number",
|
|
64
|
+
"resolved": "number | undefined",
|
|
65
|
+
"references": {}
|
|
66
|
+
},
|
|
67
|
+
"required": false,
|
|
68
|
+
"optional": true,
|
|
69
|
+
"docs": {
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": "Current page"
|
|
72
|
+
},
|
|
73
|
+
"attribute": "current-page",
|
|
74
|
+
"reflect": false
|
|
75
|
+
},
|
|
76
|
+
"formatHref": {
|
|
77
|
+
"type": "unknown",
|
|
78
|
+
"mutable": false,
|
|
79
|
+
"complexType": {
|
|
80
|
+
"original": "(page: number) => string",
|
|
81
|
+
"resolved": "(page: number) => string",
|
|
82
|
+
"references": {}
|
|
83
|
+
},
|
|
84
|
+
"required": false,
|
|
85
|
+
"optional": false,
|
|
86
|
+
"docs": {
|
|
87
|
+
"tags": [],
|
|
88
|
+
"text": "This function is called to format the href"
|
|
89
|
+
},
|
|
90
|
+
"defaultValue": "(page) => '#' + page"
|
|
91
|
+
}
|
|
92
|
+
}; }
|
|
93
|
+
static get events() { return [{
|
|
94
|
+
"method": "selectPage",
|
|
95
|
+
"name": "selectPage",
|
|
96
|
+
"bubbles": true,
|
|
97
|
+
"cancelable": true,
|
|
98
|
+
"composed": true,
|
|
99
|
+
"docs": {
|
|
100
|
+
"tags": [],
|
|
101
|
+
"text": "Emitted on page select"
|
|
102
|
+
},
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "PaginationSelectPageEvent",
|
|
105
|
+
"resolved": "PaginationSelectPageEvent",
|
|
106
|
+
"references": {
|
|
107
|
+
"PaginationSelectPageEvent": {
|
|
108
|
+
"location": "import",
|
|
109
|
+
"path": "./pagination.interfaces"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}]; }
|
|
114
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
export function paginationTemplate({ totalPages, currentPage, onSelectPage, formatHref, }) {
|
|
3
|
+
return html `
|
|
4
|
+
<dso-pagination
|
|
5
|
+
total-pages=${totalPages}
|
|
6
|
+
current-page=${currentPage}
|
|
7
|
+
.formatHref=${formatHref}
|
|
8
|
+
@selectPage=${onSelectPage}
|
|
9
|
+
></dso-pagination>
|
|
10
|
+
`;
|
|
11
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Component, Element, Host, State, h } from '@stencil/core';
|
|
2
|
+
const elementSizes = [
|
|
3
|
+
{
|
|
4
|
+
width: 624, alias: 'large'
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
width: 375, alias: 'medium'
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
width: 0, alias: 'small'
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
export class ResponsiveElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.sizeAlias = elementSizes[0].alias;
|
|
16
|
+
this.sizeWidth = 0;
|
|
17
|
+
this.observer = new ResizeObserver(([entry]) => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
const size = (_b = (_a = elementSizes.find(s => entry.contentRect.width >= s.width)) === null || _a === void 0 ? void 0 : _a.alias) !== null && _b !== void 0 ? _b : elementSizes[0].alias;
|
|
20
|
+
this.sizeAlias = size;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
componentWillLoad() {
|
|
24
|
+
this.observer.observe(this.host);
|
|
25
|
+
}
|
|
26
|
+
disconnectedCallback() {
|
|
27
|
+
this.observer.unobserve(this.host);
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return (h(Host, { small: this.sizeAlias === 'small', medium: this.sizeAlias === 'medium', large: this.sizeAlias === 'large' },
|
|
31
|
+
h("slot", null)));
|
|
32
|
+
}
|
|
33
|
+
static get is() { return "dso-responsive-element"; }
|
|
34
|
+
static get encapsulation() { return "shadow"; }
|
|
35
|
+
static get originalStyleUrls() { return {
|
|
36
|
+
"$": ["./responsive-element.scss"]
|
|
37
|
+
}; }
|
|
38
|
+
static get styleUrls() { return {
|
|
39
|
+
"$": ["responsive-element.css"]
|
|
40
|
+
}; }
|
|
41
|
+
static get states() { return {
|
|
42
|
+
"sizeAlias": {},
|
|
43
|
+
"sizeWidth": {}
|
|
44
|
+
}; }
|
|
45
|
+
static get elementRef() { return "host"; }
|
|
46
|
+
}
|
|
@@ -31,20 +31,21 @@ export class Selectable {
|
|
|
31
31
|
var _a;
|
|
32
32
|
const hasInfo = !!this.host.querySelector('[slot="info"]');
|
|
33
33
|
return (h(Fragment, null,
|
|
34
|
-
h("input", { type: this.type, id: this.getIdentifier(), value: this.value, name: this.name, "aria-invalid": (_a = this.invalid) === null || _a === void 0 ? void 0 : _a.toString(), "aria-describedby": this.describedById, disabled: this.disabled, required: this.required, checked: this.checked, onChange: e => this.change.emit(e), ref: (el) => this.input = el }),
|
|
34
|
+
h("input", { type: this.type, id: this.getIdentifier(), value: this.value, name: this.name, "aria-invalid": (_a = this.invalid) === null || _a === void 0 ? void 0 : _a.toString(), "aria-describedby": (hasInfo && this.infoFixed) ? this.describedById : undefined, disabled: this.disabled, required: this.required, checked: this.checked, onChange: e => this.change.emit(e), ref: (el) => this.input = el }),
|
|
35
35
|
h("label", { htmlFor: this.getIdentifier() },
|
|
36
36
|
h("slot", null)),
|
|
37
37
|
hasInfo && (h(Fragment, null,
|
|
38
38
|
!this.infoFixed && (h("dso-info-button", { active: this.infoActive, onToggle: e => this.infoActive = e.detail.active })),
|
|
39
|
-
h("dso-info", { fixed: this.infoFixed, active: this.infoActive, onClose: () => this.infoActive = false },
|
|
40
|
-
h("
|
|
39
|
+
h("dso-info", { id: (hasInfo && this.infoFixed) ? this.describedById : undefined, fixed: this.infoFixed, active: this.infoActive, onClose: () => this.infoActive = false },
|
|
40
|
+
h("div", null,
|
|
41
|
+
h("slot", { name: "info" })))))));
|
|
41
42
|
}
|
|
42
43
|
getIdentifier() {
|
|
43
44
|
var _a;
|
|
44
45
|
return (_a = this.identifier) !== null && _a !== void 0 ? _a : this.fallbackIdentifier;
|
|
45
46
|
}
|
|
46
47
|
static get is() { return "dso-selectable"; }
|
|
47
|
-
static get encapsulation() { return "
|
|
48
|
+
static get encapsulation() { return "scoped"; }
|
|
48
49
|
static get originalStyleUrls() { return {
|
|
49
50
|
"$": ["selectable.scss"]
|
|
50
51
|
}; }
|
|
@@ -4,6 +4,13 @@ import { h, Component, Element, Host, Listen, Method, Prop, State, Watch } from
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
// Keep const in sync with $tooltip-transition-duration in @dso-toolkit/sources/tooltip.scss tooltip_root() mixin
|
|
6
6
|
const transitionDuration = 150;
|
|
7
|
+
function hasOverflow(el) {
|
|
8
|
+
const style = window.getComputedStyle(el);
|
|
9
|
+
const overflowX = style.getPropertyValue('overflow-x');
|
|
10
|
+
const overflowY = style.getPropertyValue('overflow-y');
|
|
11
|
+
const overflowValues = ['hidden', 'clip'];
|
|
12
|
+
return overflowValues.indexOf(overflowX) != -1 || overflowValues.indexOf(overflowY) != -1;
|
|
13
|
+
}
|
|
7
14
|
export class Tooltip {
|
|
8
15
|
constructor() {
|
|
9
16
|
/**
|
|
@@ -14,6 +21,10 @@ export class Tooltip {
|
|
|
14
21
|
* Set position of tooltip relative to target
|
|
15
22
|
*/
|
|
16
23
|
this.position = 'top';
|
|
24
|
+
/**
|
|
25
|
+
* Set position strategy of tooltip
|
|
26
|
+
*/
|
|
27
|
+
this.strategy = 'auto';
|
|
17
28
|
/**
|
|
18
29
|
* Set attribute `no-arrow` to hide the arrow
|
|
19
30
|
*/
|
|
@@ -57,6 +68,33 @@ export class Tooltip {
|
|
|
57
68
|
placement: this.position
|
|
58
69
|
});
|
|
59
70
|
}
|
|
71
|
+
watchStrategy() {
|
|
72
|
+
this.setStrategy();
|
|
73
|
+
}
|
|
74
|
+
setStrategy() {
|
|
75
|
+
if (!this.popper) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (this.strategy == 'absolute' || this.strategy == 'fixed') {
|
|
79
|
+
this.popper.setOptions({
|
|
80
|
+
strategy: this.strategy,
|
|
81
|
+
});
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
let element = this.element;
|
|
85
|
+
while ((element === null || element === void 0 ? void 0 : element.parentNode) != null && element.parentNode != document) {
|
|
86
|
+
element = element.parentNode instanceof ShadowRoot ? element.parentNode.host : element.parentElement;
|
|
87
|
+
if (element != null && hasOverflow(element)) {
|
|
88
|
+
this.popper.setOptions({
|
|
89
|
+
strategy: 'fixed',
|
|
90
|
+
});
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
this.popper.setOptions({
|
|
95
|
+
strategy: 'absolute',
|
|
96
|
+
});
|
|
97
|
+
}
|
|
60
98
|
watchActive() {
|
|
61
99
|
var _a;
|
|
62
100
|
if (this.active) {
|
|
@@ -121,6 +159,7 @@ export class Tooltip {
|
|
|
121
159
|
}
|
|
122
160
|
componentDidRender() {
|
|
123
161
|
var _a;
|
|
162
|
+
this.setStrategy();
|
|
124
163
|
if (this.active) {
|
|
125
164
|
(_a = this.popper) === null || _a === void 0 ? void 0 : _a.update();
|
|
126
165
|
}
|
|
@@ -198,6 +237,24 @@ export class Tooltip {
|
|
|
198
237
|
"reflect": false,
|
|
199
238
|
"defaultValue": "'top'"
|
|
200
239
|
},
|
|
240
|
+
"strategy": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"mutable": false,
|
|
243
|
+
"complexType": {
|
|
244
|
+
"original": "'auto' | 'absolute' | 'fixed'",
|
|
245
|
+
"resolved": "\"absolute\" | \"auto\" | \"fixed\"",
|
|
246
|
+
"references": {}
|
|
247
|
+
},
|
|
248
|
+
"required": false,
|
|
249
|
+
"optional": false,
|
|
250
|
+
"docs": {
|
|
251
|
+
"tags": [],
|
|
252
|
+
"text": "Set position strategy of tooltip"
|
|
253
|
+
},
|
|
254
|
+
"attribute": "strategy",
|
|
255
|
+
"reflect": false,
|
|
256
|
+
"defaultValue": "'auto'"
|
|
257
|
+
},
|
|
201
258
|
"for": {
|
|
202
259
|
"type": "string",
|
|
203
260
|
"mutable": false,
|
|
@@ -331,6 +388,9 @@ export class Tooltip {
|
|
|
331
388
|
static get watchers() { return [{
|
|
332
389
|
"propName": "position",
|
|
333
390
|
"methodName": "watchPosition"
|
|
391
|
+
}, {
|
|
392
|
+
"propName": "strategy",
|
|
393
|
+
"methodName": "watchStrategy"
|
|
334
394
|
}, {
|
|
335
395
|
"propName": "active",
|
|
336
396
|
"methodName": "watchActive"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AlertType } from "@dso-toolkit/sources";
|
|
2
|
+
import { documentHeaderTemplate } from '@dso-toolkit/css/src/components/document-header/document-header.template';
|
|
3
|
+
import { status, features, statusContent } from '@dso-toolkit/css/src/components/document-header/document-header.content';
|
|
4
|
+
import { alertTemplate } from '../../alert/alert.template';
|
|
5
|
+
import { viewerGridTemplate } from '../templates/viewer-grid.template';
|
|
6
|
+
export function viewerGridDocumentHeaderExampleTemplate({ documentHeaderFeaturesOpen, documentHeaderFeatureAction, documentHeaderStatusOpen }) {
|
|
7
|
+
return viewerGridTemplate({
|
|
8
|
+
main: documentHeaderTemplate({
|
|
9
|
+
title: 'Omgevingsplan gemeente Gouda',
|
|
10
|
+
type: 'Een omgevingsplan waar de omgeving mooier van wordt',
|
|
11
|
+
owner: 'Gemeente Gouda',
|
|
12
|
+
features,
|
|
13
|
+
featureAction: documentHeaderFeatureAction,
|
|
14
|
+
featuresOpen: documentHeaderFeaturesOpen,
|
|
15
|
+
statusContentOpen: documentHeaderStatusOpen,
|
|
16
|
+
status: status(documentHeaderFeaturesOpen, documentHeaderFeatureAction),
|
|
17
|
+
statusContent
|
|
18
|
+
}),
|
|
19
|
+
map: alertTemplate({ message: 'Dit is de kaart', status: AlertType.Info })
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AlertType } from "@dso-toolkit/sources";
|
|
2
|
+
import { documentListStatusDemoContentMapper } from '@dso-toolkit/css/src/components/document-list/document-list.mapper';
|
|
3
|
+
import { documentListTemplate } from '@dso-toolkit/css/src/components/document-list/document-list.template';
|
|
4
|
+
import { alertTemplate } from "../../alert/alert.template";
|
|
5
|
+
import { viewerGridTemplate } from '../templates/viewer-grid.template';
|
|
6
|
+
export function viewerGridDocumentListExampleTemplate(documentList) {
|
|
7
|
+
return viewerGridTemplate({
|
|
8
|
+
main: documentListTemplate({ items: documentList.items.map(item => (Object.assign(Object.assign({}, item), { status: documentListStatusDemoContentMapper(item.status) }))) }),
|
|
9
|
+
map: alertTemplate({ message: 'Dit is de kaart', status: AlertType.Info })
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AlertType } from "@dso-toolkit/sources";
|
|
2
|
+
import { html } from "lit-html";
|
|
3
|
+
import { alertTemplate } from "../../alert/alert.template";
|
|
4
|
+
import { buttonTemplate } from "../../button/button.template";
|
|
5
|
+
import { contextTemplate } from "../../context/context.template";
|
|
6
|
+
import { labelGroupTemplate } from "../../label-group/label-group.template";
|
|
7
|
+
import { viewerGridTemplate } from "../templates/viewer-grid.template";
|
|
8
|
+
export function viewerGridFilterblokExampleTemplate() {
|
|
9
|
+
const activeFilters = [
|
|
10
|
+
{
|
|
11
|
+
label: "Geldend",
|
|
12
|
+
status: "bright",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: "Regels",
|
|
16
|
+
status: "bright",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: "Tuin",
|
|
20
|
+
status: "bright",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: "Woongebied",
|
|
24
|
+
status: "bright",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "Geluidzone",
|
|
28
|
+
status: "bright",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "Thema: milieu algemeen",
|
|
32
|
+
status: "bright",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
return viewerGridTemplate({
|
|
36
|
+
main: html `
|
|
37
|
+
<section class="dso-filterblok">
|
|
38
|
+
<div class="dso-highlight-box">
|
|
39
|
+
${contextTemplate({
|
|
40
|
+
type: "label",
|
|
41
|
+
label: html `<h3>Uw keuzes</h3>`,
|
|
42
|
+
content: buttonTemplate({
|
|
43
|
+
variant: "tertiary",
|
|
44
|
+
label: "Alle opties",
|
|
45
|
+
icon: {
|
|
46
|
+
icon: "pencil",
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
children: html `
|
|
50
|
+
<p class="dso-filterblok-address">Achterwillenseweg 9a, Gouda</p>
|
|
51
|
+
${labelGroupTemplate({ labels: activeFilters })}
|
|
52
|
+
`,
|
|
53
|
+
})}
|
|
54
|
+
</div>
|
|
55
|
+
</section>
|
|
56
|
+
`,
|
|
57
|
+
map: alertTemplate({ message: 'Dit is de kaart', status: AlertType.Info })
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
;
|
package/dist/collection/components/viewer-grid/example-pages/viewer-grid-tiles.example-template.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AlertType } from "@dso-toolkit/sources";
|
|
2
|
+
import { html } from "lit-html";
|
|
3
|
+
import { alertTemplate } from "../../alert/alert.template";
|
|
4
|
+
import { tileGridTemplate } from "@dso-toolkit/css/src/components/tile-grid/tile-grid.template";
|
|
5
|
+
import { tileTemplate } from "@dso-toolkit/css/src/components/tile/tile.template";
|
|
6
|
+
import { viewerGridTemplate } from "../templates/viewer-grid.template";
|
|
7
|
+
export function viewerGridTilesExampleTemplate(tiles) {
|
|
8
|
+
return viewerGridTemplate({
|
|
9
|
+
main: html `
|
|
10
|
+
<h2>Thema's</h2>
|
|
11
|
+
<p>Bekijk regels en beleid rond een bepaald thema.</p>
|
|
12
|
+
${tileGridTemplate({ children: html `${tiles.map(tile => tileTemplate(tile))}` })}
|
|
13
|
+
`,
|
|
14
|
+
map: alertTemplate({ message: 'Dit is de kaart', status: AlertType.Info })
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { html, nothing } from "lit-html";
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
|
+
export function viewerGridTemplate({ filterpanel, main, map, overlay, filterpanelOpen, overlayOpen, initialMainSize, mainSizeChange, filterpanelApply, filterpanelCancel, closeOverlay, }) {
|
|
4
|
+
return html `
|
|
5
|
+
<dso-viewer-grid
|
|
6
|
+
?filterpanel-open=${filterpanelOpen}
|
|
7
|
+
?overlay-open=${overlayOpen}
|
|
8
|
+
@mainSizeChange=${mainSizeChange}
|
|
9
|
+
@closeOverlay=${closeOverlay}
|
|
10
|
+
@filterpanelApply=${filterpanelApply}
|
|
11
|
+
@filterpanelCancel=${filterpanelCancel}
|
|
12
|
+
initial-main-size=${ifDefined(initialMainSize)}
|
|
13
|
+
>
|
|
14
|
+
${filterpanel ? html `<div slot="filterpanel">${filterpanel}</div>` : nothing}
|
|
15
|
+
<div slot="main">${main}</div>
|
|
16
|
+
<div slot="map">${map}</div>
|
|
17
|
+
${overlay ? html `<div slot="overlay">${overlay}</div>` : nothing}
|
|
18
|
+
</dso-viewer-grid>
|
|
19
|
+
`;
|
|
20
|
+
}
|