@oneb/ui-vue 0.0.10 → 0.0.12

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.
@@ -25,32 +25,32 @@ const q = {
25
25
  }, j = /* @__PURE__ */ x({
26
26
  __name: "OneDropdown",
27
27
  props: q,
28
- emits: ["open"],
28
+ emits: ["open", "close"],
29
29
  setup(p, { emit: s }) {
30
- const u = p, c = $(!1), o = $(null), r = () => {
31
- c.value = !c.value, c.value && s("open");
30
+ const u = p, c = $(!1), n = $(null), r = () => {
31
+ c.value = !c.value, c.value ? s("open") : s("close");
32
32
  };
33
33
  B("OneDropdown", {
34
34
  onToggle: r
35
35
  });
36
36
  const t = w(() => {
37
- const n = o.value != null && o.value.offsetLeft < 270;
38
- return o.value != null && o.value.offsetTop + 270 > window.innerHeight ? "up" + (n ? "-right" : "-left") : "down" + (n ? "-right" : "-left");
37
+ const o = n.value != null && n.value.offsetLeft < 270;
38
+ return n.value != null && n.value.offsetTop + 270 > window.innerHeight ? "up" + (o ? "-right" : "-left") : "down" + (o ? "-right" : "-left");
39
39
  }), i = w(() => {
40
- const n = [
40
+ const o = [
41
41
  "absolute z-10 w-fit rounded-md bg-white",
42
42
  "py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",
43
43
  "overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
44
44
  ];
45
- return t.value === "up" ? n.push("bottom-1 mb-10") : t.value === "down" ? n.push("top-1 mt-10") : t.value === "up-right" ? n.push("left-0 bottom-1 mb-10") : t.value === "down-right" && n.push("left-0 top-1 mt-10"), u.stick === "right" ? n.push("right-0") : u.stick === "left" && n.push("left-0"), n;
45
+ return t.value === "up" ? o.push("bottom-1 mb-10") : t.value === "down" ? o.push("top-1 mt-10") : t.value === "up-right" ? o.push("left-0 bottom-1 mb-10") : t.value === "down-right" && o.push("left-0 top-1 mt-10"), u.stick === "right" ? o.push("right-0") : u.stick === "left" && o.push("left-0"), o;
46
46
  });
47
- return (n, a) => (l(), d("div", {
47
+ return (o, a) => (l(), d("div", {
48
48
  class: "relative inline-block",
49
49
  ref_key: "menuRef",
50
- ref: o,
50
+ ref: n,
51
51
  "data-opened": c.value
52
52
  }, [
53
- z(n.$slots, "button", A(L({ onToggle: r, isExpanded: c.value }))),
53
+ z(o.$slots, "button", A(L({ onToggle: r, isExpanded: c.value }))),
54
54
  c.value ? (l(), d("div", {
55
55
  key: 0,
56
56
  class: "fixed top-0 left-0 w-screen h-screen z-10",
@@ -72,8 +72,8 @@ const q = {
72
72
  "aria-orientation": "vertical",
73
73
  tabindex: "-1"
74
74
  }, [
75
- n.title ? (l(), d("div", N, f(n.title), 1)) : m("", !0),
76
- z(n.$slots, "menu", A(L({ onToggle: r })))
75
+ o.title ? (l(), d("div", N, f(o.title), 1)) : m("", !0),
76
+ z(o.$slots, "menu", A(L({ onToggle: r })))
77
77
  ], 2)) : m("", !0)
78
78
  ]),
79
79
  _: 3
@@ -85,7 +85,7 @@ const q = {
85
85
  props: H,
86
86
  emits: ["click"],
87
87
  setup(p, { emit: s }) {
88
- const u = p, c = D("OneDropdown"), o = () => {
88
+ const u = p, c = D("OneDropdown"), n = () => {
89
89
  c !== void 0 && c.onToggle(), s("click");
90
90
  }, r = w(() => {
91
91
  const t = [];
@@ -93,7 +93,7 @@ const q = {
93
93
  });
94
94
  return (t, i) => (l(), d("button", {
95
95
  class: b(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap", r.value]),
96
- onClick: F(o, ["prevent"])
96
+ onClick: F(n, ["prevent"])
97
97
  }, [
98
98
  t.icon ? (l(), v(T(t.icon), {
99
99
  key: 0,
@@ -201,26 +201,26 @@ const J = {
201
201
  return (r = s.menu) == null ? void 0 : r.map((t) => {
202
202
  let i = { label: t.label };
203
203
  t.icon != null && (i = { ...i, icon: t.icon });
204
- const n = typeof t.click == "function" ? t.click : () => {
204
+ const o = typeof t.click == "function" ? t.click : () => {
205
205
  };
206
206
  return {
207
207
  key: t.label,
208
208
  args: i,
209
- click: n
209
+ click: o
210
210
  };
211
211
  });
212
212
  }), c = () => {
213
213
  typeof s.onAccount == "function" && s.onAccount();
214
- }, o = () => {
214
+ }, n = () => {
215
215
  typeof s.onLogout == "function" && s.onLogout();
216
216
  };
217
217
  return (r, t) => (l(), v(j, { stick: "right" }, {
218
- button: y(({ onToggle: i, isExpanded: n }) => {
218
+ button: y(({ onToggle: i, isExpanded: o }) => {
219
219
  var a, g;
220
220
  return [
221
221
  e("button", {
222
222
  onClick: i,
223
- class: b(["p-1 rounded-full hover:bg-secondary-10", [n ? "bg-secondary-25" : ""]])
223
+ class: b(["p-1 rounded-full hover:bg-secondary-10", [o ? "bg-secondary-25" : ""]])
224
224
  }, [
225
225
  h(k, {
226
226
  text: ((a = r.user) == null ? void 0 : a.name) || "",
@@ -232,14 +232,14 @@ const J = {
232
232
  ];
233
233
  }),
234
234
  menu: y(() => {
235
- var i, n, a, g;
235
+ var i, o, a, g;
236
236
  return [
237
237
  e("div", W, [
238
238
  e("div", null, [
239
239
  h(k, {
240
240
  text: ((i = r.user) == null ? void 0 : i.name) || "",
241
241
  size: 80,
242
- src: (n = r.user) == null ? void 0 : n.photo_url,
242
+ src: (o = r.user) == null ? void 0 : o.photo_url,
243
243
  rounded: !0,
244
244
  class: "mx-auto"
245
245
  }, null, 8, ["text", "src"])
@@ -265,7 +265,7 @@ const J = {
265
265
  icon: S(G),
266
266
  label: r.logoutLabel,
267
267
  class: "rounded",
268
- onClick: o
268
+ onClick: n
269
269
  }, null, 8, ["icon", "label"])
270
270
  ])
271
271
  ];
@@ -369,16 +369,16 @@ function Z(p, s) {
369
369
  const ee = ["onClick"], te = {
370
370
  class: "space-x-2 flex items-center px-3 py-2",
371
371
  style: { width: "300px" }
372
- }, ne = { class: "flex-shrink-0" }, oe = { class: "w-full text-left" }, re = { class: "flex-shrink-0" }, se = { class: "px-3 py-2 border-t border-secondary-stroke" }, ie = { class: "text-secondary-content text-left pb-1 text-sm" }, le = { class: "grid grid-cols-3 gap-1" }, ce = ["onClick"], ae = { class: "block bg-white mx-auto flex-shrink-0 border border-secondary-stroke p-1 rounded-lg" }, ue = { class: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-center text-sm mt-1" }, fe = /* @__PURE__ */ x({
372
+ }, oe = { class: "flex-shrink-0" }, ne = { class: "w-full text-left" }, re = { class: "flex-shrink-0" }, se = { class: "px-3 py-2 border-t border-secondary-stroke" }, ie = { class: "text-secondary-content text-left pb-1 text-sm" }, le = { class: "grid grid-cols-3 gap-1" }, ce = ["onClick"], ae = { class: "block bg-white mx-auto flex-shrink-0 border border-secondary-stroke p-1 rounded-lg" }, ue = { class: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-center text-sm mt-1" }, fe = /* @__PURE__ */ x({
373
373
  __name: "OneBrowserMenu",
374
374
  props: K,
375
375
  setup(p) {
376
376
  const s = p, u = () => {
377
377
  typeof s.onChange == "function" && s.onChange();
378
- }, c = (o) => {
379
- typeof s.onApp == "function" && s.onApp(o);
378
+ }, c = (n) => {
379
+ typeof s.onApp == "function" && s.onApp(n);
380
380
  };
381
- return (o, r) => (l(), v(j, { stick: "right" }, {
381
+ return (n, r) => (l(), v(j, { stick: "right" }, {
382
382
  button: y(({ onToggle: t, isExpanded: i }) => [
383
383
  e("button", {
384
384
  onClick: t,
@@ -386,35 +386,35 @@ const ee = ["onClick"], te = {
386
386
  }, [
387
387
  h(S(Z), {
388
388
  class: "text-secondary-base",
389
- style: E(`width: ${o.iconSize}px; height: ${o.iconSize}px`)
389
+ style: E(`width: ${n.iconSize}px; height: ${n.iconSize}px`)
390
390
  }, null, 8, ["style"])
391
391
  ], 10, ee)
392
392
  ]),
393
393
  menu: y(() => {
394
- var t, i, n;
394
+ var t, i, o;
395
395
  return [
396
396
  e("div", te, [
397
- e("div", ne, [
397
+ e("div", oe, [
398
398
  h(k, {
399
- text: ((t = o.workspace) == null ? void 0 : t.name) || "",
400
- src: (i = o.workspace) == null ? void 0 : i.photo_url,
399
+ text: ((t = n.workspace) == null ? void 0 : t.name) || "",
400
+ src: (i = n.workspace) == null ? void 0 : i.photo_url,
401
401
  size: 44,
402
402
  rounded: !1,
403
403
  class: "mx-auto"
404
404
  }, null, 8, ["text", "src"])
405
405
  ]),
406
- e("div", oe, f((n = o.workspace) == null ? void 0 : n.name), 1),
406
+ e("div", ne, f((o = n.workspace) == null ? void 0 : o.name), 1),
407
407
  e("div", re, [
408
408
  e("button", {
409
409
  class: "text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",
410
410
  onClick: u
411
- }, f(o.changeLabel), 1)
411
+ }, f(n.changeLabel), 1)
412
412
  ])
413
413
  ]),
414
414
  e("div", se, [
415
- e("div", ie, f(o.appsTitle), 1),
415
+ e("div", ie, f(n.appsTitle), 1),
416
416
  e("div", le, [
417
- (l(!0), d(O, null, M(o.apps, (a) => (l(), d("button", {
417
+ (l(!0), d(O, null, M(n.apps, (a) => (l(), d("button", {
418
418
  key: a.id,
419
419
  onClick: (g) => c(a),
420
420
  class: "p-1.5 flex flex-col items-center justify-center rounded hover:bg-secondary-10",
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),h=require("./common/index.cjs"),g={title:{type:String},stick:{type:String,default:"right"}},k={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},y=["data-opened"],w={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},f=e.defineComponent({__name:"OneDropdown",props:g,emits:["open","close"],setup(d,{emit:l}){const a=d,c=e.ref(!1),n=e.ref(null),r=()=>{c.value=!c.value,c.value?l("open"):l("close")};e.provide("OneDropdown",{onToggle:r});const t=e.computed(()=>{const o=n.value!=null&&n.value.offsetLeft<270;return n.value!=null&&n.value.offsetTop+270>window.innerHeight?"up"+(o?"-right":"-left"):"down"+(o?"-right":"-left")}),s=e.computed(()=>{const o=["absolute z-10 w-fit rounded-md bg-white","py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none","overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"];return t.value==="up"?o.push("bottom-1 mb-10"):t.value==="down"?o.push("top-1 mt-10"):t.value==="up-right"?o.push("left-0 bottom-1 mb-10"):t.value==="down-right"&&o.push("left-0 top-1 mt-10"),a.stick==="right"?o.push("right-0"):a.stick==="left"&&o.push("left-0"),o});return(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:n,"data-opened":c.value},[e.renderSlot(o.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:r,isExpanded:c.value}))),c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:r})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",s.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[o.title?(e.openBlock(),e.createElementBlock("div",w,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:r})))],2)):e.createCommentVNode("",!0)]),_:3})],8,y))}}),v=["onClick"],p=e.defineComponent({__name:"OneDropdownItem",props:k,emits:["click"],setup(d,{emit:l}){const a=d,c=e.inject("OneDropdown"),n=()=>{c!==void 0&&c.onToggle(),l("click")},r=e.computed(()=>{const t=[];return a.variant==="secondary"?t.push("text-secondary-content hover:bg-secondary-body-hover"):a.variant==="danger"?t.push("text-danger-content hover:bg-danger-10"):a.variant==="warning"?t.push("text-warning-content hover:bg-warning-10"):a.variant==="info"?t.push("text-info-content hover:bg-info-10"):t.push("hover:bg-secondary-body-hover"),t});return(t,s)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",r.value]),onClick:e.withModifiers(n,["prevent"])},[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,class:"w-4 h-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],10,v))}});function x(d,l){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})])}function b(d,l){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})])}const _={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},accountLabel:{type:String,default:"Account"},logoutLabel:{type:String,default:"Logout"},onAccount:{type:Function},onLogout:{type:Function}},C={workspace:{type:Object,required:!0},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},appsTitle:{type:String,default:"Apps"},changeLabel:{type:String,default:"Change"},onChange:{type:Function},onApp:{type:Function}},V=["onClick"],E={class:"space-y-2 text-center py-6",style:{width:"240px"}},N={class:"text-sm text-secondary-content"},B={class:"px-2"},S=e.defineComponent({__name:"OneUserMenu",props:_,setup(d){const l=d,a=e.computed(()=>{var r;return(r=l.menu)==null?void 0:r.map(t=>{let s={label:t.label};t.icon!=null&&(s={...s,icon:t.icon});const o=typeof t.click=="function"?t.click:()=>{};return{key:t.label,args:s,click:o}})}),c=()=>{typeof l.onAccount=="function"&&l.onAccount()},n=()=>{typeof l.onLogout=="function"&&l.onLogout()};return(r,t)=>(e.openBlock(),e.createBlock(f,{stick:"right"},{button:e.withCtx(({onToggle:s,isExpanded:o})=>{var i,u;return[e.createElementVNode("button",{onClick:s,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[o?"bg-secondary-25":""]])},[e.createVNode(h.OneAvatar,{text:((i=r.user)==null?void 0:i.name)||"",size:r.iconSize,src:(u=r.user)==null?void 0:u.photo_url,rounded:!0},null,8,["text","size","src"])],10,V)]}),menu:e.withCtx(()=>{var s,o,i,u;return[e.createElementVNode("div",E,[e.createElementVNode("div",null,[e.createVNode(h.OneAvatar,{text:((s=r.user)==null?void 0:s.name)||"",size:80,src:(o=r.user)==null?void 0:o.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",null,[e.createElementVNode("div",null,e.toDisplayString((i=r.user)==null?void 0:i.name),1),e.createElementVNode("div",N,e.toDisplayString((u=r.user)==null?void 0:u.email),1)])]),e.createElementVNode("div",B,[e.createVNode(p,{icon:e.unref(x),label:r.accountLabel,class:"rounded",onClick:c},null,8,["icon","label"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createBlock(p,e.mergeProps({key:m.key},m.args,{onClick:m.click}),null,16,["onClick"]))),128)),e.createVNode(p,{icon:e.unref(b),label:r.logoutLabel,class:"rounded",onClick:n},null,8,["icon","label"])])]}),_:1}))}});function z(d,l){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"})])}const $=["onClick"],A={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},L={class:"flex-shrink-0"},D={class:"w-full text-left"},O={class:"flex-shrink-0"},P={class:"px-3 py-2 border-t border-secondary-stroke"},M={class:"text-secondary-content text-left pb-1 text-sm"},j={class:"grid grid-cols-3 gap-1"},F=["onClick"],T={class:"block bg-white mx-auto flex-shrink-0 border border-secondary-stroke p-1 rounded-lg"},q={class:"w-full overflow-hidden text-ellipsis whitespace-nowrap text-center text-sm mt-1"},R=e.defineComponent({__name:"OneBrowserMenu",props:C,setup(d){const l=d,a=()=>{typeof l.onChange=="function"&&l.onChange()},c=n=>{typeof l.onApp=="function"&&l.onApp(n)};return(n,r)=>(e.openBlock(),e.createBlock(f,{stick:"right"},{button:e.withCtx(({onToggle:t,isExpanded:s})=>[e.createElementVNode("button",{onClick:t,class:e.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",[s?"bg-secondary-25":""]])},[e.createVNode(e.unref(z),{class:"text-secondary-base",style:e.normalizeStyle(`width: ${n.iconSize}px; height: ${n.iconSize}px`)},null,8,["style"])],10,$)]),menu:e.withCtx(()=>{var t,s,o;return[e.createElementVNode("div",A,[e.createElementVNode("div",L,[e.createVNode(h.OneAvatar,{text:((t=n.workspace)==null?void 0:t.name)||"",src:(s=n.workspace)==null?void 0:s.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",D,e.toDisplayString((o=n.workspace)==null?void 0:o.name),1),e.createElementVNode("div",O,[e.createElementVNode("button",{class:"text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",onClick:a},e.toDisplayString(n.changeLabel),1)])]),e.createElementVNode("div",P,[e.createElementVNode("div",M,e.toDisplayString(n.appsTitle),1),e.createElementVNode("div",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.apps,i=>(e.openBlock(),e.createElementBlock("button",{key:i.id,onClick:u=>c(i),class:"p-1.5 flex flex-col items-center justify-center rounded hover:bg-secondary-10",style:{width:"88px",height:"88px"}},[e.createElementVNode("span",T,[e.createVNode(h.OneAvatar,{text:i.name,src:i.photo_url,size:44,rounded:!1},null,8,["text","src"])]),e.createElementVNode("span",q,e.toDisplayString(i.name),1)],8,F))),128))])])]}),_:1}))}});exports._sfc_main=f;exports._sfc_main$1=p;exports._sfc_main$2=S;exports._sfc_main$3=R;
@@ -1,5 +1,5 @@
1
1
  import type { ExtractPropTypes, FunctionalComponent, Component } from "vue";
2
- export type ButtonVariantType = 'primary' | 'default' | 'warning' | 'danger' | 'info' | 'touch' | 'link' | 'none';
2
+ export type ButtonVariantType = 'primary' | 'secondary' | 'warning' | 'danger' | 'info' | 'touch' | 'link' | 'none';
3
3
  export type ButtonSizeType = 'sm' | 'md' | 'lg';
4
4
  export type ButtonIconType = FunctionalComponent | Component;
5
5
  export declare const buttonProps: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("../_plugin-vue_export-helper-f246444f.cjs");const b={},g={class:"spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{animation:"one-sp-ico-rot 2.7s linear infinite"}},m=e.createElementVNode("circle",{style:{"stroke-linecap":"round",animation:"one-sp-ico-dash 1.7s ease-in-out infinite"},class:"opacity-75",cx:"12",cy:"12",r:"8",fill:"none",stroke:"currentColor","stroke-width":"2"},null,-1),h=[m];function f(t,n){return e.openBlock(),e.createElementBlock("svg",g,h)}const y=p._export_sfc(b,[["render",f]]),v={variant:{type:String,default:"primary"},size:{type:String,default:"md"},label:{type:String},icon:{type:[Function,Object]},isLoading:{type:Boolean},isSubmit:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},iconClass:{type:[String,Array]}},w=["relative inline-flex","border","items-center justify-center","text-sm font-medium whitespace-nowrap","disabled:opacity-50 disabled:cursor-default","focus:outline-none focus:ring-2 focus:ring-offset-2","transition-colors duration-200"],k={sm:["px-2 py-1"],md:["px-3 py-2","h-10"],lg:["px-4 py-3","h-12"]},_={primary:["rounded-md border-transparent bg-primary-base disabled:bg-primary-hover text-white hover:bg-primary-hover focus:ring-primary-glow"],secondary:["rounded-md border-primary-stroke bg-primary-body disabled:bg-primary-body-hover text-black hover:bg-primary-body-hover focus:ring-tertiary-glow"],info:["rounded-md border-transparent bg-info-base disabled:bg-info-hover text-white hover:bg-info-hover focus:ring-info-glow"],success:["rounded-md border-transparent bg-success-base disabled:bg-success-hover text-white hover:bg-success-hover focus:ring-success-glow"],warning:["rounded-md border-transparent bg-warning-base disabled:bg-warning-hover text-white hover:bg-warning-hover focus:ring-warning-glow"],danger:["rounded-md border-transparent bg-danger-base disabled:bg-danger-hover text-white hover:bg-danger-hover focus:ring-danger-glow"],touch:["rounded-full border-transparent text-black hover:bg-primary-body-hover hover:shadow p-3 focus:ring-tertiary-glow"],link:["rounded-md border-transparent items-center text-info-base hover:text-info-hover"],none:["rounded-md border-transparent text-gray-500"]},C=(t="primary",n="md")=>{const o=[];return o.push(...w),o.push(..._[t]??[]),t!=="touch"&&o.push(...k[n]??[]),o},B=["disabled","title","type","onClick"],x=e.defineComponent({__name:"OneButton",props:v,emits:["click"],setup(t,{emit:n}){const o=t,a=()=>{n("click")},r=e.computed(()=>o.icon),l=e.computed(()=>{const s=C(o.variant,o.size);return o.variant==="touch"&&o.active&&s.push("bg-primary-body-active"),s}),c=e.computed(()=>o.disabled||o.isLoading),d=e.computed(()=>o.label&&o.label.length>0&&o.variant!=="touch"),u=e.computed(()=>{const s=["inline-block text-ellipsis overflow-hidden"];return(o.icon!=null||o.isLoading)&&s.push("ml-2"),s}),i=e.computed(()=>{const s=[];return o.size==="sm"?s.push("w-3 h-3"):o.size==="lg"?s.push("w-5 h-5"):s.push("w-4 h-4"),typeof o.iconClass=="string"?s.push(o.iconClass):o.iconClass instanceof Array&&s.push(...o.iconClass),s});return(s,L)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(l.value),disabled:c.value,title:s.label,type:s.isSubmit?"submit":"button",onClick:e.withModifiers(a,["stop"])},[s.isLoading?(e.openBlock(),e.createBlock(y,{key:0,class:e.normalizeClass(i.value)},null,8,["class"])):r.value!=null?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:1,class:e.normalizeClass(i.value)},null,8,["class"])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(u.value)},e.toDisplayString(s.label),3)):e.createCommentVNode("",!0)],10,B))}});exports.OneButton=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("../_plugin-vue_export-helper-f246444f.cjs");const b={},g={class:"spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{animation:"one-sp-ico-rot 2.7s linear infinite"}},m=e.createElementVNode("circle",{style:{"stroke-linecap":"round",animation:"one-sp-ico-dash 1.7s ease-in-out infinite"},class:"opacity-75",cx:"12",cy:"12",r:"8",fill:"none",stroke:"currentColor","stroke-width":"2"},null,-1),h=[m];function f(t,n){return e.openBlock(),e.createElementBlock("svg",g,h)}const y=p._export_sfc(b,[["render",f]]),v={variant:{type:String,default:"primary"},size:{type:String,default:"md"},label:{type:String},icon:{type:[Function,Object]},isLoading:{type:Boolean},isSubmit:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},iconClass:{type:[String,Array]}},w=["relative inline-flex","border","items-center justify-center","font-medium whitespace-nowrap","disabled:opacity-50 disabled:cursor-default","focus:outline-none focus:ring-2 focus:ring-offset-2","transition-colors duration-200"],k={sm:["px-2 py-1 text-sm"],md:["px-3 py-2"],lg:["px-4 py-3"]},_={primary:["rounded-md border-transparent bg-primary-base disabled:bg-primary-hover text-white hover:bg-primary-hover focus:ring-primary-glow"],secondary:["rounded-md border-primary-stroke bg-primary-body disabled:bg-primary-body-hover text-black hover:bg-primary-body-hover focus:ring-tertiary-glow"],info:["rounded-md border-transparent bg-info-base disabled:bg-info-hover text-white hover:bg-info-hover focus:ring-info-glow"],success:["rounded-md border-transparent bg-success-base disabled:bg-success-hover text-white hover:bg-success-hover focus:ring-success-glow"],warning:["rounded-md border-transparent bg-warning-base disabled:bg-warning-hover text-white hover:bg-warning-hover focus:ring-warning-glow"],danger:["rounded-md border-transparent bg-danger-base disabled:bg-danger-hover text-white hover:bg-danger-hover focus:ring-danger-glow"],touch:["rounded-full border-transparent text-black hover:bg-primary-body-hover hover:shadow p-3 focus:ring-tertiary-glow"],link:["rounded-md border-transparent items-center text-info-base hover:text-info-hover"],none:["rounded-md border-transparent text-gray-500"]},C=(t="primary",n="md")=>{const o=[];return o.push(...w),o.push(..._[t]??[]),t!=="touch"&&o.push(...k[n]??[]),o},B=["disabled","title","type","onClick"],x=e.defineComponent({__name:"OneButton",props:v,emits:["click"],setup(t,{emit:n}){const o=t,a=()=>{n("click")},r=e.computed(()=>o.icon),l=e.computed(()=>{const s=C(o.variant,o.size);return o.variant==="touch"&&o.active&&s.push("bg-primary-body-active"),s}),c=e.computed(()=>o.disabled||o.isLoading),d=e.computed(()=>o.label&&o.label.length>0&&o.variant!=="touch"),u=e.computed(()=>{const s=["inline-block text-ellipsis overflow-hidden"];return(o.icon!=null||o.isLoading)&&s.push("ml-2"),s}),i=e.computed(()=>{const s=[];return o.size==="sm"?s.push("w-3 h-3"):o.size==="lg"?s.push("w-5 h-5"):s.push("w-4 h-4"),typeof o.iconClass=="string"?s.push(o.iconClass):o.iconClass instanceof Array&&s.push(...o.iconClass),s});return(s,L)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(l.value),disabled:c.value,title:s.label,type:s.isSubmit?"submit":"button",onClick:e.withModifiers(a,["stop"])},[s.isLoading?(e.openBlock(),e.createBlock(y,{key:0,class:e.normalizeClass(i.value)},null,8,["class"])):r.value!=null?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:1,class:e.normalizeClass(i.value)},null,8,["class"])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(u.value)},e.toDisplayString(s.label),3)):e.createCommentVNode("",!0)],10,B))}});exports.OneButton=x;
@@ -57,14 +57,14 @@ const z = /* @__PURE__ */ k(x, [["render", S]]), I = {
57
57
  "relative inline-flex",
58
58
  "border",
59
59
  "items-center justify-center",
60
- "text-sm font-medium whitespace-nowrap",
60
+ "font-medium whitespace-nowrap",
61
61
  "disabled:opacity-50 disabled:cursor-default",
62
62
  "focus:outline-none focus:ring-2 focus:ring-offset-2",
63
63
  "transition-colors duration-200"
64
64
  ], O = {
65
- sm: ["px-2 py-1"],
66
- md: ["px-3 py-2", "h-10"],
67
- lg: ["px-4 py-3", "h-12"]
65
+ sm: ["px-2 py-1 text-sm"],
66
+ md: ["px-3 py-2"],
67
+ lg: ["px-4 py-3"]
68
68
  }, j = {
69
69
  primary: ["rounded-md border-transparent bg-primary-base disabled:bg-primary-hover text-white hover:bg-primary-hover focus:ring-primary-glow"],
70
70
  secondary: ["rounded-md border-primary-stroke bg-primary-body disabled:bg-primary-body-hover text-black hover:bg-primary-body-hover focus:ring-tertiary-glow"],
@@ -11,7 +11,6 @@ export declare const avatarProps: {
11
11
  text: {
12
12
  type: StringConstructor;
13
13
  required: boolean;
14
- default: string;
15
14
  };
16
15
  src: {
17
16
  type: PropType<string>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p={size:{type:[String,Number],default:"50"},rounded:{type:Boolean,default:!1},text:{type:String,required:!1,default:""},src:{type:[String,null],required:!1}},m=["src"],y=e.defineComponent({__name:"OneAvatar",props:p,setup(s){const t=s,n=e.computed(()=>{const r=t.text.trim().split(" ");return r.length<2?t.text.slice(0,2).toUpperCase():r.map(l=>l.slice(0,1)).join("").toUpperCase()}),a=e.computed(()=>({fill:"rgba(255, 255, 255, .75)",fontSize:`${Number(t.size)*.4}px`})),c=e.computed(()=>{const r=t.text.split("").map(o=>o.charCodeAt(0)).reduce((o,d)=>o+d,0),u=`hsl(${360/26*r}, 68%, 48%)`;return{width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%",background:u}}),i=e.computed(()=>({width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%"}));return(r,l)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(i.value),class:"overflow-hidden"},[r.src?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.src,alt:"",class:"w-full h-full"},null,8,m)):(e.openBlock(),e.createElementBlock("svg",{key:1,style:e.normalizeStyle(c.value),class:"block"},[n.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:"50%",y:"50%","text-anchor":"middle","dominant-baseline":"central",class:"font-light",style:e.normalizeStyle(a.value)},e.toDisplayString(n.value),5)):e.createCommentVNode("",!0)],4))],4))}});exports.OneAvatar=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p={size:{type:[String,Number],default:"50"},rounded:{type:Boolean,default:!1},text:{type:String,required:!1},src:{type:[String,null],required:!1}},m=["src"],h=e.defineComponent({__name:"OneAvatar",props:p,setup(s){const t=s,o=e.computed(()=>{if(t.text==null||t.text==="")return"";const r=t.text.trim().split(" ");return r.length<2?t.text.slice(0,2).toUpperCase():r.map(l=>l.slice(0,1)).join("").toUpperCase()}),i=e.computed(()=>({fill:"rgba(255, 255, 255, .75)",fontSize:`${Number(t.size)*.4}px`})),a=e.computed(()=>{if(t.text==null)return{width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%"};const r=t.text.split("").map(n=>n.charCodeAt(0)).reduce((n,d)=>n+d,0),u=`hsl(${360/26*r}, 68%, 48%)`;return{width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%",background:u}}),c=e.computed(()=>({width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%"}));return(r,l)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(c.value),class:"overflow-hidden"},[r.src?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.src,alt:"",class:"w-full h-full"},null,8,m)):(e.openBlock(),e.createElementBlock("svg",{key:1,style:e.normalizeStyle(a.value),class:"block"},[o.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:"50%",y:"50%","text-anchor":"middle","dominant-baseline":"central",class:"font-light",style:e.normalizeStyle(i.value)},e.toDisplayString(o.value),5)):e.createCommentVNode("",!0)],4))],4))}});exports.OneAvatar=h;
@@ -1,5 +1,5 @@
1
- import { defineComponent as f, computed as r, openBlock as s, createElementBlock as n, normalizeStyle as a, toDisplayString as y, createCommentVNode as g } from "vue";
2
- const x = {
1
+ import { defineComponent as m, computed as r, openBlock as s, createElementBlock as n, normalizeStyle as i, toDisplayString as f, createCommentVNode as g } from "vue";
2
+ const y = {
3
3
  size: {
4
4
  type: [String, Number],
5
5
  default: "50"
@@ -10,30 +10,37 @@ const x = {
10
10
  },
11
11
  text: {
12
12
  type: String,
13
- required: !1,
14
- default: ""
13
+ required: !1
15
14
  },
16
15
  src: {
17
16
  type: [String, null],
18
17
  required: !1
19
18
  }
20
- }, v = ["src"], S = /* @__PURE__ */ f({
19
+ }, v = ["src"], z = /* @__PURE__ */ m({
21
20
  __name: "OneAvatar",
22
- props: x,
23
- setup(c) {
24
- const e = c, i = r(() => {
21
+ props: y,
22
+ setup(u) {
23
+ const e = u, a = r(() => {
24
+ if (e.text == null || e.text === "")
25
+ return "";
25
26
  const t = e.text.trim().split(" ");
26
27
  return t.length < 2 ? e.text.slice(0, 2).toUpperCase() : t.map((l) => l.slice(0, 1)).join("").toUpperCase();
27
- }), u = r(() => ({
28
+ }), c = r(() => ({
28
29
  fill: "rgba(255, 255, 255, .75)",
29
30
  fontSize: `${Number(e.size) * 0.4}px`
30
31
  })), d = r(() => {
31
- const t = e.text.split("").map((o) => o.charCodeAt(0)).reduce((o, h) => o + h, 0), m = `hsl(${360 / 26 * t}, 68%, 48%)`;
32
+ if (e.text == null)
33
+ return {
34
+ width: `${e.size}px`,
35
+ height: `${e.size}px`,
36
+ borderRadius: e.rounded ? "100%" : "9%"
37
+ };
38
+ const t = e.text.split("").map((o) => o.charCodeAt(0)).reduce((o, x) => o + x, 0), h = `hsl(${360 / 26 * t}, 68%, 48%)`;
32
39
  return {
33
40
  width: `${e.size}px`,
34
41
  height: `${e.size}px`,
35
42
  borderRadius: e.rounded ? "100%" : "9%",
36
- background: m
43
+ background: h
37
44
  };
38
45
  }), p = r(() => ({
39
46
  width: `${e.size}px`,
@@ -41,7 +48,7 @@ const x = {
41
48
  borderRadius: e.rounded ? "100%" : "9%"
42
49
  }));
43
50
  return (t, l) => (s(), n("div", {
44
- style: a(p.value),
51
+ style: i(p.value),
45
52
  class: "overflow-hidden"
46
53
  }, [
47
54
  t.src ? (s(), n("img", {
@@ -51,22 +58,22 @@ const x = {
51
58
  class: "w-full h-full"
52
59
  }, null, 8, v)) : (s(), n("svg", {
53
60
  key: 1,
54
- style: a(d.value),
61
+ style: i(d.value),
55
62
  class: "block"
56
63
  }, [
57
- i.value ? (s(), n("text", {
64
+ a.value ? (s(), n("text", {
58
65
  key: 0,
59
66
  x: "50%",
60
67
  y: "50%",
61
68
  "text-anchor": "middle",
62
69
  "dominant-baseline": "central",
63
70
  class: "font-light",
64
- style: a(u.value)
65
- }, y(i.value), 5)) : g("", !0)
71
+ style: i(c.value)
72
+ }, f(a.value), 5)) : g("", !0)
66
73
  ], 4))
67
74
  ], 4));
68
75
  }
69
76
  });
70
77
  export {
71
- S as OneAvatar
78
+ z as OneAvatar
72
79
  };
@@ -11,7 +11,7 @@ export declare const dropdownProps: {
11
11
  export type DropdownProps = ExtractPropTypes<typeof dropdownProps>;
12
12
  export declare const dropdownItemProps: {
13
13
  variant: {
14
- type: PropType<"primary" | "warning" | "danger" | "info" | "secondary">;
14
+ type: PropType<"primary" | "secondary" | "warning" | "danger" | "info">;
15
15
  default: string;
16
16
  };
17
17
  label: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../OneBrowserMenu.vue_vue_type_script_setup_true_lang-4c394828.cjs"),r=require("vue"),n=require("../_plugin-vue_export-helper-f246444f.cjs");require("../common/index.cjs");const o={},t={class:"border-t border-secondary-stroke my-1"};function _(s,i){return r.openBlock(),r.createElementBlock("div",t)}const c=n._export_sfc(o,[["render",_]]);exports.OneBrowserMenu=e._sfc_main$3;exports.OneDropdown=e._sfc_main;exports.OneDropdownItem=e._sfc_main$1;exports.OneUserMenu=e._sfc_main$2;exports.OneDropdownDivider=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../OneBrowserMenu.vue_vue_type_script_setup_true_lang-24874222.cjs"),r=require("vue"),n=require("../_plugin-vue_export-helper-f246444f.cjs");require("../common/index.cjs");const o={},t={class:"border-t border-secondary-stroke my-1"};function _(s,i){return r.openBlock(),r.createElementBlock("div",t)}const c=n._export_sfc(o,[["render",_]]);exports.OneBrowserMenu=e._sfc_main$3;exports.OneDropdown=e._sfc_main;exports.OneDropdownItem=e._sfc_main$1;exports.OneUserMenu=e._sfc_main$2;exports.OneDropdownDivider=c;
@@ -1,4 +1,4 @@
1
- import { c as O, _ as l, a as u, b as w } from "../OneBrowserMenu.vue_vue_type_script_setup_true_lang-8d34213c.js";
1
+ import { c as O, _ as l, a as u, b as w } from "../OneBrowserMenu.vue_vue_type_script_setup_true_lang-197489be.js";
2
2
  import { openBlock as e, createElementBlock as r } from "vue";
3
3
  import { _ as o } from "../_plugin-vue_export-helper-dad06003.js";
4
4
  import "../common/index.js";
@@ -82,6 +82,10 @@ export declare const formInputProps: {
82
82
  type: PropType<"number" | "text" | "password" | "checkbox" | "radio" | "range" | "select" | "textarea">;
83
83
  default: string;
84
84
  };
85
+ inputClass: {
86
+ required: boolean;
87
+ type: PropType<string | string[]>;
88
+ };
85
89
  modelValue: {
86
90
  required: boolean;
87
91
  type: PropType<any>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E={id:{type:String,required:!1},validation:{type:Object,required:!1}},w={id:{type:String,required:!1},label:{type:String,required:!1},name:{type:String,required:!1},hint:{type:String,required:!1,default:""},errors:{type:Array,required:!1}},V={name:{type:String,required:!1},errors:{type:Array,required:!1}},F={label:{type:String,required:!1}},C={id:{type:String,required:!1},name:{type:String,required:!1},placeholder:{type:String,default:""},icon:{type:[Function,Object]},type:{type:String,default:"text"},modelValue:{required:!1,type:[String,Number,Array,Boolean,Object,null]},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},large:{type:Boolean,default:!1},invalid:{type:Boolean,required:!1,default:!1},options:{type:Array,required:!1,default:[]}},k=()=>e.inject("BaseForm",()=>({formId:e.computed(()=>{}),validation:e.computed(()=>{})}),!0),m=()=>e.inject("BaseFormField",()=>({inputId:e.computed(()=>{}),inputName:e.computed(()=>{}),hasError:e.computed(()=>!1)}),!0),N=["onSubmit","id"],S=e.defineComponent({__name:"OneForm",props:E,emits:["submit"],setup(a,{emit:o}){const n=a;e.provide("BaseForm",{formId:e.computed(()=>n.id),validation:e.computed(()=>n.validation)});const d=()=>{o("submit")};return(t,l)=>(e.openBlock(),e.createElementBlock("form",{onSubmit:e.withModifiers(d,["prevent"]),id:t.id,class:"space-y-3"},[e.renderSlot(t.$slots,"default")],40,N))}}),$=["for"],h=e.defineComponent({__name:"OneFormLabel",props:F,setup(a){const{inputId:o}=m();return(n,d)=>(e.openBlock(),e.createElementBlock("label",{for:e.unref(o),class:"block text-sm font-medium text-primary-content select-none"},[e.renderSlot(n.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.label),1)])],8,$))}}),_={key:0,class:"text-danger-content text-xs space-y-1"},v=e.defineComponent({__name:"OneFormFeedback",props:V,setup(a){const o=a,{validation:n}=k(),{inputName:d}=m(),t=e.computed(()=>d.value==null&&o.name==null?o.errors??[]:n.value==null?o.errors??[]:(n.value??{})[o.name||d.value]??o.errors??[]);return(l,s)=>t.value.length>0?(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u},e.toDisplayString(u),1))),128))])):e.createCommentVNode("",!0)}});function q(a,o){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})])}function O(a,o){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})])}function j(a,o){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])}function I(a,o){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})])}const M={key:0,class:"w-full onebselect relative group"},L=["id","disabled"],z=["selected"],D=["selected"],P={class:"absolute p-2 px-3 rounded-md h-full flex items-center right-1 top-0 select-none pointer-events-none"},A=["name","id","value","placeholder","disabled","readonly"],T={key:2,class:"flex w-full space-x-3 items-center"},G=["type","name","id","disabled","readonly","checked"],H=["for"],J={key:3,class:"w-full space-y-1"},K=["name","id","value","disabled","readonly","checked"],Q=["for"],R={key:4,class:"relative"},U={class:"absolute p-2 px-3 rounded-md h-full flex items-center select-none"},W=["type","name","id","value","placeholder","disabled","readonly"],b=e.defineComponent({__name:"OneFormInput",props:C,emits:["update:modelValue"],setup(a,{emit:o}){const n=a,{inputId:d,inputName:t,hasError:l}=m(),s=e.ref(null),u=e.ref(!1);e.onMounted(()=>{n.autofocus&&s.value&&s.value.focus()});const B=e.computed(()=>n.modelValue!=null&&n.modelValue!==""),c=e.computed(()=>{if(n.id)return n.id;const r=(d==null?void 0:d.value)||"";return n.name?`${r}-${n.name}`:r||""}),g=()=>{o("update:modelValue","")},p=r=>{n.type==="checkbox"?o("update:modelValue",r.target.checked):o("update:modelValue",r.target.value)};return(r,f)=>r.type==="select"?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("select",{id:c.value,ref_key:"inputElement",ref:s,class:e.normalizeClass(["border border-primary-stroke px-3 w-full",{"border-danger-base":e.unref(l)||r.invalid,"text-secondary-content":r.modelValue===""||r.modelValue==null,"rounded-full":r.rounded,"rounded-md":!r.rounded,"text-lg":r.large,"py-2.5":r.large,"py-2":!r.large}]),disabled:r.disabled},[r.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,selected:r.modelValue===""||r.modelValue==null,disabled:"",hidden:""},e.toDisplayString(r.placeholder),9,z)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options,i=>(e.openBlock(),e.createElementBlock("option",{selected:i.key===r.modelValue,key:i.key},e.toDisplayString(i.value),9,D))),128))],10,L),e.createElementVNode("div",P,[e.createVNode(e.unref(I),{class:e.normalizeClass(["w-4 h-4 text-secondary-content",{"group-hover:text-primary-base":!r.disabled,"opacity-50":r.disabled}])},null,8,["class"])])])):r.type==="textarea"?(e.openBlock(),e.createElementBlock("textarea",{key:1,name:r.name||e.unref(t),id:c.value,value:r.modelValue,onInput:p,rows:"3",class:e.normalizeClass(["border border-primary-stroke px-3 w-full",{"border-danger-base":e.unref(l),"rounded-3xl":r.rounded,"rounded-md":!r.rounded,"text-lg":r.large,"py-2.5":r.large,"py-2":!r.large}]),placeholder:r.placeholder,disabled:r.disabled,readonly:r.readonly,ref_key:"inputElement",ref:s},null,42,A)):r.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("input",{type:r.type,name:r.name||e.unref(t),id:c.value,value:!0,onInput:p,disabled:r.disabled,readonly:r.readonly,class:e.normalizeClass(["rounded-md border border-primary-stroke px-3 py-2 shadow-sm",{"border-danger-base":e.unref(l)||r.invalid}]),checked:r.modelValue===!0,ref_key:"inputElement",ref:s},null,42,G),e.createElementVNode("label",{for:c.value,class:"text-primary-content select-none"},e.toDisplayString(r.placeholder),9,H)])):r.type==="radio"?(e.openBlock(),e.createElementBlock("div",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options,(i,y)=>(e.openBlock(),e.createElementBlock("div",{key:i.key,class:"flex w-full space-x-3 items-center"},[e.createElementVNode("input",{type:"radio",name:r.name||e.unref(t),id:`${c.value}-${y}`,value:i.key,onInput:p,disabled:r.disabled,readonly:r.readonly,class:e.normalizeClass(["rounded-md border border-primary-stroke px-3 py-2 shadow-sm",{"border-danger-base":e.unref(l)||r.invalid}]),checked:i.key===r.modelValue,ref_for:!0,ref_key:"inputElement",ref:s},null,42,K),e.createElementVNode("label",{for:`${c.value}-${y}`,class:"text-primary-content select-none"},e.toDisplayString(i.value),9,Q)]))),128))])):(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",U,[r.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.icon),{key:0,class:"w-5 h-5 text-primary-content"})):e.createCommentVNode("",!0)]),e.createElementVNode("input",{type:u.value?"text":r.type,name:r.name||e.unref(t),id:c.value,value:r.modelValue,onInput:p,placeholder:r.placeholder,disabled:r.disabled,readonly:r.readonly,class:e.normalizeClass(["border border-primary-stroke w-full px-3",{"shadow-sm":r.type!=="range","border-danger-base":e.unref(l)||r.invalid,"pl-10":r.icon!=null,"pr-10":r.type==="password","rounded-full":r.rounded,"rounded-md":!r.rounded,"text-lg":r.large,"py-2.5":r.large,"py-2":!r.large}]),ref_key:"inputElement",ref:s},null,42,W),r.clearable&&B.value?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:g,class:"absolute p-2 px-3 rounded-md h-full flex items-center right-0 top-0 hover:cursor-pointer select-none"},[e.createVNode(e.unref(j),{class:"w-5 h-5 text-secondary-content hover:text-primary-base"})])):r.type==="password"?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:f[0]||(f[0]=i=>u.value=!u.value),class:"absolute p-2 px-3 rounded-md h-full flex items-center right-0 top-0 hover:cursor-pointer select-none"},[u.value?(e.openBlock(),e.createBlock(e.unref(O),{key:0,class:"w-5 h-5 text-primary-content hover:text-primary-base"})):(e.openBlock(),e.createBlock(e.unref(q),{key:1,class:"w-5 h-5 text-secondary-content hover:text-primary-base"}))])):e.createCommentVNode("",!0)]))}});const X={class:"space-y-1"},Y={key:2,class:"text-xs text-secondary-content select-none"},Z=e.defineComponent({__name:"OneFormField",props:w,setup(a){const o=a,{formId:n,validation:d}=k(),t=e.computed(()=>o.errors!=null&&o.errors.length>0?!0:o.name==null?!1:(d.value??{})[o.name]!=null);return e.provide("BaseFormField",{inputId:e.computed(()=>{const l=n.value||"form";if(o.id!=null)return`${l}-${o.id}`;if(o.name!=null)return`${l}-field-${o.name}`}),inputName:e.computed(()=>o.name),hasError:t}),(l,s)=>(e.openBlock(),e.createElementBlock("div",X,[l.label?(e.openBlock(),e.createBlock(h,{key:0,label:l.label},null,8,["label"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default",{},()=>[e.createVNode(b)]),t.value?(e.openBlock(),e.createBlock(v,{key:1,errors:l.errors},null,8,["errors"])):l.hint.length>0?(e.openBlock(),e.createElementBlock("p",Y,e.toDisplayString(l.hint),1)):e.createCommentVNode("",!0)]))}});exports.OneForm=S;exports.OneFormFeedback=v;exports.OneFormField=Z;exports.OneFormInput=b;exports.OneFormLabel=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w={id:{type:String,required:!1},validation:{type:Object,required:!1}},V={id:{type:String,required:!1},label:{type:String,required:!1},name:{type:String,required:!1},hint:{type:String,required:!1,default:""},errors:{type:Array,required:!1}},C={name:{type:String,required:!1},errors:{type:Array,required:!1}},F={label:{type:String,required:!1}},N={id:{type:String,required:!1},name:{type:String,required:!1},placeholder:{type:String,default:""},icon:{type:[Function,Object]},type:{type:String,default:"text"},inputClass:{required:!1,type:[Array,String]},modelValue:{required:!1,type:[String,Number,Array,Boolean,Object,null]},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},large:{type:Boolean,default:!1},invalid:{type:Boolean,required:!1,default:!1},options:{type:Array,required:!1,default:[]}},k=()=>e.inject("BaseForm",()=>({formId:e.computed(()=>{}),validation:e.computed(()=>{})}),!0),f=()=>e.inject("BaseFormField",()=>({inputId:e.computed(()=>{}),inputName:e.computed(()=>{}),hasError:e.computed(()=>!1)}),!0),S=["onSubmit","id"],_=e.defineComponent({__name:"OneForm",props:w,emits:["submit"],setup(a,{emit:t}){const o=a;e.provide("BaseForm",{formId:e.computed(()=>o.id),validation:e.computed(()=>o.validation)});const d=()=>{t("submit")};return(l,n)=>(e.openBlock(),e.createElementBlock("form",{onSubmit:e.withModifiers(d,["prevent"]),id:l.id,class:"space-y-3"},[e.renderSlot(l.$slots,"default")],40,S))}}),$=["for"],v=e.defineComponent({__name:"OneFormLabel",props:F,setup(a){const{inputId:t}=f();return(o,d)=>(e.openBlock(),e.createElementBlock("label",{for:e.unref(t),class:"block text-sm font-medium text-primary-content select-none"},[e.renderSlot(o.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.label),1)])],8,$))}}),q={key:0,class:"text-danger-content text-xs space-y-1"},h=e.defineComponent({__name:"OneFormFeedback",props:C,setup(a){const t=a,{validation:o}=k(),{inputName:d}=f(),l=e.computed(()=>d.value==null&&t.name==null?t.errors??[]:o.value==null?t.errors??[]:(o.value??{})[t.name||d.value]??t.errors??[]);return(n,i)=>l.value.length>0?(e.openBlock(),e.createElementBlock("div",q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u},e.toDisplayString(u),1))),128))])):e.createCommentVNode("",!0)}});function O(a,t){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})])}function j(a,t){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})])}function I(a,t){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])}function M(a,t){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})])}const L={key:0,class:"w-full onebselect relative group"},z=["id","disabled"],A=["selected"],D=["selected","value"],P={class:"absolute p-2 px-3 rounded-md h-full flex items-center right-1 top-0 select-none pointer-events-none"},x=["name","id","value","placeholder","disabled","readonly"],T={key:2,class:"flex w-full space-x-3 items-center"},G=["type","name","id","disabled","readonly","checked"],H=["for"],J={key:3,class:"w-full space-y-1"},K=["name","id","value","disabled","readonly","checked"],Q=["for"],R={key:4,class:"relative"},U={class:"absolute p-2 px-3 rounded-md h-full flex items-center select-none"},W=["type","name","id","value","placeholder","disabled","readonly"],b=e.defineComponent({__name:"OneFormInput",props:N,emits:["update:modelValue"],setup(a,{emit:t}){const o=a,{inputId:d,inputName:l,hasError:n}=f(),i=e.ref(null),u=e.ref(!1);e.onMounted(()=>{o.autofocus&&i.value&&i.value.focus()});const B=e.computed(()=>o.modelValue!=null&&o.modelValue!==""),c=e.computed(()=>{if(o.id)return o.id;const r=(d==null?void 0:d.value)||"";return o.name?`${r}-${o.name}`:r||""}),g=()=>{t("update:modelValue","")},E=e.computed(()=>{const r={"shadow-sm":o.type!=="range","border-danger-base":n.value||o.invalid,"pl-10":o.icon!=null,"pr-10":o.type==="password","rounded-full":o.rounded,"rounded-md":!o.rounded,"text-lg":o.large,"py-2.5":o.large,"py-2":!o.large};return o.inputClass!=null&&(typeof o.inputClass=="string"?r[o.inputClass]=!0:o.inputClass instanceof Array&&o.inputClass.forEach(m=>{r[m]=!0})),r}),p=r=>{o.type==="checkbox"?t("update:modelValue",r.target.checked):t("update:modelValue",r.target.value)};return(r,m)=>r.type==="select"?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("select",{id:c.value,ref_key:"inputElement",ref:i,class:e.normalizeClass(["border border-primary-stroke px-3 w-full",{"border-danger-base":e.unref(n)||r.invalid,"text-secondary-content":r.modelValue===""||r.modelValue==null,"rounded-full":r.rounded,"rounded-md":!r.rounded,"text-lg":r.large,"py-2.5":r.large,"py-2":!r.large}]),disabled:r.disabled},[r.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,selected:r.modelValue===""||r.modelValue==null,disabled:"",hidden:""},e.toDisplayString(r.placeholder),9,A)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options,s=>(e.openBlock(),e.createElementBlock("option",{selected:s.key===r.modelValue,key:s.key,value:s.key},e.toDisplayString(s.value),9,D))),128))],10,z),e.createElementVNode("div",P,[e.createVNode(e.unref(M),{class:e.normalizeClass(["w-4 h-4 text-secondary-content",{"group-hover:text-primary-base":!r.disabled,"opacity-50":r.disabled}])},null,8,["class"])])])):r.type==="textarea"?(e.openBlock(),e.createElementBlock("textarea",{key:1,name:r.name||e.unref(l),id:c.value,value:r.modelValue,onInput:p,rows:"3",class:e.normalizeClass(["border border-primary-stroke px-3 w-full",{"border-danger-base":e.unref(n),"rounded-3xl":r.rounded,"rounded-md":!r.rounded,"text-lg":r.large,"py-2.5":r.large,"py-2":!r.large}]),placeholder:r.placeholder,disabled:r.disabled,readonly:r.readonly,ref_key:"inputElement",ref:i},null,42,x)):r.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("input",{type:r.type,name:r.name||e.unref(l),id:c.value,value:!0,onInput:p,disabled:r.disabled,readonly:r.readonly,class:e.normalizeClass(["rounded-md border border-primary-stroke px-3 py-2 shadow-sm",{"border-danger-base":e.unref(n)||r.invalid}]),checked:r.modelValue===!0,ref_key:"inputElement",ref:i},null,42,G),e.createElementVNode("label",{for:c.value,class:"text-primary-content select-none"},e.toDisplayString(r.placeholder),9,H)])):r.type==="radio"?(e.openBlock(),e.createElementBlock("div",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options,(s,y)=>(e.openBlock(),e.createElementBlock("div",{key:s.key,class:"flex w-full space-x-3 items-center"},[e.createElementVNode("input",{type:"radio",name:r.name||e.unref(l),id:`${c.value}-${y}`,value:s.key,onInput:p,disabled:r.disabled,readonly:r.readonly,class:e.normalizeClass(["rounded-md border border-primary-stroke px-3 py-2 shadow-sm",{"border-danger-base":e.unref(n)||r.invalid}]),checked:s.key===r.modelValue,ref_for:!0,ref_key:"inputElement",ref:i},null,42,K),e.createElementVNode("label",{for:`${c.value}-${y}`,class:"text-primary-content select-none"},e.toDisplayString(s.value),9,Q)]))),128))])):(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",U,[r.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.icon),{key:0,class:"w-5 h-5 text-primary-content"})):e.createCommentVNode("",!0)]),e.createElementVNode("input",{type:u.value?"text":r.type,name:r.name||e.unref(l),id:c.value,value:r.modelValue,onInput:p,placeholder:r.placeholder,disabled:r.disabled,readonly:r.readonly,class:e.normalizeClass(["border border-primary-stroke w-full px-3",E.value]),ref_key:"inputElement",ref:i},null,42,W),r.clearable&&B.value?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:g,class:"absolute p-2 px-3 rounded-md h-full flex items-center right-0 top-0 hover:cursor-pointer select-none"},[e.createVNode(e.unref(I),{class:"w-5 h-5 text-secondary-content hover:text-primary-base"})])):r.type==="password"?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:m[0]||(m[0]=s=>u.value=!u.value),class:"absolute p-2 px-3 rounded-md h-full flex items-center right-0 top-0 hover:cursor-pointer select-none"},[u.value?(e.openBlock(),e.createBlock(e.unref(j),{key:0,class:"w-5 h-5 text-primary-content hover:text-primary-base"})):(e.openBlock(),e.createBlock(e.unref(O),{key:1,class:"w-5 h-5 text-secondary-content hover:text-primary-base"}))])):e.createCommentVNode("",!0)]))}});const X={class:"space-y-1"},Y={key:2,class:"text-xs text-secondary-content select-none"},Z=e.defineComponent({__name:"OneFormField",props:V,setup(a){const t=a,{formId:o,validation:d}=k(),l=e.computed(()=>t.errors!=null&&t.errors.length>0?!0:t.name==null?!1:(d.value??{})[t.name]!=null);return e.provide("BaseFormField",{inputId:e.computed(()=>{const n=o.value||"form";if(t.id!=null)return`${n}-${t.id}`;if(t.name!=null)return`${n}-field-${t.name}`}),inputName:e.computed(()=>t.name),hasError:l}),(n,i)=>(e.openBlock(),e.createElementBlock("div",X,[n.label?(e.openBlock(),e.createBlock(v,{key:0,label:n.label},null,8,["label"])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default",{},()=>[e.createVNode(b)]),l.value?(e.openBlock(),e.createBlock(h,{key:1,errors:n.errors},null,8,["errors"])):n.hint.length>0?(e.openBlock(),e.createElementBlock("p",Y,e.toDisplayString(n.hint),1)):e.createCommentVNode("",!0)]))}});exports.OneForm=_;exports.OneFormFeedback=h;exports.OneFormField=Z;exports.OneFormInput=b;exports.OneFormLabel=v;