@utrecht/web-component-library-stencil 1.0.0-alpha.102 → 1.0.0-alpha.106
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/loader.cjs.js +1 -1
- package/dist/cjs/utrecht-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/utrecht-custom-checkbox.cjs.entry.js +52 -0
- package/dist/cjs/utrecht-document.cjs.entry.js +1 -1
- package/dist/cjs/utrecht-logo.cjs.entry.js +1 -1
- package/dist/cjs/utrecht-page-content.cjs.entry.js +19 -0
- package/dist/cjs/utrecht-page-header.cjs.entry.js +19 -0
- package/dist/cjs/utrecht-page.cjs.entry.js +19 -0
- package/dist/cjs/utrecht-sidenav.cjs.entry.js +1 -1
- package/dist/cjs/utrecht.cjs.js +1 -1
- package/dist/collection/breadcrumb/bem.js +7 -0
- package/dist/collection/breadcrumb/stencil.css +1 -1
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/custom-checkbox/stencil.css +138 -0
- package/dist/collection/custom-checkbox/stencil.js +205 -0
- package/dist/collection/document/stencil.css +4 -1
- package/dist/collection/logo/stencil.css +2 -2
- package/dist/collection/navigatie sidenav/bem.css +1 -1
- package/dist/collection/page/bem.js +6 -0
- package/dist/collection/page/stencil.css +30 -0
- package/dist/collection/page/stencil.js +20 -0
- package/dist/collection/page-content/bem.js +10 -0
- package/dist/collection/page-content/stencil.css +31 -0
- package/dist/collection/page-content/stencil.js +20 -0
- package/dist/collection/page-header/bem.js +6 -0
- package/dist/collection/page-header/stencil.css +30 -0
- package/dist/collection/page-header/stencil.js +20 -0
- package/dist/custom-checkbox/stencil.d.ts +17 -0
- package/dist/custom-checkbox/stencil.js +85 -0
- package/dist/custom-elements/index.d.ts +24 -0
- package/dist/custom-elements/index.js +187 -91
- package/dist/esm/loader.js +1 -1
- package/dist/esm/utrecht-breadcrumb.entry.js +1 -1
- package/dist/esm/utrecht-custom-checkbox.entry.js +48 -0
- package/dist/esm/utrecht-document.entry.js +1 -1
- package/dist/esm/utrecht-logo.entry.js +1 -1
- package/dist/esm/utrecht-page-content.entry.js +15 -0
- package/dist/esm/utrecht-page-header.entry.js +15 -0
- package/dist/esm/utrecht-page.entry.js +15 -0
- package/dist/esm/utrecht-sidenav.entry.js +1 -1
- package/dist/esm/utrecht.js +1 -1
- package/dist/page/stencil.d.ts +7 -0
- package/dist/page/stencil.js +26 -0
- package/dist/page-content/stencil.d.ts +7 -0
- package/dist/page-content/stencil.js +26 -0
- package/dist/page-header/stencil.d.ts +7 -0
- package/dist/page-header/stencil.js +26 -0
- package/dist/types/components.d.ts +66 -0
- package/dist/types/custom-checkbox/stencil.d.ts +17 -0
- package/dist/types/page/stencil.d.ts +7 -0
- package/dist/types/page-content/stencil.d.ts +7 -0
- package/dist/types/page-header/stencil.d.ts +7 -0
- package/dist/utrecht/p-3aa64b31.entry.js +1 -0
- package/dist/utrecht/{p-56879b89.entry.js → p-507be14d.entry.js} +1 -1
- package/dist/utrecht/{p-d9794f59.entry.js → p-69745ae4.entry.js} +1 -1
- package/dist/utrecht/p-6f593189.entry.js +1 -0
- package/dist/utrecht/p-a2820588.entry.js +1 -0
- package/dist/utrecht/p-a3ea6b4f.entry.js +1 -0
- package/dist/utrecht/p-b2fe81be.entry.js +1 -0
- package/dist/utrecht/{p-22ccf8ac.entry.js → p-fe8b3fe4.entry.js} +1 -1
- package/dist/utrecht/utrecht.esm.js +1 -1
- package/package.json +5 -5
- package/dist/utrecht/p-8ec53ee2.entry.js +0 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2
|
|
3
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
+
*/
|
|
5
|
+
import { Component, Event, h, Prop } from "@stencil/core";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
export class CustomCheckbox {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.disabled = false;
|
|
10
|
+
this.checked = false;
|
|
11
|
+
this.indeterminate = false;
|
|
12
|
+
this.invalid = false;
|
|
13
|
+
this.required = false;
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
const { checked, disabled, indeterminate, invalid, required } = this;
|
|
17
|
+
const active = false;
|
|
18
|
+
const toggleInteraction = () => {
|
|
19
|
+
if (!this.disabled) {
|
|
20
|
+
this.checked = !this.checked;
|
|
21
|
+
this.utrechtInput.emit(this);
|
|
22
|
+
this.utrechtChange.emit(this);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const handleClick = () => {
|
|
26
|
+
toggleInteraction();
|
|
27
|
+
};
|
|
28
|
+
const handleKeyPress = (evt) => {
|
|
29
|
+
if (evt.code === "Space" || evt.key === " ") {
|
|
30
|
+
// Do not scroll the page using Space when the toggle is focussed
|
|
31
|
+
evt.preventDefault();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const handleKeyUp = (evt) => {
|
|
35
|
+
if (evt.code === "Space" || evt.key === " ") {
|
|
36
|
+
toggleInteraction();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return (h("div", { class: "utrecht-custom-checkbox", role: "checkbox", tabIndex: disabled ? null : 0, "aria-checked": indeterminate ? "mixed" : checked ? "true" : "false", "aria-disabled": disabled ? "true" : null, "aria-invalid": invalid ? "true" : null, "aria-required": required ? "true" : null, onClick: handleClick, onKeyPress: handleKeyPress, onKeyUp: handleKeyUp },
|
|
40
|
+
h("div", { class: clsx("utrecht-custom-checkbox__box", active && "utrecht-custom-checkbox__box--active", checked && "utrecht-custom-checkbox__box--checked", !checked && "utrecht-custom-checkbox__box--not-checked", disabled && "utrecht-custom-checkbox__box--disabled", invalid && "utrecht-custom-checkbox__box--invalid", indeterminate && "utrecht-custom-checkbox__box--indeterminate") },
|
|
41
|
+
checked && h("utrecht-icon-checkmark", { class: "utrecht-custom-checkbox__icon" }, "\u2714"),
|
|
42
|
+
indeterminate && (h("utrecht-icon-indeterminate", { class: "utrecht-custom-checkbox__icon" }, "\u25A0")))));
|
|
43
|
+
}
|
|
44
|
+
static get is() { return "utrecht-custom-checkbox"; }
|
|
45
|
+
static get encapsulation() { return "shadow"; }
|
|
46
|
+
static get originalStyleUrls() { return {
|
|
47
|
+
"$": ["stencil.scss"]
|
|
48
|
+
}; }
|
|
49
|
+
static get styleUrls() { return {
|
|
50
|
+
"$": ["stencil.css"]
|
|
51
|
+
}; }
|
|
52
|
+
static get properties() { return {
|
|
53
|
+
"disabled": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"mutable": false,
|
|
56
|
+
"complexType": {
|
|
57
|
+
"original": "boolean",
|
|
58
|
+
"resolved": "boolean",
|
|
59
|
+
"references": {}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": ""
|
|
66
|
+
},
|
|
67
|
+
"attribute": "disabled",
|
|
68
|
+
"reflect": true,
|
|
69
|
+
"defaultValue": "false"
|
|
70
|
+
},
|
|
71
|
+
"checked": {
|
|
72
|
+
"type": "boolean",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "boolean",
|
|
76
|
+
"resolved": "boolean",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": false,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": ""
|
|
84
|
+
},
|
|
85
|
+
"attribute": "checked",
|
|
86
|
+
"reflect": true,
|
|
87
|
+
"defaultValue": "false"
|
|
88
|
+
},
|
|
89
|
+
"indeterminate": {
|
|
90
|
+
"type": "boolean",
|
|
91
|
+
"mutable": false,
|
|
92
|
+
"complexType": {
|
|
93
|
+
"original": "boolean",
|
|
94
|
+
"resolved": "boolean",
|
|
95
|
+
"references": {}
|
|
96
|
+
},
|
|
97
|
+
"required": false,
|
|
98
|
+
"optional": false,
|
|
99
|
+
"docs": {
|
|
100
|
+
"tags": [],
|
|
101
|
+
"text": ""
|
|
102
|
+
},
|
|
103
|
+
"attribute": "indeterminate",
|
|
104
|
+
"reflect": true,
|
|
105
|
+
"defaultValue": "false"
|
|
106
|
+
},
|
|
107
|
+
"invalid": {
|
|
108
|
+
"type": "boolean",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "boolean",
|
|
112
|
+
"resolved": "boolean",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": false,
|
|
116
|
+
"optional": false,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": ""
|
|
120
|
+
},
|
|
121
|
+
"attribute": "invalid",
|
|
122
|
+
"reflect": true,
|
|
123
|
+
"defaultValue": "false"
|
|
124
|
+
},
|
|
125
|
+
"required": {
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"mutable": false,
|
|
128
|
+
"complexType": {
|
|
129
|
+
"original": "boolean",
|
|
130
|
+
"resolved": "boolean",
|
|
131
|
+
"references": {}
|
|
132
|
+
},
|
|
133
|
+
"required": false,
|
|
134
|
+
"optional": false,
|
|
135
|
+
"docs": {
|
|
136
|
+
"tags": [],
|
|
137
|
+
"text": ""
|
|
138
|
+
},
|
|
139
|
+
"attribute": "required",
|
|
140
|
+
"reflect": true,
|
|
141
|
+
"defaultValue": "false"
|
|
142
|
+
}
|
|
143
|
+
}; }
|
|
144
|
+
static get events() { return [{
|
|
145
|
+
"method": "utrechtBlur",
|
|
146
|
+
"name": "utrechtBlur",
|
|
147
|
+
"bubbles": true,
|
|
148
|
+
"cancelable": true,
|
|
149
|
+
"composed": true,
|
|
150
|
+
"docs": {
|
|
151
|
+
"tags": [],
|
|
152
|
+
"text": ""
|
|
153
|
+
},
|
|
154
|
+
"complexType": {
|
|
155
|
+
"original": "any",
|
|
156
|
+
"resolved": "any",
|
|
157
|
+
"references": {}
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
"method": "utrechtChange",
|
|
161
|
+
"name": "utrechtChange",
|
|
162
|
+
"bubbles": true,
|
|
163
|
+
"cancelable": true,
|
|
164
|
+
"composed": true,
|
|
165
|
+
"docs": {
|
|
166
|
+
"tags": [],
|
|
167
|
+
"text": ""
|
|
168
|
+
},
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "any",
|
|
171
|
+
"resolved": "any",
|
|
172
|
+
"references": {}
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
"method": "utrechtFocus",
|
|
176
|
+
"name": "utrechtFocus",
|
|
177
|
+
"bubbles": true,
|
|
178
|
+
"cancelable": true,
|
|
179
|
+
"composed": true,
|
|
180
|
+
"docs": {
|
|
181
|
+
"tags": [],
|
|
182
|
+
"text": ""
|
|
183
|
+
},
|
|
184
|
+
"complexType": {
|
|
185
|
+
"original": "any",
|
|
186
|
+
"resolved": "any",
|
|
187
|
+
"references": {}
|
|
188
|
+
}
|
|
189
|
+
}, {
|
|
190
|
+
"method": "utrechtInput",
|
|
191
|
+
"name": "utrechtInput",
|
|
192
|
+
"bubbles": true,
|
|
193
|
+
"cancelable": true,
|
|
194
|
+
"composed": true,
|
|
195
|
+
"docs": {
|
|
196
|
+
"tags": [],
|
|
197
|
+
"text": ""
|
|
198
|
+
},
|
|
199
|
+
"complexType": {
|
|
200
|
+
"original": "any",
|
|
201
|
+
"resolved": "any",
|
|
202
|
+
"references": {}
|
|
203
|
+
}
|
|
204
|
+
}]; }
|
|
205
|
+
}
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
.utrecht-document {
|
|
10
10
|
/* reset `font-smoothing: antialiasing`, prefer automatic (`subpixel-antialiasing`) behavior for high-dpi screens */
|
|
11
|
-
background-color: var(--utrecht-document-background-color, inherit);
|
|
12
11
|
color: var(--utrecht-document-color, inherit);
|
|
13
12
|
font-family: var(--utrecht-document-font-family, inherit);
|
|
14
13
|
font-size: var(--utrecht-document-font-size, inherit);
|
|
@@ -21,6 +20,10 @@
|
|
|
21
20
|
letter-spacing: 0 !important;
|
|
22
21
|
}
|
|
23
22
|
|
|
23
|
+
.utrecht-document--surface {
|
|
24
|
+
background-color: var(--utrecht-document-background-color, inherit);
|
|
25
|
+
}
|
|
26
|
+
|
|
24
27
|
:host {
|
|
25
28
|
display: block;
|
|
26
29
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2021 Robbert Broersma
|
|
4
4
|
*/
|
|
5
5
|
.utrecht-logo {
|
|
6
|
-
max-height: var(--utrecht-logo-max-height);
|
|
7
|
-
max-width: var(--utrecht-logo-max-width);
|
|
6
|
+
max-height: var(--utrecht-logo-max-height, 192px);
|
|
7
|
+
max-width: var(--utrecht-logo-max-width, 96px);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.utrecht-logo__decoration-1 {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2
|
|
3
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license EUPL-1.2
|
|
7
|
+
* Copyright (c) 2021 Gemeente Utrecht
|
|
8
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
9
|
+
*/
|
|
10
|
+
.utrecht-page {
|
|
11
|
+
margin-inline-end: auto;
|
|
12
|
+
margin-inline-start: auto;
|
|
13
|
+
max-inline-size: calc(var(--utrecht-page-max-inline-size) - var(--utrecht-page-margin-inline-start, 0px) - var(--utrecht-page-margin-inline-end, 0px));
|
|
14
|
+
padding-inline-end: var(--utrecht-page-margin-inline-end);
|
|
15
|
+
padding-inline-start: var(--utrecht-page-margin-inline-start);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.utrecht-page__content {
|
|
19
|
+
background-color: var(--utrecht-page-background-color);
|
|
20
|
+
color: var(--utrecht-page-color);
|
|
21
|
+
max-inline-size: var(--utrecht-page-max-inline-size);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host {
|
|
25
|
+
display: block;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([hidden]) {
|
|
29
|
+
display: none !important;
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @license EUPL-1.2
|
|
4
|
+
* Copyright (c) 2021 Gemeente Utrecht
|
|
5
|
+
*/
|
|
6
|
+
export class Page {
|
|
7
|
+
render() {
|
|
8
|
+
return (h("div", { class: "utrecht-page" },
|
|
9
|
+
h("div", { class: "utrecht-page__content" },
|
|
10
|
+
h("slot", null))));
|
|
11
|
+
}
|
|
12
|
+
static get is() { return "utrecht-page"; }
|
|
13
|
+
static get encapsulation() { return "shadow"; }
|
|
14
|
+
static get originalStyleUrls() { return {
|
|
15
|
+
"$": ["stencil.scss"]
|
|
16
|
+
}; }
|
|
17
|
+
static get styleUrls() { return {
|
|
18
|
+
"$": ["stencil.css"]
|
|
19
|
+
}; }
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2
|
|
3
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const PageContent = ({ asideHTML = null, innerHTML = '', navHTML = null }) => `<div class="utrecht-page-content">
|
|
7
|
+
${navHTML ? ` <nav class="utrecht-page-content__nav">${navHTML}</nav>` : ''}
|
|
8
|
+
<main class="utrecht-page-content__main">${innerHTML}</main>
|
|
9
|
+
${asideHTML ? `<aside class="utrecht-page-content__aside">${asideHTML}</aside>` : ''}
|
|
10
|
+
</div>`;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2
|
|
3
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license EUPL-1.2
|
|
7
|
+
* Copyright (c) 2021 Gemeente Utrecht
|
|
8
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
9
|
+
*/
|
|
10
|
+
.utrecht-page-content {
|
|
11
|
+
padding-block-end: var(--utrecht-page-content-padding-block-end);
|
|
12
|
+
padding-block-start: var(--utrecht-page-content-padding-block-start);
|
|
13
|
+
padding-inline-end: var(--utrecht-page-padding-inline-end);
|
|
14
|
+
padding-inline-start: var(--utrecht-page-padding-inline-start);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.utrecht-page-content__main {
|
|
18
|
+
grid-area: main;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.utrecht-page-content__aside {
|
|
22
|
+
grid-area: aside;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host {
|
|
26
|
+
display: block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([hidden]) {
|
|
30
|
+
display: none !important;
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @license EUPL-1.2
|
|
4
|
+
* Copyright (c) 2021 Gemeente Utrecht
|
|
5
|
+
*/
|
|
6
|
+
export class Page {
|
|
7
|
+
render() {
|
|
8
|
+
return (h("div", { class: "utrecht-page-content" },
|
|
9
|
+
h("main", { class: "utrecht-page-content__main" },
|
|
10
|
+
h("slot", null))));
|
|
11
|
+
}
|
|
12
|
+
static get is() { return "utrecht-page-content"; }
|
|
13
|
+
static get encapsulation() { return "shadow"; }
|
|
14
|
+
static get originalStyleUrls() { return {
|
|
15
|
+
"$": ["stencil.scss"]
|
|
16
|
+
}; }
|
|
17
|
+
static get styleUrls() { return {
|
|
18
|
+
"$": ["stencil.css"]
|
|
19
|
+
}; }
|
|
20
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2
|
|
3
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license EUPL-1.2
|
|
7
|
+
* Copyright (c) 2021 Gemeente Utrecht
|
|
8
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
9
|
+
*/
|
|
10
|
+
.utrecht-page-header {
|
|
11
|
+
background-color: var(--utrecht-page-header-background-color);
|
|
12
|
+
color: var(--utrecht-page-header-color);
|
|
13
|
+
grid-area: "utrecht-header";
|
|
14
|
+
padding-block-end: var(--utrecht-page-header-padding-block-end);
|
|
15
|
+
padding-block-start: var(--utrecht-page-header-padding-block-start);
|
|
16
|
+
padding-inline-end: var(--utrecht-page-padding-inline-end);
|
|
17
|
+
padding-inline-start: var(--utrecht-page-padding-inline-start);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.utrecht-page-header__content {
|
|
21
|
+
max-inline-size: var(--utrecht-page-max-inline-size);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host {
|
|
25
|
+
display: block;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([hidden]) {
|
|
29
|
+
display: none !important;
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @license EUPL-1.2
|
|
4
|
+
* Copyright (c) 2021 Gemeente Utrecht
|
|
5
|
+
*/
|
|
6
|
+
export class PageHeader {
|
|
7
|
+
render() {
|
|
8
|
+
return (h("header", { class: "utrecht-page-header" },
|
|
9
|
+
h("div", { class: "utrecht-page-header__content" },
|
|
10
|
+
h("slot", null))));
|
|
11
|
+
}
|
|
12
|
+
static get is() { return "utrecht-page-header"; }
|
|
13
|
+
static get encapsulation() { return "shadow"; }
|
|
14
|
+
static get originalStyleUrls() { return {
|
|
15
|
+
"$": ["stencil.scss"]
|
|
16
|
+
}; }
|
|
17
|
+
static get styleUrls() { return {
|
|
18
|
+
"$": ["stencil.css"]
|
|
19
|
+
}; }
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2
|
|
3
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
+
*/
|
|
5
|
+
import { EventEmitter } from "@stencil/core";
|
|
6
|
+
export declare class CustomCheckbox {
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
checked: boolean;
|
|
9
|
+
indeterminate: boolean;
|
|
10
|
+
invalid: boolean;
|
|
11
|
+
required: boolean;
|
|
12
|
+
utrechtBlur: EventEmitter;
|
|
13
|
+
utrechtChange: EventEmitter;
|
|
14
|
+
utrechtFocus: EventEmitter;
|
|
15
|
+
utrechtInput: EventEmitter;
|
|
16
|
+
render(): any;
|
|
17
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2
|
|
3
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
+
*/
|
|
5
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
6
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
};
|
|
11
|
+
import { Component, Event, h, Prop } from "@stencil/core";
|
|
12
|
+
import clsx from "clsx";
|
|
13
|
+
let CustomCheckbox = class CustomCheckbox {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.disabled = false;
|
|
16
|
+
this.checked = false;
|
|
17
|
+
this.indeterminate = false;
|
|
18
|
+
this.invalid = false;
|
|
19
|
+
this.required = false;
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
const { checked, disabled, indeterminate, invalid, required } = this;
|
|
23
|
+
const active = false;
|
|
24
|
+
const toggleInteraction = () => {
|
|
25
|
+
if (!this.disabled) {
|
|
26
|
+
this.checked = !this.checked;
|
|
27
|
+
this.utrechtInput.emit(this);
|
|
28
|
+
this.utrechtChange.emit(this);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const handleClick = () => {
|
|
32
|
+
toggleInteraction();
|
|
33
|
+
};
|
|
34
|
+
const handleKeyPress = (evt) => {
|
|
35
|
+
if (evt.code === "Space" || evt.key === " ") {
|
|
36
|
+
// Do not scroll the page using Space when the toggle is focussed
|
|
37
|
+
evt.preventDefault();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const handleKeyUp = (evt) => {
|
|
41
|
+
if (evt.code === "Space" || evt.key === " ") {
|
|
42
|
+
toggleInteraction();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return (h("div", { class: "utrecht-custom-checkbox", role: "checkbox", tabIndex: disabled ? null : 0, "aria-checked": indeterminate ? "mixed" : checked ? "true" : "false", "aria-disabled": disabled ? "true" : null, "aria-invalid": invalid ? "true" : null, "aria-required": required ? "true" : null, onClick: handleClick, onKeyPress: handleKeyPress, onKeyUp: handleKeyUp },
|
|
46
|
+
h("div", { class: clsx("utrecht-custom-checkbox__box", active && "utrecht-custom-checkbox__box--active", checked && "utrecht-custom-checkbox__box--checked", !checked && "utrecht-custom-checkbox__box--not-checked", disabled && "utrecht-custom-checkbox__box--disabled", invalid && "utrecht-custom-checkbox__box--invalid", indeterminate && "utrecht-custom-checkbox__box--indeterminate") },
|
|
47
|
+
checked && h("utrecht-icon-checkmark", { class: "utrecht-custom-checkbox__icon" }, "\u2714"),
|
|
48
|
+
indeterminate && (h("utrecht-icon-indeterminate", { class: "utrecht-custom-checkbox__icon" }, "\u25A0")))));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
__decorate([
|
|
52
|
+
Prop({ reflect: true })
|
|
53
|
+
], CustomCheckbox.prototype, "disabled", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
Prop({ reflect: true })
|
|
56
|
+
], CustomCheckbox.prototype, "checked", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
Prop({ reflect: true })
|
|
59
|
+
], CustomCheckbox.prototype, "indeterminate", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
Prop({ reflect: true })
|
|
62
|
+
], CustomCheckbox.prototype, "invalid", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
Prop({ reflect: true })
|
|
65
|
+
], CustomCheckbox.prototype, "required", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
Event()
|
|
68
|
+
], CustomCheckbox.prototype, "utrechtBlur", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
Event()
|
|
71
|
+
], CustomCheckbox.prototype, "utrechtChange", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
Event()
|
|
74
|
+
], CustomCheckbox.prototype, "utrechtFocus", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
Event()
|
|
77
|
+
], CustomCheckbox.prototype, "utrechtInput", void 0);
|
|
78
|
+
CustomCheckbox = __decorate([
|
|
79
|
+
Component({
|
|
80
|
+
tag: "utrecht-custom-checkbox",
|
|
81
|
+
styleUrl: "stencil.scss",
|
|
82
|
+
shadow: true,
|
|
83
|
+
})
|
|
84
|
+
], CustomCheckbox);
|
|
85
|
+
export { CustomCheckbox };
|
|
@@ -50,6 +50,12 @@ export const UtrechtContactCardTemplate: {
|
|
|
50
50
|
new (): UtrechtContactCardTemplate;
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
+
interface UtrechtCustomCheckbox extends Components.UtrechtCustomCheckbox, HTMLElement {}
|
|
54
|
+
export const UtrechtCustomCheckbox: {
|
|
55
|
+
prototype: UtrechtCustomCheckbox;
|
|
56
|
+
new (): UtrechtCustomCheckbox;
|
|
57
|
+
};
|
|
58
|
+
|
|
53
59
|
interface UtrechtDigidButton extends Components.UtrechtDigidButton, HTMLElement {}
|
|
54
60
|
export const UtrechtDigidButton: {
|
|
55
61
|
prototype: UtrechtDigidButton;
|
|
@@ -266,12 +272,30 @@ export const UtrechtLogoButton: {
|
|
|
266
272
|
new (): UtrechtLogoButton;
|
|
267
273
|
};
|
|
268
274
|
|
|
275
|
+
interface UtrechtPage extends Components.UtrechtPage, HTMLElement {}
|
|
276
|
+
export const UtrechtPage: {
|
|
277
|
+
prototype: UtrechtPage;
|
|
278
|
+
new (): UtrechtPage;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
interface UtrechtPageContent extends Components.UtrechtPageContent, HTMLElement {}
|
|
282
|
+
export const UtrechtPageContent: {
|
|
283
|
+
prototype: UtrechtPageContent;
|
|
284
|
+
new (): UtrechtPageContent;
|
|
285
|
+
};
|
|
286
|
+
|
|
269
287
|
interface UtrechtPageFooter extends Components.UtrechtPageFooter, HTMLElement {}
|
|
270
288
|
export const UtrechtPageFooter: {
|
|
271
289
|
prototype: UtrechtPageFooter;
|
|
272
290
|
new (): UtrechtPageFooter;
|
|
273
291
|
};
|
|
274
292
|
|
|
293
|
+
interface UtrechtPageHeader extends Components.UtrechtPageHeader, HTMLElement {}
|
|
294
|
+
export const UtrechtPageHeader: {
|
|
295
|
+
prototype: UtrechtPageHeader;
|
|
296
|
+
new (): UtrechtPageHeader;
|
|
297
|
+
};
|
|
298
|
+
|
|
275
299
|
interface UtrechtPagination extends Components.UtrechtPagination, HTMLElement {}
|
|
276
300
|
export const UtrechtPagination: {
|
|
277
301
|
prototype: UtrechtPagination;
|