dendelion-ui 0.0.4 → 0.0.5
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 +2 -2
- package/dist/dendelion-ui.es.js +377 -195
- package/dist/dendelion-ui.umd.js +2 -2
- package/dist/types/components/table/Table.vue.d.ts +12 -9
- package/dist/types/components/table/index.d.ts +1 -1
- package/dist/types/components/table/interface.d.ts +10 -7
- package/package.json +4 -2
- package/src/components/table/Table.vue +41 -4
- package/src/components/table/index.ts +1 -1
- package/src/components/table/interface.ts +10 -7
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
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");var L=(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))(L||{});class D{static toClassName(r){switch(r){case 0:return"primary";case 1:return"primary-content";case 2:return"secondary";case 3:return"secondary-content";case 4:return"accent";case 5:return"accent-content";case 6:return"neutral";case 7:return"neutral-content";case 8:return"base-100";case 9:return"base-200";case 10:return"base-300";case 11:return"base-content";case 12:return"info";case 13:return"info-content";case 14:return"success";case 15:return"success-content";case 16:return"warning";case 17:return"warning-content";case 18:return"error";case 19:return"error-content";default:return"primary"}}}function I(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var T={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 _;function k(){return _||(_=1,function(t){(function(){var n={}.hasOwnProperty;function a(){for(var r="",c=0;c<arguments.length;c++){var l=arguments[c];l&&(r=o(r,s(l)))}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 l in r)n.call(r,l)&&r[l]&&(c=o(c,l));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})()}(m)),m.exports}var x=k();const d=B(x),w=["type"],S={class:"group-[.is-loading]:text-transparent"},E=e.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:p.Neutral},click:{}},setup(t){const n=t,a=e.ref(d("btn","group",`btn-${f.toClassName(n.color)}`,n.loading?"is-loading":""));return e.watch(()=>n.loading,s=>{a.value=d("btn","group",`btn-${f.toClassName(n.color)}`,s?"is-loading":"")}),(s,o)=>(e.openBlock(),e.createElementBlock("button",{onClick:o[0]||(o[0]=(...r)=>s.click&&s.click(...r)),class:e.normalizeClass(a.value),type:s.type},[o[1]||(o[1]=e.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),e.createElementVNode("span",S,[e.renderSlot(s.$slots,"default")])],10,w))}});var b=(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))(b||{});class v{static toClassName(n){switch(n){case 0:return"xs";case 1:return"sm";case 2:return"md";case 3:return"lg";case 4:return"xl";case 5:return"2xl";case 6:return"3xl";default:return"md"}}}const N=e.defineComponent({__name:"Card",props:{backgroundColor:{default:p.Primary},shadow:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},rounded:{type:Boolean},roundedSize:{}},setup(t){const n=t,a=e.ref(d("card",`bg-${n.backgroundColor}`,n.shadow?"shadow-lg":"",n.fullWidth?"w-full":"",n.rounded&&!n.roundedSize?"rounded":n.roundedSize?`rounded-${n.roundedSize}`:""));return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(s.$slots,"default")],2))}}),y=(t,n)=>{const a=t.__vccOpts||t;for(const[s,o]of n)a[s]=o;return a},$={},C={class:"card-body"};function V(t,n){return e.openBlock(),e.createElementBlock("div",C,[e.renderSlot(t.$slots,"default")])}const M=y($,[["render",V]]),L=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}))}}),P=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=e.defineComponent({__name:"Table",props:{zebra:{type:Boolean,default:!1},pinRows:{type:Boolean,default:!1},pinCols:{type:Boolean,default:!1},size:{default:b.MD},columns:{},dataSource:{},ajax:{}},setup(t){const n=e.ref(null),a=t,s=e.ref(d("table",`table-${v.toClassName(a.size)}`,{"table-zebra":a.zebra,"table-pin-rows":a.pinRows,"table-pin-cols ":a.pinCols}));return(o,r)=>(e.openBlock(),e.createElementBlock("table",{ref_key:"table",ref:n,class:e.normalizeClass(s.value)},null,2))}}),j=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=l=>{o.value=l,r("update:value",l)};return e.provide("stepper",{value:o,updateValue:c}),e.watch(()=>s.value,l=>{o.value=l}),n({updateValue:c}),(l,g)=>e.renderSlot(l.$slots,"default",{updateValue:c})}}),z=e.defineComponent({__name:"Step",props:{value:{}},setup(t){const n=t,a=e.inject("stepper"),s=e.ref("");return e.watch(()=>a==null?void 0: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))}}),O={},W={class:"steps"};function X(t,n){return e.openBlock(),e.createElementBlock("ul",W,[e.renderSlot(t.$slots,"default")])}const A=y(O,[["render",X]]),D={key:0},I=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(()=>{var o,r;return[(o=e.unref(n))!=null&&o.value?(e.openBlock(),e.createElementBlock("div",D,[e.renderSlot(a.$slots,"default",{currentStep:(r=e.unref(n))==null?void 0:r.value})])):e.createCommentVNode("",!0)]}),_:3}))}}),R={key:0},U=e.defineComponent({__name:"StepPanel",props:{value:{}},setup(t,{expose:n}){const a=e.computed(()=>s==null?void 0: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",R,[e.renderSlot(r.$slots,"default",{activateCallback:o})])):e.createCommentVNode("",!0)}}),K={className:"modal-box"},q={key:0,method:"dialog"},H=e.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1}},emits:["close"],setup(t,{expose:n,emit:a}){const s=e.ref(null),o=a,r=t,c=e.ref(d("modal",{"overflow-visible":r.overflow}));return n({showModal:()=>{var u;(u=s.value)==null||u.showModal()},closeModal:()=>{var u;(u=s.value)==null||u.close()}}),(u,i)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"modal",ref:s,class:e.normalizeClass(c.value),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:i[0]||(i[0]=h=>o("close",h))},[e.createElementVNode("div",K,[u.closeButton?(e.openBlock(),e.createElementBlock("form",q,i[1]||(i[1]=[e.createElementVNode("button",{className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2"},"✕",-1)]))):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default")])],34))}}),G={class:"hidden w-full max-w-sm lg:flex"},F={class:"relative mx-3 w-full"},Z={class:"w-full max-w-full relative"},J=e.defineComponent({__name:"SearchBar",emits:["input"],setup(t,{emit:n}){const a=e.ref(null),s=n,o=r=>{(r.ctrlKey||r.metaKey)&&r.key.toLowerCase()==="k"&&(r.preventDefault(),a.value&&a.value.focus())};return e.onMounted(()=>{document.addEventListener("keydown",o)}),e.onUnmounted(()=>{document.removeEventListener("keydown",o)}),(r,c)=>(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("label",F,[c[1]||(c[1]=e.createElementVNode("svg",{class:"pointer-events-none absolute z-10 my-3.5 ms-4 opacity-60 text-base-content","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",Z,[e.createElementVNode("form",null,[e.createElementVNode("input",{ref_key:"searchInput",ref:a,type:"search",placeholder:"Zoeken...",onInput:c[0]||(c[0]=l=>s("input",l.target.value)),class:"bg-transparent color-[inherit] border-[2px] border-solid border-transparent focus:border-[2px] focus:border-base-200 focus:outline-none rounded-xl w-full px-3 py-2 ps-10"},null,544)])]),c[2]||(c[2]=e.createElementVNode("div",{class:"pointer-events-none absolute end-10 top-2.5 gap-1 opacity-50 rtl:flex-row-reverse hidden lg:flex"},[e.createElementVNode("kbd",{class:"kbd kbd-sm"},"ctrl"),e.createElementVNode("kbd",{class:"kbd kbd-sm"},"K")],-1))])]))}}),Q=["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.Button=E;exports.Card=N;exports.CardBody=M;exports.CardTitle=L;exports.Color=p;exports.ColorUtils=f;exports.Container=P;exports.Modal=H;exports.SearchBar=J;exports.Size=b;exports.SizeUtils=v;exports.Step=z;exports.StepList=A;exports.StepPanel=U;exports.StepPanels=I;exports.Stepper=j;exports.Table=T;exports.dendelionSafeList=Q;
|
|
5
|
+
*/var R;function Q(){return R||(R=1,function(t){(function(){var r={}.hasOwnProperty;function a(){for(var n="",c=0;c<arguments.length;c++){var v=arguments[c];v&&(n=o(n,s(v)))}return n}function s(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return a.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var c="";for(var v in n)r.call(n,v)&&n[v]&&(c=o(c,v));return c}function o(n,c){return c?n?n+" "+c:n+c:n}t.exports?(a.default=a,t.exports=a):window.classNames=a})()}(T)),T.exports}var ee=Q();const $=I(ee),te=["type"],ne={class:"group-[.is-loading]:text-transparent"},re=e.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:L.Neutral},click:{}},setup(t){const r=t,a=e.ref($("btn","group",`btn-${D.toClassName(r.color)}`,r.loading?"is-loading":""));return e.watch(()=>r.loading,s=>{a.value=$("btn","group",`btn-${D.toClassName(r.color)}`,s?"is-loading":"")}),(s,o)=>(e.openBlock(),e.createElementBlock("button",{onClick:o[0]||(o[0]=(...n)=>s.click&&s.click(...n)),class:e.normalizeClass(a.value),type:s.type},[o[1]||(o[1]=e.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),e.createElementVNode("span",ne,[e.renderSlot(s.$slots,"default")])],10,te))}});var O=(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))(O||{});class H{static toClassName(r){switch(r){case 0:return"xs";case 1:return"sm";case 2:return"md";case 3:return"lg";case 4:return"xl";case 5:return"2xl";case 6:return"3xl";default:return"md"}}}const ae=e.defineComponent({__name:"Card",props:{backgroundColor:{default:L.Primary},shadow:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},rounded:{type:Boolean},roundedSize:{}},setup(t){const r=t,a=e.ref($("card",`bg-${r.backgroundColor}`,r.shadow?"shadow-lg":"",r.fullWidth?"w-full":"",r.rounded&&!r.roundedSize?"rounded":r.roundedSize?`rounded-${r.roundedSize}`:""));return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(s.$slots,"default")],2))}}),U=(t,r)=>{const a=t.__vccOpts||t;for(const[s,o]of r)a[s]=o;return a},se={},oe={class:"card-body"};function ce(t,r){return e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(t.$slots,"default")])}const le=U(se,[["render",ce]]),ue=e.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(t){return(r,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.is),{class:"card-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.text),1)]),_:1}))}}),ie=e.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(t){const r=t,a=e.ref([r.container?"container":"",r.padding?"p-6":""]);return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(s.$slots,"default")],2))}});var F={},W={},q;function G(){return q||(q=1,function(t){t.__esModule=!0,t.default=o;var r=/[\u0300-\u036f]/g,a=/ł/g,s=/ñ/g;function o(n){return n.toLowerCase().normalize("NFD").replace(r,"").replace(a,"l").replace(s,"n").trim()}}(W)),W}var C={},P;function A(){if(P)return C;P=1,C.__esModule=!0,C.aggressiveFuzzyMatch=k,C.createFuzzySearchImpl=K,C.experimentalSmartFuzzyMatch=B,C.fuzzyMatchImpl=x;var t=r(G());function r(u){return u&&u.__esModule?u:{default:u}}var a=Number.MAX_SAFE_INTEGER,s=function(l,m){return l.score-m.score},o=function(l,m){return l[0]-m[0]},n=new Set(` []()-–—'"“”`.split(""));function c(u){return n.has(u)}function v(u,l,m,_,i,h,p){if(u===_)return[0,[[0,u.length-1]]];var d=_.length,f=l.length,g=i.length;if(l===i)return[.1,[[0,f-1]]];if(l.startsWith(i))return[.5,[[0,g-1]]];var S=u.indexOf(_);if(S>-1&&c(u[S-1]))return[.9,[[S,S+d-1]]];var y=l.indexOf(i);if(y>-1&&c(l[y-1]))return[1,[[y,y+d-1]]];var E=h.length;if(E>1&&h.every(function(N){return m.has(N)})){var w=1.5+E*.2;return[w,h.map(function(N){var M=l.indexOf(N);return[M,M+N.length-1]}).sort(o)]}return y>-1?[2,[[y,y+d-1]]]:p==="aggressive"?k(l,i):p==="smart"?B(l,i):null}function k(u,l){for(var m=u.length,_=l.length,i=0,h=l[i],p=[],d=-1,f=-2,g=0;g<m;g+=1)if(u[g]===h){if(g!==f+1&&(d>=0&&p.push([d,f]),d=g),f=g,i+=1,i===_)return p.push([d,f]),b(p,u);h=l[i]}return null}function B(u,l){for(var m=u.length,_=[],i=0,h=l[i],p=-1,d=-2;;){var f=u.indexOf(h,d+1);if(f===-1)break;if(f===0||c(u[f-1]))p=f;else{var g=l.length-i,S=u.length-f,y=Math.min(3,g,S),E=l.slice(i,i+y);if(u.slice(f,f+y)===E)p=f;else{d+=1;continue}}for(d=p;d<m&&u[d]===h;d+=1)i+=1,h=l[i];if(d-=1,_.push([p,d]),i===l.length)return b(_,u)}return null}function b(u,l){var m=2;return u.forEach(function(_){var i=_[0],h=_[1],p=h-i+1,d=i===0||l[i]===" "||l[i-1]===" ",f=h===l.length-1||l[h]===" "||l[h+1]===" ",g=d&&f;g?m+=.2:d?m+=.4:p>=3?m+=.8:m+=1.6}),[m,u]}function x(u,l){var m=(0,t.default)(l),_=m.split(" "),i=(0,t.default)(u),h=new Set(i.split(" ")),p=v(u,i,h,l,m,_,"smart");return p?{item:u,score:p[0],matches:[p[1]]}:null}function K(u,l){var m=l.strategy,_=m===void 0?"aggressive":m,i=l.getText,h=u.map(function(p){var d;if(i)d=i(p);else{var f=l.key?p[l.key]:p;d=[f]}var g=d.map(function(S){var y=S||"",E=(0,t.default)(y),w=new Set(E.split(" "));return[y,E,w]});return[p,g]});return function(p){var d=[],f=(0,t.default)(p),g=f.split(" ");return f.length?(h.forEach(function(S){for(var y=S[0],E=S[1],w=a,N=[],M=0,j=E.length;M<j;M+=1){var V=E[M],Z=V[0],J=V[1],Y=V[2],z=v(Z,J,Y,p,f,g,_);z?(w=Math.min(w,z[0]),N.push(z[1])):N.push(null)}w<a&&d.push({item:y,score:w,matches:N})}),d.sort(s),d):[]}}return C}var X;function de(){return X||(X=1,function(t){t.__esModule=!0,t.default=s,t.fuzzyMatch=o;var r=a(G());t.normalizeText=r.default;function a(n){return n&&n.__esModule?n:{default:n}}function s(n,c){return c===void 0&&(c={}),A().createFuzzySearchImpl(n,c)}function o(n,c){return A().fuzzyMatchImpl(n,c)}}(F)),F}var pe=de();const fe=I(pe),ve=["innerHTML"],me=e.defineComponent({__name:"Table",props:{zebra:{type:Boolean,default:!1},pinRows:{type:Boolean,default:!1},pinCols:{type:Boolean,default:!1},size:{default:O.MD},columns:{},dataSource:{},ajax:{},searchValue:{},searchFunction:{}},setup(t){const r=e.ref([]),a=e.ref([]),s=e.computed(()=>fe(r.value)),o=e.ref(null),n=t,c=e.ref($("table",`table-${H.toClassName(n.size)}`,{"table-zebra":n.zebra,"table-pin-rows":n.pinRows,"table-pin-cols ":n.pinCols})),v=(k,B)=>String(!k||typeof k!="object"?k:B.split(".").reduce((b,x)=>b&&(typeof b=="object"?b[x]:b),k));return e.watch(()=>n.searchValue,k=>{if(n.searchFunction){a.value=n.searchFunction(k??"");return}a.value=k?s.value(k):r.value}),(k,B)=>(e.openBlock(),e.createElementBlock("table",{ref_key:"table",ref:o,class:e.normalizeClass(c.value)},[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,b=>(e.openBlock(),e.createElementBlock("th",{key:b.title},e.toDisplayString(b.title),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,b=>(e.openBlock(),e.createElementBlock("tr",{key:String(b)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,x=>(e.openBlock(),e.createElementBlock("td",{key:x.title,innerHTML:x.render?x.render(v(b,x.data),b):v(b,x.data)},null,8,ve))),128))]))),128))])],2))}}),be=e.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(t,{expose:r,emit:a}){const s=t,o=e.ref(s.value),n=a,c=v=>{o.value=v,n("update:value",v)};return e.provide("stepper",{value:o,updateValue:c}),e.watch(()=>s.value,v=>{o.value=v}),r({updateValue:c}),(v,k)=>e.renderSlot(v.$slots,"default",{updateValue:c})}}),he=e.defineComponent({__name:"Step",props:{value:{}},setup(t){const r=t,a=e.inject("stepper"),s=e.ref("");return e.watch(()=>a==null?void 0:a.value.value,o=>{o&&r.value&&(s.value=Number(o)>=Number(r.value)?"step-primary":"")}),e.onMounted(()=>{a&&(s.value=a.value.value===r.value?"step-primary":"",Number(a.value.value)>=Number(r.value)&&(s.value="step-primary"))}),(o,n)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["step",s.value])},[e.renderSlot(o.$slots,"default")],2))}}),ge={},_e={class:"steps"};function ye(t,r){return e.openBlock(),e.createElementBlock("ul",_e,[e.renderSlot(t.$slots,"default")])}const ke=U(ge,[["render",ye]]),Be={key:0},xe=e.defineComponent({__name:"StepPanels",setup(t){const r=e.inject("stepper");return(a,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>{var o,n;return[(o=e.unref(r))!=null&&o.value?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(a.$slots,"default",{currentStep:(n=e.unref(r))==null?void 0:n.value})])):e.createCommentVNode("",!0)]}),_:3}))}}),Se={key:0},Ee=e.defineComponent({__name:"StepPanel",props:{value:{}},setup(t,{expose:r}){const a=e.computed(()=>s==null?void 0:s.value.value),s=e.inject("stepper"),o=n=>{s&&s.updateValue(n.toString())};return r({activateCallback:o}),(n,c)=>n.value===a.value?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(n.$slots,"default",{activateCallback:o})])):e.createCommentVNode("",!0)}}),we={className:"modal-box"},Ne={key:0,method:"dialog"},Ce=e.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1}},emits:["close"],setup(t,{expose:r,emit:a}){const s=e.ref(null),o=a,n=t,c=e.ref($("modal",{"overflow-visible":n.overflow}));return r({showModal:()=>{var B;(B=s.value)==null||B.showModal()},closeModal:()=>{var B;(B=s.value)==null||B.close()}}),(B,b)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"modal",ref:s,class:e.normalizeClass(c.value),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:b[0]||(b[0]=x=>o("close",x))},[e.createElementVNode("div",we,[B.closeButton?(e.openBlock(),e.createElementBlock("form",Ne,b[1]||(b[1]=[e.createElementVNode("button",{className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2"},"✕",-1)]))):e.createCommentVNode("",!0),e.renderSlot(B.$slots,"default")])],34))}}),Me={class:"hidden w-full max-w-sm lg:flex"},$e={class:"relative mx-3 w-full"},Le={class:"w-full max-w-full relative"},Ve=e.defineComponent({__name:"SearchBar",emits:["input"],setup(t,{emit:r}){const a=e.ref(null),s=r,o=n=>{(n.ctrlKey||n.metaKey)&&n.key.toLowerCase()==="k"&&(n.preventDefault(),a.value&&a.value.focus())};return e.onMounted(()=>{document.addEventListener("keydown",o)}),e.onUnmounted(()=>{document.removeEventListener("keydown",o)}),(n,c)=>(e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("label",$e,[c[1]||(c[1]=e.createElementVNode("svg",{class:"pointer-events-none absolute z-10 my-3.5 ms-4 opacity-60 text-base-content","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",Le,[e.createElementVNode("form",null,[e.createElementVNode("input",{ref_key:"searchInput",ref:a,type:"search",placeholder:"Zoeken...",onInput:c[0]||(c[0]=v=>s("input",v.target.value)),class:"bg-transparent color-[inherit] border-[2px] border-solid border-transparent focus:border-[2px] focus:border-base-200 focus:outline-none rounded-xl w-full px-3 py-2 ps-10"},null,544)])]),c[2]||(c[2]=e.createElementVNode("div",{class:"pointer-events-none absolute end-10 top-2.5 gap-1 opacity-50 rtl:flex-row-reverse hidden lg:flex"},[e.createElementVNode("kbd",{class:"kbd kbd-sm"},"ctrl"),e.createElementVNode("kbd",{class:"kbd kbd-sm"},"K")],-1))])]))}}),ze=["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.Button=re;exports.Card=ae;exports.CardBody=le;exports.CardTitle=ue;exports.Color=L;exports.ColorUtils=D;exports.Container=ie;exports.Modal=Ce;exports.SearchBar=Ve;exports.Size=O;exports.SizeUtils=H;exports.Step=he;exports.StepList=ke;exports.StepPanel=Ee;exports.StepPanels=xe;exports.Stepper=be;exports.Table=me;exports.dendelionSafeList=ze;
|
package/dist/dendelion-ui.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var
|
|
3
|
-
class
|
|
4
|
-
static toClassName(
|
|
5
|
-
switch (
|
|
1
|
+
import { defineComponent as N, ref as M, watch as R, createElementBlock as m, openBlock as h, normalizeClass as W, createElementVNode as _, renderSlot as T, createBlock as te, resolveDynamicComponent as be, withCtx as ne, createTextVNode as he, toDisplayString as re, computed as ae, Fragment as P, renderList as A, provide as ge, inject as H, onMounted as se, Transition as me, createCommentVNode as G, unref as U, onUnmounted as _e } from "vue";
|
|
2
|
+
var K = /* @__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))(K || {});
|
|
3
|
+
class Z {
|
|
4
|
+
static toClassName(n) {
|
|
5
|
+
switch (n) {
|
|
6
6
|
case 0:
|
|
7
7
|
return "primary";
|
|
8
8
|
case 1:
|
|
@@ -48,88 +48,88 @@ class B {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function ue(e) {
|
|
52
52
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
53
53
|
}
|
|
54
|
-
var
|
|
54
|
+
var V = { exports: {} };
|
|
55
55
|
/*!
|
|
56
56
|
Copyright (c) 2018 Jed Watson.
|
|
57
57
|
Licensed under the MIT License (MIT), see
|
|
58
58
|
http://jedwatson.github.io/classnames
|
|
59
59
|
*/
|
|
60
|
-
var
|
|
61
|
-
function
|
|
62
|
-
return
|
|
60
|
+
var J;
|
|
61
|
+
function ye() {
|
|
62
|
+
return J || (J = 1, function(e) {
|
|
63
63
|
(function() {
|
|
64
|
-
var
|
|
65
|
-
function
|
|
66
|
-
for (var
|
|
67
|
-
var
|
|
68
|
-
|
|
64
|
+
var n = {}.hasOwnProperty;
|
|
65
|
+
function r() {
|
|
66
|
+
for (var t = "", u = 0; u < arguments.length; u++) {
|
|
67
|
+
var p = arguments[u];
|
|
68
|
+
p && (t = s(t, a(p)));
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return t;
|
|
71
71
|
}
|
|
72
|
-
function a(
|
|
73
|
-
if (typeof
|
|
74
|
-
return
|
|
75
|
-
if (typeof
|
|
72
|
+
function a(t) {
|
|
73
|
+
if (typeof t == "string" || typeof t == "number")
|
|
74
|
+
return t;
|
|
75
|
+
if (typeof t != "object")
|
|
76
76
|
return "";
|
|
77
|
-
if (Array.isArray(
|
|
78
|
-
return
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
81
|
-
var
|
|
82
|
-
for (var
|
|
83
|
-
|
|
84
|
-
return
|
|
77
|
+
if (Array.isArray(t))
|
|
78
|
+
return r.apply(null, t);
|
|
79
|
+
if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
|
|
80
|
+
return t.toString();
|
|
81
|
+
var u = "";
|
|
82
|
+
for (var p in t)
|
|
83
|
+
n.call(t, p) && t[p] && (u = s(u, p));
|
|
84
|
+
return u;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
86
|
+
function s(t, u) {
|
|
87
|
+
return u ? t ? t + " " + u : t + u : t;
|
|
88
88
|
}
|
|
89
|
-
e.exports ? (
|
|
89
|
+
e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
|
|
90
90
|
})();
|
|
91
|
-
}(
|
|
91
|
+
}(V)), V.exports;
|
|
92
92
|
}
|
|
93
|
-
var
|
|
94
|
-
const
|
|
93
|
+
var xe = ye();
|
|
94
|
+
const D = /* @__PURE__ */ ue(xe), Se = ["type"], we = { class: "group-[.is-loading]:text-transparent" }, Xe = /* @__PURE__ */ N({
|
|
95
95
|
__name: "Button",
|
|
96
96
|
props: {
|
|
97
97
|
type: { default: "button" },
|
|
98
98
|
loading: { type: Boolean },
|
|
99
|
-
color: { default:
|
|
99
|
+
color: { default: K.Neutral },
|
|
100
100
|
click: {}
|
|
101
101
|
},
|
|
102
102
|
setup(e) {
|
|
103
|
-
const
|
|
103
|
+
const n = e, r = M(D(
|
|
104
104
|
"btn",
|
|
105
105
|
"group",
|
|
106
|
-
`btn-${
|
|
107
|
-
|
|
106
|
+
`btn-${Z.toClassName(n.color)}`,
|
|
107
|
+
n.loading ? "is-loading" : ""
|
|
108
108
|
));
|
|
109
|
-
return
|
|
110
|
-
|
|
109
|
+
return R(() => n.loading, (a) => {
|
|
110
|
+
r.value = D(
|
|
111
111
|
"btn",
|
|
112
112
|
"group",
|
|
113
|
-
`btn-${
|
|
113
|
+
`btn-${Z.toClassName(n.color)}`,
|
|
114
114
|
a ? "is-loading" : ""
|
|
115
115
|
);
|
|
116
|
-
}), (a,
|
|
117
|
-
onClick:
|
|
118
|
-
(...
|
|
119
|
-
class:
|
|
116
|
+
}), (a, s) => (h(), m("button", {
|
|
117
|
+
onClick: s[0] || (s[0] = //@ts-ignore
|
|
118
|
+
(...t) => a.click && a.click(...t)),
|
|
119
|
+
class: W(r.value),
|
|
120
120
|
type: a.type
|
|
121
121
|
}, [
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
s[1] || (s[1] = _("span", { class: "loading loading-spinner loading-md absolute hidden group-[.is-loading]:block" }, null, -1)),
|
|
123
|
+
_("span", we, [
|
|
124
|
+
T(a.$slots, "default")
|
|
125
125
|
])
|
|
126
|
-
], 10,
|
|
126
|
+
], 10, Se));
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
|
-
var
|
|
130
|
-
class
|
|
131
|
-
static toClassName(
|
|
132
|
-
switch (
|
|
129
|
+
var oe = /* @__PURE__ */ ((e) => (e[e.XS = 0] = "XS", e[e.SM = 1] = "SM", e[e.MD = 2] = "MD", e[e.LG = 3] = "LG", e[e.XL = 4] = "XL", e[e.TWOXL = 5] = "TWOXL", e[e.THREEXL = 6] = "THREEXL", e))(oe || {});
|
|
130
|
+
class ke {
|
|
131
|
+
static toClassName(n) {
|
|
132
|
+
switch (n) {
|
|
133
133
|
case 0:
|
|
134
134
|
return "xs";
|
|
135
135
|
case 1:
|
|
@@ -149,227 +149,409 @@ class U {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
const
|
|
152
|
+
const Ie = /* @__PURE__ */ N({
|
|
153
153
|
__name: "Card",
|
|
154
154
|
props: {
|
|
155
|
-
backgroundColor: { default:
|
|
155
|
+
backgroundColor: { default: K.Primary },
|
|
156
156
|
shadow: { type: Boolean, default: !1 },
|
|
157
157
|
fullWidth: { type: Boolean, default: !1 },
|
|
158
158
|
rounded: { type: Boolean },
|
|
159
159
|
roundedSize: {}
|
|
160
160
|
},
|
|
161
161
|
setup(e) {
|
|
162
|
-
const
|
|
162
|
+
const n = e, r = M(D(
|
|
163
163
|
"card",
|
|
164
|
-
`bg-${
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
`bg-${n.backgroundColor}`,
|
|
165
|
+
n.shadow ? "shadow-lg" : "",
|
|
166
|
+
n.fullWidth ? "w-full" : "",
|
|
167
|
+
n.rounded && !n.roundedSize ? "rounded" : n.roundedSize ? `rounded-${n.roundedSize}` : ""
|
|
168
168
|
));
|
|
169
|
-
return (a,
|
|
170
|
-
class:
|
|
169
|
+
return (a, s) => (h(), m("div", {
|
|
170
|
+
class: W(r.value)
|
|
171
171
|
}, [
|
|
172
|
-
|
|
172
|
+
T(a.$slots, "default")
|
|
173
173
|
], 2));
|
|
174
174
|
}
|
|
175
|
-
}),
|
|
176
|
-
const
|
|
177
|
-
for (const [a,
|
|
178
|
-
|
|
179
|
-
return
|
|
180
|
-
},
|
|
181
|
-
function
|
|
182
|
-
return
|
|
183
|
-
|
|
175
|
+
}), ce = (e, n) => {
|
|
176
|
+
const r = e.__vccOpts || e;
|
|
177
|
+
for (const [a, s] of n)
|
|
178
|
+
r[a] = s;
|
|
179
|
+
return r;
|
|
180
|
+
}, Me = {}, $e = { class: "card-body" };
|
|
181
|
+
function Be(e, n) {
|
|
182
|
+
return h(), m("div", $e, [
|
|
183
|
+
T(e.$slots, "default")
|
|
184
184
|
]);
|
|
185
185
|
}
|
|
186
|
-
const
|
|
186
|
+
const He = /* @__PURE__ */ ce(Me, [["render", Be]]), Ge = /* @__PURE__ */ N({
|
|
187
187
|
__name: "CardTitle",
|
|
188
188
|
props: {
|
|
189
189
|
is: { default: "h1" },
|
|
190
190
|
text: { default: "" }
|
|
191
191
|
},
|
|
192
192
|
setup(e) {
|
|
193
|
-
return (
|
|
194
|
-
default:
|
|
195
|
-
|
|
193
|
+
return (n, r) => (h(), te(be(n.is), { class: "card-title" }, {
|
|
194
|
+
default: ne(() => [
|
|
195
|
+
he(re(n.text), 1)
|
|
196
196
|
]),
|
|
197
197
|
_: 1
|
|
198
198
|
}));
|
|
199
199
|
}
|
|
200
|
-
}),
|
|
200
|
+
}), Ke = /* @__PURE__ */ N({
|
|
201
201
|
__name: "Container",
|
|
202
202
|
props: {
|
|
203
203
|
container: { type: Boolean, default: !0 },
|
|
204
204
|
padding: { type: Boolean, default: !0 }
|
|
205
205
|
},
|
|
206
206
|
setup(e) {
|
|
207
|
-
const
|
|
208
|
-
|
|
207
|
+
const n = e, r = M([
|
|
208
|
+
n.container ? "container" : "",
|
|
209
209
|
//To disable the max width in some cases
|
|
210
|
-
|
|
210
|
+
n.padding ? "p-6" : ""
|
|
211
211
|
]);
|
|
212
|
-
return (a,
|
|
213
|
-
class:
|
|
212
|
+
return (a, s) => (h(), m("div", {
|
|
213
|
+
class: W(r.value)
|
|
214
214
|
}, [
|
|
215
|
-
|
|
215
|
+
T(a.$slots, "default")
|
|
216
216
|
], 2));
|
|
217
217
|
}
|
|
218
|
-
})
|
|
218
|
+
});
|
|
219
|
+
var X = {}, I = {}, Y;
|
|
220
|
+
function le() {
|
|
221
|
+
return Y || (Y = 1, function(e) {
|
|
222
|
+
e.__esModule = !0, e.default = s;
|
|
223
|
+
var n = /[\u0300-\u036f]/g, r = /ł/g, a = /ñ/g;
|
|
224
|
+
function s(t) {
|
|
225
|
+
return t.toLowerCase().normalize("NFD").replace(n, "").replace(r, "l").replace(a, "n").trim();
|
|
226
|
+
}
|
|
227
|
+
}(I)), I;
|
|
228
|
+
}
|
|
229
|
+
var F = {}, j;
|
|
230
|
+
function Q() {
|
|
231
|
+
if (j) return F;
|
|
232
|
+
j = 1, F.__esModule = !0, F.aggressiveFuzzyMatch = w, F.createFuzzySearchImpl = ie, F.experimentalSmartFuzzyMatch = k, F.fuzzyMatchImpl = $;
|
|
233
|
+
var e = n(le());
|
|
234
|
+
function n(c) {
|
|
235
|
+
return c && c.__esModule ? c : { default: c };
|
|
236
|
+
}
|
|
237
|
+
var r = Number.MAX_SAFE_INTEGER, a = function(o, v) {
|
|
238
|
+
return (
|
|
239
|
+
/*: number*/
|
|
240
|
+
o.score - v.score
|
|
241
|
+
);
|
|
242
|
+
}, s = function(o, v) {
|
|
243
|
+
return (
|
|
244
|
+
/*: number*/
|
|
245
|
+
o[0] - v[0]
|
|
246
|
+
);
|
|
247
|
+
}, t = new Set(` []()-–—'"“”`.split(""));
|
|
248
|
+
function u(c) {
|
|
249
|
+
return t.has(c);
|
|
250
|
+
}
|
|
251
|
+
function p(c, o, v, x, l, g, d) {
|
|
252
|
+
if (c === x)
|
|
253
|
+
return [0, [[0, c.length - 1]]];
|
|
254
|
+
var i = x.length, f = o.length, y = l.length;
|
|
255
|
+
if (o === l)
|
|
256
|
+
return [0.1, [[0, f - 1]]];
|
|
257
|
+
if (o.startsWith(l))
|
|
258
|
+
return [0.5, [[0, y - 1]]];
|
|
259
|
+
var B = c.indexOf(x);
|
|
260
|
+
if (B > -1 && u(c[B - 1]))
|
|
261
|
+
return [0.9, [[B, B + i - 1]]];
|
|
262
|
+
var S = o.indexOf(l);
|
|
263
|
+
if (S > -1 && u(o[S - 1]))
|
|
264
|
+
return [1, [[S, S + i - 1]]];
|
|
265
|
+
var L = g.length;
|
|
266
|
+
if (L > 1 && g.every(function(z) {
|
|
267
|
+
return v.has(z);
|
|
268
|
+
})) {
|
|
269
|
+
var E = 1.5 + L * 0.2;
|
|
270
|
+
return [E, g.map(function(z) {
|
|
271
|
+
var C = o.indexOf(z);
|
|
272
|
+
return [C, C + z.length - 1];
|
|
273
|
+
}).sort(s)];
|
|
274
|
+
}
|
|
275
|
+
return S > -1 ? [2, [[S, S + i - 1]]] : d === "aggressive" ? w(o, l) : d === "smart" ? k(o, l) : null;
|
|
276
|
+
}
|
|
277
|
+
function w(c, o) {
|
|
278
|
+
for (var v = c.length, x = o.length, l = 0, g = o[l], d = [], i = -1, f = -2, y = 0; y < v; y += 1)
|
|
279
|
+
if (c[y] === g) {
|
|
280
|
+
if (y !== f + 1 && (i >= 0 && d.push([i, f]), i = y), f = y, l += 1, l === x)
|
|
281
|
+
return d.push([i, f]), b(d, c);
|
|
282
|
+
g = o[l];
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
function k(c, o) {
|
|
287
|
+
for (var v = c.length, x = [], l = 0, g = o[l], d = -1, i = -2; ; ) {
|
|
288
|
+
var f = c.indexOf(g, i + 1);
|
|
289
|
+
if (f === -1)
|
|
290
|
+
break;
|
|
291
|
+
if (f === 0 || u(c[f - 1]))
|
|
292
|
+
d = f;
|
|
293
|
+
else {
|
|
294
|
+
var y = o.length - l, B = c.length - f, S = Math.min(3, y, B), L = o.slice(l, l + S);
|
|
295
|
+
if (c.slice(f, f + S) === L)
|
|
296
|
+
d = f;
|
|
297
|
+
else {
|
|
298
|
+
i += 1;
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
for (i = d; i < v && c[i] === g; i += 1)
|
|
303
|
+
l += 1, g = o[l];
|
|
304
|
+
if (i -= 1, x.push([d, i]), l === o.length)
|
|
305
|
+
return b(x, c);
|
|
306
|
+
}
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
function b(c, o) {
|
|
310
|
+
var v = 2;
|
|
311
|
+
return c.forEach(function(x) {
|
|
312
|
+
var l = x[0], g = x[1], d = g - l + 1, i = l === 0 || o[l] === " " || o[l - 1] === " ", f = g === o.length - 1 || o[g] === " " || o[g + 1] === " ", y = i && f;
|
|
313
|
+
y ? v += 0.2 : i ? v += 0.4 : d >= 3 ? v += 0.8 : v += 1.6;
|
|
314
|
+
}), [v, c];
|
|
315
|
+
}
|
|
316
|
+
function $(c, o) {
|
|
317
|
+
var v = (0, e.default)(o), x = v.split(" "), l = (0, e.default)(c), g = new Set(l.split(" ")), d = p(c, l, g, o, v, x, "smart");
|
|
318
|
+
return d ? {
|
|
319
|
+
item: c,
|
|
320
|
+
score: d[0],
|
|
321
|
+
matches: [d[1]]
|
|
322
|
+
} : null;
|
|
323
|
+
}
|
|
324
|
+
function ie(c, o) {
|
|
325
|
+
var v = o.strategy, x = v === void 0 ? "aggressive" : v, l = o.getText, g = c.map(function(d) {
|
|
326
|
+
var i;
|
|
327
|
+
if (l)
|
|
328
|
+
i = l(d);
|
|
329
|
+
else {
|
|
330
|
+
var f = o.key ? d[o.key] : d;
|
|
331
|
+
i = [f];
|
|
332
|
+
}
|
|
333
|
+
var y = i.map(function(B) {
|
|
334
|
+
var S = B || "", L = (0, e.default)(S), E = new Set(L.split(" "));
|
|
335
|
+
return [S, L, E];
|
|
336
|
+
});
|
|
337
|
+
return [d, y];
|
|
338
|
+
});
|
|
339
|
+
return function(d) {
|
|
340
|
+
var i = [], f = (0, e.default)(d), y = f.split(" ");
|
|
341
|
+
return f.length ? (g.forEach(function(B) {
|
|
342
|
+
for (var S = B[0], L = B[1], E = r, z = [], C = 0, de = L.length; C < de; C += 1) {
|
|
343
|
+
var O = L[C], fe = O[0], pe = O[1], ve = O[2], q = p(fe, pe, ve, d, f, y, x);
|
|
344
|
+
q ? (E = Math.min(E, q[0]), z.push(q[1])) : z.push(null);
|
|
345
|
+
}
|
|
346
|
+
E < r && i.push({
|
|
347
|
+
item: S,
|
|
348
|
+
score: E,
|
|
349
|
+
matches: z
|
|
350
|
+
});
|
|
351
|
+
}), i.sort(a), i) : [];
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
return F;
|
|
355
|
+
}
|
|
356
|
+
var ee;
|
|
357
|
+
function Ne() {
|
|
358
|
+
return ee || (ee = 1, function(e) {
|
|
359
|
+
e.__esModule = !0, e.default = a, e.fuzzyMatch = s;
|
|
360
|
+
var n = r(le());
|
|
361
|
+
e.normalizeText = n.default;
|
|
362
|
+
function r(t) {
|
|
363
|
+
return t && t.__esModule ? t : { default: t };
|
|
364
|
+
}
|
|
365
|
+
function a(t, u) {
|
|
366
|
+
return u === void 0 && (u = {}), Q().createFuzzySearchImpl(t, u);
|
|
367
|
+
}
|
|
368
|
+
function s(t, u) {
|
|
369
|
+
return Q().fuzzyMatchImpl(t, u);
|
|
370
|
+
}
|
|
371
|
+
}(X)), X;
|
|
372
|
+
}
|
|
373
|
+
var Le = Ne();
|
|
374
|
+
const Te = /* @__PURE__ */ ue(Le), Ee = ["innerHTML"], Ue = /* @__PURE__ */ N({
|
|
219
375
|
__name: "Table",
|
|
220
376
|
props: {
|
|
221
377
|
zebra: { type: Boolean, default: !1 },
|
|
222
378
|
pinRows: { type: Boolean, default: !1 },
|
|
223
379
|
pinCols: { type: Boolean, default: !1 },
|
|
224
|
-
size: { default:
|
|
380
|
+
size: { default: oe.MD },
|
|
225
381
|
columns: {},
|
|
226
382
|
dataSource: {},
|
|
227
|
-
ajax: {}
|
|
383
|
+
ajax: {},
|
|
384
|
+
searchValue: {},
|
|
385
|
+
searchFunction: {}
|
|
228
386
|
},
|
|
229
387
|
setup(e) {
|
|
230
|
-
const
|
|
231
|
-
"table-zebra":
|
|
232
|
-
"table-pin-rows":
|
|
233
|
-
"table-pin-cols ":
|
|
234
|
-
}));
|
|
235
|
-
return (
|
|
388
|
+
const n = M([]), r = M([]), a = ae(() => Te(n.value)), s = M(null), t = e, u = M(D("table", `table-${ke.toClassName(t.size)}`, {
|
|
389
|
+
"table-zebra": t.zebra,
|
|
390
|
+
"table-pin-rows": t.pinRows,
|
|
391
|
+
"table-pin-cols ": t.pinCols
|
|
392
|
+
})), p = (w, k) => String(!w || typeof w != "object" ? w : k.split(".").reduce((b, $) => b && (typeof b == "object" ? b[$] : b), w));
|
|
393
|
+
return R(() => t.searchValue, (w) => {
|
|
394
|
+
if (t.searchFunction) {
|
|
395
|
+
r.value = t.searchFunction(w ?? "");
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
r.value = w ? a.value(w) : n.value;
|
|
399
|
+
}), (w, k) => (h(), m("table", {
|
|
236
400
|
ref_key: "table",
|
|
237
|
-
ref:
|
|
238
|
-
class:
|
|
239
|
-
},
|
|
401
|
+
ref: s,
|
|
402
|
+
class: W(u.value)
|
|
403
|
+
}, [
|
|
404
|
+
_("thead", null, [
|
|
405
|
+
_("tr", null, [
|
|
406
|
+
(h(!0), m(P, null, A(t.columns, (b) => (h(), m("th", {
|
|
407
|
+
key: b.title
|
|
408
|
+
}, re(b.title), 1))), 128))
|
|
409
|
+
])
|
|
410
|
+
]),
|
|
411
|
+
_("tbody", null, [
|
|
412
|
+
(h(!0), m(P, null, A(r.value, (b) => (h(), m("tr", {
|
|
413
|
+
key: String(b)
|
|
414
|
+
}, [
|
|
415
|
+
(h(!0), m(P, null, A(t.columns, ($) => (h(), m("td", {
|
|
416
|
+
key: $.title,
|
|
417
|
+
innerHTML: $.render ? $.render(p(b, $.data), b) : p(b, $.data)
|
|
418
|
+
}, null, 8, Ee))), 128))
|
|
419
|
+
]))), 128))
|
|
420
|
+
])
|
|
421
|
+
], 2));
|
|
240
422
|
}
|
|
241
|
-
}),
|
|
423
|
+
}), Ze = /* @__PURE__ */ N({
|
|
242
424
|
__name: "Stepper",
|
|
243
425
|
props: {
|
|
244
426
|
value: {}
|
|
245
427
|
},
|
|
246
428
|
emits: ["update:value"],
|
|
247
|
-
setup(e, { expose:
|
|
248
|
-
const a = e,
|
|
249
|
-
|
|
429
|
+
setup(e, { expose: n, emit: r }) {
|
|
430
|
+
const a = e, s = M(a.value), t = r, u = (p) => {
|
|
431
|
+
s.value = p, t("update:value", p);
|
|
250
432
|
};
|
|
251
|
-
return
|
|
252
|
-
value:
|
|
253
|
-
updateValue:
|
|
254
|
-
}),
|
|
255
|
-
|
|
256
|
-
}),
|
|
257
|
-
updateValue:
|
|
258
|
-
}), (
|
|
433
|
+
return ge("stepper", {
|
|
434
|
+
value: s,
|
|
435
|
+
updateValue: u
|
|
436
|
+
}), R(() => a.value, (p) => {
|
|
437
|
+
s.value = p;
|
|
438
|
+
}), n({
|
|
439
|
+
updateValue: u
|
|
440
|
+
}), (p, w) => T(p.$slots, "default", { updateValue: u });
|
|
259
441
|
}
|
|
260
|
-
}),
|
|
442
|
+
}), Je = /* @__PURE__ */ N({
|
|
261
443
|
__name: "Step",
|
|
262
444
|
props: {
|
|
263
445
|
value: {}
|
|
264
446
|
},
|
|
265
447
|
setup(e) {
|
|
266
|
-
const
|
|
267
|
-
return
|
|
268
|
-
|
|
269
|
-
}),
|
|
270
|
-
|
|
271
|
-
}), (
|
|
272
|
-
class:
|
|
448
|
+
const n = e, r = H("stepper"), a = M("");
|
|
449
|
+
return R(() => r == null ? void 0 : r.value.value, (s) => {
|
|
450
|
+
s && n.value && (a.value = Number(s) >= Number(n.value) ? "step-primary" : "");
|
|
451
|
+
}), se(() => {
|
|
452
|
+
r && (a.value = r.value.value === n.value ? "step-primary" : "", Number(r.value.value) >= Number(n.value) && (a.value = "step-primary"));
|
|
453
|
+
}), (s, t) => (h(), m("li", {
|
|
454
|
+
class: W(["step", a.value])
|
|
273
455
|
}, [
|
|
274
|
-
|
|
456
|
+
T(s.$slots, "default")
|
|
275
457
|
], 2));
|
|
276
458
|
}
|
|
277
|
-
}),
|
|
278
|
-
function
|
|
279
|
-
return
|
|
280
|
-
|
|
459
|
+
}), ze = {}, Fe = { class: "steps" };
|
|
460
|
+
function Ce(e, n) {
|
|
461
|
+
return h(), m("ul", Fe, [
|
|
462
|
+
T(e.$slots, "default")
|
|
281
463
|
]);
|
|
282
464
|
}
|
|
283
|
-
const
|
|
465
|
+
const Ye = /* @__PURE__ */ ce(ze, [["render", Ce]]), We = { key: 0 }, je = /* @__PURE__ */ N({
|
|
284
466
|
__name: "StepPanels",
|
|
285
467
|
setup(e) {
|
|
286
|
-
const
|
|
287
|
-
return (
|
|
468
|
+
const n = H("stepper");
|
|
469
|
+
return (r, a) => (h(), te(me, {
|
|
288
470
|
name: "fade",
|
|
289
471
|
mode: "out-in"
|
|
290
472
|
}, {
|
|
291
|
-
default:
|
|
292
|
-
var
|
|
473
|
+
default: ne(() => {
|
|
474
|
+
var s, t;
|
|
293
475
|
return [
|
|
294
|
-
(
|
|
295
|
-
|
|
296
|
-
currentStep: (
|
|
476
|
+
(s = U(n)) != null && s.value ? (h(), m("div", We, [
|
|
477
|
+
T(r.$slots, "default", {
|
|
478
|
+
currentStep: (t = U(n)) == null ? void 0 : t.value
|
|
297
479
|
})
|
|
298
|
-
])) :
|
|
480
|
+
])) : G("", !0)
|
|
299
481
|
];
|
|
300
482
|
}),
|
|
301
483
|
_: 3
|
|
302
484
|
}));
|
|
303
485
|
}
|
|
304
|
-
}),
|
|
486
|
+
}), De = { key: 0 }, Qe = /* @__PURE__ */ N({
|
|
305
487
|
__name: "StepPanel",
|
|
306
488
|
props: {
|
|
307
489
|
value: {}
|
|
308
490
|
},
|
|
309
|
-
setup(e, { expose:
|
|
310
|
-
const
|
|
311
|
-
a && a.updateValue(
|
|
491
|
+
setup(e, { expose: n }) {
|
|
492
|
+
const r = ae(() => a == null ? void 0 : a.value.value), a = H("stepper"), s = (t) => {
|
|
493
|
+
a && a.updateValue(t.toString());
|
|
312
494
|
};
|
|
313
|
-
return
|
|
314
|
-
activateCallback:
|
|
315
|
-
}), (
|
|
316
|
-
|
|
317
|
-
])) :
|
|
495
|
+
return n({
|
|
496
|
+
activateCallback: s
|
|
497
|
+
}), (t, u) => t.value === r.value ? (h(), m("div", De, [
|
|
498
|
+
T(t.$slots, "default", { activateCallback: s })
|
|
499
|
+
])) : G("", !0);
|
|
318
500
|
}
|
|
319
|
-
}),
|
|
501
|
+
}), Re = { className: "modal-box" }, Oe = {
|
|
320
502
|
key: 0,
|
|
321
503
|
method: "dialog"
|
|
322
|
-
},
|
|
504
|
+
}, et = /* @__PURE__ */ N({
|
|
323
505
|
__name: "Modal",
|
|
324
506
|
props: {
|
|
325
507
|
closeButton: { type: Boolean, default: !0 },
|
|
326
508
|
overflow: { type: Boolean, default: !1 }
|
|
327
509
|
},
|
|
328
510
|
emits: ["close"],
|
|
329
|
-
setup(e, { expose:
|
|
330
|
-
const a =
|
|
511
|
+
setup(e, { expose: n, emit: r }) {
|
|
512
|
+
const a = M(null), s = r, u = M(D("modal", {
|
|
331
513
|
"overflow-visible": e.overflow
|
|
332
514
|
}));
|
|
333
|
-
return
|
|
515
|
+
return n({
|
|
334
516
|
showModal: () => {
|
|
335
|
-
var
|
|
336
|
-
(
|
|
517
|
+
var k;
|
|
518
|
+
(k = a.value) == null || k.showModal();
|
|
337
519
|
},
|
|
338
520
|
closeModal: () => {
|
|
339
|
-
var
|
|
340
|
-
(
|
|
521
|
+
var k;
|
|
522
|
+
(k = a.value) == null || k.close();
|
|
341
523
|
}
|
|
342
|
-
}), (
|
|
524
|
+
}), (k, b) => (h(), m("dialog", {
|
|
343
525
|
ref_key: "modal",
|
|
344
526
|
ref: a,
|
|
345
|
-
class:
|
|
527
|
+
class: W(u.value),
|
|
346
528
|
"aria-modal": "true",
|
|
347
529
|
"aria-hidden": "true",
|
|
348
530
|
role: "dialog",
|
|
349
|
-
onClose:
|
|
531
|
+
onClose: b[0] || (b[0] = ($) => s("close", $))
|
|
350
532
|
}, [
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
]))) :
|
|
355
|
-
|
|
533
|
+
_("div", Re, [
|
|
534
|
+
k.closeButton ? (h(), m("form", Oe, b[1] || (b[1] = [
|
|
535
|
+
_("button", { className: "btn btn-sm btn-circle btn-ghost absolute right-2 top-2" }, "✕", -1)
|
|
536
|
+
]))) : G("", !0),
|
|
537
|
+
T(k.$slots, "default")
|
|
356
538
|
])
|
|
357
539
|
], 34));
|
|
358
540
|
}
|
|
359
|
-
}),
|
|
541
|
+
}), qe = { class: "hidden w-full max-w-sm lg:flex" }, Pe = { class: "relative mx-3 w-full" }, Ae = { class: "w-full max-w-full relative" }, tt = /* @__PURE__ */ N({
|
|
360
542
|
__name: "SearchBar",
|
|
361
543
|
emits: ["input"],
|
|
362
|
-
setup(e, { emit:
|
|
363
|
-
const
|
|
364
|
-
(
|
|
544
|
+
setup(e, { emit: n }) {
|
|
545
|
+
const r = M(null), a = n, s = (t) => {
|
|
546
|
+
(t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "k" && (t.preventDefault(), r.value && r.value.focus());
|
|
365
547
|
};
|
|
366
|
-
return
|
|
367
|
-
document.addEventListener("keydown",
|
|
368
|
-
}),
|
|
369
|
-
document.removeEventListener("keydown",
|
|
370
|
-
}), (
|
|
371
|
-
|
|
372
|
-
|
|
548
|
+
return se(() => {
|
|
549
|
+
document.addEventListener("keydown", s);
|
|
550
|
+
}), _e(() => {
|
|
551
|
+
document.removeEventListener("keydown", s);
|
|
552
|
+
}), (t, u) => (h(), m("div", qe, [
|
|
553
|
+
_("label", Pe, [
|
|
554
|
+
u[1] || (u[1] = _("svg", {
|
|
373
555
|
class: "pointer-events-none absolute z-10 my-3.5 ms-4 opacity-60 text-base-content",
|
|
374
556
|
"aria-hidden": "true",
|
|
375
557
|
width: "16",
|
|
@@ -377,32 +559,32 @@ const be = /* @__PURE__ */ L(F, [["render", J]]), Q = { key: 0 }, me = /* @__PUR
|
|
|
377
559
|
viewBox: "0.48 0.48 23.04 23.04",
|
|
378
560
|
fill: "currentColor"
|
|
379
561
|
}, [
|
|
380
|
-
|
|
562
|
+
_("path", {
|
|
381
563
|
fill: "none",
|
|
382
564
|
d: "M0 0h24v24H0z"
|
|
383
565
|
}),
|
|
384
|
-
|
|
566
|
+
_("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" })
|
|
385
567
|
], -1)),
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
568
|
+
_("div", Ae, [
|
|
569
|
+
_("form", null, [
|
|
570
|
+
_("input", {
|
|
389
571
|
ref_key: "searchInput",
|
|
390
|
-
ref:
|
|
572
|
+
ref: r,
|
|
391
573
|
type: "search",
|
|
392
574
|
placeholder: "Zoeken...",
|
|
393
|
-
onInput:
|
|
575
|
+
onInput: u[0] || (u[0] = (p) => a("input", p.target.value)),
|
|
394
576
|
class: "bg-transparent color-[inherit] border-[2px] border-solid border-transparent focus:border-[2px] focus:border-base-200 focus:outline-none rounded-xl w-full px-3 py-2 ps-10"
|
|
395
577
|
}, null, 544)
|
|
396
578
|
])
|
|
397
579
|
]),
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
580
|
+
u[2] || (u[2] = _("div", { class: "pointer-events-none absolute end-10 top-2.5 gap-1 opacity-50 rtl:flex-row-reverse hidden lg:flex" }, [
|
|
581
|
+
_("kbd", { class: "kbd kbd-sm" }, "ctrl"),
|
|
582
|
+
_("kbd", { class: "kbd kbd-sm" }, "K")
|
|
401
583
|
], -1))
|
|
402
584
|
])
|
|
403
585
|
]));
|
|
404
586
|
}
|
|
405
|
-
}),
|
|
587
|
+
}), nt = [
|
|
406
588
|
"bg-primary",
|
|
407
589
|
"bg-primary-content",
|
|
408
590
|
"bg-secondary",
|
|
@@ -488,22 +670,22 @@ const be = /* @__PURE__ */ L(F, [["render", J]]), Q = { key: 0 }, me = /* @__PUR
|
|
|
488
670
|
"block"
|
|
489
671
|
];
|
|
490
672
|
export {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
673
|
+
Xe as Button,
|
|
674
|
+
Ie as Card,
|
|
675
|
+
He as CardBody,
|
|
676
|
+
Ge as CardTitle,
|
|
677
|
+
K as Color,
|
|
678
|
+
Z as ColorUtils,
|
|
679
|
+
Ke as Container,
|
|
680
|
+
et as Modal,
|
|
681
|
+
tt as SearchBar,
|
|
682
|
+
oe as Size,
|
|
683
|
+
ke as SizeUtils,
|
|
684
|
+
Je as Step,
|
|
685
|
+
Ye as StepList,
|
|
686
|
+
Qe as StepPanel,
|
|
687
|
+
je as StepPanels,
|
|
688
|
+
Ze as Stepper,
|
|
689
|
+
Ue as Table,
|
|
690
|
+
nt as dendelionSafeList
|
|
509
691
|
};
|
package/dist/dendelion-ui.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(p,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p.DendelionUI={},p.Vue))})(this,function(p,e){"use strict";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 V{static toClassName(r){switch(r){case 0:return"primary";case 1:return"primary-content";case 2:return"secondary";case 3:return"secondary-content";case 4:return"accent";case 5:return"accent-content";case 6:return"neutral";case 7:return"neutral-content";case 8:return"base-100";case 9:return"base-200";case 10:return"base-300";case 11:return"base-content";case 12:return"info";case 13:return"info-content";case 14:return"success";case 15:return"success-content";case 16:return"warning";case 17:return"warning-content";case 18:return"error";case 19:return"error-content";default:return"primary"}}}function q(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var z={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 y;function k(){return y||(y=1,function(t){(function(){var n={}.hasOwnProperty;function r(){for(var a="",c=0;c<arguments.length;c++){var d=arguments[c];d&&(a=o(a,s(d)))}return a}function s(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return r.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var c="";for(var d in a)n.call(a,d)&&a[d]&&(c=o(c,d));return c}function o(a,c){return c?a?a+" "+c:a+c:a}t.exports?(r.default=r,t.exports=r):window.classNames=r})()}(b)),b.exports}var w=k();const p=B(w),S=["type"],x={class:"group-[.is-loading]:text-transparent"},E=e.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:u.Neutral},click:{}},setup(t){const n=t,r=e.ref(p("btn","group",`btn-${m.toClassName(n.color)}`,n.loading?"is-loading":""));return e.watch(()=>n.loading,s=>{r.value=p("btn","group",`btn-${m.toClassName(n.color)}`,s?"is-loading":"")}),(s,o)=>(e.openBlock(),e.createElementBlock("button",{onClick:o[0]||(o[0]=(...a)=>s.click&&s.click(...a)),class:e.normalizeClass(r.value),type:s.type},[o[1]||(o[1]=e.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),e.createElementVNode("span",x,[e.renderSlot(s.$slots,"default")])],10,S))}});var _=(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))(_||{});class g{static toClassName(n){switch(n){case 0:return"xs";case 1:return"sm";case 2:return"md";case 3:return"lg";case 4:return"xl";case 5:return"2xl";case 6:return"3xl";default:return"md"}}}const N=e.defineComponent({__name:"Card",props:{backgroundColor:{default:u.Primary},shadow:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},rounded:{type:Boolean},roundedSize:{}},setup(t){const n=t,r=e.ref(p("card",`bg-${n.backgroundColor}`,n.shadow?"shadow-lg":"",n.fullWidth?"w-full":"",n.rounded&&!n.roundedSize?"rounded":n.roundedSize?`rounded-${n.roundedSize}`:""));return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(r.value)},[e.renderSlot(s.$slots,"default")],2))}}),h=(t,n)=>{const r=t.__vccOpts||t;for(const[s,o]of n)r[s]=o;return r},$={},C={class:"card-body"};function V(t,n){return e.openBlock(),e.createElementBlock("div",C,[e.renderSlot(t.$slots,"default")])}const M=h($,[["render",V]]),L=e.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(t){return(n,r)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.is),{class:"card-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.text),1)]),_:1}))}}),P=e.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(t){const n=t,r=e.ref([n.container?"container":"",n.padding?"p-6":""]);return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(r.value)},[e.renderSlot(s.$slots,"default")],2))}}),T=e.defineComponent({__name:"Table",props:{zebra:{type:Boolean,default:!1},pinRows:{type:Boolean,default:!1},pinCols:{type:Boolean,default:!1},size:{default:_.MD},columns:{},dataSource:{},ajax:{}},setup(t){const n=e.ref(null),r=t,s=e.ref(p("table",`table-${g.toClassName(r.size)}`,{"table-zebra":r.zebra,"table-pin-rows":r.pinRows,"table-pin-cols ":r.pinCols}));return(o,a)=>(e.openBlock(),e.createElementBlock("table",{ref_key:"table",ref:n,class:e.normalizeClass(s.value)},null,2))}}),j=e.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(t,{expose:n,emit:r}){const s=t,o=e.ref(s.value),a=r,c=d=>{o.value=d,a("update:value",d)};return e.provide("stepper",{value:o,updateValue:c}),e.watch(()=>s.value,d=>{o.value=d}),n({updateValue:c}),(d,Y)=>e.renderSlot(d.$slots,"default",{updateValue:c})}}),z=e.defineComponent({__name:"Step",props:{value:{}},setup(t){const n=t,r=e.inject("stepper"),s=e.ref("");return e.watch(()=>r==null?void 0:r.value.value,o=>{o&&n.value&&(s.value=Number(o)>=Number(n.value)?"step-primary":"")}),e.onMounted(()=>{r&&(s.value=r.value.value===n.value?"step-primary":"",Number(r.value.value)>=Number(n.value)&&(s.value="step-primary"))}),(o,a)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["step",s.value])},[e.renderSlot(o.$slots,"default")],2))}}),O={},D={class:"steps"};function I(t,n){return e.openBlock(),e.createElementBlock("ul",D,[e.renderSlot(t.$slots,"default")])}const W=h(O,[["render",I]]),X={key:0},A=e.defineComponent({__name:"StepPanels",setup(t){const n=e.inject("stepper");return(r,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>{var o,a;return[(o=e.unref(n))!=null&&o.value?(e.openBlock(),e.createElementBlock("div",X,[e.renderSlot(r.$slots,"default",{currentStep:(a=e.unref(n))==null?void 0:a.value})])):e.createCommentVNode("",!0)]}),_:3}))}}),U={key:0},R=e.defineComponent({__name:"StepPanel",props:{value:{}},setup(t,{expose:n}){const r=e.computed(()=>s==null?void 0:s.value.value),s=e.inject("stepper"),o=a=>{s&&s.updateValue(a.toString())};return n({activateCallback:o}),(a,c)=>a.value===r.value?(e.openBlock(),e.createElementBlock("div",U,[e.renderSlot(a.$slots,"default",{activateCallback:o})])):e.createCommentVNode("",!0)}}),K={className:"modal-box"},q={key:0,method:"dialog"},H=e.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1}},emits:["close"],setup(t,{expose:n,emit:r}){const s=e.ref(null),o=r,a=t,c=e.ref(p("modal",{"overflow-visible":a.overflow}));return n({showModal:()=>{var i;(i=s.value)==null||i.showModal()},closeModal:()=>{var i;(i=s.value)==null||i.close()}}),(i,f)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"modal",ref:s,class:e.normalizeClass(c.value),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:f[0]||(f[0]=v=>o("close",v))},[e.createElementVNode("div",K,[i.closeButton?(e.openBlock(),e.createElementBlock("form",q,f[1]||(f[1]=[e.createElementVNode("button",{className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2"},"✕",-1)]))):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default")])],34))}}),G={class:"hidden w-full max-w-sm lg:flex"},F={class:"relative mx-3 w-full"},Z={class:"w-full max-w-full relative"},J=e.defineComponent({__name:"SearchBar",emits:["input"],setup(t,{emit:n}){const r=e.ref(null),s=n,o=a=>{(a.ctrlKey||a.metaKey)&&a.key.toLowerCase()==="k"&&(a.preventDefault(),r.value&&r.value.focus())};return e.onMounted(()=>{document.addEventListener("keydown",o)}),e.onUnmounted(()=>{document.removeEventListener("keydown",o)}),(a,c)=>(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("label",F,[c[1]||(c[1]=e.createElementVNode("svg",{class:"pointer-events-none absolute z-10 my-3.5 ms-4 opacity-60 text-base-content","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",Z,[e.createElementVNode("form",null,[e.createElementVNode("input",{ref_key:"searchInput",ref:r,type:"search",placeholder:"Zoeken...",onInput:c[0]||(c[0]=d=>s("input",d.target.value)),class:"bg-transparent color-[inherit] border-[2px] border-solid border-transparent focus:border-[2px] focus:border-base-200 focus:outline-none rounded-xl w-full px-3 py-2 ps-10"},null,544)])]),c[2]||(c[2]=e.createElementVNode("div",{class:"pointer-events-none absolute end-10 top-2.5 gap-1 opacity-50 rtl:flex-row-reverse hidden lg:flex"},[e.createElementVNode("kbd",{class:"kbd kbd-sm"},"ctrl"),e.createElementVNode("kbd",{class:"kbd kbd-sm"},"K")],-1))])]))}}),Q=["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"];l.Button=E,l.Card=N,l.CardBody=M,l.CardTitle=L,l.Color=u,l.ColorUtils=m,l.Container=P,l.Modal=H,l.SearchBar=J,l.Size=_,l.SizeUtils=g,l.Step=z,l.StepList=W,l.StepPanel=R,l.StepPanels=A,l.Stepper=j,l.Table=T,l.dendelionSafeList=Q,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
*/var P;function j(){return P||(P=1,function(t){(function(){var r={}.hasOwnProperty;function a(){for(var n="",c=0;c<arguments.length;c++){var h=arguments[c];h&&(n=o(n,s(h)))}return n}function s(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return a.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var c="";for(var h in n)r.call(n,h)&&n[h]&&(c=o(c,h));return c}function o(n,c){return c?n?n+" "+c:n+c:n}t.exports?(a.default=a,t.exports=a):window.classNames=a})()}(z)),z.exports}var Z=j();const L=q(Z),J=["type"],Y={class:"group-[.is-loading]:text-transparent"},Q=e.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:T.Neutral},click:{}},setup(t){const r=t,a=e.ref(L("btn","group",`btn-${V.toClassName(r.color)}`,r.loading?"is-loading":""));return e.watch(()=>r.loading,s=>{a.value=L("btn","group",`btn-${V.toClassName(r.color)}`,s?"is-loading":"")}),(s,o)=>(e.openBlock(),e.createElementBlock("button",{onClick:o[0]||(o[0]=(...n)=>s.click&&s.click(...n)),class:e.normalizeClass(a.value),type:s.type},[o[1]||(o[1]=e.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),e.createElementVNode("span",Y,[e.renderSlot(s.$slots,"default")])],10,J))}});var F=(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))(F||{});class A{static toClassName(r){switch(r){case 0:return"xs";case 1:return"sm";case 2:return"md";case 3:return"lg";case 4:return"xl";case 5:return"2xl";case 6:return"3xl";default:return"md"}}}const ee=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 r=t,a=e.ref(L("card",`bg-${r.backgroundColor}`,r.shadow?"shadow-lg":"",r.fullWidth?"w-full":"",r.rounded&&!r.roundedSize?"rounded":r.roundedSize?`rounded-${r.roundedSize}`:""));return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(s.$slots,"default")],2))}}),X=(t,r)=>{const a=t.__vccOpts||t;for(const[s,o]of r)a[s]=o;return a},te={},ne={class:"card-body"};function re(t,r){return e.openBlock(),e.createElementBlock("div",ne,[e.renderSlot(t.$slots,"default")])}const ae=X(te,[["render",re]]),se=e.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(t){return(r,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.is),{class:"card-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.text),1)]),_:1}))}}),oe=e.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(t){const r=t,a=e.ref([r.container?"container":"",r.padding?"p-6":""]);return(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(s.$slots,"default")],2))}});var D={},W={},I;function U(){return I||(I=1,function(t){t.__esModule=!0,t.default=o;var r=/[\u0300-\u036f]/g,a=/ł/g,s=/ñ/g;function o(n){return n.toLowerCase().normalize("NFD").replace(r,"").replace(a,"l").replace(s,"n").trim()}}(W)),W}var M={},H;function G(){if(H)return M;H=1,M.__esModule=!0,M.aggressiveFuzzyMatch=S,M.createFuzzySearchImpl=$e,M.experimentalSmartFuzzyMatch=E,M.fuzzyMatchImpl=x;var t=r(U());function r(i){return i&&i.__esModule?i:{default:i}}var a=Number.MAX_SAFE_INTEGER,s=function(l,b){return l.score-b.score},o=function(l,b){return l[0]-b[0]},n=new Set(` []()-–—'"“”`.split(""));function c(i){return n.has(i)}function h(i,l,b,k,u,y,f){if(i===k)return[0,[[0,i.length-1]]];var d=k.length,m=l.length,_=u.length;if(l===u)return[.1,[[0,m-1]]];if(l.startsWith(u))return[.5,[[0,_-1]]];var w=i.indexOf(k);if(w>-1&&c(i[w-1]))return[.9,[[w,w+d-1]]];var B=l.indexOf(u);if(B>-1&&c(l[B-1]))return[1,[[B,B+d-1]]];var N=y.length;if(N>1&&y.every(function(C){return b.has(C)})){var v=1.5+N*.2;return[v,y.map(function(C){var $=l.indexOf(C);return[$,$+C.length-1]}).sort(o)]}return B>-1?[2,[[B,B+d-1]]]:f==="aggressive"?S(l,u):f==="smart"?E(l,u):null}function S(i,l){for(var b=i.length,k=l.length,u=0,y=l[u],f=[],d=-1,m=-2,_=0;_<b;_+=1)if(i[_]===y){if(_!==m+1&&(d>=0&&f.push([d,m]),d=_),m=_,u+=1,u===k)return f.push([d,m]),g(f,i);y=l[u]}return null}function E(i,l){for(var b=i.length,k=[],u=0,y=l[u],f=-1,d=-2;;){var m=i.indexOf(y,d+1);if(m===-1)break;if(m===0||c(i[m-1]))f=m;else{var _=l.length-u,w=i.length-m,B=Math.min(3,_,w),N=l.slice(u,u+B);if(i.slice(m,m+B)===N)f=m;else{d+=1;continue}}for(d=f;d<b&&i[d]===y;d+=1)u+=1,y=l[u];if(d-=1,k.push([f,d]),u===l.length)return g(k,i)}return null}function g(i,l){var b=2;return i.forEach(function(k){var u=k[0],y=k[1],f=y-u+1,d=u===0||l[u]===" "||l[u-1]===" ",m=y===l.length-1||l[y]===" "||l[y+1]===" ",_=d&&m;_?b+=.2:d?b+=.4:f>=3?b+=.8:b+=1.6}),[b,i]}function x(i,l){var b=(0,t.default)(l),k=b.split(" "),u=(0,t.default)(i),y=new Set(u.split(" ")),f=h(i,u,y,l,b,k,"smart");return f?{item:i,score:f[0],matches:[f[1]]}:null}function $e(i,l){var b=l.strategy,k=b===void 0?"aggressive":b,u=l.getText,y=i.map(function(f){var d;if(u)d=u(f);else{var m=l.key?f[l.key]:f;d=[m]}var _=d.map(function(w){var B=w||"",N=(0,t.default)(B),v=new Set(N.split(" "));return[B,N,v]});return[f,_]});return function(f){var d=[],m=(0,t.default)(f),_=m.split(" ");return m.length?(y.forEach(function(w){for(var B=w[0],N=w[1],v=a,C=[],$=0,Le=N.length;$<Le;$+=1){var O=N[$],Te=O[0],Ve=O[1],ze=O[2],R=h(Te,Ve,ze,f,m,_,k);R?(v=Math.min(v,R[0]),C.push(R[1])):C.push(null)}v<a&&d.push({item:B,score:v,matches:C})}),d.sort(s),d):[]}}return M}var K;function ce(){return K||(K=1,function(t){t.__esModule=!0,t.default=s,t.fuzzyMatch=o;var r=a(U());t.normalizeText=r.default;function a(n){return n&&n.__esModule?n:{default:n}}function s(n,c){return c===void 0&&(c={}),G().createFuzzySearchImpl(n,c)}function o(n,c){return G().fuzzyMatchImpl(n,c)}}(D)),D}var le=ce();const ie=q(le),ue=["innerHTML"],de=e.defineComponent({__name:"Table",props:{zebra:{type:Boolean,default:!1},pinRows:{type:Boolean,default:!1},pinCols:{type:Boolean,default:!1},size:{default:F.MD},columns:{},dataSource:{},ajax:{},searchValue:{},searchFunction:{}},setup(t){const r=e.ref([]),a=e.ref([]),s=e.computed(()=>ie(r.value)),o=e.ref(null),n=t,c=e.ref(L("table",`table-${A.toClassName(n.size)}`,{"table-zebra":n.zebra,"table-pin-rows":n.pinRows,"table-pin-cols ":n.pinCols})),h=(S,E)=>String(!S||typeof S!="object"?S:E.split(".").reduce((g,x)=>g&&(typeof g=="object"?g[x]:g),S));return e.watch(()=>n.searchValue,S=>{if(n.searchFunction){a.value=n.searchFunction(S??"");return}a.value=S?s.value(S):r.value}),(S,E)=>(e.openBlock(),e.createElementBlock("table",{ref_key:"table",ref:o,class:e.normalizeClass(c.value)},[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,g=>(e.openBlock(),e.createElementBlock("th",{key:g.title},e.toDisplayString(g.title),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,g=>(e.openBlock(),e.createElementBlock("tr",{key:String(g)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,x=>(e.openBlock(),e.createElementBlock("td",{key:x.title,innerHTML:x.render?x.render(h(g,x.data),g):h(g,x.data)},null,8,ue))),128))]))),128))])],2))}}),fe=e.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(t,{expose:r,emit:a}){const s=t,o=e.ref(s.value),n=a,c=h=>{o.value=h,n("update:value",h)};return e.provide("stepper",{value:o,updateValue:c}),e.watch(()=>s.value,h=>{o.value=h}),r({updateValue:c}),(h,S)=>e.renderSlot(h.$slots,"default",{updateValue:c})}}),pe=e.defineComponent({__name:"Step",props:{value:{}},setup(t){const r=t,a=e.inject("stepper"),s=e.ref("");return e.watch(()=>a==null?void 0:a.value.value,o=>{o&&r.value&&(s.value=Number(o)>=Number(r.value)?"step-primary":"")}),e.onMounted(()=>{a&&(s.value=a.value.value===r.value?"step-primary":"",Number(a.value.value)>=Number(r.value)&&(s.value="step-primary"))}),(o,n)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["step",s.value])},[e.renderSlot(o.$slots,"default")],2))}}),me={},he={class:"steps"};function be(t,r){return e.openBlock(),e.createElementBlock("ul",he,[e.renderSlot(t.$slots,"default")])}const ge=X(me,[["render",be]]),ye={key:0},_e=e.defineComponent({__name:"StepPanels",setup(t){const r=e.inject("stepper");return(a,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>{var o,n;return[(o=e.unref(r))!=null&&o.value?(e.openBlock(),e.createElementBlock("div",ye,[e.renderSlot(a.$slots,"default",{currentStep:(n=e.unref(r))==null?void 0:n.value})])):e.createCommentVNode("",!0)]}),_:3}))}}),ke={key:0},Be=e.defineComponent({__name:"StepPanel",props:{value:{}},setup(t,{expose:r}){const a=e.computed(()=>s==null?void 0:s.value.value),s=e.inject("stepper"),o=n=>{s&&s.updateValue(n.toString())};return r({activateCallback:o}),(n,c)=>n.value===a.value?(e.openBlock(),e.createElementBlock("div",ke,[e.renderSlot(n.$slots,"default",{activateCallback:o})])):e.createCommentVNode("",!0)}}),Se={className:"modal-box"},Ee={key:0,method:"dialog"},xe=e.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1}},emits:["close"],setup(t,{expose:r,emit:a}){const s=e.ref(null),o=a,n=t,c=e.ref(L("modal",{"overflow-visible":n.overflow}));return r({showModal:()=>{var E;(E=s.value)==null||E.showModal()},closeModal:()=>{var E;(E=s.value)==null||E.close()}}),(E,g)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"modal",ref:s,class:e.normalizeClass(c.value),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:g[0]||(g[0]=x=>o("close",x))},[e.createElementVNode("div",Se,[E.closeButton?(e.openBlock(),e.createElementBlock("form",Ee,g[1]||(g[1]=[e.createElementVNode("button",{className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2"},"✕",-1)]))):e.createCommentVNode("",!0),e.renderSlot(E.$slots,"default")])],34))}}),we={class:"hidden w-full max-w-sm lg:flex"},Ne={class:"relative mx-3 w-full"},ve={class:"w-full max-w-full relative"},Ce=e.defineComponent({__name:"SearchBar",emits:["input"],setup(t,{emit:r}){const a=e.ref(null),s=r,o=n=>{(n.ctrlKey||n.metaKey)&&n.key.toLowerCase()==="k"&&(n.preventDefault(),a.value&&a.value.focus())};return e.onMounted(()=>{document.addEventListener("keydown",o)}),e.onUnmounted(()=>{document.removeEventListener("keydown",o)}),(n,c)=>(e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("label",Ne,[c[1]||(c[1]=e.createElementVNode("svg",{class:"pointer-events-none absolute z-10 my-3.5 ms-4 opacity-60 text-base-content","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",ve,[e.createElementVNode("form",null,[e.createElementVNode("input",{ref_key:"searchInput",ref:a,type:"search",placeholder:"Zoeken...",onInput:c[0]||(c[0]=h=>s("input",h.target.value)),class:"bg-transparent color-[inherit] border-[2px] border-solid border-transparent focus:border-[2px] focus:border-base-200 focus:outline-none rounded-xl w-full px-3 py-2 ps-10"},null,544)])]),c[2]||(c[2]=e.createElementVNode("div",{class:"pointer-events-none absolute end-10 top-2.5 gap-1 opacity-50 rtl:flex-row-reverse hidden lg:flex"},[e.createElementVNode("kbd",{class:"kbd kbd-sm"},"ctrl"),e.createElementVNode("kbd",{class:"kbd kbd-sm"},"K")],-1))])]))}}),Me=["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"];p.Button=Q,p.Card=ee,p.CardBody=ae,p.CardTitle=se,p.Color=T,p.ColorUtils=V,p.Container=oe,p.Modal=xe,p.SearchBar=Ce,p.Size=F,p.SizeUtils=A,p.Step=pe,p.StepList=ge,p.StepPanel=Be,p.StepPanels=_e,p.Stepper=fe,p.Table=de,p.dendelionSafeList=Me,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { TableProps } from './interface';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
}
|
|
2
|
+
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & TableProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
4
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
5
|
+
attrs: any;
|
|
6
|
+
slots: {};
|
|
7
|
+
emit: {};
|
|
8
|
+
}>) => import("vue").VNode & {
|
|
9
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
10
|
+
};
|
|
11
11
|
export default _default;
|
|
12
|
+
type __VLS_PrettifyLocal<T> = {
|
|
13
|
+
[K in keyof T]: T[K];
|
|
14
|
+
} & {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Table } from './Table.vue';
|
|
2
|
-
export
|
|
2
|
+
export * from './interface';
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { Size } from "@/types";
|
|
2
|
-
|
|
2
|
+
import { Component, VNode } from "vue";
|
|
3
|
+
export type TableProps<T> = {
|
|
3
4
|
zebra?: boolean;
|
|
4
5
|
pinRows?: boolean;
|
|
5
6
|
pinCols?: boolean;
|
|
6
|
-
size
|
|
7
|
-
columns: Column[];
|
|
8
|
-
dataSource:
|
|
9
|
-
ajax?: (params: object) => Promise<object
|
|
7
|
+
size?: Size;
|
|
8
|
+
columns: Column<T>[];
|
|
9
|
+
dataSource: T[];
|
|
10
|
+
ajax?: (params: object) => Promise<object> | string;
|
|
11
|
+
searchValue?: string;
|
|
12
|
+
searchFunction?: (searchValue: string) => T[];
|
|
10
13
|
};
|
|
11
|
-
export type Column = {
|
|
14
|
+
export type Column<T> = {
|
|
12
15
|
title: string;
|
|
13
16
|
data: string;
|
|
14
|
-
render?: (text: string,
|
|
17
|
+
render?: (text: string, row: T) => string | Component | VNode;
|
|
15
18
|
extraClasses?: ExtraClasses;
|
|
16
19
|
};
|
|
17
20
|
export type ExtraClasses = {
|
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.5",
|
|
6
6
|
"author": "ThatzOkay",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/ThatzOkay/DendelionUI#readme",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist",
|
|
26
26
|
"src"
|
|
27
27
|
],
|
|
28
|
-
"main": "./dist/
|
|
28
|
+
"main": "./dist/dendelion-ui.umd.js",
|
|
29
29
|
"module": "./dist/dendelion-ui.es.js",
|
|
30
30
|
"typings": "./dist/types/index.d.ts",
|
|
31
31
|
"types": "./dist/types/index.d.ts",
|
|
@@ -52,7 +52,9 @@
|
|
|
52
52
|
"preview": "vite preview"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
+
"@nozbe/microfuzz": "^1.0.0",
|
|
55
56
|
"classnames": "^2.5.1",
|
|
57
|
+
"fuzzysearch": "^1.0.3",
|
|
56
58
|
"vue": "^3.5.13"
|
|
57
59
|
},
|
|
58
60
|
"devDependencies": {
|
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<table ref="table" :class="tableClasses">
|
|
3
|
-
|
|
3
|
+
<thead>
|
|
4
|
+
<tr>
|
|
5
|
+
<th v-for="column in props.columns" v-bind:key="column.title">
|
|
6
|
+
{{ column.title }}
|
|
7
|
+
</th>
|
|
8
|
+
</tr>
|
|
9
|
+
</thead>
|
|
10
|
+
<tbody>
|
|
11
|
+
<tr v-for="row in filteredDataSource" v-bind:key="String(row)">
|
|
12
|
+
<td v-for="column in props.columns" v-bind:key="column.title" v-html="column.render ? column.render(getValue(row, column.data), row as T) : getValue(row, column.data) ">
|
|
13
|
+
</td>
|
|
14
|
+
</tr>
|
|
15
|
+
</tbody>
|
|
4
16
|
</table>
|
|
5
17
|
</template>
|
|
6
18
|
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import { ref } from 'vue';
|
|
19
|
+
<script setup lang="ts" generic="T">
|
|
20
|
+
import { computed, ref, watch } from 'vue';
|
|
9
21
|
import { TableProps } from './interface';
|
|
10
22
|
import classNames from 'classnames';
|
|
11
23
|
import { Size, SizeUtils } from '@/types';
|
|
24
|
+
import createFuzzySearch from '@nozbe/microfuzz'
|
|
25
|
+
|
|
26
|
+
const originalDataSource = ref<T[]>([]);
|
|
27
|
+
const filteredDataSource = ref<T[]>([]);
|
|
28
|
+
const fuzzyDataSource = computed(() => {
|
|
29
|
+
return createFuzzySearch(originalDataSource.value);
|
|
30
|
+
});
|
|
12
31
|
|
|
13
32
|
const table = ref<HTMLTableElement | null>(null)
|
|
14
33
|
|
|
15
|
-
const props = withDefaults(defineProps<TableProps
|
|
34
|
+
const props = withDefaults(defineProps<TableProps<T>>(), {
|
|
16
35
|
size: Size.MD,
|
|
17
36
|
zebra: false,
|
|
18
37
|
pinRows: false,
|
|
@@ -24,4 +43,22 @@ const tableClasses = ref(classNames('table', `table-${SizeUtils.toClassName(prop
|
|
|
24
43
|
'table-pin-rows': props.pinRows,
|
|
25
44
|
'table-pin-cols ': props.pinCols,
|
|
26
45
|
}));
|
|
46
|
+
|
|
47
|
+
//I'll figure pagination later
|
|
48
|
+
const getValue = (obj: any, keyPath: string): string => {
|
|
49
|
+
if (!obj || typeof obj !== 'object') return String(obj);
|
|
50
|
+
return String(
|
|
51
|
+
keyPath.split('.').reduce<unknown>((acc, key) => acc && (typeof acc === 'object' ? (acc as Record<string, any>)[key] : acc), obj)
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
watch(() => props.searchValue, (value) => {
|
|
56
|
+
if (props.searchFunction) {
|
|
57
|
+
filteredDataSource.value = props.searchFunction(value ?? "");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
filteredDataSource.value = value ? fuzzyDataSource.value(value) as T[] : originalDataSource.value;
|
|
62
|
+
});
|
|
63
|
+
|
|
27
64
|
</script>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Table } from './Table.vue';
|
|
2
|
-
export
|
|
2
|
+
export * from './interface';
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { Size } from "@/types";
|
|
2
|
+
import { Component, VNode } from "vue";
|
|
2
3
|
|
|
3
|
-
export type TableProps = {
|
|
4
|
+
export type TableProps<T> = {
|
|
4
5
|
zebra?: boolean;
|
|
5
6
|
pinRows?: boolean;
|
|
6
7
|
pinCols?: boolean;
|
|
7
|
-
size
|
|
8
|
-
columns: Column[];
|
|
9
|
-
dataSource:
|
|
10
|
-
ajax?: (params: object) => Promise<object
|
|
8
|
+
size?: Size
|
|
9
|
+
columns: Column<T>[];
|
|
10
|
+
dataSource: T[];
|
|
11
|
+
ajax?: (params: object) => Promise<object> | string;
|
|
12
|
+
searchValue?: string;
|
|
13
|
+
searchFunction?: (searchValue: string) => T[];
|
|
11
14
|
}
|
|
12
15
|
|
|
13
|
-
export type Column = {
|
|
16
|
+
export type Column<T> = {
|
|
14
17
|
title: string;
|
|
15
18
|
data: string;
|
|
16
|
-
render?: (text: string,
|
|
19
|
+
render?: (text: string, row: T) => string | Component | VNode;
|
|
17
20
|
extraClasses?: ExtraClasses;
|
|
18
21
|
}
|
|
19
22
|
|