@dso-toolkit/core 40.1.0 → 42.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/dist/cjs/dso-alert.cjs.entry.js +1 -1
- package/dist/cjs/dso-banner.cjs.entry.js +1 -1
- package/dist/cjs/dso-header.cjs.entry.js +31 -21
- package/dist/cjs/dso-icon.cjs.entry.js +15 -24
- package/dist/cjs/dso-pagination.cjs.entry.js +7 -7
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/alert/alert.css +4 -4
- package/dist/collection/components/banner/banner.css +2 -2
- package/dist/collection/components/header/header.css +119 -0
- package/dist/collection/components/header/header.interfaces.js +1 -0
- package/dist/collection/components/header/header.js +94 -100
- package/dist/collection/components/header/header.template.js +15 -31
- package/dist/collection/components/icon/icon.js +0 -2
- package/dist/collection/components/pagination/pagination.js +7 -7
- package/dist/custom-elements/index.js +56 -55
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-15d0f2eb.entry.js +1 -0
- package/dist/dso-toolkit/p-590cbab6.entry.js +1 -0
- package/dist/dso-toolkit/p-8e6ee9f0.entry.js +1 -0
- package/dist/dso-toolkit/p-9dc7e3c5.entry.js +1 -0
- package/dist/dso-toolkit/p-b1dc8d76.entry.js +1 -0
- package/dist/esm/dso-alert.entry.js +1 -1
- package/dist/esm/dso-banner.entry.js +1 -1
- package/dist/esm/dso-header.entry.js +31 -21
- package/dist/esm/dso-icon.entry.js +15 -24
- package/dist/esm/dso-pagination.entry.js +7 -7
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/header/header.d.ts +13 -20
- package/dist/types/components/header/header.interfaces.d.ts +17 -0
- package/dist/types/components/header/header.template.d.ts +1 -1
- package/dist/types/components/pagination/pagination.interfaces.d.ts +2 -0
- package/dist/types/components.d.ts +18 -7
- package/package.json +1 -1
- package/dist/dso-toolkit/p-09b53589.entry.js +0 -1
- package/dist/dso-toolkit/p-4a41728e.entry.js +0 -1
- package/dist/dso-toolkit/p-c0b7f435.entry.js +0 -1
- package/dist/dso-toolkit/p-d0d279cc.entry.js +0 -1
- package/dist/dso-toolkit/p-ea14647b.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,8 +6,9 @@ export class Header {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
this.mainMenu = [];
|
|
8
8
|
this.useDropDownMenu = "auto";
|
|
9
|
+
/** Used to show the login/logout option. 'none' renders nothing. */
|
|
10
|
+
this.authStatus = 'none';
|
|
9
11
|
this.showDropDown = false;
|
|
10
|
-
this.isLoggedIn = false;
|
|
11
12
|
this.hasSubLogo = false;
|
|
12
13
|
this.overflowMenuItems = 0;
|
|
13
14
|
this.onWindowResize = debounce(() => {
|
|
@@ -15,17 +16,21 @@ export class Header {
|
|
|
15
16
|
this.setOverflowMenu();
|
|
16
17
|
}, 100);
|
|
17
18
|
this.MenuItem = (item) => {
|
|
18
|
-
const click = (event) => {
|
|
19
|
-
event.preventDefault();
|
|
20
|
-
this.menuItemClick.emit({
|
|
21
|
-
originalEvent: event,
|
|
22
|
-
menuItem: item,
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
19
|
return (h("li", { class: item.active ? "dso-active" : undefined },
|
|
26
|
-
h("a", { href: item.url, "aria-current": item.active ? "page" : undefined, onClick:
|
|
20
|
+
h("a", { href: item.url, "aria-current": item.active ? "page" : undefined, onClick: e => this.clickHandler(e, 'menuItem', { menuItem: item }) }, item.label)));
|
|
27
21
|
};
|
|
28
22
|
}
|
|
23
|
+
clickHandler(e, type, options) {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
this.headerClick.emit({
|
|
26
|
+
originalEvent: e,
|
|
27
|
+
isModifiedEvent: e.button !== 0 || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey,
|
|
28
|
+
type,
|
|
29
|
+
menuItem: options === null || options === void 0 ? void 0 : options.menuItem,
|
|
30
|
+
url: (_a = options === null || options === void 0 ? void 0 : options.url) !== null && _a !== void 0 ? _a : (_b = options === null || options === void 0 ? void 0 : options.menuItem) === null || _b === void 0 ? void 0 : _b.url,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
;
|
|
29
34
|
watchUseDropDownMenu(value) {
|
|
30
35
|
if (value === "auto") {
|
|
31
36
|
this.setDropDownMenu();
|
|
@@ -43,7 +48,7 @@ export class Header {
|
|
|
43
48
|
if (this.wrapper.clientWidth >= this.nav.clientWidth) {
|
|
44
49
|
return;
|
|
45
50
|
}
|
|
46
|
-
if (this.overflowMenuItems >= this.mainMenu.length) {
|
|
51
|
+
if (this.mainMenu && this.overflowMenuItems >= this.mainMenu.length) {
|
|
47
52
|
return;
|
|
48
53
|
}
|
|
49
54
|
this.overflowMenuItems++;
|
|
@@ -87,7 +92,7 @@ export class Header {
|
|
|
87
92
|
h("slot", { name: "logo" })),
|
|
88
93
|
h("div", { class: "sub-logo" },
|
|
89
94
|
h("slot", { name: "sub-logo" }))),
|
|
90
|
-
this.showDropDown && this.mainMenu.length > 0 && (h("div", { class: "dropdown" },
|
|
95
|
+
this.showDropDown && this.mainMenu && this.mainMenu.length > 0 && (h("div", { class: "dropdown" },
|
|
91
96
|
h("dso-dropdown-menu", { "dropdown-align": "right" },
|
|
92
97
|
h("button", { type: "button", class: "tertiary", slot: "toggle" },
|
|
93
98
|
h("span", null, "Menu")),
|
|
@@ -96,31 +101,35 @@ export class Header {
|
|
|
96
101
|
h("ul", null,
|
|
97
102
|
this.mainMenu.map(this.MenuItem),
|
|
98
103
|
this.userHomeUrl && (h("li", null,
|
|
99
|
-
h("a", { href: this.userHomeUrl }, "Mijn Omgevingsloket"))),
|
|
100
|
-
this.loginUrl && !this.isLoggedIn && (h("li", null,
|
|
101
|
-
h("a", { href: this.loginUrl }, "Inloggen"))),
|
|
104
|
+
h("a", { href: this.userHomeUrl, onClick: e => this.clickHandler(e, 'userHome', { url: this.userHomeUrl }) }, "Mijn Omgevingsloket"))),
|
|
102
105
|
this.userProfileUrl &&
|
|
103
106
|
this.userProfileName &&
|
|
104
|
-
this.
|
|
105
|
-
h("a", { href: this.userProfileUrl },
|
|
107
|
+
this.authStatus === 'loggedIn' && (h("li", null,
|
|
108
|
+
h("a", { href: this.userProfileUrl, onClick: e => this.clickHandler(e, 'profile', { url: this.userProfileUrl }) },
|
|
106
109
|
this.userProfileName,
|
|
107
|
-
h("span", { class: "profile-label" }, "- Mijn profiel")))),
|
|
108
|
-
this.
|
|
109
|
-
h("a", { href: this.
|
|
110
|
-
|
|
110
|
+
h("span", { class: "profile-label" }, " - Mijn profiel")))),
|
|
111
|
+
this.authStatus === 'loggedOut' && (h("li", null, this.loginUrl
|
|
112
|
+
? h("a", { href: this.loginUrl, onClick: e => this.clickHandler(e, 'login', { url: this.loginUrl }) }, "Inloggen")
|
|
113
|
+
: h("button", { type: "button", onClick: e => this.clickHandler(e, 'login') }, "Inloggen"))),
|
|
114
|
+
this.authStatus === 'loggedIn' && (h("li", null, this.logoutUrl
|
|
115
|
+
? h("a", { href: this.logoutUrl, onClick: e => this.clickHandler(e, 'logout', { url: this.logoutUrl }) }, "Uitloggen")
|
|
116
|
+
: h("button", { type: "button", onClick: e => this.clickHandler(e, 'logout') }, "Uitloggen"))))))))),
|
|
117
|
+
!this.showDropDown && (h(Fragment, null,
|
|
111
118
|
h("div", { class: "dso-header-session" },
|
|
112
119
|
this.userProfileUrl &&
|
|
113
120
|
this.userProfileName &&
|
|
114
|
-
this.
|
|
121
|
+
this.authStatus === 'loggedIn' && (h("div", { class: "profile" },
|
|
115
122
|
h("span", { class: "profile-label" }, "Welkom:"),
|
|
116
|
-
h("a", { href: this.userProfileUrl }, this.userProfileName))),
|
|
117
|
-
this.
|
|
118
|
-
h("a", { href: this.loginUrl }, "Inloggen")
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
h("a", { href: this.userProfileUrl, onClick: e => this.clickHandler(e, 'profile', { url: this.userProfileUrl }) }, this.userProfileName))),
|
|
124
|
+
this.authStatus === 'loggedOut' && (h("div", { class: "login" }, this.loginUrl
|
|
125
|
+
? h("a", { href: this.loginUrl, onClick: e => this.clickHandler(e, 'login', { url: this.loginUrl }) }, "Inloggen")
|
|
126
|
+
: h("button", { class: "dso-tertiary", type: "button", onClick: e => this.clickHandler(e, 'login') }, "Inloggen"))),
|
|
127
|
+
this.authStatus === 'loggedIn' && (h("div", { class: "logout" }, this.logoutUrl
|
|
128
|
+
? h("a", { href: this.logoutUrl, onClick: e => this.clickHandler(e, 'logout', { url: this.logoutUrl }) }, "Uitloggen")
|
|
129
|
+
: h("button", { class: "dso-tertiary", type: "button", onClick: e => this.clickHandler(e, 'logout') }, "Uitloggen")))),
|
|
130
|
+
((this.mainMenu && this.mainMenu.length > 0) || this.userHomeUrl) && (h("nav", { class: "dso-navbar" },
|
|
122
131
|
h("ul", { class: "dso-nav dso-nav-main", ref: (element) => (this.nav = element) },
|
|
123
|
-
this.mainMenu
|
|
132
|
+
this.mainMenu && this.mainMenu
|
|
124
133
|
.filter((_, index) => index < this.mainMenu.length - this.overflowMenuItems)
|
|
125
134
|
.map(this.MenuItem),
|
|
126
135
|
this.overflowMenuItems > 0 && (h("li", null,
|
|
@@ -129,15 +138,13 @@ export class Header {
|
|
|
129
138
|
h("span", null, "Meer")),
|
|
130
139
|
h("div", { class: "dso-dropdown-options" },
|
|
131
140
|
h("dso-dropdown-options", null,
|
|
132
|
-
h("ul", null, this.mainMenu
|
|
133
|
-
.filter((_, index) => index >=
|
|
134
|
-
this.mainMenu.length -
|
|
135
|
-
this.overflowMenuItems)
|
|
141
|
+
h("ul", null, this.mainMenu && this.mainMenu
|
|
142
|
+
.filter((_, index) => index >= this.mainMenu.length - this.overflowMenuItems)
|
|
136
143
|
.map(this.MenuItem))))))),
|
|
137
144
|
this.userHomeUrl && (h("li", { class: "menu-user-home" },
|
|
138
|
-
h("a", { href: this.userHomeUrl },
|
|
145
|
+
h("a", { href: this.userHomeUrl, onClick: e => this.clickHandler(e, 'userHome', { url: this.userHomeUrl }) },
|
|
139
146
|
h("dso-icon", { icon: "user-line" }),
|
|
140
|
-
"Mijn Omgevingsloket"))))))))));
|
|
147
|
+
"Mijn Omgevingsloket")))))))))));
|
|
141
148
|
}
|
|
142
149
|
static get is() { return "dso-header"; }
|
|
143
150
|
static get encapsulation() { return "shadow"; }
|
|
@@ -148,13 +155,18 @@ export class Header {
|
|
|
148
155
|
"$": ["header.css"]
|
|
149
156
|
}; }
|
|
150
157
|
static get properties() { return {
|
|
151
|
-
"
|
|
152
|
-
"type": "
|
|
158
|
+
"mainMenu": {
|
|
159
|
+
"type": "unknown",
|
|
153
160
|
"mutable": false,
|
|
154
161
|
"complexType": {
|
|
155
|
-
"original": "
|
|
156
|
-
"resolved": "
|
|
157
|
-
"references": {
|
|
162
|
+
"original": "HeaderMenuItem[]",
|
|
163
|
+
"resolved": "HeaderMenuItem[] | undefined",
|
|
164
|
+
"references": {
|
|
165
|
+
"HeaderMenuItem": {
|
|
166
|
+
"location": "import",
|
|
167
|
+
"path": "./header.interfaces"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
158
170
|
},
|
|
159
171
|
"required": false,
|
|
160
172
|
"optional": true,
|
|
@@ -162,81 +174,77 @@ export class Header {
|
|
|
162
174
|
"tags": [],
|
|
163
175
|
"text": ""
|
|
164
176
|
},
|
|
165
|
-
"
|
|
166
|
-
"reflect": false
|
|
177
|
+
"defaultValue": "[]"
|
|
167
178
|
},
|
|
168
|
-
"
|
|
179
|
+
"useDropDownMenu": {
|
|
169
180
|
"type": "string",
|
|
170
181
|
"mutable": false,
|
|
171
182
|
"complexType": {
|
|
172
|
-
"original": "
|
|
173
|
-
"resolved": "
|
|
183
|
+
"original": "\"always\" | \"never\" | \"auto\"",
|
|
184
|
+
"resolved": "\"always\" | \"auto\" | \"never\"",
|
|
174
185
|
"references": {}
|
|
175
186
|
},
|
|
176
187
|
"required": false,
|
|
177
|
-
"optional":
|
|
188
|
+
"optional": false,
|
|
178
189
|
"docs": {
|
|
179
190
|
"tags": [],
|
|
180
191
|
"text": ""
|
|
181
192
|
},
|
|
182
|
-
"attribute": "
|
|
183
|
-
"reflect": false
|
|
193
|
+
"attribute": "use-drop-down-menu",
|
|
194
|
+
"reflect": false,
|
|
195
|
+
"defaultValue": "\"auto\""
|
|
184
196
|
},
|
|
185
|
-
"
|
|
186
|
-
"type": "
|
|
197
|
+
"authStatus": {
|
|
198
|
+
"type": "string",
|
|
187
199
|
"mutable": false,
|
|
188
200
|
"complexType": {
|
|
189
|
-
"original": "
|
|
190
|
-
"resolved": "
|
|
191
|
-
"references": {
|
|
192
|
-
"HeaderMenuItem": {
|
|
193
|
-
"location": "local"
|
|
194
|
-
}
|
|
195
|
-
}
|
|
201
|
+
"original": "'none' | 'loggedIn' | 'loggedOut'",
|
|
202
|
+
"resolved": "\"loggedIn\" | \"loggedOut\" | \"none\"",
|
|
203
|
+
"references": {}
|
|
196
204
|
},
|
|
197
205
|
"required": false,
|
|
198
206
|
"optional": false,
|
|
199
207
|
"docs": {
|
|
200
208
|
"tags": [],
|
|
201
|
-
"text": ""
|
|
209
|
+
"text": "Used to show the login/logout option. 'none' renders nothing."
|
|
202
210
|
},
|
|
203
|
-
"
|
|
211
|
+
"attribute": "auth-status",
|
|
212
|
+
"reflect": false,
|
|
213
|
+
"defaultValue": "'none'"
|
|
204
214
|
},
|
|
205
|
-
"
|
|
215
|
+
"loginUrl": {
|
|
206
216
|
"type": "string",
|
|
207
217
|
"mutable": false,
|
|
208
218
|
"complexType": {
|
|
209
|
-
"original": "
|
|
210
|
-
"resolved": "
|
|
219
|
+
"original": "string",
|
|
220
|
+
"resolved": "string | undefined",
|
|
211
221
|
"references": {}
|
|
212
222
|
},
|
|
213
223
|
"required": false,
|
|
214
|
-
"optional":
|
|
224
|
+
"optional": true,
|
|
215
225
|
"docs": {
|
|
216
226
|
"tags": [],
|
|
217
|
-
"text": ""
|
|
227
|
+
"text": "When the `authStatus` is `loggedOut` a loginUrl can be provided, the login button will render as an anchor."
|
|
218
228
|
},
|
|
219
|
-
"attribute": "
|
|
220
|
-
"reflect": false
|
|
221
|
-
"defaultValue": "\"auto\""
|
|
229
|
+
"attribute": "login-url",
|
|
230
|
+
"reflect": false
|
|
222
231
|
},
|
|
223
|
-
"
|
|
224
|
-
"type": "
|
|
232
|
+
"logoutUrl": {
|
|
233
|
+
"type": "string",
|
|
225
234
|
"mutable": false,
|
|
226
235
|
"complexType": {
|
|
227
|
-
"original": "
|
|
228
|
-
"resolved": "
|
|
236
|
+
"original": "string",
|
|
237
|
+
"resolved": "string | undefined",
|
|
229
238
|
"references": {}
|
|
230
239
|
},
|
|
231
240
|
"required": false,
|
|
232
|
-
"optional":
|
|
241
|
+
"optional": true,
|
|
233
242
|
"docs": {
|
|
234
243
|
"tags": [],
|
|
235
244
|
"text": ""
|
|
236
245
|
},
|
|
237
|
-
"attribute": "
|
|
238
|
-
"reflect": false
|
|
239
|
-
"defaultValue": "false"
|
|
246
|
+
"attribute": "logout-url",
|
|
247
|
+
"reflect": false
|
|
240
248
|
},
|
|
241
249
|
"userProfileName": {
|
|
242
250
|
"type": "string",
|
|
@@ -296,40 +304,26 @@ export class Header {
|
|
|
296
304
|
"overflowMenuItems": {}
|
|
297
305
|
}; }
|
|
298
306
|
static get events() { return [{
|
|
299
|
-
"method": "
|
|
300
|
-
"name": "
|
|
301
|
-
"bubbles": true,
|
|
302
|
-
"cancelable": true,
|
|
303
|
-
"composed": true,
|
|
304
|
-
"docs": {
|
|
305
|
-
"tags": [],
|
|
306
|
-
"text": ""
|
|
307
|
-
},
|
|
308
|
-
"complexType": {
|
|
309
|
-
"original": "HeaderMenuItemClickEvent",
|
|
310
|
-
"resolved": "HeaderMenuItemClickEvent",
|
|
311
|
-
"references": {
|
|
312
|
-
"HeaderMenuItemClickEvent": {
|
|
313
|
-
"location": "local"
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}, {
|
|
318
|
-
"method": "logoutClick",
|
|
319
|
-
"name": "logoutClick",
|
|
307
|
+
"method": "headerClick",
|
|
308
|
+
"name": "headerClick",
|
|
320
309
|
"bubbles": true,
|
|
321
310
|
"cancelable": true,
|
|
322
311
|
"composed": true,
|
|
323
312
|
"docs": {
|
|
324
313
|
"tags": [],
|
|
325
|
-
"text": "
|
|
314
|
+
"text": "Emitted when something in the header is selected.\n\n`event.detail.type` indicates the functionality the user pressed. eg. `'login'` or `'menuItem'`"
|
|
326
315
|
},
|
|
327
316
|
"complexType": {
|
|
328
|
-
"original": "
|
|
329
|
-
"resolved": "
|
|
317
|
+
"original": "HeaderClickEvent | HeaderClickMenuItemEvent",
|
|
318
|
+
"resolved": "HeaderClickEvent | HeaderClickMenuItemEvent",
|
|
330
319
|
"references": {
|
|
331
|
-
"
|
|
332
|
-
"location": "
|
|
320
|
+
"HeaderClickEvent": {
|
|
321
|
+
"location": "import",
|
|
322
|
+
"path": "./header.interfaces"
|
|
323
|
+
},
|
|
324
|
+
"HeaderClickMenuItemEvent": {
|
|
325
|
+
"location": "import",
|
|
326
|
+
"path": "./header.interfaces"
|
|
333
327
|
}
|
|
334
328
|
}
|
|
335
329
|
}
|
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
import { html } from "lit-html";
|
|
2
2
|
import { ifDefined } from "lit-html/directives/if-defined.js";
|
|
3
|
-
export function headerTemplate({ logo, subLogo, mainMenu, useDropDownMenu,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<div slot="logo"><img height="40" alt="Omgevingsloket" src="${logo}" /></div>
|
|
19
|
-
<div slot="sub-logo"><img alt="Regels op de kaart" src="${subLogo}" /></div></div>
|
|
20
|
-
</dso-header>`
|
|
21
|
-
: html `<dso-header
|
|
22
|
-
.mainMenu=${mainMenu}
|
|
23
|
-
use-drop-down-menu=${ifDefined(useDropDownMenu)}
|
|
24
|
-
is-logged-in=${ifDefined(isLoggedIn)}
|
|
25
|
-
login-url=${ifDefined(bindLoginUrl)}
|
|
26
|
-
logout-url=${ifDefined(bindLogoutUrl)}
|
|
27
|
-
user-profile-url=${ifDefined(userProfileUrl)}
|
|
28
|
-
user-profile-name=${ifDefined(userProfileName)}
|
|
29
|
-
user-home-url=${ifDefined(userHomeUrl)}
|
|
30
|
-
@menuItemClick=${menuItemClick}
|
|
31
|
-
>
|
|
32
|
-
<div slot="logo"><img alt="Omgevingsloket" src="${logo}" /></div>
|
|
33
|
-
</dso-header>`;
|
|
3
|
+
export function headerTemplate({ logo, subLogo, mainMenu, useDropDownMenu, authStatus, loginUrl, logoutUrl, userProfileUrl, userProfileName, userHomeUrl, onHeaderClick, }) {
|
|
4
|
+
return html `<dso-header
|
|
5
|
+
.mainMenu=${mainMenu}
|
|
6
|
+
use-drop-down-menu=${ifDefined(useDropDownMenu)}
|
|
7
|
+
auth-status=${ifDefined(authStatus)}
|
|
8
|
+
login-url=${ifDefined(loginUrl)}
|
|
9
|
+
logout-url=${ifDefined(logoutUrl)}
|
|
10
|
+
user-profile-url=${ifDefined(userProfileUrl)}
|
|
11
|
+
user-profile-name=${ifDefined(userProfileName)}
|
|
12
|
+
user-home-url=${ifDefined(userHomeUrl)}
|
|
13
|
+
@headerClick=${onHeaderClick}
|
|
14
|
+
>
|
|
15
|
+
<div slot="logo"><img height="40" alt="Omgevingsloket" src="${logo}" /></div>
|
|
16
|
+
${subLogo ? html `<div slot="sub-logo"><img alt="Regels op de kaart" src="${subLogo}" /></div>` : undefined}
|
|
17
|
+
</dso-header>`;
|
|
34
18
|
}
|
|
@@ -77,7 +77,6 @@ import sortAscending from '@dso-toolkit/sources/src/icons/sort-ascending.svg';
|
|
|
77
77
|
import sortDescending from '@dso-toolkit/sources/src/icons/sort-descending.svg';
|
|
78
78
|
import sort from '@dso-toolkit/sources/src/icons/sort.svg';
|
|
79
79
|
import sound from '@dso-toolkit/sources/src/icons/sound.svg';
|
|
80
|
-
import statusForbidden from '@dso-toolkit/sources/src/icons/status-forbidden.svg';
|
|
81
80
|
import statusDanger from '@dso-toolkit/sources/src/icons/status-danger.svg';
|
|
82
81
|
import statusInfo from '@dso-toolkit/sources/src/icons/status-info.svg';
|
|
83
82
|
import statusSuccess from '@dso-toolkit/sources/src/icons/status-success.svg';
|
|
@@ -171,7 +170,6 @@ const icons = [
|
|
|
171
170
|
{ alias: 'sort', svg: sort },
|
|
172
171
|
{ alias: 'sound', svg: sound },
|
|
173
172
|
{ alias: 'status-danger', svg: statusDanger },
|
|
174
|
-
{ alias: 'status-forbidden', svg: statusForbidden },
|
|
175
173
|
{ alias: 'status-info', svg: statusInfo },
|
|
176
174
|
{ alias: 'status-success', svg: statusSuccess },
|
|
177
175
|
{ alias: 'status-warning', svg: statusWarning },
|
|
@@ -7,11 +7,11 @@ export class Pagination {
|
|
|
7
7
|
this.formatHref = (page) => '#' + page;
|
|
8
8
|
}
|
|
9
9
|
clickHandler(e, page) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
this.selectPage.emit({
|
|
11
|
+
originalEvent: e,
|
|
12
|
+
page,
|
|
13
|
+
isModifiedEvent: e.button !== 0 || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey,
|
|
14
|
+
});
|
|
15
15
|
}
|
|
16
16
|
;
|
|
17
17
|
render() {
|
|
@@ -21,13 +21,13 @@ export class Pagination {
|
|
|
21
21
|
const pages = Array.from({ length: this.totalPages }, (_value, i) => i + 1);
|
|
22
22
|
return (h("ul", { class: "pagination" },
|
|
23
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[
|
|
24
|
+
h("a", { href: this.formatHref(pages[0]), "aria-label": "Vorige", onClick: e => this.currentPage && this.clickHandler(e, pages[this.currentPage - 2]) },
|
|
25
25
|
h("dso-icon", { icon: "chevron-left" }))),
|
|
26
26
|
pages.map(page => (h("li", { key: page, class: this.currentPage === page ? 'active' : undefined }, this.currentPage === page
|
|
27
27
|
? (h("span", { "aria-current": "page" }, page))
|
|
28
28
|
: (h("a", { href: this.formatHref(page), onClick: e => this.clickHandler(e, page) }, page))))),
|
|
29
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[
|
|
30
|
+
h("a", { href: this.formatHref(pages[pages.length - 1]), "aria-label": "Volgende", onClick: e => this.currentPage && this.clickHandler(e, pages[this.currentPage]) },
|
|
31
31
|
h("dso-icon", { icon: "chevron-right" })))));
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "dso-pagination"; }
|