@farris/ui-vue 1.8.0-alpha.0 → 1.8.0-beta.1
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/avatar/index.esm.js +138 -1526
- package/components/avatar/index.umd.cjs +1 -6
- package/components/button/index.css +1 -1
- package/components/button/index.esm.js +15951 -15410
- package/components/button/index.umd.cjs +27 -27
- package/components/calendar/index.esm.js +269 -255
- package/components/calendar/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +243 -229
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +32 -32
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +473 -456
- package/components/comment/index.umd.cjs +6 -6
- package/components/component/index.css +1 -1
- package/components/component/index.esm.js +2503 -2239
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +1064 -954
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +1 -1
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +3894 -3058
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +91 -77
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +220 -215
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +145 -131
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +336 -329
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +1611 -1536
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +219 -219
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/external-container/index.esm.js +179 -178
- package/components/external-container/index.umd.cjs +1 -1
- package/components/fieldset/index.esm.js +285 -221
- package/components/fieldset/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -0
- package/components/filter-bar/index.esm.js +1512 -1290
- package/components/filter-bar/index.umd.cjs +7 -7
- package/components/filter-condition-editor/index.esm.js +851 -831
- package/components/filter-condition-editor/index.umd.cjs +3 -3
- package/components/flow-canvas/index.esm.js +520 -501
- package/components/flow-canvas/index.umd.cjs +8 -8
- package/components/image/index.esm.js +101 -79
- package/components/image/index.umd.cjs +3 -3
- package/components/language-textbox/index.esm.js +330 -251
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-nav/index.esm.js +399 -313
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/locale/index.esm.js +3 -0
- package/components/locale/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +997 -976
- package/components/lookup/index.umd.cjs +2 -2
- package/components/mapping-editor/index.esm.js +725 -705
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +542 -522
- package/components/message-box/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +95 -308
- package/components/nav/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +115 -107
- package/components/number-range/index.umd.cjs +2 -2
- package/components/order/index.esm.js +56 -54
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +135 -123
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +266 -222
- package/components/page-header/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +402 -375
- package/components/property-panel/index.umd.cjs +4 -4
- package/components/query-solution/index.esm.js +3171 -3061
- package/components/query-solution/index.umd.cjs +7 -7
- package/components/response-toolbar/index.esm.js +1 -1
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +1620 -1608
- package/components/schema-selector/index.umd.cjs +5 -5
- package/components/scroll-navbar/index.esm.js +150 -136
- package/components/scroll-navbar/index.umd.cjs +2 -2
- package/components/section/index.esm.js +323 -311
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +850 -830
- package/components/sort-condition-editor/index.umd.cjs +3 -3
- package/components/step/index.esm.js +991 -224
- package/components/step/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +356 -334
- package/components/tabs/index.umd.cjs +1 -1
- package/components/wizard/index.esm.js +159 -162
- package/components/wizard/index.umd.cjs +1 -1
- package/designer/avatar/index.esm.js +1721 -0
- package/designer/avatar/index.umd.cjs +6 -0
- package/designer/button-edit/index.esm.js +2 -1
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +693 -659
- package/designer/data-grid/index.umd.cjs +6 -6
- package/designer/data-view/index.esm.js +90 -78
- package/designer/data-view/index.umd.cjs +2 -2
- package/designer/date-picker/index.esm.js +203 -203
- package/designer/date-picker/index.umd.cjs +1 -1
- package/designer/drawer/index.esm.js +181 -167
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +228 -206
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +10014 -9692
- package/designer/farris-designer.all.umd.cjs +18 -18
- package/designer/index.css +1 -1
- package/designer/input-group/index.esm.js +15 -15
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/nav/index.esm.js +1719 -0
- package/designer/nav/index.umd.cjs +6 -0
- package/designer/number-spinner/index.esm.js +8 -7
- package/designer/number-spinner/index.umd.cjs +1 -1
- package/designer/radio-group/index.esm.js +133 -125
- package/designer/radio-group/index.umd.cjs +2 -2
- package/designer/response-toolbar/index.esm.js +864 -863
- package/designer/response-toolbar/index.umd.cjs +1 -1
- package/designer/section/index.esm.js +245 -183
- package/designer/section/index.umd.cjs +1 -1
- package/designer/tabs/index.css +1 -1
- package/designer/tabs/index.esm.js +3667 -2810
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/time-picker/index.esm.js +26 -17
- package/designer/time-picker/index.umd.cjs +2 -2
- package/designer/tree-grid/index.esm.js +69 -37
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/designer/wizard/index.esm.js +110 -110
- package/designer/wizard/index.umd.cjs +3 -3
- package/farris.all.esm.js +39993 -39089
- package/farris.all.umd.cjs +36 -36
- package/index.css +1 -1
- package/locales/filter-bar/ui/en.json +1 -0
- package/locales/filter-bar/ui/zh-CHS.json +1 -0
- package/locales/filter-bar/ui/zh-CHT.json +1 -0
- package/locales/ui/en.json +1 -0
- package/locales/ui/zh-CHS.json +1 -0
- package/locales/ui/zh-CHT.json +1 -0
- package/package.json +1 -1
- package/types/avatar/designer.d.ts +28 -0
- package/types/avatar/index.d.ts +0 -15
- package/types/avatar/src/composition/types.d.ts +3 -0
- package/types/avatar/src/composition/use-file.d.ts +19 -0
- package/types/avatar/src/composition/use-image.d.ts +1 -1
- package/types/avatar/src/designer/avatar.design.props.d.ts +24 -0
- package/types/avatar/src/property-config/avatar.property-config.d.ts +11 -13
- package/types/avatar/src/schema/schema-mapper.d.ts +2 -0
- package/types/components.d.ts +3 -0
- package/types/condition/index.d.ts +18 -6
- package/types/condition/src/condition-fields.component.d.ts +9 -3
- package/types/condition/src/condition-fields.design.component.d.ts +9 -3
- package/types/condition/src/condition-list.component.d.ts +9 -3
- package/types/condition/src/condition.props.d.ts +11 -0
- package/types/data-view/designer/property-config/use-appearance.d.ts +17 -10
- package/types/data-view/designer/property-config/use-pagination.d.ts +0 -6
- package/types/designer-canvas/src/composition/dg-control.d.ts +13 -0
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +3 -0
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.props.d.ts +4 -0
- package/types/dynamic-resolver/src/converter/tree-auto-check.converter.d.ts +3 -0
- package/types/dynamic-view/src/components/maps.d.ts +130 -4
- package/types/filter-bar/src/composition/types.d.ts +2 -0
- package/types/filter-bar/src/filter-bar.props.d.ts +0 -1
- package/types/filter-bar/src/locale/locale.d.ts +2 -1
- package/types/filter-bar/src/property-config/filter-bar.property-config.d.ts +0 -1
- package/types/language-textbox/index.d.ts +65 -2
- package/types/language-textbox/src/designer/language-textbox.design.component.d.ts +36 -0
- package/types/language-textbox/src/language-textbox.component.d.ts +38 -1
- package/types/language-textbox/src/language-textbox.props.d.ts +20 -0
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/lookup/src/composition/use-compat.d.ts +28 -0
- package/types/lookup/src/composition/use-state.d.ts +1 -0
- package/types/message-box/src/message-box.service.d.ts +2 -1
- package/types/nav/designer.d.ts +28 -0
- package/types/nav/index.d.ts +24 -20
- package/types/nav/src/designer/nav.design.props.d.ts +29 -0
- package/types/nav/src/designer/use-design-rules.d.ts +3 -0
- package/types/nav/src/property-config/nav.property-config.d.ts +9 -0
- package/types/nav/src/schema/schema-mapper.d.ts +4 -0
- package/types/page-footer/src/designer/use-designer-rules.d.ts +2 -2
- package/types/page-header/src/designer/use-designer-rules.d.ts +2 -2
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +1 -1
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +1 -1
- package/types/section/src/designer/section.design.props.d.ts +4 -0
- package/types/section/src/property-config/section.property-config.d.ts +39 -0
- package/types/section/src/schema/toolbar-resolver.d.ts +0 -1
- package/types/step/src/designer/use-designer-rules.d.ts +3 -0
- package/types/step/src/designer/use-step-creator.d.ts +6 -0
- package/types/step/src/property-config/step.property-config.d.ts +15 -0
- package/types/step/src/schema/schema-resolver.d.ts +2 -1
- package/types/tabs/src/composition/types.d.ts +4 -0
- package/types/tabs/src/tabs.props.d.ts +6 -0
- package/types/tooltip/index.d.ts +3 -3
- package/types/tooltip/src/tooltip.component.d.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(C,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),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","../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):(C=typeof globalThis<"u"?globalThis:C||self,e(C.tabs={},C.Vue,C.common,C.FCapsule,C.locale,C.FResponseToolbar,C.BigNumber,C.LodashES,C.FSection,C.propertyPanel))})(this,function(C,e,q,X,F,Y,je,Ie,W,Z){"use strict";const E={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}};function ee(t,n,l){const c=e.ref([]),i=e.ref(t.activeId||"");let d="";const p=e.ref(!0),u=e.ref([]),b=e.ref(!0),f=e.ref(0),h=e.computed(()=>{const s=c.value.find(r=>r.props.id===i.value);return(s==null?void 0:s.props.toolbarPosition)==="inHead"});function w(s,o=!0){const r=s.findIndex(g=>g.props.show!==!1&&!g.props.disabled);if(u.value=[],r!==-1){if(i.value=s[r].props.id,!o)return;const g=s[r];g&&g.props.toolbar&&g.props.toolbar.buttons&&g.props.toolbar.buttons.length&&(u.value=[...g.props.toolbar.buttons],b.value=g.props.toolbarVisible)}}function T(s){i.value=s;const o=c.value.find(r=>r.props.id===s);u.value=[],o&&o.props.toolbar&&o.props.toolbar.buttons&&o.props.toolbar.buttons.length&&(u.value=[...o.props.toolbar.buttons],b.value=o.props.toolbarVisible),n.emit("update:activeId",s),n.emit("tabChange",{prevId:d,nextId:i.value})}function B(s){let o=-1;if(!i.value){if(o=s.findIndex(r=>i.value===r.props.id&&r.props.show!==!1&&!r.props.disabled),o>-1)return;d=i.value}w(s,!1),T(i.value)}function S(s){let o=!1;if(s){const r=c.value.find(g=>g.props.id===s);o=!r||r.props.show===!1||r.props.disabled===!0}o?B(c.value):(i.value!==s&&(d=i.value,i.value=s),T(i.value))}e.watch(()=>t.activeId,(s,o)=>{s!==o&&t.activeId!==i.value&&S(s)});function a(s){var r;if(t.autoTitleWidth)return;const o=(r=s.value)==null?void 0:r.querySelectorAll(".st-tab-text");if(!(!o||t.tabType==="pill"))for(let g=0;g<o.length;g++){const O=o[g].parentNode;o[g].scrollWidth>O.offsetWidth?o[g].classList.contains("farris-title-text-custom")||o[g].classList.add("farris-title-text-custom"):o[g].classList.remove("farris-title-text-custom")}}const v=s=>{s.preventDefault(),s.stopPropagation()};function x(s,o,r=!1){const g=c.value.findIndex(O=>O.props.id===o);c.value=c.value.filter(O=>O.props.id!==o),i.value===o&&(d=o,i.value="",w(c.value)),v(s),e.nextTick(()=>{f.value++,a(l),r&&(p.value=!0),n.emit("tabRemove",{removeIndex:g,removeId:o,activeId:i.value})})}function m(s,o=!0){i.value===s&&(i.value="",d=s,S("")),e.nextTick(()=>{f.value++,o&&(p.value=!0)})}let V;function j(s){V=s}function I(s){i.value!==s&&(d=i.value,T(s),V&&V())}function k(s){c.value.findIndex(r=>r.props.id===s.props.id)===-1&&c.value.push(s),f.value++}function P(s){c.value.findIndex(r=>r.props.id===s.props.id)!==-1&&(c.value.forEach(r=>{r.props.id===s.props.id&&(r=s)}),s.props.id===i.value&&h.value,e.nextTick(()=>{f.value++,a(l)}))}return{activeId:i,addTab:k,changeTitleStyle:a,removeTab:x,selectTab:I,tabPages:c,updateTab:P,toolbarItems:u,needUpdateNavigationLayout:f,checkActiveIdAndSelect:S,toggleShowTab:m,hasInHeadClass:h,setScrollToSelectedTabFunction:j,toolbarVisible:b}}function te(t,n,l,c,i){const{activeId:d,removeTab:p,selectTab:u}=i,b=e.computed(()=>{const m={"st-tab-text":!0,"text-truncate":t.tabType==="pill"&&!t.autoTitleWidth,"farris-title-auto":t.autoTitleWidth};return q.getCustomClass(m,n.customTitleClass)}),f=e.computed(()=>({"nav-item":!0,"d-none":n.show!==void 0?!n.show:!1,"f-state-active":n.id===d.value,"f-state-disabled":n.disabled})),h=e.computed(()=>({width:`${n.tabWidth}px`})),w=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:n.id===d.value,disabled:n.disabled})),T=e.reactive({content:n.title,overflowShown:!0});function B(){return t.tabType!=="pill"&&!t.autoTitleWidth?e.withDirectives(e.createVNode("span",{class:b.value,"data-tabid":n.id},[n.title]),[[e.resolveDirective("tooltip"),T]]):e.createVNode("span",{class:b.value,"data-tabid":n.id,title:n.title},[n.title])}const S=e.ref(n.removeable);function a(){return S.value?e.createVNode("span",{class:"st-drop-close",onClick:m=>p(m,n.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]):""}function v(m){u(n.id),t.tabType==="one-page"&&c.scrollToByPaggId(n.id)}function x(){return l.slots.title?e.createVNode("a",{class:w.value,onClick:v,id:`${n.id}-design-item`},[l.slots.title(l),a()]):n.titleRenderFunction?e.createVNode("a",{class:w.value,onClick:v,id:`${n.id}-design-item`},[n.titleRenderFunction(),a()]):e.createVNode("a",{class:w.value,onClick:v,id:`${n.id}-design-item`},[B(),a()])}return e.createVNode("li",{class:f.value,style:h.value},[x()])}function ne(t,n,l,c,i){const{shouldShowNavigationButtons:d}=l,{tabPages:p}=i,u=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":d.value})),b=e.computed(()=>({width:"100%","justify-content":t.justifyContent})),f=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:u.value,style:b.value},[e.createVNode("ul",{class:f.value,ref:n},[p.value.map(h=>te(t,h.props,h,c,i))])])}function oe(t,n,l,c,i){const d=e.ref(),{shouldShowNavigationButtons:p}=l,{activeId:u,tabPages:b,selectTab:f}=i,h=e.ref(u.value),w=e.computed(()=>b.value.map(a=>({name:a.props.title,value:a.props.id,show:a.props.show,disabled:a.props.disabled}))),T=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":p.value})),B=e.computed(()=>({width:"100%",display:"flex","justify-content":t.justifyContent}));e.onMounted(()=>{d.value&&(n.value=d.value.$el)});function S(a){f(a)}return e.watch(()=>u.value,a=>{a!==h.value&&(h.value=a)},{immediate:!0}),()=>e.createVNode("div",{class:T.value,style:B.value},[e.createVNode(X,{items:w.value,modelValue:h.value,"onUpdate:modelValue":a=>h.value=a,onChange:S,ref:d},null)])}function le(t,n,l,c){const i=e.ref(),{activeId:d,removeTab:p,tabPages:u,selectTab:b}=c,{hideDropDown:f,searchTabText:h}=n,w=600;let T=null;const B=e.computed(()=>{var r,g;let o=[];return t.searchBoxVisible?o=(r=u.value)==null?void 0:r.filter(O=>O.props.title.includes(h.value)):o=(g=u.value)==null?void 0:g.slice(),o}),S=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":t.searchBoxVisible,show:!f.value,"d-none":f.value}));let a;function v(o){a=o}e.watch(f,o=>{if(a.value)if(o)i.value.style.width=null;else{const r=a.value.querySelector(".farris-tabs-header"),g=a.value.clientHeight-r.clientHeight-20,M=r.querySelector(".farris-tabs-title").clientWidth-20;i.value.style.maxWidth=M+"px",i.value.style.maxHeight=g+"px",e.nextTick(()=>{const{width:R}=i.value.getClientRects()[0];i.value.style.width=R?R+"px":null})}});function x(o){return{"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:o.props.disabled,active:o.props.id===d.value,"d-none":o.props.show!==!0}}function m(o){o.preventDefault(),o.stopPropagation()}function V(){T&&clearTimeout(T)}function j(){f.value||(T=setTimeout(()=>{f.value=!0},w))}function I(o,r){o.stopPropagation(),r.disabled||b(r.id),f.value=!0}function k(o,r){o.stopPropagation(),p(o,r,!0)}function P(o){return o.slots.title?e.createVNode("a",{class:"dropdown-title",id:`${o.props.id}-dropdown-item`},[o.slots.title(o)]):o.props.titleRenderFunction?e.createVNode("a",{class:"dropdown-title",id:`${o.props.id}-dropdown-item`},[o.props.titleRenderFunction()]):e.createVNode("a",{class:"dropdown-title",id:`${o.props.id}-dropdown-item`},[o.props.title])}function s(){return e.createVNode("div",{ref:i,class:S.value,onMouseenter:()=>V(),onMouseleave:()=>j()},[t.searchBoxVisible&&e.createVNode("div",{onClick:o=>m(o),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{type:"text",class:"form-control","onUpdate:modelValue":o=>h.value=o},null),[[e.vModelText,h.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),B.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items flex-fill"},[B.value.map(o=>e.createVNode("li",{class:x(o),onClick:r=>I(r,o.props)},[o.props.removeable&&o.props.disabled!==!0&&e.createVNode("span",{class:"float-right st-drop-close",onClick:r=>k(r,o.props.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),P(o)]))]):e.createVNode("div",{class:"dropdown-no-data"},[F.LocaleService.getLocaleValue("tabs.noData")])])}return{renderDropdownMenu:s,setTabsRef:v}}function ie(t,n,l,c){const{hideDropDown:i}=n,{renderDropdownMenu:d,setTabsRef:p}=le(t,n,l,c),u=e.ref(t.showDropdown);function b(){return u.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{i.value=!1}},null),d()])}return{renderMorePagesButtton:b,setTabsRef:p}}function ae(t,n,l,c){const i=e.ref(!1),{selectTab:d,tabPages:p,needUpdateNavigationLayout:u,activeId:b}=c,f=4,h=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!i.value})),w=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!i.value})),T=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!i.value}));function B(m,V){if(!n.value)return;const j=n.value.scrollLeft,I=n.value.scrollWidth-n.value.offsetWidth;if(V>0){if(n.value.scrollLeft>=I)return;n.value.scrollLeft=j+t.scrollStep+m}else if(V<0){if(n.value.scrollLeft<=0)return;n.value.scrollLeft=j-t.scrollStep-m}}function S(m=-1){if(!i.value||!n.value)return;m<0&&(m=p.value.findIndex(P=>P.props.id===b.value));const V=t.tabType==="pills"?".f-capsule-item":".nav-item",j=n.value.querySelectorAll(V),{parentElement:I}=n.value,k=j[m];if(k&&I){const P=I.getBoundingClientRect().left,s=I.getBoundingClientRect().right,o=k.getBoundingClientRect().left,r=k.getBoundingClientRect().right;o<P?B(P-o,-1):s<r&&B(r-s,1),t.tabType==="one-page"&&l.scrollTo(m)}}function a(){var j;if(!n.value)return;const m=n.value,V=(j=n.value)==null?void 0:j.parentElement;i.value=V&&m&&V.offsetWidth<m.scrollWidth-f,i.value&&e.nextTick(()=>{S()})}function v(m){m.disabled||d(m.id)}function x(){["default","one-page"].indexOf(t.tabType)>-1&&e.nextTick(()=>{S()})}return e.watch(u,()=>{a()}),{previousButtonClass:h,nextButtonGroupClass:w,nextButtonClass:T,scrollTab:B,selectAndScrollToTab:v,shouldShowNavigationButtons:i,updateNavigationLayout:a,scrollToSelectedTab:x}}function se(t,n){const{tabPages:l}=n,c=e.ref(""),i=e.ref(!0),d=e.computed(()=>t.searchBoxVisible),p=e.computed(()=>d.value?l.value.filter(b=>b.props.title.includes(c.value)):l.value.slice());return e.watch(i,u=>{u||(c.value="")}),{searchTabText:c,hideDropDown:i,shouldShowSearchBox:d,tabsInDropdownMenu:p}}function re(t,n,l){const c=".farris-tab-page",{tabPages:i}=l;function d(u){const b=n.value;if(b){const f=n.value.querySelectorAll(c);if(f.length>0){const h=f[u],{offsetTop:w}=h,T=w-32>0?w-32:0;b.scrollTop=T}}}function p(u){const b=i.value.findIndex(f=>f.props.id===u);b>-1&&d(b)}return{scrollTo:d,scrollToByPaggId:p}}const ce=["moz","ms","webkit"];function de(){let t=0;return n=>{const l=new Date().getTime(),c=Math.max(0,16-(l-t)),i=setTimeout(()=>{n(l+c)},c);return t=l+c,i}}function ue(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=ce.filter(n=>`${n}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:de()}ue();function fe(){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 u of l)if(u.test(t))return!1;for(const u of n)if(u.test(t))return!0;const c="ontouchstart"in window||navigator.maxTouchPoints>0,i=screen.width,d=screen.height,p=Math.min(i,d);return!!(c&&p<=768)}const H=e.defineComponent({name:"FTabs",props:E,emits:["tabChange","tabRemove","update:activeId","Click"],setup(t,n){const l=e.ref(t.tabType),c=e.shallowRef(),i=fe(),d=e.ref(t.customClass),p=e.shallowRef(),u=e.shallowRef(),b=e.ref(),f=ee(t,n,p),{activeId:h,changeTitleStyle:w,tabPages:T,addTab:B,updateTab:S,toolbarItems:a,checkActiveIdAndSelect:v,toggleShowTab:x,hasInHeadClass:m,toolbarVisible:V}=f,j=re(t,u,f),I=ae(t,p,j,f),{previousButtonClass:k,nextButtonClass:P,nextButtonGroupClass:s,scrollTab:o,updateNavigationLayout:r,scrollToSelectedTab:g}=I;f.setScrollToSelectedTabFunction(g);const O=se(t,f),M=ne(t,p,I,j,f),R=M,pe=oe(t,p,I,j,f),_=new Map([["default",M],["one-page",R],["pills",pe]]);e.computed(()=>{const y=T.value.find(N=>N.props.id===h.value);return y==null?void 0:y.slots});const D=e.computed(()=>t.fill),z=(y,N)=>{n.emit("Click",y,N,h.value)};e.provide("tabs",{activeId:h,addTab:B,updateTab:S,tabPages:T,tabType:l,shouldFillParentContaner:D,toggleShowTab:x,toolbarVisible:V,clickToolbarItemHandler:z});let G=!1;const me=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":m.value,"farris-tabs-inContent":!m.value,"farris-tabs-nav-fill":t.tabType==="fill","farris-tabs-nav-pills":t.tabType==="pills"})),he=e.computed(()=>{const y={width:m.value&&t.titleWidth?`${t.titleWidth}%`:""};return y.width&&(y.flex="unset"),y}),ve=e.computed(()=>{const y={"farris-tabs":!0,"f-tabs-content-fill":D.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 d.value&&d.value.split(" ").reduce((N,A)=>(N[A]=!0,N),y),y}),ge=new ResizeObserver(y=>{y.length&&r()});function K(){b.value&&!G&&(ge.observe(b.value),G=!0)}e.watch(()=>t.visible,y=>{e.nextTick(()=>{T.value.length&&v(t.activeId||T.value[0].props.id),r(),w(p),K()})}),e.watch(()=>t.autoTitleWidth,y=>{e.nextTick(()=>{r(),w(p)})}),e.onMounted(()=>{t.visible&&(T.value.length&&v(t.activeId||T.value[0].props.id),e.nextTick(()=>{r(),w(p)}),K())});function Te(){return e.createVNode("button",{title:F.LocaleService.getLocaleValue("tabs.leftButton"),type:"button",class:k.value,onClick:()=>{o(0,-1)}},null)}function ye(){return e.createVNode("button",{title:F.LocaleService.getLocaleValue("tabs.rightButton"),type:"button",class:P.value,onClick:()=>{o(0,1)}},null)}const{renderMorePagesButtton:we,setTabsRef:Ce}=ie(t,O,I,f);Ce(c);function xe(){return a.value.length?e.createVNode("div",{class:{"farris-tabs-toolbar":!0,"d-none":!V.value}},[e.createVNode(Y,{class:"f-utils-fill",alignment:m.value?"right":"left",items:a.value,visible:V.value,onClick:z},null)]):null}const J=_.get(t.tabType)||_.get("default");function Ve(){var y,N,A,Q;return e.createVNode("div",{class:me.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(N=(y=n.slots).headerPrefix)==null?void 0:N.call(y)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:he.value,ref:b},[!i&&Te(),J&&J(),e.createVNode("div",{hidden:i,class:s.value},[ye(),we()])]),xe(),e.createVNode("div",{class:"farris-tabs-header-post"},[(Q=(A=n.slots).headerSuffix)==null?void 0:Q.call(A)])])}const Se=e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":D.value}));function Be(){var y,N;return e.createVNode("div",{class:Se.value,ref:u},[(N=(y=n.slots).default)==null?void 0:N.call(y)])}return()=>t.visible?e.createVNode("div",{class:ve.value,ref:c},[Ve(),Be()]):null}}),$={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 U(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const L=e.defineComponent({name:"FTabPage",props:$,emits:[],setup(t,n){const l=e.inject("tabs");q.isMobilePhone();const c=e.ref(t.show),i={slots:n.slots,props:t},d=e.ref((l==null?void 0:l.tabType.value)||"default");e.onMounted(()=>{const a=l==null?void 0:l.tabPages.value.findIndex(v=>v.props.id===t.id);(!a||a===-1)&&(l==null||l.addTab(i))}),e.onUnmounted(()=>{});const p=e.computed(()=>(t==null?void 0:t.id)===(l==null?void 0:l.activeId.value)),u=e.computed(()=>({display:p.value?"":"none"}));e.watch(()=>t,a=>{l==null||l.updateTab({props:a,slots:n.slots})},{immediate:!0,deep:!0}),e.watch(()=>t.show,a=>{l==null||l.toggleShowTab(t.id)}),e.watch(()=>t.toolbarVisible,a=>{p.value&&l&&(l.toolbarVisible.value=a)});function b(){var v,x;const a=(x=(v=n.slots).default)==null?void 0:x.call(v);return e.createVNode(W,{"main-title":t.title,class:["farris-tab-page",c.value?"":"f-tab-d-none"]},U(a)?a:{default:()=>[a]})}function f(a,v){l&&(l.activeId.value=t.id,l.clickToolbarItemHandler&&l.clickToolbarItemHandler(a,v))}function h(){var v,x;const a=(x=(v=n.slots).default)==null?void 0:x.call(v);return e.createVNode(W,{customClass:"section-in-tab is-mobile",onClick:f,visible:t.show,"main-title":t.title,buttons:t.toolbar.buttons,"button-position":t.toolbar.position||t.toolbarPosition,"buttons-visible":t.toolbarVisible},U(a)?a:{default:()=>[a]})}const w=e.computed(()=>{var v;return{"farris-tab-page":!0,"f-tab-d-none":!c.value,"f-tab-active":p.value&&l&&((v=l.shouldFillParentContaner)==null?void 0:v.value)}});function T(){var v,x;const a=(x=(v=n.slots).default)==null?void 0:x.call(v);return e.createVNode("div",{class:w.value,style:u.value},[a])}const S=new Map([["default",T],["one-page",b],["mobile",h]]).get(d.value)||T;return()=>S()}});class be extends Z.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","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:"点击事件"}],c=this,i=c.eventsEditorUtils.formProperties(n,c.viewModelId,l),d=c.createBaseEventProperty(i);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:d,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(p,u){const b=p.propertyValue;delete n[c.viewModelId],b&&(b.setPropertyRelates=this.setPropertyRelates,c.eventsEditorUtils.saveRelatedParameters(n,c.viewModelId,b.events,b))}}}}H.install=t=>{t.component(H.name,H),t.component(L.name,L)},C.FTabPage=L,C.FTabs=H,C.TabToolbarItemProperty=be,C.default=H,C.tabPageProps=$,C.tabsProps=E,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(w,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):(w=typeof globalThis<"u"?globalThis:w||self,e(w.tabs={},w.Vue,w.notify,w.common,w.FCapsule,w.locale,w.FResponseToolbar,w.BigNumber,w.LodashES,w.FSection,w.propertyPanel))})(this,function(w,e,X,D,Y,F,Z,Ne,Pe,W,ee){"use strict";const E={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,c){const i={};return i.beforeTabSelect=s=>l.call("beforeTabSelect",n,[s,n],c),i}return{resolve:t}}function ne(t,n,l){const c=new X.FNotifyService,i=e.ref([]),s=e.ref(t.activeId||"");let d="";const p=e.ref(!0),f=e.ref([]),b=e.ref(!0),h=e.ref(0),C=e.computed(()=>{const o=i.value.find(u=>u.props.id===s.value);return(o==null?void 0:o.props.toolbarPosition)==="inHead"});function T(o,a=!0){const u=o.findIndex(g=>g.props.show!==!1&&!g.props.disabled);if(u!==-1){if(s.value=o[u].props.id,!a)return;f.value=[];const g=o[u];g&&g.props.toolbar&&g.props.toolbar.buttons&&g.props.toolbar.buttons.length&&(f.value=[...g.props.toolbar.buttons],b.value=g.props.toolbarVisible)}}function S(o){s.value=o;const a=i.value.find(u=>u.props.id===o);f.value=[],a&&a.props.toolbar&&a.props.toolbar.buttons&&a.props.toolbar.buttons.length&&(f.value=[...a.props.toolbar.buttons],b.value=a.props.toolbarVisible),n.emit("update:activeId",o),n.emit("tabChange",{prevId:d,nextId:s.value})}async function B(o){var N;let a=-1;if(!s.value){if(a=o.findIndex(M=>s.value===M.props.id&&M.props.show!==!1&&!M.props.disabled),a>-1)return;d=s.value}T(o,!1);const u=await((N=t.beforeTabSelect)==null?void 0:N.call(t,{prevId:d,nextId:s.value}));(typeof u=="boolean"?u:(u==null?void 0:u.canSelect)??!0)?S(s.value):(s.value=d,typeof u!="boolean"&&u.message&&(c==null||c.warning({message:u.message,position:"top-center"})))}function r(o){let a=!1;if(o){const u=i.value.find(g=>g.props.id===o);a=!u||u.props.show===!1||u.props.disabled===!0}a?B(i.value):(s.value!==o&&(d=s.value,s.value=o),S(s.value))}e.watch(()=>t.activeId,(o,a)=>{o!==a&&t.activeId!==s.value&&r(o)});function v(o){var u;if(t.autoTitleWidth)return;const a=(u=o.value)==null?void 0:u.querySelectorAll(".st-tab-text");if(!(!a||t.tabType==="pill"))for(let g=0;g<a.length;g++){const N=a[g].parentNode;a[g].scrollWidth>N.offsetWidth?a[g].classList.contains("farris-title-text-custom")||a[g].classList.add("farris-title-text-custom"):a[g].classList.remove("farris-title-text-custom")}}const x=o=>{o.preventDefault(),o.stopPropagation()};function m(o,a,u=!1){const g=i.value.findIndex(N=>N.props.id===a);i.value=i.value.filter(N=>N.props.id!==a),s.value===a&&(d=a,s.value="",T(i.value)),x(o),e.nextTick(()=>{h.value++,v(l),u&&(p.value=!0),n.emit("tabRemove",{removeIndex:g,removeId:a,activeId:s.value})})}function j(o,a=!0){s.value===o&&(s.value="",d=o,r("")),e.nextTick(()=>{h.value++,a&&(p.value=!0)})}let V;function I(o){V=o}function O(o){s.value!==o&&(d=s.value,S(o),V&&V())}function k(o){i.value.findIndex(u=>u.props.id===o.props.id)===-1&&i.value.push(o),h.value++}function H(o){i.value.findIndex(u=>u.props.id===o.props.id)!==-1&&(i.value.forEach(u=>{u.props.id===o.props.id&&(u=o)}),o.props.id===s.value&&C.value,e.nextTick(()=>{h.value++,v(l)}))}return{activeId:s,addTab:k,changeTitleStyle:v,removeTab:m,selectTab:O,tabPages:i,updateTab:H,toolbarItems:f,needUpdateNavigationLayout:h,checkActiveIdAndSelect:r,toggleShowTab:j,hasInHeadClass:C,setScrollToSelectedTabFunction:I,toolbarVisible:b}}function oe(t,n,l,c,i){const{activeId:s,removeTab:d,selectTab:p}=i,f=e.computed(()=>{const m={"st-tab-text":!0,"text-truncate":t.tabType==="pill"&&!t.autoTitleWidth,"farris-title-auto":t.autoTitleWidth};return D.getCustomClass(m,n.customTitleClass)}),b=e.computed(()=>({"nav-item":!0,"d-none":n.show!==void 0?!n.show:!1,"f-state-active":n.id===s.value,"f-state-disabled":n.disabled})),h=e.computed(()=>({width:`${n.tabWidth}px`})),C=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:n.id===s.value,disabled:n.disabled})),T=e.reactive({content:n.title,overflowShown:!0});function S(){return t.tabType!=="pill"&&!t.autoTitleWidth?e.withDirectives(e.createVNode("span",{class:f.value,"data-tabid":n.id},[n.title]),[[e.resolveDirective("tooltip"),T]]):e.createVNode("span",{class:f.value,"data-tabid":n.id,title:n.title},[n.title])}const B=e.ref(n.removeable);function r(){return B.value?e.createVNode("span",{class:"st-drop-close",onClick:m=>d(m,n.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]):""}function v(m){p(n.id),t.tabType==="one-page"&&c.scrollToByPaggId(n.id)}function x(){return l.slots.title?e.createVNode("a",{class:C.value,onClick:v,id:`${n.id}-design-item`},[l.slots.title(l),r()]):n.titleRenderFunction?e.createVNode("a",{class:C.value,onClick:v,id:`${n.id}-design-item`},[n.titleRenderFunction(),r()]):e.createVNode("a",{class:C.value,onClick:v,id:`${n.id}-design-item`},[S(),r()])}return e.createVNode("li",{class:b.value,style:h.value},[x()])}function le(t,n,l,c,i){const{shouldShowNavigationButtons:s}=l,{tabPages:d}=i,p=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":s.value})),f=e.computed(()=>({width:"100%","justify-content":t.justifyContent})),b=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:p.value,style:f.value},[e.createVNode("ul",{class:b.value,ref:n},[d.value.map(h=>oe(t,h.props,h,c,i))])])}function ae(t,n,l,c,i){const s=e.ref(),{shouldShowNavigationButtons:d}=l,{activeId:p,tabPages:f,selectTab:b}=i,h=e.ref(p.value),C=e.computed(()=>f.value.map(r=>({name:r.props.title,value:r.props.id,show:r.props.show,disabled:r.props.disabled}))),T=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":d.value})),S=e.computed(()=>({width:"100%",display:"flex","justify-content":t.justifyContent}));e.onMounted(()=>{s.value&&(n.value=s.value.$el)});function B(r){b(r)}return e.watch(()=>p.value,r=>{r!==h.value&&(h.value=r)},{immediate:!0}),()=>e.createVNode("div",{class:T.value,style:S.value},[e.createVNode(Y,{items:C.value,modelValue:h.value,"onUpdate:modelValue":r=>h.value=r,onChange:B,ref:s},null)])}function ie(t,n,l,c){const i=e.ref(),{activeId:s,removeTab:d,tabPages:p,selectTab:f}=c,{hideDropDown:b,searchTabText:h}=n,C=600;let T=null;const S=e.computed(()=>{var a,u;let o=[];return t.searchBoxVisible?o=(a=p.value)==null?void 0:a.filter(g=>g.props.title.includes(h.value)):o=(u=p.value)==null?void 0:u.slice(),o}),B=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":t.searchBoxVisible,show:!b.value,"d-none":b.value}));let r;function v(o){r=o}e.watch(b,o=>{if(r.value)if(o)i.value.style.width=null;else{const a=r.value.querySelector(".farris-tabs-header"),u=r.value.clientHeight-a.clientHeight-20,N=a.querySelector(".farris-tabs-title").clientWidth-20;i.value.style.maxWidth=N+"px",i.value.style.maxHeight=u+"px",e.nextTick(()=>{const{width:M}=i.value.getClientRects()[0];i.value.style.width=M?M+"px":null})}});function x(o){return{"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:o.props.disabled,active:o.props.id===s.value,"d-none":o.props.show!==!0}}function m(o){o.preventDefault(),o.stopPropagation()}function j(){T&&clearTimeout(T)}function V(){b.value||(T=setTimeout(()=>{b.value=!0},C))}function I(o,a){o.stopPropagation(),a.disabled||f(a.id),b.value=!0}function O(o,a){o.stopPropagation(),d(o,a,!0)}function k(o){return o.slots.title?e.createVNode("a",{class:"dropdown-title",id:`${o.props.id}-dropdown-item`},[o.slots.title(o)]):o.props.titleRenderFunction?e.createVNode("a",{class:"dropdown-title",id:`${o.props.id}-dropdown-item`},[o.props.titleRenderFunction()]):e.createVNode("a",{class:"dropdown-title",id:`${o.props.id}-dropdown-item`},[o.props.title])}function H(){return e.createVNode("div",{ref:i,class:B.value,onMouseenter:()=>j(),onMouseleave:()=>V()},[t.searchBoxVisible&&e.createVNode("div",{onClick:o=>m(o),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{type:"text",class:"form-control","onUpdate:modelValue":o=>h.value=o},null),[[e.vModelText,h.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),S.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items flex-fill"},[S.value.map(o=>e.createVNode("li",{class:x(o),onClick:a=>I(a,o.props)},[o.props.removeable&&o.props.disabled!==!0&&e.createVNode("span",{class:"float-right st-drop-close",onClick:a=>O(a,o.props.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),k(o)]))]):e.createVNode("div",{class:"dropdown-no-data"},[F.LocaleService.getLocaleValue("tabs.noData")])])}return{renderDropdownMenu:H,setTabsRef:v}}function se(t,n,l,c){const{hideDropDown:i}=n,{renderDropdownMenu:s,setTabsRef:d}=ie(t,n,l,c),p=e.ref(t.showDropdown);function f(){return p.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{i.value=!1}},null),s()])}return{renderMorePagesButtton:f,setTabsRef:d}}function re(t,n,l,c){const i=e.ref(!1),{selectTab:s,tabPages:d,needUpdateNavigationLayout:p,activeId:f}=c,b=4,h=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!i.value})),C=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!i.value})),T=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!i.value}));function S(m,j){if(!n.value)return;const V=n.value.scrollLeft,I=n.value.scrollWidth-n.value.offsetWidth;if(j>0){if(n.value.scrollLeft>=I)return;n.value.scrollLeft=V+t.scrollStep+m}else if(j<0){if(n.value.scrollLeft<=0)return;n.value.scrollLeft=V-t.scrollStep-m}}function B(m=-1){if(!i.value||!n.value)return;m<0&&(m=d.value.findIndex(k=>k.props.id===f.value));const j=t.tabType==="pills"?".f-capsule-item":".nav-item",V=n.value.querySelectorAll(j),{parentElement:I}=n.value,O=V[m];if(O&&I){const k=I.getBoundingClientRect().left,H=I.getBoundingClientRect().right,o=O.getBoundingClientRect().left,a=O.getBoundingClientRect().right;o<k?S(k-o,-1):H<a&&S(a-H,1),t.tabType==="one-page"&&l.scrollTo(m)}}function r(){var V;if(!n.value)return;const m=n.value,j=(V=n.value)==null?void 0:V.parentElement;i.value=j&&m&&j.offsetWidth<m.scrollWidth-b,i.value&&e.nextTick(()=>{B()})}function v(m){m.disabled||s(m.id)}function x(){["default","one-page"].indexOf(t.tabType)>-1&&e.nextTick(()=>{B()})}return e.watch(p,()=>{r()}),{previousButtonClass:h,nextButtonGroupClass:C,nextButtonClass:T,scrollTab:S,selectAndScrollToTab:v,shouldShowNavigationButtons:i,updateNavigationLayout:r,scrollToSelectedTab:x}}function ce(t,n){const{tabPages:l}=n,c=e.ref(""),i=e.ref(!0),s=e.computed(()=>t.searchBoxVisible),d=e.computed(()=>s.value?l.value.filter(f=>f.props.title.includes(c.value)):l.value.slice());return e.watch(i,p=>{p||(c.value="")}),{searchTabText:c,hideDropDown:i,shouldShowSearchBox:s,tabsInDropdownMenu:d}}function de(t,n,l){const c=".farris-tab-page",{tabPages:i}=l;function s(p){const f=n.value;if(f){const b=n.value.querySelectorAll(c);if(b.length>0){const h=b[p],{offsetTop:C}=h,T=C-32>0?C-32:0;f.scrollTop=T}}}function d(p){const f=i.value.findIndex(b=>b.props.id===p);f>-1&&s(f)}return{scrollTo:s,scrollToByPaggId:d}}const ue=["moz","ms","webkit"];function fe(){let t=0;return n=>{const l=new Date().getTime(),c=Math.max(0,16-(l-t)),i=setTimeout(()=>{n(l+c)},c);return t=l+c,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();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 p of l)if(p.test(t))return!1;for(const p of n)if(p.test(t))return!0;const c="ontouchstart"in window||navigator.maxTouchPoints>0,i=screen.width,s=screen.height,d=Math.min(i,s);return!!(c&&d<=768)}const R=e.defineComponent({name:"FTabs",props:E,emits:["tabChange","tabRemove","update:activeId","Click"],setup(t,n){const l=e.ref(t.tabType),c=e.shallowRef(),i=pe(),s=e.ref(t.customClass),d=e.shallowRef(),p=e.shallowRef(),f=e.ref(),b=ne(t,n,d),{activeId:h,changeTitleStyle:C,tabPages:T,addTab:S,updateTab:B,toolbarItems:r,checkActiveIdAndSelect:v,toggleShowTab:x,hasInHeadClass:m,toolbarVisible:j}=b,V=de(t,p,b),I=re(t,d,V,b),{previousButtonClass:O,nextButtonClass:k,nextButtonGroupClass:H,scrollTab:o,updateNavigationLayout:a,scrollToSelectedTab:u}=I;b.setScrollToSelectedTabFunction(u);const g=ce(t,b),N=le(t,d,I,V,b),M=N,he=ae(t,d,I,V,b),_=new Map([["default",N],["one-page",M],["pills",he]]);e.computed(()=>{const y=T.value.find(P=>P.props.id===h.value);return y==null?void 0:y.slots});const q=e.computed(()=>t.fill),z=(y,P)=>{n.emit("Click",y,P,h.value)};e.provide("tabs",{activeId:h,addTab:S,updateTab:B,tabPages:T,tabType:l,shouldFillParentContaner:q,toggleShowTab:x,toolbarVisible:j,clickToolbarItemHandler:z});let G=!1;const ve=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":m.value,"farris-tabs-inContent":!m.value,"farris-tabs-nav-fill":t.tabType==="fill","farris-tabs-nav-pills":t.tabType==="pills","d-none":t.showHeader===!1})),ge=e.computed(()=>{const y={width:m.value&&t.titleWidth?`${t.titleWidth}%`:""};return y.width&&(y.flex="unset"),y}),Te=e.computed(()=>{const y={"farris-tabs":!0,"f-tabs-content-fill":q.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 s.value&&s.value.split(" ").reduce((P,A)=>(P[A]=!0,P),y),y}),ye=new ResizeObserver(y=>{y.length&&a()});function K(){f.value&&!G&&(ye.observe(f.value),G=!0)}e.watch(()=>t.visible,y=>{e.nextTick(()=>{T.value.length&&v(t.activeId||T.value[0].props.id),a(),C(d),K()})}),e.watch(()=>t.autoTitleWidth,y=>{e.nextTick(()=>{a(),C(d)})}),e.onMounted(()=>{t.visible&&(T.value.length&&v(t.activeId||T.value[0].props.id),e.nextTick(()=>{a(),C(d)}),K())});function we(){return e.createVNode("button",{title:F.LocaleService.getLocaleValue("tabs.leftButton"),type:"button",class:O.value,onClick:()=>{o(0,-1)}},null)}function Ce(){return e.createVNode("button",{title:F.LocaleService.getLocaleValue("tabs.rightButton"),type:"button",class:k.value,onClick:()=>{o(0,1)}},null)}const{renderMorePagesButtton:xe,setTabsRef:Se}=se(t,g,I,b);Se(c);function Ve(){return r.value.length?e.createVNode("div",{class:{"farris-tabs-toolbar":!0,"d-none":!j.value}},[e.createVNode(Z,{class:"f-utils-fill",alignment:m.value?"right":"left",items:r.value,visible:j.value,onClick:z},null)]):null}const J=_.get(t.tabType)||_.get("default");function je(){var y,P,A,Q;return e.createVNode("div",{class:ve.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(P=(y=n.slots).headerPrefix)==null?void 0:P.call(y)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:ge.value,ref:f},[!i&&we(),J&&J(),e.createVNode("div",{hidden:i,class:H.value},[Ce(),xe()])]),Ve(),e.createVNode("div",{class:"farris-tabs-header-post"},[(Q=(A=n.slots).headerSuffix)==null?void 0:Q.call(A)])])}const Be=e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":q.value}));function Ie(){var y,P;return e.createVNode("div",{class:Be.value,ref:p},[(P=(y=n.slots).default)==null?void 0:P.call(y)])}return()=>t.visible?e.createVNode("div",{class:Te.value,ref:c},[je(),Ie()]):null}}),$={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 U(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const L=e.defineComponent({name:"FTabPage",props:$,emits:[],setup(t,n){const l=e.inject("tabs");D.isMobilePhone();const c=e.ref(t.show),i={slots:n.slots,props:t},s=e.ref((l==null?void 0:l.tabType.value)||"default");e.onMounted(()=>{const r=l==null?void 0:l.tabPages.value.findIndex(v=>v.props.id===t.id);(!r||r===-1)&&(l==null||l.addTab(i))}),e.onUnmounted(()=>{});const d=e.computed(()=>(t==null?void 0:t.id)===(l==null?void 0:l.activeId.value)),p=e.computed(()=>({display:d.value?"":"none"}));e.watch(()=>t,r=>{l==null||l.updateTab({props:r,slots:n.slots})},{immediate:!0,deep:!0}),e.watch(()=>t.show,r=>{l==null||l.toggleShowTab(t.id)}),e.watch(()=>t.toolbarVisible,r=>{d.value&&l&&(l.toolbarVisible.value=r)});function f(){var v,x;const r=(x=(v=n.slots).default)==null?void 0:x.call(v);return e.createVNode(W,{"main-title":t.title,class:["farris-tab-page",c.value?"":"f-tab-d-none"]},U(r)?r:{default:()=>[r]})}function b(r,v){l&&(l.activeId.value=t.id,l.clickToolbarItemHandler&&l.clickToolbarItemHandler(r,v))}function h(){var v,x;const r=(x=(v=n.slots).default)==null?void 0:x.call(v);return e.createVNode(W,{customClass:"section-in-tab is-mobile",onClick:b,visible:t.show,"main-title":t.title,buttons:t.toolbar.buttons,"button-position":t.toolbar.position||t.toolbarPosition,"buttons-visible":t.toolbarVisible},U(r)?r:{default:()=>[r]})}const C=e.computed(()=>{var v;return{"farris-tab-page":!0,"f-tab-d-none":!c.value,"f-tab-active":d.value&&l&&((v=l.shouldFillParentContaner)==null?void 0:v.value)}});function T(){var v,x;const r=(x=(v=n.slots).default)==null?void 0:x.call(v);return e.createVNode("div",{class:C.value,style:p.value},[r])}const B=new Map([["default",T],["one-page",f],["mobile",h]]).get(s.value)||T;return()=>B()}});class me 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","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:"点击事件"}],c=this,i=c.eventsEditorUtils.formProperties(n,c.viewModelId,l),s=c.createBaseEventProperty(i);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:s,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(d,p){const f=d.propertyValue;delete n[c.viewModelId],f&&(f.setPropertyRelates=this.setPropertyRelates,c.eventsEditorUtils.saveRelatedParameters(n,c.viewModelId,f.events,f))}}}}R.install=t=>{t.component(R.name,R),t.component(L.name,L)},w.FTabPage=L,w.FTabs=R,w.TabToolbarItemProperty=me,w.createTabsCallbackResolver=te,w.default=R,w.tabPageProps=$,w.tabsProps=E,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as l, computed as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { ref as l, computed as h, defineComponent as B, provide as J, watch as L, onMounted as N, createVNode as i, inject as A, compile as Q } from "vue";
|
|
2
|
+
import U from "../step/index.esm.js";
|
|
3
|
+
const X = {
|
|
4
4
|
stepClickable: { type: Boolean, default: !1 },
|
|
5
5
|
stepCls: { type: String, default: "" },
|
|
6
6
|
direction: { type: String, default: "vertical" },
|
|
@@ -12,125 +12,124 @@ const Z = {
|
|
|
12
12
|
currentStepIndex: { type: Number, default: 0 },
|
|
13
13
|
visible: { type: Boolean, default: !0 },
|
|
14
14
|
stepsData: { type: Array, default: () => [] }
|
|
15
|
-
},
|
|
16
|
-
function
|
|
17
|
-
const r = l({}),
|
|
15
|
+
}, b = Symbol("WizardContext");
|
|
16
|
+
function Y(e, t) {
|
|
17
|
+
const r = l({}), u = h(() => {
|
|
18
18
|
var a;
|
|
19
19
|
return ((a = e[t.value]) == null ? void 0 : a.id) || "";
|
|
20
20
|
});
|
|
21
|
-
function
|
|
21
|
+
function g(a) {
|
|
22
22
|
r.value = a;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function m() {
|
|
25
25
|
return r.value;
|
|
26
26
|
}
|
|
27
27
|
function f() {
|
|
28
28
|
t.value > 0 && (t.value === e.length ? t.value = t.value - 2 : t.value--);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function p() {
|
|
31
31
|
t.value < e.length && t.value++;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function c(a) {
|
|
34
34
|
t.value = a;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function z(a, d) {
|
|
37
37
|
r.value[a] = d;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function v(a) {
|
|
40
40
|
return r.value[a];
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return r.value[
|
|
44
|
-
}
|
|
45
|
-
function y() {
|
|
46
|
-
const a = e.findIndex((d) => d.id === c.value);
|
|
47
|
-
return a > 0 ? e[a - 1].id : c.value;
|
|
42
|
+
function s() {
|
|
43
|
+
return r.value[u.value];
|
|
48
44
|
}
|
|
49
45
|
function D() {
|
|
50
|
-
const a = e.findIndex((d) => d.id ===
|
|
51
|
-
return a
|
|
46
|
+
const a = e.findIndex((d) => d.id === u.value);
|
|
47
|
+
return a > 0 ? e[a - 1].id : u.value;
|
|
52
48
|
}
|
|
53
|
-
function I(
|
|
54
|
-
const
|
|
55
|
-
return
|
|
49
|
+
function I() {
|
|
50
|
+
const a = e.findIndex((d) => d.id === u.value);
|
|
51
|
+
return a < e.length ? e[a + 1].id : u.value;
|
|
56
52
|
}
|
|
57
53
|
function w(a) {
|
|
58
|
-
const d = e.findIndex((
|
|
54
|
+
const d = e.findIndex((o) => o.id === a);
|
|
55
|
+
return d > 0 ? r.value[e[d - 1].id] : r.value[a];
|
|
56
|
+
}
|
|
57
|
+
function y(a) {
|
|
58
|
+
const d = e.findIndex((o) => o.id === a);
|
|
59
59
|
return d < e.length ? r.value[e[d + 1].id] : r.value[a];
|
|
60
60
|
}
|
|
61
61
|
return {
|
|
62
|
-
currentPageId:
|
|
62
|
+
currentPageId: u,
|
|
63
63
|
currentStepIndex: t,
|
|
64
64
|
wizardData: r,
|
|
65
|
-
setWizardData:
|
|
66
|
-
getWizardData:
|
|
65
|
+
setWizardData: g,
|
|
66
|
+
getWizardData: m,
|
|
67
67
|
// gotoPreviousPage,
|
|
68
68
|
// gotoNextPage,
|
|
69
69
|
gotoPreviousStep: f,
|
|
70
|
-
gotoNextStep:
|
|
71
|
-
setCurrentStep:
|
|
72
|
-
setDataByPageId:
|
|
73
|
-
getDataByPageId:
|
|
74
|
-
getCurrentPageData:
|
|
75
|
-
getPreviousPageDataByPageId:
|
|
76
|
-
getNextPageDataByPageId:
|
|
77
|
-
getPreviousPageId:
|
|
78
|
-
getNextPageId:
|
|
70
|
+
gotoNextStep: p,
|
|
71
|
+
setCurrentStep: c,
|
|
72
|
+
setDataByPageId: z,
|
|
73
|
+
getDataByPageId: v,
|
|
74
|
+
getCurrentPageData: s,
|
|
75
|
+
getPreviousPageDataByPageId: w,
|
|
76
|
+
getNextPageDataByPageId: y,
|
|
77
|
+
getPreviousPageId: D,
|
|
78
|
+
getNextPageId: I
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const C = /* @__PURE__ */ B({
|
|
82
82
|
name: "FWizard",
|
|
83
|
-
props:
|
|
83
|
+
props: X,
|
|
84
84
|
emits: ["stateChange", "update:currentPageId"],
|
|
85
85
|
setup(e, {
|
|
86
86
|
slots: t,
|
|
87
87
|
emit: r,
|
|
88
|
-
expose:
|
|
88
|
+
expose: u
|
|
89
89
|
}) {
|
|
90
|
-
const
|
|
91
|
-
currentStepIndex:
|
|
92
|
-
currentPageId:
|
|
90
|
+
const g = l(null), m = l(null), f = l(null), p = l(null), c = l([]), z = l(e.currentStepIndex), {
|
|
91
|
+
currentStepIndex: v,
|
|
92
|
+
currentPageId: s,
|
|
93
93
|
wizardData: D,
|
|
94
94
|
setDataByPageId: I,
|
|
95
95
|
gotoNextStep: w,
|
|
96
|
-
gotoPreviousStep:
|
|
96
|
+
gotoPreviousStep: y,
|
|
97
97
|
// gotoNextPage,
|
|
98
98
|
// gotoPreviousPage,
|
|
99
|
-
getDataByPageId:
|
|
100
|
-
getPreviousPageDataByPageId:
|
|
101
|
-
getNextPageDataByPageId:
|
|
102
|
-
getPreviousPageId:
|
|
103
|
-
getNextPageId:
|
|
104
|
-
getCurrentPageData:
|
|
105
|
-
} =
|
|
99
|
+
getDataByPageId: a,
|
|
100
|
+
getPreviousPageDataByPageId: d,
|
|
101
|
+
getNextPageDataByPageId: o,
|
|
102
|
+
getPreviousPageId: W,
|
|
103
|
+
getNextPageId: F,
|
|
104
|
+
getCurrentPageData: k
|
|
105
|
+
} = Y(e.stepsData, z), V = h(() => ({
|
|
106
106
|
"f-component-wizard-fill": e.fill,
|
|
107
107
|
"f-component-wizard": !0
|
|
108
108
|
}));
|
|
109
|
-
function
|
|
110
|
-
|
|
109
|
+
function K(n) {
|
|
110
|
+
z.value = n;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
s.value = n;
|
|
112
|
+
function H(n) {
|
|
114
113
|
}
|
|
115
|
-
|
|
116
|
-
wizardPageList:
|
|
114
|
+
J(b, {
|
|
115
|
+
wizardPageList: c,
|
|
117
116
|
wizardProps: e,
|
|
118
|
-
activeIndex:
|
|
119
|
-
activeId:
|
|
120
|
-
updateCurrentPageId:
|
|
117
|
+
activeIndex: v,
|
|
118
|
+
activeId: s,
|
|
119
|
+
updateCurrentPageId: H,
|
|
121
120
|
// gotoNextPage,
|
|
122
121
|
// gotoPreviousPage,
|
|
123
122
|
gotoNextStep: w,
|
|
124
|
-
gotoPreviousStep:
|
|
123
|
+
gotoPreviousStep: y,
|
|
125
124
|
setDataByPageId: I,
|
|
126
|
-
getNextPageDataByPageId:
|
|
127
|
-
getPreviousPageDataByPageId:
|
|
128
|
-
getPreviousPageId:
|
|
129
|
-
getNextPageId:
|
|
130
|
-
getDataByPageId:
|
|
131
|
-
getCurrentPageData:
|
|
125
|
+
getNextPageDataByPageId: o,
|
|
126
|
+
getPreviousPageDataByPageId: d,
|
|
127
|
+
getPreviousPageId: W,
|
|
128
|
+
getNextPageId: F,
|
|
129
|
+
getDataByPageId: a,
|
|
130
|
+
getCurrentPageData: k
|
|
132
131
|
});
|
|
133
|
-
function
|
|
132
|
+
function M() {
|
|
134
133
|
let n = "";
|
|
135
134
|
switch (e.stepPosition) {
|
|
136
135
|
case "Top":
|
|
@@ -156,173 +155,171 @@ const B = /* @__PURE__ */ N({
|
|
|
156
155
|
function x(n) {
|
|
157
156
|
return e.stepPosition === n;
|
|
158
157
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}), b(() => {
|
|
164
|
-
!s.value && o.value.length > 0 && (h(o.value[0]), L(0));
|
|
158
|
+
L(() => e.currentPageId, (n, P) => {
|
|
159
|
+
}), L(() => e.currentStepIndex, (n, P) => {
|
|
160
|
+
n !== P && K(n);
|
|
161
|
+
}), N(() => {
|
|
165
162
|
});
|
|
166
|
-
function
|
|
163
|
+
function S() {
|
|
167
164
|
return i("div", {
|
|
168
165
|
class: "f-wizard-step"
|
|
169
|
-
}, [i(
|
|
170
|
-
ref:
|
|
171
|
-
activeIndex:
|
|
166
|
+
}, [i(U, {
|
|
167
|
+
ref: p,
|
|
168
|
+
activeIndex: v.value,
|
|
172
169
|
steps: e.stepsData,
|
|
173
170
|
direction: e.direction,
|
|
174
171
|
clickable: e.stepClickable
|
|
175
172
|
}, {
|
|
176
173
|
default: () => [t.stepTemplate && {
|
|
177
174
|
stepTemplate: (n) => {
|
|
178
|
-
var
|
|
175
|
+
var R;
|
|
179
176
|
const {
|
|
180
|
-
step:
|
|
177
|
+
step: P,
|
|
181
178
|
index: T,
|
|
182
|
-
length:
|
|
183
|
-
activeIndex:
|
|
184
|
-
direction:
|
|
179
|
+
length: q,
|
|
180
|
+
activeIndex: E,
|
|
181
|
+
direction: G
|
|
185
182
|
} = n;
|
|
186
|
-
return (
|
|
187
|
-
step:
|
|
183
|
+
return (R = t.stepTemplate) == null ? void 0 : R.call(t, {
|
|
184
|
+
step: P,
|
|
188
185
|
index: T,
|
|
189
|
-
length:
|
|
190
|
-
activeIndex:
|
|
191
|
-
direction:
|
|
186
|
+
length: q,
|
|
187
|
+
activeIndex: E,
|
|
188
|
+
direction: G
|
|
192
189
|
});
|
|
193
190
|
}
|
|
194
191
|
}]
|
|
195
192
|
})]);
|
|
196
193
|
}
|
|
197
|
-
return
|
|
194
|
+
return u({
|
|
198
195
|
setDataByPageId: I,
|
|
199
|
-
updateCurrentPageId:
|
|
196
|
+
updateCurrentPageId: H,
|
|
200
197
|
// gotoNextPage,
|
|
201
198
|
// gotoPreviousPage,
|
|
202
199
|
gotoNextStep: w,
|
|
203
|
-
gotoPreviousStep:
|
|
204
|
-
getNextPageDataByPageId:
|
|
205
|
-
getPreviousPageDataByPageId:
|
|
206
|
-
getPreviousPageId:
|
|
207
|
-
getNextPageId:
|
|
208
|
-
getDataByPageId:
|
|
209
|
-
getCurrentPageData:
|
|
200
|
+
gotoPreviousStep: y,
|
|
201
|
+
getNextPageDataByPageId: o,
|
|
202
|
+
getPreviousPageDataByPageId: d,
|
|
203
|
+
getPreviousPageId: W,
|
|
204
|
+
getNextPageId: F,
|
|
205
|
+
getDataByPageId: a,
|
|
206
|
+
getCurrentPageData: k,
|
|
210
207
|
cancel: () => {
|
|
211
208
|
},
|
|
212
209
|
finish: () => {
|
|
213
210
|
}
|
|
214
211
|
}), () => {
|
|
215
|
-
var n,
|
|
212
|
+
var n, P, T;
|
|
216
213
|
return e.visible && i("div", {
|
|
217
|
-
class:
|
|
214
|
+
class: V.value
|
|
218
215
|
}, [i("div", {
|
|
219
|
-
ref:
|
|
220
|
-
class:
|
|
216
|
+
ref: m,
|
|
217
|
+
class: M()
|
|
221
218
|
}, [x("Top") && ((n = t.wizardStepTemplate) == null ? void 0 : n.call(t)), x("None") && i("div", {
|
|
222
219
|
class: "d-none"
|
|
223
|
-
}, [
|
|
220
|
+
}, [S()]), (t.wizardHeader || x("HeaderRight")) && i("div", {
|
|
224
221
|
class: "f-wizard-header",
|
|
225
|
-
ref:
|
|
226
|
-
}, [(
|
|
222
|
+
ref: g
|
|
223
|
+
}, [(P = t.wizardHeader) == null ? void 0 : P.call(t), x("HeaderRight") && S()]), i("div", {
|
|
227
224
|
class: "f-wizard-content",
|
|
228
225
|
ref: f
|
|
229
|
-
}, [x("PageLeft") &&
|
|
226
|
+
}, [x("PageLeft") && S(), i("div", {
|
|
230
227
|
class: "f-wizard-pages"
|
|
231
228
|
}, [(T = t.default) == null ? void 0 : T.call(t)])])])]);
|
|
232
229
|
};
|
|
233
230
|
}
|
|
234
|
-
}),
|
|
231
|
+
}), Z = {
|
|
235
232
|
pageId: { type: String, default: "" },
|
|
236
233
|
active: { type: Boolean, default: !1 }
|
|
237
|
-
},
|
|
234
|
+
}, j = /* @__PURE__ */ B({
|
|
238
235
|
name: "FWizardPage",
|
|
239
|
-
props:
|
|
236
|
+
props: Z,
|
|
240
237
|
emits: ["pageSelected"],
|
|
241
238
|
setup(e, {
|
|
242
239
|
slots: t
|
|
243
240
|
}) {
|
|
244
241
|
const {
|
|
245
242
|
wizardPageList: r,
|
|
246
|
-
activeId:
|
|
247
|
-
wizardProps:
|
|
248
|
-
activeIndex:
|
|
249
|
-
} =
|
|
243
|
+
activeId: u,
|
|
244
|
+
wizardProps: g,
|
|
245
|
+
activeIndex: m
|
|
246
|
+
} = A(b, {
|
|
250
247
|
activeId: l(""),
|
|
251
|
-
activeIndex: l(
|
|
248
|
+
activeIndex: l(1),
|
|
252
249
|
wizardPageList: l([]),
|
|
253
250
|
wizardProps: {}
|
|
254
|
-
}), f =
|
|
255
|
-
var
|
|
256
|
-
return ((
|
|
257
|
-
}),
|
|
251
|
+
}), f = h(() => {
|
|
252
|
+
var c;
|
|
253
|
+
return ((c = g.stepsData[m.value]) == null ? void 0 : c.id) === e.pageId;
|
|
254
|
+
}), p = h(() => ({
|
|
258
255
|
"f-component-wizard-page": !0,
|
|
259
256
|
active: f.value
|
|
260
257
|
}));
|
|
261
|
-
return
|
|
258
|
+
return N(() => {
|
|
262
259
|
r.value.includes(e.pageId) || r.value.push(e.pageId);
|
|
263
260
|
}), () => {
|
|
264
|
-
var
|
|
261
|
+
var c;
|
|
265
262
|
return f.value && i("div", {
|
|
266
|
-
class:
|
|
267
|
-
}, [(
|
|
263
|
+
class: p.value
|
|
264
|
+
}, [(c = t.default) == null ? void 0 : c.call(t)]);
|
|
268
265
|
};
|
|
269
266
|
}
|
|
270
|
-
}),
|
|
267
|
+
}), _ = {
|
|
271
268
|
// 头部模板
|
|
272
269
|
headerTemplate: { type: Object },
|
|
273
270
|
// 内容模板
|
|
274
271
|
contentTemplate: { type: Object },
|
|
275
272
|
// 底部模板
|
|
276
273
|
footerTemplate: { type: Object }
|
|
277
|
-
},
|
|
274
|
+
}, O = /* @__PURE__ */ B({
|
|
278
275
|
name: "FWizardPageDetail",
|
|
279
|
-
props:
|
|
276
|
+
props: _,
|
|
280
277
|
emits: ["pagedetailSelected"],
|
|
281
278
|
setup(e, {
|
|
282
279
|
slots: t,
|
|
283
280
|
expose: r,
|
|
284
|
-
emit:
|
|
281
|
+
emit: u
|
|
285
282
|
}) {
|
|
286
|
-
const
|
|
287
|
-
wizardProps:
|
|
283
|
+
const g = A(b, null), {
|
|
284
|
+
wizardProps: m,
|
|
288
285
|
gotoNextPage: f,
|
|
289
|
-
gotoPreviousPage:
|
|
290
|
-
gotoNextStep:
|
|
291
|
-
gotoPreviousStep:
|
|
292
|
-
setDataByPageId:
|
|
293
|
-
activeId:
|
|
294
|
-
getPreviousPageId:
|
|
295
|
-
getNextPageId:
|
|
296
|
-
getDataByPageId:
|
|
297
|
-
getCurrentPageData:
|
|
298
|
-
} =
|
|
299
|
-
function a(
|
|
300
|
-
|
|
286
|
+
gotoPreviousPage: p,
|
|
287
|
+
gotoNextStep: c,
|
|
288
|
+
gotoPreviousStep: z,
|
|
289
|
+
setDataByPageId: v,
|
|
290
|
+
activeId: s,
|
|
291
|
+
getPreviousPageId: D,
|
|
292
|
+
getNextPageId: I,
|
|
293
|
+
getDataByPageId: w,
|
|
294
|
+
getCurrentPageData: y
|
|
295
|
+
} = g;
|
|
296
|
+
function a(o) {
|
|
297
|
+
v(s.value, o);
|
|
301
298
|
}
|
|
302
299
|
function d() {
|
|
303
300
|
if (typeof e.footerTemplate == "string") {
|
|
304
|
-
const
|
|
301
|
+
const o = Q(e.footerTemplate);
|
|
305
302
|
return i({
|
|
306
|
-
render:
|
|
303
|
+
render: o
|
|
307
304
|
});
|
|
308
305
|
}
|
|
309
306
|
return e.footerTemplate();
|
|
310
307
|
}
|
|
311
|
-
return
|
|
312
|
-
|
|
308
|
+
return N(() => {
|
|
309
|
+
u("pagedetailSelected", s.value);
|
|
313
310
|
}), r({
|
|
314
311
|
gotoNextPage: f,
|
|
315
|
-
gotoPreviousPage:
|
|
316
|
-
gotoNextStep:
|
|
317
|
-
gotoPreviousStep:
|
|
318
|
-
setDataByPageId:
|
|
319
|
-
getPreviousPageId:
|
|
320
|
-
getNextPageId:
|
|
312
|
+
gotoPreviousPage: p,
|
|
313
|
+
gotoNextStep: c,
|
|
314
|
+
gotoPreviousStep: z,
|
|
315
|
+
setDataByPageId: v,
|
|
316
|
+
getPreviousPageId: D,
|
|
317
|
+
getNextPageId: I,
|
|
321
318
|
setPageData: a,
|
|
322
|
-
getCurrentPageData:
|
|
323
|
-
getDataByPageId:
|
|
319
|
+
getCurrentPageData: y,
|
|
320
|
+
getDataByPageId: w
|
|
324
321
|
}), () => {
|
|
325
|
-
var
|
|
322
|
+
var o;
|
|
326
323
|
return i("div", {
|
|
327
324
|
class: "f-component-wizard-page-detail f-component-wizard-page-detail-fill"
|
|
328
325
|
}, [e.headerTemplate ? i("div", {
|
|
@@ -333,7 +330,7 @@ const B = /* @__PURE__ */ N({
|
|
|
333
330
|
class: "f-component-wizard-page-detail-content"
|
|
334
331
|
}, [e.contentTemplate()]) : t.contentTemplate ? i("div", {
|
|
335
332
|
class: "f-component-wizard-page-detail-content"
|
|
336
|
-
}, [t.contentTemplate()]) : (
|
|
333
|
+
}, [t.contentTemplate()]) : (o = t.default) == null ? void 0 : o.call(t), e.footerTemplate ? i("div", {
|
|
337
334
|
class: "f-component-wizard-page-detail-footer"
|
|
338
335
|
}, [d()]) : t.footerTemplate && i("div", {
|
|
339
336
|
class: "f-component-wizard-page-detail-footer"
|
|
@@ -341,16 +338,16 @@ const B = /* @__PURE__ */ N({
|
|
|
341
338
|
};
|
|
342
339
|
}
|
|
343
340
|
});
|
|
344
|
-
|
|
345
|
-
e.component(
|
|
341
|
+
C.install = (e) => {
|
|
342
|
+
e.component(C.name, C).component(j.name, j).component(O.name, O);
|
|
346
343
|
};
|
|
347
344
|
export {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
345
|
+
C as FWizard,
|
|
346
|
+
j as FWizardPage,
|
|
347
|
+
O as FWizardPageDetail,
|
|
348
|
+
C as default,
|
|
349
|
+
_ as pageDetailProps,
|
|
350
|
+
Y as useWizard,
|
|
351
|
+
Z as wizardPageProps,
|
|
352
|
+
X as wizardProps
|
|
356
353
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../step/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../step/index.umd.js"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.wizard={},o.Vue,o.FStep))})(this,function(o,e,
|
|
1
|
+
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../step/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../step/index.umd.js"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.wizard={},o.Vue,o.FStep))})(this,function(o,e,M){"use strict";const W={stepClickable:{type:Boolean,default:!1},stepCls:{type:String,default:""},direction:{type:String,default:"vertical"},stepPosition:{type:String,default:"None"},fill:{type:Boolean,default:!0},storedIndex:{type:Boolean,default:!1},storedIndexState:{type:Boolean,default:!1},currentPageId:{type:String,default:""},currentStepIndex:{type:Number,default:0},visible:{type:Boolean,default:!0},stepsData:{type:Array,default:()=>[]}},S=Symbol("WizardContext");function B(t,a){const d=e.ref({}),l=e.computed(()=>{var n;return((n=t[a.value])==null?void 0:n.id)||""});function g(n){d.value=n}function z(){return d.value}function u(){a.value>0&&(a.value===t.length?a.value=a.value-2:a.value--)}function p(){a.value<t.length&&a.value++}function f(n){a.value=n}function s(n,r){d.value[n]=r}function P(n){return d.value[n]}function w(){return d.value[l.value]}function D(){const n=t.findIndex(r=>r.id===l.value);return n>0?t[n-1].id:l.value}function I(){const n=t.findIndex(r=>r.id===l.value);return n<t.length?t[n+1].id:l.value}function v(n){const r=t.findIndex(c=>c.id===n);return r>0?d.value[t[r-1].id]:d.value[n]}function y(n){const r=t.findIndex(c=>c.id===n);return r<t.length?d.value[t[r+1].id]:d.value[n]}return{currentPageId:l,currentStepIndex:a,wizardData:d,setWizardData:g,getWizardData:z,gotoPreviousStep:u,gotoNextStep:p,setCurrentStep:f,setDataByPageId:s,getDataByPageId:P,getCurrentPageData:w,getPreviousPageDataByPageId:v,getNextPageDataByPageId:y,getPreviousPageId:D,getNextPageId:I}}const N=e.defineComponent({name:"FWizard",props:W,emits:["stateChange","update:currentPageId"],setup(t,{slots:a,emit:d,expose:l}){const g=e.ref(null),z=e.ref(null),u=e.ref(null),p=e.ref(null),f=e.ref([]),s=e.ref(t.currentStepIndex),{currentStepIndex:P,currentPageId:w,wizardData:D,setDataByPageId:I,gotoNextStep:v,gotoPreviousStep:y,getDataByPageId:n,getPreviousPageDataByPageId:r,getNextPageDataByPageId:c,getPreviousPageId:j,getNextPageId:k,getCurrentPageData:H}=B(t.stepsData,s),O=e.computed(()=>({"f-component-wizard-fill":t.fill,"f-component-wizard":!0}));function q(i){s.value=i}function R(i){}e.provide(S,{wizardPageList:f,wizardProps:t,activeIndex:P,activeId:w,updateCurrentPageId:R,gotoNextStep:v,gotoPreviousStep:y,setDataByPageId:I,getNextPageDataByPageId:c,getPreviousPageDataByPageId:r,getPreviousPageId:j,getNextPageId:k,getDataByPageId:n,getCurrentPageData:H});function A(){let i="";switch(t.stepPosition){case"Top":i="f-component-wizard-step-top";break;case"HeaderRight":i="f-component-wizard-step-headerright";break;case"PageLeft":i="f-component-wizard-step-pageleft";break;case"None":i="f-component-wizard-step-none";break;default:i=""}return{[i]:!!i,"f-wizard":!0}}function h(i){return t.stepPosition===i}e.watch(()=>t.currentPageId,(i,m)=>{}),e.watch(()=>t.currentStepIndex,(i,m)=>{i!==m&&q(i)}),e.onMounted(()=>{});function V(){return e.createVNode("div",{class:"f-wizard-step"},[e.createVNode(M,{ref:p,activeIndex:P.value,steps:t.stepsData,direction:t.direction,clickable:t.stepClickable},{default:()=>[a.stepTemplate&&{stepTemplate:i=>{var L;const{step:m,index:T,length:_,activeIndex:K,direction:E}=i;return(L=a.stepTemplate)==null?void 0:L.call(a,{step:m,index:T,length:_,activeIndex:K,direction:E})}}]})])}return l({setDataByPageId:I,updateCurrentPageId:R,gotoNextStep:v,gotoPreviousStep:y,getNextPageDataByPageId:c,getPreviousPageDataByPageId:r,getPreviousPageId:j,getNextPageId:k,getDataByPageId:n,getCurrentPageData:H,cancel:()=>{},finish:()=>{}}),()=>{var i,m,T;return t.visible&&e.createVNode("div",{class:O.value},[e.createVNode("div",{ref:z,class:A()},[h("Top")&&((i=a.wizardStepTemplate)==null?void 0:i.call(a)),h("None")&&e.createVNode("div",{class:"d-none"},[V()]),(a.wizardHeader||h("HeaderRight"))&&e.createVNode("div",{class:"f-wizard-header",ref:g},[(m=a.wizardHeader)==null?void 0:m.call(a),h("HeaderRight")&&V()]),e.createVNode("div",{class:"f-wizard-content",ref:u},[h("PageLeft")&&V(),e.createVNode("div",{class:"f-wizard-pages"},[(T=a.default)==null?void 0:T.call(a)])])])])}}}),b={pageId:{type:String,default:""},active:{type:Boolean,default:!1}},x=e.defineComponent({name:"FWizardPage",props:b,emits:["pageSelected"],setup(t,{slots:a}){const{wizardPageList:d,activeId:l,wizardProps:g,activeIndex:z}=e.inject(S,{activeId:e.ref(""),activeIndex:e.ref(1),wizardPageList:e.ref([]),wizardProps:{}}),u=e.computed(()=>{var f;return((f=g.stepsData[z.value])==null?void 0:f.id)===t.pageId}),p=e.computed(()=>({"f-component-wizard-page":!0,active:u.value}));return e.onMounted(()=>{d.value.includes(t.pageId)||d.value.push(t.pageId)}),()=>{var f;return u.value&&e.createVNode("div",{class:p.value},[(f=a.default)==null?void 0:f.call(a)])}}}),F={headerTemplate:{type:Object},contentTemplate:{type:Object},footerTemplate:{type:Object}},C=e.defineComponent({name:"FWizardPageDetail",props:F,emits:["pagedetailSelected"],setup(t,{slots:a,expose:d,emit:l}){const g=e.inject(S,null),{wizardProps:z,gotoNextPage:u,gotoPreviousPage:p,gotoNextStep:f,gotoPreviousStep:s,setDataByPageId:P,activeId:w,getPreviousPageId:D,getNextPageId:I,getDataByPageId:v,getCurrentPageData:y}=g;function n(c){P(w.value,c)}function r(){if(typeof t.footerTemplate=="string"){const c=e.compile(t.footerTemplate);return e.createVNode({render:c})}return t.footerTemplate()}return e.onMounted(()=>{l("pagedetailSelected",w.value)}),d({gotoNextPage:u,gotoPreviousPage:p,gotoNextStep:f,gotoPreviousStep:s,setDataByPageId:P,getPreviousPageId:D,getNextPageId:I,setPageData:n,getCurrentPageData:y,getDataByPageId:v}),()=>{var c;return e.createVNode("div",{class:"f-component-wizard-page-detail f-component-wizard-page-detail-fill"},[t.headerTemplate?e.createVNode("div",{class:"f-component-wizard-page-detail-header"},[t.headerTemplate()]):a.headerTemplate&&e.createVNode("div",{class:"f-component-wizard-page-detail-header"},[a.headerTemplate()]),t.contentTemplate?e.createVNode("div",{class:"f-component-wizard-page-detail-content"},[t.contentTemplate()]):a.contentTemplate?e.createVNode("div",{class:"f-component-wizard-page-detail-content"},[a.contentTemplate()]):(c=a.default)==null?void 0:c.call(a),t.footerTemplate?e.createVNode("div",{class:"f-component-wizard-page-detail-footer"},[r()]):a.footerTemplate&&e.createVNode("div",{class:"f-component-wizard-page-detail-footer"},[a.footerTemplate()])])}}});N.install=t=>{t.component(N.name,N).component(x.name,x).component(C.name,C)},o.FWizard=N,o.FWizardPage=x,o.FWizardPageDetail=C,o.default=N,o.pageDetailProps=F,o.useWizard=B,o.wizardPageProps=b,o.wizardProps=W,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|