@dso-toolkit/core 33.2.0 → 33.3.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-autosuggest.cjs.entry.js +2 -70
- package/dist/cjs/dso-date-picker.cjs.entry.js +2 -3
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +15 -4
- package/dist/cjs/dso-header.cjs.entry.js +101 -0
- package/dist/cjs/dso-info-button.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-base-layers.cjs.entry.js +3 -4
- package/dist/cjs/dso-map-controls.cjs.entry.js +2 -2
- package/dist/cjs/dso-map-overlays.cjs.entry.js +5 -8
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/dso-tooltip.cjs.entry.js +168 -75
- package/dist/cjs/index-794ad37a.js +72 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/date-picker/date-picker.js +2 -3
- package/dist/collection/components/dropdown-menu/dropdown-menu.js +15 -4
- package/dist/collection/components/header/header.css +439 -0
- package/dist/collection/components/header/header.js +294 -0
- package/dist/collection/components/header/header.template.js +32 -0
- package/dist/collection/components/info-button/info-button.css +1 -0
- package/dist/collection/components/map-base-layers/map-base-layers.js +6 -27
- package/dist/collection/components/map-controls/map-controls.css +18 -8
- package/dist/collection/components/map-controls/map-controls.js +10 -11
- package/dist/collection/components/map-controls/map-controls.template.js +5 -8
- package/dist/collection/components/map-overlays/map-overlays.js +9 -35
- package/dist/collection/components/tooltip/tooltip.css +34 -12
- package/dist/collection/components/tooltip/tooltip.js +19 -4
- package/dist/collection/components/tooltip/tooltip.template.js +3 -5
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +296 -102
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-1805f5b0.js +1 -0
- package/dist/dso-toolkit/p-22bc904d.entry.js +1 -0
- package/dist/dso-toolkit/{p-5665f1ee.entry.js → p-4a78a31b.entry.js} +1 -1
- package/dist/dso-toolkit/p-72e4484a.entry.js +1 -0
- package/dist/dso-toolkit/p-7a043467.entry.js +1 -0
- package/dist/dso-toolkit/p-99b93d2e.entry.js +5 -0
- package/dist/dso-toolkit/p-b3e6d377.entry.js +1 -0
- package/dist/dso-toolkit/p-da3be034.entry.js +1 -0
- package/dist/dso-toolkit/p-ec8b74f7.entry.js +1 -0
- package/dist/dso-toolkit/p-ff767c21.entry.js +1 -0
- package/dist/esm/dso-autosuggest.entry.js +1 -69
- package/dist/esm/dso-date-picker.entry.js +2 -3
- package/dist/esm/dso-dropdown-menu.entry.js +15 -4
- package/dist/esm/dso-header.entry.js +97 -0
- package/dist/esm/dso-info-button.entry.js +1 -1
- package/dist/esm/dso-map-base-layers.entry.js +3 -4
- package/dist/esm/dso-map-controls.entry.js +2 -2
- package/dist/esm/dso-map-overlays.entry.js +5 -8
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/dso-tooltip.entry.js +168 -75
- package/dist/esm/index-f2bf58ce.js +70 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/types/components/header/header.d.ts +36 -0
- package/dist/types/components/header/header.template.d.ts +2 -0
- package/dist/types/components/map-base-layers/map-base-layers.d.ts +3 -4
- package/dist/types/components/map-base-layers/map-base-layers.interfaces.d.ts +5 -1
- package/dist/types/components/map-controls/map-controls.template.d.ts +1 -1
- package/dist/types/components/map-overlays/map-overlays.d.ts +4 -4
- package/dist/types/components/map-overlays/map-overlays.interfaces.d.ts +6 -1
- package/dist/types/components/tooltip/tooltip.d.ts +1 -0
- package/dist/types/components.d.ts +34 -8
- package/package.json +3 -2
- package/dist/dso-toolkit/p-08427682.entry.js +0 -1
- package/dist/dso-toolkit/p-731a9631.entry.js +0 -1
- package/dist/dso-toolkit/p-741e96de.entry.js +0 -5
- package/dist/dso-toolkit/p-759920d0.entry.js +0 -1
- package/dist/dso-toolkit/p-e4269e02.entry.js +0 -1
- package/dist/dso-toolkit/p-e7700d9e.entry.js +0 -1
- package/dist/dso-toolkit/p-fd5e24c9.entry.js +0 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { Component, Element, Fragment, h, Prop, State, Watch, } from "@stencil/core";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import debounce from "debounce";
|
|
4
|
+
const minDesktopViewportWidth = 992;
|
|
5
|
+
export class Header {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.useDropDownMenu = "auto";
|
|
8
|
+
this.showDropDown = false;
|
|
9
|
+
this.isLoggedIn = false;
|
|
10
|
+
this.hasSubLogo = false;
|
|
11
|
+
this.overflowMenuItems = 0;
|
|
12
|
+
this.onWindowResize = debounce(() => {
|
|
13
|
+
this.setDropDownMenu();
|
|
14
|
+
this.setOverflowMenu();
|
|
15
|
+
}, 100);
|
|
16
|
+
}
|
|
17
|
+
watchUseDropDownMenu(value) {
|
|
18
|
+
if (value === "auto") {
|
|
19
|
+
this.setDropDownMenu();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
this.showDropDown = value === "always";
|
|
23
|
+
}
|
|
24
|
+
componentWillLoad() {
|
|
25
|
+
this.hasSubLogo = this.host.querySelector("*[slot = 'sub-logo']") !== null;
|
|
26
|
+
}
|
|
27
|
+
shrinkMenuToFit() {
|
|
28
|
+
if (!this.wrapper || !this.nav) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (this.wrapper.clientWidth >= this.nav.clientWidth) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (this.overflowMenuItems >= this.mainMenu.length) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.overflowMenuItems++;
|
|
38
|
+
}
|
|
39
|
+
componentDidRender() {
|
|
40
|
+
if (this.showDropDown) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
window.setTimeout(() => this.shrinkMenuToFit(), 0);
|
|
44
|
+
}
|
|
45
|
+
setOverflowMenu() {
|
|
46
|
+
if (this.showDropDown) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (this.overflowMenuItems != 0) {
|
|
50
|
+
this.overflowMenuItems = 0;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.shrinkMenuToFit();
|
|
54
|
+
}
|
|
55
|
+
setDropDownMenu() {
|
|
56
|
+
if (this.useDropDownMenu !== "auto") {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.showDropDown = window.innerWidth < minDesktopViewportWidth;
|
|
60
|
+
}
|
|
61
|
+
connectedCallback() {
|
|
62
|
+
window.addEventListener("resize", this.onWindowResize);
|
|
63
|
+
}
|
|
64
|
+
disconnectedCallback() {
|
|
65
|
+
window.removeEventListener("resize", this.onWindowResize);
|
|
66
|
+
}
|
|
67
|
+
MenuItem(item) {
|
|
68
|
+
return (h("li", { class: item.active ? "dso-active" : undefined },
|
|
69
|
+
h("a", { href: item.url, "aria-current": item.active ? "page" : undefined }, item.label)));
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
return (h(Fragment, null,
|
|
73
|
+
h("div", { class: clsx("dso-header", {
|
|
74
|
+
["use-drop-down"]: this.showDropDown,
|
|
75
|
+
["has-sub-logo"]: this.hasSubLogo,
|
|
76
|
+
}), ref: (element) => (this.wrapper = element) },
|
|
77
|
+
h("div", { class: "logo-container" },
|
|
78
|
+
h("div", { class: "logo" },
|
|
79
|
+
h("slot", { name: "logo" })),
|
|
80
|
+
h("div", { class: "sub-logo" },
|
|
81
|
+
h("slot", { name: "sub-logo" }))),
|
|
82
|
+
this.showDropDown && (h("div", { class: "dropdown" },
|
|
83
|
+
h("dso-dropdown-menu", { "dropdown-align": "right" },
|
|
84
|
+
h("button", { type: "button", class: "tertiary", slot: "toggle" },
|
|
85
|
+
h("span", null, "Menu")),
|
|
86
|
+
h("div", { class: "dso-dropdown-options" },
|
|
87
|
+
h("dso-dropdown-options", null,
|
|
88
|
+
h("ul", null,
|
|
89
|
+
this.mainMenu.map(this.MenuItem),
|
|
90
|
+
this.userHomeUrl && (h("li", null,
|
|
91
|
+
h("a", { href: this.userHomeUrl }, "Mijn Omgevingsloket"))),
|
|
92
|
+
this.loginUrl && !this.isLoggedIn && (h("li", null,
|
|
93
|
+
h("a", { href: this.loginUrl }, "Inloggen"))),
|
|
94
|
+
this.userProfileUrl &&
|
|
95
|
+
this.userProfileName &&
|
|
96
|
+
this.isLoggedIn && (h("li", null,
|
|
97
|
+
h("a", { href: this.userProfileUrl },
|
|
98
|
+
this.userProfileName,
|
|
99
|
+
h("span", { class: "profile-label" }, "- Mijn profiel")))),
|
|
100
|
+
this.logoutUrl && this.isLoggedIn && (h("li", null,
|
|
101
|
+
h("a", { href: this.logoutUrl }, "Uitloggen"))))))))),
|
|
102
|
+
!this.showDropDown && (h(Fragment, null,
|
|
103
|
+
h("div", { class: "dso-header-session" },
|
|
104
|
+
this.userProfileUrl &&
|
|
105
|
+
this.userProfileName &&
|
|
106
|
+
this.isLoggedIn && (h("div", { class: "profile" },
|
|
107
|
+
h("span", { class: "profile-label" }, "Welkom:"),
|
|
108
|
+
h("a", { href: this.userProfileUrl }, this.userProfileName))),
|
|
109
|
+
this.loginUrl && !this.isLoggedIn && (h("div", { class: "login" },
|
|
110
|
+
h("a", { href: this.loginUrl }, "Inloggen"))),
|
|
111
|
+
this.logoutUrl && this.isLoggedIn && (h("div", { class: "logout" },
|
|
112
|
+
h("a", { href: this.logoutUrl }, "Uitloggen")))),
|
|
113
|
+
h("nav", { class: "dso-navbar" },
|
|
114
|
+
h("ul", { class: "dso-nav dso-nav-main", ref: (element) => (this.nav = element) },
|
|
115
|
+
this.mainMenu
|
|
116
|
+
.filter((_, index) => index < this.mainMenu.length - this.overflowMenuItems)
|
|
117
|
+
.map(this.MenuItem),
|
|
118
|
+
this.overflowMenuItems > 0 && (h("li", null,
|
|
119
|
+
h("dso-dropdown-menu", { "dropdown-align": "left" },
|
|
120
|
+
h("button", { type: "button", class: "tertiary", slot: "toggle" },
|
|
121
|
+
h("span", null, "Meer")),
|
|
122
|
+
h("div", { class: "dso-dropdown-options" },
|
|
123
|
+
h("dso-dropdown-options", null,
|
|
124
|
+
h("ul", null, this.mainMenu
|
|
125
|
+
.filter((_, index) => index >=
|
|
126
|
+
this.mainMenu.length -
|
|
127
|
+
this.overflowMenuItems)
|
|
128
|
+
.map(this.MenuItem))))))),
|
|
129
|
+
this.userHomeUrl && (h("li", { class: "menu-user-home" },
|
|
130
|
+
h("a", { href: this.userHomeUrl },
|
|
131
|
+
h("dso-icon", { icon: "user-line" }),
|
|
132
|
+
"Mijn Omgevingsloket"))))))))));
|
|
133
|
+
}
|
|
134
|
+
static get is() { return "dso-header"; }
|
|
135
|
+
static get encapsulation() { return "shadow"; }
|
|
136
|
+
static get originalStyleUrls() { return {
|
|
137
|
+
"$": ["header.scss"]
|
|
138
|
+
}; }
|
|
139
|
+
static get styleUrls() { return {
|
|
140
|
+
"$": ["header.css"]
|
|
141
|
+
}; }
|
|
142
|
+
static get properties() { return {
|
|
143
|
+
"loginUrl": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"mutable": false,
|
|
146
|
+
"complexType": {
|
|
147
|
+
"original": "string",
|
|
148
|
+
"resolved": "string | undefined",
|
|
149
|
+
"references": {}
|
|
150
|
+
},
|
|
151
|
+
"required": false,
|
|
152
|
+
"optional": true,
|
|
153
|
+
"docs": {
|
|
154
|
+
"tags": [],
|
|
155
|
+
"text": ""
|
|
156
|
+
},
|
|
157
|
+
"attribute": "login-url",
|
|
158
|
+
"reflect": false
|
|
159
|
+
},
|
|
160
|
+
"logoutUrl": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"mutable": false,
|
|
163
|
+
"complexType": {
|
|
164
|
+
"original": "string",
|
|
165
|
+
"resolved": "string | undefined",
|
|
166
|
+
"references": {}
|
|
167
|
+
},
|
|
168
|
+
"required": false,
|
|
169
|
+
"optional": true,
|
|
170
|
+
"docs": {
|
|
171
|
+
"tags": [],
|
|
172
|
+
"text": ""
|
|
173
|
+
},
|
|
174
|
+
"attribute": "logout-url",
|
|
175
|
+
"reflect": false
|
|
176
|
+
},
|
|
177
|
+
"mainMenu": {
|
|
178
|
+
"type": "unknown",
|
|
179
|
+
"mutable": false,
|
|
180
|
+
"complexType": {
|
|
181
|
+
"original": "HeaderMenuItem[]",
|
|
182
|
+
"resolved": "HeaderMenuItem[]",
|
|
183
|
+
"references": {
|
|
184
|
+
"HeaderMenuItem": {
|
|
185
|
+
"location": "local"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"required": true,
|
|
190
|
+
"optional": false,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [],
|
|
193
|
+
"text": ""
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"useDropDownMenu": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"mutable": false,
|
|
199
|
+
"complexType": {
|
|
200
|
+
"original": "\"always\" | \"never\" | \"auto\"",
|
|
201
|
+
"resolved": "\"always\" | \"auto\" | \"never\"",
|
|
202
|
+
"references": {}
|
|
203
|
+
},
|
|
204
|
+
"required": false,
|
|
205
|
+
"optional": false,
|
|
206
|
+
"docs": {
|
|
207
|
+
"tags": [],
|
|
208
|
+
"text": ""
|
|
209
|
+
},
|
|
210
|
+
"attribute": "use-drop-down-menu",
|
|
211
|
+
"reflect": false,
|
|
212
|
+
"defaultValue": "\"auto\""
|
|
213
|
+
},
|
|
214
|
+
"isLoggedIn": {
|
|
215
|
+
"type": "boolean",
|
|
216
|
+
"mutable": false,
|
|
217
|
+
"complexType": {
|
|
218
|
+
"original": "boolean",
|
|
219
|
+
"resolved": "boolean",
|
|
220
|
+
"references": {}
|
|
221
|
+
},
|
|
222
|
+
"required": false,
|
|
223
|
+
"optional": false,
|
|
224
|
+
"docs": {
|
|
225
|
+
"tags": [],
|
|
226
|
+
"text": ""
|
|
227
|
+
},
|
|
228
|
+
"attribute": "is-logged-in",
|
|
229
|
+
"reflect": false,
|
|
230
|
+
"defaultValue": "false"
|
|
231
|
+
},
|
|
232
|
+
"userProfileName": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"mutable": false,
|
|
235
|
+
"complexType": {
|
|
236
|
+
"original": "string",
|
|
237
|
+
"resolved": "string | undefined",
|
|
238
|
+
"references": {}
|
|
239
|
+
},
|
|
240
|
+
"required": false,
|
|
241
|
+
"optional": true,
|
|
242
|
+
"docs": {
|
|
243
|
+
"tags": [],
|
|
244
|
+
"text": ""
|
|
245
|
+
},
|
|
246
|
+
"attribute": "user-profile-name",
|
|
247
|
+
"reflect": false
|
|
248
|
+
},
|
|
249
|
+
"userProfileUrl": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"mutable": false,
|
|
252
|
+
"complexType": {
|
|
253
|
+
"original": "string",
|
|
254
|
+
"resolved": "string | undefined",
|
|
255
|
+
"references": {}
|
|
256
|
+
},
|
|
257
|
+
"required": false,
|
|
258
|
+
"optional": true,
|
|
259
|
+
"docs": {
|
|
260
|
+
"tags": [],
|
|
261
|
+
"text": ""
|
|
262
|
+
},
|
|
263
|
+
"attribute": "user-profile-url",
|
|
264
|
+
"reflect": false
|
|
265
|
+
},
|
|
266
|
+
"userHomeUrl": {
|
|
267
|
+
"type": "string",
|
|
268
|
+
"mutable": false,
|
|
269
|
+
"complexType": {
|
|
270
|
+
"original": "string",
|
|
271
|
+
"resolved": "string | undefined",
|
|
272
|
+
"references": {}
|
|
273
|
+
},
|
|
274
|
+
"required": false,
|
|
275
|
+
"optional": true,
|
|
276
|
+
"docs": {
|
|
277
|
+
"tags": [],
|
|
278
|
+
"text": ""
|
|
279
|
+
},
|
|
280
|
+
"attribute": "user-home-url",
|
|
281
|
+
"reflect": false
|
|
282
|
+
}
|
|
283
|
+
}; }
|
|
284
|
+
static get states() { return {
|
|
285
|
+
"showDropDown": {},
|
|
286
|
+
"hasSubLogo": {},
|
|
287
|
+
"overflowMenuItems": {}
|
|
288
|
+
}; }
|
|
289
|
+
static get elementRef() { return "host"; }
|
|
290
|
+
static get watchers() { return [{
|
|
291
|
+
"propName": "useDropDownMenu",
|
|
292
|
+
"methodName": "watchUseDropDownMenu"
|
|
293
|
+
}]; }
|
|
294
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { html } from "lit-html";
|
|
2
|
+
import { ifDefined } from "lit-html/directives/if-defined";
|
|
3
|
+
export function headerTemplate({ logo, subLogo, mainMenu, useDropDownMenu, showSubLogo, loginUrl, logoutUrl, isLoggedIn, showLoggedIn, userProfileUrl, userProfileName, userHomeUrl, }) {
|
|
4
|
+
const bindLoginUrl = showLoggedIn && loginUrl ? loginUrl : undefined;
|
|
5
|
+
const bindLogoutUrl = showLoggedIn && logoutUrl ? logoutUrl : undefined;
|
|
6
|
+
return showSubLogo
|
|
7
|
+
? html `<dso-header
|
|
8
|
+
.mainMenu=${mainMenu}
|
|
9
|
+
use-drop-down-menu=${ifDefined(useDropDownMenu)}
|
|
10
|
+
is-logged-in=${ifDefined(isLoggedIn)}
|
|
11
|
+
login-url=${ifDefined(bindLoginUrl)}
|
|
12
|
+
logout-url=${ifDefined(bindLogoutUrl)}
|
|
13
|
+
user-profile-url=${ifDefined(userProfileUrl)}
|
|
14
|
+
user-profile-name=${ifDefined(userProfileName)}
|
|
15
|
+
user-home-url=${ifDefined(userHomeUrl)}
|
|
16
|
+
>
|
|
17
|
+
<div slot="logo"><img height="40" alt="Omgevingsloket" src="${logo}" /></div>
|
|
18
|
+
<div slot="sub-logo"><img alt="Regels op de kaart" src="${subLogo}" /></div></div>
|
|
19
|
+
</dso-header>`
|
|
20
|
+
: html `<dso-header
|
|
21
|
+
.mainMenu=${mainMenu}
|
|
22
|
+
use-drop-down-menu=${ifDefined(useDropDownMenu)}
|
|
23
|
+
is-logged-in=${ifDefined(isLoggedIn)}
|
|
24
|
+
login-url=${ifDefined(bindLoginUrl)}
|
|
25
|
+
logout-url=${ifDefined(bindLogoutUrl)}
|
|
26
|
+
user-profile-url=${ifDefined(userProfileUrl)}
|
|
27
|
+
user-profile-name=${ifDefined(userProfileName)}
|
|
28
|
+
user-home-url=${ifDefined(userHomeUrl)}
|
|
29
|
+
>
|
|
30
|
+
<div slot="logo"><img alt="Omgevingsloket" src="${logo}" /></div>
|
|
31
|
+
</dso-header>`;
|
|
32
|
+
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Component, h, Prop, Event } from '@stencil/core';
|
|
2
2
|
export class MapBaseLayers {
|
|
3
|
-
|
|
4
|
-
this.
|
|
5
|
-
this.baseLayerChange.emit(baseLayer);
|
|
3
|
+
baseLayerChangeHandler(baseLayer) {
|
|
4
|
+
this.baseLayerChange.emit({ activeBaseLayer: baseLayer });
|
|
6
5
|
}
|
|
7
6
|
render() {
|
|
8
7
|
return (h("fieldset", { class: "form-group dso-radios" },
|
|
9
8
|
h("legend", { class: "sr-only" }, "Achtergrond"),
|
|
10
9
|
h("div", { class: "dso-label-container" },
|
|
11
10
|
h("span", { class: "control-label", "aria-hidden": "true" }, "Achtergrond")),
|
|
12
|
-
h("div", { class: "dso-field-container" }, this.baseLayers.map(
|
|
11
|
+
h("div", { class: "dso-field-container" }, this.baseLayers.map(baseLayer => (h("dso-selectable", { key: baseLayer.id, type: "radio", value: baseLayer.name, checked: baseLayer.checked, onDsoChange: () => this.baseLayerChangeHandler(baseLayer) }, baseLayer.name))))));
|
|
13
12
|
}
|
|
14
13
|
static get is() { return "dso-map-base-layers"; }
|
|
15
14
|
static get encapsulation() { return "shadow"; }
|
|
@@ -39,26 +38,6 @@ export class MapBaseLayers {
|
|
|
39
38
|
"tags": [],
|
|
40
39
|
"text": ""
|
|
41
40
|
}
|
|
42
|
-
},
|
|
43
|
-
"selectedBaseLayer": {
|
|
44
|
-
"type": "unknown",
|
|
45
|
-
"mutable": true,
|
|
46
|
-
"complexType": {
|
|
47
|
-
"original": "BaseLayer | undefined",
|
|
48
|
-
"resolved": "BaseLayer | undefined",
|
|
49
|
-
"references": {
|
|
50
|
-
"BaseLayer": {
|
|
51
|
-
"location": "import",
|
|
52
|
-
"path": "./map-base-layers.interfaces"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"required": false,
|
|
57
|
-
"optional": false,
|
|
58
|
-
"docs": {
|
|
59
|
-
"tags": [],
|
|
60
|
-
"text": ""
|
|
61
|
-
}
|
|
62
41
|
}
|
|
63
42
|
}; }
|
|
64
43
|
static get events() { return [{
|
|
@@ -72,10 +51,10 @@ export class MapBaseLayers {
|
|
|
72
51
|
"text": ""
|
|
73
52
|
},
|
|
74
53
|
"complexType": {
|
|
75
|
-
"original": "
|
|
76
|
-
"resolved": "
|
|
54
|
+
"original": "BaseLayerChangeEvent",
|
|
55
|
+
"resolved": "BaseLayerChangeEvent",
|
|
77
56
|
"references": {
|
|
78
|
-
"
|
|
57
|
+
"BaseLayerChangeEvent": {
|
|
79
58
|
"location": "import",
|
|
80
59
|
"path": "./map-base-layers.interfaces"
|
|
81
60
|
}
|
|
@@ -48,14 +48,6 @@ button::-moz-focus-inner {
|
|
|
48
48
|
display: none;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
#controls {
|
|
52
|
-
align-items: start;
|
|
53
|
-
display: flex;
|
|
54
|
-
position: absolute;
|
|
55
|
-
right: calc(100% + 16px);
|
|
56
|
-
top: 16px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
51
|
#toggle-visibility-button {
|
|
60
52
|
display: inline-block;
|
|
61
53
|
font-size: 1em;
|
|
@@ -81,6 +73,9 @@ button::-moz-focus-inner {
|
|
|
81
73
|
margin-right: 16px;
|
|
82
74
|
padding: 8px 16px;
|
|
83
75
|
white-space: nowrap;
|
|
76
|
+
position: absolute;
|
|
77
|
+
right: calc(100% + 56px);
|
|
78
|
+
top: 16px;
|
|
84
79
|
}
|
|
85
80
|
#toggle-visibility-button:focus, #toggle-visibility-button:focus-visible {
|
|
86
81
|
outline-offset: 2px;
|
|
@@ -157,6 +152,12 @@ button::-moz-focus-inner {
|
|
|
157
152
|
margin-left: 8px;
|
|
158
153
|
margin-right: -8px;
|
|
159
154
|
}
|
|
155
|
+
#toggle-visibility-button:focus-visible {
|
|
156
|
+
background-color: #39870c;
|
|
157
|
+
border-color: #39870c;
|
|
158
|
+
color: #fff;
|
|
159
|
+
outline: none;
|
|
160
|
+
}
|
|
160
161
|
|
|
161
162
|
#zoom-buttons {
|
|
162
163
|
border-radius: 4px;
|
|
@@ -164,6 +165,9 @@ button::-moz-focus-inner {
|
|
|
164
165
|
display: flex;
|
|
165
166
|
flex-wrap: wrap;
|
|
166
167
|
flex: 0 0;
|
|
168
|
+
position: absolute;
|
|
169
|
+
right: calc(100% + 16px);
|
|
170
|
+
top: 16px;
|
|
167
171
|
}
|
|
168
172
|
#zoom-buttons button {
|
|
169
173
|
display: inline-block;
|
|
@@ -269,6 +273,12 @@ button::-moz-focus-inner {
|
|
|
269
273
|
clip: rect(0, 0, 0, 0);
|
|
270
274
|
border: 0;
|
|
271
275
|
}
|
|
276
|
+
#zoom-buttons button:focus-visible {
|
|
277
|
+
background-color: #39870c;
|
|
278
|
+
border-color: #39870c;
|
|
279
|
+
color: #fff;
|
|
280
|
+
outline: none;
|
|
281
|
+
}
|
|
272
282
|
#zoom-buttons button + button {
|
|
273
283
|
border-radius: 0;
|
|
274
284
|
border-bottom-left-radius: 4px;
|
|
@@ -35,17 +35,16 @@ export class MapControls {
|
|
|
35
35
|
}
|
|
36
36
|
render() {
|
|
37
37
|
return (h(Host, null,
|
|
38
|
-
h("
|
|
39
|
-
h("
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
h("
|
|
43
|
-
h("
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
h("
|
|
47
|
-
|
|
48
|
-
h("dso-icon", { icon: "minus" })))),
|
|
38
|
+
h("button", { type: "button", id: "toggle-visibility-button", onClick: () => this.open = !this.open, ref: element => __classPrivateFieldSet(this, _toggleButtonElement, element) },
|
|
39
|
+
h("dso-icon", { icon: "layers" }),
|
|
40
|
+
h("span", null, "Kaartlagen")),
|
|
41
|
+
h("div", { id: "zoom-buttons" },
|
|
42
|
+
h("button", { type: "button", onClick: e => this.zoomIn.emit(e), disabled: this.disableZoom === 'in' || this.disableZoom === 'both' },
|
|
43
|
+
h("span", null, "Zoom in"),
|
|
44
|
+
h("dso-icon", { icon: "plus" })),
|
|
45
|
+
h("button", { type: "button", onClick: e => this.zoomOut.emit(e), disabled: this.disableZoom === 'out' || this.disableZoom === 'both' },
|
|
46
|
+
h("span", null, "Zoom uit"),
|
|
47
|
+
h("dso-icon", { icon: "minus" }))),
|
|
49
48
|
h("section", { hidden: this.hideContent },
|
|
50
49
|
h("header", null,
|
|
51
50
|
h("h2", null, "Kaartlagen"),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { checkFix } from '@dso-toolkit/sources';
|
|
2
1
|
import { html } from 'lit-html';
|
|
3
|
-
export function mapControlsTemplate({ zoomIn, zoomOut, open, baseLayers,
|
|
2
|
+
export function mapControlsTemplate({ zoomIn, zoomOut, open, baseLayers, baseLayerChange, overlays, toggleOverlay, disableZoom }) {
|
|
4
3
|
return html `
|
|
5
4
|
<dso-map-controls
|
|
6
5
|
@zoomIn=${zoomIn}
|
|
@@ -9,20 +8,18 @@ export function mapControlsTemplate({ zoomIn, zoomOut, open, baseLayers, selecte
|
|
|
9
8
|
?open=${open}
|
|
10
9
|
>
|
|
11
10
|
<form>
|
|
12
|
-
<div class="rich-content">
|
|
11
|
+
<div class="dso-rich-content">
|
|
13
12
|
<p>Inhoud</p>
|
|
14
13
|
</div>
|
|
15
14
|
<dso-map-base-layers
|
|
16
15
|
.baseLayers=${baseLayers}
|
|
17
|
-
|
|
18
|
-
@baseLayerChange=${(e) => baseLayerChange(e.detail)}
|
|
16
|
+
@baseLayerChange=${(e) => baseLayerChange(e)}
|
|
19
17
|
></dso-map-base-layers>
|
|
20
18
|
<dso-map-overlays
|
|
21
19
|
.overlays=${overlays}
|
|
22
|
-
|
|
23
|
-
@checkedOverlaysChange=${(e) => checkedOverlaysChange(e.detail)}
|
|
20
|
+
@toggleOverlay=${(e) => toggleOverlay(e)}
|
|
24
21
|
></dso-map-overlays>
|
|
25
|
-
<div class="rich-content">
|
|
22
|
+
<div class="dso-rich-content">
|
|
26
23
|
<p>Ook nog meer inhoud</p>
|
|
27
24
|
</div>
|
|
28
25
|
</form>
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { Component, Event, Prop, h } from '@stencil/core';
|
|
2
2
|
export class MapOverlays {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
toggleOverlay(overlay, checked) {
|
|
7
|
-
this.checkedOverlays = checked
|
|
8
|
-
? [...this.checkedOverlays, overlay]
|
|
9
|
-
: this.checkedOverlays.filter(o => o !== overlay);
|
|
10
|
-
this.checkedOverlaysChange.emit(this.checkedOverlays);
|
|
3
|
+
overlayChangeHandler(overlay, e) {
|
|
4
|
+
const checked = e.detail.target instanceof HTMLInputElement ? !!e.detail.target.checked : false;
|
|
5
|
+
this.toggleOverlay.emit({ overlay, checked });
|
|
11
6
|
}
|
|
12
7
|
render() {
|
|
13
8
|
return (h("fieldset", { class: "form-group dso-checkboxes" },
|
|
14
9
|
h("legend", { class: "sr-only" }, "Kaartlagen"),
|
|
15
10
|
h("div", { class: "dso-label-container" },
|
|
16
11
|
h("span", { class: "control-label", "aria-hidden": "true" }, "Kaartlagen")),
|
|
17
|
-
h("div", { class: "dso-field-container" }, this.overlays.map(overlay => (h("dso-selectable", { type: "checkbox", value: overlay.name, checked:
|
|
12
|
+
h("div", { class: "dso-field-container" }, this.overlays.map(overlay => (h("dso-selectable", { type: "checkbox", value: overlay.name, checked: overlay.checked, disabled: overlay.disabled, onDsoChange: e => this.overlayChangeHandler(overlay, e) }, overlay.name))))));
|
|
18
13
|
}
|
|
19
14
|
static get is() { return "dso-map-overlays"; }
|
|
20
15
|
static get encapsulation() { return "shadow"; }
|
|
@@ -44,32 +39,11 @@ export class MapOverlays {
|
|
|
44
39
|
"tags": [],
|
|
45
40
|
"text": ""
|
|
46
41
|
}
|
|
47
|
-
},
|
|
48
|
-
"checkedOverlays": {
|
|
49
|
-
"type": "unknown",
|
|
50
|
-
"mutable": true,
|
|
51
|
-
"complexType": {
|
|
52
|
-
"original": "Overlay[]",
|
|
53
|
-
"resolved": "Overlay[]",
|
|
54
|
-
"references": {
|
|
55
|
-
"Overlay": {
|
|
56
|
-
"location": "import",
|
|
57
|
-
"path": "./map-overlays.interfaces"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"required": false,
|
|
62
|
-
"optional": false,
|
|
63
|
-
"docs": {
|
|
64
|
-
"tags": [],
|
|
65
|
-
"text": ""
|
|
66
|
-
},
|
|
67
|
-
"defaultValue": "[]"
|
|
68
42
|
}
|
|
69
43
|
}; }
|
|
70
44
|
static get events() { return [{
|
|
71
|
-
"method": "
|
|
72
|
-
"name": "
|
|
45
|
+
"method": "toggleOverlay",
|
|
46
|
+
"name": "toggleOverlay",
|
|
73
47
|
"bubbles": true,
|
|
74
48
|
"cancelable": true,
|
|
75
49
|
"composed": true,
|
|
@@ -78,10 +52,10 @@ export class MapOverlays {
|
|
|
78
52
|
"text": ""
|
|
79
53
|
},
|
|
80
54
|
"complexType": {
|
|
81
|
-
"original": "
|
|
82
|
-
"resolved": "
|
|
55
|
+
"original": "OverlayChangeEvent",
|
|
56
|
+
"resolved": "OverlayChangeEvent",
|
|
83
57
|
"references": {
|
|
84
|
-
"
|
|
58
|
+
"OverlayChangeEvent": {
|
|
85
59
|
"location": "import",
|
|
86
60
|
"path": "./map-overlays.interfaces"
|
|
87
61
|
}
|