Add the typing for `<woltlab-core-label-picker>`
authorAlexander Ebert <ebert@woltlab.com>
Thu, 28 Sep 2023 22:16:20 +0000 (00:16 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 5 Oct 2023 15:22:51 +0000 (17:22 +0200)
ts/WoltLabSuite/Core/Component/Article/LabelPicker.ts
ts/WoltLabSuite/WebComponent/woltlab-core-label-picker.ts
ts/global.d.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Component/Article/LabelPicker.js
wcfsetup/install/files/js/WoltLabSuite/WebComponent.min.js

index 46e8ea3e40103e8bc1d88f36458b5077546aba1a..95cad6e70bf560acb92c2607b4b205ab8e2f6b01 100644 (file)
@@ -1,3 +1,12 @@
+/**
+ * Toggles the visibility of label groups based on the selected category.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @woltlabExcludeBundle all
+ */
+
 type CategoryId = number;
 type LabelGroupId = number;
 
@@ -6,14 +15,13 @@ function toggleVisibility(showLabelGroupIds: LabelGroupId[] | undefined): void {
     showLabelGroupIds = [];
   }
 
-  // TODO: Missing typings for `<woltlab-core-label-picker>`
-  document.querySelectorAll<HTMLElement>("woltlab-core-label-picker").forEach((labelPicker) => {
+  document.querySelectorAll("woltlab-core-label-picker").forEach((labelPicker) => {
     const groupId = parseInt(labelPicker.dataset.groupId!);
     if (showLabelGroupIds!.includes(groupId)) {
-      (labelPicker as any).disabled = false;
+      labelPicker.disabled = false;
       labelPicker.closest("dl")!.hidden = false;
     } else {
-      (labelPicker as any).disabled = true;
+      labelPicker.disabled = true;
       labelPicker.closest("dl")!.hidden = true;
     }
   });
index d1edfabbf8d42553b85b79d4eea67b43a5f895d2..755f2100f86db0926dc7875ea98e3e55b0b57267 100644 (file)
@@ -1,3 +1,13 @@
+/**
+ * The `<woltlab-core-label-picker>` provides an interactive widget to select a
+ * label out of a label group.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @woltlabExcludeBundle all
+ */
+
 {
   class WoltlabCoreLabelPickerElement extends HTMLElement {
     readonly #button: HTMLButtonElement;
     get required(): boolean {
       return this.hasAttribute("required");
     }
-
-    get labels(): Map<number, string> {
-      return new Map(this.#labels);
-    }
   }
 
   window.customElements.define("woltlab-core-label-picker", WoltlabCoreLabelPickerElement);
index 29daeeab06e7332b96a75399fa117dc53f41773f..c7c781eeb6022e9f9c308970ce99e8d4f9774de8 100644 (file)
@@ -91,6 +91,15 @@ declare global {
     set date(date: Date);
   }
 
+  interface WoltlabCoreLabelPickerElement extends HTMLElement {
+    set disabled(disabled: boolean);
+    get disabled(): boolean;
+    set selected(selected: number);
+    get selected(): number | undefined;
+    set required(required: boolean);
+    get required(): boolean;
+  }
+
   interface WoltlabCoreLoadingIndicatorElement extends HTMLElement {
     get size(): LoadingIndicatorIconSize;
     set size(size: LoadingIndicatorIconSize);
@@ -121,6 +130,7 @@ declare global {
     "woltlab-core-dialog": WoltlabCoreDialogElement;
     "woltlab-core-dialog-control": WoltlabCoreDialogControlElement;
     "woltlab-core-date-time": WoltlabCoreDateTime;
+    "woltlab-core-label-picker": WoltlabCoreLabelPickerElement;
     "woltlab-core-loading-indicator": WoltlabCoreLoadingIndicatorElement;
     "woltlab-core-pagination": WoltlabCorePaginationElement;
     "woltlab-core-google-maps": WoltlabCoreGoogleMapsElement;
index 77157244b928c533bbe51b32466a335f21b9450e..0919d00c0f4818bcba1d4aa1b4b612e268593964 100644 (file)
@@ -1,3 +1,11 @@
+/**
+ * Toggles the visibility of label groups based on the selected category.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @woltlabExcludeBundle all
+ */
 define(["require", "exports"], function (require, exports) {
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,7 +14,6 @@ define(["require", "exports"], function (require, exports) {
         if (showLabelGroupIds === undefined) {
             showLabelGroupIds = [];
         }
-        // TODO: Missing typings for `<woltlab-core-label-picker>`
         document.querySelectorAll("woltlab-core-label-picker").forEach((labelPicker) => {
             const groupId = parseInt(labelPicker.dataset.groupId);
             if (showLabelGroupIds.includes(groupId)) {
index cef37066b10d99b2477512df9e340a31bc7844c6..49f468276d290bde39be49ae34bba1bc3f2913f7 100644 (file)
@@ -60,7 +60,7 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[E]||E)+"'":ae="Parse error o
             time::after {
               content: " (" attr(title) ")";
             }
-          }`,L.append(C)}g&&(this.#e.dateTime=p.toISOString(),this.#e.title=b.DateAndTime.format(p));let y;if(this.static)y=this.#e.title;else if(x<k.OneMinute)y=window.WoltLabLanguage.getPhrase("wcf.date.relative.now");else if(x<k.OneHour){let L=Math.trunc(x/k.OneMinute);y=b.Minutes.format(L*-1,"minute")}else if(x<k.OneWeek){let L=b.DayOfWeekAndTime.formatToParts(p);L[0].type==="weekday"?p.getTime()>t?y=this.#t(L,0):p.getTime()>a?y=this.#t(L,-1):y=L.map(W=>W.value).join(""):y=b.DateAndTime.format(p)}else y=b.Date.format(p);y=y.charAt(0).toUpperCase()+y.slice(1),this.#e.textContent=y}#t(g,p){return g.map(y=>y.type==="weekday"?b.TodayOrYesterday.format(p,"day"):y.value).join("")}}window.customElements.define("woltlab-core-date-time",q);let S=()=>{document.querySelectorAll("woltlab-core-date-time").forEach(h=>h.refresh(!1))},z,P=()=>{z=window.setInterval(()=>{i(),S()},6e4)};document.addEventListener("DOMContentLoaded",()=>P(),{once:!0}),document.addEventListener("visibilitychange",()=>{document.hidden?window.clearInterval(z):(S(),P())})}{class e extends HTMLElement{#a;#e;#t=new Map;constructor(){super(),this.#a=document.createElement("button")}connectedCallback(){if(this.hasAttribute("labels")&&(this.#t=new Map(JSON.parse(this.getAttribute("labels"))),this.removeAttribute("labels")),this.#t.size===0)throw new Error("Expected a non empty list of labels.");let l=`<span class="badge label">${window.WoltLabLanguage.getPhrase("wcf.label.none")}</span>`;this.#a.type="button",this.#a.classList.add("dropdownToggle"),this.#a.innerHTML=l,this.#a.addEventListener("click",a=>{a.preventDefault();let i=new CustomEvent("showPicker");this.dispatchEvent(i)}),this.#a.id=this.id,this.removeAttribute("id"),this.append(this.#a);let c=document.createElement("ul");c.classList.add("scrollableDropdownMenu");for(let[a,i]of this.#t)c.append(this.#s(a,i));if(!this.required){let a=document.createElement("li");a.classList.add("dropdownDivider"),c.append(a,this.#s(0,l))}let t=document.createElement("ul");t.classList.add("dropdownMenu"),t.append(c),this.append(t),this.classList.add("dropdown"),this.closest("form")!==null?(this.#e===void 0&&(this.#e=document.createElement("input"),this.#e.type="hidden",this.#e.name=`labelIDs[${this.dataset.groupId}]`,this.append(this.#e)),this.#e.value=(this.selected||0).toString()):this.#e?.remove(),this.selected&&(this.selected=this.selected)}#s(l,c){let t=document.createElement("button");t.type="button",t.dataset.labelId=l.toString(),t.innerHTML=c,t.addEventListener("click",()=>{this.selected=l});let a=document.createElement("li");return a.append(t),a}set selected(l){this.setAttribute("selected",l.toString()),this.#a.innerHTML=this.#t.get(l)||`<span class="badge label">${window.WoltLabLanguage.getPhrase("wcf.label.none")}</span>`,this.#e!==void 0&&(this.#e.value=l.toString())}get selected(){let l=parseInt(this.getAttribute("selected"));if(!Number.isNaN(l))return l}set disabled(l){l?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this.#a.disabled=l,this.#e&&(this.#e.disabled=l)}get disabled(){return this.hasAttribute("disabled")}set required(l){l?this.setAttribute("required",""):this.removeAttribute("required")}get required(){return this.hasAttribute("required")}get labels(){return new Map(this.#t)}}window.customElements.define("woltlab-core-label-picker",e)}{let r=[24,48,96];class l extends HTMLElement{#a;#e;connectedCallback(){this.#a===void 0&&this.#t()}attributeChangedCallback(t,a,i){if(t==="size"){let d=parseInt(i||"");if(!r.includes(d)){let b=parseInt(a||"");r.includes(b)||(b=24),this.setAttribute(t,b.toString())}}}#t(){this.classList.add("loading-indicator"),this.hasAttribute("size")||this.setAttribute("size",24 .toString()),this.#a=document.createElement("fa-icon"),this.#a.size=this.size,this.#a.setIcon("spinner"),this.#e=document.createElement("span"),this.#e.classList.add("loading-indicator__text"),this.#e.textContent=window.WoltLabLanguage.getPhrase("wcf.global.loading"),this.#e.hidden=this.hideText;let t=document.createElement("div");t.classList.add("loading-indicator__wrapper"),t.append(this.#a,this.#e),this.append(t)}get size(){return parseInt(this.getAttribute("size"))}set size(t){if(!r.includes(t))throw new TypeError(`The size ${t} is unrecognized, permitted values are ${r.join(", ")}.`);this.setAttribute("size",t.toString()),this.#a&&(this.#a.size=t)}get hideText(){return this.hasAttribute("hide-text")}set hideText(t){t?this.setAttribute("hide-text",""):this.removeAttribute("hide-text"),this.#e&&(this.#e.hidden=t)}static get observedAttributes(){return["size"]}}window.customElements.define("woltlab-core-loading-indicator",l)}{let e,r=()=>(e===void 0&&(e=window.matchMedia("(max-width: 544px)")),e);class l extends HTMLElement{#a="pagination";connectedCallback(){this.#e(),r().addEventListener("change",()=>this.#e())}#e(){if(this.innerHTML="",this.count<2)return;this.classList.add(`${this.#a}__wrapper`);let t=this.#t();this.append(t);let a=this.#s();a&&t.append(a);let i=document.createElement("ul");i.classList.add(`${this.#a}__list`),t.append(i),i.append(this.#l(1)),this.page>this.thresholdForEllipsis+1&&i.append(this.#i()),this.#f().forEach(b=>{i.append(b)}),this.count-this.page>this.thresholdForEllipsis&&i.append(this.#i()),i.append(this.#l(this.count));let d=this.#o();d&&t.append(d)}#t(){let t=document.createElement("nav");return t.setAttribute("role","navigation"),t.setAttribute("aria-label",window.WoltLabLanguage.getPhrase("wcf.page.pagination")),t.classList.add(this.#a),t}#s(){if(this.page===1)return;let t=document.createElement("div");t.classList.add(`${this.#a}__prev`);let a=this.#r(this.page-1);a instanceof HTMLAnchorElement&&(a.rel="prev"),a.title=window.WoltLabLanguage.getPhrase("wcf.global.page.previous"),a.classList.add("jsTooltip"),t.append(a);let i=document.createElement("fa-icon");return i.setIcon("arrow-left"),a.append(i),t}#o(){if(this.page===this.count)return;let t=document.createElement("div");t.classList.add(`${this.#a}__next`);let a=this.#r(this.page+1);a instanceof HTMLAnchorElement&&(a.rel="next"),a.title=window.WoltLabLanguage.getPhrase("wcf.global.page.next"),a.classList.add("jsTooltip"),t.append(a);let i=document.createElement("fa-icon");return i.setIcon("arrow-right"),a.append(i),t}#r(t){let a,i=this.getLinkUrl(t);return i?(a=document.createElement("a"),a.href=i):(a=document.createElement("button"),a.type="button",this.page===t?a.disabled=!0:a.addEventListener("click",()=>{this.#n(t)})),a.classList.add(`${this.#a}__link`),a}#l(t){let a=document.createElement("li");a.classList.add(`${this.#a}__item`);let i=this.#r(t);return i.setAttribute("aria-label",window.WoltLabLanguage.getPhrase("wcf.page.pageNo",{pageNo:t})),t===this.page&&(i.setAttribute("aria-current","page"),i.classList.add(`${this.#a}__link--current`)),i.textContent=t.toLocaleString(document.documentElement.lang),a.append(i),a}#f(){let t=[],a,i;r().matches?(a=this.page,i=this.page):(a=this.page-1,a===3&&a--,i=this.page+1,i===this.count-2&&i++);for(let d=a;d<=i;d++)d<=1||d>=this.count||t.push(this.#l(d));return t}#i(){let t=document.createElement("li");t.classList.add(`${this.#a}__item`,`${this.#a}__item--ellipsis`);let a=document.createElement("button");return a.type="button",a.title=window.WoltLabLanguage.getPhrase("wcf.page.jumpTo"),a.classList.add("pagination__link","jsTooltip"),a.innerHTML="&ctdot;",a.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("jumpToPage"))}),t.append(a),t}get thresholdForEllipsis(){return r().matches?1:3}getLinkUrl(t){if(!this.url)return"";let a=new URL(this.url);return a.search+=a.search!==""?"&":"?",a.search+=new URLSearchParams([["pageNo",t.toString()]]).toString(),a.toString()}jumpToPage(t){let a=this.getLinkUrl(t);a?window.location.href=a:this.#n(t)}#n(t){let a=new CustomEvent("switchPage",{cancelable:!0,detail:t});this.dispatchEvent(a),a.defaultPrevented||(this.page=t)}get count(){return this.hasAttribute("count")?parseInt(this.getAttribute("count")):0}set count(t){this.setAttribute("count",t.toString()),this.#e()}get page(){return this.hasAttribute("page")?parseInt(this.getAttribute("page")):1}set page(t){this.setAttribute("page",t.toString()),this.#e()}get url(){return this.getAttribute("url")}set url(t){this.setAttribute("url",t),this.#e()}}window.customElements.define("woltlab-core-pagination",l)}{class e extends HTMLElement{connectedCallback(){this.setData(this.#e(),this.#t())}setData(l,c){this.#a(l,c)}get objectId(){return parseInt(this.getAttribute("object-id"))}get objectType(){return this.getAttribute("object-type")}#a(l,c){if(this.innerHTML="",!l.size)return;let t=document.createElement("button");t.classList.add("reactionSummary","jsTooltip"),t.title=window.WoltLabLanguage.getPhrase("wcf.reactions.summary.listReactions"),t.addEventListener("click",()=>{this.dispatchEvent(new Event("showDetails"))}),this.append(t),l.forEach((a,i)=>{let d=document.createElement("span");d.classList.add("reactionCountButton"),i===c&&d.classList.add("selected");let b=document.createElement("span");b.innerHTML=window.REACTION_TYPES[i].renderedIcon,d.append(b);let k=document.createElement("span");k.classList.add("reactionCount"),k.textContent=a.toString(),d.append(k),t.append(d)})}#e(){let l=JSON.parse(this.getAttribute("data"));return this.removeAttribute("data"),new Map(l)}#t(){return parseInt(this.getAttribute("selected-reaction"))}}window.customElements.define("woltlab-core-reaction-summary",e)}window.WoltLabLanguage=ne;window.WoltLabTemplate=V;window.HTMLParsedElement=pe;})();
+          }`,L.append(C)}g&&(this.#e.dateTime=p.toISOString(),this.#e.title=b.DateAndTime.format(p));let y;if(this.static)y=this.#e.title;else if(x<k.OneMinute)y=window.WoltLabLanguage.getPhrase("wcf.date.relative.now");else if(x<k.OneHour){let L=Math.trunc(x/k.OneMinute);y=b.Minutes.format(L*-1,"minute")}else if(x<k.OneWeek){let L=b.DayOfWeekAndTime.formatToParts(p);L[0].type==="weekday"?p.getTime()>t?y=this.#t(L,0):p.getTime()>a?y=this.#t(L,-1):y=L.map(W=>W.value).join(""):y=b.DateAndTime.format(p)}else y=b.Date.format(p);y=y.charAt(0).toUpperCase()+y.slice(1),this.#e.textContent=y}#t(g,p){return g.map(y=>y.type==="weekday"?b.TodayOrYesterday.format(p,"day"):y.value).join("")}}window.customElements.define("woltlab-core-date-time",q);let S=()=>{document.querySelectorAll("woltlab-core-date-time").forEach(h=>h.refresh(!1))},z,P=()=>{z=window.setInterval(()=>{i(),S()},6e4)};document.addEventListener("DOMContentLoaded",()=>P(),{once:!0}),document.addEventListener("visibilitychange",()=>{document.hidden?window.clearInterval(z):(S(),P())})}{class e extends HTMLElement{#a;#e;#t=new Map;constructor(){super(),this.#a=document.createElement("button")}connectedCallback(){if(this.hasAttribute("labels")&&(this.#t=new Map(JSON.parse(this.getAttribute("labels"))),this.removeAttribute("labels")),this.#t.size===0)throw new Error("Expected a non empty list of labels.");let l=`<span class="badge label">${window.WoltLabLanguage.getPhrase("wcf.label.none")}</span>`;this.#a.type="button",this.#a.classList.add("dropdownToggle"),this.#a.innerHTML=l,this.#a.addEventListener("click",a=>{a.preventDefault();let i=new CustomEvent("showPicker");this.dispatchEvent(i)}),this.#a.id=this.id,this.removeAttribute("id"),this.append(this.#a);let c=document.createElement("ul");c.classList.add("scrollableDropdownMenu");for(let[a,i]of this.#t)c.append(this.#s(a,i));if(!this.required){let a=document.createElement("li");a.classList.add("dropdownDivider"),c.append(a,this.#s(0,l))}let t=document.createElement("ul");t.classList.add("dropdownMenu"),t.append(c),this.append(t),this.classList.add("dropdown"),this.closest("form")!==null?(this.#e===void 0&&(this.#e=document.createElement("input"),this.#e.type="hidden",this.#e.name=`labelIDs[${this.dataset.groupId}]`,this.append(this.#e)),this.#e.value=(this.selected||0).toString()):this.#e?.remove(),this.selected&&(this.selected=this.selected)}#s(l,c){let t=document.createElement("button");t.type="button",t.dataset.labelId=l.toString(),t.innerHTML=c,t.addEventListener("click",()=>{this.selected=l});let a=document.createElement("li");return a.append(t),a}set selected(l){this.setAttribute("selected",l.toString()),this.#a.innerHTML=this.#t.get(l)||`<span class="badge label">${window.WoltLabLanguage.getPhrase("wcf.label.none")}</span>`,this.#e!==void 0&&(this.#e.value=l.toString())}get selected(){let l=parseInt(this.getAttribute("selected"));if(!Number.isNaN(l))return l}set disabled(l){l?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this.#a.disabled=l,this.#e&&(this.#e.disabled=l)}get disabled(){return this.hasAttribute("disabled")}set required(l){l?this.setAttribute("required",""):this.removeAttribute("required")}get required(){return this.hasAttribute("required")}}window.customElements.define("woltlab-core-label-picker",e)}{let r=[24,48,96];class l extends HTMLElement{#a;#e;connectedCallback(){this.#a===void 0&&this.#t()}attributeChangedCallback(t,a,i){if(t==="size"){let d=parseInt(i||"");if(!r.includes(d)){let b=parseInt(a||"");r.includes(b)||(b=24),this.setAttribute(t,b.toString())}}}#t(){this.classList.add("loading-indicator"),this.hasAttribute("size")||this.setAttribute("size",24 .toString()),this.#a=document.createElement("fa-icon"),this.#a.size=this.size,this.#a.setIcon("spinner"),this.#e=document.createElement("span"),this.#e.classList.add("loading-indicator__text"),this.#e.textContent=window.WoltLabLanguage.getPhrase("wcf.global.loading"),this.#e.hidden=this.hideText;let t=document.createElement("div");t.classList.add("loading-indicator__wrapper"),t.append(this.#a,this.#e),this.append(t)}get size(){return parseInt(this.getAttribute("size"))}set size(t){if(!r.includes(t))throw new TypeError(`The size ${t} is unrecognized, permitted values are ${r.join(", ")}.`);this.setAttribute("size",t.toString()),this.#a&&(this.#a.size=t)}get hideText(){return this.hasAttribute("hide-text")}set hideText(t){t?this.setAttribute("hide-text",""):this.removeAttribute("hide-text"),this.#e&&(this.#e.hidden=t)}static get observedAttributes(){return["size"]}}window.customElements.define("woltlab-core-loading-indicator",l)}{let e,r=()=>(e===void 0&&(e=window.matchMedia("(max-width: 544px)")),e);class l extends HTMLElement{#a="pagination";connectedCallback(){this.#e(),r().addEventListener("change",()=>this.#e())}#e(){if(this.innerHTML="",this.count<2)return;this.classList.add(`${this.#a}__wrapper`);let t=this.#t();this.append(t);let a=this.#s();a&&t.append(a);let i=document.createElement("ul");i.classList.add(`${this.#a}__list`),t.append(i),i.append(this.#l(1)),this.page>this.thresholdForEllipsis+1&&i.append(this.#i()),this.#f().forEach(b=>{i.append(b)}),this.count-this.page>this.thresholdForEllipsis&&i.append(this.#i()),i.append(this.#l(this.count));let d=this.#o();d&&t.append(d)}#t(){let t=document.createElement("nav");return t.setAttribute("role","navigation"),t.setAttribute("aria-label",window.WoltLabLanguage.getPhrase("wcf.page.pagination")),t.classList.add(this.#a),t}#s(){if(this.page===1)return;let t=document.createElement("div");t.classList.add(`${this.#a}__prev`);let a=this.#r(this.page-1);a instanceof HTMLAnchorElement&&(a.rel="prev"),a.title=window.WoltLabLanguage.getPhrase("wcf.global.page.previous"),a.classList.add("jsTooltip"),t.append(a);let i=document.createElement("fa-icon");return i.setIcon("arrow-left"),a.append(i),t}#o(){if(this.page===this.count)return;let t=document.createElement("div");t.classList.add(`${this.#a}__next`);let a=this.#r(this.page+1);a instanceof HTMLAnchorElement&&(a.rel="next"),a.title=window.WoltLabLanguage.getPhrase("wcf.global.page.next"),a.classList.add("jsTooltip"),t.append(a);let i=document.createElement("fa-icon");return i.setIcon("arrow-right"),a.append(i),t}#r(t){let a,i=this.getLinkUrl(t);return i?(a=document.createElement("a"),a.href=i):(a=document.createElement("button"),a.type="button",this.page===t?a.disabled=!0:a.addEventListener("click",()=>{this.#n(t)})),a.classList.add(`${this.#a}__link`),a}#l(t){let a=document.createElement("li");a.classList.add(`${this.#a}__item`);let i=this.#r(t);return i.setAttribute("aria-label",window.WoltLabLanguage.getPhrase("wcf.page.pageNo",{pageNo:t})),t===this.page&&(i.setAttribute("aria-current","page"),i.classList.add(`${this.#a}__link--current`)),i.textContent=t.toLocaleString(document.documentElement.lang),a.append(i),a}#f(){let t=[],a,i;r().matches?(a=this.page,i=this.page):(a=this.page-1,a===3&&a--,i=this.page+1,i===this.count-2&&i++);for(let d=a;d<=i;d++)d<=1||d>=this.count||t.push(this.#l(d));return t}#i(){let t=document.createElement("li");t.classList.add(`${this.#a}__item`,`${this.#a}__item--ellipsis`);let a=document.createElement("button");return a.type="button",a.title=window.WoltLabLanguage.getPhrase("wcf.page.jumpTo"),a.classList.add("pagination__link","jsTooltip"),a.innerHTML="&ctdot;",a.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("jumpToPage"))}),t.append(a),t}get thresholdForEllipsis(){return r().matches?1:3}getLinkUrl(t){if(!this.url)return"";let a=new URL(this.url);return a.search+=a.search!==""?"&":"?",a.search+=new URLSearchParams([["pageNo",t.toString()]]).toString(),a.toString()}jumpToPage(t){let a=this.getLinkUrl(t);a?window.location.href=a:this.#n(t)}#n(t){let a=new CustomEvent("switchPage",{cancelable:!0,detail:t});this.dispatchEvent(a),a.defaultPrevented||(this.page=t)}get count(){return this.hasAttribute("count")?parseInt(this.getAttribute("count")):0}set count(t){this.setAttribute("count",t.toString()),this.#e()}get page(){return this.hasAttribute("page")?parseInt(this.getAttribute("page")):1}set page(t){this.setAttribute("page",t.toString()),this.#e()}get url(){return this.getAttribute("url")}set url(t){this.setAttribute("url",t),this.#e()}}window.customElements.define("woltlab-core-pagination",l)}{class e extends HTMLElement{connectedCallback(){this.setData(this.#e(),this.#t())}setData(l,c){this.#a(l,c)}get objectId(){return parseInt(this.getAttribute("object-id"))}get objectType(){return this.getAttribute("object-type")}#a(l,c){if(this.innerHTML="",!l.size)return;let t=document.createElement("button");t.classList.add("reactionSummary","jsTooltip"),t.title=window.WoltLabLanguage.getPhrase("wcf.reactions.summary.listReactions"),t.addEventListener("click",()=>{this.dispatchEvent(new Event("showDetails"))}),this.append(t),l.forEach((a,i)=>{let d=document.createElement("span");d.classList.add("reactionCountButton"),i===c&&d.classList.add("selected");let b=document.createElement("span");b.innerHTML=window.REACTION_TYPES[i].renderedIcon,d.append(b);let k=document.createElement("span");k.classList.add("reactionCount"),k.textContent=a.toString(),d.append(k),t.append(d)})}#e(){let l=JSON.parse(this.getAttribute("data"));return this.removeAttribute("data"),new Map(l)}#t(){return parseInt(this.getAttribute("selected-reaction"))}}window.customElements.define("woltlab-core-reaction-summary",e)}window.WoltLabLanguage=ne;window.WoltLabTemplate=V;window.HTMLParsedElement=pe;})();
 /**
  * Handles the low level management of language items.
  *
@@ -94,6 +94,15 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[E]||E)+"'":ae="Parse error o
  * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @woltlabExcludeBundle all
  */
+/**
+ * The `<woltlab-core-label-picker>` provides an interactive widget to select a
+ * label out of a label group.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @woltlabExcludeBundle all
+ */
 /**
  * The `<woltlab-core-loading-indicator>` provides a ready-to-use
  * widget to indicate the loading status of a component to the user.