@oneb/ui-vue 0.2.4 → 0.2.7
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/README.md +7 -9
- package/dist/OneHelpMenu-2f5544f1.cjs +1 -0
- package/dist/{OneHelpMenu-37653a53.js → OneHelpMenu-a40ac0b4.js} +113 -112
- package/dist/button/button.d.ts +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/util.d.ts +1 -1
- package/dist/buttonGroup/props.d.ts +1 -1
- package/dist/card/card.d.ts +1 -1
- package/dist/common/avatar.d.ts +1 -1
- package/dist/dropdown/dropdown.d.ts +1 -1
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +3 -3
- package/dist/dropdown/menu.d.ts +1 -1
- package/dist/form/form.d.ts +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +1 -3
- package/dist/{index-f8afb6b6.js → index-6181061b.js} +28 -12
- package/dist/index.cjs +1 -1
- package/dist/index.js +39 -33
- package/dist/indicators/indicators.d.ts +1 -1
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +23 -12
- package/dist/layout/layout.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/switch/switch.d.ts +1 -1
- package/package.json +1 -1
- package/dist/OneHelpMenu-05780713.cjs +0 -1
package/dist/card/card.d.ts
CHANGED
package/dist/common/avatar.d.ts
CHANGED
package/dist/dropdown/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("../OneHelpMenu-05780713.cjs"),c=require("vue"),Pt=require("../_plugin-vue_export-helper-f246444f.cjs"),wt=require("../OneAvatar.vue_vue_type_script_setup_true_lang-2d9f44f1.cjs");require("../XMarkIcon-f94baa4c.cjs");require("../index-9f8735d9.cjs");const st=Math.min,P=Math.max,K=Math.round,G=Math.floor,O=t=>({x:t,y:t}),Mt={left:"right",right:"left",bottom:"top",top:"bottom"},$t={start:"end",end:"start"};function ct(t,e){return typeof t=="function"?t(e):t}function $(t){return t.split("-")[0]}function Z(t){return t.split("-")[1]}function zt(t){return t==="x"?"y":"x"}function Ot(t){return t==="y"?"height":"width"}function j(t){return["top","bottom"].includes($(t))?"y":"x"}function Ct(t){return zt(j(t))}function Wt(t,e,o){o===void 0&&(o=!1);const n=Z(t),i=Ct(t),r=Ot(i);let s=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=J(s)),[s,J(s)]}function Ht(t){const e=J(t);return[rt(t),e,rt(e)]}function rt(t){return t.replace(/start|end/g,e=>$t[e])}function qt(t,e,o){const n=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return o?e?i:n:e?n:i;case"left":case"right":return e?r:s;default:return[]}}function It(t,e,o,n){const i=Z(t);let r=qt($(t),o==="start",n);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(rt)))),r}function J(t){return t.replace(/left|right|bottom|top/g,e=>Mt[e])}function jt(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ut(t){return typeof t!="number"?jt(t):{top:t,right:t,bottom:t,left:t}}function Q(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function yt(t,e,o){let{reference:n,floating:i}=t;const r=j(e),s=Ct(e),l=Ot(s),a=$(e),f=r==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,m=n[l]/2-i[l]/2;let p;switch(a){case"top":p={x:u,y:n.y-i.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}switch(Z(e)){case"start":p[s]-=m*(o&&f?-1:1);break;case"end":p[s]+=m*(o&&f?-1:1);break}return p}const Yt=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=o,l=r.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=yt(f,n,a),m=n,p={},h=0;for(let w=0;w<l.length;w++){const{name:y,fn:g}=l[w],{x:v,y:b,data:_,reset:x}=await g({x:u,y:d,initialPlacement:n,placement:m,strategy:i,middlewareData:p,rects:f,platform:s,elements:{reference:t,floating:e}});u=v??u,d=b??d,p={...p,[y]:{...p[y],..._}},x&&h<=50&&(h++,typeof x=="object"&&(x.placement&&(m=x.placement),x.rects&&(f=x.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):x.rects),{x:u,y:d}=yt(f,m,a)),w=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:p}};async function Xt(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=ct(e,t),h=Ut(p),y=l[m?d==="floating"?"reference":"floating":d],g=Q(await r.getClippingRect({element:(o=await(r.isElement==null?void 0:r.isElement(y)))==null||o?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:f,rootBoundary:u,strategy:a})),v=d==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),_=await(r.isElement==null?void 0:r.isElement(b))?await(r.getScale==null?void 0:r.getScale(b))||{x:1,y:1}:{x:1,y:1},x=Q(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:b,strategy:a}):v);return{top:(g.top-x.top+h.top)/_.y,bottom:(x.bottom-g.bottom+h.bottom)/_.y,left:(g.left-x.left+h.left)/_.x,right:(x.right-g.right+h.right)/_.x}}const Gt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:f}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:w=!0,...y}=ct(t,e);if((o=r.arrow)!=null&&o.alignmentOffset)return{};const g=$(i),v=j(l),b=$(l)===l,_=await(a.isRTL==null?void 0:a.isRTL(f.floating)),x=m||(b||!w?[J(l)]:Ht(l)),H=h!=="none";!m&&H&&x.push(...It(l,w,h,_));const B=[l,...x],ot=await Xt(e,y),X=[];let q=((n=r.flip)==null?void 0:n.overflows)||[];if(u&&X.push(ot[g]),d){const V=Wt(i,s,_);X.push(ot[V[0]],ot[V[1]])}if(q=[...q,{placement:i,overflows:X}],!X.every(V=>V<=0)){var pt,mt;const V=(((pt=r.flip)==null?void 0:pt.index)||0)+1,gt=B[V];if(gt)return{data:{index:V,overflows:q},reset:{placement:gt}};let I=(mt=q.filter(F=>F.overflows[0]<=0).sort((F,S)=>F.overflows[1]-S.overflows[1])[0])==null?void 0:mt.placement;if(!I)switch(p){case"bestFit":{var ht;const F=(ht=q.filter(S=>{if(H){const L=j(S.placement);return L===v||L==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(L=>L>0).reduce((L,Ft)=>L+Ft,0)]).sort((S,L)=>S[1]-L[1])[0])==null?void 0:ht[0];F&&(I=F);break}case"initialPlacement":I=l;break}if(i!==I)return{reset:{placement:I}}}return{}}}};async function Kt(t,e){const{placement:o,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=$(o),l=Z(o),a=j(o)==="y",f=["left","top"].includes(s)?-1:1,u=r&&a?-1:1,d=ct(e,t);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof h=="number"&&(p=l==="end"?h*-1:h),a?{x:p*u,y:m*f}:{x:m*f,y:p*u}}const Jt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;const{x:i,y:r,placement:s,middlewareData:l}=e,a=await Kt(e,t);return s===((o=l.offset)==null?void 0:o.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}};function tt(){return typeof window<"u"}function W(t){return Rt(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function R(t){var e;return(e=(Rt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Rt(t){return tt()?t instanceof Node||t instanceof k(t).Node:!1}function E(t){return tt()?t instanceof Element||t instanceof k(t).Element:!1}function C(t){return tt()?t instanceof HTMLElement||t instanceof k(t).HTMLElement:!1}function xt(t){return!tt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof k(t).ShadowRoot}function Y(t){const{overflow:e,overflowX:o,overflowY:n,display:i}=A(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&!["inline","contents"].includes(i)}function Qt(t){return["table","td","th"].includes(W(t))}function et(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function at(t){const e=ft(),o=E(t)?A(t):t;return["transform","translate","scale","rotate","perspective"].some(n=>o[n]?o[n]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!e&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!e&&(o.filter?o.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function Zt(t){let e=T(t);for(;C(e)&&!z(e);){if(at(e))return e;if(et(e))return null;e=T(e)}return null}function ft(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(W(t))}function A(t){return k(t).getComputedStyle(t)}function nt(t){return E(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function T(t){if(W(t)==="html")return t;const e=t.assignedSlot||t.parentNode||xt(t)&&t.host||R(t);return xt(e)?e.host:e}function Dt(t){const e=T(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:C(e)&&Y(e)?e:Dt(e)}function U(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=!0);const i=Dt(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=k(i);if(r){const l=lt(s);return e.concat(s,s.visualViewport||[],Y(i)?i:[],l&&o?U(l):[])}return e.concat(i,U(i,[],o))}function lt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function St(t){const e=A(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=C(t),r=i?t.offsetWidth:o,s=i?t.offsetHeight:n,l=K(o)!==r||K(n)!==s;return l&&(o=r,n=s),{width:o,height:n,$:l}}function ut(t){return E(t)?t:t.contextElement}function M(t){const e=ut(t);if(!C(e))return O(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:r}=St(e);let s=(r?K(o.width):o.width)/n,l=(r?K(o.height):o.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const te=O(0);function Lt(t){const e=k(t);return!ft()||!e.visualViewport?te:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ee(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==k(t)?!1:e}function N(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),r=ut(t);let s=O(1);e&&(n?E(n)&&(s=M(n)):s=M(t));const l=ee(r,o,n)?Lt(r):O(0);let a=(i.left+l.x)/s.x,f=(i.top+l.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(r){const m=k(r),p=n&&E(n)?k(n):n;let h=m,w=lt(h);for(;w&&n&&p!==h;){const y=M(w),g=w.getBoundingClientRect(),v=A(w),b=g.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,_=g.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;a*=y.x,f*=y.y,u*=y.x,d*=y.y,a+=b,f+=_,h=k(w),w=lt(h)}}return Q({width:u,height:d,x:a,y:f})}function dt(t,e){const o=nt(t).scrollLeft;return e?e.left+o:N(R(t)).left+o}function Tt(t,e,o){o===void 0&&(o=!1);const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-(o?0:dt(t,n)),r=n.top+e.scrollTop;return{x:i,y:r}}function ne(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const r=i==="fixed",s=R(n),l=e?et(e.floating):!1;if(n===s||l&&r)return o;let a={scrollLeft:0,scrollTop:0},f=O(1);const u=O(0),d=C(n);if((d||!d&&!r)&&((W(n)!=="body"||Y(s))&&(a=nt(n)),C(n))){const p=N(n);f=M(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}const m=s&&!d&&!r?Tt(s,a,!0):O(0);return{width:o.width*f.x,height:o.height*f.y,x:o.x*f.x-a.scrollLeft*f.x+u.x+m.x,y:o.y*f.y-a.scrollTop*f.y+u.y+m.y}}function oe(t){return Array.from(t.getClientRects())}function ie(t){const e=R(t),o=nt(t),n=t.ownerDocument.body,i=P(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=P(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-o.scrollLeft+dt(t);const l=-o.scrollTop;return A(n).direction==="rtl"&&(s+=P(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:l}}function se(t,e){const o=k(t),n=R(t),i=o.visualViewport;let r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;const f=ft();(!f||f&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l,y:a}}function re(t,e){const o=N(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=C(t)?M(t):O(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,a=i*r.x,f=n*r.y;return{width:s,height:l,x:a,y:f}}function vt(t,e,o){let n;if(e==="viewport")n=se(t,o);else if(e==="document")n=ie(R(t));else if(E(e))n=re(e,o);else{const i=Lt(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Q(n)}function Vt(t,e){const o=T(t);return o===e||!E(o)||z(o)?!1:A(o).position==="fixed"||Vt(o,e)}function le(t,e){const o=e.get(t);if(o)return o;let n=U(t,[],!1).filter(l=>E(l)&&W(l)!=="body"),i=null;const r=A(t).position==="fixed";let s=r?T(t):t;for(;E(s)&&!z(s);){const l=A(s),a=at(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Y(s)&&!a&&Vt(t,s))?n=n.filter(u=>u!==s):i=l,s=T(s)}return e.set(t,n),n}function ce(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const s=[...o==="clippingAncestors"?et(e)?[]:le(e,this._c):[].concat(o),n],l=s[0],a=s.reduce((f,u)=>{const d=vt(e,u,i);return f.top=P(d.top,f.top),f.right=st(d.right,f.right),f.bottom=st(d.bottom,f.bottom),f.left=P(d.left,f.left),f},vt(e,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ae(t){const{width:e,height:o}=St(t);return{width:e,height:o}}function fe(t,e,o){const n=C(e),i=R(e),r=o==="fixed",s=N(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=O(0);if(n||!n&&!r)if((W(e)!=="body"||Y(i))&&(l=nt(e)),n){const m=N(e,!0,r,e);a.x=m.x+e.clientLeft,a.y=m.y+e.clientTop}else i&&(a.x=dt(i));const f=i&&!n&&!r?Tt(i,l):O(0),u=s.left+l.scrollLeft-a.x-f.x,d=s.top+l.scrollTop-a.y-f.y;return{x:u,y:d,width:s.width,height:s.height}}function it(t){return A(t).position==="static"}function bt(t,e){if(!C(t)||A(t).position==="fixed")return null;if(e)return e(t);let o=t.offsetParent;return R(t)===o&&(o=o.ownerDocument.body),o}function Nt(t,e){const o=k(t);if(et(t))return o;if(!C(t)){let i=T(t);for(;i&&!z(i);){if(E(i)&&!it(i))return i;i=T(i)}return o}let n=bt(t,e);for(;n&&Qt(n)&&it(n);)n=bt(n,e);return n&&z(n)&&it(n)&&!at(n)?o:n||Zt(t)||o}const ue=async function(t){const e=this.getOffsetParent||Nt,o=this.getDimensions,n=await o(t.floating);return{reference:fe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function de(t){return A(t).direction==="rtl"}const pe={convertOffsetParentRelativeRectToViewportRelativeRect:ne,getDocumentElement:R,getClippingRect:ce,getOffsetParent:Nt,getElementRects:ue,getClientRects:oe,getDimensions:ae,getScale:M,isElement:E,isRTL:de};function Bt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function me(t,e){let o=null,n;const i=R(t);function r(){var l;clearTimeout(n),(l=o)==null||l.disconnect(),o=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),r();const f=t.getBoundingClientRect(),{left:u,top:d,width:m,height:p}=f;if(l||e(),!m||!p)return;const h=G(d),w=G(i.clientWidth-(u+m)),y=G(i.clientHeight-(d+p)),g=G(u),b={rootMargin:-h+"px "+-w+"px "+-y+"px "+-g+"px",threshold:P(0,st(1,a))||1};let _=!0;function x(H){const B=H[0].intersectionRatio;if(B!==a){if(!_)return s();B?s(!1,B):n=setTimeout(()=>{s(!1,1e-7)},1e3)}B===1&&!Bt(f,t.getBoundingClientRect())&&s(),_=!1}try{o=new IntersectionObserver(x,{...b,root:i.ownerDocument})}catch{o=new IntersectionObserver(x,b)}o.observe(t)}return s(!0),r}function he(t,e,o,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=n,f=ut(t),u=i||r?[...f?U(f):[],...U(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",o,{passive:!0}),r&&g.addEventListener("resize",o)});const d=f&&l?me(f,o):null;let m=-1,p=null;s&&(p=new ResizeObserver(g=>{let[v]=g;v&&v.target===f&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),o()}),f&&!a&&p.observe(f),p.observe(e));let h,w=a?N(t):null;a&&y();function y(){const g=N(t);w&&!Bt(w,g)&&o(),w=g,h=requestAnimationFrame(y)}return o(),()=>{var g;u.forEach(v=>{i&&v.removeEventListener("scroll",o),r&&v.removeEventListener("resize",o)}),d==null||d(),(g=p)==null||g.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const _t=Jt,kt=Gt,Et=(t,e,o)=>{const n=new Map,i={platform:pe,...o},r={...i.platform,_c:n};return Yt(t,e,{...i,platform:r})},ge=["data-opened"],we={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},ye=c.defineComponent({__name:"OneDropdownAuto",props:D.dropdownProps,emits:["open","close"],setup(t,{emit:e}){const o=t,n=c.ref(!1),i=c.ref(null),r=c.ref(null);let s=null;c.watch(n,u=>{u&&r.value&&i.value?(Et(r.value,i.value,{placement:o.stick?o.stick:"bottom-start",middleware:[_t(5),kt()]}).then(({x:d,y:m})=>{Object.assign(i.value.style,{left:`${d}px`,top:`${m}px`})}),s=he(r.value,i.value,()=>{Et(r.value,i.value,{placement:o.stick?o.stick:"bottom-start",middleware:[_t(4),kt()]}).then(({x:d,y:m})=>{Object.assign(i.value.style,{left:`${d}px`,top:`${m}px`})})})):s&&(s(),s=null)}),c.onBeforeUnmount(()=>{s&&s()});const l=e,a=()=>{n.value=!n.value,n.value?l("open"):l("close")};c.provide("OneDropdown",{onToggle:a});const f=c.computed(()=>["absolute z-10 w-fit rounded-md bg-white","py-1 shadow-lg ring-black ring-opacity-5 focus:outline-none","overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"]);return(u,d)=>(c.openBlock(),c.createElementBlock("div",{class:"relative inline-block","data-opened":n.value},[c.createElementVNode("div",{ref_key:"buttonRef",ref:r},[c.renderSlot(u.$slots,"button",c.normalizeProps(c.guardReactiveProps({onToggle:a,isExpanded:n.value})))],512),n.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:a})):c.createCommentVNode("",!0),c.withDirectives(c.createElementVNode("div",{ref_key:"menuRef",ref:i,class:c.normalizeClass(["menu",f.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1",style:{display:"none"}},[u.title?(c.openBlock(),c.createElementBlock("div",we,c.toDisplayString(u.title),1)):c.createCommentVNode("",!0),c.renderSlot(u.$slots,"menu",c.normalizeProps(c.guardReactiveProps({onToggle:a})))],2),[[c.vShow,n.value]])],8,ge))}}),xe={},ve={class:"border-t border-secondary-stroke my-1"};function be(t,e){return c.openBlock(),c.createElementBlock("div",ve)}const _e=Pt._export_sfc(xe,[["render",be]]),ke=["onClick"],Ee={class:"grid"},Ae={class:"font-semibold px-3"},Oe={class:"rounded-lg m-3 border"},Ce={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},Re={class:"flex-shrink-0"},De={class:"w-full text-left"},Se={class:"flex-shrink-0"},Le={class:"px-3 py-2"},Te={class:"text-secondary-content text-left pb-1 text-sm uppercase"},Ve={key:0,class:"space-y-2"},Ne=["onClick"],Be={class:"pl-2"},Fe={class:"text-sm mt-1"},Pe={class:"text-xs mt-1"},At=3,Me=c.defineComponent({__name:"OneBrowserMenuGrid",props:D.browserMenuProps,setup(t){const e=t,o=()=>{typeof e.onChange=="function"&&e.onChange()},n=c.ref(!1),i=c.computed(()=>e.apps?n.value?e.apps:e.apps.slice(0,At):[]),r=()=>{n.value=!n.value},s=l=>{typeof e.onApp=="function"&&e.onApp(l)};return(l,a)=>(c.openBlock(),c.createBlock(D._sfc_main$1,{stick:"right"},{button:c.withCtx(({onToggle:f,isExpanded:u})=>[c.createElementVNode("button",{onClick:f,class:c.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",[u?"bg-secondary-25":""]])},[c.createVNode(c.unref(D.render$4),{class:"text-secondary-base",style:c.normalizeStyle(`width: ${l.iconSize}px; height: ${l.iconSize}px`)},null,8,["style"])],10,ke)]),menu:c.withCtx(()=>{var f,u,d,m;return[c.createElementVNode("div",Ee,[c.createElementVNode("div",Ae,c.toDisplayString((f=l.workspace)==null?void 0:f.title),1),c.createElementVNode("div",Oe,[c.createElementVNode("div",Ce,[c.createElementVNode("div",Re,[c.createVNode(wt._sfc_main,{text:((u=l.workspace)==null?void 0:u.name)||"",src:(d=l.workspace)==null?void 0:d.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),c.createElementVNode("div",De,c.toDisplayString((m=l.workspace)==null?void 0:m.name),1),c.createElementVNode("div",Se,[c.createElementVNode("button",{class:"text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",onClick:o},c.toDisplayString(l.changeLabel),1)])]),a[0]||(a[0]=c.createElementVNode("hr",null,null,-1))])]),c.createElementVNode("div",Le,[c.createElementVNode("div",Te,c.toDisplayString(l.appsTitle),1),c.createElementVNode("div",null,[l.apps&&l.apps.length?(c.openBlock(),c.createElementBlock("div",Ve,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.value,p=>(c.openBlock(),c.createElementBlock("div",{key:p.id,onClick:h=>s(p),class:"flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"},[c.createVNode(wt._sfc_main,{text:p.name,src:p.photo_url,size:44,rounded:!1},null,8,["text","src"]),c.createElementVNode("div",Be,[c.createElementVNode("p",Fe,c.toDisplayString(p.name),1),c.createElementVNode("p",Pe,c.toDisplayString(p.short),1)])],8,Ne))),128))])):c.createCommentVNode("",!0),l.apps&&l.apps.length>At?(c.openBlock(),c.createElementBlock("button",{key:1,onClick:r,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"},c.toDisplayString(n.value?"Приховати":"Дивитися всі"),1)):c.createCommentVNode("",!0)])])]}),_:1}))}});exports.OneBrowserMenu=D.OneBrowserMenu;exports.OneDropdown=D._sfc_main$1;exports.OneDropdownItem=D._sfc_main$2;exports.OneHelpMenu=D.OneHelpMenu;exports.OneUserMenu=D._sfc_main;exports.OneBrowserMenuGrid=Me;exports.OneDropdownAuto=ye;exports.OneDropdownDivider=_e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("../OneHelpMenu-2f5544f1.cjs"),c=require("vue"),Pt=require("../_plugin-vue_export-helper-f246444f.cjs"),wt=require("../OneAvatar.vue_vue_type_script_setup_true_lang-2d9f44f1.cjs");require("../XMarkIcon-f94baa4c.cjs");require("../index-9f8735d9.cjs");const st=Math.min,P=Math.max,K=Math.round,G=Math.floor,O=t=>({x:t,y:t}),Mt={left:"right",right:"left",bottom:"top",top:"bottom"},$t={start:"end",end:"start"};function ct(t,e){return typeof t=="function"?t(e):t}function $(t){return t.split("-")[0]}function Z(t){return t.split("-")[1]}function zt(t){return t==="x"?"y":"x"}function Ot(t){return t==="y"?"height":"width"}function j(t){return["top","bottom"].includes($(t))?"y":"x"}function Ct(t){return zt(j(t))}function Wt(t,e,o){o===void 0&&(o=!1);const n=Z(t),i=Ct(t),r=Ot(i);let s=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=J(s)),[s,J(s)]}function Ht(t){const e=J(t);return[rt(t),e,rt(e)]}function rt(t){return t.replace(/start|end/g,e=>$t[e])}function qt(t,e,o){const n=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return o?e?i:n:e?n:i;case"left":case"right":return e?r:s;default:return[]}}function It(t,e,o,n){const i=Z(t);let r=qt($(t),o==="start",n);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(rt)))),r}function J(t){return t.replace(/left|right|bottom|top/g,e=>Mt[e])}function jt(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ut(t){return typeof t!="number"?jt(t):{top:t,right:t,bottom:t,left:t}}function Q(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function yt(t,e,o){let{reference:n,floating:i}=t;const r=j(e),s=Ct(e),l=Ot(s),a=$(e),f=r==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,m=n[l]/2-i[l]/2;let p;switch(a){case"top":p={x:u,y:n.y-i.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}switch(Z(e)){case"start":p[s]-=m*(o&&f?-1:1);break;case"end":p[s]+=m*(o&&f?-1:1);break}return p}const Yt=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=o,l=r.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=yt(f,n,a),m=n,p={},h=0;for(let w=0;w<l.length;w++){const{name:y,fn:g}=l[w],{x:v,y:b,data:_,reset:x}=await g({x:u,y:d,initialPlacement:n,placement:m,strategy:i,middlewareData:p,rects:f,platform:s,elements:{reference:t,floating:e}});u=v??u,d=b??d,p={...p,[y]:{...p[y],..._}},x&&h<=50&&(h++,typeof x=="object"&&(x.placement&&(m=x.placement),x.rects&&(f=x.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):x.rects),{x:u,y:d}=yt(f,m,a)),w=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:p}};async function Xt(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=ct(e,t),h=Ut(p),y=l[m?d==="floating"?"reference":"floating":d],g=Q(await r.getClippingRect({element:(o=await(r.isElement==null?void 0:r.isElement(y)))==null||o?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:f,rootBoundary:u,strategy:a})),v=d==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),_=await(r.isElement==null?void 0:r.isElement(b))?await(r.getScale==null?void 0:r.getScale(b))||{x:1,y:1}:{x:1,y:1},x=Q(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:b,strategy:a}):v);return{top:(g.top-x.top+h.top)/_.y,bottom:(x.bottom-g.bottom+h.bottom)/_.y,left:(g.left-x.left+h.left)/_.x,right:(x.right-g.right+h.right)/_.x}}const Gt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:f}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:w=!0,...y}=ct(t,e);if((o=r.arrow)!=null&&o.alignmentOffset)return{};const g=$(i),v=j(l),b=$(l)===l,_=await(a.isRTL==null?void 0:a.isRTL(f.floating)),x=m||(b||!w?[J(l)]:Ht(l)),H=h!=="none";!m&&H&&x.push(...It(l,w,h,_));const B=[l,...x],ot=await Xt(e,y),X=[];let q=((n=r.flip)==null?void 0:n.overflows)||[];if(u&&X.push(ot[g]),d){const V=Wt(i,s,_);X.push(ot[V[0]],ot[V[1]])}if(q=[...q,{placement:i,overflows:X}],!X.every(V=>V<=0)){var pt,mt;const V=(((pt=r.flip)==null?void 0:pt.index)||0)+1,gt=B[V];if(gt)return{data:{index:V,overflows:q},reset:{placement:gt}};let I=(mt=q.filter(F=>F.overflows[0]<=0).sort((F,S)=>F.overflows[1]-S.overflows[1])[0])==null?void 0:mt.placement;if(!I)switch(p){case"bestFit":{var ht;const F=(ht=q.filter(S=>{if(H){const L=j(S.placement);return L===v||L==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(L=>L>0).reduce((L,Ft)=>L+Ft,0)]).sort((S,L)=>S[1]-L[1])[0])==null?void 0:ht[0];F&&(I=F);break}case"initialPlacement":I=l;break}if(i!==I)return{reset:{placement:I}}}return{}}}};async function Kt(t,e){const{placement:o,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=$(o),l=Z(o),a=j(o)==="y",f=["left","top"].includes(s)?-1:1,u=r&&a?-1:1,d=ct(e,t);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof h=="number"&&(p=l==="end"?h*-1:h),a?{x:p*u,y:m*f}:{x:m*f,y:p*u}}const Jt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;const{x:i,y:r,placement:s,middlewareData:l}=e,a=await Kt(e,t);return s===((o=l.offset)==null?void 0:o.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}};function tt(){return typeof window<"u"}function W(t){return Rt(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function R(t){var e;return(e=(Rt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Rt(t){return tt()?t instanceof Node||t instanceof k(t).Node:!1}function E(t){return tt()?t instanceof Element||t instanceof k(t).Element:!1}function C(t){return tt()?t instanceof HTMLElement||t instanceof k(t).HTMLElement:!1}function xt(t){return!tt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof k(t).ShadowRoot}function Y(t){const{overflow:e,overflowX:o,overflowY:n,display:i}=A(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&!["inline","contents"].includes(i)}function Qt(t){return["table","td","th"].includes(W(t))}function et(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function at(t){const e=ft(),o=E(t)?A(t):t;return["transform","translate","scale","rotate","perspective"].some(n=>o[n]?o[n]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!e&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!e&&(o.filter?o.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function Zt(t){let e=T(t);for(;C(e)&&!z(e);){if(at(e))return e;if(et(e))return null;e=T(e)}return null}function ft(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(W(t))}function A(t){return k(t).getComputedStyle(t)}function nt(t){return E(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function T(t){if(W(t)==="html")return t;const e=t.assignedSlot||t.parentNode||xt(t)&&t.host||R(t);return xt(e)?e.host:e}function Dt(t){const e=T(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:C(e)&&Y(e)?e:Dt(e)}function U(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=!0);const i=Dt(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=k(i);if(r){const l=lt(s);return e.concat(s,s.visualViewport||[],Y(i)?i:[],l&&o?U(l):[])}return e.concat(i,U(i,[],o))}function lt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function St(t){const e=A(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=C(t),r=i?t.offsetWidth:o,s=i?t.offsetHeight:n,l=K(o)!==r||K(n)!==s;return l&&(o=r,n=s),{width:o,height:n,$:l}}function ut(t){return E(t)?t:t.contextElement}function M(t){const e=ut(t);if(!C(e))return O(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:r}=St(e);let s=(r?K(o.width):o.width)/n,l=(r?K(o.height):o.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const te=O(0);function Lt(t){const e=k(t);return!ft()||!e.visualViewport?te:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ee(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==k(t)?!1:e}function N(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),r=ut(t);let s=O(1);e&&(n?E(n)&&(s=M(n)):s=M(t));const l=ee(r,o,n)?Lt(r):O(0);let a=(i.left+l.x)/s.x,f=(i.top+l.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(r){const m=k(r),p=n&&E(n)?k(n):n;let h=m,w=lt(h);for(;w&&n&&p!==h;){const y=M(w),g=w.getBoundingClientRect(),v=A(w),b=g.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,_=g.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;a*=y.x,f*=y.y,u*=y.x,d*=y.y,a+=b,f+=_,h=k(w),w=lt(h)}}return Q({width:u,height:d,x:a,y:f})}function dt(t,e){const o=nt(t).scrollLeft;return e?e.left+o:N(R(t)).left+o}function Tt(t,e,o){o===void 0&&(o=!1);const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-(o?0:dt(t,n)),r=n.top+e.scrollTop;return{x:i,y:r}}function ne(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const r=i==="fixed",s=R(n),l=e?et(e.floating):!1;if(n===s||l&&r)return o;let a={scrollLeft:0,scrollTop:0},f=O(1);const u=O(0),d=C(n);if((d||!d&&!r)&&((W(n)!=="body"||Y(s))&&(a=nt(n)),C(n))){const p=N(n);f=M(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}const m=s&&!d&&!r?Tt(s,a,!0):O(0);return{width:o.width*f.x,height:o.height*f.y,x:o.x*f.x-a.scrollLeft*f.x+u.x+m.x,y:o.y*f.y-a.scrollTop*f.y+u.y+m.y}}function oe(t){return Array.from(t.getClientRects())}function ie(t){const e=R(t),o=nt(t),n=t.ownerDocument.body,i=P(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=P(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-o.scrollLeft+dt(t);const l=-o.scrollTop;return A(n).direction==="rtl"&&(s+=P(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:l}}function se(t,e){const o=k(t),n=R(t),i=o.visualViewport;let r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;const f=ft();(!f||f&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l,y:a}}function re(t,e){const o=N(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=C(t)?M(t):O(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,a=i*r.x,f=n*r.y;return{width:s,height:l,x:a,y:f}}function vt(t,e,o){let n;if(e==="viewport")n=se(t,o);else if(e==="document")n=ie(R(t));else if(E(e))n=re(e,o);else{const i=Lt(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Q(n)}function Vt(t,e){const o=T(t);return o===e||!E(o)||z(o)?!1:A(o).position==="fixed"||Vt(o,e)}function le(t,e){const o=e.get(t);if(o)return o;let n=U(t,[],!1).filter(l=>E(l)&&W(l)!=="body"),i=null;const r=A(t).position==="fixed";let s=r?T(t):t;for(;E(s)&&!z(s);){const l=A(s),a=at(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Y(s)&&!a&&Vt(t,s))?n=n.filter(u=>u!==s):i=l,s=T(s)}return e.set(t,n),n}function ce(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const s=[...o==="clippingAncestors"?et(e)?[]:le(e,this._c):[].concat(o),n],l=s[0],a=s.reduce((f,u)=>{const d=vt(e,u,i);return f.top=P(d.top,f.top),f.right=st(d.right,f.right),f.bottom=st(d.bottom,f.bottom),f.left=P(d.left,f.left),f},vt(e,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ae(t){const{width:e,height:o}=St(t);return{width:e,height:o}}function fe(t,e,o){const n=C(e),i=R(e),r=o==="fixed",s=N(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=O(0);if(n||!n&&!r)if((W(e)!=="body"||Y(i))&&(l=nt(e)),n){const m=N(e,!0,r,e);a.x=m.x+e.clientLeft,a.y=m.y+e.clientTop}else i&&(a.x=dt(i));const f=i&&!n&&!r?Tt(i,l):O(0),u=s.left+l.scrollLeft-a.x-f.x,d=s.top+l.scrollTop-a.y-f.y;return{x:u,y:d,width:s.width,height:s.height}}function it(t){return A(t).position==="static"}function bt(t,e){if(!C(t)||A(t).position==="fixed")return null;if(e)return e(t);let o=t.offsetParent;return R(t)===o&&(o=o.ownerDocument.body),o}function Nt(t,e){const o=k(t);if(et(t))return o;if(!C(t)){let i=T(t);for(;i&&!z(i);){if(E(i)&&!it(i))return i;i=T(i)}return o}let n=bt(t,e);for(;n&&Qt(n)&&it(n);)n=bt(n,e);return n&&z(n)&&it(n)&&!at(n)?o:n||Zt(t)||o}const ue=async function(t){const e=this.getOffsetParent||Nt,o=this.getDimensions,n=await o(t.floating);return{reference:fe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function de(t){return A(t).direction==="rtl"}const pe={convertOffsetParentRelativeRectToViewportRelativeRect:ne,getDocumentElement:R,getClippingRect:ce,getOffsetParent:Nt,getElementRects:ue,getClientRects:oe,getDimensions:ae,getScale:M,isElement:E,isRTL:de};function Bt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function me(t,e){let o=null,n;const i=R(t);function r(){var l;clearTimeout(n),(l=o)==null||l.disconnect(),o=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),r();const f=t.getBoundingClientRect(),{left:u,top:d,width:m,height:p}=f;if(l||e(),!m||!p)return;const h=G(d),w=G(i.clientWidth-(u+m)),y=G(i.clientHeight-(d+p)),g=G(u),b={rootMargin:-h+"px "+-w+"px "+-y+"px "+-g+"px",threshold:P(0,st(1,a))||1};let _=!0;function x(H){const B=H[0].intersectionRatio;if(B!==a){if(!_)return s();B?s(!1,B):n=setTimeout(()=>{s(!1,1e-7)},1e3)}B===1&&!Bt(f,t.getBoundingClientRect())&&s(),_=!1}try{o=new IntersectionObserver(x,{...b,root:i.ownerDocument})}catch{o=new IntersectionObserver(x,b)}o.observe(t)}return s(!0),r}function he(t,e,o,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=n,f=ut(t),u=i||r?[...f?U(f):[],...U(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",o,{passive:!0}),r&&g.addEventListener("resize",o)});const d=f&&l?me(f,o):null;let m=-1,p=null;s&&(p=new ResizeObserver(g=>{let[v]=g;v&&v.target===f&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),o()}),f&&!a&&p.observe(f),p.observe(e));let h,w=a?N(t):null;a&&y();function y(){const g=N(t);w&&!Bt(w,g)&&o(),w=g,h=requestAnimationFrame(y)}return o(),()=>{var g;u.forEach(v=>{i&&v.removeEventListener("scroll",o),r&&v.removeEventListener("resize",o)}),d==null||d(),(g=p)==null||g.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const _t=Jt,kt=Gt,Et=(t,e,o)=>{const n=new Map,i={platform:pe,...o},r={...i.platform,_c:n};return Yt(t,e,{...i,platform:r})},ge=["data-opened"],we={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},ye=c.defineComponent({__name:"OneDropdownAuto",props:D.dropdownProps,emits:["open","close"],setup(t,{emit:e}){const o=t,n=c.ref(!1),i=c.ref(null),r=c.ref(null);let s=null;c.watch(n,u=>{u&&r.value&&i.value?(Et(r.value,i.value,{placement:o.stick?o.stick:"bottom-start",middleware:[_t(5),kt()]}).then(({x:d,y:m})=>{Object.assign(i.value.style,{left:`${d}px`,top:`${m}px`})}),s=he(r.value,i.value,()=>{Et(r.value,i.value,{placement:o.stick?o.stick:"bottom-start",middleware:[_t(4),kt()]}).then(({x:d,y:m})=>{Object.assign(i.value.style,{left:`${d}px`,top:`${m}px`})})})):s&&(s(),s=null)}),c.onBeforeUnmount(()=>{s&&s()});const l=e,a=()=>{n.value=!n.value,n.value?l("open"):l("close")};c.provide("OneDropdown",{onToggle:a});const f=c.computed(()=>["absolute z-10 w-fit rounded-md bg-white","py-1 shadow-lg ring-black ring-opacity-5 focus:outline-none","overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"]);return(u,d)=>(c.openBlock(),c.createElementBlock("div",{class:"relative inline-block","data-opened":n.value},[c.createElementVNode("div",{ref_key:"buttonRef",ref:r},[c.renderSlot(u.$slots,"button",c.normalizeProps(c.guardReactiveProps({onToggle:a,isExpanded:n.value})))],512),n.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:a})):c.createCommentVNode("",!0),c.withDirectives(c.createElementVNode("div",{ref_key:"menuRef",ref:i,class:c.normalizeClass(["menu",f.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1",style:{display:"none"}},[u.title?(c.openBlock(),c.createElementBlock("div",we,c.toDisplayString(u.title),1)):c.createCommentVNode("",!0),c.renderSlot(u.$slots,"menu",c.normalizeProps(c.guardReactiveProps({onToggle:a})))],2),[[c.vShow,n.value]])],8,ge))}}),xe={},ve={class:"border-t border-secondary-stroke my-1"};function be(t,e){return c.openBlock(),c.createElementBlock("div",ve)}const _e=Pt._export_sfc(xe,[["render",be]]),ke=["onClick"],Ee={class:"grid"},Ae={class:"font-semibold px-3"},Oe={class:"rounded-lg m-3 border"},Ce={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},Re={class:"flex-shrink-0"},De={class:"w-full text-left"},Se={class:"flex-shrink-0"},Le={class:"px-3 py-2"},Te={class:"text-secondary-content text-left pb-1 text-sm uppercase"},Ve={key:0,class:"space-y-2"},Ne=["onClick"],Be={class:"pl-2"},Fe={class:"text-sm mt-1"},Pe={class:"text-xs mt-1"},At=3,Me=c.defineComponent({__name:"OneBrowserMenuGrid",props:D.browserMenuProps,setup(t){const e=t,o=()=>{typeof e.onChange=="function"&&e.onChange()},n=c.ref(!1),i=c.computed(()=>e.apps?n.value?e.apps:e.apps.slice(0,At):[]),r=()=>{n.value=!n.value},s=l=>{typeof e.onApp=="function"&&e.onApp(l)};return(l,a)=>(c.openBlock(),c.createBlock(D._sfc_main$1,{stick:"right"},{button:c.withCtx(({onToggle:f,isExpanded:u})=>[c.createElementVNode("button",{onClick:f,class:c.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",[u?"bg-secondary-25":""]])},[c.createVNode(c.unref(D.render$4),{class:"text-secondary-base",style:c.normalizeStyle(`width: ${l.iconSize}px; height: ${l.iconSize}px`)},null,8,["style"])],10,ke)]),menu:c.withCtx(()=>{var f,u,d,m;return[c.createElementVNode("div",Ee,[c.createElementVNode("div",Ae,c.toDisplayString((f=l.workspace)==null?void 0:f.title),1),c.createElementVNode("div",Oe,[c.createElementVNode("div",Ce,[c.createElementVNode("div",Re,[c.createVNode(wt._sfc_main,{text:((u=l.workspace)==null?void 0:u.name)||"",src:(d=l.workspace)==null?void 0:d.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),c.createElementVNode("div",De,c.toDisplayString((m=l.workspace)==null?void 0:m.name),1),c.createElementVNode("div",Se,[c.createElementVNode("button",{class:"text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",onClick:o},c.toDisplayString(l.changeLabel),1)])]),a[0]||(a[0]=c.createElementVNode("hr",null,null,-1))])]),c.createElementVNode("div",Le,[c.createElementVNode("div",Te,c.toDisplayString(l.appsTitle),1),c.createElementVNode("div",null,[l.apps&&l.apps.length?(c.openBlock(),c.createElementBlock("div",Ve,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.value,p=>(c.openBlock(),c.createElementBlock("div",{key:p.id,onClick:h=>s(p),class:"flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"},[c.createVNode(wt._sfc_main,{text:p.name,src:p.photo_url,size:44,rounded:!1},null,8,["text","src"]),c.createElementVNode("div",Be,[c.createElementVNode("p",Fe,c.toDisplayString(p.name),1),c.createElementVNode("p",Pe,c.toDisplayString(p.short),1)])],8,Ne))),128))])):c.createCommentVNode("",!0),l.apps&&l.apps.length>At?(c.openBlock(),c.createElementBlock("button",{key:1,onClick:r,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"},c.toDisplayString(n.value?"Приховати":"Дивитися всі"),1)):c.createCommentVNode("",!0)])])]}),_:1}))}});exports.OneBrowserMenu=D.OneBrowserMenu;exports.OneDropdown=D._sfc_main$1;exports.OneDropdownItem=D._sfc_main$2;exports.OneHelpMenu=D.OneHelpMenu;exports.OneUserMenu=D._sfc_main;exports.OneBrowserMenuGrid=Me;exports.OneDropdownAuto=ye;exports.OneDropdownDivider=_e;
|
package/dist/dropdown/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { g as Gt, h as Kt, e as Jt, i as Qt } from "../OneHelpMenu-
|
|
2
|
-
import { d as vn, f as bn, O as An, _ as Rn } from "../OneHelpMenu-
|
|
1
|
+
import { g as Gt, h as Kt, e as Jt, i as Qt } from "../OneHelpMenu-a40ac0b4.js";
|
|
2
|
+
import { d as vn, f as bn, O as An, _ as Rn } from "../OneHelpMenu-a40ac0b4.js";
|
|
3
3
|
import { defineComponent as Bt, ref as Q, watch as Zt, onBeforeUnmount as te, provide as ee, computed as $t, openBlock as L, createElementBlock as F, createElementVNode as y, renderSlot as At, normalizeProps as Rt, guardReactiveProps as Ot, createCommentVNode as Z, withDirectives as ne, normalizeClass as Mt, toDisplayString as S, vShow as oe, createBlock as ie, withCtx as _t, createVNode as ct, unref as se, normalizeStyle as re, Fragment as le, renderList as ce } from "vue";
|
|
4
4
|
import { _ as ae } from "../_plugin-vue_export-helper-dad06003.js";
|
|
5
5
|
import { _ as Ct } from "../OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
|
|
6
6
|
import "../XMarkIcon-51ef0691.js";
|
|
7
|
-
import "../index-
|
|
7
|
+
import "../index-6181061b.js";
|
|
8
8
|
const ft = Math.min, V = Math.max, tt = Math.round, J = Math.floor, C = (t) => ({
|
|
9
9
|
x: t,
|
|
10
10
|
y: t
|
package/dist/dropdown/menu.d.ts
CHANGED
package/dist/form/form.d.ts
CHANGED
package/dist/form/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export { default as OneFormField } from './OneFormField.vue';
|
|
|
3
3
|
export { default as OneFormFeedback } from './OneFormFeedback.vue';
|
|
4
4
|
export { default as OneFormLabel } from './OneFormLabel.vue';
|
|
5
5
|
export { default as OneFormInput } from './OneFormInput.vue';
|
|
6
|
-
export type { FormProps, FormProvide, FormFieldProps, FormFieldProvide, FormFeedbackProps, FormLabelProps, FormInputProps
|
|
6
|
+
export type { FormProps, FormProvide, FormFieldProps, FormFieldProvide, FormFeedbackProps, FormLabelProps, FormInputProps } from './form';
|
package/dist/form/index.js
CHANGED
|
@@ -417,9 +417,7 @@ const ae = ["id", "disabled"], te = ["selected"], oe = ["selected", "value"], ne
|
|
|
417
417
|
__name: "OneFormField",
|
|
418
418
|
props: Q,
|
|
419
419
|
setup(u) {
|
|
420
|
-
const a = u, { formId: s, validation: r } = N(), i = n(
|
|
421
|
-
() => a.errors != null && a.errors.length > 0 ? !0 : a.name == null ? !1 : (r.value ?? {})[a.name] != null
|
|
422
|
-
);
|
|
420
|
+
const a = u, { formId: s, validation: r } = N(), i = n(() => a.errors != null && a.errors.length > 0 ? !0 : a.name == null ? !1 : (r.value ?? {})[a.name] != null);
|
|
423
421
|
return _("BaseFormField", {
|
|
424
422
|
inputId: n(() => {
|
|
425
423
|
const o = s.value || "form";
|
|
@@ -73,16 +73,34 @@ const f = /* @__PURE__ */ L(A, [["render", F]]), I = {
|
|
|
73
73
|
md: ["px-3 py-2"],
|
|
74
74
|
lg: ["px-4 py-3"]
|
|
75
75
|
}, N = {
|
|
76
|
-
primary: [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
primary: [
|
|
77
|
+
"rounded-md border-transparent bg-primary-base disabled:bg-primary-hover text-sm text-white hover:bg-primary-hover focus:ring-primary-glow"
|
|
78
|
+
],
|
|
79
|
+
secondary: [
|
|
80
|
+
"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"
|
|
81
|
+
],
|
|
82
|
+
info: [
|
|
83
|
+
"rounded-md border-transparent bg-info-base disabled:bg-info-hover text-white text-sm hover:bg-info-hover focus:ring-info-glow"
|
|
84
|
+
],
|
|
85
|
+
success: [
|
|
86
|
+
"rounded-md border-transparent bg-success-base disabled:bg-success-hover text-white text-sm hover:bg-success-hover focus:ring-success-glow"
|
|
87
|
+
],
|
|
88
|
+
warning: [
|
|
89
|
+
"rounded-md border-transparent bg-warning-base disabled:bg-warning-hover text-white text-sm hover:bg-warning-hover focus:ring-warning-glow"
|
|
90
|
+
],
|
|
91
|
+
danger: [
|
|
92
|
+
"rounded-md border-transparent bg-danger-base disabled:bg-danger-hover text-white text-sm hover:bg-danger-hover focus:ring-danger-glow"
|
|
93
|
+
],
|
|
94
|
+
touch: [
|
|
95
|
+
"rounded-full border-transparent text-black hover:bg-primary-body-hover hover:shadow p-3 text-sm focus:ring-tertiary-glow"
|
|
96
|
+
],
|
|
97
|
+
link: [
|
|
98
|
+
"rounded-md border-transparent items-center text-info-base hover:text-info-hover text-sm"
|
|
99
|
+
],
|
|
84
100
|
none: ["rounded-md border-transparent text-gray-500"],
|
|
85
|
-
mini: [
|
|
101
|
+
mini: [
|
|
102
|
+
"rounded-full border-transparent bg-[#FAFAFA] text-sm hover:text-green-500 disabled:text-[#525B66] focus:ring-2"
|
|
103
|
+
]
|
|
86
104
|
}, O = (u = "primary", o = "md") => {
|
|
87
105
|
const a = [];
|
|
88
106
|
return a.push(...j), a.push(...N[u] ?? []), u !== "touch" && a.push(...D[o] ?? []), a;
|
|
@@ -97,9 +115,7 @@ const f = /* @__PURE__ */ L(A, [["render", F]]), I = {
|
|
|
97
115
|
const e = O(s.variant, s.size);
|
|
98
116
|
return s.variant === "touch" && s.active && e.push("bg-primary-body-active"), e;
|
|
99
117
|
}), h = r(() => s.disabled || s.isLoading), w = r(() => s.label && s.label.length > 0 && s.variant !== "touch"), x = r(() => {
|
|
100
|
-
const e = [
|
|
101
|
-
"inline-block text-ellipsis overflow-hidden"
|
|
102
|
-
];
|
|
118
|
+
const e = ["inline-block text-ellipsis overflow-hidden"];
|
|
103
119
|
return l.value != null && e.push("ml-2"), i.value != null && e.push("mr-2"), s.labelClass != null && e.push(s.labelClass), e;
|
|
104
120
|
}), c = r(() => {
|
|
105
121
|
const e = [];
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-9f8735d9.cjs"),f=require("./card/index.cjs"),p=require("./form/index.cjs"),m=require("./OneHelpMenu-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-9f8735d9.cjs"),f=require("./card/index.cjs"),p=require("./form/index.cjs"),m=require("./OneHelpMenu-2f5544f1.cjs"),x=require("./dropdown/index.cjs"),h=require("./OneAvatar.vue_vue_type_script_setup_true_lang-2d9f44f1.cjs"),w=require("./common/index.cjs"),e=require("vue"),y=require("./_plugin-vue_export-helper-f246444f.cjs");require("./XMarkIcon-f94baa4c.cjs");const O={color:{type:String,default:"red"},size:{type:String,default:"sm"},text:{type:String,default:""},variant:{type:String,default:"indicators"},bargeVariant:{type:String,default:"stand"}},b={class:"px-1 font-semibold",style:{color:"white"}},C=e.defineComponent({__name:"OneIndicators",props:{...O},setup(u){const t=u,l=e.computed(()=>{switch(t.color){case"green":return"#22c55e";case"blue":return"#3b82f6";case"red":return"#ef4444";case"yellow":return"#eab308";default:return"#E3ECF2"}}),d=e.computed(()=>{let s="",r="",a;return t.text?t.size==="sm"?(r="min-w-[12px]",a="textSm"):t.size==="md"?(r="min-w-[16px]",a="textMd"):t.size==="lg"&&(r="min-w-[20px]",a="textLg"):t.size==="sm"?s="w-3 min-w-[12px]":t.size==="lg"?s="w-5 min-w-[20px]":t.size==="md"&&(s="w-4 min-w-[16px]"),`${s} ${a} ${r} h-${t.size==="sm"?3:t.size==="lg"?5:4}`}),o=e.computed(()=>{let s="",r="",a;return t.text?t.size==="sm"?(r="min-w-[44px]",a="textMd"):t.size==="md"?(r="min-w-[58px]",a="text10"):t.size==="lg"&&(r="min-w-[68px]",a="text-sm"):t.size==="sm"?s="min-w-[44px]":t.size==="lg"?s="min-w-[68px]":t.size==="md"&&(s="min-w-[58px]"),`${s} ${a} ${r} h-${t.size==="sm"?5:t.size==="lg"?7:6}`}),i=e.computed(()=>{const s=t.bargeVariant==="stand"?"1A":"",r=t.bargeVariant==="stand"?"1px solid":"none";return{backgroundColor:`${l.value}${s}`,border:r,borderColor:l.value}});return(s,r)=>t.variant==="indicators"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["rounded-full border border-white flex items-center justify-center w-max",[d.value]]),style:e.normalizeStyle({backgroundColor:l.value})},[e.createElementVNode("p",b,e.toDisplayString(s.text),1)],6)):t.variant==="barge"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["rounded px-2 py-1 text-center w-max",[o.value,{"rounded-full":s.bargeVariant==="round",rounded:s.bargeVariant!=="round"}]]),style:e.normalizeStyle([i.value])},[e.createElementVNode("p",{class:"font-medium",style:e.normalizeStyle({color:s.bargeVariant!=="stand"?"white":l.value})},e.toDisplayString(s.text),5)],6)):e.createCommentVNode("",!0)}});const k=y._export_sfc(C,[["__scopeId","data-v-f0eea1db"]]),z=e.defineComponent({__name:"OneLabel",props:{size:{type:String,default:"standard"},color:{type:String,default:"blue"},filled:{type:Boolean,default:!0},text:{type:String,default:"Label"}},setup(u){const t=u,l=e.ref(!1),d=e.computed(()=>{const s="inline-flex items-center cursor-pointer transition-opacity rounded-full",r=t.size==="mini"?"text-xs px-3 py-1":"text-sm px-4 py-2",a=t.filled?`${t.color}-filled`:`${t.color}-border`;return`${s} ${r} ${a} ${l.value?"opacity-80":"hover:opacity-90"}`}),o=()=>{l.value=!0},i=()=>{l.value=!1};return(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(d.value),onMousedown:o,onMouseup:i,onMouseleave:i},[e.createElementVNode("span",null,e.toDisplayString(u.text),1)],34))}});const B=e.defineComponent({__name:"OneCollapse",props:{blockClass:{},titleClass:{},defaultOpen:{type:Boolean}},setup(u){const t=u,{blockClass:l,titleClass:d,defaultOpen:o}=e.toRefs(t),i=e.ref(null),s=e.ref((o==null?void 0:o.value)??!1),r=()=>{s.value=!s.value},a=c=>{const n=c;n.style.height="0"},_=c=>{const n=c;n.style.height=`${c.scrollHeight}px`,n.style.transition="height 0.3s ease"},v=c=>{const n=c;n.style.height=`${c.scrollHeight}px`,e.nextTick(()=>{n.style.height="0",n.style.transition="height 0.3s ease"})};return(c,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l))},[e.createElementVNode("div",{onClick:r,class:e.normalizeClass(e.unref(d))},[e.renderSlot(c.$slots,"title",{isOpen:s.value},void 0,!0)],2),e.createVNode(e.Transition,{name:"accordion",onBeforeEnter:a,onEnter:_,onLeave:v},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"content",ref:i},[e.renderSlot(c.$slots,"default",{},void 0,!0)],512),[[e.vShow,s.value]])]),_:3})],2))}});const S=y._export_sfc(B,[["__scopeId","data-v-525e3430"]]);const E={},V={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 $(u,t){return e.openBlock(),e.createElementBlock("svg",V,t[0]||(t[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 F=y._export_sfc(E,[["render",$]]),D={color:{type:String,default:"green"},size:{type:String,default:"md"},modelValue:{type:Boolean,default:!1},isLoading:{required:!1,type:Boolean,default:!1},disabled:{required:!1,type:Boolean,default:!1},textOn:{type:String,default:""},textOff:{type:String,default:""},iconOn:{type:[Function,Object]},iconOff:{type:[Function,Object]},iconClass:{type:[String,Array]}},I=["disabled","checked"],M=e.defineComponent({__name:"OneSwitch",props:D,emits:["update:modelValue"],setup(u,{emit:t}){const l=u,d=t,o=e.ref(l.modelValue),i=e.computed(()=>l.disabled),s=()=>{o.value=!o.value,d("update:modelValue",o.value)};e.watch(()=>l.modelValue,n=>{o.value=n});const r=e.computed(()=>l.size==="sm"?"w-max min-w-[40px] h-[20px]":l.size==="lg"?"w-max min-w-[60px] h-[31px]":l.size==="md"?"w-max min-w-[50px] h-[24px]":"w-max"),a=e.computed(()=>{if(o.value)switch(l.color){case"green":return"#86c94c";case"blue":return"#2196f3";case"red":return"#f44336";case"yellow":return"#ffeb3b";default:return"#86c94c"}else return"#E2E7EF"}),_=e.computed(()=>l.iconOn),v=e.computed(()=>l.iconOff),c=e.computed(()=>{const n=[];return typeof l.iconClass=="string"?n.push(l.iconClass):l.iconClass instanceof Array&&n.push(...l.iconClass),n});return(n,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("input",{type:"checkbox",disabled:n.disabled,checked:o.value,class:"hidden w-96",onClick:s},null,8,I),e.createElementVNode("div",{onClick:s,class:e.normalizeClass(["relative rounded-full cursor-pointer flex items-center",[r.value,n.isLoading?"loading":"",i.value?"disabled opacity-50 pointer-events-none":""]]),style:e.normalizeStyle({backgroundColor:i.value?"#ccc":a.value})},[e.createElementVNode("div",{class:e.normalizeClass(["bg-white absolute rounded-full",[n.size==="sm"?"w-[16px] h-[16px]":"",n.size==="md"?"w-[20px] h-[20px]":"",n.size==="lg"?"w-[27px] h-[27px]":"",o.value?"right-[2px] top-[2px]":"left-[2px] top-[2px]"]])},[e.createElementVNode("div",{class:e.normalizeClass(["circle",r.value])},[n.isLoading?(e.openBlock(),e.createBlock(F,{key:0,class:"absolute w-3 h-3 text-gray-400 left-1/2 top-1/2 -ml-1.5 -mt-1.5"})):o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_.value),{key:1,class:e.normalizeClass([c.value,"absolute w-3 h-3 text-gray-400 left-1/2 top-1/2 -ml-1.5 -mt-1.5"]),style:e.normalizeStyle({color:o.value?a.value:""})},null,8,["class","style"])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(v.value),{key:2,class:e.normalizeClass([c.value,"absolute w-3 h-3 text-gray-400 left-1/2 top-1/2 -ml-1.5 -mt-1.5"])},null,8,["class"]))],2)],2),o.value&&n.textOn?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["switch-text text-white",[n.size==="sm"?"text-xs pr-6 pl-2":"",n.size==="md"?"text-sm pr-6 pl-2":"",n.size==="lg"?"text-base pr-8 pl-2":""]])},e.toDisplayString(n.textOn),3)):!o.value&&n.textOff?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["switch-text w-max",[n.size==="sm"?"text-xs pl-6 pr-2":"",n.size==="md"?"text-sm pl-7 pr-2":"",n.size==="lg"?"text-base pl-8 pr-2":""]])},e.toDisplayString(n.textOff),3)):e.createCommentVNode("",!0)],6)],64))}});const N=y._export_sfc(M,[["__scopeId","data-v-1bbf999e"]]),q={buttons:{type:Array,default:[]},modelValue:{required:!1,type:[String,Number,Array,Boolean,Object,null]}},L={class:"flex text-xs space-x-0.5 bg-gray-100 p-0.5 rounded-md"},A=["onClick"],H=e.defineComponent({__name:"OneButtonGroup",props:q,emits:["update:modelValue"],setup(u,{emit:t}){const l=t;return(d,o)=>(e.openBlock(),e.createElementBlock("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.buttons,i=>(e.openBlock(),e.createElementBlock("button",{key:i.key,class:e.normalizeClass([{"bg-white":i.key==d.modelValue,"text-blue-600":i.key==d.modelValue},"h-[32px] w-full transition-all px-3 rounded-md hover:text-blue-600"]),onClick:s=>l("update:modelValue",i.key)},e.toDisplayString(i.label),11,A))),128))]))}});exports.OneButton=g._sfc_main;exports.OneCard=f.OneCard;exports.OneCardBody=f.OneCardBody;exports.OneCardFooter=f.OneCardFooter;exports.OneCardHeader=f.OneCardHeader;exports.OneForm=p.OneForm;exports.OneFormFeedback=p.OneFormFeedback;exports.OneFormField=p.OneFormField;exports.OneFormInput=p.OneFormInput;exports.OneFormLabel=p.OneFormLabel;exports.OneBrowserMenu=m.OneBrowserMenu;exports.OneDropdown=m._sfc_main$1;exports.OneDropdownItem=m._sfc_main$2;exports.OneHelpMenu=m.OneHelpMenu;exports.OneUserMenu=m._sfc_main;exports.OneBrowserMenuGrid=x.OneBrowserMenuGrid;exports.OneDropdownAuto=x.OneDropdownAuto;exports.OneDropdownDivider=x.OneDropdownDivider;exports.OneAvatar=h._sfc_main;exports.OneMarkdown=w.OneMarkdown;exports.OneButtonGroup=H;exports.OneCollapse=S;exports.OneIndicators=k;exports.OneLabel=z;exports.OneSwitch=N;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { _ as ce } from "./index-
|
|
2
|
-
import { OneCard as
|
|
1
|
+
import { _ as ce } from "./index-6181061b.js";
|
|
2
|
+
import { OneCard as de, OneCardBody as pe, OneCardFooter as me, OneCardHeader as fe } from "./card/index.js";
|
|
3
3
|
import { OneForm as ye, OneFormFeedback as ve, OneFormField as he, OneFormInput as ge, OneFormLabel as _e } from "./form/index.js";
|
|
4
|
-
import { d as be, e as Oe, f as Ce, O as ke, _ as ze } from "./OneHelpMenu-
|
|
4
|
+
import { d as be, e as Oe, f as Ce, O as ke, _ as ze } from "./OneHelpMenu-a40ac0b4.js";
|
|
5
5
|
import { OneBrowserMenuGrid as Se, OneDropdownAuto as Ve, OneDropdownDivider as Be } from "./dropdown/index.js";
|
|
6
6
|
import { _ as Ee } from "./OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
|
|
7
7
|
import { OneMarkdown as Le } from "./common/index.js";
|
|
8
|
-
import { defineComponent as h, computed as p, openBlock as i, createElementBlock as m, normalizeClass as
|
|
8
|
+
import { defineComponent as h, computed as p, openBlock as i, createElementBlock as m, normalizeClass as u, normalizeStyle as v, createElementVNode as x, toDisplayString as y, createCommentVNode as $, ref as g, toRefs as V, unref as C, renderSlot as k, createVNode as B, Transition as I, withCtx as E, withDirectives as F, vShow as L, nextTick as M, watch as D, Fragment as S, createBlock as O, resolveDynamicComponent as z, renderList as A } from "vue";
|
|
9
9
|
import { _ } from "./_plugin-vue_export-helper-dad06003.js";
|
|
10
10
|
import "./XMarkIcon-51ef0691.js";
|
|
11
11
|
const j = {
|
|
@@ -51,7 +51,7 @@ const j = {
|
|
|
51
51
|
default:
|
|
52
52
|
return "#E3ECF2";
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
54
|
+
}), d = p(() => {
|
|
55
55
|
let s = "", o = "", a;
|
|
56
56
|
return e.text ? e.size === "sm" ? (o = "min-w-[12px]", a = "textSm") : e.size === "md" ? (o = "min-w-[16px]", a = "textMd") : e.size === "lg" && (o = "min-w-[20px]", a = "textLg") : e.size === "sm" ? s = "w-3 min-w-[12px]" : e.size === "lg" ? s = "w-5 min-w-[20px]" : e.size === "md" && (s = "w-4 min-w-[16px]"), `${s} ${a} ${o} h-${e.size === "sm" ? 3 : e.size === "lg" ? 5 : 4}`;
|
|
57
57
|
}), l = p(() => {
|
|
@@ -67,13 +67,16 @@ const j = {
|
|
|
67
67
|
});
|
|
68
68
|
return (s, o) => e.variant === "indicators" ? (i(), m("div", {
|
|
69
69
|
key: 0,
|
|
70
|
-
class:
|
|
70
|
+
class: u(["rounded-full border border-white flex items-center justify-center w-max", [d.value]]),
|
|
71
71
|
style: v({ backgroundColor: n.value })
|
|
72
72
|
}, [
|
|
73
73
|
x("p", G, y(s.text), 1)
|
|
74
74
|
], 6)) : e.variant === "barge" ? (i(), m("div", {
|
|
75
75
|
key: 1,
|
|
76
|
-
class:
|
|
76
|
+
class: u(["rounded px-2 py-1 text-center w-max", [
|
|
77
|
+
l.value,
|
|
78
|
+
{ "rounded-full": s.bargeVariant === "round", rounded: s.bargeVariant !== "round" }
|
|
79
|
+
]]),
|
|
77
80
|
style: v([r.value])
|
|
78
81
|
}, [
|
|
79
82
|
x("p", {
|
|
@@ -83,7 +86,7 @@ const j = {
|
|
|
83
86
|
], 6)) : $("", !0);
|
|
84
87
|
}
|
|
85
88
|
});
|
|
86
|
-
const se = /* @__PURE__ */ _(H, [["__scopeId", "data-v-
|
|
89
|
+
const se = /* @__PURE__ */ _(H, [["__scopeId", "data-v-f0eea1db"]]), ne = /* @__PURE__ */ h({
|
|
87
90
|
__name: "OneLabel",
|
|
88
91
|
props: {
|
|
89
92
|
size: {
|
|
@@ -108,7 +111,7 @@ const se = /* @__PURE__ */ _(H, [["__scopeId", "data-v-3d58c944"]]), ne = /* @__
|
|
|
108
111
|
}
|
|
109
112
|
},
|
|
110
113
|
setup(f) {
|
|
111
|
-
const e = f, n = g(!1),
|
|
114
|
+
const e = f, n = g(!1), d = p(() => {
|
|
112
115
|
const s = "inline-flex items-center cursor-pointer transition-opacity rounded-full", o = e.size === "mini" ? "text-xs px-3 py-1" : "text-sm px-4 py-2", a = e.filled ? `${e.color}-filled` : `${e.color}-border`;
|
|
113
116
|
return `${s} ${o} ${a} ${n.value ? "opacity-80" : "hover:opacity-90"}`;
|
|
114
117
|
}), l = () => {
|
|
@@ -117,7 +120,7 @@ const se = /* @__PURE__ */ _(H, [["__scopeId", "data-v-3d58c944"]]), ne = /* @__
|
|
|
117
120
|
n.value = !1;
|
|
118
121
|
};
|
|
119
122
|
return (s, o) => (i(), m("div", {
|
|
120
|
-
class: d
|
|
123
|
+
class: u(d.value),
|
|
121
124
|
onMousedown: l,
|
|
122
125
|
onMouseup: r,
|
|
123
126
|
onMouseleave: r
|
|
@@ -134,7 +137,7 @@ const N = /* @__PURE__ */ h({
|
|
|
134
137
|
defaultOpen: { type: Boolean }
|
|
135
138
|
},
|
|
136
139
|
setup(f) {
|
|
137
|
-
const e = f, { blockClass: n, titleClass:
|
|
140
|
+
const e = f, { blockClass: n, titleClass: d, defaultOpen: l } = V(e), r = g(null), s = g((l == null ? void 0 : l.value) ?? !1), o = () => {
|
|
138
141
|
s.value = !s.value;
|
|
139
142
|
}, a = (c) => {
|
|
140
143
|
const t = c;
|
|
@@ -149,11 +152,11 @@ const N = /* @__PURE__ */ h({
|
|
|
149
152
|
});
|
|
150
153
|
};
|
|
151
154
|
return (c, t) => (i(), m("div", {
|
|
152
|
-
class:
|
|
155
|
+
class: u(C(n))
|
|
153
156
|
}, [
|
|
154
157
|
x("div", {
|
|
155
158
|
onClick: o,
|
|
156
|
-
class:
|
|
159
|
+
class: u(C(d))
|
|
157
160
|
}, [
|
|
158
161
|
k(c.$slots, "title", { isOpen: s.value }, void 0, !0)
|
|
159
162
|
], 2),
|
|
@@ -178,7 +181,7 @@ const N = /* @__PURE__ */ h({
|
|
|
178
181
|
], 2));
|
|
179
182
|
}
|
|
180
183
|
});
|
|
181
|
-
const le = /* @__PURE__ */ _(N, [["__scopeId", "data-v-
|
|
184
|
+
const le = /* @__PURE__ */ _(N, [["__scopeId", "data-v-525e3430"]]);
|
|
182
185
|
const P = {}, q = {
|
|
183
186
|
class: "spinner",
|
|
184
187
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -244,12 +247,15 @@ const T = /* @__PURE__ */ _(P, [["render", R]]), W = {
|
|
|
244
247
|
props: W,
|
|
245
248
|
emits: ["update:modelValue"],
|
|
246
249
|
setup(f, { emit: e }) {
|
|
247
|
-
const n = f,
|
|
248
|
-
l.value = !l.value,
|
|
250
|
+
const n = f, d = e, l = g(n.modelValue), r = p(() => n.disabled), s = () => {
|
|
251
|
+
l.value = !l.value, d("update:modelValue", l.value);
|
|
249
252
|
};
|
|
250
|
-
D(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
+
D(
|
|
254
|
+
() => n.modelValue,
|
|
255
|
+
(t) => {
|
|
256
|
+
l.value = t;
|
|
257
|
+
}
|
|
258
|
+
);
|
|
253
259
|
const o = p(() => n.size === "sm" ? "w-max min-w-[40px] h-[20px]" : n.size === "lg" ? "w-max min-w-[60px] h-[31px]" : n.size === "md" ? "w-max min-w-[50px] h-[24px]" : "w-max"), a = p(() => {
|
|
254
260
|
if (l.value)
|
|
255
261
|
switch (n.color) {
|
|
@@ -280,7 +286,7 @@ const T = /* @__PURE__ */ _(P, [["render", R]]), W = {
|
|
|
280
286
|
}, null, 8, U),
|
|
281
287
|
x("div", {
|
|
282
288
|
onClick: s,
|
|
283
|
-
class:
|
|
289
|
+
class: u(["relative rounded-full cursor-pointer flex items-center", [
|
|
284
290
|
o.value,
|
|
285
291
|
t.isLoading ? "loading" : "",
|
|
286
292
|
r.value ? "disabled opacity-50 pointer-events-none" : ""
|
|
@@ -288,7 +294,7 @@ const T = /* @__PURE__ */ _(P, [["render", R]]), W = {
|
|
|
288
294
|
style: v({ backgroundColor: r.value ? "#ccc" : a.value })
|
|
289
295
|
}, [
|
|
290
296
|
x("div", {
|
|
291
|
-
class:
|
|
297
|
+
class: u(["bg-white absolute rounded-full", [
|
|
292
298
|
t.size === "sm" ? "w-[16px] h-[16px]" : "",
|
|
293
299
|
t.size === "md" ? "w-[20px] h-[20px]" : "",
|
|
294
300
|
t.size === "lg" ? "w-[27px] h-[27px]" : "",
|
|
@@ -296,31 +302,31 @@ const T = /* @__PURE__ */ _(P, [["render", R]]), W = {
|
|
|
296
302
|
]])
|
|
297
303
|
}, [
|
|
298
304
|
x("div", {
|
|
299
|
-
class:
|
|
305
|
+
class: u(["circle", o.value])
|
|
300
306
|
}, [
|
|
301
307
|
t.isLoading ? (i(), O(T, {
|
|
302
308
|
key: 0,
|
|
303
309
|
class: "absolute w-3 h-3 text-gray-400 left-1/2 top-1/2 -ml-1.5 -mt-1.5"
|
|
304
310
|
})) : l.value ? (i(), O(z(w.value), {
|
|
305
311
|
key: 1,
|
|
306
|
-
class:
|
|
312
|
+
class: u([c.value, "absolute w-3 h-3 text-gray-400 left-1/2 top-1/2 -ml-1.5 -mt-1.5"]),
|
|
307
313
|
style: v({ color: l.value ? a.value : "" })
|
|
308
314
|
}, null, 8, ["class", "style"])) : (i(), O(z(b.value), {
|
|
309
315
|
key: 2,
|
|
310
|
-
class:
|
|
316
|
+
class: u([c.value, "absolute w-3 h-3 text-gray-400 left-1/2 top-1/2 -ml-1.5 -mt-1.5"])
|
|
311
317
|
}, null, 8, ["class"]))
|
|
312
318
|
], 2)
|
|
313
319
|
], 2),
|
|
314
320
|
l.value && t.textOn ? (i(), m("div", {
|
|
315
321
|
key: 0,
|
|
316
|
-
class:
|
|
322
|
+
class: u(["switch-text text-white", [
|
|
317
323
|
t.size === "sm" ? "text-xs pr-6 pl-2" : "",
|
|
318
324
|
t.size === "md" ? "text-sm pr-6 pl-2" : "",
|
|
319
325
|
t.size === "lg" ? "text-base pr-8 pl-2" : ""
|
|
320
326
|
]])
|
|
321
327
|
}, y(t.textOn), 3)) : !l.value && t.textOff ? (i(), m("div", {
|
|
322
328
|
key: 1,
|
|
323
|
-
class:
|
|
329
|
+
class: u(["switch-text w-max", [
|
|
324
330
|
t.size === "sm" ? "text-xs pl-6 pr-2" : "",
|
|
325
331
|
t.size === "md" ? "text-sm pl-7 pr-2" : "",
|
|
326
332
|
t.size === "lg" ? "text-base pl-8 pr-2" : ""
|
|
@@ -330,7 +336,7 @@ const T = /* @__PURE__ */ _(P, [["render", R]]), W = {
|
|
|
330
336
|
], 64));
|
|
331
337
|
}
|
|
332
338
|
});
|
|
333
|
-
const oe = /* @__PURE__ */ _(J, [["__scopeId", "data-v-
|
|
339
|
+
const oe = /* @__PURE__ */ _(J, [["__scopeId", "data-v-1bbf999e"]]), K = {
|
|
334
340
|
buttons: {
|
|
335
341
|
type: Array,
|
|
336
342
|
default: []
|
|
@@ -345,12 +351,12 @@ const oe = /* @__PURE__ */ _(J, [["__scopeId", "data-v-d0ecef0b"]]), K = {
|
|
|
345
351
|
emits: ["update:modelValue"],
|
|
346
352
|
setup(f, { emit: e }) {
|
|
347
353
|
const n = e;
|
|
348
|
-
return (
|
|
349
|
-
(i(!0), m(S, null, A(
|
|
354
|
+
return (d, l) => (i(), m("div", Q, [
|
|
355
|
+
(i(!0), m(S, null, A(d.buttons, (r) => (i(), m("button", {
|
|
350
356
|
key: r.key,
|
|
351
|
-
class:
|
|
352
|
-
"bg-white": r.key ==
|
|
353
|
-
"text-blue-600": r.key ==
|
|
357
|
+
class: u([{
|
|
358
|
+
"bg-white": r.key == d.modelValue,
|
|
359
|
+
"text-blue-600": r.key == d.modelValue
|
|
354
360
|
}, "h-[32px] w-full transition-all px-3 rounded-md hover:text-blue-600"]),
|
|
355
361
|
onClick: (s) => n("update:modelValue", r.key)
|
|
356
362
|
}, y(r.label), 11, X))), 128))
|
|
@@ -363,7 +369,7 @@ export {
|
|
|
363
369
|
Se as OneBrowserMenuGrid,
|
|
364
370
|
ce as OneButton,
|
|
365
371
|
ae as OneButtonGroup,
|
|
366
|
-
|
|
372
|
+
de as OneCard,
|
|
367
373
|
pe as OneCardBody,
|
|
368
374
|
me as OneCardFooter,
|
|
369
375
|
fe as OneCardHeader,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtractPropTypes } from
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
2
|
export type IndicatorsColorType = 'green' | 'blue' | 'red' | 'yellow';
|
|
3
3
|
export type IndicatorsSizeType = 'sm' | 'md' | 'lg';
|
|
4
4
|
export type IndicatorsVariantType = 'indicators' | 'barge';
|