@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(z,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../locale/index.umd.js"),require("../common/index.umd.js"),require("lodash-es"),require("../property-panel/index.umd.js"),require("../button/index.umd.js"),require("../field-selector/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../locale/index.umd.js","../common/index.umd.js","lodash-es","../property-panel/index.umd.js","../button/index.umd.js","../field-selector/index.umd.js"],e):(z=typeof globalThis<"u"?globalThis:z||self,e(z["message-box"]={},z.Vue,z.locale,z.common,z.LodashES))})(this,function(z,e,D,_,fe){"use strict";var nt=Object.defineProperty;var lt=(z,e,D)=>e in z?nt(z,e,{enumerable:!0,configurable:!0,writable:!0,value:D}):z[e]=D;var q=(z,e,D)=>lt(z,typeof e!="symbol"?e+"":e,D);const oe={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},showOkButton:{Type:Boolean,default:!0},showCancelButton:{Type:Boolean,default:!0},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function ee(){return new DOMException("The request is not allowed","NotAllowedError")}async function he(t){if(!navigator.clipboard)throw ee();return navigator.clipboard.writeText(t)}async function me(t){const a=document.createElement("span");a.textContent=t,a.style.whiteSpace="pre",a.style.webkitUserSelect="auto",a.style.userSelect="all",document.body.appendChild(a);const l=window.getSelection(),n=window.document.createRange();l==null||l.removeAllRanges(),n.selectNode(a),l==null||l.addRange(n);let r=!1;try{r=window.document.execCommand("copy")}finally{l==null||l.removeAllRanges(),window.document.body.removeChild(a)}if(!r)throw ee()}async function ge(t){try{await he(t)}catch(a){try{await me(t)}catch(l){throw l||a||ee()}}}function ve(){async function t(a){await ge(a)}return{onCopy:t}}function pe(t,a,l,n){const r=e.ref(14),d=e.ref(140),c=e.ref(""),i=e.ref(n.value.length),s=e.computed(()=>n.value),m=e.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function y(g){if(g.currentTarget){const N=g.currentTarget.value||"";i.value=N.length}}return()=>e.createVNode(e.Fragment,null,[e.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:m.value,rows:"4",maxlength:d.value,onInput:g=>y(g)},[s.value]),e.createVNode("span",{class:"textarea-wordcount",title:c.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[i.value+" / "+d.value])])}function ye(t,a,l,n){const r=pe(t,a,l,n),d=new Map([["text-area",r]]);function c(i){return d.get(i)||null}return{getEditorRender:c}}function we(){const t=e.ref(!1),a=e.ref("复制成功");return{feedbackStyle:e.computed(()=>{const n={position:"absolute",left:"50%",top:"50%","min-width":"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease",padding:"0 10px"};return n.opacity=t.value?"0.8":"0",n.display=t.value?"":"none",n}),feedbackMessage:a,toShowFeedback:t}}function xe(t,a){const l=a.getEditorRender(t.promptEditorType);return()=>l&&l()}function be(t,a){function l(p){if(p==null)return 0;let M=0;for(let S=0;S<p.length;S++){const B=p.charCodeAt(S);B>=0&&B<=128?M++:M=M+2}return M}function n(p,M){if(p!==""&&p!==void 0&&p!==null){p=""+p;const S=p.length;let B="",k=0;for(let w=0;w<S;w++){const F=p.charAt(w);if(k++,encodeURI(F).length>4&&k++,B=B.concat(F),k>=M)return B=B.concat("..."),B}if(k<M)return p}return""}const r=e.computed(()=>!!t.value&&!!t.value.date),d=e.computed(()=>{const p=t.value&&t.value.date||"";return`${a.exception.happend} : ${p}`}),c=e.computed(()=>!!t.value&&!!t.value.detail),i=e.computed(()=>t.value?l(t.value.detail)>160:!1),s=e.ref(!1),m=e.computed(()=>s.value?a.exception.collapse:a.exception.expand),y=e.computed(()=>{const p=a.exception.detail+" : "+(t.value&&t.value.detail)||"";return s.value?p:n(p,160)}),g=e.computed(()=>({bottom:s.value?0:"2px"}));function N(){s.value=!s.value}return()=>e.createVNode("div",{class:"toast-msg-detail",style:"max-height: calc(100vh - 200px);overflow: auto;"},[r.value&&e.createVNode("div",null,[d.value]),c.value&&e.createVNode("div",{class:"exception_wrap"},[e.createVNode("div",{class:"exception_error_msg"},[e.createVNode("div",{innerHTML:y.value},null),i.value&&e.createVNode("span",{class:"exception_toggle_detail",style:g.value,onClick:N},[m.value])])])])}function Ce(t){return()=>e.createVNode("p",{class:"toast-msg-detail",innerHTML:t.value,style:"max-height: calc(100vh - 200px);overflow: auto;"},null)}function Me(t,a,l,n,r){const d=e.ref(t.exceptionInfo),c=e.computed(()=>{const M=a.value==="question"?"warning":a.value,S={"f-icon":!0},B=`f-icon-${M}`;return S[B]=!0,S}),i=e.computed(()=>l.value||d.value&&d.value.message),s=e.computed(()=>n.value),m=e.computed(()=>!!n.value),y=e.computed(()=>!!d.value);function g(){return y.value?be(d,r):m.value?Ce(s):()=>null}const N=g(),p=e.computed(()=>r.locale==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"float-left modal-tips-iconwrap"},[e.createVNode("span",{class:c.value},null)]),e.createVNode("div",{class:"modal-tips-content"},[e.createVNode("p",{class:"toast-msg-title",innerHTML:i.value,style:p.value},null),N()])])}function Be(t,a,l,n){const{onCopy:r}=a,{toShowFeedback:d}=l,c=e.ref(n.exception.copySuccess||"复制成功"),i=e.ref(n.exception.copy||"复制详细信息"),s=e.ref(t.exceptionInfo||{date:"",message:"",detail:""}),m=e.computed(()=>s.value&&s.value.detail||"");function y(g){r(m.value).catch(N=>{c.value=n.exception.copyFailed||"复制失败"}).finally(()=>{d.value=!0,setTimeout(()=>{d.value=!1},700)})}return()=>e.createVNode("span",{class:"copy-exception-info"},[e.createVNode("span",{onClick:y,style:"cursor: pointer;"},[i.value])])}function ke(t,a,l,n,r){const d=e.ref(t.type),c=e.ref(t.buttons),i=e.ref(t.exceptionInfo),s=e.ref(r.ok||t.okButtonText),m=e.ref(r.cancel||t.cancelButtonText),y=e.ref(t.showCancelButton),g=e.ref(t.showOkButton),N=e.computed(()=>!!(c.value&&c.value.length)),p=e.computed(()=>!!(i.value&&i.value.detail)),M=e.computed(()=>!(c.value&&c.value.length)&&(g.value||y.value)),S=Be(t,l,n,r);s.value==="关闭"?s.value=r.close:s.value==="知道了"&&(s.value=r.exception.roger);function B(w){d.value==="question"&&a.emit("reject"),a.emit("close")}function k(w){d.value==="question"&&a.emit("accept"),a.emit("close")}return()=>e.createVNode("div",{class:"modal-footer"},[p.value&&S(),M.value&&y.value&&e.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:B},[m.value]),M.value&&g.value&&e.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:k},[s.value]),N.value&&c.value.length&&c.value.map(w=>e.createVNode("button",{type:"button",onClick:w.handle,class:w.class},[w.iconClass&&e.createVNode("span",{class:w.iconClass},null),w.text]))])}function Te(t){const{getLocaleValue:a}=D.LocaleService,l=D.LocaleService.getLocale();function n(r,d,c){return d===c?a(r):d}return{yes:n("messageBox.yes")||"是",no:n("messageBox.no")||"否",close:n("messageBox.close")||"关闭",ok:n("messageBox.ok",t.okButtonText,"确定")||"确定",cancel:n("messageBox.cancel",t.cancelButtonText,"取消")||"取消",title:n("messageBox.title")||"系统提示",errorTitle:n("messageBox.errorTitle")||"错误提示",exception:{expand:n("messageBox.exception.expand")||"展开",collapse:n("messageBox.exception.collapse")||"收起",happend:n("messageBox.exception.happend")||"发生时间",detail:n("messageBox.exception.detail")||"详细信息",copy:n("messageBox.exception.copy")||"复制详细信息",copySuccess:n("messageBox.exception.copySuccess")||"复制成功",copyFailed:n("messageBox.exception.copyFailed")||"复制失败",roger:n("messageBox.exception.roger")||"知道了"},locale:l}}const X=e.defineComponent({name:"FMessageBox",props:oe,emits:["accept","reject","close"],setup(t,a){const l=Te(t),n=e.ref(t.type),r=e.ref(t.title),d=e.ref(t.detail),c=e.computed(()=>{const k={"modal-tips":!0,"d-flex":!0,"flex-row":!0},w=`messager-type-${n.value}`;return k[w]=!0,k}),i=e.computed(()=>{const k={cursor:"default"};return n.value==="prompt"?k.padding="0.5rem 0.5rem 1rem 1.5rem":n.value==="error"&&(k.padding="0.5rem 1.5rem 1rem 1.5rem"),k}),s=ve(),m=ye(t,n,r,d),y=we(),{feedbackStyle:g,feedbackMessage:N}=y;N.value=l.exception.copySuccess;function p(){return e.createVNode("div",{style:g.value},[N.value])}function M(){switch(n.value){case"prompt":return xe(t,m);default:return Me(t,n,r,d,l)}}const S=M(),B=ke(t,a,s,y,l);return()=>e.createVNode("div",{class:"farris-messager"},[!t.exceptionInfo&&e.createVNode("div",{style:"height: 30px;width: 100%;position: absolute;",class:"messager-draggable"},null),e.createVNode("section",{class:c.value,style:i.value},[S()]),B(),p()])}}),Ne={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showFloatingClose:{type:Boolean,default:!1},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60},position:{type:String,default:"center"},host:{type:Object,default:"body"},isMessager:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}};class H{constructor(a,l){this.x=a,this.y=l}static getTransformInfo(a){const n=window.getComputedStyle(a).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(n.length>=6){const r=parseInt(n[4],10),d=parseInt(n[5],10);return{x:r,y:d}}return{x:0,y:0}}static fromEvent(a,l=null){if(this.isMouseEvent(a))return new H(a.clientX,a.clientY);if(l===null||a.changedTouches.length===1)return new H(a.changedTouches[0].clientX,a.changedTouches[0].clientY);for(let n=0;n<a.changedTouches.length;n++)if(a.changedTouches[n].target===l)return new H(a.changedTouches[n].clientX,a.changedTouches[n].clientY)}static isMouseEvent(a){return Object.prototype.toString.apply(a).indexOf("MouseEvent")===8}static isIPosition(a){return!!a&&"x"in a&&"y"in a}static getCurrent(a){const l=new H(0,0);if(window){const n=window.getComputedStyle(a);if(n){const r=parseInt(n.getPropertyValue("left"),10),d=parseInt(n.getPropertyValue("top"),10);l.x=isNaN(r)?0:r,l.y=isNaN(d)?0:d}return l}return null}static copy(a){return new H(0,0).set(a)}get value(){return{x:this.x,y:this.y}}add(a){return this.x+=a.x,this.y+=a.y,this}subtract(a){return this.x-=a.x,this.y-=a.y,this}multiply(a){this.x*=a,this.y*=a}divide(a){this.x/=a,this.y/=a}reset(){return this.x=0,this.y=0,this}set(a){return this.x=a.x,this.y=a.y,this}}class ${constructor(a,l){this.width=a,this.height=l}static getCurrent(a){const l=new $(0,0);if(window){const n=window.getComputedStyle(a);return n&&(l.width=parseInt(n.getPropertyValue("width"),10),l.height=parseInt(n.getPropertyValue("height"),10)),l}return null}static copy(a){return new $(0,0).set(a)}set(a){return this.width=a.width,this.height=a.height,this}}function Se(t,a){const l=e.ref(),n=e.ref(),r=e.ref(),d=e.ref(),c=e.ref(),i=e.ref(),s=e.ref(),m=e.ref(),y=e.ref(),g=e.ref(),N=e.ref(),p=e.ref(t.resizeable),M=e.ref(),S=e.ref(t.draggable),B=e.ref(!1);function k(){const u=n.value||document.body,f=window.getComputedStyle(u);if(!f||!l.value)return;const T=H.getTransformInfo(l.value),x={};s.value&&(x.deltaL=l.value.offsetLeft-s.value.x,x.deltaT=l.value.offsetTop-s.value.y);const L=f.getPropertyValue("position");x.width=u.clientWidth,x.height=u.clientHeight,x.pr=parseInt(f.getPropertyValue("padding-right"),10),x.pb=parseInt(f.getPropertyValue("padding-bottom"),10),x.position=f.getPropertyValue("position"),L==="static"&&(u.style.position="relative"),x.translateX=T.x,x.translateY=T.y,g.value=x}function w(u){if(l.value){d.value=$.getCurrent(l.value),c.value=H.getCurrent(l.value),i.value=d.value?$.copy(d.value):null,s.value=c.value?H.copy(c.value):null,k();const f=u.target.getAttribute("type")||"";m.value={n:!!f.match(/n/),s:!!f.match(/s/),w:!!f.match(/w/),e:!!f.match(/e/)}}}function F(){var u,f,T,x;if(l.value){const L=l.value;m.value&&((m.value.n||m.value.s)&&((u=i.value)!=null&&u.height)&&(L.style.height=i.value.height+"px"),(m.value.w||m.value.e)&&((f=i.value)!=null&&f.width)&&(L.style.width=i.value.width+"px"),s.value&&((T=s.value)!=null&&T.x&&(L.style.left=s.value.x+"px"),(x=s.value)!=null&&x.y&&(L.style.top=s.value.y+"px")))}}function O(){const u=t.minHeight?t.minHeight:1,f=t.minWidth?t.minWidth:1;i.value&&s.value&&m.value&&d.value&&(i.value.height<u&&(i.value.height=u,m.value.n&&c.value&&(s.value.y=c.value.y+(d.value.height-u))),i.value.width<f&&(i.value.width=f,m.value.w&&c.value&&(s.value.x=c.value.x+(d.value.width-f))),t.maxHeight&&i.value.height>t.maxHeight&&(i.value.height=t.maxHeight,c.value&&m.value.n&&(s.value.y=c.value.y+(d.value.height-t.maxHeight))),t.maxWidth&&i.value.width>t.maxWidth&&(i.value.width=t.maxWidth,m.value.w&&c.value&&(s.value.x=c.value.x+(d.value.width-t.maxWidth))))}function b(){if(n.value){const u=g.value;if(s.value&&i.value&&m.value&&d.value){const f=u.width-u.pr-u.deltaL-u.translateX-s.value.x,T=u.height-u.pb-u.deltaT-u.translateY-s.value.y;m.value.n&&s.value.y+u.translateY<0&&c.value&&(s.value.y=-u.translateY,i.value.height=d.value.height+c.value.y+u.translateY),m.value.w&&s.value.x+u.translateX<0&&c.value&&(s.value.x=-u.translateX,i.value.width=d.value.width+c.value.x+u.translateX),i.value.width>f&&(i.value.width=f),i.value.height>T&&(i.value.height=T)}}}function R(u){if(!r.value||!d.value||!c.value||!m.value)return;u.subtract(r.value);const f=u.x,T=u.y;m.value.n?(s.value.y=c.value.y+T,i.value.height=d.value.height-T):m.value.s&&(i.value.height=d.value.height+T),m.value.e?i.value.width=d.value.width+f:m.value.w&&(i.value.width=d.value.width-f,s.value.x=c.value.x+f),b(),O(),F()}function h(u){if(!y.value)return;const f=H.fromEvent(u);f&&R(f)}function C(){if(l.value){const{width:u,height:f,x:T,y:x}=l.value.getBoundingClientRect(),L=H.getTransformInfo(l.value);return{size:{width:u,height:f},position:{x:T-L.x,y:x-L.y}}}return null}function I(u){if(l.value){const f=C();N.value=f}r.value=void 0,d.value=null,c.value=null,i.value=null,s.value=null,m.value=null,y.value=null,document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",I)}function P(){document.addEventListener("mousemove",h),document.addEventListener("mouseup",I)}function V(u){u instanceof MouseEvent&&u.button===2||S.value&&(document.body.click(),u.stopPropagation(),u.preventDefault(),r.value=H.fromEvent(u),y.value=u.target,w(u),P())}function A(u){return l.value=u,p.value&&e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:f=>V(f)},null)])}function Z(u=!0){document.body.click();const f=n.value||document.body,T=$.getCurrent(f),x=l.value;u&&x&&(M.value=C(),M.value.transform=x.style.transform),T&&x&&(i.value=T,i.value.height-=14,i.value.width-=14,x.style.height=i.value.height+"px",x.style.width=i.value.width+"px",x.style.left="7px",x.style.top="7px",x.style.transform="",N.value={size:i.value,position:{x:0,y:0}},S.value=!1,B.value=!0)}function te(){var u,f;if(document.body.click(),M.value){const T={width:M.value.size.width||0,height:M.value.size.height||0},x={x:(window.innerWidth-T.width)/2,y:(window.innerHeight-T.height)/2};(u=i.value)==null||u.set(T),(f=s.value)==null||f.set(x);const L=l.value;L.style.height=T.height+"px",L.style.width=T.width+"px",L.style.left=`${x.x}px`,L.style.top=`${x.y}px`,L.style.transform="",N.value={size:T,position:x},S.value=t.draggable,B.value=!1}}function G(){if(l.value){const u=$.getCurrent(l.value);if(u){const{width:f,height:T}=u;l.value.style.left=`${(window.innerWidth-f)/2}px`,l.value.style.top=`${(window.innerHeight-T)/2}px`,l.value.style.transform=""}}}function Y(){const u=()=>{B.value?Z(!1):G(),document.body.click()};return window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}}const ae=Y();return{renderResizeBar:A,boundingElement:n,resizedEventParam:N,maximize:Z,restore:te,allowDrag:S,isMaximized:B,unWindowResizeHandle:ae,moveToCenter:G}}function Ve(t,a,l){const n=e.ref(),r=e.ref(t.draggable),d=e.ref(t.lockAxis),c=e.ref(),i=e.ref(),s=e.ref(!1),m=e.ref(new H(0,0)),y=e.ref(new H(0,0)),g=e.ref(new H(0,0)),N=e.ref(new H(0,0));e.watch(()=>l.value,h=>{c.value.style.cursor=h?"move":"default"});function p(h,C){if(C.tagName==="BUTTON")return!1;if(C===h)return!0;for(const I in C.children)if(Object.prototype.hasOwnProperty.call(C.children,I)&&p(h,C.children[I]))return!0;return!1}function M(){var P,V;let h=g.value.x+y.value.x,C=g.value.y+y.value.y;d.value==="x"?(h=((P=m.value)==null?void 0:P.x)||0,g.value.x=0):d.value==="y"&&(C=((V=m.value)==null?void 0:V.y)||0,g.value.y=0);const I=`translate3d(${Math.round(h)}px, ${Math.round(C)}px, 0px)`;n.value&&(n.value.style.transform=I),N.value.x=h,N.value.y=C}function S(){if(!i.value||!n.value)return null;const h=i.value.getBoundingClientRect(),C=n.value.getBoundingClientRect(),I={top:h.top<C.top,right:h.right>C.right,bottom:h.bottom>C.bottom,left:h.left<C.left};return I.top||(g.value.y-=C.top-h.top),I.bottom||(g.value.y-=C.bottom-h.bottom),I.right||(g.value.x-=C.right-h.right),I.left||(g.value.x-=C.left-h.left),M(),I}function B(h){h&&(m.value&&h.subtract(m.value),g.value.set(h),M(),S())}function k(h){s.value&&r.value&&(h.stopPropagation(),h.preventDefault(),B(H.fromEvent(h,c.value)))}function w(){var h;s.value&&(s.value=!1,y.value.add(g.value),g.value.reset(),(h=n.value)==null||h.classList.remove("ng-dragging"),a.emit("stopMove"),document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",w))}function F(){!s.value&&c.value&&(s.value=!0,c.value.classList.add("ng-dragging"),document.addEventListener("mousemove",k),document.addEventListener("mouseup",w))}function O(){if(n.value){const h=H.getTransformInfo(n.value);y.value.set(h);return}y.value.reset()}function b(h){if(!l.value||h instanceof MouseEvent&&h.button===2)return;const C=h.target||h.srcElement;c.value!==void 0&&C&&!p(C,c.value)||r.value!==!1&&(document.body.click(),h.stopPropagation(),h.preventDefault(),m.value=H.fromEvent(h,n.value),O(),F())}function R(h,C,I){if(r.value&&C){if(h)c.value=h;else if(t.dragHandle){if(t.dragHandle instanceof HTMLElement)c.value=t.dragHandle;else if(typeof t.dragHandle=="string"){const P=C.querySelector(t.dragHandle);P&&(c.value=P)}}n.value=C,i.value=I,c.value?(c.value.classList.add("ng-draggable"),c.value.addEventListener("mousedown",b)):r.value=!1}}return{registerDraggle:R,resetTranslate:O}}function se(t,a){if(t){const l=n=>{n.key.toLowerCase()===t.toLowerCase()&&a({event:n,key:t})};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}}}function Ee(t,a){const l=e.ref(t.enableEsc);let n=null;return l.value?(n=se("Escape",r=>{a.emit("esc",{event:r.event,type:"esc"})}),{remove:n}):null}function ze(t,a){const l=e.ref(t.enableEnter);let n=null;return l.value?(n=se("Enter",r=>{a.emit("enter",{event:r.event,type:"enter"})}),{remove:n}):null}const K=e.defineComponent({name:"FModal",props:Ne,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove","buttonClick"],setup(t,a){const l=e.ref(t.width||300),n=e.ref(t.height||200),r=e.ref(t.modelValue),d=e.ref(""),c=e.ref(t.class),i=e.ref(t.fitContent),s=e.ref(t.showHeader),m=e.ref(""),y=e.ref(t.showCloseButton),g=e.ref(t.showMaxButton),N=e.ref(!1),p=e.ref(t.dialogType),M=e.ref(t.src),S=e.ref(""),B=e.ref(t.showButtons),k=e.ref(t.title),w=e.ref(t.containment||null),F=e.ref();k.value==="错误提示"&&(k.value=D.LocaleService.getLocaleValue("messageBox.errorTitle"));const O=e.ref(!1);function b(o,v){const j=v?"accept":"cancel";Promise.resolve().then(()=>{var E;return(E=t.beforeClose)==null?void 0:E.call(t,{closeType:j})}).then(E=>{E&&(r.value=!1,a.emit("update:modelValue",!1),v!=null&&a.emit(v?"accept":"cancel"),a.emit("closed",o))})}const R=[{name:"cancel",text:D.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:o=>{b(o,!1)}},{name:"accept",text:D.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:o=>{b(o,!0)}}],h=e.ref(t.buttons&&t.buttons.length?t.buttons:R),C=e.computed(()=>!!m.value),I=e.computed(()=>!!B.value&&!!h.value),P=e.ref(),V=e.ref(),A=e.ref(!1),{renderResizeBar:Z,maximize:te,restore:G,boundingElement:Y,resizedEventParam:ae,allowDrag:u,unWindowResizeHandle:f,moveToCenter:T}=Se(t),{registerDraggle:x}=Ve(t,a,u);function L(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function Le(){const o=document.querySelectorAll(".farris-modal").length;(!o||o-1<=0)&&document.body.classList.remove("modal-open"),F.value&&F.value.classList.remove("show")}e.watch(()=>t.title,(o,v)=>{o!==v&&(k.value=o)}),e.watch(()=>t.modelValue,(o,v)=>{o!==v&&(r.value=o,r.value&&t.draggable&&e.nextTick(()=>{V.value&&!w.value&&(w.value=V.value.parentElement,Y.value=w.value,x(P.value,V.value,Y.value),T())}),o||(w.value&&(w.value=null),Le())),r.value?O.value=L():(A.value=!1,u.value=t.draggable)}),e.watch(()=>t.showHeader,(o,v)=>{o!==v&&(s.value=o)}),e.watch(()=>t.showButtons,(o,v)=>{o!==v&&(B.value=o)}),e.watch(()=>ae.value,(o,v)=>{const j=o||{},E=v||{};JSON.stringify(j)!==JSON.stringify(E)&&a.emit("resize",{newSize:o,oldSize:v,isMaximized:A.value})}),e.watch([()=>t.width,()=>t.height],(o,v)=>{(o[0]!==v[0]||o[1]!==v[1])&&(l.value=o[0]||500,n.value=o[1]||600)}),e.watch(()=>t.class,(o,v)=>{c.value=o});const Q=e.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),Ie=e.computed(()=>{var j;const o={modal:!0,"farris-modal":!0,fade:!0,"fe-cmp-page-modal":!!t.showFloatingClose};o["f-modal-fitContent"]=!!i.value,o.show=!!Q.value;const v=(j=t.maskClass)==null?void 0:j.split(" ");return v==null||v.reduce((E,U)=>(E[U]=!0,E),o),o}),Oe=e.computed(()=>{var j;const o={"modal-dialog":!0},v=(j=c.value)==null?void 0:j.split(" ");return v==null||v.reduce((E,U)=>(E[U]=!0,E),o),o}),je=()=>_.isMobilePhone()&&!t.isMessager||!!t.fullscreen,Fe=e.computed(()=>{const o=document.documentElement.clientWidth,v=document.documentElement.clientHeight,j=Math.min(l.value,o),E=t.position==="right"?"100%":i.value?"auto":`${Math.min(n.value,v-10)}px`,U=`${(window.innerHeight-(E==="100%"||E==="auto"?0:parseInt(E)))/2}px`,at=t.position==="right"?`${window.innerWidth-j}px`:`${(window.innerWidth-j)/2}px`,de={position:"absolute",top:U,left:at,width:`${j}px`,height:E};return t.mask||(de.pointerEvents="auto"),de}),ce=e.ref(_.getMaxZIndex()||1050),De=e.computed(()=>{const o={display:"block",overflow:"hidden"};return t.mask||(o.pointerEvents="none",o.backgroundColor="transparent"),O.value&&(o.backgroundColor="transparent"),o.zIndex=ce.value,o}),Pe=e.computed(()=>({"modal-content":!0,"modal-content-has-header":s.value,"is-mobile":je()})),We=e.computed(()=>{const o={display:s.value?"":"none"};return o["pointer-events"]=u.value?"auto":"none",o}),Ae=e.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:A.value})),qe=e.computed(()=>({"modal-body":!0,"f-utils-flex-column":p.value==="iframe","f-utils-fill":!0}));function $e(){return{height:`${t.footerHeight||60}px`}}const Ue=e.computed(()=>{const o={textAlgin:S.value},v=$e();return Object.assign(o,v)});function ue(o){if(o==null||o.stopPropagation(),A.value){A.value=!1,G();return}te(),A.value=!0}async function Xe(o,v){o.handle?await o.handle(v,o)&&a.emit("closed",v):(typeof o.onClick=="string"&&(o.onButtonClick=fe.cloneDeep(o.onClick||""),delete o.onClick),a.emit("buttonClick",{button:o,$event:v}))}function Ye(o){o.width&&(l.value=o.width),o.height&&(n.value=o.height),o.buttons&&(h.value=o.buttons),o.title&&(k.value=o.title)}let ne=null,le=null;e.onBeforeMount(()=>{O.value=L()}),e.onMounted(()=>{V.value&&!w.value&&(w.value=V.value.parentElement,Y.value=w.value,x(P.value,V.value,Y.value)),Q.value&&document.body.classList.add("modal-open"),ne=Ee(t,a),le=ze(t,a)}),e.onUnmounted(()=>{f&&f(),ne&&ne.remove(),le&&le.remove()}),a.expose({modalElementRef:V,updateModalOptions:Ye,close:b,maxDialog:ue,isMaximized:A});function Ke(){return e.createVNode("div",{class:"action-wrapper",onClick:o=>b(o,!1)},[e.createVNode("span",{class:"close-icon"},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])])}function Je(){return e.createVNode("ul",null,[N.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),g.value&&e.createVNode("li",{onClick:ue,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[e.createVNode("span",{class:Ae.value},null)]),y.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:o=>b(o,!1),style:"pointer-events: auto;"},[e.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ze(){return e.createVNode("div",{class:"modal-footer",style:Ue.value},[h.value&&h.value.map(o=>{var E;const v=e.ref(o.disabled),j=o.class||((E=o.appearance)==null?void 0:E.class);return e.createVNode("button",{name:o.name,type:"button",disabled:v.value,class:j+(o.iconClass?" btn-icontext":"")+(o.visible===!1?"d-none":""),onClick:U=>{Xe(o,U)}},[!!o.iconClass&&e.createVNode("i",{class:o.iconClass},null),o.text])})])}function Ge(){return e.createVNode("div",{ref:P,class:"modal-header",style:We.value},[a.slots.headerTemplate?a.slots.headerTemplate():e.createVNode("div",{class:"modal-title"},[C.value&&e.createVNode("span",{class:m.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[k.value])]),e.createVNode("div",{class:"actions"},[Je()])])}function Qe(){return a.slots.footerTemplate?a.slots.footerTemplate():I.value&&Ze()}function _e(o){if(o.stopPropagation(),t.allowClickMaskToClose){if(o.target!==F.value)return;b(o,!1)}}function et(){var o,v;return e.createVNode("div",{id:d.value,class:Oe.value,style:Fe.value,ref:V},[t.showFloatingClose&&Ke(),e.createVNode("div",{class:Pe.value},[s.value&&Ge(),e.createVNode("div",{class:qe.value},[(v=(o=a.slots).default)==null?void 0:v.call(o),p.value==="iframe"&&e.createVNode("iframe",{title:d.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:M.value},null)]),Qe()]),!i.value&&V.value&&!A.value&&Z(V.value)])}function tt(o){return o||"body"}return e.watchEffect(()=>{Q.value&&(ce.value=_.getMaxZIndex()||1050)}),()=>e.createVNode(e.Teleport,{to:tt(t.host)},{default:()=>[Q.value&&e.createVNode(e.Transition,{name:"fade",appear:!0},{default:()=>[e.createVNode("div",{ref:F,class:Ie.value,style:De.value,onClick:_e},[et()])]})]})}});function re(t){if(t.content&&t.content.render)return t.content.render;if(t.render&&typeof t.render=="function")return t.render}function He(t){const a=document.createElement("div");a.style.display="contents";const l=e.createApp({setup(n,r){e.onUnmounted(()=>{document.body.removeChild(a)});const d=e.ref(),c=e.ref(t.class||""),i=e.ref(!!t.showButtons),s=e.ref(!!t.showHeader),m=e.ref(t.showCloseButton==null?!0:t.showCloseButton),y=e.ref(!!t.showFloatingClose),g=e.ref(!0),N=e.ref(t.title||""),p=t.acceptCallback||(()=>{}),M=t.rejectCallback||(()=>{}),S=t.closedCallback||(O=>{}),B=t.resizeHandle||(O=>{}),k=t.stopMoveHandle||(O=>{}),w=re(t),F=O=>{g.value=!1,l.unmount(),S(O)};return e.onMounted(()=>{}),r.expose({modalRef:d}),()=>e.createVNode(K,{ref:d,class:c.value,modelValue:g.value,"onUpdate:modelValue":O=>g.value=O,title:N.value,width:t.width,height:t.height,buttons:t.buttons,"show-header":s.value,"show-buttons":i.value,"show-close-button":m.value,"show-max-button":!1,showFloatingClose:y.value,onAccept:p,onCancel:M,fitContent:t.fitContent==null?!0:t.fitContent,onClosed:F,onResize:B,onStopMove:k},{default:()=>[w&&w(l)]})}});return document.body.appendChild(a),l.use(D.LocaleService.i18n),l.mount(a),l}class ie{constructor(a){q(this,"appContext",null);q(this,"modalRef",e.ref());q(this,"activeModalIndex",e.ref(0));q(this,"modalRefs",{});q(this,"isUseEscCloseModal",e.ref(!1));q(this,"activeModalInstance",e.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=a,this.appContext=a?a._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(a,l){const{width:n,height:r}={width:window.innerWidth,height:window.innerHeight};return n<a&&(a=n-14),r<l&&(l=r-14),{width:a,height:l}}static show(a){const l=Object.assign({title:"",showButtons:!0,showHeader:!0},a);return He(l)}close(a){var l,n;a?(n=a.value)==null||n.close():(l=this.getCurrentModal())==null||l.close()}open(a){const l=document.createDocumentFragment();a.showMaxButton&&a.fitContent&&(a.showMaxButton=!1);const n=e.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},a)),r=e.ref(!0),d=n.value.acceptCallback||(()=>{}),c=n.value.rejectCallback||(()=>{}),i=n.value.closedCallback||((b,R)=>{}),s=n.value.resizeHandle||(b=>{}),m=a.stopMoveHandle||(b=>{});let y;const g=re(n.value),N=b=>{var h;r.value=!1;const R=(h=b==null?void 0:b.target)==null?void 0:h.classList.contains("modal_close");i(b,this.isUseEscCloseModal.value?"esc":R?"icon":"button")},p=b=>{N(b),y&&e.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],e.render(null,l),y=null,this.modalRef.value=null,this.modalRefs){const R=Object.keys(this.modalRefs).map(h=>Number(h));R.length>0?this.activeModalIndex.value=Math.max(...R):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},M=b=>{var R;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((R=this.activeModalInstance.value)==null||R.close(b==null?void 0:b.event))},{width:S,height:B}=n.value,k=this.adaptToWindow(S||500,B||320);Object.assign(n.value,k);const w=()=>e.createVNode(K,e.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":b=>r.value=b},n.value,{isMessager:n.value.class&&n.value.class.indexOf("modal-message")>-1,onAccept:d,onCancel:c,onClosed:p,onResize:s,onEsc:M,onStopMove:m}),{default:()=>[g&&g(this.app)]});return y=(b=>{const R=e.h(w,b);return R.appContext=this.appContext,e.render(R,l),R})({...n.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:b=>{n.value={...n.value,...b},y&&e.render(e.cloneVNode(y,{...n}),l)},destroy:p,modalRef:this.activeModalInstance,close:()=>this.close()}}}const Re=Symbol("FModalService");K.install=t=>{t.component(K.name,K);const a=new ie(t);t.provide(Re,a),t.provide("FModalService",a)};const W=class W{static show(a){const l=e.reactive({...a}),n=!1,r=l.type==="error"||l.type==="prompt",d=l.type==="error"?"错误提示":l.type==="prompt"&&l.title||"",c=l.acceptCallback||(()=>{}),i=l.rejectCallback||(()=>{});let s=null,m=new ie(W.app);const y=()=>{s&&(s==null||s.destroy(),m=null)};return s=m==null?void 0:m.open({class:"modal-message modal-message-type-info",title:d,showButtons:n,showHeader:r,width:l.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,dragHandle:".messager-draggable",render:()=>e.createVNode(X,e.mergeProps(l,{onAccept:c,onReject:i,onClose:y}),null)}),m==null?void 0:m.getCurrentModal()}static info(a,l){const n=e.reactive({type:"info",title:a,detail:l,okButtonText:"知道了",showCancelButton:!1});W.show(n)}static warning(a,l){const n=e.reactive({type:"warning",title:a,detail:l,okButtonText:"知道了",showCancelButton:!1});W.show(n)}static success(a,l){const n=e.reactive({type:"success",title:a,detail:l,okButtonText:"关闭",showCancelButton:!1});W.show(n)}static error(a,l,n){const r=e.reactive({width:500,type:"error",okButtonText:"关闭",showCancelButton:!1,exceptionInfo:{date:n,message:a,detail:l}});W.show(r)}static prompt(a,l){const n=e.reactive({type:"prompt",title:a,detail:l,okButtonText:"确定",cancelButtonText:"取消"});W.show(n)}static question(a,l,n,r){const d=e.reactive({type:"question",title:a,detail:l,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:n,rejectCallback:r});W.show(d)}};q(W,"app",null);let J=W;X.install=t=>{t.component(X.name,X),J.app=t,t.provide("FMessageBoxService",J)},z.FMessageBox=X,z.FMessageBoxService=J,z.default=X,z.messageBoxProps=oe,Object.defineProperties(z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(z,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../locale/index.umd.js"),require("../common/index.umd.js"),require("lodash-es"),require("../property-panel/index.umd.js"),require("../button/index.umd.js"),require("../field-selector/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../locale/index.umd.js","../common/index.umd.js","lodash-es","../property-panel/index.umd.js","../button/index.umd.js","../field-selector/index.umd.js"],e):(z=typeof globalThis<"u"?globalThis:z||self,e(z["message-box"]={},z.Vue,z.locale,z.common,z.LodashES))})(this,function(z,e,D,_,fe){"use strict";var nt=Object.defineProperty;var lt=(z,e,D)=>e in z?nt(z,e,{enumerable:!0,configurable:!0,writable:!0,value:D}):z[e]=D;var q=(z,e,D)=>lt(z,typeof e!="symbol"?e+"":e,D);const oe={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},showOkButton:{Type:Boolean,default:!0},showCancelButton:{Type:Boolean,default:!0},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function ee(){return new DOMException("The request is not allowed","NotAllowedError")}async function he(t){if(!navigator.clipboard)throw ee();return navigator.clipboard.writeText(t)}async function me(t){const a=document.createElement("span");a.textContent=t,a.style.whiteSpace="pre",a.style.webkitUserSelect="auto",a.style.userSelect="all",document.body.appendChild(a);const l=window.getSelection(),n=window.document.createRange();l==null||l.removeAllRanges(),n.selectNode(a),l==null||l.addRange(n);let s=!1;try{s=window.document.execCommand("copy")}finally{l==null||l.removeAllRanges(),window.document.body.removeChild(a)}if(!s)throw ee()}async function ge(t){try{await he(t)}catch(a){try{await me(t)}catch(l){throw l||a||ee()}}}function ve(){async function t(a){await ge(a)}return{onCopy:t}}function pe(t,a,l,n){const s=e.ref(14),d=e.ref(140),c=e.ref(""),i=e.ref(n.value.length),r=e.computed(()=>n.value),g=e.computed(()=>({"font-size":`${s.value}px`,height:"100%"}));function v(m){if(m.currentTarget){const B=m.currentTarget.value||"";i.value=B.length}}return()=>e.createVNode(e.Fragment,null,[e.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:g.value,rows:"4",maxlength:d.value,onInput:m=>v(m)},[r.value]),e.createVNode("span",{class:"textarea-wordcount",title:c.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[i.value+" / "+d.value])])}function ye(t,a,l,n){const s=pe(t,a,l,n),d=new Map([["text-area",s]]);function c(i){return d.get(i)||null}return{getEditorRender:c}}function we(){const t=e.ref(!1),a=e.ref("复制成功");return{feedbackStyle:e.computed(()=>{const n={position:"absolute",left:"50%",top:"50%","min-width":"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease",padding:"0 10px"};return n.opacity=t.value?"0.8":"0",n.display=t.value?"":"none",n}),feedbackMessage:a,toShowFeedback:t}}function xe(t,a){const l=a.getEditorRender(t.promptEditorType);return()=>l&&l()}function be(t,a){function l(y){if(y==null)return 0;let b=0;for(let S=0;S<y.length;S++){const k=y.charCodeAt(S);k>=0&&k<=128?b++:b=b+2}return b}function n(y,b){if(y!==""&&y!==void 0&&y!==null){y=""+y;const S=y.length;let k="",T=0;for(let w=0;w<S;w++){const F=y.charAt(w);if(T++,encodeURI(F).length>4&&T++,k=k.concat(F),T>=b)return k=k.concat("..."),k}if(T<b)return y}return""}const s=e.computed(()=>!!t.value&&!!t.value.date),d=e.computed(()=>{const y=t.value&&t.value.date||"";return`${a.exception.happend} : ${y}`}),c=e.computed(()=>!!t.value&&!!t.value.detail),i=e.computed(()=>t.value?l(t.value.detail)>160:!1),r=e.ref(!1),g=e.computed(()=>r.value?a.exception.collapse:a.exception.expand),v=e.computed(()=>{const y=a.exception.detail+" : "+(t.value&&t.value.detail)||"";return r.value?y:n(y,160)}),m=e.computed(()=>({bottom:r.value?0:"2px"}));function B(){r.value=!r.value}return()=>e.createVNode("div",{class:"toast-msg-detail",style:"max-height: calc(100vh - 200px);overflow: auto;"},[s.value&&e.createVNode("div",null,[d.value]),c.value&&e.createVNode("div",{class:"exception_wrap"},[e.createVNode("div",{class:"exception_error_msg"},[e.createVNode("div",{innerHTML:v.value},null),i.value&&e.createVNode("span",{class:"exception_toggle_detail",style:m.value,onClick:B},[g.value])])])])}function Ce(t){return()=>e.createVNode("p",{class:"toast-msg-detail",innerHTML:t.value,style:"max-height: calc(100vh - 200px);overflow: auto;"},null)}function Me(t,a,l,n,s){const d=e.ref(t.exceptionInfo),c=e.computed(()=>{const b=a.value==="question"?"warning":a.value,S={"f-icon":!0},k=`f-icon-${b}`;return S[k]=!0,S}),i=e.computed(()=>l.value||d.value&&d.value.message),r=e.computed(()=>n.value),g=e.computed(()=>!!n.value),v=e.computed(()=>!!d.value);function m(){return v.value?be(d,s):g.value?Ce(r):()=>null}const B=m(),y=e.computed(()=>s.locale==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"float-left modal-tips-iconwrap"},[e.createVNode("span",{class:c.value},null)]),e.createVNode("div",{class:"modal-tips-content"},[e.createVNode("p",{class:"toast-msg-title",innerHTML:i.value,style:y.value},null),B()])])}function Be(t,a,l,n){const{onCopy:s}=a,{toShowFeedback:d}=l,c=e.ref(n.exception.copySuccess||"复制成功"),i=e.ref(n.exception.copy||"复制详细信息"),r=e.ref(t.exceptionInfo||{date:"",message:"",detail:""}),g=e.computed(()=>r.value&&r.value.detail||"");function v(m){s(g.value).catch(B=>{c.value=n.exception.copyFailed||"复制失败"}).finally(()=>{d.value=!0,setTimeout(()=>{d.value=!1},700)})}return()=>e.createVNode("span",{class:"copy-exception-info"},[e.createVNode("span",{onClick:v,style:"cursor: pointer;"},[i.value])])}function ke(t,a,l,n,s){const d=e.ref(t.type),c=e.ref(t.buttons),i=e.ref(t.exceptionInfo),r=e.ref(s.ok||t.okButtonText),g=e.ref(s.cancel||t.cancelButtonText),v=e.ref(t.showCancelButton),m=e.ref(t.showOkButton),B=e.computed(()=>!!(c.value&&c.value.length)),y=e.computed(()=>!!(i.value&&i.value.detail)),b=e.computed(()=>!(c.value&&c.value.length)&&(m.value||v.value)),S=Be(t,l,n,s);r.value==="关闭"?r.value=s.close:r.value==="知道了"&&(r.value=s.exception.roger);function k(w){d.value==="question"&&a.emit("reject"),a.emit("close")}function T(w){d.value==="question"&&a.emit("accept"),a.emit("close")}return()=>e.createVNode("div",{class:"modal-footer"},[y.value&&S(),b.value&&v.value&&e.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:k},[g.value]),b.value&&m.value&&e.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:T},[r.value]),B.value&&c.value.length&&c.value.map(w=>e.createVNode("button",{type:"button",onClick:w.handle,class:w.class},[w.iconClass&&e.createVNode("span",{class:w.iconClass},null),w.text]))])}function Te(t){const{getLocaleValue:a}=D.LocaleService,l=D.LocaleService.getLocale();function n(s,d,c){return d===c?a(s):d}return{yes:n("messageBox.yes")||"是",no:n("messageBox.no")||"否",close:n("messageBox.close")||"关闭",ok:n("messageBox.ok",t.okButtonText,"确定")||"确定",cancel:n("messageBox.cancel",t.cancelButtonText,"取消")||"取消",title:n("messageBox.title")||"系统提示",errorTitle:n("messageBox.errorTitle")||"错误提示",exception:{expand:n("messageBox.exception.expand")||"展开",collapse:n("messageBox.exception.collapse")||"收起",happend:n("messageBox.exception.happend")||"发生时间",detail:n("messageBox.exception.detail")||"详细信息",copy:n("messageBox.exception.copy")||"复制详细信息",copySuccess:n("messageBox.exception.copySuccess")||"复制成功",copyFailed:n("messageBox.exception.copyFailed")||"复制失败",roger:n("messageBox.exception.roger")||"知道了"},locale:l}}const X=e.defineComponent({name:"FMessageBox",props:oe,emits:["accept","reject","close"],setup(t,a){const l=Te(t),n=e.ref(t.type),s=e.ref(t.title),d=e.ref(t.detail),c=e.computed(()=>{const T={"modal-tips":!0,"d-flex":!0,"flex-row":!0},w=`messager-type-${n.value}`;return T[w]=!0,T}),i=e.computed(()=>{const T={cursor:"default"};return n.value==="prompt"?T.padding="0.5rem 0.5rem 1rem 1.5rem":n.value==="error"&&(T.padding="0.5rem 1.5rem 1rem 1.5rem"),T}),r=ve(),g=ye(t,n,s,d),v=we(),{feedbackStyle:m,feedbackMessage:B}=v;B.value=l.exception.copySuccess;function y(){return e.createVNode("div",{style:m.value},[B.value])}function b(){switch(n.value){case"prompt":return xe(t,g);default:return Me(t,n,s,d,l)}}const S=b(),k=ke(t,a,r,v,l);return()=>e.createVNode("div",{class:"farris-messager"},[!t.exceptionInfo&&e.createVNode("div",{style:"height: 30px;width: 100%;position: absolute;",class:"messager-draggable"},null),e.createVNode("section",{class:c.value,style:i.value},[S()]),k(),y()])}}),Ne={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showFloatingClose:{type:Boolean,default:!1},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60},position:{type:String,default:"center"},host:{type:Object,default:"body"},isMessager:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}};class H{constructor(a,l){this.x=a,this.y=l}static getTransformInfo(a){const n=window.getComputedStyle(a).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(n.length>=6){const s=parseInt(n[4],10),d=parseInt(n[5],10);return{x:s,y:d}}return{x:0,y:0}}static fromEvent(a,l=null){if(this.isMouseEvent(a))return new H(a.clientX,a.clientY);if(l===null||a.changedTouches.length===1)return new H(a.changedTouches[0].clientX,a.changedTouches[0].clientY);for(let n=0;n<a.changedTouches.length;n++)if(a.changedTouches[n].target===l)return new H(a.changedTouches[n].clientX,a.changedTouches[n].clientY)}static isMouseEvent(a){return Object.prototype.toString.apply(a).indexOf("MouseEvent")===8}static isIPosition(a){return!!a&&"x"in a&&"y"in a}static getCurrent(a){const l=new H(0,0);if(window){const n=window.getComputedStyle(a);if(n){const s=parseInt(n.getPropertyValue("left"),10),d=parseInt(n.getPropertyValue("top"),10);l.x=isNaN(s)?0:s,l.y=isNaN(d)?0:d}return l}return null}static copy(a){return new H(0,0).set(a)}get value(){return{x:this.x,y:this.y}}add(a){return this.x+=a.x,this.y+=a.y,this}subtract(a){return this.x-=a.x,this.y-=a.y,this}multiply(a){this.x*=a,this.y*=a}divide(a){this.x/=a,this.y/=a}reset(){return this.x=0,this.y=0,this}set(a){return this.x=a.x,this.y=a.y,this}}class ${constructor(a,l){this.width=a,this.height=l}static getCurrent(a){const l=new $(0,0);if(window){const n=window.getComputedStyle(a);return n&&(l.width=parseInt(n.getPropertyValue("width"),10),l.height=parseInt(n.getPropertyValue("height"),10)),l}return null}static copy(a){return new $(0,0).set(a)}set(a){return this.width=a.width,this.height=a.height,this}}function Se(t,a){const l=e.ref(),n=e.ref(),s=e.ref(),d=e.ref(),c=e.ref(),i=e.ref(),r=e.ref(),g=e.ref(),v=e.ref(),m=e.ref(),B=e.ref(),y=e.ref(t.resizeable),b=e.ref(),S=e.ref(t.draggable),k=e.ref(!1);function T(){const u=n.value||document.body,f=window.getComputedStyle(u);if(!f||!l.value)return;const N=H.getTransformInfo(l.value),x={};r.value&&(x.deltaL=l.value.offsetLeft-r.value.x,x.deltaT=l.value.offsetTop-r.value.y);const L=f.getPropertyValue("position");x.width=u.clientWidth,x.height=u.clientHeight,x.pr=parseInt(f.getPropertyValue("padding-right"),10),x.pb=parseInt(f.getPropertyValue("padding-bottom"),10),x.position=f.getPropertyValue("position"),L==="static"&&(u.style.position="relative"),x.translateX=N.x,x.translateY=N.y,m.value=x}function w(u){if(l.value){d.value=$.getCurrent(l.value),c.value=H.getCurrent(l.value),i.value=d.value?$.copy(d.value):null,r.value=c.value?H.copy(c.value):null,T();const f=u.target.getAttribute("type")||"";g.value={n:!!f.match(/n/),s:!!f.match(/s/),w:!!f.match(/w/),e:!!f.match(/e/)}}}function F(){var u,f,N,x;if(l.value){const L=l.value;g.value&&((g.value.n||g.value.s)&&((u=i.value)!=null&&u.height)&&(L.style.height=i.value.height+"px"),(g.value.w||g.value.e)&&((f=i.value)!=null&&f.width)&&(L.style.width=i.value.width+"px"),r.value&&((N=r.value)!=null&&N.x&&(L.style.left=r.value.x+"px"),(x=r.value)!=null&&x.y&&(L.style.top=r.value.y+"px")))}}function I(){const u=t.minHeight?t.minHeight:1,f=t.minWidth?t.minWidth:1;i.value&&r.value&&g.value&&d.value&&(i.value.height<u&&(i.value.height=u,g.value.n&&c.value&&(r.value.y=c.value.y+(d.value.height-u))),i.value.width<f&&(i.value.width=f,g.value.w&&c.value&&(r.value.x=c.value.x+(d.value.width-f))),t.maxHeight&&i.value.height>t.maxHeight&&(i.value.height=t.maxHeight,c.value&&g.value.n&&(r.value.y=c.value.y+(d.value.height-t.maxHeight))),t.maxWidth&&i.value.width>t.maxWidth&&(i.value.width=t.maxWidth,g.value.w&&c.value&&(r.value.x=c.value.x+(d.value.width-t.maxWidth))))}function C(){if(n.value){const u=m.value;if(r.value&&i.value&&g.value&&d.value){const f=u.width-u.pr-u.deltaL-u.translateX-r.value.x,N=u.height-u.pb-u.deltaT-u.translateY-r.value.y;g.value.n&&r.value.y+u.translateY<0&&c.value&&(r.value.y=-u.translateY,i.value.height=d.value.height+c.value.y+u.translateY),g.value.w&&r.value.x+u.translateX<0&&c.value&&(r.value.x=-u.translateX,i.value.width=d.value.width+c.value.x+u.translateX),i.value.width>f&&(i.value.width=f),i.value.height>N&&(i.value.height=N)}}}function R(u){if(!s.value||!d.value||!c.value||!g.value)return;u.subtract(s.value);const f=u.x,N=u.y;g.value.n?(r.value.y=c.value.y+N,i.value.height=d.value.height-N):g.value.s&&(i.value.height=d.value.height+N),g.value.e?i.value.width=d.value.width+f:g.value.w&&(i.value.width=d.value.width-f,r.value.x=c.value.x+f),C(),I(),F()}function h(u){if(!v.value)return;const f=H.fromEvent(u);f&&R(f)}function M(){if(l.value){const{width:u,height:f,x:N,y:x}=l.value.getBoundingClientRect(),L=H.getTransformInfo(l.value);return{size:{width:u,height:f},position:{x:N-L.x,y:x-L.y}}}return null}function O(u){if(l.value){const f=M();B.value=f}s.value=void 0,d.value=null,c.value=null,i.value=null,r.value=null,g.value=null,v.value=null,document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",O)}function W(){document.addEventListener("mousemove",h),document.addEventListener("mouseup",O)}function V(u){u instanceof MouseEvent&&u.button===2||S.value&&(document.body.click(),u.stopPropagation(),u.preventDefault(),s.value=H.fromEvent(u),v.value=u.target,w(u),W())}function A(u){return l.value=u,y.value&&e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:f=>V(f)},null),e.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:f=>V(f)},null)])}function Z(u=!0){document.body.click();const f=n.value||document.body,N=$.getCurrent(f),x=l.value;u&&x&&(b.value=M(),b.value.transform=x.style.transform),N&&x&&(i.value=N,i.value.height-=14,i.value.width-=14,x.style.height=i.value.height+"px",x.style.width=i.value.width+"px",x.style.left="7px",x.style.top="7px",x.style.transform="",B.value={size:i.value,position:{x:0,y:0}},S.value=!1,k.value=!0)}function te(){var u,f;if(document.body.click(),b.value){const N={width:b.value.size.width||0,height:b.value.size.height||0},x={x:(window.innerWidth-N.width)/2,y:(window.innerHeight-N.height)/2};(u=i.value)==null||u.set(N),(f=r.value)==null||f.set(x);const L=l.value;L.style.height=N.height+"px",L.style.width=N.width+"px",L.style.left=`${x.x}px`,L.style.top=`${x.y}px`,L.style.transform="",B.value={size:N,position:x},S.value=t.draggable,k.value=!1}}function G(){if(l.value){const u=$.getCurrent(l.value);if(u){const{width:f,height:N}=u;l.value.style.left=`${(window.innerWidth-f)/2}px`,l.value.style.top=`${(window.innerHeight-N)/2}px`,l.value.style.transform=""}}}function Y(){const u=()=>{k.value?Z(!1):G(),document.body.click()};return window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}}const ae=Y();return{renderResizeBar:A,boundingElement:n,resizedEventParam:B,maximize:Z,restore:te,allowDrag:S,isMaximized:k,unWindowResizeHandle:ae,moveToCenter:G}}function Ve(t,a,l){const n=e.ref(),s=e.ref(t.draggable),d=e.ref(t.lockAxis),c=e.ref(),i=e.ref(),r=e.ref(!1),g=e.ref(new H(0,0)),v=e.ref(new H(0,0)),m=e.ref(new H(0,0)),B=e.ref(new H(0,0));e.watch(()=>l.value,h=>{c.value.style.cursor=h?"move":"default"});function y(h,M){if(M.tagName==="BUTTON")return!1;if(M===h)return!0;for(const O in M.children)if(Object.prototype.hasOwnProperty.call(M.children,O)&&y(h,M.children[O]))return!0;return!1}function b(){var W,V;let h=m.value.x+v.value.x,M=m.value.y+v.value.y;d.value==="x"?(h=((W=g.value)==null?void 0:W.x)||0,m.value.x=0):d.value==="y"&&(M=((V=g.value)==null?void 0:V.y)||0,m.value.y=0);const O=`translate3d(${Math.round(h)}px, ${Math.round(M)}px, 0px)`;n.value&&(n.value.style.transform=O),B.value.x=h,B.value.y=M}function S(){if(!i.value||!n.value)return null;const h=i.value.getBoundingClientRect(),M=n.value.getBoundingClientRect(),O={top:h.top<M.top,right:h.right>M.right,bottom:h.bottom>M.bottom,left:h.left<M.left};return O.top||(m.value.y-=M.top-h.top),O.bottom||(m.value.y-=M.bottom-h.bottom),O.right||(m.value.x-=M.right-h.right),O.left||(m.value.x-=M.left-h.left),b(),O}function k(h){h&&(g.value&&h.subtract(g.value),m.value.set(h),b(),S())}function T(h){r.value&&s.value&&(h.stopPropagation(),h.preventDefault(),k(H.fromEvent(h,c.value)))}function w(){var h;r.value&&(r.value=!1,v.value.add(m.value),m.value.reset(),(h=n.value)==null||h.classList.remove("ng-dragging"),a.emit("stopMove"),document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",w))}function F(){!r.value&&c.value&&(r.value=!0,c.value.classList.add("ng-dragging"),document.addEventListener("mousemove",T),document.addEventListener("mouseup",w))}function I(){if(n.value){const h=H.getTransformInfo(n.value);v.value.set(h);return}v.value.reset()}function C(h){if(!l.value||h instanceof MouseEvent&&h.button===2)return;const M=h.target||h.srcElement;c.value!==void 0&&M&&!y(M,c.value)||s.value!==!1&&(document.body.click(),h.stopPropagation(),h.preventDefault(),g.value=H.fromEvent(h,n.value),I(),F())}function R(h,M,O){if(s.value&&M){if(h)c.value=h;else if(t.dragHandle){if(t.dragHandle instanceof HTMLElement)c.value=t.dragHandle;else if(typeof t.dragHandle=="string"){const W=M.querySelector(t.dragHandle);W&&(c.value=W)}}n.value=M,i.value=O,c.value?(c.value.classList.add("ng-draggable"),c.value.addEventListener("mousedown",C)):s.value=!1}}return{registerDraggle:R,resetTranslate:I}}function se(t,a){if(t){const l=n=>{n.key.toLowerCase()===t.toLowerCase()&&a({event:n,key:t})};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}}}function Ee(t,a){const l=e.ref(t.enableEsc);let n=null;return l.value?(n=se("Escape",s=>{a.emit("esc",{event:s.event,type:"esc"})}),{remove:n}):null}function ze(t,a){const l=e.ref(t.enableEnter);let n=null;return l.value?(n=se("Enter",s=>{a.emit("enter",{event:s.event,type:"enter"})}),{remove:n}):null}const K=e.defineComponent({name:"FModal",props:Ne,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove","buttonClick"],setup(t,a){const l=e.ref(t.width||300),n=e.ref(t.height||200),s=e.ref(t.modelValue),d=e.ref(""),c=e.ref(t.class),i=e.ref(t.fitContent),r=e.ref(t.showHeader),g=e.ref(""),v=e.ref(t.showCloseButton),m=e.ref(t.showMaxButton),B=e.ref(!1),y=e.ref(t.dialogType),b=e.ref(t.src),S=e.ref(""),k=e.ref(t.showButtons),T=e.ref(t.title),w=e.ref(t.containment||null),F=e.ref();T.value==="错误提示"&&(T.value=D.LocaleService.getLocaleValue("messageBox.errorTitle"));const I=e.ref(!1);function C(o,p){const j=p?"accept":"cancel";Promise.resolve().then(()=>{var E;return(E=t.beforeClose)==null?void 0:E.call(t,{closeType:j})}).then(E=>{E&&(s.value=!1,a.emit("update:modelValue",!1),p!=null&&a.emit(p?"accept":"cancel"),a.emit("closed",o))})}const R=[{name:"cancel",text:D.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:o=>{C(o,!1)}},{name:"accept",text:D.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:o=>{C(o,!0)}}],h=e.ref(t.buttons&&t.buttons.length?t.buttons:R),M=e.computed(()=>!!g.value),O=e.computed(()=>!!k.value&&!!h.value),W=e.ref(),V=e.ref(),A=e.ref(!1),{renderResizeBar:Z,maximize:te,restore:G,boundingElement:Y,resizedEventParam:ae,allowDrag:u,unWindowResizeHandle:f,moveToCenter:N}=Se(t),{registerDraggle:x}=Ve(t,a,u);function L(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function Le(){const o=document.querySelectorAll(".farris-modal").length;(!o||o-1<=0)&&document.body.classList.remove("modal-open"),F.value&&F.value.classList.remove("show")}e.watch(()=>t.title,(o,p)=>{o!==p&&(T.value=o)}),e.watch(()=>t.modelValue,(o,p)=>{o!==p&&(s.value=o,s.value&&t.draggable&&e.nextTick(()=>{V.value&&!w.value&&(w.value=V.value.parentElement,Y.value=w.value,x(W.value,V.value,Y.value),N())}),o||(w.value&&(w.value=null),Le())),s.value?I.value=L():(A.value=!1,u.value=t.draggable)}),e.watch(()=>t.showHeader,(o,p)=>{o!==p&&(r.value=o)}),e.watch(()=>t.showButtons,(o,p)=>{o!==p&&(k.value=o)}),e.watch(()=>ae.value,(o,p)=>{const j=o||{},E=p||{};JSON.stringify(j)!==JSON.stringify(E)&&a.emit("resize",{newSize:o,oldSize:p,isMaximized:A.value})}),e.watch([()=>t.width,()=>t.height],(o,p)=>{(o[0]!==p[0]||o[1]!==p[1])&&(l.value=o[0]||500,n.value=o[1]||600)}),e.watch(()=>t.class,(o,p)=>{c.value=o});const Q=e.computed(()=>(s.value&&document.body.classList.add("modal-open"),s.value)),Oe=e.computed(()=>{var j;const o={modal:!0,"farris-modal":!0,fade:!0,"fe-cmp-page-modal":!!t.showFloatingClose};o["f-modal-fitContent"]=!!i.value,o.show=!!Q.value;const p=(j=t.maskClass)==null?void 0:j.split(" ");return p==null||p.reduce((E,U)=>(E[U]=!0,E),o),o}),Ie=e.computed(()=>{var j;const o={"modal-dialog":!0},p=(j=c.value)==null?void 0:j.split(" ");return p==null||p.reduce((E,U)=>(E[U]=!0,E),o),o}),je=()=>_.isMobilePhone()&&!t.isMessager||!!t.fullscreen,Fe=e.computed(()=>{const o=document.documentElement.clientWidth,p=document.documentElement.clientHeight,j=Math.min(l.value,o),E=t.position==="right"?"100%":i.value?"auto":`${Math.min(n.value,p-10)}px`,U=`${(window.innerHeight-(E==="100%"||E==="auto"?0:parseInt(E)))/2}px`,at=t.position==="right"?`${window.innerWidth-j}px`:`${(window.innerWidth-j)/2}px`,de={position:"absolute",top:U,left:at,width:`${j}px`,height:E};return t.mask||(de.pointerEvents="auto"),de}),ce=e.ref(_.getMaxZIndex()||1050),De=e.computed(()=>{const o={display:"block",overflow:"hidden"};return t.mask||(o.pointerEvents="none",o.backgroundColor="transparent"),I.value&&(o.backgroundColor="transparent"),o.zIndex=ce.value,o}),Pe=e.computed(()=>({"modal-content":!0,"modal-content-has-header":r.value,"is-mobile":je()})),We=e.computed(()=>{const o={display:r.value?"":"none"};return o["pointer-events"]=u.value?"auto":"none",o}),Ae=e.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:A.value})),qe=e.computed(()=>({"modal-body":!0,"f-utils-flex-column":y.value==="iframe","f-utils-fill":!0}));function $e(){return{height:`${t.footerHeight||60}px`}}const Ue=e.computed(()=>{const o={textAlgin:S.value},p=$e();return Object.assign(o,p)});function ue(o){if(o==null||o.stopPropagation(),A.value){A.value=!1,G();return}te(),A.value=!0}async function Xe(o,p){o.handle?await o.handle(p,o)&&a.emit("closed",p):(typeof o.onClick=="string"&&(o.onButtonClick=fe.cloneDeep(o.onClick||""),delete o.onClick),a.emit("buttonClick",{button:o,$event:p}))}function Ye(o){o.width&&(l.value=o.width),o.height&&(n.value=o.height),o.buttons&&(h.value=o.buttons),o.title&&(T.value=o.title)}let ne=null,le=null;e.onBeforeMount(()=>{I.value=L()}),e.onMounted(()=>{V.value&&!w.value&&(w.value=V.value.parentElement,Y.value=w.value,x(W.value,V.value,Y.value)),Q.value&&document.body.classList.add("modal-open"),ne=Ee(t,a),le=ze(t,a)}),e.onUnmounted(()=>{f&&f(),ne&&ne.remove(),le&&le.remove()}),a.expose({modalElementRef:V,updateModalOptions:Ye,close:C,maxDialog:ue,isMaximized:A});function Ke(){return e.createVNode("div",{class:"action-wrapper",onClick:o=>C(o,!1)},[e.createVNode("span",{class:"close-icon"},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])])}function Je(){return e.createVNode("ul",null,[B.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),m.value&&e.createVNode("li",{onClick:ue,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[e.createVNode("span",{class:Ae.value},null)]),v.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:o=>C(o,!1),style:"pointer-events: auto;"},[e.createVNode("span",{class:"f-icon modal_close"},null)])])}function Ze(){return e.createVNode("div",{class:"modal-footer",style:Ue.value},[h.value&&h.value.map(o=>{var E;const p=e.ref(o.disabled),j=o.class||((E=o.appearance)==null?void 0:E.class);return e.createVNode("button",{name:o.name,type:"button",disabled:p.value,class:j+(o.iconClass?" btn-icontext":"")+(o.visible===!1?"d-none":""),onClick:U=>{Xe(o,U)}},[!!o.iconClass&&e.createVNode("i",{class:o.iconClass},null),o.text])})])}function Ge(){return e.createVNode("div",{ref:W,class:"modal-header",style:We.value},[a.slots.headerTemplate?a.slots.headerTemplate():e.createVNode("div",{class:"modal-title"},[M.value&&e.createVNode("span",{class:g.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[T.value])]),e.createVNode("div",{class:"actions"},[Je()])])}function Qe(){return a.slots.footerTemplate?a.slots.footerTemplate():O.value&&Ze()}function _e(o){if(o.stopPropagation(),t.allowClickMaskToClose){if(o.target!==F.value)return;C(o,!1)}}function et(){var o,p;return e.createVNode("div",{id:d.value,class:Ie.value,style:Fe.value,ref:V},[t.showFloatingClose&&Ke(),e.createVNode("div",{class:Pe.value},[r.value&&Ge(),e.createVNode("div",{class:qe.value},[(p=(o=a.slots).default)==null?void 0:p.call(o),y.value==="iframe"&&e.createVNode("iframe",{title:d.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:b.value},null)]),Qe()]),!i.value&&V.value&&!A.value&&Z(V.value)])}function tt(o){return o||"body"}return e.watchEffect(()=>{Q.value&&(ce.value=_.getMaxZIndex()||1050)}),()=>e.createVNode(e.Teleport,{to:tt(t.host)},{default:()=>[Q.value&&e.createVNode(e.Transition,{name:"fade",appear:!0},{default:()=>[e.createVNode("div",{ref:F,class:Oe.value,style:De.value,onClick:_e},[et()])]})]})}});function re(t){if(t.content&&t.content.render)return t.content.render;if(t.render&&typeof t.render=="function")return t.render}function He(t){const a=document.createElement("div");a.style.display="contents";const l=e.createApp({setup(n,s){e.onUnmounted(()=>{document.body.removeChild(a)});const d=e.ref(),c=e.ref(t.class||""),i=e.ref(!!t.showButtons),r=e.ref(!!t.showHeader),g=e.ref(t.showCloseButton==null?!0:t.showCloseButton),v=e.ref(!!t.showFloatingClose),m=e.ref(!0),B=e.ref(t.title||""),y=t.acceptCallback||(()=>{}),b=t.rejectCallback||(()=>{}),S=t.closedCallback||(I=>{}),k=t.resizeHandle||(I=>{}),T=t.stopMoveHandle||(I=>{}),w=re(t),F=I=>{m.value=!1,l.unmount(),S(I)};return e.onMounted(()=>{}),s.expose({modalRef:d}),()=>e.createVNode(K,{ref:d,class:c.value,modelValue:m.value,"onUpdate:modelValue":I=>m.value=I,title:B.value,width:t.width,height:t.height,buttons:t.buttons,"show-header":r.value,"show-buttons":i.value,"show-close-button":g.value,"show-max-button":!1,showFloatingClose:v.value,onAccept:y,onCancel:b,fitContent:t.fitContent==null?!0:t.fitContent,onClosed:F,onResize:k,onStopMove:T},{default:()=>[w&&w(l)]})}});return document.body.appendChild(a),l.use(D.LocaleService.i18n),l.mount(a),l}class ie{constructor(a){q(this,"appContext",null);q(this,"modalRef",e.ref());q(this,"activeModalIndex",e.ref(0));q(this,"modalRefs",{});q(this,"isUseEscCloseModal",e.ref(!1));q(this,"activeModalInstance",e.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=a,this.appContext=a?a._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(a,l){const{width:n,height:s}={width:window.innerWidth,height:window.innerHeight};return n<a&&(a=n-14),s<l&&(l=s-14),{width:a,height:l}}static show(a){const l=Object.assign({title:"",showButtons:!0,showHeader:!0},a);return He(l)}close(a){var l,n;a?(n=a.value)==null||n.close():(l=this.getCurrentModal())==null||l.close()}open(a){const l=document.createDocumentFragment();a.showMaxButton&&a.fitContent&&(a.showMaxButton=!1);const n=e.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},a)),s=e.ref(!0),d=n.value.acceptCallback||(()=>{}),c=n.value.rejectCallback||(()=>{}),i=n.value.closedCallback||((C,R)=>{}),r=n.value.resizeHandle||(C=>{}),g=a.stopMoveHandle||(C=>{});let v;const m=re(n.value),B=C=>{var h;s.value=!1;const R=(h=C==null?void 0:C.target)==null?void 0:h.classList.contains("modal_close");i(C,this.isUseEscCloseModal.value?"esc":R?"icon":"button")},y=C=>{B(C),v&&e.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],e.render(null,l),v=null,this.modalRef.value=null,this.modalRefs){const R=Object.keys(this.modalRefs).map(h=>Number(h));R.length>0?this.activeModalIndex.value=Math.max(...R):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},b=C=>{var R;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((R=this.activeModalInstance.value)==null||R.close(C==null?void 0:C.event))},{width:S,height:k}=n.value,T=this.adaptToWindow(S||500,k||320);Object.assign(n.value,T);const w=()=>e.createVNode(K,e.mergeProps({ref:this.modalRef,modelValue:s.value,"onUpdate:modelValue":C=>s.value=C},n.value,{isMessager:n.value.class&&n.value.class.indexOf("modal-message")>-1,onAccept:d,onCancel:c,onClosed:y,onResize:r,onEsc:b,onStopMove:g}),{default:()=>[m&&m(this.app)]});return v=(C=>{const R=e.h(w,C);return R.appContext=this.appContext,e.render(R,l),R})({...n.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:C=>{n.value={...n.value,...C},v&&e.render(e.cloneVNode(v,{...n}),l)},destroy:y,modalRef:this.activeModalInstance,close:()=>this.close()}}}const Re=Symbol("FModalService");K.install=t=>{t.component(K.name,K);const a=new ie(t);t.provide(Re,a),t.provide("FModalService",a)};const P=class P{static show(a,l,n){let s;if(typeof a=="string"&&l!=null){const S={type:a,title:l,detail:"",...n};s=e.reactive(S)}else s=e.reactive({...a});const d=!1,c=s.type==="error"||s.type==="prompt",i=s.type==="error"?"错误提示":s.type==="prompt"&&s.title||"",r=s.acceptCallback||(()=>{}),g=s.rejectCallback||(()=>{});let v=null,m=new ie(P.app);const B=()=>{v&&(v==null||v.destroy(),m=null)};return v=m==null?void 0:m.open({class:"modal-message modal-message-type-info",title:i,showButtons:d,showHeader:c,width:s.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,dragHandle:".messager-draggable",render:()=>e.createVNode(X,e.mergeProps(s,{onAccept:r,onReject:g,onClose:B}),null)}),m==null?void 0:m.getCurrentModal()}static info(a,l){const n=e.reactive({type:"info",title:a,detail:l,okButtonText:"知道了",showCancelButton:!1});P.show(n)}static warning(a,l){const n=e.reactive({type:"warning",title:a,detail:l,okButtonText:"知道了",showCancelButton:!1});P.show(n)}static success(a,l){const n=e.reactive({type:"success",title:a,detail:l,okButtonText:"关闭",showCancelButton:!1});P.show(n)}static error(a,l,n){const s=e.reactive({width:500,type:"error",okButtonText:"关闭",showCancelButton:!1,exceptionInfo:{date:n,message:a,detail:l}});P.show(s)}static prompt(a,l){const n=e.reactive({type:"prompt",title:a,detail:l,okButtonText:"确定",cancelButtonText:"取消"});P.show(n)}static question(a,l,n,s){const d=e.reactive({type:"question",title:a,detail:l,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:n,rejectCallback:s});P.show(d)}static showHtmlMsg(a,l,n,s){P.show({type:a,title:l,detail:n,okButtonText:"关闭",acceptCallback:s})}};q(P,"app",null);let J=P;X.install=t=>{t.component(X.name,X),J.app=t,t.provide("FMessageBoxService",J)},z.FMessageBox=X,z.FMessageBoxService=J,z.default=X,z.messageBoxProps=oe,Object.defineProperties(z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { getCustomClass as g, getCustomStyle as b, withInstall as F } from "../common/index.esm.js";
|
|
2
|
+
import { defineComponent as S, ref as d, computed as u, watch as h, createVNode as n, createTextVNode as N } from "vue";
|
|
3
|
+
import { resolveAppearance as T, createPropsResolver as D } from "../dynamic-resolver/index.esm.js";
|
|
4
|
+
function x(e, l, i) {
|
|
5
|
+
return l === "dynamic" ? { navData: Array.isArray(i.bindDataSource) ? i.bindDataSource || [] : [] } : { navData: i.navData };
|
|
6
|
+
}
|
|
7
|
+
const j = /* @__PURE__ */ new Map([
|
|
8
|
+
["appearance", T],
|
|
9
|
+
["dataSourceType", x]
|
|
6
10
|
]);
|
|
7
|
-
function
|
|
8
|
-
return
|
|
11
|
+
function k(e, l, i) {
|
|
12
|
+
return l;
|
|
9
13
|
}
|
|
10
|
-
const
|
|
14
|
+
const C = "https://json-schema.org/draft/2020-12/schema", I = "https://farris-design.gitee.io/nav.schema.json", P = "nav", A = "A Farris Component", O = "object", $ = {
|
|
11
15
|
id: {
|
|
12
16
|
description: "The unique identifier for a nav",
|
|
13
17
|
type: "string"
|
|
@@ -35,171 +39,72 @@ const $ = "https://json-schema.org/draft/2020-12/schema", A = "https://farris-de
|
|
|
35
39
|
type: "object",
|
|
36
40
|
default: {}
|
|
37
41
|
},
|
|
38
|
-
|
|
39
|
-
description: "",
|
|
40
|
-
type: "boolean",
|
|
41
|
-
default: !0
|
|
42
|
-
},
|
|
43
|
-
enableLinkLabel: {
|
|
44
|
-
description: "",
|
|
45
|
-
type: "boolean",
|
|
46
|
-
default: !1
|
|
47
|
-
},
|
|
48
|
-
label: {
|
|
42
|
+
activeNavId: {
|
|
49
43
|
description: "",
|
|
50
44
|
type: "string",
|
|
51
45
|
default: ""
|
|
52
46
|
},
|
|
53
|
-
|
|
47
|
+
displayField: {
|
|
54
48
|
description: "",
|
|
55
|
-
type: "
|
|
49
|
+
type: "string",
|
|
50
|
+
default: "text"
|
|
56
51
|
},
|
|
57
|
-
|
|
52
|
+
disableField: {
|
|
58
53
|
description: "",
|
|
59
54
|
type: "string",
|
|
60
|
-
default: ""
|
|
55
|
+
default: "disable"
|
|
61
56
|
},
|
|
62
|
-
|
|
57
|
+
horizontal: {
|
|
63
58
|
description: "",
|
|
64
59
|
type: "boolean",
|
|
65
|
-
default: !
|
|
60
|
+
default: !0
|
|
66
61
|
},
|
|
67
|
-
|
|
62
|
+
idField: {
|
|
68
63
|
description: "",
|
|
69
|
-
type: "
|
|
70
|
-
default:
|
|
64
|
+
type: "string",
|
|
65
|
+
default: "id"
|
|
71
66
|
},
|
|
72
|
-
|
|
67
|
+
valueField: {
|
|
73
68
|
description: "",
|
|
74
|
-
type: "
|
|
75
|
-
default:
|
|
69
|
+
type: "string",
|
|
70
|
+
default: "num"
|
|
76
71
|
},
|
|
77
|
-
|
|
72
|
+
maxNum: {
|
|
78
73
|
description: "",
|
|
79
|
-
type: "
|
|
80
|
-
enum: [
|
|
81
|
-
"left",
|
|
82
|
-
"middle",
|
|
83
|
-
"right"
|
|
84
|
-
],
|
|
85
|
-
default: "left"
|
|
74
|
+
type: "number"
|
|
86
75
|
},
|
|
87
|
-
|
|
76
|
+
navData: {
|
|
88
77
|
description: "",
|
|
89
|
-
type: "
|
|
90
|
-
default:
|
|
78
|
+
type: "array",
|
|
79
|
+
default: []
|
|
91
80
|
},
|
|
92
|
-
|
|
81
|
+
dataSourceType: {
|
|
93
82
|
description: "",
|
|
94
83
|
type: "string",
|
|
95
|
-
default: ""
|
|
84
|
+
default: "static"
|
|
96
85
|
},
|
|
97
|
-
|
|
86
|
+
bindDataSource: {
|
|
98
87
|
description: "",
|
|
99
|
-
type: "
|
|
100
|
-
|
|
88
|
+
type: "object"
|
|
89
|
+
},
|
|
90
|
+
navPicking: {
|
|
91
|
+
description: "",
|
|
92
|
+
type: "function"
|
|
101
93
|
}
|
|
102
|
-
},
|
|
94
|
+
}, q = [
|
|
103
95
|
"id",
|
|
104
96
|
"type"
|
|
105
|
-
],
|
|
106
|
-
$schema:
|
|
107
|
-
$id:
|
|
108
|
-
title:
|
|
109
|
-
description:
|
|
110
|
-
type:
|
|
111
|
-
properties:
|
|
112
|
-
required:
|
|
113
|
-
},
|
|
114
|
-
basic: {
|
|
115
|
-
description: "Basic Infomation",
|
|
116
|
-
title: "基本信息",
|
|
117
|
-
properties: {
|
|
118
|
-
id: {
|
|
119
|
-
description: "组件标识",
|
|
120
|
-
title: "标识",
|
|
121
|
-
type: "string",
|
|
122
|
-
readonly: !0
|
|
123
|
-
},
|
|
124
|
-
type: {
|
|
125
|
-
description: "组件类型",
|
|
126
|
-
title: "控件类型",
|
|
127
|
-
type: "select",
|
|
128
|
-
editor: {
|
|
129
|
-
type: "waiting for modification",
|
|
130
|
-
enum: []
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
behavior: {
|
|
136
|
-
description: "Basic Infomation",
|
|
137
|
-
title: "行为",
|
|
138
|
-
properties: {
|
|
139
|
-
editable: {
|
|
140
|
-
description: "",
|
|
141
|
-
title: "允许编辑",
|
|
142
|
-
type: "boolean"
|
|
143
|
-
},
|
|
144
|
-
readonly: {
|
|
145
|
-
description: "",
|
|
146
|
-
title: "只读",
|
|
147
|
-
type: "string"
|
|
148
|
-
},
|
|
149
|
-
required: {
|
|
150
|
-
description: "",
|
|
151
|
-
title: "必填",
|
|
152
|
-
type: "boolean"
|
|
153
|
-
},
|
|
154
|
-
visible: {
|
|
155
|
-
description: "",
|
|
156
|
-
title: "可见",
|
|
157
|
-
type: "boolean"
|
|
158
|
-
},
|
|
159
|
-
placeholder: {
|
|
160
|
-
description: "",
|
|
161
|
-
title: "提示文本",
|
|
162
|
-
type: "string"
|
|
163
|
-
},
|
|
164
|
-
tabindex: {
|
|
165
|
-
description: "",
|
|
166
|
-
title: "tab索引",
|
|
167
|
-
type: "number"
|
|
168
|
-
},
|
|
169
|
-
textAlign: {
|
|
170
|
-
description: "",
|
|
171
|
-
title: "对齐方式",
|
|
172
|
-
type: "enum",
|
|
173
|
-
editor: {
|
|
174
|
-
type: "combo-list",
|
|
175
|
-
textField: "name",
|
|
176
|
-
valueField: "value",
|
|
177
|
-
data: [
|
|
178
|
-
{
|
|
179
|
-
value: "left",
|
|
180
|
-
name: "左对齐"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
value: "center",
|
|
184
|
-
name: "居中"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
value: "right",
|
|
188
|
-
name: "右对齐"
|
|
189
|
-
}
|
|
190
|
-
]
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}, E = {
|
|
196
|
-
title: w,
|
|
197
|
-
description: O,
|
|
198
|
-
type: V,
|
|
199
|
-
categories: W
|
|
200
|
-
}, h = {
|
|
97
|
+
], w = {
|
|
98
|
+
$schema: C,
|
|
99
|
+
$id: I,
|
|
100
|
+
title: P,
|
|
101
|
+
description: A,
|
|
102
|
+
type: O,
|
|
103
|
+
properties: $,
|
|
104
|
+
required: q
|
|
105
|
+
}, c = {
|
|
201
106
|
/** 当前激活的id */
|
|
202
|
-
activeNavId: { Type: String, default: "
|
|
107
|
+
activeNavId: { Type: String, default: "" },
|
|
203
108
|
/** 导航文本字段 */
|
|
204
109
|
displayField: { Type: String, default: "text" },
|
|
205
110
|
/** 控制禁用字段 */
|
|
@@ -213,197 +118,79 @@ const $ = "https://json-schema.org/draft/2020-12/schema", A = "https://farris-de
|
|
|
213
118
|
/** 导航数据 */
|
|
214
119
|
navData: {
|
|
215
120
|
Type: Array,
|
|
216
|
-
default: [
|
|
217
|
-
{
|
|
218
|
-
id: "1",
|
|
219
|
-
text: "全部"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
id: "2",
|
|
223
|
-
text: "已回复",
|
|
224
|
-
disable: !0
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
id: "3",
|
|
228
|
-
text: "待回复",
|
|
229
|
-
num: 200
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
id: "4",
|
|
233
|
-
text: "@我",
|
|
234
|
-
num: 33
|
|
235
|
-
}
|
|
236
|
-
]
|
|
121
|
+
default: []
|
|
237
122
|
},
|
|
238
123
|
/** 切换前事件 */
|
|
239
124
|
navPicking: {
|
|
240
125
|
type: Function,
|
|
241
|
-
default: () => (
|
|
126
|
+
default: () => (e) => !0
|
|
242
127
|
},
|
|
243
128
|
/** 徽标值字段 */
|
|
244
|
-
valueField: { Type: String, default: "num" }
|
|
245
|
-
|
|
129
|
+
valueField: { Type: String, default: "num" },
|
|
130
|
+
visible: { Type: Boolean, default: !0 },
|
|
131
|
+
customClass: { Type: String, default: "" },
|
|
132
|
+
customStyle: { Type: String, default: "" }
|
|
133
|
+
}, V = D(c, w, j, k), z = /* @__PURE__ */ S({
|
|
246
134
|
name: "FNav",
|
|
247
|
-
props:
|
|
135
|
+
props: c,
|
|
248
136
|
emits: ["nav", "update:activeNavId"],
|
|
249
|
-
setup(
|
|
250
|
-
const i = d(
|
|
137
|
+
setup(e, l) {
|
|
138
|
+
const i = d(e.activeNavId), r = d(e.navData), o = d(e.navPicking), v = u(() => ({
|
|
251
139
|
paddingTop: "1rem"
|
|
252
140
|
}));
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
get() {
|
|
258
|
-
return v.value;
|
|
259
|
-
},
|
|
260
|
-
set(a) {
|
|
261
|
-
v.value = a, g();
|
|
262
|
-
}
|
|
263
|
-
}), o = c({
|
|
264
|
-
get() {
|
|
265
|
-
return i.value;
|
|
266
|
-
},
|
|
267
|
-
set(a) {
|
|
268
|
-
if (i.value = a, i.value && r && r.value.length) {
|
|
269
|
-
const e = r.value.find((n) => n.id === i.value);
|
|
270
|
-
e && s.emit("nav", e);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}), m = c({
|
|
274
|
-
set(a) {
|
|
275
|
-
u.value = a;
|
|
276
|
-
},
|
|
277
|
-
get() {
|
|
278
|
-
return u.value;
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
function g() {
|
|
282
|
-
if (r.value && r.value.length && !i.value) {
|
|
283
|
-
const a = r.value.find((e) => !e.disable);
|
|
284
|
-
a && (i.value = a.id);
|
|
141
|
+
function f(a) {
|
|
142
|
+
if (r.value && r.value.length) {
|
|
143
|
+
let t = r.value.find((s) => s[e.idField] === a && s[e.disableField] !== !0);
|
|
144
|
+
t || (t = r.value.find((s) => s[e.disableField] !== !0)), t && i.value !== t.id && (i.value = a, l.emit("nav", t));
|
|
285
145
|
}
|
|
286
146
|
}
|
|
147
|
+
h([e.activeNavId, e.navData], ([a, t]) => {
|
|
148
|
+
r.value = t, f(a);
|
|
149
|
+
});
|
|
287
150
|
function y(a) {
|
|
288
|
-
a.disable || a.id === i.value || Promise.resolve().then(() =>
|
|
289
|
-
|
|
151
|
+
a.disable || a.id === i.value || Promise.resolve().then(() => o.value(a)).then((t) => {
|
|
152
|
+
t && (i.value = a.id, l.emit("update:activeNavId", a.id), l.emit("nav", a));
|
|
290
153
|
});
|
|
291
154
|
}
|
|
155
|
+
const p = u(() => {
|
|
156
|
+
const a = {
|
|
157
|
+
"farris-nav": !0,
|
|
158
|
+
"farris-nav-vertical": !e.horizontal
|
|
159
|
+
};
|
|
160
|
+
return g(a, e.customClass);
|
|
161
|
+
}), m = u(() => b({}, e.customStyle));
|
|
292
162
|
return () => {
|
|
293
163
|
var a;
|
|
294
|
-
return
|
|
295
|
-
class:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}, [(a = r.value) == null ? void 0 : a.map((e) => l("div", {
|
|
164
|
+
return n("div", {
|
|
165
|
+
class: p.value,
|
|
166
|
+
style: m.value
|
|
167
|
+
}, [(a = r.value) == null ? void 0 : a.map((t) => n("div", {
|
|
299
168
|
class: ["farris-nav-item", {
|
|
300
|
-
active: e
|
|
169
|
+
active: t[e.idField] === i.value
|
|
301
170
|
}, {
|
|
302
|
-
disabled: e
|
|
171
|
+
disabled: t[e.disableField]
|
|
303
172
|
}],
|
|
304
|
-
onClick: () => y(
|
|
305
|
-
}, [
|
|
173
|
+
onClick: () => y(t)
|
|
174
|
+
}, [n("div", {
|
|
306
175
|
class: "farris-nav-item-link",
|
|
307
|
-
style:
|
|
308
|
-
}, [
|
|
176
|
+
style: v.value
|
|
177
|
+
}, [n("span", {
|
|
309
178
|
class: "farris-nav-item-link-text"
|
|
310
|
-
}, [typeof e
|
|
179
|
+
}, [typeof t[e.displayField] == "function" ? t[e.displayField]() : t[e.displayField], t[e.valueField] && n("div", {
|
|
311
180
|
class: "farris-nav-item-tag"
|
|
312
|
-
}, [e
|
|
181
|
+
}, [t[e.valueField] <= e.maxNum && n("span", {
|
|
313
182
|
class: "tag-text"
|
|
314
|
-
}, [e
|
|
183
|
+
}, [t[e.valueField]]), t[e.valueField] > e.maxNum && n("span", {
|
|
315
184
|
class: "tag-text"
|
|
316
|
-
}, [
|
|
185
|
+
}, [e.maxNum, N("+")])])]), n("div", {
|
|
317
186
|
class: "farris-nav-item-bottom-line"
|
|
318
187
|
}, null)])]))]);
|
|
319
188
|
};
|
|
320
189
|
}
|
|
321
|
-
}),
|
|
322
|
-
name: "FNavDesign",
|
|
323
|
-
props: h,
|
|
324
|
-
emits: ["nav"],
|
|
325
|
-
setup(t, s) {
|
|
326
|
-
const i = d(t.activeNavId), v = d(t.navData), u = d(t.horizontal);
|
|
327
|
-
d(t.navPicking);
|
|
328
|
-
const p = d(), f = D("design-item-context"), r = z(p, f);
|
|
329
|
-
T(() => {
|
|
330
|
-
p.value.componentInstance = r;
|
|
331
|
-
}), s.expose(r.value);
|
|
332
|
-
const o = c({
|
|
333
|
-
get() {
|
|
334
|
-
return v.value;
|
|
335
|
-
},
|
|
336
|
-
set(e) {
|
|
337
|
-
v.value = e, y();
|
|
338
|
-
}
|
|
339
|
-
}), m = c({
|
|
340
|
-
get() {
|
|
341
|
-
return i.value;
|
|
342
|
-
},
|
|
343
|
-
set(e) {
|
|
344
|
-
if (i.value = e, i.value && o && o.value.length) {
|
|
345
|
-
const n = o.value.find((k) => k.id === i.value);
|
|
346
|
-
n && s.emit("nav", n);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}), g = c({
|
|
350
|
-
set(e) {
|
|
351
|
-
u.value = e;
|
|
352
|
-
},
|
|
353
|
-
get() {
|
|
354
|
-
return u.value;
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
function y() {
|
|
358
|
-
if (o.value && o.value.length && !i.value) {
|
|
359
|
-
const e = o.value.find((n) => !n.disable);
|
|
360
|
-
e && (i.value = e.id);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
function a(e) {
|
|
364
|
-
e.disable || e.id === i.value || (i.value = e.id, s.emit("nav", e));
|
|
365
|
-
}
|
|
366
|
-
return () => {
|
|
367
|
-
var e;
|
|
368
|
-
return l("div", {
|
|
369
|
-
ref: p,
|
|
370
|
-
class: ["farris-nav", {
|
|
371
|
-
"farris-nav-vertical": !g.value
|
|
372
|
-
}]
|
|
373
|
-
}, [(e = o.value) == null ? void 0 : e.map((n) => l("div", {
|
|
374
|
-
class: ["farris-nav-item", {
|
|
375
|
-
active: n.id === m.value
|
|
376
|
-
}, {
|
|
377
|
-
disabled: n.disable
|
|
378
|
-
}],
|
|
379
|
-
onClick: () => a(n)
|
|
380
|
-
}, [l("div", {
|
|
381
|
-
class: "farris-nav-item-link"
|
|
382
|
-
}, [l("span", {
|
|
383
|
-
class: "farris-nav-item-link-text"
|
|
384
|
-
}, [n.text, n.num && l("div", {
|
|
385
|
-
class: "farris-nav-item-tag"
|
|
386
|
-
}, [n.num <= t.maxNum && l("span", {
|
|
387
|
-
class: "tag-text"
|
|
388
|
-
}, [n.num]), n.num > t.maxNum && l("span", {
|
|
389
|
-
class: "tag-text"
|
|
390
|
-
}, [t.maxNum, F("+")])])])])]))]);
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
}), Q = {
|
|
394
|
-
install(t) {
|
|
395
|
-
t.component(b.name, b);
|
|
396
|
-
},
|
|
397
|
-
register(t, s, i, v) {
|
|
398
|
-
t.nav = b, s.nav = N;
|
|
399
|
-
},
|
|
400
|
-
registerDesigner(t, s, i) {
|
|
401
|
-
t.nav = G, s.nav = N;
|
|
402
|
-
}
|
|
403
|
-
};
|
|
190
|
+
}), L = F(z);
|
|
404
191
|
export {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
192
|
+
z as FNav,
|
|
193
|
+
L as default,
|
|
194
|
+
c as navProps,
|
|
195
|
+
V as propsResolver
|
|
409
196
|
};
|