Lines Matching refs:toString

1 (function(u,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("bootstrap")):typeof define=="function"&&define.amd?define(["exports","bootstrap"],c):(u=typeof globalThis<"u"?globalThis:u||self,c(u.combo={},u.bootstrap))})(this,function(u,c){"use strict";var et=Object.defineProperty;var it=(u,c,H)=>c in u?et(u,c,{enumerable:!0,configurable:!0,writable:!0,value:H}):u[c]=H;var i=(u,c,H)=>(it(u,typeof c!="symbol"?c+"":c,H),H);class H{static toBoolean(t){return typeof t=="boolean"?t:t==="true"}}let F;class E{static getLogger(){return F===void 0&&(F=new E),F}error(t){if(console.error(t),process.env.NODE_ENV!=="production")throw new Error(t)}}let J=g=>crypto.getRandomValues(new Uint8Array(g)),q=(g,t,e)=>{let s=(2<<Math.log(g.length-1)/Math.LN2)-1,l=-~(1.6*s*t/g.length);return()=>{let r="";for(;;){let n=e(l),o=l;for(;o--;)if(r+=g[n[o]&s]||"",r.length===t)return r}}},G=(g,t)=>q(g,t,J);class ${static toHtmlId(t){return t.toString().replace(/[_.\s:\/\\]/g,"-")}static createRandomId(){return G("abcdefghijklmnopqrstuvwxyz",10)()}static createRandomIdWithPrefix(t){return t+"-"+this.createRandomId()}static toEntities(t){let e=[];for(let s=0;s<t.length;s++){let l=`&#${t.charCodeAt(s)};`;e.push(l)}return e.join("")}}class Q{static isString(t){return typeof t=="string"||t instanceof String}}const w=class{constructor(t){i(this,"tab","unknown");i(this,"mutable",!0);i(this,"values",[]);i(this,"defaultValues",[]);i(this,"multiple",!1);i(this,"children",{});i(this,"name");i(this,"type");i(this,"label");i(this,"url");i(this,"description");i(this,"parent");i(this,"domainValues");i(this,"width");this.name=t}getLabelAnchor(){if(this.getUrl()===void 0&&this.getDescription()===void 0)return this.getLabel();let t=this.getUrl();return this.getUrl()===void 0?(t="#",`
30 `;let l=this.getDataNamespace();return this.popoverRootHtmlElement.setAttribute(`data${l}-toggle`,"popover"),this.popoverRootHtmlElement.setAttribute(`data${l}-trigger`,this.trigger),this.popoverRootHtmlElement.setAttribute(`data${l}-placement`,String(this.placement)),this.popoverRootHtmlElement.setAttribute(`data${l}-html`,String(this.isHtml)),this.popoverRootHtmlElement.setAttribute(`data${l}-container`,"body"),this.popoverRootHtmlElement.setAttribute(`data${l}-content`,this.content),this.bootStrapPopOver=new c.Popover(this.popoverRootHtmlElement,e),this.bootStrapPopOver}getDataNamespace(){let t="-bs",e=5;if("bootstrap"in window){let s=window.bootstrap;if(typeof s.Popover.VERSION<"u")return e=parseInt(s.Popover.VERSION.substring(0,1),10),e<5?"":t}if("jQuery"in window){let l=window.jQuery.fn.tooltip.constructor.VERSION;if(typeof l<"u")return e=parseInt(l.substring(0,1),10),e<5?"":t}return t}setTextContent(t){return this.content=t,this.isHtml=!1,this}setHtmlContent(t){return this.content=t,this.isHtml=!0,this}setEnableDismissOnNextClick(){return this.dismissOnNextClick=!0,this}setDisableDismissOnNextClick(){return this.dismissOnNextClick=!1,this}setTitle(t){return this.title=t,this}}class X{static hasWindowGuard(t){if(!this.hasWindow(t))throw Error("The element has no window")}static hasWindow(t){return!(!t||!t.ownerDocument||!t.ownerDocument.defaultView)}static getWindow(t){return this.hasWindowGuard(t),t.ownerDocument.defaultView}static formDataToObject(t){let e={};for(let s of t){let l=s[0],r=s[1];if(e.hasOwnProperty(l)){let n=e[l];Array.isArray(n)?e[l].push(r):e[l]=[n,r]}else e[l]=r}return e}}class z{constructor(t){i(this,"method","GET");i(this,"url");this.url=t}async getJson(){let t=await this.getResponse();return t.status!==200?{}:t.json()}async getText(){let t=await this.getResponse();return t.status!==200?"":t.text()}setMethod(t){return this.method=t.toUpperCase(),this}sendFormDataAsJson(t){return fetch(this.url.toString(),{method:this.method,body:JSON.stringify(X.formDataToObject(t)),headers:{"Content-Type":"application/json"}})}async getResponse(){let t=await fetch(this.url.toString(),{method:this.method});if(t.status!==200){let e=R.createTemporary();e.addBody(`Bad request: the call ${this.url} to the backend sends back the following exit code`+t.status),e.show()}return t}}const f=class{constructor(t){i(this,"url");let e=window.DOKU_BASE,s=window.JSINFO;switch(t){case f.AJAX:this.url=new URL(e+"lib/exe/ajax.php",window.location.href),this.url.searchParams.set("id",s.id);break;case f.RUNNER:this.url=new URL(e+"lib/exe/taskrunner.php",window.location.href),this.url.searchParams.set("id",s.id);break;case f.FETCH:this.url=new URL(e+"lib/exe/fetch.php",window.location.href);break;case f.EDIT:this.url=new URL(e+"doku.php",window.location.href),this.url.searchParams.set("do","edit"),this.url.searchParams.set("id",s.id);break;case f.SHOW:this.url=new URL(e+"doku.php",window.location.href),this.url.searchParams.set("id",s.id);break;default:throw new Error(`The type ${t} is unknown`)}}setProperty(t,e){return this.url.searchParams.set(t,e),this}toString(){return this.url.toString()}getCall(){return this.url.searchParams.get(f.CALL)}toRequest(){return new z(this.url)}static createAjax(t){return new f(this.AJAX).setProperty(f.CALL,t)}static createRunner(){return new f(this.RUNNER)}static createFetch(t,e){let s=new f(this.FETCH);if(typeof t>"u")throw new Error("The media id is mandatory");return s.setProperty("media",t),typeof e<"u"&&s.setProperty("drive",e),s}static createEdit(t){let e=new f(this.EDIT);return typeof t<"u"&&e.setProperty("id",t),e}};let y=f;i(y,"AJAX","AJAX"),i(y,"RUNNER","RUNNER"),i(y,"CALL","call"),i(y,"EDIT","edit"),i(y,"SHOW","show"),i(y,"FETCH","fetch");class V{constructor(t){i(this,"date");this.date=t}static createFromIso(t){let e=new Date(t);return new V(e)}toSqlTimestampString(){return`${this.date.getFullYear()}-${(this.date.getMonth()+1).toString().padStart(2,"0")}-${this.date.getDate().toString().padStart(2,"0")} ${this.date.getHours().toString().padStart(2,"0")}:${this.date.getMinutes().toString().padStart(2,"0")}:${this.date.getSeconds().toString().padStart(2,"0")}`}}u.Date=V,u.DokuUrl=y,u.Form=B,u.Html=$,u.Modal=R,u.Popover=x,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});