@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
2 lines (1 loc) • 21.3 kB
JavaScript
(function(S,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../notify/index.umd.js"),require("../common/index.umd.js"),require("../capsule/index.umd.js"),require("../locale/index.umd.js"),require("../response-toolbar/index.umd.js"),require("bignumber.js"),require("lodash-es"),require("../section/index.umd.js"),require("../property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../notify/index.umd.js","../common/index.umd.js","../capsule/index.umd.js","../locale/index.umd.js","../response-toolbar/index.umd.js","bignumber.js","lodash-es","../section/index.umd.js","../property-panel/index.umd.js"],e):(S=typeof globalThis<"u"?globalThis:S||self,e(S.tabs={},S.Vue,S.notify,S.common,S.FCapsule,S.locale,S.FResponseToolbar,S.BigNumber,S.LodashES,S.FSection,S.propertyPanel))})(this,function(S,e,Q,L,X,q,Z,je,Ie,E,ee){"use strict";const $={tabType:{type:String,default:"default"},autoTitleWidth:{type:Boolean,default:!1},titleLength:{type:Number,default:7},position:{type:String,default:"top"},showDropdown:{type:Boolean,default:!0},scrollStep:{type:Number,default:10},autoResize:{type:Boolean,default:!1},width:{type:Number},height:{type:Number},searchBoxVisible:{type:Boolean,default:!0},titleWidth:{type:Number,default:0},customClass:{type:String,default:""},activeId:{type:String},fill:{type:Boolean,default:!1},justifyContent:{type:String,default:"left"},visible:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},beforeTabSelect:{type:Function,default:null}};function te(){function t(n,l,u){const i={};return i.beforeTabSelect=a=>l.call("beforeTabSelect",n,[a,n],u),i}return{resolve:t}}function ne(t,n,l){const u=new Q.FNotifyService,i=e.ref([]),a=e.ref(t.activeId||"");let f="";const m=e.ref(!0),b=e.ref([]),v=e.ref(!0),p=e.ref(0),y=e.computed(()=>{const o=i.value.find(c=>c.props.id===a.value);return(o==null?void 0:o.props.toolbarPosition)==="inHead"});let w;function j(o){w=o}function V(o,d=!0){const c=o.findIndex(T=>T.props.show!==!1&&!T.props.disabled);if(c!==-1){if(a.value=o[c].props.id,!d)return;b.value=[];const T=o[c];T&&T.props.toolbar&&T.props.toolbar.buttons&&T.props.toolbar.buttons.length&&(b.value=[...T.props.toolbar.buttons],v.value=T.props.toolbarVisible)}}function s(o){a.value=o;const d=i.value.find(c=>c.props.id===o);b.value=[],d&&d.props.toolbar&&d.props.toolbar.buttons&&d.props.toolbar.buttons.length&&(b.value=[...d.props.toolbar.buttons],v.value=d.props.toolbarVisible),n.emit("update:activeId",o),n.emit("tabChange",{prevId:f,nextId:a.value})}async function g(o,d,c,T){var R;const B=await((R=t.beforeTabSelect)==null?void 0:R.call(t,{prevId:o,nextId:d}));(typeof B=="boolean"?B:(B==null?void 0:B.canSelect)??!0)?c&&c():(T&&T(),typeof B!="boolean"&&B.message&&(u==null||u.warning({message:B.message,position:"top-center"})))}function x(o){let d=-1;if(!a.value){if(d=o.findIndex(c=>a.value===c.props.id&&c.props.show!==!1&&!c.props.disabled),d>-1)return;f=a.value}V(o,!1),g(f,a.value,()=>{s(a.value),w&&w()},()=>{a.value=f})}function h(o){let d=!1;if(o){const c=i.value.find(T=>T.props.id===o);d=!c||c.props.show===!1||c.props.disabled===!0}if(d)x(i.value);else if(a.value!==o){const c=a.value;g(c,o,()=>{f=c,a.value=o,s(a.value),w&&w()},()=>{a.value=c,n.emit("update:activeId",c)})}else s(a.value)}e.watch(()=>t.activeId,(o,d)=>{o!==d&&t.activeId!==a.value&&h(o)});function I(o){var c;if(t.autoTitleWidth)return;const d=(c=o.value)==null?void 0:c.querySelectorAll(".st-tab-text");if(!(!d||t.tabType==="pill"))for(let T=0;T<d.length;T++){const B=d[T].parentNode;d[T].scrollWidth>B.offsetWidth?d[T].classList.contains("farris-title-text-custom")||d[T].classList.add("farris-title-text-custom"):d[T].classList.remove("farris-title-text-custom")}}const N=o=>{o.preventDefault(),o.stopPropagation()};function O(o,d,c=!1){const T=i.value.findIndex(B=>B.props.id===d);i.value=i.value.filter(B=>B.props.id!==d),a.value===d&&(f=d,a.value="",V(i.value)),N(o),e.nextTick(()=>{p.value++,I(l),c&&(m.value=!0),n.emit("tabRemove",{removeIndex:T,removeId:d,activeId:a.value})})}function k(o,d=!0){const c=i.value.find(T=>T.props.id===o);c&&(c.props.show===!1&&a.value===o?(a.value="",f=o,h("")):c.props.show===!0&&!a.value&&x(i.value),e.nextTick(()=>{p.value++,d&&(m.value=!0)}))}function H(o){a.value!==o&&g(f,o,()=>{f=a.value,s(o),w&&w()},null)}function M(o){i.value.findIndex(c=>c.props.id===o.props.id)===-1&&i.value.push(o),p.value++}function r(o){i.value.findIndex(c=>c.props.id===o.props.id)!==-1&&(i.value.forEach(c=>{c.props.id===o.props.id&&(c=o)}),o.props.id===a.value&&y.value,e.nextTick(()=>{p.value++,I(l)}))}return{activeId:a,addTab:M,changeTitleStyle:I,removeTab:O,selectTab:H,tabPages:i,updateTab:r,toolbarItems:b,needUpdateNavigationLayout:p,checkActiveIdAndSelect:h,toggleShowTab:k,hasInHeadClass:y,setScrollToSelectedTabFunction:j,toolbarVisible:v}}function oe(t,n,l,u,i){const{activeId:a,removeTab:f,selectTab:m}=i,b=e.computed(()=>{const h={"st-tab-text":!0,"text-truncate":t.tabType==="pill"&&!t.autoTitleWidth,"farris-title-auto":t.autoTitleWidth};return L.getCustomClass(h,n.customTitleClass)}),v=e.computed(()=>({"nav-item":!0,"d-none":n.show!==void 0?!n.show:!1,"f-state-active":n.id===a.value,"f-state-disabled":n.disabled})),p=e.computed(()=>({width:`${n.tabWidth}px`})),y=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:n.id===a.value,disabled:n.disabled})),w=e.reactive({content:n.title,overflowShown:!0});function j(){return t.tabType!=="pill"&&!t.autoTitleWidth?e.withDirectives(e.createVNode("span",{class:b.value,"data-tabid":n.id},[n.title]),[[e.resolveDirective("tooltip"),w]]):e.createVNode("span",{class:b.value,"data-tabid":n.id,title:n.title},[n.title])}const V=e.ref(n.removeable);function s(){return V.value?e.createVNode("span",{class:"st-drop-close",onClick:h=>f(h,n.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]):""}function g(h){m(n.id),t.tabType==="one-page"&&u.scrollToByPaggId(n.id)}function x(){return l.slots.title?e.createVNode("a",{class:y.value,onClick:g,id:`${n.id}-tab-title`},[l.slots.title(l),s()]):n.titleRenderFunction?e.createVNode("a",{class:y.value,onClick:g,id:`${n.id}-tab-title`},[n.titleRenderFunction(),s()]):e.createVNode("a",{class:y.value,onClick:g,id:`${n.id}-tab-title`},[j(),s()])}return e.createVNode("li",{class:v.value,style:p.value},[x()])}function le(t,n,l,u,i){const{shouldShowNavigationButtons:a}=l,{tabPages:f}=i,m=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":a.value})),b=e.computed(()=>({width:"100%","justify-content":t.justifyContent})),v=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":t.tabType==="fill","nav-pills":t.tabType==="pills","flex-row":t.position==="top"||t.position==="bottom","flex-column":t.position==="left"||t.position==="right"}));return()=>e.createVNode("div",{class:m.value,style:b.value},[e.createVNode("ul",{class:v.value,ref:n},[f.value.map(p=>oe(t,p.props,p,u,i))])])}function ae(t,n,l,u,i){const a=e.ref(),{shouldShowNavigationButtons:f}=l,{activeId:m,tabPages:b,selectTab:v}=i,p=e.ref(m.value),y=e.computed(()=>b.value.map(s=>({name:s.props.title,value:s.props.id,show:s.props.show,disabled:s.props.disabled}))),w=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":f.value})),j=e.computed(()=>({width:"100%",display:"flex","justify-content":t.justifyContent}));e.onMounted(()=>{a.value&&(n.value=a.value.$el)});function V(s){v(s)}return e.watch(()=>m.value,s=>{s!==p.value&&(p.value=s)},{immediate:!0}),()=>e.createVNode("div",{class:w.value,style:j.value},[e.createVNode(X,{items:y.value,modelValue:p.value,"onUpdate:modelValue":s=>p.value=s,onChange:V,ref:a},null)])}function ie(t,n,l,u){const i=e.ref(),{activeId:a,removeTab:f,tabPages:m,selectTab:b}=u,{hideDropDown:v,searchTabText:p}=n,y=600;let w=null;const j=e.computed(()=>{var o,d;let r=[];return t.searchBoxVisible?r=(o=m.value)==null?void 0:o.filter(c=>c.props.title.includes(p.value)):r=(d=m.value)==null?void 0:d.slice(),r}),V=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":t.searchBoxVisible,show:!v.value,"d-none":v.value}));let s;function g(r){s=r}e.watch(v,r=>{if(s.value)if(r)i.value.style.width=null;else{const o=s.value.querySelector(".farris-tabs-header"),d=s.value.clientHeight-o.clientHeight-20,T=o.querySelector(".farris-tabs-title").clientWidth-20;i.value.style.maxWidth=T+"px",i.value.style.maxHeight=d+"px",e.nextTick(()=>{const{width:B}=i.value.getClientRects()[0];i.value.style.width=B?B+"px":null})}});function x(r){return{"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:r.props.disabled,active:r.props.id===a.value,"d-none":r.props.show!==!0}}function h(r){r.preventDefault(),r.stopPropagation()}function I(){w&&clearTimeout(w)}function N(){v.value||(w=setTimeout(()=>{v.value=!0},y))}function O(r,o){r.stopPropagation(),o.disabled||b(o.id),v.value=!0}function k(r,o){r.stopPropagation(),f(r,o,!0)}function H(r){return r.slots.title?e.createVNode("a",{class:"dropdown-title",id:`${r.props.id}-dropdown-item`},[r.slots.title(r)]):r.props.titleRenderFunction?e.createVNode("a",{class:"dropdown-title",id:`${r.props.id}-dropdown-item`},[r.props.titleRenderFunction()]):e.createVNode("a",{class:"dropdown-title",id:`${r.props.id}-dropdown-item`},[r.props.title])}function M(){return e.createVNode("div",{ref:i,class:V.value,onMouseenter:()=>I(),onMouseleave:()=>N()},[t.searchBoxVisible&&e.createVNode("div",{onClick:r=>h(r),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{type:"text",class:"form-control","onUpdate:modelValue":r=>p.value=r},null),[[e.vModelText,p.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),j.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items flex-fill"},[j.value.map(r=>e.createVNode("li",{class:x(r),onClick:o=>O(o,r.props)},[r.props.removeable&&r.props.disabled!==!0&&e.createVNode("span",{class:"float-right st-drop-close",onClick:o=>k(o,r.props.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),H(r)]))]):e.createVNode("div",{class:"dropdown-no-data"},[q.LocaleService.getLocaleValue("tabs.noData")])])}return{renderDropdownMenu:M,setTabsRef:g}}function se(t,n,l,u){const{hideDropDown:i}=n,{renderDropdownMenu:a,setTabsRef:f}=ie(t,n,l,u),m=e.ref(t.showDropdown);function b(){return m.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{i.value=!1}},null),a()])}return{renderMorePagesButtton:b,setTabsRef:f}}function re(t,n,l,u){const i=e.ref(!1),{selectTab:a,tabPages:f,needUpdateNavigationLayout:m,activeId:b}=u,v=4,p=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!i.value})),y=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!i.value})),w=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!i.value}));function j(h,I){if(!n.value)return;const N=n.value.scrollLeft,O=n.value.scrollWidth-n.value.offsetWidth;if(I>0){if(n.value.scrollLeft>=O)return;n.value.scrollLeft=N+t.scrollStep+h}else if(I<0){if(n.value.scrollLeft<=0)return;n.value.scrollLeft=N-t.scrollStep-h}}function V(h=-1){if(!i.value||!n.value)return;h<0&&(h=f.value.findIndex(H=>H.props.id===b.value));const I=t.tabType==="pills"?".f-capsule-item":".nav-item",N=n.value.querySelectorAll(I),{parentElement:O}=n.value,k=N[h];if(k&&O){const H=O.getBoundingClientRect().left,M=O.getBoundingClientRect().right,r=k.getBoundingClientRect().left,o=k.getBoundingClientRect().right;r<H?j(H-r,-1):M<o&&j(o-M,1),t.tabType==="one-page"&&l.scrollTo(h)}}function s(){var N;if(!n.value)return;const h=n.value,I=(N=n.value)==null?void 0:N.parentElement;i.value=I&&h&&I.offsetWidth<h.scrollWidth-v,i.value&&e.nextTick(()=>{V()})}function g(h){h.disabled||a(h.id)}function x(){["default","one-page"].indexOf(t.tabType)>-1&&e.nextTick(()=>{V()})}return e.watch(m,()=>{s()}),{previousButtonClass:p,nextButtonGroupClass:y,nextButtonClass:w,scrollTab:j,selectAndScrollToTab:g,shouldShowNavigationButtons:i,updateNavigationLayout:s,scrollToSelectedTab:x}}function ce(t,n){const{tabPages:l}=n,u=e.ref(""),i=e.ref(!0),a=e.computed(()=>t.searchBoxVisible),f=e.computed(()=>a.value?l.value.filter(b=>b.props.title.includes(u.value)):l.value.slice());return e.watch(i,m=>{m||(u.value="")}),{searchTabText:u,hideDropDown:i,shouldShowSearchBox:a,tabsInDropdownMenu:f}}function de(t,n,l){const u=".farris-tab-page",{tabPages:i}=l;let a=-1;function f(){if(a<0){const v=document.querySelector(".farris-tabs-header");v&&(a=v.clientHeight)}return a}function m(v){const p=n.value;if(p){const y=n.value.querySelectorAll(u);if(y.length>0){const w=y[v],{offsetTop:j}=w,V=j-f();p.scrollTop=V>0?V:0}}}function b(v){const p=i.value.findIndex(y=>y.props.id===v);p>-1&&m(p)}return{scrollTo:m,scrollToByPaggId:b}}const ue=["moz","ms","webkit"];function fe(){let t=0;return n=>{const l=new Date().getTime(),u=Math.max(0,16-(l-t)),i=setTimeout(()=>{n(l+u)},u);return t=l+u,i}}function be(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=ue.filter(n=>`${n}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:fe()}be(),e.ref("");function pe(){const t=navigator.userAgent||navigator.vendor||window.opera,n=[/iPhone/i,/iPod/i,/Android.*Mobile/i,/webOS/i,/BlackBerry/i,/IEMobile/i,/Opera Mini/i,/Harmony/i],l=[/iPad/i,/Android(?!.*Mobile)/i,/Tablet/i,/PlayBook/i,/Kindle/i,/Silk/i];for(const m of l)if(m.test(t))return!1;for(const m of n)if(m.test(t))return!0;const u="ontouchstart"in window||navigator.maxTouchPoints>0,i=screen.width,a=screen.height,f=Math.min(i,a);return!!(u&&f<=768)}const A=e.defineComponent({name:"FTabs",props:$,emits:["tabChange","tabRemove","update:activeId","Click"],setup(t,n){const l=e.ref(t.tabType),u=e.shallowRef(),i=pe(),a=e.ref(t.customClass),f=e.shallowRef();e.shallowRef();const m=e.ref(),b=ne(t,n,f),{activeId:v,changeTitleStyle:p,tabPages:y,addTab:w,updateTab:j,toolbarItems:V,checkActiveIdAndSelect:s,toggleShowTab:g,hasInHeadClass:x,toolbarVisible:h}=b,I=de(t,u,b),N=re(t,f,I,b),{previousButtonClass:O,nextButtonClass:k,nextButtonGroupClass:H,scrollTab:M,updateNavigationLayout:r,scrollToSelectedTab:o}=N;b.setScrollToSelectedTabFunction(o);const d=ce(t,b),c=le(t,f,N,I,b),T=c,B=ae(t,f,N,I,b),W=new Map([["default",c],["one-page",T],["pills",B]]);e.computed(()=>{const C=y.value.find(P=>P.props.id===v.value);return C==null?void 0:C.slots});const R=e.computed(()=>t.fill),z=(C,P)=>{n.emit("Click",C,P,v.value)};e.provide("tabs",{activeId:v,addTab:w,updateTab:j,tabPages:y,tabType:l,shouldFillParentContaner:R,toggleShowTab:g,toolbarVisible:h,clickToolbarItemHandler:z});let G=!1;const me=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":x.value,"farris-tabs-inContent":!x.value,"farris-tabs-nav-fill":t.tabType==="fill","farris-tabs-nav-pills":t.tabType==="pills","d-none":t.showHeader===!1})),ve=e.computed(()=>{const C={width:x.value&&t.titleWidth?`${t.titleWidth}%`:""};return C.width&&(C.flex="unset"),C}),Te=e.computed(()=>{const C={"farris-tabs":!0,"f-tabs-content-fill":R.value,"flex-column":t.position==="top","flex-column-reverse":t.position==="bottom","flex-row":t.position==="left","flex-row-reverse":t.position==="right","one-page":t.tabType==="one-page"};return a.value&&a.value.split(" ").reduce((P,F)=>(P[F]=!0,P),C),C}),ge=new ResizeObserver(C=>{C.length&&r()});function K(){m.value&&!G&&(ge.observe(m.value),G=!0)}e.watch(()=>t.visible,C=>{e.nextTick(()=>{y.value.length&&s(t.activeId||y.value[0].props.id),r(),p(f),K()})}),e.watch(()=>t.autoTitleWidth,C=>{e.nextTick(()=>{r(),p(f)})}),e.onMounted(()=>{t.visible&&(y.value.length&&s(t.activeId||y.value[0].props.id),e.nextTick(()=>{r(),p(f)}),K())});function ye(){return e.createVNode("button",{title:q.LocaleService.getLocaleValue("tabs.leftButton"),type:"button",class:O.value,onClick:()=>{M(0,-1)}},null)}function we(){return e.createVNode("button",{title:q.LocaleService.getLocaleValue("tabs.rightButton"),type:"button",class:k.value,onClick:()=>{M(0,1)}},null)}const{renderMorePagesButtton:Ce,setTabsRef:Se}=se(t,d,N,b);Se(u);function xe(){return V.value.length?e.createVNode("div",{class:{"farris-tabs-toolbar":!0,"d-none":!h.value}},[e.createVNode(Z,{class:"f-utils-fill",alignment:x.value?"right":"left",items:V.value,visible:h.value,onClick:z},null)]):null}const Y=W.get(t.tabType)||W.get("default");function Ve(){var C,P,F,J;return e.createVNode("div",{class:me.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(P=(C=n.slots).headerPrefix)==null?void 0:P.call(C)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:ve.value,ref:m},[!i&&ye(),Y&&Y(),e.createVNode("div",{hidden:i,class:H.value},[we(),Ce()])]),xe(),e.createVNode("div",{class:"farris-tabs-header-post"},[(J=(F=n.slots).headerSuffix)==null?void 0:J.call(F)])])}e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":R.value}));function Be(){var C,P;return(P=(C=n.slots).default)==null?void 0:P.call(C)}return()=>t.visible?e.createVNode("div",{class:Te.value,ref:u},[Ve(),Be()]):null}}),U={tabWidth:{type:Number},id:{type:String,default:""},customTitleClass:{type:String,default:""},titleOverflow:{type:Boolean,default:!1},title:{type:String,default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removeable:{type:Boolean,default:!1},show:{type:Boolean,default:!0},toolbar:{type:Object,default:{}},toolbarPosition:{type:String,default:"inHead"},toolbarVisible:{type:Boolean,default:!0},titleRenderFunction:{type:Function}};function _(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const D=e.defineComponent({name:"FTabPage",props:U,emits:[],setup(t,n){const l=e.inject("tabs");L.isMobilePhone();const u=e.ref(t.show),i={slots:n.slots,props:t},a=e.ref((l==null?void 0:l.tabType.value)||"default");e.onMounted(()=>{const s=l==null?void 0:l.tabPages.value.findIndex(g=>g.props.id===t.id);(!s||s===-1)&&(l==null||l.addTab(i))}),e.onUnmounted(()=>{});const f=e.computed(()=>(t==null?void 0:t.id)===(l==null?void 0:l.activeId.value)),m=e.computed(()=>({display:f.value?"":"none"}));e.watch(()=>t,s=>{l==null||l.updateTab({props:s,slots:n.slots})},{immediate:!0,deep:!0}),e.watch(()=>t.show,s=>{u.value=s,l==null||l.toggleShowTab(t.id)}),e.watch(()=>t.toolbarVisible,s=>{f.value&&l&&(l.toolbarVisible.value=s)});function b(){var g,x;const s=(x=(g=n.slots).default)==null?void 0:x.call(g);return e.createVNode(E,{"main-title":t.title,class:["farris-tab-page",u.value?"":"f-tab-d-none"]},_(s)?s:{default:()=>[s]})}function v(s,g){l&&(l.activeId.value=t.id,l.clickToolbarItemHandler&&l.clickToolbarItemHandler(s,g))}function p(){var g,x;const s=(x=(g=n.slots).default)==null?void 0:x.call(g);return e.createVNode(E,{customClass:"section-in-tab is-mobile",onClick:v,visible:t.show,"main-title":t.title,buttons:t.toolbar.buttons,"button-position":t.toolbar.position||t.toolbarPosition,"buttons-visible":t.toolbarVisible},_(s)?s:{default:()=>[s]})}const y=e.computed(()=>{var g;return{"farris-tab-page":!0,"f-tab-d-none":!u.value,"f-tab-active":f.value&&l&&((g=l.shouldFillParentContaner)==null?void 0:g.value)}});function w(){var g,x;const s=(x=(g=n.slots).default)==null?void 0:x.call(g);return e.createVNode("div",{class:y.value,style:m.value},[s])}const V=new Map([["default",w],["one-page",b],["mobile",p]]).get(a.value)||w;return()=>V()}});class he extends ee.BaseControlProperty{constructor(n,l){super(n,l)}getPropertyConfig(n,l=!1){return this.propertyConfig.categories.basic=this.getBasicPropConfig(n),this.propertyConfig.categories.basic.properties.text={title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},this.getAppearanceProperties(n,l),this.getbBehaviorConfig(n),this.getEventPropConfig(n),this.propertyConfig}getAppearanceProperties(n,l=!1){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式",visible:!l},icon:{title:"图标",type:"string",description:""},split:{title:"下拉按钮分离",type:"boolean",description:"启用下拉按钮分离,可以单独点击按钮。单独点击下拉按钮展开下拉面板",visible:!!(n.children&&n.children.length>0)}}}}getbBehaviorConfig(n){const l=this.getPropertyEditorParams(n,["Const","Variable","StateMachine","Custom","Expression"],"disabled");this.propertyConfig.categories.behavior=this.getBehaviorConfig(n,"",{disabled:{title:"禁用",type:"boolean",description:"按钮禁用状态",editor:l}})}getEventPropConfig(n){const l=[{label:"onClick",name:"点击事件"}],u=this,i=u.eventsEditorUtils.formProperties(n,u.viewModelId,l),a=u.createBaseEventProperty(i);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:L.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(f,m){const b=f.propertyValue;delete n[u.viewModelId],b&&(b.setPropertyRelates=this.setPropertyRelates,u.eventsEditorUtils.saveRelatedParameters(n,u.viewModelId,b.events,b))}}}}A.install=t=>{t.component(A.name,A),t.component(D.name,D)},S.FTabPage=D,S.FTabs=A,S.TabToolbarItemProperty=he,S.createTabsCallbackResolver=te,S.default=A,S.tabPageProps=U,S.tabsProps=$,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});