From 29ee9058bf9e237743f94939224ba10283ab42f2 Mon Sep 17 00:00:00 2001 From: Jelmer Veen Date: Wed, 3 Jul 2024 16:55:46 +0200 Subject: [PATCH] fix: fixed sorting bug by removing joq dependency and rewriting sort, also saves 6kb. --- dist/flightkit-v0.0.6/flightkit.min.js | 1 - .../flightkit.js | 690 ++---------------- dist/flightkit-v0.0.7/flightkit.min.js | 1 + docs/cdn/ibiss-v0.0.7/avian.min.css | 1 + docs/cdn/ibiss-v0.0.7/flightkit.min.js | 1 + docs/cdn/ibiss-v0.0.7/htmx-ibiss-ui.min.js | 1 + docs/cdn/ibiss-v0.0.7/rocket.min.js | 1 + docs/js/flightkit.min.js | 2 +- .../public/cdn/ibiss-v0.0.7/avian.min.css | 1 + .../public/cdn/ibiss-v0.0.7/flightkit.min.js | 1 + .../cdn/ibiss-v0.0.7/htmx-ibiss-ui.min.js | 1 + .../public/cdn/ibiss-v0.0.7/rocket.min.js | 1 + documentation/public/js/flightkit.min.js | 2 +- flightkit/components/draggable.js | 2 +- flightkit/components/dropdown.js | 4 +- .../components/extensions/base_component.js | 4 +- flightkit/components/modal.js | 2 +- flightkit/components/table.js | 21 +- flightkit/components/tree-navigation.js | 4 +- .../domTraversal.js | 0 .../icons.js | 0 flightkit/flightkit-functions/sorting.js | 144 ++++ .../uuid_v4.js | 0 flightkit/package-lock.json | 13 - flightkit/package.json | 3 - package.json | 4 +- 26 files changed, 244 insertions(+), 661 deletions(-) delete mode 100644 dist/flightkit-v0.0.6/flightkit.min.js rename dist/{flightkit-v0.0.6 => flightkit-v0.0.7}/flightkit.js (73%) create mode 100644 dist/flightkit-v0.0.7/flightkit.min.js create mode 100644 docs/cdn/ibiss-v0.0.7/avian.min.css create mode 100644 docs/cdn/ibiss-v0.0.7/flightkit.min.js create mode 100644 docs/cdn/ibiss-v0.0.7/htmx-ibiss-ui.min.js create mode 100644 docs/cdn/ibiss-v0.0.7/rocket.min.js create mode 100644 documentation/public/cdn/ibiss-v0.0.7/avian.min.css create mode 100644 documentation/public/cdn/ibiss-v0.0.7/flightkit.min.js create mode 100644 documentation/public/cdn/ibiss-v0.0.7/htmx-ibiss-ui.min.js create mode 100644 documentation/public/cdn/ibiss-v0.0.7/rocket.min.js rename flightkit/{htmlbuilder => flightkit-functions}/domTraversal.js (100%) rename flightkit/{htmlbuilder => flightkit-functions}/icons.js (100%) create mode 100644 flightkit/flightkit-functions/sorting.js rename flightkit/{htmlbuilder => flightkit-functions}/uuid_v4.js (100%) diff --git a/dist/flightkit-v0.0.6/flightkit.min.js b/dist/flightkit-v0.0.6/flightkit.min.js deleted file mode 100644 index 330a84f..0000000 --- a/dist/flightkit-v0.0.6/flightkit.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/dist/flightkit-v0.0.6/flightkit.js b/dist/flightkit-v0.0.7/flightkit.js similarity index 73% rename from dist/flightkit-v0.0.6/flightkit.js rename to dist/flightkit-v0.0.7/flightkit.js index 01824db..f5bb20d 100644 --- a/dist/flightkit-v0.0.6/flightkit.js +++ b/dist/flightkit-v0.0.7/flightkit.js @@ -1,455 +1,24 @@ (function () { 'use strict'; - var DataType; - (function (DataType) { - DataType["Date"] = "date"; - DataType["String"] = "string"; - DataType["Float"] = "float"; - DataType["Number"] = "number"; - DataType["Array"] = "array"; - DataType["Object"] = "object"; - DataType["Bool"] = "bool"; - DataType["Currency"] = "currency"; - DataType["Undefined"] = "undefined"; - DataType["Null"] = "null"; - })(DataType || (DataType = {})); - const ValueRegexes = { - date: /^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim, - currency: /^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim, - float: /\d+[,|.]\d+[,|.]?\d*/gim, - currencySign: /\$|€/gim, - array: /^\s?[[].[^,]+[\]],?/gi, - precision: /[-+$€,.]/gm, - string: /[a-zA-Z]/gim - }; - const TypeCheck = (inputValue) => { - if (inputValue === null || inputValue === "null") - return DataType.Null; - if (!inputValue && inputValue !== 0 && inputValue !== false) - return DataType.Undefined; // !inputValue means also ignoring 0 and false - const dateValue = new RegExp(ValueRegexes.date).exec(inputValue); - if (dateValue !== null && !isNaN(Date.parse(inputValue))) { - return DataType.Date; - } - if (new RegExp(ValueRegexes.currency).exec(inputValue)) { - return DataType.Currency; - } - if (!new RegExp(ValueRegexes.string).exec(inputValue) && new RegExp(ValueRegexes.float).exec(inputValue.toString())) { - return DataType.Float; - } - if (!isNaN(inputValue) || inputValue === 0) { - return DataType.Number; - } - if (Array.isArray(inputValue)) { - return DataType.Array; - } - if (typeof inputValue === "object") { - return DataType.Object; - } - return DataType.String; - }; - const TypeConversion = (inputValue, dataType) => { - if (!dataType) - dataType = TypeCheck(inputValue); - const result = { value: undefined, type: dataType, currencySign: "" }; - switch (result.type) { - case DataType.String: { - result.value = inputValue.toString(); - break; - } - case DataType.Float: - case DataType.Currency: { - inputValue = inputValue.toString(); - const commas = inputValue.match(new RegExp(/(,)/gim)); - const dots = inputValue.match(new RegExp(/(\.)/gim)); - if (commas) { - for (let comma = 1; comma <= commas.length; comma++) { - if (comma === commas.length && !dots) /** if only one comma and no dot, it will be a dot.*/ - inputValue = inputValue.replace(",", "."); - else { - inputValue = inputValue.replace(",", ""); - } - } - } - if (result.type === DataType.Currency) { - const currencySignRegex = new RegExp(ValueRegexes.currencySign); - const currencySign = currencySignRegex.exec(inputValue); - result.currencySign = currencySign !== null ? currencySign[0] : ""; - inputValue = inputValue.replace(currencySignRegex, ""); - } - result.value = parseFloat(inputValue).toPrecision(12); - break; - } - case DataType.Number: { - result.value = Number(inputValue); - break; - } - case DataType.Date: { - result.value = Date.parse(inputValue); /** Get milliseconds, makes searching easier. */ - break; - } - case DataType.Array: { - if (inputValue.length) { - if (typeof inputValue[0] === "object") { - result.value = inputValue - .map((item) => JSON.stringify(item)) // No nesting yet. - .join(", "); - } - else { - result.value = inputValue.join(", "); - } - } - else { - result.value = ""; - } - break; - } - case DataType.Object: { - result.value = inputValue; - break; - } - case DataType.Undefined: { - result.value = ""; - break; - } - case DataType.Null: { - result.value = null; - break; - } - } - return result; - }; - function getColumnValue(column, jsonObject) { - const propertyTrail = column.split('.'); - /** it will be an object first, and later it will be the actual value */ - let objectValue; - for (let property of propertyTrail) { - property = property.trim(); - if (!objectValue) - objectValue = jsonObject[property]; - else if (typeof objectValue === "object" && !Array.isArray(objectValue)) - objectValue = objectValue[property]; - } - return objectValue; - } - - function distinctJsonProperties(jsonArray, columnNames, concatenationToken) { - /** Nothing to distinct */ - if (!columnNames || !columnNames.length) { - return jsonArray; - } - const groupedObjects = []; - const criteriaMet = []; - for (const jsonObject of jsonArray) { - const criteria = {}; - let newCriteria = ""; - for (const criteriaColumn of columnNames) { - const critValue = getColumnValue(criteriaColumn, jsonObject); - /** for use to group */ - criteria[criteriaColumn] = critValue; - /** track which combination of values has been grouped already */ - newCriteria += critValue; - } - if (!criteriaMet.includes(newCriteria)) { - let critGroup = jsonArray; - const criteriaKeys = Object.keys(criteria); - for (const critKey of criteriaKeys) { - critGroup = critGroup.filter((obj) => obj[critKey] === criteria[critKey]); - } - criteriaMet.push(newCriteria); - groupedObjects.push(critGroup); - } - } - const mergedObjects = []; - for (const objectGroup of groupedObjects) { - let mergedObject = {}; - for (const jsonObject of objectGroup) { - const jsonProperties = Object.keys(mergedObject); - if (!jsonProperties.length) { - mergedObject = jsonObject; - continue; - } - for (const column of jsonProperties) { - if (!columnNames.includes(column)) { - const mergedValue = mergedObject[column]; - if (Array.isArray(mergedValue)) { - const valueToMerge = jsonObject[column]; - if (Array.isArray(valueToMerge)) { - mergedObject[column] = [ - ...new Set(...mergedObject[column].concat(jsonObject[column])), - ]; - } - else { - if (!mergedObject[column].includes(jsonObject[column])) { - mergedObject[column].push(jsonObject[column]); - } - } - } - else { - if (isNaN(mergedObject[column]) && isNaN(jsonObject[column])) { - if (mergedObject[column] !== jsonObject[column]) { - mergedObject[column] = [ - mergedObject[column], - jsonObject[column], - ]; - } - } - else { - mergedObject[column] = - mergedObject[column] + jsonObject[column]; - } - } - } - } - } - mergedObjects.push(mergedObject); - } - /** merge the arrays */ - mergedObjects.forEach((jsonObject) => { - for (const prop in jsonObject) { - if (Array.isArray(jsonObject[prop])) { - jsonObject[prop] = jsonObject[prop].join(concatenationToken); - } - } - }); - return mergedObjects; - } - - const bigger = (value, comparisonValue) => value > comparisonValue; - const smaller = (value, comparisonValue) => value < comparisonValue; - const biggerEquals = (value, comparisonValue) => value >= comparisonValue; - const smallerEquals = (value, comparisonValue) => value <= comparisonValue; - const equals = (value, comparisonValue, ignoreCase) => { - if (ignoreCase) - return value.toLowerCase() == comparisonValue.toLowerCase(); - else - return value == comparisonValue; - }; - const superEquals = (value, comparisonValue) => value === comparisonValue; - const notEquals = (value, comparisonValue) => value != comparisonValue; - const superNotEquals = (value, comparisonValue) => value !== comparisonValue; - const like = (value, comparisonValue) => { - if (comparisonValue !== null && comparisonValue !== undefined && typeof value === 'string') { - return value.toLowerCase().indexOf(comparisonValue.toString().toLowerCase()) >= 0; - } - else - return false; - }; - const genericLike = (value, comparisonValue) => { - if (comparisonValue !== null && comparisonValue !== undefined) { - return value.toString().toLowerCase().indexOf(comparisonValue.toString().toLowerCase()) >= 0; - } - else - return false; - }; - const notLike = (value, comparisonValue) => { - if (comparisonValue !== null && comparisonValue !== undefined && typeof value === 'string') { - return value.toLowerCase().indexOf(comparisonValue.toString().toLowerCase()) < 0; - } - return false; - }; - function getComparisonFunction(comparisonOperator) { - switch (comparisonOperator.toLowerCase()) { - case ">": - return bigger; - case "<": - return smaller; - case ">=": - return biggerEquals; - case "<=": - return smallerEquals; - case "is": - case "==": - return equals; - case "!is": - case "!=": - return notEquals; - case "===": - return superEquals; - case "!==": - return superNotEquals; - case "like": - case "~": - case "contains": - return like; - case "!contains": - case "!like": - case "!~": - return notLike; - default: - return genericLike; - } - } - - var FilterType; - (function (FilterType) { - FilterType["And"] = "and"; - FilterType["Or"] = "or"; - })(FilterType || (FilterType = {})); - var FilterOperator; - (function (FilterOperator) { - FilterOperator["GreaterThan"] = ">"; - FilterOperator["LesserThan"] = "<"; - FilterOperator["EqualsOrGreater"] = ">="; - FilterOperator["EqualsOrLesser"] = "<="; - FilterOperator["Is"] = "is"; - FilterOperator["Equals"] = "=="; - FilterOperator["NotEquals"] = "!="; - FilterOperator["SuperEquals"] = "==="; - FilterOperator["SuperNotEquals"] = "!=="; - FilterOperator["Like"] = "like"; - FilterOperator["NotLike"] = "!like"; - FilterOperator["Contains"] = "contains"; - FilterOperator["NotContains"] = "!contains"; - })(FilterOperator || (FilterOperator = {})); - function filterJsonArray(jsonArray, filterDetails) { - if (filterDetails.length === 0) - return jsonArray; - return filterFunction(jsonArray, filterDetails); - } - function filterFunction(jsonArray, filterDetails) { - const searchResults = []; - const filters = []; - let filterGroup = []; - for (const filter of filterDetails) { - if (!filter.type || filter.type === FilterType.And) { - filterGroup.push(filter); - } - else { - if (filterGroup.length) { - filters.push(filterGroup); - } - filterGroup = [filter]; - } - } - filters.push(filterGroup); - let indexThatMatch = []; - for (const filterGroup of filters) { - indexThatMatch = indexThatMatch.concat(compareValues(jsonArray, filterGroup)); - } - /** deduplicate */ - indexThatMatch = [...new Set(indexThatMatch)]; - const jsonArrayLength = jsonArray.length; - for (let index = 0; index < jsonArrayLength; index++) { - if (indexThatMatch.includes(index)) { - searchResults.push(jsonArray[index]); - } - } - return searchResults; - } - const compareValues = function (jsonArray, filterDetails) { - const matches = []; - if (!jsonArray) - return matches; - for (const [index, objectToCheck] of jsonArray.entries()) { - let itemMatches = true; - for (const filterDetail of filterDetails) { - const columnValue = getColumnValue(filterDetail.propertyName, objectToCheck); - const parsedValue = TypeConversion(columnValue).value; - const comparisonValue = TypeConversion(filterDetail.value).value; - const comparisonFunction = getComparisonFunction(filterDetail.operator); - if (!comparisonFunction(parsedValue, comparisonValue, filterDetail.ignoreCase)) { - itemMatches = false; - break; - } - } - /** pushing the index so we can deduplicate later with other or clauses */ - if (itemMatches) { - matches.push(index); - } - } - return matches; - }; - - function groupJsonArray(jsonArray, groupByProperties) { - if (!groupByProperties || groupByProperties.length === 0) - return jsonArray; - if (groupByProperties.length > 1) { - return multipleGroupFunction(jsonArray, groupByProperties); - } - else { - return groupFunction(jsonArray, groupByProperties[0]); - } - } - function groupFunction(objects, groupByProperty) { - const arrayOfGroupedObjects = []; - const groupIndex = []; // the index in the arrayOfGroupedObjects - do { - if (!objects || objects.length === 0) - break; - /** need to use shift instead of pop, because of sorting. else we are unintentionally reversing the array */ - const nextInline = objects.shift(); - if (!nextInline) - break; - const value = nextInline[groupByProperty]; - const index = groupIndex.indexOf(value.toString()); - if (index >= 0) { - arrayOfGroupedObjects[index].push(nextInline); - } - else { - groupIndex.push(value.toString()); - if (arrayOfGroupedObjects[groupIndex.length - 1] !== undefined) // If it's not empty, we push a new one inside existing array - arrayOfGroupedObjects[groupIndex.length - 1].push(nextInline); - else { - arrayOfGroupedObjects.push([nextInline]); // We create a new array and push that - } - } - } while (objects.length > 0); - return arrayOfGroupedObjects; - } - function multipleGroupFunction(objects, groupByProperties) { - let arrayOfGroupedObjects = []; - let tempArray = []; - groupByProperties.forEach((property) => { - // we start - if (arrayOfGroupedObjects.length === 0) { - arrayOfGroupedObjects = arrayOfGroupedObjects.concat(groupFunction(objects, property)); - } - else { - for (const objectArray of arrayOfGroupedObjects) { - tempArray = tempArray.concat(groupFunction(objectArray, property)); - } - arrayOfGroupedObjects = tempArray; - tempArray = []; - } - }); - return arrayOfGroupedObjects; - } - - function selectJsonArray(jsonArray, selection) { - if (selection.length === 0) - return jsonArray; - return selectFunction(jsonArray, selection); - } - function selectFunction(jsonArray, selection) { - let subselectedJsonArray = []; - for (const object of jsonArray) { - const newObject = {}; - for (const property of selection) { - newObject[property] = object[property]; - } - subselectedJsonArray.push(newObject); - } - return subselectedJsonArray; - } - - var SortDirection; - (function (SortDirection) { - SortDirection["ascending"] = "asc"; - SortDirection["descending"] = "desc"; - })(SortDirection || (SortDirection = {})); + /** + * @param {*} jsonArray + * @param {Object} sortDetails ( propertyName: string, direction: 'asc' | 'desc' ) + * @returns + */ function sortJsonArray(jsonArray, sortDetails) { - if (!sortDetails || sortDetails.length === 0) - return jsonArray; - /** need to make a copy, sort is in-place. So original order would be lost */ + if (!sortDetails || sortDetails.length === 0) return jsonArray; + + /** need to make a copy, sort is in-place. Else original order would be lost */ const newJsonArray = Object.assign([], jsonArray); + if (Array.isArray(newJsonArray[0])) { sortGroupedJsonArray(newJsonArray, sortDetails); } else { newJsonArray.sort(sortFunction(sortDetails)); } + return newJsonArray; } const sortGroupedJsonArray = (groupedJsonArray, sortDetails) => { @@ -459,32 +28,72 @@ } return result; }; + + function extractNumber(value) { + let testString = value.toString(); + let match = testString.match(/^\d+|\d+$/); + return match ? parseInt(match[0]) : null; + } + + function isBoolean(value) { + if (typeof value === 'boolean') return true; + + if (typeof value === 'string') { + const comparison = value.toLocaleLowerCase(); + return comparison === 'true' || comparison === 'false' + } + return false; + } + + function getBooleanValue(value) { + if (typeof value === 'boolean') return value; + return value.toLocaleLowerCase() === 'true' + } + function sortFunction(applicableSorters, index = 0) { return function (a, b) { + const { propertyName, direction } = applicableSorters[index]; + /** if it is undefined, just make it a string. */ - let valueA = a[propertyName] || ""; - let valueB = b[propertyName] || ""; + let valueA = a[propertyName] === null || a[propertyName] === undefined ? '' : a[propertyName]; + let valueB = b[propertyName] === null || b[propertyName] === undefined ? '' : b[propertyName]; + const dateRegex = /^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim; + const valuesAreDates = (valueA instanceof Date && valueB instanceof Date) || (dateRegex.test(valueA) && dateRegex.test(valueB)); if (valuesAreDates) { valueA = valueA instanceof Date ? valueA.valueOf() : new Date(Date.parse(valueA)); valueB = valueB instanceof Date ? valueB.valueOf() : new Date(Date.parse(valueB)); } - const valuesAreNumbers = !isNaN(valueA) && !isNaN(valueB); + + /** need to check for booleans, else valueA and valueB become NaN */ + const valuesAreBooleans = isBoolean(valueA) && isBoolean(valueB); + const valuesAreNumbers = !valuesAreBooleans && !isNaN(valueA) && !isNaN(valueB); + + const valueAHasNumber = extractNumber(valueA); + const valueBHasNumber = extractNumber(valueB); + if (valuesAreNumbers) { valueA = parseFloat(valueA).toPrecision(12); valueB = parseFloat(valueB).toPrecision(12); } - const valuesAreBooleans = (valueA === "true" || valueA === "false") && (valueB === "true" || valueB === "false"); + else if (valueAHasNumber !== null && valueBHasNumber !== null) { + valueA = parseFloat(valueAHasNumber).toPrecision(12); + valueB = parseFloat(valueBHasNumber).toPrecision(12); + } + if (valuesAreBooleans) { - valueA = valueA === "true"; - valueB = valueB === "true"; + valueA = getBooleanValue(valueA); + valueB = getBooleanValue(valueB); } + /** set the values genericly */ let leftHandValue, rightHandValue; + switch (direction) { - case SortDirection.descending: { + case 'descending': + case 'desc': { leftHandValue = valueB; rightHandValue = valueA; break; @@ -495,8 +104,10 @@ break; } } + // check if -1 or 1, 0. if 0 then check again. let comparisonValue = 0; + if (valuesAreBooleans || valuesAreDates || valuesAreNumbers) { /** Yes this works for all these things. :D */ comparisonValue = leftHandValue - rightHandValue; @@ -504,9 +115,12 @@ else { leftHandValue = leftHandValue.toString().trim().toLowerCase(); rightHandValue = rightHandValue.toString().trim().toLowerCase(); + const digitRegex = /\d/gmi; + /** use this for the additional options in localeCompare */ const valuesAreAlphaNumeric = digitRegex.test(valueA) && digitRegex.test(valueB); + if (valuesAreAlphaNumeric) { comparisonValue = leftHandValue.localeCompare(rightHandValue, undefined, { numeric: true, @@ -517,7 +131,9 @@ comparisonValue = leftHandValue.localeCompare(rightHandValue); } } + const nextSorterIndex = index + 1; + /** the value is the same for this property and we have more sorters then go to the next */ if (comparisonValue === 0 && nextSorterIndex < applicableSorters.length) { const sortWrapper = sortFunction(applicableSorters, nextSorterIndex); @@ -529,167 +145,6 @@ }; } - const sumJsonArray = (jsonArray, propertiesToSum) => { - if (!propertiesToSum) - return {}; - return sumFunction(jsonArray, propertiesToSum); - }; - function sumFunction(jsonArray, propertiesToSum) { - const sumObject = {}; - for (const sumProperty of propertiesToSum) { - let allValuesToSum = jsonArray.map(object => object[sumProperty].toString()); - const dataTypes = allValuesToSum.map(value => TypeCheck(value)); - const isFloat = dataTypes.some(type => type === DataType.Float); - if (isFloat) { - allValuesToSum = allValuesToSum.map(value => parseFloat(value)); - sumObject[sumProperty] = parseFloat(allValuesToSum.reduce((a, b) => a + b).toFixed(2)); - } - else { - allValuesToSum = allValuesToSum.map(value => parseInt(value)); - sumObject[sumProperty] = allValuesToSum.reduce((a, b) => a + b); - } - } - return sumObject; - } - - class JOQ { - model; - sortDetails = []; - filterDetails = []; - selection = []; - groupByProperties = []; - distinctProperties = []; - concatenationToken = ', '; - /** - * Jelmers Object Query Class - */ - constructor(jsonArray) { - /** Make a hard copy */ - this.model = JSON.parse(JSON.stringify(jsonArray)); - } - /** Same as order, but here you can give the complete sorting details.*/ - sort(sortDetails) { - this.sortDetails = sortDetails; - return this; - } - /** Order the array ascending or descending for the values of given property*/ - orderBy(propertyName, direction) { - this.sortDetails.push({ propertyName, direction }); - return this; - } - /** Add a consecutive ordering of the array ascending or descending for the values of given property*/ - thenOrderBy(propertyName, direction) { - return this.orderBy(propertyName, direction); - } - /** - * Set the complete where / filter clause specification, for automated processes - * @param {Array} filterDetails an array with { column: string, value: any, operator: FilterOperator, type?: FilterType } - * @returns - */ - filter(filterDetails) { - if (Array.isArray(filterDetails)) { - this.filterDetails = filterDetails; - } - else { - this.filterDetails.push(filterDetails); - } - return this; - } - ; - /** - * Add a where clause - * @param {Array} filterDetails an array with { column: string, value: any, operator: FilterOperator, type?: FilterType } - * @returns - */ - where(propertyName, operator, value, type, ignoreCase) { - this.filterDetails.push({ propertyName, operator, value, type, ignoreCase }); - return this; - } - ; - /** Same as where, but prefills the FilterType with 'and' */ - andWhere(propertyName, operator, value, ignoreCase) { - this.where(propertyName, operator, value, FilterType.And, ignoreCase); - return this; - } - ; - /** Same as where, but prefills the FilterType with 'or' */ - orWhere(propertyName, operator, value, ignoreCase) { - this.where(propertyName, operator, value, FilterType.Or, ignoreCase); - return this; - } - ; - /** - * Sets propertynames that you want to group on, order matters. - * @param {Array | String} groupByProperties - * @returns joq object - */ - group(groupByProperties) { - this.groupByProperties = groupByProperties; - return this; - } - /** Same as group, semantic sugar */ - groupBy(propertyName) { - this.groupByProperties.push(propertyName); - return this; - } - ; - /** Same as group, semantic sugar */ - thenGroupBy(propertyName) { - this.groupByProperties.push(propertyName); - return this; - } - ; - /** - * Subselects all objects based on provided selection. - */ - select(selection) { - if (Array.isArray(selection)) { - this.selection = selection; - } - else if (selection !== "*") { - this.selection = [selection]; - } - return this; - } - ; - /** - * distinct on specified columns in objects and make them unique and merge the other properties - */ - distinct(properties, concatenationToken) { - if (concatenationToken) { - this.concatenationToken = concatenationToken; - } - if (Array.isArray(properties)) { - this.distinctProperties = properties; - } - else if (properties) { - this.distinctProperties = [properties]; - } - return this; - } - /** Executes selection, group and where statements provided */ - execute() { - /** always use a fresh copy. */ - const copyOfModel = JSON.parse(JSON.stringify(this.model)); - const filteredJsonArray = filterJsonArray(copyOfModel, this.filterDetails); - const sortedJsonArray = sortJsonArray(filteredJsonArray, this.sortDetails); - const distinctJsonArray = distinctJsonProperties(sortedJsonArray, this.distinctProperties, this.concatenationToken); - const selectedJsonArray = selectJsonArray(distinctJsonArray, this.selection); - const groupedJsonArray = groupJsonArray(selectedJsonArray, this.groupByProperties); - return groupedJsonArray; - } - /** - * @param sumProperties string or string array with the propertynames which you want to sum. - * @param jsonArray *optional* can be used with your own object array, or a subselection, default uses the one that you initialized JOQ with. - * @returns an object with { property: sum} - */ - sum(sumProperties, jsonArray) { - const propertiesToSum = Array.isArray(sumProperties) ? sumProperties : [sumProperties]; - return sumJsonArray(jsonArray || this.model, propertiesToSum); - } - ; - } - function isFlightkitElement(tagName, flkTag) { const compareTo = flkTag ? flkTag.toUpperCase() : 'FLK-'; return tagName.toUpperCase().includes(compareTo); @@ -977,6 +432,8 @@ return parsedSvg.documentElement; } + // import JOQ from '@pennions/joq'; + class FlightkitTable extends HTMLElement { base; /** to render */ @@ -1022,7 +479,7 @@ set contents(newValue) { this.analyzeData(newValue); - this._contents = new JOQ(newValue); + this._contents = newValue; } get orderBy() { @@ -1140,14 +597,10 @@ createHtml() { const tableElement = document.createElement('table'); + let tableData = this.contents; - /** because of JOQ */ if (this.orderBy.length) { - this.contents.sort(this.orderBy); - } - else { - /** reset if no order */ - this.contents.sort([]); + tableData = sortJsonArray(this.contents, this.orderBy); } const tableHead = this.createHead(); @@ -1157,10 +610,9 @@ tableElement.append(this._createElement('caption')); } - const orderedData = this.contents.execute(); let filteredData = []; if (this.filter.length) { - for (const data of orderedData) { + for (const data of tableData) { let valuesInData = Object.values(data).join(" ").toLowerCase(); if (valuesInData.includes(this.filter)) { @@ -1169,7 +621,7 @@ } } else { - filteredData = orderedData; + filteredData = tableData; } diff --git a/dist/flightkit-v0.0.7/flightkit.min.js b/dist/flightkit-v0.0.7/flightkit.min.js new file mode 100644 index 0000000..984097a --- /dev/null +++ b/dist/flightkit-v0.0.7/flightkit.min.js @@ -0,0 +1 @@ +!function(){"use strict";function i(e,t){if(!t||0===t.length)return e;const s=Object.assign([],e);if(Array.isArray(s[0])){e=s;var n=t;const r=[];for(const i of e)r.push(i.sort(E(n)));r}else s.sort(E(t));return s}function y(e){let t=e.toString();e=t.match(/^\d+|\d+$/);return e?parseInt(e[0]):null}function b(e){return"boolean"==typeof e||"string"==typeof e&&("true"===(e=e.toLocaleLowerCase())||"false"===e)}function w(e){return"boolean"==typeof e?e:"true"===e.toLocaleLowerCase()}function E(f,v=0){return function(e,t){var{propertyName:s,direction:d}=f[v];let n=null===e[s]||void 0===e[s]?"":e[s],r=null===t[s]||void 0===t[s]?"":t[s];const h=/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim;var s=n instanceof Date&&r instanceof Date||h.test(n)&&h.test(r),p=(s&&(n=n instanceof Date?n.valueOf():new Date(Date.parse(n)),r=r instanceof Date?r.valueOf():new Date(Date.parse(r))),b(n)&&b(r)),u=!p&&!isNaN(n)&&!isNaN(r),i=y(n),o=y(r);u?(n=parseFloat(n).toPrecision(12),r=parseFloat(r).toPrecision(12)):null!==i&&null!==o&&(n=parseFloat(i).toPrecision(12),r=parseFloat(o).toPrecision(12)),p&&(n=w(n),r=w(r));let a,l;switch(d){case"descending":case"desc":a=r,l=n;break;default:a=n,l=r}let c=0;if(p||s||u)c=a-l;else{a=a.toString().trim().toLowerCase(),l=l.toString().trim().toLowerCase();const m=/\d/gim;i=m.test(n)&&m.test(r);c=i?a.localeCompare(l,void 0,{numeric:!0,sensitivity:"base"}):a.localeCompare(l)}o=v+1;if(0===c&&o(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(s,i,t.getAttribute(n))}}var r=Object.keys(t.classList).length;if(r){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=p(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const r of s.split("."))n=(n||window)[r];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const n of document.querySelectorAll(s.selector))this._addEventToElement(s,n);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const m='',g='';function l(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class e extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=e}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const r of e.split(",")){var t=r.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const n=p(e).target,r=(t?n._selectedIds.add(s):n._selectedIds.delete(s),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[r]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=p(e).target,s=u(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=n[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const r=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),r.append(i),t.append(r)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var s=this.createRow(n,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const r=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class t extends HTMLElement{base;componentId;constructor(){super(),this.base=new r}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const r=document.createElement("div");r.innerHTML=this.innerHTML,this.component=r;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=p(e,"flk-draggable").target;let n,r;function t(e){n=e.clientX-s.offsetLeft,r=e.clientY-s.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-r;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class s extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new r}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=p(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var r=this.getAttribute("modal-title");if(r){const c=document.createElement("span");c.innerText=r,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");r=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=r,n.append(a),s.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+r,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class n extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new r}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var n=l('');const r=l(''),i=(r.classList.add("hidden"),s.append(n,r),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=p(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,n=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=n||t.offsetWidth+"px",t._iconId);const r=document.getElementById(n);e?(r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")):(r.childNodes[0].classList.add("hidden"),r.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=p(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const n of e)s._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const r of e)r._closeDropdown()}}class o extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const n of t.split(","))s=s.concat(n.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new r,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=p(e,"flk-tree-nav").target,s=u(e,"branchKey");let n=t.contents;const d=s.split(".");for(const o of d)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}let r,i=e.target;for(;i.dataset&&i.dataset.leafKey?r=i.dataset.leafKey:i=i.parentNode||i.parentElement,!r;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:r,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let n="",r="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,n=this.convertJsonKeyToTitle(e.substring(0,s)),r=e.substring(s)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:r}}createTextTag(n,r){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=n.titleText,document.createElement("small"));s.innerText=n.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",r.append(e)}else r.innerText=n.titleText}createLeaf(e,t,s,n=[]){let r=document.createElement("li");r.classList.add("cursor-no-select"),r.style.marginTop="0.4rem",r.dataset.branchKey=s;const i="file"===this.iconSet?'':'';r.style.listStyleImage=`url('data:image/svg+xml,${i}')`,r.style.position="relative",r.style.left="2px";let o=document.createElement("span");s=[e].concat(n);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",r.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?m:g;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(r),t.append(e)}else t.append(r)}createBranch(s,t,n,r){if(r===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,n+"."+e,r+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,n+"."+l,r+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?m:g;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(s,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?m:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",e),customElements.define("flk-draggable",t),customElements.define("flk-modal",s),customElements.define("flk-dropdown",n),customElements.define("flk-tree-nav",o)}(); \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.7/avian.min.css b/docs/cdn/ibiss-v0.0.7/avian.min.css new file mode 100644 index 0000000..53c6f0a --- /dev/null +++ b/docs/cdn/ibiss-v0.0.7/avian.min.css @@ -0,0 +1 @@ +:root{--html-background:#faf9f8;--background:#fff;--code-background:#f3f2f1;--overlay-background:0,0,0;--color-on-black:#c8c6c4;--font-color:#323130;--shadow-color:0,0,0;--hr-color:#d2d0ce;--border-color:#8a8886;--gray-light:#edebe9;--color-on-gray-light:#000;--gray:#a19f9d;--color-on-gray:#000;--gray-dark:#605e5c;--color-on-gray-dark:#faf9f8;--gray-darker:#8a8886;--light:#d2d0ce;--black:#000;--white:#fff;--icon:#605e5c;--icon-disabled:#a19f9d;--icon-error:#a80000;--icon-success:#107c10;--icon-warning:#797673;--primary:#0078d4;--primary-hover:#0068b8;--color-on-primary:#fff;--accent:#fce100;--accent-hover:#e6cf00;--color-on-accent:#000;--danger:#d13438;--danger-hover:#bb2a2f;--color-on-danger:#fff;--warning:#fff4ce;--color-on-warning:#323130;--error:#fde7e9;--color-on-error:#323130;--success:#dff6dd;--color-on-success:#323130;--contrast:#ccc;--contrast-hover:#b2b2b2;--color-on-contrast:#000;--disabled:#d2d0ce;--color-on-disabled:#a19f9d;--button-background:#fff;--button-hover:#e1dfdd;--button-outline-color:#000;--button-color:#000;--disabled-button-background:#f3f2f1;--disabled-button-color:#a19f9d;--colored-disabled-button-color:#d2d0ce;--input-border-color:#605e5c;--input-hover:#c8c6c4;--range-track-color:#c8c6c4;--range-filled-track-color:#605e5c;--range-track-hover-color:#e0f2ff;--switch-border-color:#000;--switch-toggle-off-color:#000;--switch-toggle-on-color:#fff;--table-hover:#e1dfdd;--table-striped-hover:#d2d0ce;--table-stripe:#edebe9;--default-distance:1.5rem;--distance-0:0;--distance-1:0.5rem;--distance-2:1rem;--distance-3:1.5rem;--distance-4:2rem;--distance-5:2.5rem;--h1-font-size:3.2rem;--h2-font-size:3rem;--h3-font-size:2.8rem;--h4-font-size:2.6rem;--h5-font-size:2.4rem;--h6-font-size:2.2rem;--th-font-size:2.2rem;--paragraph-font-size:1.6rem;--label-font-size:1.6rem;--small-font-size:1.2rem;--font-weight-normal:400;--font-weight-semibold:600;--font-weight-bold:700}*,:after,:before{box-sizing:border-box;font:inherit;font-weight:var(--font-weight-normal);margin:0;padding:0}html{font-size:62.5%;hanging-punctuation:first last}body{font-family:Segoe UI,"Segoe UI Web (West European)",-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif;font-size:1.6rem;height:100svh;line-height:1.5;text-rendering:optimizeSpeed}h1,h2,h3,h4,h5,h6{text-wrap:balance}p{text-wrap:pretty;max-width:75ch}ol,ul{margin-left:2rem}img,picture{display:block;max-width:100%}.lucide{left:2px;position:relative;top:3px}@media (prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,:after,:before{animation-duration:.01ms;animation-iteration-count:1;scroll-behavior:auto;transition-duration:.01ms}}@media (prefers-reduced-motion:no-preference){:has(:target),html{scroll-behavior:smooth;scroll-padding-top:3rem}}h1{font-size:var(--h1-font-size)}h1,h2{font-weight:var(--font-weight-bold)}h2{font-size:var(--h2-font-size)}h3{font-size:var(--h3-font-size);font-weight:var(--font-weight-bold)}h4{font-size:var(--h4-font-size)}h4,h5{font-weight:var(--font-weight-semibold)}h5{font-size:var(--h5-font-size)}h6{font-size:var(--h6-font-size);font-weight:var(--font-weight-semibold)}p{font-size:var(--paragraph-font-size)}label{font-size:var(--label-font-size)}small{font-size:var(--small-font-size)}b,strong{font-weight:var(--font-weight-bold)}cite,em,i{font-style:italic}code:not([class*=language]),kbd{background-color:var(--code-background);border:.5px solid var(--border-color);border-radius:.2rem;bottom:.1rem;margin:0 .2rem;padding:.2rem .4rem;position:relative}mark{background-color:var(--accent)}th{font-size:var(--th-font-size);font-weight:var(--font-weight-semibold)}.font-size-68{font-size:6.8rem!important}.font-size-42{font-size:4.2rem!important}.font-size-32{font-size:3.2rem!important}.font-size-28{font-size:2.8rem!important}.font-size-24{font-size:2.4rem!important}.font-size-20{font-size:2rem!important}.font-size-18{font-size:1.8rem!important}.font-size-16{font-size:1.6rem!important}.font-size-14{font-size:1.4rem!important}.font-size-12{font-size:1.2rem!important}.font-size-10{font-size:1rem!important}.font-weight-normal{font-weight:400!important}.font-weight-semibold{font-weight:600!important}.font-weight-bold{font-weight:700!important}.align-center{align-items:center}.align-end{align-items:flex-end}.align-start{align-items:flex-start}.align-stretch{align-items:stretch}.align-between{align-content:space-between}.align-around{align-content:space-around}.align-evenly{align-content:space-evenly}.self-align-stretch{align-self:stretch}.self-align-center{align-self:center}.self-align-start{align-self:flex-start}.self-align-end{align-self:flex-end}.row{display:flex;flex-wrap:wrap}.column{display:flex;flex-direction:column}.no-wrap{flex-wrap:nowrap}.wrap-reverse{flex-wrap:wrap-reverse}.row-reverse{flex-direction:row-reverse}.column-reverse{flex-direction:column-reverse}@media (min-width:993px){.drow-reverse{flex-direction:row-reverse}.dcolumn-reverse{flex-direction:column-reverse}}@media (min-width:768px) and (max-width:992px){.trow-reverse{flex-direction:row-reverse}.tcolumn-reverse{flex-direction:column-reverse}}@media (max-width:767px){.mrow-reverse{flex-direction:row-reverse}.mcolumn-reverse{flex-direction:column-reverse}}.gap-0{gap:var(--distance-0)}.gap-1{gap:var(--distance-1)}.gap-2{gap:var(--distance-2)}.gap-3{gap:var(--distance-3)}.gap-4{gap:var(--distance-4)}.gap-5{gap:var(--distance-5)}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.justify-evenly{justify-content:space-evenly}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.justify-start{justify-content:flex-start}.f-100{flex:1 1 100%}.f-90{flex:0 0 90%}.f-80{flex:0 0 80%}.f-75{flex:0 0 75%}.f-70{flex:0 0 70%}.f-60{flex:0 0 60%}.f-50{flex:0 0 50%}.f-33{flex:0 0 33.33%}.f-30{flex:0 0 30%}.f-25{flex:0 0 25%}.f-20{flex:0 0 20%}.f-16{flex:0 0 16.67%}.f-10{flex:0 0 10%}.f-8{flex:0 0 8.33%}.f-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.f-fill{flex:1;max-width:none;min-width:auto;width:100%}@media (min-width:768px) and (max-width:992px){.tf-100{flex:1 1 100%}.tf-90{flex:0 0 90%}.tf-80{flex:0 0 80%}.tf-75{flex:0 0 75%}.tf-70{flex:0 0 70%}.tf-60{flex:0 0 60%}.tf-50{flex:0 0 50%}.tf-33{flex:0 0 33.33%}.tf-30{flex:0 0 30%}.tf-25{flex:0 0 25%}.tf-20{flex:0 0 20%}.tf-16{flex:0 0 16.67%}.tf-10{flex:0 0 10%}.tf-8{flex:0 0 8.33%}.tf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.tf-fill{flex:1;max-width:none;min-width:auto;width:100%}}@media (max-width:767px){.mf-100{flex:1 1 100%}.mf-90{flex:0 0 90%}.mf-80{flex:0 0 80%}.mf-75{flex:0 0 75%}.mf-70{flex:0 0 70%}.mf-60{flex:0 0 60%}.mf-50{flex:0 0 50%}.mf-33{flex:0 0 33.33%}.mf-30{flex:0 0 30%}.mf-25{flex:0 0 25%}.mf-20{flex:0 0 20%}.mf-16{flex:0 0 16.67%}.mf-10{flex:0 0 10%}.mf-8{flex:0 0 8.33%}.mf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.mf-fill{flex:1;max-width:none;min-width:auto;width:100%}}.no-scroll{overflow:hidden}.text-no-wrap{white-space:nowrap}.text-normal{font-weight:400}.sticky{height:auto;position:sticky;position:-webkit-sticky;top:0;z-index:1000}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.block{display:block}.hidden{display:none}@media (min-width:768px){.mobile{display:none!important}}.tablet{display:none}@media (min-width:768px) and (max-width:992px){.tablet{display:inherit!important}}@media (max-width:992px){.desktop{display:none!important}}@media (min-width:769px){.small-screen{display:none!important}}@media (max-width:768px){.large-screen{display:none!important}}.fit-content{max-width:fit-content!important;max-width:-moz-fit-content!important}.list-style-none{list-style:none!important}.m-0{margin:var(--distance-0)!important}.ml-0{margin-left:var(--distance-0)!important}.mr-0{margin-right:var(--distance-0)!important}.mt-0{margin-top:var(--distance-0)!important}.mb-0{margin-bottom:var(--distance-0)!important}.mx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.m-1{margin:var(--distance-1)!important}.m-2{margin:var(--distance-2)!important}.m-3{margin:var(--distance-3)!important}.m-4{margin:var(--distance-4)!important}.m-5{margin:var(--distance-5)!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.mx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.my-auto{margin-bottom:auto!important;margin-top:auto!important}.my-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.my-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.my-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.my-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.my-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.my-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mt-auto{margin-top:auto!important}.mt-1{margin-top:var(--distance-1)!important}.mt-2{margin-top:var(--distance-2)!important}.mt-3{margin-top:var(--distance-3)!important}.mt-4{margin-top:var(--distance-4)!important}.mt-5{margin-top:var(--distance-5)!important}.ml-auto{margin-left:auto!important}.ml-1{margin-left:var(--distance-1)!important}.ml-2{margin-left:var(--distance-2)!important}.ml-3{margin-left:var(--distance-3)!important}.ml-4{margin-left:var(--distance-4)!important}.ml-5{margin-left:var(--distance-5)!important}.mr-auto{margin-right:auto!important}.mr-1{margin-right:var(--distance-1)!important}.mr-2{margin-right:var(--distance-2)!important}.mr-3{margin-right:var(--distance-3)!important}.mr-4{margin-right:var(--distance-4)!important}.mr-5{margin-right:var(--distance-5)!important}.mb-auto{margin-bottom:auto!important}.mb-1{margin-bottom:var(--distance-1)!important}.mb-2{margin-bottom:var(--distance-2)!important}.mb-3{margin-bottom:var(--distance-3)!important}.mb-4{margin-bottom:var(--distance-4)!important}.mb-5{margin-bottom:var(--distance-5)!important}@media (min-width:768px) and (max-width:992px){.tm-0{margin:var(--distance-0)!important}.tml-0{margin-left:var(--distance-0)!important}.tmr-0{margin-right:var(--distance-0)!important}.tmt-0{margin-top:var(--distance-0)!important}.tmb-0{margin-bottom:var(--distance-0)!important}.tmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.tm-1{margin:var(--distance-1)!important}.tm-2{margin:var(--distance-2)!important}.tm-3{margin:var(--distance-3)!important}.tm-4{margin:var(--distance-4)!important}.tm-5{margin:var(--distance-5)!important}.tmx-auto{margin-left:auto!important;margin-right:auto!important}.tmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.tmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.tmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.tmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.tmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.tmy-auto{margin-bottom:auto!important;margin-top:auto!important}.tmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.tmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.tmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.tmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.tmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.tmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.tmt-auto{margin-top:auto!important}.tmt-1{margin-top:var(--distance-1)!important}.tmt-2{margin-top:var(--distance-2)!important}.tmt-3{margin-top:var(--distance-3)!important}.tmt-4{margin-top:var(--distance-4)!important}.tmt-5{margin-top:var(--distance-5)!important}.tml-auto{margin-left:auto!important}.tml-1{margin-left:var(--distance-1)!important}.tml-2{margin-left:var(--distance-2)!important}.tml-3{margin-left:var(--distance-3)!important}.tml-4{margin-left:var(--distance-4)!important}.tml-5{margin-left:var(--distance-5)!important}.tmr-auto{margin-right:auto!important}.tmr-1{margin-right:var(--distance-1)!important}.tmr-2{margin-right:var(--distance-2)!important}.tmr-3{margin-right:var(--distance-3)!important}.tmr-4{margin-right:var(--distance-4)!important}.tmr-5{margin-right:var(--distance-5)!important}.tmb-auto{margin-bottom:auto!important}.tmb-1{margin-bottom:var(--distance-1)!important}.tmb-2{margin-bottom:var(--distance-2)!important}.tmb-3{margin-bottom:var(--distance-3)!important}.tmb-4{margin-bottom:var(--distance-4)!important}.tmb-5{margin-bottom:var(--distance-5)!important}}@media (max-width:767px){.mm-0{margin:var(--distance-0)!important}.mml-0{margin-left:var(--distance-0)!important}.mmr-0{margin-right:var(--distance-0)!important}.mmt-0{margin-top:var(--distance-0)!important}.mmb-0{margin-bottom:var(--distance-0)!important}.mmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.mm-1{margin:var(--distance-1)!important}.mm-2{margin:var(--distance-2)!important}.mm-3{margin:var(--distance-3)!important}.mm-4{margin:var(--distance-4)!important}.mm-5{margin:var(--distance-5)!important}.mmx-auto{margin-left:auto!important;margin-right:auto!important}.mmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.mmy-auto{margin-bottom:auto!important;margin-top:auto!important}.mmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.mmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.mmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.mmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.mmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.mmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mmt-auto{margin-top:auto!important}.mmt-1{margin-top:var(--distance-1)!important}.mmt-2{margin-top:var(--distance-2)!important}.mmt-3{margin-top:var(--distance-3)!important}.mmt-4{margin-top:var(--distance-4)!important}.mmt-5{margin-top:var(--distance-5)!important}.mml-auto{margin-left:auto!important}.mml-1{margin-left:var(--distance-1)!important}.mml-2{margin-left:var(--distance-2)!important}.mml-3{margin-left:var(--distance-3)!important}.mml-4{margin-left:var(--distance-4)!important}.mml-5{margin-left:var(--distance-5)!important}.mmr-auto{margin-right:auto!important}.mmr-1{margin-right:var(--distance-1)!important}.mmr-2{margin-right:var(--distance-2)!important}.mmr-3{margin-right:var(--distance-3)!important}.mmr-4{margin-right:var(--distance-4)!important}.mmr-5{margin-right:var(--distance-5)!important}.mmb-auto{margin-bottom:auto!important}.mmb-1{margin-bottom:var(--distance-1)!important}.mmb-2{margin-bottom:var(--distance-2)!important}.mmb-3{margin-bottom:var(--distance-3)!important}.mmb-4{margin-bottom:var(--distance-4)!important}.mmb-5{margin-bottom:var(--distance-5)!important}}.p-0{padding:var(--distance-0)}.pl-0{padding-left:var(--distance-0)}.pr-0{padding-right:var(--distance-0)}.pt-0{padding-top:var(--distance-0)}.pb-0{padding-bottom:var(--distance-0)}.p-1{padding:var(--distance-1)}.p-2{padding:var(--distance-2)}.p-3{padding:var(--distance-3)}.p-4{padding:var(--distance-4)}.p-5{padding:var(--distance-5)}.px-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.px-auto{padding-left:auto;padding-right:auto}.px-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.px-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.px-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.px-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.px-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.py-auto{padding-bottom:auto;padding-top:auto}.py-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.py-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.py-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.py-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.py-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.py-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.pt-auto{padding-top:auto}.pt-1{padding-top:var(--distance-1)}.pt-2{padding-top:var(--distance-2)}.pt-3{padding-top:var(--distance-3)}.pt-4{padding-top:var(--distance-4)}.pt-5{padding-top:var(--distance-5)}.pl-auto{padding-left:auto}.pl-1{padding-left:var(--distance-1)}.pl-2{padding-left:var(--distance-2)}.pl-3{padding-left:var(--distance-3)}.pl-4{padding-left:var(--distance-4)}.pl-5{padding-left:var(--distance-5)}.pr-auto{padding-right:auto}.pr-1{padding-right:var(--distance-1)}.pr-2{padding-right:var(--distance-2)}.pr-3{padding-right:var(--distance-3)}.pr-4{padding-right:var(--distance-4)}.pr-5{padding-right:var(--distance-5)}.pb-auto{padding-bottom:auto}.pb-1{padding-bottom:var(--distance-1)}.pb-2{padding-bottom:var(--distance-2)}.pb-3{padding-bottom:var(--distance-3)}.pb-4{padding-bottom:var(--distance-4)}.pb-5{padding-bottom:var(--distance-5)}@media (min-width:768px) and (max-width:992px){.tp-0{padding:var(--distance-0)}.tpl-0{padding-left:var(--distance-0)}.tpr-0{padding-right:var(--distance-0)}.tpt-0{padding-top:var(--distance-0)}.tpb-0{padding-bottom:var(--distance-0)}.tpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.tp-1{padding:var(--distance-1)}.tp-2{padding:var(--distance-2)}.tp-3{padding:var(--distance-3)}.tp-4{padding:var(--distance-4)}.tp-5{padding:var(--distance-5)}.tpx-auto{padding-left:auto;padding-right:auto}.tpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.tpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.tpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.tpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.tpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.tpy-auto{padding-bottom:auto;padding-top:auto}.tpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.tpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.tpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.tpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.tpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.tpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.tpt-auto{padding-top:auto}.tpt-1{padding-top:var(--distance-1)}.tpt-2{padding-top:var(--distance-2)}.tpt-3{padding-top:var(--distance-3)}.tpt-4{padding-top:var(--distance-4)}.tpt-5{padding-top:var(--distance-5)}.tpl-auto{padding-left:auto}.tpl-1{padding-left:var(--distance-1)}.tpl-2{padding-left:var(--distance-2)}.tpl-3{padding-left:var(--distance-3)}.tpl-4{padding-left:var(--distance-4)}.tpl-5{padding-left:var(--distance-5)}.tpr-auto{padding-right:auto}.tpr-1{padding-right:var(--distance-1)}.tpr-2{padding-right:var(--distance-2)}.tpr-3{padding-right:var(--distance-3)}.tpr-4{padding-right:var(--distance-4)}.tpr-5{padding-right:var(--distance-5)}.tpb-auto{padding-bottom:auto}.tpb-1{padding-bottom:var(--distance-1)}.tpb-2{padding-bottom:var(--distance-2)}.tpb-3{padding-bottom:var(--distance-3)}.tpb-4{padding-bottom:var(--distance-4)}.tpb-5{padding-bottom:var(--distance-5)}}@media (max-width:767px){.mp-0{padding:var(--distance-0)}.mpl-0{padding-left:var(--distance-0)}.mpr-0{padding-right:var(--distance-0)}.mpt-0{padding-top:var(--distance-0)}.mpb-0{padding-bottom:var(--distance-0)}.mpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.mp-1{padding:var(--distance-1)}.mp-2{padding:var(--distance-2)}.mp-3{padding:var(--distance-3)}.mp-4{padding:var(--distance-4)}.mp-5{padding:var(--distance-5)}.mpx-auto{padding-left:auto;padding-right:auto}.mpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.mpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.mpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.mpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.mpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.mpy-auto{padding-bottom:auto;padding-top:auto}.mpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.mpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.mpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.mpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.mpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.mpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.mpt-auto{padding-top:auto}.mpt-1{padding-top:var(--distance-1)}.mpt-2{padding-top:var(--distance-2)}.mpt-3{padding-top:var(--distance-3)}.mpt-4{padding-top:var(--distance-4)}.mpt-5{padding-top:var(--distance-5)}.mpl-auto{padding-left:auto}.mpl-1{padding-left:var(--distance-1)}.mpl-2{padding-left:var(--distance-2)}.mpl-3{padding-left:var(--distance-3)}.mpl-4{padding-left:var(--distance-4)}.mpl-5{padding-left:var(--distance-5)}.mpr-auto{padding-right:auto}.mpr-1{padding-right:var(--distance-1)}.mpr-2{padding-right:var(--distance-2)}.mpr-3{padding-right:var(--distance-3)}.mpr-4{padding-right:var(--distance-4)}.mpr-5{padding-right:var(--distance-5)}.mpb-auto{padding-bottom:auto}.mpb-1{padding-bottom:var(--distance-1)}.mpb-2{padding-bottom:var(--distance-2)}.mpb-3{padding-bottom:var(--distance-3)}.mpb-4{padding-bottom:var(--distance-4)}.mpb-5{padding-bottom:var(--distance-5)}}hr{border-color:var(--hr-color);border-style:solid;border-width:0 0 .5px;margin-bottom:var(--default-distance)}button{background-color:var(--button-background);border:.5px solid var(--border-color);border-radius:2px;padding:.6rem 1.5rem}@supports (-moz-appearance:none){button{padding:.6rem 1.5rem .9rem}}button:active,button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}button.no-border{background-color:transparent!important;border:none!important}button:hover{background-color:var(--button-hover)!important;cursor:pointer}button.icon{color:var(--icon)!important;display:flex;flex-direction:column;padding:0;width:auto}button.icon:disabled{color:var(--icon-disabled)!important}button.icon:disabled:hover{background-color:transparent!important}button.primary{background-color:var(--primary)!important;border:0;color:var(--color-on-primary)!important}button.primary:hover{background-color:var(--primary-hover)!important}button.danger{background-color:var(--danger)!important;border:0;color:var(--color-on-danger)!important}button.danger:hover{background-color:var(--danger-hover)!important}button.accent{background-color:var(--accent)!important;border:0;color:var(--color-on-accent)!important}button.accent:hover{background-color:var(--accent-hover)!important}button.contrast{background-color:var(--contrast)!important;border:0;color:var(--color-on-contrast)!important}button.contrast:hover{background-color:var(--contrast-hover)!important}button.accent:active,button.accent:focus,button.contrast:active,button.contrast:focus,button.danger:active,button.danger:focus,button.primary:active,button.primary:focus{box-shadow:0 0 0 1px var(--button-outline-color)!important}button.accent.disabled,button.accent:disabled,button.contrast.disabled,button.contrast:disabled,button.danger.disabled,button.danger:disabled,button.primary.disabled,button.primary:disabled{color:var(--colored-disabled-button-color)!important;cursor:auto;outline:none}button.accent.disabled:not(.link),button.accent:disabled:not(.link),button.contrast.disabled:not(.link),button.contrast:disabled:not(.link),button.danger.disabled:not(.link),button.danger:disabled:not(.link),button.primary.disabled:not(.link),button.primary:disabled:not(.link){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.outline-hover:hover{background-color:transparent!important;outline:.5px solid var(--button-outline-color)!important}button.link{background-color:transparent!important;border:0;color:var(--primary)!important;padding:0}button.link.accent{color:var(--accent)!important}button.link.contrast{color:var(--contrast)!important}button.link.danger{color:var(--danger)!important}button.link:active,button.link:focus,button.link:hover{background-color:transparent!important;box-shadow:unset!important;text-decoration:underline!important}button.disabled,button:disabled{color:var(--disabled-button-color)!important;cursor:auto}button.disabled:not(.link):not(.icon),button:disabled:not(.link):not(.icon){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.disabled.link,button:disabled.link{color:var(--disabled-button-color)!important}button.disabled:hover,button:disabled:hover{outline:none;text-decoration:none}select{background-color:var(--background);border:.5px solid var(--input-border-color);outline:var(--primary) none 0;padding:.5rem}select:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}select:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-colour);cursor:auto}input,textarea{accent-color:var(--primary);border:.5px solid var(--input-border-color);border-radius:2px;min-height:3rem;outline:0 none currentcolor;padding:0 1rem}input:focus,textarea:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}input:invalid:not([invalid=false]):not([required]),input[invalid]:not([invalid=false]),textarea:invalid:not([invalid=false]):not([required]),textarea[invalid]:not([invalid=false]){border-color:var(--danger)}input:invalid:not([invalid=false]):not([required]):focus,input:invalid:not([invalid=false]):not([required]):hover,input[invalid]:not([invalid=false]):focus,input[invalid]:not([invalid=false]):hover,textarea:invalid:not([invalid=false]):not([required]):focus,textarea:invalid:not([invalid=false]):not([required]):hover,textarea[invalid]:not([invalid=false]):focus,textarea[invalid]:not([invalid=false]):hover{box-shadow:inset 1px 1px 0 var(--danger),inset -1px -1px 0 var(--danger)}input:disabled,textarea:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=checkbox],input[type=color],input[type=file],input[type=image],input[type=radio],input[type=range],textarea[type=checkbox],textarea[type=color],textarea[type=file],textarea[type=image],textarea[type=radio],textarea[type=range]{border:none;min-height:unset;padding-left:0}input[type=checkbox]:focus-visible,input[type=radio]:focus-visible,textarea[type=checkbox]:focus-visible,textarea[type=radio]:focus-visible{outline:var(--button-outline-color) dashed .1rem;outline-offset:.1rem}input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{border:0;padding:.6rem 1.5rem}@supports (-moz-appearance:none){input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{padding:.6rem 1.5rem .9rem}}input[type=button]:hover,input[type=reset]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=reset]:hover,textarea[type=submit]:hover{background-color:var(--button-hover);cursor:pointer}input[type=button]:active,input[type=button]:focus,input[type=reset]:active,input[type=reset]:focus,input[type=submit]:active,input[type=submit]:focus,textarea[type=button]:active,textarea[type=button]:focus,textarea[type=reset]:active,textarea[type=reset]:focus,textarea[type=submit]:active,textarea[type=submit]:focus{box-shadow:0 0 0 2px var(--button-outline-color);cursor:pointer;outline:none}input[type=button]:disabled,input[type=button]:hover:disabled,input[type=reset]:disabled,input[type=reset]:hover:disabled,input[type=submit]:disabled,input[type=submit]:hover:disabled,textarea[type=button]:disabled,textarea[type=button]:hover:disabled,textarea[type=reset]:disabled,textarea[type=reset]:hover:disabled,textarea[type=submit]:disabled,textarea[type=submit]:hover:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=reset],textarea[type=reset]{background-color:var(--background);border:.5px solid var(--border-color)}input[type=reset]:active,input[type=reset]:focus,textarea[type=reset]:active,textarea[type=reset]:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}input[type=button],input[type=submit],textarea[type=button],textarea[type=submit]{background-color:var(--primary);color:var(--color-on-primary)}input[type=button]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=submit]:hover{background-color:var(--primary-hover)}input[type=color],input[type=file],input[type=range],textarea[type=color],textarea[type=file],textarea[type=range]{border:none}input[type=color]:focus,input[type=file]:focus,input[type=range]:focus,textarea[type=color]:focus,textarea[type=file]:focus,textarea[type=range]:focus{box-shadow:none;outline:var(--primary) solid 2px;outline-offset:2px}input[type=file]::-webkit-file-upload-button,input[type=file]::file-selector-button,textarea[type=file]::-webkit-file-upload-button,textarea[type=file]::file-selector-button{background-color:var(--primary);border:0;border-radius:2px;color:var(--color-on-primary);padding:.6rem 1.5rem}input[type=file]:active::-webkit-file-upload-button,input[type=file]:active::file-selector-button,textarea[type=file]:active::-webkit-file-upload-button,textarea[type=file]:active::file-selector-button{box-shadow:inset 0 0 0 2px var(--button-outline-color)}input[type=file]:hover::-webkit-file-upload-button,input[type=file]:hover::file-selector-button,textarea[type=file]:hover::-webkit-file-upload-button,textarea[type=file]:hover::file-selector-button{background-color:var(--primary-hover);cursor:pointer}input[type=file]:focus,textarea[type=file]:focus{outline:var(--button-outline-color) solid .2rem;outline-offset:.1rem}input[type=color],textarea[type=color]{background-color:transparent;padding:0;width:8rem}input[type=range],textarea[type=range]{appearance:none;-webkit-appearance:none;background:transparent;padding:0}input[type=range]::-moz-range-thumb,textarea[type=range]::-moz-range-thumb{background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.2rem;width:1.2rem}input[type=range]::-moz-range-track,textarea[type=range]::-moz-range-track{background-color:var(--range-track-color);height:.3rem}input[type=range]::-moz-range-progress,textarea[type=range]::-moz-range-progress{background-color:var(--range-filled-track-color);height:.3rem}input[type=range]::-webkit-slider-thumb,textarea[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.6rem;margin-top:-6px;width:1.6rem}input[type=range]::-webkit-slider-runnable-track,textarea[type=range]::-webkit-slider-runnable-track{background:var(--range-track-color);border:none;border-radius:3px;height:3px}input[type=range]:focus,input[type=range]:hover,textarea[type=range]:focus,textarea[type=range]:hover{background:transparent;outline:none}input[type=range]:focus::-moz-range-progress,input[type=range]:hover::-moz-range-progress,textarea[type=range]:focus::-moz-range-progress,textarea[type=range]:hover::-moz-range-progress{background-color:var(--primary)}input[type=range]:focus::-moz-range-thumb,input[type=range]:hover::-moz-range-thumb,textarea[type=range]:focus::-moz-range-thumb,textarea[type=range]:hover::-moz-range-thumb{border:2px solid var(--primary)}input[type=range]:focus::-webkit-slider-runnable-track,input[type=range]:hover::-webkit-slider-runnable-track,textarea[type=range]:focus::-webkit-slider-runnable-track,textarea[type=range]:hover::-webkit-slider-runnable-track{background-color:var(--primary)}input[type=range]:focus::-webkit-slider-thumb,input[type=range]:hover::-webkit-slider-thumb,textarea[type=range]:focus::-webkit-slider-thumb,textarea[type=range]:hover::-webkit-slider-thumb{border:2px solid var(--primary)}input[type=range]:disabled:focus,input[type=range]:disabled:hover,textarea[type=range]:disabled:focus,textarea[type=range]:disabled:hover{background:transparent;outline:none}input[type=range]:disabled:focus::-moz-range-progress,input[type=range]:disabled:hover::-moz-range-progress,textarea[type=range]:disabled:focus::-moz-range-progress,textarea[type=range]:disabled:hover::-moz-range-progress{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-moz-range-thumb,input[type=range]:disabled:hover::-moz-range-thumb,textarea[type=range]:disabled:focus::-moz-range-thumb,textarea[type=range]:disabled:hover::-moz-range-thumb{border:2px solid var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-runnable-track,input[type=range]:disabled:hover::-webkit-slider-runnable-track,textarea[type=range]:disabled:focus::-webkit-slider-runnable-track,textarea[type=range]:disabled:hover::-webkit-slider-runnable-track{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-thumb,input[type=range]:disabled:hover::-webkit-slider-thumb,textarea[type=range]:disabled:focus::-webkit-slider-thumb,textarea[type=range]:disabled:hover::-webkit-slider-thumb{border:2px solid var(--range-filled-track-color)}input.underline,textarea.underline{background-color:transparent;border-left:0;border-radius:0;border-right:0;border-top:0;padding:0}input.underline:focus,textarea.underline:focus{box-shadow:none}input.underline:focus,input.underline:hover,textarea.underline:focus,textarea.underline:hover{border-color:var(--primary);box-shadow:inset 0 -1px 0 var(--primary)}input.underline:disabled:focus,input.underline:disabled:hover,input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover{border-left:0;border-right:0;border-top:0;box-shadow:none}input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,input.underline[invalid]:not([invalid=false]):focus,input.underline[invalid]:not([invalid=false]):hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline[invalid]:not([invalid=false]):focus,textarea.underline[invalid]:not([invalid=false]):hover{border-color:var(--danger);box-shadow:inset 0 -1px 0 var(--danger)}input.underline:disabled:focus,input.underline:disabled:hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover{border-color:var(--disabled-button-background)}a{color:var(--primary)}a:active,a:focus,a:focus-visible,a:hover{outline:unset}a.accent{color:var(--accent)}a.danger{color:var(--danger)}a.contrast{color:var(--contrast)}a.button{background-color:transparent;border-radius:2px;color:var(--button-color);display:inline-block;padding:.9rem 1.5rem;text-align:center;text-decoration:none}a.button.normal{border:.5px solid var(--border-color)}a.button.normal.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--disabled-button-color);cursor:default}a.button:hover{background-color:var(--button-hover);cursor:pointer}a.button:active,a.button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}a.button.primary{background-color:var(--primary);border:0;color:var(--color-on-primary)}a.button.primary:hover{background-color:var(--primary-hover)}a.button.danger{background-color:var(--danger);border:0;color:var(--color-on-danger)}a.button.danger:hover{background-color:var(--danger-hover)}a.button.accent{background-color:var(--accent);border:0;color:var(--color-on-accent)}a.button.accent:hover{background-color:var(--accent-hover)}a.button.contrast{background-color:var(--contrast);border:0;color:var(--color-on-contrast)}a.button.contrast:hover{background-color:var(--contrast-hover)}a.button.accent:active,a.button.accent:focus,a.button.contrast:active,a.button.contrast:focus,a.button.danger:active,a.button.danger:focus,a.button.primary:active,a.button.primary:focus{box-shadow:0 0 0 2px var(--button-outline-color)}a.button.accent.disabled,a.button.contrast.disabled,a.button.danger.disabled,a.button.primary.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--colored-disabled-button-color);cursor:default}table{border-collapse:collapse}table td,table th{padding:.5rem 2.5rem .6rem .5rem;text-align:left;vertical-align:top}table:not(.no-hover) tbody tr:hover{background-color:var(--table-hover)}table.table tbody tr,table.table thead{border-bottom:.5px solid var(--border-color)}table.table tbody tr{border-color:var(--light)}table.table tfoot{font-size:small;font-style:italic}table.sticky-header>thead{background-color:var(--background);border-bottom:0;-webkit-box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);position:sticky;position:-webkit-sticky;top:0;white-space:nowrap;z-index:2}table.striped tbody tr:nth-child(odd){background-color:var(--table-stripe)}table.striped tbody tr:hover{background-color:var(--table-striped-hover)}.table-container{border:.5px solid var(--border-color);border-color:var(--light);display:inline-block;overflow-x:hidden;overflow-y:auto;width:fit-content}@-moz-document url-prefix(){.table-container{padding-right:1.7rem}}.cursor-not-allowed:hover{cursor:not-allowed!important}.cursor-pointer{-webkit-user-select:none;-ms-user-select:none;user-select:none}.cursor-pointer:hover{cursor:pointer!important}.cursor-grab:hover{cursor:grab!important}.cursor-grabbing:hover{cursor:grabbing!important}.cursor-zoom-in:hover{cursor:zoom-in!important}.cursor-zoom-out:hover{cursor:zoom-out!important}.cursor-wait:hover{cursor:wait!important}.cursor-help:hover{cursor:help!important}.cursor-default,.cursor-default:hover{cursor:default!important}.cursor-no-select{-webkit-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.border{border:.5px solid var(--border-color)}.border-bottom{border-bottom:.5px solid var(--border-color)}.border-top{border-top:.5px solid var(--border-color)}.border-right{border-right:.5px solid var(--border-color)}.border-left{border-left:.5px solid var(--border-color)}.border-black{border-color:var(--black)}.border-white{border-color:var(--white)}.border-primary{border-color:var(--primary)}.border-accent{border-color:var(--accent)}.border-danger{border-color:var(--danger)}.border-light{border-color:var(--light)}.border-success{border-color:var(--icon-success)}html{background-color:var(--html-background)!important}.bg-gray-light{background-color:var(--gray-light)!important;color:var(--color-on-gray-light)!important}.bg-gray{background-color:var(--gray)!important;color:var(--color-on-gray)!important}.bg-gray-dark{background-color:var(--gray-dark)!important;color:var(--color-on-gray-dark)!important}.bg-black{background-color:var(--black)!important;color:var(--color-on-black)!important}.bg-white{background-color:var(--white)!important;color:var(--font-color)!important}.bg-primary{background-color:var(--primary)!important;color:var(--color-on-primary)!important}.bg-accent{background-color:var(--accent)!important;color:var(--color-on-accent)!important}.bg-danger{background-color:var(--danger)!important;color:var(--color-on-danger)!important}.bg-success{background-color:var(--success)!important;color:var(--color-on-success)!important}.bg-error{background-color:var(--error)!important;color:var(--color-on-error)!important}.bg-warning{background-color:var(--warning)!important;color:var(--color-on-warning)!important}.bg-transparent{background-color:transparent!important}.text-black{color:var(--black)!important}.text-white{color:var(--white)!important}.text-gray{color:var(--gray-darker)!important}.text-primary{color:var(--primary)!important}.text-accent{color:var(--accent)!important}.text-danger{color:var(--danger)!important}.text-success{color:var(--icon-success)!important}.icon-gray{color:var(--gray)!important}.icon-gray-dark{color:var(--gray-dark)!important}.icon-success{color:var(--icon-success)!important}.icon-primary{color:var(--primary)!important}.icon-accent{color:var(--accent)!important}.icon-danger{color:var(--danger)!important}.icon-black{color:var(--black)!important}.icon-white{color:var(--white)!important}.shadow{box-shadow:0 .6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-top{box-shadow:0 -1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 -.3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-left{box-shadow:-1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-right{box-shadow:1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),-.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-bottom{box-shadow:0 1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-lg{box-shadow:0 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-top-lg{box-shadow:0 -3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-bottom-lg{box-shadow:0 3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-left-lg{box-shadow:-3px 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-right-lg{box-shadow:3px 0 5px 0 rgba(var(--shadow-color),.132)!important} \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.7/flightkit.min.js b/docs/cdn/ibiss-v0.0.7/flightkit.min.js new file mode 100644 index 0000000..984097a --- /dev/null +++ b/docs/cdn/ibiss-v0.0.7/flightkit.min.js @@ -0,0 +1 @@ +!function(){"use strict";function i(e,t){if(!t||0===t.length)return e;const s=Object.assign([],e);if(Array.isArray(s[0])){e=s;var n=t;const r=[];for(const i of e)r.push(i.sort(E(n)));r}else s.sort(E(t));return s}function y(e){let t=e.toString();e=t.match(/^\d+|\d+$/);return e?parseInt(e[0]):null}function b(e){return"boolean"==typeof e||"string"==typeof e&&("true"===(e=e.toLocaleLowerCase())||"false"===e)}function w(e){return"boolean"==typeof e?e:"true"===e.toLocaleLowerCase()}function E(f,v=0){return function(e,t){var{propertyName:s,direction:d}=f[v];let n=null===e[s]||void 0===e[s]?"":e[s],r=null===t[s]||void 0===t[s]?"":t[s];const h=/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim;var s=n instanceof Date&&r instanceof Date||h.test(n)&&h.test(r),p=(s&&(n=n instanceof Date?n.valueOf():new Date(Date.parse(n)),r=r instanceof Date?r.valueOf():new Date(Date.parse(r))),b(n)&&b(r)),u=!p&&!isNaN(n)&&!isNaN(r),i=y(n),o=y(r);u?(n=parseFloat(n).toPrecision(12),r=parseFloat(r).toPrecision(12)):null!==i&&null!==o&&(n=parseFloat(i).toPrecision(12),r=parseFloat(o).toPrecision(12)),p&&(n=w(n),r=w(r));let a,l;switch(d){case"descending":case"desc":a=r,l=n;break;default:a=n,l=r}let c=0;if(p||s||u)c=a-l;else{a=a.toString().trim().toLowerCase(),l=l.toString().trim().toLowerCase();const m=/\d/gim;i=m.test(n)&&m.test(r);c=i?a.localeCompare(l,void 0,{numeric:!0,sensitivity:"base"}):a.localeCompare(l)}o=v+1;if(0===c&&o(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(s,i,t.getAttribute(n))}}var r=Object.keys(t.classList).length;if(r){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=p(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const r of s.split("."))n=(n||window)[r];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const n of document.querySelectorAll(s.selector))this._addEventToElement(s,n);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const m='',g='';function l(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class e extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=e}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const r of e.split(",")){var t=r.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const n=p(e).target,r=(t?n._selectedIds.add(s):n._selectedIds.delete(s),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[r]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=p(e).target,s=u(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=n[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const r=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),r.append(i),t.append(r)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var s=this.createRow(n,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const r=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class t extends HTMLElement{base;componentId;constructor(){super(),this.base=new r}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const r=document.createElement("div");r.innerHTML=this.innerHTML,this.component=r;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=p(e,"flk-draggable").target;let n,r;function t(e){n=e.clientX-s.offsetLeft,r=e.clientY-s.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-r;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class s extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new r}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=p(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var r=this.getAttribute("modal-title");if(r){const c=document.createElement("span");c.innerText=r,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");r=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=r,n.append(a),s.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+r,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class n extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new r}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var n=l('');const r=l(''),i=(r.classList.add("hidden"),s.append(n,r),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=p(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,n=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=n||t.offsetWidth+"px",t._iconId);const r=document.getElementById(n);e?(r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")):(r.childNodes[0].classList.add("hidden"),r.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=p(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const n of e)s._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const r of e)r._closeDropdown()}}class o extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const n of t.split(","))s=s.concat(n.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new r,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=p(e,"flk-tree-nav").target,s=u(e,"branchKey");let n=t.contents;const d=s.split(".");for(const o of d)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}let r,i=e.target;for(;i.dataset&&i.dataset.leafKey?r=i.dataset.leafKey:i=i.parentNode||i.parentElement,!r;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:r,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let n="",r="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,n=this.convertJsonKeyToTitle(e.substring(0,s)),r=e.substring(s)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:r}}createTextTag(n,r){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=n.titleText,document.createElement("small"));s.innerText=n.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",r.append(e)}else r.innerText=n.titleText}createLeaf(e,t,s,n=[]){let r=document.createElement("li");r.classList.add("cursor-no-select"),r.style.marginTop="0.4rem",r.dataset.branchKey=s;const i="file"===this.iconSet?'':'';r.style.listStyleImage=`url('data:image/svg+xml,${i}')`,r.style.position="relative",r.style.left="2px";let o=document.createElement("span");s=[e].concat(n);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",r.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?m:g;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(r),t.append(e)}else t.append(r)}createBranch(s,t,n,r){if(r===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,n+"."+e,r+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,n+"."+l,r+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?m:g;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(s,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?m:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",e),customElements.define("flk-draggable",t),customElements.define("flk-modal",s),customElements.define("flk-dropdown",n),customElements.define("flk-tree-nav",o)}(); \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.7/htmx-ibiss-ui.min.js b/docs/cdn/ibiss-v0.0.7/htmx-ibiss-ui.min.js new file mode 100644 index 0000000..c035056 --- /dev/null +++ b/docs/cdn/ibiss-v0.0.7/htmx-ibiss-ui.min.js @@ -0,0 +1 @@ +!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";htmx.defineExtension("ibiss-ui",{onEvent:function(t,e){if("htmx:beforeRequest"===t){const{target:i,detail:n}=e;t=i.getAttribute("ibiss-router");if(window[t]&&"function"==typeof window[t])return window[t](i,n,e),!1}}})}); \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.7/rocket.min.js b/docs/cdn/ibiss-v0.0.7/rocket.min.js new file mode 100644 index 0000000..0a7f9d0 --- /dev/null +++ b/docs/cdn/ibiss-v0.0.7/rocket.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).rocketjs=t()}(this,function(){"use strict";function y(e,t){let r=0,l=e.indexOf(t);for(;-1!==l;)r++,l=e.indexOf(t,l+1);return r}function e(){return{sequence:"",match:!1}}function v(e,t,r){let l=r.sequence;return l.length===t.length&&(l=l.substring(1)),l+=e,r.sequence=l,r.match=l===t,r}class g{static getTemplates(t,r,l){if(r.length!==l.length)throw new Error("Template start is not the same length as template end");var g=t.length;let a=e(),o=e(),n=0,s=0,i=[],p=[];const u=[];for(let e=0;ee.replace(new RegExp(t,"g"),r));return l=l.replace(/if([\s\S]+?)\s|is|not/gm,e=>e.replace(new RegExp(t,"g"),r)),l=l.replace(/(of|in)([\s\S]+?)(?=<|{)/gm,e=>e.replace(new RegExp(t,"g"),r)),l}}class o{static resolvePartials(e,t){let r=e;for(const a of g.getTemplates(e,"{{#","#}}")){var l=g.getInnerTemplate(a),l=g.getPropertyValue(l,t);let e=l?l:"";r=r.replace(a,e)}if(r.includes("{{#")){if(e===r)return r;r=o.resolvePartials(r,t)}return r}}class s{static interpolateTemplate(e,r){let l=e;for(const n of g.getTemplates(e,"{{","}}")){let e=g.getInnerTemplate(n,2);var a="!"===e[0],o=(a&&(e=e.substr(1).trim()),g.getPropertyValue(e,r));let t=o?o:"";t=Array.isArray(t)?t.join(", "):t.toString().trim();o=a?s.escapeHtml(t):t;l=l.replace(n,o)}return l}static escapeHtml(e){return e=(e=(e=(e=(e=e.replace(/&/gm,"&")).replace(//gm,">")).replace(/"/gm,""")).replace(/\//gm,"'")}}class r{static buildTemplate(e,t){e=o.resolvePartials(e,t),e=class{static resolveWrapper(e){let t=e;for(const o of g.getTemplates(e,"{{$","$}}")){var r=g.getWrapperProperty(o),l=g.getTemplates(r.templateToFill,"{{","}}"),l=g.getToplevelTemplates(l);let e=r.templateToFill;for(const n of l){var a=g.getProperty(n);e=e.replace(new RegExp(a,"g"),r.property+"."+a)}t=t.replace(o,e)}return t}}.resolveWrapper(e);return e=c.resolveLoop(e,t),class{static resolveConditional(e,l){let a=e;for(const p of g.getTemplates(e,"{{~","~}}")){const c=g.getConditionalLogic(p);var o=c.property,n=c.logiclessTemplate,s=c.truthy,i=!c.truthy;let e="",t=(c.comparison&&(e=c.comparison),""),r=g.getPropertyValue(o,l);r&&(r=Array.isArray(r)?r:r.toString().trim().toLocaleLowerCase(),e=c.comparison?c.comparison.toLocaleLowerCase():null),e?(s&&(t=r===e?n:""),i&&(t=r!==e?n:"")):t="false"===r||!r||Array.isArray(r)&&!r.length?"":n,a=a.replace(p,t)}return a}}.resolveConditional(e,t)}static interpolateTemplate(e,t){return s.interpolateTemplate(e,t)}static render(e,t){e=r.buildTemplate(e,t);return r.interpolateTemplate(e,t)}}return r}); \ No newline at end of file diff --git a/docs/js/flightkit.min.js b/docs/js/flightkit.min.js index 330a84f..984097a 100644 --- a/docs/js/flightkit.min.js +++ b/docs/js/flightkit.min.js @@ -1 +1 @@ -!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file +!function(){"use strict";function i(e,t){if(!t||0===t.length)return e;const s=Object.assign([],e);if(Array.isArray(s[0])){e=s;var n=t;const r=[];for(const i of e)r.push(i.sort(E(n)));r}else s.sort(E(t));return s}function y(e){let t=e.toString();e=t.match(/^\d+|\d+$/);return e?parseInt(e[0]):null}function b(e){return"boolean"==typeof e||"string"==typeof e&&("true"===(e=e.toLocaleLowerCase())||"false"===e)}function w(e){return"boolean"==typeof e?e:"true"===e.toLocaleLowerCase()}function E(f,v=0){return function(e,t){var{propertyName:s,direction:d}=f[v];let n=null===e[s]||void 0===e[s]?"":e[s],r=null===t[s]||void 0===t[s]?"":t[s];const h=/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim;var s=n instanceof Date&&r instanceof Date||h.test(n)&&h.test(r),p=(s&&(n=n instanceof Date?n.valueOf():new Date(Date.parse(n)),r=r instanceof Date?r.valueOf():new Date(Date.parse(r))),b(n)&&b(r)),u=!p&&!isNaN(n)&&!isNaN(r),i=y(n),o=y(r);u?(n=parseFloat(n).toPrecision(12),r=parseFloat(r).toPrecision(12)):null!==i&&null!==o&&(n=parseFloat(i).toPrecision(12),r=parseFloat(o).toPrecision(12)),p&&(n=w(n),r=w(r));let a,l;switch(d){case"descending":case"desc":a=r,l=n;break;default:a=n,l=r}let c=0;if(p||s||u)c=a-l;else{a=a.toString().trim().toLowerCase(),l=l.toString().trim().toLowerCase();const m=/\d/gim;i=m.test(n)&&m.test(r);c=i?a.localeCompare(l,void 0,{numeric:!0,sensitivity:"base"}):a.localeCompare(l)}o=v+1;if(0===c&&o(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(s,i,t.getAttribute(n))}}var r=Object.keys(t.classList).length;if(r){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=p(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const r of s.split("."))n=(n||window)[r];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const n of document.querySelectorAll(s.selector))this._addEventToElement(s,n);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const m='',g='';function l(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class e extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=e}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const r of e.split(",")){var t=r.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const n=p(e).target,r=(t?n._selectedIds.add(s):n._selectedIds.delete(s),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[r]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=p(e).target,s=u(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=n[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const r=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),r.append(i),t.append(r)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var s=this.createRow(n,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const r=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class t extends HTMLElement{base;componentId;constructor(){super(),this.base=new r}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const r=document.createElement("div");r.innerHTML=this.innerHTML,this.component=r;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=p(e,"flk-draggable").target;let n,r;function t(e){n=e.clientX-s.offsetLeft,r=e.clientY-s.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-r;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class s extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new r}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=p(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var r=this.getAttribute("modal-title");if(r){const c=document.createElement("span");c.innerText=r,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");r=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=r,n.append(a),s.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+r,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class n extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new r}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var n=l('');const r=l(''),i=(r.classList.add("hidden"),s.append(n,r),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=p(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,n=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=n||t.offsetWidth+"px",t._iconId);const r=document.getElementById(n);e?(r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")):(r.childNodes[0].classList.add("hidden"),r.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=p(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const n of e)s._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const r of e)r._closeDropdown()}}class o extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const n of t.split(","))s=s.concat(n.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new r,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=p(e,"flk-tree-nav").target,s=u(e,"branchKey");let n=t.contents;const d=s.split(".");for(const o of d)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}let r,i=e.target;for(;i.dataset&&i.dataset.leafKey?r=i.dataset.leafKey:i=i.parentNode||i.parentElement,!r;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:r,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let n="",r="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,n=this.convertJsonKeyToTitle(e.substring(0,s)),r=e.substring(s)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:r}}createTextTag(n,r){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=n.titleText,document.createElement("small"));s.innerText=n.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",r.append(e)}else r.innerText=n.titleText}createLeaf(e,t,s,n=[]){let r=document.createElement("li");r.classList.add("cursor-no-select"),r.style.marginTop="0.4rem",r.dataset.branchKey=s;const i="file"===this.iconSet?'':'';r.style.listStyleImage=`url('data:image/svg+xml,${i}')`,r.style.position="relative",r.style.left="2px";let o=document.createElement("span");s=[e].concat(n);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",r.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?m:g;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(r),t.append(e)}else t.append(r)}createBranch(s,t,n,r){if(r===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,n+"."+e,r+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,n+"."+l,r+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?m:g;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(s,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?m:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",e),customElements.define("flk-draggable",t),customElements.define("flk-modal",s),customElements.define("flk-dropdown",n),customElements.define("flk-tree-nav",o)}(); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.7/avian.min.css b/documentation/public/cdn/ibiss-v0.0.7/avian.min.css new file mode 100644 index 0000000..53c6f0a --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.7/avian.min.css @@ -0,0 +1 @@ +:root{--html-background:#faf9f8;--background:#fff;--code-background:#f3f2f1;--overlay-background:0,0,0;--color-on-black:#c8c6c4;--font-color:#323130;--shadow-color:0,0,0;--hr-color:#d2d0ce;--border-color:#8a8886;--gray-light:#edebe9;--color-on-gray-light:#000;--gray:#a19f9d;--color-on-gray:#000;--gray-dark:#605e5c;--color-on-gray-dark:#faf9f8;--gray-darker:#8a8886;--light:#d2d0ce;--black:#000;--white:#fff;--icon:#605e5c;--icon-disabled:#a19f9d;--icon-error:#a80000;--icon-success:#107c10;--icon-warning:#797673;--primary:#0078d4;--primary-hover:#0068b8;--color-on-primary:#fff;--accent:#fce100;--accent-hover:#e6cf00;--color-on-accent:#000;--danger:#d13438;--danger-hover:#bb2a2f;--color-on-danger:#fff;--warning:#fff4ce;--color-on-warning:#323130;--error:#fde7e9;--color-on-error:#323130;--success:#dff6dd;--color-on-success:#323130;--contrast:#ccc;--contrast-hover:#b2b2b2;--color-on-contrast:#000;--disabled:#d2d0ce;--color-on-disabled:#a19f9d;--button-background:#fff;--button-hover:#e1dfdd;--button-outline-color:#000;--button-color:#000;--disabled-button-background:#f3f2f1;--disabled-button-color:#a19f9d;--colored-disabled-button-color:#d2d0ce;--input-border-color:#605e5c;--input-hover:#c8c6c4;--range-track-color:#c8c6c4;--range-filled-track-color:#605e5c;--range-track-hover-color:#e0f2ff;--switch-border-color:#000;--switch-toggle-off-color:#000;--switch-toggle-on-color:#fff;--table-hover:#e1dfdd;--table-striped-hover:#d2d0ce;--table-stripe:#edebe9;--default-distance:1.5rem;--distance-0:0;--distance-1:0.5rem;--distance-2:1rem;--distance-3:1.5rem;--distance-4:2rem;--distance-5:2.5rem;--h1-font-size:3.2rem;--h2-font-size:3rem;--h3-font-size:2.8rem;--h4-font-size:2.6rem;--h5-font-size:2.4rem;--h6-font-size:2.2rem;--th-font-size:2.2rem;--paragraph-font-size:1.6rem;--label-font-size:1.6rem;--small-font-size:1.2rem;--font-weight-normal:400;--font-weight-semibold:600;--font-weight-bold:700}*,:after,:before{box-sizing:border-box;font:inherit;font-weight:var(--font-weight-normal);margin:0;padding:0}html{font-size:62.5%;hanging-punctuation:first last}body{font-family:Segoe UI,"Segoe UI Web (West European)",-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif;font-size:1.6rem;height:100svh;line-height:1.5;text-rendering:optimizeSpeed}h1,h2,h3,h4,h5,h6{text-wrap:balance}p{text-wrap:pretty;max-width:75ch}ol,ul{margin-left:2rem}img,picture{display:block;max-width:100%}.lucide{left:2px;position:relative;top:3px}@media (prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,:after,:before{animation-duration:.01ms;animation-iteration-count:1;scroll-behavior:auto;transition-duration:.01ms}}@media (prefers-reduced-motion:no-preference){:has(:target),html{scroll-behavior:smooth;scroll-padding-top:3rem}}h1{font-size:var(--h1-font-size)}h1,h2{font-weight:var(--font-weight-bold)}h2{font-size:var(--h2-font-size)}h3{font-size:var(--h3-font-size);font-weight:var(--font-weight-bold)}h4{font-size:var(--h4-font-size)}h4,h5{font-weight:var(--font-weight-semibold)}h5{font-size:var(--h5-font-size)}h6{font-size:var(--h6-font-size);font-weight:var(--font-weight-semibold)}p{font-size:var(--paragraph-font-size)}label{font-size:var(--label-font-size)}small{font-size:var(--small-font-size)}b,strong{font-weight:var(--font-weight-bold)}cite,em,i{font-style:italic}code:not([class*=language]),kbd{background-color:var(--code-background);border:.5px solid var(--border-color);border-radius:.2rem;bottom:.1rem;margin:0 .2rem;padding:.2rem .4rem;position:relative}mark{background-color:var(--accent)}th{font-size:var(--th-font-size);font-weight:var(--font-weight-semibold)}.font-size-68{font-size:6.8rem!important}.font-size-42{font-size:4.2rem!important}.font-size-32{font-size:3.2rem!important}.font-size-28{font-size:2.8rem!important}.font-size-24{font-size:2.4rem!important}.font-size-20{font-size:2rem!important}.font-size-18{font-size:1.8rem!important}.font-size-16{font-size:1.6rem!important}.font-size-14{font-size:1.4rem!important}.font-size-12{font-size:1.2rem!important}.font-size-10{font-size:1rem!important}.font-weight-normal{font-weight:400!important}.font-weight-semibold{font-weight:600!important}.font-weight-bold{font-weight:700!important}.align-center{align-items:center}.align-end{align-items:flex-end}.align-start{align-items:flex-start}.align-stretch{align-items:stretch}.align-between{align-content:space-between}.align-around{align-content:space-around}.align-evenly{align-content:space-evenly}.self-align-stretch{align-self:stretch}.self-align-center{align-self:center}.self-align-start{align-self:flex-start}.self-align-end{align-self:flex-end}.row{display:flex;flex-wrap:wrap}.column{display:flex;flex-direction:column}.no-wrap{flex-wrap:nowrap}.wrap-reverse{flex-wrap:wrap-reverse}.row-reverse{flex-direction:row-reverse}.column-reverse{flex-direction:column-reverse}@media (min-width:993px){.drow-reverse{flex-direction:row-reverse}.dcolumn-reverse{flex-direction:column-reverse}}@media (min-width:768px) and (max-width:992px){.trow-reverse{flex-direction:row-reverse}.tcolumn-reverse{flex-direction:column-reverse}}@media (max-width:767px){.mrow-reverse{flex-direction:row-reverse}.mcolumn-reverse{flex-direction:column-reverse}}.gap-0{gap:var(--distance-0)}.gap-1{gap:var(--distance-1)}.gap-2{gap:var(--distance-2)}.gap-3{gap:var(--distance-3)}.gap-4{gap:var(--distance-4)}.gap-5{gap:var(--distance-5)}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.justify-evenly{justify-content:space-evenly}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.justify-start{justify-content:flex-start}.f-100{flex:1 1 100%}.f-90{flex:0 0 90%}.f-80{flex:0 0 80%}.f-75{flex:0 0 75%}.f-70{flex:0 0 70%}.f-60{flex:0 0 60%}.f-50{flex:0 0 50%}.f-33{flex:0 0 33.33%}.f-30{flex:0 0 30%}.f-25{flex:0 0 25%}.f-20{flex:0 0 20%}.f-16{flex:0 0 16.67%}.f-10{flex:0 0 10%}.f-8{flex:0 0 8.33%}.f-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.f-fill{flex:1;max-width:none;min-width:auto;width:100%}@media (min-width:768px) and (max-width:992px){.tf-100{flex:1 1 100%}.tf-90{flex:0 0 90%}.tf-80{flex:0 0 80%}.tf-75{flex:0 0 75%}.tf-70{flex:0 0 70%}.tf-60{flex:0 0 60%}.tf-50{flex:0 0 50%}.tf-33{flex:0 0 33.33%}.tf-30{flex:0 0 30%}.tf-25{flex:0 0 25%}.tf-20{flex:0 0 20%}.tf-16{flex:0 0 16.67%}.tf-10{flex:0 0 10%}.tf-8{flex:0 0 8.33%}.tf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.tf-fill{flex:1;max-width:none;min-width:auto;width:100%}}@media (max-width:767px){.mf-100{flex:1 1 100%}.mf-90{flex:0 0 90%}.mf-80{flex:0 0 80%}.mf-75{flex:0 0 75%}.mf-70{flex:0 0 70%}.mf-60{flex:0 0 60%}.mf-50{flex:0 0 50%}.mf-33{flex:0 0 33.33%}.mf-30{flex:0 0 30%}.mf-25{flex:0 0 25%}.mf-20{flex:0 0 20%}.mf-16{flex:0 0 16.67%}.mf-10{flex:0 0 10%}.mf-8{flex:0 0 8.33%}.mf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.mf-fill{flex:1;max-width:none;min-width:auto;width:100%}}.no-scroll{overflow:hidden}.text-no-wrap{white-space:nowrap}.text-normal{font-weight:400}.sticky{height:auto;position:sticky;position:-webkit-sticky;top:0;z-index:1000}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.block{display:block}.hidden{display:none}@media (min-width:768px){.mobile{display:none!important}}.tablet{display:none}@media (min-width:768px) and (max-width:992px){.tablet{display:inherit!important}}@media (max-width:992px){.desktop{display:none!important}}@media (min-width:769px){.small-screen{display:none!important}}@media (max-width:768px){.large-screen{display:none!important}}.fit-content{max-width:fit-content!important;max-width:-moz-fit-content!important}.list-style-none{list-style:none!important}.m-0{margin:var(--distance-0)!important}.ml-0{margin-left:var(--distance-0)!important}.mr-0{margin-right:var(--distance-0)!important}.mt-0{margin-top:var(--distance-0)!important}.mb-0{margin-bottom:var(--distance-0)!important}.mx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.m-1{margin:var(--distance-1)!important}.m-2{margin:var(--distance-2)!important}.m-3{margin:var(--distance-3)!important}.m-4{margin:var(--distance-4)!important}.m-5{margin:var(--distance-5)!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.mx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.my-auto{margin-bottom:auto!important;margin-top:auto!important}.my-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.my-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.my-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.my-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.my-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.my-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mt-auto{margin-top:auto!important}.mt-1{margin-top:var(--distance-1)!important}.mt-2{margin-top:var(--distance-2)!important}.mt-3{margin-top:var(--distance-3)!important}.mt-4{margin-top:var(--distance-4)!important}.mt-5{margin-top:var(--distance-5)!important}.ml-auto{margin-left:auto!important}.ml-1{margin-left:var(--distance-1)!important}.ml-2{margin-left:var(--distance-2)!important}.ml-3{margin-left:var(--distance-3)!important}.ml-4{margin-left:var(--distance-4)!important}.ml-5{margin-left:var(--distance-5)!important}.mr-auto{margin-right:auto!important}.mr-1{margin-right:var(--distance-1)!important}.mr-2{margin-right:var(--distance-2)!important}.mr-3{margin-right:var(--distance-3)!important}.mr-4{margin-right:var(--distance-4)!important}.mr-5{margin-right:var(--distance-5)!important}.mb-auto{margin-bottom:auto!important}.mb-1{margin-bottom:var(--distance-1)!important}.mb-2{margin-bottom:var(--distance-2)!important}.mb-3{margin-bottom:var(--distance-3)!important}.mb-4{margin-bottom:var(--distance-4)!important}.mb-5{margin-bottom:var(--distance-5)!important}@media (min-width:768px) and (max-width:992px){.tm-0{margin:var(--distance-0)!important}.tml-0{margin-left:var(--distance-0)!important}.tmr-0{margin-right:var(--distance-0)!important}.tmt-0{margin-top:var(--distance-0)!important}.tmb-0{margin-bottom:var(--distance-0)!important}.tmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.tm-1{margin:var(--distance-1)!important}.tm-2{margin:var(--distance-2)!important}.tm-3{margin:var(--distance-3)!important}.tm-4{margin:var(--distance-4)!important}.tm-5{margin:var(--distance-5)!important}.tmx-auto{margin-left:auto!important;margin-right:auto!important}.tmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.tmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.tmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.tmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.tmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.tmy-auto{margin-bottom:auto!important;margin-top:auto!important}.tmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.tmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.tmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.tmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.tmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.tmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.tmt-auto{margin-top:auto!important}.tmt-1{margin-top:var(--distance-1)!important}.tmt-2{margin-top:var(--distance-2)!important}.tmt-3{margin-top:var(--distance-3)!important}.tmt-4{margin-top:var(--distance-4)!important}.tmt-5{margin-top:var(--distance-5)!important}.tml-auto{margin-left:auto!important}.tml-1{margin-left:var(--distance-1)!important}.tml-2{margin-left:var(--distance-2)!important}.tml-3{margin-left:var(--distance-3)!important}.tml-4{margin-left:var(--distance-4)!important}.tml-5{margin-left:var(--distance-5)!important}.tmr-auto{margin-right:auto!important}.tmr-1{margin-right:var(--distance-1)!important}.tmr-2{margin-right:var(--distance-2)!important}.tmr-3{margin-right:var(--distance-3)!important}.tmr-4{margin-right:var(--distance-4)!important}.tmr-5{margin-right:var(--distance-5)!important}.tmb-auto{margin-bottom:auto!important}.tmb-1{margin-bottom:var(--distance-1)!important}.tmb-2{margin-bottom:var(--distance-2)!important}.tmb-3{margin-bottom:var(--distance-3)!important}.tmb-4{margin-bottom:var(--distance-4)!important}.tmb-5{margin-bottom:var(--distance-5)!important}}@media (max-width:767px){.mm-0{margin:var(--distance-0)!important}.mml-0{margin-left:var(--distance-0)!important}.mmr-0{margin-right:var(--distance-0)!important}.mmt-0{margin-top:var(--distance-0)!important}.mmb-0{margin-bottom:var(--distance-0)!important}.mmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.mm-1{margin:var(--distance-1)!important}.mm-2{margin:var(--distance-2)!important}.mm-3{margin:var(--distance-3)!important}.mm-4{margin:var(--distance-4)!important}.mm-5{margin:var(--distance-5)!important}.mmx-auto{margin-left:auto!important;margin-right:auto!important}.mmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.mmy-auto{margin-bottom:auto!important;margin-top:auto!important}.mmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.mmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.mmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.mmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.mmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.mmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mmt-auto{margin-top:auto!important}.mmt-1{margin-top:var(--distance-1)!important}.mmt-2{margin-top:var(--distance-2)!important}.mmt-3{margin-top:var(--distance-3)!important}.mmt-4{margin-top:var(--distance-4)!important}.mmt-5{margin-top:var(--distance-5)!important}.mml-auto{margin-left:auto!important}.mml-1{margin-left:var(--distance-1)!important}.mml-2{margin-left:var(--distance-2)!important}.mml-3{margin-left:var(--distance-3)!important}.mml-4{margin-left:var(--distance-4)!important}.mml-5{margin-left:var(--distance-5)!important}.mmr-auto{margin-right:auto!important}.mmr-1{margin-right:var(--distance-1)!important}.mmr-2{margin-right:var(--distance-2)!important}.mmr-3{margin-right:var(--distance-3)!important}.mmr-4{margin-right:var(--distance-4)!important}.mmr-5{margin-right:var(--distance-5)!important}.mmb-auto{margin-bottom:auto!important}.mmb-1{margin-bottom:var(--distance-1)!important}.mmb-2{margin-bottom:var(--distance-2)!important}.mmb-3{margin-bottom:var(--distance-3)!important}.mmb-4{margin-bottom:var(--distance-4)!important}.mmb-5{margin-bottom:var(--distance-5)!important}}.p-0{padding:var(--distance-0)}.pl-0{padding-left:var(--distance-0)}.pr-0{padding-right:var(--distance-0)}.pt-0{padding-top:var(--distance-0)}.pb-0{padding-bottom:var(--distance-0)}.p-1{padding:var(--distance-1)}.p-2{padding:var(--distance-2)}.p-3{padding:var(--distance-3)}.p-4{padding:var(--distance-4)}.p-5{padding:var(--distance-5)}.px-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.px-auto{padding-left:auto;padding-right:auto}.px-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.px-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.px-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.px-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.px-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.py-auto{padding-bottom:auto;padding-top:auto}.py-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.py-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.py-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.py-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.py-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.py-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.pt-auto{padding-top:auto}.pt-1{padding-top:var(--distance-1)}.pt-2{padding-top:var(--distance-2)}.pt-3{padding-top:var(--distance-3)}.pt-4{padding-top:var(--distance-4)}.pt-5{padding-top:var(--distance-5)}.pl-auto{padding-left:auto}.pl-1{padding-left:var(--distance-1)}.pl-2{padding-left:var(--distance-2)}.pl-3{padding-left:var(--distance-3)}.pl-4{padding-left:var(--distance-4)}.pl-5{padding-left:var(--distance-5)}.pr-auto{padding-right:auto}.pr-1{padding-right:var(--distance-1)}.pr-2{padding-right:var(--distance-2)}.pr-3{padding-right:var(--distance-3)}.pr-4{padding-right:var(--distance-4)}.pr-5{padding-right:var(--distance-5)}.pb-auto{padding-bottom:auto}.pb-1{padding-bottom:var(--distance-1)}.pb-2{padding-bottom:var(--distance-2)}.pb-3{padding-bottom:var(--distance-3)}.pb-4{padding-bottom:var(--distance-4)}.pb-5{padding-bottom:var(--distance-5)}@media (min-width:768px) and (max-width:992px){.tp-0{padding:var(--distance-0)}.tpl-0{padding-left:var(--distance-0)}.tpr-0{padding-right:var(--distance-0)}.tpt-0{padding-top:var(--distance-0)}.tpb-0{padding-bottom:var(--distance-0)}.tpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.tp-1{padding:var(--distance-1)}.tp-2{padding:var(--distance-2)}.tp-3{padding:var(--distance-3)}.tp-4{padding:var(--distance-4)}.tp-5{padding:var(--distance-5)}.tpx-auto{padding-left:auto;padding-right:auto}.tpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.tpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.tpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.tpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.tpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.tpy-auto{padding-bottom:auto;padding-top:auto}.tpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.tpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.tpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.tpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.tpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.tpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.tpt-auto{padding-top:auto}.tpt-1{padding-top:var(--distance-1)}.tpt-2{padding-top:var(--distance-2)}.tpt-3{padding-top:var(--distance-3)}.tpt-4{padding-top:var(--distance-4)}.tpt-5{padding-top:var(--distance-5)}.tpl-auto{padding-left:auto}.tpl-1{padding-left:var(--distance-1)}.tpl-2{padding-left:var(--distance-2)}.tpl-3{padding-left:var(--distance-3)}.tpl-4{padding-left:var(--distance-4)}.tpl-5{padding-left:var(--distance-5)}.tpr-auto{padding-right:auto}.tpr-1{padding-right:var(--distance-1)}.tpr-2{padding-right:var(--distance-2)}.tpr-3{padding-right:var(--distance-3)}.tpr-4{padding-right:var(--distance-4)}.tpr-5{padding-right:var(--distance-5)}.tpb-auto{padding-bottom:auto}.tpb-1{padding-bottom:var(--distance-1)}.tpb-2{padding-bottom:var(--distance-2)}.tpb-3{padding-bottom:var(--distance-3)}.tpb-4{padding-bottom:var(--distance-4)}.tpb-5{padding-bottom:var(--distance-5)}}@media (max-width:767px){.mp-0{padding:var(--distance-0)}.mpl-0{padding-left:var(--distance-0)}.mpr-0{padding-right:var(--distance-0)}.mpt-0{padding-top:var(--distance-0)}.mpb-0{padding-bottom:var(--distance-0)}.mpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.mp-1{padding:var(--distance-1)}.mp-2{padding:var(--distance-2)}.mp-3{padding:var(--distance-3)}.mp-4{padding:var(--distance-4)}.mp-5{padding:var(--distance-5)}.mpx-auto{padding-left:auto;padding-right:auto}.mpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.mpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.mpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.mpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.mpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.mpy-auto{padding-bottom:auto;padding-top:auto}.mpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.mpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.mpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.mpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.mpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.mpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.mpt-auto{padding-top:auto}.mpt-1{padding-top:var(--distance-1)}.mpt-2{padding-top:var(--distance-2)}.mpt-3{padding-top:var(--distance-3)}.mpt-4{padding-top:var(--distance-4)}.mpt-5{padding-top:var(--distance-5)}.mpl-auto{padding-left:auto}.mpl-1{padding-left:var(--distance-1)}.mpl-2{padding-left:var(--distance-2)}.mpl-3{padding-left:var(--distance-3)}.mpl-4{padding-left:var(--distance-4)}.mpl-5{padding-left:var(--distance-5)}.mpr-auto{padding-right:auto}.mpr-1{padding-right:var(--distance-1)}.mpr-2{padding-right:var(--distance-2)}.mpr-3{padding-right:var(--distance-3)}.mpr-4{padding-right:var(--distance-4)}.mpr-5{padding-right:var(--distance-5)}.mpb-auto{padding-bottom:auto}.mpb-1{padding-bottom:var(--distance-1)}.mpb-2{padding-bottom:var(--distance-2)}.mpb-3{padding-bottom:var(--distance-3)}.mpb-4{padding-bottom:var(--distance-4)}.mpb-5{padding-bottom:var(--distance-5)}}hr{border-color:var(--hr-color);border-style:solid;border-width:0 0 .5px;margin-bottom:var(--default-distance)}button{background-color:var(--button-background);border:.5px solid var(--border-color);border-radius:2px;padding:.6rem 1.5rem}@supports (-moz-appearance:none){button{padding:.6rem 1.5rem .9rem}}button:active,button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}button.no-border{background-color:transparent!important;border:none!important}button:hover{background-color:var(--button-hover)!important;cursor:pointer}button.icon{color:var(--icon)!important;display:flex;flex-direction:column;padding:0;width:auto}button.icon:disabled{color:var(--icon-disabled)!important}button.icon:disabled:hover{background-color:transparent!important}button.primary{background-color:var(--primary)!important;border:0;color:var(--color-on-primary)!important}button.primary:hover{background-color:var(--primary-hover)!important}button.danger{background-color:var(--danger)!important;border:0;color:var(--color-on-danger)!important}button.danger:hover{background-color:var(--danger-hover)!important}button.accent{background-color:var(--accent)!important;border:0;color:var(--color-on-accent)!important}button.accent:hover{background-color:var(--accent-hover)!important}button.contrast{background-color:var(--contrast)!important;border:0;color:var(--color-on-contrast)!important}button.contrast:hover{background-color:var(--contrast-hover)!important}button.accent:active,button.accent:focus,button.contrast:active,button.contrast:focus,button.danger:active,button.danger:focus,button.primary:active,button.primary:focus{box-shadow:0 0 0 1px var(--button-outline-color)!important}button.accent.disabled,button.accent:disabled,button.contrast.disabled,button.contrast:disabled,button.danger.disabled,button.danger:disabled,button.primary.disabled,button.primary:disabled{color:var(--colored-disabled-button-color)!important;cursor:auto;outline:none}button.accent.disabled:not(.link),button.accent:disabled:not(.link),button.contrast.disabled:not(.link),button.contrast:disabled:not(.link),button.danger.disabled:not(.link),button.danger:disabled:not(.link),button.primary.disabled:not(.link),button.primary:disabled:not(.link){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.outline-hover:hover{background-color:transparent!important;outline:.5px solid var(--button-outline-color)!important}button.link{background-color:transparent!important;border:0;color:var(--primary)!important;padding:0}button.link.accent{color:var(--accent)!important}button.link.contrast{color:var(--contrast)!important}button.link.danger{color:var(--danger)!important}button.link:active,button.link:focus,button.link:hover{background-color:transparent!important;box-shadow:unset!important;text-decoration:underline!important}button.disabled,button:disabled{color:var(--disabled-button-color)!important;cursor:auto}button.disabled:not(.link):not(.icon),button:disabled:not(.link):not(.icon){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.disabled.link,button:disabled.link{color:var(--disabled-button-color)!important}button.disabled:hover,button:disabled:hover{outline:none;text-decoration:none}select{background-color:var(--background);border:.5px solid var(--input-border-color);outline:var(--primary) none 0;padding:.5rem}select:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}select:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-colour);cursor:auto}input,textarea{accent-color:var(--primary);border:.5px solid var(--input-border-color);border-radius:2px;min-height:3rem;outline:0 none currentcolor;padding:0 1rem}input:focus,textarea:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}input:invalid:not([invalid=false]):not([required]),input[invalid]:not([invalid=false]),textarea:invalid:not([invalid=false]):not([required]),textarea[invalid]:not([invalid=false]){border-color:var(--danger)}input:invalid:not([invalid=false]):not([required]):focus,input:invalid:not([invalid=false]):not([required]):hover,input[invalid]:not([invalid=false]):focus,input[invalid]:not([invalid=false]):hover,textarea:invalid:not([invalid=false]):not([required]):focus,textarea:invalid:not([invalid=false]):not([required]):hover,textarea[invalid]:not([invalid=false]):focus,textarea[invalid]:not([invalid=false]):hover{box-shadow:inset 1px 1px 0 var(--danger),inset -1px -1px 0 var(--danger)}input:disabled,textarea:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=checkbox],input[type=color],input[type=file],input[type=image],input[type=radio],input[type=range],textarea[type=checkbox],textarea[type=color],textarea[type=file],textarea[type=image],textarea[type=radio],textarea[type=range]{border:none;min-height:unset;padding-left:0}input[type=checkbox]:focus-visible,input[type=radio]:focus-visible,textarea[type=checkbox]:focus-visible,textarea[type=radio]:focus-visible{outline:var(--button-outline-color) dashed .1rem;outline-offset:.1rem}input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{border:0;padding:.6rem 1.5rem}@supports (-moz-appearance:none){input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{padding:.6rem 1.5rem .9rem}}input[type=button]:hover,input[type=reset]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=reset]:hover,textarea[type=submit]:hover{background-color:var(--button-hover);cursor:pointer}input[type=button]:active,input[type=button]:focus,input[type=reset]:active,input[type=reset]:focus,input[type=submit]:active,input[type=submit]:focus,textarea[type=button]:active,textarea[type=button]:focus,textarea[type=reset]:active,textarea[type=reset]:focus,textarea[type=submit]:active,textarea[type=submit]:focus{box-shadow:0 0 0 2px var(--button-outline-color);cursor:pointer;outline:none}input[type=button]:disabled,input[type=button]:hover:disabled,input[type=reset]:disabled,input[type=reset]:hover:disabled,input[type=submit]:disabled,input[type=submit]:hover:disabled,textarea[type=button]:disabled,textarea[type=button]:hover:disabled,textarea[type=reset]:disabled,textarea[type=reset]:hover:disabled,textarea[type=submit]:disabled,textarea[type=submit]:hover:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=reset],textarea[type=reset]{background-color:var(--background);border:.5px solid var(--border-color)}input[type=reset]:active,input[type=reset]:focus,textarea[type=reset]:active,textarea[type=reset]:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}input[type=button],input[type=submit],textarea[type=button],textarea[type=submit]{background-color:var(--primary);color:var(--color-on-primary)}input[type=button]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=submit]:hover{background-color:var(--primary-hover)}input[type=color],input[type=file],input[type=range],textarea[type=color],textarea[type=file],textarea[type=range]{border:none}input[type=color]:focus,input[type=file]:focus,input[type=range]:focus,textarea[type=color]:focus,textarea[type=file]:focus,textarea[type=range]:focus{box-shadow:none;outline:var(--primary) solid 2px;outline-offset:2px}input[type=file]::-webkit-file-upload-button,input[type=file]::file-selector-button,textarea[type=file]::-webkit-file-upload-button,textarea[type=file]::file-selector-button{background-color:var(--primary);border:0;border-radius:2px;color:var(--color-on-primary);padding:.6rem 1.5rem}input[type=file]:active::-webkit-file-upload-button,input[type=file]:active::file-selector-button,textarea[type=file]:active::-webkit-file-upload-button,textarea[type=file]:active::file-selector-button{box-shadow:inset 0 0 0 2px var(--button-outline-color)}input[type=file]:hover::-webkit-file-upload-button,input[type=file]:hover::file-selector-button,textarea[type=file]:hover::-webkit-file-upload-button,textarea[type=file]:hover::file-selector-button{background-color:var(--primary-hover);cursor:pointer}input[type=file]:focus,textarea[type=file]:focus{outline:var(--button-outline-color) solid .2rem;outline-offset:.1rem}input[type=color],textarea[type=color]{background-color:transparent;padding:0;width:8rem}input[type=range],textarea[type=range]{appearance:none;-webkit-appearance:none;background:transparent;padding:0}input[type=range]::-moz-range-thumb,textarea[type=range]::-moz-range-thumb{background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.2rem;width:1.2rem}input[type=range]::-moz-range-track,textarea[type=range]::-moz-range-track{background-color:var(--range-track-color);height:.3rem}input[type=range]::-moz-range-progress,textarea[type=range]::-moz-range-progress{background-color:var(--range-filled-track-color);height:.3rem}input[type=range]::-webkit-slider-thumb,textarea[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.6rem;margin-top:-6px;width:1.6rem}input[type=range]::-webkit-slider-runnable-track,textarea[type=range]::-webkit-slider-runnable-track{background:var(--range-track-color);border:none;border-radius:3px;height:3px}input[type=range]:focus,input[type=range]:hover,textarea[type=range]:focus,textarea[type=range]:hover{background:transparent;outline:none}input[type=range]:focus::-moz-range-progress,input[type=range]:hover::-moz-range-progress,textarea[type=range]:focus::-moz-range-progress,textarea[type=range]:hover::-moz-range-progress{background-color:var(--primary)}input[type=range]:focus::-moz-range-thumb,input[type=range]:hover::-moz-range-thumb,textarea[type=range]:focus::-moz-range-thumb,textarea[type=range]:hover::-moz-range-thumb{border:2px solid var(--primary)}input[type=range]:focus::-webkit-slider-runnable-track,input[type=range]:hover::-webkit-slider-runnable-track,textarea[type=range]:focus::-webkit-slider-runnable-track,textarea[type=range]:hover::-webkit-slider-runnable-track{background-color:var(--primary)}input[type=range]:focus::-webkit-slider-thumb,input[type=range]:hover::-webkit-slider-thumb,textarea[type=range]:focus::-webkit-slider-thumb,textarea[type=range]:hover::-webkit-slider-thumb{border:2px solid var(--primary)}input[type=range]:disabled:focus,input[type=range]:disabled:hover,textarea[type=range]:disabled:focus,textarea[type=range]:disabled:hover{background:transparent;outline:none}input[type=range]:disabled:focus::-moz-range-progress,input[type=range]:disabled:hover::-moz-range-progress,textarea[type=range]:disabled:focus::-moz-range-progress,textarea[type=range]:disabled:hover::-moz-range-progress{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-moz-range-thumb,input[type=range]:disabled:hover::-moz-range-thumb,textarea[type=range]:disabled:focus::-moz-range-thumb,textarea[type=range]:disabled:hover::-moz-range-thumb{border:2px solid var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-runnable-track,input[type=range]:disabled:hover::-webkit-slider-runnable-track,textarea[type=range]:disabled:focus::-webkit-slider-runnable-track,textarea[type=range]:disabled:hover::-webkit-slider-runnable-track{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-thumb,input[type=range]:disabled:hover::-webkit-slider-thumb,textarea[type=range]:disabled:focus::-webkit-slider-thumb,textarea[type=range]:disabled:hover::-webkit-slider-thumb{border:2px solid var(--range-filled-track-color)}input.underline,textarea.underline{background-color:transparent;border-left:0;border-radius:0;border-right:0;border-top:0;padding:0}input.underline:focus,textarea.underline:focus{box-shadow:none}input.underline:focus,input.underline:hover,textarea.underline:focus,textarea.underline:hover{border-color:var(--primary);box-shadow:inset 0 -1px 0 var(--primary)}input.underline:disabled:focus,input.underline:disabled:hover,input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover{border-left:0;border-right:0;border-top:0;box-shadow:none}input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,input.underline[invalid]:not([invalid=false]):focus,input.underline[invalid]:not([invalid=false]):hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline[invalid]:not([invalid=false]):focus,textarea.underline[invalid]:not([invalid=false]):hover{border-color:var(--danger);box-shadow:inset 0 -1px 0 var(--danger)}input.underline:disabled:focus,input.underline:disabled:hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover{border-color:var(--disabled-button-background)}a{color:var(--primary)}a:active,a:focus,a:focus-visible,a:hover{outline:unset}a.accent{color:var(--accent)}a.danger{color:var(--danger)}a.contrast{color:var(--contrast)}a.button{background-color:transparent;border-radius:2px;color:var(--button-color);display:inline-block;padding:.9rem 1.5rem;text-align:center;text-decoration:none}a.button.normal{border:.5px solid var(--border-color)}a.button.normal.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--disabled-button-color);cursor:default}a.button:hover{background-color:var(--button-hover);cursor:pointer}a.button:active,a.button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}a.button.primary{background-color:var(--primary);border:0;color:var(--color-on-primary)}a.button.primary:hover{background-color:var(--primary-hover)}a.button.danger{background-color:var(--danger);border:0;color:var(--color-on-danger)}a.button.danger:hover{background-color:var(--danger-hover)}a.button.accent{background-color:var(--accent);border:0;color:var(--color-on-accent)}a.button.accent:hover{background-color:var(--accent-hover)}a.button.contrast{background-color:var(--contrast);border:0;color:var(--color-on-contrast)}a.button.contrast:hover{background-color:var(--contrast-hover)}a.button.accent:active,a.button.accent:focus,a.button.contrast:active,a.button.contrast:focus,a.button.danger:active,a.button.danger:focus,a.button.primary:active,a.button.primary:focus{box-shadow:0 0 0 2px var(--button-outline-color)}a.button.accent.disabled,a.button.contrast.disabled,a.button.danger.disabled,a.button.primary.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--colored-disabled-button-color);cursor:default}table{border-collapse:collapse}table td,table th{padding:.5rem 2.5rem .6rem .5rem;text-align:left;vertical-align:top}table:not(.no-hover) tbody tr:hover{background-color:var(--table-hover)}table.table tbody tr,table.table thead{border-bottom:.5px solid var(--border-color)}table.table tbody tr{border-color:var(--light)}table.table tfoot{font-size:small;font-style:italic}table.sticky-header>thead{background-color:var(--background);border-bottom:0;-webkit-box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);position:sticky;position:-webkit-sticky;top:0;white-space:nowrap;z-index:2}table.striped tbody tr:nth-child(odd){background-color:var(--table-stripe)}table.striped tbody tr:hover{background-color:var(--table-striped-hover)}.table-container{border:.5px solid var(--border-color);border-color:var(--light);display:inline-block;overflow-x:hidden;overflow-y:auto;width:fit-content}@-moz-document url-prefix(){.table-container{padding-right:1.7rem}}.cursor-not-allowed:hover{cursor:not-allowed!important}.cursor-pointer{-webkit-user-select:none;-ms-user-select:none;user-select:none}.cursor-pointer:hover{cursor:pointer!important}.cursor-grab:hover{cursor:grab!important}.cursor-grabbing:hover{cursor:grabbing!important}.cursor-zoom-in:hover{cursor:zoom-in!important}.cursor-zoom-out:hover{cursor:zoom-out!important}.cursor-wait:hover{cursor:wait!important}.cursor-help:hover{cursor:help!important}.cursor-default,.cursor-default:hover{cursor:default!important}.cursor-no-select{-webkit-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.border{border:.5px solid var(--border-color)}.border-bottom{border-bottom:.5px solid var(--border-color)}.border-top{border-top:.5px solid var(--border-color)}.border-right{border-right:.5px solid var(--border-color)}.border-left{border-left:.5px solid var(--border-color)}.border-black{border-color:var(--black)}.border-white{border-color:var(--white)}.border-primary{border-color:var(--primary)}.border-accent{border-color:var(--accent)}.border-danger{border-color:var(--danger)}.border-light{border-color:var(--light)}.border-success{border-color:var(--icon-success)}html{background-color:var(--html-background)!important}.bg-gray-light{background-color:var(--gray-light)!important;color:var(--color-on-gray-light)!important}.bg-gray{background-color:var(--gray)!important;color:var(--color-on-gray)!important}.bg-gray-dark{background-color:var(--gray-dark)!important;color:var(--color-on-gray-dark)!important}.bg-black{background-color:var(--black)!important;color:var(--color-on-black)!important}.bg-white{background-color:var(--white)!important;color:var(--font-color)!important}.bg-primary{background-color:var(--primary)!important;color:var(--color-on-primary)!important}.bg-accent{background-color:var(--accent)!important;color:var(--color-on-accent)!important}.bg-danger{background-color:var(--danger)!important;color:var(--color-on-danger)!important}.bg-success{background-color:var(--success)!important;color:var(--color-on-success)!important}.bg-error{background-color:var(--error)!important;color:var(--color-on-error)!important}.bg-warning{background-color:var(--warning)!important;color:var(--color-on-warning)!important}.bg-transparent{background-color:transparent!important}.text-black{color:var(--black)!important}.text-white{color:var(--white)!important}.text-gray{color:var(--gray-darker)!important}.text-primary{color:var(--primary)!important}.text-accent{color:var(--accent)!important}.text-danger{color:var(--danger)!important}.text-success{color:var(--icon-success)!important}.icon-gray{color:var(--gray)!important}.icon-gray-dark{color:var(--gray-dark)!important}.icon-success{color:var(--icon-success)!important}.icon-primary{color:var(--primary)!important}.icon-accent{color:var(--accent)!important}.icon-danger{color:var(--danger)!important}.icon-black{color:var(--black)!important}.icon-white{color:var(--white)!important}.shadow{box-shadow:0 .6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-top{box-shadow:0 -1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 -.3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-left{box-shadow:-1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-right{box-shadow:1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),-.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-bottom{box-shadow:0 1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-lg{box-shadow:0 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-top-lg{box-shadow:0 -3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-bottom-lg{box-shadow:0 3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-left-lg{box-shadow:-3px 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-right-lg{box-shadow:3px 0 5px 0 rgba(var(--shadow-color),.132)!important} \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.7/flightkit.min.js b/documentation/public/cdn/ibiss-v0.0.7/flightkit.min.js new file mode 100644 index 0000000..984097a --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.7/flightkit.min.js @@ -0,0 +1 @@ +!function(){"use strict";function i(e,t){if(!t||0===t.length)return e;const s=Object.assign([],e);if(Array.isArray(s[0])){e=s;var n=t;const r=[];for(const i of e)r.push(i.sort(E(n)));r}else s.sort(E(t));return s}function y(e){let t=e.toString();e=t.match(/^\d+|\d+$/);return e?parseInt(e[0]):null}function b(e){return"boolean"==typeof e||"string"==typeof e&&("true"===(e=e.toLocaleLowerCase())||"false"===e)}function w(e){return"boolean"==typeof e?e:"true"===e.toLocaleLowerCase()}function E(f,v=0){return function(e,t){var{propertyName:s,direction:d}=f[v];let n=null===e[s]||void 0===e[s]?"":e[s],r=null===t[s]||void 0===t[s]?"":t[s];const h=/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim;var s=n instanceof Date&&r instanceof Date||h.test(n)&&h.test(r),p=(s&&(n=n instanceof Date?n.valueOf():new Date(Date.parse(n)),r=r instanceof Date?r.valueOf():new Date(Date.parse(r))),b(n)&&b(r)),u=!p&&!isNaN(n)&&!isNaN(r),i=y(n),o=y(r);u?(n=parseFloat(n).toPrecision(12),r=parseFloat(r).toPrecision(12)):null!==i&&null!==o&&(n=parseFloat(i).toPrecision(12),r=parseFloat(o).toPrecision(12)),p&&(n=w(n),r=w(r));let a,l;switch(d){case"descending":case"desc":a=r,l=n;break;default:a=n,l=r}let c=0;if(p||s||u)c=a-l;else{a=a.toString().trim().toLowerCase(),l=l.toString().trim().toLowerCase();const m=/\d/gim;i=m.test(n)&&m.test(r);c=i?a.localeCompare(l,void 0,{numeric:!0,sensitivity:"base"}):a.localeCompare(l)}o=v+1;if(0===c&&o(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(s,i,t.getAttribute(n))}}var r=Object.keys(t.classList).length;if(r){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=p(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const r of s.split("."))n=(n||window)[r];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const n of document.querySelectorAll(s.selector))this._addEventToElement(s,n);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const m='',g='';function l(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class e extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=e}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const r of e.split(",")){var t=r.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const n=p(e).target,r=(t?n._selectedIds.add(s):n._selectedIds.delete(s),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[r]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=p(e).target,s=u(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=n[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const r=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),r.append(i),t.append(r)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var s=this.createRow(n,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const r=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class t extends HTMLElement{base;componentId;constructor(){super(),this.base=new r}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const r=document.createElement("div");r.innerHTML=this.innerHTML,this.component=r;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=p(e,"flk-draggable").target;let n,r;function t(e){n=e.clientX-s.offsetLeft,r=e.clientY-s.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-r;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class s extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new r}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=p(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var r=this.getAttribute("modal-title");if(r){const c=document.createElement("span");c.innerText=r,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");r=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=r,n.append(a),s.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+r,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class n extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new r}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var n=l('');const r=l(''),i=(r.classList.add("hidden"),s.append(n,r),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=p(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,n=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=n||t.offsetWidth+"px",t._iconId);const r=document.getElementById(n);e?(r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")):(r.childNodes[0].classList.add("hidden"),r.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=p(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const n of e)s._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const r of e)r._closeDropdown()}}class o extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const n of t.split(","))s=s.concat(n.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new r,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=p(e,"flk-tree-nav").target,s=u(e,"branchKey");let n=t.contents;const d=s.split(".");for(const o of d)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}let r,i=e.target;for(;i.dataset&&i.dataset.leafKey?r=i.dataset.leafKey:i=i.parentNode||i.parentElement,!r;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:r,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let n="",r="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,n=this.convertJsonKeyToTitle(e.substring(0,s)),r=e.substring(s)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:r}}createTextTag(n,r){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=n.titleText,document.createElement("small"));s.innerText=n.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",r.append(e)}else r.innerText=n.titleText}createLeaf(e,t,s,n=[]){let r=document.createElement("li");r.classList.add("cursor-no-select"),r.style.marginTop="0.4rem",r.dataset.branchKey=s;const i="file"===this.iconSet?'':'';r.style.listStyleImage=`url('data:image/svg+xml,${i}')`,r.style.position="relative",r.style.left="2px";let o=document.createElement("span");s=[e].concat(n);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",r.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?m:g;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(r),t.append(e)}else t.append(r)}createBranch(s,t,n,r){if(r===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,n+"."+e,r+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,n+"."+l,r+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?m:g;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(s,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?m:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",e),customElements.define("flk-draggable",t),customElements.define("flk-modal",s),customElements.define("flk-dropdown",n),customElements.define("flk-tree-nav",o)}(); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.7/htmx-ibiss-ui.min.js b/documentation/public/cdn/ibiss-v0.0.7/htmx-ibiss-ui.min.js new file mode 100644 index 0000000..c035056 --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.7/htmx-ibiss-ui.min.js @@ -0,0 +1 @@ +!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";htmx.defineExtension("ibiss-ui",{onEvent:function(t,e){if("htmx:beforeRequest"===t){const{target:i,detail:n}=e;t=i.getAttribute("ibiss-router");if(window[t]&&"function"==typeof window[t])return window[t](i,n,e),!1}}})}); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.7/rocket.min.js b/documentation/public/cdn/ibiss-v0.0.7/rocket.min.js new file mode 100644 index 0000000..0a7f9d0 --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.7/rocket.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).rocketjs=t()}(this,function(){"use strict";function y(e,t){let r=0,l=e.indexOf(t);for(;-1!==l;)r++,l=e.indexOf(t,l+1);return r}function e(){return{sequence:"",match:!1}}function v(e,t,r){let l=r.sequence;return l.length===t.length&&(l=l.substring(1)),l+=e,r.sequence=l,r.match=l===t,r}class g{static getTemplates(t,r,l){if(r.length!==l.length)throw new Error("Template start is not the same length as template end");var g=t.length;let a=e(),o=e(),n=0,s=0,i=[],p=[];const u=[];for(let e=0;ee.replace(new RegExp(t,"g"),r));return l=l.replace(/if([\s\S]+?)\s|is|not/gm,e=>e.replace(new RegExp(t,"g"),r)),l=l.replace(/(of|in)([\s\S]+?)(?=<|{)/gm,e=>e.replace(new RegExp(t,"g"),r)),l}}class o{static resolvePartials(e,t){let r=e;for(const a of g.getTemplates(e,"{{#","#}}")){var l=g.getInnerTemplate(a),l=g.getPropertyValue(l,t);let e=l?l:"";r=r.replace(a,e)}if(r.includes("{{#")){if(e===r)return r;r=o.resolvePartials(r,t)}return r}}class s{static interpolateTemplate(e,r){let l=e;for(const n of g.getTemplates(e,"{{","}}")){let e=g.getInnerTemplate(n,2);var a="!"===e[0],o=(a&&(e=e.substr(1).trim()),g.getPropertyValue(e,r));let t=o?o:"";t=Array.isArray(t)?t.join(", "):t.toString().trim();o=a?s.escapeHtml(t):t;l=l.replace(n,o)}return l}static escapeHtml(e){return e=(e=(e=(e=(e=e.replace(/&/gm,"&")).replace(//gm,">")).replace(/"/gm,""")).replace(/\//gm,"'")}}class r{static buildTemplate(e,t){e=o.resolvePartials(e,t),e=class{static resolveWrapper(e){let t=e;for(const o of g.getTemplates(e,"{{$","$}}")){var r=g.getWrapperProperty(o),l=g.getTemplates(r.templateToFill,"{{","}}"),l=g.getToplevelTemplates(l);let e=r.templateToFill;for(const n of l){var a=g.getProperty(n);e=e.replace(new RegExp(a,"g"),r.property+"."+a)}t=t.replace(o,e)}return t}}.resolveWrapper(e);return e=c.resolveLoop(e,t),class{static resolveConditional(e,l){let a=e;for(const p of g.getTemplates(e,"{{~","~}}")){const c=g.getConditionalLogic(p);var o=c.property,n=c.logiclessTemplate,s=c.truthy,i=!c.truthy;let e="",t=(c.comparison&&(e=c.comparison),""),r=g.getPropertyValue(o,l);r&&(r=Array.isArray(r)?r:r.toString().trim().toLocaleLowerCase(),e=c.comparison?c.comparison.toLocaleLowerCase():null),e?(s&&(t=r===e?n:""),i&&(t=r!==e?n:"")):t="false"===r||!r||Array.isArray(r)&&!r.length?"":n,a=a.replace(p,t)}return a}}.resolveConditional(e,t)}static interpolateTemplate(e,t){return s.interpolateTemplate(e,t)}static render(e,t){e=r.buildTemplate(e,t);return r.interpolateTemplate(e,t)}}return r}); \ No newline at end of file diff --git a/documentation/public/js/flightkit.min.js b/documentation/public/js/flightkit.min.js index 330a84f..984097a 100644 --- a/documentation/public/js/flightkit.min.js +++ b/documentation/public/js/flightkit.min.js @@ -1 +1 @@ -!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file +!function(){"use strict";function i(e,t){if(!t||0===t.length)return e;const s=Object.assign([],e);if(Array.isArray(s[0])){e=s;var n=t;const r=[];for(const i of e)r.push(i.sort(E(n)));r}else s.sort(E(t));return s}function y(e){let t=e.toString();e=t.match(/^\d+|\d+$/);return e?parseInt(e[0]):null}function b(e){return"boolean"==typeof e||"string"==typeof e&&("true"===(e=e.toLocaleLowerCase())||"false"===e)}function w(e){return"boolean"==typeof e?e:"true"===e.toLocaleLowerCase()}function E(f,v=0){return function(e,t){var{propertyName:s,direction:d}=f[v];let n=null===e[s]||void 0===e[s]?"":e[s],r=null===t[s]||void 0===t[s]?"":t[s];const h=/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim;var s=n instanceof Date&&r instanceof Date||h.test(n)&&h.test(r),p=(s&&(n=n instanceof Date?n.valueOf():new Date(Date.parse(n)),r=r instanceof Date?r.valueOf():new Date(Date.parse(r))),b(n)&&b(r)),u=!p&&!isNaN(n)&&!isNaN(r),i=y(n),o=y(r);u?(n=parseFloat(n).toPrecision(12),r=parseFloat(r).toPrecision(12)):null!==i&&null!==o&&(n=parseFloat(i).toPrecision(12),r=parseFloat(o).toPrecision(12)),p&&(n=w(n),r=w(r));let a,l;switch(d){case"descending":case"desc":a=r,l=n;break;default:a=n,l=r}let c=0;if(p||s||u)c=a-l;else{a=a.toString().trim().toLowerCase(),l=l.toString().trim().toLowerCase();const m=/\d/gim;i=m.test(n)&&m.test(r);c=i?a.localeCompare(l,void 0,{numeric:!0,sensitivity:"base"}):a.localeCompare(l)}o=v+1;if(0===c&&o(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var n="e-"+i;this.addEvent(s,i,t.getAttribute(n))}}var r=Object.keys(t.classList).length;if(r){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=p(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let n=void 0;for(const r of s.split("."))n=(n||window)[r];return e.preventDefault(),e.stopPropagation(),n(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const n of document.querySelectorAll(s.selector))this._addEventToElement(s,n);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const n of Array.isArray(t)?t:[t])e.append(n);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const m='',g='';function l(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class e extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=e}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const n=[];for(const r of e.split(",")){var t=r.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const n=p(e).target,r=(t?n._selectedIds.add(s):n._selectedIds.delete(s),n._selectionProperty);e=n.contents.execute().filter(e=>n._selectedIds.has(e[r]));n._emit("select",n,{selection:e}),n._updateCheckboxes(n)}sortData(e){const t=p(e).target,s=u(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,n){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=n[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const r=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var n=e[this._selectionProperty];this._selectedIds.has(n)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),r.append(i),t.append(r)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const n of e){var s=this.createRow(n,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const r=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(n){const c=document.createElement("span");c.innerHTML="asc"===n.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class t extends HTMLElement{base;componentId;constructor(){super(),this.base=new r}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),n=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),n&&(this.style.zIndex=n),this.componentId=this.getAttribute("handle");const r=document.createElement("div");r.innerHTML=this.innerHTML,this.component=r;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=p(e,"flk-draggable").target;let n,r;function t(e){n=e.clientX-s.offsetLeft,r=e.clientY-s.offsetTop}function i(e){var t=e.clientX-n,e=e.clientY-r;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class s extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new r}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=p(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),n=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var r=this.getAttribute("modal-title");if(r){const c=document.createElement("span");c.innerText=r,c.classList.add("ml-1","mr-auto"),n.append(c)}n.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),n.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");r=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=r,n.append(a),s.append(n),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+r,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class n extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new r}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var n=l('');const r=l(''),i=(r.classList.add("hidden"),s.append(n,r),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";n=this.querySelector("template");n.innerHTML.length?i.innerHTML=n.innerHTML:i.append(n.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=p(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,n=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),n=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=n||t.offsetWidth+"px",t._iconId);const r=document.getElementById(n);e?(r.childNodes[0].classList.remove("hidden"),r.childNodes[1].classList.add("hidden")):(r.childNodes[0].classList.add("hidden"),r.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=p(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const n of e)s._buttonId!==n._buttonId&&(t=n._drawerId,"none"!==document.getElementById(t).style.display&&n._closeDropdown());else for(const r of e)r._closeDropdown()}}class o extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const n of t.split(","))s=s.concat(n.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new r,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=p(e,"flk-tree-nav").target,s=u(e,"branchKey");let n=t.contents;const d=s.split(".");for(const o of d)if(n[o])n=n[o];else if(null===n[o])n=null;else{let e=[];for(const a of n)a[o]&&e.push(a[o]);n=e}let r,i=e.target;for(;i.dataset&&i.dataset.leafKey?r=i.dataset.leafKey:i=i.parentNode||i.parentElement,!r;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:n,key:r,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof n})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let n="",r="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,n=this.convertJsonKeyToTitle(e.substring(0,s)),r=e.substring(s)):n=this.convertJsonKeyToTitle(e),{titleText:n,commentText:r}}createTextTag(n,r){n=this.createLeafText(n);if(n.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=n.titleText,document.createElement("small"));s.innerText=n.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",r.append(e)}else r.innerText=n.titleText}createLeaf(e,t,s,n=[]){let r=document.createElement("li");r.classList.add("cursor-no-select"),r.style.marginTop="0.4rem",r.dataset.branchKey=s;const i="file"===this.iconSet?'':'';r.style.listStyleImage=`url('data:image/svg+xml,${i}')`,r.style.position="relative",r.style.left="2px";let o=document.createElement("span");s=[e].concat(n);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",r.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?m:g;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(r),t.append(e)}else t.append(r)}createBranch(s,t,n,r){if(r===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,n+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,n+"."+e,r+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=n+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,n+"."+l,r+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?m:g;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const p of a)t.append(p)}else this.createLeaf(s,t,n);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?m:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",e),customElements.define("flk-draggable",t),customElements.define("flk-modal",s),customElements.define("flk-dropdown",n),customElements.define("flk-tree-nav",o)}(); \ No newline at end of file diff --git a/flightkit/components/draggable.js b/flightkit/components/draggable.js index 3b2fa86..120f662 100644 --- a/flightkit/components/draggable.js +++ b/flightkit/components/draggable.js @@ -1,4 +1,4 @@ -import { returnEventWithTopLevelElement } from '../htmlbuilder/domTraversal'; +import { returnEventWithTopLevelElement } from '../flightkit-functions/domTraversal'; import { BaseComponent } from './extensions/base_component'; export class FlightkitDraggable extends HTMLElement { diff --git a/flightkit/components/dropdown.js b/flightkit/components/dropdown.js index edc48a5..38a45a6 100644 --- a/flightkit/components/dropdown.js +++ b/flightkit/components/dropdown.js @@ -1,5 +1,5 @@ -import { returnEventWithTopLevelElement } from '../htmlbuilder/domTraversal'; -import { chevronDownIcon, chevronUpIcon, rehydrateSvg } from '../htmlbuilder/icons'; +import { returnEventWithTopLevelElement } from '../flightkit-functions/domTraversal'; +import { chevronDownIcon, chevronUpIcon, rehydrateSvg } from '../flightkit-functions/icons'; import { BaseComponent } from './extensions/base_component'; export class FlightkitDropdown extends HTMLElement { diff --git a/flightkit/components/extensions/base_component.js b/flightkit/components/extensions/base_component.js index f7e37f0..4322ee8 100644 --- a/flightkit/components/extensions/base_component.js +++ b/flightkit/components/extensions/base_component.js @@ -1,5 +1,5 @@ -import { returnEventWithTopLevelElement } from '../../htmlbuilder/domTraversal'; -import { uuidv4 } from '../../htmlbuilder/uuid_v4'; +import { returnEventWithTopLevelElement } from '../../flightkit-functions/domTraversal'; +import { uuidv4 } from '../../flightkit-functions/uuid_v4'; export class BaseComponent { diff --git a/flightkit/components/modal.js b/flightkit/components/modal.js index ba01ef3..899bf6c 100644 --- a/flightkit/components/modal.js +++ b/flightkit/components/modal.js @@ -1,4 +1,4 @@ -import { returnEventWithTopLevelElement } from '../htmlbuilder/domTraversal'; +import { returnEventWithTopLevelElement } from '../flightkit-functions/domTraversal'; import { BaseComponent } from './extensions/base_component'; export class FlightkitModal extends HTMLElement { diff --git a/flightkit/components/table.js b/flightkit/components/table.js index 9aa5edc..86cb029 100644 --- a/flightkit/components/table.js +++ b/flightkit/components/table.js @@ -1,7 +1,7 @@ -import JOQ from '@pennions/joq'; +import { sortJsonArray } from '../flightkit-functions/sorting'; import { BaseComponent } from './extensions/base_component'; -import { returnEventWithTopLevelElement, returnDataSetValue } from '../htmlbuilder/domTraversal'; -import { sortAscendingIcon, sortDescendingIcon } from '../htmlbuilder/icons'; +import { returnEventWithTopLevelElement, returnDataSetValue } from '../flightkit-functions/domTraversal'; +import { sortAscendingIcon, sortDescendingIcon } from '../flightkit-functions/icons'; export class FlightkitTable extends HTMLElement { base; @@ -48,7 +48,7 @@ export class FlightkitTable extends HTMLElement { set contents(newValue) { this.analyzeData(newValue); - this._contents = new JOQ(newValue); + this._contents = newValue; } get orderBy() { @@ -166,14 +166,10 @@ export class FlightkitTable extends HTMLElement { createHtml() { const tableElement = document.createElement('table'); + let tableData = this.contents; - /** because of JOQ */ if (this.orderBy.length) { - this.contents.sort(this.orderBy); - } - else { - /** reset if no order */ - this.contents.sort([]); + tableData = sortJsonArray(this.contents, this.orderBy); } const tableHead = this.createHead(); @@ -183,10 +179,9 @@ export class FlightkitTable extends HTMLElement { tableElement.append(this._createElement('caption')); } - const orderedData = this.contents.execute(); let filteredData = [] if (this.filter.length) { - for (const data of orderedData) { + for (const data of tableData) { let valuesInData = Object.values(data).join(" ").toLowerCase(); if (valuesInData.includes(this.filter)) { @@ -195,7 +190,7 @@ export class FlightkitTable extends HTMLElement { } } else { - filteredData = orderedData + filteredData = tableData } diff --git a/flightkit/components/tree-navigation.js b/flightkit/components/tree-navigation.js index 6d0f6d8..75f973f 100644 --- a/flightkit/components/tree-navigation.js +++ b/flightkit/components/tree-navigation.js @@ -1,5 +1,5 @@ -import { folderListIcon, fileListIcon, databaseListIcon, tableListIcon, columnListIcon } from '../htmlbuilder/icons'; -import { returnDataSetValue, returnEventWithTopLevelElement } from '../htmlbuilder/domTraversal'; +import { folderListIcon, fileListIcon, databaseListIcon, tableListIcon, columnListIcon } from '../flightkit-functions/icons'; +import { returnDataSetValue, returnEventWithTopLevelElement } from '../flightkit-functions/domTraversal'; import { BaseComponent } from './extensions/base_component'; export class FlightkitTreeNavigation extends HTMLElement { diff --git a/flightkit/htmlbuilder/domTraversal.js b/flightkit/flightkit-functions/domTraversal.js similarity index 100% rename from flightkit/htmlbuilder/domTraversal.js rename to flightkit/flightkit-functions/domTraversal.js diff --git a/flightkit/htmlbuilder/icons.js b/flightkit/flightkit-functions/icons.js similarity index 100% rename from flightkit/htmlbuilder/icons.js rename to flightkit/flightkit-functions/icons.js diff --git a/flightkit/flightkit-functions/sorting.js b/flightkit/flightkit-functions/sorting.js new file mode 100644 index 0000000..4f72db7 --- /dev/null +++ b/flightkit/flightkit-functions/sorting.js @@ -0,0 +1,144 @@ +/** + * @param {*} jsonArray + * @param {Object} sortDetails ( propertyName: string, direction: 'asc' | 'desc' ) + * @returns + */ +export function sortJsonArray(jsonArray, sortDetails) { + if (!sortDetails || sortDetails.length === 0) return jsonArray; + + /** need to make a copy, sort is in-place. Else original order would be lost */ + const newJsonArray = Object.assign([], jsonArray); + + if (Array.isArray(newJsonArray[0])) { + sortGroupedJsonArray(newJsonArray, sortDetails); + } + else { + newJsonArray.sort(sortFunction(sortDetails)); + } + + return newJsonArray; +}; + +export const sortGroupedJsonArray = (groupedJsonArray, sortDetails) => { + const result = []; + for (const jsonArray of groupedJsonArray) { + result.push(jsonArray.sort(sortFunction(sortDetails))); + } + return result; +}; + +function extractNumber(value) { + let testString = value.toString() + let match = testString.match(/^\d+|\d+$/); + return match ? parseInt(match[0]) : null; +} + +function isBoolean(value) { + if (typeof value === 'boolean') return true; + + if (typeof value === 'string') { + const comparison = value.toLocaleLowerCase(); + return comparison === 'true' || comparison === 'false' + } + return false; +} + +function getBooleanValue(value) { + if (typeof value === 'boolean') return value; + return value.toLocaleLowerCase() === 'true' +} + +function sortFunction(applicableSorters, index = 0) { + return function (a, b) { + + const { propertyName, direction } = applicableSorters[index]; + + /** if it is undefined, just make it a string. */ + let valueA = a[propertyName] === null || a[propertyName] === undefined ? '' : a[propertyName]; + let valueB = b[propertyName] === null || b[propertyName] === undefined ? '' : b[propertyName]; + + const dateRegex = /^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim; + + const valuesAreDates = (valueA instanceof Date && valueB instanceof Date) || (dateRegex.test(valueA) && dateRegex.test(valueB)); + if (valuesAreDates) { + valueA = valueA instanceof Date ? valueA.valueOf() : new Date(Date.parse(valueA)); + valueB = valueB instanceof Date ? valueB.valueOf() : new Date(Date.parse(valueB)); + } + + /** need to check for booleans, else valueA and valueB become NaN */ + const valuesAreBooleans = isBoolean(valueA) && isBoolean(valueB); + const valuesAreNumbers = !valuesAreBooleans && !isNaN(valueA) && !isNaN(valueB); + + const valueAHasNumber = extractNumber(valueA) + const valueBHasNumber = extractNumber(valueB) + + if (valuesAreNumbers) { + valueA = parseFloat(valueA).toPrecision(12); + valueB = parseFloat(valueB).toPrecision(12); + } + else if (valueAHasNumber !== null && valueBHasNumber !== null) { + valueA = parseFloat(valueAHasNumber).toPrecision(12); + valueB = parseFloat(valueBHasNumber).toPrecision(12); + } + + if (valuesAreBooleans) { + valueA = getBooleanValue(valueA); + valueB = getBooleanValue(valueB); + } + + /** set the values genericly */ + let leftHandValue, rightHandValue; + + switch (direction) { + case 'descending': + case 'desc': { + leftHandValue = valueB; + rightHandValue = valueA; + break; + } + default: { + leftHandValue = valueA; + rightHandValue = valueB; + break; + } + } + + // check if -1 or 1, 0. if 0 then check again. + let comparisonValue = 0; + + if (valuesAreBooleans || valuesAreDates || valuesAreNumbers) { + /** Yes this works for all these things. :D */ + comparisonValue = leftHandValue - rightHandValue; + } + else { + leftHandValue = leftHandValue.toString().trim().toLowerCase(); + rightHandValue = rightHandValue.toString().trim().toLowerCase(); + + const digitRegex = /\d/gmi; + + /** use this for the additional options in localeCompare */ + const valuesAreAlphaNumeric = digitRegex.test(valueA) && digitRegex.test(valueB); + + if (valuesAreAlphaNumeric) { + comparisonValue = leftHandValue.localeCompare(rightHandValue, undefined, { + numeric: true, + sensitivity: 'base' + }); + } + else { + comparisonValue = leftHandValue.localeCompare(rightHandValue); + } + } + + const nextSorterIndex = index + 1; + + /** the value is the same for this property and we have more sorters then go to the next */ + if (comparisonValue === 0 && nextSorterIndex < applicableSorters.length) { + const sortWrapper = sortFunction(applicableSorters, nextSorterIndex); + return sortWrapper(a, b); + } + else { + return comparisonValue; + } + }; +} \ No newline at end of file diff --git a/flightkit/htmlbuilder/uuid_v4.js b/flightkit/flightkit-functions/uuid_v4.js similarity index 100% rename from flightkit/htmlbuilder/uuid_v4.js rename to flightkit/flightkit-functions/uuid_v4.js diff --git a/flightkit/package-lock.json b/flightkit/package-lock.json index ecbbcd8..f5ebdb4 100644 --- a/flightkit/package-lock.json +++ b/flightkit/package-lock.json @@ -7,9 +7,6 @@ "": { "name": "flightkit", "version": "0.0.1", - "dependencies": { - "@pennions/joq": "^1.4.0" - }, "devDependencies": { "vite": "^5.1.0" } @@ -382,11 +379,6 @@ "node": ">=12" } }, - "node_modules/@pennions/joq": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@pennions/joq/-/joq-1.4.0.tgz", - "integrity": "sha512-zAyuMo+eTGPY/iTgeHabQUwiXmIPfGM8zruULGb3vBKHBDH8ZQJmqH2g2gXy1ecSjgNxsP259A9Fzlxm5CBx1g==" - }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.9.6", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz", @@ -925,11 +917,6 @@ "dev": true, "optional": true }, - "@pennions/joq": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@pennions/joq/-/joq-1.4.0.tgz", - "integrity": "sha512-zAyuMo+eTGPY/iTgeHabQUwiXmIPfGM8zruULGb3vBKHBDH8ZQJmqH2g2gXy1ecSjgNxsP259A9Fzlxm5CBx1g==" - }, "@rollup/rollup-android-arm-eabi": { "version": "4.9.6", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz", diff --git a/flightkit/package.json b/flightkit/package.json index 896498c..f8aab24 100644 --- a/flightkit/package.json +++ b/flightkit/package.json @@ -10,8 +10,5 @@ }, "devDependencies": { "vite": "^5.1.0" - }, - "dependencies": { - "@pennions/joq": "^1.4.0" } } diff --git a/package.json b/package.json index 3e8efda..cf8654d 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "@pennions/ibiss", - "version": "0.0.6", + "version": "0.0.7", "avian_version": "0.0.2", - "flightkit_version": "0.0.6", + "flightkit_version": "0.0.7", "htmx_plugin_version": "0.0.1", "rocketjs_version": "0.0.1", "description": "Frontend library of Pennions",