dendelion-ui 0.0.8 → 0.0.11
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 +459 -303
- package/dist/dendelion-ui.umd.js +2 -2
- package/dist/types/components/button/Button.vue.d.ts +5 -1
- package/dist/types/components/button/interface.d.ts +3 -1
- package/dist/types/components/modal/Modal.vue.d.ts +5 -0
- package/dist/types/components/modal/interface.d.ts +2 -0
- package/dist/types/types/color.d.ts +7 -1
- package/dist/types/types/size.d.ts +7 -1
- package/package.json +1 -1
- package/src/components/button/Button.vue +7 -3
- package/src/components/button/interface.ts +3 -1
- package/src/components/card/Card.vue +3 -3
- package/src/components/modal/Modal.vue +12 -4
- package/src/components/modal/interface.ts +2 -0
- package/src/components/table/Table.vue +2 -2
- package/src/shims-vue.d.ts +0 -1
- package/src/types/color.ts +166 -68
- package/src/types/size.ts +56 -10
package/dist/dendelion-ui.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(
|
|
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 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 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 P{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 Q{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 v=(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))(v||{});class A{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 I{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 X{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 K(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var F={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 I;function Z(){return I||(I=1,function(t){(function(){var n={}.hasOwnProperty;function s(){for(var r="",c=0;c<arguments.length;c++){var f=arguments[c];f&&(r=a(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 s.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=a(c,f));return c}function a(r,c){return c?r?r+" "+c:r+c:r}t.exports?(s.default=s,t.exports=s):window.classNames=s})()}(T)),T.exports}var J=Z();const L=A(J),Y=["type","disabled"],Q={class:"group-[.is-loading]:text-transparent"},ee=e.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:z.Neutral},disabled:{type:Boolean},click:{}},setup(t){const n=t,s=e.computed(()=>L("btn","group",`btn-${P.toClassName(n.color)}`,n.loading?"is-loading":"",n.disabled?"disabled":""));return(o,a)=>(e.openBlock(),e.createElementBlock("button",{onClick:a[0]||(a[0]=r=>o.click?o.click:void 0),class:e.normalizeClass(s.value),type:o.type,disabled:o.disabled||o.loading},[a[1]||(a[1]=e.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),e.createElementVNode("span",Q,[e.renderSlot(o.$slots,"default")])],10,Y))}}),v=(t,n)=>{const s=t.__vccOpts||t;for(const[o,a]of n)s[o]=a;return s},te={};function ne(t,n){return e.openBlock(),e.createElementBlock("button")}const re=v(te,[["render",ne]]);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 X{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 ae=e.defineComponent({__name:"Card",props:{backgroundColor:{default:z.Primary},shadow:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},rounded:{type:Boolean},roundedSize:{}},setup(t){const n=t,s=e.ref(L("card",`bg-${n.backgroundColor}`,n.shadow?"shadow-lg":"",n.fullWidth?"w-full":"",n.rounded&&!n.roundedSize?"rounded":n.roundedSize?`rounded-${n.roundedSize}`:""));return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.value)},[e.renderSlot(o.$slots,"default")],2))}}),se={},oe={class:"card-body"};function ce(t,n){return e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(t.$slots,"default")])}const le=v(se,[["render",ce]]),ie=e.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(t){return(n,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.is),{class:"card-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.text),1)]),_:1}))}}),de=e.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(t){const n=t,s=e.ref([n.container?"container":"",n.padding?"p-6":""]);return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.value)},[e.renderSlot(o.$slots,"default")],2))}});var D={},W={},K;function U(){return K||(K=1,function(t){t.__esModule=!0,t.default=a;var n=/[\u0300-\u036f]/g,s=/ł/g,o=/ñ/g;function a(r){return r.toLowerCase().normalize("NFD").replace(n,"").replace(s,"l").replace(o,"n").trim()}}(W)),W}var M={},H;function j(){if(H)return M;H=1,M.__esModule=!0,M.aggressiveFuzzyMatch=y,M.createFuzzySearchImpl=O,M.experimentalSmartFuzzyMatch=B,M.fuzzyMatchImpl=_;var t=n(U());function n(i){return i&&i.__esModule?i:{default:i}}var s=Number.MAX_SAFE_INTEGER,o=function(l,h){return l.score-h.score},a=function(l,h){return l[0]-h[0]},r=new Set(` []()-–—'"“”`.split(""));function c(i){return r.has(i)}function f(i,l,h,S,d,k,b){if(i===S)return[0,[[0,i.length-1]]];var u=S.length,g=l.length,E=d.length;if(l===d)return[.1,[[0,g-1]]];if(l.startsWith(d))return[.5,[[0,E-1]]];var N=i.indexOf(S);if(N>-1&&c(i[N-1]))return[.9,[[N,N+u-1]]];var x=l.indexOf(d);if(x>-1&&c(l[x-1]))return[1,[[x,x+u-1]]];var w=k.length;if(w>1&&k.every(function($){return h.has($)})){var C=1.5+w*.2;return[C,k.map(function($){var V=l.indexOf($);return[V,V+$.length-1]}).sort(a)]}return x>-1?[2,[[x,x+u-1]]]:b==="aggressive"?y(l,d):b==="smart"?B(l,d):null}function y(i,l){for(var h=i.length,S=l.length,d=0,k=l[d],b=[],u=-1,g=-2,E=0;E<h;E+=1)if(i[E]===k){if(E!==g+1&&(u>=0&&b.push([u,g]),u=E),g=E,d+=1,d===S)return b.push([u,g]),m(b,i);k=l[d]}return null}function B(i,l){for(var h=i.length,S=[],d=0,k=l[d],b=-1,u=-2;;){var g=i.indexOf(k,u+1);if(g===-1)break;if(g===0||c(i[g-1]))b=g;else{var E=l.length-d,N=i.length-g,x=Math.min(3,E,N),w=l.slice(d,d+x);if(i.slice(g,g+x)===w)b=g;else{u+=1;continue}}for(u=b;u<h&&i[u]===k;u+=1)d+=1,k=l[d];if(u-=1,S.push([b,u]),d===l.length)return m(S,i)}return null}function m(i,l){var h=2;return i.forEach(function(S){var d=S[0],k=S[1],b=k-d+1,u=d===0||l[d]===" "||l[d-1]===" ",g=k===l.length-1||l[k]===" "||l[k+1]===" ",E=u&&g;E?h+=.2:u?h+=.4:b>=3?h+=.8:h+=1.6}),[h,i]}function _(i,l){var h=(0,t.default)(l),S=h.split(" "),d=(0,t.default)(i),k=new Set(d.split(" ")),b=f(i,d,k,l,h,S,"smart");return b?{item:i,score:b[0],matches:[b[1]]}:null}function O(i,l){var h=l.strategy,S=h===void 0?"aggressive":h,d=l.getText,k=i.map(function(b){var u;if(d)u=d(b);else{var g=l.key?b[l.key]:b;u=[g]}var E=u.map(function(N){var x=N||"",w=(0,t.default)(x),C=new Set(w.split(" "));return[x,w,C]});return[b,E]});return function(b){var u=[],g=(0,t.default)(b),E=g.split(" ");return g.length?(k.forEach(function(N){for(var x=N[0],w=N[1],C=s,$=[],V=0,We=w.length;V<We;V+=1){var R=w[V],Oe=R[0],Re=R[1],qe=R[2],q=f(Oe,Re,qe,b,g,E,S);q?(C=Math.min(C,q[0]),$.push(q[1])):$.push(null)}C<s&&u.push({item:x,score:C,matches:$})}),u.sort(o),u):[]}}return M}var G;function ue(){return G||(G=1,function(t){t.__esModule=!0,t.default=o,t.fuzzyMatch=a;var n=s(U());t.normalizeText=n.default;function s(r){return r&&r.__esModule?r:{default:r}}function o(r,c){return c===void 0&&(c={}),j().createFuzzySearchImpl(r,c)}function a(r,c){return j().fuzzyMatchImpl(r,c)}}(D)),D}var fe=ue();const pe=A(fe),me={key:0},he=["colspan"],be=["innerHTML"],ge=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 n=e.ref([]),s=e.ref([]),o=e.ref(null),a=t,r=e.ref(L("table",`table-${X.toClassName(a.size)}`,{"table-zebra":a.zebra,"table-pin-rows":a.pinRows,"table-pin-cols ":a.pinCols})),c=(y,B)=>String(!y||typeof y!="object"?y:B.split(".").reduce((m,_)=>m&&(typeof m=="object"?m[_]:m),y));e.onMounted(()=>{n.value=a.dataSource,s.value=a.dataSource}),e.watch(()=>a.dataSource,y=>{n.value=y,s.value=y},{immediate:!0}),e.watch(()=>a.searchValue,y=>{if(a.searchFunction){s.value=a.searchFunction(y??"");return}s.value=y?f(y):n.value},{immediate:!0});const f=y=>{const B=[];return n.value.length>0?(Object.keys(n.value[0]).forEach(_=>{const O=n.value.map(h=>c(h,_)),l=pe(O)(y);for(const h of l){const S=n.value.filter(d=>c(d,_)===h.item);B.push(...S)}}),B):[]};return(y,B)=>(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(a.columns,m=>(e.openBlock(),e.createElementBlock("th",{key:m.title},e.toDisplayString(m.title),1))),128))])]),e.createElementVNode("tbody",null,[s.value.length===0?(e.openBlock(),e.createElementBlock("tr",me,[e.createElementVNode("td",{colspan:a.columns.length}," No data found ",8,he)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(s.value,m=>(e.openBlock(),e.createElementBlock("tr",{key:String(m)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.columns,_=>(e.openBlock(),e.createElementBlock("td",{key:_.title},[_.render?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(c(m,_.data)),1)],64)),typeof _.render=="function"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[typeof _.render(c(m,_.data),m)=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:_.render(c(m,_.data),m)},null,8,be)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_.render(c(m,_.data),m)),{key:1}))],64)):e.createCommentVNode("",!0)]))),128))]))),128))])],2))}}),ye=e.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(t,{expose:n,emit:s}){const o=t,a=e.ref(o.value),r=s,c=f=>{a.value=f,r("update:value",f)};return e.provide("stepper",{value:a,updateValue:c}),e.watch(()=>o.value,f=>{a.value=f}),n({updateValue:c}),(f,y)=>e.renderSlot(f.$slots,"default",{updateValue:c})}}),_e=e.defineComponent({__name:"Step",props:{value:{}},setup(t){const n=t,s=e.inject("stepper"),o=e.ref("");return e.watch(()=>s==null?void 0:s.value.value,a=>{a&&n.value&&(o.value=Number(a)>=Number(n.value)?"step-primary":"")}),e.onMounted(()=>{s&&(o.value=s.value.value===n.value?"step-primary":"",Number(s.value.value)>=Number(n.value)&&(o.value="step-primary"))}),(a,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["step",o.value])},[e.renderSlot(a.$slots,"default")],2))}}),ke={},Be={class:"steps"};function Se(t,n){return e.openBlock(),e.createElementBlock("ul",Be,[e.renderSlot(t.$slots,"default")])}const Ee=v(ke,[["render",Se]]),xe={key:0},Ne=e.defineComponent({__name:"StepPanels",setup(t){const n=e.inject("stepper");return(s,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>{var a,r;return[(a=e.unref(n))!=null&&a.value?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(s.$slots,"default",{currentStep:(r=e.unref(n))==null?void 0:r.value})])):e.createCommentVNode("",!0)]}),_:3}))}}),we={key:0},Ce=e.defineComponent({__name:"StepPanel",props:{value:{}},setup(t,{expose:n}){const s=e.computed(()=>o==null?void 0:o.value.value),o=e.inject("stepper"),a=r=>{o&&o.updateValue(r.toString())};return n({activateCallback:a}),(r,c)=>r.value===s.value?(e.openBlock(),e.createElementBlock("div",we,[e.renderSlot(r.$slots,"default",{activateCallback:a})])):e.createCommentVNode("",!0)}}),$e={className:"modal-box"},Me={key:0,method:"dialog"},Ve=e.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1}},emits:["close"],setup(t,{expose:n,emit:s}){const o=e.ref(null),a=s,r=t,c=e.ref(L("modal",{"overflow-visible":r.overflow}));return n({showModal:()=>{var B;(B=o.value)==null||B.showModal()},closeModal:()=>{var B;(B=o.value)==null||B.close()}}),(B,m)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"modal",ref:o,class:e.normalizeClass(c.value),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:m[0]||(m[0]=_=>a("close",_))},[e.createElementVNode("div",$e,[B.closeButton?(e.openBlock(),e.createElementBlock("form",Me,m[1]||(m[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))}}),ze={class:"hidden w-full max-w-sm lg:flex"},Le={class:"relative mx-3 w-full"},Te={class:"w-full max-w-full relative"},ve=["value"],Fe=e.defineComponent({__name:"SearchBar",props:["modelValue"],emits:["update:modelValue"],setup(t,{emit:n}){const s=t,o=e.ref(null),a=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",ze,[e.createElementVNode("label",Le,[f[1]||(f[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",Te,[e.createElementVNode("form",null,[e.createElementVNode("input",{ref_key:"searchInput",ref:o,type:"search",placeholder:"Zoeken...",value:s.modelValue,onInput:f[0]||(f[0]=y=>a("update:modelValue",y.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,40,ve)])]),f[2]||(f[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))])]))}}),De=["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=ee,p.Card=ae,p.CardBody=le,p.CardTitle=ie,p.Color=z,p.ColorUtils=P,p.Container=de,p.Modal=Ve,p.SearchBar=Fe,p.SimpleButton=re,p.Size=F,p.SizeUtils=X,p.Step=_e,p.StepList=Ee,p.StepPanel=Ce,p.StepPanels=Ne,p.Stepper=ye,p.Table=ge,p.dendelionSafeList=De,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
*/var H;function ee(){return H||(H=1,function(t){(function(){var n={}.hasOwnProperty;function s(){for(var r="",c=0;c<arguments.length;c++){var m=arguments[c];m&&(r=a(r,o(m)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return s.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var m in r)n.call(r,m)&&r[m]&&(c=a(c,m));return c}function a(r,c){return c?r?r+" "+c:r+c:r}t.exports?(s.default=s,t.exports=s):window.classNames=s})()}(F)),F.exports}var te=ee();const $=K(te),ne=["type","disabled"],re={class:"group-[.is-loading]:text-transparent"},ae=e.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:L.Neutral},soft:{type:Boolean,default:!1},outline:{type:Boolean,default:!1},disabled:{type:Boolean},click:{}},setup(t){const n=t,s=e.computed(()=>$("btn","group",P.toClassName(n.color),n.soft?"btn-soft":"",n.outline?"btn-outline":"",n.loading?"is-loading":"",n.disabled?"disabled":""));return(o,a)=>(e.openBlock(),e.createElementBlock("button",{onClick:a[0]||(a[0]=r=>o.click?o.click:void 0),class:e.normalizeClass(s.value),type:o.type,disabled:o.disabled||o.loading},[a[1]||(a[1]=e.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),e.createElementVNode("span",re,[e.renderSlot(o.$slots,"default")])],10,ne))}}),D=(t,n)=>{const s=t.__vccOpts||t;for(const[o,a]of n)s[o]=a;return s},se={};function oe(t,n){return e.openBlock(),e.createElementBlock("button")}const ce=D(se,[["render",oe]]),le=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 n=t,s=e.ref($("card",q.toClassName(n.backgroundColor),n.shadow?"shadow-lg":"",n.fullWidth?"w-full":"",n.rounded&&!n.roundedSize?"rounded":n.roundedSize?I.toClassName(n.roundedSize):""));return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.value)},[e.renderSlot(o.$slots,"default")],2))}}),ue={},ie={class:"card-body"};function de(t,n){return e.openBlock(),e.createElementBlock("div",ie,[e.renderSlot(t.$slots,"default")])}const fe=D(ue,[["render",de]]),pe=e.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(t){return(n,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.is),{class:"card-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.text),1)]),_:1}))}}),me=e.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(t){const n=t,s=e.ref([n.container?"container":"",n.padding?"p-6":""]);return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.value)},[e.renderSlot(o.$slots,"default")],2))}});var R={},W={},j;function G(){return j||(j=1,function(t){t.__esModule=!0,t.default=a;var n=/[\u0300-\u036f]/g,s=/ł/g,o=/ñ/g;function a(r){return r.toLowerCase().normalize("NFD").replace(n,"").replace(s,"l").replace(o,"n").trim()}}(W)),W}var V={},Z;function J(){if(Z)return V;Z=1,V.__esModule=!0,V.aggressiveFuzzyMatch=_,V.createFuzzySearchImpl=T,V.experimentalSmartFuzzyMatch=w,V.fuzzyMatchImpl=y;var t=n(G());function n(u){return u&&u.__esModule?u:{default:u}}var s=Number.MAX_SAFE_INTEGER,o=function(l,b){return l.score-b.score},a=function(l,b){return l[0]-b[0]},r=new Set(` []()-–—'"“”`.split(""));function c(u){return r.has(u)}function m(u,l,b,k,i,B,g){if(u===k)return[0,[[0,u.length-1]]];var p=k.length,h=l.length,S=i.length;if(l===i)return[.1,[[0,h-1]]];if(l.startsWith(i))return[.5,[[0,S-1]]];var E=u.indexOf(k);if(E>-1&&c(u[E-1]))return[.9,[[E,E+p-1]]];var x=l.indexOf(i);if(x>-1&&c(l[x-1]))return[1,[[x,x+p-1]]];var N=B.length;if(N>1&&B.every(function(M){return b.has(M)})){var C=1.5+N*.2;return[C,B.map(function(M){var z=l.indexOf(M);return[z,z+M.length-1]}).sort(a)]}return x>-1?[2,[[x,x+p-1]]]:g==="aggressive"?_(l,i):g==="smart"?w(l,i):null}function _(u,l){for(var b=u.length,k=l.length,i=0,B=l[i],g=[],p=-1,h=-2,S=0;S<b;S+=1)if(u[S]===B){if(S!==h+1&&(p>=0&&g.push([p,h]),p=S),h=S,i+=1,i===k)return g.push([p,h]),f(g,u);B=l[i]}return null}function w(u,l){for(var b=u.length,k=[],i=0,B=l[i],g=-1,p=-2;;){var h=u.indexOf(B,p+1);if(h===-1)break;if(h===0||c(u[h-1]))g=h;else{var S=l.length-i,E=u.length-h,x=Math.min(3,S,E),N=l.slice(i,i+x);if(u.slice(h,h+x)===N)g=h;else{p+=1;continue}}for(p=g;p<b&&u[p]===B;p+=1)i+=1,B=l[i];if(p-=1,k.push([g,p]),i===l.length)return f(k,u)}return null}function f(u,l){var b=2;return u.forEach(function(k){var i=k[0],B=k[1],g=B-i+1,p=i===0||l[i]===" "||l[i-1]===" ",h=B===l.length-1||l[B]===" "||l[B+1]===" ",S=p&&h;S?b+=.2:p?b+=.4:g>=3?b+=.8:b+=1.6}),[b,u]}function y(u,l){var b=(0,t.default)(l),k=b.split(" "),i=(0,t.default)(u),B=new Set(i.split(" ")),g=m(u,i,B,l,b,k,"smart");return g?{item:u,score:g[0],matches:[g[1]]}:null}function T(u,l){var b=l.strategy,k=b===void 0?"aggressive":b,i=l.getText,B=u.map(function(g){var p;if(i)p=i(g);else{var h=l.key?g[l.key]:g;p=[h]}var S=p.map(function(E){var x=E||"",N=(0,t.default)(x),C=new Set(N.split(" "));return[x,N,C]});return[g,S]});return function(g){var p=[],h=(0,t.default)(g),S=h.split(" ");return h.length?(B.forEach(function(E){for(var x=E[0],N=E[1],C=s,M=[],z=0,qe=N.length;z<qe;z+=1){var O=N[z],Pe=O[0],Ae=O[1],Ie=O[2],U=m(Pe,Ae,Ie,g,h,S,k);U?(C=Math.min(C,U[0]),M.push(U[1])):M.push(null)}C<s&&p.push({item:x,score:C,matches:M})}),p.sort(o),p):[]}}return V}var Y;function be(){return Y||(Y=1,function(t){t.__esModule=!0,t.default=o,t.fuzzyMatch=a;var n=s(G());t.normalizeText=n.default;function s(r){return r&&r.__esModule?r:{default:r}}function o(r,c){return c===void 0&&(c={}),J().createFuzzySearchImpl(r,c)}function a(r,c){return J().fuzzyMatchImpl(r,c)}}(R)),R}var ge=be();const he=K(ge),ye={key:0},_e=["colspan"],Be=["innerHTML"],ke=e.defineComponent({__name:"Table",props:{zebra:{type:Boolean,default:!1},pinRows:{type:Boolean,default:!1},pinCols:{type:Boolean,default:!1},size:{default:v.MD},columns:{},dataSource:{},ajax:{},searchValue:{},searchFunction:{}},setup(t){const n=e.ref([]),s=e.ref([]),o=e.ref(null),a=t,r=e.ref($("table",X.toClassName(a.size),{"table-zebra":a.zebra,"table-pin-rows":a.pinRows,"table-pin-cols ":a.pinCols})),c=(_,w)=>String(!_||typeof _!="object"?_:w.split(".").reduce((f,y)=>f&&(typeof f=="object"?f[y]:f),_));e.onMounted(()=>{n.value=a.dataSource,s.value=a.dataSource}),e.watch(()=>a.dataSource,_=>{n.value=_,s.value=_},{immediate:!0}),e.watch(()=>a.searchValue,_=>{if(a.searchFunction){s.value=a.searchFunction(_??"");return}s.value=_?m(_):n.value},{immediate:!0});const m=_=>{const w=[];return n.value.length>0?(Object.keys(n.value[0]).forEach(y=>{const T=n.value.map(b=>c(b,y)),l=he(T)(_);for(const b of l){const k=n.value.filter(i=>c(i,y)===b.item);w.push(...k)}}),w):[]};return(_,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(a.columns,f=>(e.openBlock(),e.createElementBlock("th",{key:f.title},e.toDisplayString(f.title),1))),128))])]),e.createElementVNode("tbody",null,[s.value.length===0?(e.openBlock(),e.createElementBlock("tr",ye,[e.createElementVNode("td",{colspan:a.columns.length}," No data found ",8,_e)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(s.value,f=>(e.openBlock(),e.createElementBlock("tr",{key:String(f)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.columns,y=>(e.openBlock(),e.createElementBlock("td",{key:y.title},[y.render?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(c(f,y.data)),1)],64)),typeof y.render=="function"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[typeof y.render(c(f,y.data),f)=="string"?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:y.render(c(f,y.data),f)},null,8,Be)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(y.render(c(f,y.data),f)),{key:1}))],64)):e.createCommentVNode("",!0)]))),128))]))),128))])],2))}}),Se=e.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(t,{expose:n,emit:s}){const o=t,a=e.ref(o.value),r=s,c=m=>{a.value=m,r("update:value",m)};return e.provide("stepper",{value:a,updateValue:c}),e.watch(()=>o.value,m=>{a.value=m}),n({updateValue:c}),(m,_)=>e.renderSlot(m.$slots,"default",{updateValue:c})}}),xe=e.defineComponent({__name:"Step",props:{value:{}},setup(t){const n=t,s=e.inject("stepper"),o=e.ref("");return e.watch(()=>s==null?void 0:s.value.value,a=>{a&&n.value&&(o.value=Number(a)>=Number(n.value)?"step-primary":"")}),e.onMounted(()=>{s&&(o.value=s.value.value===n.value?"step-primary":"",Number(s.value.value)>=Number(n.value)&&(o.value="step-primary"))}),(a,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["step",o.value])},[e.renderSlot(a.$slots,"default")],2))}}),Ee={},Ne={class:"steps"};function we(t,n){return e.openBlock(),e.createElementBlock("ul",Ne,[e.renderSlot(t.$slots,"default")])}const Ce=D(Ee,[["render",we]]),Me={key:0},Ve=e.defineComponent({__name:"StepPanels",setup(t){const n=e.inject("stepper");return(s,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>{var a,r;return[(a=e.unref(n))!=null&&a.value?(e.openBlock(),e.createElementBlock("div",Me,[e.renderSlot(s.$slots,"default",{currentStep:(r=e.unref(n))==null?void 0:r.value})])):e.createCommentVNode("",!0)]}),_:3}))}}),ze={key:0},$e=e.defineComponent({__name:"StepPanel",props:{value:{}},setup(t,{expose:n}){const s=e.computed(()=>o==null?void 0:o.value.value),o=e.inject("stepper"),a=r=>{o&&o.updateValue(r.toString())};return n({activateCallback:a}),(r,c)=>r.value===s.value?(e.openBlock(),e.createElementBlock("div",ze,[e.renderSlot(r.$slots,"default",{activateCallback:a})])):e.createCommentVNode("",!0)}}),Te={class:"modal-box"},Le={key:0,method:"dialog"},ve=e.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1},closeButtonSize:{default:v.SM}},emits:["close"],setup(t,{expose:n,emit:s}){const o=e.ref(null),a=s,r=t,c=e.ref($("modal",{"overflow-visible":r.overflow})),m=e.ref($("btn",A.toClassName(r.closeButtonSize),"btn-circle","btn-ghost","absolute","right-2","top-2"));return n({showModal:()=>{var f;(f=o.value)==null||f.showModal()},closeModal:()=>{var f;(f=o.value)==null||f.close()}}),(f,y)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"modal",ref:o,class:e.normalizeClass(c.value),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:y[0]||(y[0]=T=>a("close",T))},[e.createElementVNode("div",Te,[f.closeButton?(e.openBlock(),e.createElementBlock("form",Le,[e.createElementVNode("button",{class:e.normalizeClass(m.value)},"✕",2)])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default")]),y[1]||(y[1]=e.createElementVNode("form",{method:"dialog",class:"modal-backdrop"},[e.createElementVNode("button",null,"close")],-1))],34))}}),Fe={class:"hidden w-full max-w-sm lg:flex"},De={class:"relative mx-3 w-full"},Re={class:"w-full max-w-full relative"},We=["value"],Oe=e.defineComponent({__name:"SearchBar",props:["modelValue"],emits:["update:modelValue"],setup(t,{emit:n}){const s=t,o=e.ref(null),a=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,m)=>(e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("label",De,[m[1]||(m[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",Re,[e.createElementVNode("form",null,[e.createElementVNode("input",{ref_key:"searchInput",ref:o,type:"search",placeholder:"Zoeken...",value:s.modelValue,onInput:m[0]||(m[0]=_=>a("update:modelValue",_.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,40,We)])]),m[2]||(m[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))])]))}}),Ue=["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=ae,d.ButtonColorUtils=P,d.ButtonSizeUtils=A,d.Card=le,d.CardBody=fe,d.CardTitle=pe,d.Color=L,d.Container=me,d.Modal=ve,d.RoundedSizeUtils=I,d.SearchBar=Oe,d.SimpleButton=ce,d.Size=v,d.Step=xe,d.StepList=Ce,d.StepPanel=$e,d.StepPanels=Ve,d.Stepper=Se,d.Table=ke,d.TableSizeUtils=X,d.TextColorUtils=Q,d.dendelionSafeList=Ue,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color } from '@/types
|
|
1
|
+
import { Color } from '@/types';
|
|
2
2
|
import { ButtonProps } from './interface';
|
|
3
3
|
declare const classes: import("vue").ComputedRef<string>;
|
|
4
4
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
@@ -11,10 +11,14 @@ declare const __VLS_self: import("vue").DefineComponent<ButtonProps, {
|
|
|
11
11
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
|
|
12
12
|
type: import("./interface").Type;
|
|
13
13
|
color: Color;
|
|
14
|
+
soft: boolean;
|
|
15
|
+
outline: boolean;
|
|
14
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
17
|
declare const __VLS_component: import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
|
|
16
18
|
type: import("./interface").Type;
|
|
17
19
|
color: Color;
|
|
20
|
+
soft: boolean;
|
|
21
|
+
outline: boolean;
|
|
18
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
23
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
20
24
|
export default _default;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Color } from "@/types
|
|
1
|
+
import { Color } from "@/types";
|
|
2
2
|
export type Type = 'button' | 'submit' | 'reset';
|
|
3
3
|
export type ButtonProps = {
|
|
4
4
|
type?: Type;
|
|
5
5
|
loading?: boolean;
|
|
6
6
|
color?: Color;
|
|
7
|
+
soft?: boolean;
|
|
8
|
+
outline?: boolean;
|
|
7
9
|
disabled?: boolean;
|
|
8
10
|
click?: () => void;
|
|
9
11
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ModalProps } from './interface';
|
|
2
|
+
import { Size } from '@/types';
|
|
2
3
|
declare const modal: import("vue").Ref<HTMLDialogElement | null, HTMLDialogElement | null>;
|
|
3
4
|
declare const emit: (event: "close", ...args: any[]) => void;
|
|
4
5
|
declare const classes: import("vue").Ref<string, string>;
|
|
6
|
+
declare const closeButtonClasses: import("vue").Ref<string, string>;
|
|
5
7
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
6
8
|
declare var __VLS_1: {};
|
|
7
9
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
@@ -11,6 +13,7 @@ declare const __VLS_self: import("vue").DefineComponent<ModalProps, {
|
|
|
11
13
|
modal: typeof modal;
|
|
12
14
|
emit: typeof emit;
|
|
13
15
|
classes: typeof classes;
|
|
16
|
+
closeButtonClasses: typeof closeButtonClasses;
|
|
14
17
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
18
|
close: (...args: any[]) => void;
|
|
16
19
|
}, string, import("vue").PublicProps, Readonly<ModalProps> & Readonly<{
|
|
@@ -18,6 +21,7 @@ declare const __VLS_self: import("vue").DefineComponent<ModalProps, {
|
|
|
18
21
|
}>, {
|
|
19
22
|
closeButton: boolean;
|
|
20
23
|
overflow: boolean;
|
|
24
|
+
closeButtonSize: Size;
|
|
21
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
26
|
declare const __VLS_component: import("vue").DefineComponent<ModalProps, {
|
|
23
27
|
showModal: () => void;
|
|
@@ -29,6 +33,7 @@ declare const __VLS_component: import("vue").DefineComponent<ModalProps, {
|
|
|
29
33
|
}>, {
|
|
30
34
|
closeButton: boolean;
|
|
31
35
|
overflow: boolean;
|
|
36
|
+
closeButtonSize: Size;
|
|
32
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
38
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
34
39
|
export default _default;
|
|
@@ -20,6 +20,12 @@ export declare enum Color {
|
|
|
20
20
|
Error = 18,
|
|
21
21
|
ErrorContent = 19
|
|
22
22
|
}
|
|
23
|
-
export declare class
|
|
23
|
+
export declare class BackgroundColorUtils {
|
|
24
|
+
static toClassName(color: Color): string;
|
|
25
|
+
}
|
|
26
|
+
export declare class ButtonColorUtils {
|
|
27
|
+
static toClassName(color: Color): string;
|
|
28
|
+
}
|
|
29
|
+
export declare class TextColorUtils {
|
|
24
30
|
static toClassName(color: Color): string;
|
|
25
31
|
}
|
|
@@ -7,6 +7,12 @@ export declare enum Size {
|
|
|
7
7
|
TWOXL = 5,
|
|
8
8
|
THREEXL = 6
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
10
|
+
export declare class ButtonSizeUtils {
|
|
11
|
+
static toClassName(size: Size): string;
|
|
12
|
+
}
|
|
13
|
+
export declare class RoundedSizeUtils {
|
|
14
|
+
static toClassName(size: Size): string;
|
|
15
|
+
}
|
|
16
|
+
export declare class TableSizeUtils {
|
|
11
17
|
static toClassName(size: Size): string;
|
|
12
18
|
}
|
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.11",
|
|
6
6
|
"author": "ThatzOkay",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/ThatzOkay/DendelionUI#readme",
|
|
@@ -6,19 +6,23 @@
|
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script setup lang="ts">
|
|
9
|
-
import { Color,
|
|
9
|
+
import { Color, ButtonColorUtils } from '@/types';
|
|
10
10
|
import { ButtonProps } from './interface';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import { computed } from 'vue';
|
|
13
13
|
|
|
14
14
|
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
15
15
|
type: 'button',
|
|
16
|
-
color: Color.Neutral
|
|
16
|
+
color: Color.Neutral,
|
|
17
|
+
soft: false,
|
|
18
|
+
outline: false,
|
|
17
19
|
})
|
|
18
20
|
|
|
19
21
|
const classes = computed(() => classNames('btn',
|
|
20
22
|
'group',
|
|
21
|
-
|
|
23
|
+
ButtonColorUtils.toClassName(props.color),
|
|
24
|
+
props.soft ? 'btn-soft' : '',
|
|
25
|
+
props.outline ? 'btn-outline' : '',
|
|
22
26
|
props.loading ? 'is-loading' : '',
|
|
23
27
|
props.disabled ? 'disabled' : ''
|
|
24
28
|
))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color } from "@/types
|
|
1
|
+
import { Color } from "@/types";
|
|
2
2
|
|
|
3
3
|
export type Type = 'button' | 'submit' | 'reset';
|
|
4
4
|
|
|
@@ -6,6 +6,8 @@ export type ButtonProps = {
|
|
|
6
6
|
type?: Type,
|
|
7
7
|
loading?: boolean,
|
|
8
8
|
color?: Color,
|
|
9
|
+
soft?: boolean,
|
|
10
|
+
outline?: boolean,
|
|
9
11
|
disabled?: boolean,
|
|
10
12
|
click?: () => void,
|
|
11
13
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { ref } from 'vue';
|
|
10
10
|
import { CardProps } from './interface';
|
|
11
|
-
import { Color } from '@/types';
|
|
11
|
+
import { Color, BackgroundColorUtils, RoundedSizeUtils } from '@/types';
|
|
12
12
|
|
|
13
13
|
const props = withDefaults(defineProps<CardProps>(), {
|
|
14
14
|
backgroundColor: Color.Primary,
|
|
@@ -17,9 +17,9 @@ const props = withDefaults(defineProps<CardProps>(), {
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const classes = ref(classNames('card',
|
|
20
|
-
|
|
20
|
+
BackgroundColorUtils.toClassName(props.backgroundColor),
|
|
21
21
|
props.shadow ? 'shadow-lg' : '',
|
|
22
22
|
props.fullWidth ? 'w-full' : '',
|
|
23
|
-
props.rounded && !props.roundedSize ? 'rounded' : props.roundedSize ?
|
|
23
|
+
props.rounded && !props.roundedSize ? 'rounded' : props.roundedSize ? RoundedSizeUtils.toClassName(props.roundedSize) : '',
|
|
24
24
|
));
|
|
25
25
|
</script>
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<dialog ref="modal" :class="classes" aria-modal="true" aria-hidden="true" role="dialog"
|
|
3
|
-
|
|
2
|
+
<dialog ref="modal" :class="classes" aria-modal="true" aria-hidden="true" role="dialog"
|
|
3
|
+
@close="(e) => emit('close', e)">
|
|
4
|
+
<div class="modal-box">
|
|
4
5
|
<form v-if="closeButton" method="dialog">
|
|
5
|
-
<button
|
|
6
|
+
<button :class="closeButtonClasses">✕</button>
|
|
6
7
|
</form>
|
|
7
8
|
<slot></slot>
|
|
8
9
|
</div>
|
|
10
|
+
<form method="dialog" class="modal-backdrop">
|
|
11
|
+
<button>close</button>
|
|
12
|
+
</form>
|
|
9
13
|
</dialog>
|
|
10
14
|
</template>
|
|
11
15
|
|
|
@@ -13,6 +17,7 @@
|
|
|
13
17
|
import { ref } from 'vue';
|
|
14
18
|
import { ModalProps } from './interface';
|
|
15
19
|
import classNames from 'classnames';
|
|
20
|
+
import { Size, ButtonSizeUtils } from '@/types';
|
|
16
21
|
|
|
17
22
|
const modal = ref<HTMLDialogElement | null>(null);
|
|
18
23
|
|
|
@@ -20,13 +25,16 @@ const emit = defineEmits(['close']);
|
|
|
20
25
|
|
|
21
26
|
const props = withDefaults(defineProps<ModalProps>(), {
|
|
22
27
|
closeButton: true,
|
|
23
|
-
overflow: false
|
|
28
|
+
overflow: false,
|
|
29
|
+
closeButtonSize: Size.SM
|
|
24
30
|
});
|
|
25
31
|
|
|
26
32
|
const classes = ref(classNames('modal', {
|
|
27
33
|
'overflow-visible': props.overflow
|
|
28
34
|
}));
|
|
29
35
|
|
|
36
|
+
const closeButtonClasses = ref(classNames('btn', ButtonSizeUtils.toClassName(props.closeButtonSize), 'btn-circle', 'btn-ghost', 'absolute', 'right-2', 'top-2'));
|
|
37
|
+
|
|
30
38
|
const showModal = () => {
|
|
31
39
|
modal.value?.showModal();
|
|
32
40
|
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
import { onMounted, ref, watch } from 'vue';
|
|
34
34
|
import { TableProps } from './interface';
|
|
35
35
|
import classNames from 'classnames';
|
|
36
|
-
import { Size,
|
|
36
|
+
import { Size, TableSizeUtils } from '@/types';
|
|
37
37
|
import createFuzzySearch from '@nozbe/microfuzz'
|
|
38
38
|
|
|
39
39
|
const originalDataSource = ref<T[]>([]);
|
|
@@ -48,7 +48,7 @@ const props = withDefaults(defineProps<TableProps<T>>(), {
|
|
|
48
48
|
pinCols: false,
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
const tableClasses = ref(classNames('table',
|
|
51
|
+
const tableClasses = ref(classNames('table', TableSizeUtils.toClassName(props.size), {
|
|
52
52
|
'table-zebra': props.zebra,
|
|
53
53
|
'table-pin-rows': props.pinRows,
|
|
54
54
|
'table-pin-cols ': props.pinCols,
|
package/src/shims-vue.d.ts
CHANGED
package/src/types/color.ts
CHANGED
|
@@ -1,72 +1,170 @@
|
|
|
1
1
|
export enum Color {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
Primary,
|
|
3
|
+
PrimaryContent,
|
|
4
|
+
Secondary,
|
|
5
|
+
SecondaryContent,
|
|
6
|
+
Accent,
|
|
7
|
+
AccentContent,
|
|
8
|
+
Neutral,
|
|
9
|
+
NeutralContent,
|
|
10
|
+
Base100,
|
|
11
|
+
Base200,
|
|
12
|
+
Base300,
|
|
13
|
+
BaseContent,
|
|
14
|
+
Info,
|
|
15
|
+
InfoContent,
|
|
16
|
+
Success,
|
|
17
|
+
SuccessContent,
|
|
18
|
+
Warning,
|
|
19
|
+
WarningContent,
|
|
20
|
+
Error,
|
|
21
|
+
ErrorContent,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class BackgroundColorUtils {
|
|
25
|
+
public static toClassName(color: Color): string {
|
|
26
|
+
switch (color) {
|
|
27
|
+
case Color.Primary:
|
|
28
|
+
return "bg-primary";
|
|
29
|
+
case Color.PrimaryContent:
|
|
30
|
+
return "bg-primary-content";
|
|
31
|
+
case Color.Secondary:
|
|
32
|
+
return "bg-secondary";
|
|
33
|
+
case Color.SecondaryContent:
|
|
34
|
+
return "bg-secondary-content";
|
|
35
|
+
case Color.Accent:
|
|
36
|
+
return "bg-accent";
|
|
37
|
+
case Color.AccentContent:
|
|
38
|
+
return "bg-accent-content";
|
|
39
|
+
case Color.Neutral:
|
|
40
|
+
return "bg-neutral";
|
|
41
|
+
case Color.NeutralContent:
|
|
42
|
+
return "bg-neutral-content";
|
|
43
|
+
case Color.Base100:
|
|
44
|
+
return "base-100";
|
|
45
|
+
case Color.Base200:
|
|
46
|
+
return "bg-base-200";
|
|
47
|
+
case Color.Base300:
|
|
48
|
+
return "bg-base-300";
|
|
49
|
+
case Color.BaseContent:
|
|
50
|
+
return "bg-base-content";
|
|
51
|
+
case Color.Info:
|
|
52
|
+
return "bg-info";
|
|
53
|
+
case Color.InfoContent:
|
|
54
|
+
return "bg-info-content";
|
|
55
|
+
case Color.Success:
|
|
56
|
+
return "bg-success";
|
|
57
|
+
case Color.SuccessContent:
|
|
58
|
+
return "bg-success-content";
|
|
59
|
+
case Color.Warning:
|
|
60
|
+
return "bg-warning";
|
|
61
|
+
case Color.WarningContent:
|
|
62
|
+
return "bg-warning-content";
|
|
63
|
+
case Color.Error:
|
|
64
|
+
return "bg-error";
|
|
65
|
+
case Color.ErrorContent:
|
|
66
|
+
return "bg-error-content";
|
|
67
|
+
default:
|
|
68
|
+
return "bg-base-content";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export class ButtonColorUtils {
|
|
74
|
+
public static toClassName(color: Color): string {
|
|
75
|
+
switch (color) {
|
|
76
|
+
case Color.Primary:
|
|
77
|
+
return "btn-primary";
|
|
78
|
+
case Color.PrimaryContent:
|
|
79
|
+
return "btn-primary-content";
|
|
80
|
+
case Color.Secondary:
|
|
81
|
+
return "btn-secondary";
|
|
82
|
+
case Color.SecondaryContent:
|
|
83
|
+
return "btn-secondary-content";
|
|
84
|
+
case Color.Accent:
|
|
85
|
+
return "btn-accent";
|
|
86
|
+
case Color.AccentContent:
|
|
87
|
+
return "btn-accent-content";
|
|
88
|
+
case Color.Neutral:
|
|
89
|
+
return "btn-neutral";
|
|
90
|
+
case Color.NeutralContent:
|
|
91
|
+
return "btn-neutral-content";
|
|
92
|
+
case Color.Base100:
|
|
93
|
+
return "base-100";
|
|
94
|
+
case Color.Base200:
|
|
95
|
+
return "btn-base-200";
|
|
96
|
+
case Color.Base300:
|
|
97
|
+
return "btn-base-300";
|
|
98
|
+
case Color.BaseContent:
|
|
99
|
+
return "btn-base-content";
|
|
100
|
+
case Color.Info:
|
|
101
|
+
return "btn-info";
|
|
102
|
+
case Color.InfoContent:
|
|
103
|
+
return "btn-info-content";
|
|
104
|
+
case Color.Success:
|
|
105
|
+
return "btn-success";
|
|
106
|
+
case Color.SuccessContent:
|
|
107
|
+
return "btn-success-content";
|
|
108
|
+
case Color.Warning:
|
|
109
|
+
return "btn-warning";
|
|
110
|
+
case Color.WarningContent:
|
|
111
|
+
return "btn-warning-content";
|
|
112
|
+
case Color.Error:
|
|
113
|
+
return "btn-error";
|
|
114
|
+
case Color.ErrorContent:
|
|
115
|
+
return "btn-error-content";
|
|
116
|
+
default:
|
|
117
|
+
return "btn-base-content";
|
|
118
|
+
}
|
|
22
119
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export class TextColorUtils {
|
|
123
|
+
public static toClassName(color: Color): string {
|
|
124
|
+
switch (color) {
|
|
125
|
+
case Color.Primary:
|
|
126
|
+
return "text-primary";
|
|
127
|
+
case Color.PrimaryContent:
|
|
128
|
+
return "text-primary-content";
|
|
129
|
+
case Color.Secondary:
|
|
130
|
+
return "text-secondary";
|
|
131
|
+
case Color.SecondaryContent:
|
|
132
|
+
return "text-secondary-content";
|
|
133
|
+
case Color.Accent:
|
|
134
|
+
return "text-accent";
|
|
135
|
+
case Color.AccentContent:
|
|
136
|
+
return "text-accent-content";
|
|
137
|
+
case Color.Neutral:
|
|
138
|
+
return "text-neutral";
|
|
139
|
+
case Color.NeutralContent:
|
|
140
|
+
return "text-neutral-content";
|
|
141
|
+
case Color.Base100:
|
|
142
|
+
return "base-100";
|
|
143
|
+
case Color.Base200:
|
|
144
|
+
return "text-base-200";
|
|
145
|
+
case Color.Base300:
|
|
146
|
+
return "text-base-300";
|
|
147
|
+
case Color.BaseContent:
|
|
148
|
+
return "text-base-content";
|
|
149
|
+
case Color.Info:
|
|
150
|
+
return "text-info";
|
|
151
|
+
case Color.InfoContent:
|
|
152
|
+
return "text-info-content";
|
|
153
|
+
case Color.Success:
|
|
154
|
+
return "text-success";
|
|
155
|
+
case Color.SuccessContent:
|
|
156
|
+
return "text-success-content";
|
|
157
|
+
case Color.Warning:
|
|
158
|
+
return "text-warning";
|
|
159
|
+
case Color.WarningContent:
|
|
160
|
+
return "text-warning-content";
|
|
161
|
+
case Color.Error:
|
|
162
|
+
return "text-error";
|
|
163
|
+
case Color.ErrorContent:
|
|
164
|
+
return "text-error-content";
|
|
165
|
+
default:
|
|
166
|
+
return "text-base-content";
|
|
70
167
|
}
|
|
71
168
|
}
|
|
72
|
-
|
|
169
|
+
}
|
|
170
|
+
|