@dso-toolkit/core 52.0.3 → 53.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-accordion-section.cjs.entry.js +39 -1404
- package/dist/cjs/dso-action-list-item.cjs.entry.js +27 -0
- package/dist/cjs/dso-action-list.cjs.entry.js +20 -0
- package/dist/cjs/dso-annotation-output.cjs.entry.js +1 -1
- package/dist/cjs/dso-card-container.cjs.entry.js +1 -1
- package/dist/cjs/dso-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +18 -3
- package/dist/cjs/dso-expandable-heading.cjs.entry.js +6 -2
- package/dist/cjs/dso-expandable.cjs.entry.js +1433 -2
- package/dist/cjs/dso-header.cjs.entry.js +16 -1
- package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +2 -2
- package/dist/cjs/dso-image-overlay.cjs.entry.js +2 -2
- package/dist/cjs/dso-info_2.cjs.entry.js +3 -2
- package/dist/cjs/dso-label.cjs.entry.js +1 -8
- package/dist/cjs/dso-list-button.cjs.entry.js +3 -3
- package/dist/cjs/dso-modal.cjs.entry.js +2 -2
- package/dist/cjs/dso-ozon-content.cjs.entry.js +2 -2
- package/dist/cjs/dso-table.cjs.entry.js +2 -2
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/dso-tooltip.cjs.entry.js +14 -12
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +2 -2
- package/dist/cjs/expandable.interfaces-19b608b9.js +7 -0
- package/dist/cjs/{focus-trap.esm-c501d382.js → focus-trap.esm-a5b7273f.js} +134 -51
- package/dist/cjs/{has-overflow-b1b4f3f3.js → has-overflow-dd552ec8.js} +3 -4
- package/dist/cjs/index.cjs.js +67 -0
- package/dist/cjs/{index.esm-03a9e0b4.js → index.esm-0e935715.js} +97 -17
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/accordion/accordion.js +1 -1
- package/dist/collection/components/accordion/components/accordion-section.css +60 -10
- package/dist/collection/components/accordion/components/accordion-section.js +41 -100
- package/dist/collection/components/action-list/action-list.css +25 -0
- package/dist/collection/components/action-list/action-list.js +42 -0
- package/dist/collection/components/action-list/components/action-list-item.css +81 -0
- package/dist/collection/components/action-list/components/action-list-item.js +120 -0
- package/dist/collection/components/annotation-output/annotation-output.js +1 -1
- package/dist/collection/components/card-container/card-container.css +15 -1
- package/dist/collection/components/date-picker/date-picker.css +1 -1
- package/dist/collection/components/date-picker/date-picker.js +1 -1
- package/dist/collection/components/dropdown-menu/dropdown-menu.js +36 -1
- package/dist/collection/components/expandable/expandable.css +12 -1
- package/dist/collection/components/expandable/expandable.interfaces.js +3 -0
- package/dist/collection/components/expandable/expandable.js +246 -2
- package/dist/collection/components/expandable-heading/expandable-heading.css +34 -0
- package/dist/collection/components/expandable-heading/expandable-heading.js +28 -2
- package/dist/collection/components/header/header.js +18 -2
- package/dist/collection/components/label/label.js +1 -8
- package/dist/collection/components/list-button/list-button.css +2 -2
- package/dist/collection/components/modal/modal-ref.js +18 -0
- package/dist/collection/components/modal/modal.controller.js +47 -0
- package/dist/collection/components/modal/modal.js +3 -7
- package/dist/collection/components/ozon-content/ozon-content.css +8 -0
- package/dist/collection/components/selectable/selectable.css +22 -9
- package/dist/collection/components/selectable/selectable.js +2 -1
- package/dist/collection/components/tooltip/tooltip.js +13 -11
- package/dist/collection/index.js +2 -0
- package/dist/components/dropdown-menu.js +17 -1
- package/dist/components/dso-accordion-section.js +52 -1407
- package/dist/components/dso-action-list-item.d.ts +11 -0
- package/dist/components/dso-action-list-item.js +53 -0
- package/dist/components/dso-action-list.d.ts +11 -0
- package/dist/components/dso-action-list.js +36 -0
- package/dist/components/dso-annotation-output.js +1 -1
- package/dist/components/dso-card-container.js +1 -1
- package/dist/components/dso-date-picker.js +2 -2
- package/dist/components/dso-expandable-heading.js +9 -4
- package/dist/components/dso-header.js +18 -2
- package/dist/components/dso-label.js +1 -8
- package/dist/components/dso-list-button.js +1 -1
- package/dist/components/dso-ozon-content.js +1 -1
- package/dist/components/expandable.js +1440 -4
- package/dist/components/focus-trap.esm.js +133 -50
- package/dist/components/has-overflow.js +3 -4
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.esm.js +97 -17
- package/dist/components/index.js +71 -1
- package/dist/components/selectable.js +3 -2
- package/dist/components/tooltip.js +13 -11
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/index.esm.js +1 -1
- package/dist/dso-toolkit/{p-e4f667b3.entry.js → p-0b6fa7d3.entry.js} +1 -1
- package/dist/dso-toolkit/p-36224d6f.entry.js +1 -0
- package/dist/dso-toolkit/{p-9b07b034.entry.js → p-398a8e0b.entry.js} +1 -1
- package/dist/dso-toolkit/p-3b91c3e9.entry.js +1 -0
- package/dist/dso-toolkit/p-452b1234.js +1 -0
- package/dist/dso-toolkit/p-5950644a.js +5 -0
- package/dist/dso-toolkit/p-5de8b79a.entry.js +1 -0
- package/dist/dso-toolkit/p-5e50b616.entry.js +1 -0
- package/dist/dso-toolkit/p-69f37ab3.entry.js +1 -0
- package/dist/dso-toolkit/p-6a99d7f8.entry.js +1 -0
- package/dist/dso-toolkit/p-8a77030b.entry.js +1 -0
- package/dist/dso-toolkit/p-91963e3d.js +5 -0
- package/dist/dso-toolkit/p-96f44d35.entry.js +1 -0
- package/dist/dso-toolkit/p-975c172a.entry.js +1 -0
- package/dist/dso-toolkit/{p-092dde2f.entry.js → p-a1616935.entry.js} +1 -1
- package/dist/dso-toolkit/{p-ba330644.entry.js → p-bb90ea4c.entry.js} +1 -1
- package/dist/dso-toolkit/p-bf750b97.js +1 -0
- package/dist/dso-toolkit/{p-aab458c4.entry.js → p-c86a5bcb.entry.js} +1 -1
- package/dist/dso-toolkit/{p-f2b76233.entry.js → p-cf9b79df.entry.js} +1 -1
- package/dist/dso-toolkit/{p-43f3d736.entry.js → p-d10ec2b3.entry.js} +1 -1
- package/dist/dso-toolkit/p-e8a6ccf5.entry.js +1 -0
- package/dist/dso-toolkit/p-eaae698e.entry.js +1 -0
- package/dist/dso-toolkit/p-fa2f1a1c.entry.js +1 -0
- package/dist/dso-toolkit/p-fe7ca25f.entry.js +1 -0
- package/dist/esm/dso-accordion-section.entry.js +39 -1404
- package/dist/esm/dso-action-list-item.entry.js +23 -0
- package/dist/esm/dso-action-list.entry.js +16 -0
- package/dist/esm/dso-annotation-output.entry.js +1 -1
- package/dist/esm/dso-card-container.entry.js +1 -1
- package/dist/esm/dso-date-picker.entry.js +1 -1
- package/dist/esm/dso-dropdown-menu.entry.js +18 -3
- package/dist/esm/dso-expandable-heading.entry.js +7 -3
- package/dist/esm/dso-expandable.entry.js +1434 -3
- package/dist/esm/dso-header.entry.js +16 -1
- package/dist/esm/dso-helpcenter-panel.entry.js +2 -2
- package/dist/esm/dso-image-overlay.entry.js +2 -2
- package/dist/esm/dso-info_2.entry.js +3 -2
- package/dist/esm/dso-label.entry.js +1 -8
- package/dist/esm/dso-list-button.entry.js +3 -3
- package/dist/esm/dso-modal.entry.js +2 -2
- package/dist/esm/dso-ozon-content.entry.js +2 -2
- package/dist/esm/dso-table.entry.js +2 -2
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/dso-tooltip.entry.js +14 -12
- package/dist/esm/dso-viewer-grid.entry.js +2 -2
- package/dist/esm/expandable.interfaces-9b1afbe8.js +5 -0
- package/dist/esm/{focus-trap.esm-94794d92.js → focus-trap.esm-2a49a38f.js} +134 -51
- package/dist/esm/{has-overflow-c44a8a0a.js → has-overflow-fdc85d8f.js} +3 -4
- package/dist/esm/{index.esm-8fc07ad8.js → index.esm-3d6c8190.js} +97 -17
- package/dist/esm/index.js +69 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/accordion/accordion.interfaces.d.ts +1 -1
- package/dist/types/components/accordion/components/accordion-section.d.ts +4 -8
- package/dist/types/components/action-list/action-list.d.ts +5 -0
- package/dist/types/components/action-list/components/action-list-item.d.ts +15 -0
- package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +5 -0
- package/dist/types/components/expandable/expandable.d.ts +25 -1
- package/dist/types/components/expandable/expandable.interfaces.d.ts +10 -0
- package/dist/types/components/expandable-heading/expandable-heading.d.ts +2 -1
- package/dist/types/components/expandable-heading/expandable-heading.interfaces.d.ts +1 -0
- package/dist/types/components/header/header.d.ts +3 -0
- package/dist/types/components/label/label.d.ts +0 -1
- package/dist/types/components/modal/modal-ref.d.ts +8 -0
- package/dist/types/components/modal/modal.controller.d.ts +6 -0
- package/dist/types/components/modal/modal.d.ts +1 -2
- package/dist/types/components/modal/modal.interfaces.d.ts +12 -0
- package/dist/types/components.d.ts +82 -4
- package/dist/types/index.d.ts +2 -0
- package/package.json +11 -11
- package/dist/dso-toolkit/p-0fcdc369.entry.js +0 -1
- package/dist/dso-toolkit/p-147ec7bd.entry.js +0 -1
- package/dist/dso-toolkit/p-22f9240a.entry.js +0 -1
- package/dist/dso-toolkit/p-3635427a.js +0 -5
- package/dist/dso-toolkit/p-3b83e9c6.entry.js +0 -1
- package/dist/dso-toolkit/p-452c7fbb.entry.js +0 -1
- package/dist/dso-toolkit/p-4ae40ddc.entry.js +0 -1
- package/dist/dso-toolkit/p-4c8426b7.entry.js +0 -1
- package/dist/dso-toolkit/p-57ceabab.js +0 -5
- package/dist/dso-toolkit/p-9984079e.entry.js +0 -1
- package/dist/dso-toolkit/p-cece17a5.entry.js +0 -1
- package/dist/dso-toolkit/p-d3ed00f6.js +0 -1
- package/dist/dso-toolkit/p-e3bd7689.entry.js +0 -1
- package/dist/dso-toolkit/p-f3f0d6c9.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { v4 as uuidv4 } from "uuid";
|
|
4
4
|
import { Heading } from "./heading";
|
|
@@ -8,6 +8,7 @@ export class ExpandableHeading {
|
|
|
8
8
|
this.open = undefined;
|
|
9
9
|
this.heading = "h2";
|
|
10
10
|
this.color = "default";
|
|
11
|
+
this.editAction = undefined;
|
|
11
12
|
}
|
|
12
13
|
toggle(e) {
|
|
13
14
|
this.open = !this.open;
|
|
@@ -15,7 +16,10 @@ export class ExpandableHeading {
|
|
|
15
16
|
}
|
|
16
17
|
render() {
|
|
17
18
|
const expandableProperties = this.open ? { open: true } : {};
|
|
18
|
-
return (h(
|
|
19
|
+
return (h(Host, { class: clsx({
|
|
20
|
+
"dso-del": this.editAction === "delete",
|
|
21
|
+
"dso-ins": this.editAction === "insert",
|
|
22
|
+
}) }, this.editAction === "delete" && (h("p", { class: "dso-edit-action-text" }, h("span", null, "verwijderd:"))), this.editAction === "insert" && (h("p", { class: "dso-edit-action-text" }, h("span", null, "toegevoegd:"))), h("div", { class: clsx("expandable-heading", this.color === "black" ? "dso-expandable-heading-black" : "") }, h(Heading, { heading: this.heading }, h("button", { type: "button", "aria-expanded": this.open ? "true" : "false", "aria-controls": this.identifier, onClick: (e) => this.toggle(e) }, h("dso-icon", { icon: this.open ? "chevron-down" : "chevron-right" }), h("slot", { name: "title" }))), h("slot", { name: "addons-start" }), h("div", { class: "addons-end" }, h("slot", { name: "addons-end" }))), h("dso-expandable", Object.assign({ id: this.identifier }, expandableProperties), h("slot", { slot: "expandable-content" }))));
|
|
19
23
|
}
|
|
20
24
|
static get is() { return "dso-expandable-heading"; }
|
|
21
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -88,6 +92,28 @@ export class ExpandableHeading {
|
|
|
88
92
|
"attribute": "color",
|
|
89
93
|
"reflect": false,
|
|
90
94
|
"defaultValue": "\"default\""
|
|
95
|
+
},
|
|
96
|
+
"editAction": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "EditAction",
|
|
101
|
+
"resolved": "\"delete\" | \"insert\" | undefined",
|
|
102
|
+
"references": {
|
|
103
|
+
"EditAction": {
|
|
104
|
+
"location": "import",
|
|
105
|
+
"path": "./expandable-heading.interfaces"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": true,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": ""
|
|
114
|
+
},
|
|
115
|
+
"attribute": "edit-action",
|
|
116
|
+
"reflect": false
|
|
91
117
|
}
|
|
92
118
|
};
|
|
93
119
|
}
|
|
@@ -23,6 +23,7 @@ export class Header {
|
|
|
23
23
|
this.showDropDown = undefined;
|
|
24
24
|
this.hasSubLogo = false;
|
|
25
25
|
this.overflowMenuItems = 0;
|
|
26
|
+
this.dropdownOptionsOffset = 0;
|
|
26
27
|
}
|
|
27
28
|
clickHandler(e, type, options) {
|
|
28
29
|
var _a, _b;
|
|
@@ -58,12 +59,16 @@ export class Header {
|
|
|
58
59
|
}
|
|
59
60
|
componentDidRender() {
|
|
60
61
|
if (this.showDropDown) {
|
|
62
|
+
this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();
|
|
61
63
|
return;
|
|
62
64
|
}
|
|
63
65
|
window.setTimeout(() => this.shrinkMenuToFit(), 0);
|
|
64
66
|
}
|
|
65
67
|
componentDidLoad() {
|
|
66
68
|
this.setShowDropDown(this.useDropDownMenu);
|
|
69
|
+
if (this.showDropDown) {
|
|
70
|
+
this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();
|
|
71
|
+
}
|
|
67
72
|
}
|
|
68
73
|
setOverflowMenu() {
|
|
69
74
|
if (this.showDropDown) {
|
|
@@ -81,6 +86,14 @@ export class Header {
|
|
|
81
86
|
}
|
|
82
87
|
this.showDropDown = window.innerWidth < minDesktopViewportWidth;
|
|
83
88
|
}
|
|
89
|
+
calculateDropdownOptionsOffset() {
|
|
90
|
+
var _a;
|
|
91
|
+
if (!this.dropdownElement) {
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
return (this.host.clientHeight -
|
|
95
|
+
(((_a = this.dropdownElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().bottom) - this.host.getBoundingClientRect().top));
|
|
96
|
+
}
|
|
84
97
|
connectedCallback() {
|
|
85
98
|
window.addEventListener("resize", this.onWindowResize);
|
|
86
99
|
}
|
|
@@ -95,7 +108,9 @@ export class Header {
|
|
|
95
108
|
return (h(Fragment, null, h("div", { class: clsx("dso-header", {
|
|
96
109
|
["use-drop-down"]: this.showDropDown,
|
|
97
110
|
["has-sub-logo"]: this.hasSubLogo,
|
|
98
|
-
}), ref: (element) => (this.wrapper = element) }, h("div", { class: "logo-container" }, h("div", { class: "logo" }, h("slot", { name: "logo" })), h("div", { class: "sub-logo" }, h("slot", { name: "sub-logo" }))), this.showDropDown &&
|
|
111
|
+
}), ref: (element) => (this.wrapper = element) }, h("div", { class: "logo-container" }, h("div", { class: "logo" }, h("slot", { name: "logo" })), h("div", { class: "sub-logo" }, h("slot", { name: "sub-logo" }))), this.showDropDown &&
|
|
112
|
+
this.mainMenu &&
|
|
113
|
+
(this.mainMenu.length > 0 || this.userHomeUrl || this.authStatus !== "none") && (h("div", { class: "dropdown" }, h("dso-dropdown-menu", { "dropdown-align": "right", strategy: "absolute", dropdownOptionsOffset: this.dropdownOptionsOffset, ref: (element) => (this.dropdownElement = element) }, h("button", { type: "button", slot: "toggle" }, h("span", null, "Menu")), h("div", { class: "dso-dropdown-options" }, h("ul", null, this.mainMenu.map(this.MenuItem), this.userHomeUrl && (h("li", null, h("a", { href: this.userHomeUrl, onClick: (e) => this.clickHandler(e, "userHome", { url: this.userHomeUrl }) }, "Mijn Omgevingsloket"))), this.userProfileUrl && this.userProfileName && this.authStatus === "loggedIn" && (h("li", null, h("a", { href: this.userProfileUrl, onClick: (e) => this.clickHandler(e, "profile", { url: this.userProfileUrl }) }, this.userProfileName, h("span", { class: "profile-label" }, " - Mijn profiel")))), this.authStatus === "loggedOut" && (h("li", null, this.loginUrl ? (h("a", { href: this.loginUrl, onClick: (e) => this.clickHandler(e, "login", { url: this.loginUrl }) }, "Inloggen")) : (h("button", { type: "button", onClick: (e) => this.clickHandler(e, "login") }, "Inloggen")))), this.authStatus === "loggedIn" && (h("li", null, this.logoutUrl ? (h("a", { href: this.logoutUrl, onClick: (e) => this.clickHandler(e, "logout", { url: this.logoutUrl }) }, "Uitloggen")) : (h("button", { type: "button", onClick: (e) => this.clickHandler(e, "logout") }, "Uitloggen"))))))))), !this.showDropDown && (h(Fragment, null, h("div", { class: "dso-header-session" }, this.userProfileUrl && this.userProfileName && this.authStatus === "loggedIn" && (h("div", { class: "profile" }, h("span", { class: "profile-label" }, "Welkom:"), h("a", { href: this.userProfileUrl, onClick: (e) => this.clickHandler(e, "profile", { url: this.userProfileUrl }) }, this.userProfileName))), this.authStatus === "loggedOut" && (h("div", { class: "login" }, this.loginUrl ? (h("a", { href: this.loginUrl, onClick: (e) => this.clickHandler(e, "login", { url: this.loginUrl }) }, "Inloggen")) : (h("button", { class: "dso-tertiary", type: "button", onClick: (e) => this.clickHandler(e, "login") }, "Inloggen")))), this.authStatus === "loggedIn" && (h("div", { class: "logout" }, this.logoutUrl ? (h("a", { href: this.logoutUrl, onClick: (e) => this.clickHandler(e, "logout", { url: this.logoutUrl }) }, "Uitloggen")) : (h("button", { class: "dso-tertiary", type: "button", onClick: (e) => this.clickHandler(e, "logout") }, "Uitloggen"))))), ((this.mainMenu && this.mainMenu.length > 0) || this.userHomeUrl) && (h("nav", { class: "dso-navbar" }, h("ul", { class: "dso-nav dso-nav-main", ref: (element) => (this.nav = element) }, this.mainMenu &&
|
|
99
114
|
this.mainMenu
|
|
100
115
|
.filter((_, index) => this.mainMenu && index < this.mainMenu.length - this.overflowMenuItems)
|
|
101
116
|
.map(this.MenuItem), this.overflowMenuItems > 0 && (h("li", null, h("dso-dropdown-menu", { "dropdown-align": "left" }, h("button", { type: "button", slot: "toggle" }, h("span", null, "Meer")), h("div", { class: "dso-dropdown-options" }, h("ul", null, this.mainMenu &&
|
|
@@ -265,7 +280,8 @@ export class Header {
|
|
|
265
280
|
return {
|
|
266
281
|
"showDropDown": {},
|
|
267
282
|
"hasSubLogo": {},
|
|
268
|
-
"overflowMenuItems": {}
|
|
283
|
+
"overflowMenuItems": {},
|
|
284
|
+
"dropdownOptionsOffset": {}
|
|
269
285
|
};
|
|
270
286
|
}
|
|
271
287
|
static get events() {
|
|
@@ -97,12 +97,11 @@ export class Label {
|
|
|
97
97
|
this.keydownListenerActive = false;
|
|
98
98
|
}
|
|
99
99
|
render() {
|
|
100
|
-
const status = this.status && Label.statusMap.get(this.status);
|
|
101
100
|
return (h(Fragment, null, h("span", { "aria-describedby": "toggle-anchor", class: clsx("dso-label", {
|
|
102
101
|
[`dso-label-${this.status}`]: this.status,
|
|
103
102
|
"dso-compact": this.compact && !this.removable,
|
|
104
103
|
"dso-hover": this.removeHover || this.removeFocus,
|
|
105
|
-
}) }, h("slot", { name: "symbol" }),
|
|
104
|
+
}) }, h("slot", { name: "symbol" }), h("span", { class: clsx("dso-label-content", {
|
|
106
105
|
"dso-truncate": !!this.truncate,
|
|
107
106
|
}), ref: (element) => (this.labelContent = element), tabindex: this.truncate && this.isTruncated ? 0 : undefined, onMouseEnter: () => (this.textHover = true), onMouseLeave: () => (this.textHover = false), onFocus: () => (this.textFocus = true), onBlur: () => (this.textFocus = false) }, h("slot", null)), this.removable && (h("button", { type: "button", onClick: (e) => this.dsoRemoveClick.emit(e), onMouseEnter: () => (this.removeHover = true), onMouseLeave: () => (this.removeHover = false), onFocus: () => (this.removeFocus = true), onBlur: () => (this.removeFocus = false) }, h("span", { class: "sr-only" }, "Verwijder: ", this.labelText), h("dso-icon", { icon: "times" })))), this.isTruncated && (h("dso-tooltip", { stateless: true, id: "toggle-anchor", active: this.textHover || this.textFocus, position: "top", strategy: "absolute" }, this.labelText))));
|
|
108
107
|
}
|
|
@@ -272,9 +271,3 @@ export class Label {
|
|
|
272
271
|
}];
|
|
273
272
|
}
|
|
274
273
|
}
|
|
275
|
-
Label.statusMap = new Map([
|
|
276
|
-
["info", "Opmerking"],
|
|
277
|
-
["success", "Gelukt"],
|
|
278
|
-
["warning", "Waarschuwing"],
|
|
279
|
-
["danger", "Fout"],
|
|
280
|
-
]);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class DsoModalRef {
|
|
2
|
+
constructor(modalElement) {
|
|
3
|
+
this.modalElement = modalElement;
|
|
4
|
+
if (!modalElement) {
|
|
5
|
+
throw new Error("unable to add event listener. try opening the modal first");
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** Removes the modal from the DOM. */
|
|
9
|
+
close() {
|
|
10
|
+
document.body.removeChild(this.modalElement);
|
|
11
|
+
}
|
|
12
|
+
addEventListener(eventName, fn) {
|
|
13
|
+
this.modalElement.addEventListener(eventName, fn);
|
|
14
|
+
}
|
|
15
|
+
removeEventListener(eventName, fn) {
|
|
16
|
+
this.modalElement.removeEventListener(eventName, fn);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DsoModalRef } from "./modal-ref";
|
|
2
|
+
export class DsoModalController {
|
|
3
|
+
open(modal, options) {
|
|
4
|
+
const dsoModalElement = this.createModal(modal, options);
|
|
5
|
+
document.body.appendChild(dsoModalElement);
|
|
6
|
+
return new DsoModalRef(dsoModalElement);
|
|
7
|
+
}
|
|
8
|
+
createModal({ title, body, footer }, options) {
|
|
9
|
+
const element = document.createElement(`dso-modal`);
|
|
10
|
+
if (title) {
|
|
11
|
+
element.setAttribute("modal-title", title);
|
|
12
|
+
}
|
|
13
|
+
if (options) {
|
|
14
|
+
const { role, showCloseButton, initialFocus } = options;
|
|
15
|
+
if (role) {
|
|
16
|
+
element.role = role;
|
|
17
|
+
}
|
|
18
|
+
if (showCloseButton) {
|
|
19
|
+
element.setAttribute("show-close-button", showCloseButton ? "true" : "false");
|
|
20
|
+
}
|
|
21
|
+
if (initialFocus) {
|
|
22
|
+
element.setAttribute("initial-focus", initialFocus);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const bodyDiv = document.createElement("div");
|
|
26
|
+
bodyDiv.setAttribute("slot", "body");
|
|
27
|
+
if (typeof body === "string") {
|
|
28
|
+
bodyDiv.innerHTML = body;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
bodyDiv.appendChild(body);
|
|
32
|
+
}
|
|
33
|
+
element.appendChild(bodyDiv);
|
|
34
|
+
if (footer) {
|
|
35
|
+
const footerDiv = document.createElement("div");
|
|
36
|
+
footerDiv.setAttribute("slot", "footer");
|
|
37
|
+
if (typeof footer === "string") {
|
|
38
|
+
footerDiv.innerHTML = footer;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
footerDiv.appendChild(footer);
|
|
42
|
+
}
|
|
43
|
+
element.appendChild(footerDiv);
|
|
44
|
+
}
|
|
45
|
+
return element;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -92,13 +92,9 @@ export class Modal {
|
|
|
92
92
|
"type": "string",
|
|
93
93
|
"mutable": false,
|
|
94
94
|
"complexType": {
|
|
95
|
-
"original": "
|
|
96
|
-
"resolved": "
|
|
97
|
-
"references": {
|
|
98
|
-
"ModalRole": {
|
|
99
|
-
"location": "local"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
95
|
+
"original": "string",
|
|
96
|
+
"resolved": "string",
|
|
97
|
+
"references": {}
|
|
102
98
|
},
|
|
103
99
|
"required": false,
|
|
104
100
|
"optional": false,
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
ins {
|
|
2
|
+
background-color: #e4f1d4;
|
|
3
|
+
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.25);
|
|
4
|
+
color: #000;
|
|
5
|
+
text-decoration: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
:host(:not([inline])) {
|
|
2
9
|
display: block;
|
|
3
10
|
}
|
|
@@ -232,6 +239,7 @@ span[role=paragraph] {
|
|
|
232
239
|
|
|
233
240
|
.dso-ins {
|
|
234
241
|
background-color: #e4f1d4;
|
|
242
|
+
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.25);
|
|
235
243
|
color: #000;
|
|
236
244
|
}
|
|
237
245
|
.dso-ins a {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: block;
|
|
3
|
-
padding-left: 32px;
|
|
4
3
|
position: relative;
|
|
5
4
|
}
|
|
6
5
|
:host .dso-selectable-options {
|
|
@@ -135,8 +134,8 @@
|
|
|
135
134
|
}
|
|
136
135
|
:host > dso-info {
|
|
137
136
|
float: none;
|
|
138
|
-
margin: 8px 16px 0
|
|
139
|
-
width:
|
|
137
|
+
margin: 8px 16px 0 0;
|
|
138
|
+
width: 100%;
|
|
140
139
|
}
|
|
141
140
|
:host[invalid] {
|
|
142
141
|
--dso-selectable-color: #ce3f51;
|
|
@@ -152,22 +151,36 @@
|
|
|
152
151
|
box-sizing: border-box;
|
|
153
152
|
}
|
|
154
153
|
|
|
155
|
-
.dso-selectable-
|
|
154
|
+
.dso-selectable-container {
|
|
156
155
|
display: inline-block;
|
|
157
|
-
|
|
156
|
+
position: relative;
|
|
157
|
+
padding-inline-start: 32px;
|
|
158
|
+
}
|
|
159
|
+
.dso-selectable-container.has-info-button {
|
|
160
|
+
padding-inline-end: 32px;
|
|
161
|
+
}
|
|
162
|
+
.dso-selectable-container .dso-selectable-input-wrapper {
|
|
163
|
+
display: inline;
|
|
164
|
+
margin-inline: -32px;
|
|
158
165
|
min-height: 24px;
|
|
159
|
-
padding-
|
|
166
|
+
padding-inline: 32px;
|
|
160
167
|
}
|
|
161
|
-
.dso-selectable-input-wrapper:focus-within {
|
|
168
|
+
.dso-selectable-container .dso-selectable-input-wrapper:focus-within {
|
|
162
169
|
border-radius: 2px;
|
|
163
170
|
outline-offset: 3px;
|
|
164
171
|
outline: 3px solid #008ccc;
|
|
165
172
|
}
|
|
166
|
-
.dso-selectable-input-wrapper input[type=radio]:focus + label::before,
|
|
167
|
-
.dso-selectable-input-wrapper input[type=checkbox]:focus + label::before {
|
|
173
|
+
.dso-selectable-container .dso-selectable-input-wrapper input[type=radio]:focus + label::before,
|
|
174
|
+
.dso-selectable-container .dso-selectable-input-wrapper input[type=checkbox]:focus + label::before {
|
|
168
175
|
box-shadow: 0 0 0 2px var(--dso-selectable-color, #275937);
|
|
169
176
|
height: 20px;
|
|
170
177
|
left: 2px;
|
|
171
178
|
top: 2px;
|
|
172
179
|
width: 20px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
dso-info-button {
|
|
183
|
+
position: absolute;
|
|
184
|
+
right: 0;
|
|
185
|
+
top: 0;
|
|
173
186
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h, Fragment, forceUpdate, } from "@stencil/core";
|
|
2
|
+
import clsx from "clsx";
|
|
2
3
|
import { createIdentifier } from "../../utils/create-identifier";
|
|
3
4
|
export class Selectable {
|
|
4
5
|
constructor() {
|
|
@@ -42,7 +43,7 @@ export class Selectable {
|
|
|
42
43
|
render() {
|
|
43
44
|
var _a;
|
|
44
45
|
const hasInfo = !!this.host.querySelector('[slot="info"]');
|
|
45
|
-
return (h(Fragment, null, h("div", { class: "dso-selectable-input-wrapper" }, 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, "aria-labelledBy": this.labelledById, disabled: this.disabled, required: this.required, checked: this.checked, onChange: (e) => this.dsoChange.emit(e), ref: (el) => (this.input = el) }), !this.labelledById ? (h("label", { htmlFor: this.getIdentifier() }, h("slot", null))) : (h("label", null))), hasInfo && (h(Fragment, null, !this.infoFixed && (h("dso-info-button", { active: this.infoActive, onDsoToggle: (e) => (this.infoActive = e.detail.active) })), h("dso-info", { id: hasInfo && this.infoFixed ? this.describedById : undefined, fixed: this.infoFixed, active: this.infoActive, onDsoClose: () => (this.infoActive = false) }, h("div", null, h("slot", { name: "info" }))))))
|
|
46
|
+
return (h(Fragment, null, h("div", { class: clsx("dso-selectable-container", { "has-info-button": hasInfo }) }, h("div", { class: "dso-selectable-input-wrapper" }, 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, "aria-labelledBy": this.labelledById, disabled: this.disabled, required: this.required, checked: this.checked, onChange: (e) => this.dsoChange.emit(e), ref: (el) => (this.input = el) }), !this.labelledById ? (h("label", { htmlFor: this.getIdentifier() }, h("slot", null))) : (h("label", null))), hasInfo && (h(Fragment, null, !this.infoFixed && (h("dso-info-button", { active: this.infoActive, onDsoToggle: (e) => (this.infoActive = e.detail.active) }))))), hasInfo && (h("dso-info", { id: hasInfo && this.infoFixed ? this.describedById : undefined, fixed: this.infoFixed, active: this.infoActive, onDsoClose: () => (this.infoActive = false) }, h("div", null, h("slot", { name: "info" }))))));
|
|
46
47
|
}
|
|
47
48
|
getIdentifier() {
|
|
48
49
|
var _a;
|
|
@@ -137,7 +137,7 @@ export class Tooltip {
|
|
|
137
137
|
if (!(tooltip instanceof HTMLElement)) {
|
|
138
138
|
throw new Error("tooltip element is not instanceof HTMLElement");
|
|
139
139
|
}
|
|
140
|
-
if (!this.stateless) {
|
|
140
|
+
if (!this.stateless && this.target) {
|
|
141
141
|
this.target.addEventListener("mouseenter", this.callbacks.activate);
|
|
142
142
|
this.target.addEventListener("mouseleave", this.callbacks.deactivate);
|
|
143
143
|
this.target.addEventListener("focus", this.callbacks.activate);
|
|
@@ -171,14 +171,13 @@ export class Tooltip {
|
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
const tooltip = (_a = this.element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".tooltip");
|
|
174
|
-
if (
|
|
175
|
-
|
|
174
|
+
if (this.target && tooltip instanceof HTMLElement) {
|
|
175
|
+
this.popper = createPopper(this.target, tooltip, {
|
|
176
|
+
placement: this.position,
|
|
177
|
+
modifiers: [maxSize, applyMaxSize, { name: "eventListeners", enabled: false }],
|
|
178
|
+
});
|
|
179
|
+
this.setStrategy();
|
|
176
180
|
}
|
|
177
|
-
this.popper = createPopper(this.target, tooltip, {
|
|
178
|
-
placement: this.position,
|
|
179
|
-
modifiers: [maxSize, applyMaxSize, { name: "eventListeners", enabled: false }],
|
|
180
|
-
});
|
|
181
|
-
this.setStrategy();
|
|
182
181
|
}
|
|
183
182
|
get target() {
|
|
184
183
|
var _a;
|
|
@@ -190,15 +189,18 @@ export class Tooltip {
|
|
|
190
189
|
initializeTarget() {
|
|
191
190
|
const id = this.element.id;
|
|
192
191
|
if (!id) {
|
|
193
|
-
|
|
192
|
+
console.warn("Unable to find reference tooltip has no [id] attribute.");
|
|
193
|
+
return;
|
|
194
194
|
}
|
|
195
195
|
const rootNode = this.element.getRootNode();
|
|
196
196
|
if (!(rootNode instanceof Document || rootNode instanceof ShadowRoot)) {
|
|
197
|
-
|
|
197
|
+
console.warn(`rootNode is not instance of Document or ShadowRoot`);
|
|
198
|
+
return;
|
|
198
199
|
}
|
|
199
200
|
const reference = rootNode.querySelector(`[aria-describedBy="${id}`);
|
|
200
201
|
if (!reference) {
|
|
201
|
-
|
|
202
|
+
console.warn(`Unable to find reference with aria-describedby ${id}`);
|
|
203
|
+
return;
|
|
202
204
|
}
|
|
203
205
|
__classPrivateFieldSet(this, _Tooltip_target, reference, "f");
|
|
204
206
|
return reference;
|
package/dist/collection/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./components/annotation-output/annotation-output.interfaces";
|
|
|
3
3
|
export * from "./components/autosuggest/autosuggest.interfaces";
|
|
4
4
|
export * from "./components/card/card.interfaces";
|
|
5
5
|
export * from "./components/date-picker/date-picker.interfaces";
|
|
6
|
+
export * from "./components/expandable/expandable.interfaces";
|
|
6
7
|
export * from "./components/expandable-heading/expandable-heading.interfaces";
|
|
7
8
|
export * from "./components/header/header.interfaces";
|
|
8
9
|
export * from "./components/info-button/info-button.interfaces";
|
|
@@ -18,3 +19,4 @@ export * from "./components/selectable/selectable.interfaces";
|
|
|
18
19
|
export * from "./components/slide-toggle/slide-toggle.interfaces";
|
|
19
20
|
export * from "./components/tree-view/tree-view.interfaces";
|
|
20
21
|
export * from "./components/viewer-grid/viewer-grid.interfaces";
|
|
22
|
+
export * from "./components/modal/modal.controller";
|
|
@@ -45,6 +45,7 @@ const DropdownMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
45
45
|
};
|
|
46
46
|
this.open = false;
|
|
47
47
|
this.dropdownAlign = "left";
|
|
48
|
+
this.dropdownOptionsOffset = 2;
|
|
48
49
|
this.checkable = false;
|
|
49
50
|
this.boundary = undefined;
|
|
50
51
|
this.strategy = "auto";
|
|
@@ -57,6 +58,19 @@ const DropdownMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
57
58
|
placement: this.dropdownAlign === "right" ? "bottom-end" : "bottom-start",
|
|
58
59
|
});
|
|
59
60
|
}
|
|
61
|
+
watchOptionsOffset() {
|
|
62
|
+
var _a;
|
|
63
|
+
(_a = this.popper) === null || _a === void 0 ? void 0 : _a.setOptions({
|
|
64
|
+
modifiers: [
|
|
65
|
+
{
|
|
66
|
+
name: "offset",
|
|
67
|
+
options: {
|
|
68
|
+
offset: [0, this.dropdownOptionsOffset],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
60
74
|
watchStrategy() {
|
|
61
75
|
this.setStrategy();
|
|
62
76
|
}
|
|
@@ -129,7 +143,7 @@ const DropdownMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
129
143
|
{
|
|
130
144
|
name: "offset",
|
|
131
145
|
options: {
|
|
132
|
-
offset: [0,
|
|
146
|
+
offset: [0, this.dropdownOptionsOffset],
|
|
133
147
|
},
|
|
134
148
|
},
|
|
135
149
|
{
|
|
@@ -200,12 +214,14 @@ const DropdownMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
200
214
|
get host() { return this; }
|
|
201
215
|
static get watchers() { return {
|
|
202
216
|
"dropdownAlign": ["watchPosition"],
|
|
217
|
+
"dropdownOptionsOffset": ["watchOptionsOffset"],
|
|
203
218
|
"strategy": ["watchStrategy"]
|
|
204
219
|
}; }
|
|
205
220
|
static get style() { return dropdownMenuCss; }
|
|
206
221
|
}, [1, "dso-dropdown-menu", {
|
|
207
222
|
"open": [1540],
|
|
208
223
|
"dropdownAlign": [1, "dropdown-align"],
|
|
224
|
+
"dropdownOptionsOffset": [2, "dropdown-options-offset"],
|
|
209
225
|
"checkable": [4],
|
|
210
226
|
"boundary": [1],
|
|
211
227
|
"strategy": [1]
|