@oneb/ui-vue 0.2.7 → 0.2.10
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/{OneHelpMenu-a40ac0b4.js → OneHelpMenu-adc595d0.js} +26 -26
- package/dist/OneHelpMenu-b9ca7ee4.cjs +1 -0
- package/dist/SpinnerIcon-24e552a8.js +26 -0
- package/dist/SpinnerIcon-89c60210.cjs +1 -0
- package/dist/button/index.cjs +1 -1
- package/dist/button/index.js +142 -3
- package/dist/checkbox/checkbox.d.ts +41 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/common/index.cjs +5 -5
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.js +7 -4
- package/dist/dropdown/dropdown.d.ts +1 -1
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +14 -13
- package/dist/entityPicker/OneEntityPicker.vue.d.ts +2 -0
- package/dist/entityPicker/entityPicker.d.ts +179 -0
- package/dist/entityPicker/index.d.ts +4 -0
- package/dist/errorsPage/OneErrorPage.vue.d.ts +2 -0
- package/dist/errorsPage/errorsType.d.ts +21 -0
- package/dist/errorsPage/index.d.ts +2 -0
- package/dist/form/form.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +15 -4
- package/dist/index.js +9835 -223
- package/dist/infobox/OneInfobox.vue.d.ts +2 -0
- package/dist/infobox/box.d.ts +21 -0
- package/dist/infobox/index.d.ts +2 -0
- package/dist/infobox/util.d.ts +2 -0
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +47 -47
- package/dist/modal/OneModal.vue.d.ts +2 -0
- package/dist/modal/OneModalBody.vue.d.ts +2 -0
- package/dist/modal/OneModalFooter.vue.d.ts +2 -0
- package/dist/modal/OneModalHeader.vue.d.ts +2 -0
- package/dist/modal/index.d.ts +7 -0
- package/dist/modal/modal.d.ts +46 -0
- package/dist/modal/useModal.d.ts +3 -0
- package/dist/modal/util.d.ts +2 -0
- package/dist/periodPicker/OnePeriodPicker.vue.d.ts +2 -0
- package/dist/periodPicker/OnePeriodPickerFastModal.vue.d.ts +2 -0
- package/dist/periodPicker/index.d.ts +4 -0
- package/dist/periodPicker/periodPicker.d.ts +96 -0
- package/dist/periodPicker/util.d.ts +49 -0
- package/dist/radio/OneRadio.vue.d.ts +2 -0
- package/dist/radio/index.d.ts +2 -0
- package/dist/radio/radio.d.ts +22 -0
- package/dist/skeleton/OneSkeleton.vue.d.ts +2 -0
- package/dist/skeleton/index.d.ts +2 -0
- package/dist/skeleton/skeleton.d.ts +21 -0
- package/dist/skeleton/util.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/toast/OneToast.vue.d.ts +2 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/utils.d.ts +2 -0
- package/dist/tooltip/index.d.ts +2 -0
- package/package.json +131 -4
- package/dist/OneHelpMenu-2f5544f1.cjs +0 -1
- package/dist/index-6181061b.js +0 -165
- package/dist/index-9f8735d9.cjs +0 -1
- /package/dist/{button/SpinnerIcon.vue.d.ts → checkbox/OneCheckbox.vue.d.ts} +0 -0
- /package/dist/{switch → common}/SpinnerIcon.vue.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as z, ref as L, provide as X, computed as F, openBlock as t, createElementBlock as o, renderSlot as N, normalizeProps as R, guardReactiveProps as W, createCommentVNode as p, createVNode as w, Transition as Y, withCtx as I, normalizeClass as
|
|
1
|
+
import { defineComponent as z, ref as L, provide as X, computed as F, openBlock as t, createElementBlock as o, renderSlot as N, normalizeProps as R, guardReactiveProps as W, createCommentVNode as p, createVNode as w, Transition as Y, withCtx as I, normalizeClass as O, toDisplayString as a, inject as Z, withModifiers as ee, createBlock as j, resolveDynamicComponent as P, createElementVNode as e, Fragment as $, renderList as A, mergeProps as te, unref as b } from "vue";
|
|
2
2
|
import { _ as B } from "./OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
|
|
3
3
|
import { r as G } from "./XMarkIcon-51ef0691.js";
|
|
4
|
-
import {
|
|
4
|
+
import { OneButton as oe } from "./button/index.js";
|
|
5
5
|
import { _ as J } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
6
|
const ne = {
|
|
7
7
|
title: {
|
|
@@ -71,7 +71,7 @@ const ne = {
|
|
|
71
71
|
default: I(() => [
|
|
72
72
|
v.value ? (t(), o("div", {
|
|
73
73
|
key: 0,
|
|
74
|
-
class:
|
|
74
|
+
class: O(["menu", _.value]),
|
|
75
75
|
role: "menu",
|
|
76
76
|
"aria-orientation": "vertical",
|
|
77
77
|
tabindex: "-1"
|
|
@@ -96,7 +96,7 @@ const ne = {
|
|
|
96
96
|
return h.variant === "secondary" ? r.push("text-secondary-content hover:bg-secondary-body-hover") : h.variant === "danger" ? r.push("text-danger-content hover:bg-danger-10") : h.variant === "warning" ? r.push("text-warning-content hover:bg-warning-10") : h.variant === "info" ? r.push("text-info-content hover:bg-info-10") : r.push("hover:bg-secondary-body-hover"), r;
|
|
97
97
|
});
|
|
98
98
|
return (r, _) => (t(), o("button", {
|
|
99
|
-
class:
|
|
99
|
+
class: O(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap", d.value]),
|
|
100
100
|
onClick: ee(i, ["prevent"])
|
|
101
101
|
}, [
|
|
102
102
|
r.icon ? (t(), j(P(r.icon), {
|
|
@@ -220,7 +220,7 @@ const ae = {
|
|
|
220
220
|
return [
|
|
221
221
|
e("button", {
|
|
222
222
|
onClick: r,
|
|
223
|
-
class:
|
|
223
|
+
class: O(["p-1 rounded-full hover:bg-secondary-10", [_ ? "bg-secondary-25" : ""]])
|
|
224
224
|
}, [
|
|
225
225
|
w(B, {
|
|
226
226
|
text: ((n = i.user) == null ? void 0 : n.name) || "",
|
|
@@ -424,7 +424,7 @@ const ke = ["data-opened"], ye = {
|
|
|
424
424
|
}, be = { class: "flex justify-between items-center pt-3 mb-3" }, Ce = { class: "font-semibold text-xl px-3" }, $e = { class: "grid" }, Ae = { class: "rounded-lg m-3 border" }, Fe = {
|
|
425
425
|
class: "space-x-2 flex items-center px-3 py-2",
|
|
426
426
|
style: { width: "300px" }
|
|
427
|
-
}, Le = { class: "flex justify-between relative" }, je = { class: "flex items-center justify-between w-full text-left text-sm font-semibold" }, Me = { key: 0 }, Be = { class: "text-xs font-semibold" }, ze = { class: "px-3 py-2" },
|
|
427
|
+
}, Le = { class: "flex justify-between relative" }, je = { class: "flex items-center justify-between w-full text-left text-sm font-semibold" }, Me = { key: 0 }, Be = { class: "text-xs font-semibold" }, ze = { class: "px-3 py-2" }, Oe = { class: "text-secondary-content text-left pb-1 text-xs uppercase" }, Se = { class: "overflow-auto max-h-full" }, Ee = {
|
|
428
428
|
key: 0,
|
|
429
429
|
class: "space-y-2"
|
|
430
430
|
}, Ie = ["onClick"], Pe = { class: "flex" }, He = { class: "border border-secondary-stroke rounded-2xl w-14 h-14 md:w-14 md:h-14 flex items-center justify-center" }, Te = { class: "pl-2" }, Ve = { class: "text-sm mt-1 font-semibold" }, De = { class: "text9 mt-1" }, qe = {
|
|
@@ -449,7 +449,7 @@ const ke = ["data-opened"], ye = {
|
|
|
449
449
|
return t(), o("div", { "data-opened": c.value }, [
|
|
450
450
|
e("button", {
|
|
451
451
|
onClick: i,
|
|
452
|
-
class:
|
|
452
|
+
class: O(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10", { "bg-secondary-10": c.value }])
|
|
453
453
|
}, [
|
|
454
454
|
w(b(_e), { class: "text-secondary-base w-full p-1 hover:text-blue-600 m-auto" })
|
|
455
455
|
], 2),
|
|
@@ -503,12 +503,12 @@ const ke = ["data-opened"], ye = {
|
|
|
503
503
|
])
|
|
504
504
|
]),
|
|
505
505
|
e("div", ze, [
|
|
506
|
-
e("div",
|
|
507
|
-
e("div",
|
|
506
|
+
e("div", Oe, a((M = n.workspace) == null ? void 0 : M.appsLabel), 1),
|
|
507
|
+
e("div", Se, [
|
|
508
508
|
n.apps && n.apps.length ? (t(), o("div", Ee, [
|
|
509
509
|
(t(!0), o($, null, A(n.apps, (g) => (t(), o("div", {
|
|
510
510
|
key: g.id,
|
|
511
|
-
onClick: (
|
|
511
|
+
onClick: (S) => _(g),
|
|
512
512
|
class: "flex justify-between items-center rounded-lg hover:bg-secondary-10 p-2 bg-[#FAFAFA] cursor-pointer"
|
|
513
513
|
}, [
|
|
514
514
|
e("div", Pe, [
|
|
@@ -529,7 +529,7 @@ const ke = ["data-opened"], ye = {
|
|
|
529
529
|
w(oe, {
|
|
530
530
|
variant: "touch",
|
|
531
531
|
icon: b(we),
|
|
532
|
-
onClick: (
|
|
532
|
+
onClick: (S) => _(g)
|
|
533
533
|
}, null, 8, ["icon", "onClick"])
|
|
534
534
|
])
|
|
535
535
|
], 8, Ie))), 128))
|
|
@@ -637,11 +637,11 @@ const Ge = ["data-opened"], Je = {
|
|
|
637
637
|
k.value = !k.value;
|
|
638
638
|
};
|
|
639
639
|
return (l, m) => {
|
|
640
|
-
var y, M, g,
|
|
640
|
+
var y, M, g, S, H, T, V, D, q;
|
|
641
641
|
return t(), o("div", { "data-opened": c.value }, [
|
|
642
642
|
e("button", {
|
|
643
643
|
onClick: i,
|
|
644
|
-
class:
|
|
644
|
+
class: O(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10", { "bg-secondary-10": c.value }])
|
|
645
645
|
}, [
|
|
646
646
|
w(b(Re), { class: "text-secondary-base w-full p-1 hover:text-blue-600 m-auto" })
|
|
647
647
|
], 2),
|
|
@@ -672,7 +672,7 @@ const Ge = ["data-opened"], Je = {
|
|
|
672
672
|
])) : p("", !0),
|
|
673
673
|
e("div", et, [
|
|
674
674
|
e("div", tt, [
|
|
675
|
-
(
|
|
675
|
+
(S = l.help) != null && S.helpList && l.help.helpList.length ? (t(), o("div", ot, [
|
|
676
676
|
(t(!0), o($, null, A(l.help.helpList, (s) => (t(), o("div", {
|
|
677
677
|
key: s.id,
|
|
678
678
|
onClick: (E) => x(s.link, s),
|
|
@@ -753,16 +753,16 @@ const Ge = ["data-opened"], Je = {
|
|
|
753
753
|
});
|
|
754
754
|
const Mt = /* @__PURE__ */ J(yt, [["__scopeId", "data-v-071eaf70"]]);
|
|
755
755
|
export {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
756
|
+
jt as O,
|
|
757
|
+
ie as _,
|
|
758
|
+
U as a,
|
|
759
|
+
Lt as b,
|
|
760
|
+
Mt as c,
|
|
761
|
+
ne as d,
|
|
762
|
+
ue as e,
|
|
763
|
+
_e as f,
|
|
764
|
+
Q as g,
|
|
765
|
+
we as h,
|
|
766
|
+
Ue as i,
|
|
767
|
+
K as r
|
|
768
768
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),_=require("./OneAvatar.vue_vue_type_script_setup_true_lang-2d9f44f1.cjs"),S=require("./XMarkIcon-f94baa4c.cjs"),P=require("./button/index.cjs"),F=require("./_plugin-vue_export-helper-f246444f.cjs"),L={title:{type:String},stick:{type:String,default:"right"}},q={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},H=["data-opened"],I={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},D=e.defineComponent({__name:"OneDropdown",props:L,emits:["open","close"],setup(d,{emit:c}){const u=e.ref(!1),i=e.ref(null),s=c,l=d,a=()=>{u.value=!u.value,u.value?s("open"):s("close")};e.provide("OneDropdown",{onToggle:a});const n=e.computed(()=>{var f;const t=(f=i.value)==null?void 0:f.getBoundingClientRect(),p=t?t.x<270:!1;return t&&t.top+270>window.innerHeight?"up"+(p?"-right":"-left"):"down"+(p?"-right":"-left")}),k=e.computed(()=>{const t=["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 n.value.startsWith("up")?t.push("bottom-1 mb-10"):n.value.startsWith("down")&&t.push("top-1 mt-10"),l.stick==="right"?t.push("right-0"):l.stick==="left"&&t.push("left-0"),t});return(t,p)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:i,"data-opened":u.value},[e.renderSlot(t.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:a,isExpanded:u.value}))),u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:a})):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(()=>[u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",k.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[t.title?(e.openBlock(),e.createElementBlock("div",I,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:a})))],2)):e.createCommentVNode("",!0)]),_:3})],8,H))}}),B=e.defineComponent({__name:"OneDropdownItem",props:q,emits:["click"],setup(d,{emit:c}){const u=c,i=d,s=e.inject("OneDropdown"),l=()=>{s!==void 0&&s.onToggle(),u("click")},a=e.computed(()=>{const n=[];return i.variant==="secondary"?n.push("text-secondary-content hover:bg-secondary-body-hover"):i.variant==="danger"?n.push("text-danger-content hover:bg-danger-10"):i.variant==="warning"?n.push("text-warning-content hover:bg-warning-10"):i.variant==="info"?n.push("text-info-content hover:bg-info-10"):n.push("hover:bg-secondary-body-hover"),n});return(n,k)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",a.value]),onClick:e.withModifiers(l,["prevent"])},[n.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.icon),{key:0,class:"w-4 h-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(n.label),1)],2))}});function T(d,c){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 R={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},app:{type:Object},accountLabel:{type:String,default:"Account"},logoutLabel:{type:String,default:"Logout"},versionLabel:{type:String,default:""},onAccount:{type:Function},onLogout:{type:Function}},M={workspace:{type:Object,required:!0},workspaces:{type:Array},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},appsTitle:{type:String,default:"Ваші додатки"},changeLabel:{type:String,default:"Керувати робочими просторами"},onChange:{type:Function},onApp:{type:Function}},W={help:{type:Object,required:!0}},U=["onClick"],X={class:"flex flex-col items-center pt-5 pb-2 h-full"},G={class:"flex flex-col px-10 py-1 mt-2 text-center"},J={class:"self-center text-base font-medium tracking-wide text-black"},K={class:"mt-1 text-xs leading-5 text-blue-500 font-light"},Q={class:"text-left w-full mt-5 px-3"},Y={class:"-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400"},Z=e.defineComponent({__name:"OneUserMenu",props:R,setup(d){const c=d,u=e.computed(()=>{var l;return(l=c.menu)==null?void 0:l.map(a=>{let n={label:a.label};a.icon!=null&&(n={...n,icon:a.icon});const k=typeof a.click=="function"?a.click:()=>{};return{key:a.label,args:n,click:k}})}),i=()=>{typeof c.onAccount=="function"&&c.onAccount()},s=()=>{typeof c.onLogout=="function"&&c.onLogout()};return(l,a)=>(e.openBlock(),e.createBlock(D,{stick:"right"},{button:e.withCtx(({onToggle:n,isExpanded:k})=>{var t,p;return[e.createElementVNode("button",{onClick:n,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[k?"bg-secondary-25":""]])},[e.createVNode(_._sfc_main,{text:((t=l.user)==null?void 0:t.name)||"",size:l.iconSize,src:(p=l.user)==null?void 0:p.photo_url,rounded:!0},null,8,["text","size","src"])],10,U)]}),menu:e.withCtx(()=>{var n,k,t,p,f;return[e.createElementVNode("div",X,[e.createVNode(_._sfc_main,{text:((n=l.user)==null?void 0:n.name)||"",size:80,src:(k=l.user)==null?void 0:k.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"]),e.createElementVNode("div",G,[e.createElementVNode("div",J,e.toDisplayString((t=l.user)==null?void 0:t.name),1),e.createElementVNode("div",K,e.toDisplayString((p=l.user)==null?void 0:p.email),1)]),typeof c.onAccount=="function"?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:i,class:"cursor-pointer justify-center px-8 py-2 mt-3 text-xs font-semibold tracking-wide leading-5 text-gray-600 border border-solid bg-neutral-100 border-slate-200 rounded-[50px] hover:bg-neutral-200"},e.toDisplayString(l.accountLabel),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,v=>(e.openBlock(),e.createBlock(B,e.mergeProps({key:v.key,ref_for:!0},v.args,{onClick:v.click}),null,16,["onClick"]))),128)),typeof l.onLogout=="function"?(e.openBlock(),e.createBlock(B,{key:0,icon:e.unref(T),label:l.logoutLabel,class:"rounded py-3",onClick:s},null,8,["icon","label"])):e.createCommentVNode("",!0)]),a[0]||(a[0]=e.createElementVNode("div",{class:"space-y-2 text-center",style:{width:"240px"}},null,-1)),e.createElementVNode("div",Y,e.toDisplayString((f=l.app)==null?void 0:f.version),1)])]}),_:1}))}});function z(d,c){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"})])}function b(d,c){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"})])}function E(d,c){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:"M4.5 15.75l7.5-7.5 7.5 7.5"})])}function j(d,c){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:"M8.25 4.5l7.5 7.5-7.5 7.5"})])}const ee=["data-opened"],te={key:1,class:"absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white px-3 z-10"},oe={class:"flex justify-between items-center pt-3 mb-3"},ne={class:"font-semibold text-xl px-3"},re={class:"grid"},le={class:"rounded-lg m-3 border"},se={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},ce={class:"flex justify-between relative"},ae={class:"flex items-center justify-between w-full text-left text-sm font-semibold"},ie={key:0},de={class:"text-xs font-semibold"},ue={class:"px-3 py-2"},pe={class:"text-secondary-content text-left pb-1 text-xs uppercase"},me={class:"overflow-auto max-h-full"},he={key:0,class:"space-y-2"},ke=["onClick"],fe={class:"flex"},ge={class:"border border-secondary-stroke rounded-2xl w-14 h-14 md:w-14 md:h-14 flex items-center justify-center"},ve={class:"pl-2"},xe={class:"text-sm mt-1 font-semibold"},_e={class:"text9 mt-1"},ye={key:1,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"},we=e.defineComponent({__name:"OneBrowserMenu",props:M,emits:["open","close"],setup(d,{emit:c}){const u=c,i=d,s=e.ref(!1),l=()=>{s.value=!s.value,s.value?u("open"):u("close")},a=e.ref(!1);e.computed(()=>a.value?E:b);const n=()=>{typeof i.onChange=="function"&&i.onChange()},k=t=>{typeof i.onApp=="function"&&i.onApp(t)};return(t,p)=>{var f,v,r,m,g,x;return e.openBlock(),e.createElementBlock("div",{"data-opened":s.value},[e.createElementVNode("button",{onClick:l,class:e.normalizeClass(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10",{"bg-secondary-10":s.value}])},[e.createVNode(e.unref(z),{class:"text-secondary-base w-full p-1 hover:text-blue-600 m-auto"})],2),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10 bg-black/10",onClick:l})):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",oe,[e.createElementVNode("div",ne,e.toDisplayString((f=t.workspace)==null?void 0:f.title),1),e.createVNode(e.unref(S.render),{class:"w-6 cursor-pointer",onClick:l})]),e.createElementVNode("div",re,[e.createElementVNode("div",le,[e.createElementVNode("div",se,[e.createElementVNode("div",ce,[e.createVNode(_._sfc_main,{text:((v=t.workspace)==null?void 0:v.name)||"",src:(r=t.workspace)==null?void 0:r.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",ae,e.toDisplayString((m=t.workspace)==null?void 0:m.name),1)]),a.value?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.workspaces,h=>(e.openBlock(),e.createElementBlock("div",{key:h.name,class:"flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"},[e.createVNode(_._sfc_main,{text:h.name,src:h.photo_url,size:30,rounded:!1},null,8,["text","src"]),e.createElementVNode("span",de,e.toDisplayString(h.name),1)]))),128))])):e.createCommentVNode("",!0),p[0]||(p[0]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("div",{onClick:n,class:"text-center py-2 cursor-pointer",style:{"font-size":"10px"}},e.toDisplayString((g=t.workspace)==null?void 0:g.changeLabel),1)])]),e.createElementVNode("div",ue,[e.createElementVNode("div",pe,e.toDisplayString((x=t.workspace)==null?void 0:x.appsLabel),1),e.createElementVNode("div",me,[t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("div",he,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.apps,h=>(e.openBlock(),e.createElementBlock("div",{key:h.id,onClick:y=>k(h),class:"flex justify-between items-center rounded-lg hover:bg-secondary-10 p-2 bg-[#FAFAFA] cursor-pointer"},[e.createElementVNode("div",fe,[e.createElementVNode("div",ge,[e.createVNode(_._sfc_main,{text:h.name,src:h.photo_url,size:44,rounded:!1},null,8,["text","src"])]),e.createElementVNode("div",ve,[e.createElementVNode("p",xe,e.toDisplayString(h.name),1),e.createElementVNode("p",_e,e.toDisplayString(h==null?void 0:h.short),1)])]),e.createElementVNode("div",null,[e.createVNode(P.OneButton,{variant:"touch",icon:e.unref(j),onClick:y=>k(h)},null,8,["icon","onClick"])])],8,ke))),128))])):e.createCommentVNode("",!0),t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("button",ye,e.toDisplayString("Дивитися всі"))):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],8,ee)}}});const Be=F._export_sfc(we,[["__scopeId","data-v-2628df74"]]);function be(d,c){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:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})])}function Ee(d,c){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:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"})])}function O(d,c){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:"M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418"})])}const Ve=["data-opened"],Ne={key:1,class:"absolute top-0 right-0 h-screen max-w-96 bg-white px-3 z-10 flex flex-col"},Ce={class:"flex justify-between items-center pt-3 mb-3"},$e={class:"font-semibold text-xl px-3"},Ae={key:0,class:"grid grid-cols-3 bg-[#FAFAFA] rounded-xl text-[#525B66] mb-2"},Se=["onClick"],Fe={class:"uppercase text-[8px]"},Le={class:"overflow-y-auto grid rounded-xl"},De={class:"max-h-full bg-[#FAFAFA]"},Me={key:0,class:"space-y-2"},ze=["onClick"],je={class:"flex"},Oe={class:"pl-2"},Pe={class:"text-sm mt-1 font-semibold"},qe={class:"text-[10px] mt-1 text-[#979CA9]"},He={class:"mt-auto"},Ie={key:0},Te=["onClick"],Re={class:"flex items-center space-x-3"},We={class:"h-16"},Ue={key:0,class:"bg-[#FAFAFA] rounded-lg p-3"},Xe={class:"flex justify-between"},Ge=["onClick"],Je={key:0,class:"tooltip-text min-w-[70px]"},Ke={class:"flex justify-between mb-4"},Qe=["href"],Ye={class:"flex flex-nowrap items-center w-max h-[24px]"},Ze={class:"whitespace-nowrap overflow-hidden text-ellipsis text-left flex-shrink w-full text-[#525B66]"},et={class:"py-[8px] pl-0 pr-[8px]"},tt=e.defineComponent({__name:"OneHelpMenu",props:W,emits:["open","close"],setup(d,{emit:c}){const u=c,i=d,s=e.ref(!1),l=()=>{s.value=!s.value,s.value?u("open"):u("close")},a=e.computed(()=>f.value?E:b),n=e.ref(3),k=e.computed(()=>{var m,g;const r=((g=(m=i.help)==null?void 0:m.helpList)==null?void 0:g.length)||0;return n.value===r});e.computed(()=>{var m;return(((m=i.help)==null?void 0:m.helpList)||[]).slice(0,n.value)});const t=()=>{var m,g;const r=((g=(m=i.help)==null?void 0:m.helpList)==null?void 0:g.length)||0;n.value=k.value?3:r},p=(r,m)=>{r&&m&&typeof m.openLink=="function"?m.openLink(m):r&&window.open(r,"_blank")},f=e.ref(!1),v=()=>{f.value=!f.value};return(r,m)=>{var g,x,h,y,V,N,C,$,A;return e.openBlock(),e.createElementBlock("div",{"data-opened":s.value},[e.createElementVNode("button",{onClick:l,class:e.normalizeClass(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10",{"bg-secondary-10":s.value}])},[e.createVNode(e.unref(be),{class:"text-secondary-base w-full p-1 hover:text-blue-600 m-auto"})],2),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10 bg-black/10 flex flex-col",onClick:l})):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",Ce,[e.createElementVNode("div",$e,e.toDisplayString((g=r.help)==null?void 0:g.label),1),e.createVNode(e.unref(S.render),{class:"w-6 cursor-pointer",onClick:l})]),(x=r.help)!=null&&x.helpButton?(e.openBlock(),e.createElementBlock("div",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((h=r.help)==null?void 0:h.helpButton,o=>(e.openBlock(),e.createElementBlock("button",{key:o.name,onClick:w=>p(o.link,o),class:"grid justify-center space-y-2 hover:bg-slate-100 p-3 rounded-xl hover:text-blue-500"},[e.createElementVNode("div",null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o==null?void 0:o.icon),{class:"w-[16px] h-[16px] mx-auto"}))]),e.createElementVNode("span",Fe,e.toDisplayString(o.name),1)],8,Se))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[e.createElementVNode("div",De,[(y=r.help)!=null&&y.helpList&&r.help.helpList.length?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.help.helpList,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,onClick:w=>p(o.link,o),class:"flex justify-between items-center rounded-lg hover:bg-slate-100 p-2 cursor-pointer hover:text-[#4089E0]"},[e.createElementVNode("div",je,[e.createElementVNode("div",Oe,[e.createElementVNode("p",Pe,e.toDisplayString(o.name),1),e.createElementVNode("p",qe,e.toDisplayString(o.category),1)])])],8,ze))),128))])):e.createCommentVNode("",!0)])]),(V=r.help)!=null&&V.helpList&&r.help.helpList.length<0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:t,class:"h-11 w-full bg-[#FAFAFA] hover:bg-slate-100 p-3 text-[#525B66] rounded-b-xl text-xs hover:text-[#4089E0] font-medium"},e.toDisplayString(k.value?r.help.buttNoMore:r.help.buttMore),1)):e.createCommentVNode("",!0),e.createElementVNode("div",He,[(N=r.help)!=null&&N.video?(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.help.video,o=>(e.openBlock(),e.createElementBlock("button",{key:o.id,onClick:w=>p(o.link,o),class:"flex items-center space-x-3 mt-2 w-full bg-[#FAFAFA] hover:bg-slate-100 p-4 text-[#525B66] rounded-lg text-sm hover:text-[#4089E0] font-medium"},[e.createVNode(e.unref(Ee),{class:"w-6 h-6"}),e.createElementVNode("span",null,e.toDisplayString(o.name),1)],8,Te))),128))])):e.createCommentVNode("",!0),(C=r.help)!=null&&C.socialList?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:v,class:"flex items-center justify-between mt-2 w-full bg-[#FAFAFA] hover:bg-slate-100 p-4 text-[#525B66] rounded-lg text-sm hover:text-[#4089E0] font-medium"},[e.createElementVNode("div",Re,[e.createVNode(e.unref(O),{class:"w-6 h-6"}),e.createElementVNode("span",null,e.toDisplayString(r.help.socialButt),1)]),e.createVNode(e.unref(a),{class:"w-4 h-4"})])):e.createCommentVNode("",!0),e.createElementVNode("div",We,[f.value?(e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(($=r.help)==null?void 0:$.socialList,o=>(e.openBlock(),e.createElementBlock("button",{key:o.id,onClick:w=>p(o.link,o),class:"flex items-center space-x-2 p-2 rounded-lg hover:bg-slate-100 hover:text-blue-500 tooltip"},[e.createElementVNode("div",null,[o.name?(e.openBlock(),e.createElementBlock("div",Je,e.toDisplayString(o.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o==null?void 0:o.icon),{class:"w-[24px] h-[24px] mx-auto"}))])],8,Ge))),128))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((A=r.help)==null?void 0:A.termsOffer,o=>(e.openBlock(),e.createElementBlock("a",{key:o.name,target:"_blank",href:o.link,class:"ml-2 flex items-center rounded-lg text-xs hover:underline font-extralight cursor-pointer"},[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("span",et,e.toDisplayString(o.name),1)])])],8,Qe))),128))])])])):e.createCommentVNode("",!0)],8,Ve)}}});const ot=F._export_sfc(tt,[["__scopeId","data-v-071eaf70"]]);exports.OneBrowserMenu=Be;exports.OneHelpMenu=ot;exports._sfc_main=D;exports._sfc_main$1=B;exports._sfc_main$2=Z;exports.browserMenuProps=M;exports.dropdownProps=L;exports.render=b;exports.render$1=z;exports.render$2=E;exports.render$3=j;exports.render$4=O;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { openBlock as n, createElementBlock as o, createElementVNode as t } from "vue";
|
|
2
|
+
import { _ as s } from "./_plugin-vue_export-helper-dad06003.js";
|
|
3
|
+
const i = {}, r = {
|
|
4
|
+
class: "spinner",
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
style: { animation: "one-sp-ico-rot 2.7s linear infinite" }
|
|
8
|
+
};
|
|
9
|
+
function c(l, e) {
|
|
10
|
+
return n(), o("svg", r, e[0] || (e[0] = [
|
|
11
|
+
t("circle", {
|
|
12
|
+
style: { "stroke-linecap": "round", animation: "one-sp-ico-dash 1.7s ease-in-out infinite" },
|
|
13
|
+
class: "opacity-75",
|
|
14
|
+
cx: "12",
|
|
15
|
+
cy: "12",
|
|
16
|
+
r: "8",
|
|
17
|
+
fill: "none",
|
|
18
|
+
stroke: "currentColor",
|
|
19
|
+
"stroke-width": "2"
|
|
20
|
+
}, null, -1)
|
|
21
|
+
]));
|
|
22
|
+
}
|
|
23
|
+
const p = /* @__PURE__ */ s(i, [["render", c]]);
|
|
24
|
+
export {
|
|
25
|
+
p as S
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),t=require("./_plugin-vue_export-helper-f246444f.cjs");const o={},i={class:"spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{animation:"one-sp-ico-rot 2.7s linear infinite"}};function r(c,n){return e.openBlock(),e.createElementBlock("svg",i,n[0]||(n[0]=[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)]))}const s=t._export_sfc(o,[["render",r]]);exports.SpinnerIcon=s;
|
package/dist/button/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("../SpinnerIcon-89c60210.cjs");require("../_plugin-vue_export-helper-f246444f.cjs");const g={variant:{type:String,default:"primary"},size:{type:String,default:"md"},label:{type:String},labelClass:{type:String,default:""},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]},iconAfter:{type:[Function,Object,String]}},v=["relative inline-flex","border","items-center justify-center","font-medium whitespace-nowrap","disabled:opacity-50 disabled:cursor-default","focus:outline-none focus:ring-2","transition-colors duration-200"],y={sm:["px-2 py-1 text-sm"],md:["px-3 py-2"],lg:["px-4 py-3"]},f={primary:["rounded-md border-transparent bg-primary-base disabled:bg-primary-hover text-sm 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 text-sm hover:bg-primary-body-hover focus:ring-tertiary-glow"],info:["rounded-md border-transparent bg-info-base disabled:bg-info-hover text-white text-sm hover:bg-info-hover focus:ring-info-glow"],success:["rounded-md border-transparent bg-success-base disabled:bg-success-hover text-white text-sm hover:bg-success-hover focus:ring-success-glow"],warning:["rounded-md border-transparent bg-warning-base disabled:bg-warning-hover text-white text-sm hover:bg-warning-hover focus:ring-warning-glow"],danger:["rounded-md border-transparent bg-danger-base disabled:bg-danger-hover text-white text-sm hover:bg-danger-hover focus:ring-danger-glow"],touch:["rounded-full border-transparent text-black hover:bg-primary-body-hover hover:shadow p-3 text-sm focus:ring-tertiary-glow"],link:["rounded-md border-transparent items-center text-info-base hover:text-info-hover text-sm"],none:["rounded-md border-transparent text-gray-500"],mini:["rounded-full border-transparent bg-[#FAFAFA] text-sm hover:text-green-500 disabled:text-[#525B66] focus:ring-2"]},h=(l="primary",i="md")=>{const o=[];return o.push(...v),o.push(...f[l]??[]),l!=="touch"&&o.push(...y[i]??[]),o},k=["disabled","title","type"],C=e.defineComponent({__name:"OneButton",props:g,emits:["click"],setup(l,{emit:i}){const o=i,s=l,u=()=>{o("click")},n=e.computed(()=>s.icon),r=e.computed(()=>s.iconAfter),d=e.computed(()=>{const t=h(s.variant,s.size);return s.variant==="touch"&&s.active&&t.push("bg-primary-body-active"),t}),p=e.computed(()=>s.disabled||s.isLoading),m=e.computed(()=>s.label&&s.label.length>0&&s.variant!=="touch"),b=e.computed(()=>{const t=["inline-block text-ellipsis overflow-hidden"];return n.value!=null&&t.push("ml-2"),r.value!=null&&t.push("mr-2"),s.labelClass!=null&&t.push(s.labelClass),t}),a=e.computed(()=>{const t=[];return s.size==="sm"?t.push("w-3 h-3"):s.size==="lg"?t.push("w-5 h-5"):t.push("w-4 h-4"),typeof s.iconClass=="string"?t.push(s.iconClass):s.iconClass instanceof Array&&t.push(...s.iconClass),t});return(t,B)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(d.value),disabled:p.value,title:t.label,type:t.isSubmit?"submit":"button",onClick:e.withModifiers(u,["stop"])},[n.value!=null&&t.isLoading?(e.openBlock(),e.createBlock(c.SpinnerIcon,{key:0,class:e.normalizeClass(a.value)},null,8,["class"])):typeof n.value=="string"?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(a.value)},e.toDisplayString(n.value),3)):n.value!=null?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),{key:2,class:e.normalizeClass(a.value)},null,8,["class"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(b.value)},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],2)):e.createCommentVNode("",!0),r.value!=null&&t.isLoading?(e.openBlock(),e.createBlock(c.SpinnerIcon,{key:4,class:e.normalizeClass(a.value)},null,8,["class"])):typeof r.value=="string"?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(a.value)},e.toDisplayString(r.value),3)):r.value!=null?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:6,class:e.normalizeClass(a.value)},null,8,["class"])):e.createCommentVNode("",!0)],10,k))}});exports.OneButton=C;
|
package/dist/button/index.js
CHANGED
|
@@ -1,6 +1,145 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
1
|
+
import { defineComponent as C, computed as r, openBlock as t, createElementBlock as c, normalizeClass as n, withModifiers as k, createBlock as d, toDisplayString as b, resolveDynamicComponent as m, createCommentVNode as g, renderSlot as B, createTextVNode as S } from "vue";
|
|
2
|
+
import { S as f } from "../SpinnerIcon-24e552a8.js";
|
|
3
3
|
import "../_plugin-vue_export-helper-dad06003.js";
|
|
4
|
+
const L = {
|
|
5
|
+
variant: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: "primary"
|
|
8
|
+
},
|
|
9
|
+
size: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: "md"
|
|
12
|
+
},
|
|
13
|
+
label: {
|
|
14
|
+
type: String
|
|
15
|
+
},
|
|
16
|
+
labelClass: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
icon: {
|
|
21
|
+
type: [Function, Object]
|
|
22
|
+
},
|
|
23
|
+
isLoading: {
|
|
24
|
+
type: Boolean
|
|
25
|
+
},
|
|
26
|
+
isSubmit: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
disabled: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
active: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
},
|
|
38
|
+
iconClass: {
|
|
39
|
+
type: [String, Array]
|
|
40
|
+
},
|
|
41
|
+
iconAfter: {
|
|
42
|
+
type: [Function, Object, String]
|
|
43
|
+
}
|
|
44
|
+
}, A = [
|
|
45
|
+
"relative inline-flex",
|
|
46
|
+
"border",
|
|
47
|
+
"items-center justify-center",
|
|
48
|
+
"font-medium whitespace-nowrap",
|
|
49
|
+
"disabled:opacity-50 disabled:cursor-default",
|
|
50
|
+
"focus:outline-none focus:ring-2",
|
|
51
|
+
"transition-colors duration-200"
|
|
52
|
+
], z = {
|
|
53
|
+
sm: ["px-2 py-1 text-sm"],
|
|
54
|
+
md: ["px-3 py-2"],
|
|
55
|
+
lg: ["px-4 py-3"]
|
|
56
|
+
}, F = {
|
|
57
|
+
primary: [
|
|
58
|
+
"rounded-md border-transparent bg-primary-base disabled:bg-primary-hover text-sm text-white hover:bg-primary-hover focus:ring-primary-glow"
|
|
59
|
+
],
|
|
60
|
+
secondary: [
|
|
61
|
+
"rounded-md border-primary-stroke bg-primary-body disabled:bg-primary-body-hover text-black text-sm hover:bg-primary-body-hover focus:ring-tertiary-glow"
|
|
62
|
+
],
|
|
63
|
+
info: [
|
|
64
|
+
"rounded-md border-transparent bg-info-base disabled:bg-info-hover text-white text-sm hover:bg-info-hover focus:ring-info-glow"
|
|
65
|
+
],
|
|
66
|
+
success: [
|
|
67
|
+
"rounded-md border-transparent bg-success-base disabled:bg-success-hover text-white text-sm hover:bg-success-hover focus:ring-success-glow"
|
|
68
|
+
],
|
|
69
|
+
warning: [
|
|
70
|
+
"rounded-md border-transparent bg-warning-base disabled:bg-warning-hover text-white text-sm hover:bg-warning-hover focus:ring-warning-glow"
|
|
71
|
+
],
|
|
72
|
+
danger: [
|
|
73
|
+
"rounded-md border-transparent bg-danger-base disabled:bg-danger-hover text-white text-sm hover:bg-danger-hover focus:ring-danger-glow"
|
|
74
|
+
],
|
|
75
|
+
touch: [
|
|
76
|
+
"rounded-full border-transparent text-black hover:bg-primary-body-hover hover:shadow p-3 text-sm focus:ring-tertiary-glow"
|
|
77
|
+
],
|
|
78
|
+
link: [
|
|
79
|
+
"rounded-md border-transparent items-center text-info-base hover:text-info-hover text-sm"
|
|
80
|
+
],
|
|
81
|
+
none: ["rounded-md border-transparent text-gray-500"],
|
|
82
|
+
mini: [
|
|
83
|
+
"rounded-full border-transparent bg-[#FAFAFA] text-sm hover:text-green-500 disabled:text-[#525B66] focus:ring-2"
|
|
84
|
+
]
|
|
85
|
+
}, I = (u = "primary", p = "md") => {
|
|
86
|
+
const a = [];
|
|
87
|
+
return a.push(...A), a.push(...F[u] ?? []), u !== "touch" && a.push(...z[p] ?? []), a;
|
|
88
|
+
}, O = ["disabled", "title", "type"], _ = /* @__PURE__ */ C({
|
|
89
|
+
__name: "OneButton",
|
|
90
|
+
props: L,
|
|
91
|
+
emits: ["click"],
|
|
92
|
+
setup(u, { emit: p }) {
|
|
93
|
+
const a = p, s = u, h = () => {
|
|
94
|
+
a("click");
|
|
95
|
+
}, o = r(() => s.icon), l = r(() => s.iconAfter), v = r(() => {
|
|
96
|
+
const e = I(s.variant, s.size);
|
|
97
|
+
return s.variant === "touch" && s.active && e.push("bg-primary-body-active"), e;
|
|
98
|
+
}), y = r(() => s.disabled || s.isLoading), w = r(() => s.label && s.label.length > 0 && s.variant !== "touch"), x = r(() => {
|
|
99
|
+
const e = ["inline-block text-ellipsis overflow-hidden"];
|
|
100
|
+
return o.value != null && e.push("ml-2"), l.value != null && e.push("mr-2"), s.labelClass != null && e.push(s.labelClass), e;
|
|
101
|
+
}), i = r(() => {
|
|
102
|
+
const e = [];
|
|
103
|
+
return s.size === "sm" ? e.push("w-3 h-3") : s.size === "lg" ? e.push("w-5 h-5") : e.push("w-4 h-4"), typeof s.iconClass == "string" ? e.push(s.iconClass) : s.iconClass instanceof Array && e.push(...s.iconClass), e;
|
|
104
|
+
});
|
|
105
|
+
return (e, j) => (t(), c("button", {
|
|
106
|
+
class: n(v.value),
|
|
107
|
+
disabled: y.value,
|
|
108
|
+
title: e.label,
|
|
109
|
+
type: e.isSubmit ? "submit" : "button",
|
|
110
|
+
onClick: k(h, ["stop"])
|
|
111
|
+
}, [
|
|
112
|
+
o.value != null && e.isLoading ? (t(), d(f, {
|
|
113
|
+
key: 0,
|
|
114
|
+
class: n(i.value)
|
|
115
|
+
}, null, 8, ["class"])) : typeof o.value == "string" ? (t(), c("span", {
|
|
116
|
+
key: 1,
|
|
117
|
+
class: n(i.value)
|
|
118
|
+
}, b(o.value), 3)) : o.value != null ? (t(), d(m(o.value), {
|
|
119
|
+
key: 2,
|
|
120
|
+
class: n(i.value)
|
|
121
|
+
}, null, 8, ["class"])) : g("", !0),
|
|
122
|
+
w.value ? (t(), c("span", {
|
|
123
|
+
key: 3,
|
|
124
|
+
class: n(x.value)
|
|
125
|
+
}, [
|
|
126
|
+
B(e.$slots, "default", {}, () => [
|
|
127
|
+
S(b(e.label), 1)
|
|
128
|
+
])
|
|
129
|
+
], 2)) : g("", !0),
|
|
130
|
+
l.value != null && e.isLoading ? (t(), d(f, {
|
|
131
|
+
key: 4,
|
|
132
|
+
class: n(i.value)
|
|
133
|
+
}, null, 8, ["class"])) : typeof l.value == "string" ? (t(), c("span", {
|
|
134
|
+
key: 5,
|
|
135
|
+
class: n(i.value)
|
|
136
|
+
}, b(l.value), 3)) : l.value != null ? (t(), d(m(l.value), {
|
|
137
|
+
key: 6,
|
|
138
|
+
class: n(i.value)
|
|
139
|
+
}, null, 8, ["class"])) : g("", !0)
|
|
140
|
+
], 10, O));
|
|
141
|
+
}
|
|
142
|
+
});
|
|
4
143
|
export {
|
|
5
|
-
|
|
144
|
+
_ as OneButton
|
|
6
145
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
export type CheckboxColorType = 'green' | 'blue' | 'red' | 'yellow';
|
|
3
|
+
export type CheckboxSizeType = 'sm' | 'md';
|
|
4
|
+
export type CheckboxTextPositionType = 'left' | 'right';
|
|
5
|
+
export type CheckboxModelValue = boolean;
|
|
6
|
+
export declare const checkboxProps: {
|
|
7
|
+
color: {
|
|
8
|
+
type: PropType<CheckboxColorType>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
textPosition: {
|
|
12
|
+
type: PropType<CheckboxTextPositionType>;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
isChecked: {
|
|
16
|
+
type: PropType<boolean>;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
isLoading: {
|
|
20
|
+
required: boolean;
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
disabled: {
|
|
25
|
+
required: boolean;
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
textOn: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
textOff: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
textClass: {
|
|
38
|
+
type: PropType<string | string[]>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type checkboxProps = ExtractPropTypes<typeof checkboxProps>;
|