dendelion-ui 0.0.1 → 0.0.2
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 +153 -143
- package/dist/dendelion-ui.umd.js +2 -2
- package/dist/types/components/modal/Modal.vue.d.ts +1 -0
- package/dist/types/components/modal/interface.d.ts +1 -0
- package/package.json +72 -72
- package/src/components/button/Button.vue +9 -1
- package/src/components/modal/Modal.vue +9 -3
- package/src/components/modal/interface.ts +1 -0
package/dist/dendelion-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue");var p=(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))(p||{});class m{static toClassName(n){switch(n){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 h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}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
|
|
5
|
+
*/var _;function x(){return _||(_=1,function(e){(function(){var n={}.hasOwnProperty;function s(){for(var a="",c=0;c<arguments.length;c++){var l=arguments[c];l&&(a=o(a,r(l)))}return a}function r(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return s.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var c="";for(var l in a)n.call(a,l)&&a[l]&&(c=o(c,l));return c}function o(a,c){return c?a?a+" "+c:a+c:a}e.exports?(s.default=s,e.exports=s):window.classNames=s})()}(f)),f.exports}var S=x();const d=h(S),k=["type"],w={class:"group-[.is-loading]:text-transparent"},$=t.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:p.Neutral},click:{}},setup(e){const n=e,s=t.ref(d("btn","group",`btn-${m.toClassName(n.color)}`,n.loading?"is-loading":""));return t.watch(()=>n.loading,r=>{s.value=d("btn","group",`btn-${m.toClassName(n.color)}`,r?"is-loading":"")}),(r,o)=>(t.openBlock(),t.createElementBlock("button",{onClick:o[0]||(o[0]=(...a)=>r.click&&r.click(...a)),class:t.normalizeClass(s.value),type:r.type},[o[1]||(o[1]=t.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),t.createElementVNode("span",w,[t.renderSlot(r.$slots,"default")])],10,k))}});var b=(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))(b||{});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 C=t.defineComponent({__name:"Card",props:{backgroundColor:{default:p.Primary},shadow:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},rounded:{type:Boolean},roundedSize:{}},setup(e){const n=e,s=t.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(r,o)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(s.value)},[t.renderSlot(r.$slots,"default")],2))}}),y=(e,n)=>{const s=e.__vccOpts||e;for(const[r,o]of n)s[r]=o;return s},N={},E={class:"card-body"};function M(e,n){return t.openBlock(),t.createElementBlock("div",E,[t.renderSlot(e.$slots,"default")])}const L=y(N,[["render",M]]),P=t.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(e){return(n,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.is),{class:"card-title"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.text),1)]),_:1}))}}),V=t.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(e){const n=e,s=t.ref([n.container?"container":"",n.padding?"p-6":""]);return(r,o)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(s.value)},[t.renderSlot(r.$slots,"default")],2))}}),T=t.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(e){const n=t.ref(null),s=e,r=t.ref(d("table",`table-${g.toClassName(s.size)}`,{"table-zebra":s.zebra,"table-pin-rows":s.pinRows,"table-pin-cols ":s.pinCols}));return(o,a)=>(t.openBlock(),t.createElementBlock("table",{ref_key:"table",ref:n,class:t.normalizeClass(r.value)},null,2))}}),j=t.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(e,{expose:n,emit:s}){const r=e,o=t.ref(r.value),a=s,c=l=>{o.value=l,a("update:value",l)};return t.provide("stepper",{value:o,updateValue:c}),t.watch(()=>r.value,l=>{o.value=l}),n({updateValue:c}),(l,v)=>t.renderSlot(l.$slots,"default",{updateValue:c})}}),O=t.defineComponent({__name:"Step",props:{value:{}},setup(e){const n=e,s=t.inject("stepper"),r=t.ref("");return t.watch(()=>s==null?void 0:s.value.value,o=>{o&&n.value&&(r.value=Number(o)>=Number(n.value)?"step-primary":"")}),t.onMounted(()=>{s&&(r.value=s.value.value===n.value?"step-primary":"",Number(s.value.value)>=Number(n.value)&&(r.value="step-primary"))}),(o,a)=>(t.openBlock(),t.createElementBlock("li",{class:t.normalizeClass(["step",r.value])},[t.renderSlot(o.$slots,"default")],2))}}),W={},X={class:"steps"};function A(e,n){return t.openBlock(),t.createElementBlock("ul",X,[t.renderSlot(e.$slots,"default")])}const D=y(W,[["render",A]]),z={key:0},R=t.defineComponent({__name:"StepPanels",setup(e){const n=t.inject("stepper");return(s,r)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>{var o,a;return[(o=t.unref(n))!=null&&o.value?(t.openBlock(),t.createElementBlock("div",z,[t.renderSlot(s.$slots,"default",{currentStep:(a=t.unref(n))==null?void 0:a.value})])):t.createCommentVNode("",!0)]}),_:3}))}}),I={key:0},U=t.defineComponent({__name:"StepPanel",props:{value:{}},setup(e,{expose:n}){const s=t.computed(()=>r==null?void 0:r.value.value),r=t.inject("stepper"),o=a=>{r&&r.updateValue(a.toString())};return n({activateCallback:o}),(a,c)=>a.value===s.value?(t.openBlock(),t.createElementBlock("div",I,[t.renderSlot(a.$slots,"default",{activateCallback:o})])):t.createCommentVNode("",!0)}}),q={className:"modal-box"},G={key:0,method:"dialog"},H=t.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1}},emits:["close"],setup(e,{expose:n,emit:s}){const r=t.ref(null),o=s,a=e,c=t.ref(d("modal",{"overflow-visible":a.overflow}));return n({showModal:()=>{var u;(u=r.value)==null||u.showModal()},closeModal:()=>{var u;(u=r.value)==null||u.close()}}),(u,i)=>(t.openBlock(),t.createElementBlock("dialog",{ref_key:"modal",ref:r,class:t.normalizeClass(c.value),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:i[0]||(i[0]=B=>o("close",B))},[t.createElementVNode("div",q,[u.closeButton?(t.openBlock(),t.createElementBlock("form",G,i[1]||(i[1]=[t.createElementVNode("button",{className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2"},"✕",-1)]))):t.createCommentVNode("",!0),t.renderSlot(u.$slots,"default")])],34))}}),F=["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=$;exports.Card=C;exports.CardBody=L;exports.CardTitle=P;exports.Color=p;exports.ColorUtils=m;exports.Container=V;exports.Modal=H;exports.Size=b;exports.SizeUtils=g;exports.Step=O;exports.StepList=D;exports.StepPanel=U;exports.StepPanels=R;exports.Stepper=j;exports.Table=T;exports.dendelionSafeList=F;
|
package/dist/dendelion-ui.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var
|
|
3
|
-
class
|
|
1
|
+
import { defineComponent as i, ref as p, watch as v, openBlock as u, createElementBlock as l, normalizeClass as b, createElementVNode as g, renderSlot as d, createBlock as N, resolveDynamicComponent as T, withCtx as k, createTextVNode as C, toDisplayString as O, provide as W, inject as x, onMounted as X, Transition as V, unref as w, createCommentVNode as h, computed as j } from "vue";
|
|
2
|
+
var $ = /* @__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))($ || {});
|
|
3
|
+
class B {
|
|
4
4
|
static toClassName(t) {
|
|
5
5
|
switch (t) {
|
|
6
6
|
case 0:
|
|
@@ -48,79 +48,86 @@ class C {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function A(e) {
|
|
52
52
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
53
53
|
}
|
|
54
|
-
var
|
|
54
|
+
var y = { 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 S;
|
|
61
|
+
function D() {
|
|
62
|
+
return S || (S = 1, function(e) {
|
|
63
63
|
(function() {
|
|
64
64
|
var t = {}.hasOwnProperty;
|
|
65
|
-
function
|
|
66
|
-
for (var
|
|
67
|
-
var
|
|
68
|
-
|
|
65
|
+
function n() {
|
|
66
|
+
for (var s = "", o = 0; o < arguments.length; o++) {
|
|
67
|
+
var c = arguments[o];
|
|
68
|
+
c && (s = r(s, a(c)));
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return s;
|
|
71
71
|
}
|
|
72
|
-
function a(
|
|
73
|
-
if (typeof
|
|
74
|
-
return
|
|
75
|
-
if (typeof
|
|
72
|
+
function a(s) {
|
|
73
|
+
if (typeof s == "string" || typeof s == "number")
|
|
74
|
+
return s;
|
|
75
|
+
if (typeof s != "object")
|
|
76
76
|
return "";
|
|
77
|
-
if (Array.isArray(
|
|
78
|
-
return
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
81
|
-
var
|
|
82
|
-
for (var
|
|
83
|
-
t.call(
|
|
84
|
-
return
|
|
77
|
+
if (Array.isArray(s))
|
|
78
|
+
return n.apply(null, s);
|
|
79
|
+
if (s.toString !== Object.prototype.toString && !s.toString.toString().includes("[native code]"))
|
|
80
|
+
return s.toString();
|
|
81
|
+
var o = "";
|
|
82
|
+
for (var c in s)
|
|
83
|
+
t.call(s, c) && s[c] && (o = r(o, c));
|
|
84
|
+
return o;
|
|
85
85
|
}
|
|
86
|
-
function r(
|
|
87
|
-
return
|
|
86
|
+
function r(s, o) {
|
|
87
|
+
return o ? s ? s + " " + o : s + o : s;
|
|
88
88
|
}
|
|
89
|
-
e.exports ? (
|
|
89
|
+
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
90
90
|
})();
|
|
91
|
-
}(
|
|
91
|
+
}(y)), y.exports;
|
|
92
92
|
}
|
|
93
|
-
var
|
|
94
|
-
const
|
|
93
|
+
var R = D();
|
|
94
|
+
const m = /* @__PURE__ */ A(R), I = ["type"], q = { class: "group-[.is-loading]:text-transparent" }, ne = /* @__PURE__ */ i({
|
|
95
95
|
__name: "Button",
|
|
96
96
|
props: {
|
|
97
97
|
type: { default: "button" },
|
|
98
98
|
loading: { type: Boolean },
|
|
99
|
-
color: { default:
|
|
99
|
+
color: { default: $.Neutral },
|
|
100
100
|
click: {}
|
|
101
101
|
},
|
|
102
102
|
setup(e) {
|
|
103
|
-
const t = e,
|
|
103
|
+
const t = e, n = p(m(
|
|
104
104
|
"btn",
|
|
105
105
|
"group",
|
|
106
|
-
`btn-${
|
|
106
|
+
`btn-${B.toClassName(t.color)}`,
|
|
107
107
|
t.loading ? "is-loading" : ""
|
|
108
108
|
));
|
|
109
|
-
return (
|
|
109
|
+
return v(() => t.loading, (a) => {
|
|
110
|
+
n.value = m(
|
|
111
|
+
"btn",
|
|
112
|
+
"group",
|
|
113
|
+
`btn-${B.toClassName(t.color)}`,
|
|
114
|
+
a ? "is-loading" : ""
|
|
115
|
+
);
|
|
116
|
+
}), (a, r) => (u(), l("button", {
|
|
110
117
|
onClick: r[0] || (r[0] = //@ts-ignore
|
|
111
|
-
(...
|
|
112
|
-
class: b(
|
|
118
|
+
(...s) => a.click && a.click(...s)),
|
|
119
|
+
class: b(n.value),
|
|
113
120
|
type: a.type
|
|
114
121
|
}, [
|
|
115
|
-
r[1] || (r[1] =
|
|
116
|
-
|
|
117
|
-
|
|
122
|
+
r[1] || (r[1] = g("span", { class: "loading loading-spinner loading-md absolute hidden group-[.is-loading]:block" }, null, -1)),
|
|
123
|
+
g("span", q, [
|
|
124
|
+
d(a.$slots, "default")
|
|
118
125
|
])
|
|
119
|
-
], 10,
|
|
126
|
+
], 10, I));
|
|
120
127
|
}
|
|
121
128
|
});
|
|
122
|
-
var
|
|
123
|
-
class
|
|
129
|
+
var M = /* @__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))(M || {});
|
|
130
|
+
class G {
|
|
124
131
|
static toClassName(t) {
|
|
125
132
|
switch (t) {
|
|
126
133
|
case 0:
|
|
@@ -142,17 +149,17 @@ class I {
|
|
|
142
149
|
}
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
|
-
const
|
|
152
|
+
const se = /* @__PURE__ */ i({
|
|
146
153
|
__name: "Card",
|
|
147
154
|
props: {
|
|
148
|
-
backgroundColor: { default:
|
|
155
|
+
backgroundColor: { default: $.Primary },
|
|
149
156
|
shadow: { type: Boolean, default: !1 },
|
|
150
157
|
fullWidth: { type: Boolean, default: !1 },
|
|
151
158
|
rounded: { type: Boolean },
|
|
152
159
|
roundedSize: {}
|
|
153
160
|
},
|
|
154
161
|
setup(e) {
|
|
155
|
-
const t = e,
|
|
162
|
+
const t = e, n = p(m(
|
|
156
163
|
"card",
|
|
157
164
|
`bg-${t.backgroundColor}`,
|
|
158
165
|
t.shadow ? "shadow-lg" : "",
|
|
@@ -160,193 +167,196 @@ const te = /* @__PURE__ */ d({
|
|
|
160
167
|
t.rounded && !t.roundedSize ? "rounded" : t.roundedSize ? `rounded-${t.roundedSize}` : ""
|
|
161
168
|
));
|
|
162
169
|
return (a, r) => (u(), l("div", {
|
|
163
|
-
class: b(
|
|
170
|
+
class: b(n.value)
|
|
164
171
|
}, [
|
|
165
|
-
|
|
172
|
+
d(a.$slots, "default")
|
|
166
173
|
], 2));
|
|
167
174
|
}
|
|
168
|
-
}),
|
|
169
|
-
const
|
|
175
|
+
}), E = (e, t) => {
|
|
176
|
+
const n = e.__vccOpts || e;
|
|
170
177
|
for (const [a, r] of t)
|
|
171
|
-
|
|
172
|
-
return
|
|
173
|
-
},
|
|
174
|
-
function
|
|
175
|
-
return u(), l("div",
|
|
176
|
-
|
|
178
|
+
n[a] = r;
|
|
179
|
+
return n;
|
|
180
|
+
}, H = {}, U = { class: "card-body" };
|
|
181
|
+
function F(e, t) {
|
|
182
|
+
return u(), l("div", U, [
|
|
183
|
+
d(e.$slots, "default")
|
|
177
184
|
]);
|
|
178
185
|
}
|
|
179
|
-
const
|
|
186
|
+
const ae = /* @__PURE__ */ E(H, [["render", F]]), re = /* @__PURE__ */ i({
|
|
180
187
|
__name: "CardTitle",
|
|
181
188
|
props: {
|
|
182
189
|
is: { default: "h1" },
|
|
183
190
|
text: { default: "" }
|
|
184
191
|
},
|
|
185
192
|
setup(e) {
|
|
186
|
-
return (t,
|
|
187
|
-
default:
|
|
188
|
-
|
|
193
|
+
return (t, n) => (u(), N(T(t.is), { class: "card-title" }, {
|
|
194
|
+
default: k(() => [
|
|
195
|
+
C(O(t.text), 1)
|
|
189
196
|
]),
|
|
190
197
|
_: 1
|
|
191
198
|
}));
|
|
192
199
|
}
|
|
193
|
-
}),
|
|
200
|
+
}), oe = /* @__PURE__ */ i({
|
|
194
201
|
__name: "Container",
|
|
195
202
|
props: {
|
|
196
203
|
container: { type: Boolean, default: !0 },
|
|
197
204
|
padding: { type: Boolean, default: !0 }
|
|
198
205
|
},
|
|
199
206
|
setup(e) {
|
|
200
|
-
const t = e,
|
|
207
|
+
const t = e, n = p([
|
|
201
208
|
t.container ? "container" : "",
|
|
202
209
|
//To disable the max width in some cases
|
|
203
210
|
t.padding ? "p-6" : ""
|
|
204
211
|
]);
|
|
205
212
|
return (a, r) => (u(), l("div", {
|
|
206
|
-
class: b(
|
|
213
|
+
class: b(n.value)
|
|
207
214
|
}, [
|
|
208
|
-
|
|
215
|
+
d(a.$slots, "default")
|
|
209
216
|
], 2));
|
|
210
217
|
}
|
|
211
|
-
}),
|
|
218
|
+
}), ce = /* @__PURE__ */ i({
|
|
212
219
|
__name: "Table",
|
|
213
220
|
props: {
|
|
214
221
|
zebra: { type: Boolean, default: !1 },
|
|
215
222
|
pinRows: { type: Boolean, default: !1 },
|
|
216
223
|
pinCols: { type: Boolean, default: !1 },
|
|
217
|
-
size: { default:
|
|
224
|
+
size: { default: M.MD },
|
|
218
225
|
columns: {},
|
|
219
226
|
dataSource: {},
|
|
220
227
|
ajax: {}
|
|
221
228
|
},
|
|
222
229
|
setup(e) {
|
|
223
|
-
const t = p(null),
|
|
224
|
-
"table-zebra":
|
|
225
|
-
"table-pin-rows":
|
|
226
|
-
"table-pin-cols ":
|
|
230
|
+
const t = p(null), n = e, a = p(m("table", `table-${G.toClassName(n.size)}`, {
|
|
231
|
+
"table-zebra": n.zebra,
|
|
232
|
+
"table-pin-rows": n.pinRows,
|
|
233
|
+
"table-pin-cols ": n.pinCols
|
|
227
234
|
}));
|
|
228
|
-
return (r,
|
|
235
|
+
return (r, s) => (u(), l("table", {
|
|
229
236
|
ref_key: "table",
|
|
230
237
|
ref: t,
|
|
231
238
|
class: b(a.value)
|
|
232
239
|
}, null, 2));
|
|
233
240
|
}
|
|
234
|
-
}),
|
|
241
|
+
}), ue = /* @__PURE__ */ i({
|
|
235
242
|
__name: "Stepper",
|
|
236
243
|
props: {
|
|
237
244
|
value: {}
|
|
238
245
|
},
|
|
239
246
|
emits: ["update:value"],
|
|
240
|
-
setup(e, { expose: t, emit:
|
|
241
|
-
const a = e, r = p(a.value),
|
|
242
|
-
r.value =
|
|
247
|
+
setup(e, { expose: t, emit: n }) {
|
|
248
|
+
const a = e, r = p(a.value), s = n, o = (c) => {
|
|
249
|
+
r.value = c, s("update:value", c);
|
|
243
250
|
};
|
|
244
|
-
return
|
|
251
|
+
return W("stepper", {
|
|
245
252
|
value: r,
|
|
246
|
-
updateValue:
|
|
247
|
-
}),
|
|
248
|
-
r.value =
|
|
253
|
+
updateValue: o
|
|
254
|
+
}), v(() => a.value, (c) => {
|
|
255
|
+
r.value = c;
|
|
249
256
|
}), t({
|
|
250
|
-
updateValue:
|
|
251
|
-
}), (
|
|
257
|
+
updateValue: o
|
|
258
|
+
}), (c, P) => d(c.$slots, "default", { updateValue: o });
|
|
252
259
|
}
|
|
253
|
-
}),
|
|
260
|
+
}), le = /* @__PURE__ */ i({
|
|
254
261
|
__name: "Step",
|
|
255
262
|
props: {
|
|
256
263
|
value: {}
|
|
257
264
|
},
|
|
258
265
|
setup(e) {
|
|
259
|
-
const t = e,
|
|
260
|
-
return
|
|
266
|
+
const t = e, n = x("stepper"), a = p("");
|
|
267
|
+
return v(() => n == null ? void 0 : n.value.value, (r) => {
|
|
261
268
|
r && t.value && (a.value = Number(r) >= Number(t.value) ? "step-primary" : "");
|
|
262
|
-
}),
|
|
263
|
-
|
|
264
|
-
}), (r,
|
|
269
|
+
}), X(() => {
|
|
270
|
+
n && (a.value = n.value.value === t.value ? "step-primary" : "", Number(n.value.value) >= Number(t.value) && (a.value = "step-primary"));
|
|
271
|
+
}), (r, s) => (u(), l("li", {
|
|
265
272
|
class: b(["step", a.value])
|
|
266
273
|
}, [
|
|
267
|
-
|
|
274
|
+
d(r.$slots, "default")
|
|
268
275
|
], 2));
|
|
269
276
|
}
|
|
270
|
-
}),
|
|
271
|
-
function
|
|
272
|
-
return u(), l("ul",
|
|
273
|
-
|
|
277
|
+
}), J = {}, K = { class: "steps" };
|
|
278
|
+
function Q(e, t) {
|
|
279
|
+
return u(), l("ul", K, [
|
|
280
|
+
d(e.$slots, "default")
|
|
274
281
|
]);
|
|
275
282
|
}
|
|
276
|
-
const
|
|
283
|
+
const ie = /* @__PURE__ */ E(J, [["render", Q]]), Y = { key: 0 }, de = /* @__PURE__ */ i({
|
|
277
284
|
__name: "StepPanels",
|
|
278
285
|
setup(e) {
|
|
279
|
-
const t =
|
|
280
|
-
return (
|
|
286
|
+
const t = x("stepper");
|
|
287
|
+
return (n, a) => (u(), N(V, {
|
|
281
288
|
name: "fade",
|
|
282
289
|
mode: "out-in"
|
|
283
290
|
}, {
|
|
284
|
-
default:
|
|
285
|
-
var r,
|
|
291
|
+
default: k(() => {
|
|
292
|
+
var r, s;
|
|
286
293
|
return [
|
|
287
|
-
(r =
|
|
288
|
-
|
|
289
|
-
currentStep: (
|
|
294
|
+
(r = w(t)) != null && r.value ? (u(), l("div", Y, [
|
|
295
|
+
d(n.$slots, "default", {
|
|
296
|
+
currentStep: (s = w(t)) == null ? void 0 : s.value
|
|
290
297
|
})
|
|
291
|
-
])) :
|
|
298
|
+
])) : h("", !0)
|
|
292
299
|
];
|
|
293
300
|
}),
|
|
294
301
|
_: 3
|
|
295
302
|
}));
|
|
296
303
|
}
|
|
297
|
-
}),
|
|
304
|
+
}), Z = { key: 0 }, pe = /* @__PURE__ */ i({
|
|
298
305
|
__name: "StepPanel",
|
|
299
306
|
props: {
|
|
300
307
|
value: {}
|
|
301
308
|
},
|
|
302
309
|
setup(e, { expose: t }) {
|
|
303
|
-
const
|
|
304
|
-
a && a.updateValue(
|
|
310
|
+
const n = j(() => a == null ? void 0 : a.value.value), a = x("stepper"), r = (s) => {
|
|
311
|
+
a && a.updateValue(s.toString());
|
|
305
312
|
};
|
|
306
313
|
return t({
|
|
307
314
|
activateCallback: r
|
|
308
|
-
}), (
|
|
309
|
-
|
|
310
|
-
])) :
|
|
315
|
+
}), (s, o) => s.value === n.value ? (u(), l("div", Z, [
|
|
316
|
+
d(s.$slots, "default", { activateCallback: r })
|
|
317
|
+
])) : h("", !0);
|
|
311
318
|
}
|
|
312
|
-
}),
|
|
319
|
+
}), z = { className: "modal-box" }, ee = {
|
|
313
320
|
key: 0,
|
|
314
321
|
method: "dialog"
|
|
315
|
-
},
|
|
322
|
+
}, fe = /* @__PURE__ */ i({
|
|
316
323
|
__name: "Modal",
|
|
317
324
|
props: {
|
|
318
|
-
closeButton: { type: Boolean, default: !0 }
|
|
325
|
+
closeButton: { type: Boolean, default: !0 },
|
|
326
|
+
overflow: { type: Boolean, default: !1 }
|
|
319
327
|
},
|
|
320
328
|
emits: ["close"],
|
|
321
|
-
setup(e, { expose: t, emit:
|
|
322
|
-
const a = p(null), r =
|
|
329
|
+
setup(e, { expose: t, emit: n }) {
|
|
330
|
+
const a = p(null), r = n, o = p(m("modal", {
|
|
331
|
+
"overflow-visible": e.overflow
|
|
332
|
+
}));
|
|
323
333
|
return t({
|
|
324
334
|
showModal: () => {
|
|
325
|
-
var
|
|
326
|
-
(
|
|
335
|
+
var f;
|
|
336
|
+
(f = a.value) == null || f.showModal();
|
|
327
337
|
},
|
|
328
338
|
closeModal: () => {
|
|
329
|
-
var
|
|
330
|
-
(
|
|
339
|
+
var f;
|
|
340
|
+
(f = a.value) == null || f.close();
|
|
331
341
|
}
|
|
332
|
-
}), (
|
|
342
|
+
}), (f, _) => (u(), l("dialog", {
|
|
333
343
|
ref_key: "modal",
|
|
334
344
|
ref: a,
|
|
335
|
-
class:
|
|
345
|
+
class: b(o.value),
|
|
336
346
|
"aria-modal": "true",
|
|
337
347
|
"aria-hidden": "true",
|
|
338
348
|
role: "dialog",
|
|
339
|
-
onClose:
|
|
349
|
+
onClose: _[0] || (_[0] = (L) => r("close", L))
|
|
340
350
|
}, [
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
]))) :
|
|
345
|
-
|
|
351
|
+
g("div", z, [
|
|
352
|
+
f.closeButton ? (u(), l("form", ee, _[1] || (_[1] = [
|
|
353
|
+
g("button", { className: "btn btn-sm btn-circle btn-ghost absolute right-2 top-2" }, "✕", -1)
|
|
354
|
+
]))) : h("", !0),
|
|
355
|
+
d(f.$slots, "default")
|
|
346
356
|
])
|
|
347
|
-
],
|
|
357
|
+
], 34));
|
|
348
358
|
}
|
|
349
|
-
}),
|
|
359
|
+
}), be = [
|
|
350
360
|
"bg-primary",
|
|
351
361
|
"bg-primary-content",
|
|
352
362
|
"bg-secondary",
|
|
@@ -432,21 +442,21 @@ const ue = /* @__PURE__ */ k(U, [["render", J]]), K = { key: 0 }, le = /* @__PUR
|
|
|
432
442
|
"block"
|
|
433
443
|
];
|
|
434
444
|
export {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
445
|
+
ne as Button,
|
|
446
|
+
se as Card,
|
|
447
|
+
ae as CardBody,
|
|
448
|
+
re as CardTitle,
|
|
449
|
+
$ as Color,
|
|
450
|
+
B as ColorUtils,
|
|
451
|
+
oe as Container,
|
|
452
|
+
fe as Modal,
|
|
453
|
+
M as Size,
|
|
454
|
+
G as SizeUtils,
|
|
455
|
+
le as Step,
|
|
456
|
+
ie as StepList,
|
|
457
|
+
pe as StepPanel,
|
|
458
|
+
de as StepPanels,
|
|
459
|
+
ue as Stepper,
|
|
460
|
+
ce as Table,
|
|
461
|
+
be as dendelionSafeList
|
|
452
462
|
};
|
package/dist/dendelion-ui.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(c,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(c=typeof globalThis<"u"?globalThis:c||self,t(c.DendelionUI={},c.Vue))})(this,function(c,t){"use strict";var
|
|
1
|
+
(function(c,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(c=typeof globalThis<"u"?globalThis:c||self,t(c.DendelionUI={},c.Vue))})(this,function(c,t){"use strict";var p=(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))(p||{});class m{static toClassName(n){switch(n){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 h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var b={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
|
|
5
|
+
*/var y;function S(){return y||(y=1,function(e){(function(){var n={}.hasOwnProperty;function s(){for(var a="",l=0;l<arguments.length;l++){var i=arguments[l];i&&(a=o(a,r(i)))}return a}function r(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return s.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var l="";for(var i in a)n.call(a,i)&&a[i]&&(l=o(l,i));return l}function o(a,l){return l?a?a+" "+l:a+l:a}e.exports?(s.default=s,e.exports=s):window.classNames=s})()}(b)),b.exports}var k=S();const u=h(k),w=["type"],$={class:"group-[.is-loading]:text-transparent"},C=t.defineComponent({__name:"Button",props:{type:{default:"button"},loading:{type:Boolean},color:{default:p.Neutral},click:{}},setup(e){const n=e,s=t.ref(u("btn","group",`btn-${m.toClassName(n.color)}`,n.loading?"is-loading":""));return t.watch(()=>n.loading,r=>{s.value=u("btn","group",`btn-${m.toClassName(n.color)}`,r?"is-loading":"")}),(r,o)=>(t.openBlock(),t.createElementBlock("button",{onClick:o[0]||(o[0]=(...a)=>r.click&&r.click(...a)),class:t.normalizeClass(s.value),type:r.type},[o[1]||(o[1]=t.createElementVNode("span",{class:"loading loading-spinner loading-md absolute hidden group-[.is-loading]:block"},null,-1)),t.createElementVNode("span",$,[t.renderSlot(r.$slots,"default")])],10,w))}});var _=(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))(_||{});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=t.defineComponent({__name:"Card",props:{backgroundColor:{default:p.Primary},shadow:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},rounded:{type:Boolean},roundedSize:{}},setup(e){const n=e,s=t.ref(u("card",`bg-${n.backgroundColor}`,n.shadow?"shadow-lg":"",n.fullWidth?"w-full":"",n.rounded&&!n.roundedSize?"rounded":n.roundedSize?`rounded-${n.roundedSize}`:""));return(r,o)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(s.value)},[t.renderSlot(r.$slots,"default")],2))}}),B=(e,n)=>{const s=e.__vccOpts||e;for(const[r,o]of n)s[r]=o;return s},x={},E={class:"card-body"};function M(e,n){return t.openBlock(),t.createElementBlock("div",E,[t.renderSlot(e.$slots,"default")])}const T=B(x,[["render",M]]),V=t.defineComponent({__name:"CardTitle",props:{is:{default:"h1"},text:{default:""}},setup(e){return(n,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.is),{class:"card-title"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.text),1)]),_:1}))}}),L=t.defineComponent({__name:"Container",props:{container:{type:Boolean,default:!0},padding:{type:Boolean,default:!0}},setup(e){const n=e,s=t.ref([n.container?"container":"",n.padding?"p-6":""]);return(r,o)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(s.value)},[t.renderSlot(r.$slots,"default")],2))}}),P=t.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(e){const n=t.ref(null),s=e,r=t.ref(u("table",`table-${g.toClassName(s.size)}`,{"table-zebra":s.zebra,"table-pin-rows":s.pinRows,"table-pin-cols ":s.pinCols}));return(o,a)=>(t.openBlock(),t.createElementBlock("table",{ref_key:"table",ref:n,class:t.normalizeClass(r.value)},null,2))}}),j=t.defineComponent({__name:"Stepper",props:{value:{}},emits:["update:value"],setup(e,{expose:n,emit:s}){const r=e,o=t.ref(r.value),a=s,l=i=>{o.value=i,a("update:value",i)};return t.provide("stepper",{value:o,updateValue:l}),t.watch(()=>r.value,i=>{o.value=i}),n({updateValue:l}),(i,J)=>t.renderSlot(i.$slots,"default",{updateValue:l})}}),O=t.defineComponent({__name:"Step",props:{value:{}},setup(e){const n=e,s=t.inject("stepper"),r=t.ref("");return t.watch(()=>s==null?void 0:s.value.value,o=>{o&&n.value&&(r.value=Number(o)>=Number(n.value)?"step-primary":"")}),t.onMounted(()=>{s&&(r.value=s.value.value===n.value?"step-primary":"",Number(s.value.value)>=Number(n.value)&&(r.value="step-primary"))}),(o,a)=>(t.openBlock(),t.createElementBlock("li",{class:t.normalizeClass(["step",r.value])},[t.renderSlot(o.$slots,"default")],2))}}),W={},X={class:"steps"};function D(e,n){return t.openBlock(),t.createElementBlock("ul",X,[t.renderSlot(e.$slots,"default")])}const A=B(W,[["render",D]]),z={key:0},I=t.defineComponent({__name:"StepPanels",setup(e){const n=t.inject("stepper");return(s,r)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>{var o,a;return[(o=t.unref(n))!=null&&o.value?(t.openBlock(),t.createElementBlock("div",z,[t.renderSlot(s.$slots,"default",{currentStep:(a=t.unref(n))==null?void 0:a.value})])):t.createCommentVNode("",!0)]}),_:3}))}}),R={key:0},U=t.defineComponent({__name:"StepPanel",props:{value:{}},setup(e,{expose:n}){const s=t.computed(()=>r==null?void 0:r.value.value),r=t.inject("stepper"),o=a=>{r&&r.updateValue(a.toString())};return n({activateCallback:o}),(a,l)=>a.value===s.value?(t.openBlock(),t.createElementBlock("div",R,[t.renderSlot(a.$slots,"default",{activateCallback:o})])):t.createCommentVNode("",!0)}}),q={className:"modal-box"},G={key:0,method:"dialog"},H=t.defineComponent({__name:"Modal",props:{closeButton:{type:Boolean,default:!0},overflow:{type:Boolean,default:!1}},emits:["close"],setup(e,{expose:n,emit:s}){const r=t.ref(null),o=s,a=e,l=t.ref(u("modal",{"overflow-visible":a.overflow}));return n({showModal:()=>{var d;(d=r.value)==null||d.showModal()},closeModal:()=>{var d;(d=r.value)==null||d.close()}}),(d,f)=>(t.openBlock(),t.createElementBlock("dialog",{ref_key:"modal",ref:r,class:t.normalizeClass(l.value),"aria-modal":"true","aria-hidden":"true",role:"dialog",onClose:f[0]||(f[0]=K=>o("close",K))},[t.createElementVNode("div",q,[d.closeButton?(t.openBlock(),t.createElementBlock("form",G,f[1]||(f[1]=[t.createElementVNode("button",{className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2"},"✕",-1)]))):t.createCommentVNode("",!0),t.renderSlot(d.$slots,"default")])],34))}}),F=["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"];c.Button=C,c.Card=N,c.CardBody=T,c.CardTitle=V,c.Color=p,c.ColorUtils=m,c.Container=L,c.Modal=H,c.Size=_,c.SizeUtils=g,c.Step=O,c.StepList=A,c.StepPanel=U,c.StepPanels=I,c.Stepper=j,c.Table=P,c.dendelionSafeList=F,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -19,6 +19,7 @@ declare const __VLS_component: import("vue").DefineComponent<ModalProps, {
|
|
|
19
19
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
20
20
|
}>, {
|
|
21
21
|
closeButton: boolean;
|
|
22
|
+
overflow: boolean;
|
|
22
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {
|
|
23
24
|
modal: HTMLDialogElement;
|
|
24
25
|
}, HTMLDialogElement>;
|
package/package.json
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dendelion-ui",
|
|
3
|
-
"private": false,
|
|
4
|
-
"description": "Simpel component library using Tailwind css and DaisyUI",
|
|
5
|
-
"version": "0.0.
|
|
6
|
-
"author": "ThatzOkay",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"homepage": "https://github.com/ThatzOkay/DendelionUI#readme",
|
|
9
|
-
"repository": {
|
|
10
|
-
"url": "git+https://github.com/ThatzOkay/DendelionUI.git",
|
|
11
|
-
"type": "git"
|
|
12
|
-
},
|
|
13
|
-
"bugs": {
|
|
14
|
-
"url": "https://github.com/ThatzOkay/DendelionUI/issues"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [
|
|
17
|
-
"Tailwind",
|
|
18
|
-
"DaisyUI",
|
|
19
|
-
"Vue",
|
|
20
|
-
"Component",
|
|
21
|
-
"Library"
|
|
22
|
-
],
|
|
23
|
-
"type": "module",
|
|
24
|
-
"files": [
|
|
25
|
-
"dist",
|
|
26
|
-
"src"
|
|
27
|
-
],
|
|
28
|
-
"main": "./dist/apldendelion-uiayer.umd.js",
|
|
29
|
-
"module": "./dist/dendelion-ui.es.js",
|
|
30
|
-
"typings": "./dist/types/index.d.ts",
|
|
31
|
-
"types": "./dist/types/index.d.ts",
|
|
32
|
-
"exports": {
|
|
33
|
-
".": {
|
|
34
|
-
"types": "./dist/types/index.d.ts",
|
|
35
|
-
"import": "./dist/dendelion-ui.es.js",
|
|
36
|
-
"require": "./dist/dendelion-ui.umd.js"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"dev": "cross-env MODE=demo npm run vite",
|
|
41
|
-
"vite": "vite",
|
|
42
|
-
"clean": "rimraf dist",
|
|
43
|
-
"build": "npm run clean && npm run build:lib && npm run build:tsc",
|
|
44
|
-
"build:lib": "cross-env MODE=lib vite build",
|
|
45
|
-
"build:tsc": "vue-tsc --emitDeclarationOnly",
|
|
46
|
-
"build:demo": "cross-env MODE=demo vite build",
|
|
47
|
-
"docs:dev": "vitepress dev docs",
|
|
48
|
-
"docs:build": "vitepress build docs",
|
|
49
|
-
"docs:preview": "vitepress preview docs",
|
|
50
|
-
"lint": "eslint ",
|
|
51
|
-
"lint:fix": "eslint --fix ",
|
|
52
|
-
"preview": "vite preview"
|
|
53
|
-
},
|
|
54
|
-
"dependencies": {
|
|
55
|
-
"classnames": "^2.5.1",
|
|
56
|
-
"vue": "^3.5.13"
|
|
57
|
-
},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"@vitejs/plugin-vue": "^5.2.1",
|
|
60
|
-
"@vue/tsconfig": "^0.7.0",
|
|
61
|
-
"cross-env": "^7.0.3",
|
|
62
|
-
"daisyui": "^4.12.23",
|
|
63
|
-
"eslint": "^9.17.0",
|
|
64
|
-
"eslint-plugin-vue": "^9.32.0",
|
|
65
|
-
"fluid-tailwind": "^1.0.4",
|
|
66
|
-
"rimraf": "^6.0.1",
|
|
67
|
-
"typescript": "~5.
|
|
68
|
-
"typescript-eslint": "^8.19.1",
|
|
69
|
-
"vite": "^6.0.5",
|
|
70
|
-
"vue-tsc": "^2.2.0"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dendelion-ui",
|
|
3
|
+
"private": false,
|
|
4
|
+
"description": "Simpel component library using Tailwind css and DaisyUI",
|
|
5
|
+
"version": "0.0.2",
|
|
6
|
+
"author": "ThatzOkay",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/ThatzOkay/DendelionUI#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"url": "git+https://github.com/ThatzOkay/DendelionUI.git",
|
|
11
|
+
"type": "git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/ThatzOkay/DendelionUI/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"Tailwind",
|
|
18
|
+
"DaisyUI",
|
|
19
|
+
"Vue",
|
|
20
|
+
"Component",
|
|
21
|
+
"Library"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"src"
|
|
27
|
+
],
|
|
28
|
+
"main": "./dist/apldendelion-uiayer.umd.js",
|
|
29
|
+
"module": "./dist/dendelion-ui.es.js",
|
|
30
|
+
"typings": "./dist/types/index.d.ts",
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/types/index.d.ts",
|
|
35
|
+
"import": "./dist/dendelion-ui.es.js",
|
|
36
|
+
"require": "./dist/dendelion-ui.umd.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"dev": "cross-env MODE=demo npm run vite",
|
|
41
|
+
"vite": "vite",
|
|
42
|
+
"clean": "rimraf dist",
|
|
43
|
+
"build": "npm run clean && npm run build:lib && npm run build:tsc",
|
|
44
|
+
"build:lib": "cross-env MODE=lib vite build",
|
|
45
|
+
"build:tsc": "vue-tsc --emitDeclarationOnly",
|
|
46
|
+
"build:demo": "cross-env MODE=demo vite build",
|
|
47
|
+
"docs:dev": "vitepress dev docs",
|
|
48
|
+
"docs:build": "vitepress build docs",
|
|
49
|
+
"docs:preview": "vitepress preview docs",
|
|
50
|
+
"lint": "eslint ",
|
|
51
|
+
"lint:fix": "eslint --fix ",
|
|
52
|
+
"preview": "vite preview"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"classnames": "^2.5.1",
|
|
56
|
+
"vue": "^3.5.13"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
60
|
+
"@vue/tsconfig": "^0.7.0",
|
|
61
|
+
"cross-env": "^7.0.3",
|
|
62
|
+
"daisyui": "^4.12.23",
|
|
63
|
+
"eslint": "^9.17.0",
|
|
64
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
65
|
+
"fluid-tailwind": "^1.0.4",
|
|
66
|
+
"rimraf": "^6.0.1",
|
|
67
|
+
"typescript": "~5.7.0",
|
|
68
|
+
"typescript-eslint": "^8.19.1",
|
|
69
|
+
"vite": "^6.0.5",
|
|
70
|
+
"vue-tsc": "^2.2.0"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { Color, ColorUtils } from '@/types/color';
|
|
10
10
|
import { ButtonProps } from './interface';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
|
-
import { ref } from 'vue';
|
|
12
|
+
import { ref, watch } from 'vue';
|
|
13
13
|
|
|
14
14
|
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
15
15
|
type: 'button',
|
|
@@ -21,4 +21,12 @@ const classes = ref(classNames('btn',
|
|
|
21
21
|
`btn-${ColorUtils.toClassName(props.color)}`,
|
|
22
22
|
props.loading ? 'is-loading' : '',
|
|
23
23
|
))
|
|
24
|
+
|
|
25
|
+
watch(() => props.loading, (loading: boolean) => {
|
|
26
|
+
classes.value = classNames('btn',
|
|
27
|
+
'group',
|
|
28
|
+
`btn-${ColorUtils.toClassName(props.color)}`,
|
|
29
|
+
loading ? 'is-loading' : '',
|
|
30
|
+
)
|
|
31
|
+
})
|
|
24
32
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<dialog ref="modal" class="
|
|
2
|
+
<dialog ref="modal" :class="classes" aria-modal="true" aria-hidden="true" role="dialog" @close="(e) => emit('close', e)" >
|
|
3
3
|
<div className="modal-box">
|
|
4
4
|
<form v-if="closeButton" method="dialog">
|
|
5
5
|
<button className="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">✕</button>
|
|
@@ -12,14 +12,20 @@
|
|
|
12
12
|
<script setup lang="ts">
|
|
13
13
|
import { ref } from 'vue';
|
|
14
14
|
import { ModalProps } from './interface';
|
|
15
|
+
import classNames from 'classnames';
|
|
15
16
|
|
|
16
17
|
const modal = ref<HTMLDialogElement | null>(null);
|
|
17
18
|
|
|
18
19
|
const emit = defineEmits(['close']);
|
|
19
20
|
|
|
20
|
-
withDefaults(defineProps<ModalProps>(), {
|
|
21
|
+
const props = withDefaults(defineProps<ModalProps>(), {
|
|
21
22
|
closeButton: true,
|
|
22
|
-
|
|
23
|
+
overflow: false
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const classes = ref(classNames('modal', {
|
|
27
|
+
'overflow-visible': props.overflow
|
|
28
|
+
}));
|
|
23
29
|
|
|
24
30
|
const showModal = () => {
|
|
25
31
|
modal.value?.showModal();
|