@postnord/pn-marketweb-components 4.4.0 → 4.5.1
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/cjs/loader.cjs.js +1 -1
- package/cjs/pn-date-and-time.cjs.entry.js +25 -3
- package/cjs/pn-date-and-time.cjs.entry.js.map +1 -1
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/collection/components/input/pn-date-and-time/pn-date-and-time.js +44 -3
- package/collection/components/input/pn-date-and-time/pn-date-and-time.js.map +1 -1
- package/collection/components/input/pn-date-and-time/pn-date-and-time.stories.js +3 -1
- package/components/pn-date-and-time.js +27 -3
- package/components/pn-date-and-time.js.map +1 -1
- package/esm/loader.js +1 -1
- package/esm/pn-date-and-time.entry.js +25 -3
- package/esm/pn-date-and-time.entry.js.map +1 -1
- package/esm/pn-market-web-components.js +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/p-dbfb632c.entry.js +2 -0
- package/pn-market-web-components/p-dbfb632c.entry.js.map +1 -0
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/pn-market-web-components/pn-market-web-components.esm.js.map +1 -1
- package/types/components/input/pn-date-and-time/pn-date-and-time.d.ts +3 -0
- package/types/components.d.ts +2 -0
- package/umd/modules/@postnord/web-components/cem.json +392 -0
- package/umd/modules/@postnord/web-components/cjs/close_small-CTOfc4Qy.js +10 -0
- package/umd/modules/@postnord/web-components/cjs/index-DWu-2oJc.js +12 -4
- package/umd/modules/@postnord/web-components/cjs/loader.cjs.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-card.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-footer.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-header.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-input-chip.cjs.entry.js +52 -0
- package/umd/modules/@postnord/web-components/cjs/pn-multiselect.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-ocr-search.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-page-nav-dropdown-item.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-page-nav-item.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-page-nav.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-pagination.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-radio-button.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-range.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-search-field.cjs.entry.js +2 -4
- package/umd/modules/@postnord/web-components/cjs/pn-segment.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-segmented-control.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-select.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-skeleton-loader.cjs.entry.js +103 -0
- package/umd/modules/@postnord/web-components/cjs/pn-tab.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-tablist.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-text-link.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-textarea.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-tile.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-toggle-switch.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/pn-zipcode-search.cjs.entry.js +1 -1
- package/umd/modules/@postnord/web-components/cjs/postnord-web-components.cjs.js +1 -1
- package/umd/modules/@postnord/web-components/collection/collection-manifest.json +2 -0
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-skeleton-loader/pn-skeleton-loader.css +314 -0
- package/umd/modules/@postnord/web-components/collection/components/feedback/pn-skeleton-loader/pn-skeleton-loader.js +291 -0
- package/umd/modules/@postnord/web-components/collection/components/input/pn-input-chip/pn-input-chip.css +109 -0
- package/umd/modules/@postnord/web-components/collection/components/input/pn-input-chip/pn-input-chip.js +232 -0
- package/umd/modules/@postnord/web-components/collection/components/input/pn-multiselect/pn-multiselect.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-radio-button/pn-radio-button.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-range/pn-range.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-search-field/pn-search-field.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/pn-segmented-control.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/segment/pn-segment.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-select/pn-select.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-textarea/pn-textarea.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/input/pn-toggle-switch/pn-toggle-switch.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/layout/pn-header/pn-header.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-card/pn-card.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-footer/pn-footer.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/dropdown-item/pn-page-nav-dropdown-item.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/item/pn-page-nav-item.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/menu/pn-page-nav.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-pagination/pn-pagination.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/pn-tablist.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/tab/pn-tab.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-text-link/pn-text-link.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tile/pn-tile.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/web-components/pn-ocr-search/pn-ocr-search.js +1 -1
- package/umd/modules/@postnord/web-components/collection/components/web-components/pn-zipcode-search/pn-zipcode-search.js +1 -1
- package/umd/modules/@postnord/web-components/components/close_small.js +5 -0
- package/umd/modules/@postnord/web-components/components/index.d.ts +4 -0
- package/umd/modules/@postnord/web-components/components/index.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-card.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-footer.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-header.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-input-chip.d.ts +11 -0
- package/umd/modules/@postnord/web-components/components/pn-input-chip.js +5 -0
- package/umd/modules/@postnord/web-components/components/pn-multiselect.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-ocr-search.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-page-nav-dropdown-item.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-page-nav-item.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-page-nav.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-pagination.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-radio-button.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-range.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-search-field2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-segment.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-segmented-control.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-select2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-skeleton-loader.d.ts +11 -0
- package/umd/modules/@postnord/web-components/components/pn-skeleton-loader.js +5 -0
- package/umd/modules/@postnord/web-components/components/pn-tab.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-tablist.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-text-link2.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-textarea.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-tile.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-toggle-switch.js +1 -1
- package/umd/modules/@postnord/web-components/components/pn-zipcode-search.js +1 -1
- package/umd/modules/@postnord/web-components/esm/close_small-gPbnChG6.js +8 -0
- package/umd/modules/@postnord/web-components/esm/index-XKg-ydzH.js +12 -4
- package/umd/modules/@postnord/web-components/esm/loader.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-card.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-footer.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-header.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-input-chip.entry.js +50 -0
- package/umd/modules/@postnord/web-components/esm/pn-multiselect.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-ocr-search.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-page-nav-dropdown-item.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-page-nav-item.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-page-nav.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-pagination.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-radio-button.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-range.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-search-field.entry.js +2 -4
- package/umd/modules/@postnord/web-components/esm/pn-segment.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-segmented-control.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-select.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-skeleton-loader.entry.js +101 -0
- package/umd/modules/@postnord/web-components/esm/pn-tab.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-tablist.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-text-link.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-textarea.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-tile.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-toggle-switch.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/pn-zipcode-search.entry.js +1 -1
- package/umd/modules/@postnord/web-components/esm/postnord-web-components.js +1 -1
- package/umd/modules/@postnord/web-components/hydrate/index.js +199 -22
- package/umd/modules/@postnord/web-components/hydrate/index.mjs +199 -22
- package/umd/modules/@postnord/web-components/package.json +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-e11b4af5.entry.js → p-10d5fb90.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-88344f8d.entry.js → p-110ba4cc.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-98a37be9.entry.js → p-1b27c05f.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-292a7591.entry.js → p-20fe57fd.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-43483837.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-060b6ad2.entry.js → p-48f7e582.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-a31d93db.entry.js → p-594f5e35.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-9d56fb64.entry.js → p-5f5f3eeb.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-783ee52f.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-e5574624.entry.js → p-809a0ddb.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-d81b4ede.entry.js → p-8d90ab9d.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-3db02038.entry.js → p-90b44536.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-a1f92f19.entry.js → p-9f48d450.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-ef00ef4d.entry.js → p-a028c1af.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-a3bd612d.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-d228b929.entry.js → p-a70c9879.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-b80c060c.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-0bf70d44.entry.js → p-bdb494ac.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-020ee3f4.entry.js → p-c51d8164.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-8cedf2e0.entry.js → p-c7a6d048.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-b45e58df.entry.js → p-d728a000.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-eb15a889.entry.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-3709c995.entry.js → p-fa3c2490.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/{p-64207923.entry.js → p-fdbffb51.entry.js} +1 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-gPbnChG6.js +5 -0
- package/umd/modules/@postnord/web-components/postnord-web-components/postnord-web-components.esm.js +1 -1
- package/umd/modules/@postnord/web-components/types/components/feedback/pn-skeleton-loader/pn-skeleton-loader.d.ts +35 -0
- package/umd/modules/@postnord/web-components/types/components/input/pn-input-chip/pn-input-chip.d.ts +34 -0
- package/umd/modules/@postnord/web-components/types/components.d.ts +257 -0
- package/umd/modules/@postnord/web-components/vscode-data.json +117 -0
- package/umd/pn-marketweb-header-wrongrembase.css +6 -5
- package/umd/pn-marketweb-init.js +1 -1
- package/umd/pn-marketweb-salesforce-header.js +1 -1
- package/umd/pn-marketweb-salesforce-owncss.js +88 -0
- package/umd/pn-marketweb-salesforce.js +1 -1
- package/vscode-data.json +4 -0
- package/pn-market-web-components/p-99843884.entry.js +0 -2
- package/pn-market-web-components/p-99843884.entry.js.map +0 -1
- package/umd/modules/@postnord/web-components/postnord-web-components/p-aa15469e.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-b72f9866.entry.js +0 -5
- package/umd/modules/@postnord/web-components/postnord-web-components/p-d71054df.entry.js +0 -5
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//this file will load the top header without loading the wrongrembase.css file.
|
|
2
|
+
(function () {
|
|
3
|
+
if (document.body.dataset["marketwebComponentsSalesforceHeaderInit"]) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
document.body.dataset["marketwebComponentsSalesforceHeaderInit"] = true;
|
|
7
|
+
|
|
8
|
+
const header = document.createElement("pn-marketweb-header");
|
|
9
|
+
const footer = document.createElement("pn-marketweb-sitefooter");
|
|
10
|
+
let currentLanguage = document.querySelector("html").getAttribute("lang");
|
|
11
|
+
if (currentLanguage === "en-US" || currentLanguage === "en_US") {
|
|
12
|
+
currentLanguage = "en";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[header, footer].forEach((comp) => {
|
|
16
|
+
comp.setAttribute("market", "dk");
|
|
17
|
+
comp.setAttribute("language", currentLanguage);
|
|
18
|
+
comp.setAttribute("site-domain-in-urls", "true");
|
|
19
|
+
comp.setAttribute("hide-site-selector", "true");
|
|
20
|
+
comp.setAttribute("spa-mode", "true");
|
|
21
|
+
const environment =
|
|
22
|
+
window.location.href.indexOf("kundeservice.postnord.dk") !== -1 ? "production" : "preproduction";
|
|
23
|
+
comp.setAttribute("environment", environment);
|
|
24
|
+
});
|
|
25
|
+
document.body.insertBefore(header, document.body.firstElementChild);
|
|
26
|
+
document.body.appendChild(footer);
|
|
27
|
+
|
|
28
|
+
const currentMinorVersion = "#packageversion#";
|
|
29
|
+
const requestedComponentVersion = new URLSearchParams(window.location.search).get("componentversion");
|
|
30
|
+
const versionToLoad = requestedComponentVersion ? requestedComponentVersion : currentMinorVersion;
|
|
31
|
+
|
|
32
|
+
const s = document.createElement("script");
|
|
33
|
+
s.setAttribute("type", "module");
|
|
34
|
+
s.setAttribute(
|
|
35
|
+
"src",
|
|
36
|
+
`https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@${versionToLoad}/umd/standalone-loader-salesforce.js`
|
|
37
|
+
);
|
|
38
|
+
document.querySelector("head").appendChild(s);
|
|
39
|
+
|
|
40
|
+
window["bindLanguageSelector"] = function () {
|
|
41
|
+
if (window["haslangchange"]) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
window.addEventListener("marketweb-languagechange", (e) => {
|
|
45
|
+
let lang = e.detail;
|
|
46
|
+
if (lang === "en") {
|
|
47
|
+
lang = "en_US";
|
|
48
|
+
}
|
|
49
|
+
const queryParams = new URLSearchParams(window.location.search);
|
|
50
|
+
const currentLanguageValue = queryParams.get("language");
|
|
51
|
+
|
|
52
|
+
if (lang.indexOf("en") !== -1) {
|
|
53
|
+
const rootUrl = window.location.href.indexOf("kundeservice-test.postnord.dk" !== -1)
|
|
54
|
+
? "https://www.postnord.dk"
|
|
55
|
+
: "https://dk-prep.postnord.com";
|
|
56
|
+
window.location.href = `${rootUrl}/en/help-and-support/private`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
window.location.href = newUrl;
|
|
60
|
+
});
|
|
61
|
+
window["haslangchange"] = true;
|
|
62
|
+
};
|
|
63
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
64
|
+
window["bindLanguageSelector"]();
|
|
65
|
+
});
|
|
66
|
+
window.setTimeout(() => {
|
|
67
|
+
window["bindLanguageSelector"]();
|
|
68
|
+
}, 200);
|
|
69
|
+
window["renderpncomponent-interval"] = window.setInterval(renderPNComponents, 150);
|
|
70
|
+
renderPNComponents();
|
|
71
|
+
})();
|
|
72
|
+
|
|
73
|
+
function renderPNComponents() {
|
|
74
|
+
const componentsDivs = [...document.querySelectorAll("[data-component]:not([data-component-rendered])")];
|
|
75
|
+
componentsDivs.forEach((componentDiv) => {
|
|
76
|
+
const component = document.createElement(componentDiv.getAttribute("data-component"));
|
|
77
|
+
[...componentDiv.attributes].map((dataAttribute) => {
|
|
78
|
+
if (dataAttribute.name.indexOf("data-component-") === -1) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
component.setAttribute(dataAttribute.name.replace("data-component-", ""), dataAttribute.value);
|
|
82
|
+
});
|
|
83
|
+
component.innerHTML = componentDiv.innerHTML;
|
|
84
|
+
componentDiv.innerHTML = "";
|
|
85
|
+
componentDiv.appendChild(component);
|
|
86
|
+
componentDiv.setAttribute("data-component-rendered", "");
|
|
87
|
+
});
|
|
88
|
+
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
document.body.insertBefore(header, document.body.firstElementChild);
|
|
25
25
|
document.body.appendChild(footer);
|
|
26
26
|
|
|
27
|
-
const currentMinorVersion = "4.
|
|
27
|
+
const currentMinorVersion = "4.5.0";
|
|
28
28
|
const requestedComponentVersion = new URLSearchParams(window.location.search).get("componentversion");
|
|
29
29
|
const versionToLoad = requestedComponentVersion ? requestedComponentVersion : currentMinorVersion;
|
|
30
30
|
|
package/vscode-data.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,g as i,h as s,d as a}from"./p-b3a13b6a.js";const n='<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0m8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m0 8a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m1 2v4.5a1 1 0 1 1-2 0V12a1 1 0 1 1 2 0" clip-rule="evenodd"/></svg>';const d=n;const h="pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-date-and-time pn-date-picker .pn-date-picker{container-type:normal}pn-date-and-time label{color:#5e554a;font-size:1.4rem}pn-date-and-time .time-separator{margin-top:auto;margin-bottom:auto}pn-date-and-time .date-and-time-group{margin-bottom:1rem}pn-date-and-time .date-and-time-row{display:flex;gap:1rem}pn-date-and-time .helper-text{margin-top:0.2rem;color:#5e554a;display:block}pn-date-and-time .error-message{color:#a70707}";const l=h;const o=class{constructor(i){t(this,i);this.dateandtimerange=e(this,"dateandtimerange",7);this.languageCode=null;this.dateAndTimeLabel="";this.dateDaysFromToday=0;this.validTimeRangeMinutes=0;this.errorMessage="";this.dateHelperText="";this.timeHelperText="";this.disableWeekends=false;this.disabledDates=null;this.datePlaceholder="";this.minFromHour=undefined;this.maxToHour=undefined;this.language=null;this.hourArr=null;this.minuteArr=null;this.formValue=null;this.invalidTimespan=false;this.selectedDate=null;this.selectedFromHour=undefined;this.selectedFromMin=undefined;this.selectedToHour=undefined;this.selectedToMin=undefined;this.firstValidDateString="";this.lastValidDateString=""}get hostElement(){return i(this)}pnDatePicker=null;pnTimeFromHourDropdown=null;pnTimeFromMinuteDropdown=null;pnTimeToHourDropdown=null;pnTimeToMinuteDropdown=null;dateandtimerange;componentWillLoad(){this.setInitialValues()}componentDidLoad(){this.setDefaultHiddenValue();this.addEventHandlers()}setInitialValues(){this.setLanguageCode();this.setFirstValidDate();if(!this.minFromHour){this.minFromHour=14}if(!this.maxToHour){this.maxToHour=17}this.hourArr=this.getNumbersAsStringArr(this.minFromHour,this.maxToHour,1);this.minuteArr=this.getNumbersAsStringArr(0,50,10)}setFirstValidDate(){const t=new Date;t.setDate(t.getDate()+this.dateDaysFromToday);const e=t.getFullYear();const i=(t.getMonth()+1).toString().padStart(2,"0");const s=t.getDate().toString().padStart(2,"0");const a=e+2;this.firstValidDateString=`${e.toString()}-${i}-${s}`;this.lastValidDateString=`${a.toString()}-${i}-${s}`}setLanguageCode(){if(typeof this.languageCode==="string"&&this.languageCode.trim()===""){this.language=document.querySelector("html").lang}else{this.language=this.languageCode}}setDefaultHiddenValue(){this.selectedFromHour=parseInt(this.hourArr[0]);this.selectedFromMin=parseInt(this.minuteArr[0]);this.selectedToHour=parseInt(this.hourArr[this.hourArr.length-1]);this.selectedToMin=parseInt(this.minuteArr[this.minuteArr.length-1]);this.updateHiddenValue()}addEventHandlers(){const t=this.handleChange.bind(this);this.pnDatePicker.addEventListener("dateselection",t);this.pnTimeFromHourDropdown.addEventListener("change",t);this.pnTimeFromMinuteDropdown.addEventListener("change",t);this.pnTimeToHourDropdown.addEventListener("change",t);this.pnTimeToMinuteDropdown.addEventListener("change",t)}handleChange(t){if(t.target===this.pnDatePicker){this.selectedDate=t.detail.start}const e=t.target;const i=e.value;if(e.name===this.pnTimeFromHourDropdown.name){this.selectedFromHour=parseInt(i)}else if(e.name===this.pnTimeFromMinuteDropdown.name){this.selectedFromMin=parseInt(i)}else if(e.name===this.pnTimeToHourDropdown.name){this.selectedToHour=parseInt(i)}else if(e.name===this.pnTimeToMinuteDropdown.name){this.selectedToMin=parseInt(i)}this.updateHiddenValue()}updateHiddenValue(){const t=new Date;const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),this.selectedFromHour,this.selectedFromMin,0,0);const i=new Date(t.getFullYear(),t.getMonth(),t.getDate(),this.selectedToHour,this.selectedToMin,0,0);this.validateTimeRange(e.getTime(),i.getTime());if(this.invalidTimespan||!this.selectedDate){this.formValue=""}else{const t=this.selectedFromMin.toString().padStart(2,"0");const e=this.selectedToMin.toString().padStart(2,"0");this.formValue=`${this.selectedDate}, ${this.selectedFromHour}:${t}-${this.selectedToHour}:${e}`}this.dateandtimerange.emit(this.formValue)}validateTimeRange(t,e){let i=(e-t)/1e3;i/=60;this.invalidTimespan=i<this.validTimeRangeMinutes?true:false}getNumbersAsStringArr(t,e,i){const s=Array.from({length:(e-t)/i+1},((e,s)=>t+s*i));const a=[];s.forEach((t=>{const e=t.toString().padStart(2,"0");a.push(e)}));return a}removePnOptionSelected(){const t=this.hostElement.querySelectorAll("option");t.forEach((t=>{t.removeAttribute("selected")}))}render(){return s(a,{key:"60e68e04200db9303ef2e84dc046a6c92844487f"},s("div",{key:"8857c3a3232caa6b701f30b0f13d02dc2c739e54",class:"date-and-time-group"},this.dateAndTimeLabel?s("div",{class:"date-and-time-row"},s("label",null,this.dateAndTimeLabel)):null,s("div",{key:"82e9e3a55361697b37275a0b4e31f5b09bd5eb43",class:"date-and-time-row"},s("pn-date-picker",{key:"efdd2e74f7eb8064073b9ab8d5a101edfa811a29",ref:t=>this.pnDatePicker=t,range:"false","disable-weekends":this.disableWeekends,"min-date":this.firstValidDateString,"max-date":this.lastValidDateString,language:this.language,placeholder:this.datePlaceholder,"disabled-dates":this.disabledDates})),this.dateHelperText?s("small",{class:"date-and-time-row helper-text"},this.dateHelperText):null),s("div",{key:"bb00ae7e49da0175ea099d81c8755f35ec14ff77",class:"date-and-time-group"},s("div",{key:"520fd0a41f9acb0e787632490390d6b611ef39be",class:"date-and-time-row"},s("pn-select",{key:"c220a53c6135045a4abdc1926873b5cbb6244884",ref:t=>this.pnTimeFromHourDropdown=t,name:"date-and-time-from-hour",class:"date-and-time-dropdown--time",invalid:this.invalidTimespan},this.hourArr?.map(((t,e)=>s("option",{label:t,value:t,selected:e===0},t)))),s("pn-select",{key:"a7b33b9a750700b9817128a9c1adfebab794a6a3",ref:t=>this.pnTimeFromMinuteDropdown=t,name:"date-and-time-from-minute",class:"date-and-time-dropdown--time",invalid:this.invalidTimespan},this.minuteArr?.map(((t,e)=>s("option",{label:t,value:t,selected:e===0},t)))),s("div",{key:"d029032c9a94be5cfb576e043ebda297839b3c96",class:"time-separator"},s("span",{key:"8d53aee1b0e9f17708cba86ab0f2a557b81964ad"},"-")),s("pn-select",{key:"faedc85315a18f59f965377ff03eb5ba77416c7a",ref:t=>this.pnTimeToHourDropdown=t,name:"date-and-time-to-hour",class:"date-and-time-dropdown--time",invalid:this.invalidTimespan},this.hourArr?.map(((t,e)=>s("option",{label:t,value:t,selected:e===this.hourArr.length-1},t)))),s("pn-select",{key:"b747f94f3adf68590ec32c17afc8ac2dfd8a2266",ref:t=>this.pnTimeToMinuteDropdown=t,name:"date-and-time-to-minute",class:"date-and-time-dropdown--time",invalid:this.invalidTimespan},this.minuteArr?.map(((t,e)=>s("option",{label:t,value:t,selected:e===this.minuteArr.length-1},t))))),this.timeHelperText?s("small",{class:"date-and-time-row helper-text"},this.timeHelperText):null,this.invalidTimespan&&this.errorMessage?s("small",{class:"date-and-time-row error-message"},s("pn-icon",{icon:d,small:"false",color:"warning"}),this.errorMessage):null))}};o.style=l;export{o as pn_date_and_time};
|
|
2
|
-
//# sourceMappingURL=p-99843884.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["icon","alert_info_circle","pnDateAndTimeCss","PnDateAndTimeStyle0","PnDateAndTime","pnDatePicker","pnTimeFromHourDropdown","pnTimeFromMinuteDropdown","pnTimeToHourDropdown","pnTimeToMinuteDropdown","dateandtimerange","componentWillLoad","this","setInitialValues","componentDidLoad","setDefaultHiddenValue","addEventHandlers","setLanguageCode","setFirstValidDate","minFromHour","maxToHour","hourArr","getNumbersAsStringArr","minuteArr","date","Date","setDate","getDate","dateDaysFromToday","year","getFullYear","month","getMonth","toString","padStart","day","endYear","firstValidDateString","lastValidDateString","languageCode","trim","language","document","querySelector","lang","selectedFromHour","parseInt","selectedFromMin","selectedToHour","length","selectedToMin","updateHiddenValue","boundHandleChange","handleChange","bind","addEventListener","e","target","selectedDate","detail","start","value","name","dateFrom","dateTo","validateTimeRange","getTime","invalidTimespan","formValue","fromMin","toMin","emit","from","to","differenceValue","validTimeRangeMinutes","stop","step","arr","Array","_","index","result","forEach","item","itemAsString","push","removePnOptionSelected","selectOptions","hostElement","querySelectorAll","elm","removeAttribute","render","h","Host","key","class","dateAndTimeLabel","ref","el","range","disableWeekends","placeholder","datePlaceholder","disabledDates","dateHelperText","invalid","map","hour","label","selected","minute","timeHelperText","errorMessage","small","color"],"sources":["node_modules/pn-design-assets/pn-assets/icons/alert_info_circle.js","src/components/input/pn-date-and-time/pn-date-and-time.scss?tag=pn-date-and-time","src/components/input/pn-date-and-time/pn-date-and-time.tsx"],"sourcesContent":["const icon = '<svg class=\"pn-icon-svg\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"#000\" fill-rule=\"evenodd\" d=\"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0m8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m0 8a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m1 2v4.5a1 1 0 1 1-2 0V12a1 1 0 1 1 2 0\" clip-rule=\"evenodd\"/></svg>';\nexport const alert_info_circle = icon;\nexport const alertInfoCircle = icon;\n","@import '../../../globals/main.scss';\n\npn-date-and-time {\n pn-date-picker .pn-date-picker {\n container-type: normal;\n }\n\n label {\n color: $gray700;\n font-size: 1.4rem;\n }\n\n .time-separator {\n margin-top: auto;\n margin-bottom: auto;\n }\n\n .date-and-time-group {\n margin-bottom: 1rem;\n }\n\n .date-and-time-row {\n display: flex;\n gap: 1rem;\n }\n\n .helper-text {\n margin-top: 0.2rem;\n color: $gray700;\n display: block;\n }\n\n .error-message {\n color: #a70707;\n }\n}","import { Component, Prop, h, Element, State, Host, Event, EventEmitter } from '@stencil/core';\nimport { alert_info_circle } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-date-and-time',\n styleUrl: 'pn-date-and-time.scss',\n})\nexport class PnDateAndTime {\n @Element() hostElement: Element;\n pnDatePicker: HTMLElement = null;\n pnTimeFromHourDropdown: HTMLSelectElement = null;\n pnTimeFromMinuteDropdown: HTMLSelectElement = null;\n pnTimeToHourDropdown: HTMLSelectElement = null;\n pnTimeToMinuteDropdown: HTMLSelectElement = null;\n\n @Prop() languageCode: string = null;\n @Prop() dateAndTimeLabel: string = '';\n @Prop() dateDaysFromToday: number = 0;\n @Prop() validTimeRangeMinutes: number = 0;\n @Prop() errorMessage: string = '';\n @Prop() dateHelperText: string = '';\n @Prop() timeHelperText: string = '';\n @Prop() disableWeekends: boolean = false;\n @Prop() disabledDates: string = null;\n @Prop() datePlaceholder: string = '';\n @Prop() minFromHour: number;\n @Prop() maxToHour: number;\n\n @State() language: string = null;\n @State() hourArr: string[] = null;\n @State() minuteArr: string[] = null;\n @State() formValue: string = null;\n @State() invalidTimespan: boolean = false;\n @State() selectedDate: string = null;\n @State() selectedFromHour: number;\n @State() selectedFromMin: number;\n @State() selectedToHour: number;\n @State() selectedToMin: number;\n @State() firstValidDateString: string = '';\n @State() lastValidDateString: string = '';\n\n @Event() dateandtimerange: EventEmitter<string>;\n\n componentWillLoad() {\n this.setInitialValues();\n }\n\n componentDidLoad() {\n this.setDefaultHiddenValue();\n this.addEventHandlers();\n }\n\n setInitialValues() {\n this.setLanguageCode();\n this.setFirstValidDate();\n\n if (!this.minFromHour) {\n this.minFromHour = 14;\n }\n\n if (!this.maxToHour) {\n this.maxToHour = 17;\n }\n\n this.hourArr = this.getNumbersAsStringArr(this.minFromHour, this.maxToHour, 1);\n this.minuteArr = this.getNumbersAsStringArr(0, 50, 10);\n }\n\n setFirstValidDate() {\n const date = new Date();\n date.setDate(date.getDate() + this.dateDaysFromToday);\n\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n const endYear = year + 2;\n\n this.firstValidDateString = `${year.toString()}-${month}-${day}`;\n this.lastValidDateString = `${endYear.toString()}-${month}-${day}`;\n }\n\n setLanguageCode() {\n if (typeof this.languageCode === 'string' && this.languageCode.trim() === '') {\n this.language = document.querySelector('html').lang;\n } else {\n this.language = this.languageCode;\n }\n }\n\n setDefaultHiddenValue() {\n this.selectedFromHour = parseInt(this.hourArr[0]);\n this.selectedFromMin = parseInt(this.minuteArr[0]);\n this.selectedToHour = parseInt(this.hourArr[this.hourArr.length -1]);\n this.selectedToMin = parseInt(this.minuteArr[this.minuteArr.length -1 ]);\n\n this.updateHiddenValue();\n }\n\naddEventHandlers() {\n const boundHandleChange = this.handleChange.bind(this);\n\n this.pnDatePicker.addEventListener('dateselection', boundHandleChange);\n this.pnTimeFromHourDropdown.addEventListener('change', boundHandleChange);\n this.pnTimeFromMinuteDropdown.addEventListener('change', boundHandleChange);\n this.pnTimeToHourDropdown.addEventListener('change', boundHandleChange);\n this.pnTimeToMinuteDropdown.addEventListener('change', boundHandleChange);\n}\n\n\nhandleChange(e: CustomEvent) {\n\n if (e.target === this.pnDatePicker) {\n this.selectedDate = e.detail.start;\n }\n\n const target = e.target as HTMLSelectElement;\n\n const value = target.value;\n\n if (target.name === this.pnTimeFromHourDropdown.name) {\n this.selectedFromHour = parseInt(value);\n } else if (target.name === this.pnTimeFromMinuteDropdown.name) {\n this.selectedFromMin = parseInt(value);\n } else if (target.name === this.pnTimeToHourDropdown.name) {\n this.selectedToHour = parseInt(value);\n } else if (target.name === this.pnTimeToMinuteDropdown.name) {\n this.selectedToMin = parseInt(value);\n }\n\n this.updateHiddenValue();\n}\n\n\n updateHiddenValue() {\n const date = new Date();\n const dateFrom = new Date(date.getFullYear(), date.getMonth(), date.getDate(), this.selectedFromHour, this.selectedFromMin, 0, 0);\n const dateTo = new Date(date.getFullYear(), date.getMonth(), date.getDate(), this.selectedToHour, this.selectedToMin, 0, 0);\n this.validateTimeRange(dateFrom.getTime(), dateTo.getTime());\n\n if (this.invalidTimespan || !this.selectedDate) {\n this.formValue = '';\n } else {\n const fromMin = this.selectedFromMin.toString().padStart(2, '0');\n const toMin = this.selectedToMin.toString().padStart(2, '0');\n\n this.formValue = `${this.selectedDate}, ${this.selectedFromHour}:${fromMin}-${this.selectedToHour}:${toMin}`;\n }\n this.dateandtimerange.emit(this.formValue);\n }\n\n validateTimeRange(from: number, to: number) {\n let differenceValue = (to - from) / 1000;\n differenceValue /= 60;\n this.invalidTimespan = differenceValue < this.validTimeRangeMinutes ? true : false;\n }\n\n getNumbersAsStringArr(start: number, stop: number, step: number) {\n const arr = Array.from({ length: (stop - start) / step + 1 }, (_, index: number) => start + index * step);\n const result: string[] = [];\n\n arr.forEach(item => {\n const itemAsString = item.toString().padStart(2, '0');\n result.push(itemAsString);\n });\n\n return result;\n }\n\n removePnOptionSelected() {\n const selectOptions = this.hostElement.querySelectorAll('option');\n selectOptions.forEach(elm => {\n elm.removeAttribute('selected');\n });\n }\n\n render() {\n return (\n <Host>\n <div class=\"date-and-time-group\">\n {this.dateAndTimeLabel ? (\n <div class=\"date-and-time-row\">\n <label>{this.dateAndTimeLabel}</label>\n </div>\n ) : null}\n <div class=\"date-and-time-row\">\n <pn-date-picker\n ref={el => (this.pnDatePicker = el as HTMLInputElement)}\n range=\"false\"\n disable-weekends={this.disableWeekends}\n min-date={this.firstValidDateString}\n max-date={this.lastValidDateString}\n language={this.language}\n placeholder={this.datePlaceholder}\n disabled-dates={this.disabledDates}\n ></pn-date-picker>\n </div>\n\n {this.dateHelperText ? <small class=\"date-and-time-row helper-text\">{this.dateHelperText}</small> : null}\n </div>\n <div class=\"date-and-time-group\">\n <div class=\"date-and-time-row\">\n <pn-select\n ref={el => (this.pnTimeFromHourDropdown = el as HTMLSelectElement)}\n name=\"date-and-time-from-hour\"\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan} >\n {this.hourArr?.map((hour: string, index: number) => <option label={hour} value={hour} selected={index === 0}>{hour}</option>)}\n </pn-select>\n <pn-select\n ref={el => (this.pnTimeFromMinuteDropdown = el as HTMLSelectElement)}\n name=\"date-and-time-from-minute\"\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan} >\n {this.minuteArr?.map((minute: string, index: number) => <option label={minute} value={minute} selected={index === 0}>{minute}</option>)}\n </pn-select>\n <div class=\"time-separator\">\n <span>-</span>\n </div>\n <pn-select\n ref={el => (this.pnTimeToHourDropdown = el as HTMLSelectElement)}\n name=\"date-and-time-to-hour\"\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan} >\n {this.hourArr?.map((hour: string, index: number) => <option label={hour} value={hour} selected={index === this.hourArr.length -1}>{hour}</option>)}\n </pn-select>\n <pn-select\n ref={el => (this.pnTimeToMinuteDropdown = el as HTMLSelectElement)}\n name=\"date-and-time-to-minute\"\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan} >\n {this.minuteArr?.map((minute: string, index: number) => <option label={minute} value={minute} selected={index === this.minuteArr.length -1}>{minute}</option>)}\n </pn-select>\n </div>\n {this.timeHelperText ? <small class=\"date-and-time-row helper-text\">{this.timeHelperText}</small> : null}\n\n {this.invalidTimespan && this.errorMessage ? (\n <small class=\"date-and-time-row error-message\">\n <pn-icon icon={alert_info_circle} small=\"false\" color=\"warning\" />\n {this.errorMessage}\n </small>\n ) : null}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* By PostNord.
|
|
4
|
-
*/
|
|
5
|
-
import{t as e,r as n,c as t,g as o,h as a}from"./p-XKg-ydzH.js";import{a as i}from"./p-D_UyW-KH.js";const p=class{constructor(e){n(this,e),this.itemselection=t(this,"itemselection",7)}get hostElement(){return o(this)}value;href;active=!1;itemselection;select(e){this.value&&!this.href&&e.preventDefault(),this.itemselection.emit(this.value)}setClassnames(){let e="pn-page-nav-dropdown-item ";return this.active&&(e+="pn-page-nav-dropdown-item-active "),e}getType(){return this.value?null:"button"}getTagName(){return this.value?"a":"button"}render(){const e=this.getTagName();return a("li",{key:"93c6bd31a88c76797cee2bc915c31e6ecfa5aace"},a(e,{key:"2818d4f3a1572f863f9b9a8609d572f5994f6e75",href:this.href||"#",class:this.setClassnames(),type:this.getType(),onClick:e=>this.select(e),tabindex:"-1"},a("slot",{key:"e04f130737445747a2b93bf9d7372bf22889fcff"}),a("pn-icon",{key:"934d46f6bd482171d974efec7c4494f8b1b1faff",icon:i,color:"white"})),a("hr",{key:"c5c9c4a24affe5b10d56e8a6ca5d6bee434aa571"}))}};p.style=`${e("pn-page-nav-dropdown-item")}:first-of-type li>a,${e("pn-page-nav-dropdown-item")}:first-of-type li>button{border-radius:0.5em 0.5em 0 0}${e("pn-page-nav-dropdown-item")}:last-of-type li>a,${e("pn-page-nav-dropdown-item")}:last-of-type li>button{border-radius:0 0 0.5em 0.5em}${e("pn-page-nav-dropdown-item")}:last-of-type li>hr{display:none}${e("pn-page-nav-dropdown-item")} li{font-size:inherit}${e("pn-page-nav-dropdown-item")} li>*{color:#ffffff;font-size:inherit;border:none;padding:1em;margin:0;display:flex;justify-content:space-between;align-items:center;cursor:pointer;transition:background 0.15s;outline:none;width:100%;font-weight:500}${e("pn-page-nav-dropdown-item")} li>*>${e("pn-icon")}{margin-left:1em}${e("pn-page-nav-dropdown-item")} li>*.pn-page-nav-dropdown-item-active{background:#005d92}${e("pn-page-nav-dropdown-item")} li>*.pn-page-nav-dropdown-item-active:hover,${e("pn-page-nav-dropdown-item")} li>*.pn-page-nav-dropdown-item-active:focus{background:#005d92}${e("pn-page-nav-dropdown-item")} li>*:hover,${e("pn-page-nav-dropdown-item")} li>*:focus{background:#0d234b}${e("pn-page-nav-dropdown-item")} li>*:focus{box-shadow:inset 0 0 0 0.1em #005d92, inset 0 0 0 0.2em #d3cecb}${e("pn-page-nav-dropdown-item")} li>a{text-decoration:none}${e("pn-page-nav-dropdown-item")} li>button{background:none}${e("pn-page-nav-dropdown-item")} li>hr{bottom:0;padding:0;margin:0 auto;border-top:0.0625em solid #d3cecb;opacity:0.6;width:85%}`;export{p as pn_page_nav_dropdown_item}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* By PostNord.
|
|
4
|
-
*/
|
|
5
|
-
import{t,M as e,r as i,c as n,g as l,h as o,a as s}from"./p-XKg-ydzH.js";import{a as c}from"./p-BWAVaTWQ.js";import{a as r}from"./p-B88w-Zxn.js";import{c as a}from"./p-DrYFvs2M.js";import{c as p}from"./p-BvuWkoyY.js";import{uuidv4 as u,awaitTopbar as d,ripple as m,getTotalHeightOffset as h,getMenuWidth as b,en as f}from"./index.esm.js";const g={SELECT_AN_OPTION:{en:"Select an option",sv:"Välj ett alternativ",da:"Vælg en mulighed",fi:"Valitse vaihtoehto",no:"Velg et alternativ"},SELECT_ALL_OPTIONS:{en:"Select all options",sv:"Välj alla alternativ",da:"Vælg alle muligheder",fi:"Valitse kaikki vaihtoehdot",no:"Velg alle alternativer"},SELECT_FOUND_OPTIONS:{en:"Select {number} options",sv:"Välj {number} alternativ",da:"Vælg {number} muligheder",fi:"Valitse {number} vaihtoehtoa",no:"Velg {number} alternativer"},SELECTED_OPTIONS:{en:"Selected options.",sv:"Valda alternativ.",da:"Valgte muligheder.",fi:"Valitut vaihtoehdot.",no:"Valgte alternativer."},BUTTON_OPEN:{en:"Open list",sv:"Öppna listan",da:"Open list",fi:"Open list",no:"Open list"},BUTTON_CLOSE:{en:"Close list",sv:"Stäng listan",da:"Close list",fi:"Close list",no:"Close list"},REMOVE:{en:"Remove",sv:"Ta bort",da:"Remove",fi:"Remove",no:"Remove"},REMOVED:{en:"Removed",sv:"Tog bort",da:"Fjernet",fi:"Poistettu",no:"Fjernet"},MORE_OPTION:{en:"more option.",sv:"alternativ till.",da:"mulighed mere.",fi:"vaihtoehto lisää.",no:"alternativ til."},MORE_OPTIONS:{en:"more options.",sv:"fler alternativ.",da:"more options.",fi:"more options.",no:"more options."},SEARCH:{en:"Search",sv:"Sök",da:"Søg",fi:"Hae",no:"Søk"},RESULTS_FOUND:{en:"options found",sv:"alternativ hittades",da:"muligheder fundet",fi:"vaihtoehtoja löytyi",no:"alternativer funnet"},NO_SEARCH_RESULTS:{en:"No options found",sv:"Inga alternativ hittades",da:"Ingen muligheder fundet",fi:"Vaihtoehtoja ei löytynyt",no:"Finner ingen alternativer"},NO_OPTIONS:{en:"No options available",sv:"Inga alternativ tillgängliga",da:"Ingen tilgængelige muligheder",fi:"Ei vaihtoehtoja",no:"Ingen tilgjengelige alternativer"}},k=class extends(e(c)){constructor(t){super(),i(this,t),this.toggleSelect=n(this,"toggleSelect",7),this.allOptions=n(this,"allOptions",7),this.selectedOption=n(this,"selectedOption",7),this.selectedAllOptions=n(this,"selectedAllOptions",7),this.searchInput=n(this,"searchInput",7)}id=`pn-multiselect-${u()}`;idLegend=`${this.id}-legend`;idButton=`${this.id}-button`;idOptions=`${this.id}-options`;idHelper=`${this.id}-text`;idError=`${this.id}-error`;idChips=`${this.id}-chips`;idSr=`${this.id}-sr`;elGroup;elButton;elInput;elList;elChips;srTimer;get hostElement(){return l(this)}isSearching=!1;open=!1;upwards=!1;srMessage;label;helpertext;language=void 0;name;selectName;placeholder;required=!1;disabled=!1;options;compact=!1;icon;selectAll=!1;allValue="pn_multiselect_all";search=!1;searchQuery="";itemCount=5;maxHeight;top=!1;bottom=!1;invalid=!1;error;pnId;pnAriaLabel;pnAriaLabelledby;selectId;handleOpen(){this.open?(this.addGlobalEventListeners(),this.handleDirection(),this.handleMaxHeight(),this.handleOffset()):this.removeGlobalEventListeners(),this.dropdownHandler()}handleSearch(){this.search||(this.options=[...this.options.map((t=>{const e={...t,hide:!1};return e?.group?.length&&e.group.map((t=>({...t,hide:!1}))),e}))])}handleSearchQuery(){this.search&&"string"==typeof this.searchQuery&&this.handleInputSearch()}handleSelectId(){const t=this.getId();this.idLegend=`${t}-legend`,this.idButton=`${t}-button`,this.idOptions=`${t}-options`,this.idHelper=`${t}-text`,this.idError=`${t}-error`,this.idChips=`${t}-chips`,this.idSr=`${t}-sr`}handleResize(){this.open&&(this.toggleOpen(!1),this.elGroup.style.removeProperty("--pn-select-max-height"),this.elGroup.style.removeProperty("--pn-select-options-offset"))}toggleSelect;allOptions;selectedOption;selectedAllOptions;searchInput;async componentWillLoad(){void 0===this.language&&await d(this.hostElement)}componentDidLoad(){this.searchQuery?.length&&this.handleSearchQuery()}getId(){return this.pnId||this.selectId||this.id}hasHelperText(){return this.helpertext?.length>0||this.checkSlottedHelper()}hasErrorMessage(){return this.error?.length>0||this.checkSlottedError()}hasError(){return this.hasErrorMessage()||this.invalid}checkSlottedHelper(){return!!this.hostElement.querySelector("[slot=helpertext]")}checkSlottedError(){return!!this.hostElement.querySelector("[slot=error]")}hideHelpertext(){return this.hasErrorMessage()||!this.hasHelperText()}hideError(){return!this.hasErrorMessage()}globalEvents=t=>{this.hostElement.contains(t.target)&&"Escape"!==t?.key||this.toggleOpen(!1)};addGlobalEventListeners(){this.hostElement.getRootNode().addEventListener("click",this.globalEvents)}removeGlobalEventListeners(){this.hostElement.getRootNode().removeEventListener("click",this.globalEvents)}dropdownHandler(){this.open?this.openDropdown(this.elList):this.closeDropdown(this.elList)}emitEvents(t,e){if(this.allOptions.emit(this.options),t)return this.selectedOption.emit(t);const i={checked:e,searching:this.isSearching};this.search&&this.optionsTotal()!==this.optionsSearch().length&&(i.query=this.searchQuery,i.found=this.optionsSearch()),this.selectedAllOptions.emit(i)}optionsChecked(){const t=this.options?.reduce(((t,e)=>{const i=e.group?[...e.group.filter((({checked:t})=>t))]:[];return e.checked&&t.push(e),i?.length&&t.push(...i),t}),[]);return t}optionsTotal(){return this.options?.reduce(((t,e)=>t+(e?.group?.length?e.group.length+1:1)),0)}optionsIndex(t){const e=({group:e=[]})=>e?.findIndex((({value:e})=>e===t)),i=this.options.findIndex((i=>i.value===t||-1!==e(i)));return{indexGroup:i,indexNested:e(this.options?.[i])}}optionsCheckedTotal(){return this.optionsChecked()?.length}optionsCheckedPreview(){return this.optionsChecked()?.slice(0,this.itemCount)}optionsCheckedLabels(){return this.optionsChecked()?.map((({label:t})=>t))?.join(", ")?.trim()}optionsSearch(){const t=this.options?.reduce(((t,e)=>{const i=e.group?[...e.group.filter((({hide:t})=>!t))]:[];return e.hide||t.push(e),i?.length&&t.push(...i),t}),[]);return t}noResults(){return 0===this.optionsSearch()?.length}isIndeterminate(t){const e=this.options?.[t];if(e?.group?.length){const t=e.group.every((({checked:t})=>t)),i=e.group.every((({checked:t})=>!t));return!(t||i)}return!1}optionSelect({val:t,checked:e,chip:i}){if(t===this.allValue)return this.optionSelectAll(e);const n=this.options,{indexGroup:l,indexNested:o}=this.optionsIndex(t),s=n[l]?.group,c=s?.[o];if(c?.value){n[l].group[o].checked=e;const t=s?.every((({checked:t})=>t));n[l].checked=!!t}else n[l].checked=e,s?.length&&(n[l].group=s?.map((t=>({...t,checked:e}))));const r=-1===o?n[l]:n[l].group[o];this.emitEvents(r),this.options=[...n],"number"==typeof i&&(this.handleSrMesssage(`${this.translate("REMOVED")} ${r.label}`),requestAnimationFrame((()=>{const t=i===this.optionsCheckedTotal()?i-1:i,e=Array.from(this.elChips.children)?.[t];e?.querySelector("button").focus({preventScroll:!0})})))}optionSelectAll(t){this.options=[...this.options.map((e=>{const i={...e,checked:this.isSearching&&e.hide?e.checked:t};i.group&&(i.group=[...i.group.map((e=>({...e,checked:this.isSearching&&e.hide?e.checked:t})))]);const n=i?.group?.every((({checked:t})=>t));return i?.group?.length&&(i.checked=n),i}))],this.emitEvents(null,t)}optionSelected(t){return!!this.optionsChecked()?.find((({value:e,checked:i})=>e===t&&i))}translate(t){const e=g?.[t]?.[this.language||f];return e.includes("{number}")?e.replace("{number}",this.optionsSearch().length):e}getRect(t){return t?.getBoundingClientRect()}ripple({clientX:t,clientY:e,target:i}){const n=0===t&&0===e,l=i.nextElementSibling,{x:o,width:s,y:c,top:r}=this.getRect(l);m(n?{clientX:o+s-24,clientY:c-r}:{clientX:t,clientY:e},l)}handleSrMesssage(t){this.srMessage=t,clearTimeout(this.srTimer),this.srTimer=setTimeout((()=>this.srMessage=null),2e3)}handleDirection(){if(this.top)return this.upwards=!0;if(this.bottom)return this.upwards=!1;const{bottom:t,top:e}=this.getRect(this.elInput),i=window.innerHeight-t-16;this.upwards=(e-16)/2>i}handleMaxHeight(){if(this.maxHeight)return this.elGroup.style.setProperty("--pn-select-max-height",this.maxHeight);const{bottom:t,top:e}=this.getRect(this.elInput),i=this.upwards?e:t,n=h(),l=this.upwards?n+16:16,o=this.upwards?i-l:window.innerHeight-i-l;this.elGroup.style.setProperty("--pn-select-max-height",`${Math.ceil(o)}px`)}handleOffset(){this.elGroup.style.removeProperty("--pn-select-options-offset"),requestAnimationFrame((()=>{const{left:t,right:e}=this.getRect(this.elList),i=b()+8,n=window.innerWidth-8;let l=0;t<i?l=i-t:e>n&&(l=n-e),0!==l&&this.elGroup.style.setProperty("--pn-select-options-offset",`${Math.floor(l)}px`)}))}setFocus(){this.search?this.elInput.focus({preventScroll:!0}):this.elButton.focus({preventScroll:!0})}toggleOpen(t){"boolean"==typeof t&&t===this.open||(this.open=t??!this.open,this.toggleSelect.emit({open:this.open}))}handleInputKeyboard(t){t.stopImmediatePropagation();const{code:e}=t;if("Escape"===e)return this.toggleOpen(!1);!this.open&&e.match(/^(Space|Enter)$|Arrow|^Key.*$/)&&this.toggleOpen()}setSearchQuery(t){this.open||this.toggleOpen(!0),this.searchQuery=t}handleInputSearch(){if(this.isEmpty())return;const t=this.searchQuery,e=({label:e,helpertext:i,value:n})=>`${e} ${i} ${n}`.trim().toLowerCase().includes(t.toLowerCase()),i=this.options.map((t=>{const i=t?.group?.map((t=>({...t,hide:!e(t)})))||[],n=e(t)||i?.some((({hide:t})=>!t));return t.hide=!n,t?.group?.length&&(t.group=[...i]),t}));this.isSearching=""!==t,this.options=[...i],this.searchInput.emit({query:t,found:this.optionsSearch()})}getListItem(t){const{value:e}=this.options[t];return this.elList.querySelector(`.pn-multiselect-option-input[value='${e}']`)}getOptionIndex(t,e,i){const n=this.optionsTotal()-1;if("End"===i)return n;if("Home"===i)return 0;const l=this.options.findIndex((({value:e})=>e===t))+e.find((t=>"number"==typeof t));return l>=n?n:l<=0?0:l}checkboxNav(t,e){const{code:i}=t,n="Tab"===i,l="Space"===i,o="Enter"===i,s="Escape"===i,c=["ArrowUp"===i&&-1,"ArrowDown"===i&&1,"PageUp"===i&&-10,"PageDown"===i&&10,"Home"===i&&0,"End"===i&&this.optionsTotal()-1,n,l,o,s];if(!c.some((t=>"number"==typeof t||t)))return;if(n||l||o)return;if(t.stopImmediatePropagation(),t.preventDefault(),s)return this.setFocus(),this.toggleOpen(!1);const r=this.getOptionIndex(e,c,i);return this.getListItem(r)?.focus()}handleBlur(t){const e=t.target,i=t.relatedTarget;"pn-multiselect-chip-button"===(i||e)?.className&&this.toggleOpen(!1)}handleLabel(){this.disabled||this.setFocus()}isEmpty(){return 0===(this.options?.length||0)}showSelectAll(){return this.selectAll&&!this.isEmpty()&&!this.noResults()}showEmptyOption(){return this.isSearching&&this.noResults()||this.isEmpty()}getPlaceholder(){return this.placeholder||this.translate(this.search?"SEARCH":"SELECT_AN_OPTION")}handleChange({target:t}){const{value:e,checked:i}=t;this.optionSelect({val:e,checked:i})}additonalOptions(){const t=this.optionsCheckedTotal()-this.itemCount;return`${t} ${this.translate("MORE_OPTION"+(1===t?"":"S"))}`}displayLabel(){return!!this.label}getAriaLabel(){return this.displayLabel()||this.pnAriaLabelledby?null:this.pnAriaLabel}getAriaLabelledby(){return this.displayLabel()?this.idLegend:this.pnAriaLabel?null:this.pnAriaLabelledby}describedBy(){const t=[];return this.search&&t.push(this.idChips),this.srMessage&&t.push(this.idSr),this.hasHelperText()&&!this.hasErrorMessage()&&t.push(this.idHelper),this.hasErrorMessage()&&t.push(this.idError),t.length?t.join(" "):null}renderItemIcon(t,e){return(this.open||this.isMoving())&&!!t&&!e}renderOption({label:t,value:e,checked:i,helpertext:n,icon:l,id:s=`${this.getId()}-${e||t}`,invalid:c,disabled:r,hide:a,group:p},u,d){return o("li",{class:"pn-multiselect-option",key:s,hidden:a},o("input",{type:"checkbox",id:s,class:"pn-multiselect-option-input",checked:i??this.optionSelected(e),indeterminate:void 0===d&&this.isIndeterminate(u),name:this.name,value:e,disabled:this.disabled||r,required:this.required,"aria-invalid":c?"true":null,"aria-describedby":n?`${s}-helper`:null,onClick:t=>this.ripple(t),onKeyDown:t=>this.checkboxNav(t,e),onBlur:t=>this.handleBlur(t)}),o("div",{class:"pn-multiselect-option-content"},this.renderItemIcon(l,a)&&o("pn-icon",{icon:l,color:"blue900"}),o("div",{class:"pn-multiselect-option-text"},o("label",{class:"pn-multiselect-option-label",htmlFor:s},o("span",null,t)),n&&o("p",{class:"pn-multiselect-option-helper",id:`${s}-helper`},n)),o("div",{class:"pn-multiselect-option-checkbox"},o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},o("polyline",{class:"pn-multiselect-option-checkbox-checkmark-path",points:"4,12 9,17 20,6","stroke-width":"3"}),o("polyline",{class:"pn-multiselect-option-checkbox-indeterminate-path",points:"4,12 20,12","stroke-width":"3"})))),p?.length&&o("ul",{class:"pn-multiselect-optgroup"},p?.map(((t,e)=>this.renderOption(t,u,e)))))}renderOptions(){return o("ul",{id:this.idOptions,class:"pn-multiselect-options","data-open":this.open,"data-upwards":this.upwards,onChange:t=>this.handleChange(t),style:{height:"0px"},ref:t=>this.elList=t},this.showSelectAll()&&this.renderOption({label:this.translate(`SELECT_${this.isSearching?"FOUND":"ALL"}_OPTIONS`),value:this.allValue,checked:this.optionsTotal()===this.optionsCheckedTotal()}),this.options?.map(((t,e)=>this.renderOption(t,e))),this.showEmptyOption()&&o("li",{class:"pn-multiselect-option"},o("div",{class:"pn-multiselect-option-content",role:"alert"},o("div",{class:"pn-multiselect-option-text"},o("span",{class:"pn-multiselect-option-label"},this.translate(this.isEmpty()?"NO_OPTIONS":"NO_SEARCH_RESULTS"))))))}renderChips(){return o("ul",{id:this.idChips,class:"pn-multiselect-chips","aria-label":this.translate("SELECTED_OPTIONS"),ref:t=>this.elChips=t},this.optionsCheckedPreview()?.map((({label:t,value:e,icon:i},n)=>o("li",{class:"pn-multiselect-chip","aria-setsize":this.optionsCheckedTotal(),"aria-posinset":n+1,key:`${t}-${e}`},!!i&&o("pn-icon",{icon:i,small:!0}),o("span",{class:"pn-multiselect-chip-label"},t),o("button",{type:"button",class:"pn-multiselect-chip-button","aria-label":`${this.translate("REMOVE")} ${t}`,onClick:()=>this.optionSelect({val:e,checked:!1,chip:n})},o("pn-icon",{icon:p,small:!0,color:"blue700"}))))),this.optionsCheckedTotal()>this.itemCount&&o("li",{class:"pn-multiselect-chip","data-count":!0},o("span",{class:"pn-multiselect-chip-label"},"+ ",this.additonalOptions())))}renderLabel(t=!1){return this.label?o(t?"div":"legend",{id:t?null:this.idLegend,class:{"pn-multiselect-label":!0,"pn-multiselect-sr-only":this.compact&&!t},"data-compact":this.compact,...t?{inert:!0}:{onClick:()=>this.handleLabel()}},o("span",null,this.label),!!this.optionsChecked()?.length&&o("span",null,this.optionsCheckedTotal(),"/",this.optionsTotal())):null}render(){return o(s,{key:"326b1351c1600920a89b49a4ca04fb48af112bb7"},o("fieldset",{key:"069b0689d499ad99b65f29597cc3968a47a3fc86",class:"pn-multiselect","data-icon":!!this.icon,"data-error":this.hasError(),disabled:this.disabled},this.renderLabel(),o("div",{key:"0a96f922421c6a1adb664714ec0d593cfdf950e5",class:"pn-multiselect-group",ref:t=>this.elGroup=t},o("div",{key:"3c6cadb7ff3dbc67fb8bab786133d64ad330c5d7",class:"pn-multiselect-input"},!!this.icon&&o("pn-icon",{key:"20bb5b6b273bea94903648a3465e14cf8dad2f77",class:"pn-multiselect-icon","data-custom":!0,icon:this.icon}),o("input",{key:"905179f50885d27bc7f41df667be93731dd5e4be",tabindex:this.search?null:"-1",type:this.search?"search":"input",id:this.getId(),class:"pn-multiselect-element",value:this.search?this.searchQuery:this.optionsCheckedLabels(),name:this.selectName,placeholder:this.getPlaceholder(),required:this.search?null:this.required,"aria-label":this.getAriaLabel(),"aria-labelledby":this.getAriaLabelledby(),"aria-describedby":this.describedBy(),"aria-controls":`${this.idOptions} ${this.search?this.idChips:""}`,"aria-invalid":this.hasError()?.toString(),disabled:this.disabled,readonly:!this.search,"data-compact":this.compact,onClick:()=>this.search&&this.open?null:this.toggleOpen(),onKeyDown:t=>this.handleInputKeyboard(t),onBlur:t=>this.handleBlur(t),onInput:t=>this.search&&this.setSearchQuery(t.target.value),ref:t=>this.elInput=t}),this.compact&&this.renderLabel(!0),this.hasError()&&o("pn-icon",{key:"635d97c6b8f780e6bd6daab225a97d1057b4bf0d",class:"pn-multiselect-icon","data-error":!0,icon:r,color:"warning"}),o("button",{key:"77e9862561cd9ed80c5aa1b386ae772476a34e76",id:this.idButton,type:"button",class:"pn-multiselect-button","aria-label":this.translate("BUTTON_"+(this.open?"CLOSE":"OPEN")),"aria-describedby":this.search?null:this.getId(),"aria-controls":this.idOptions,"aria-expanded":this.open.toString(),onClick:()=>this.toggleOpen(),ref:t=>this.elButton=t},o("pn-icon",{key:"28092398e64c04af103142d8f459579eb2b70a1b",class:"pn-multiselect-icon",icon:a,color:"blue700"}))),this.renderOptions()),o("p",{key:"17d396f1b3175b502ce8d54c6ec059588bbe8128",id:this.idHelper,class:"pn-multiselect-text",hidden:this.hideHelpertext()},o("span",{key:"693ba0a687b9b9766249e6703d0252beeeb762e9"},this.helpertext),o("slot",{key:"a70b1dff00b4ec936461f73354ebe18ce1a0a0c1",name:"helpertext"})),o("p",{key:"94c44db96a270fd7d3180c6dfddb53a46e85c2aa",id:this.idError,class:"pn-multiselect-text",role:"alert",hidden:this.hideError()},o("span",{key:"0297ed1e18f374c0c3f0909a1ee5685b75c73a7c"},this.error),o("slot",{key:"9c545b960d440978e46858b69ac86ad0112510c7",name:"error"})),this.search&&this.renderChips(),o("slot",{key:"9551563c6a72fa6e06ce473eadbc73a0428b551e"}),this.search&&o("p",{key:"96863325f57e613f0272d652e05a70e1c5c35dde",id:this.idSr,class:"pn-multiselect-sr-only",role:"alert","aria-live":"assertive"},this.srMessage&&o("span",{key:"21b84e0522ca16702a9ccabb071d30c0317631ef"},this.srMessage))))}static get watchers(){return{open:[{handleOpen:0}],search:[{handleSearch:0}],searchQuery:[{handleSearchQuery:0}],selectId:[{handleSelectId:0}],pnId:[{handleSelectId:1}]}}};k.style=`${t("pn-multiselect")}{display:inline-block}${t("pn-multiselect")} .pn-multiselect{position:relative;border:0;margin:0;padding:0}${t("pn-multiselect")} .pn-multiselect[data-icon]{--pn-input-offset-left:2em}${t("pn-multiselect")} .pn-multiselect[data-icon] .pn-multiselect-element{padding-left:2.75em}${t("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-label{color:#a70707}${t("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-label[data-compact]{color:#2d2013}${t("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element{padding-right:5.5em;border-color:#a70707}${t("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:hover{border-color:#500715}${t("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:focus-visible{background-color:#ffffff;border-color:#a70707;outline-color:#a70707}${t("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:-webkit-autofill,${t("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:-webkit-autofill:hover,${t("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:-webkit-autofill:focus,${t("pn-multiselect")} .pn-multiselect[data-error] .pn-multiselect-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #fef7f6 inset;-webkit-text-fill-color:#2d2013}${t("pn-multiselect")} .pn-multiselect-label{width:100%;cursor:pointer;display:flex;justify-content:space-between;align-items:flex-end;font-weight:400;color:#2d2013;margin:0 0 0.25em 0;gap:0.5em;-webkit-tap-highlight-color:transparent;transition-property:color, transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${t("pn-multiselect")} .pn-multiselect-label{transition-duration:0s;transition-delay:0s}}${t("pn-multiselect")} .pn-multiselect-label[data-compact]{position:absolute;top:1.5625em;left:calc(var(--pn-input-offset-left, 0px) + 0.75em + 0.0625em);margin:0;pointer-events:none;align-items:center;height:1.5em;max-width:calc(100% - (var(--pn-input-offset-left, 0px) + 0.75em) - (var(--pn-input-offset-right, 0px) + 0.75em));transform:translateY(-50%) scale(1) translateZ(0);transform-origin:0 0;transition-delay:0.2s}${t("pn-multiselect")} .pn-multiselect-label[data-compact]>span{font-size:1em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;line-height:1.5em}${t("pn-multiselect")} .pn-multiselect-label>span{font-size:0.875em}${t("pn-multiselect")} .pn-multiselect-label[data-compact]{justify-content:start}${t("pn-multiselect")} .pn-multiselect-sr-only{position:absolute;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);margin:-1px;white-space:nowrap}${t("pn-multiselect")} .pn-multiselect-group{position:relative;padding:0;margin:0}${t("pn-multiselect")} .pn-multiselect-input{position:relative}${t("pn-multiselect")} .pn-multiselect-input>${t("pn-icon")}{pointer-events:none;position:absolute;top:0.75em;right:3.5em}${t("pn-multiselect")} .pn-multiselect-input>${t("pn-icon")}[data-custom]{left:0.75em;right:unset}${t("pn-multiselect")} .pn-multiselect-button{cursor:pointer;position:absolute;right:0.75em;top:50%;transform:translateY(-50%);padding:0;margin:0;border:0;width:2em;height:2em;font-size:1em;border-radius:50%;background-color:transparent;-webkit-tap-highlight-color:transparent;transition-property:background-color, outline-color, border-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${t("pn-multiselect")} .pn-multiselect-button{transition-duration:0s;transition-delay:0s}}${t("pn-multiselect")} .pn-multiselect-button{outline:0.2rem solid transparent;outline-offset:0.2rem}${t("pn-multiselect")} .pn-multiselect-button:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${t("pn-multiselect")} .pn-multiselect-button>${t("pn-icon")} svg>path{transition-delay:0.2s;transform-origin:center;transform:rotate(0deg)}${t("pn-multiselect")} .pn-multiselect-button:hover{background-color:#effbff}${t("pn-multiselect")} .pn-multiselect-button[aria-expanded=true]{background-color:#effbff}${t("pn-multiselect")} .pn-multiselect-button[aria-expanded=true]>${t("pn-icon")} svg>path{transform:rotate(180deg);transition-delay:0s}${t("pn-multiselect")} .pn-multiselect-element{cursor:text;text-align:left;transition-delay:0.1s, 0.1s, 0s;width:100%;display:flex;align-items:center;justify-content:space-between;gap:0.5em;overflow:hidden;text-overflow:ellipsis;color:#2d2013;background-color:#ffffff;border:0.0625em solid #969087;border-radius:0.5em;padding:0.75em 3.5em 0.75em 0.75em;font-family:inherit;font-size:1em;font-weight:500;line-height:1.5em;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}${t("pn-multiselect")} .pn-multiselect-element:-webkit-autofill,${t("pn-multiselect")} .pn-multiselect-element:-webkit-autofill:hover,${t("pn-multiselect")} .pn-multiselect-element:-webkit-autofill:focus,${t("pn-multiselect")} .pn-multiselect-element:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #e0f8ff inset;-webkit-text-fill-color:#2d2013}${t("pn-multiselect")} .pn-multiselect-element{outline:0.2rem solid transparent;outline-offset:0.2rem}${t("pn-multiselect")} .pn-multiselect-element:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${t("pn-multiselect")} .pn-multiselect-element{transition-property:outline-color, background-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${t("pn-multiselect")} .pn-multiselect-element{transition-duration:0s;transition-delay:0s}}${t("pn-multiselect")} .pn-multiselect-element[data-compact]{text-align:left;padding-top:1.125em;padding-bottom:0.375em;max-width:unset}${t("pn-multiselect")} .pn-multiselect-element[data-compact]::placeholder{color:transparent}${t("pn-multiselect")} .pn-multiselect-element[data-compact]:focus+.pn-multiselect-label,${t("pn-multiselect")} .pn-multiselect-element[data-compact]:not(:placeholder-shown)+.pn-multiselect-label{transform:translateY(-85%) scale(0.75);transition-delay:0s}${t("pn-multiselect")} .pn-multiselect-element::placeholder{color:#5e554a;font-weight:normal}${t("pn-multiselect")} .pn-multiselect-element:hover{border-color:#005d92}${t("pn-multiselect")} .pn-multiselect-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${t("pn-multiselect")} .pn-multiselect-element:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2;pointer-events:none}${t("pn-multiselect")} .pn-multiselect-element:disabled+.pn-multiselect-button{pointer-events:none}${t("pn-multiselect")} .pn-multiselect-element:disabled+.pn-multiselect-button path{fill:#5e554a}${t("pn-multiselect")} .pn-multiselect-element:placeholder{color:#5e554a;font-weight:normal}${t("pn-multiselect")} .pn-multiselect-element[type=input]:hover{cursor:pointer;color:#2d2013;background-color:#effbff;transition-delay:0s}${t("pn-multiselect")} .pn-multiselect-element[type=input]:hover[aria-invalid=true]{background-color:#fdefee}${t("pn-multiselect")} .pn-multiselect-element:focus-visible{transition-delay:0s}${t("pn-multiselect")} .pn-multiselect-element::-webkit-search-cancel-button,${t("pn-multiselect")} .pn-multiselect-element::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}${t("pn-multiselect")} .pn-multiselect-options{scroll-behavior:smooth;position:absolute;z-index:10;top:calc(100% + 0.5em);left:0;right:0;background-color:#ffffff;box-shadow:0em 0.075em 0.225em 0em rgba(0, 0, 0, 0.1), 0em 0.4em 0.9em 0em rgba(0, 0, 0, 0.13);border-radius:0.5em;list-style:none;margin:0;padding:0;width:clamp(100%, 95vw, 20em);max-height:var(--pn-select-max-height);overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;visibility:hidden;transform-origin:top left;transform:translateX(var(--pn-select-options-offset, 0))}${t("pn-multiselect")} .pn-multiselect-options[data-open]{visibility:visible}${t("pn-multiselect")} .pn-multiselect-options[data-upwards]{top:unset;bottom:calc(100% + 0.5em);transform-origin:bottom left;box-shadow:0 -0.0625em 0.125em rgba(0, 0, 0, 0.2)}${t("pn-multiselect")} .pn-multiselect-options[data-moving]{overflow:hidden;visibility:visible}${t("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar{background-color:#ffffff;width:0.875em;border-radius:0.5em}${t("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-track{background-color:#ffffff;border-radius:0.5em}${t("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-thumb{cursor:pointer;background-color:#969087;border-radius:1em;border:0.25em solid #ffffff}${t("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-thumb:hover{background-color:#5e554a}${t("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-corner,${t("pn-multiselect")} .pn-multiselect-options::-webkit-scrollbar-button{display:none}${t("pn-multiselect")} .pn-multiselect-options>${t("pn-input")}{padding:0.5em}${t("pn-multiselect")} .pn-multiselect-optgroup{list-style:none;padding:0}${t("pn-multiselect")} .pn-multiselect-optgroup>.pn-multiselect-option>.pn-multiselect-option-content{padding-left:2em}${t("pn-multiselect")} .pn-multiselect-chips{list-style:none;display:flex;flex-wrap:wrap;gap:0.5em;padding:0;margin:0.5em 0 0 0;color:#5e554a;font-weight:400}${t("pn-multiselect")} .pn-multiselect-chips:empty{display:none}${t("pn-multiselect")} .pn-multiselect-chip{margin:0;display:inline-flex;align-items:center;gap:0.25em;background-color:#ffffff;border-radius:0.5em;padding:0.125em 0.25em 0.125em 0.5em;line-height:1.5em;border:0.0625em solid #5e554a;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, outline-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${t("pn-multiselect")} .pn-multiselect-chip{transition-duration:0s;transition-delay:0s}}${t("pn-multiselect")} .pn-multiselect-chip:focus-within{color:#005d92;outline-color:#005d92;background-color:#effbff;border-color:#005d92}${t("pn-multiselect")} .pn-multiselect-chip[data-count]{pointer-events:none;border:0;padding-left:0;padding-right:0;background-color:unset}${t("pn-multiselect")} .pn-multiselect-chip-label{font-size:0.875em;white-space:nowrap}${t("pn-multiselect")} .pn-multiselect-chip-button{cursor:pointer;font-size:1em;padding:0.25em;height:1.5em;width:1.5em;border:0;background-color:unset;border-radius:50%;-webkit-tap-highlight-color:transparent;transition-property:background-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${t("pn-multiselect")} .pn-multiselect-chip-button{transition-duration:0s;transition-delay:0s}}${t("pn-multiselect")} .pn-multiselect-chip-button:hover{background-color:#8eddf9}${t("pn-multiselect")} .pn-multiselect-chip-button:focus{outline:0}${t("pn-multiselect")} .pn-multiselect-no-results{margin:0;padding:0.75em}${t("pn-multiselect")} .pn-multiselect-text{color:#5e554a;font-size:0.875em;font-weight:400;margin:0.25em 0 0 0;display:flex;flex-direction:column;gap:0.25em}${t("pn-multiselect")} .pn-multiselect-text[hidden]{display:none}${t("pn-multiselect")} .pn-multiselect-text[role=alert]{color:#a70707}${t("pn-multiselect")} .pn-multiselect-option{position:relative;margin:0;padding:0}${t("pn-multiselect")} .pn-multiselect-option .pn-ripple{animation:ripple 0.4s cubic-bezier(0.7, 0, 0.3, 1);position:absolute;border-radius:50%;background-color:#005d92;transform:translate(-50%, -50%) scale(0);opacity:0.1;pointer-events:none;z-index:3}@keyframes ripple{to{transform:translate(-50%, -50%) scale(1);opacity:0}}${t("pn-multiselect")} .pn-multiselect-option-input{cursor:pointer;position:absolute;opacity:0;left:0;top:0;height:100%;width:100%;margin:0;-webkit-tap-highlight-color:transparent}${t("pn-multiselect")} .pn-multiselect-option-input:disabled{pointer-events:none}${t("pn-multiselect")} .pn-multiselect-option-input:disabled+.pn-multiselect-option-content{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2;pointer-events:none}${t("pn-multiselect")} .pn-multiselect-option-input:disabled+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#f3f2f2;border-color:#969087}${t("pn-multiselect")} .pn-multiselect-option-input:disabled+.pn-multiselect-option-content .pn-icon-svg path{fill:#5e554a}${t("pn-multiselect")} .pn-multiselect-option-input:disabled:checked+.pn-multiselect-option-content{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${t("pn-multiselect")} .pn-multiselect-option-input:disabled:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#969087;border-color:#969087}${t("pn-multiselect")} .pn-multiselect-option-input:disabled:checked+.pn-multiselect-option-content .pn-icon-svg path{fill:#5e554a}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#a70707}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]+.pn-multiselect-option-content .pn-ripple{background-color:#a70707}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked+.pn-multiselect-option-content{background-color:#fdefee}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#a70707;border-color:#a70707}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:focus-visible+.pn-multiselect-option-content{background-color:#fdefee}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#500715;border-color:#500715}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:hover+.pn-multiselect-option-content{background-color:#fef7f6}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:checked:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#500715;border-color:#500715}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:hover+.pn-multiselect-option-content{background-color:#fef7f6}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#fdefee;border-color:#a70707}${t("pn-multiselect")} .pn-multiselect-option-input[aria-invalid=true]:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{outline-color:#a70707;background-color:#fdefee;border-color:#a70707}${t("pn-multiselect")} .pn-multiselect-option-input:hover+.pn-multiselect-option-content{background-color:#effbff}${t("pn-multiselect")} .pn-multiselect-option-input:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#005d92;background-color:#e0f8ff}${t("pn-multiselect")} .pn-multiselect-option-input:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{outline-color:#005d92;background-color:#e0f8ff;border-color:#005d92}${t("pn-multiselect")} .pn-multiselect-option-input:checked+.pn-multiselect-option-content{background-color:#e0f8ff}${t("pn-multiselect")} .pn-multiselect-option-input:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#005d92;background-color:#005d92}${t("pn-multiselect")} .pn-multiselect-option-input:checked+.pn-multiselect-option-content .pn-multiselect-option-checkbox svg polyline.pn-multiselect-option-checkbox-checkmark-path{transition-delay:0.2s;stroke-dashoffset:0}${t("pn-multiselect")} .pn-multiselect-option-input:checked:hover+.pn-multiselect-option-content{background-color:#effbff}${t("pn-multiselect")} .pn-multiselect-option-input:checked:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#0d234b;background-color:#0d234b}${t("pn-multiselect")} .pn-multiselect-option-input:checked:focus-visible+.pn-multiselect-option-content{background-color:#e0f8ff}${t("pn-multiselect")} .pn-multiselect-option-input:checked:focus-visible+.pn-multiselect-option-content .pn-multiselect-option-checkbox{border-color:#0d234b;background-color:#0d234b}${t("pn-multiselect")} .pn-multiselect-option-input:indeterminate+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#005d92;border-color:#005d92}${t("pn-multiselect")} .pn-multiselect-option-input:indeterminate+.pn-multiselect-option-content svg .pn-multiselect-option-checkbox-checkmark-path{stroke-dashoffset:23}${t("pn-multiselect")} .pn-multiselect-option-input:indeterminate+.pn-multiselect-option-content svg .pn-multiselect-option-checkbox-indeterminate-path{stroke-dashoffset:0}${t("pn-multiselect")} .pn-multiselect-option-input:indeterminate:hover+.pn-multiselect-option-content .pn-multiselect-option-checkbox{background-color:#0d234b;border-color:#0d234b}${t("pn-multiselect")} .pn-multiselect-option-content{position:relative;overflow:hidden;z-index:-1;display:flex;align-items:center;padding:0.75em 1em;gap:0.5em;background-color:#ffffff;transition-property:background-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${t("pn-multiselect")} .pn-multiselect-option-content{transition-duration:0s;transition-delay:0s}}${t("pn-multiselect")} .pn-multiselect-option-text{flex:1;text-overflow:ellipsis;overflow:hidden}${t("pn-multiselect")} .pn-multiselect-option-helper{color:#5e554a;margin:0}${t("pn-multiselect")} .pn-multiselect-option-checkbox{background-color:#ffffff;flex:0 0 1.5em;width:1.5em;height:1.5em;border:0.0625em solid #969087;border-radius:0.25em;outline:0.2rem solid transparent;outline-offset:0.2rem;transition-property:background-color, border-color, outline-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${t("pn-multiselect")} .pn-multiselect-option-checkbox{transition-duration:0s;transition-delay:0s}}${t("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline{stroke:#ffffff;stroke-linecap:round;stroke-dasharray:23;transition-delay:0s;transition-property:stroke-dashoffset;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${t("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline{transition-duration:0s;transition-delay:0s}}${t("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline.pn-multiselect-option-checkbox-checkmark-path{stroke-dashoffset:23}${t("pn-multiselect")} .pn-multiselect-option-checkbox svg polyline.pn-multiselect-option-checkbox-indeterminate-path{stroke-dashoffset:23}`;export{k as pn_multiselect}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* By PostNord.
|
|
4
|
-
*/
|
|
5
|
-
import{t as e,r as i,c as n,g as t,h as a,a as s}from"./p-XKg-ydzH.js";import{uuidv4 as l,awaitTopbar as r,en as d}from"./index.esm.js";const o='<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M4 11.442A7.44 7.44 0 0 1 11.44 4c6.24 0 9.617 7.154 5.923 11.949l2.844 2.844a1 1 0 0 1-1.414 1.414l-2.837-2.837C11.21 21.045 4 17.73 4 11.441m11.277 3.867C11.846 18.714 6 16.284 6 11.442A5.44 5.44 0 0 1 11.44 6c4.724 0 7.204 5.605 4.026 9.1z" clip-rule="evenodd"/></svg>',c={SEARCH:{en:"Search",sv:"Sök",da:"Søg",fi:"Hae",no:"Søk"},CLEAR:{en:"Clear search field",sv:"Rensa sökfältet",da:"Ryd søgefeltet",fi:"Tyhjennä hakukenttä",no:"Tøm søkefeltet"}},h=class{constructor(e){i(this,e),this.search=n(this,"search",7),this.update=n(this,"update",7)}id=`pn-search-field-${l()}`;get hostElement(){return t(this)}label;language=void 0;value="";name;placeholder;autocomplete;list;required=!1;disabled=!1;loading=!1;button="";buttonLabel;buttonTooltip;buttonLight=!1;pnId;pnAriaLabelledby;searchid;search;update;inputHandler(){this.update.emit(this.value)}async componentWillLoad(){void 0===this.language&&await r(this.hostElement)}getId(){return this.pnId||this.searchid||this.id}translate(e){return c?.[e]?.[this.language||d]}emitSearch({click:e,button:i}){("click"===e?.type||"keydown"===i?.type&&"Enter"===i?.key)&&((e||i).preventDefault(),this.search.emit(this.value))}setVal(e){this.value=e.target.value}clearInput(){this.value="",this.update.emit(this.value),this.hostElement.querySelector("input").focus()}displayLabel(){return!!this.label}getAriaLabelledby(){return this.displayLabel()?null:this.pnAriaLabelledby}getButtonLabel(){return this.buttonLabel||this.translate("SEARCH")}searchSimple(){return"icon"===this.button||"simple"===this.button}searchAuto(){return"icon-inline"===this.button||"none"===this.button||"auto"===this.button}searchJumbo(){return"jumbo"===this.button}searchButtonAppearance(){return this.searchSimple()?"light":null}searchButtonVariant(){return this.searchSimple()?"outlined":null}render(){return a(s,{key:"5ffa0c58cd54c1a6588147e5ec9a72e0045e16aa"},a("div",{key:"d18a2bdaef46229ff87fe1612d39489443fd70cc",class:"pn-search-field","data-inline":this.searchAuto(),"data-loading":this.loading,"data-searching":!!this.value,"data-jumbo":this.searchJumbo()},a("div",{key:"1a7c9e872e0c7696f0d1d84a3420eade2b1cd2ed",class:"pn-search-field-container"},a("input",{key:"3ff3e9809123283f66ea933f7bc9fb5a92489e51",class:"pn-search-field-input",id:this.getId(),type:"search",value:this.value,name:this.name,placeholder:this.placeholder,autocomplete:this.autocomplete,list:this.list,required:this.required,disabled:this.disabled,"aria-label":this.label,"aria-labelledby":this.getAriaLabelledby(),onKeyDown:e=>this.emitSearch({button:e}),onInput:e=>this.setVal(e)}),a("div",{key:"eeb6d382c93f98da5561b30219ef829c668eab54",class:"pn-search-field-inline"},this.searchAuto()&&a("pn-button",{key:"65d7049753656a7f4bce29e7e8c99305e99f15e2",class:"pn-search-field-button",type:"button",appearance:"light",small:!0,icon:o,iconOnly:!0,arialabel:this.getButtonLabel(),noTab:this.loading,onPnClick:e=>this.emitSearch({click:e.detail})}),!this.disabled&&a("pn-button",{key:"58bae5e2fc05c66cee21081e71904530ca75a0b9",small:!0,class:"pn-search-field-clear",type:"button",appearance:"light",icon:'<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M6.293 6.293a1 1 0 0 1 1.414 0L12 10.586l4.293-4.293a1 1 0 1 1 1.414 1.414L13.414 12l4.293 4.293a1 1 0 0 1-1.414 1.414L12 13.414l-4.293 4.293a1 1 0 0 1-1.414-1.414L10.586 12 6.293 7.707a1 1 0 0 1 0-1.414" clip-rule="evenodd"/></svg>',iconOnly:!0,arialabel:this.translate("CLEAR"),noTab:!this.value||this.loading,onPnClick:()=>this.clearInput()}),this.searchAuto()&&a("pn-spinner",{key:"d3955278766f786897eb0024c7523179a2ad78c4",class:"pn-search-field-spinner"}))),!this.searchAuto()&&a("pn-button",{key:"fd46d299cfd9600e671e827daa4a00675a6bd25b",class:"pn-search-field-submit",label:this.getButtonLabel(),tooltip:this.buttonTooltip,appearance:this.searchButtonAppearance(),variant:this.searchButtonVariant(),icon:o,iconOnly:this.searchSimple()||this.searchJumbo(),arialabel:this.searchSimple()||this.searchJumbo()?this.getButtonLabel():null,loading:this.loading,onPnClick:e=>this.emitSearch({click:e.detail})})))}};h.style=`${e("pn-search-field")}{display:inline-block}${e("pn-search-field")} .pn-search-field{display:flex;gap:0.5em}${e("pn-search-field")} .pn-search-field-container{width:100%;flex:1 1 100%;position:relative}${e("pn-search-field")} .pn-search-field-input{min-height:3em;height:100%;width:100%;color:#2d2013;background-color:#ffffff;border:0.0625em solid #969087;border-radius:3em;padding:0.75em;font-family:inherit;font-size:1em;font-weight:500;line-height:1.5em;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}${e("pn-search-field")} .pn-search-field-input:-webkit-autofill,${e("pn-search-field")} .pn-search-field-input:-webkit-autofill:hover,${e("pn-search-field")} .pn-search-field-input:-webkit-autofill:focus,${e("pn-search-field")} .pn-search-field-input:-webkit-autofill:active{-webkit-box-shadow:0 0 0 10em #e0f8ff inset;-webkit-text-fill-color:#2d2013}${e("pn-search-field")} .pn-search-field-input{outline:0.2rem solid transparent;outline-offset:0.2rem}${e("pn-search-field")} .pn-search-field-input:focus-visible{outline-color:#005d92;background-color:#ffffff;border-color:#005d92}${e("pn-search-field")} .pn-search-field-input{transition-property:outline-color, background-color, border-color, color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-search-field")} .pn-search-field-input{transition-duration:0s;transition-delay:0s}}${e("pn-search-field")} .pn-search-field-input::placeholder{color:#5e554a;font-weight:normal}${e("pn-search-field")} .pn-search-field-input:hover{border-color:#005d92}${e("pn-search-field")} .pn-search-field-input:disabled{color:#5e554a;background-color:#f3f2f2;border-color:#f3f2f2}${e("pn-search-field")} .pn-search-field-input::-webkit-calendar-picker-indicator,${e("pn-search-field")} .pn-search-field-input::-webkit-search-cancel-button,${e("pn-search-field")} .pn-search-field-input::-webkit-search-decoration{display:none !important}${e("pn-search-field")} .pn-search-field-inline{pointer-events:none;position:absolute;top:0;right:0;background:transparent;width:3em;height:100%;overflow:hidden;display:flex;align-items:center;justify-content:center}${e("pn-search-field")} .pn-search-field-inline ${e("pn-button")}{position:absolute;left:50%;top:50%;transition-property:transform;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}@media (prefers-reduced-motion: reduce){${e("pn-search-field")} .pn-search-field-inline ${e("pn-button")}{transition-duration:0s;transition-delay:0s}}${e("pn-search-field")} .pn-search-field-inline ${e("pn-button")}{transition-delay:0.2s;transform:translate(100%, -50%)}${e("pn-search-field")} .pn-search-field-submit{white-space:nowrap}${e("pn-search-field")} .pn-search-field-spinner{position:absolute;left:50%;top:50%;transition:transform cubic-bezier(0.7, 0, 0.3, 1) 0.2s;transform:translate(100%, -50%)}${e("pn-search-field")} .pn-search-field[data-inline] .pn-search-field-inline{pointer-events:unset}${e("pn-search-field")} .pn-search-field[data-inline] .pn-search-field-button{transform:translate(-50%, -50%)}${e("pn-search-field")} .pn-search-field[data-inline][data-loading] ${e("pn-button")}{transform:translate(100%, -50%)}${e("pn-search-field")} .pn-search-field[data-inline][data-loading] .pn-search-field-spinner{transform:translate(-50%, -50%)}${e("pn-search-field")} .pn-search-field[data-inline][data-searching] .pn-search-field-button{transform:translate(150%, -50%)}${e("pn-search-field")} .pn-search-field[data-jumbo] .pn-search-field-input{min-height:4em;padding-left:1.25em}${e("pn-search-field")} .pn-search-field[data-jumbo] .pn-search-field-submit .pn-button[data-icon-only]{width:4em;height:4em}${e("pn-search-field")} .pn-search-field[data-jumbo] .pn-search-field-submit .pn-button[data-icon-only][data-loading] .pn-button-bg{width:4em;height:4em}${e("pn-search-field")} .pn-search-field[data-searching] .pn-search-field-inline{pointer-events:unset}${e("pn-search-field")} .pn-search-field[data-searching] .pn-search-field-clear{transform:translate(-50%, -50%)}`;export{h as pn_search_field}
|