dendelion-ui 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dendelion-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");var T=(t=>(t[t.Primary=0]="Primary",t[t.PrimaryContent=1]="PrimaryContent",t[t.Secondary=2]="Secondary",t[t.SecondaryContent=3]="SecondaryContent",t[t.Accent=4]="Accent",t[t.AccentContent=5]="AccentContent",t[t.Neutral=6]="Neutral",t[t.NeutralContent=7]="NeutralContent",t[t.Base100=8]="Base100",t[t.Base200=9]="Base200",t[t.Base300=10]="Base300",t[t.BaseContent=11]="BaseContent",t[t.Info=12]="Info",t[t.InfoContent=13]="InfoContent",t[t.Success=14]="Success",t[t.SuccessContent=15]="SuccessContent",t[t.Warning=16]="Warning",t[t.WarningContent=17]="WarningContent",t[t.Error=18]="Error",t[t.ErrorContent=19]="ErrorContent",t))(T||{});class
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");var T=(t=>(t[t.Primary=0]="Primary",t[t.PrimaryContent=1]="PrimaryContent",t[t.Secondary=2]="Secondary",t[t.SecondaryContent=3]="SecondaryContent",t[t.Accent=4]="Accent",t[t.AccentContent=5]="AccentContent",t[t.Neutral=6]="Neutral",t[t.NeutralContent=7]="NeutralContent",t[t.Base100=8]="Base100",t[t.Base200=9]="Base200",t[t.Base300=10]="Base300",t[t.BaseContent=11]="BaseContent",t[t.Info=12]="Info",t[t.InfoContent=13]="InfoContent",t[t.Success=14]="Success",t[t.SuccessContent=15]="SuccessContent",t[t.Warning=16]="Warning",t[t.WarningContent=17]="WarningContent",t[t.Error=18]="Error",t[t.ErrorContent=19]="ErrorContent",t))(T||{});class j{static toClassName(n){switch(n){case 0:return"bg-primary";case 1:return"bg-primary-content";case 2:return"bg-secondary";case 3:return"bg-secondary-content";case 4:return"bg-accent";case 5:return"bg-accent-content";case 6:return"bg-neutral";case 7:return"bg-neutral-content";case 8:return"base-100";case 9:return"bg-base-200";case 10:return"bg-base-300";case 11:return"bg-base-content";case 12:return"bg-info";case 13:return"bg-info-content";case 14:return"bg-success";case 15:return"bg-success-content";case 16:return"bg-warning";case 17:return"bg-warning-content";case 18:return"bg-error";case 19:return"bg-error-content";default:return"bg-base-content"}}}class H{static toClassName(n){switch(n){case 0:return"btn-primary";case 1:return"btn-primary-content";case 2:return"btn-secondary";case 3:return"btn-secondary-content";case 4:return"btn-accent";case 5:return"btn-accent-content";case 6:return"btn-neutral";case 7:return"btn-neutral-content";case 8:return"base-100";case 9:return"btn-base-200";case 10:return"btn-base-300";case 11:return"btn-base-content";case 12:return"btn-info";case 13:return"btn-info-content";case 14:return"btn-success";case 15:return"btn-success-content";case 16:return"btn-warning";case 17:return"btn-warning-content";case 18:return"btn-error";case 19:return"btn-error-content";default:return"btn-base-content"}}}class ae{static toClassName(n){switch(n){case 0:return"text-primary";case 1:return"text-primary-content";case 2:return"text-secondary";case 3:return"text-secondary-content";case 4:return"text-accent";case 5:return"text-accent-content";case 6:return"text-neutral";case 7:return"text-neutral-content";case 8:return"base-100";case 9:return"text-base-200";case 10:return"text-base-300";case 11:return"text-base-content";case 12:return"text-info";case 13:return"text-info-content";case 14:return"text-success";case 15:return"text-success-content";case 16:return"text-warning";case 17:return"text-warning-content";case 18:return"text-error";case 19:return"text-error-content";default:return"text-base-content"}}}var L=(t=>(t[t.XS=0]="XS",t[t.SM=1]="SM",t[t.MD=2]="MD",t[t.LG=3]="LG",t[t.XL=4]="XL",t[t.TWOXL=5]="TWOXL",t[t.THREEXL=6]="THREEXL",t))(L||{});class G{static toClassName(n){switch(n){case 0:return"btn-xs";case 1:return"btn-sm";case 2:return"btn-md";case 3:return"btn-lg";case 4:return"btn-xl";case 5:return"btn-2xl";case 6:return"btn-3xl";default:return"btn-md"}}}class J{static toClassName(n){switch(n){case 0:return"rounded-xs";case 1:return"rounded-sm";case 2:return"rounded-md";case 3:return"rounded-lg";case 4:return"rounded-xl";case 5:return"rounded-2xl";case 6:return"rounded-3xl";default:return"rounded-md"}}}class Z{static toClassName(n){switch(n){case 0:return"table-xs";case 1:return"table-sm";case 2:return"table-md";case 3:return"table-lg";case 4:return"table-xl";case 5:return"table-2xl";case 6:return"table-3xl";default:return"table-md"}}}function Y(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var D={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/var A;function ae(){return A||(A=1,function(t){(function(){var n={}.hasOwnProperty;function a(){for(var r="",c=0;c<arguments.length;c++){var d=arguments[c];d&&(r=s(r,o(d)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return a.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var d in r)n.call(r,d)&&r[d]&&(c=s(c,d));return c}function s(r,c){return c?r?r+" "+c:r+c:r}t.exports?(a.default=a,t.exports=a):window.classNames=a})()}(D)),D.exports}var se=ae();const M=Z(se),oe=["type","disabled"],ce={class:"group-[.is-loading]:text-transparent"},le=e.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:T.Neutral},soft:{type:Boolean,default:!1},outline:{type:Boolean,default:!1},disabled:{type:Boolean},click:{}},setup(t){const n=t,a=e.computed(()=>M("btn","group",j.toClassName(n.color),n.soft?"btn-soft":"",n.outline?"btn-outline":"",n.loading?"is-loading":"",n.disabled?"disabled":""));return(o,s)=>(e.openBlock(),e.createElementBlock("button",{onClick:s[0]||(s[0]=r=>o.click?o.click:void 0),class:e.normalizeClass(a.value),type:o.type,disabled:o.disabled||o.loading},[s[1]||(s[1]=e.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),e.createElementVNode("span",ce,[e.renderSlot(o.$slots,"default")])],10,oe))}}),P=(t,n)=>{const a=t.__vccOpts||t;for(const[o,s]of n)a[o]=s;return a},ue={};function ie(t,n){return e.openBlock(),e.createElementBlock("button")}const de=P(ue,[["render",ie]]),pe=e.defineComponent({__name:"Card",props:{backgroundColor:{default:T.Primary},shadow:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},rounded:{type:Boolean},roundedSize:{}},setup(t){const n=t,a=e.ref(M("card",K.toClassName(n.backgroundColor),n.shadow?"shadow-lg":"",n.fullWidth?"w-full":"",n.rounded&&!n.roundedSize?"rounded":n.roundedSize?G.toClassName(n.roundedSize):""));return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(o.$slots,"default")],2))}}),fe={},me={class:"card-body"};function be(t,n){return e.openBlock(),e.createElementBlock("div",me,[e.renderSlot(t.$slots,"default")])}const ve=P(fe,[["render",be]]),ge=e.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(t){return(n,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.is),{class:"card-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.text),1)]),_:1}))}}),he=e.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(t){const n=t,a=e.ref([n.container?"container":"",n.padding?"p-6":""]);return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(o.$slots,"default")],2))}}),V=(t,n)=>String(!t||typeof t!="object"?t:n.split(".").reduce((a,o)=>a&&(typeof a=="object"?a[o]:a),t));var O={},W={},q;function Y(){return q||(q=1,function(t){t.__esModule=!0,t.default=s;var n=/[\u0300-\u036f]/g,a=/ł/g,o=/ñ/g;function s(r){return r.toLowerCase().normalize("NFD").replace(n,"").replace(a,"l").replace(o,"n").trim()}}(W)),W}var z={},U;function I(){if(U)return z;U=1,z.__esModule=!0,z.aggressiveFuzzyMatch=v,z.createFuzzySearchImpl=k,z.experimentalSmartFuzzyMatch=w,z.fuzzyMatchImpl=x;var t=n(Y());function n(u){return u&&u.__esModule?u:{default:u}}var a=Number.MAX_SAFE_INTEGER,o=function(l,f){return l.score-f.score},s=function(l,f){return l[0]-f[0]},r=new Set(` []()-–—'"“”`.split(""));function c(u){return r.has(u)}function d(u,l,f,h,i,g,m){if(u===h)return[0,[[0,u.length-1]]];var p=h.length,b=l.length,y=i.length;if(l===i)return[.1,[[0,b-1]]];if(l.startsWith(i))return[.5,[[0,y-1]]];var S=u.indexOf(h);if(S>-1&&c(u[S-1]))return[.9,[[S,S+p-1]]];var _=l.indexOf(i);if(_>-1&&c(l[_-1]))return[1,[[_,_+p-1]]];var C=g.length;if(C>1&&g.every(function(N){return f.has(N)})){var E=1.5+C*.2;return[E,g.map(function(N){var $=l.indexOf(N);return[$,$+N.length-1]}).sort(s)]}return _>-1?[2,[[_,_+p-1]]]:m==="aggressive"?v(l,i):m==="smart"?w(l,i):null}function v(u,l){for(var f=u.length,h=l.length,i=0,g=l[i],m=[],p=-1,b=-2,y=0;y<f;y+=1)if(u[y]===g){if(y!==b+1&&(p>=0&&m.push([p,b]),p=y),b=y,i+=1,i===h)return m.push([p,b]),B(m,u);g=l[i]}return null}function w(u,l){for(var f=u.length,h=[],i=0,g=l[i],m=-1,p=-2;;){var b=u.indexOf(g,p+1);if(b===-1)break;if(b===0||c(u[b-1]))m=b;else{var y=l.length-i,S=u.length-b,_=Math.min(3,y,S),C=l.slice(i,i+_);if(u.slice(b,b+_)===C)m=b;else{p+=1;continue}}for(p=m;p<f&&u[p]===g;p+=1)i+=1,g=l[i];if(p-=1,h.push([m,p]),i===l.length)return B(h,u)}return null}function B(u,l){var f=2;return u.forEach(function(h){var i=h[0],g=h[1],m=g-i+1,p=i===0||l[i]===" "||l[i-1]===" ",b=g===l.length-1||l[g]===" "||l[g+1]===" ",y=p&&b;y?f+=.2:p?f+=.4:m>=3?f+=.8:f+=1.6}),[f,u]}function x(u,l){var f=(0,t.default)(l),h=f.split(" "),i=(0,t.default)(u),g=new Set(i.split(" ")),m=d(u,i,g,l,f,h,"smart");return m?{item:u,score:m[0],matches:[m[1]]}:null}function k(u,l){var f=l.strategy,h=f===void 0?"aggressive":f,i=l.getText,g=u.map(function(m){var p;if(i)p=i(m);else{var b=l.key?m[l.key]:m;p=[b]}var y=p.map(function(S){var _=S||"",C=(0,t.default)(_),E=new Set(C.split(" "));return[_,C,E]});return[m,y]});return function(m){var p=[],b=(0,t.default)(m),y=b.split(" ");return b.length?(g.forEach(function(S){for(var _=S[0],C=S[1],E=a,N=[],$=0,Q=C.length;$<Q;$+=1){var F=C[$],ee=F[0],te=F[1],ne=F[2],R=d(ee,te,ne,m,b,y,h);R?(E=Math.min(E,R[0]),N.push(R[1])):N.push(null)}E<a&&p.push({item:_,score:E,matches:N})}),p.sort(o),p):[]}}return z}var X;function ye(){return X||(X=1,function(t){t.__esModule=!0,t.default=o,t.fuzzyMatch=s;var n=a(Y());t.normalizeText=n.default;function a(r){return r&&r.__esModule?r:{default:r}}function o(r,c){return c===void 0&&(c={}),I().createFuzzySearchImpl(r,c)}function s(r,c){return I().fuzzyMatchImpl(r,c)}}(O)),O}var _e=ye();const ke=Z(_e),Be={key:0},xe={key:0},Se=["innerHTML"],Ce={key:1},we={key:2},Ee=e.defineComponent({__name:"TableColumn",props:{column:{},row:{},rowIndex:{}},setup(t){const n=t,a=e.computed(()=>n.column.render?n.column.render(V(n.row,n.column.data),n.row):V(n.row,n.column.data));e.onMounted(()=>{a.value&&typeof a.value=="object"&&"then"in a.value&&console.warn("Async component detected in TableColumn, this may cause issues with rendering.")});const o=(r,c)=>c.render===void 0?{}:c.render(V(r,c.data),r).props,s=r=>(console.log("getComponent",r),r&&typeof r=="object"&&"then"in r?e.defineAsyncComponent(()=>r):typeof r=="function"?e.defineAsyncComponent(r):r);return(r,c)=>(e.openBlock(),e.createElementBlock("td",null,[r.column.render?r.row?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.value?(e.openBlock(),e.createElementBlock("div",Be,[typeof a.value=="string"?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{innerHTML:a.value},null,8,Se)])):e.isVNode(a.value)?(e.openBlock(),e.createElementBlock("div",Ce,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value)))])):(e.openBlock(),e.createElementBlock("div",we,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s(a.value.component)),e.normalizeProps(e.guardReactiveProps(o(r.row,r.column))),null,16))]))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(V)(r.row,r.column.data)),1)],64))]))}}),Ne={key:0},ze=["colspan"],Ve=["onClick"],$e=e.defineComponent({__name:"Table",props:{zebra:{type:Boolean,default:!1},pinRows:{type:Boolean,default:!1},pinCols:{type:Boolean,default:!1},size:{default:L.MD},columns:{},dataSource:{},ajax:{},searchValue:{},searchFunction:{},onRowClick:{}},setup(t){const n=e.ref([]),a=e.ref([]),o=e.ref(null),s=t,r=e.ref(M("table",J.toClassName(s.size),{"table-zebra":s.zebra,"table-pin-rows":s.pinRows,"table-pin-cols ":s.pinCols})),c=(v,w)=>{s.onRowClick&&s.onRowClick(v,w)};e.onMounted(()=>{n.value=s.dataSource,a.value=s.dataSource}),e.watch(()=>s.dataSource,v=>{console.log("dataSource changed",v),n.value=v,a.value=v},{immediate:!0}),e.watch(()=>s.searchValue,v=>{if(s.searchFunction){a.value=s.searchFunction(v??"");return}a.value=v?d(v):n.value},{immediate:!0});const d=v=>{const w=[];return n.value.length>0?(Object.keys(n.value[0]).forEach(x=>{const k=n.value.map(f=>V(f,x)),l=ke(k)(v);for(const f of l){const h=n.value.filter(i=>V(i,x)===f.item);w.push(...h)}}),w):[]};return(v,w)=>(e.openBlock(),e.createElementBlock("table",{ref_key:"table",ref:o,class:e.normalizeClass(r.value)},[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.columns,B=>(e.openBlock(),e.createElementBlock("th",{key:B.title},e.toDisplayString(B.title),1))),128))])]),e.createElementVNode("tbody",null,[a.value.length===0?(e.openBlock(),e.createElementBlock("tr",Ne,[e.createElementVNode("td",{colspan:s.columns.length},"No data found",8,ze)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.value,(B,x)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass(s.onRowClick?"hover":""),key:JSON.stringify(B),onClick:k=>c(B,x)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.columns,k=>(e.openBlock(),e.createBlock(Ee,{key:k.data,column:k,row:B,rowIndex:x},null,8,["column","row","rowIndex"]))),128))],10,Ve))),128))])],2))}}),Me=e.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(t,{expose:n,emit:a}){const o=t,s=e.ref(o.value),r=a,c=d=>{s.value=d,r("update:value",d)};return e.provide("stepper",{value:s,updateValue:c}),e.watch(()=>o.value,d=>{s.value=d}),n({updateValue:c}),(d,v)=>e.renderSlot(d.$slots,"default",{updateValue:c})}}),Te=e.defineComponent({__name:"Step",props:{value:{}},setup(t){const n=t,a=e.inject("stepper"),o=e.ref("");return e.watch(()=>a?.value.value,s=>{s&&n.value&&(o.value=Number(s)>=Number(n.value)?"step-primary":"")}),e.onMounted(()=>{a&&(o.value=a.value.value===n.value?"step-primary":"",Number(a.value.value)>=Number(n.value)&&(o.value="step-primary"))}),(s,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["step",o.value])},[e.renderSlot(s.$slots,"default")],2))}}),Le={},Fe={class:"steps"};function Re(t,n){return e.openBlock(),e.createElementBlock("ul",Fe,[e.renderSlot(t.$slots,"default")])}const De=P(Le,[["render",Re]]),Oe={key:0},We=e.defineComponent({__name:"StepPanels",setup(t){const n=e.inject("stepper");return(a,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[e.unref(n)?.value?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(a.$slots,"default",{currentStep:e.unref(n)?.value})])):e.createCommentVNode("",!0)]),_:3}))}}),Pe={key:0},Ae=e.defineComponent({__name:"StepPanel",props:{value:{}},setup(t,{expose:n}){const a=e.computed(()=>o?.value.value),o=e.inject("stepper"),s=r=>{o&&o.updateValue(r.toString())};return n({activateCallback:s}),(r,c)=>r.value===a.value?(e.openBlock(),e.createElementBlock("div",Pe,[e.renderSlot(r.$slots,"default",{activateCallback:s})])):e.createCommentVNode("",!0)}}),qe={key:0,method:"dialog"},Ue=e.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1},closeButtonSize:{default:L.SM},extraBoxClasses:{}},emits:["close"],setup(t,{expose:n,emit:a}){const o=e.ref(null),s=a,r=t,c=e.ref(M("modal-box",r.extraBoxClasses,{"overflow-visible":r.overflow})),d=e.ref(M("modal")),v=e.ref(M("btn",H.toClassName(r.closeButtonSize),"btn-circle","btn-ghost","absolute","right-2","top-2"));return n({showModal:()=>{o.value?.showModal()},closeModal:()=>{o.value?.close()}}),(x,k)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"modal",ref:o,class:e.normalizeClass([d.value,x.$attrs.class]),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:k[0]||(k[0]=u=>s("close",u))},[e.createElementVNode("div",{class:e.normalizeClass(c.value)},[x.closeButton?(e.openBlock(),e.createElementBlock("form",qe,[e.createElementVNode("button",{class:e.normalizeClass(v.value)},"✕",2)])):e.createCommentVNode("",!0),e.renderSlot(x.$slots,"default")],2),k[1]||(k[1]=e.createElementVNode("form",{method:"dialog",class:"modal-backdrop"},[e.createElementVNode("button",null,"close")],-1))],34))}}),Ie={class:"hidden w-full max-w-sm lg:flex"},Xe={class:"relative mx-3 w-full"},Ke={class:"relative w-full max-w-full"},je=["value"],He=e.defineComponent({__name:"SearchBar",props:["modelValue"],emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=e.ref(null),s=n,r=c=>{(c.ctrlKey||c.metaKey)&&c.key.toLowerCase()==="k"&&(c.preventDefault(),o.value&&o.value.focus())};return e.onMounted(()=>{document.addEventListener("keydown",r)}),e.onUnmounted(()=>{document.removeEventListener("keydown",r)}),(c,d)=>(e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("label",Xe,[d[1]||(d[1]=e.createElementVNode("svg",{class:"pointer-events-none absolute z-10 my-3.5 ms-4 text-base-content opacity-60","aria-hidden":"true",width:"16",height:"16",viewBox:"0.48 0.48 23.04 23.04",fill:"currentColor"},[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"}),e.createElementVNode("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})],-1)),e.createElementVNode("div",Ke,[e.createElementVNode("form",null,[e.createElementVNode("input",{ref_key:"searchInput",ref:o,type:"search",placeholder:"Zoeken...",value:a.modelValue,onInput:d[0]||(d[0]=v=>s("update:modelValue",v.target.value)),class:"color-[inherit] w-full rounded-xl border-[2px] border-solid border-transparent bg-transparent px-3 py-2 ps-10 focus:border-[2px] focus:border-base-200 focus:outline-none"},null,40,je)])]),d[2]||(d[2]=e.createElementVNode("div",{class:"pointer-events-none absolute end-10 top-2.5 hidden gap-1 opacity-50 lg:flex rtl:flex-row-reverse"},[e.createElementVNode("kbd",{class:"kbd kbd-sm"},"ctrl"),e.createElementVNode("kbd",{class:"kbd kbd-sm"},"K")],-1))])]))}}),Ge=["bg-primary","bg-primary-content","bg-secondary","bg-secondary-content","bg-accent","bg-accent-content","bg-neutral","bg-neutral-content","bg-base-100","bg-base-200","bg-base-300","bg-base-content","bg-info","bg-info-content","bg-success","bg-success-content","bg-warning","bg-warning-content","bg-error","bg-error-content","btn-primary","btn-primary-content","btn-secondary","btn-secondary-content","btn-accent","btn-accent-content","btn-neutral","btn-neutral-content","btn-base-100","btn-base-200","btn-base-300","btn-base-content","btn-info","btn-info-content","btn-success","btn-success-content","btn-warning","btn-warning-content","btn-error","btn-error-content","text-primary","text-primary-content","text-secondary","text-secondary-content","text-accent","text-accent-content","text-neutral","text-neutral-content","text-base-100","text-base-200","text-base-300","text-base-content","text-info","text-info-content","text-success","text-success-content","text-warning","text-warning-content","text-error","text-error-content","text-transparent","step","steps","modal","modal-box","btn","btn-sm","btn-circle","btn-ghost","absolute","right-2","top-2","shadow-lg","w-full","rounded-xs","rounded-sm","rounded-md","rounded-lg","rounded-xl","rounded-2xl","rounded-3xl","hidden","block"];exports.BackgroundColorUtils=K;exports.Button=le;exports.ButtonColorUtils=j;exports.ButtonSizeUtils=H;exports.Card=pe;exports.CardBody=ve;exports.CardTitle=ge;exports.Color=T;exports.Container=he;exports.Modal=Ue;exports.RoundedSizeUtils=G;exports.SearchBar=He;exports.SimpleButton=de;exports.Size=L;exports.Step=Te;exports.StepList=De;exports.StepPanel=Ae;exports.StepPanels=We;exports.Stepper=Me;exports.Table=$e;exports.TableSizeUtils=J;exports.TextColorUtils=re;exports.dendelionSafeList=Ge;exports.getValue=V;
|
|
5
|
+
*/var A;function oe(){return A||(A=1,function(t){(function(){var n={}.hasOwnProperty;function a(){for(var r="",c=0;c<arguments.length;c++){var d=arguments[c];d&&(r=o(r,s(d)))}return r}function s(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return a.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var d in r)n.call(r,d)&&r[d]&&(c=o(c,d));return c}function o(r,c){return c?r?r+" "+c:r+c:r}t.exports?(a.default=a,t.exports=a):window.classNames=a})()}(D)),D.exports}var se=oe();const M=Y(se),ce=["type","disabled"],le={class:"group-[.is-loading]:text-transparent"},ue=e.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:T.Neutral},soft:{type:Boolean,default:!1},outline:{type:Boolean,default:!1},disabled:{type:Boolean},click:{}},setup(t){const n=t,a=e.computed(()=>M("btn","group",H.toClassName(n.color),n.soft?"btn-soft":"",n.outline?"btn-outline":"",n.loading?"is-loading":"",n.disabled?"disabled":""));return(s,o)=>(e.openBlock(),e.createElementBlock("button",{onClick:o[0]||(o[0]=r=>s.click?s.click:void 0),class:e.normalizeClass(a.value),type:s.type,disabled:s.disabled||s.loading},[o[1]||(o[1]=e.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),e.createElementVNode("span",le,[e.renderSlot(s.$slots,"default")])],10,ce))}}),P=(t,n)=>{const a=t.__vccOpts||t;for(const[s,o]of n)a[s]=o;return a},ie={};function de(t,n){return e.openBlock(),e.createElementBlock("button")}const pe=P(ie,[["render",de]]),fe=e.defineComponent({__name:"Card",props:{backgroundColor:{default:T.Primary},shadow:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},rounded:{type:Boolean},roundedSize:{}},setup(t){const n=t,a=e.ref(M("card",j.toClassName(n.backgroundColor),n.shadow?"shadow-lg":"",n.fullWidth?"w-full":"",n.rounded&&!n.roundedSize?"rounded":n.roundedSize?J.toClassName(n.roundedSize):""));return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(s.$slots,"default")],2))}}),me={},be={class:"card-body"};function ve(t,n){return e.openBlock(),e.createElementBlock("div",be,[e.renderSlot(t.$slots,"default")])}const ge=P(me,[["render",ve]]),he=e.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(t){return(n,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.is),{class:"card-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.text),1)]),_:1}))}}),ye=e.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(t){const n=t,a=e.ref([n.container?"container":"",n.padding?"p-6":""]);return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(s.$slots,"default")],2))}}),V=(t,n)=>String(!t||typeof t!="object"?t:n.split(".").reduce((a,s)=>a&&(typeof a=="object"?a[s]:a),t));var O={},W={},q;function Q(){return q||(q=1,function(t){t.__esModule=!0,t.default=o;var n=/[\u0300-\u036f]/g,a=/ł/g,s=/ñ/g;function o(r){return r.toLowerCase().normalize("NFD").replace(n,"").replace(a,"l").replace(s,"n").trim()}}(W)),W}var z={},U;function I(){if(U)return z;U=1,z.__esModule=!0,z.aggressiveFuzzyMatch=b,z.createFuzzySearchImpl=B,z.experimentalSmartFuzzyMatch=E,z.fuzzyMatchImpl=x;var t=n(Q());function n(u){return u&&u.__esModule?u:{default:u}}var a=Number.MAX_SAFE_INTEGER,s=function(l,f){return l.score-f.score},o=function(l,f){return l[0]-f[0]},r=new Set(` []()-–—'"“”`.split(""));function c(u){return r.has(u)}function d(u,l,f,h,i,g,m){if(u===h)return[0,[[0,u.length-1]]];var p=h.length,v=l.length,y=i.length;if(l===i)return[.1,[[0,v-1]]];if(l.startsWith(i))return[.5,[[0,y-1]]];var S=u.indexOf(h);if(S>-1&&c(u[S-1]))return[.9,[[S,S+p-1]]];var _=l.indexOf(i);if(_>-1&&c(l[_-1]))return[1,[[_,_+p-1]]];var C=g.length;if(C>1&&g.every(function(N){return f.has(N)})){var w=1.5+C*.2;return[w,g.map(function(N){var $=l.indexOf(N);return[$,$+N.length-1]}).sort(o)]}return _>-1?[2,[[_,_+p-1]]]:m==="aggressive"?b(l,i):m==="smart"?E(l,i):null}function b(u,l){for(var f=u.length,h=l.length,i=0,g=l[i],m=[],p=-1,v=-2,y=0;y<f;y+=1)if(u[y]===g){if(y!==v+1&&(p>=0&&m.push([p,v]),p=y),v=y,i+=1,i===h)return m.push([p,v]),k(m,u);g=l[i]}return null}function E(u,l){for(var f=u.length,h=[],i=0,g=l[i],m=-1,p=-2;;){var v=u.indexOf(g,p+1);if(v===-1)break;if(v===0||c(u[v-1]))m=v;else{var y=l.length-i,S=u.length-v,_=Math.min(3,y,S),C=l.slice(i,i+_);if(u.slice(v,v+_)===C)m=v;else{p+=1;continue}}for(p=m;p<f&&u[p]===g;p+=1)i+=1,g=l[i];if(p-=1,h.push([m,p]),i===l.length)return k(h,u)}return null}function k(u,l){var f=2;return u.forEach(function(h){var i=h[0],g=h[1],m=g-i+1,p=i===0||l[i]===" "||l[i-1]===" ",v=g===l.length-1||l[g]===" "||l[g+1]===" ",y=p&&v;y?f+=.2:p?f+=.4:m>=3?f+=.8:f+=1.6}),[f,u]}function x(u,l){var f=(0,t.default)(l),h=f.split(" "),i=(0,t.default)(u),g=new Set(i.split(" ")),m=d(u,i,g,l,f,h,"smart");return m?{item:u,score:m[0],matches:[m[1]]}:null}function B(u,l){var f=l.strategy,h=f===void 0?"aggressive":f,i=l.getText,g=u.map(function(m){var p;if(i)p=i(m);else{var v=l.key?m[l.key]:m;p=[v]}var y=p.map(function(S){var _=S||"",C=(0,t.default)(_),w=new Set(C.split(" "));return[_,C,w]});return[m,y]});return function(m){var p=[],v=(0,t.default)(m),y=v.split(" ");return v.length?(g.forEach(function(S){for(var _=S[0],C=S[1],w=a,N=[],$=0,ee=C.length;$<ee;$+=1){var F=C[$],te=F[0],ne=F[1],re=F[2],R=d(te,ne,re,m,v,y,h);R?(w=Math.min(w,R[0]),N.push(R[1])):N.push(null)}w<a&&p.push({item:_,score:w,matches:N})}),p.sort(s),p):[]}}return z}var X;function ke(){return X||(X=1,function(t){t.__esModule=!0,t.default=s,t.fuzzyMatch=o;var n=a(Q());t.normalizeText=n.default;function a(r){return r&&r.__esModule?r:{default:r}}function s(r,c){return c===void 0&&(c={}),I().createFuzzySearchImpl(r,c)}function o(r,c){return I().fuzzyMatchImpl(r,c)}}(O)),O}var Be=ke();const _e=Y(Be),xe={key:0},Se={key:0},Ce=["innerHTML"],Ee={key:1},we={key:2},K=e.defineComponent({__name:"TableColumn",props:{column:{},row:{},rowIndex:{}},setup(t){const n=t,a=e.computed(()=>n.column.render?n.column.render(V(n.row,n.column.data),n.row):V(n.row,n.column.data));e.onMounted(()=>{a.value&&typeof a.value=="object"&&"then"in a.value&&console.warn("Async component detected in TableColumn, this may cause issues with rendering.")});const s=(r,c)=>c.render===void 0?{}:c.render(V(r,c.data),r).props,o=r=>(console.log("getComponent",r),r&&typeof r=="object"&&"then"in r?e.defineAsyncComponent(()=>r):typeof r=="function"?e.defineAsyncComponent(r):r);return(r,c)=>(e.openBlock(),e.createElementBlock("td",null,[r.column.render?r.row?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.value?(e.openBlock(),e.createElementBlock("div",xe,[typeof a.value=="string"?(e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("div",{innerHTML:a.value},null,8,Ce)])):e.isVNode(a.value)?(e.openBlock(),e.createElementBlock("div",Ee,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value)))])):(e.openBlock(),e.createElementBlock("div",we,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o(a.value.component)),e.normalizeProps(e.guardReactiveProps(s(r.row,r.column))),null,16))]))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(V)(r.row,r.column.data)),1)],64))]))}}),Ne={key:0},ze={key:1},Ve={key:0},$e=["colspan"],Me=["onClick"],Te={key:2},Le={key:0},Fe=["colspan"],Re=e.defineComponent({__name:"Table",props:{zebra:{type:Boolean,default:!1},pinRows:{type:Boolean,default:!1},pinCols:{type:Boolean,default:!1},horizontal:{type:Boolean,default:!1},size:{default:L.MD},columns:{},dataSource:{},ajax:{},searchValue:{},searchFunction:{},onRowClick:{}},setup(t){const n=e.ref([]),a=e.ref([]),s=e.ref(null),o=t,r=e.ref(M("table",Z.toClassName(o.size),{"table-zebra":o.zebra,"table-pin-rows":o.pinRows,"table-pin-cols ":o.pinCols})),c=(b,E)=>{o.onRowClick&&o.onRowClick(b,E)};e.onMounted(()=>{n.value=o.dataSource,a.value=o.dataSource}),e.watch(()=>o.dataSource,b=>{console.log("dataSource changed",b),n.value=b,a.value=b},{immediate:!0}),e.watch(()=>o.searchValue,b=>{if(o.searchFunction){a.value=o.searchFunction(b??"");return}a.value=b?d(b):n.value},{immediate:!0});const d=b=>{const E=[];return n.value.length>0?(Object.keys(n.value[0]).forEach(x=>{const B=n.value.map(f=>V(f,x)),l=_e(B)(b);for(const f of l){const h=n.value.filter(i=>V(i,x)===f.item);E.push(...h)}}),E):[]};return(b,E)=>(e.openBlock(),e.createElementBlock("table",{ref_key:"table",ref:s,class:e.normalizeClass(r.value)},[b.horizontal?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("thead",Ne,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columns,k=>(e.openBlock(),e.createElementBlock("th",{key:k.title},e.toDisplayString(k.title),1))),128))])])),b.horizontal?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tbody",ze,[a.value.length===0?(e.openBlock(),e.createElementBlock("tr",Ve,[e.createElementVNode("td",{colspan:o.columns.length},"No data found",8,$e)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.value,(k,x)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass(o.onRowClick?"hover":""),key:JSON.stringify(k),onClick:B=>c(k,x)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columns,B=>(e.openBlock(),e.createBlock(K,{key:B.data,column:B,row:k,rowIndex:x},null,8,["column","row","rowIndex"]))),128))],10,Me))),128))])),b.horizontal?(e.openBlock(),e.createElementBlock("tbody",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columns,k=>(e.openBlock(),e.createElementBlock("tr",{key:k.title},[e.createElementVNode("th",null,e.toDisplayString(k.title),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(x,B)=>(e.openBlock(),e.createBlock(K,{key:B,column:k,row:x,rowIndex:B},null,8,["column","row","rowIndex"]))),128))]))),128)),a.value.length===0?(e.openBlock(),e.createElementBlock("tr",Le,[e.createElementVNode("td",{colspan:o.columns.length+1,style:{"text-align":"center",padding:"1rem"}}," No data found ",8,Fe)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),De=e.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(t,{expose:n,emit:a}){const s=t,o=e.ref(s.value),r=a,c=d=>{o.value=d,r("update:value",d)};return e.provide("stepper",{value:o,updateValue:c}),e.watch(()=>s.value,d=>{o.value=d}),n({updateValue:c}),(d,b)=>e.renderSlot(d.$slots,"default",{updateValue:c})}}),Oe=e.defineComponent({__name:"Step",props:{value:{}},setup(t){const n=t,a=e.inject("stepper"),s=e.ref("");return e.watch(()=>a?.value.value,o=>{o&&n.value&&(s.value=Number(o)>=Number(n.value)?"step-primary":"")}),e.onMounted(()=>{a&&(s.value=a.value.value===n.value?"step-primary":"",Number(a.value.value)>=Number(n.value)&&(s.value="step-primary"))}),(o,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["step",s.value])},[e.renderSlot(o.$slots,"default")],2))}}),We={},Pe={class:"steps"};function Ae(t,n){return e.openBlock(),e.createElementBlock("ul",Pe,[e.renderSlot(t.$slots,"default")])}const qe=P(We,[["render",Ae]]),Ue={key:0},Ie=e.defineComponent({__name:"StepPanels",setup(t){const n=e.inject("stepper");return(a,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[e.unref(n)?.value?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(a.$slots,"default",{currentStep:e.unref(n)?.value})])):e.createCommentVNode("",!0)]),_:3}))}}),Xe={key:0},Ke=e.defineComponent({__name:"StepPanel",props:{value:{}},setup(t,{expose:n}){const a=e.computed(()=>s?.value.value),s=e.inject("stepper"),o=r=>{s&&s.updateValue(r.toString())};return n({activateCallback:o}),(r,c)=>r.value===a.value?(e.openBlock(),e.createElementBlock("div",Xe,[e.renderSlot(r.$slots,"default",{activateCallback:o})])):e.createCommentVNode("",!0)}}),je={key:0,method:"dialog"},He=e.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1},closeButtonSize:{default:L.SM},extraBoxClasses:{}},emits:["close"],setup(t,{expose:n,emit:a}){const s=e.ref(null),o=a,r=t,c=e.ref(M("modal-box",r.extraBoxClasses,{"overflow-visible":r.overflow})),d=e.ref(M("modal")),b=e.ref(M("btn",G.toClassName(r.closeButtonSize),"btn-circle","btn-ghost","absolute","right-2","top-2"));return n({showModal:()=>{s.value?.showModal()},closeModal:()=>{s.value?.close()}}),(x,B)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"modal",ref:s,class:e.normalizeClass([d.value,x.$attrs.class]),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:B[0]||(B[0]=u=>o("close",u))},[e.createElementVNode("div",{class:e.normalizeClass(c.value)},[x.closeButton?(e.openBlock(),e.createElementBlock("form",je,[e.createElementVNode("button",{class:e.normalizeClass(b.value)},"✕",2)])):e.createCommentVNode("",!0),e.renderSlot(x.$slots,"default")],2),B[1]||(B[1]=e.createElementVNode("form",{method:"dialog",class:"modal-backdrop"},[e.createElementVNode("button",null,"close")],-1))],34))}}),Ge={class:"hidden w-full max-w-sm lg:flex"},Je={class:"relative mx-3 w-full"},Ze={class:"relative w-full max-w-full"},Ye=["value"],Qe=e.defineComponent({__name:"SearchBar",props:["modelValue"],emits:["update:modelValue"],setup(t,{emit:n}){const a=t,s=e.ref(null),o=n,r=c=>{(c.ctrlKey||c.metaKey)&&c.key.toLowerCase()==="k"&&(c.preventDefault(),s.value&&s.value.focus())};return e.onMounted(()=>{document.addEventListener("keydown",r)}),e.onUnmounted(()=>{document.removeEventListener("keydown",r)}),(c,d)=>(e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("label",Je,[d[1]||(d[1]=e.createElementVNode("svg",{class:"pointer-events-none absolute z-10 my-3.5 ms-4 text-base-content opacity-60","aria-hidden":"true",width:"16",height:"16",viewBox:"0.48 0.48 23.04 23.04",fill:"currentColor"},[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"}),e.createElementVNode("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})],-1)),e.createElementVNode("div",Ze,[e.createElementVNode("form",null,[e.createElementVNode("input",{ref_key:"searchInput",ref:s,type:"search",placeholder:"Zoeken...",value:a.modelValue,onInput:d[0]||(d[0]=b=>o("update:modelValue",b.target.value)),class:"color-[inherit] w-full rounded-xl border-[2px] border-solid border-transparent bg-transparent px-3 py-2 ps-10 focus:border-[2px] focus:border-base-200 focus:outline-none"},null,40,Ye)])]),d[2]||(d[2]=e.createElementVNode("div",{class:"pointer-events-none absolute end-10 top-2.5 hidden gap-1 opacity-50 lg:flex rtl:flex-row-reverse"},[e.createElementVNode("kbd",{class:"kbd kbd-sm"},"ctrl"),e.createElementVNode("kbd",{class:"kbd kbd-sm"},"K")],-1))])]))}}),et=["bg-primary","bg-primary-content","bg-secondary","bg-secondary-content","bg-accent","bg-accent-content","bg-neutral","bg-neutral-content","bg-base-100","bg-base-200","bg-base-300","bg-base-content","bg-info","bg-info-content","bg-success","bg-success-content","bg-warning","bg-warning-content","bg-error","bg-error-content","btn-primary","btn-primary-content","btn-secondary","btn-secondary-content","btn-accent","btn-accent-content","btn-neutral","btn-neutral-content","btn-base-100","btn-base-200","btn-base-300","btn-base-content","btn-info","btn-info-content","btn-success","btn-success-content","btn-warning","btn-warning-content","btn-error","btn-error-content","text-primary","text-primary-content","text-secondary","text-secondary-content","text-accent","text-accent-content","text-neutral","text-neutral-content","text-base-100","text-base-200","text-base-300","text-base-content","text-info","text-info-content","text-success","text-success-content","text-warning","text-warning-content","text-error","text-error-content","text-transparent","step","steps","modal","modal-box","btn","btn-sm","btn-circle","btn-ghost","absolute","right-2","top-2","shadow-lg","w-full","rounded-xs","rounded-sm","rounded-md","rounded-lg","rounded-xl","rounded-2xl","rounded-3xl","hidden","block"];exports.BackgroundColorUtils=j;exports.Button=ue;exports.ButtonColorUtils=H;exports.ButtonSizeUtils=G;exports.Card=fe;exports.CardBody=ge;exports.CardTitle=he;exports.Color=T;exports.Container=ye;exports.Modal=He;exports.RoundedSizeUtils=J;exports.SearchBar=Qe;exports.SimpleButton=pe;exports.Size=L;exports.Step=Oe;exports.StepList=qe;exports.StepPanel=Ke;exports.StepPanels=Ie;exports.Stepper=De;exports.Table=Re;exports.TableSizeUtils=Z;exports.TextColorUtils=ae;exports.dendelionSafeList=et;exports.getValue=V;
|
package/dist/dendelion-ui.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as C, computed as Q, createElementBlock as i, openBlock as u, normalizeClass as E, createElementVNode as g, renderSlot as z, ref as $, createBlock as A, resolveDynamicComponent as Z, withCtx as de, createTextVNode as fe, toDisplayString as I, onMounted as U, createCommentVNode as L, Fragment as O, unref as Y, isVNode as ye, normalizeProps as _e, guardReactiveProps as xe, defineAsyncComponent as ae, watch as X, renderList as q, provide as we, inject as ee, Transition as ke, onUnmounted as Se } from "vue";
|
|
2
2
|
var te = /* @__PURE__ */ ((e) => (e[e.Primary = 0] = "Primary", e[e.PrimaryContent = 1] = "PrimaryContent", e[e.Secondary = 2] = "Secondary", e[e.SecondaryContent = 3] = "SecondaryContent", e[e.Accent = 4] = "Accent", e[e.AccentContent = 5] = "AccentContent", e[e.Neutral = 6] = "Neutral", e[e.NeutralContent = 7] = "NeutralContent", e[e.Base100 = 8] = "Base100", e[e.Base200 = 9] = "Base200", e[e.Base300 = 10] = "Base300", e[e.BaseContent = 11] = "BaseContent", e[e.Info = 12] = "Info", e[e.InfoContent = 13] = "InfoContent", e[e.Success = 14] = "Success", e[e.SuccessContent = 15] = "SuccessContent", e[e.Warning = 16] = "Warning", e[e.WarningContent = 17] = "WarningContent", e[e.Error = 18] = "Error", e[e.ErrorContent = 19] = "ErrorContent", e))(te || {});
|
|
3
|
-
class
|
|
3
|
+
class Be {
|
|
4
4
|
static toClassName(t) {
|
|
5
5
|
switch (t) {
|
|
6
6
|
case 0:
|
|
@@ -48,7 +48,7 @@ class ke {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
class
|
|
51
|
+
class $e {
|
|
52
52
|
static toClassName(t) {
|
|
53
53
|
switch (t) {
|
|
54
54
|
case 0:
|
|
@@ -96,7 +96,7 @@ class Be {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
class
|
|
99
|
+
class ft {
|
|
100
100
|
static toClassName(t) {
|
|
101
101
|
switch (t) {
|
|
102
102
|
case 0:
|
|
@@ -167,7 +167,7 @@ class Ce {
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
class
|
|
170
|
+
class Me {
|
|
171
171
|
static toClassName(t) {
|
|
172
172
|
switch (t) {
|
|
173
173
|
case 0:
|
|
@@ -189,7 +189,7 @@ class $e {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
class
|
|
192
|
+
class Ne {
|
|
193
193
|
static toClassName(t) {
|
|
194
194
|
switch (t) {
|
|
195
195
|
case 0:
|
|
@@ -211,24 +211,24 @@ class Me {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function pe(e) {
|
|
215
215
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
216
216
|
}
|
|
217
|
-
var
|
|
217
|
+
var G = { exports: {} };
|
|
218
218
|
/*!
|
|
219
219
|
Copyright (c) 2018 Jed Watson.
|
|
220
220
|
Licensed under the MIT License (MIT), see
|
|
221
221
|
http://jedwatson.github.io/classnames
|
|
222
222
|
*/
|
|
223
223
|
var se;
|
|
224
|
-
function
|
|
224
|
+
function ze() {
|
|
225
225
|
return se || (se = 1, function(e) {
|
|
226
226
|
(function() {
|
|
227
227
|
var t = {}.hasOwnProperty;
|
|
228
228
|
function r() {
|
|
229
229
|
for (var n = "", o = 0; o < arguments.length; o++) {
|
|
230
|
-
var
|
|
231
|
-
|
|
230
|
+
var f = arguments[o];
|
|
231
|
+
f && (n = a(n, s(f)));
|
|
232
232
|
}
|
|
233
233
|
return n;
|
|
234
234
|
}
|
|
@@ -242,8 +242,8 @@ function Ne() {
|
|
|
242
242
|
if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
|
|
243
243
|
return n.toString();
|
|
244
244
|
var o = "";
|
|
245
|
-
for (var
|
|
246
|
-
t.call(n,
|
|
245
|
+
for (var f in n)
|
|
246
|
+
t.call(n, f) && n[f] && (o = a(o, f));
|
|
247
247
|
return o;
|
|
248
248
|
}
|
|
249
249
|
function a(n, o) {
|
|
@@ -251,10 +251,10 @@ function Ne() {
|
|
|
251
251
|
}
|
|
252
252
|
e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
|
|
253
253
|
})();
|
|
254
|
-
}(
|
|
254
|
+
}(G)), G.exports;
|
|
255
255
|
}
|
|
256
|
-
var Te =
|
|
257
|
-
const
|
|
256
|
+
var Te = ze();
|
|
257
|
+
const D = /* @__PURE__ */ pe(Te), Le = ["type", "disabled"], Ee = { class: "group-[.is-loading]:text-transparent" }, pt = /* @__PURE__ */ C({
|
|
258
258
|
__name: "Button",
|
|
259
259
|
props: {
|
|
260
260
|
type: { default: "button" },
|
|
@@ -266,39 +266,39 @@ const V = /* @__PURE__ */ fe(Te), ze = ["type", "disabled"], Le = { class: "grou
|
|
|
266
266
|
click: {}
|
|
267
267
|
},
|
|
268
268
|
setup(e) {
|
|
269
|
-
const t = e, r =
|
|
270
|
-
() =>
|
|
269
|
+
const t = e, r = Q(
|
|
270
|
+
() => D(
|
|
271
271
|
"btn",
|
|
272
272
|
"group",
|
|
273
|
-
|
|
273
|
+
$e.toClassName(t.color),
|
|
274
274
|
t.soft ? "btn-soft" : "",
|
|
275
275
|
t.outline ? "btn-outline" : "",
|
|
276
276
|
t.loading ? "is-loading" : "",
|
|
277
277
|
t.disabled ? "disabled" : ""
|
|
278
278
|
)
|
|
279
279
|
);
|
|
280
|
-
return (s, a) => (
|
|
280
|
+
return (s, a) => (u(), i("button", {
|
|
281
281
|
onClick: a[0] || (a[0] = (n) => s.click ? s.click : void 0),
|
|
282
|
-
class:
|
|
282
|
+
class: E(r.value),
|
|
283
283
|
type: s.type,
|
|
284
284
|
disabled: s.disabled || s.loading
|
|
285
285
|
}, [
|
|
286
286
|
a[1] || (a[1] = g("span", { class: "loading loading-spinner loading-md absolute hidden group-[.is-loading]:block" }, null, -1)),
|
|
287
|
-
g("span",
|
|
288
|
-
|
|
287
|
+
g("span", Ee, [
|
|
288
|
+
z(s.$slots, "default")
|
|
289
289
|
])
|
|
290
|
-
], 10,
|
|
290
|
+
], 10, Le));
|
|
291
291
|
}
|
|
292
292
|
}), re = (e, t) => {
|
|
293
293
|
const r = e.__vccOpts || e;
|
|
294
294
|
for (const [s, a] of t)
|
|
295
295
|
r[s] = a;
|
|
296
296
|
return r;
|
|
297
|
-
},
|
|
298
|
-
function
|
|
299
|
-
return
|
|
297
|
+
}, Re = {};
|
|
298
|
+
function Fe(e, t) {
|
|
299
|
+
return u(), i("button");
|
|
300
300
|
}
|
|
301
|
-
const
|
|
301
|
+
const bt = /* @__PURE__ */ re(Re, [["render", Fe]]), vt = /* @__PURE__ */ C({
|
|
302
302
|
__name: "Card",
|
|
303
303
|
props: {
|
|
304
304
|
backgroundColor: { default: te.Primary },
|
|
@@ -308,202 +308,202 @@ const lt = /* @__PURE__ */ re(Ee, [["render", Re]]), it = /* @__PURE__ */ B({
|
|
|
308
308
|
roundedSize: {}
|
|
309
309
|
},
|
|
310
310
|
setup(e) {
|
|
311
|
-
const t = e, r =
|
|
312
|
-
|
|
311
|
+
const t = e, r = $(
|
|
312
|
+
D(
|
|
313
313
|
"card",
|
|
314
|
-
|
|
314
|
+
Be.toClassName(t.backgroundColor),
|
|
315
315
|
t.shadow ? "shadow-lg" : "",
|
|
316
316
|
t.fullWidth ? "w-full" : "",
|
|
317
|
-
t.rounded && !t.roundedSize ? "rounded" : t.roundedSize ?
|
|
317
|
+
t.rounded && !t.roundedSize ? "rounded" : t.roundedSize ? Me.toClassName(t.roundedSize) : ""
|
|
318
318
|
)
|
|
319
319
|
);
|
|
320
|
-
return (s, a) => (
|
|
321
|
-
class:
|
|
320
|
+
return (s, a) => (u(), i("div", {
|
|
321
|
+
class: E(r.value)
|
|
322
322
|
}, [
|
|
323
|
-
|
|
323
|
+
z(s.$slots, "default")
|
|
324
324
|
], 2));
|
|
325
325
|
}
|
|
326
|
-
}),
|
|
327
|
-
function
|
|
328
|
-
return
|
|
329
|
-
|
|
326
|
+
}), We = {}, Oe = { class: "card-body" };
|
|
327
|
+
function Ve(e, t) {
|
|
328
|
+
return u(), i("div", Oe, [
|
|
329
|
+
z(e.$slots, "default")
|
|
330
330
|
]);
|
|
331
331
|
}
|
|
332
|
-
const
|
|
332
|
+
const ht = /* @__PURE__ */ re(We, [["render", Ve]]), mt = /* @__PURE__ */ C({
|
|
333
333
|
__name: "CardTitle",
|
|
334
334
|
props: {
|
|
335
335
|
is: { default: "h1" },
|
|
336
336
|
text: { default: "" }
|
|
337
337
|
},
|
|
338
338
|
setup(e) {
|
|
339
|
-
return (t, r) => (
|
|
340
|
-
default:
|
|
341
|
-
|
|
339
|
+
return (t, r) => (u(), A(Z(t.is), { class: "card-title" }, {
|
|
340
|
+
default: de(() => [
|
|
341
|
+
fe(I(t.text), 1)
|
|
342
342
|
]),
|
|
343
343
|
_: 1
|
|
344
344
|
}));
|
|
345
345
|
}
|
|
346
|
-
}),
|
|
346
|
+
}), gt = /* @__PURE__ */ C({
|
|
347
347
|
__name: "Container",
|
|
348
348
|
props: {
|
|
349
349
|
container: { type: Boolean, default: !0 },
|
|
350
350
|
padding: { type: Boolean, default: !0 }
|
|
351
351
|
},
|
|
352
352
|
setup(e) {
|
|
353
|
-
const t = e, r =
|
|
353
|
+
const t = e, r = $([
|
|
354
354
|
t.container ? "container" : "",
|
|
355
355
|
//To disable the max width in some cases
|
|
356
356
|
t.padding ? "p-6" : ""
|
|
357
357
|
]);
|
|
358
|
-
return (s, a) => (
|
|
359
|
-
class:
|
|
358
|
+
return (s, a) => (u(), i("div", {
|
|
359
|
+
class: E(r.value)
|
|
360
360
|
}, [
|
|
361
|
-
|
|
361
|
+
z(s.$slots, "default")
|
|
362
362
|
], 2));
|
|
363
363
|
}
|
|
364
|
-
}),
|
|
365
|
-
var
|
|
366
|
-
function
|
|
364
|
+
}), P = (e, t) => String(!e || typeof e != "object" ? e : t.split(".").reduce((r, s) => r && (typeof r == "object" ? r[s] : r), e));
|
|
365
|
+
var j = {}, J = {}, oe;
|
|
366
|
+
function be() {
|
|
367
367
|
return oe || (oe = 1, function(e) {
|
|
368
368
|
e.__esModule = !0, e.default = a;
|
|
369
369
|
var t = /[\u0300-\u036f]/g, r = /ł/g, s = /ñ/g;
|
|
370
370
|
function a(n) {
|
|
371
371
|
return n.toLowerCase().normalize("NFD").replace(t, "").replace(r, "l").replace(s, "n").trim();
|
|
372
372
|
}
|
|
373
|
-
}(
|
|
373
|
+
}(J)), J;
|
|
374
374
|
}
|
|
375
|
-
var
|
|
375
|
+
var W = {}, ue;
|
|
376
376
|
function ce() {
|
|
377
|
-
if (ue) return
|
|
378
|
-
ue = 1,
|
|
379
|
-
var e = t(
|
|
380
|
-
function t(
|
|
381
|
-
return
|
|
377
|
+
if (ue) return W;
|
|
378
|
+
ue = 1, W.__esModule = !0, W.aggressiveFuzzyMatch = h, W.createFuzzySearchImpl = k, W.experimentalSmartFuzzyMatch = T, W.fuzzyMatchImpl = B;
|
|
379
|
+
var e = t(be());
|
|
380
|
+
function t(l) {
|
|
381
|
+
return l && l.__esModule ? l : { default: l };
|
|
382
382
|
}
|
|
383
|
-
var r = Number.MAX_SAFE_INTEGER, s = function(
|
|
383
|
+
var r = Number.MAX_SAFE_INTEGER, s = function(c, b) {
|
|
384
384
|
return (
|
|
385
385
|
/*: number*/
|
|
386
|
-
|
|
386
|
+
c.score - b.score
|
|
387
387
|
);
|
|
388
|
-
}, a = function(
|
|
388
|
+
}, a = function(c, b) {
|
|
389
389
|
return (
|
|
390
390
|
/*: number*/
|
|
391
|
-
|
|
391
|
+
c[0] - b[0]
|
|
392
392
|
);
|
|
393
393
|
}, n = new Set(` []()-–—'"“”`.split(""));
|
|
394
|
-
function o(
|
|
395
|
-
return n.has(
|
|
394
|
+
function o(l) {
|
|
395
|
+
return n.has(l);
|
|
396
396
|
}
|
|
397
|
-
function
|
|
398
|
-
if (
|
|
399
|
-
return [0, [[0,
|
|
400
|
-
var
|
|
401
|
-
if (
|
|
397
|
+
function f(l, c, b, _, d, y, v) {
|
|
398
|
+
if (l === _)
|
|
399
|
+
return [0, [[0, l.length - 1]]];
|
|
400
|
+
var p = _.length, m = c.length, x = d.length;
|
|
401
|
+
if (c === d)
|
|
402
402
|
return [0.1, [[0, m - 1]]];
|
|
403
|
-
if (
|
|
403
|
+
if (c.startsWith(d))
|
|
404
404
|
return [0.5, [[0, x - 1]]];
|
|
405
|
-
var M =
|
|
406
|
-
if (M > -1 && o(
|
|
407
|
-
return [0.9, [[M, M +
|
|
408
|
-
var
|
|
409
|
-
if (
|
|
410
|
-
return [1, [[
|
|
405
|
+
var M = l.indexOf(_);
|
|
406
|
+
if (M > -1 && o(l[M - 1]))
|
|
407
|
+
return [0.9, [[M, M + p - 1]]];
|
|
408
|
+
var S = c.indexOf(d);
|
|
409
|
+
if (S > -1 && o(c[S - 1]))
|
|
410
|
+
return [1, [[S, S + p - 1]]];
|
|
411
411
|
var N = y.length;
|
|
412
|
-
if (N > 1 && y.every(function(
|
|
413
|
-
return b.has(
|
|
412
|
+
if (N > 1 && y.every(function(F) {
|
|
413
|
+
return b.has(F);
|
|
414
414
|
})) {
|
|
415
|
-
var
|
|
416
|
-
return [
|
|
417
|
-
var
|
|
418
|
-
return [
|
|
415
|
+
var R = 1.5 + N * 0.2;
|
|
416
|
+
return [R, y.map(function(F) {
|
|
417
|
+
var V = c.indexOf(F);
|
|
418
|
+
return [V, V + F.length - 1];
|
|
419
419
|
}).sort(a)];
|
|
420
420
|
}
|
|
421
|
-
return
|
|
421
|
+
return S > -1 ? [2, [[S, S + p - 1]]] : v === "aggressive" ? h(c, d) : v === "smart" ? T(c, d) : null;
|
|
422
422
|
}
|
|
423
|
-
function h(
|
|
424
|
-
for (var b =
|
|
425
|
-
if (
|
|
426
|
-
if (x !== m + 1 && (
|
|
427
|
-
return v.push([
|
|
428
|
-
y =
|
|
423
|
+
function h(l, c) {
|
|
424
|
+
for (var b = l.length, _ = c.length, d = 0, y = c[d], v = [], p = -1, m = -2, x = 0; x < b; x += 1)
|
|
425
|
+
if (l[x] === y) {
|
|
426
|
+
if (x !== m + 1 && (p >= 0 && v.push([p, m]), p = x), m = x, d += 1, d === _)
|
|
427
|
+
return v.push([p, m]), w(v, l);
|
|
428
|
+
y = c[d];
|
|
429
429
|
}
|
|
430
430
|
return null;
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
for (var b =
|
|
434
|
-
var m =
|
|
432
|
+
function T(l, c) {
|
|
433
|
+
for (var b = l.length, _ = [], d = 0, y = c[d], v = -1, p = -2; ; ) {
|
|
434
|
+
var m = l.indexOf(y, p + 1);
|
|
435
435
|
if (m === -1)
|
|
436
436
|
break;
|
|
437
|
-
if (m === 0 || o(
|
|
437
|
+
if (m === 0 || o(l[m - 1]))
|
|
438
438
|
v = m;
|
|
439
439
|
else {
|
|
440
|
-
var x =
|
|
441
|
-
if (
|
|
440
|
+
var x = c.length - d, M = l.length - m, S = Math.min(3, x, M), N = c.slice(d, d + S);
|
|
441
|
+
if (l.slice(m, m + S) === N)
|
|
442
442
|
v = m;
|
|
443
443
|
else {
|
|
444
|
-
|
|
444
|
+
p += 1;
|
|
445
445
|
continue;
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
for (
|
|
449
|
-
|
|
450
|
-
if (
|
|
451
|
-
return
|
|
448
|
+
for (p = v; p < b && l[p] === y; p += 1)
|
|
449
|
+
d += 1, y = c[d];
|
|
450
|
+
if (p -= 1, _.push([v, p]), d === c.length)
|
|
451
|
+
return w(_, l);
|
|
452
452
|
}
|
|
453
453
|
return null;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function w(l, c) {
|
|
456
456
|
var b = 2;
|
|
457
|
-
return
|
|
458
|
-
var
|
|
459
|
-
x ? b += 0.2 :
|
|
460
|
-
}), [b,
|
|
457
|
+
return l.forEach(function(_) {
|
|
458
|
+
var d = _[0], y = _[1], v = y - d + 1, p = d === 0 || c[d] === " " || c[d - 1] === " ", m = y === c.length - 1 || c[y] === " " || c[y + 1] === " ", x = p && m;
|
|
459
|
+
x ? b += 0.2 : p ? b += 0.4 : v >= 3 ? b += 0.8 : b += 1.6;
|
|
460
|
+
}), [b, l];
|
|
461
461
|
}
|
|
462
|
-
function
|
|
463
|
-
var b = (0, e.default)(
|
|
462
|
+
function B(l, c) {
|
|
463
|
+
var b = (0, e.default)(c), _ = b.split(" "), d = (0, e.default)(l), y = new Set(d.split(" ")), v = f(l, d, y, c, b, _, "smart");
|
|
464
464
|
return v ? {
|
|
465
|
-
item:
|
|
465
|
+
item: l,
|
|
466
466
|
score: v[0],
|
|
467
467
|
matches: [v[1]]
|
|
468
468
|
} : null;
|
|
469
469
|
}
|
|
470
|
-
function k(
|
|
471
|
-
var b =
|
|
472
|
-
var
|
|
473
|
-
if (
|
|
474
|
-
|
|
470
|
+
function k(l, c) {
|
|
471
|
+
var b = c.strategy, _ = b === void 0 ? "aggressive" : b, d = c.getText, y = l.map(function(v) {
|
|
472
|
+
var p;
|
|
473
|
+
if (d)
|
|
474
|
+
p = d(v);
|
|
475
475
|
else {
|
|
476
|
-
var m =
|
|
477
|
-
|
|
476
|
+
var m = c.key ? v[c.key] : v;
|
|
477
|
+
p = [m];
|
|
478
478
|
}
|
|
479
|
-
var x =
|
|
480
|
-
var
|
|
481
|
-
return [
|
|
479
|
+
var x = p.map(function(M) {
|
|
480
|
+
var S = M || "", N = (0, e.default)(S), R = new Set(N.split(" "));
|
|
481
|
+
return [S, N, R];
|
|
482
482
|
});
|
|
483
483
|
return [v, x];
|
|
484
484
|
});
|
|
485
485
|
return function(v) {
|
|
486
|
-
var
|
|
486
|
+
var p = [], m = (0, e.default)(v), x = m.split(" ");
|
|
487
487
|
return m.length ? (y.forEach(function(M) {
|
|
488
|
-
for (var
|
|
489
|
-
var
|
|
490
|
-
|
|
488
|
+
for (var S = M[0], N = M[1], R = r, F = [], V = 0, ve = N.length; V < ve; V += 1) {
|
|
489
|
+
var K = N[V], he = K[0], me = K[1], ge = K[2], H = f(he, me, ge, v, m, x, _);
|
|
490
|
+
H ? (R = Math.min(R, H[0]), F.push(H[1])) : F.push(null);
|
|
491
491
|
}
|
|
492
|
-
|
|
493
|
-
item:
|
|
494
|
-
score:
|
|
495
|
-
matches:
|
|
492
|
+
R < r && p.push({
|
|
493
|
+
item: S,
|
|
494
|
+
score: R,
|
|
495
|
+
matches: F
|
|
496
496
|
});
|
|
497
|
-
}),
|
|
497
|
+
}), p.sort(s), p) : [];
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
|
-
return
|
|
500
|
+
return W;
|
|
501
501
|
}
|
|
502
502
|
var le;
|
|
503
|
-
function
|
|
503
|
+
function Pe() {
|
|
504
504
|
return le || (le = 1, function(e) {
|
|
505
505
|
e.__esModule = !0, e.default = s, e.fuzzyMatch = a;
|
|
506
|
-
var t = r(
|
|
506
|
+
var t = r(be());
|
|
507
507
|
e.normalizeText = t.default;
|
|
508
508
|
function r(n) {
|
|
509
509
|
return n && n.__esModule ? n : { default: n };
|
|
@@ -514,10 +514,10 @@ function Ve() {
|
|
|
514
514
|
function a(n, o) {
|
|
515
515
|
return ce().fuzzyMatchImpl(n, o);
|
|
516
516
|
}
|
|
517
|
-
}(
|
|
517
|
+
}(j)), j;
|
|
518
518
|
}
|
|
519
|
-
var
|
|
520
|
-
const
|
|
519
|
+
var De = Pe();
|
|
520
|
+
const Ae = /* @__PURE__ */ pe(De), qe = { key: 0 }, Ie = { key: 0 }, Xe = ["innerHTML"], Ue = { key: 1 }, Ke = { key: 2 }, ie = /* @__PURE__ */ C({
|
|
521
521
|
__name: "TableColumn",
|
|
522
522
|
props: {
|
|
523
523
|
column: {},
|
|
@@ -525,33 +525,34 @@ const De = /* @__PURE__ */ fe(Pe), Ae = { key: 0 }, qe = { key: 0 }, Ie = ["inne
|
|
|
525
525
|
rowIndex: {}
|
|
526
526
|
},
|
|
527
527
|
setup(e) {
|
|
528
|
-
const t = e, r =
|
|
529
|
-
|
|
528
|
+
const t = e, r = Q(() => t.column.render ? t.column.render(P(t.row, t.column.data), t.row) : P(t.row, t.column.data));
|
|
529
|
+
U(() => {
|
|
530
530
|
r.value && typeof r.value == "object" && "then" in r.value && console.warn("Async component detected in TableColumn, this may cause issues with rendering.");
|
|
531
531
|
});
|
|
532
|
-
const s = (n, o) => o.render === void 0 ? {} : o.render(
|
|
533
|
-
return (n, o) => (
|
|
534
|
-
n.column.render ? n.row ? (
|
|
535
|
-
r.value ? (
|
|
536
|
-
typeof r.value == "string" ? (
|
|
537
|
-
g("div", { innerHTML: r.value }, null, 8,
|
|
538
|
-
])) :
|
|
539
|
-
(
|
|
540
|
-
])) : (
|
|
541
|
-
(
|
|
532
|
+
const s = (n, o) => o.render === void 0 ? {} : o.render(P(n, o.data), n).props, a = (n) => (console.log("getComponent", n), n && typeof n == "object" && "then" in n ? ae(() => n) : typeof n == "function" ? ae(n) : n);
|
|
533
|
+
return (n, o) => (u(), i("td", null, [
|
|
534
|
+
n.column.render ? n.row ? (u(), i(O, { key: 1 }, [
|
|
535
|
+
r.value ? (u(), i("div", qe, [
|
|
536
|
+
typeof r.value == "string" ? (u(), i("div", Ie, [
|
|
537
|
+
g("div", { innerHTML: r.value }, null, 8, Xe)
|
|
538
|
+
])) : ye(r.value) ? (u(), i("div", Ue, [
|
|
539
|
+
(u(), A(Z(r.value)))
|
|
540
|
+
])) : (u(), i("div", Ke, [
|
|
541
|
+
(u(), A(Z(a(r.value.component)), _e(xe(s(n.row, n.column))), null, 16))
|
|
542
542
|
]))
|
|
543
|
-
])) :
|
|
544
|
-
], 64)) :
|
|
545
|
-
|
|
543
|
+
])) : L("", !0)
|
|
544
|
+
], 64)) : L("", !0) : (u(), i(O, { key: 0 }, [
|
|
545
|
+
fe(I(Y(P)(n.row, n.column.data)), 1)
|
|
546
546
|
], 64))
|
|
547
547
|
]));
|
|
548
548
|
}
|
|
549
|
-
}), He = { key: 0 }, Ge = ["colspan"],
|
|
549
|
+
}), He = { key: 0 }, Ge = { key: 1 }, je = { key: 0 }, Je = ["colspan"], Ze = ["onClick"], Ye = { key: 2 }, Qe = { key: 0 }, et = ["colspan"], yt = /* @__PURE__ */ C({
|
|
550
550
|
__name: "Table",
|
|
551
551
|
props: {
|
|
552
552
|
zebra: { type: Boolean, default: !1 },
|
|
553
553
|
pinRows: { type: Boolean, default: !1 },
|
|
554
554
|
pinCols: { type: Boolean, default: !1 },
|
|
555
|
+
horizontal: { type: Boolean, default: !1 },
|
|
555
556
|
size: { default: ne.MD },
|
|
556
557
|
columns: {},
|
|
557
558
|
dataSource: {},
|
|
@@ -561,161 +562,180 @@ const De = /* @__PURE__ */ fe(Pe), Ae = { key: 0 }, qe = { key: 0 }, Ie = ["inne
|
|
|
561
562
|
onRowClick: {}
|
|
562
563
|
},
|
|
563
564
|
setup(e) {
|
|
564
|
-
const t =
|
|
565
|
-
|
|
565
|
+
const t = $([]), r = $([]), s = $(null), a = e, n = $(
|
|
566
|
+
D("table", Ne.toClassName(a.size), {
|
|
566
567
|
"table-zebra": a.zebra,
|
|
567
568
|
"table-pin-rows": a.pinRows,
|
|
568
569
|
"table-pin-cols ": a.pinCols
|
|
569
570
|
})
|
|
570
|
-
), o = (h,
|
|
571
|
-
a.onRowClick && a.onRowClick(h,
|
|
571
|
+
), o = (h, T) => {
|
|
572
|
+
a.onRowClick && a.onRowClick(h, T);
|
|
572
573
|
};
|
|
573
|
-
|
|
574
|
+
U(() => {
|
|
574
575
|
t.value = a.dataSource, r.value = a.dataSource;
|
|
575
|
-
}),
|
|
576
|
+
}), X(
|
|
576
577
|
() => a.dataSource,
|
|
577
578
|
(h) => {
|
|
578
579
|
console.log("dataSource changed", h), t.value = h, r.value = h;
|
|
579
580
|
},
|
|
580
581
|
{ immediate: !0 }
|
|
581
|
-
),
|
|
582
|
+
), X(
|
|
582
583
|
() => a.searchValue,
|
|
583
584
|
(h) => {
|
|
584
585
|
if (a.searchFunction) {
|
|
585
586
|
r.value = a.searchFunction(h ?? "");
|
|
586
587
|
return;
|
|
587
588
|
}
|
|
588
|
-
r.value = h ?
|
|
589
|
+
r.value = h ? f(h) : t.value;
|
|
589
590
|
},
|
|
590
591
|
{ immediate: !0 }
|
|
591
592
|
);
|
|
592
|
-
const
|
|
593
|
-
const
|
|
594
|
-
return t.value.length > 0 ? (Object.keys(t.value[0]).forEach((
|
|
595
|
-
const k = t.value.map((b) =>
|
|
596
|
-
for (const b of
|
|
597
|
-
const _ = t.value.filter((
|
|
598
|
-
|
|
593
|
+
const f = (h) => {
|
|
594
|
+
const T = [];
|
|
595
|
+
return t.value.length > 0 ? (Object.keys(t.value[0]).forEach((B) => {
|
|
596
|
+
const k = t.value.map((b) => P(b, B)), c = Ae(k)(h);
|
|
597
|
+
for (const b of c) {
|
|
598
|
+
const _ = t.value.filter((d) => P(d, B) === b.item);
|
|
599
|
+
T.push(..._);
|
|
599
600
|
}
|
|
600
|
-
}),
|
|
601
|
+
}), T) : [];
|
|
601
602
|
};
|
|
602
|
-
return (h,
|
|
603
|
+
return (h, T) => (u(), i("table", {
|
|
603
604
|
ref_key: "table",
|
|
604
605
|
ref: s,
|
|
605
|
-
class:
|
|
606
|
+
class: E(n.value)
|
|
606
607
|
}, [
|
|
607
|
-
|
|
608
|
+
h.horizontal ? L("", !0) : (u(), i("thead", He, [
|
|
608
609
|
g("tr", null, [
|
|
609
|
-
(
|
|
610
|
-
key:
|
|
611
|
-
},
|
|
610
|
+
(u(!0), i(O, null, q(a.columns, (w) => (u(), i("th", {
|
|
611
|
+
key: w.title
|
|
612
|
+
}, I(w.title), 1))), 128))
|
|
612
613
|
])
|
|
613
|
-
]),
|
|
614
|
-
|
|
615
|
-
r.value.length === 0 ? (
|
|
614
|
+
])),
|
|
615
|
+
h.horizontal ? L("", !0) : (u(), i("tbody", Ge, [
|
|
616
|
+
r.value.length === 0 ? (u(), i("tr", je, [
|
|
616
617
|
g("td", {
|
|
617
618
|
colspan: a.columns.length
|
|
618
|
-
}, "No data found", 8,
|
|
619
|
-
])) : (
|
|
620
|
-
class:
|
|
621
|
-
key: JSON.stringify(
|
|
622
|
-
onClick: (k) => o(
|
|
619
|
+
}, "No data found", 8, Je)
|
|
620
|
+
])) : (u(!0), i(O, { key: 1 }, q(r.value, (w, B) => (u(), i("tr", {
|
|
621
|
+
class: E(a.onRowClick ? "hover" : ""),
|
|
622
|
+
key: JSON.stringify(w),
|
|
623
|
+
onClick: (k) => o(w, B)
|
|
623
624
|
}, [
|
|
624
|
-
(
|
|
625
|
+
(u(!0), i(O, null, q(a.columns, (k) => (u(), A(ie, {
|
|
625
626
|
key: k.data,
|
|
626
627
|
column: k,
|
|
627
|
-
row:
|
|
628
|
-
rowIndex:
|
|
628
|
+
row: w,
|
|
629
|
+
rowIndex: B
|
|
629
630
|
}, null, 8, ["column", "row", "rowIndex"]))), 128))
|
|
630
|
-
], 10,
|
|
631
|
-
])
|
|
631
|
+
], 10, Ze))), 128))
|
|
632
|
+
])),
|
|
633
|
+
h.horizontal ? (u(), i("tbody", Ye, [
|
|
634
|
+
(u(!0), i(O, null, q(a.columns, (w) => (u(), i("tr", {
|
|
635
|
+
key: w.title
|
|
636
|
+
}, [
|
|
637
|
+
g("th", null, I(w.title), 1),
|
|
638
|
+
(u(!0), i(O, null, q(r.value, (B, k) => (u(), A(ie, {
|
|
639
|
+
key: k,
|
|
640
|
+
column: w,
|
|
641
|
+
row: B,
|
|
642
|
+
rowIndex: k
|
|
643
|
+
}, null, 8, ["column", "row", "rowIndex"]))), 128))
|
|
644
|
+
]))), 128)),
|
|
645
|
+
r.value.length === 0 ? (u(), i("tr", Qe, [
|
|
646
|
+
g("td", {
|
|
647
|
+
colspan: a.columns.length + 1,
|
|
648
|
+
style: { "text-align": "center", padding: "1rem" }
|
|
649
|
+
}, " No data found ", 8, et)
|
|
650
|
+
])) : L("", !0)
|
|
651
|
+
])) : L("", !0)
|
|
632
652
|
], 2));
|
|
633
653
|
}
|
|
634
|
-
}),
|
|
654
|
+
}), _t = /* @__PURE__ */ C({
|
|
635
655
|
__name: "Stepper",
|
|
636
656
|
props: {
|
|
637
657
|
value: {}
|
|
638
658
|
},
|
|
639
659
|
emits: ["update:value"],
|
|
640
660
|
setup(e, { expose: t, emit: r }) {
|
|
641
|
-
const s = e, a =
|
|
642
|
-
a.value =
|
|
661
|
+
const s = e, a = $(s.value), n = r, o = (f) => {
|
|
662
|
+
a.value = f, n("update:value", f);
|
|
643
663
|
};
|
|
644
|
-
return
|
|
664
|
+
return we("stepper", {
|
|
645
665
|
value: a,
|
|
646
666
|
updateValue: o
|
|
647
|
-
}),
|
|
667
|
+
}), X(
|
|
648
668
|
() => s.value,
|
|
649
|
-
(
|
|
650
|
-
a.value =
|
|
669
|
+
(f) => {
|
|
670
|
+
a.value = f;
|
|
651
671
|
}
|
|
652
672
|
), t({
|
|
653
673
|
updateValue: o
|
|
654
|
-
}), (
|
|
674
|
+
}), (f, h) => z(f.$slots, "default", { updateValue: o });
|
|
655
675
|
}
|
|
656
|
-
}),
|
|
676
|
+
}), xt = /* @__PURE__ */ C({
|
|
657
677
|
__name: "Step",
|
|
658
678
|
props: {
|
|
659
679
|
value: {}
|
|
660
680
|
},
|
|
661
681
|
setup(e) {
|
|
662
|
-
const t = e, r = ee("stepper"), s =
|
|
663
|
-
return
|
|
682
|
+
const t = e, r = ee("stepper"), s = $("");
|
|
683
|
+
return X(
|
|
664
684
|
() => r?.value.value,
|
|
665
685
|
(a) => {
|
|
666
686
|
a && t.value && (s.value = Number(a) >= Number(t.value) ? "step-primary" : "");
|
|
667
687
|
}
|
|
668
|
-
),
|
|
688
|
+
), U(() => {
|
|
669
689
|
r && (s.value = r.value.value === t.value ? "step-primary" : "", Number(r.value.value) >= Number(t.value) && (s.value = "step-primary"));
|
|
670
|
-
}), (a, n) => (
|
|
671
|
-
class:
|
|
690
|
+
}), (a, n) => (u(), i("li", {
|
|
691
|
+
class: E(["step", s.value])
|
|
672
692
|
}, [
|
|
673
|
-
|
|
693
|
+
z(a.$slots, "default")
|
|
674
694
|
], 2));
|
|
675
695
|
}
|
|
676
|
-
}),
|
|
677
|
-
function
|
|
678
|
-
return
|
|
679
|
-
|
|
696
|
+
}), tt = {}, nt = { class: "steps" };
|
|
697
|
+
function rt(e, t) {
|
|
698
|
+
return u(), i("ul", nt, [
|
|
699
|
+
z(e.$slots, "default")
|
|
680
700
|
]);
|
|
681
701
|
}
|
|
682
|
-
const
|
|
702
|
+
const wt = /* @__PURE__ */ re(tt, [["render", rt]]), at = { key: 0 }, kt = /* @__PURE__ */ C({
|
|
683
703
|
__name: "StepPanels",
|
|
684
704
|
setup(e) {
|
|
685
705
|
const t = ee("stepper");
|
|
686
|
-
return (r, s) => (
|
|
706
|
+
return (r, s) => (u(), A(ke, {
|
|
687
707
|
name: "fade",
|
|
688
708
|
mode: "out-in"
|
|
689
709
|
}, {
|
|
690
|
-
default:
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
currentStep:
|
|
710
|
+
default: de(() => [
|
|
711
|
+
Y(t)?.value ? (u(), i("div", at, [
|
|
712
|
+
z(r.$slots, "default", {
|
|
713
|
+
currentStep: Y(t)?.value
|
|
694
714
|
})
|
|
695
|
-
])) :
|
|
715
|
+
])) : L("", !0)
|
|
696
716
|
]),
|
|
697
717
|
_: 3
|
|
698
718
|
}));
|
|
699
719
|
}
|
|
700
|
-
}),
|
|
720
|
+
}), st = { key: 0 }, St = /* @__PURE__ */ C({
|
|
701
721
|
__name: "StepPanel",
|
|
702
722
|
props: {
|
|
703
723
|
value: {}
|
|
704
724
|
},
|
|
705
725
|
setup(e, { expose: t }) {
|
|
706
|
-
const r =
|
|
726
|
+
const r = Q(() => s?.value.value), s = ee("stepper"), a = (n) => {
|
|
707
727
|
s && s.updateValue(n.toString());
|
|
708
728
|
};
|
|
709
729
|
return t({
|
|
710
730
|
activateCallback: a
|
|
711
|
-
}), (n, o) => n.value === r.value ? (
|
|
712
|
-
|
|
713
|
-
])) :
|
|
731
|
+
}), (n, o) => n.value === r.value ? (u(), i("div", st, [
|
|
732
|
+
z(n.$slots, "default", { activateCallback: a })
|
|
733
|
+
])) : L("", !0);
|
|
714
734
|
}
|
|
715
|
-
}),
|
|
735
|
+
}), ot = {
|
|
716
736
|
key: 0,
|
|
717
737
|
method: "dialog"
|
|
718
|
-
},
|
|
738
|
+
}, Bt = /* @__PURE__ */ C({
|
|
719
739
|
__name: "Modal",
|
|
720
740
|
props: {
|
|
721
741
|
closeButton: { type: Boolean, default: !0 },
|
|
@@ -725,12 +745,12 @@ const gt = /* @__PURE__ */ re(Je, [["render", Ye]]), Qe = { key: 0 }, ht = /* @_
|
|
|
725
745
|
},
|
|
726
746
|
emits: ["close"],
|
|
727
747
|
setup(e, { expose: t, emit: r }) {
|
|
728
|
-
const s =
|
|
748
|
+
const s = $(null), a = r, n = e, o = $(D("modal-box", n.extraBoxClasses, {
|
|
729
749
|
"overflow-visible": n.overflow
|
|
730
|
-
})),
|
|
731
|
-
|
|
732
|
-
), h =
|
|
733
|
-
|
|
750
|
+
})), f = $(
|
|
751
|
+
D("modal")
|
|
752
|
+
), h = $(
|
|
753
|
+
D(
|
|
734
754
|
"btn",
|
|
735
755
|
Ce.toClassName(n.closeButtonSize),
|
|
736
756
|
"btn-circle",
|
|
@@ -747,24 +767,24 @@ const gt = /* @__PURE__ */ re(Je, [["render", Ye]]), Qe = { key: 0 }, ht = /* @_
|
|
|
747
767
|
closeModal: () => {
|
|
748
768
|
s.value?.close();
|
|
749
769
|
}
|
|
750
|
-
}), (
|
|
770
|
+
}), (B, k) => (u(), i("dialog", {
|
|
751
771
|
ref_key: "modal",
|
|
752
772
|
ref: s,
|
|
753
|
-
class:
|
|
773
|
+
class: E([f.value, B.$attrs.class]),
|
|
754
774
|
"aria-modal": "true",
|
|
755
775
|
"aria-hidden": "true",
|
|
756
776
|
role: "dialog",
|
|
757
|
-
onClose: k[0] || (k[0] = (
|
|
777
|
+
onClose: k[0] || (k[0] = (l) => a("close", l))
|
|
758
778
|
}, [
|
|
759
779
|
g("div", {
|
|
760
|
-
class:
|
|
780
|
+
class: E(o.value)
|
|
761
781
|
}, [
|
|
762
|
-
|
|
782
|
+
B.closeButton ? (u(), i("form", ot, [
|
|
763
783
|
g("button", {
|
|
764
|
-
class:
|
|
784
|
+
class: E(h.value)
|
|
765
785
|
}, "✕", 2)
|
|
766
|
-
])) :
|
|
767
|
-
|
|
786
|
+
])) : L("", !0),
|
|
787
|
+
z(B.$slots, "default")
|
|
768
788
|
], 2),
|
|
769
789
|
k[1] || (k[1] = g("form", {
|
|
770
790
|
method: "dialog",
|
|
@@ -774,21 +794,21 @@ const gt = /* @__PURE__ */ re(Je, [["render", Ye]]), Qe = { key: 0 }, ht = /* @_
|
|
|
774
794
|
], -1))
|
|
775
795
|
], 34));
|
|
776
796
|
}
|
|
777
|
-
}),
|
|
797
|
+
}), ut = { class: "hidden w-full max-w-sm lg:flex" }, ct = { class: "relative mx-3 w-full" }, lt = { class: "relative w-full max-w-full" }, it = ["value"], $t = /* @__PURE__ */ C({
|
|
778
798
|
__name: "SearchBar",
|
|
779
799
|
props: ["modelValue"],
|
|
780
800
|
emits: ["update:modelValue"],
|
|
781
801
|
setup(e, { emit: t }) {
|
|
782
|
-
const r = e, s =
|
|
802
|
+
const r = e, s = $(null), a = t, n = (o) => {
|
|
783
803
|
(o.ctrlKey || o.metaKey) && o.key.toLowerCase() === "k" && (o.preventDefault(), s.value && s.value.focus());
|
|
784
804
|
};
|
|
785
|
-
return
|
|
805
|
+
return U(() => {
|
|
786
806
|
document.addEventListener("keydown", n);
|
|
787
807
|
}), Se(() => {
|
|
788
808
|
document.removeEventListener("keydown", n);
|
|
789
|
-
}), (o,
|
|
790
|
-
g("label",
|
|
791
|
-
|
|
809
|
+
}), (o, f) => (u(), i("div", ut, [
|
|
810
|
+
g("label", ct, [
|
|
811
|
+
f[1] || (f[1] = g("svg", {
|
|
792
812
|
class: "pointer-events-none absolute z-10 my-3.5 ms-4 text-base-content opacity-60",
|
|
793
813
|
"aria-hidden": "true",
|
|
794
814
|
width: "16",
|
|
@@ -802,7 +822,7 @@ const gt = /* @__PURE__ */ re(Je, [["render", Ye]]), Qe = { key: 0 }, ht = /* @_
|
|
|
802
822
|
}),
|
|
803
823
|
g("path", { d: "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" })
|
|
804
824
|
], -1)),
|
|
805
|
-
g("div",
|
|
825
|
+
g("div", lt, [
|
|
806
826
|
g("form", null, [
|
|
807
827
|
g("input", {
|
|
808
828
|
ref_key: "searchInput",
|
|
@@ -810,19 +830,19 @@ const gt = /* @__PURE__ */ re(Je, [["render", Ye]]), Qe = { key: 0 }, ht = /* @_
|
|
|
810
830
|
type: "search",
|
|
811
831
|
placeholder: "Zoeken...",
|
|
812
832
|
value: r.modelValue,
|
|
813
|
-
onInput:
|
|
833
|
+
onInput: f[0] || (f[0] = (h) => a("update:modelValue", h.target.value)),
|
|
814
834
|
class: "color-[inherit] w-full rounded-xl border-[2px] border-solid border-transparent bg-transparent px-3 py-2 ps-10 focus:border-[2px] focus:border-base-200 focus:outline-none"
|
|
815
|
-
}, null, 40,
|
|
835
|
+
}, null, 40, it)
|
|
816
836
|
])
|
|
817
837
|
]),
|
|
818
|
-
|
|
838
|
+
f[2] || (f[2] = g("div", { class: "pointer-events-none absolute end-10 top-2.5 hidden gap-1 opacity-50 lg:flex rtl:flex-row-reverse" }, [
|
|
819
839
|
g("kbd", { class: "kbd kbd-sm" }, "ctrl"),
|
|
820
840
|
g("kbd", { class: "kbd kbd-sm" }, "K")
|
|
821
841
|
], -1))
|
|
822
842
|
])
|
|
823
843
|
]));
|
|
824
844
|
}
|
|
825
|
-
}),
|
|
845
|
+
}), Ct = [
|
|
826
846
|
"bg-primary",
|
|
827
847
|
"bg-primary-content",
|
|
828
848
|
"bg-secondary",
|
|
@@ -908,28 +928,28 @@ const gt = /* @__PURE__ */ re(Je, [["render", Ye]]), Qe = { key: 0 }, ht = /* @_
|
|
|
908
928
|
"block"
|
|
909
929
|
];
|
|
910
930
|
export {
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
931
|
+
Be as BackgroundColorUtils,
|
|
932
|
+
pt as Button,
|
|
933
|
+
$e as ButtonColorUtils,
|
|
914
934
|
Ce as ButtonSizeUtils,
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
935
|
+
vt as Card,
|
|
936
|
+
ht as CardBody,
|
|
937
|
+
mt as CardTitle,
|
|
918
938
|
te as Color,
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
939
|
+
gt as Container,
|
|
940
|
+
Bt as Modal,
|
|
941
|
+
Me as RoundedSizeUtils,
|
|
942
|
+
$t as SearchBar,
|
|
943
|
+
bt as SimpleButton,
|
|
924
944
|
ne as Size,
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
945
|
+
xt as Step,
|
|
946
|
+
wt as StepList,
|
|
947
|
+
St as StepPanel,
|
|
948
|
+
kt as StepPanels,
|
|
949
|
+
_t as Stepper,
|
|
950
|
+
yt as Table,
|
|
951
|
+
Ne as TableSizeUtils,
|
|
952
|
+
ft as TextColorUtils,
|
|
953
|
+
Ct as dendelionSafeList,
|
|
954
|
+
P as getValue
|
|
935
955
|
};
|
package/dist/dendelion-ui.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.DendelionUI={},d.Vue))})(this,function(d,e){"use strict";var F=(t=>(t[t.Primary=0]="Primary",t[t.PrimaryContent=1]="PrimaryContent",t[t.Secondary=2]="Secondary",t[t.SecondaryContent=3]="SecondaryContent",t[t.Accent=4]="Accent",t[t.AccentContent=5]="AccentContent",t[t.Neutral=6]="Neutral",t[t.NeutralContent=7]="NeutralContent",t[t.Base100=8]="Base100",t[t.Base200=9]="Base200",t[t.Base300=10]="Base300",t[t.BaseContent=11]="BaseContent",t[t.Info=12]="Info",t[t.InfoContent=13]="InfoContent",t[t.Success=14]="Success",t[t.SuccessContent=15]="SuccessContent",t[t.Warning=16]="Warning",t[t.WarningContent=17]="WarningContent",t[t.Error=18]="Error",t[t.ErrorContent=19]="ErrorContent",t))(F||{});class
|
|
1
|
+
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.DendelionUI={},d.Vue))})(this,function(d,e){"use strict";var F=(t=>(t[t.Primary=0]="Primary",t[t.PrimaryContent=1]="PrimaryContent",t[t.Secondary=2]="Secondary",t[t.SecondaryContent=3]="SecondaryContent",t[t.Accent=4]="Accent",t[t.AccentContent=5]="AccentContent",t[t.Neutral=6]="Neutral",t[t.NeutralContent=7]="NeutralContent",t[t.Base100=8]="Base100",t[t.Base200=9]="Base200",t[t.Base300=10]="Base300",t[t.BaseContent=11]="BaseContent",t[t.Info=12]="Info",t[t.InfoContent=13]="InfoContent",t[t.Success=14]="Success",t[t.SuccessContent=15]="SuccessContent",t[t.Warning=16]="Warning",t[t.WarningContent=17]="WarningContent",t[t.Error=18]="Error",t[t.ErrorContent=19]="ErrorContent",t))(F||{});class q{static toClassName(n){switch(n){case 0:return"bg-primary";case 1:return"bg-primary-content";case 2:return"bg-secondary";case 3:return"bg-secondary-content";case 4:return"bg-accent";case 5:return"bg-accent-content";case 6:return"bg-neutral";case 7:return"bg-neutral-content";case 8:return"base-100";case 9:return"bg-base-200";case 10:return"bg-base-300";case 11:return"bg-base-content";case 12:return"bg-info";case 13:return"bg-info-content";case 14:return"bg-success";case 15:return"bg-success-content";case 16:return"bg-warning";case 17:return"bg-warning-content";case 18:return"bg-error";case 19:return"bg-error-content";default:return"bg-base-content"}}}class I{static toClassName(n){switch(n){case 0:return"btn-primary";case 1:return"btn-primary-content";case 2:return"btn-secondary";case 3:return"btn-secondary-content";case 4:return"btn-accent";case 5:return"btn-accent-content";case 6:return"btn-neutral";case 7:return"btn-neutral-content";case 8:return"base-100";case 9:return"btn-base-200";case 10:return"btn-base-300";case 11:return"btn-base-content";case 12:return"btn-info";case 13:return"btn-info-content";case 14:return"btn-success";case 15:return"btn-success-content";case 16:return"btn-warning";case 17:return"btn-warning-content";case 18:return"btn-error";case 19:return"btn-error-content";default:return"btn-base-content"}}}class te{static toClassName(n){switch(n){case 0:return"text-primary";case 1:return"text-primary-content";case 2:return"text-secondary";case 3:return"text-secondary-content";case 4:return"text-accent";case 5:return"text-accent-content";case 6:return"text-neutral";case 7:return"text-neutral-content";case 8:return"base-100";case 9:return"text-base-200";case 10:return"text-base-300";case 11:return"text-base-content";case 12:return"text-info";case 13:return"text-info-content";case 14:return"text-success";case 15:return"text-success-content";case 16:return"text-warning";case 17:return"text-warning-content";case 18:return"text-error";case 19:return"text-error-content";default:return"text-base-content"}}}var R=(t=>(t[t.XS=0]="XS",t[t.SM=1]="SM",t[t.MD=2]="MD",t[t.LG=3]="LG",t[t.XL=4]="XL",t[t.TWOXL=5]="TWOXL",t[t.THREEXL=6]="THREEXL",t))(R||{});class X{static toClassName(n){switch(n){case 0:return"btn-xs";case 1:return"btn-sm";case 2:return"btn-md";case 3:return"btn-lg";case 4:return"btn-xl";case 5:return"btn-2xl";case 6:return"btn-3xl";default:return"btn-md"}}}class j{static toClassName(n){switch(n){case 0:return"rounded-xs";case 1:return"rounded-sm";case 2:return"rounded-md";case 3:return"rounded-lg";case 4:return"rounded-xl";case 5:return"rounded-2xl";case 6:return"rounded-3xl";default:return"rounded-md"}}}class K{static toClassName(n){switch(n){case 0:return"table-xs";case 1:return"table-sm";case 2:return"table-md";case 3:return"table-lg";case 4:return"table-xl";case 5:return"table-2xl";case 6:return"table-3xl";default:return"table-md"}}}function H(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var D={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/var H;function te(){return H||(H=1,function(t){(function(){var n={}.hasOwnProperty;function a(){for(var r="",c=0;c<arguments.length;c++){var f=arguments[c];f&&(r=s(r,o(f)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return a.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var f in r)n.call(r,f)&&r[f]&&(c=s(c,f));return c}function s(r,c){return c?r?r+" "+c:r+c:r}t.exports?(a.default=a,t.exports=a):window.classNames=a})()}(v)),v.exports}var ne=te();const T=K(ne),re=["type","disabled"],ae={class:"group-[.is-loading]:text-transparent"},se=e.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:F.Neutral},soft:{type:Boolean,default:!1},outline:{type:Boolean,default:!1},disabled:{type:Boolean},click:{}},setup(t){const n=t,a=e.computed(()=>T("btn","group",q.toClassName(n.color),n.soft?"btn-soft":"",n.outline?"btn-outline":"",n.loading?"is-loading":"",n.disabled?"disabled":""));return(o,s)=>(e.openBlock(),e.createElementBlock("button",{onClick:s[0]||(s[0]=r=>o.click?o.click:void 0),class:e.normalizeClass(a.value),type:o.type,disabled:o.disabled||o.loading},[s[1]||(s[1]=e.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),e.createElementVNode("span",ae,[e.renderSlot(o.$slots,"default")])],10,re))}}),D=(t,n)=>{const a=t.__vccOpts||t;for(const[o,s]of n)a[o]=s;return a},oe={};function ce(t,n){return e.openBlock(),e.createElementBlock("button")}const le=D(oe,[["render",ce]]),ie=e.defineComponent({__name:"Card",props:{backgroundColor:{default:F.Primary},shadow:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},rounded:{type:Boolean},roundedSize:{}},setup(t){const n=t,a=e.ref(T("card",U.toClassName(n.backgroundColor),n.shadow?"shadow-lg":"",n.fullWidth?"w-full":"",n.rounded&&!n.roundedSize?"rounded":n.roundedSize?X.toClassName(n.roundedSize):""));return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(o.$slots,"default")],2))}}),ue={},de={class:"card-body"};function fe(t,n){return e.openBlock(),e.createElementBlock("div",de,[e.renderSlot(t.$slots,"default")])}const pe=D(ue,[["render",fe]]),me=e.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(t){return(n,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.is),{class:"card-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.text),1)]),_:1}))}}),be=e.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(t){const n=t,a=e.ref([n.container?"container":"",n.padding?"p-6":""]);return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(o.$slots,"default")],2))}}),$=(t,n)=>String(!t||typeof t!="object"?t:n.split(".").reduce((a,o)=>a&&(typeof a=="object"?a[o]:a),t));var O={},W={},G;function J(){return G||(G=1,function(t){t.__esModule=!0,t.default=s;var n=/[\u0300-\u036f]/g,a=/ł/g,o=/ñ/g;function s(r){return r.toLowerCase().normalize("NFD").replace(n,"").replace(a,"l").replace(o,"n").trim()}}(W)),W}var M={},Z;function Y(){if(Z)return M;Z=1,M.__esModule=!0,M.aggressiveFuzzyMatch=h,M.createFuzzySearchImpl=S,M.experimentalSmartFuzzyMatch=N,M.fuzzyMatchImpl=C;var t=n(J());function n(i){return i&&i.__esModule?i:{default:i}}var a=Number.MAX_SAFE_INTEGER,o=function(l,m){return l.score-m.score},s=function(l,m){return l[0]-m[0]},r=new Set(` []()-–—'"“”`.split(""));function c(i){return r.has(i)}function f(i,l,m,_,u,y,b){if(i===_)return[0,[[0,i.length-1]]];var p=_.length,g=l.length,k=u.length;if(l===u)return[.1,[[0,g-1]]];if(l.startsWith(u))return[.5,[[0,k-1]]];var w=i.indexOf(_);if(w>-1&&c(i[w-1]))return[.9,[[w,w+p-1]]];var B=l.indexOf(u);if(B>-1&&c(l[B-1]))return[1,[[B,B+p-1]]];var E=y.length;if(E>1&&y.every(function(z){return m.has(z)})){var V=1.5+E*.2;return[V,y.map(function(z){var L=l.indexOf(z);return[L,L+z.length-1]}).sort(s)]}return B>-1?[2,[[B,B+p-1]]]:b==="aggressive"?h(l,u):b==="smart"?N(l,u):null}function h(i,l){for(var m=i.length,_=l.length,u=0,y=l[u],b=[],p=-1,g=-2,k=0;k<m;k+=1)if(i[k]===y){if(k!==g+1&&(p>=0&&b.push([p,g]),p=k),g=k,u+=1,u===_)return b.push([p,g]),x(b,i);y=l[u]}return null}function N(i,l){for(var m=i.length,_=[],u=0,y=l[u],b=-1,p=-2;;){var g=i.indexOf(y,p+1);if(g===-1)break;if(g===0||c(i[g-1]))b=g;else{var k=l.length-u,w=i.length-g,B=Math.min(3,k,w),E=l.slice(u,u+B);if(i.slice(g,g+B)===E)b=g;else{p+=1;continue}}for(p=b;p<m&&i[p]===y;p+=1)u+=1,y=l[u];if(p-=1,_.push([b,p]),u===l.length)return x(_,i)}return null}function x(i,l){var m=2;return i.forEach(function(_){var u=_[0],y=_[1],b=y-u+1,p=u===0||l[u]===" "||l[u-1]===" ",g=y===l.length-1||l[y]===" "||l[y+1]===" ",k=p&&g;k?m+=.2:p?m+=.4:b>=3?m+=.8:m+=1.6}),[m,i]}function C(i,l){var m=(0,t.default)(l),_=m.split(" "),u=(0,t.default)(i),y=new Set(u.split(" ")),b=f(i,u,y,l,m,_,"smart");return b?{item:i,score:b[0],matches:[b[1]]}:null}function S(i,l){var m=l.strategy,_=m===void 0?"aggressive":m,u=l.getText,y=i.map(function(b){var p;if(u)p=u(b);else{var g=l.key?b[l.key]:b;p=[g]}var k=p.map(function(w){var B=w||"",E=(0,t.default)(B),V=new Set(E.split(" "));return[B,E,V]});return[b,k]});return function(b){var p=[],g=(0,t.default)(b),k=g.split(" ");return g.length?(y.forEach(function(w){for(var B=w[0],E=w[1],V=a,z=[],L=0,Ke=E.length;L<Ke;L+=1){var P=E[L],He=P[0],Ge=P[1],Je=P[2],A=f(He,Ge,Je,b,g,k,_);A?(V=Math.min(V,A[0]),z.push(A[1])):z.push(null)}V<a&&p.push({item:B,score:V,matches:z})}),p.sort(o),p):[]}}return M}var Q;function ge(){return Q||(Q=1,function(t){t.__esModule=!0,t.default=o,t.fuzzyMatch=s;var n=a(J());t.normalizeText=n.default;function a(r){return r&&r.__esModule?r:{default:r}}function o(r,c){return c===void 0&&(c={}),Y().createFuzzySearchImpl(r,c)}function s(r,c){return Y().fuzzyMatchImpl(r,c)}}(O)),O}var he=ge();const ye=K(he),_e={key:0},ke={key:0},Be=["innerHTML"],Se={key:1},xe={key:2},Ce=e.defineComponent({__name:"TableColumn",props:{column:{},row:{},rowIndex:{}},setup(t){const n=t,a=e.computed(()=>n.column.render?n.column.render($(n.row,n.column.data),n.row):$(n.row,n.column.data));e.onMounted(()=>{a.value&&typeof a.value=="object"&&"then"in a.value&&console.warn("Async component detected in TableColumn, this may cause issues with rendering.")});const o=(r,c)=>c.render===void 0?{}:c.render($(r,c.data),r).props,s=r=>(console.log("getComponent",r),r&&typeof r=="object"&&"then"in r?e.defineAsyncComponent(()=>r):typeof r=="function"?e.defineAsyncComponent(r):r);return(r,c)=>(e.openBlock(),e.createElementBlock("td",null,[r.column.render?r.row?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.value?(e.openBlock(),e.createElementBlock("div",_e,[typeof a.value=="string"?(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",{innerHTML:a.value},null,8,Be)])):e.isVNode(a.value)?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value)))])):(e.openBlock(),e.createElementBlock("div",xe,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s(a.value.component)),e.normalizeProps(e.guardReactiveProps(o(r.row,r.column))),null,16))]))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref($)(r.row,r.column.data)),1)],64))]))}}),we={key:0},Ee=["colspan"],Ne=["onClick"],Ve=e.defineComponent({__name:"Table",props:{zebra:{type:Boolean,default:!1},pinRows:{type:Boolean,default:!1},pinCols:{type:Boolean,default:!1},size:{default:R.MD},columns:{},dataSource:{},ajax:{},searchValue:{},searchFunction:{},onRowClick:{}},setup(t){const n=e.ref([]),a=e.ref([]),o=e.ref(null),s=t,r=e.ref(T("table",j.toClassName(s.size),{"table-zebra":s.zebra,"table-pin-rows":s.pinRows,"table-pin-cols ":s.pinCols})),c=(h,N)=>{s.onRowClick&&s.onRowClick(h,N)};e.onMounted(()=>{n.value=s.dataSource,a.value=s.dataSource}),e.watch(()=>s.dataSource,h=>{console.log("dataSource changed",h),n.value=h,a.value=h},{immediate:!0}),e.watch(()=>s.searchValue,h=>{if(s.searchFunction){a.value=s.searchFunction(h??"");return}a.value=h?f(h):n.value},{immediate:!0});const f=h=>{const N=[];return n.value.length>0?(Object.keys(n.value[0]).forEach(C=>{const S=n.value.map(m=>$(m,C)),l=ye(S)(h);for(const m of l){const _=n.value.filter(u=>$(u,C)===m.item);N.push(..._)}}),N):[]};return(h,N)=>(e.openBlock(),e.createElementBlock("table",{ref_key:"table",ref:o,class:e.normalizeClass(r.value)},[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.columns,x=>(e.openBlock(),e.createElementBlock("th",{key:x.title},e.toDisplayString(x.title),1))),128))])]),e.createElementVNode("tbody",null,[a.value.length===0?(e.openBlock(),e.createElementBlock("tr",we,[e.createElementVNode("td",{colspan:s.columns.length},"No data found",8,Ee)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.value,(x,C)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass(s.onRowClick?"hover":""),key:JSON.stringify(x),onClick:S=>c(x,C)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.columns,S=>(e.openBlock(),e.createBlock(Ce,{key:S.data,column:S,row:x,rowIndex:C},null,8,["column","row","rowIndex"]))),128))],10,Ne))),128))])],2))}}),ze=e.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(t,{expose:n,emit:a}){const o=t,s=e.ref(o.value),r=a,c=f=>{s.value=f,r("update:value",f)};return e.provide("stepper",{value:s,updateValue:c}),e.watch(()=>o.value,f=>{s.value=f}),n({updateValue:c}),(f,h)=>e.renderSlot(f.$slots,"default",{updateValue:c})}}),$e=e.defineComponent({__name:"Step",props:{value:{}},setup(t){const n=t,a=e.inject("stepper"),o=e.ref("");return e.watch(()=>a?.value.value,s=>{s&&n.value&&(o.value=Number(s)>=Number(n.value)?"step-primary":"")}),e.onMounted(()=>{a&&(o.value=a.value.value===n.value?"step-primary":"",Number(a.value.value)>=Number(n.value)&&(o.value="step-primary"))}),(s,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["step",o.value])},[e.renderSlot(s.$slots,"default")],2))}}),Me={},Te={class:"steps"};function Le(t,n){return e.openBlock(),e.createElementBlock("ul",Te,[e.renderSlot(t.$slots,"default")])}const Fe=D(Me,[["render",Le]]),Re={key:0},ve=e.defineComponent({__name:"StepPanels",setup(t){const n=e.inject("stepper");return(a,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[e.unref(n)?.value?(e.openBlock(),e.createElementBlock("div",Re,[e.renderSlot(a.$slots,"default",{currentStep:e.unref(n)?.value})])):e.createCommentVNode("",!0)]),_:3}))}}),De={key:0},Oe=e.defineComponent({__name:"StepPanel",props:{value:{}},setup(t,{expose:n}){const a=e.computed(()=>o?.value.value),o=e.inject("stepper"),s=r=>{o&&o.updateValue(r.toString())};return n({activateCallback:s}),(r,c)=>r.value===a.value?(e.openBlock(),e.createElementBlock("div",De,[e.renderSlot(r.$slots,"default",{activateCallback:s})])):e.createCommentVNode("",!0)}}),We={key:0,method:"dialog"},Pe=e.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1},closeButtonSize:{default:R.SM},extraBoxClasses:{}},emits:["close"],setup(t,{expose:n,emit:a}){const o=e.ref(null),s=a,r=t,c=e.ref(T("modal-box",r.extraBoxClasses,{"overflow-visible":r.overflow})),f=e.ref(T("modal")),h=e.ref(T("btn",I.toClassName(r.closeButtonSize),"btn-circle","btn-ghost","absolute","right-2","top-2"));return n({showModal:()=>{o.value?.showModal()},closeModal:()=>{o.value?.close()}}),(C,S)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"modal",ref:o,class:e.normalizeClass([f.value,C.$attrs.class]),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:S[0]||(S[0]=i=>s("close",i))},[e.createElementVNode("div",{class:e.normalizeClass(c.value)},[C.closeButton?(e.openBlock(),e.createElementBlock("form",We,[e.createElementVNode("button",{class:e.normalizeClass(h.value)},"✕",2)])):e.createCommentVNode("",!0),e.renderSlot(C.$slots,"default")],2),S[1]||(S[1]=e.createElementVNode("form",{method:"dialog",class:"modal-backdrop"},[e.createElementVNode("button",null,"close")],-1))],34))}}),Ae={class:"hidden w-full max-w-sm lg:flex"},Ue={class:"relative mx-3 w-full"},qe={class:"relative w-full max-w-full"},Ie=["value"],Xe=e.defineComponent({__name:"SearchBar",props:["modelValue"],emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=e.ref(null),s=n,r=c=>{(c.ctrlKey||c.metaKey)&&c.key.toLowerCase()==="k"&&(c.preventDefault(),o.value&&o.value.focus())};return e.onMounted(()=>{document.addEventListener("keydown",r)}),e.onUnmounted(()=>{document.removeEventListener("keydown",r)}),(c,f)=>(e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("label",Ue,[f[1]||(f[1]=e.createElementVNode("svg",{class:"pointer-events-none absolute z-10 my-3.5 ms-4 text-base-content opacity-60","aria-hidden":"true",width:"16",height:"16",viewBox:"0.48 0.48 23.04 23.04",fill:"currentColor"},[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"}),e.createElementVNode("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})],-1)),e.createElementVNode("div",qe,[e.createElementVNode("form",null,[e.createElementVNode("input",{ref_key:"searchInput",ref:o,type:"search",placeholder:"Zoeken...",value:a.modelValue,onInput:f[0]||(f[0]=h=>s("update:modelValue",h.target.value)),class:"color-[inherit] w-full rounded-xl border-[2px] border-solid border-transparent bg-transparent px-3 py-2 ps-10 focus:border-[2px] focus:border-base-200 focus:outline-none"},null,40,Ie)])]),f[2]||(f[2]=e.createElementVNode("div",{class:"pointer-events-none absolute end-10 top-2.5 hidden gap-1 opacity-50 lg:flex rtl:flex-row-reverse"},[e.createElementVNode("kbd",{class:"kbd kbd-sm"},"ctrl"),e.createElementVNode("kbd",{class:"kbd kbd-sm"},"K")],-1))])]))}}),je=["bg-primary","bg-primary-content","bg-secondary","bg-secondary-content","bg-accent","bg-accent-content","bg-neutral","bg-neutral-content","bg-base-100","bg-base-200","bg-base-300","bg-base-content","bg-info","bg-info-content","bg-success","bg-success-content","bg-warning","bg-warning-content","bg-error","bg-error-content","btn-primary","btn-primary-content","btn-secondary","btn-secondary-content","btn-accent","btn-accent-content","btn-neutral","btn-neutral-content","btn-base-100","btn-base-200","btn-base-300","btn-base-content","btn-info","btn-info-content","btn-success","btn-success-content","btn-warning","btn-warning-content","btn-error","btn-error-content","text-primary","text-primary-content","text-secondary","text-secondary-content","text-accent","text-accent-content","text-neutral","text-neutral-content","text-base-100","text-base-200","text-base-300","text-base-content","text-info","text-info-content","text-success","text-success-content","text-warning","text-warning-content","text-error","text-error-content","text-transparent","step","steps","modal","modal-box","btn","btn-sm","btn-circle","btn-ghost","absolute","right-2","top-2","shadow-lg","w-full","rounded-xs","rounded-sm","rounded-md","rounded-lg","rounded-xl","rounded-2xl","rounded-3xl","hidden","block"];d.BackgroundColorUtils=U,d.Button=se,d.ButtonColorUtils=q,d.ButtonSizeUtils=I,d.Card=ie,d.CardBody=pe,d.CardTitle=me,d.Color=F,d.Container=be,d.Modal=Pe,d.RoundedSizeUtils=X,d.SearchBar=Xe,d.SimpleButton=le,d.Size=R,d.Step=$e,d.StepList=Fe,d.StepPanel=Oe,d.StepPanels=ve,d.Stepper=ze,d.Table=Ve,d.TableSizeUtils=j,d.TextColorUtils=ee,d.dendelionSafeList=je,d.getValue=$,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
*/var G;function ne(){return G||(G=1,function(t){(function(){var n={}.hasOwnProperty;function a(){for(var r="",c=0;c<arguments.length;c++){var f=arguments[c];f&&(r=o(r,s(f)))}return r}function s(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return a.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var f in r)n.call(r,f)&&r[f]&&(c=o(c,f));return c}function o(r,c){return c?r?r+" "+c:r+c:r}t.exports?(a.default=a,t.exports=a):window.classNames=a})()}(D)),D.exports}var re=ne();const T=H(re),ae=["type","disabled"],oe={class:"group-[.is-loading]:text-transparent"},se=e.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:F.Neutral},soft:{type:Boolean,default:!1},outline:{type:Boolean,default:!1},disabled:{type:Boolean},click:{}},setup(t){const n=t,a=e.computed(()=>T("btn","group",I.toClassName(n.color),n.soft?"btn-soft":"",n.outline?"btn-outline":"",n.loading?"is-loading":"",n.disabled?"disabled":""));return(s,o)=>(e.openBlock(),e.createElementBlock("button",{onClick:o[0]||(o[0]=r=>s.click?s.click:void 0),class:e.normalizeClass(a.value),type:s.type,disabled:s.disabled||s.loading},[o[1]||(o[1]=e.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),e.createElementVNode("span",oe,[e.renderSlot(s.$slots,"default")])],10,ae))}}),O=(t,n)=>{const a=t.__vccOpts||t;for(const[s,o]of n)a[s]=o;return a},ce={};function le(t,n){return e.openBlock(),e.createElementBlock("button")}const ie=O(ce,[["render",le]]),ue=e.defineComponent({__name:"Card",props:{backgroundColor:{default:F.Primary},shadow:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},rounded:{type:Boolean},roundedSize:{}},setup(t){const n=t,a=e.ref(T("card",q.toClassName(n.backgroundColor),n.shadow?"shadow-lg":"",n.fullWidth?"w-full":"",n.rounded&&!n.roundedSize?"rounded":n.roundedSize?j.toClassName(n.roundedSize):""));return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(s.$slots,"default")],2))}}),de={},fe={class:"card-body"};function pe(t,n){return e.openBlock(),e.createElementBlock("div",fe,[e.renderSlot(t.$slots,"default")])}const me=O(de,[["render",pe]]),be=e.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(t){return(n,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.is),{class:"card-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.text),1)]),_:1}))}}),he=e.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(t){const n=t,a=e.ref([n.container?"container":"",n.padding?"p-6":""]);return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(s.$slots,"default")],2))}}),$=(t,n)=>String(!t||typeof t!="object"?t:n.split(".").reduce((a,s)=>a&&(typeof a=="object"?a[s]:a),t));var W={},P={},J;function Z(){return J||(J=1,function(t){t.__esModule=!0,t.default=o;var n=/[\u0300-\u036f]/g,a=/ł/g,s=/ñ/g;function o(r){return r.toLowerCase().normalize("NFD").replace(n,"").replace(a,"l").replace(s,"n").trim()}}(P)),P}var M={},Y;function v(){if(Y)return M;Y=1,M.__esModule=!0,M.aggressiveFuzzyMatch=h,M.createFuzzySearchImpl=S,M.experimentalSmartFuzzyMatch=N,M.fuzzyMatchImpl=E;var t=n(Z());function n(i){return i&&i.__esModule?i:{default:i}}var a=Number.MAX_SAFE_INTEGER,s=function(l,m){return l.score-m.score},o=function(l,m){return l[0]-m[0]},r=new Set(` []()-–—'"“”`.split(""));function c(i){return r.has(i)}function f(i,l,m,k,u,y,b){if(i===k)return[0,[[0,i.length-1]]];var p=k.length,g=l.length,B=u.length;if(l===u)return[.1,[[0,g-1]]];if(l.startsWith(u))return[.5,[[0,B-1]]];var x=i.indexOf(k);if(x>-1&&c(i[x-1]))return[.9,[[x,x+p-1]]];var C=l.indexOf(u);if(C>-1&&c(l[C-1]))return[1,[[C,C+p-1]]];var w=y.length;if(w>1&&y.every(function(z){return m.has(z)})){var V=1.5+w*.2;return[V,y.map(function(z){var L=l.indexOf(z);return[L,L+z.length-1]}).sort(o)]}return C>-1?[2,[[C,C+p-1]]]:b==="aggressive"?h(l,u):b==="smart"?N(l,u):null}function h(i,l){for(var m=i.length,k=l.length,u=0,y=l[u],b=[],p=-1,g=-2,B=0;B<m;B+=1)if(i[B]===y){if(B!==g+1&&(p>=0&&b.push([p,g]),p=B),g=B,u+=1,u===k)return b.push([p,g]),_(b,i);y=l[u]}return null}function N(i,l){for(var m=i.length,k=[],u=0,y=l[u],b=-1,p=-2;;){var g=i.indexOf(y,p+1);if(g===-1)break;if(g===0||c(i[g-1]))b=g;else{var B=l.length-u,x=i.length-g,C=Math.min(3,B,x),w=l.slice(u,u+C);if(i.slice(g,g+C)===w)b=g;else{p+=1;continue}}for(p=b;p<m&&i[p]===y;p+=1)u+=1,y=l[u];if(p-=1,k.push([b,p]),u===l.length)return _(k,i)}return null}function _(i,l){var m=2;return i.forEach(function(k){var u=k[0],y=k[1],b=y-u+1,p=u===0||l[u]===" "||l[u-1]===" ",g=y===l.length-1||l[y]===" "||l[y+1]===" ",B=p&&g;B?m+=.2:p?m+=.4:b>=3?m+=.8:m+=1.6}),[m,i]}function E(i,l){var m=(0,t.default)(l),k=m.split(" "),u=(0,t.default)(i),y=new Set(u.split(" ")),b=f(i,u,y,l,m,k,"smart");return b?{item:i,score:b[0],matches:[b[1]]}:null}function S(i,l){var m=l.strategy,k=m===void 0?"aggressive":m,u=l.getText,y=i.map(function(b){var p;if(u)p=u(b);else{var g=l.key?b[l.key]:b;p=[g]}var B=p.map(function(x){var C=x||"",w=(0,t.default)(C),V=new Set(w.split(" "));return[C,w,V]});return[b,B]});return function(b){var p=[],g=(0,t.default)(b),B=g.split(" ");return g.length?(y.forEach(function(x){for(var C=x[0],w=x[1],V=a,z=[],L=0,ve=w.length;L<ve;L+=1){var A=w[L],Qe=A[0],et=A[1],tt=A[2],U=f(Qe,et,tt,b,g,B,k);U?(V=Math.min(V,U[0]),z.push(U[1])):z.push(null)}V<a&&p.push({item:C,score:V,matches:z})}),p.sort(s),p):[]}}return M}var Q;function ge(){return Q||(Q=1,function(t){t.__esModule=!0,t.default=s,t.fuzzyMatch=o;var n=a(Z());t.normalizeText=n.default;function a(r){return r&&r.__esModule?r:{default:r}}function s(r,c){return c===void 0&&(c={}),v().createFuzzySearchImpl(r,c)}function o(r,c){return v().fuzzyMatchImpl(r,c)}}(W)),W}var ye=ge();const ke=H(ye),Be={key:0},_e={key:0},Se=["innerHTML"],Ce={key:1},Ee={key:2},ee=e.defineComponent({__name:"TableColumn",props:{column:{},row:{},rowIndex:{}},setup(t){const n=t,a=e.computed(()=>n.column.render?n.column.render($(n.row,n.column.data),n.row):$(n.row,n.column.data));e.onMounted(()=>{a.value&&typeof a.value=="object"&&"then"in a.value&&console.warn("Async component detected in TableColumn, this may cause issues with rendering.")});const s=(r,c)=>c.render===void 0?{}:c.render($(r,c.data),r).props,o=r=>(console.log("getComponent",r),r&&typeof r=="object"&&"then"in r?e.defineAsyncComponent(()=>r):typeof r=="function"?e.defineAsyncComponent(r):r);return(r,c)=>(e.openBlock(),e.createElementBlock("td",null,[r.column.render?r.row?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.value?(e.openBlock(),e.createElementBlock("div",Be,[typeof a.value=="string"?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",{innerHTML:a.value},null,8,Se)])):e.isVNode(a.value)?(e.openBlock(),e.createElementBlock("div",Ce,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value)))])):(e.openBlock(),e.createElementBlock("div",Ee,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o(a.value.component)),e.normalizeProps(e.guardReactiveProps(s(r.row,r.column))),null,16))]))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref($)(r.row,r.column.data)),1)],64))]))}}),xe={key:0},we={key:1},Ne={key:0},Ve=["colspan"],ze=["onClick"],$e={key:2},Me={key:0},Te=["colspan"],Le=e.defineComponent({__name:"Table",props:{zebra:{type:Boolean,default:!1},pinRows:{type:Boolean,default:!1},pinCols:{type:Boolean,default:!1},horizontal:{type:Boolean,default:!1},size:{default:R.MD},columns:{},dataSource:{},ajax:{},searchValue:{},searchFunction:{},onRowClick:{}},setup(t){const n=e.ref([]),a=e.ref([]),s=e.ref(null),o=t,r=e.ref(T("table",K.toClassName(o.size),{"table-zebra":o.zebra,"table-pin-rows":o.pinRows,"table-pin-cols ":o.pinCols})),c=(h,N)=>{o.onRowClick&&o.onRowClick(h,N)};e.onMounted(()=>{n.value=o.dataSource,a.value=o.dataSource}),e.watch(()=>o.dataSource,h=>{console.log("dataSource changed",h),n.value=h,a.value=h},{immediate:!0}),e.watch(()=>o.searchValue,h=>{if(o.searchFunction){a.value=o.searchFunction(h??"");return}a.value=h?f(h):n.value},{immediate:!0});const f=h=>{const N=[];return n.value.length>0?(Object.keys(n.value[0]).forEach(E=>{const S=n.value.map(m=>$(m,E)),l=ke(S)(h);for(const m of l){const k=n.value.filter(u=>$(u,E)===m.item);N.push(...k)}}),N):[]};return(h,N)=>(e.openBlock(),e.createElementBlock("table",{ref_key:"table",ref:s,class:e.normalizeClass(r.value)},[h.horizontal?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("thead",xe,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columns,_=>(e.openBlock(),e.createElementBlock("th",{key:_.title},e.toDisplayString(_.title),1))),128))])])),h.horizontal?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tbody",we,[a.value.length===0?(e.openBlock(),e.createElementBlock("tr",Ne,[e.createElementVNode("td",{colspan:o.columns.length},"No data found",8,Ve)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.value,(_,E)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass(o.onRowClick?"hover":""),key:JSON.stringify(_),onClick:S=>c(_,E)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columns,S=>(e.openBlock(),e.createBlock(ee,{key:S.data,column:S,row:_,rowIndex:E},null,8,["column","row","rowIndex"]))),128))],10,ze))),128))])),h.horizontal?(e.openBlock(),e.createElementBlock("tbody",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columns,_=>(e.openBlock(),e.createElementBlock("tr",{key:_.title},[e.createElementVNode("th",null,e.toDisplayString(_.title),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(E,S)=>(e.openBlock(),e.createBlock(ee,{key:S,column:_,row:E,rowIndex:S},null,8,["column","row","rowIndex"]))),128))]))),128)),a.value.length===0?(e.openBlock(),e.createElementBlock("tr",Me,[e.createElementVNode("td",{colspan:o.columns.length+1,style:{"text-align":"center",padding:"1rem"}}," No data found ",8,Te)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),Fe=e.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(t,{expose:n,emit:a}){const s=t,o=e.ref(s.value),r=a,c=f=>{o.value=f,r("update:value",f)};return e.provide("stepper",{value:o,updateValue:c}),e.watch(()=>s.value,f=>{o.value=f}),n({updateValue:c}),(f,h)=>e.renderSlot(f.$slots,"default",{updateValue:c})}}),Re=e.defineComponent({__name:"Step",props:{value:{}},setup(t){const n=t,a=e.inject("stepper"),s=e.ref("");return e.watch(()=>a?.value.value,o=>{o&&n.value&&(s.value=Number(o)>=Number(n.value)?"step-primary":"")}),e.onMounted(()=>{a&&(s.value=a.value.value===n.value?"step-primary":"",Number(a.value.value)>=Number(n.value)&&(s.value="step-primary"))}),(o,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["step",s.value])},[e.renderSlot(o.$slots,"default")],2))}}),De={},Oe={class:"steps"};function We(t,n){return e.openBlock(),e.createElementBlock("ul",Oe,[e.renderSlot(t.$slots,"default")])}const Pe=O(De,[["render",We]]),Ae={key:0},Ue=e.defineComponent({__name:"StepPanels",setup(t){const n=e.inject("stepper");return(a,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[e.unref(n)?.value?(e.openBlock(),e.createElementBlock("div",Ae,[e.renderSlot(a.$slots,"default",{currentStep:e.unref(n)?.value})])):e.createCommentVNode("",!0)]),_:3}))}}),qe={key:0},Ie=e.defineComponent({__name:"StepPanel",props:{value:{}},setup(t,{expose:n}){const a=e.computed(()=>s?.value.value),s=e.inject("stepper"),o=r=>{s&&s.updateValue(r.toString())};return n({activateCallback:o}),(r,c)=>r.value===a.value?(e.openBlock(),e.createElementBlock("div",qe,[e.renderSlot(r.$slots,"default",{activateCallback:o})])):e.createCommentVNode("",!0)}}),Xe={key:0,method:"dialog"},je=e.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1},closeButtonSize:{default:R.SM},extraBoxClasses:{}},emits:["close"],setup(t,{expose:n,emit:a}){const s=e.ref(null),o=a,r=t,c=e.ref(T("modal-box",r.extraBoxClasses,{"overflow-visible":r.overflow})),f=e.ref(T("modal")),h=e.ref(T("btn",X.toClassName(r.closeButtonSize),"btn-circle","btn-ghost","absolute","right-2","top-2"));return n({showModal:()=>{s.value?.showModal()},closeModal:()=>{s.value?.close()}}),(E,S)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"modal",ref:s,class:e.normalizeClass([f.value,E.$attrs.class]),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:S[0]||(S[0]=i=>o("close",i))},[e.createElementVNode("div",{class:e.normalizeClass(c.value)},[E.closeButton?(e.openBlock(),e.createElementBlock("form",Xe,[e.createElementVNode("button",{class:e.normalizeClass(h.value)},"✕",2)])):e.createCommentVNode("",!0),e.renderSlot(E.$slots,"default")],2),S[1]||(S[1]=e.createElementVNode("form",{method:"dialog",class:"modal-backdrop"},[e.createElementVNode("button",null,"close")],-1))],34))}}),Ke={class:"hidden w-full max-w-sm lg:flex"},He={class:"relative mx-3 w-full"},Ge={class:"relative w-full max-w-full"},Je=["value"],Ze=e.defineComponent({__name:"SearchBar",props:["modelValue"],emits:["update:modelValue"],setup(t,{emit:n}){const a=t,s=e.ref(null),o=n,r=c=>{(c.ctrlKey||c.metaKey)&&c.key.toLowerCase()==="k"&&(c.preventDefault(),s.value&&s.value.focus())};return e.onMounted(()=>{document.addEventListener("keydown",r)}),e.onUnmounted(()=>{document.removeEventListener("keydown",r)}),(c,f)=>(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("label",He,[f[1]||(f[1]=e.createElementVNode("svg",{class:"pointer-events-none absolute z-10 my-3.5 ms-4 text-base-content opacity-60","aria-hidden":"true",width:"16",height:"16",viewBox:"0.48 0.48 23.04 23.04",fill:"currentColor"},[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"}),e.createElementVNode("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})],-1)),e.createElementVNode("div",Ge,[e.createElementVNode("form",null,[e.createElementVNode("input",{ref_key:"searchInput",ref:s,type:"search",placeholder:"Zoeken...",value:a.modelValue,onInput:f[0]||(f[0]=h=>o("update:modelValue",h.target.value)),class:"color-[inherit] w-full rounded-xl border-[2px] border-solid border-transparent bg-transparent px-3 py-2 ps-10 focus:border-[2px] focus:border-base-200 focus:outline-none"},null,40,Je)])]),f[2]||(f[2]=e.createElementVNode("div",{class:"pointer-events-none absolute end-10 top-2.5 hidden gap-1 opacity-50 lg:flex rtl:flex-row-reverse"},[e.createElementVNode("kbd",{class:"kbd kbd-sm"},"ctrl"),e.createElementVNode("kbd",{class:"kbd kbd-sm"},"K")],-1))])]))}}),Ye=["bg-primary","bg-primary-content","bg-secondary","bg-secondary-content","bg-accent","bg-accent-content","bg-neutral","bg-neutral-content","bg-base-100","bg-base-200","bg-base-300","bg-base-content","bg-info","bg-info-content","bg-success","bg-success-content","bg-warning","bg-warning-content","bg-error","bg-error-content","btn-primary","btn-primary-content","btn-secondary","btn-secondary-content","btn-accent","btn-accent-content","btn-neutral","btn-neutral-content","btn-base-100","btn-base-200","btn-base-300","btn-base-content","btn-info","btn-info-content","btn-success","btn-success-content","btn-warning","btn-warning-content","btn-error","btn-error-content","text-primary","text-primary-content","text-secondary","text-secondary-content","text-accent","text-accent-content","text-neutral","text-neutral-content","text-base-100","text-base-200","text-base-300","text-base-content","text-info","text-info-content","text-success","text-success-content","text-warning","text-warning-content","text-error","text-error-content","text-transparent","step","steps","modal","modal-box","btn","btn-sm","btn-circle","btn-ghost","absolute","right-2","top-2","shadow-lg","w-full","rounded-xs","rounded-sm","rounded-md","rounded-lg","rounded-xl","rounded-2xl","rounded-3xl","hidden","block"];d.BackgroundColorUtils=q,d.Button=se,d.ButtonColorUtils=I,d.ButtonSizeUtils=X,d.Card=ue,d.CardBody=me,d.CardTitle=be,d.Color=F,d.Container=he,d.Modal=je,d.RoundedSizeUtils=j,d.SearchBar=Ze,d.SimpleButton=ie,d.Size=R,d.Step=Re,d.StepList=Pe,d.StepPanel=Ie,d.StepPanels=Ue,d.Stepper=Fe,d.Table=Le,d.TableSizeUtils=K,d.TextColorUtils=te,d.dendelionSafeList=Ye,d.getValue=$,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dendelion-ui",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "Simpel component library using Tailwind css and DaisyUI",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.21",
|
|
6
6
|
"author": "ThatzOkay",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/ThatzOkay/DendelionUI#readme",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<table ref="table" :class="tableClasses">
|
|
3
|
-
<thead>
|
|
3
|
+
<thead v-if="!horizontal">
|
|
4
4
|
<tr>
|
|
5
5
|
<th v-for="column in props.columns" v-bind:key="column.title">
|
|
6
6
|
{{ column.title }}
|
|
7
7
|
</th>
|
|
8
8
|
</tr>
|
|
9
9
|
</thead>
|
|
10
|
-
<tbody>
|
|
10
|
+
<tbody v-if="!horizontal">
|
|
11
11
|
<tr v-if="filteredDataSource.length === 0">
|
|
12
12
|
<td :colspan="props.columns.length">No data found</td>
|
|
13
13
|
</tr>
|
|
@@ -17,13 +17,30 @@
|
|
|
17
17
|
:rowIndex="rowIndex" />
|
|
18
18
|
</tr>
|
|
19
19
|
</tbody>
|
|
20
|
+
<tbody v-if="horizontal">
|
|
21
|
+
<tr v-for="(column) in props.columns" :key="column.title">
|
|
22
|
+
<th>{{ column.title }}</th>
|
|
23
|
+
<TableColumn
|
|
24
|
+
v-for="(row, rowIndex) in filteredDataSource"
|
|
25
|
+
:key="rowIndex"
|
|
26
|
+
:column="column"
|
|
27
|
+
:row="row as T"
|
|
28
|
+
:rowIndex="rowIndex"
|
|
29
|
+
/>
|
|
30
|
+
</tr>
|
|
31
|
+
|
|
32
|
+
<tr v-if="filteredDataSource.length === 0">
|
|
33
|
+
<td :colspan="props.columns.length + 1" style="text-align:center; padding:1rem;">
|
|
34
|
+
No data found
|
|
35
|
+
</td>
|
|
36
|
+
</tr>
|
|
37
|
+
</tbody>
|
|
20
38
|
</table>
|
|
21
39
|
</template>
|
|
22
40
|
|
|
23
41
|
<script setup lang="ts" generic="T">
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import { Column, ColumnComponent, ComponentImport, ComponentOrImport, getValue, TableProps } from './interface';
|
|
42
|
+
import { onMounted, ref, watch } from 'vue';
|
|
43
|
+
import { getValue, TableProps } from './interface';
|
|
27
44
|
import classNames from 'classnames';
|
|
28
45
|
import { Size, TableSizeUtils } from '../../types';
|
|
29
46
|
import createFuzzySearch from '@nozbe/microfuzz';
|
|
@@ -39,6 +56,7 @@ const props = withDefaults(defineProps<TableProps<T>>(), {
|
|
|
39
56
|
zebra: false,
|
|
40
57
|
pinRows: false,
|
|
41
58
|
pinCols: false,
|
|
59
|
+
horizontal: false,
|
|
42
60
|
});
|
|
43
61
|
|
|
44
62
|
const tableClasses = ref(
|
|
@@ -5,6 +5,7 @@ export type TableProps<T> = {
|
|
|
5
5
|
zebra?: boolean;
|
|
6
6
|
pinRows?: boolean;
|
|
7
7
|
pinCols?: boolean;
|
|
8
|
+
horizontal?: boolean;
|
|
8
9
|
size?: Size;
|
|
9
10
|
columns: Column<T>[];
|
|
10
11
|
dataSource: T[];
|
|
@@ -52,4 +53,4 @@ export const getValue = (obj: any, keyPath: string): string => {
|
|
|
52
53
|
.split('.')
|
|
53
54
|
.reduce<unknown>((acc, key) => acc && (typeof acc === 'object' ? (acc as Record<string, any>)[key] : acc), obj),
|
|
54
55
|
);
|
|
55
|
-
};
|
|
56
|
+
};
|