@farris/ui-vue 1.8.5-beta.3 → 1.8.5-beta.4
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/components/batch-editor/index.esm.js +6850 -6840
- package/components/batch-editor/index.umd.cjs +20 -20
- package/components/button/index.esm.js +6852 -6842
- package/components/button/index.umd.cjs +20 -20
- package/components/button-edit/index.esm.js +140 -140
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/button-group/index.esm.js +46 -45
- package/components/button-group/index.umd.cjs +1 -1
- package/components/common/index.esm.js +16 -12
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +411 -411
- package/components/component/index.umd.cjs +2 -2
- package/components/data-view/index.esm.js +6500 -6487
- package/components/data-view/index.umd.cjs +21 -21
- package/components/designer-canvas/index.esm.js +269 -269
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +458 -458
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/filter-condition-editor/index.esm.js +386 -386
- package/components/filter-condition-editor/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +1100 -1100
- package/components/flow-canvas/index.umd.cjs +7 -7
- package/components/mapping-editor/index.esm.js +243 -243
- package/components/mapping-editor/index.umd.cjs +2 -2
- package/components/message-box/index.esm.js +82 -82
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +76 -76
- package/components/modal/index.umd.cjs +1 -1
- package/components/order/index.esm.js +139 -138
- package/components/order/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +891 -891
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +151 -149
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +947 -941
- package/components/schema-selector/index.umd.cjs +6 -6
- package/components/section/index.esm.js +121 -121
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +539 -539
- package/components/sort-condition-editor/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +448 -442
- package/components/tabs/index.umd.cjs +1 -1
- package/designer/button-edit/index.esm.js +97 -97
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +6483 -6470
- package/designer/data-grid/index.umd.cjs +21 -21
- package/designer/farris-designer.all.esm.js +1891 -1885
- package/designer/farris-designer.all.umd.cjs +14 -14
- package/designer/radio-group/index.esm.js +183 -183
- package/designer/radio-group/index.umd.cjs +2 -2
- package/designer/response-toolbar/index.esm.js +558 -556
- package/designer/response-toolbar/index.umd.cjs +1 -1
- package/designer/tabs/index.esm.js +416 -416
- package/designer/tabs/index.umd.cjs +2 -2
- package/farris.all.esm.js +9133 -9119
- package/farris.all.umd.cjs +35 -35
- package/package.json +1 -1
- package/types/common/index.d.ts +1 -0
- package/types/common/utils/attrs.d.ts +26 -0
- package/types/modal/src/composition/type.d.ts +2 -0
- package/types/tabs/src/composition/types.d.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(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,F,Z,D,ee,je,Ne,W,te){"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 ne(){function t(n,l,u){const i={};return i.beforeTabSelect=a=>l.call("beforeTabSelect",n,[a,n],u),i}return{resolve:t}}function oe(t,n,l){const u=new Q.FNotifyService,i=e.ref([]),a=e.ref(t.activeId||"");let b="";const v=e.ref(!0),f=e.ref([]),m=e.ref(!0),p=e.ref(0),T=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 I(o){w=o}function V(o,d=!0){const c=o.findIndex(y=>y.props.show!==!1&&!y.props.disabled);if(c!==-1){if(a.value=o[c].props.id,!d)return;f.value=[];const y=o[c];y&&y.props.toolbar&&y.props.toolbar.buttons&&y.props.toolbar.buttons.length&&(f.value=[...y.props.toolbar.buttons],m.value=y.props.toolbarVisible)}}function s(o){a.value=o;const d=i.value.find(c=>c.props.id===o);f.value=[],d&&d.props.toolbar&&d.props.toolbar.buttons&&d.props.toolbar.buttons.length&&(f.value=[...d.props.toolbar.buttons],m.value=d.props.toolbarVisible),n.emit("update:activeId",o),n.emit("tabChange",{prevId:b,nextId:a.value})}async function g(o,d,c,y){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():(y&&y(),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;b=a.value}V(o,!1),g(b,a.value,()=>{s(a.value),w&&w()},()=>{a.value=b})}function h(o){let d=!1;if(o){const c=i.value.find(y=>y.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,()=>{b=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 j(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 y=0;y<d.length;y++){const B=d[y].parentNode;d[y].scrollWidth>B.offsetWidth?d[y].classList.contains("farris-title-text-custom")||d[y].classList.add("farris-title-text-custom"):d[y].classList.remove("farris-title-text-custom")}}const N=o=>{o.preventDefault(),o.stopPropagation()};function O(o,d,c=!1){const y=i.value.findIndex(B=>B.props.id===d);i.value=i.value.filter(B=>B.props.id!==d),a.value===d&&(b=d,a.value="",V(i.value)),N(o),e.nextTick(()=>{p.value++,j(l),c&&(v.value=!0),n.emit("tabRemove",{removeIndex:y,removeId:d,activeId:a.value})})}function M(o,d=!0){const c=i.value.find(y=>y.props.id===o);c&&(c.props.show===!1&&a.value===o?(a.value="",b=o,h("")):c.props.show===!0&&!a.value&&x(i.value),e.nextTick(()=>{p.value++,d&&(v.value=!0)}))}function H(o){a.value!==o&&g(b,o,()=>{b=a.value,s(o),w&&w()},null)}function k(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&&T.value,e.nextTick(()=>{p.value++,j(l)}))}return{activeId:a,addTab:k,changeTitleStyle:j,removeTab:O,selectTab:H,tabPages:i,updateTab:r,toolbarItems:f,needUpdateNavigationLayout:p,checkActiveIdAndSelect:h,toggleShowTab:M,hasInHeadClass:T,setScrollToSelectedTabFunction:I,toolbarVisible:m}}function le(t,n,l,u,i){const{activeId:a,removeTab:b,selectTab:v}=i,f=e.computed(()=>{const h={"st-tab-text":!0,"text-truncate":t.tabType==="pill"&&!t.autoTitleWidth,"farris-title-auto":t.autoTitleWidth};return F.getCustomClass(h,n.customTitleClass)}),m=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`})),T=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 I(){return t.tabType!=="pill"&&!t.autoTitleWidth?e.withDirectives(e.createVNode("span",{class:f.value,"data-tabid":n.id},[n.title]),[[e.resolveDirective("tooltip"),w]]):e.createVNode("span",{class:f.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=>b(h,n.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]):""}function g(h){v(n.id),t.tabType==="one-page"&&u.scrollToByPaggId(n.id)}function x(){return l.slots.title?e.createVNode("a",{class:T.value,onClick:g,id:`${n.id}-tab-title`},[l.slots.title(l),s()]):n.titleRenderFunction?e.createVNode("a",{class:T.value,onClick:g,id:`${n.id}-tab-title`},[n.titleRenderFunction(),s()]):e.createVNode("a",{class:T.value,onClick:g,id:`${n.id}-tab-title`},[I(),s()])}return e.createVNode("li",{class:m.value,style:p.value},[x()])}function ae(t,n,l,u,i){const{shouldShowNavigationButtons:a}=l,{tabPages:b}=i,v=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":a.value})),f=e.computed(()=>({width:"100%","justify-content":t.justifyContent})),m=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:v.value,style:f.value},[e.createVNode("ul",{class:m.value,ref:n},[b.value.map(p=>le(t,p.props,p,u,i))])])}function ie(t,n,l,u,i){const a=e.ref(),{shouldShowNavigationButtons:b}=l,{activeId:v,tabPages:f,selectTab:m}=i,p=e.ref(v.value),T=e.computed(()=>f.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":b.value})),I=e.computed(()=>({width:"100%",display:"flex","justify-content":t.justifyContent}));e.onMounted(()=>{a.value&&(n.value=a.value.$el)});function V(s){m(s)}return e.watch(()=>v.value,s=>{s!==p.value&&(p.value=s)},{immediate:!0}),()=>e.createVNode("div",{class:w.value,style:I.value},[e.createVNode(Z,{items:T.value,modelValue:p.value,"onUpdate:modelValue":s=>p.value=s,onChange:V,ref:a},null)])}function se(t,n,l,u){const i=e.ref(),{activeId:a,removeTab:b,tabPages:v,selectTab:f}=u,{hideDropDown:m,searchTabText:p}=n,T=600;let w=null;const I=e.computed(()=>{var o,d;let r=[];return t.searchBoxVisible?r=(o=v.value)==null?void 0:o.filter(c=>c.props.title.includes(p.value)):r=(d=v.value)==null?void 0:d.slice(),r}),V=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":t.searchBoxVisible,show:!m.value,"d-none":m.value}));let s;function g(r){s=r}e.watch(m,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,y=o.querySelector(".farris-tabs-title").clientWidth-20;i.value.style.maxWidth=y+"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 j(){w&&clearTimeout(w)}function N(){m.value||(w=setTimeout(()=>{m.value=!0},T))}function O(r,o){r.stopPropagation(),o.disabled||f(o.id),m.value=!0}function M(r,o){r.stopPropagation(),b(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 k(){return e.createVNode("div",{ref:i,class:V.value,onMouseenter:()=>j(),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)]),I.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items flex-fill"},[I.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=>M(o,r.props.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),H(r)]))]):e.createVNode("div",{class:"dropdown-no-data"},[D.LocaleService.getLocaleValue("tabs.noData")])])}return{renderDropdownMenu:k,setTabsRef:g}}function re(t,n,l,u){const{hideDropDown:i}=n,{renderDropdownMenu:a,setTabsRef:b}=se(t,n,l,u),v=e.ref(t.showDropdown);function f(){return v.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{i.value=!1}},null),a()])}return{renderMorePagesButtton:f,setTabsRef:b}}function ce(t,n,l,u){const i=e.ref(!1),{selectTab:a,tabPages:b,needUpdateNavigationLayout:v,activeId:f}=u,m=4,p=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!i.value})),T=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 I(h,j){if(!n.value)return;const N=n.value.scrollLeft,O=n.value.scrollWidth-n.value.offsetWidth;if(j>0){if(n.value.scrollLeft>=O)return;n.value.scrollLeft=N+t.scrollStep+h}else if(j<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=b.value.findIndex(H=>H.props.id===f.value));const j=t.tabType==="pills"?".f-capsule-item":".nav-item",N=n.value.querySelectorAll(j),{parentElement:O}=n.value,M=N[h];if(M&&O){const H=O.getBoundingClientRect().left,k=O.getBoundingClientRect().right,r=M.getBoundingClientRect().left,o=M.getBoundingClientRect().right;r<H?I(H-r,-1):k<o&&I(o-k,1),t.tabType==="one-page"&&l.scrollTo(h)}}function s(){var N;if(!n.value)return;const h=n.value,j=(N=n.value)==null?void 0:N.parentElement;i.value=j&&h&&j.offsetWidth<h.scrollWidth-m,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(v,()=>{s()}),{previousButtonClass:p,nextButtonGroupClass:T,nextButtonClass:w,scrollTab:I,selectAndScrollToTab:g,shouldShowNavigationButtons:i,updateNavigationLayout:s,scrollToSelectedTab:x}}function de(t,n){const{tabPages:l}=n,u=e.ref(""),i=e.ref(!0),a=e.computed(()=>t.searchBoxVisible),b=e.computed(()=>a.value?l.value.filter(f=>f.props.title.includes(u.value)):l.value.slice());return e.watch(i,v=>{v||(u.value="")}),{searchTabText:u,hideDropDown:i,shouldShowSearchBox:a,tabsInDropdownMenu:b}}function ue(t,n,l){const u=".farris-tab-page",{tabPages:i}=l;let a=-1;function b(){if(a<0){const m=document.querySelector(".farris-tabs-header");m&&(a=m.clientHeight)}return a}function v(m){const p=n.value;if(p){const T=n.value.querySelectorAll(u);if(T.length>0){const w=T[m],{offsetTop:I}=w,V=I-b();p.scrollTop=V>0?V:0}}}function f(m){const p=i.value.findIndex(T=>T.props.id===m);p>-1&&v(p)}return{scrollTo:v,scrollToByPaggId:f}}const fe=["moz","ms","webkit"];function be(){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 pe(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=fe.filter(n=>`${n}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:be()}pe(),e.ref("");function $(){if(typeof window>"u"||typeof navigator>"u")return!1;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 f of l)if(f.test(t))return!1;for(const f of n)if(f.test(t))return!0;if(typeof screen>"u")return!1;const u="ontouchstart"in window||navigator.maxTouchPoints>0,i=screen.width,a=screen.height,b=Math.min(i,a);return!!(u&&b<=768)}function he(){const t=$();return t&&document.body.classList.add("f-mobile"),t}typeof document<"u"&&he();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=$(),a=e.ref(t.customClass),b=e.shallowRef();e.shallowRef();const v=e.ref(),f=oe(t,n,b),{activeId:m,changeTitleStyle:p,tabPages:T,addTab:w,updateTab:I,toolbarItems:V,checkActiveIdAndSelect:s,toggleShowTab:g,hasInHeadClass:x,toolbarVisible:h}=f,j=ue(t,u,f),N=ce(t,b,j,f),{previousButtonClass:O,nextButtonClass:M,nextButtonGroupClass:H,scrollTab:k,updateNavigationLayout:r,scrollToSelectedTab:o}=N;f.setScrollToSelectedTabFunction(o);const d=de(t,f),c=ae(t,b,N,j,f),y=c,B=ie(t,b,N,j,f),E=new Map([["default",c],["one-page",y],["pills",B]]);e.computed(()=>{const C=T.value.find(P=>P.props.id===m.value);return C==null?void 0:C.slots});const R=e.computed(()=>t.fill),G=(C,P)=>{n.emit("Click",C,P,m.value)};e.provide("tabs",{activeId:m,addTab:w,updateTab:I,tabPages:T,tabType:l,shouldFillParentContaner:R,toggleShowTab:g,toolbarVisible:h,clickToolbarItemHandler:G});let X=!1;const ve=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})),ye=e.computed(()=>{const C={width:x.value&&t.titleWidth?`${t.titleWidth}%`:""};return C.width&&(C.flex="unset"),C}),ge=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,L)=>(P[L]=!0,P),C),C}),Te=new ResizeObserver(C=>{C.length&&r()});function K(){v.value&&!X&&(Te.observe(v.value),X=!0)}e.watch(()=>t.visible,C=>{e.nextTick(()=>{T.value.length&&s(t.activeId||T.value[0].props.id),r(),p(b),K()})}),e.watch(()=>t.autoTitleWidth,C=>{e.nextTick(()=>{r(),p(b)})}),e.onMounted(()=>{t.visible&&(T.value.length&&s(t.activeId||T.value[0].props.id),e.nextTick(()=>{r(),p(b)}),K())});function we(){return e.createVNode("button",{title:D.LocaleService.getLocaleValue("tabs.leftButton"),type:"button",class:O.value,onClick:()=>{k(0,-1)}},null)}function Ce(){return e.createVNode("button",{title:D.LocaleService.getLocaleValue("tabs.rightButton"),type:"button",class:M.value,onClick:()=>{k(0,1)}},null)}const{renderMorePagesButtton:Se,setTabsRef:xe}=re(t,d,N,f);xe(u);function Ve(){return V.value.length?e.createVNode("div",{class:{"farris-tabs-toolbar":!0,"d-none":!h.value}},[e.createVNode(ee,{class:"f-utils-fill",alignment:x.value?"right":"left",items:V.value,visible:h.value,onClick:G},null)]):null}const Y=E.get(t.tabType)||E.get("default");function Be(){var C,P,L,J;return e.createVNode("div",{class:ve.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:ye.value,ref:v},[!i&&we(),Y&&Y(),e.createVNode("div",{hidden:i,class:H.value},[Ce(),Se()])]),Ve(),e.createVNode("div",{class:"farris-tabs-header-post"},[(J=(L=n.slots).headerSuffix)==null?void 0:J.call(L)])])}e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":R.value}));function Ie(){var C,P;return(P=(C=n.slots).default)==null?void 0:P.call(C)}return()=>t.visible?e.createVNode("div",{class:ge.value,ref:u},[Be(),Ie()]):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 z(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const q=e.defineComponent({name:"FTabPage",props:U,emits:[],setup(t,n){const l=e.inject("tabs");F.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 b=e.computed(()=>(t==null?void 0:t.id)===(l==null?void 0:l.activeId.value)),v=e.computed(()=>({display:b.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=>{b.value&&l&&(l.toolbarVisible.value=s)});function f(){var g,x;const s=(x=(g=n.slots).default)==null?void 0:x.call(g);return e.createVNode(W,{"main-title":t.title,class:["farris-tab-page",u.value?"":"f-tab-d-none"]},z(s)?s:{default:()=>[s]})}function m(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(W,{customClass:"section-in-tab is-mobile",onClick:m,visible:t.show,"main-title":t.title,buttons:t.toolbar.buttons,"button-position":t.toolbar.position||t.toolbarPosition,"buttons-visible":t.toolbarVisible},z(s)?s:{default:()=>[s]})}const T=e.computed(()=>{var g;return{"farris-tab-page":!0,"f-tab-d-none":!u.value,"f-tab-active":b.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:T.value,style:v.value},[s])}const V=new Map([["default",w],["one-page",f],["mobile",p]]).get(a.value)||w;return()=>V()}});class me extends te.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:"按钮禁用状态",refreshPanelAfterChanged:!0,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:F.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(b,v){const f=b.propertyValue;delete n[u.viewModelId],f&&(f.setPropertyRelates=this.setPropertyRelates,u.eventsEditorUtils.saveRelatedParameters(n,u.viewModelId,f.events,f))}}}}A.install=t=>{t.component(A.name,A),t.component(q.name,q)},S.FTabPage=q,S.FTabs=A,S.TabToolbarItemProperty=me,S.createTabsCallbackResolver=ne,S.default=A,S.tabPageProps=U,S.tabsProps=_,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(V,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):(V=typeof globalThis<"u"?globalThis:V||self,e(V.tabs={},V.Vue,V.notify,V.common,V.FCapsule,V.locale,V.FResponseToolbar,V.BigNumber,V.LodashES,V.FSection,V.propertyPanel))})(this,function(V,e,Z,D,ee,F,te,Pe,Ne,W,ne){"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 oe(){function t(n,o,u){const i={};return i.beforeTabSelect=a=>o.call("beforeTabSelect",n,[a,n],u),i}return{resolve:t}}function le(t,n,o){const u=new Z.FNotifyService,i=e.ref([]),a=e.ref(t.activeId||"");let b="";const h=e.ref(!0),f=e.ref([]),m=e.ref(!0),p=e.ref(0),T=e.computed(()=>{const l=i.value.find(c=>c.props.id===a.value);return(l==null?void 0:l.props.toolbarPosition)==="inHead"});let C;function j(l){C=l}function B(l,d=!0){const c=l.findIndex(v=>v.props.show!==!1&&!v.props.disabled);if(c!==-1){if(a.value=l[c].props.id,!d)return;f.value=[];const v=l[c];v&&v.props.toolbar&&v.props.toolbar.buttons&&v.props.toolbar.buttons.length&&(f.value=[...v.props.toolbar.buttons],m.value=v.props.toolbarVisible)}}function s(l){a.value=l;const d=i.value.find(c=>c.props.id===l);f.value=[],d&&d.props.toolbar&&d.props.toolbar.buttons&&d.props.toolbar.buttons.length&&(f.value=[...d.props.toolbar.buttons],m.value=d.props.toolbarVisible),n.emit("update:activeId",l),n.emit("tabChange",{prevId:b,nextId:a.value})}async function g(l,d,c,v){var R;const I=await((R=t.beforeTabSelect)==null?void 0:R.call(t,{prevId:l,nextId:d}));(typeof I=="boolean"?I:(I==null?void 0:I.canSelect)??!0)?c&&c():(v&&v(),typeof I!="boolean"&&I.message&&(u==null||u.warning({message:I.message,position:"top-center"})))}function S(l){let d=-1;if(!a.value){if(d=l.findIndex(c=>a.value===c.props.id&&c.props.show!==!1&&!c.props.disabled),d>-1)return;b=a.value}B(l,!1),g(b,a.value,()=>{s(a.value),C&&C()},()=>{a.value=b})}function y(l){let d=!1;if(l){const c=i.value.find(v=>v.props.id===l);d=!c||c.props.show===!1||c.props.disabled===!0}if(d)S(i.value);else if(a.value!==l){const c=a.value;g(c,l,()=>{b=c,a.value=l,s(a.value),C&&C()},()=>{a.value=c,n.emit("update:activeId",c)})}else s(a.value)}e.watch(()=>t.activeId,(l,d)=>{l!==d&&t.activeId!==a.value&&y(l)});function w(l){var c;if(t.autoTitleWidth)return;const d=(c=l.value)==null?void 0:c.querySelectorAll(".st-tab-text");if(!(!d||t.tabType==="pill"))for(let v=0;v<d.length;v++){const I=d[v].parentNode;d[v].scrollWidth>I.offsetWidth?d[v].classList.contains("farris-title-text-custom")||d[v].classList.add("farris-title-text-custom"):d[v].classList.remove("farris-title-text-custom")}}const P=l=>{l.preventDefault(),l.stopPropagation()};function O(l,d,c=!1){const v=i.value.findIndex(I=>I.props.id===d);i.value=i.value.filter(I=>I.props.id!==d),a.value===d&&(b=d,a.value="",B(i.value)),P(l),e.nextTick(()=>{p.value++,w(o),c&&(h.value=!0),n.emit("tabRemove",{removeIndex:v,removeId:d,activeId:a.value})})}function M(l,d=!0){const c=i.value.find(v=>v.props.id===l);c&&(c.props.show===!1&&a.value===l?(a.value="",b=l,y("")):c.props.show===!0&&!a.value&&S(i.value),e.nextTick(()=>{p.value++,d&&(h.value=!0)}))}function H(l){a.value!==l&&g(b,l,()=>{b=a.value,s(l),C&&C()},null)}function k(l){i.value.findIndex(c=>c.props.id===l.props.id)===-1&&i.value.push(l),p.value++}function r(l){i.value.findIndex(c=>c.props.id===l.props.id)!==-1&&(i.value.forEach(c=>{c.props.id===l.props.id&&(c=l)}),l.props.id===a.value&&T.value,e.nextTick(()=>{p.value++,w(o)}))}return{activeId:a,addTab:k,changeTitleStyle:w,removeTab:O,selectTab:H,tabPages:i,updateTab:r,toolbarItems:f,needUpdateNavigationLayout:p,checkActiveIdAndSelect:y,toggleShowTab:M,hasInHeadClass:T,setScrollToSelectedTabFunction:j,toolbarVisible:m}}function ae(t,n,o,u,i){const{activeId:a,removeTab:b,selectTab:h}=i,f=e.computed(()=>{const w={"st-tab-text":!0,"text-truncate":t.tabType==="pill"&&!t.autoTitleWidth,"farris-title-auto":t.autoTitleWidth};return D.getCustomClass(w,n.customTitleClass)}),m=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`})),T=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:n.id===a.value,disabled:n.disabled})),C=e.reactive({content:n.title,overflowShown:!0});function j(){return t.tabType!=="pill"&&!t.autoTitleWidth?e.withDirectives(e.createVNode("span",{class:f.value,"data-tabid":n.id},[n.title]),[[e.resolveDirective("tooltip"),C]]):e.createVNode("span",{class:f.value,"data-tabid":n.id,title:n.title},[n.title])}const B=e.ref(n.removeable);function s(){return B.value?e.createVNode("span",{class:"st-drop-close",onClick:w=>b(w,n.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]):""}function g(w){h(n.id),t.tabType==="one-page"&&u.scrollToByPaggId(n.id)}const S=D.extractDataAttrs(o.attrs);function y(){return o.slots.title?e.createVNode("a",e.mergeProps(S,{class:T.value,onClick:g,id:`${n.id}-tab-title`}),[o.slots.title(o),s()]):n.titleRenderFunction?e.createVNode("a",e.mergeProps(S,{class:T.value,onClick:g,id:`${n.id}-tab-title`}),[n.titleRenderFunction(),s()]):e.createVNode("a",e.mergeProps(S,{class:T.value,onClick:g,id:`${n.id}-tab-title`}),[j(),s()])}return e.createVNode("li",{class:m.value,style:p.value},[y()])}function ie(t,n,o,u,i){const{shouldShowNavigationButtons:a}=o,{tabPages:b}=i,h=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":a.value})),f=e.computed(()=>({width:"100%","justify-content":t.justifyContent})),m=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:h.value,style:f.value},[e.createVNode("ul",{class:m.value,ref:n},[b.value.map(p=>ae(t,p.props,p,u,i))])])}function se(t,n,o,u,i){const a=e.ref(),{shouldShowNavigationButtons:b}=o,{activeId:h,tabPages:f,selectTab:m}=i,p=e.ref(h.value),T=e.computed(()=>f.value.map(s=>({name:s.props.title,value:s.props.id,show:s.props.show,disabled:s.props.disabled}))),C=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":b.value})),j=e.computed(()=>({width:"100%",display:"flex","justify-content":t.justifyContent}));e.onMounted(()=>{a.value&&(n.value=a.value.$el)});function B(s){m(s)}return e.watch(()=>h.value,s=>{s!==p.value&&(p.value=s)},{immediate:!0}),()=>e.createVNode("div",{class:C.value,style:j.value},[e.createVNode(ee,{items:T.value,modelValue:p.value,"onUpdate:modelValue":s=>p.value=s,onChange:B,ref:a},null)])}function re(t,n,o,u){const i=e.ref(),{activeId:a,removeTab:b,tabPages:h,selectTab:f}=u,{hideDropDown:m,searchTabText:p}=n,T=600;let C=null;const j=e.computed(()=>{var l,d;let r=[];return t.searchBoxVisible?r=(l=h.value)==null?void 0:l.filter(c=>c.props.title.includes(p.value)):r=(d=h.value)==null?void 0:d.slice(),r}),B=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":t.searchBoxVisible,show:!m.value,"d-none":m.value}));let s;function g(r){s=r}e.watch(m,r=>{if(s.value)if(r)i.value.style.width=null;else{const l=s.value.querySelector(".farris-tabs-header"),d=s.value.clientHeight-l.clientHeight-20,v=l.querySelector(".farris-tabs-title").clientWidth-20;i.value.style.maxWidth=v+"px",i.value.style.maxHeight=d+"px",e.nextTick(()=>{const{width:I}=i.value.getClientRects()[0];i.value.style.width=I?I+"px":null})}});function S(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 y(r){r.preventDefault(),r.stopPropagation()}function w(){C&&clearTimeout(C)}function P(){m.value||(C=setTimeout(()=>{m.value=!0},T))}function O(r,l){r.stopPropagation(),l.disabled||f(l.id),m.value=!0}function M(r,l){r.stopPropagation(),b(r,l,!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 k(){return e.createVNode("div",{ref:i,class:B.value,onMouseenter:()=>w(),onMouseleave:()=>P()},[t.searchBoxVisible&&e.createVNode("div",{onClick:r=>y(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:S(r),onClick:l=>O(l,r.props)},[r.props.removeable&&r.props.disabled!==!0&&e.createVNode("span",{class:"float-right st-drop-close",onClick:l=>M(l,r.props.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),H(r)]))]):e.createVNode("div",{class:"dropdown-no-data"},[F.LocaleService.getLocaleValue("tabs.noData")])])}return{renderDropdownMenu:k,setTabsRef:g}}function ce(t,n,o,u){const{hideDropDown:i}=n,{renderDropdownMenu:a,setTabsRef:b}=re(t,n,o,u),h=e.ref(t.showDropdown);function f(){return h.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{i.value=!1}},null),a()])}return{renderMorePagesButtton:f,setTabsRef:b}}function de(t,n,o,u){const i=e.ref(!1),{selectTab:a,tabPages:b,needUpdateNavigationLayout:h,activeId:f}=u,m=4,p=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!i.value})),T=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!i.value})),C=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!i.value}));function j(y,w){if(!n.value)return;const P=n.value.scrollLeft,O=n.value.scrollWidth-n.value.offsetWidth;if(w>0){if(n.value.scrollLeft>=O)return;n.value.scrollLeft=P+t.scrollStep+y}else if(w<0){if(n.value.scrollLeft<=0)return;n.value.scrollLeft=P-t.scrollStep-y}}function B(y=-1){if(!i.value||!n.value)return;y<0&&(y=b.value.findIndex(H=>H.props.id===f.value));const w=t.tabType==="pills"?".f-capsule-item":".nav-item",P=n.value.querySelectorAll(w),{parentElement:O}=n.value,M=P[y];if(M&&O){const H=O.getBoundingClientRect().left,k=O.getBoundingClientRect().right,r=M.getBoundingClientRect().left,l=M.getBoundingClientRect().right;r<H?j(H-r,-1):k<l&&j(l-k,1),t.tabType==="one-page"&&o.scrollTo(y)}}function s(){var P;if(!n.value)return;const y=n.value,w=(P=n.value)==null?void 0:P.parentElement;i.value=w&&y&&w.offsetWidth<y.scrollWidth-m,i.value&&e.nextTick(()=>{B()})}function g(y){y.disabled||a(y.id)}function S(){["default","one-page"].indexOf(t.tabType)>-1&&e.nextTick(()=>{B()})}return e.watch(h,()=>{s()}),{previousButtonClass:p,nextButtonGroupClass:T,nextButtonClass:C,scrollTab:j,selectAndScrollToTab:g,shouldShowNavigationButtons:i,updateNavigationLayout:s,scrollToSelectedTab:S}}function ue(t,n){const{tabPages:o}=n,u=e.ref(""),i=e.ref(!0),a=e.computed(()=>t.searchBoxVisible),b=e.computed(()=>a.value?o.value.filter(f=>f.props.title.includes(u.value)):o.value.slice());return e.watch(i,h=>{h||(u.value="")}),{searchTabText:u,hideDropDown:i,shouldShowSearchBox:a,tabsInDropdownMenu:b}}function fe(t,n,o){const u=".farris-tab-page",{tabPages:i}=o;let a=-1;function b(){if(a<0){const m=document.querySelector(".farris-tabs-header");m&&(a=m.clientHeight)}return a}function h(m){const p=n.value;if(p){const T=n.value.querySelectorAll(u);if(T.length>0){const C=T[m],{offsetTop:j}=C,B=j-b();p.scrollTop=B>0?B:0}}}function f(m){const p=i.value.findIndex(T=>T.props.id===m);p>-1&&h(p)}return{scrollTo:h,scrollToByPaggId:f}}const be=["moz","ms","webkit"];function pe(){let t=0;return n=>{const o=new Date().getTime(),u=Math.max(0,16-(o-t)),i=setTimeout(()=>{n(o+u)},u);return t=o+u,i}}function me(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=be.filter(n=>`${n}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:pe()}me(),e.ref("");function $(){if(typeof window>"u"||typeof navigator>"u")return!1;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],o=[/iPad/i,/Android(?!.*Mobile)/i,/Tablet/i,/PlayBook/i,/Kindle/i,/Silk/i];for(const f of o)if(f.test(t))return!1;for(const f of n)if(f.test(t))return!0;if(typeof screen>"u")return!1;const u="ontouchstart"in window||navigator.maxTouchPoints>0,i=screen.width,a=screen.height,b=Math.min(i,a);return!!(u&&b<=768)}function he(){const t=$();return t&&document.body.classList.add("f-mobile"),t}typeof document<"u"&&he();function U(t){return t?Object.keys(t).reduce((n,o)=>(o.startsWith("data-")&&(n[o]=t[o]),n),{}):{}}const A=e.defineComponent({name:"FTabs",props:_,emits:["tabChange","tabRemove","update:activeId","Click"],setup(t,n){const o=e.ref(t.tabType),u=e.shallowRef(),i=$(),a=e.ref(t.customClass),b=e.shallowRef();e.shallowRef();const h=e.ref(),f=le(t,n,b),{activeId:m,changeTitleStyle:p,tabPages:T,addTab:C,updateTab:j,toolbarItems:B,checkActiveIdAndSelect:s,toggleShowTab:g,hasInHeadClass:S,toolbarVisible:y}=f,w=fe(t,u,f),P=de(t,b,w,f),{previousButtonClass:O,nextButtonClass:M,nextButtonGroupClass:H,scrollTab:k,updateNavigationLayout:r,scrollToSelectedTab:l}=P;f.setScrollToSelectedTabFunction(l);const d=ue(t,f),c=ie(t,b,P,w,f),v=c,I=se(t,b,P,w,f),E=new Map([["default",c],["one-page",v],["pills",I]]);e.computed(()=>{const x=T.value.find(N=>N.props.id===m.value);return x==null?void 0:x.slots});const R=e.computed(()=>t.fill),X=(x,N)=>{n.emit("Click",x,N,m.value)};e.provide("tabs",{activeId:m,addTab:C,updateTab:j,tabPages:T,tabType:o,shouldFillParentContaner:R,toggleShowTab:g,toolbarVisible:y,clickToolbarItemHandler:X});let K=!1;const ge=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":S.value,"farris-tabs-inContent":!S.value,"farris-tabs-nav-fill":t.tabType==="fill","farris-tabs-nav-pills":t.tabType==="pills","d-none":t.showHeader===!1})),ye=e.computed(()=>{const x={width:S.value&&t.titleWidth?`${t.titleWidth}%`:""};return x.width&&(x.flex="unset"),x}),Te=e.computed(()=>{const x={"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((N,L)=>(N[L]=!0,N),x),x}),we=new ResizeObserver(x=>{x.length&&r()});function Y(){h.value&&!K&&(we.observe(h.value),K=!0)}e.watch(()=>t.visible,x=>{e.nextTick(()=>{T.value.length&&s(t.activeId||T.value[0].props.id),r(),p(b),Y()})}),e.watch(()=>t.autoTitleWidth,x=>{e.nextTick(()=>{r(),p(b)})}),e.onMounted(()=>{t.visible&&(T.value.length&&s(t.activeId||T.value[0].props.id),e.nextTick(()=>{r(),p(b)}),Y())});function Ce(){return e.createVNode("button",{title:F.LocaleService.getLocaleValue("tabs.leftButton"),type:"button",class:O.value,onClick:()=>{k(0,-1)}},null)}function Se(){return e.createVNode("button",{title:F.LocaleService.getLocaleValue("tabs.rightButton"),type:"button",class:M.value,onClick:()=>{k(0,1)}},null)}const{renderMorePagesButtton:xe,setTabsRef:Ve}=ce(t,d,P,f);Ve(u);function Be(){return B.value.length?e.createVNode("div",{class:{"farris-tabs-toolbar":!0,"d-none":!y.value}},[e.createVNode(te,e.mergeProps(U(n.attrs),{class:"f-utils-fill",alignment:S.value?"right":"left",items:B.value,visible:y.value,onClick:X}),null)]):null}const J=E.get(t.tabType)||E.get("default");function Ie(){var x,N,L,Q;return e.createVNode("div",{class:ge.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(N=(x=n.slots).headerPrefix)==null?void 0:N.call(x)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:ye.value,ref:h},[!i&&Ce(),J&&J(),e.createVNode("div",{hidden:i,class:H.value},[Se(),xe()])]),Be(),e.createVNode("div",{class:"farris-tabs-header-post"},[(Q=(L=n.slots).headerSuffix)==null?void 0:Q.call(L)])])}e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":R.value}));function je(){var x,N;return(N=(x=n.slots).default)==null?void 0:N.call(x)}return()=>t.visible?e.createVNode("div",e.mergeProps(U(n.attrs),{class:Te.value,ref:u}),[Ie(),je()]):null}}),z={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 G(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const q=e.defineComponent({name:"FTabPage",props:z,emits:[],setup(t,n){const o=e.inject("tabs");D.isMobilePhone();const u=e.ref(t.show),i={slots:n.slots,props:t,attrs:n.attrs},a=e.ref((o==null?void 0:o.tabType.value)||"default");e.onMounted(()=>{const s=o==null?void 0:o.tabPages.value.findIndex(g=>g.props.id===t.id);(!s||s===-1)&&(o==null||o.addTab(i))}),e.onUnmounted(()=>{});const b=e.computed(()=>(t==null?void 0:t.id)===(o==null?void 0:o.activeId.value)),h=e.computed(()=>({display:b.value?"":"none"}));e.watch(()=>t,s=>{o==null||o.updateTab({props:s,slots:n.slots,attrs:n.attrs})},{immediate:!0,deep:!0}),e.watch(()=>t.show,s=>{u.value=s,o==null||o.toggleShowTab(t.id)}),e.watch(()=>t.toolbarVisible,s=>{b.value&&o&&(o.toolbarVisible.value=s)});function f(){var g,S;const s=(S=(g=n.slots).default)==null?void 0:S.call(g);return e.createVNode(W,{"main-title":t.title,class:["farris-tab-page",u.value?"":"f-tab-d-none"]},G(s)?s:{default:()=>[s]})}function m(s,g){o&&(o.activeId.value=t.id,o.clickToolbarItemHandler&&o.clickToolbarItemHandler(s,g))}function p(){var g,S;const s=(S=(g=n.slots).default)==null?void 0:S.call(g);return e.createVNode(W,{customClass:"section-in-tab is-mobile",onClick:m,visible:t.show,"main-title":t.title,buttons:t.toolbar.buttons,"button-position":t.toolbar.position||t.toolbarPosition,"buttons-visible":t.toolbarVisible},G(s)?s:{default:()=>[s]})}const T=e.computed(()=>{var g;return{"farris-tab-page":!0,"f-tab-d-none":!u.value,"f-tab-active":b.value&&o&&((g=o.shouldFillParentContaner)==null?void 0:g.value)}});function C(){var g,S;const s=(S=(g=n.slots).default)==null?void 0:S.call(g);return e.createVNode("div",{class:T.value,style:h.value},[s])}const B=new Map([["default",C],["one-page",f],["mobile",p]]).get(a.value)||C;return()=>B()}});class ve extends ne.BaseControlProperty{constructor(n,o){super(n,o)}getPropertyConfig(n,o=!1){return this.propertyConfig.categories.basic=this.getBasicPropConfig(n),this.propertyConfig.categories.basic.properties.text={title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},this.getAppearanceProperties(n,o),this.getbBehaviorConfig(n),this.getEventPropConfig(n),this.propertyConfig}getAppearanceProperties(n,o=!1){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式",visible:!o},icon:{title:"图标",type:"string",description:""},split:{title:"下拉按钮分离",type:"boolean",description:"启用下拉按钮分离,可以单独点击按钮。单独点击下拉按钮展开下拉面板",visible:!!(n.children&&n.children.length>0)}}}}getbBehaviorConfig(n){const o=this.getPropertyEditorParams(n,["Const","Variable","StateMachine","Custom","Expression"],"disabled");this.propertyConfig.categories.behavior=this.getBehaviorConfig(n,"",{disabled:{title:"禁用",type:"boolean",description:"按钮禁用状态",refreshPanelAfterChanged:!0,editor:o}})}getEventPropConfig(n){const o=[{label:"onClick",name:"点击事件"}],u=this,i=u.eventsEditorUtils.formProperties(n,u.viewModelId,o),a=u.createBaseEventProperty(i);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:a,refreshPanelAfterChanged:!0,tabId:D.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(b,h){const f=b.propertyValue;delete n[u.viewModelId],f&&(f.setPropertyRelates=this.setPropertyRelates,u.eventsEditorUtils.saveRelatedParameters(n,u.viewModelId,f.events,f))}}}}A.install=t=>{t.component(A.name,A),t.component(q.name,q)},V.FTabPage=q,V.FTabs=A,V.TabToolbarItemProperty=ve,V.createTabsCallbackResolver=oe,V.default=A,V.tabPageProps=z,V.tabsProps=_,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var Je = Object.defineProperty;
|
|
2
2
|
var _e = (e, t, l) => t in e ? Je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[t] = l;
|
|
3
3
|
var U = (e, t, l) => _e(e, typeof t != "symbol" ? t + "" : t, l);
|
|
4
|
-
import { isMobilePhone as he, getMaxZIndex as me,
|
|
5
|
-
import { resolveAppearance as
|
|
6
|
-
import
|
|
7
|
-
import { ref as o, onMounted as ie, defineComponent as re, computed as I, createVNode as v, Teleport as ge, createApp as ye, onUnmounted as ce, Fragment as be, watch as $, nextTick as K, onBeforeMount as
|
|
4
|
+
import { isMobilePhone as he, getMaxZIndex as me, extractDataAttrs as Ze, withInstall as Qe } from "../../components/common/index.esm.js";
|
|
5
|
+
import { resolveAppearance as et, createPropsResolver as tt } from "../../components/dynamic-resolver/index.esm.js";
|
|
6
|
+
import nt, { buttonEditProps as lt } from "../../components/button-edit/index.esm.js";
|
|
7
|
+
import { ref as o, onMounted as ie, defineComponent as re, computed as I, createVNode as v, Teleport as ge, createApp as ye, onUnmounted as ce, Fragment as be, watch as $, nextTick as K, onBeforeMount as at, watchEffect as ot, Transition as ut, mergeProps as ee, shallowRef as st, render as se, h as it, cloneVNode as rt, inject as we } from "vue";
|
|
8
8
|
import { LocaleService as Q } from "../../components/locale/index.esm.js";
|
|
9
9
|
import Ce from "../../components/drawer/index.esm.js";
|
|
10
10
|
import "../../components/property-panel/index.esm.js";
|
|
11
11
|
import "../../components/button/index.esm.js";
|
|
12
12
|
import "../../components/field-selector/index.esm.js";
|
|
13
13
|
import "../../components/collection-property-editor/index.esm.js/src/use-button-items.designer";
|
|
14
|
-
import { useDesignerComponent as
|
|
15
|
-
const
|
|
14
|
+
import { useDesignerComponent as ct } from "../../components/designer-canvas/index.esm.js";
|
|
15
|
+
const dt = {
|
|
16
16
|
/**
|
|
17
17
|
* 标记组件的唯一标识
|
|
18
18
|
*/
|
|
@@ -183,23 +183,23 @@ const ct = {
|
|
|
183
183
|
* 扩展按钮是否禁用
|
|
184
184
|
*/
|
|
185
185
|
expandDisabled: { type: Boolean, default: !1 }
|
|
186
|
-
},
|
|
186
|
+
}, ft = {
|
|
187
187
|
popupContentPosition: { type: Object, default: { left: 0, top: 0 } },
|
|
188
188
|
host: { type: Object },
|
|
189
189
|
backgroundColor: { type: String, default: "" }
|
|
190
190
|
};
|
|
191
|
-
function
|
|
191
|
+
function vt() {
|
|
192
192
|
const e = o(!1);
|
|
193
193
|
return ie(() => {
|
|
194
194
|
e.value = !0;
|
|
195
195
|
}), e;
|
|
196
196
|
}
|
|
197
|
-
const
|
|
197
|
+
const pt = /* @__PURE__ */ re({
|
|
198
198
|
name: "FOverlay",
|
|
199
|
-
props:
|
|
199
|
+
props: ft,
|
|
200
200
|
emits: ["click"],
|
|
201
201
|
setup(e, t) {
|
|
202
|
-
const l = o(e.popupContentPosition), a = o(e.host), u =
|
|
202
|
+
const l = o(e.popupContentPosition), a = o(e.host), u = vt(), s = I(() => ({
|
|
203
203
|
backgroundColor: e.backgroundColor || "",
|
|
204
204
|
pointerEvents: "auto"
|
|
205
205
|
}));
|
|
@@ -242,13 +242,13 @@ const vt = /* @__PURE__ */ re({
|
|
|
242
242
|
}) : null;
|
|
243
243
|
}
|
|
244
244
|
});
|
|
245
|
-
function
|
|
245
|
+
function ht(e) {
|
|
246
246
|
if (e.content && e.content.render)
|
|
247
247
|
return e.content.render;
|
|
248
248
|
if (e.render && typeof e.render == "function")
|
|
249
249
|
return e.render;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function mt(e) {
|
|
252
252
|
const t = document.createElement("div");
|
|
253
253
|
t.style.display = "contents";
|
|
254
254
|
let l;
|
|
@@ -261,8 +261,8 @@ function ht(e) {
|
|
|
261
261
|
ce(() => {
|
|
262
262
|
document.body.removeChild(t);
|
|
263
263
|
});
|
|
264
|
-
const s =
|
|
265
|
-
return () => v(
|
|
264
|
+
const s = ht(e);
|
|
265
|
+
return () => v(pt, {
|
|
266
266
|
"popup-content-position": e.popupPosition,
|
|
267
267
|
host: e.host,
|
|
268
268
|
onClick: u,
|
|
@@ -273,12 +273,12 @@ function ht(e) {
|
|
|
273
273
|
}
|
|
274
274
|
}), document.body.appendChild(t), l.mount(t), l;
|
|
275
275
|
}
|
|
276
|
-
class
|
|
276
|
+
class gt {
|
|
277
277
|
static show(t) {
|
|
278
|
-
return
|
|
278
|
+
return mt(t);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
const
|
|
281
|
+
const yt = {
|
|
282
282
|
/**
|
|
283
283
|
* 允许点击蒙层关闭对话框
|
|
284
284
|
* @default false
|
|
@@ -496,7 +496,7 @@ class X {
|
|
|
496
496
|
return this.width = t.width, this.height = t.height, this;
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function bt(e, t) {
|
|
500
500
|
const l = o(), a = o(), u = o(), s = o(), d = o(), f = o(), i = o(), p = o(), B = o(), w = o(), M = o(), C = o(e.resizeable), O = o(), E = o(e.draggable), P = o(!1);
|
|
501
501
|
function y() {
|
|
502
502
|
const r = a.value || document.body, c = window.getComputedStyle(r);
|
|
@@ -632,7 +632,7 @@ function yt(e, t) {
|
|
|
632
632
|
}
|
|
633
633
|
}, E.value = !1, P.value = !0);
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function ne() {
|
|
636
636
|
var r, c;
|
|
637
637
|
if (document.body.click(), O.value) {
|
|
638
638
|
const k = {
|
|
@@ -662,7 +662,7 @@ function yt(e, t) {
|
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function le() {
|
|
666
666
|
const r = () => {
|
|
667
667
|
P.value ? D(!1) : _(), document.body.click();
|
|
668
668
|
};
|
|
@@ -670,20 +670,20 @@ function yt(e, t) {
|
|
|
670
670
|
window.removeEventListener("resize", r);
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
const q =
|
|
673
|
+
const q = le();
|
|
674
674
|
return {
|
|
675
675
|
renderResizeBar: N,
|
|
676
676
|
boundingElement: a,
|
|
677
677
|
resizedEventParam: M,
|
|
678
678
|
maximize: D,
|
|
679
|
-
restore:
|
|
679
|
+
restore: ne,
|
|
680
680
|
allowDrag: E,
|
|
681
681
|
isMaximized: P,
|
|
682
682
|
unWindowResizeHandle: q,
|
|
683
683
|
moveToCenter: _
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function wt(e, t, l) {
|
|
687
687
|
const a = o(), u = o(e.draggable), s = o(e.lockAxis), d = o(), f = o(), i = o(!1), p = o(new R(0, 0)), B = o(new R(0, 0)), w = o(new R(0, 0)), M = o(new R(0, 0));
|
|
688
688
|
$(() => l.value, (h) => {
|
|
689
689
|
d.value.style.cursor = h ? "move" : "default";
|
|
@@ -779,7 +779,7 @@ function xe(e, t) {
|
|
|
779
779
|
};
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
function
|
|
782
|
+
function Ct(e, t) {
|
|
783
783
|
const l = o(e.enableEsc);
|
|
784
784
|
let a = null;
|
|
785
785
|
return l.value ? (a = xe("Escape", (u) => {
|
|
@@ -788,7 +788,7 @@ function wt(e, t) {
|
|
|
788
788
|
remove: a
|
|
789
789
|
}) : null;
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function xt(e, t) {
|
|
792
792
|
const l = o(e.enableEnter);
|
|
793
793
|
let a = null;
|
|
794
794
|
return l.value ? (a = xe("Enter", (u) => {
|
|
@@ -799,7 +799,7 @@ function Ct(e, t) {
|
|
|
799
799
|
}
|
|
800
800
|
const J = /* @__PURE__ */ re({
|
|
801
801
|
name: "FModal",
|
|
802
|
-
props:
|
|
802
|
+
props: yt,
|
|
803
803
|
emits: ["update:modelValue", "accept", "cancel", "closed", "resize", "esc", "enter", "stopMove", "buttonClick"],
|
|
804
804
|
setup(e, t) {
|
|
805
805
|
const l = o(e.width || 300), a = o(e.height || 200), u = o(e.modelValue), s = o(""), d = o(e.class), f = o(e.fitContent), i = o(e.showHeader), p = o(""), B = o(e.showCloseButton), w = o(e.showMaxButton), M = o(!1), C = o(e.dialogType), O = o(e.src), E = o(""), P = o(e.showButtons), y = o(e.title), b = o(e.containment || null), S = o();
|
|
@@ -835,17 +835,17 @@ const J = /* @__PURE__ */ re({
|
|
|
835
835
|
V(n, !0);
|
|
836
836
|
}
|
|
837
837
|
}], g = o(e.buttons && e.buttons.length ? e.buttons : h), z = I(() => !!p.value), A = I(() => !!P.value && !!g.value), W = o(), N = o(), D = o(e.maximized || !1), {
|
|
838
|
-
renderResizeBar:
|
|
838
|
+
renderResizeBar: ne,
|
|
839
839
|
maximize: _,
|
|
840
|
-
restore:
|
|
840
|
+
restore: le,
|
|
841
841
|
boundingElement: q,
|
|
842
842
|
resizedEventParam: r,
|
|
843
843
|
allowDrag: c,
|
|
844
844
|
unWindowResizeHandle: k,
|
|
845
845
|
moveToCenter: x
|
|
846
|
-
} =
|
|
846
|
+
} = bt(e), {
|
|
847
847
|
registerDraggle: j
|
|
848
|
-
} =
|
|
848
|
+
} = wt(e, t, c);
|
|
849
849
|
function de() {
|
|
850
850
|
return !!document.querySelectorAll(".farris-modal").length && document.body.classList.contains("modal-open");
|
|
851
851
|
}
|
|
@@ -942,9 +942,9 @@ const J = /* @__PURE__ */ re({
|
|
|
942
942
|
}, m = Le();
|
|
943
943
|
return Object.assign(n, m);
|
|
944
944
|
});
|
|
945
|
-
function
|
|
945
|
+
function ae(n) {
|
|
946
946
|
if (n == null || n.stopPropagation(), D.value) {
|
|
947
|
-
D.value = !1,
|
|
947
|
+
D.value = !1, le();
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
950
|
_(), D.value = !0;
|
|
@@ -958,18 +958,18 @@ const J = /* @__PURE__ */ re({
|
|
|
958
958
|
function De(n) {
|
|
959
959
|
n.width && (l.value = n.width), n.height && (a.value = n.height), n.buttons && (g.value = n.buttons), n.title && (y.value = n.title);
|
|
960
960
|
}
|
|
961
|
-
let
|
|
962
|
-
|
|
961
|
+
let oe = null, ue = null;
|
|
962
|
+
at(() => {
|
|
963
963
|
F.value = de();
|
|
964
964
|
}), ie(() => {
|
|
965
|
-
N.value && !b.value && (b.value = N.value.parentElement, q.value = b.value, j(W.value, N.value, q.value)), Z.value && document.body.classList.add("modal-open"),
|
|
965
|
+
N.value && !b.value && (b.value = N.value.parentElement, q.value = b.value, j(W.value, N.value, q.value)), Z.value && document.body.classList.add("modal-open"), oe = Ct(e, t), ue = xt(e, t);
|
|
966
966
|
}), ce(() => {
|
|
967
|
-
k && k(),
|
|
967
|
+
k && k(), oe && oe.remove(), ue && ue.remove();
|
|
968
968
|
}), t.expose({
|
|
969
969
|
modalElementRef: N,
|
|
970
970
|
updateModalOptions: De,
|
|
971
971
|
close: V,
|
|
972
|
-
maxDialog:
|
|
972
|
+
maxDialog: ae,
|
|
973
973
|
isMaximized: D,
|
|
974
974
|
disableButtons: (n, m = !0) => {
|
|
975
975
|
g.value.forEach((H) => {
|
|
@@ -993,7 +993,7 @@ const J = /* @__PURE__ */ re({
|
|
|
993
993
|
}, [v("span", {
|
|
994
994
|
class: "f-icon modal_minimize"
|
|
995
995
|
}, null)]), w.value && v("li", {
|
|
996
|
-
onClick:
|
|
996
|
+
onClick: ae,
|
|
997
997
|
class: "f-btn-icon f-bare",
|
|
998
998
|
style: "pointer-events: auto;"
|
|
999
999
|
}, [v("span", {
|
|
@@ -1020,8 +1020,8 @@ const J = /* @__PURE__ */ re({
|
|
|
1020
1020
|
onWheel: Ne
|
|
1021
1021
|
}, [g.value.map((n) => {
|
|
1022
1022
|
var T;
|
|
1023
|
-
const m = o(n.disabled), H = n.class || ((T = n.appearance) == null ? void 0 : T.class);
|
|
1024
|
-
return v("button", {
|
|
1023
|
+
const m = o(n.disabled), H = n.class || ((T = n.appearance) == null ? void 0 : T.class) || "btn btn-secondary";
|
|
1024
|
+
return v("button", ee(Ze(n), {
|
|
1025
1025
|
name: n.name,
|
|
1026
1026
|
style: n.styles,
|
|
1027
1027
|
type: "button",
|
|
@@ -1030,13 +1030,13 @@ const J = /* @__PURE__ */ re({
|
|
|
1030
1030
|
onClick: (Y) => {
|
|
1031
1031
|
We(n, Y);
|
|
1032
1032
|
}
|
|
1033
|
-
}, [!!n.iconClass && v("i", {
|
|
1033
|
+
}), [!!n.iconClass && v("i", {
|
|
1034
1034
|
class: n.iconClass
|
|
1035
1035
|
}, null), n.text]);
|
|
1036
1036
|
})])]);
|
|
1037
1037
|
}
|
|
1038
1038
|
function ve(n) {
|
|
1039
|
-
w.value &&
|
|
1039
|
+
w.value && ae();
|
|
1040
1040
|
}
|
|
1041
1041
|
function Ye() {
|
|
1042
1042
|
return v(be, null, [D.value && v("div", {
|
|
@@ -1086,17 +1086,17 @@ const J = /* @__PURE__ */ re({
|
|
|
1086
1086
|
width: "100%",
|
|
1087
1087
|
frameborder: "0",
|
|
1088
1088
|
src: O.value
|
|
1089
|
-
}, null)]), Xe()]), !f.value && N.value && !D.value &&
|
|
1089
|
+
}, null)]), Xe()]), !f.value && N.value && !D.value && ne(N.value)]);
|
|
1090
1090
|
}
|
|
1091
1091
|
function Ge(n) {
|
|
1092
1092
|
return n || "body";
|
|
1093
1093
|
}
|
|
1094
|
-
return
|
|
1094
|
+
return ot(() => {
|
|
1095
1095
|
Z.value && (fe.value = me() || 1050);
|
|
1096
1096
|
}), () => v(ge, {
|
|
1097
1097
|
to: Ge(e.host)
|
|
1098
1098
|
}, {
|
|
1099
|
-
default: () => [Z.value && v(
|
|
1099
|
+
default: () => [Z.value && v(ut, {
|
|
1100
1100
|
name: "fade",
|
|
1101
1101
|
appear: !0
|
|
1102
1102
|
}, {
|
|
@@ -1116,7 +1116,7 @@ function Be(e) {
|
|
|
1116
1116
|
if (e.render && typeof e.render == "function")
|
|
1117
1117
|
return e.render;
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function Bt(e) {
|
|
1120
1120
|
const t = document.createElement("div");
|
|
1121
1121
|
t.style.display = "contents";
|
|
1122
1122
|
const l = e.type || "modal", a = ye({
|
|
@@ -1186,7 +1186,7 @@ function xt(e) {
|
|
|
1186
1186
|
});
|
|
1187
1187
|
return document.body.appendChild(t), a.use(Q.i18n), a.mount(t), a;
|
|
1188
1188
|
}
|
|
1189
|
-
class
|
|
1189
|
+
class Mt {
|
|
1190
1190
|
// private activeModalInstance = computed(() => {
|
|
1191
1191
|
// return this.modalRefs[this.activeModalIndex.value];
|
|
1192
1192
|
// });
|
|
@@ -1220,7 +1220,7 @@ class Bt {
|
|
|
1220
1220
|
showButtons: !0,
|
|
1221
1221
|
showHeader: !0
|
|
1222
1222
|
}, t);
|
|
1223
|
-
return
|
|
1223
|
+
return Bt(l);
|
|
1224
1224
|
}
|
|
1225
1225
|
close(t) {
|
|
1226
1226
|
var l, a;
|
|
@@ -1229,7 +1229,7 @@ class Bt {
|
|
|
1229
1229
|
open(t) {
|
|
1230
1230
|
const l = document.createDocumentFragment(), a = t.type || "modal";
|
|
1231
1231
|
t.showMaxButton && t.fitContent && (t.showMaxButton = !1);
|
|
1232
|
-
const u =
|
|
1232
|
+
const u = st(Object.assign({
|
|
1233
1233
|
title: "",
|
|
1234
1234
|
showButtons: !0,
|
|
1235
1235
|
showHeader: !0,
|
|
@@ -1245,7 +1245,7 @@ class Bt {
|
|
|
1245
1245
|
f(y, this.isUseEscCloseModal.value ? "esc" : b ? "icon" : "button");
|
|
1246
1246
|
}, w = (y) => {
|
|
1247
1247
|
B(y), p && K(() => {
|
|
1248
|
-
if (this.modalRefs[this.activeModalIndex.value] && delete this.modalRefs[this.activeModalIndex.value],
|
|
1248
|
+
if (this.modalRefs[this.activeModalIndex.value] && delete this.modalRefs[this.activeModalIndex.value], se(null, l), p = null, this.modalRef.value = null, this.modalRefs) {
|
|
1249
1249
|
const b = Object.keys(this.modalRefs).map((S) => Number(S));
|
|
1250
1250
|
b.length > 0 ? this.activeModalIndex.value = Math.max(...b) : this.activeModalIndex.value = 0, this.modalRefs[this.activeModalIndex.value] && (this.modalRef.value = this.modalRefs[this.activeModalIndex.value]);
|
|
1251
1251
|
}
|
|
@@ -1254,7 +1254,7 @@ class Bt {
|
|
|
1254
1254
|
}, M = o();
|
|
1255
1255
|
let C;
|
|
1256
1256
|
if (a === "drawer")
|
|
1257
|
-
C = () => v(Ce,
|
|
1257
|
+
C = () => v(Ce, ee({
|
|
1258
1258
|
ref: M,
|
|
1259
1259
|
modelValue: s.value,
|
|
1260
1260
|
"onUpdate:modelValue": (y) => s.value = y,
|
|
@@ -1276,7 +1276,7 @@ class Bt {
|
|
|
1276
1276
|
width: V,
|
|
1277
1277
|
height: h
|
|
1278
1278
|
} = u.value, g = this.adaptToWindow(Number(V) || 500, Number(h) || 320);
|
|
1279
|
-
Object.assign(u.value, g), C = () => v(J,
|
|
1279
|
+
Object.assign(u.value, g), C = () => v(J, ee({
|
|
1280
1280
|
ref: M,
|
|
1281
1281
|
modelValue: s.value,
|
|
1282
1282
|
"onUpdate:modelValue": (z) => s.value = z
|
|
@@ -1294,8 +1294,8 @@ class Bt {
|
|
|
1294
1294
|
});
|
|
1295
1295
|
}
|
|
1296
1296
|
p = ((y) => {
|
|
1297
|
-
const b =
|
|
1298
|
-
return b.appContext = this.appContext,
|
|
1297
|
+
const b = it(C, y);
|
|
1298
|
+
return b.appContext = this.appContext, se(b, l), b;
|
|
1299
1299
|
})({
|
|
1300
1300
|
...u.value
|
|
1301
1301
|
}), this.activeModalIndex.value++;
|
|
@@ -1305,7 +1305,7 @@ class Bt {
|
|
|
1305
1305
|
u.value = {
|
|
1306
1306
|
...u.value,
|
|
1307
1307
|
...y
|
|
1308
|
-
}, p &&
|
|
1308
|
+
}, p && se(rt(p, {
|
|
1309
1309
|
...u
|
|
1310
1310
|
}), l);
|
|
1311
1311
|
};
|
|
@@ -1329,7 +1329,7 @@ class Bt {
|
|
|
1329
1329
|
const Me = Symbol("FModalService");
|
|
1330
1330
|
J.install = (e) => {
|
|
1331
1331
|
e.component(J.name, J);
|
|
1332
|
-
const t = new
|
|
1332
|
+
const t = new Mt(e);
|
|
1333
1333
|
e.provide(Me, t), e.provide("FModalService", t);
|
|
1334
1334
|
};
|
|
1335
1335
|
function ke(e, t) {
|
|
@@ -1346,7 +1346,7 @@ function ke(e, t) {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
return { judgeCanOpen: l };
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1349
|
+
function kt(e, t, l, a, u) {
|
|
1350
1350
|
const s = o(e.buttonBehavior), d = o(e.popupOnInput), f = I(() => ({
|
|
1351
1351
|
"input-group-append": !0,
|
|
1352
1352
|
"append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
|
|
@@ -1361,7 +1361,7 @@ function Mt(e, t, l, a, u) {
|
|
|
1361
1361
|
});
|
|
1362
1362
|
w.value = b == null ? void 0 : b.modalRef;
|
|
1363
1363
|
}
|
|
1364
|
-
s.value === "Overlay" &&
|
|
1364
|
+
s.value === "Overlay" && gt.show({
|
|
1365
1365
|
// host: buttonEditRef.value,
|
|
1366
1366
|
host: document.body,
|
|
1367
1367
|
backgroundColor: "rgba(0,0,0,.15)",
|
|
@@ -1384,7 +1384,7 @@ function Mt(e, t, l, a, u) {
|
|
|
1384
1384
|
};
|
|
1385
1385
|
}
|
|
1386
1386
|
const G = "FarrisVue_PopoverInstancesKey";
|
|
1387
|
-
function
|
|
1387
|
+
function Et(e, t, l, a) {
|
|
1388
1388
|
const u = o(), s = o(!1), { judgeCanOpen: d } = ke(e, a);
|
|
1389
1389
|
$(() => u.value, (C, O) => {
|
|
1390
1390
|
window[G] = window[G] || /* @__PURE__ */ new WeakMap(), C ? window[G].set(l.value, C) : window[G].delete(l.value);
|
|
@@ -1426,7 +1426,7 @@ function kt(e, t, l, a) {
|
|
|
1426
1426
|
}
|
|
1427
1427
|
return { hidePopup: w, showPopup: M, popup: B, shouldPopupContent: s, togglePopup: p, popoverRef: u, closeAllPopover: f };
|
|
1428
1428
|
}
|
|
1429
|
-
function
|
|
1429
|
+
function zt(e, t, l) {
|
|
1430
1430
|
const {
|
|
1431
1431
|
buttonGroupClass: a
|
|
1432
1432
|
} = l, u = o(), s = I(() => ({
|
|
@@ -1453,12 +1453,12 @@ function Et(e, t, l) {
|
|
|
1453
1453
|
buttonHandleElement: u
|
|
1454
1454
|
};
|
|
1455
1455
|
}
|
|
1456
|
-
const
|
|
1456
|
+
const te = /* @__PURE__ */ re({
|
|
1457
1457
|
name: "FButtonEdit",
|
|
1458
|
-
props:
|
|
1458
|
+
props: dt,
|
|
1459
1459
|
emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue"],
|
|
1460
1460
|
setup(e, t) {
|
|
1461
|
-
const l = o(), a = we("design-item-context"), u =
|
|
1461
|
+
const l = o(), a = we("design-item-context"), u = ct(l, a), s = o(e.customClass), d = o(e.modelValue), f = Et(e, t, l, d), i = kt(e, t, l, f, d), p = o(), B = I(() => ({
|
|
1462
1462
|
"f-cmp-inputgroup": !0,
|
|
1463
1463
|
"input-group": !0,
|
|
1464
1464
|
"f-state-disabled": !0,
|
|
@@ -1483,8 +1483,8 @@ const ee = /* @__PURE__ */ re({
|
|
|
1483
1483
|
"f-utils-fill": !0
|
|
1484
1484
|
})), {
|
|
1485
1485
|
renderButtonGroup: C
|
|
1486
|
-
} =
|
|
1487
|
-
return () => v("div",
|
|
1486
|
+
} = zt(e, t, i);
|
|
1487
|
+
return () => v("div", ee(t.attrs, {
|
|
1488
1488
|
ref: l,
|
|
1489
1489
|
class: w.value,
|
|
1490
1490
|
id: e.id ? e.id : void 0,
|
|
@@ -1498,13 +1498,13 @@ const ee = /* @__PURE__ */ re({
|
|
|
1498
1498
|
placeholder: e.placeholder
|
|
1499
1499
|
}, null), C()])]);
|
|
1500
1500
|
}
|
|
1501
|
-
}),
|
|
1502
|
-
["appearance",
|
|
1501
|
+
}), Ot = /* @__PURE__ */ new Map([
|
|
1502
|
+
["appearance", et]
|
|
1503
1503
|
]);
|
|
1504
|
-
function
|
|
1504
|
+
function St(e, t, l) {
|
|
1505
1505
|
return t;
|
|
1506
1506
|
}
|
|
1507
|
-
const
|
|
1507
|
+
const Ht = "https://json-schema.org/draft/2020-12/schema", It = "https://farris-design.gitee.io/button-edit.schema.json", Tt = "button-edit", Rt = "A Farris Input Component", Pt = "object", jt = {
|
|
1508
1508
|
id: {
|
|
1509
1509
|
description: "The unique identifier for a Input Group",
|
|
1510
1510
|
type: "string"
|
|
@@ -1713,18 +1713,18 @@ const St = "https://json-schema.org/draft/2020-12/schema", Ht = "https://farris-
|
|
|
1713
1713
|
type: "string",
|
|
1714
1714
|
default: ""
|
|
1715
1715
|
}
|
|
1716
|
-
},
|
|
1716
|
+
}, Lt = [
|
|
1717
1717
|
"id",
|
|
1718
1718
|
"type"
|
|
1719
|
-
],
|
|
1720
|
-
$schema:
|
|
1721
|
-
$id:
|
|
1722
|
-
title:
|
|
1723
|
-
description:
|
|
1724
|
-
type:
|
|
1725
|
-
properties:
|
|
1726
|
-
required:
|
|
1727
|
-
},
|
|
1719
|
+
], Ft = {
|
|
1720
|
+
$schema: Ht,
|
|
1721
|
+
$id: It,
|
|
1722
|
+
title: Tt,
|
|
1723
|
+
description: Rt,
|
|
1724
|
+
type: Pt,
|
|
1725
|
+
properties: jt,
|
|
1726
|
+
required: Lt
|
|
1727
|
+
}, Wt = "buttonEdit", Dt = "A Farris Component", Vt = "object", At = {
|
|
1728
1728
|
basic: {
|
|
1729
1729
|
description: "Basic Infomation",
|
|
1730
1730
|
title: "基本信息",
|
|
@@ -1806,27 +1806,27 @@ const St = "https://json-schema.org/draft/2020-12/schema", Ht = "https://farris-
|
|
|
1806
1806
|
}
|
|
1807
1807
|
}
|
|
1808
1808
|
}
|
|
1809
|
-
},
|
|
1810
|
-
title:
|
|
1811
|
-
description:
|
|
1812
|
-
type:
|
|
1813
|
-
categories:
|
|
1814
|
-
}, Ee =
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
zt,
|
|
1809
|
+
}, Nt = {
|
|
1810
|
+
title: Wt,
|
|
1811
|
+
description: Dt,
|
|
1812
|
+
type: Vt,
|
|
1813
|
+
categories: At
|
|
1814
|
+
}, Ee = tt(
|
|
1815
|
+
lt,
|
|
1816
|
+
Ft,
|
|
1818
1817
|
Ot,
|
|
1819
|
-
|
|
1818
|
+
St,
|
|
1819
|
+
Nt
|
|
1820
1820
|
);
|
|
1821
|
-
|
|
1822
|
-
e["button-edit"] =
|
|
1821
|
+
te.register = (e, t, l, a) => {
|
|
1822
|
+
e["button-edit"] = nt, t["button-edit"] = Ee;
|
|
1823
1823
|
};
|
|
1824
|
-
|
|
1825
|
-
e["button-edit"] =
|
|
1824
|
+
te.registerDesigner = (e, t, l) => {
|
|
1825
|
+
e["button-edit"] = te, t["button-edit"] = Ee;
|
|
1826
1826
|
};
|
|
1827
|
-
const
|
|
1827
|
+
const tn = Qe(te);
|
|
1828
1828
|
export {
|
|
1829
|
-
|
|
1830
|
-
|
|
1829
|
+
te as FButtonEditDesign,
|
|
1830
|
+
tn as default,
|
|
1831
1831
|
Ee as propsResolver
|
|
1832
1832
|
};
|