@farris/ui-vue 1.2.5 → 1.2.6
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/accordion/package.json +1 -1
- package/components/avatar/index.esm.js +124 -116
- package/components/avatar/index.umd.cjs +1 -1
- package/components/avatar/package.json +1 -1
- package/components/border-editor/package.json +1 -1
- package/components/button/package.json +1 -1
- package/components/button-edit/index.css +1 -0
- package/components/button-edit/package.json +1 -1
- package/components/button-group/package.json +1 -1
- package/components/calculator/package.json +1 -1
- package/components/calendar/package.json +1 -1
- package/components/capsule/package.json +1 -1
- package/components/checkbox/index.esm.js +219 -209
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/checkbox/package.json +1 -1
- package/components/color-picker/package.json +1 -1
- package/components/combo-list/index.esm.js +36 -28
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-list/package.json +1 -1
- package/components/combo-tree/index.esm.js +340 -107
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/combo-tree/package.json +1 -1
- package/components/common/package.json +1 -1
- package/components/component/index.esm.js +36 -29
- package/components/component/index.umd.cjs +1 -1
- package/components/component/package.json +1 -1
- package/components/condition/index.esm.js +318 -316
- package/components/condition/index.umd.cjs +1 -1
- package/components/condition/package.json +1 -1
- package/components/content-container/index.esm.js +9 -13
- package/components/content-container/index.umd.cjs +1 -1
- package/components/content-container/package.json +1 -1
- package/components/{tree-grid/style.css → data-grid/index.css} +1 -1
- package/components/data-grid/index.esm.js +3771 -3622
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-grid/package.json +1 -1
- package/components/data-view/index.esm.js +2408 -2405
- package/components/data-view/index.umd.cjs +1 -1
- package/components/data-view/package.json +1 -1
- package/components/date-picker/index.esm.js +250 -242
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/date-picker/package.json +1 -1
- package/components/designer-canvas/index.esm.js +23 -20
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-canvas/package.json +1 -1
- package/components/designer-outline/package.json +1 -1
- package/components/designer-toolbox/package.json +1 -1
- package/components/discussion-editor/package.json +1 -1
- package/components/discussion-list/package.json +1 -1
- package/components/drawer/package.json +1 -1
- package/components/dropdown/index.esm.js +86 -86
- package/components/dropdown/index.umd.cjs +1 -1
- package/components/dropdown/package.json +1 -1
- package/components/dynamic-form/index.esm.js +575 -565
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-form/package.json +1 -1
- package/components/dynamic-resolver/index.esm.js +56 -47
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-resolver/package.json +1 -1
- package/components/dynamic-view/index.esm.js +281 -277
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/dynamic-view/package.json +1 -1
- package/components/enum-editor/package.json +1 -1
- package/components/events-editor/package.json +1 -1
- package/components/expression-editor/package.json +1 -1
- package/components/external-container/index.css +1 -0
- package/components/external-container/index.esm.js +1795 -1783
- package/components/external-container/index.umd.cjs +1 -1
- package/components/external-container/package.json +1 -1
- package/components/field-selector/index.css +1 -0
- package/components/field-selector/index.esm.js +3914 -3769
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/field-selector/package.json +1 -1
- package/components/filter-bar/{style.css → index.css} +1 -1
- package/components/filter-bar/index.esm.js +475 -465
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-bar/package.json +1 -1
- package/components/flow-canvas/index.esm.js +37 -34
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/flow-canvas/package.json +1 -1
- package/components/image-cropper/package.json +1 -1
- package/components/input-group/index.esm.js +256 -248
- package/components/input-group/index.umd.cjs +1 -1
- package/components/input-group/package.json +1 -1
- package/components/layout/package.json +1 -1
- package/components/list-nav/package.json +1 -1
- package/components/list-view/index.esm.js +1445 -1446
- package/components/list-view/index.umd.cjs +1 -1
- package/components/list-view/package.json +1 -1
- package/components/loading/package.json +1 -1
- package/components/locale/package.json +1 -1
- package/components/lookup/index.css +1 -0
- package/components/lookup/index.esm.js +4347 -4145
- package/components/lookup/index.umd.cjs +1 -1
- package/components/lookup/package.json +1 -1
- package/components/mapping-editor/index.css +1 -0
- package/components/mapping-editor/index.esm.js +4657 -4475
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/mapping-editor/package.json +1 -1
- package/components/message-box/index.css +1 -0
- package/components/message-box/index.esm.js +397 -386
- package/components/message-box/index.umd.cjs +1 -1
- package/components/message-box/package.json +1 -1
- package/components/modal/index.css +1 -0
- package/components/modal/index.esm.js +308 -297
- package/components/modal/index.umd.cjs +1 -1
- package/components/modal/package.json +1 -1
- package/components/nav/package.json +1 -1
- package/components/notify/package.json +1 -1
- package/components/order/index.esm.js +353 -345
- package/components/order/index.umd.cjs +1 -1
- package/components/order/package.json +1 -1
- package/components/page-footer/package.json +1 -1
- package/components/page-header/index.esm.js +917 -893
- package/components/page-header/index.umd.cjs +1 -1
- package/components/page-header/package.json +1 -1
- package/components/pagination/package.json +1 -1
- package/components/popover/package.json +1 -1
- package/components/progress/package.json +1 -1
- package/components/property-editor/index.esm.js +108 -101
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-editor/package.json +1 -1
- package/components/property-panel/index.esm.js +394 -384
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/property-panel/package.json +1 -1
- package/components/radio-button/package.json +1 -1
- package/components/radio-group/index.esm.js +72 -64
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/radio-group/package.json +1 -1
- package/components/rate/package.json +1 -1
- package/components/response-layout/package.json +1 -1
- package/components/response-layout-editor/{style.css → index.css} +1 -1
- package/components/response-layout-editor/index.esm.js +404 -393
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-layout-editor/package.json +1 -1
- package/components/response-toolbar/index.esm.js +610 -592
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/response-toolbar/package.json +1 -1
- package/components/schema-selector/index.css +1 -0
- package/components/schema-selector/index.esm.js +3654 -3408
- package/components/schema-selector/index.umd.cjs +8 -1
- package/components/schema-selector/package.json +1 -1
- package/components/search-box/package.json +1 -1
- package/components/section/index.esm.js +21 -14
- package/components/section/index.umd.cjs +1 -1
- package/components/section/package.json +1 -1
- package/components/smoke-detector/package.json +1 -1
- package/components/spacing-editor/package.json +1 -1
- package/components/splitter/package.json +1 -1
- package/components/step/package.json +1 -1
- package/components/switch/index.esm.js +79 -71
- package/components/switch/index.umd.cjs +1 -1
- package/components/switch/package.json +1 -1
- package/components/tabs/index.css +1 -0
- package/components/tabs/index.esm.js +1448 -1406
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tabs/package.json +1 -1
- package/components/tags/package.json +1 -1
- package/components/text/package.json +1 -1
- package/components/textarea/index.esm.js +86 -78
- package/components/textarea/index.umd.cjs +1 -1
- package/components/textarea/package.json +1 -1
- package/components/time-picker/index.css +1 -0
- package/components/time-picker/index.esm.js +387 -379
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/time-picker/package.json +1 -1
- package/components/tooltip/package.json +1 -1
- package/components/transfer/package.json +1 -1
- package/components/{data-grid/style.css → tree-grid/index.css} +1 -1
- package/components/tree-grid/index.esm.js +3769 -3620
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-grid/package.json +1 -1
- package/components/tree-view/index.esm.js +2041 -2038
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/tree-view/package.json +1 -1
- package/components/uploader/package.json +1 -1
- package/components/verify-detail/package.json +1 -1
- package/components/video/package.json +1 -1
- package/components/weather/package.json +1 -1
- package/farris.all.esm.js +12423 -11981
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -0
- package/package.json +2 -2
- package/types/combo-tree/src/combo-tree.props.d.ts +4 -0
- package/types/combo-tree/src/components/tree-container.component.d.ts +13 -3
- package/types/combo-tree/src/components/tree-container.props.d.ts +15 -1
- package/types/combo-tree/src/schema/schema-mapper.d.ts +2 -0
- package/types/combo-tree/src/schema/schema-resolver.d.ts +2 -0
- package/types/components.d.ts +1 -0
- package/types/data-grid/index.d.ts +5 -5
- package/types/data-grid/src/data-grid.component.d.ts +2 -2
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/property-config/data-grid.property-config.d.ts +1 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +8 -8
- package/types/designer-canvas/src/composition/types.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/converter/pagination.converter.d.ts +6 -0
- package/types/dynamic-resolver/src/visible-prop-resolver.d.ts +3 -0
- package/types/lookup/src/designer/use-lookup-rules.d.ts +3 -0
- package/types/lookup/src/property-config/converters/lookup-property.converter.d.ts +8 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +29 -25
- package/types/mapping-editor/src/mapping-editor.props.d.ts +8 -0
- package/types/modal/src/modal.component.d.ts +3 -3
- package/types/modal/src/modal.props.d.ts +3 -5
- package/types/page-header/src/page-header.props.d.ts +7 -0
- package/types/page-header/src/property-config/page-header.property-config.d.ts +1 -1
- package/types/property-panel/src/composition/entity/base-property.d.ts +2 -0
- package/types/response-toolbar/index.d.ts +9 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
- package/types/response-toolbar/src/response-toolbar.component.d.ts +4 -2
- package/types/response-toolbar/src/response-toolbar.props.d.ts +9 -2
- package/types/schema-selector/src/composition/types.d.ts +3 -1
- package/types/schema-selector/src/schema-selector-editor.component.d.ts +5 -1
- package/types/tabs/src/designer/tab-toolbar.design.component.d.ts +1 -1
- package/types/tabs/src/tabs.props.d.ts +8 -0
- package/components/button-edit/style.css +0 -1
- package/components/external-container/style.css +0 -1
- package/components/field-selector/style.css +0 -1
- package/components/lookup/style.css +0 -1
- package/components/mapping-editor/style.css +0 -1
- package/components/message-box/style.css +0 -1
- package/components/modal/style.css +0 -1
- package/components/schema-selector/style.css +0 -1
- package/components/tabs/style.css +0 -1
- package/components/time-picker/style.css +0 -1
- package/style.css +0 -1
- package/types/tabs/src/designer/tab-toolbar-item.props.d.ts +0 -19
- /package/components/border-editor/{style.css → index.css} +0 -0
- /package/components/checkbox/{style.css → index.css} +0 -0
- /package/components/date-picker/{style.css → index.css} +0 -0
- /package/components/designer-canvas/{style.css → index.css} +0 -0
- /package/components/designer-outline/{style.css → index.css} +0 -0
- /package/components/designer-toolbox/{style.css → index.css} +0 -0
- /package/components/discussion-editor/{style.css → index.css} +0 -0
- /package/components/discussion-list/{style.css → index.css} +0 -0
- /package/components/drawer/{style.css → index.css} +0 -0
- /package/components/events-editor/{style.css → index.css} +0 -0
- /package/components/flow-canvas/{style.css → index.css} +0 -0
- /package/components/list-view/{style.css → index.css} +0 -0
- /package/components/order/{style.css → index.css} +0 -0
- /package/components/property-editor/{style.css → index.css} +0 -0
- /package/components/property-panel/{style.css → index.css} +0 -0
- /package/components/radio-button/{style.css → index.css} +0 -0
- /package/components/radio-group/{style.css → index.css} +0 -0
- /package/components/smoke-detector/{style.css → index.css} +0 -0
- /package/components/spacing-editor/{style.css → index.css} +0 -0
- /package/components/splitter/{style.css → index.css} +0 -0
- /package/components/switch/{style.css → index.css} +0 -0
- /package/components/transfer/{style.css → index.css} +0 -0
- /package/components/uploader/{style.css → index.css} +0 -0
- /package/components/weather/{style.css → index.css} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(U,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("@farris/ui-vue/components/capsule"),require("@farris/ui-vue/components/response-toolbar"),require("@farris/ui-vue/components/dynamic-resolver"),require("@farris/ui-vue/components/section"),require("@farris/ui-vue/components/designer-canvas/src/composition/function/use-designer-inner-component"),require("bignumber.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","@farris/ui-vue/components/capsule","@farris/ui-vue/components/response-toolbar","@farris/ui-vue/components/dynamic-resolver","@farris/ui-vue/components/section","@farris/ui-vue/components/designer-canvas/src/composition/function/use-designer-inner-component","bignumber.js"],e):(U=typeof globalThis<"u"?globalThis:U||self,e(U.tabs={},U.Vue,U.LodashES,U.FCapsule,U.FResponseToolbar,U.dynamicResolver,U.FSection$1,U.useDesignerInnerComponent$1))})(this,function(U,e,se,Ye,Ve,Ze,Je,Be){"use strict";var Bn=Object.defineProperty;var kn=(U,e,se)=>e in U?Bn(U,e,{enumerable:!0,configurable:!0,writable:!0,value:se}):U[e]=se;var L=(U,e,se)=>kn(U,typeof e!="symbol"?e+"":e,se);const he={},ke={};function ye(n){const{properties:t,title:o}=n,a=Object.keys(t).reduce((s,r)=>(s[r]=t[r].type==="object"&&t[r].properties?ye(t[r]):se.cloneDeep(t[r].default),s),{});return a.id=`${o}-${Date.now()}`,a}function Y(n,t={}){const o=he[n];if(o){let a=ye(o);const s=ke[n];return a=s?s({getSchemaByType:Y},a,t):a,a}return null}function Ke(n,t){const o=ye(t);return Object.keys(n).reduce((a,s)=>(a[s]=n[s],a),o),o}function et(n,t){return Object.keys(n).filter(a=>n[a]!=null).reduce((a,s)=>{if(t.has(s)){const r=t.get(s);if(typeof r=="string")a[r]=n[s];else{const d=r(s,n[s],n);Object.assign(a,d)}}else a[s]=n[s];return a},{})}function tt(n,t,o=new Map){const a=Ke(n,t);return et(a,o)}function nt(n={}){function t(l,v,w,S){if(typeof w=="number")return S[l].length===w;if(typeof w=="object"){const x=Object.keys(w)[0],y=w[x];if(x==="not")return Number(S[l].length)!==Number(y);if(x==="moreThan")return Number(S[l].length)>=Number(y);if(x==="lessThan")return Number(S[l].length)<=Number(y)}return!1}function o(l,v,w,S){return S[l]&&S[l].propertyValue&&String(S[l].propertyValue.value)===String(w)}const a=new Map([["length",t],["getProperty",o]]);Object.keys(n).reduce((l,v)=>(l.set(v,n[v]),l),a);function s(l,v){const w=l;return typeof v=="number"?[{target:w,operator:"length",param:null,value:Number(v)}]:typeof v=="boolean"?[{target:w,operator:"getProperty",param:l,value:!!v}]:typeof v=="object"?Object.keys(v).map(S=>{if(S==="length")return{target:w,operator:"length",param:null,value:v[S]};const x=S,y=v[S];return{target:w,operator:"getProperty",param:x,value:y}}):[]}function r(l){return Object.keys(l).reduce((w,S)=>{const x=s(S,l[S]);return w.push(...x),w},[])}function d(l,v){if(a.has(l.operator)){const w=a.get(l.operator);return w&&w(l.target,l.param,l.value,v)||!1}return!1}function f(l,v){return r(l).reduce((x,y)=>x&&d(y,v),!0)}function h(l,v){const w=Object.keys(l),S=w.includes("allOf"),x=w.includes("anyOf"),y=S||x,c=(y?l[y?S?"allOf":"anyOf":"allOf"]:[l]).map(N=>f(N,v));return S?!c.includes(!1):c.includes(!0)}return{parseValueSchema:h}}const O={Button:{type:"Button",name:"按钮",icon:"Button"},ButtonGroup:{type:"ButtonGroup",name:"按钮组",icon:"ButtonGroup"},ToolBar:{type:"ToolBar",name:"工具栏",icon:"ButtonGroup"},ToolBarItem:{type:"ToolBarItem",name:"工具栏项",icon:"Button"},ContentContainer:{type:"ContentContainer",name:"容器",icon:"ContentContainer"},DisplayField:{type:"DisplayField",name:"标签",icon:"DisplayField"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},FlexLayout:{type:"FlexLayout",name:"弹性布局"},FlowLayout:{type:"FlowLayout",name:"流布局"},ResponseLayout:{type:"ResponseLayout",name:"布局容器",icon:"ResponseLayout3"},ResponseLayoutItem:{type:"ResponseLayoutItem",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},TreeGridField:{type:"TreeGridField",name:"树表格列"},FieldSet:{type:"FieldSet",name:"分组",icon:"FieldSet"},Form:{type:"Form",name:"卡片面板",icon:"Form"},QueryForm:{type:"QueryForm",name:"查询面板",icon:"Form"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},Panel:{type:"Panel",name:"面板",icon:"ContentContainer"},Module:{type:"Module",name:"模块",icon:"Module"},Component:{type:"Component",name:"组件",icon:"Component"},ExternalContainer:{type:"ExternalContainer",name:"外部容器",icon:"ContentContainer"},Image:{type:"Image",name:"图像",icon:"Image"},ImageUpload:{type:"ImageUpload",name:"图片上传",icon:"imageupload"},HiddenContainer:{type:"HiddenContainer",name:"隐藏区域",icon:"ContentContainer"},ModalContainer:{type:"ModalContainer",name:"弹窗容器",icon:"ContentContainer"},RouteContainer:{type:"RouteContainer",name:"路由区域",icon:"ContentContainer"},Tab:{type:"Tab",name:"标签页",icon:"Tab"},TabPage:{type:"TabPage",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},Tag:{type:"Tag",name:"Tag",icon:"Tag"},Sidebar:{type:"Sidebar",name:"侧边栏",icon:"Sidebar"},HtmlTemplate:{type:"HtmlTemplate",name:"模版容器",icon:"HtmlTemplate"},ListView:{type:"ListView",name:"列表",icon:"ListView"},RichTextBox:{type:"RichTextBox",name:"富文本",icon:"RichTextBox"},TimeSpinner:{type:"TimeSpinner",name:"时间调节器",icon:"TimePicker"},TimePicker:{type:"TimePicker",name:"时间选择",icon:"TimePicker"},Section:{type:"Section",name:"分组面板",icon:"Section"},SectionToolbar:{type:"SectionToolbar",name:"分组面板工具栏"},SectionToolbarItem:{type:"SectionToolbarItem",name:"分组面板按钮"},QueryScheme:{type:"QueryScheme",name:"筛选方案",icon:"QueryScheme"},FormHeader:{type:"FormHeader",name:"翻页"},Splitter:{type:"Splitter",name:"分栏面板",icon:"Splitter"},SplitterPane:{type:"SplitterPane",name:"分栏面板项",dependentParentControl:"Splitter"},WizardDetail:{type:"WizardDetail",name:"向导详情页"},WizardDetailContainer:{type:"WizardDetailContainer",name:"向导详情容器"},Wizard:{type:"Wizard",name:"向导",icon:"Wizard"},MultiSelect:{type:"MultiSelect",name:"数据分配",icon:"MultiSelect"},Steps:{type:"Steps",name:"步骤条",icon:"Steps"},avatar:{type:"avatar",name:"头像",icon:"Avatar"},ListFilter:{type:"ListFilter",name:"筛选条",icon:"ListFilter"},ListNav:{type:"ListNav",name:"列表导航",icon:"ListNav"},NumberRange:{type:"NumberRange",name:"数字区间选择",icon:"NumericBox"},Scrollspy:{type:"Scrollspy",name:"滚动监听",icon:"Scrollspy"},LanguageTextBox:{type:"LanguageTextBox",name:"多语言输入框",icon:"LanguageTextBox"},ComponentRef:{type:"ComponentRef",name:"组件引用节点"},FileUpload:{type:"FileUpload",name:"附件上传",icon:"FileUpload"},FilePreview:{type:"FilePreview",name:"附件预览",icon:"FilePreview"},ViewChange:{type:"ViewChange",name:"多视图切换",icon:"Button"},MultiViewContainer:{type:"MultiViewContainer",name:"多视图",icon:"MultiViewContainer"},MultiViewItem:{type:"MultiViewItem",name:"多视图项",dependentParentControl:"MultiViewContainer"},Footer:{type:"Footer",name:"页脚"},DiscussionEditor:{type:"DiscussionEditor",name:"评论编辑区",icon:"DiscussionEditor"},DiscussionList:{type:"DiscussionList",name:"评论列表",icon:"DiscussionList"},NavTab:{type:"NavTab",name:"标签类导航",icon:"NavTab"},Tags:{type:"Tags",name:"标记组",icon:"Tags"},Portlet:{type:"Portlet",name:"小部件",icon:"dingzhi"},Header:{type:"Header",name:"页头",icon:"Header"},ModalFooter:{type:"ModalFooter",name:"弹窗页脚",icon:"ModalFooter"},ScrollCollapsibleArea:{type:"ScrollCollapsibleArea",name:"滚动收折区域",icon:"ScrollCollapsibleArea"},PersonnelSelector:{type:"PersonnelSelector",name:"人员选择",icon:"PersonnelSelector"},Table:{type:"Table",name:"表格",icon:"DataGrid"},LoopContainer:{type:"LoopContainer",name:"循环容器",icon:"ContentContainer"},FileUploadPreview:{type:"FileUploadPreview",name:"附件上传预览",icon:"FileUpload"},DynamicArea:{type:"DynamicArea",name:"动态区域",icon:"ContentContainer"},DynamicAreaItem:{type:"DynamicAreaItem",name:"动态区域项",icon:"ContentContainer"},TabToolbar:{type:"TabToolbar",name:"标签页工具栏",icon:"TabToolbar"},HeaderToolBar:{type:"HeaderToolBar",name:"头部组件工具栏",icon:"HeaderToolBar"},ModalFooterToolBar:{type:"ModalFooterToolBar",name:"底部组件工具栏",icon:"ModalFooterToolBar"},HeaderToolBarItem:{type:"HeaderToolBarItem",name:"头部组件工具栏按钮",icon:"HeaderToolBarItem"},ModalFooterToolBarItem:{type:"ModalFooterToolBarItem",name:"底部组件工具栏按钮",icon:"ModalFooterToolBarItem"},OrganizationSelector:{type:"OrganizationSelector",name:"组织选择",icon:"OrganizationSelector"},AdminOrganizationSelector:{type:"AdminOrganizationSelector",name:"组织选择",icon:"OrganizationSelector"},EmployeeSelector:{type:"EmployeeSelector",name:"人员选择",icon:"PersonnelSelector"},OaRelation:{type:"OaRelation",name:"关联行政审批",icon:"TextBox"},CitySelector:{type:"CitySelector",name:"城市选择",icon:"CitySelector"},ExtIntergration:{type:"ExtIntergration",name:"外部服务集成",icon:"ViewModel"},AppointmentCalendar:{type:"AppointmentCalendar",name:"预约日历",icon:"DateBox"},Charts:{type:"Charts",name:"图表",icon:"Charts"},QdpFramework:{type:"QdpFramework",name:"查询结果工具栏",icon:"QdpFramework"},SpreadSheet:{type:"SpreadSheet",name:"查询表格控件",icon:"Charts"},QdpConditionDialog:{type:"QdpConditionDialog",name:"查询筛选对话框",icon:"ContentContainer"},QdpConditionDialogTab:{type:"QdpConditionDialogTab",name:"查询筛选标签页",icon:"Tab"},ApprovalLogs:{type:"ApprovalLogs",name:"审批记录",icon:"ApprovalLogs"},ApprovalComments:{type:"ApprovalComments",name:"审批意见",icon:"shenpiyijian"}},Pe={},ot={};nt();function ie(n,t,o=new Map,a=(d,f,h)=>f,s={},r=d=>d){return he[t.title]=t,ke[t.title]=a,Pe[t.title]=s,ot[t.title]=r,(d={})=>{const f=tt(d,t,o),h=Object.keys(n).reduce((l,v)=>(l[v]=n[v].default,l),{});return Object.assign(h,f)}}function ge(n,t){return{customClass:t.class,customStyle:t.style}}const at=new Map([["appearance",ge]]);function st(n,t,o){const a=n.getSchemaByType("tab-page");return t.contents=[a],t}const rt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tabs.schema.json",title:"tabs",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Tabs",type:"string"},type:{description:"The type string of Tabs component",type:"string",default:"tabs"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},autoTitleWidth:{description:"",type:"boolean",default:!1},titleLength:{description:"",type:"number",default:7},fill:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]},le={tabType:{type:String,default:"default"},autoTitleWidth:{type:Boolean,default:!1},titleLength:{type:Number,default:7},position:{type:String,default:"top"},showDropdown:{type:Boolean,default:!0},scrollStep:{type:Number,default:10},autoResize:{type:Boolean,default:!1},selectedTab:{type:String,default:""},width:{type:Number},height:{type:Number},searchBoxVisible:{type:Boolean,default:!0},titleWidth:{type:Number,default:0},customClass:{type:String,default:""},activeId:{type:String},fill:{type:Boolean,default:!1},justifyContent:{type:String,default:"left"}},be=ie(le,rt,at,st);function it(n,t,o){const a=e.ref([]),s=e.ref(n.activeId||""),r=e.ref(!0),d=e.ref([]);e.watch(()=>n.activeId,(u,m)=>{u!==m&&(s.value=u)});function f(u){const m=u.value.findIndex(c=>c.props.show!==!1&&!s.value&&!c.props.disabled);!s.value&&m!==-1&&(s.value=u.value[m].props.id)}function h(u){var c;if(n.autoTitleWidth)return;const m=(c=u.value)==null?void 0:c.querySelectorAll(".st-tab-text");if(m)for(let T=0;T<m.length;T++){const N=m[T].parentNode;m[T].scrollWidth>N.offsetWidth?m[T].classList.contains("farris-title-text-custom")||m[T].classList.add("farris-title-text-custom"):m[T].classList.remove("farris-title-text-custom")}}const l=u=>{u.preventDefault(),u.stopPropagation()};function v(u,m,c=!1){const T=a.value.findIndex(N=>N.props.id===m);a.value=a.value.filter(N=>N.props.id!==m),s.value===m&&(s.value="",f(a)),l(u),e.nextTick(()=>{h(o),c&&(r.value=!0),t.emit("tabRemove",{removeIndex:T,removeId:m,activeId:s.value})})}function w(u){const m=s.value;s.value=u;const c=a.value.find(T=>T.props.id===u);d.value=[],c&&c.props.toolbar&&c.props.toolbar.contents&&c.props.toolbar.contents.length&&(d.value=[...c.props.toolbar.contents]),t.emit("update:activeId",u),t.emit("tabChange",{prevId:m,nextId:s.value})}function S(u){w(u)}function x(u){a.value.findIndex(c=>c.props.id===u.props.id)===-1&&a.value.push(u)}function y(u){a.value.findIndex(c=>c.props.id===u.props.id)!==-1&&(a.value.forEach(c=>{c.props.id===u.props.id&&(c=u)}),e.nextTick(()=>{h(o)}))}return{activeId:s,addTab:x,changeTitleStyle:h,removeTab:v,selectTab:S,selectTabByTabId:w,tabPages:a,updateTab:y,toolbarItems:d}}function lt(n,t,o,a,s){const{activeId:r,removeTab:d,selectTab:f}=s,h=e.computed(()=>({"st-tab-text":!0,"text-truncate":!0,"farris-title-auto":n.autoTitleWidth})),l=e.computed(()=>({"nav-item":!0,"d-none":t.show!==void 0?!t.show:!1,"f-state-active":t.id===r.value,"f-state-disable":t.disabled})),v=e.computed(()=>({width:`${t.tabWidth}px`})),w=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:t.id===r.value,disabled:t.disabled}));function S(T){return e.createVNode("span",{class:h.value,title:T.title},[T.title])}function x(T){return T.slots.title?T.slots.title:S}const y=x(o),u=e.ref(t.removeable);function m(){return e.createVNode("span",{class:"st-drop-close",onClick:T=>d(T,t.id),style:{opacity:.6}},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function c(T){f(t.id),n.tabType==="one-page"&&a.scrollToByPaggId(t.id)}return e.createVNode("li",{class:l.value,style:v.value},[e.createVNode("a",{class:w.value,onClick:c},[y(t),u.value&&m()])])}function ct(n,t,o,a,s){const{shouldShowNavigationButtons:r}=o,{tabPages:d}=s,f=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":r.value})),h=e.computed(()=>({width:"100%","justify-content":n.justifyContent})),l=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":n.fill||n.tabType==="fill","nav-pills":n.tabType==="pills","flex-row":n.position==="top"||n.position==="bottom","flex-column":n.position==="left"||n.position==="right"}));return()=>e.createVNode("div",{class:f.value,style:h.value},[e.createVNode("ul",{class:l.value,ref:t},[d.value.map(v=>lt(n,v.props,v,a,s))])])}function je(n,t,o,a,s){const r=e.ref(),{shouldShowNavigationButtons:d}=o,{activeId:f,tabPages:h,selectTab:l}=s,v=e.ref(f.value),w=e.computed(()=>h.value.map(u=>({name:u.props.title,value:u.props.id,show:u.props.show,disabled:u.props.disabled}))),S=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":d.value})),x=e.computed(()=>({width:"100%",display:"flex","justify-content":n.justifyContent}));e.onMounted(()=>{r.value&&(t.value=r.value.$el)});function y(u){l(u)}return e.watch(()=>f.value,u=>{u!==v.value&&(v.value=u)},{immediate:!0}),()=>e.createVNode("div",{class:S.value,style:x.value},[e.createVNode(Ye,{items:w.value,modelValue:v.value,"onUpdate:modelValue":u=>v.value=u,onChange:y,ref:r},null)])}function dt(n,t,o,a){const{activeId:s,removeTab:r,tabPages:d}=a,{selectAndScrollToTab:f}=o,{hideDropDown:h,searchTabText:l}=t,v=e.ref("auto"),w=e.computed(()=>{var T,N;let c=[];return n.searchBoxVisible?c=(T=d.value)==null?void 0:T.filter(I=>I.props.title.includes(l.value)):c=(N=d.value)==null?void 0:N.slice(),c}),S=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":n.searchBoxVisible,show:!h.value}));function x(c){return{"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:c.props.disabled,active:c.props.id===s.value,"d-none":c.props.show!==!0}}function y(c){c.preventDefault(),c.stopPropagation()}const u=()=>({width:v.value});function m(){return e.createVNode("div",{class:S.value},[n.searchBoxVisible&&e.createVNode("div",{onClick:c=>y(c),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{title:"search-box",type:"text",class:"form-control k-textbox","onUpdate:modelValue":c=>l.value=c},null),[[e.vModelText,l.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),w.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items",style:u()},[w.value.map(c=>e.createVNode("li",{class:x(c),onClick:T=>f(T,c.props)},[c.props.removeable&&e.createVNode("span",{class:"float-right st-drop-close",onClick:T=>r(T,c.props.id,!0)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),e.createVNode("a",{class:"dropdown-title",title:c.props.title},[c.props.title])]))]):e.createVNode("div",{class:"dropdown-no-data"},[e.createTextVNode("没有相关数据")])])}return{renderDropdownMenu:m}}function Ee(n,t,o,a){const{hideDropDown:s}=t,{renderDropdownMenu:r}=dt(n,t,o,a),d=e.ref(n.showDropdown);function f(){return d.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{title:"toggle-button",class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{s.value=!1}},null),r()])}return{renderMorePagesButtton:f}}function De(n,t,o,a){const s=e.ref(!1),{selectTabByTabId:r,tabPages:d}=a,f=4;function h(){var c;const u=t.value,m=(c=t.value)==null?void 0:c.parentElement;s.value=m&&u&&m.offsetWidth<u.scrollWidth-f}const l=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!s.value})),v=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!s.value})),w=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!s.value}));function S(u,m){if(!t.value)return;const c=t.value.scrollLeft,T=t.value.scrollWidth-t.value.offsetWidth;if(m>0){if(t.value.scrollLeft>=T)return;t.value.scrollLeft=c+n.scrollStep+u}else if(m<0){if(t.value.scrollLeft<=0)return;t.value.scrollLeft=c-n.scrollStep-u}}function x(u){if(!s.value||!t.value)return;const m=n.tabType==="pills"?".f-capsule-item":".nav-item",c=t.value.querySelectorAll(m),{parentElement:T}=t.value,N=c[u];if(N&&T){const I=T.getBoundingClientRect().left,R=T.getBoundingClientRect().right,g=N.getBoundingClientRect().left,V=N.getBoundingClientRect().right;g<I?S(I-g,-1):R<V&&S(V-R,1),n.tabType==="one-page"&&o.scrollTo(u)}}function y(u,m){if(m.disabled)return;r(m.id);const c=d.value.findIndex(T=>T.props.id===m.id);e.nextTick(()=>{x(c)})}return{previousButtonClass:l,nextButtonGroupClass:v,nextButtonClass:w,scrollTab:S,selectAndScrollToTab:y,shouldShowNavigationButtons:s,updateNavigationLayout:h}}function Ie(n,t){const{tabPages:o}=t,a=e.ref(""),s=e.ref(!0),r=e.computed(()=>n.searchBoxVisible),d=e.computed(()=>r.value?o.value.filter(h=>h.props.title.includes(a.value)):o.value.slice());return{searchTabText:a,hideDropDown:s,shouldShowSearchBox:r,tabsInDropdownMenu:d}}function $e(n,t,o){const a=".farris-tab-page",{tabPages:s}=o;function r(f){const h=t.value;if(h){const l=t.value.querySelectorAll(a);if(l.length>0){const v=l[f],{offsetTop:w}=v,S=w-32>0?w-32:0;h.scrollTop=S}}}function d(f){const h=s.value.findIndex(l=>l.props.id===f);h>-1&&r(h)}return{scrollTo:r,scrollToByPaggId:d}}const te=e.defineComponent({name:"FTabs",props:le,emits:["tabChange","tabRemove","update:activeId"],setup(n,t){const o=e.ref(n.tabType),a=e.shallowRef(),s=e.ref(n.customClass),r=e.shallowRef(),d=e.shallowRef(),f=it(n,t,r),{activeId:h,changeTitleStyle:l,tabPages:v,addTab:w,updateTab:S,selectTabByTabId:x,toolbarItems:y}=f,u=$e(n,d,f),m=De(n,r,u,f),{previousButtonClass:c,nextButtonClass:T,nextButtonGroupClass:N,scrollTab:I,updateNavigationLayout:R}=m,g=Ie(n,f),{hideDropDown:V}=g,B=ct(n,r,m,u,f),F=B,M=je(n,r,m,u,f),b=new Map([["default",B],["one-page",F],["pills",M]]);e.computed(()=>{const W=v.value.find(Q=>Q.props.id===h.value);return W==null?void 0:W.slots});const p=e.computed(()=>{const W=v.value.find(z=>z.props.id===h.value);return(W==null?void 0:W.props.toolbarPosition)==="inHead"}),i=e.computed(()=>n.fill||n.tabType==="fill");e.provide("tabs",{activeId:h,addTab:w,updateTab:S,tabPages:v,tabType:o,shouldFillParentContaner:i});const C=e.computed(()=>n.tabType==="pills"),P=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":p.value,"farris-tabs-inContent":!p.value,"farris-tabs-nav-fill":i.value,"farris-tabs-nav-pills":C.value})),E=e.computed(()=>({width:p.value&&n.titleWidth?`${n.titleWidth}%`:""})),k=e.computed(()=>{const W={"farris-tabs":!0,"f-utils-fill-flex-column":i.value,"flex-column":n.position==="top","flex-column-reverse":n.position==="bottom","flex-row":n.position==="left","flex-row-reverse":n.position==="right","one-page":n.tabType==="one-page"};return s.value&&s.value.split(" ").reduce((Q,z)=>(Q[z]=!0,Q),W),W});e.onMounted(()=>{v.value.length&&(h.value=n.activeId||v.value[0].props.id,x(h.value)),e.nextTick(()=>{R()}),l(r),window.addEventListener("click",W=>{var Q;V.value||(Q=a.value)!=null&&Q.contains(W.target)||(V.value=!0)}),window.addEventListener("resize",()=>{R()})});function j(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:c.value,onClick:()=>{I(0,-1)}},null)}function A(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:T.value,onClick:()=>{I(0,1)}},null)}const{renderMorePagesButtton:$}=Ee(n,g,m,f),H=W=>{t.emit("Click",W)};function X(){return y.value.length?e.createVNode(Ve,{items:y.value,onClick:H},null):null}const Z=b.get(n.tabType)||b.get("default");function ae(){var W,Q,z,_;return e.createVNode("div",{class:P.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(Q=(W=t.slots).headerPrefix)==null?void 0:Q.call(W)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:E.value},[j(),Z&&Z(),e.createVNode("div",{class:N.value},[A(),$()])]),X(),e.createVNode("div",{class:"farris-tabs-header-post"},[(_=(z=t.slots).headerSuffix)==null?void 0:_.call(z)])])}const K=e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":i.value}));function ee(){var W,Q;return e.createVNode("div",{class:K.value,ref:d},[(Q=(W=t.slots).default)==null?void 0:Q.call(W)])}return()=>e.createVNode("div",{class:k.value,ref:a},[ae(),ee()])}}),ut=new Map([["appearance",ge],["toolbar",pt]]);function pt(n,t,o){return t&&t.contents&&t.contents.length&&(t.contents.forEach(a=>{a.title&&(a.text=a.title)}),t.buttons=t.contents,delete t.contents),{toolbar:t}}const ft={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tab-page.schema.json",title:"tab-page",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a tab-page Item",type:"string"},type:{description:"The type string of tab-page Item component",type:"string",default:"tab-page"},contents:{description:"",type:"array",default:[]},title:{description:"",type:"string",default:"标题"},toolbar:{description:"",type:"object"}},required:["id","type","contents"]},mt={title:"tab-page",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"工具栏按钮的标识",title:"标识",type:"string",readonly:!0},title:{description:"工具栏按钮的标识",title:"标题",type:"string"}}},appearance:{description:"",title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},width:{description:"组件的宽度",title:"宽度(px)",type:"number"},height:{description:"组件的高度",title:"高度(px)",type:"number"}}},behavior:{description:"",title:"行为",properties:{removeable:{description:"是否可移除",type:"boolean",title:"是否可移除"},toolbar:{description:"",type:"array",title:"工具栏",visible:"hidden"}}}}},ce={tabWidth:{type:Number,default:-1},id:{type:String,default:""},customTitleClass:{type:String,default:""},titleOverflow:{type:Boolean,default:!1},title:{type:String,default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removeable:{type:Boolean,default:!1},show:{type:Boolean,default:!0},toolbar:{type:Object,default:{}},toolbarPosition:{type:String,default:"inHead"}},ve=Ze.createPropsResolver(ce,ft,ut,void 0,mt);function ht(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const de=e.defineComponent({name:"FTabPage",props:ce,emits:[],setup(n,t){const o=e.inject("tabs"),a=e.ref(n.show),s={slots:t.slots,props:n},r=e.ref((o==null?void 0:o.tabType.value)||"default");e.onMounted(()=>{const x=o==null?void 0:o.tabPages.value.findIndex(y=>y.props.id===n.id);!x||x===-1?o==null||o.addTab(s):x>-1&&(a.value=!1,console.warn(`已经存在id为${n.id}的页签啦`))}),e.onUnmounted(()=>{});const d=e.computed(()=>(n==null?void 0:n.id)===(o==null?void 0:o.activeId.value)),f=e.computed(()=>({display:d.value?"":"none"}));e.watch(()=>n,x=>{o==null||o.updateTab({props:x,slots:t.slots})},{immediate:!0,deep:!0});function h(){var y,u;const x=(u=(y=t.slots).default)==null?void 0:u.call(y);return e.createVNode(Je,{"main-title":n.title,class:"farris-tab-page"},ht(x)?x:{default:()=>[x]})}const l=e.computed(()=>{var y;return{"farris-tab-page":!0,"f-utils-fill-flex-column":d.value&&o&&((y=o.shouldFillParentContaner)==null?void 0:y.value)}});function v(){var y,u;const x=(u=(y=t.slots).default)==null?void 0:u.call(y);return e.createVNode("div",{class:l.value,style:f.value},[x])}const S=new Map([["default",v],["one-page",h]]).get(r.value)||v;return()=>a.value?S():null}}),yt={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"}};function Ce(){return new DOMException("The request is not allowed","NotAllowedError")}async function gt(n){if(!navigator.clipboard)throw Ce();return navigator.clipboard.writeText(n)}async function bt(n){const t=document.createElement("span");t.textContent=n,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const o=window.getSelection(),a=window.document.createRange();o==null||o.removeAllRanges(),a.selectNode(t),o==null||o.addRange(a);let s=!1;try{s=window.document.execCommand("copy")}finally{o==null||o.removeAllRanges(),window.document.body.removeChild(t)}if(!s)throw Ce()}async function vt(n){try{await gt(n)}catch(t){try{await bt(n)}catch(o){throw o||t||Ce()}}}function Ct(){async function n(t){await vt(t)}return{onCopy:n}}function wt(n,t,o,a){const s=e.ref(14),r=e.ref(140),d=e.ref(""),f=e.ref(a.value.length),h=e.computed(()=>a.value),l=e.computed(()=>({"font-size":`${s.value}px`,height:"100%"}));function v(w){if(w.currentTarget){const S=w.currentTarget.value||"";f.value=S.length}}return()=>e.createVNode(e.Fragment,null,[e.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:l.value,rows:"4",maxlength:r.value,onInput:w=>v(w)},[h.value]),e.createVNode("span",{class:"textarea-wordcount",title:d.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[f.value+" / "+r.value])])}function Tt(n,t,o,a){const s=wt(n,t,o,a),r=new Map([["text-area",s]]);function d(f){return r.get(f)||null}return{getEditorRender:d}}function xt(){const n=e.ref(!1),t=e.ref("复制成功");return{feedbackStyle:e.computed(()=>{const a={position:"absolute",left:"50%",top:"50%",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"};return a.opacity=n.value?"0.8":"0",a.display=n.value?"":"none",a}),feedbackMessage:t,toShowFeedback:n}}function St(n,t){const o=t.getEditorRender(n.promptEditorType);return()=>o&&o()}function Mt(n){const t=e.ref(3),o=e.ref(480),a=e.computed(()=>!!n.value&&!!n.value.date),s=e.computed(()=>`发生时间 : ${n.value&&n.value.date||""}`),r=e.computed(()=>!!n.value&&!!n.value.detail),d=e.computed(()=>{const m=`${o.value}px`;return{overflow:"hidden","text-overflow":"ellipsis",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":t.value,"max-height":m}}),f=e.computed(()=>n.value&&n.value.detail||""),h=e.computed(()=>!0),l=e.ref(!1),v=e.ref("展开"),w=e.ref("收起"),S=e.computed(()=>{const m={display:"block",color:"#2A87FF"};return m["text-align"]=l.value?"":"right",m});function x(m,c){l.value=!l.value,t.value=l.value?20:3}function y(m){return x()}function u(m){return x()}return()=>e.createVNode("div",{class:"toast-msg-detail"},[a.value&&e.createVNode("div",null,[s.value]),r.value&&e.createVNode("div",{id:"exception_error_msg",ref:"exceptionMessageRef",style:d.value},[e.createTextVNode("详细信息 : "),e.createVNode("span",{innerHTML:f.value},null)]),h.value&&e.createVNode("span",{style:S.value},[l.value&&e.createVNode("span",{onClick:y,style:"cursor: pointer;"},[w.value]),!l.value&&e.createVNode("span",{onClick:u,style:"cursor: pointer;"},[v.value])])])}function Nt(n){return()=>e.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function Vt(n,t,o,a){const s=e.ref(n.exceptionInfo),r=e.computed(()=>{const S={"f-icon":!0},x=`f-icon-${t.value}`;return S[x]=!0,S}),d=e.computed(()=>o.value||s.value&&s.value.message),f=e.computed(()=>a.value),h=e.computed(()=>!!a.value),l=e.computed(()=>!!s.value);function v(){return l.value?Mt(s):h.value?Nt(f):()=>null}const w=v();return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"float-left modal-tips-iconwrap"},[e.createVNode("span",{class:r.value},null)]),e.createVNode("div",{class:"modal-tips-content"},[e.createVNode("p",{class:"toast-msg-title",innerHTML:d.value},null),w()])])}function Bt(n,t,o){const{onCopy:a}=t,{toShowFeedback:s}=o,r=e.ref("复制成功"),d=e.ref("复制详细信息"),f=e.ref(n.exceptionInfo||{date:"",message:"",detail:""}),h=e.computed(()=>f.value&&f.value.detail||"");function l(v){a(h.value).catch(w=>{r.value="复制失败"}).finally(()=>{s.value=!0,setTimeout(()=>{s.value=!1},700)})}return()=>e.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[e.createVNode("span",{onClick:l,style:"cursor: pointer;"},[d.value])])}function kt(n,t,o,a){const s=e.ref(n.type),r=e.ref([]),d=e.ref(n.exceptionInfo),f=e.ref(n.okButtonText),h=e.ref(n.cancelButtonText),l=e.ref(!0),v=e.ref(!0),w=e.computed(()=>!!(r.value&&r.value.length)),S=e.computed(()=>d.value&&d.value.date&&d.value.message&&d.value.detail),x=e.computed(()=>!(r.value&&r.value.length)&&(f.value||h.value)),y=e.computed(()=>v.value&&f.value),u=e.computed(()=>l.value&&h.value),m=Bt(n,o,a);function c(N){s.value==="question"&&t.emit("reject"),t.emit("close")}function T(N){s.value==="question"&&t.emit("accept"),t.emit("close")}return()=>e.createVNode("div",{class:"modal-footer"},[S.value&&m(),x.value&&u.value&&e.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:c},[h.value]),x.value&&y.value&&e.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:T},[f.value]),w.value&&r.value.length&&r.value.map(N=>e.createVNode("button",{type:"button",onClick:N.handle,class:N.class},[N.iconClass&&e.createVNode("span",{class:N.iconClass},null),N.text]))])}const ue=e.defineComponent({name:"FMessageBox",props:yt,emits:["accept","reject","close"],setup(n,t){const o=e.ref(n.type),a=e.ref(n.title),s=e.ref(n.detail),r=e.computed(()=>{const m={"modal-tips":!0,"d-flex":!0,"flex-row":!0},c=`messager-type-${o.value}`;return m[c]=!0,m}),d=e.computed(()=>{const m={};return o.value==="prompt"?m.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(m.padding="0.5rem 1.5rem 1rem 1.5rem"),m}),f=Ct(),h=Tt(n,o,a,s),l=xt(),{feedbackStyle:v,feedbackMessage:w}=l;function S(){return e.createVNode("div",{style:v.value},[w.value])}function x(){switch(o.value){case"prompt":return St(n,h);default:return Vt(n,o,a,s)}}const y=x(),u=kt(n,t,f,l);return()=>e.createVNode("div",{class:"farris-messager"},[e.createVNode("section",{class:r.value,style:d.value},[y()]),u(),S()])}}),Pt={class:{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},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:HTMLElement,default:null},reiszeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:HTMLElement,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}};class G{constructor(t,o){this.x=t,this.y=o}static getTransformInfo(t){const a=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(a.length>=6){const s=parseInt(a[4],10),r=parseInt(a[5],10);return{x:s,y:r}}return{x:0,y:0}}static fromEvent(t,o=null){if(this.isMouseEvent(t))return new G(t.clientX,t.clientY);if(o===null||t.changedTouches.length===1)return new G(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let a=0;a<t.changedTouches.length;a++)if(t.changedTouches[a].target===o)return new G(t.changedTouches[a].clientX,t.changedTouches[a].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const o=new G(0,0);if(window){const a=window.getComputedStyle(t);if(a){const s=parseInt(a.getPropertyValue("left"),10),r=parseInt(a.getPropertyValue("top"),10);o.x=isNaN(s)?0:s,o.y=isNaN(r)?0:r}return o}return null}static copy(t){return new G(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class oe{constructor(t,o){this.width=t,this.height=o}static getCurrent(t){const o=new oe(0,0);if(window){const a=window.getComputedStyle(t);return a&&(o.width=parseInt(a.getPropertyValue("width"),10),o.height=parseInt(a.getPropertyValue("height"),10)),o}return null}static copy(t){return new oe(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function jt(n,t){const o=e.ref(),a=e.ref(),s=e.ref(),r=e.ref(),d=e.ref(),f=e.ref(),h=e.ref(),l=e.ref(),v=e.ref(),w=e.ref(),S=e.ref(),x=e.ref(),y=e.ref(n.draggable),u=e.ref(!1);function m(){const k=a.value||document.body,j=window.getComputedStyle(k);if(!j||!o.value)return;const A=G.getTransformInfo(o.value),$={};h.value&&($.deltaL=o.value.offsetLeft-h.value.x,$.deltaT=o.value.offsetTop-h.value.y);const H=j.getPropertyValue("position");$.width=k.clientWidth,$.height=k.clientHeight,$.pr=parseInt(j.getPropertyValue("padding-right"),10),$.pb=parseInt(j.getPropertyValue("padding-bottom"),10),$.position=j.getPropertyValue("position"),H==="static"&&(k.style.position="relative"),$.translateX=A.x,$.translateY=A.y,w.value=$}function c(k){if(o.value){r.value=oe.getCurrent(o.value),d.value=G.getCurrent(o.value),f.value=r.value?oe.copy(r.value):null,h.value=d.value?G.copy(d.value):null,m();const j=k.target.getAttribute("type")||"";l.value={n:!!j.match(/n/),s:!!j.match(/s/),w:!!j.match(/w/),e:!!j.match(/e/)}}}function T(){var k,j,A,$;if(o.value){const H=o.value;l.value&&((l.value.n||l.value.s)&&((k=f.value)!=null&&k.height)&&(H.style.height=f.value.height+"px"),(l.value.w||l.value.e)&&((j=f.value)!=null&&j.width)&&(H.style.width=f.value.width+"px"),h.value&&((A=h.value)!=null&&A.x&&(H.style.left=h.value.x+"px"),($=h.value)!=null&&$.y&&(H.style.top=h.value.y+"px")))}}function N(){const k=n.minHeight?n.minHeight:1,j=n.minWidth?n.minWidth:1;f.value&&h.value&&l.value&&r.value&&(f.value.height<k&&(f.value.height=k,l.value.n&&d.value&&(h.value.y=d.value.y+(r.value.height-k))),f.value.width<j&&(f.value.width=j,l.value.w&&d.value&&(h.value.x=d.value.x+(r.value.width-j))),n.maxHeight&&f.value.height>n.maxHeight&&(f.value.height=n.maxHeight,d.value&&l.value.n&&(h.value.y=d.value.y+(r.value.height-n.maxHeight))),n.maxWidth&&f.value.width>n.maxWidth&&(f.value.width=n.maxWidth,l.value.w&&d.value&&(h.value.x=d.value.x+(r.value.width-n.maxWidth))))}function I(){if(a.value){const k=w.value;if(h.value&&f.value&&l.value&&r.value){const j=k.width-k.pr-k.deltaL-k.translateX-h.value.x,A=k.height-k.pb-k.deltaT-k.translateY-h.value.y;l.value.n&&h.value.y+k.translateY<0&&d.value&&(h.value.y=-k.translateY,f.value.height=r.value.height+d.value.y+k.translateY),l.value.w&&h.value.x+k.translateX<0&&d.value&&(h.value.x=-k.translateX,f.value.width=r.value.width+d.value.x+k.translateX),f.value.width>j&&(f.value.width=j),f.value.height>A&&(f.value.height=A)}}}function R(k){if(!s.value||!r.value||!d.value||!l.value)return;k.subtract(s.value);const j=k.x,A=k.y;l.value.n?(h.value.y=d.value.y+A,f.value.height=r.value.height-A):l.value.s&&(f.value.height=r.value.height+A),l.value.e?f.value.width=r.value.width+j:l.value.w&&(f.value.width=r.value.width-j,h.value.x=d.value.x+j),I(),N(),T()}function g(k){if(!v.value)return;const j=G.fromEvent(k);j&&R(j)}function V(){if(o.value){const{width:k,height:j,x:A,y:$}=o.value.getBoundingClientRect(),H=G.getTransformInfo(o.value);return{size:{width:k,height:j},position:{x:A-H.x,y:$-H.y}}}return null}function B(k){if(o.value){const j=V();S.value=j}s.value=void 0,r.value=null,d.value=null,f.value=null,h.value=null,l.value=null,v.value=null,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",B)}function F(){document.addEventListener("mousemove",g),document.addEventListener("mouseup",B)}function M(k){k instanceof MouseEvent&&k.button===2||y.value&&(k.stopPropagation(),k.preventDefault(),s.value=G.fromEvent(k),v.value=k.target,c(k),F())}function b(k){return o.value=k,e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"ng-resizable-handle ng-resizable-n",type:"n",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-e",type:"e",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-s",type:"s",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-w",type:"w",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-ne",type:"ne",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-se ng-resizable-diagonal",type:"se",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-sw",type:"sw",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-nw",type:"nw",onMousedown:j=>M(j)},null)])}function p(k=!0){const j=a.value||document.body,A=oe.getCurrent(j),$=o.value;k&&(x.value=V(),x.value.transform=$.style.transform),A&&$&&(f.value=A,$.style.height=f.value.height-14+"px",$.style.width=f.value.width-14+"px",$.style.left="7px",$.style.top="7px",$.style.transform="",S.value={size:f.value,position:{x:0,y:0}},y.value=!1,u.value=!0)}function i(){var k,j;if(x.value){const A={width:x.value.size.width||0,height:x.value.size.height||0},$={x:(window.innerWidth-A.width)/2,y:(window.innerHeight-A.height)/2};(k=f.value)==null||k.set(A),(j=h.value)==null||j.set($);const H=o.value;H.style.height=A.height+"px",H.style.width=A.width+"px",H.style.left=`${$.x}px`,H.style.top=`${$.y}px`,H.style.transform="",S.value={size:A,position:$},y.value=n.draggable,u.value=!1}}function C(){if(o.value){const k=oe.getCurrent(o.value);if(k){const{width:j,height:A}=k;o.value.style.left=`${(window.innerWidth-j)/2}px`,o.value.style.top=`${(window.innerHeight-A)/2}px`,o.value.style.transform=""}}}function P(){const k=()=>{u.value?p(!1):C()};return window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k)}}const E=P();return{renderResizeBar:b,boundingElement:a,resizedEventParam:S,maximize:p,restore:i,allowDrag:y,isMaximized:u,unWindowResizeHandle:E}}function Et(n,t){const o=e.ref(),a=e.ref(n.draggable),s=e.ref(n.lockAxis),r=e.ref(),d=e.ref(),f=e.ref(!1),h=e.ref(new G(0,0)),l=e.ref(new G(0,0)),v=e.ref(new G(0,0)),w=e.ref(new G(0,0));function S(g,V){if(V.tagName==="BUTTON")return!1;if(V===g)return!0;for(const B in V.children)if(V.children.hasOwnProperty(B)&&S(g,V.children[B]))return!0;return!1}function x(){var F,M;let g=v.value.x+l.value.x,V=v.value.y+l.value.y;s.value==="x"?(g=((F=h.value)==null?void 0:F.x)||0,v.value.x=0):s.value==="y"&&(V=((M=h.value)==null?void 0:M.y)||0,v.value.y=0);const B=`translate3d(${Math.round(g)}px, ${Math.round(V)}px, 0px)`;o.value&&(o.value.style.transform=B),w.value.x=g,w.value.y=V}function y(){if(!d.value||!o.value)return null;const g=d.value.getBoundingClientRect(),V=o.value.getBoundingClientRect(),B={top:g.top<V.top,right:g.right>V.right,bottom:g.bottom>V.bottom,left:g.left<V.left};return B.top||(v.value.y-=V.top-g.top),B.bottom||(v.value.y-=V.bottom-g.bottom),B.right||(v.value.x-=V.right-g.right),B.left||(v.value.x-=V.left-g.left),x(),B}function u(g){g&&(h.value&&g.subtract(h.value),v.value.set(g),x(),y())}function m(g){f.value&&a.value&&(g.stopPropagation(),g.preventDefault(),u(G.fromEvent(g,r.value)))}function c(){var g;f.value&&(f.value=!1,l.value.add(v.value),v.value.reset(),(g=o.value)==null||g.classList.remove("ng-dragging"),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",c))}function T(){!f.value&&r.value&&(f.value=!0,r.value.classList.add("ng-dragging"),document.addEventListener("mousemove",m),document.addEventListener("mouseup",c))}function N(){if(o.value){const g=G.getTransformInfo(o.value);l.value.set(g);return}l.value.reset()}function I(g){if(g instanceof MouseEvent&&g.button===2)return;const V=g.target||g.srcElement;r.value!==void 0&&V&&!S(V,r.value)||a.value!==!1&&(g.stopPropagation(),g.preventDefault(),h.value=G.fromEvent(g,o.value),N(),T())}function R(g,V,B){g&&a.value&&V&&(r.value=g,o.value=V,d.value=B,g.classList.add("ng-draggable"),g.addEventListener("mousedown",I))}return{registerDraggle:R,resetTranslate:N}}function Dt(n,t){const o=e.ref(n.enableEsc);function a(s){s.key==="Escape"&&n.enableEsc&&t.emit("esc",{event:s,type:"esc"})}o.value&&document.addEventListener("keydown",a)}const Ae=e.defineComponent({name:"FModal",props:Pt,emits:["update:modelValue","accept","cancel","closed","resize","esc"],setup(n,t){const o=e.ref(n.width||300),a=e.ref(n.height||200),s=e.ref(n.modelValue),r=e.ref(""),d=e.ref(n.class),f=e.ref(n.fitContent),h=e.ref(n.showHeader),l=e.ref(""),v=e.ref(n.showCloseButton),w=e.ref(n.showMaxButton),S=e.ref(!1),x=e.ref(""),y=e.ref(""),u=e.ref(""),m=e.ref(n.showButtons),c=e.ref(n.title),T=e.ref(n.reiszeable),N=e.ref(n.containment||null);function I(D,q){s.value=!1,t.emit("update:modelValue",!1),q!=null&&t.emit(q?"accept":"cancel"),t.emit("closed",D)}const R=[{name:"cancel",text:"取消",class:"btn btn-light",handle:D=>{I(D,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:D=>{I(D,!0)}}],g=e.ref(n.buttons&&n.buttons.length?n.buttons:R),V=e.computed(()=>!!l.value),B=e.computed(()=>!!m.value&&!!g.value),F=e.ref(),M=e.ref(),b=e.ref(!1),{renderResizeBar:p,maximize:i,restore:C,boundingElement:P,resizedEventParam:E,allowDrag:k,unWindowResizeHandle:j}=jt(n),{registerDraggle:A}=Et(n);e.watch(()=>n.title,(D,q)=>{D!==q&&(c.value=D)}),e.watch(()=>n.modelValue,(D,q)=>{D!==q&&(s.value=D)}),e.watch(()=>n.showHeader,(D,q)=>{D!==q&&(h.value=D)}),e.watch(()=>n.showButtons,(D,q)=>{D!==q&&(m.value=D)}),e.watch(()=>E.value,(D,q)=>{const re=D||{},me=q||{};JSON.stringify(re)!==JSON.stringify(me)&&t.emit("resize",{newSize:D,oldSize:q})});function $(){const D=document.querySelectorAll(".farris-modal").length;(!D||D-1<=0)&&document.body.classList.remove("modal-open")}const H=e.computed(()=>(s.value?document.body.classList.add("modal-open"):$(),s.value)),X=e.computed(()=>{const D={modal:!0,"farris-modal":!0,fade:!0,show:H.value};return D["f-modal-fitContent"]=!!f.value,D}),Z=e.computed(()=>{var re;const D={"modal-dialog":!0},q=(re=d.value)==null?void 0:re.split(" ");return q==null||q.reduce((me,Vn)=>(me[Vn]=!0,me),D),D}),ae=e.computed(()=>({position:"absolute",top:`${(window.innerHeight-a.value)/2}px`,left:`${(window.innerWidth-o.value)/2}px`,width:`${o.value}px`,height:f.value?"auto":`${a.value}px`})),K=e.computed(()=>({"modal-content":!0,"modal-content-has-header":h.value})),ee=e.computed(()=>{const D={display:h.value?"":"none"};return D["pointer-events"]=k.value?"auto":"none",D}),W=e.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:b.value})),Q=e.computed(()=>({"modal-body":!0,"f-utils-flex-column":x.value==="iframe"}));function z(){return{}}const _=e.computed(()=>{const D={textAlgin:u.value},q=z();return Object.assign(D,q)});function ne(D){if(D.stopPropagation(),b.value){b.value=!1,C();return}i(),b.value=!0}async function fe(D,q){D.handle&&await D.handle(q,D)&&t.emit("closed",q)}function Sn(D){D.width&&(o.value=D.width),D.height&&(a.value=D.height),D.buttons&&(g.value=D.buttons),D.title&&(c.value=D.title)}e.onMounted(()=>{M.value&&!N.value&&(N.value=M.value.parentElement,P.value=N.value,A(F.value,M.value,P.value)),H.value&&document.body.classList.add("modal-open"),Dt(n,t)}),e.onUnmounted(()=>{$(),j&&j()}),t.expose({modalElementRef:M,updateModalOptions:Sn,close:I});function Mn(){return e.createVNode("ul",null,[S.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),w.value&&e.createVNode("li",{onClick:ne,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[e.createVNode("span",{class:W.value},null)]),v.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:D=>I(D,!1),style:"pointer-events: auto;"},[e.createVNode("span",{class:"f-icon modal_close"},null)])])}function Nn(){return e.createVNode("div",{class:"modal-footer",style:_.value},[g.value&&g.value.map(D=>e.createVNode("button",{name:D.name,type:"button",class:D.class+(D.iconClass?" btn-icontext":""),onClick:q=>{fe(D,q)}},[!!D.iconClass&&e.createVNode("i",{class:D.iconClass},null),D.text]))])}return()=>e.createVNode(e.Teleport,{to:"body"},{default:()=>{var D,q;return[H.value&&e.createVNode("div",{class:X.value,style:"display: block"},[e.createVNode("div",{id:r.value,class:Z.value,style:ae.value,ref:M},[e.createVNode("div",{class:K.value},[e.createVNode("div",{ref:F,class:"modal-header",style:ee.value},[e.createVNode("div",{class:"modal-title"},[V.value&&e.createVNode("span",{class:l.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[c.value])]),e.createVNode("div",{class:"actions"},[Mn()])]),e.createVNode("div",{class:Q.value},[(q=(D=t.slots).default)==null?void 0:q.call(D),x.value==="iframe"&&e.createVNode("iframe",{title:r.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:y.value},null)]),B.value&&Nn()]),!f.value&&T.value&&M.value&&p(M.value)])])]}})}});function Oe(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function It(n){const t=document.createElement("div");t.style.display="contents";const o=e.createApp({setup(a,s){e.onUnmounted(()=>{document.body.removeChild(t)});const r=e.ref(),d=e.ref(n.class||""),f=e.ref(!!n.showButtons),h=e.ref(!!n.showHeader),l=e.ref(n.showCloseButton==null?!0:n.showCloseButton),v=e.ref(!0),w=e.ref(n.title||""),S=n.acceptCallback||(()=>{}),x=n.rejectCallback||(()=>{}),y=n.closedCallback||(T=>{}),u=n.resizeHandle||(T=>{}),m=Oe(n),c=T=>{v.value=!1,o.unmount(),y(T)};return e.onMounted(()=>{}),s.expose({modalRef:r}),()=>e.createVNode(Ae,{ref:r,class:d.value,modelValue:v.value,"onUpdate:modelValue":T=>v.value=T,title:w.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":h.value,"show-buttons":f.value,"show-close-button":l.value,"show-max-button":!1,onAccept:S,onCancel:x,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:c,onResize:u},{default:()=>[m&&m(o)]})}});return document.body.appendChild(t),o.mount(t),o}class $t{constructor(t){L(this,"appContext",null);L(this,"modalRef",e.ref());L(this,"activeModalIndex",e.ref(0));L(this,"modalRefs",{});L(this,"isUseEscCloseModal",e.ref(!1));L(this,"activeModalInstance",e.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.value}static show(t){const o=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return It(o)}open(t){const o=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const a=e.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},t)),s=e.ref(!0),r=a.value.acceptCallback||(()=>{}),d=a.value.rejectCallback||(()=>{}),f=a.value.closedCallback||((c,T)=>{}),h=a.value.resizeHandle||(c=>{});let l;const v=Oe(a.value),w=c=>{var N;s.value=!1;const T=(N=c==null?void 0:c.target)==null?void 0:N.classList.contains("modal_close");f(c,this.isUseEscCloseModal.value?"esc":T?"icon":"button")},S=c=>{w(c),l&&e.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],e.render(null,o),l=null,this.modalRef.value=null,this.modalRefs){const T=Object.keys(this.modalRefs);T.length>0?this.activeModalIndex.value=Math.max(...T):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},x=c=>{var T;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((T=this.activeModalInstance.value)==null||T.close(c==null?void 0:c.event))},y=()=>e.createVNode(Ae,e.mergeProps({ref:this.modalRef,modelValue:s.value,"onUpdate:modelValue":c=>s.value=c},a.value,{onAccept:r,onCancel:d,onClosed:S,onResize:h,onEsc:x}),{default:()=>[v&&v()]});return l=(c=>{const T=e.h(y,c);return T.appContext=this.appContext,e.render(T,o),T})({...a.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:c=>{a.value={...a.value,...c},l&&e.render(e.cloneVNode(l,{...a}),o)},destroy:S,modalRef:this.activeModalInstance}}}class J{static show(t){let o=new $t;const a=e.reactive({...t}),s=!1,r=a.type==="error"||a.type==="prompt",d=a.type==="error"?"错误提示":a.type==="prompt"&&a.title||"",f=a.acceptCallback||(()=>{}),h=a.rejectCallback||(()=>{});let l=null;const v=()=>{l&&(l==null||l.destroy(),o=null)};l=o==null?void 0:o.open({class:"modal-message modal-message-type-info",title:d,showButtons:s,showHeader:r,width:a.width||400,fitContent:!0,showMaxButton:!1,render:()=>e.createVNode(ue,e.mergeProps(a,{onAccept:f,onReject:h,onClose:v}),null)})}static info(t,o){const a=e.reactive({type:"info",title:t,detail:o,okButtonText:"知道了",cancelButtonText:""});J.show(a)}static warning(t,o){const a=e.reactive({type:"warning",title:t,detail:o,okButtonText:"知道了",cancelButtonText:""});J.show(a)}static success(t,o){const a=e.reactive({type:"success",title:t,detail:o,okButtonText:"关闭",cancelButtonText:""});J.show(a)}static error(t,o,a){const s=e.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:a,message:t,detail:o}});J.show(s)}static prompt(t,o){const a=e.reactive({type:"prompt",title:t,detail:o,okButtonText:"确定",cancelButtonText:"取消"});J.show(a)}static question(t,o,a,s){const r=e.reactive({type:"question",title:t,detail:o,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:a,rejectCallback:s});J.show(r)}}ue.install=n=>{n.component(ue.name,ue),n.provide("FMessageBoxService",J)};function At(n,t,o,a,s){const{activeId:r,removeTab:d,selectTab:f,removeDesignTab:h,selectDesignTab:l}=s,v=e.computed(()=>({"st-tab-text":!0,"farris-title-auto":n.autoTitleWidth})),w=e.computed(()=>{const B={"farris-component":!0,"nav-item":!0,"d-none":t.show!==void 0?!t.show:!1,"f-state-active":t.id===r.value,"f-state-disable":t.disabled};return B[`${t.id}-design-item`]=!0,B}),S=e.computed(()=>({width:`${t.tabWidth}px`})),x=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:t.id===r.value,disabled:t.disabled}));function y(B){return e.createVNode("span",{class:v.value,title:B.title},[B.title])}function u(B){return B.slots.title?B.slots.title:y}const m=u(o),c=e.ref(t.removeable);function T(){return e.createVNode("span",{class:"st-drop-close",onClick:B=>d(B,t.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function N(B){f(t.id),n.tabType==="one-page"&&a.scrollToByPaggId(t.id)}function I(B){l(B,t.id)}function R(B){J.question(`确定删除标签页【${o.props.title}】?`,"",()=>h(B,t.id),()=>{})}function g(){return e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:B=>R(B)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function V(){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[g()])])}return e.createVNode("li",{onClick:B=>I(B),class:w.value,style:S.value,id:`${t.id}-design-item`},[V(),e.createVNode("a",{class:x.value,onClick:N},[m(t),c.value&&T()])])}function Ot(n,t,o,a,s,r,d){const{shouldShowNavigationButtons:f}=o,{tabPages:h}=s,l=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":f.value})),v=e.computed(()=>({width:"100%","justify-content":n.justifyContent})),w=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":n.fill||n.tabType==="fill","nav-pills":n.tabType==="pills","flex-row":n.position==="top"||n.position==="bottom","flex-column":n.position==="left"||n.position==="right"})),S=e.computed(()=>({overflow:"auto"}));function x(u){const{componentType:m}=u;let c=Y(m,u);d&&d.onResolveNewComponentSchema&&(c=d.onResolveNewComponentSchema(u,c));const T=m.toLowerCase().replace("-","_");return c&&!c.id&&c.type===m&&(c.id=`${T}_${Math.random().toString().slice(2,6)}`),c}const y=function(u){var N;const m={componentType:"tab-page",label:"Tab1",parentComponentInstance:r.value,targetPosition:-1},c=x(m);(N=r.value.schema.contents)==null||N.push(c);const{selectTabByTabId:T}=s;T(c.id)};return()=>e.createVNode("div",{class:l.value,style:v.value},[e.createVNode("ul",{class:w.value,style:S.value,ref:t},[h.value.map(u=>At(n,u.props,u,a,s)),e.createVNode("li",{class:"nav-item"},[e.createVNode("a",{class:"nav-link tabs-text-truncate",title:"添加页签",onClick:u=>y()},[e.createVNode("i",{class:"f-icon f-icon-plus",style:"font-size: 20px;margin: 0 auto;line-height: 24px;"},null)])])])])}function Re(n,t,o){var R;function a(){o!=null&&o.resolveComponentContext&&o.resolveComponentContext()}a();const s=o&&o.getStyles&&o.getStyles()||"",r=o&&o.getDesignerClass&&o.getDesignerClass()||"",d=e.ref();function f(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanMoveComponent?o.checkCanMoveComponent():!0}function h(){return!1}function l(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function v(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:o&&o.hideNestedPaddingInDesginerView?o.hideNestedPaddingInDesginerView():!1}function w(g){if(!g||!g.value)return null;if(g.value.schema&&g.value.schema.type==="component")return g.value;const V=e.ref(g==null?void 0:g.value.parent),B=w(V);return B||null}function S(g=t){const{componentInstance:V,designerItemElementRef:B}=g;return!V||!V.value?null:V.value.canMove?B:S(g.parent)}function x(g){return!!o&&o.canAccepts(g)}function y(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function u(){}function m(g,V){V&&o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(V)}function c(g){const{componentType:V}=g;let B=Y(V,g);o&&o.onResolveNewComponentSchema&&(B=o.onResolveNewComponentSchema(g,B));const F=V.toLowerCase().replace("-","_");return B&&!B.id&&B.type===V&&(B.id=`${F}_${Math.random().toString().slice(2,6)}`),B}function T(g,V){const B=String(g.getAttribute("data-controltype")),F=g.getAttribute("data-feature"),M=F?JSON.parse(F):{};M.parentComponentInstance=d.value;let b=Y(B,M);o&&o.onAcceptNewChildElement&&(b=o.onAcceptNewChildElement(g,V,b));const p=B.toLowerCase().replace("-","_");return b&&!b.id&&b.type===B&&(b.id=`${p}_${Math.random().toString().slice(2,6)}`),b}function N(g){}function I(...g){if(o&&o.getPropsConfig)return o.getPropsConfig(...g)}return d.value={canMove:f(),canSelectParent:h(),canDelete:l(),canNested:!v(),contents:t==null?void 0:t.schema.contents,elementRef:n,parent:(R=t==null?void 0:t.parent)==null?void 0:R.componentInstance,schema:t==null?void 0:t.schema,styles:s,designerClass:r,canAccepts:x,getBelongedComponentInstance:w,getDraggableDesignItemElement:S,getDraggingDisplayText:y,getPropConfig:I,getDragScopeElement:u,onAcceptMovedChildElement:m,onAcceptNewChildElement:T,onChildElementMovedOut:N,addNewChildComponentSchema:c,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1)},d}const Rt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}},required:[]},we=new Map;function Te(){function n(y,u,m,c){var T;if(typeof m=="number")return((T=c[y])==null?void 0:T.length)===m;if(typeof m=="object"){const N=Object.keys(m)[0],I=m[N];if(N==="not")return Number(c[y].length)!==Number(I);if(N==="moreThan")return Number(c[y].length)>=Number(I);if(N==="lessThan")return Number(c[y].length)<=Number(I)}return!1}function t(y,u,m,c){return typeof m=="boolean"?c.childrenClassList.includes(u)===!!m:!1}function o(y,u,m,c){return typeof m=="boolean"?c.parentClassList.includes(u)===!!m:!1}function a(y,u,m,c){return typeof m=="boolean"?c.parentClassList.includes(u)===!!m:!1}const s=new Map([["length",n],["hasChildren",t],["hasSibling",a],["hasParent",o]]);function r(y,u){const m=y;return typeof u=="number"?[{target:m,operator:"length",param:null,value:Number(u)}]:typeof u=="object"?Object.keys(u).map(c=>{if(c==="length")return{target:m,operator:"length",param:null,value:u[c]};const T=c,N=u[c];return{target:m,operator:y==="children"?"hasChildren":y==="parent"?"hasParent":"hasSibling",param:T,value:N}}):[]}function d(y,u){if(s.has(y.operator)){const m=s.get(y.operator);return m&&m(y.target,y.param,y.value,u)||!1}return!1}function f(y,u){return Object.keys(y).reduce((N,I)=>{const R=r(I,y[I]);return N.push(...R),N},[]).reduce((N,I)=>N&&d(I,u),!0)}function h(y,u){const m=Object.keys(y),c=m.includes("allOf"),T=m.includes("anyOf"),N=c||T,g=(N?y[N?c?"allOf":"anyOf":"allOf"]:[y]).map(B=>f(B,u));return c?!g.includes(!1):g.includes(!0)}function l(y,u){const m=y.const;return m?typeof m=="boolean"?m:typeof m=="object"?h(m,u):!1:!1}function v(y){return u=>{const m={canAccept:!0,fixed:!1,hidePadding:!1};return y&&y.properties&&Object.keys(y.properties).reduce((c,T)=>{const N=y.properties[T];return c[T]=l(N,u),c},m),m}}function w(y,u,m){if(u.type==="object"&&u.properties){const{rules:c,contents:T}=u.properties;m.set(y,v(c)),T&&Object.keys(T.properties).forEach(N=>w(N,T.properties[N],m))}}function S(){const{properties:y}=Rt;Object.keys(y).forEach(u=>{w(u,y[u],we)})}function x(y,u){const m={canAccept:!0,fixed:!1,hidePadding:!0};return we.has(y)?we.get(y)(u):m}return S(),{getRuleValue:x}}const Ft={title:"tabs",description:"A Farris Container Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"Splitter",enum:[]}},title:{title:"标题",type:"string",description:"标题"}}},appearance:{description:"",title:"外观",properties:{width:{description:"组件的宽度",title:"宽度(px)",type:"number",min:0,decimals:0},height:{description:"组件的高度",title:"高度(px)",type:"number",min:0,decimals:0},titleWidth:{description:"标题区域宽度占页面比",type:"number",title:"标题区域宽度(%)",min:0,decimals:0,max:100},autoTitleWidth:{description:"开启,则显示全部字符;关闭,最多显示7个字符",type:"boolean",title:"标题自适应宽度",defaultValue:!1},fill:{description:"flex布局下,填充满剩余部分",type:"boolean",title:"填充"}}}}};function Lt(n,t){const o=Te();let a=!1,s,r=!1;function d(S){return!1}function f(){return!r}function h(){return!r}function l(){return a}function v(){const S=n,x=S.appearance&&S.appearance.class||"",y=x?x.split(" "):[],u=t==null?void 0:t.schema,m=u&&u.appearance&&u.appearance.class||"",c=m?m.split(" "):[],T=S.contents||[],N=T.length?T[0]:null,I=N&&N.appearance&&N.appearance.class||"",R=I?I.split(" "):[],g=T.length?T.reduce((p,i)=>{const C=i&&i.appearance?i.appearance.class:"",P=C?C.split(" "):[];return p.push(...P),p},[]):[],V=(t==null?void 0:t.parent)&&t.parent.schema,B=V&&V.appearance&&V.appearance.class||"";B&&B.split(" "),s={componentClass:x,componentClassList:y,childContents:T,firstChildContent:N,firstChildClass:I,firstChildClassList:R,parent,parentClass:m,parentClassList:c,children:T,childrenClassList:g};const{canAccept:F,fixed:M,hidePadding:b}=o.getRuleValue(y[0],s);return a=b,r=M,!0}function w(S){return Ft}return{canAccepts:d,checkCanDeleteComponent:f,checkCanMoveComponent:h,getPropsConfig:w,hideNestedPaddingInDesginerView:l,resolveComponentContext:v}}function Ht(n,t,o,a){const s=e.ref([]),r=e.ref(n.activeId||""),d=e.ref(!0),f=e.ref(),h=e.ref([]);function l(i){const C=i.value.findIndex(P=>P.props.show!==!1&&!r.value&&!P.props.disabled);!r.value&&C!==-1&&(r.value=i.value[C].props.id)}function v(i,C){i.classList.contains(C)||i.classList.add(C)}function w(i,C){i.classList.remove(C)}function S(i){const{parentElement:C}=i;C&&(i.scrollWidth>C.offsetWidth?v(i,"farris-title-text-custom"):w(i,"farris-title-text-custom"))}function x(i){var P;if(n.autoTitleWidth)return;const C=(P=i.value)==null?void 0:P.querySelectorAll(".st-tab-text");C&&C.forEach(E=>S(E))}const y=i=>{i.preventDefault(),i.stopPropagation()};function u(i){s.value=s.value.filter(C=>C.props.id!==i),r.value===i&&(r.value="",l(s))}function m(i,C,P=!1){const E=s.value.findIndex(k=>k.props.id===C);u(C),y(i),e.nextTick(()=>{x(o),P&&(d.value=!0),t.emit("tabRemove",{removeIndex:E,removeId:C,activeId:r.value})})}function c(){const i=s.value.find(E=>E.props.id===r.value);if(h.value=[],i&&i.props.toolbar){const E=i.props.toolbar.hasOwnProperty("contents")?"contents":"buttons";i.props.toolbar[E]&&i.props.toolbar[E].length&&(h.value=[...i.props.toolbar[E]])}const C=a.schema.contents,P=C==null?void 0:C.find(E=>E.id===r.value);f.value=P==null?void 0:P.toolbar}function T(i){const C=r.value;r.value=i,c(),t.emit("tabChange",{prevId:C,nextId:r.value})}function N(i){T(i)}function I(i){s.value.findIndex(P=>P.props.id===i.props.id)===-1&&s.value.push(i)}function R(i){s.value.findIndex(P=>P.props.id===i.props.id)!==-1&&(s.value.forEach(P=>{P.props.id===i.props.id&&(P=i)}),e.nextTick(()=>{x(o)}))}function g(i){i&&(i.stopPropagation(),i.preventDefault())}function V(i,C){g(i);const P=a.schema.contents,E=P==null?void 0:P.findIndex(k=>k.id===C);E===-1||E===void 0||(P==null||P.splice(E,1),u(C))}function B(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(C=>C.classList.remove("dgComponentFocused"));const i=document.getElementsByClassName("dgComponentSelected");Array.from(i).forEach(C=>C.classList.remove("dgComponentSelected"))}function F(i){i.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function M(i){var k;const{contents:C=[]}=a.schema,P=C==null?void 0:C.findIndex(j=>j.id===i),E=C[P];(k=a==null?void 0:a.setupContext)==null||k.emit("selectionChange",E.type,E)}function b(i,C){B(),g(i),F(i),M(C)}function p(i,C){B(),g(i),F(i)}return{activeId:r,addTab:I,changeTitleStyle:x,removeTab:m,selectTab:N,selectTabByTabId:T,tabPages:s,updateTab:R,toolbarItems:h,removeDesignTab:V,selectDesignTab:b,selectDesignTabToolbar:p,toolbarSchema:f}}const Fe=new Map([["buttons","items"]]);function Le(n,t,o){return t}const zt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-toolbar.schema.json",title:"response-toolbar",description:"A Farris Toolbar Component",type:"object",properties:{id:{description:"The unique identifier for a Response Toolbar",type:"string"},type:{description:"The type string of Response Toolbar",type:"string",default:"response-toolbar"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},alignment:{description:"The alignment of Response Toolbar Button.",type:"string",default:"right"},buttons:{description:"The items of Response Toolbar.",type:"array",default:[]}},required:["id","type","buttons"]},xe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-toolbar-item.schema.json",title:"response-toolbar-item",description:"A Farris Toolbar Item Component",type:"object",properties:{id:{description:"The unique identifier for a Response Toolbar",type:"string"},type:{description:"The type string of Response Toolbar",type:"string",default:"response-toolbar-item"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},text:{description:"The items of Response Toolbar.",type:"string",default:"新增"},icon:{description:"The icon of response toolbar item.",type:"string",default:""},onClick:{description:"The event of response toolbar item.",type:"string",default:""}},required:["id","type","text"]},He={title:"response-toolbar-item",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}},text:{title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},icon:{title:"图标",type:"string",description:""}}}}},ze={customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]}};he[xe.title]=xe,Pe[He.title]=He,ie(ze,zt,Fe,Le);const We={id:{type:String,default:""},items:{type:Object,default:{}},text:{type:String,default:""},disabled:{type:Boolean,default:!1},icon:{type:String,default:""}};ie(We,xe,Fe,Le);class qe{constructor(t){L(this,"id","");L(this,"class","btn-secondary");L(this,"icon","");L(this,"groupId","");L(this,"order",-1);L(this,"asDropDownTop",!1);L(this,"text","");L(this,"visible",!0);L(this,"responsed",!1);L(this,"tipsEnable",!1);L(this,"tipsText","");L(this,"width",0);L(this,"onClick",()=>{});L(this,"options");this.options=t;const o=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","onClick"];Object.keys(t).filter(a=>o.indexOf(a)>-1).forEach(a=>{this[a]=t[a]})}get enable(){return Object.keys(this.options).indexOf("enable")>-1?this.options.enable:e.computed(()=>!0)}setWidth(t){this.width=parseInt(t,10)}getWidth(){return this.visible?this.width:!1}}class Wt extends qe{constructor(t){super(t)}}function qt(){function n(t){const o=[];return t.reduce((a,s)=>(s.children&&s.children.length>0?a.push(new pe(s)):a.push(new Wt(s)),a),o),o}return{buildResponseToolbarItems:n}}const{buildResponseToolbarItems:Ut}=qt();class pe extends qe{constructor(o){super(o);L(this,"placement","");L(this,"dropdownClass","");L(this,"menuClass","");L(this,"split",!1);L(this,"children",[]);L(this,"expanded",!1);const a=["isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(o).filter(s=>a.indexOf(s)>-1).forEach(s=>{this[s]=o[s]}),o.children&&o.children.length&&(this.children=Ut(o.children))}}function _t(){function n(o){const a={"f-icon":!0};if(o.icon){const s=o.icon.trim().split(" ");s&&s.length&&s.reduce((r,d)=>(r[d]=!0,r),a)}return a}function t(o){return!!(o.icon&&o.icon.trim())}return{iconClass:n,shouldShowIcon:t}}function Gt(n,t){const o=e.inject("design-item-context"),a=e.inject("toolbar-item-handler",()=>{});function s(){a&&a()}function r(b){const p={"dropdown-menu":!0};if(b.class){const i=b.menuClass.split(" ");i&&i.length&&i.reduce((C,P)=>(C[P]=!0,C),p)}return p}function d(b){const p={disabled:!b.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},i=b.dropdownClass.split(" ");return i&&i.length&&i.reduce((C,P)=>(C[P]=!0,C),p),p}function f(b){const p={disabled:!b.enable,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0},i=b.class.split(" ");return i&&i.length&&i.reduce((C,P)=>(C[P]=!0,C),p),p}let h;const l=new Map;function v(b,p,i){var P;((P=b.target)==null?void 0:P.id)===p.id&&b.stopPropagation();const C=i?i.id:"__top_item__";if(p.children&&p.children.length&&(p.expanded=!p.expanded,p.expanded?l.set(C,p):l.delete(C)),l.has(C)&&l.get(C)!==p){const E=l.get(C);E&&(E.expanded=!1)}}function w(b){b&&(b.stopPropagation(),b.preventDefault())}function S(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(p=>p.classList.remove("dgComponentFocused"));const b=document.getElementsByClassName("dgComponentSelected");Array.from(b).forEach(p=>p.classList.remove("dgComponentSelected"))}function x(b){b.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function y(b){const{buttons:p=[]}=o.schema;let i=[];p.forEach(E=>{i=i.concat(E.children||[])});const C=i.findIndex(E=>E.id===b),P=C===-1?null:i[C];return{index:C,item:P}}function u(b){const{buttons:p=[]}=o.schema,i=p.findIndex(P=>P.id===b),C=i===-1?null:p[i];return{index:i,item:C}}function m(b){var C;o.schema;const{index:p,item:i}=y(b);(C=o==null?void 0:o.setupContext)==null||C.emit("selectionChange",i==null?void 0:i.type,i)}const c=function(b){const{componentType:p}=b,i=Y(p,b),C=p.toLowerCase().replace("-","_");return i&&!i.id&&i.type===p&&(i.id=`${C}_${Math.random().toString().slice(2,6)}`),i},T=function(){const b={componentType:"response-toolbar-item",parentComponentInstance:t.value,targetPosition:-1};return c(b)};function N(b,p){w(b),S(),x(b),m(p.id)}function I(b,p,i){w(b);const C=p.id,P=i&&i.id,{buttons:E=[]}=o.schema;if(!P)return;const{index:k}=u(P);if(k===-1)return;const{index:j}=y(C);j!==-1&&(E[k].children.splice(j,1),s())}function R(b,p,i){w(b);const C=i&&i.id,{buttons:P=[]}=o.schema;if(!C)return;const{index:E}=u(C);if(E===-1)return;const k=T(),j=Object.assign({},k,{text:p.text});P[E].children.push(j),s()}function g(b,p,i){w(b);const C=i&&i.id,{buttons:P=[]}=o.schema;if(!C)return;const{index:E}=u(C);if(E===-1)return;const k=T(),j=Object.assign({},k,{text:"按钮"});P[E].children.push(j),s()}function V(b,p){return e.createVNode("div",{class:"component-btn-group"},[e.createVNode("div",null,[e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:i=>I(i,b,p)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:i=>R(i,b,p)},[e.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增同级",ref:"appendSame",style:"width:85px!important;padding:0 5px;position:static;",onClick:i=>g(i,b,p)},[e.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),e.createVNode("span",{style:"font-size:13px;margin:auto"},[e.createTextVNode("新增同级")])])])])}function B(b){return b.children.map(p=>p.children&&p.children.length?e.createVNode("li",{class:d(p),id:p.id,onClick:i=>p.enable&&v(i,p,b)},[e.createVNode("span",{id:p.id,class:f(p),onMouseover:i=>p.enable&&v(i,p,b)},[p.text,e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),h(p,p)]):e.createVNode("li",{class:f(p),id:p.id,onClick:i=>N(i,p)},[V(p,b),n.shouldShowIcon(p)&&e.createVNode("i",{class:n.iconClass(p)},null),p.text]))}function F(b,p,i){const C={display:b.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},P=document.getElementsByTagName("body")[0].getClientRects()[0].width,E=p,k=E==null?void 0:E.getClientRects();if(E&&k&&k.length){const{top:j,width:A,left:$,right:H,height:X}=k[0],Z=Math.ceil(X+j);C.top=`${Z}px`,C.left=`${$}px`;const ae=b.id+"_menu",K=p?p.querySelector("#"+ae):null;if(K){C.display==="block"&&(K.style.display="block");const ee=K.getBoundingClientRect();if(i){C.top=`${j-6}px`;const W=Math.ceil(A+$);C.left=`${W}px`}P-$-A<ee.width&&(C.left=`${(i?$:H)-ee.width}px`)}}return C}h=function(b,p){var E,k;const i=e.getCurrentInstance(),C=p?p.id:b.id,P=(k=(E=i==null?void 0:i.exposed)==null?void 0:E.elementRef.value)==null?void 0:k.querySelector("#"+C);return e.createVNode("ul",{class:r(b),style:F(b,P,p),id:b.id+"_menu"},[B(b)])};function M(){l.forEach(b=>{b.expanded=!1}),l.clear()}return{renderDropdownMenu:h,clearAllDropDownMenu:M}}function Qt(n,t,o){const a=e.ref(n.alignment),{renderDropdownMenu:s,clearAllDropDownMenu:r}=Gt(t,o),d=e.inject("design-item-context"),f=e.inject("toolbar-item-handler",()=>{});function h(){f&&f()}function l(M){const b={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":a.value==="right","f-btn-mr":a.value==="left"},p=M.dropdownClass.split(" ");return p&&p.length&&p.reduce((i,C)=>(i[C]=!0,i),b),b}function v(M){const b={btn:!0,disabled:!M.enable,"position-relative":!0,"farris-component":!0,"f-rt-btn":!0,"btn-icontext":!!(M.icon&&M.icon.trim())};if(M.class){const p=M.class.split(" ");p&&p.length&&p.reduce((i,C)=>(i[C]=!0,i),b)}return b}function w(M){M&&(M.stopPropagation(),M.preventDefault())}function S(M,b){w(M);const p=b.expanded;document.body.click(),b.expanded=!p}const x=function(M){const{componentType:b}=M,p=Y(b,M),i=b.toLowerCase().replace("-","_");return p&&!p.id&&p.type===b&&(p.id=`${i}_${Math.random().toString().slice(2,6)}`),p},y=function(){const M={componentType:"response-toolbar-item",parentComponentInstance:o.value,targetPosition:-1};return x(M)};function u(M){const b=d.schema.buttons||d.schema.contents,p=b==null?void 0:b.findIndex(C=>C.id===M),i=p===-1?null:b[p];return{index:p,toolbarItem:i}}function m(M,b){var k;const{index:p,toolbarItem:i}=u(b);if(p===-1)return;const C=i.text||"按钮",P=y(),E=Object.assign({},P,{text:C});(k=d.schema.buttons)==null||k.push(E),h()}function c(M,b){const{index:p,toolbarItem:i}=u(b);if(p===-1)return;const C=i.text||"按钮",P=y(),E=Object.assign({},P,{text:C}),k=d.schema.buttons[p].children||[];k.push(E),d.schema.buttons[p].children=k,h()}function T(M,b){const p=d.schema.buttons||d.schema.contents,i=p==null?void 0:p.findIndex(C=>C.id===b);i!==-1&&(p.splice(i,1),h())}function N(M){return e.createVNode("div",{class:"component-btn-group"},[e.createVNode("div",null,[e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:b=>T(b,M)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:b=>m(b,M)},[e.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增子级",ref:"appendChildButton",style:"width:85px!important;padding:0 5px;position:static;",onClick:b=>c(b,M)},[e.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),e.createVNode("span",{style:"font-size:13px;margin:auto"},[e.createTextVNode("新增子级")])])])])}function I(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(b=>b.classList.remove("dgComponentFocused"));const M=document.getElementsByClassName("dgComponentSelected");Array.from(M).forEach(b=>b.classList.remove("dgComponentSelected"))}function R(M){M.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function g(M){var C;const b=d.schema.buttons||d.schema.contents,p=b==null?void 0:b.findIndex(P=>P.id===M);if(p===-1)return;const i=b[p];(C=d==null?void 0:d.setupContext)==null||C.emit("selectionChange","response-toolbar-item",i)}function V(M,b){w(M),I(),R(M),w(M),S(M,b),g(b.id)}function B(M){return e.createVNode("div",{id:M.id,class:l(M)},[e.createVNode("div",{class:v(M),style:"display: flex;padding-right: 0.1rem;",onClick:b=>M.enable&&V(b,M)},[N(M.id),t.shouldShowIcon(M)&&e.createVNode("i",{class:t.iconClass(M)},null),e.createVNode("span",null,[M.text]),e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-down",style:"display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"},null)]),s(M)])}function F(){r()}return{renderToolbarDropdown:B,clearAllDropDown:F}}function Ue(){function n(t){var s,r;if(!t)return!1;const o=((s=t.targetContainer)==null?void 0:s.componentInstance)&&t.targetContainer.componentInstance.value;if(!o)return!1;const a=(r=o.schema.appearance)==null?void 0:r.class;if(t.controlCategory==="input"||t.controlType==="form-group"){const d=o.schema.type,f=(d==="response-form"||d==="content-container")&&a&&a.includes("farris-form");if(o.schema.type!=="response-layout-item"&&!f)return!1}return t.controlType!=="field-set"}return{basalDragulaRuleForContainer:n}}class _e{static getEditorTypesByMDataType(t){return this.fieldControlTypeMapping[t]}}L(_e,"fieldControlTypeMapping",{String:[{key:O["input-group"].type,value:O["input-group"].name},{key:O.lookup.type,value:O.lookup.name},{key:O.Image.type,value:O.Image.name},{key:O["date-picker"].type,value:O["date-picker"].name},{key:O["check-box"].type,value:O["check-box"].name},{key:O["radio-group"].type,value:O["radio-group"].name},{key:O["combo-list"].type,value:O["combo-list"].name},{key:O.textarea.type,value:O.textarea.name}],Text:[{key:O.textarea.type,value:O.textarea.name},{key:O.avatar.type,value:O.avatar.name},{key:O.lookup.type,value:O.lookup.name}],Decimal:[{key:O["number-spinner"].type,value:O["number-spinner"].name}],Integer:[{key:O["number-spinner"].type,value:O["number-spinner"].name}],Number:[{key:O["number-spinner"].type,value:O["number-spinner"].name}],BigNumber:[{key:O["number-spinner"].type,value:O["number-spinner"].name}],Date:[{key:O["date-picker"].type,value:O["date-picker"].name}],DateTime:[{key:O["date-picker"].type,value:O["date-picker"].name}],Boolean:[{key:O.switch.type,value:O.switch.name},{key:O["check-box"].type,value:O["check-box"].name}],Enum:[{key:O["combo-list"].type,value:O["combo-list"].name},{key:O["radio-group"].type,value:O["radio-group"].name}],Object:[{key:O.lookup.type,value:O.lookup.name},{key:O["combo-list"].type,value:O["combo-list"].name},{key:O["radio-group"].type,value:O["radio-group"].name}],EmployeeSelector:[{key:O.EmployeeSelector.type,value:O.EmployeeSelector.name}],AdminOrganizationSelector:[{key:O.AdminOrganizationSelector.type,value:O.AdminOrganizationSelector.name}]});class Se{constructor(t,o){L(this,"componentId");L(this,"viewModelId");L(this,"eventsEditorUtils");L(this,"formSchemaUtils");L(this,"formMetadataConverter");L(this,"designViewModelUtils");L(this,"designViewModelField");L(this,"controlCreatorUtils");L(this,"designerHostService");L(this,"metadataService",null);L(this,"propertyConfig",{type:"object",categories:{}});var a;this.componentId=t,this.designerHostService=o,this.eventsEditorUtils=o.eventsEditorUtils,this.formSchemaUtils=o.formSchemaUtils,this.formMetadataConverter=o.formMetadataConverter,this.viewModelId=((a=this.formSchemaUtils)==null?void 0:a.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=o.designViewModelUtils,this.controlCreatorUtils=o.controlCreatorUtils,this.metadataService=o.metadataService}setDesignViewModelField(t){const o=t.binding&&t.binding.type==="Form"&&t.binding.field;if(o){if(!this.designViewModelField){const a=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=a.fields.find(s=>s.id===o)}t.updateOn=this.designViewModelField.updateOn}}changeFieldEditorType(t,o){}getBasicPropConfig(t){var o=this;return this.setDesignViewModelField(t),{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"string",refreshPanelAfterChanged:!0,$converter:"/converter/change-editor.converter",editor:{type:"combo-list",textField:"value",valueField:"key",data:_e.getEditorTypesByMDataType(o.designViewModelField.type.name)}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"}},setPropertyRelates(a,s){if(a)switch(a&&a.propertyID){case"type":{o.changeControlType(t,a);break}}}}}changeControlType(t,o){var l,v,w,S,x;const a=o.propertyValue,s=this.formSchemaUtils.getComponentById(this.componentId);let r=this.getControlParentContainer(t.id,s);if(!r)return;const d=r.contents.findIndex(y=>y.id===t.id),f=r.contents[d];let h;this.designViewModelField&&(this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,{editor:{$type:a},name:this.designViewModelField.name,require:this.designViewModelField.require,readonly:this.designViewModelField.readonly},!1),h=this.controlCreatorUtils.setFormFieldProperty("Form",this.designViewModelField,null,a)),Object.assign(h,{id:f.id,appearance:f.appearance,size:f.size,label:f.label}),Object.assign(h.editor,{isTextArea:h.isTextArea&&f.isTextArea,type:a||"",placeHolder:(l=f.editor)==null?void 0:l.placeHolder,holdPlace:(v=f.editor)==null?void 0:v.holdPlace,readonly:(w=f.editor)==null?void 0:w.readonly,require:(S=f.editor)==null?void 0:S.require,visible:(x=f.editor)==null?void 0:x.visible}),r.contents.splice(d,1,h)}getAppearanceConfig(t=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!1,editor:{type:"response-layout-editor-setting"},$converter:"/converter/response-form-layout.converter"}}}}getControlParentContainer(t,o){let a;if(!o||!o.contents||o.contents.length===0)return null;for(const s of o.contents){if(s.id===t)return a=o,o;if(a=this.getControlParentContainer(t,s),a)return a}}getBindingFieldEditorOptions(t){const o=this.formSchemaUtils.getFormMetadataBasicInfo();return{type:"field-selector",bindingType:{enable:!1},editorParams:{propertyData:t,formBasicInfo:o},columns:[{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"fieldType",title:"字段类型"}],beforeOpenDialog:a=>{const s=this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);a.instance.loadData(s)},textField:"bindingField"}}}class Xt extends Se{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getBehaviorProperties(t),this.propertyConfig}getBasicPropConfig(t){this.propertyConfig.categories.basic={description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}}}}}getBehaviorProperties(t){this.propertyConfig.categories.behavior={title:"行为",description:"",properties:{alignment:{title:"对齐方式",description:"The alignment of Response Toolbar Button.",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"right",name:"右对齐"},{value:"left",name:"左对齐"}]}},buttons:{title:"按钮",description:"The items of Response Toolbar.",type:"array",default:[],$converter:"/converter/buttons.converter",refreshPanelAfterChanged:!0}}}}}function Yt(n,t,o,a){const s=Te(),r=e.ref(!1),d=e.ref(!1);let f=!0,h=!1,l;function v(g){return l&&l.componentClassList&&l.componentClassList.includes("f-form-layout")&&l.componentClassList.includes("farris-form")?g.sourceType==="control"&&g.controlCategory==="input"||g.sourceType==="move"&&g.controlType==="form-group":!0}function w(g){return!Ue().basalDragulaRuleForContainer(g)||!f||!v(g),!1}function S(){r.value=!1,d.value=!1;const g=n,V=g.appearance&&g.appearance.class||"",B=V.split(" "),F=g.buttons||[],M=F.length?F[0]:null,b=M&&M.appearance?M.appearance.class:"",p=b?b.split(" "):[],i=F.length?F.reduce(($,H)=>{const X=H&&H.appearance?H.appearance.class:"",Z=X?X.split(" "):[];return $.push(...Z),$},[]):[],C=o==null?void 0:o.schema,P=C&&C.appearance&&C.appearance.class||"",E=P?P.split(" "):[];l={componentClass:V,componentClassList:B,childContents:F,firstChildContent:M,firstChildClass:b,firstChildClassList:p,parent:C,parentClass:P,parentClassList:E,children:F,childrenClassList:i};const{canAccept:k,fixed:j,hidePadding:A}=s.getRuleValue(B[0],l);return f=k,h=A,!0}function x(g){}function y(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function u(g,V){return V.text=g.label,V}function m(g,V,B){const F=n;if((F.appearance&&F.appearance.class||"").split(" ").includes("f-form-layout")){const p=String(g.innerText),i=Y("form-group");return i.editor=B,i.label=p,i}return B}function c(){return!1}function T(){return!1}function N(){return!0}function I(){return h}function R(g){return new Xt(g,t).getPropertyConfig(n)}return{canAccepts:w,checkCanAddComponent:N,checkCanDeleteComponent:T,checkCanMoveComponent:c,getStyles:y,hideNestedPaddingInDesginerView:I,onAcceptNewChildElement:m,onAcceptMovedChildElement:x,onResolveNewComponentSchema:u,resolveComponentContext:S,getPropsConfig:R,triggerBelongedComponentToMoveWhenMoved:r,triggerBelongedComponentToDeleteWhenDeleted:d}}const Zt={id:{type:String,default:""},componentId:{type:String,default:""},canAdd:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},canMove:{type:Boolean,default:!1},contentKey:{type:String,default:"contents"},childLabel:{type:String,default:""},childType:{type:String,default:""},modelValue:{type:Object}},Me=e.ref(0);function Jt(n,t){const o=t.getBoundingClientRect(),a=n.getBoundingClientRect(),s=a.top>=o.top,r=a.top<=o.bottom;return s&&r}function Kt(n){if(!n)return;let t;if(n.className.includes("dgComponentSelected")?t=n:t=n.querySelector(".dgComponentSelected"),!t)return;const o=t.getBoundingClientRect();if(o.width===0&&o.height===0)return;const a=t.querySelector(".component-btn-group");if(a){if(!Jt(t,n)){a.style.display="none";return}a.style.display="";const r=a.getBoundingClientRect(),d=a.querySelector("div");if(d){const f=d.getBoundingClientRect();d.style.top=r.top+"px",d.style.left=r.left-f.width+"px"}}}function en(n,t,o){var R;function a(){}const s="",r=e.ref();function d(){return!0}function f(){return!1}function h(){return!0}function l(){return!0}function v(){return!0}function w(g){if(!g||!g.value)return null;const V=e.ref(g==null?void 0:g.value.parent),B=w(V);return B||null}function S(g=t){const{componentInstance:V,designerItemElementRef:B}=g;return!V||!V.value?null:V.value.canMove||V.value.canAdd||V.value.canDelete?B:S(g.parent)}function x(g){return!!o}function y(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function u(){}function m(g,V){}function c(g){const{componentType:V}=g;let B=Y(V,g);const F=V.toLowerCase().replace("-","_");return B&&!B.id&&B.type===V&&(B.id=`${F}_${Math.random().toString().slice(2,6)}`),B}function T(g,V){const B=String(g.getAttribute("data-controltype")),F=g.getAttribute("data-feature"),M=F?JSON.parse(F):{};M.parentComponentInstance=r.value;let b=Y(B,M);const p=B.toLowerCase().replace("-","_");return b&&!b.id&&b.type===B&&(b.id=`${p}_${Math.random().toString().slice(2,6)}`),b}function N(g){}function I(){return[]}return r.value={canMove:d(),canSelectParent:f(),canAdd:l(),canDelete:h(),canNested:!v(),contents:[],elementRef:n,parent:(R=t.parent)==null?void 0:R.componentInstance,schema:t.schema,styles:s,canAccepts:x,getBelongedComponentInstance:w,getDraggableDesignItemElement:S,getDraggingDisplayText:y,getPropConfig:I,getDragScopeElement:u,onAcceptMovedChildElement:m,onAcceptNewChildElement:T,onChildElementMovedOut:N,addNewChildComponentSchema:c,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},r}const Ge=e.defineComponent({name:"FDesignerInnerItem",props:Zt,emits:["selectionChange","addComponent","removeComponent"],setup(n,t){const o=e.ref(n.canMove),a=e.ref(n.canAdd),s=e.ref(n.canDelete),r=e.ref(!1),d=e.ref(n.contentKey),f=e.ref(n.childType),h=e.ref(n.childLabel),l=e.ref(n.modelValue),v=e.ref(""),w=e.ref(),S=e.inject("canvas-dragula"),x=e.ref(),y=e.inject("design-item-context"),u={designerItemElementRef:w,componentInstance:x,schema:l.value,parent:y,setupContext:t};e.provide("design-item-context",u);const m=e.computed(()=>({"farris-component":!0,"position-relative":o.value||s.value,"farris-nested":r.value,"can-move":o.value,"d-none":w.value&&w.value.classList.contains("d-none")})),c=e.computed(()=>{const p={};return v.value&&v.value.split(";").reduce((i,C)=>{const[P,E]=C.split(":");return P&&(i[P]=E),i},p),p});function T(p,i){if(y&&y.schema[d.value]){const C=y.schema[d.value].findIndex(P=>P.id===i.id);if(C>-1){const P=y.schema[d.value].length,E=y.schema[d.value][C%P];y.designerItemElementRef.value.querySelector(`#${E.id}-design-item`),y.schema[d.value].splice(C,1),y.componentInstance.value.updateDragAndDropRules(),Me.value++,t.emit("removeComponent")}}}function N(p){if(x.value.addNewChildComponentSchema){const i={componentType:f.value,label:h.value,parentComponentInstance:x.value,targetPosition:-1},C=x.value.addNewChildComponentSchema(i);l.value[d.value].push(C),t.emit("addComponent")}}function I(){return a.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:p=>{N()}},[e.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function R(p){return s.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:e.withModifiers(i=>T(i,p),["stop"])},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function g(){return o.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[e.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function V(p){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[I(),g(),R(p)])])}e.watch(()=>n.modelValue,p=>{l.value=p,u.schema=p});function B(p){const i=p.target;Kt(i)}function F(){var p,i;(i=(p=l.value)==null?void 0:p.contents)!=null&&i.length&&w.value&&w.value.addEventListener("scroll",B)}function M(){const p=w.value,i=e.ref(p.children[1]);return en(i,u).value}e.onMounted(()=>{if(w.value){const p=w.value.querySelector(`[data-dragref='${l.value.id}-container']`);x.value=p&&p.componentInstance?p.componentInstance.value:M(),S&&p&&S.attachComponents(p,l.value),r.value=x.value.canNested!==void 0?x.value.canNested:r.value,a.value=x.value.canAdd!==void 0?x.value.canAdd:a.value,s.value=x.value.canDelete!==void 0?x.value.canDelete:s.value,o.value=x.value.canMove!==void 0?x.value.canMove:o.value,v.value=x.value.styles||"",w.value&&(w.value.componentInstance=x,w.value.designItemContext=u)}F(),Me.value++}),e.onBeforeUnmount(()=>{w.value&&w.value.removeEventListener("scroll",B)});function b(p){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(C=>C.classList.remove("dgComponentFocused")),p&&(p.preventDefault(),p.stopPropagation());const i=w.value;if(i){const C=document.getElementsByClassName("dgComponentSelected");if(!(C&&C.length===1&&C[0]===w.value)){Array.from(C).forEach(k=>k.classList.remove("dgComponentSelected")),i.classList.add("dgComponentFocused"),t.emit("selectionChange",l.value.type,l.value,n.componentId,x.value);const E=x.value.getDraggableDesignItemElement(u);E&&E.value&&E.value.classList.add("dgComponentSelected")}}Me.value++}return()=>e.createVNode("div",{id:`${n.id}-design-item`,ref:w,class:m.value,style:c.value,onClick:b},[V(l.value),t.slots.default&&t.slots.default()])}});class tn extends Se{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(t){this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识00",title:"标识",type:"string",readonly:!0},type:{description:"类型",title:"类型",type:"string",readonly:!0,$converter:"/converter/type.converter"},text:{title:"文本",type:"string",description:""},icon:{title:"图标",type:"string",description:""}}}}getAppearanceProperties(t){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"}},setPropertyRelates(o,a){}}}getEventPropConfig(t){const o=[{label:"click",name:"点击事件"}];var a=this;const s=a.eventsEditorUtils.formProperties(t,a.viewModelId,o),r={};r[a.viewModelId]={type:"events-editor",editor:{initialData:s}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:r,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(d,f){const h=d.propertyValue;delete t[a.viewModelId],h&&(h.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(t,a.viewModelId,h.events,h))}}}}class nn extends Se{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(){this.propertyConfig.categories.basic={title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}},text:{title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},icon:{title:"图标",type:"string",description:""}}}}getAppearanceProperties(t){}getEventPropConfig(t){const o=[{label:"click",name:"点击事件"}],a=this,s=a.eventsEditorUtils.formProperties(t,a.viewModelId,o),r={};r[a.viewModelId]={type:"events-editor",editor:{initialData:s}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:r,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(d,f){const h=d.propertyValue;delete t[a.viewModelId],h&&(h.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(t,a.viewModelId,h.events,h))}}}}function on(n,t){Te();const o=e.ref(!1),a=e.ref(!1);let s=!1,r=!1;function d(m){return!1}function f(m){}function h(){return""}function l(m,c){return c.text=m.label,c}function v(m,c,T){const N=n.schema;if((N.appearance&&N.appearance.class||"").split(" ").includes("f-form-layout")){const g=String(m.innerText),V=Y("form-group");return V.editor=T,V.label=g,V}return T}function w(){return!1}function S(){return!r}function x(){return!1}function y(){return s}function u(m){let c;switch(n.schema.type){case"tab-toolbar-item":c=new tn(m,t);break;default:c=new nn(m,t)}return c.getPropertyConfig(n.schema)}return{canAccepts:d,checkCanAddComponent:x,checkCanDeleteComponent:S,checkCanMoveComponent:w,getStyles:h,hideNestedPaddingInDesginerView:y,onAcceptNewChildElement:v,onAcceptMovedChildElement:f,onResolveNewComponentSchema:l,getPropsConfig:u,triggerBelongedComponentToMoveWhenMoved:o,triggerBelongedComponentToDeleteWhenDeleted:a}}const an=e.defineComponent({name:"FResponseToolbarItemDesign",props:We,emits:["Click"],setup(n,t){e.ref(),e.ref();const o=e.ref(n.alignment),a={id:"__more_buttons__",text:"More"},s=e.ref(new pe(a));e.computed(()=>s.value.children.length>0);const r=e.ref(),d=e.inject("designer-host-service"),f=e.inject("design-item-context"),h=on(f,d),l=Be.useDesignerInnerComponent(r,f,h);e.inject("toolbar-item-handler",()=>{}),e.onMounted(()=>{r.value.componentInstance=l}),t.expose(l.value);function v(){const x={"f-icon":!0};if(n.icon){const y=n.icon.trim().split(" ");y&&y.length&&y.reduce((u,m)=>(u[m]=!0,u),x)}return x}function w(){return!!(n.icon&&n.icon.trim())}function S(){const x={btn:!0,"f-rt-btn":!0,"f-btn-ml":o.value==="right","f-btn-mr":o.value==="left","btn-icontext":!!(n.icon&&n.icon.trim())};if(n.class){const y=n.class.split(" ");y&&y.length&&y.reduce((u,m)=>(u[m]=!0,u),x)}return x}return e.onMounted(()=>{}),e.onUnmounted(()=>{}),()=>e.createVNode("div",{ref:r,"data-dragref":`${f.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[e.createVNode("button",{type:"button",class:S(),id:n.id},[w()&&e.createVNode("i",{class:v()},null),n.text])])}}),sn=e.defineComponent({name:"FResponseToolbarDesign",props:ze,emits:["Click"],setup(n,t){const o=e.ref(n.items);let a=new Array(o.value.length).fill(e.ref());const s=e.ref(),r=e.ref(),d=e.ref(n.alignment),f={id:"__more_buttons__",text:"More"},h=e.ref(new pe(f)),l=_t();e.computed(()=>h.value.children.length>0);const v=e.ref(),w=e.inject("designer-host-service"),S=e.inject("design-item-context"),x=Yt(S.schema,w,S),y=Be.useDesignerInnerComponent(v,S,x);e.inject("toolbar-item-handler",()=>{}),e.onMounted(()=>{v.value.componentInstance=y}),t.expose(y.value);const u=e.computed(()=>({"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0})),m=e.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":d.value==="right","justify-content-start":d.value==="left"})),{renderToolbarDropdown:c,clearAllDropDown:T}=Qt(n,l,y);function N(){o.value.filter(M=>M.children&&M.children.length>0).forEach(M=>{M.expanded=!1}),h.value.expanded=!1,T()}const I=new Map,R=[];function g(M){const b=r.value;let p=M;const i=Array.from(b.children),C=i[i.length-1].id==="__more_buttons__"?i[i.length-1]:null;if(C){const A=C.computedStyleMap().get("margin-left"),$=C.computedStyleMap().get("margin-right"),H=(A?A.value:0)+C.getBoundingClientRect().width+($?$.value:0);p-=H}const P=i.filter(A=>A.id!=="__more_buttons__");for(const A of P){const $=A.computedStyleMap().get("margin-left"),H=A.computedStyleMap().get("margin-right"),X=($?$.value:0)+A.getBoundingClientRect().width+(H?H.value:0);p<X?(I.set(A.id,!0),R.push({id:A.id,width:X})):p-=X}if(R.length)for(let A=R.length-1;A>=0;A--){const $=R[A].width;if(p>=$)p-=$,I.delete(R[A].id),R.pop();else break}const E=Object.assign({},h.value);E.children=[];const k=new pe(E),j=o.value.reduce((A,$)=>(I.has($.id)&&k.children.push($),$.visible=!I.has($.id),A.push($),A),[]);h.value=k,o.value=j}const V=new ResizeObserver(M=>{if(M.length){const p=M[0].contentRect.width,C=r.value.getBoundingClientRect().width;(p<C||R.length)&&g(p)}});e.onMounted(()=>{const M=s.value;V.observe(M),document.body.addEventListener("click",N)}),e.onUnmounted(()=>{V.disconnect(),document.body.removeEventListener("click",N)}),e.watch(()=>n.items,()=>{o.value=n.items},{deep:!0}),e.watch(o,M=>{a=new Array(o.value.length).fill(e.ref())});function B(M,b,p,i){S&&S.setupContext&&S.setupContext.emit("selectionChange",M,b,p,i)}function F(){const M=r.value.querySelector(".dgComponentFocused.dgComponentSelected");M==null||M.classList.remove("dgComponentSelected"),M==null||M.classList.remove("dgComponentFocused")}return()=>e.createVNode("div",{ref:v,"data-dragref":`${S.schema.id}-container`,class:u.value},[e.createVNode("div",{ref:s,class:m.value},[e.createVNode("div",{ref:r,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.map((M,b)=>e.createVNode(Ge,{ref:a[b],class:"p-0 display-inline-block",modelValue:M,"onUpdate:modelValue":p=>M=p,canMove:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:M.id,id:M.id,style:"padding:0 !important;display:inline-block",onSelectionChange:B,onRemoveComponent:F},{default:()=>[e.createVNode(an,{id:M.id,disable:M.disable,text:M.text,icon:M.icon},null)]}))])])])}});function rn(n,t,o,a){const{toolbarItems:s,toolbarSchema:r}=n;function d(f,h,l,v){var w;(w=a.setupContext)==null||w.emit("selectionChange",f,h,l,v)}return e.createVNode("div",{class:"farris-tabs-toolbar"},[e.createVNode("div",{class:"farris-tabs-inline-flex"},[e.createVNode(Ge,{modelValue:r.value,"onUpdate:modelValue":f=>r.value=f,canAdd:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",id:r.value.id,onSelectionChange:d,componentId:r.value.id},{default:()=>[e.createVNode(sn,{items:s.value},null)]})])])}const ln=e.defineComponent({name:"FTabsDesign",props:le,emits:["tabChange","tabRemove"],setup(n,t){const o=e.ref(),a=e.inject("design-item-context"),s=Lt(a.schema,a.parent),r=Re(o,a,s),d=e.ref(n.tabType),f=e.shallowRef(),h=e.shallowRef(),l=Ht(n,t,f,a),{activeId:v,changeTitleStyle:w,tabPages:S,addTab:x,updateTab:y,selectTabByTabId:u,toolbarItems:m}=l,c=$e(n,h,l),T=De(n,f,c,l),{previousButtonClass:N,nextButtonClass:I,nextButtonGroupClass:R,scrollTab:g,updateNavigationLayout:V}=T,B=Ie(n,l),{hideDropDown:F}=B,M=Ot(n,f,T,c,l,r,s),b=M,p=je(n,f,T,c,l),i=new Map([["default",M],["one-page",b],["pills",p]]);e.computed(()=>{const z=S.value.find(_=>_.props.id===v.value);return z==null?void 0:z.slots});const C=e.computed(()=>{const z=S.value.find(ne=>ne.props.id===v.value);return(z==null?void 0:z.props.toolbarPosition)==="inHead"});e.provide("tabs",{activeId:v,addTab:x,updateTab:y,tabPages:S,tabType:d});function P(){const z=r.value.schema.contents||[];return z.length<1?null:z.find(ne=>ne.id===v.value)}function E(){var _;const z=P();m.value=[...(_=z==null?void 0:z.toolbar)==null?void 0:_.contents]}e.provide("toolbar-item-handler",E);const k=e.computed(()=>n.fill||n.tabType==="fill"),j=e.computed(()=>n.tabType==="pills"),A=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":C.value,"farris-tabs-inContent":!C.value,"farris-tabs-nav-fill":k.value,"farris-tabs-nav-pills":j.value})),$=e.computed(()=>({width:C.value&&n.titleWidth?`${n.titleWidth}%`:""})),H=e.computed(()=>({"farris-tabs":!0,"flex-column":n.position==="top","flex-column-reverse":n.position==="bottom","flex-row":n.position==="left","flex-row-reverse":n.position==="right","one-page":n.tabType==="one-page"}));e.onMounted(()=>{S.value.length&&(v.value=n.activeId||S.value[0].props.id,u(v.value)),e.nextTick(()=>{V()}),w(f),window.addEventListener("click",z=>{var _;F.value||(_=o.value)!=null&&_.contains(z.target)||(F.value=!0)}),window.addEventListener("resize",()=>{V()}),o.value.componentInstance=r});function X(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:N.value,onClick:()=>{g(0,-1)}},null)}function Z(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:I.value,onClick:()=>{g(0,1)}},null)}const{renderMorePagesButtton:ae}=Ee(n,B,T,l);function K(){return!!m.value.length&&rn(l,r,s,a)}const ee=i.get(n.tabType)||i.get("default");function W(){var z,_,ne,fe;return e.createVNode("div",{class:A.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(_=(z=t.slots).headerPrefix)==null?void 0:_.call(z)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:$.value},[X(),ee&&ee(),e.createVNode("div",{class:R.value},[Z(),ae()])]),K(),e.createVNode("div",{class:"farris-tabs-header-post"},[(fe=(ne=t.slots).headerSuffix)==null?void 0:fe.call(ne)])])}function Q(){var z,_;return e.createVNode("div",{class:"farris-tabs-content",ref:h},[(_=(z=t.slots).default)==null?void 0:_.call(z)])}return t.expose(r.value),()=>e.createVNode("div",{class:H.value,ref:o},[W(),Q()])}});function cn(n,t,o){return t?{enableAccordion:o.accordionMode}:{enableAccordion:""}}function dn(n,t){return t&&t.contents&&t.contents.length&&t.contents.forEach(o=>{o.title&&(o.text=o.title)}),{buttons:t.contents,buttonPosition:t.position}}const un=new Map([["appearance",ge],["expanded","expandStatus"],["enableAccordion",cn],["toolbar",dn]]);function pn(n,t,o){return t}const fn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/section.schema.json",title:"section",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"section"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contentClass:{description:"",type:"string",default:""},contents:{description:"",type:"array",default:[]},enableAccordion:{description:"",type:"boolean",default:!1},accordionMode:{description:"",type:"string",default:"default"},enableMaximize:{description:"",type:"boolean",default:!1},expanded:{description:"",type:"boolean",default:!0},fill:{description:"",type:"boolean",default:!1},headerClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},showHeader:{description:"",type:"string",default:!0},mainTitle:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},headerContentClass:{description:"",type:"string",default:""},extendClass:{description:"",type:"string",default:""},visible:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{type:{type:"string",default:"SectionToolbar"},position:{type:"string",default:"inHead"},contents:{type:"array",default:[]}},default:null}},required:["id","type","contents"]},mn={title:"section",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}},mainTitle:{title:"主标题",type:"string",description:""},subTitle:{title:"副标题",type:"string",description:""}}},appearance:{title:"样式",description:"Appearance",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},fill:{title:"是否填充内容区域",type:"boolean",description:"To fill the space of parent container in flex layout."},showHeader:{title:"显示标题区域",type:"boolean",description:""},mainTitle:{title:"主标题",type:"string",description:"",visible:{showHeader:!0}},subTitle:{title:"副标题",type:"string",description:"",visible:{showHeader:!0}},enableAccordion:{title:"允许收折",type:"boolean",description:"",visible:{showHeader:!0}}}},extends:{title:"扩展",description:"",properties:{contentClass:{title:"内容区域样式",type:"string",description:""}}}}},Qe={contentClass:{type:String,default:""},customClass:{type:String,default:""},enableAccordion:{type:String,default:""},expandStatus:{type:Boolean,default:!0},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!0},subTitle:{type:String,default:""},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},headerClass:{type:String,default:""},enableMaximize:{type:Boolean,default:!1},headerContentClass:{type:String,default:""},extendClass:{type:String,default:""},buttons:{type:Array,default:[]},buttonPosition:{type:String,default:"inHead"},fill:{type:Boolean,default:!1}};ie(Qe,fn,un,pn,mn);function hn(n,t,o){let a;function s(){!n||!t.value||(o.value=!o.value,o.value?r():d())}function r(){a=n.value.nextElementSibling;const h=document&&document.querySelector("body");h&&(h.appendChild(n.value),n.value.style.zIndex=f())}function d(){a?t.value.insertBefore(n.value,a):t.value.appendChild(n.value),n.value.style.zIndex=null}function f(h=1){const l=["body>.f-datagrid-settings-simple-host","body>div","body>farris-dialog>.farris-modal.show","body>.farris-modal.show","body>farris-filter-panel>.f-filter-panel-wrapper","body .f-sidebar-show>.f-sidebar-main","body>.popover.show","body>filter-row-panel>.f-datagrid-filter-panel","body>.f-section-maximize"],v=Array.from(document.body.querySelectorAll(l.join(","))).filter(S=>S).map(S=>{const{display:x,zIndex:y}=window.getComputedStyle(S);return x==="none"?0:parseInt(y,10)}).filter(S=>S);let w=Math.max(...v);return w<1040&&(w=1040),w+h}return{onClickMaxMinIcon:s}}function Xe(n,t){const o=e.ref(n.buttons),a=e.computed(()=>n.buttonPosition==="inHead"?"right":"left"),s=e.computed(()=>"f-section-toolbar"+(n.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),r=e.computed(()=>{n.buttons&&n.buttons.length>0&&n.buttonPosition});function d(f){t.emit("Click",f)}return()=>r&&e.createVNode(Ve,{customClass:s.value,items:o.value,onClick:d,alignment:a.value},null)}function yn(n,t,o,a,s,r){e.ref(n.subTitle);const d=e.computed(()=>n.buttonPosition),f=Xe(n,t),{onClickMaxMinIcon:h}=hn(a,s,r),l=e.computed(()=>!!n.subTitle),v=e.computed(()=>n.enableMaximize),w=e.computed(()=>n.enableAccordion!=""),S=e.computed(()=>{const N={"f-section-header":!0};return t.slots.header&&n.headerClass.split(" ").reduce((R,g)=>(R[g]=!0,R),N),N});function x(N){N.stopPropagation(),n.enableAccordion!==""&&(o.value=!o.value)}function y(){const N=e.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":o.value})),I=e.computed(()=>({"f-icon":!0,"f-icon-maximize":!r.value,"f-icon-minimize":r.value}));return e.createVNode("div",{class:"f-max-accordion"},[v.value?e.createVNode("span",{class:I.value,onClick:h},null):"",w.value?e.createVNode("button",{class:N.value,onClick:x},[e.createVNode("span",null,[o.value?n.collapseLabel:n.expandLabel])]):""])}function u(){return t.slots.header?e.createVNode("div",{class:S.value},[t.slots.header()]):""}function m(){return e.createVNode("div",{class:"f-title",onClick:x},[e.createVNode("h4",{class:"f-title-text"},[n.mainTitle]),l.value&&e.createVNode("span",null,[n.subTitle])])}function c(){const N=e.computed(()=>{const I={"f-content":!0};return n.headerContentClass&&n.headerContentClass.split(" ").reduce((g,V)=>(g[V]=!0,g),I),I});return t.slots.headerContent?e.createVNode("div",{class:N.value},[t.slots.headerContent()]):""}function T(){return e.createVNode("div",{class:S.value},[t.slots.headerTitle?t.slots.headerTitle():m(),c(),d.value==="inHead"&&f(),(v.value||w.value)&&y()])}return()=>n.showHeader&&(t.slots.header?u():T())}const gn=["moz","ms","webkit"];function bn(){let n=0;return t=>{const o=new Date().getTime(),a=Math.max(0,16-(o-n)),s=setTimeout(()=>{t(o+a)},a);return n=o+a,s}}function vn(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const n=gn.filter(t=>`${t}RequestAnimationFrame`in window)[0];return n?window[`${n}RequestAnimationFrame`]:bn()}vn();function Ne(n,t){return((t==null?void 0:t.split(" "))||[]).reduce((a,s)=>(s&&(a[s]=!0),a),n),n}const Cn=e.defineComponent({name:"FSection",props:Qe,emits:[],setup(n,t){const o=e.ref();let a=e.ref();const s=e.ref(n.customClass),r=e.computed(()=>n.enableAccordion),d=e.ref(n.expandStatus),f=e.computed(()=>n.buttonPosition),h=e.ref(!1),l=yn(n,t,d,o,a,h),v=Xe(n,t),w=e.computed(()=>{const m={"f-section":!0,"f-section-accordion":r.value==="default","f-state-collapse":(r.value==="default"||r.value==="custom")&&!d.value,"f-section-custom-accordion":r.value==="custom","f-section-fill":n.fill,"f-section-maximize":h.value};return Ne(m,s.value)}),S=e.computed(()=>Ne({"f-section-content":!0},n.contentClass)),x=e.computed(()=>Ne({"f-section-extend":!0},x.value));function y(){return t.slots.extend&&e.createVNode("div",{class:x.value},[t.slots.extend()])}function u(){return e.createVNode("div",{class:S.value},[f.value==="inContent"&&v(),t.slots.default&&t.slots.default()])}return e.watch(()=>n.expandStatus,(m,c)=>{m!==c&&(d.value=m)}),e.onMounted(()=>{o&&o.value&&(a.value=o.value.parentElement)}),()=>e.createVNode("div",{class:w.value,ref:o},[l(),y(),u()])}});function wn(n,t){function o(s){return!!Ue().basalDragulaRuleForContainer(s)}function a(s){}return{canAccepts:o,onAcceptMovedChildElement:a}}function Tn(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const xn=e.defineComponent({name:"FTabPageDesign",props:ce,emits:[],setup(n,t){const o=e.ref(),a=e.inject("design-item-context"),s=wn(a.schema,a.parent),r=Re(o,a,s);r.value.canNested=!1,r.value.canDelete=!1,r.value.canMove=!1,t.expose(r.value);const d=e.inject("tabs"),f=e.ref(!0),h={slots:t.slots,props:n},l=e.ref((d==null?void 0:d.tabType.value)||"default");e.onMounted(()=>{o.value.componentInstance=r;const c=d.tabPages.value.findIndex(T=>T.props.id===n.id);!c||c===-1?d==null||d.addTab(h):c>-1&&(f.value=!1,console.warn(`已经存在id为${n.id}的页签啦`))}),e.onUnmounted(()=>{});const v=e.computed(()=>(n==null?void 0:n.id)===(d==null?void 0:d.activeId.value)),w=e.computed(()=>({display:v.value?"":"none"}));e.watch(()=>n,c=>{d==null||d.updateTab({props:c,slots:t.slots})},{immediate:!0,deep:!0});function S(){var T,N;const c=(N=(T=t.slots).default)==null?void 0:N.call(T);return e.createVNode(Cn,{"main-title":n.title,class:"farris-tab-page"},Tn(c)?c:{default:()=>[c]})}const x=e.computed(()=>({"farris-tab-page":!0,"drag-container":!0}));function y(){var T,N;const c=(N=(T=t.slots).default)==null?void 0:N.call(T);return e.createVNode("div",{ref:o,class:x.value,"data-dragref":`${a.schema.id}-container`,style:w.value},[c])}const m=new Map([["default",y],["one-page",S]]).get(l.value)||y;return()=>f.value?m():null}});te.install=n=>{n.component(te.name,te),n.component(de.name,de)},te.register=(n,t,o)=>{n.tabs=te,n["tab-page"]=de,t.tabs=be,t["tab-page"]=ve},te.registerDesigner=(n,t,o)=>{n.tabs=ln,n["tab-page"]=xn,t.tabs=be,t["tab-page"]=ve},U.FTabPage=de,U.FTabs=te,U.default=te,U.tabPageProps=ce,U.tabPagePropsResolver=ve,U.tabsProps=le,U.tabsPropsResolver=be,Object.defineProperties(U,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(W,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("@farris/ui-vue/components/capsule"),require("@farris/ui-vue/components/response-toolbar"),require("@farris/ui-vue/components/dynamic-resolver"),require("@farris/ui-vue/components/section"),require("@farris/ui-vue/components/designer-canvas/src/composition/function/use-designer-inner-component"),require("bignumber.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","@farris/ui-vue/components/capsule","@farris/ui-vue/components/response-toolbar","@farris/ui-vue/components/dynamic-resolver","@farris/ui-vue/components/section","@farris/ui-vue/components/designer-canvas/src/composition/function/use-designer-inner-component","bignumber.js"],e):(W=typeof globalThis<"u"?globalThis:W||self,e(W.tabs={},W.Vue,W.LodashES,W.FCapsule,W.FResponseToolbar,W.dynamicResolver,W.FSection$1,W.useDesignerInnerComponent$1))})(this,function(W,e,se,tt,Ve,nt,ot,Be){"use strict";var Dn=Object.defineProperty;var En=(W,e,se)=>e in W?Dn(W,e,{enumerable:!0,configurable:!0,writable:!0,value:se}):W[e]=se;var L=(W,e,se)=>En(W,typeof e!="symbol"?e+"":e,se);const he={},ke={};function ye(n){const{properties:t,title:o}=n,a=Object.keys(t).reduce((s,r)=>(s[r]=t[r].type==="object"&&t[r].properties?ye(t[r]):se.cloneDeep(t[r].default),s),{});return a.id=`${o}-${Date.now()}`,a}function Y(n,t={}){const o=he[n];if(o){let a=ye(o);const s=ke[n];return a=s?s({getSchemaByType:Y},a,t):a,a}return null}function at(n,t){const o=ye(t);return Object.keys(n).reduce((a,s)=>(a[s]=n[s],a),o),o}function st(n,t){return Object.keys(n).filter(a=>n[a]!=null).reduce((a,s)=>{if(t.has(s)){const r=t.get(s);if(typeof r=="string")a[r]=n[s];else{const c=r(s,n[s],n);Object.assign(a,c)}}else a[s]=n[s];return a},{})}function rt(n,t,o=new Map){const a=at(n,t);return st(a,o)}function it(n={}){function t(l,b,w,x){if(typeof w=="number")return x[l].length===w;if(typeof w=="object"){const S=Object.keys(w)[0],y=w[S];if(S==="not")return Number(x[l].length)!==Number(y);if(S==="moreThan")return Number(x[l].length)>=Number(y);if(S==="lessThan")return Number(x[l].length)<=Number(y)}return!1}function o(l,b,w,x){return x[l]&&x[l].propertyValue&&String(x[l].propertyValue.value)===String(w)}const a=new Map([["length",t],["getProperty",o]]);Object.keys(n).reduce((l,b)=>(l.set(b,n[b]),l),a);function s(l,b){const w=l;return typeof b=="number"?[{target:w,operator:"length",param:null,value:Number(b)}]:typeof b=="boolean"?[{target:w,operator:"getProperty",param:l,value:!!b}]:typeof b=="object"?Object.keys(b).map(x=>{if(x==="length")return{target:w,operator:"length",param:null,value:b[x]};const S=x,y=b[x];return{target:w,operator:"getProperty",param:S,value:y}}):[]}function r(l){return Object.keys(l).reduce((w,x)=>{const S=s(x,l[x]);return w.push(...S),w},[])}function c(l,b){if(a.has(l.operator)){const w=a.get(l.operator);return w&&w(l.target,l.param,l.value,b)||!1}return!1}function f(l,b){return r(l).reduce((S,y)=>S&&c(y,b),!0)}function h(l,b){const w=Object.keys(l),x=w.includes("allOf"),S=w.includes("anyOf"),y=x||S,d=(y?l[y?x?"allOf":"anyOf":"allOf"]:[l]).map(V=>f(V,b));return x?!d.includes(!1):d.includes(!0)}return{parseValueSchema:h}}const O={Button:{type:"Button",name:"按钮",icon:"Button"},ButtonGroup:{type:"ButtonGroup",name:"按钮组",icon:"ButtonGroup"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"工具栏项",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},DisplayField:{type:"DisplayField",name:"标签",icon:"DisplayField"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},FlexLayout:{type:"FlexLayout",name:"弹性布局"},FlowLayout:{type:"FlowLayout",name:"流布局"},ResponseLayout:{type:"ResponseLayout",name:"布局容器",icon:"ResponseLayout3"},ResponseLayoutItem:{type:"ResponseLayoutItem",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},TreeGridField:{type:"TreeGridField",name:"树表格列"},FieldSet:{type:"FieldSet",name:"分组",icon:"FieldSet"},Form:{type:"Form",name:"卡片面板",icon:"Form"},QueryForm:{type:"QueryForm",name:"查询面板",icon:"Form"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},Panel:{type:"Panel",name:"面板",icon:"ContentContainer"},Module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},ExternalContainer:{type:"ExternalContainer",name:"外部容器",icon:"ContentContainer"},Image:{type:"Image",name:"图像",icon:"Image"},ImageUpload:{type:"ImageUpload",name:"图片上传",icon:"imageupload"},HiddenContainer:{type:"HiddenContainer",name:"隐藏区域",icon:"ContentContainer"},ModalContainer:{type:"ModalContainer",name:"弹窗容器",icon:"ContentContainer"},RouteContainer:{type:"RouteContainer",name:"路由区域",icon:"ContentContainer"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},Tag:{type:"Tag",name:"Tag",icon:"Tag"},Sidebar:{type:"Sidebar",name:"侧边栏",icon:"Sidebar"},HtmlTemplate:{type:"HtmlTemplate",name:"模版容器",icon:"HtmlTemplate"},ListView:{type:"ListView",name:"列表",icon:"ListView"},RichTextBox:{type:"RichTextBox",name:"富文本",icon:"RichTextBox"},TimeSpinner:{type:"TimeSpinner",name:"时间调节器",icon:"TimePicker"},TimePicker:{type:"TimePicker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},SectionToolbar:{type:"SectionToolbar",name:"分组面板工具栏"},SectionToolbarItem:{type:"SectionToolbarItem",name:"分组面板按钮"},QueryScheme:{type:"QueryScheme",name:"筛选方案",icon:"QueryScheme"},FormHeader:{type:"FormHeader",name:"翻页"},Splitter:{type:"Splitter",name:"分栏面板",icon:"Splitter"},SplitterPane:{type:"SplitterPane",name:"分栏面板项",dependentParentControl:"Splitter"},WizardDetail:{type:"WizardDetail",name:"向导详情页"},WizardDetailContainer:{type:"WizardDetailContainer",name:"向导详情容器"},Wizard:{type:"Wizard",name:"向导",icon:"Wizard"},MultiSelect:{type:"MultiSelect",name:"数据分配",icon:"MultiSelect"},Steps:{type:"Steps",name:"步骤条",icon:"Steps"},avatar:{type:"avatar",name:"头像",icon:"Avatar"},ListFilter:{type:"ListFilter",name:"筛选条",icon:"ListFilter"},ListNav:{type:"ListNav",name:"列表导航",icon:"ListNav"},NumberRange:{type:"NumberRange",name:"数字区间选择",icon:"NumericBox"},Scrollspy:{type:"Scrollspy",name:"滚动监听",icon:"Scrollspy"},LanguageTextBox:{type:"LanguageTextBox",name:"多语言输入框",icon:"LanguageTextBox"},ComponentRef:{type:"ComponentRef",name:"组件引用节点"},FileUpload:{type:"FileUpload",name:"附件上传",icon:"FileUpload"},FilePreview:{type:"FilePreview",name:"附件预览",icon:"FilePreview"},ViewChange:{type:"ViewChange",name:"多视图切换",icon:"Button"},MultiViewContainer:{type:"MultiViewContainer",name:"多视图",icon:"MultiViewContainer"},MultiViewItem:{type:"MultiViewItem",name:"多视图项",dependentParentControl:"MultiViewContainer"},Footer:{type:"Footer",name:"页脚"},DiscussionEditor:{type:"DiscussionEditor",name:"评论编辑区",icon:"DiscussionEditor"},DiscussionList:{type:"DiscussionList",name:"评论列表",icon:"DiscussionList"},NavTab:{type:"NavTab",name:"标签类导航",icon:"NavTab"},Tags:{type:"Tags",name:"标记组",icon:"Tags"},Portlet:{type:"Portlet",name:"小部件",icon:"dingzhi"},"page-header":{type:"page-header",name:"页头",icon:"Header"},ModalFooter:{type:"ModalFooter",name:"弹窗页脚",icon:"ModalFooter"},ScrollCollapsibleArea:{type:"ScrollCollapsibleArea",name:"滚动收折区域",icon:"ScrollCollapsibleArea"},PersonnelSelector:{type:"PersonnelSelector",name:"人员选择",icon:"PersonnelSelector"},Table:{type:"Table",name:"表格",icon:"DataGrid"},LoopContainer:{type:"LoopContainer",name:"循环容器",icon:"ContentContainer"},FileUploadPreview:{type:"FileUploadPreview",name:"附件上传预览",icon:"FileUpload"},DynamicArea:{type:"DynamicArea",name:"动态区域",icon:"ContentContainer"},DynamicAreaItem:{type:"DynamicAreaItem",name:"动态区域项",icon:"ContentContainer"},TabToolbar:{type:"TabToolbar",name:"标签页工具栏",icon:"TabToolbar"},HeaderToolBar:{type:"HeaderToolBar",name:"头部组件工具栏",icon:"HeaderToolBar"},ModalFooterToolBar:{type:"ModalFooterToolBar",name:"底部组件工具栏",icon:"ModalFooterToolBar"},HeaderToolBarItem:{type:"HeaderToolBarItem",name:"头部组件工具栏按钮",icon:"HeaderToolBarItem"},ModalFooterToolBarItem:{type:"ModalFooterToolBarItem",name:"底部组件工具栏按钮",icon:"ModalFooterToolBarItem"},OrganizationSelector:{type:"OrganizationSelector",name:"组织选择",icon:"OrganizationSelector"},AdminOrganizationSelector:{type:"AdminOrganizationSelector",name:"组织选择",icon:"OrganizationSelector"},EmployeeSelector:{type:"EmployeeSelector",name:"人员选择",icon:"PersonnelSelector"},OaRelation:{type:"OaRelation",name:"关联行政审批",icon:"TextBox"},CitySelector:{type:"CitySelector",name:"城市选择",icon:"CitySelector"},ExtIntergration:{type:"ExtIntergration",name:"外部服务集成",icon:"ViewModel"},AppointmentCalendar:{type:"AppointmentCalendar",name:"预约日历",icon:"DateBox"},Charts:{type:"Charts",name:"图表",icon:"Charts"},QdpFramework:{type:"QdpFramework",name:"查询结果工具栏",icon:"QdpFramework"},SpreadSheet:{type:"SpreadSheet",name:"查询表格控件",icon:"Charts"},QdpConditionDialog:{type:"QdpConditionDialog",name:"查询筛选对话框",icon:"ContentContainer"},QdpConditionDialogTab:{type:"QdpConditionDialogTab",name:"查询筛选标签页",icon:"Tab"},ApprovalLogs:{type:"ApprovalLogs",name:"审批记录",icon:"ApprovalLogs"},ApprovalComments:{type:"ApprovalComments",name:"审批意见",icon:"shenpiyijian"}},Pe={},lt={};it();function re(n,t,o=new Map,a=(c,f,h)=>f,s={},r=c=>c){return he[t.title]=t,ke[t.title]=a,Pe[t.title]=s,lt[t.title]=r,(c={})=>{const f=rt(c,t,o),h=Object.keys(n).reduce((l,b)=>(l[b]=n[b].default,l),{});return Object.assign(h,f)}}function ge(n,t){return{customClass:t.class,customStyle:t.style}}const je=new Map([["appearance",ge]]);function De(n,t,o){const a=n.getSchemaByType("tab-page");return t.contents=[a],t}const Ee={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tabs.schema.json",title:"tabs",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Tabs",type:"string"},type:{description:"The type string of Tabs component",type:"string",default:"tabs"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},autoTitleWidth:{description:"",type:"boolean",default:!1},titleLength:{description:"",type:"number",default:7},fill:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]},le={tabType:{type:String,default:"default"},autoTitleWidth:{type:Boolean,default:!1},titleLength:{type:Number,default:7},position:{type:String,default:"top"},showDropdown:{type:Boolean,default:!0},scrollStep:{type:Number,default:10},autoResize:{type:Boolean,default:!1},selectedTab:{type:String,default:""},width:{type:Number},height:{type:Number},searchBoxVisible:{type:Boolean,default:!0},titleWidth:{type:Number,default:0},customClass:{type:String,default:""},activeId:{type:String},fill:{type:Boolean,default:!1},justifyContent:{type:String,default:"left"}},Ie=re(le,Ee,je,De),be=Object.assign({},le,{componentId:{type:String,default:""}}),$e=re(be,Ee,je,De);function ct(n,t,o){const a=e.ref([]),s=e.ref(n.activeId||""),r=e.ref(!0),c=e.ref([]);e.watch(()=>n.activeId,(u,m)=>{u!==m&&(s.value=u)});function f(u){const m=u.value.findIndex(d=>d.props.show!==!1&&!s.value&&!d.props.disabled);!s.value&&m!==-1&&(s.value=u.value[m].props.id)}function h(u){var d;if(n.autoTitleWidth)return;const m=(d=u.value)==null?void 0:d.querySelectorAll(".st-tab-text");if(m)for(let T=0;T<m.length;T++){const V=m[T].parentNode;m[T].scrollWidth>V.offsetWidth?m[T].classList.contains("farris-title-text-custom")||m[T].classList.add("farris-title-text-custom"):m[T].classList.remove("farris-title-text-custom")}}const l=u=>{u.preventDefault(),u.stopPropagation()};function b(u,m,d=!1){const T=a.value.findIndex(V=>V.props.id===m);a.value=a.value.filter(V=>V.props.id!==m),s.value===m&&(s.value="",f(a)),l(u),e.nextTick(()=>{h(o),d&&(r.value=!0),t.emit("tabRemove",{removeIndex:T,removeId:m,activeId:s.value})})}function w(u){const m=s.value;s.value=u;const d=a.value.find(T=>T.props.id===u);c.value=[],d&&d.props.toolbar&&d.props.toolbar.contents&&d.props.toolbar.contents.length&&(c.value=[...d.props.toolbar.contents]),t.emit("update:activeId",u),t.emit("tabChange",{prevId:m,nextId:s.value})}function x(u){w(u)}function S(u){a.value.findIndex(d=>d.props.id===u.props.id)===-1&&a.value.push(u)}function y(u){a.value.findIndex(d=>d.props.id===u.props.id)!==-1&&(a.value.forEach(d=>{d.props.id===u.props.id&&(d=u)}),e.nextTick(()=>{h(o)}))}return{activeId:s,addTab:S,changeTitleStyle:h,removeTab:b,selectTab:x,selectTabByTabId:w,tabPages:a,updateTab:y,toolbarItems:c}}function dt(n,t,o,a,s){const{activeId:r,removeTab:c,selectTab:f}=s,h=e.computed(()=>({"st-tab-text":!0,"text-truncate":!0,"farris-title-auto":n.autoTitleWidth})),l=e.computed(()=>({"nav-item":!0,"d-none":t.show!==void 0?!t.show:!1,"f-state-active":t.id===r.value,"f-state-disable":t.disabled})),b=e.computed(()=>({width:`${t.tabWidth}px`})),w=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:t.id===r.value,disabled:t.disabled}));function x(T){return e.createVNode("span",{class:h.value,title:T.title},[T.title])}function S(T){return T.slots.title?T.slots.title:x}const y=S(o),u=e.ref(t.removeable);function m(){return e.createVNode("span",{class:"st-drop-close",onClick:T=>c(T,t.id),style:{opacity:.6}},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function d(T){f(t.id),n.tabType==="one-page"&&a.scrollToByPaggId(t.id)}return e.createVNode("li",{class:l.value,style:b.value},[e.createVNode("a",{class:w.value,onClick:d},[y(t),u.value&&m()])])}function ut(n,t,o,a,s){const{shouldShowNavigationButtons:r}=o,{tabPages:c}=s,f=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":r.value})),h=e.computed(()=>({width:"100%","justify-content":n.justifyContent})),l=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":n.fill||n.tabType==="fill","nav-pills":n.tabType==="pills","flex-row":n.position==="top"||n.position==="bottom","flex-column":n.position==="left"||n.position==="right"}));return()=>e.createVNode("div",{class:f.value,style:h.value},[e.createVNode("ul",{class:l.value,ref:t},[c.value.map(b=>dt(n,b.props,b,a,s))])])}function Ae(n,t,o,a,s){const r=e.ref(),{shouldShowNavigationButtons:c}=o,{activeId:f,tabPages:h,selectTab:l}=s,b=e.ref(f.value),w=e.computed(()=>h.value.map(u=>({name:u.props.title,value:u.props.id,show:u.props.show,disabled:u.props.disabled}))),x=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":c.value})),S=e.computed(()=>({width:"100%",display:"flex","justify-content":n.justifyContent}));e.onMounted(()=>{r.value&&(t.value=r.value.$el)});function y(u){l(u)}return e.watch(()=>f.value,u=>{u!==b.value&&(b.value=u)},{immediate:!0}),()=>e.createVNode("div",{class:x.value,style:S.value},[e.createVNode(tt,{items:w.value,modelValue:b.value,"onUpdate:modelValue":u=>b.value=u,onChange:y,ref:r},null)])}function pt(n,t,o,a){const{activeId:s,removeTab:r,tabPages:c}=a,{selectAndScrollToTab:f}=o,{hideDropDown:h,searchTabText:l}=t,b=e.ref("auto"),w=e.computed(()=>{var T,V;let d=[];return n.searchBoxVisible?d=(T=c.value)==null?void 0:T.filter(I=>I.props.title.includes(l.value)):d=(V=c.value)==null?void 0:V.slice(),d}),x=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":n.searchBoxVisible,show:!h.value}));function S(d){return{"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:d.props.disabled,active:d.props.id===s.value,"d-none":d.props.show!==!0}}function y(d){d.preventDefault(),d.stopPropagation()}const u=()=>({width:b.value});function m(){return e.createVNode("div",{class:x.value},[n.searchBoxVisible&&e.createVNode("div",{onClick:d=>y(d),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{title:"search-box",type:"text",class:"form-control k-textbox","onUpdate:modelValue":d=>l.value=d},null),[[e.vModelText,l.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),w.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items",style:u()},[w.value.map(d=>e.createVNode("li",{class:S(d),onClick:T=>f(T,d.props)},[d.props.removeable&&e.createVNode("span",{class:"float-right st-drop-close",onClick:T=>r(T,d.props.id,!0)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),e.createVNode("a",{class:"dropdown-title",title:d.props.title},[d.props.title])]))]):e.createVNode("div",{class:"dropdown-no-data"},[e.createTextVNode("没有相关数据")])])}return{renderDropdownMenu:m}}function Oe(n,t,o,a){const{hideDropDown:s}=t,{renderDropdownMenu:r}=pt(n,t,o,a),c=e.ref(n.showDropdown);function f(){return c.value&&e.createVNode(e.Fragment,null,[e.createVNode("button",{title:"toggle-button",class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{s.value=!1}},null),r()])}return{renderMorePagesButtton:f}}function Re(n,t,o,a){const s=e.ref(!1),{selectTabByTabId:r,tabPages:c}=a,f=4;function h(){var d;const u=t.value,m=(d=t.value)==null?void 0:d.parentElement;s.value=m&&u&&m.offsetWidth<u.scrollWidth-f}const l=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":!s.value})),b=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":!s.value})),w=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":!s.value}));function x(u,m){if(!t.value)return;const d=t.value.scrollLeft,T=t.value.scrollWidth-t.value.offsetWidth;if(m>0){if(t.value.scrollLeft>=T)return;t.value.scrollLeft=d+n.scrollStep+u}else if(m<0){if(t.value.scrollLeft<=0)return;t.value.scrollLeft=d-n.scrollStep-u}}function S(u){if(!s.value||!t.value)return;const m=n.tabType==="pills"?".f-capsule-item":".nav-item",d=t.value.querySelectorAll(m),{parentElement:T}=t.value,V=d[u];if(V&&T){const I=T.getBoundingClientRect().left,R=T.getBoundingClientRect().right,v=V.getBoundingClientRect().left,N=V.getBoundingClientRect().right;v<I?x(I-v,-1):R<N&&x(N-R,1),n.tabType==="one-page"&&o.scrollTo(u)}}function y(u,m){if(m.disabled)return;r(m.id);const d=c.value.findIndex(T=>T.props.id===m.id);e.nextTick(()=>{S(d)})}return{previousButtonClass:l,nextButtonGroupClass:b,nextButtonClass:w,scrollTab:x,selectAndScrollToTab:y,shouldShowNavigationButtons:s,updateNavigationLayout:h}}function Fe(n,t){const{tabPages:o}=t,a=e.ref(""),s=e.ref(!0),r=e.computed(()=>n.searchBoxVisible),c=e.computed(()=>r.value?o.value.filter(h=>h.props.title.includes(a.value)):o.value.slice());return{searchTabText:a,hideDropDown:s,shouldShowSearchBox:r,tabsInDropdownMenu:c}}function Le(n,t,o){const a=".farris-tab-page",{tabPages:s}=o;function r(f){const h=t.value;if(h){const l=t.value.querySelectorAll(a);if(l.length>0){const b=l[f],{offsetTop:w}=b,x=w-32>0?w-32:0;h.scrollTop=x}}}function c(f){const h=s.value.findIndex(l=>l.props.id===f);h>-1&&r(h)}return{scrollTo:r,scrollToByPaggId:c}}const te=e.defineComponent({name:"FTabs",props:le,emits:["tabChange","tabRemove","update:activeId"],setup(n,t){const o=e.ref(n.tabType),a=e.shallowRef(),s=e.ref(n.customClass),r=e.shallowRef(),c=e.shallowRef(),f=ct(n,t,r),{activeId:h,changeTitleStyle:l,tabPages:b,addTab:w,updateTab:x,selectTabByTabId:S,toolbarItems:y}=f,u=Le(n,c,f),m=Re(n,r,u,f),{previousButtonClass:d,nextButtonClass:T,nextButtonGroupClass:V,scrollTab:I,updateNavigationLayout:R}=m,v=Fe(n,f),{hideDropDown:N}=v,B=ut(n,r,m,u,f),F=B,M=Ae(n,r,m,u,f),g=new Map([["default",B],["one-page",F],["pills",M]]);e.computed(()=>{const q=b.value.find(Q=>Q.props.id===h.value);return q==null?void 0:q.slots});const p=e.computed(()=>{const q=b.value.find(z=>z.props.id===h.value);return(q==null?void 0:q.props.toolbarPosition)==="inHead"}),i=e.computed(()=>n.fill||n.tabType==="fill");e.provide("tabs",{activeId:h,addTab:w,updateTab:x,tabPages:b,tabType:o,shouldFillParentContaner:i});const C=e.computed(()=>n.tabType==="pills"),P=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":p.value,"farris-tabs-inContent":!p.value,"farris-tabs-nav-fill":i.value,"farris-tabs-nav-pills":C.value})),D=e.computed(()=>({width:p.value&&n.titleWidth?`${n.titleWidth}%`:""})),k=e.computed(()=>{const q={"farris-tabs":!0,"f-utils-fill-flex-column":i.value,"flex-column":n.position==="top","flex-column-reverse":n.position==="bottom","flex-row":n.position==="left","flex-row-reverse":n.position==="right","one-page":n.tabType==="one-page"};return s.value&&s.value.split(" ").reduce((Q,z)=>(Q[z]=!0,Q),q),q});e.onMounted(()=>{b.value.length&&(h.value=n.activeId||b.value[0].props.id,S(h.value)),e.nextTick(()=>{R()}),l(r),window.addEventListener("click",q=>{var Q;N.value||(Q=a.value)!=null&&Q.contains(q.target)||(N.value=!0)}),window.addEventListener("resize",()=>{R()})});function j(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:d.value,onClick:()=>{I(0,-1)}},null)}function $(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:T.value,onClick:()=>{I(0,1)}},null)}const{renderMorePagesButtton:A}=Oe(n,v,m,f),H=q=>{t.emit("Click",q)};function X(){return y.value.length?e.createVNode(Ve,{items:y.value,onClick:H},null):null}const Z=g.get(n.tabType)||g.get("default");function ae(){var q,Q,z,_;return e.createVNode("div",{class:P.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(Q=(q=t.slots).headerPrefix)==null?void 0:Q.call(q)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:D.value},[j(),Z&&Z(),e.createVNode("div",{class:V.value},[$(),A()])]),X(),e.createVNode("div",{class:"farris-tabs-header-post"},[(_=(z=t.slots).headerSuffix)==null?void 0:_.call(z)])])}const K=e.computed(()=>({"farris-tabs-content":!0,"f-utils-fill-flex-column":i.value}));function ee(){var q,Q;return e.createVNode("div",{class:K.value,ref:c},[(Q=(q=t.slots).default)==null?void 0:Q.call(q)])}return()=>e.createVNode("div",{class:k.value,ref:a},[ae(),ee()])}}),ft=new Map([["appearance",ge],["toolbar",mt]]);function mt(n,t,o){return t&&t.contents&&t.contents.length&&(t.contents.forEach(a=>{a.title&&(a.text=a.title)}),t.buttons=t.contents,delete t.contents),{toolbar:t}}const ht={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tab-page.schema.json",title:"tab-page",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a tab-page Item",type:"string"},type:{description:"The type string of tab-page Item component",type:"string",default:"tab-page"},contents:{description:"",type:"array",default:[]},title:{description:"",type:"string",default:"标题"},toolbar:{description:"",type:"object"}},required:["id","type","contents"]},yt={title:"tab-page",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"工具栏按钮的标识",title:"标识",type:"string",readonly:!0},title:{description:"工具栏按钮的标识",title:"标题",type:"string"}}},appearance:{description:"",title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},width:{description:"组件的宽度",title:"宽度(px)",type:"number"},height:{description:"组件的高度",title:"高度(px)",type:"number"}}},behavior:{description:"",title:"行为",properties:{removeable:{description:"是否可移除",type:"boolean",title:"是否可移除"},toolbar:{description:"",type:"array",title:"工具栏",visible:"hidden"}}}}},ce={tabWidth:{type:Number,default:-1},id:{type:String,default:""},customTitleClass:{type:String,default:""},titleOverflow:{type:Boolean,default:!1},title:{type:String,default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removeable:{type:Boolean,default:!1},show:{type:Boolean,default:!0},toolbar:{type:Object,default:{}},toolbarPosition:{type:String,default:"inHead"}},ve=nt.createPropsResolver(ce,ht,ft,void 0,yt);function gt(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const de=e.defineComponent({name:"FTabPage",props:ce,emits:[],setup(n,t){const o=e.inject("tabs"),a=e.ref(n.show),s={slots:t.slots,props:n},r=e.ref((o==null?void 0:o.tabType.value)||"default");e.onMounted(()=>{const S=o==null?void 0:o.tabPages.value.findIndex(y=>y.props.id===n.id);!S||S===-1?o==null||o.addTab(s):S>-1&&(a.value=!1,console.warn(`已经存在id为${n.id}的页签啦`))}),e.onUnmounted(()=>{});const c=e.computed(()=>(n==null?void 0:n.id)===(o==null?void 0:o.activeId.value)),f=e.computed(()=>({display:c.value?"":"none"}));e.watch(()=>n,S=>{o==null||o.updateTab({props:S,slots:t.slots})},{immediate:!0,deep:!0});function h(){var y,u;const S=(u=(y=t.slots).default)==null?void 0:u.call(y);return e.createVNode(ot,{"main-title":n.title,class:"farris-tab-page"},gt(S)?S:{default:()=>[S]})}const l=e.computed(()=>{var y;return{"farris-tab-page":!0,"f-utils-fill-flex-column":c.value&&o&&((y=o.shouldFillParentContaner)==null?void 0:y.value)}});function b(){var y,u;const S=(u=(y=t.slots).default)==null?void 0:u.call(y);return e.createVNode("div",{class:l.value,style:f.value},[S])}const x=new Map([["default",b],["one-page",h]]).get(r.value)||b;return()=>a.value?x():null}}),bt={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"}};function Ce(){return new DOMException("The request is not allowed","NotAllowedError")}async function vt(n){if(!navigator.clipboard)throw Ce();return navigator.clipboard.writeText(n)}async function Ct(n){const t=document.createElement("span");t.textContent=n,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const o=window.getSelection(),a=window.document.createRange();o==null||o.removeAllRanges(),a.selectNode(t),o==null||o.addRange(a);let s=!1;try{s=window.document.execCommand("copy")}finally{o==null||o.removeAllRanges(),window.document.body.removeChild(t)}if(!s)throw Ce()}async function wt(n){try{await vt(n)}catch(t){try{await Ct(n)}catch(o){throw o||t||Ce()}}}function Tt(){async function n(t){await wt(t)}return{onCopy:n}}function xt(n,t,o,a){const s=e.ref(14),r=e.ref(140),c=e.ref(""),f=e.ref(a.value.length),h=e.computed(()=>a.value),l=e.computed(()=>({"font-size":`${s.value}px`,height:"100%"}));function b(w){if(w.currentTarget){const x=w.currentTarget.value||"";f.value=x.length}}return()=>e.createVNode(e.Fragment,null,[e.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:l.value,rows:"4",maxlength:r.value,onInput:w=>b(w)},[h.value]),e.createVNode("span",{class:"textarea-wordcount",title:c.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[f.value+" / "+r.value])])}function St(n,t,o,a){const s=xt(n,t,o,a),r=new Map([["text-area",s]]);function c(f){return r.get(f)||null}return{getEditorRender:c}}function Mt(){const n=e.ref(!1),t=e.ref("复制成功");return{feedbackStyle:e.computed(()=>{const a={position:"absolute",left:"50%",top:"50%",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"};return a.opacity=n.value?"0.8":"0",a.display=n.value?"":"none",a}),feedbackMessage:t,toShowFeedback:n}}function Nt(n,t){const o=t.getEditorRender(n.promptEditorType);return()=>o&&o()}function Vt(n){const t=e.ref(3),o=e.ref(480),a=e.computed(()=>!!n.value&&!!n.value.date),s=e.computed(()=>`发生时间 : ${n.value&&n.value.date||""}`),r=e.computed(()=>!!n.value&&!!n.value.detail),c=e.computed(()=>{const m=`${o.value}px`;return{overflow:"hidden","text-overflow":"ellipsis",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":t.value,"max-height":m}}),f=e.computed(()=>n.value&&n.value.detail||""),h=e.computed(()=>!0),l=e.ref(!1),b=e.ref("展开"),w=e.ref("收起"),x=e.computed(()=>{const m={display:"block",color:"#2A87FF"};return m["text-align"]=l.value?"":"right",m});function S(m,d){l.value=!l.value,t.value=l.value?20:3}function y(m){return S()}function u(m){return S()}return()=>e.createVNode("div",{class:"toast-msg-detail"},[a.value&&e.createVNode("div",null,[s.value]),r.value&&e.createVNode("div",{id:"exception_error_msg",ref:"exceptionMessageRef",style:c.value},[e.createTextVNode("详细信息 : "),e.createVNode("span",{innerHTML:f.value},null)]),h.value&&e.createVNode("span",{style:x.value},[l.value&&e.createVNode("span",{onClick:y,style:"cursor: pointer;"},[w.value]),!l.value&&e.createVNode("span",{onClick:u,style:"cursor: pointer;"},[b.value])])])}function Bt(n){return()=>e.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function kt(n,t,o,a){const s=e.ref(n.exceptionInfo),r=e.computed(()=>{const x={"f-icon":!0},S=`f-icon-${t.value}`;return x[S]=!0,x}),c=e.computed(()=>o.value||s.value&&s.value.message),f=e.computed(()=>a.value),h=e.computed(()=>!!a.value),l=e.computed(()=>!!s.value);function b(){return l.value?Vt(s):h.value?Bt(f):()=>null}const w=b();return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"float-left modal-tips-iconwrap"},[e.createVNode("span",{class:r.value},null)]),e.createVNode("div",{class:"modal-tips-content"},[e.createVNode("p",{class:"toast-msg-title",innerHTML:c.value},null),w()])])}function Pt(n,t,o){const{onCopy:a}=t,{toShowFeedback:s}=o,r=e.ref("复制成功"),c=e.ref("复制详细信息"),f=e.ref(n.exceptionInfo||{date:"",message:"",detail:""}),h=e.computed(()=>f.value&&f.value.detail||"");function l(b){a(h.value).catch(w=>{r.value="复制失败"}).finally(()=>{s.value=!0,setTimeout(()=>{s.value=!1},700)})}return()=>e.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[e.createVNode("span",{onClick:l,style:"cursor: pointer;"},[c.value])])}function jt(n,t,o,a){const s=e.ref(n.type),r=e.ref([]),c=e.ref(n.exceptionInfo),f=e.ref(n.okButtonText),h=e.ref(n.cancelButtonText),l=e.ref(!0),b=e.ref(!0),w=e.computed(()=>!!(r.value&&r.value.length)),x=e.computed(()=>c.value&&c.value.date&&c.value.message&&c.value.detail),S=e.computed(()=>!(r.value&&r.value.length)&&(f.value||h.value)),y=e.computed(()=>b.value&&f.value),u=e.computed(()=>l.value&&h.value),m=Pt(n,o,a);function d(V){s.value==="question"&&t.emit("reject"),t.emit("close")}function T(V){s.value==="question"&&t.emit("accept"),t.emit("close")}return()=>e.createVNode("div",{class:"modal-footer"},[x.value&&m(),S.value&&u.value&&e.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:d},[h.value]),S.value&&y.value&&e.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:T},[f.value]),w.value&&r.value.length&&r.value.map(V=>e.createVNode("button",{type:"button",onClick:V.handle,class:V.class},[V.iconClass&&e.createVNode("span",{class:V.iconClass},null),V.text]))])}const ue=e.defineComponent({name:"FMessageBox",props:bt,emits:["accept","reject","close"],setup(n,t){const o=e.ref(n.type),a=e.ref(n.title),s=e.ref(n.detail),r=e.computed(()=>{const m={"modal-tips":!0,"d-flex":!0,"flex-row":!0},d=`messager-type-${o.value}`;return m[d]=!0,m}),c=e.computed(()=>{const m={};return o.value==="prompt"?m.padding="0.5rem 0.5rem 1rem 1.5rem":o.value==="error"&&(m.padding="0.5rem 1.5rem 1rem 1.5rem"),m}),f=Tt(),h=St(n,o,a,s),l=Mt(),{feedbackStyle:b,feedbackMessage:w}=l;function x(){return e.createVNode("div",{style:b.value},[w.value])}function S(){switch(o.value){case"prompt":return Nt(n,h);default:return kt(n,o,a,s)}}const y=S(),u=jt(n,t,f,l);return()=>e.createVNode("div",{class:"farris-messager"},[e.createVNode("section",{class:r.value,style:c.value},[y()]),u(),x()])}}),Dt={class:{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},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:HTMLElement,default:null},reiszeable:{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}};class G{constructor(t,o){this.x=t,this.y=o}static getTransformInfo(t){const a=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(a.length>=6){const s=parseInt(a[4],10),r=parseInt(a[5],10);return{x:s,y:r}}return{x:0,y:0}}static fromEvent(t,o=null){if(this.isMouseEvent(t))return new G(t.clientX,t.clientY);if(o===null||t.changedTouches.length===1)return new G(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let a=0;a<t.changedTouches.length;a++)if(t.changedTouches[a].target===o)return new G(t.changedTouches[a].clientX,t.changedTouches[a].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const o=new G(0,0);if(window){const a=window.getComputedStyle(t);if(a){const s=parseInt(a.getPropertyValue("left"),10),r=parseInt(a.getPropertyValue("top"),10);o.x=isNaN(s)?0:s,o.y=isNaN(r)?0:r}return o}return null}static copy(t){return new G(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class oe{constructor(t,o){this.width=t,this.height=o}static getCurrent(t){const o=new oe(0,0);if(window){const a=window.getComputedStyle(t);return a&&(o.width=parseInt(a.getPropertyValue("width"),10),o.height=parseInt(a.getPropertyValue("height"),10)),o}return null}static copy(t){return new oe(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function Et(n,t){const o=e.ref(),a=e.ref(),s=e.ref(),r=e.ref(),c=e.ref(),f=e.ref(),h=e.ref(),l=e.ref(),b=e.ref(),w=e.ref(),x=e.ref(),S=e.ref(),y=e.ref(n.draggable),u=e.ref(!1);function m(){const k=a.value||document.body,j=window.getComputedStyle(k);if(!j||!o.value)return;const $=G.getTransformInfo(o.value),A={};h.value&&(A.deltaL=o.value.offsetLeft-h.value.x,A.deltaT=o.value.offsetTop-h.value.y);const H=j.getPropertyValue("position");A.width=k.clientWidth,A.height=k.clientHeight,A.pr=parseInt(j.getPropertyValue("padding-right"),10),A.pb=parseInt(j.getPropertyValue("padding-bottom"),10),A.position=j.getPropertyValue("position"),H==="static"&&(k.style.position="relative"),A.translateX=$.x,A.translateY=$.y,w.value=A}function d(k){if(o.value){r.value=oe.getCurrent(o.value),c.value=G.getCurrent(o.value),f.value=r.value?oe.copy(r.value):null,h.value=c.value?G.copy(c.value):null,m();const j=k.target.getAttribute("type")||"";l.value={n:!!j.match(/n/),s:!!j.match(/s/),w:!!j.match(/w/),e:!!j.match(/e/)}}}function T(){var k,j,$,A;if(o.value){const H=o.value;l.value&&((l.value.n||l.value.s)&&((k=f.value)!=null&&k.height)&&(H.style.height=f.value.height+"px"),(l.value.w||l.value.e)&&((j=f.value)!=null&&j.width)&&(H.style.width=f.value.width+"px"),h.value&&(($=h.value)!=null&&$.x&&(H.style.left=h.value.x+"px"),(A=h.value)!=null&&A.y&&(H.style.top=h.value.y+"px")))}}function V(){const k=n.minHeight?n.minHeight:1,j=n.minWidth?n.minWidth:1;f.value&&h.value&&l.value&&r.value&&(f.value.height<k&&(f.value.height=k,l.value.n&&c.value&&(h.value.y=c.value.y+(r.value.height-k))),f.value.width<j&&(f.value.width=j,l.value.w&&c.value&&(h.value.x=c.value.x+(r.value.width-j))),n.maxHeight&&f.value.height>n.maxHeight&&(f.value.height=n.maxHeight,c.value&&l.value.n&&(h.value.y=c.value.y+(r.value.height-n.maxHeight))),n.maxWidth&&f.value.width>n.maxWidth&&(f.value.width=n.maxWidth,l.value.w&&c.value&&(h.value.x=c.value.x+(r.value.width-n.maxWidth))))}function I(){if(a.value){const k=w.value;if(h.value&&f.value&&l.value&&r.value){const j=k.width-k.pr-k.deltaL-k.translateX-h.value.x,$=k.height-k.pb-k.deltaT-k.translateY-h.value.y;l.value.n&&h.value.y+k.translateY<0&&c.value&&(h.value.y=-k.translateY,f.value.height=r.value.height+c.value.y+k.translateY),l.value.w&&h.value.x+k.translateX<0&&c.value&&(h.value.x=-k.translateX,f.value.width=r.value.width+c.value.x+k.translateX),f.value.width>j&&(f.value.width=j),f.value.height>$&&(f.value.height=$)}}}function R(k){if(!s.value||!r.value||!c.value||!l.value)return;k.subtract(s.value);const j=k.x,$=k.y;l.value.n?(h.value.y=c.value.y+$,f.value.height=r.value.height-$):l.value.s&&(f.value.height=r.value.height+$),l.value.e?f.value.width=r.value.width+j:l.value.w&&(f.value.width=r.value.width-j,h.value.x=c.value.x+j),I(),V(),T()}function v(k){if(!b.value)return;const j=G.fromEvent(k);j&&R(j)}function N(){if(o.value){const{width:k,height:j,x:$,y:A}=o.value.getBoundingClientRect(),H=G.getTransformInfo(o.value);return{size:{width:k,height:j},position:{x:$-H.x,y:A-H.y}}}return null}function B(k){if(o.value){const j=N();x.value=j}s.value=void 0,r.value=null,c.value=null,f.value=null,h.value=null,l.value=null,b.value=null,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",B)}function F(){document.addEventListener("mousemove",v),document.addEventListener("mouseup",B)}function M(k){k instanceof MouseEvent&&k.button===2||y.value&&(k.stopPropagation(),k.preventDefault(),s.value=G.fromEvent(k),b.value=k.target,d(k),F())}function g(k){return o.value=k,e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"ng-resizable-handle ng-resizable-n",type:"n",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-e",type:"e",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-s",type:"s",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-w",type:"w",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-ne",type:"ne",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-se ng-resizable-diagonal",type:"se",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-sw",type:"sw",onMousedown:j=>M(j)},null),e.createVNode("div",{class:"ng-resizable-handle ng-resizable-nw",type:"nw",onMousedown:j=>M(j)},null)])}function p(k=!0){const j=a.value||document.body,$=oe.getCurrent(j),A=o.value;k&&(S.value=N(),S.value.transform=A.style.transform),$&&A&&(f.value=$,A.style.height=f.value.height-14+"px",A.style.width=f.value.width-14+"px",A.style.left="7px",A.style.top="7px",A.style.transform="",x.value={size:f.value,position:{x:0,y:0}},y.value=!1,u.value=!0)}function i(){var k,j;if(S.value){const $={width:S.value.size.width||0,height:S.value.size.height||0},A={x:(window.innerWidth-$.width)/2,y:(window.innerHeight-$.height)/2};(k=f.value)==null||k.set($),(j=h.value)==null||j.set(A);const H=o.value;H.style.height=$.height+"px",H.style.width=$.width+"px",H.style.left=`${A.x}px`,H.style.top=`${A.y}px`,H.style.transform="",x.value={size:$,position:A},y.value=n.draggable,u.value=!1}}function C(){if(o.value){const k=oe.getCurrent(o.value);if(k){const{width:j,height:$}=k;o.value.style.left=`${(window.innerWidth-j)/2}px`,o.value.style.top=`${(window.innerHeight-$)/2}px`,o.value.style.transform=""}}}function P(){const k=()=>{u.value?p(!1):C()};return window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k)}}const D=P();return{renderResizeBar:g,boundingElement:a,resizedEventParam:x,maximize:p,restore:i,allowDrag:y,isMaximized:u,unWindowResizeHandle:D}}function It(n,t){const o=e.ref(),a=e.ref(n.draggable),s=e.ref(n.lockAxis),r=e.ref(),c=e.ref(),f=e.ref(!1),h=e.ref(new G(0,0)),l=e.ref(new G(0,0)),b=e.ref(new G(0,0)),w=e.ref(new G(0,0));function x(v,N){if(N.tagName==="BUTTON")return!1;if(N===v)return!0;for(const B in N.children)if(N.children.hasOwnProperty(B)&&x(v,N.children[B]))return!0;return!1}function S(){var F,M;let v=b.value.x+l.value.x,N=b.value.y+l.value.y;s.value==="x"?(v=((F=h.value)==null?void 0:F.x)||0,b.value.x=0):s.value==="y"&&(N=((M=h.value)==null?void 0:M.y)||0,b.value.y=0);const B=`translate3d(${Math.round(v)}px, ${Math.round(N)}px, 0px)`;o.value&&(o.value.style.transform=B),w.value.x=v,w.value.y=N}function y(){if(!c.value||!o.value)return null;const v=c.value.getBoundingClientRect(),N=o.value.getBoundingClientRect(),B={top:v.top<N.top,right:v.right>N.right,bottom:v.bottom>N.bottom,left:v.left<N.left};return B.top||(b.value.y-=N.top-v.top),B.bottom||(b.value.y-=N.bottom-v.bottom),B.right||(b.value.x-=N.right-v.right),B.left||(b.value.x-=N.left-v.left),S(),B}function u(v){v&&(h.value&&v.subtract(h.value),b.value.set(v),S(),y())}function m(v){f.value&&a.value&&(v.stopPropagation(),v.preventDefault(),u(G.fromEvent(v,r.value)))}function d(){var v;f.value&&(f.value=!1,l.value.add(b.value),b.value.reset(),(v=o.value)==null||v.classList.remove("ng-dragging"),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d))}function T(){!f.value&&r.value&&(f.value=!0,r.value.classList.add("ng-dragging"),document.addEventListener("mousemove",m),document.addEventListener("mouseup",d))}function V(){if(o.value){const v=G.getTransformInfo(o.value);l.value.set(v);return}l.value.reset()}function I(v){if(v instanceof MouseEvent&&v.button===2)return;const N=v.target||v.srcElement;r.value!==void 0&&N&&!x(N,r.value)||a.value!==!1&&(v.stopPropagation(),v.preventDefault(),h.value=G.fromEvent(v,o.value),V(),T())}function R(v,N,B){if(v&&a.value&&N){if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)r.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const F=N.querySelector(n.dragHandle);F&&(r.value=F)}}else r.value=v;o.value=N,c.value=B,r.value.classList.add("ng-draggable"),r.value.addEventListener("mousedown",I)}}return{registerDraggle:R,resetTranslate:V}}function $t(n,t){const o=e.ref(n.enableEsc);function a(s){s.key==="Escape"&&n.enableEsc&&t.emit("esc",{event:s,type:"esc"})}o.value&&document.addEventListener("keydown",a)}const He=e.defineComponent({name:"FModal",props:Dt,emits:["update:modelValue","accept","cancel","closed","resize","esc"],setup(n,t){const o=e.ref(n.width||300),a=e.ref(n.height||200),s=e.ref(n.modelValue),r=e.ref(""),c=e.ref(n.class),f=e.ref(n.fitContent),h=e.ref(n.showHeader),l=e.ref(""),b=e.ref(n.showCloseButton),w=e.ref(n.showMaxButton),x=e.ref(!1),S=e.ref(""),y=e.ref(""),u=e.ref(""),m=e.ref(n.showButtons),d=e.ref(n.title),T=e.ref(n.reiszeable),V=e.ref(n.containment||null),I=e.ref();function R(E,U){s.value=!1,t.emit("update:modelValue",!1),U!=null&&t.emit(U?"accept":"cancel"),t.emit("closed",E)}const v=[{name:"cancel",text:"取消",class:"btn btn-light",handle:E=>{R(E,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:E=>{R(E,!0)}}],N=e.ref(n.buttons&&n.buttons.length?n.buttons:v),B=e.computed(()=>!!l.value),F=e.computed(()=>!!m.value&&!!N.value),M=e.ref(),g=e.ref(),p=e.ref(!1),{renderResizeBar:i,maximize:C,restore:P,boundingElement:D,resizedEventParam:k,allowDrag:j,unWindowResizeHandle:$}=Et(n),{registerDraggle:A}=It(n);e.watch(()=>n.title,(E,U)=>{E!==U&&(d.value=E)}),e.watch(()=>n.modelValue,(E,U)=>{E!==U&&(s.value=E)}),e.watch(()=>n.showHeader,(E,U)=>{E!==U&&(h.value=E)}),e.watch(()=>n.showButtons,(E,U)=>{E!==U&&(m.value=E)}),e.watch(()=>k.value,(E,U)=>{const ie=E||{},me=U||{};JSON.stringify(ie)!==JSON.stringify(me)&&t.emit("resize",{newSize:E,oldSize:U})});function H(){const E=document.querySelectorAll(".farris-modal").length;(!E||E-1<=0)&&document.body.classList.remove("modal-open"),I.value&&I.value.classList.remove("show")}const X=e.computed(()=>(s.value?document.body.classList.add("modal-open"):H(),s.value)),Z=e.computed(()=>{const E={modal:!0,"farris-modal":!0,fade:!0};return E["f-modal-fitContent"]=!!f.value,E.show=!!X.value,E}),ae=e.computed(()=>{var ie;const E={"modal-dialog":!0},U=(ie=c.value)==null?void 0:ie.split(" ");return U==null||U.reduce((me,jn)=>(me[jn]=!0,me),E),E}),K=e.computed(()=>({position:"absolute",top:`${(window.innerHeight-a.value)/2}px`,left:`${(window.innerWidth-o.value)/2}px`,width:`${o.value}px`,height:f.value?"auto":`${a.value}px`})),ee=e.computed(()=>({"modal-content":!0,"modal-content-has-header":h.value})),q=e.computed(()=>{const E={display:h.value?"":"none"};return E["pointer-events"]=j.value?"auto":"none",E}),Q=e.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:p.value})),z=e.computed(()=>({"modal-body":!0,"f-utils-flex-column":S.value==="iframe"}));function _(){return{}}const ne=e.computed(()=>{const E={textAlgin:u.value},U=_();return Object.assign(E,U)});function fe(E){if(E.stopPropagation(),p.value){p.value=!1,P();return}C(),p.value=!0}async function Vn(E,U){E.handle&&await E.handle(U,E)&&t.emit("closed",U)}function Bn(E){E.width&&(o.value=E.width),E.height&&(a.value=E.height),E.buttons&&(N.value=E.buttons),E.title&&(d.value=E.title)}e.onMounted(()=>{g.value&&!V.value&&(V.value=g.value.parentElement,D.value=V.value,A(M.value,g.value,D.value)),X.value&&document.body.classList.add("modal-open"),$t(n,t)}),e.onUnmounted(()=>{H(),$&&$()}),t.expose({modalElementRef:g,updateModalOptions:Bn,close:R});function kn(){return e.createVNode("ul",null,[x.value&&e.createVNode("li",{class:"f-btn-icon f-bare"},[e.createVNode("span",{class:"f-icon modal_minimize"},null)]),w.value&&e.createVNode("li",{onClick:fe,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[e.createVNode("span",{class:Q.value},null)]),b.value&&e.createVNode("li",{class:"f-btn-icon f-bare",onClick:E=>R(E,!1),style:"pointer-events: auto;"},[e.createVNode("span",{class:"f-icon modal_close"},null)])])}function Pn(){return e.createVNode("div",{class:"modal-footer",style:ne.value},[N.value&&N.value.map(E=>e.createVNode("button",{name:E.name,type:"button",class:E.class+(E.iconClass?" btn-icontext":""),onClick:U=>{Vn(E,U)}},[!!E.iconClass&&e.createVNode("i",{class:E.iconClass},null),E.text]))])}return()=>e.createVNode(e.Teleport,{to:"body"},{default:()=>{var E,U;return[X.value&&e.createVNode("div",{class:Z.value,style:"display: block",ref:I},[e.createVNode("div",{id:r.value,class:ae.value,style:K.value,ref:g},[e.createVNode("div",{class:ee.value},[e.createVNode("div",{ref:M,class:"modal-header",style:q.value},[e.createVNode("div",{class:"modal-title"},[B.value&&e.createVNode("span",{class:l.value,style:"margin-right: 8px"},null),e.createVNode("span",{class:"modal-title-label"},[d.value])]),e.createVNode("div",{class:"actions"},[kn()])]),e.createVNode("div",{class:z.value},[(U=(E=t.slots).default)==null?void 0:U.call(E),S.value==="iframe"&&e.createVNode("iframe",{title:r.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:y.value},null)]),F.value&&Pn()]),!f.value&&T.value&&g.value&&i(g.value)])])]}})}});function ze(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function At(n){const t=document.createElement("div");t.style.display="contents";const o=e.createApp({setup(a,s){e.onUnmounted(()=>{document.body.removeChild(t)});const r=e.ref(),c=e.ref(n.class||""),f=e.ref(!!n.showButtons),h=e.ref(!!n.showHeader),l=e.ref(n.showCloseButton==null?!0:n.showCloseButton),b=e.ref(!0),w=e.ref(n.title||""),x=n.acceptCallback||(()=>{}),S=n.rejectCallback||(()=>{}),y=n.closedCallback||(T=>{}),u=n.resizeHandle||(T=>{}),m=ze(n),d=T=>{b.value=!1,o.unmount(),y(T)};return e.onMounted(()=>{}),s.expose({modalRef:r}),()=>e.createVNode(He,{ref:r,class:c.value,modelValue:b.value,"onUpdate:modelValue":T=>b.value=T,title:w.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":h.value,"show-buttons":f.value,"show-close-button":l.value,"show-max-button":!1,onAccept:x,onCancel:S,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:d,onResize:u},{default:()=>[m&&m(o)]})}});return document.body.appendChild(t),o.mount(t),o}class Ot{constructor(t){L(this,"appContext",null);L(this,"modalRef",e.ref());L(this,"activeModalIndex",e.ref(0));L(this,"modalRefs",{});L(this,"isUseEscCloseModal",e.ref(!1));L(this,"activeModalInstance",e.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.value}static show(t){const o=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return At(o)}open(t){const o=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const a=e.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},t)),s=e.ref(!0),r=a.value.acceptCallback||(()=>{}),c=a.value.rejectCallback||(()=>{}),f=a.value.closedCallback||((d,T)=>{}),h=a.value.resizeHandle||(d=>{});let l;const b=ze(a.value),w=d=>{var V;s.value=!1;const T=(V=d==null?void 0:d.target)==null?void 0:V.classList.contains("modal_close");f(d,this.isUseEscCloseModal.value?"esc":T?"icon":"button")},x=d=>{w(d),l&&e.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],e.render(null,o),l=null,this.modalRef.value=null,this.modalRefs){const T=Object.keys(this.modalRefs);T.length>0?this.activeModalIndex.value=Math.max(...T):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},S=d=>{var T;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((T=this.activeModalInstance.value)==null||T.close(d==null?void 0:d.event))},y=()=>e.createVNode(He,e.mergeProps({ref:this.modalRef,modelValue:s.value,"onUpdate:modelValue":d=>s.value=d},a.value,{onAccept:r,onCancel:c,onClosed:x,onResize:h,onEsc:S}),{default:()=>[b&&b()]});return l=(d=>{const T=e.h(y,d);return T.appContext=this.appContext,e.render(T,o),T})({...a.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:d=>{a.value={...a.value,...d},l&&e.render(e.cloneVNode(l,{...a}),o)},destroy:x,modalRef:this.activeModalInstance}}}class J{static show(t){let o=new Ot;const a=e.reactive({...t}),s=!1,r=a.type==="error"||a.type==="prompt",c=a.type==="error"?"错误提示":a.type==="prompt"&&a.title||"",f=a.acceptCallback||(()=>{}),h=a.rejectCallback||(()=>{});let l=null;const b=()=>{l&&(l==null||l.destroy(),o=null)};l=o==null?void 0:o.open({class:"modal-message modal-message-type-info",title:c,showButtons:s,showHeader:r,width:a.width||400,fitContent:!0,showMaxButton:!1,render:()=>e.createVNode(ue,e.mergeProps(a,{onAccept:f,onReject:h,onClose:b}),null)})}static info(t,o){const a=e.reactive({type:"info",title:t,detail:o,okButtonText:"知道了",cancelButtonText:""});J.show(a)}static warning(t,o){const a=e.reactive({type:"warning",title:t,detail:o,okButtonText:"知道了",cancelButtonText:""});J.show(a)}static success(t,o){const a=e.reactive({type:"success",title:t,detail:o,okButtonText:"关闭",cancelButtonText:""});J.show(a)}static error(t,o,a){const s=e.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:a,message:t,detail:o}});J.show(s)}static prompt(t,o){const a=e.reactive({type:"prompt",title:t,detail:o,okButtonText:"确定",cancelButtonText:"取消"});J.show(a)}static question(t,o,a,s){const r=e.reactive({type:"question",title:t,detail:o,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:a,rejectCallback:s});J.show(r)}}ue.install=n=>{n.component(ue.name,ue),n.provide("FMessageBoxService",J)};function Rt(n,t,o,a,s){const{activeId:r,removeTab:c,selectTab:f,removeDesignTab:h,selectDesignTab:l}=s,b=e.computed(()=>({"st-tab-text":!0,"farris-title-auto":n.autoTitleWidth})),w=e.computed(()=>{const B={"farris-component":!0,"nav-item":!0,"d-none":t.show!==void 0?!t.show:!1,"f-state-active":t.id===r.value,"f-state-disable":t.disabled};return B[`${t.id}-design-item`]=!0,B}),x=e.computed(()=>({width:`${t.tabWidth}px`})),S=e.computed(()=>({"nav-link":!0,"tabs-text-truncate":!0,active:t.id===r.value,disabled:t.disabled}));function y(B){return e.createVNode("span",{class:b.value,title:B.title},[B.title])}function u(B){return B.slots.title?B.slots.title:y}const m=u(o),d=e.ref(t.removeable);function T(){return e.createVNode("span",{class:"st-drop-close",onClick:B=>c(B,t.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])}function V(B){f(t.id),n.tabType==="one-page"&&a.scrollToByPaggId(t.id)}function I(B){l(B,t.id)}function R(B){J.question(`确定删除标签页【${o.props.title}】?`,"",()=>h(B,t.id),()=>{})}function v(){return e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:B=>R(B)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function N(){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[v()])])}return e.createVNode("li",{onClick:B=>I(B),class:w.value,style:x.value,id:`${t.id}-design-item`},[N(),e.createVNode("a",{class:S.value,onClick:V},[m(t),d.value&&T()])])}function Ft(n,t,o,a,s,r,c){const{shouldShowNavigationButtons:f}=o,{tabPages:h}=s,l=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":f.value})),b=e.computed(()=>({width:"100%","justify-content":n.justifyContent})),w=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":n.fill||n.tabType==="fill","nav-pills":n.tabType==="pills","flex-row":n.position==="top"||n.position==="bottom","flex-column":n.position==="left"||n.position==="right"})),x=e.computed(()=>({overflow:"auto"}));function S(u){const{componentType:m}=u;let d=Y(m,u);c&&c.onResolveNewComponentSchema&&(d=c.onResolveNewComponentSchema(u,d));const T=m.toLowerCase().replace("-","_");return d&&!d.id&&d.type===m&&(d.id=`${T}_${Math.random().toString().slice(2,6)}`),d}const y=function(u){var V;const m={componentType:"tab-page",label:"Tab1",parentComponentInstance:r.value,targetPosition:-1},d=S(m);(V=r.value.schema.contents)==null||V.push(d);const{selectTabByTabId:T}=s;T(d.id)};return()=>e.createVNode("div",{class:l.value,style:b.value},[e.createVNode("ul",{class:w.value,style:x.value,ref:t},[h.value.map(u=>Rt(n,u.props,u,a,s)),e.createVNode("li",{class:"nav-item"},[e.createVNode("a",{class:"nav-link tabs-text-truncate",title:"添加页签",onClick:u=>y()},[e.createVNode("i",{class:"f-icon f-icon-plus",style:"font-size: 20px;margin: 0 auto;line-height: 24px;"},null)])])])])}function We(n,t,o){var R;function a(){o!=null&&o.resolveComponentContext&&o.resolveComponentContext()}a();const s=o&&o.getStyles&&o.getStyles()||"",r=o&&o.getDesignerClass&&o.getDesignerClass()||"",c=e.ref();function f(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanMoveComponent?o.checkCanMoveComponent():!0}function h(){return!1}function l(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:o&&o.checkCanDeleteComponent?o.checkCanDeleteComponent():!0}function b(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:o&&o.hideNestedPaddingInDesginerView?o.hideNestedPaddingInDesginerView():!1}function w(v){if(!v||!v.value)return null;if(v.value.schema&&v.value.schema.type==="component")return v.value;const N=e.ref(v==null?void 0:v.value.parent),B=w(N);return B||null}function x(v=t){const{componentInstance:N,designerItemElementRef:B}=v;return!N||!N.value?null:N.value.canMove?B:x(v.parent)}function S(v){return!!o&&o.canAccepts(v)}function y(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function u(){}function m(v,N){N&&o!=null&&o.onAcceptMovedChildElement&&o.onAcceptMovedChildElement(N)}function d(v){const{componentType:N}=v;let B=Y(N,v);o&&o.onResolveNewComponentSchema&&(B=o.onResolveNewComponentSchema(v,B));const F=N.toLowerCase().replace("-","_");return B&&!B.id&&B.type===N&&(B.id=`${F}_${Math.random().toString().slice(2,6)}`),B}function T(v,N){const B=String(v.getAttribute("data-controltype")),F=v.getAttribute("data-feature"),M=F?JSON.parse(F):{};M.parentComponentInstance=c.value;let g=Y(B,M);o&&o.onAcceptNewChildElement&&(g=o.onAcceptNewChildElement(v,N,g));const p=B.toLowerCase().replace("-","_");return g&&!g.id&&g.type===B&&(g.id=`${p}_${Math.random().toString().slice(2,6)}`),g}function V(v){}function I(...v){if(o&&o.getPropsConfig)return o.getPropsConfig(...v)}return c.value={canMove:f(),canSelectParent:h(),canDelete:l(),canNested:!b(),contents:t==null?void 0:t.schema.contents,elementRef:n,parent:(R=t==null?void 0:t.parent)==null?void 0:R.componentInstance,schema:t==null?void 0:t.schema,styles:s,designerClass:r,canAccepts:S,getBelongedComponentInstance:w,getDraggableDesignItemElement:x,getDraggingDisplayText:y,getPropConfig:I,getDragScopeElement:u,onAcceptMovedChildElement:m,onAcceptNewChildElement:T,onChildElementMovedOut:V,addNewChildComponentSchema:d,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:!!o&&o.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!o&&o.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1)},c}const Lt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}},required:[]},we=new Map;function Te(){function n(y,u,m,d){var T;if(typeof m=="number")return((T=d[y])==null?void 0:T.length)===m;if(typeof m=="object"){const V=Object.keys(m)[0],I=m[V];if(V==="not")return Number(d[y].length)!==Number(I);if(V==="moreThan")return Number(d[y].length)>=Number(I);if(V==="lessThan")return Number(d[y].length)<=Number(I)}return!1}function t(y,u,m,d){return typeof m=="boolean"?d.childrenClassList.includes(u)===!!m:!1}function o(y,u,m,d){return typeof m=="boolean"?d.parentClassList.includes(u)===!!m:!1}function a(y,u,m,d){return typeof m=="boolean"?d.parentClassList.includes(u)===!!m:!1}const s=new Map([["length",n],["hasChildren",t],["hasSibling",a],["hasParent",o]]);function r(y,u){const m=y;return typeof u=="number"?[{target:m,operator:"length",param:null,value:Number(u)}]:typeof u=="object"?Object.keys(u).map(d=>{if(d==="length")return{target:m,operator:"length",param:null,value:u[d]};const T=d,V=u[d];return{target:m,operator:y==="children"?"hasChildren":y==="parent"?"hasParent":"hasSibling",param:T,value:V}}):[]}function c(y,u){if(s.has(y.operator)){const m=s.get(y.operator);return m&&m(y.target,y.param,y.value,u)||!1}return!1}function f(y,u){return Object.keys(y).reduce((V,I)=>{const R=r(I,y[I]);return V.push(...R),V},[]).reduce((V,I)=>V&&c(I,u),!0)}function h(y,u){const m=Object.keys(y),d=m.includes("allOf"),T=m.includes("anyOf"),V=d||T,v=(V?y[V?d?"allOf":"anyOf":"allOf"]:[y]).map(B=>f(B,u));return d?!v.includes(!1):v.includes(!0)}function l(y,u){const m=y.const;return m?typeof m=="boolean"?m:typeof m=="object"?h(m,u):!1:!1}function b(y){return u=>{const m={canAccept:!0,fixed:!1,hidePadding:!1};return y&&y.properties&&Object.keys(y.properties).reduce((d,T)=>{const V=y.properties[T];return d[T]=l(V,u),d},m),m}}function w(y,u,m){if(u.type==="object"&&u.properties){const{rules:d,contents:T}=u.properties;m.set(y,b(d)),T&&Object.keys(T.properties).forEach(V=>w(V,T.properties[V],m))}}function x(){const{properties:y}=Lt;Object.keys(y).forEach(u=>{w(u,y[u],we)})}function S(y,u){const m={canAccept:!0,fixed:!1,hidePadding:!0};return we.has(y)?we.get(y)(u):m}return x(),{getRuleValue:S}}const Ht={title:"tabs",description:"A Farris Container Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"Splitter",enum:[]}},title:{title:"标题",type:"string",description:"标题"}}},appearance:{description:"",title:"外观",properties:{width:{description:"组件的宽度",title:"宽度(px)",type:"number",min:0,decimals:0},height:{description:"组件的高度",title:"高度(px)",type:"number",min:0,decimals:0},titleWidth:{description:"标题区域宽度占页面比",type:"number",title:"标题区域宽度(%)",min:0,decimals:0,max:100},autoTitleWidth:{description:"开启,则显示全部字符;关闭,最多显示7个字符",type:"boolean",title:"标题自适应宽度",defaultValue:!1},fill:{description:"flex布局下,填充满剩余部分",type:"boolean",title:"填充"}}}}};function zt(n,t){const o=Te();let a=!1,s,r=!1;function c(x){return!1}function f(){return!r}function h(){return!r}function l(){return a}function b(){const x=n,S=x.appearance&&x.appearance.class||"",y=S?S.split(" "):[],u=t==null?void 0:t.schema,m=u&&u.appearance&&u.appearance.class||"",d=m?m.split(" "):[],T=x.contents||[],V=T.length?T[0]:null,I=V&&V.appearance&&V.appearance.class||"",R=I?I.split(" "):[],v=T.length?T.reduce((p,i)=>{const C=i&&i.appearance?i.appearance.class:"",P=C?C.split(" "):[];return p.push(...P),p},[]):[],N=(t==null?void 0:t.parent)&&t.parent.schema,B=N&&N.appearance&&N.appearance.class||"";B&&B.split(" "),s={componentClass:S,componentClassList:y,childContents:T,firstChildContent:V,firstChildClass:I,firstChildClassList:R,parent,parentClass:m,parentClassList:d,children:T,childrenClassList:v};const{canAccept:F,fixed:M,hidePadding:g}=o.getRuleValue(y[0],s);return a=g,r=M,!0}function w(x){return Ht}return{canAccepts:c,checkCanDeleteComponent:f,checkCanMoveComponent:h,getPropsConfig:w,hideNestedPaddingInDesginerView:l,resolveComponentContext:b}}function Wt(n,t,o,a){const s=e.ref([]),r=e.ref(n.activeId||""),c=e.ref(!0),f=e.ref(),h=e.ref([]);function l(i){const C=i.value.findIndex(P=>P.props.show!==!1&&!r.value&&!P.props.disabled);!r.value&&C!==-1&&(r.value=i.value[C].props.id)}function b(i,C){i.classList.contains(C)||i.classList.add(C)}function w(i,C){i.classList.remove(C)}function x(i){const{parentElement:C}=i;C&&(i.scrollWidth>C.offsetWidth?b(i,"farris-title-text-custom"):w(i,"farris-title-text-custom"))}function S(i){var P;if(n.autoTitleWidth)return;const C=(P=i.value)==null?void 0:P.querySelectorAll(".st-tab-text");C&&C.forEach(D=>x(D))}const y=i=>{i.preventDefault(),i.stopPropagation()};function u(i){s.value=s.value.filter(C=>C.props.id!==i),r.value===i&&(r.value="",l(s))}function m(i,C,P=!1){const D=s.value.findIndex(k=>k.props.id===C);u(C),y(i),e.nextTick(()=>{S(o),P&&(c.value=!0),t.emit("tabRemove",{removeIndex:D,removeId:C,activeId:r.value})})}function d(){const i=s.value.find(D=>D.props.id===r.value);if(h.value=[],i&&i.props.toolbar){const D=i.props.toolbar.hasOwnProperty("contents")?"contents":"buttons";i.props.toolbar[D]&&i.props.toolbar[D].length&&(h.value=[...i.props.toolbar[D]])}const C=a.schema.contents,P=C==null?void 0:C.find(D=>D.id===r.value);f.value=P==null?void 0:P.toolbar}function T(i){const C=r.value;r.value=i,d(),t.emit("tabChange",{prevId:C,nextId:r.value})}function V(i){T(i)}function I(i){s.value.findIndex(P=>P.props.id===i.props.id)===-1&&s.value.push(i)}function R(i){s.value.findIndex(P=>P.props.id===i.props.id)!==-1&&(s.value.forEach(P=>{P.props.id===i.props.id&&(P=i)}),e.nextTick(()=>{S(o)}))}function v(i){i&&(i.stopPropagation(),i.preventDefault())}function N(i,C){v(i);const P=a.schema.contents,D=P==null?void 0:P.findIndex(k=>k.id===C);D===-1||D===void 0||(P==null||P.splice(D,1),u(C))}function B(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(C=>C.classList.remove("dgComponentFocused"));const i=document.getElementsByClassName("dgComponentSelected");Array.from(i).forEach(C=>C.classList.remove("dgComponentSelected"))}function F(i){i.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function M(i){var k;const{contents:C=[]}=a.schema,P=C==null?void 0:C.findIndex(j=>j.id===i),D=C[P];(k=a==null?void 0:a.setupContext)==null||k.emit("selectionChange",D.type,D)}function g(i,C){B(),v(i),F(i),M(C)}function p(i,C){B(),v(i),F(i)}return{activeId:r,addTab:I,changeTitleStyle:S,removeTab:m,selectTab:V,selectTabByTabId:T,tabPages:s,updateTab:R,toolbarItems:h,removeDesignTab:N,selectDesignTab:g,selectDesignTabToolbar:p,toolbarSchema:f}}const qe=new Map([["buttons","items"]]);function Ue(n,t,o){return t}const qt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-toolbar.schema.json",title:"response-toolbar",description:"A Farris Toolbar Component",type:"object",properties:{id:{description:"The unique identifier for a Response Toolbar",type:"string"},type:{description:"The type string of Response Toolbar",type:"string",default:"response-toolbar"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},alignment:{description:"The alignment of Response Toolbar Button.",type:"string",default:"right"},buttons:{description:"The items of Response Toolbar.",type:"array",default:[]}},required:["id","type","buttons"]},xe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-toolbar-item.schema.json",title:"response-toolbar-item",description:"A Farris Toolbar Item Component",type:"object",properties:{id:{description:"The unique identifier for a Response Toolbar",type:"string"},type:{description:"The type string of Response Toolbar",type:"string",default:"response-toolbar-item"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},text:{description:"The items of Response Toolbar.",type:"string",default:"新增"},icon:{description:"The icon of response toolbar item.",type:"string",default:""},click:{description:"The event of response toolbar item.",type:"string",default:""}},required:["id","type","text"]},_e={title:"response-toolbar-item",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",data:[]}},text:{title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},icon:{title:"图标",type:"string",description:""}}}}},Ge={customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]}};he[xe.title]=xe,Pe[_e.title]=_e;const Ut=Object.assign({},Ge,{componentId:{type:String,default:""}});re(Ge,qt,qe,Ue);const Qe={id:{type:String,default:""},items:{type:Object,default:{}},text:{type:String,default:""},disabled:{type:Boolean,default:!1},icon:{type:String,default:""},componentId:{type:String,default:""}};re(Qe,xe,qe,Ue);class Xe{constructor(t){L(this,"id","");L(this,"class","btn-secondary");L(this,"icon","");L(this,"groupId","");L(this,"order",-1);L(this,"asDropDownTop",!1);L(this,"text","");L(this,"visible",!0);L(this,"responsed",!1);L(this,"tipsEnable",!1);L(this,"tipsText","");L(this,"width",0);L(this,"onClick",()=>{});L(this,"options");this.options=t;const o=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","onClick"];Object.keys(t).filter(a=>o.indexOf(a)>-1).forEach(a=>{this[a]=t[a]})}get enable(){return Object.keys(this.options).indexOf("enable")>-1?this.options.enable:e.computed(()=>!0)}setWidth(t){this.width=parseInt(t,10)}getWidth(){return this.visible?this.width:!1}}class _t extends Xe{constructor(t){super(t)}}function Gt(){function n(t){const o=[];return t.reduce((a,s)=>(s.children&&s.children.length>0?a.push(new pe(s)):a.push(new _t(s)),a),o),o}return{buildResponseToolbarItems:n}}const{buildResponseToolbarItems:Qt}=Gt();class pe extends Xe{constructor(o){super(o);L(this,"placement","");L(this,"dropdownClass","");L(this,"menuClass","");L(this,"split",!1);L(this,"children",[]);L(this,"expanded",!1);const a=["isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(o).filter(s=>a.indexOf(s)>-1).forEach(s=>{this[s]=o[s]}),o.children&&o.children.length&&(this.children=Qt(o.children))}}function Xt(){function n(o){const a={"f-icon":!0};if(o.icon){const s=o.icon.trim().split(" ");s&&s.length&&s.reduce((r,c)=>(r[c]=!0,r),a)}return a}function t(o){return!!(o.icon&&o.icon.trim())}return{iconClass:n,shouldShowIcon:t}}function Yt(n,t){const o=e.inject("design-item-context"),a=e.inject("toolbar-item-handler",()=>{});function s(){a&&a()}function r(g){const p={"dropdown-menu":!0};if(g.class){const i=g.menuClass.split(" ");i&&i.length&&i.reduce((C,P)=>(C[P]=!0,C),p)}return p}function c(g){const p={disabled:!g.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},i=g.dropdownClass.split(" ");return i&&i.length&&i.reduce((C,P)=>(C[P]=!0,C),p),p}function f(g){const p={disabled:!g.enable,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0},i=g.class.split(" ");return i&&i.length&&i.reduce((C,P)=>(C[P]=!0,C),p),p}let h;const l=new Map;function b(g,p,i){var P;((P=g.target)==null?void 0:P.id)===p.id&&g.stopPropagation();const C=i?i.id:"__top_item__";if(p.children&&p.children.length&&(p.expanded=!p.expanded,p.expanded?l.set(C,p):l.delete(C)),l.has(C)&&l.get(C)!==p){const D=l.get(C);D&&(D.expanded=!1)}}function w(g){g&&(g.stopPropagation(),g.preventDefault())}function x(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(p=>p.classList.remove("dgComponentFocused"));const g=document.getElementsByClassName("dgComponentSelected");Array.from(g).forEach(p=>p.classList.remove("dgComponentSelected"))}function S(g){g.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function y(g){const{buttons:p=[]}=o.schema;let i=[];p.forEach(D=>{i=i.concat(D.children||[])});const C=i.findIndex(D=>D.id===g),P=C===-1?null:i[C];return{index:C,item:P}}function u(g){const{buttons:p=[]}=o.schema,i=p.findIndex(P=>P.id===g),C=i===-1?null:p[i];return{index:i,item:C}}function m(g){var C;o.schema;const{index:p,item:i}=y(g);(C=o==null?void 0:o.setupContext)==null||C.emit("selectionChange",i==null?void 0:i.type,i)}const d=function(g){const{componentType:p}=g,i=Y(p,g),C=p.toLowerCase().replace("-","_");return i&&!i.id&&i.type===p&&(i.id=`${C}_${Math.random().toString().slice(2,6)}`),i},T=function(){const g={componentType:"response-toolbar-item",parentComponentInstance:t.value,targetPosition:-1};return d(g)};function V(g,p){w(g),x(),S(g),m(p.id)}function I(g,p,i){w(g);const C=p.id,P=i&&i.id,{buttons:D=[]}=o.schema;if(!P)return;const{index:k}=u(P);if(k===-1)return;const{index:j}=y(C);j!==-1&&(D[k].children.splice(j,1),s())}function R(g,p,i){w(g);const C=i&&i.id,{buttons:P=[]}=o.schema;if(!C)return;const{index:D}=u(C);if(D===-1)return;const k=T(),j=Object.assign({},k,{text:p.text});P[D].children.push(j),s()}function v(g,p,i){w(g);const C=i&&i.id,{buttons:P=[]}=o.schema;if(!C)return;const{index:D}=u(C);if(D===-1)return;const k=T(),j=Object.assign({},k,{text:"按钮"});P[D].children.push(j),s()}function N(g,p){return e.createVNode("div",{class:"component-btn-group"},[e.createVNode("div",null,[e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:i=>I(i,g,p)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:i=>R(i,g,p)},[e.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增同级",ref:"appendSame",style:"width:85px!important;padding:0 5px;position:static;",onClick:i=>v(i,g,p)},[e.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),e.createVNode("span",{style:"font-size:13px;margin:auto"},[e.createTextVNode("新增同级")])])])])}function B(g){return g.children.map(p=>p.children&&p.children.length?e.createVNode("li",{class:c(p),id:p.id,onClick:i=>p.enable&&b(i,p,g)},[e.createVNode("span",{id:p.id,class:f(p),onMouseover:i=>p.enable&&b(i,p,g)},[p.text,e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),h(p,p)]):e.createVNode("li",{class:f(p),id:p.id,onClick:i=>V(i,p)},[N(p,g),n.shouldShowIcon(p)&&e.createVNode("i",{class:n.iconClass(p)},null),p.text]))}function F(g,p,i){const C={display:g.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},P=document.getElementsByTagName("body")[0].getClientRects()[0].width,D=p,k=D==null?void 0:D.getClientRects();if(D&&k&&k.length){const{top:j,width:$,left:A,right:H,height:X}=k[0],Z=Math.ceil(X+j);C.top=`${Z}px`,C.left=`${A}px`;const ae=g.id+"_menu",K=p?p.querySelector("#"+ae):null;if(K){C.display==="block"&&(K.style.display="block");const ee=K.getBoundingClientRect();if(i){C.top=`${j-6}px`;const q=Math.ceil($+A);C.left=`${q}px`}P-A-$<ee.width&&(C.left=`${(i?A:H)-ee.width}px`)}}return C}h=function(g,p){var D,k;const i=e.getCurrentInstance(),C=p?p.id:g.id,P=(k=(D=i==null?void 0:i.exposed)==null?void 0:D.elementRef.value)==null?void 0:k.querySelector("#"+C);return e.createVNode("ul",{class:r(g),style:F(g,P,p),id:g.id+"_menu"},[B(g)])};function M(){l.forEach(g=>{g.expanded=!1}),l.clear()}return{renderDropdownMenu:h,clearAllDropDownMenu:M}}function Zt(n,t,o){const a=e.ref(n.alignment),{renderDropdownMenu:s,clearAllDropDownMenu:r}=Yt(t,o),c=e.inject("design-item-context"),f=e.inject("toolbar-item-handler",()=>{});function h(){f&&f()}function l(M){const g={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":a.value==="right","f-btn-mr":a.value==="left"},p=M.dropdownClass.split(" ");return p&&p.length&&p.reduce((i,C)=>(i[C]=!0,i),g),g}function b(M){const g={btn:!0,disabled:!M.enable,"position-relative":!0,"farris-component":!0,"f-rt-btn":!0,"btn-icontext":!!(M.icon&&M.icon.trim())};if(M.class){const p=M.class.split(" ");p&&p.length&&p.reduce((i,C)=>(i[C]=!0,i),g)}return g}function w(M){M&&(M.stopPropagation(),M.preventDefault())}function x(M,g){w(M);const p=g.expanded;document.body.click(),g.expanded=!p}const S=function(M){const{componentType:g}=M,p=Y(g,M),i=g.toLowerCase().replace("-","_");return p&&!p.id&&p.type===g&&(p.id=`${i}_${Math.random().toString().slice(2,6)}`),p},y=function(){const M={componentType:"response-toolbar-item",parentComponentInstance:o.value,targetPosition:-1};return S(M)};function u(M){const g=c.schema.buttons||c.schema.contents,p=g==null?void 0:g.findIndex(C=>C.id===M),i=p===-1?null:g[p];return{index:p,toolbarItem:i}}function m(M,g){var k;const{index:p,toolbarItem:i}=u(g);if(p===-1)return;const C=i.text||"按钮",P=y(),D=Object.assign({},P,{text:C});(k=c.schema.buttons)==null||k.push(D),h()}function d(M,g){const{index:p,toolbarItem:i}=u(g);if(p===-1)return;const C=i.text||"按钮",P=y(),D=Object.assign({},P,{text:C}),k=c.schema.buttons[p].children||[];k.push(D),c.schema.buttons[p].children=k,h()}function T(M,g){const p=c.schema.buttons||c.schema.contents,i=p==null?void 0:p.findIndex(C=>C.id===g);i!==-1&&(p.splice(i,1),h())}function V(M){return e.createVNode("div",{class:"component-btn-group"},[e.createVNode("div",null,[e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:g=>T(g,M)},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:g=>m(g,M)},[e.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增子级",ref:"appendChildButton",style:"width:85px!important;padding:0 5px;position:static;",onClick:g=>d(g,M)},[e.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),e.createVNode("span",{style:"font-size:13px;margin:auto"},[e.createTextVNode("新增子级")])])])])}function I(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(g=>g.classList.remove("dgComponentFocused"));const M=document.getElementsByClassName("dgComponentSelected");Array.from(M).forEach(g=>g.classList.remove("dgComponentSelected"))}function R(M){M.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function v(M){var C;const g=c.schema.buttons||c.schema.contents,p=g==null?void 0:g.findIndex(P=>P.id===M);if(p===-1)return;const i=g[p];(C=c==null?void 0:c.setupContext)==null||C.emit("selectionChange","response-toolbar-item",i)}function N(M,g){w(M),I(),R(M),w(M),x(M,g),v(g.id)}function B(M){return e.createVNode("div",{id:M.id,class:l(M)},[e.createVNode("div",{class:b(M),style:"display: flex;padding-right: 0.1rem;",onClick:g=>M.enable&&N(g,M)},[V(M.id),t.shouldShowIcon(M)&&e.createVNode("i",{class:t.iconClass(M)},null),e.createVNode("span",null,[M.text]),e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-down",style:"display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"},null)]),s(M)])}function F(){r()}return{renderToolbarDropdown:B,clearAllDropDown:F}}function Ye(){function n(t){var s,r;if(!t)return!1;const o=((s=t.targetContainer)==null?void 0:s.componentInstance)&&t.targetContainer.componentInstance.value;if(!o)return!1;const a=(r=o.schema.appearance)==null?void 0:r.class;if(t.controlCategory==="input"||t.controlType==="form-group"){const c=o.schema.type,f=(c==="response-form"||c==="content-container")&&a&&a.includes("farris-form");if(o.schema.type!=="response-layout-item"&&!f)return!1}return t.controlType!=="field-set"}return{basalDragulaRuleForContainer:n}}class Ze{static getEditorTypesByMDataType(t){const o=this.fieldControlTypeMapping[t];return o||[{key:"",value:""}]}}L(Ze,"fieldControlTypeMapping",{String:[{key:O["input-group"].type,value:O["input-group"].name},{key:O.lookup.type,value:O.lookup.name},{key:O.Image.type,value:O.Image.name},{key:O["date-picker"].type,value:O["date-picker"].name},{key:O["check-box"].type,value:O["check-box"].name},{key:O["radio-group"].type,value:O["radio-group"].name},{key:O["combo-list"].type,value:O["combo-list"].name},{key:O.textarea.type,value:O.textarea.name}],Text:[{key:O.textarea.type,value:O.textarea.name},{key:O.avatar.type,value:O.avatar.name},{key:O.lookup.type,value:O.lookup.name}],Decimal:[{key:O["number-spinner"].type,value:O["number-spinner"].name}],Integer:[{key:O["number-spinner"].type,value:O["number-spinner"].name}],Number:[{key:O["number-spinner"].type,value:O["number-spinner"].name}],BigNumber:[{key:O["number-spinner"].type,value:O["number-spinner"].name}],Date:[{key:O["date-picker"].type,value:O["date-picker"].name}],DateTime:[{key:O["date-picker"].type,value:O["date-picker"].name}],Boolean:[{key:O.switch.type,value:O.switch.name},{key:O["check-box"].type,value:O["check-box"].name}],Enum:[{key:O["combo-list"].type,value:O["combo-list"].name},{key:O["radio-group"].type,value:O["radio-group"].name}],Object:[{key:O.lookup.type,value:O.lookup.name},{key:O["combo-list"].type,value:O["combo-list"].name},{key:O["radio-group"].type,value:O["radio-group"].name}],EmployeeSelector:[{key:O.EmployeeSelector.type,value:O.EmployeeSelector.name}],AdminOrganizationSelector:[{key:O.AdminOrganizationSelector.type,value:O.AdminOrganizationSelector.name}]});class Se{constructor(t,o){L(this,"componentId");L(this,"viewModelId");L(this,"eventsEditorUtils");L(this,"formSchemaUtils");L(this,"formMetadataConverter");L(this,"designViewModelUtils");L(this,"designViewModelField");L(this,"controlCreatorUtils");L(this,"designerHostService");L(this,"schemaService",null);L(this,"metadataService",null);L(this,"propertyConfig",{type:"object",categories:{}});var a;this.componentId=t,this.designerHostService=o,this.eventsEditorUtils=o.eventsEditorUtils,this.formSchemaUtils=o.formSchemaUtils,this.formMetadataConverter=o.formMetadataConverter,this.viewModelId=((a=this.formSchemaUtils)==null?void 0:a.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=o.designViewModelUtils,this.controlCreatorUtils=o.controlCreatorUtils,this.metadataService=o.metadataService,this.schemaService=o.schemaService}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){const o=t.binding&&t.binding.type==="Form"&&t.binding.field;if(o){if(!this.designViewModelField){const a=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=a.fields.find(s=>s.id===o)}t.updateOn=this.designViewModelField.updateOn}}changeFieldEditorType(t,o){}getBasicPropConfig(t){var a,s;var o=this;return this.setDesignViewModelField(t),{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"string",refreshPanelAfterChanged:!0,$converter:"/converter/change-editor.converter",editor:{type:"combo-list",textField:"value",valueField:"key",data:Ze.getEditorTypesByMDataType(((s=(a=o.designViewModelField)==null?void 0:a.type)==null?void 0:s.name)||""),editable:!1}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"}},setPropertyRelates(r,c){if(r)switch(r&&r.propertyID){case"type":{o.changeControlType(t,r);break}}}}}changeControlType(t,o){var l,b,w,x,S;const a=o.propertyValue,s=this.formSchemaUtils.getComponentById(this.componentId);let r=this.getControlParentContainer(t.id,s);if(!r)return;const c=r.contents.findIndex(y=>y.id===t.id),f=r.contents[c];let h;this.designViewModelField&&(this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,{editor:{$type:a},name:this.designViewModelField.name,require:this.designViewModelField.require,readonly:this.designViewModelField.readonly},!1),h=this.controlCreatorUtils.setFormFieldProperty("Form",this.designViewModelField,null,a)),Object.assign(h,{id:f.id,appearance:f.appearance,size:f.size,label:f.label}),Object.assign(h.editor,{isTextArea:h.isTextArea&&f.isTextArea,type:a||"",placeHolder:(l=f.editor)==null?void 0:l.placeHolder,holdPlace:(b=f.editor)==null?void 0:b.holdPlace,readonly:(w=f.editor)==null?void 0:w.readonly,require:(x=f.editor)==null?void 0:x.require,visible:(S=f.editor)==null?void 0:S.visible}),r.contents.splice(c,1,h)}getAppearanceConfig(t=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!1,editor:{type:"response-layout-editor-setting"},$converter:"/converter/response-form-layout.converter"}}}}getControlParentContainer(t,o){let a;if(!o||!o.contents||o.contents.length===0)return null;for(const s of o.contents){if(s.id===t)return a=o,o;if(a=this.getControlParentContainer(t,s),a)return a}}getBindingFieldEditorOptions(t){const o=this.formSchemaUtils.getFormMetadataBasicInfo();return{type:"field-selector",bindingType:{enable:!1},editorParams:{propertyData:t,formBasicInfo:o},columns:[{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"fieldType",title:"字段类型"}],beforeOpenDialog:a=>{const s=this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);a.instance.loadData(s)},textField:"bindingField"}}}class Jt extends Se{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getBehaviorProperties(t),this.propertyConfig}getBasicPropConfig(t){this.propertyConfig.categories.basic={description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",textField:"value",valueField:"key",data:[{key:"response-toolbar",value:O["response-toolbar"].name}]}}}}}getBehaviorProperties(t){this.propertyConfig.categories.behavior={title:"行为",description:"",properties:{alignment:{title:"对齐方式",description:"The alignment of Response Toolbar Button.",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"right",name:"右对齐"},{value:"left",name:"左对齐"}]}},buttons:{title:"按钮",description:"The items of Response Toolbar.",type:"array",default:[],$converter:"/converter/buttons.converter",refreshPanelAfterChanged:!0}}}}}function Kt(n,t,o,a){const s=Te(),r=e.ref(!1),c=e.ref(!1);let f=!0,h=!1,l;function b(v){return l&&l.componentClassList&&l.componentClassList.includes("f-form-layout")&&l.componentClassList.includes("farris-form")?v.sourceType==="control"&&v.controlCategory==="input"||v.sourceType==="move"&&v.controlType==="form-group":!0}function w(v){return!Ye().basalDragulaRuleForContainer(v)||!f||!b(v),!1}function x(){r.value=!1,c.value=!1;const v=n,N=v.appearance&&v.appearance.class||"",B=N.split(" "),F=v.buttons||[],M=F.length?F[0]:null,g=M&&M.appearance?M.appearance.class:"",p=g?g.split(" "):[],i=F.length?F.reduce((A,H)=>{const X=H&&H.appearance?H.appearance.class:"",Z=X?X.split(" "):[];return A.push(...Z),A},[]):[],C=o==null?void 0:o.schema,P=C&&C.appearance&&C.appearance.class||"",D=P?P.split(" "):[];l={componentClass:N,componentClassList:B,childContents:F,firstChildContent:M,firstChildClass:g,firstChildClassList:p,parent:C,parentClass:P,parentClassList:D,children:F,childrenClassList:i};const{canAccept:k,fixed:j,hidePadding:$}=s.getRuleValue(B[0],l);return f=k,h=$,!0}function S(v){}function y(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function u(v,N){return N.text=v.label,N}function m(v,N,B){const F=n;if((F.appearance&&F.appearance.class||"").split(" ").includes("f-form-layout")){const p=String(v.innerText),i=Y("form-group");return i.editor=B,i.label=p,i}return B}function d(){return!1}function T(){return!1}function V(){return!0}function I(){return h}function R(v){return new Jt(v,t).getPropertyConfig(n)}return{canAccepts:w,checkCanAddComponent:V,checkCanDeleteComponent:T,checkCanMoveComponent:d,getStyles:y,hideNestedPaddingInDesginerView:I,onAcceptNewChildElement:m,onAcceptMovedChildElement:S,onResolveNewComponentSchema:u,resolveComponentContext:x,getPropsConfig:R,triggerBelongedComponentToMoveWhenMoved:r,triggerBelongedComponentToDeleteWhenDeleted:c}}const en={id:{type:String,default:""},componentId:{type:String,default:""},canAdd:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},canMove:{type:Boolean,default:!1},contentKey:{type:String,default:"contents"},childLabel:{type:String,default:""},childType:{type:String,default:""},modelValue:{type:Object}},Me=e.ref(0);function tn(n,t){const o=t.getBoundingClientRect(),a=n.getBoundingClientRect(),s=a.top>=o.top,r=a.top<=o.bottom;return s&&r}function nn(n){if(!n)return;let t;if(n.className.includes("dgComponentSelected")?t=n:t=n.querySelector(".dgComponentSelected"),!t)return;const o=t.getBoundingClientRect();if(o.width===0&&o.height===0)return;const a=t.querySelector(".component-btn-group");if(a){if(!tn(t,n)){a.style.display="none";return}a.style.display="";const r=a.getBoundingClientRect(),c=a.querySelector("div");if(c){const f=c.getBoundingClientRect();c.style.top=r.top+"px",c.style.left=r.left-f.width+"px"}}}function on(n,t,o){var R;function a(){}const s="",r=e.ref();function c(){return!0}function f(){return!1}function h(){return!0}function l(){return!0}function b(){return!0}function w(v){if(!v||!v.value)return null;const N=e.ref(v==null?void 0:v.value.parent),B=w(N);return B||null}function x(v=t){const{componentInstance:N,designerItemElementRef:B}=v;return!N||!N.value?null:N.value.canMove||N.value.canAdd||N.value.canDelete?B:x(v.parent)}function S(v){return!!o}function y(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function u(){}function m(v,N){}function d(v){const{componentType:N}=v;let B=Y(N,v);const F=N.toLowerCase().replace("-","_");return B&&!B.id&&B.type===N&&(B.id=`${F}_${Math.random().toString().slice(2,6)}`),B}function T(v,N){const B=String(v.getAttribute("data-controltype")),F=v.getAttribute("data-feature"),M=F?JSON.parse(F):{};M.parentComponentInstance=r.value;let g=Y(B,M);const p=B.toLowerCase().replace("-","_");return g&&!g.id&&g.type===B&&(g.id=`${p}_${Math.random().toString().slice(2,6)}`),g}function V(v){}function I(...v){return[]}return r.value={canMove:c(),canSelectParent:f(),canAdd:l(),canDelete:h(),canNested:!b(),contents:[],elementRef:n,parent:(R=t.parent)==null?void 0:R.componentInstance,schema:t.schema,styles:s,canAccepts:S,getBelongedComponentInstance:w,getDraggableDesignItemElement:x,getDraggingDisplayText:y,getPropConfig:I,getDragScopeElement:u,onAcceptMovedChildElement:m,onAcceptNewChildElement:T,onChildElementMovedOut:V,addNewChildComponentSchema:d,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},r}const Je=e.defineComponent({name:"FDesignerInnerItem",props:en,emits:["selectionChange","addComponent","removeComponent"],setup(n,t){const o=e.ref(n.canMove),a=e.ref(n.canAdd),s=e.ref(n.canDelete),r=e.ref(!1),c=e.ref(n.contentKey),f=e.ref(n.childType),h=e.ref(n.childLabel),l=e.ref(n.modelValue),b=e.ref(""),w=e.ref(),x=e.inject("canvas-dragula"),S=e.ref(),y=e.inject("design-item-context"),u={designerItemElementRef:w,componentInstance:S,schema:l.value,parent:y,setupContext:t};e.provide("design-item-context",u);const m=e.computed(()=>({"farris-component":!0,"flex-fill":n.id=="root-component","position-relative":o.value||s.value,"farris-nested":r.value,"can-move":o.value,"d-none":w.value&&w.value.classList.contains("d-none")})),d=e.computed(()=>{const p={};return b.value&&b.value.split(";").reduce((i,C)=>{const[P,D]=C.split(":");return P&&(i[P]=D),i},p),p});function T(p,i){if(y&&y.schema[c.value]){const C=y.schema[c.value].findIndex(P=>P.id===i.id);if(C>-1){const P=y.schema[c.value].length,D=y.schema[c.value][C%P];y.designerItemElementRef.value.querySelector(`#${D.id}-design-item`),y.schema[c.value].splice(C,1),y.componentInstance.value.updateDragAndDropRules(),Me.value++,t.emit("removeComponent")}}}function V(p){if(S.value.addNewChildComponentSchema){const i={componentType:f.value,label:h.value,parentComponentInstance:S.value,targetPosition:-1},C=S.value.addNewChildComponentSchema(i);l.value[c.value].push(C),t.emit("addComponent")}}function I(){return a.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:p=>{V()}},[e.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function R(p){return s.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:e.withModifiers(i=>T(i,p),["stop"])},[e.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function v(){return o.value&&e.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[e.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function N(p){return e.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[e.createVNode("div",null,[I(),v(),R(p)])])}e.watch(()=>n.modelValue,p=>{l.value=p,u.schema=p});function B(p){const i=p.target;nn(i)}function F(){var p,i;(i=(p=l.value)==null?void 0:p.contents)!=null&&i.length&&w.value&&w.value.addEventListener("scroll",B)}function M(){const p=w.value,i=e.ref(p.children[1]);return on(i,u).value}e.onMounted(()=>{if(w.value){const p=w.value.querySelector(`[data-dragref='${l.value.id}-container']`);S.value=p&&p.componentInstance?p.componentInstance.value:M(),x&&p&&x.attachComponents(p,l.value),r.value=S.value.canNested!==void 0?S.value.canNested:r.value,a.value=S.value.canAdd!==void 0?S.value.canAdd:a.value,s.value=S.value.canDelete!==void 0?S.value.canDelete:s.value,o.value=S.value.canMove!==void 0?S.value.canMove:o.value,b.value=S.value.styles||"",w.value&&(w.value.componentInstance=S,w.value.designItemContext=u)}F(),Me.value++}),e.onBeforeUnmount(()=>{w.value&&w.value.removeEventListener("scroll",B)});function g(p){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(C=>C.classList.remove("dgComponentFocused")),p&&(p.preventDefault(),p.stopPropagation());const i=w.value;if(i){const C=document.getElementsByClassName("dgComponentSelected");if(!(C&&C.length===1&&C[0]===w.value)){Array.from(C).forEach(k=>k.classList.remove("dgComponentSelected")),i.classList.add("dgComponentFocused"),t.emit("selectionChange",l.value.type,l.value,n.componentId,S.value);const D=S.value.getDraggableDesignItemElement(u);D&&D.value&&D.value.classList.add("dgComponentSelected")}}Me.value++}return()=>e.createVNode("div",{id:`${n.id}-design-item`,ref:w,class:m.value,style:d.value,onClick:g},[N(l.value),t.slots.default&&t.slots.default()])}});class an extends Se{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(t){this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识00",title:"标识",type:"string",readonly:!0},type:{description:"类型",title:"类型",type:"string",readonly:!0,$converter:"/converter/type.converter"},text:{title:"文本",type:"string",description:""},icon:{title:"图标",type:"string",description:""}}}}getAppearanceProperties(t){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"}},setPropertyRelates(o,a){}}}getEventPropConfig(t){const o=[{label:"click",name:"点击事件"}];var a=this;const s=a.eventsEditorUtils.formProperties(t,a.viewModelId,o),r={};r[a.viewModelId]={type:"events-editor",editor:{initialData:s}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:r,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(c,f){const h=c.propertyValue;delete t[a.viewModelId],h&&(h.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(t,a.viewModelId,h.events,h))}}}}class sn extends Se{constructor(t,o){super(t,o)}getPropertyConfig(t){return this.getBasicPropConfig(),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(){this.propertyConfig.categories.basic={title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",textField:"value",valueField:"key",data:[{key:"response-toolbar-item",value:O["response-toolbar-item"].name}]}},text:{title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},icon:{title:"图标",type:"string",description:""}}}}getAppearanceProperties(t){}getEventPropConfig(t){const o=[{label:"click",name:"点击事件"}],a=this,s=a.eventsEditorUtils.formProperties(t,a.viewModelId,o),r={};r[a.viewModelId]={type:"events-editor",editor:{initialData:s}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:r,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(c,f){const h=c.propertyValue;delete t[a.viewModelId],h&&(h.setPropertyRelates=this.setPropertyRelates,a.eventsEditorUtils.saveRelatedParameters(t,a.viewModelId,h.events,h))}}}}function rn(n,t){Te();const o=e.ref(!1),a=e.ref(!1);let s=!1,r=!1;function c(m){return!1}function f(m){}function h(){return""}function l(m,d){return d.text=m.label,d}function b(m,d,T){const V=n.schema;if((V.appearance&&V.appearance.class||"").split(" ").includes("f-form-layout")){const v=String(m.innerText),N=Y("form-group");return N.editor=T,N.label=v,N}return T}function w(){return!1}function x(){return!r}function S(){return!1}function y(){return s}function u(m){let d;switch(n.schema.type){case"tab-toolbar-item":d=new an(m,t);break;default:d=new sn(m,t)}return d.getPropertyConfig(n.schema)}return{canAccepts:c,checkCanAddComponent:S,checkCanDeleteComponent:x,checkCanMoveComponent:w,getStyles:h,hideNestedPaddingInDesginerView:y,onAcceptNewChildElement:b,onAcceptMovedChildElement:f,onResolveNewComponentSchema:l,getPropsConfig:u,triggerBelongedComponentToMoveWhenMoved:o,triggerBelongedComponentToDeleteWhenDeleted:a}}const ln=e.defineComponent({name:"FResponseToolbarItemDesign",props:Qe,emits:["Click"],setup(n,t){e.ref(),e.ref();const o=e.ref(n.alignment),a={id:"__more_buttons__",text:"More"},s=e.ref(new pe(a));e.computed(()=>s.value.children.length>0);const r=e.ref(),c=e.inject("designer-host-service"),f=e.inject("design-item-context"),h=rn(f,c),l=Be.useDesignerInnerComponent(r,f,h);e.inject("toolbar-item-handler",()=>{}),e.onMounted(()=>{r.value.componentInstance=l}),t.expose(l.value);function b(){const S={"f-icon":!0};if(n.icon){const y=n.icon.trim().split(" ");y&&y.length&&y.reduce((u,m)=>(u[m]=!0,u),S)}return S}function w(){return!!(n.icon&&n.icon.trim())}function x(){const S={btn:!0,"f-rt-btn":!0,"f-btn-ml":o.value==="right","f-btn-mr":o.value==="left","btn-icontext":!!(n.icon&&n.icon.trim())};if(n.class){const y=n.class.split(" ");y&&y.length&&y.reduce((u,m)=>(u[m]=!0,u),S)}return S}return e.onMounted(()=>{}),e.onUnmounted(()=>{}),()=>e.createVNode("div",{ref:r,"data-dragref":`${f.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[e.createVNode("button",{type:"button",class:x(),id:n.id},[w()&&e.createVNode("i",{class:b()},null),n.text])])}}),cn=e.defineComponent({name:"FResponseToolbarDesign",props:Ut,emits:["Click"],setup(n,t){const o=e.ref(n.items);let a=new Array(o.value.length).fill(e.ref());const s=e.ref(),r=e.ref(),c=e.ref(n.alignment),f={id:"__more_buttons__",text:"More"},h=e.ref(new pe(f)),l=Xt();e.computed(()=>h.value.children.length>0);const b=e.ref(),w=e.inject("designer-host-service"),x=e.inject("design-item-context"),S=Kt(x.schema,w,x),y=Be.useDesignerInnerComponent(b,x,S);e.inject("toolbar-item-handler",()=>{}),e.onMounted(()=>{b.value.componentInstance=y}),t.expose(y.value);const u=e.computed(()=>({"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0})),m=e.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":c.value==="right","justify-content-start":c.value==="left"})),{renderToolbarDropdown:d,clearAllDropDown:T}=Zt(n,l,y);function V(){o.value.filter(M=>M.children&&M.children.length>0).forEach(M=>{M.expanded=!1}),h.value.expanded=!1,T()}const I=new Map,R=[];function v(M){const g=r.value;let p=M;const i=Array.from(g.children),C=i[i.length-1].id==="__more_buttons__"?i[i.length-1]:null;if(C){const $=C.computedStyleMap().get("margin-left"),A=C.computedStyleMap().get("margin-right"),H=($?$.value:0)+C.getBoundingClientRect().width+(A?A.value:0);p-=H}const P=i.filter($=>$.id!=="__more_buttons__");for(const $ of P){const A=$.computedStyleMap().get("margin-left"),H=$.computedStyleMap().get("margin-right"),X=(A?A.value:0)+$.getBoundingClientRect().width+(H?H.value:0);p<X?(I.set($.id,!0),R.push({id:$.id,width:X})):p-=X}if(R.length)for(let $=R.length-1;$>=0;$--){const A=R[$].width;if(p>=A)p-=A,I.delete(R[$].id),R.pop();else break}const D=Object.assign({},h.value);D.children=[];const k=new pe(D),j=o.value.reduce(($,A)=>(I.has(A.id)&&k.children.push(A),A.visible=!I.has(A.id),$.push(A),$),[]);h.value=k,o.value=j}const N=new ResizeObserver(M=>{if(M.length){const p=M[0].contentRect.width,C=r.value.getBoundingClientRect().width;(p<C||R.length)&&v(p)}});e.onMounted(()=>{const M=s.value;N.observe(M),document.body.addEventListener("click",V)}),e.onUnmounted(()=>{N.disconnect(),document.body.removeEventListener("click",V)}),e.watch(()=>n.items,()=>{o.value=n.items},{deep:!0}),e.watch(o,M=>{a=new Array(o.value.length).fill(e.ref())});function B(M,g,p,i){x&&x.setupContext&&x.setupContext.emit("selectionChange",M,g,p,i)}function F(){const M=r.value.querySelector(".dgComponentFocused.dgComponentSelected");M==null||M.classList.remove("dgComponentSelected"),M==null||M.classList.remove("dgComponentFocused")}return()=>e.createVNode("div",{ref:b,"data-dragref":`${x.schema.id}-container`,class:u.value},[e.createVNode("div",{ref:s,class:m.value},[e.createVNode("div",{ref:r,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[o.value.map((M,g)=>e.createVNode(Je,{ref:a[g],class:"p-0 display-inline-block",modelValue:M,"onUpdate:modelValue":p=>M=p,canMove:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:n.componentId,id:M.id,style:"padding:0 !important;display:inline-block",onSelectionChange:B,onRemoveComponent:F},{default:()=>[e.createVNode(ln,{id:M.id,disable:M.disable,text:M.text,icon:M.icon,componentId:n.componentId},null)]}))])])])}});function dn(n,t,o,a,s){const{toolbarItems:r,toolbarSchema:c}=n;function f(h,l,b,w){var x;(x=a.setupContext)==null||x.emit("selectionChange",h,l,b,w)}return e.createVNode("div",{class:"farris-tabs-toolbar"},[e.createVNode("div",{class:"farris-tabs-inline-flex"},[e.createVNode(Je,{modelValue:c.value,"onUpdate:modelValue":h=>c.value=h,canAdd:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",id:c.value.id,onSelectionChange:f,componentId:s},{default:()=>[e.createVNode(cn,{items:r.value,componentId:s},null)]})])])}const un=e.defineComponent({name:"FTabsDesign",props:be,emits:["tabChange","tabRemove"],setup(n,t){const o=e.ref(),a=e.inject("design-item-context"),s=zt(a.schema,a.parent),r=We(o,a,s),c=e.ref(n.tabType),f=e.shallowRef(),h=e.shallowRef(),l=Wt(n,t,f,a),{activeId:b,changeTitleStyle:w,tabPages:x,addTab:S,updateTab:y,selectTabByTabId:u,toolbarItems:m}=l,d=Le(n,h,l),T=Re(n,f,d,l),{previousButtonClass:V,nextButtonClass:I,nextButtonGroupClass:R,scrollTab:v,updateNavigationLayout:N}=T,B=Fe(n,l),{hideDropDown:F}=B,M=Ft(n,f,T,d,l,r,s),g=M,p=Ae(n,f,T,d,l),i=new Map([["default",M],["one-page",g],["pills",p]]);e.computed(()=>{const z=x.value.find(_=>_.props.id===b.value);return z==null?void 0:z.slots});const C=e.computed(()=>{const z=x.value.find(ne=>ne.props.id===b.value);return(z==null?void 0:z.props.toolbarPosition)==="inHead"});e.provide("tabs",{activeId:b,addTab:S,updateTab:y,tabPages:x,tabType:c});function P(){const z=r.value.schema.contents||[];return z.length<1?null:z.find(ne=>ne.id===b.value)}function D(){var _;const z=P();m.value=[...(_=z==null?void 0:z.toolbar)==null?void 0:_.contents]}e.provide("toolbar-item-handler",D);const k=e.computed(()=>n.fill||n.tabType==="fill"),j=e.computed(()=>n.tabType==="pills"),$=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":C.value,"farris-tabs-inContent":!C.value,"farris-tabs-nav-fill":k.value,"farris-tabs-nav-pills":j.value})),A=e.computed(()=>({width:C.value&&n.titleWidth?`${n.titleWidth}%`:""})),H=e.computed(()=>({"farris-tabs":!0,"flex-column":n.position==="top","flex-column-reverse":n.position==="bottom","flex-row":n.position==="left","flex-row-reverse":n.position==="right","one-page":n.tabType==="one-page"}));e.onMounted(()=>{x.value.length&&(b.value=n.activeId||x.value[0].props.id,u(b.value)),e.nextTick(()=>{N()}),w(f),window.addEventListener("click",z=>{var _;F.value||(_=o.value)!=null&&_.contains(z.target)||(F.value=!0)}),window.addEventListener("resize",()=>{N()}),o.value.componentInstance=r});function X(){return e.createVNode("button",{title:"left-arrow-button",type:"button",class:V.value,onClick:()=>{v(0,-1)}},null)}function Z(){return e.createVNode("button",{title:"right-arrow-button",type:"button",class:I.value,onClick:()=>{v(0,1)}},null)}const{renderMorePagesButtton:ae}=Oe(n,B,T,l);function K(){return!!m.value.length&&dn(l,r,s,a,n.componentId)}const ee=i.get(n.tabType)||i.get("default");function q(){var z,_,ne,fe;return e.createVNode("div",{class:$.value},[e.createVNode("div",{class:"farris-tabs-header-pre"},[(_=(z=t.slots).headerPrefix)==null?void 0:_.call(z)]),e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:A.value},[X(),ee&&ee(),e.createVNode("div",{class:R.value},[Z(),ae()])]),K(),e.createVNode("div",{class:"farris-tabs-header-post"},[(fe=(ne=t.slots).headerSuffix)==null?void 0:fe.call(ne)])])}function Q(){var z,_;return e.createVNode("div",{class:"farris-tabs-content",ref:h},[(_=(z=t.slots).default)==null?void 0:_.call(z)])}return t.expose(r.value),()=>e.createVNode("div",{class:H.value,ref:o},[q(),Q()])}});function pn(n,t,o){return t?{enableAccordion:o.accordionMode}:{enableAccordion:""}}function fn(n,t){return t&&t.contents&&t.contents.length&&t.contents.forEach(o=>{o.title&&(o.text=o.title)}),{buttons:t.contents,buttonPosition:t.position}}const mn=new Map([["appearance",ge],["expanded","expandStatus"],["enableAccordion",pn],["toolbar",fn]]);function hn(n,t,o){return t}const yn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/section.schema.json",title:"section",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"section"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contentClass:{description:"",type:"string",default:""},contents:{description:"",type:"array",default:[]},enableAccordion:{description:"",type:"boolean",default:!1},accordionMode:{description:"",type:"string",default:"default"},enableMaximize:{description:"",type:"boolean",default:!1},expanded:{description:"",type:"boolean",default:!0},fill:{description:"",type:"boolean",default:!1},headerClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},showHeader:{description:"",type:"string",default:!0},mainTitle:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},headerContentClass:{description:"",type:"string",default:""},extendClass:{description:"",type:"string",default:""},visible:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{type:{type:"string",default:"SectionToolbar"},position:{type:"string",default:"inHead"},contents:{type:"array",default:[]}},default:null}},required:["id","type","contents"]},gn={title:"section",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"组件类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",textField:"value",valueField:"key",data:[{key:"section",value:"分组面板"}]}},mainTitle:{title:"主标题",type:"string",description:""},subTitle:{title:"副标题",type:"string",description:""}}},appearance:{title:"样式",description:"Appearance",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},fill:{title:"填充内容区域",type:"boolean",description:"To fill the space of parent container in flex layout."},showHeader:{title:"显示标题区域",type:"boolean",description:""},mainTitle:{title:"主标题",type:"string",description:"",visible:{showHeader:!0}},subTitle:{title:"副标题",type:"string",description:"",visible:{showHeader:!0}},enableAccordion:{title:"允许收折",type:"boolean",description:"",visible:{showHeader:!0}}}},extends:{title:"扩展",description:"",properties:{contentClass:{title:"内容区域样式",type:"string",description:""}}}}},Ke={contentClass:{type:String,default:""},customClass:{type:String,default:""},enableAccordion:{type:String,default:""},expandStatus:{type:Boolean,default:!0},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!0},subTitle:{type:String,default:""},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},headerClass:{type:String,default:""},enableMaximize:{type:Boolean,default:!1},headerContentClass:{type:String,default:""},extendClass:{type:String,default:""},buttons:{type:Array,default:[]},buttonPosition:{type:String,default:"inHead"},fill:{type:Boolean,default:!1}};re(Ke,yn,mn,hn,gn);function bn(n,t,o){let a;function s(){!n||!t.value||(o.value=!o.value,o.value?r():c())}function r(){a=n.value.nextElementSibling;const h=document&&document.querySelector("body");h&&(h.appendChild(n.value),n.value.style.zIndex=f())}function c(){a?t.value.insertBefore(n.value,a):t.value.appendChild(n.value),n.value.style.zIndex=null}function f(h=1){const l=["body>.f-datagrid-settings-simple-host","body>div","body>farris-dialog>.farris-modal.show","body>.farris-modal.show","body>farris-filter-panel>.f-filter-panel-wrapper","body .f-sidebar-show>.f-sidebar-main","body>.popover.show","body>filter-row-panel>.f-datagrid-filter-panel","body>.f-section-maximize"],b=Array.from(document.body.querySelectorAll(l.join(","))).filter(x=>x).map(x=>{const{display:S,zIndex:y}=window.getComputedStyle(x);return S==="none"?0:parseInt(y,10)}).filter(x=>x);let w=Math.max(...b);return w<1040&&(w=1040),w+h}return{onClickMaxMinIcon:s}}function et(n,t){const o=e.ref(n.buttons),a=e.computed(()=>n.buttonPosition==="inHead"?"right":"left"),s=e.computed(()=>"f-section-toolbar"+(n.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),r=e.computed(()=>{n.buttons&&n.buttons.length>0&&n.buttonPosition});function c(f){t.emit("Click",f)}return()=>r&&e.createVNode(Ve,{customClass:s.value,items:o.value,onClick:c,alignment:a.value},null)}function vn(n,t,o,a,s,r){e.ref(n.subTitle);const c=e.computed(()=>n.buttonPosition),f=et(n,t),{onClickMaxMinIcon:h}=bn(a,s,r),l=e.computed(()=>!!n.subTitle),b=e.computed(()=>n.enableMaximize),w=e.computed(()=>n.enableAccordion!=""),x=e.computed(()=>{const V={"f-section-header":!0};return t.slots.header&&n.headerClass.split(" ").reduce((R,v)=>(R[v]=!0,R),V),V});function S(V){V.stopPropagation(),n.enableAccordion!==""&&(o.value=!o.value)}function y(){const V=e.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":o.value})),I=e.computed(()=>({"f-icon":!0,"f-icon-maximize":!r.value,"f-icon-minimize":r.value}));return e.createVNode("div",{class:"f-max-accordion"},[b.value?e.createVNode("span",{class:I.value,onClick:h},null):"",w.value?e.createVNode("button",{class:V.value,onClick:S},[e.createVNode("span",null,[o.value?n.collapseLabel:n.expandLabel])]):""])}function u(){return t.slots.header?e.createVNode("div",{class:x.value},[t.slots.header()]):""}function m(){return e.createVNode("div",{class:"f-title",onClick:S},[e.createVNode("h4",{class:"f-title-text"},[n.mainTitle]),l.value&&e.createVNode("span",null,[n.subTitle])])}function d(){const V=e.computed(()=>{const I={"f-content":!0};return n.headerContentClass&&n.headerContentClass.split(" ").reduce((v,N)=>(v[N]=!0,v),I),I});return t.slots.headerContent?e.createVNode("div",{class:V.value},[t.slots.headerContent()]):""}function T(){return e.createVNode("div",{class:x.value},[t.slots.headerTitle?t.slots.headerTitle():m(),d(),c.value==="inHead"&&f(),(b.value||w.value)&&y()])}return()=>n.showHeader&&(t.slots.header?u():T())}const Cn=["moz","ms","webkit"];function wn(){let n=0;return t=>{const o=new Date().getTime(),a=Math.max(0,16-(o-n)),s=setTimeout(()=>{t(o+a)},a);return n=o+a,s}}function Tn(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const n=Cn.filter(t=>`${t}RequestAnimationFrame`in window)[0];return n?window[`${n}RequestAnimationFrame`]:wn()}Tn();function Ne(n,t){return((t==null?void 0:t.split(" "))||[]).reduce((a,s)=>(s&&(a[s]=!0),a),n),n}const xn=e.defineComponent({name:"FSection",props:Ke,emits:[],setup(n,t){const o=e.ref();let a=e.ref();const s=e.ref(n.customClass),r=e.computed(()=>n.enableAccordion),c=e.ref(n.expandStatus),f=e.computed(()=>n.buttonPosition),h=e.ref(!1),l=vn(n,t,c,o,a,h),b=et(n,t),w=e.computed(()=>{const m={"f-section":!0,"f-section-accordion":r.value==="default","f-state-collapse":(r.value==="default"||r.value==="custom")&&!c.value,"f-section-custom-accordion":r.value==="custom","f-section-fill":n.fill,"f-section-maximize":h.value};return Ne(m,s.value)}),x=e.computed(()=>Ne({"f-section-content":!0},n.contentClass)),S=e.computed(()=>Ne({"f-section-extend":!0},S.value));function y(){return t.slots.extend&&e.createVNode("div",{class:S.value},[t.slots.extend()])}function u(){return e.createVNode("div",{class:x.value},[f.value==="inContent"&&b(),t.slots.default&&t.slots.default()])}return e.watch(()=>n.expandStatus,(m,d)=>{m!==d&&(c.value=m)}),e.onMounted(()=>{o&&o.value&&(a.value=o.value.parentElement)}),()=>e.createVNode("div",{class:w.value,ref:o},[l(),y(),u()])}});function Sn(n,t){function o(s){return!!Ye().basalDragulaRuleForContainer(s)}function a(s){}return{canAccepts:o,onAcceptMovedChildElement:a}}function Mn(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const Nn=e.defineComponent({name:"FTabPageDesign",props:ce,emits:[],setup(n,t){const o=e.ref(),a=e.inject("design-item-context"),s=Sn(a.schema,a.parent),r=We(o,a,s);r.value.canNested=!1,r.value.canDelete=!1,r.value.canMove=!1,t.expose(r.value);const c=e.inject("tabs"),f=e.ref(!0),h={slots:t.slots,props:n},l=e.ref((c==null?void 0:c.tabType.value)||"default");e.onMounted(()=>{o.value.componentInstance=r;const d=c.tabPages.value.findIndex(T=>T.props.id===n.id);!d||d===-1?c==null||c.addTab(h):d>-1&&(f.value=!1,console.warn(`已经存在id为${n.id}的页签啦`))}),e.onUnmounted(()=>{});const b=e.computed(()=>(n==null?void 0:n.id)===(c==null?void 0:c.activeId.value)),w=e.computed(()=>({display:b.value?"":"none"}));e.watch(()=>n,d=>{c==null||c.updateTab({props:d,slots:t.slots})},{immediate:!0,deep:!0});function x(){var T,V;const d=(V=(T=t.slots).default)==null?void 0:V.call(T);return e.createVNode(xn,{"main-title":n.title,class:"farris-tab-page"},Mn(d)?d:{default:()=>[d]})}const S=e.computed(()=>({"farris-tab-page":!0,"drag-container":!0}));function y(){var T,V;const d=(V=(T=t.slots).default)==null?void 0:V.call(T);return e.createVNode("div",{ref:o,class:S.value,"data-dragref":`${a.schema.id}-container`,style:w.value},[d])}const m=new Map([["default",y],["one-page",x]]).get(l.value)||y;return()=>f.value?m():null}});te.install=n=>{n.component(te.name,te),n.component(de.name,de)},te.register=(n,t,o)=>{n.tabs=te,n["tab-page"]=de,t.tabs=Ie,t["tab-page"]=ve},te.registerDesigner=(n,t,o)=>{n.tabs=un,n["tab-page"]=Nn,t.tabs=$e,t["tab-page"]=ve},W.FTabPage=de,W.FTabs=te,W.default=te,W.tabPageProps=ce,W.tabPagePropsResolver=ve,W.tabsDesignProps=be,W.tabsDesignPropsResolver=$e,W.tabsProps=le,W.tabsPropsResolver=Ie,Object.defineProperties(W,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|