@farris/ui-vue 1.2.6 → 1.2.8
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/index.esm.js +150 -142
- package/components/avatar/index.esm.js +393 -457
- package/components/border-editor/index.esm.js +4 -4
- package/components/button/index.esm.js +1 -1
- package/components/button-edit/index.esm.js +353 -444
- package/components/button-group/index.esm.js +5 -5
- package/components/calendar/index.esm.js +176 -176
- package/components/capsule/index.esm.js +93 -93
- package/components/checkbox/index.esm.js +491 -554
- package/components/color-picker/index.esm.js +1 -1
- package/components/combo-list/index.esm.js +479 -513
- package/components/combo-tree/index.esm.js +8 -8
- package/components/component/index.esm.js +89 -89
- package/components/condition/index.esm.js +857 -743
- package/components/content-container/index.esm.js +61 -61
- package/components/data-grid/index.esm.js +4883 -5182
- package/components/data-view/index.esm.js +3072 -2949
- package/components/date-picker/index.esm.js +2626 -2689
- package/components/dependent-base/style.js +1 -0
- package/components/dependent-fluid/style.js +1 -0
- package/components/dependent-icon/style.js +1 -0
- package/components/dependent-input/style.js +1 -0
- package/components/dependent-table/style.js +1 -0
- package/components/designer-canvas/index.esm.js +478 -475
- package/components/designer-outline/index.esm.js +173 -131
- package/components/discussion-editor/index.esm.js +1 -1
- package/components/dropdown/index.esm.js +73 -73
- package/components/dynamic-form/index.esm.js +940 -998
- package/components/dynamic-resolver/index.esm.js +67 -35
- package/components/dynamic-view/index.esm.js +307 -293
- package/components/enum-editor/index.esm.js +3 -3
- package/components/events-editor/index.esm.js +178 -178
- package/components/expression-editor/index.esm.js +105 -105
- package/components/external-container/index.esm.js +1747 -1627
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +5877 -6176
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1454 -1524
- package/components/flow-canvas/index.esm.js +678 -675
- package/components/image-cropper/index.esm.js +266 -266
- package/components/input-group/index.esm.js +659 -722
- package/components/layout/index.esm.js +148 -148
- package/components/list-nav/index.esm.js +109 -109
- package/components/list-view/index.esm.js +1643 -1524
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +6502 -6770
- package/components/mapping-editor/index.esm.js +5639 -5939
- package/components/message-box/index.esm.js +1 -1
- package/components/modal/index.esm.js +1 -1
- package/components/nav/index.esm.js +86 -86
- package/components/number-range/index.esm.js +1120 -0
- package/components/number-range/package.json +8 -0
- package/components/number-range/style.js +6 -0
- package/components/number-spinner/index.esm.js +1146 -0
- package/components/number-spinner/package.json +8 -0
- package/components/number-spinner/style.js +4 -0
- package/components/order/index.esm.js +1098 -1130
- package/components/page-footer/index.esm.js +106 -106
- package/components/page-header/index.esm.js +1088 -1317
- package/components/pagination/index.esm.js +252 -252
- package/components/progress/index.esm.js +37 -37
- package/components/property-editor/index.esm.js +1479 -1513
- package/components/property-panel/index.css +1 -1
- package/components/property-panel/index.esm.js +706 -778
- package/components/query-solution/index.css +1 -0
- package/components/query-solution/index.esm.js +6935 -0
- package/components/query-solution/package.json +8 -0
- package/components/query-solution/style.js +2 -0
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-group/index.esm.js +453 -516
- package/components/rate/index.esm.js +92 -92
- package/components/response-layout/index.esm.js +33 -33
- package/components/response-layout-editor/index.esm.js +555 -526
- package/components/response-toolbar/index.esm.js +1009 -1247
- package/components/schema-selector/index.esm.js +3261 -3373
- package/components/search-box/index.esm.js +143 -143
- package/components/section/index.esm.js +209 -209
- package/components/smoke-detector/index.esm.js +22 -22
- package/components/spacing-editor/index.esm.js +2 -2
- package/components/splitter/index.esm.js +1097 -394
- package/components/step/index.esm.js +153 -153
- package/components/switch/index.esm.js +441 -504
- package/components/tabs/index.esm.js +1849 -2039
- package/components/tags/index.esm.js +215 -215
- package/components/text/index.esm.js +53 -53
- package/components/textarea/index.esm.js +445 -493
- package/components/time-picker/index.esm.js +1350 -1414
- package/components/transfer/index.esm.js +146 -144
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +5948 -6237
- package/components/tree-view/index.esm.js +2381 -2255
- package/components/uploader/index.esm.js +1 -1
- package/components/verify-detail/index.esm.js +232 -232
- package/components/video/index.esm.js +136 -136
- package/components/weather/index.esm.js +2 -2
- package/farris.all.esm.js +27221 -26804
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/checkbox/index.d.ts +1 -0
- package/types/combo-list/src/components/list-container.component.d.ts +6 -0
- package/types/combo-list/src/components/list-container.props.d.ts +9 -1
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- package/types/data-grid/src/designer/column-header.design.component.d.ts +1 -1
- package/types/data-grid/src/designer/data-grid-column.props.d.ts +1 -0
- package/types/data-view/composition/types.d.ts +1 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +16 -350
- package/types/designer-canvas/src/types.d.ts +1 -1
- package/types/dynamic-form/index.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/binding-resolver.d.ts +1 -0
- package/types/dynamic-view/src/dynamic-view.component.d.ts +1 -1
- package/types/lookup/src/property-config/converters/lookup-property.converter.d.ts +0 -4
- package/types/lookup/src/property-config/lookup.property-config.d.ts +4 -3
- package/types/modal/src/modal.props.d.ts +1 -4
- package/types/property-panel/src/composition/entity/base-property.d.ts +0 -28
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +11 -5
- package/types/property-panel/src/composition/entity/schema-dom-mapping.d.ts +10 -8
- package/types/tabs/src/designer/tab-toolbar-item.props.d.ts +19 -0
- package/types/tabs/src/property-config/tabs.property-config.d.ts +6 -6
- package/types/tree-grid/src/designer/use-designer-rules.d.ts +3 -0
- package/types/tree-grid/src/property-config/tree-grid.property-config.d.ts +11 -0
- package/types/tree-grid/src/schema/column-resolver.d.ts +1 -1
- package/types/tree-grid/src/tree-grid.props.d.ts +8 -0
- package/components/accordion/index.umd.cjs +0 -1
- package/components/avatar/index.umd.cjs +0 -1
- package/components/border-editor/index.umd.cjs +0 -1
- package/components/button/index.umd.cjs +0 -1
- package/components/button-edit/index.umd.cjs +0 -1
- package/components/button-group/index.umd.cjs +0 -1
- package/components/calculator/index.umd.cjs +0 -1
- package/components/calendar/index.umd.cjs +0 -1
- package/components/capsule/index.umd.cjs +0 -1
- package/components/checkbox/index.umd.cjs +0 -1
- package/components/color-picker/index.umd.cjs +0 -3
- package/components/combo-list/index.umd.cjs +0 -1
- package/components/combo-tree/index.umd.cjs +0 -1
- package/components/common/index.umd.cjs +0 -1
- package/components/component/index.umd.cjs +0 -1
- package/components/condition/index.umd.cjs +0 -1
- package/components/content-container/index.umd.cjs +0 -1
- package/components/data-grid/index.umd.cjs +0 -1
- package/components/data-view/index.umd.cjs +0 -1
- package/components/date-picker/index.umd.cjs +0 -1
- package/components/designer-canvas/index.umd.cjs +0 -1
- package/components/designer-outline/index.umd.cjs +0 -1
- package/components/designer-toolbox/index.umd.cjs +0 -1
- package/components/discussion-editor/index.umd.cjs +0 -3
- package/components/discussion-list/index.umd.cjs +0 -1
- package/components/drawer/index.umd.cjs +0 -1
- package/components/dropdown/index.umd.cjs +0 -2
- package/components/dynamic-form/index.umd.cjs +0 -1
- package/components/dynamic-resolver/index.umd.cjs +0 -1
- package/components/dynamic-view/index.umd.cjs +0 -1
- package/components/enum-editor/index.umd.cjs +0 -1
- package/components/events-editor/index.umd.cjs +0 -1
- package/components/expression-editor/index.umd.cjs +0 -1
- package/components/external-container/index.umd.cjs +0 -1
- package/components/field-selector/index.umd.cjs +0 -1
- package/components/filter-bar/index.umd.cjs +0 -1
- package/components/flow-canvas/index.umd.cjs +0 -1
- package/components/image-cropper/index.umd.cjs +0 -1
- package/components/input-group/index.umd.cjs +0 -1
- package/components/layout/index.umd.cjs +0 -1
- package/components/list-nav/index.umd.cjs +0 -1
- package/components/list-view/index.umd.cjs +0 -1
- package/components/loading/index.umd.cjs +0 -8
- package/components/locale/index.umd.cjs +0 -1
- package/components/lookup/index.umd.cjs +0 -1
- package/components/mapping-editor/index.umd.cjs +0 -1
- package/components/message-box/index.umd.cjs +0 -1
- package/components/modal/index.umd.cjs +0 -1
- package/components/nav/index.umd.cjs +0 -3
- package/components/notify/index.umd.cjs +0 -1
- package/components/order/index.umd.cjs +0 -1
- package/components/page-footer/index.umd.cjs +0 -1
- package/components/page-header/index.umd.cjs +0 -1
- package/components/pagination/index.umd.cjs +0 -1
- package/components/popover/index.umd.cjs +0 -1
- package/components/progress/index.umd.cjs +0 -3
- package/components/property-editor/index.umd.cjs +0 -3
- package/components/property-panel/index.umd.cjs +0 -1
- package/components/radio-button/index.umd.cjs +0 -1
- package/components/radio-group/index.umd.cjs +0 -1
- package/components/rate/index.umd.cjs +0 -1
- package/components/response-layout/index.umd.cjs +0 -1
- package/components/response-layout-editor/index.umd.cjs +0 -1
- package/components/response-toolbar/index.umd.cjs +0 -1
- package/components/schema-selector/index.umd.cjs +0 -8
- package/components/search-box/index.umd.cjs +0 -1
- package/components/section/index.umd.cjs +0 -1
- package/components/smoke-detector/index.umd.cjs +0 -1
- package/components/spacing-editor/index.umd.cjs +0 -1
- package/components/splitter/index.umd.cjs +0 -1
- package/components/step/index.umd.cjs +0 -1
- package/components/switch/index.umd.cjs +0 -1
- package/components/tabs/index.umd.cjs +0 -1
- package/components/tags/index.umd.cjs +0 -1
- package/components/text/index.umd.cjs +0 -1
- package/components/textarea/index.umd.cjs +0 -1
- package/components/time-picker/index.umd.cjs +0 -1
- package/components/tooltip/index.umd.cjs +0 -1
- package/components/transfer/index.umd.cjs +0 -1
- package/components/tree-grid/index.umd.cjs +0 -1
- package/components/tree-view/index.umd.cjs +0 -1
- package/components/uploader/index.umd.cjs +0 -2
- package/components/verify-detail/index.umd.cjs +0 -1
- package/components/video/index.umd.cjs +0 -1
- package/components/weather/index.umd.cjs +0 -16
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function($,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("lodash-es"),require("@farris/ui-vue/components/response-toolbar"),require("@farris/ui-vue/components/designer-canvas/src/composition/function/use-designer-inner-component"),require("@farris/ui-vue/components/common")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","@farris/ui-vue/components/response-toolbar","@farris/ui-vue/components/designer-canvas/src/composition/function/use-designer-inner-component","@farris/ui-vue/components/common"],t):($=typeof globalThis<"u"?globalThis:$||self,t($["page-header"]={},$.Vue,$.LodashES,$.FResponseToolbar$1,$.useDesignerInnerComponent$1,$.common))})(this,function($,t,q,ke,ae,xe){"use strict";var ft=Object.defineProperty;var mt=($,t,q)=>t in $?ft($,t,{enumerable:!0,configurable:!0,writable:!0,value:q}):$[t]=q;var I=($,t,q)=>mt($,typeof t!="symbol"?t+"":t,q);const Z={},ce={};function K(r){const{properties:e,title:n}=r,s=Object.keys(e).reduce((d,f)=>(d[f]=e[f].type==="object"&&e[f].properties?K(e[f]):q.cloneDeep(e[f].default),d),{});return s.id=`${n}-${Date.now()}`,s}function U(r,e={}){const n=Z[r];if(n){let s=K(n);const d=ce[r];return s=d?d({getSchemaByType:U},s,e):s,s}return null}function Ne(r,e){const n=K(e);return Object.keys(r).reduce((s,d)=>(s[d]=r[d],s),n),n}function Ve(r,e){return Object.keys(r).filter(s=>r[s]!=null).reduce((s,d)=>{if(e.has(d)){const f=e.get(d);if(typeof f=="string")s[f]=r[d];else{const b=f(d,r[d],r);Object.assign(s,b)}}else s[d]=r[d];return s},{})}function je(r,e,n=new Map){const s=Ne(r,e);return Ve(s,n)}function Ee(r={}){function e(y,T,p,c){if(typeof p=="number")return c[y].length===p;if(typeof p=="object"){const m=Object.keys(p)[0],a=p[m];if(m==="not")return Number(c[y].length)!==Number(a);if(m==="moreThan")return Number(c[y].length)>=Number(a);if(m==="lessThan")return Number(c[y].length)<=Number(a)}return!1}function n(y,T,p,c){return c[y]&&c[y].propertyValue&&String(c[y].propertyValue.value)===String(p)}const s=new Map([["length",e],["getProperty",n]]);Object.keys(r).reduce((y,T)=>(y.set(T,r[T]),y),s);function d(y,T){const p=y;return typeof T=="number"?[{target:p,operator:"length",param:null,value:Number(T)}]:typeof T=="boolean"?[{target:p,operator:"getProperty",param:y,value:!!T}]:typeof T=="object"?Object.keys(T).map(c=>{if(c==="length")return{target:p,operator:"length",param:null,value:T[c]};const m=c,a=T[c];return{target:p,operator:"getProperty",param:m,value:a}}):[]}function f(y){return Object.keys(y).reduce((p,c)=>{const m=d(c,y[c]);return p.push(...m),p},[])}function b(y,T){if(s.has(y.operator)){const p=s.get(y.operator);return p&&p(y.target,y.param,y.value,T)||!1}return!1}function P(y,T){return f(y).reduce((m,a)=>m&&b(a,T),!0)}function M(y,T){const p=Object.keys(y),c=p.includes("allOf"),m=p.includes("anyOf"),a=c||m,k=(a?y[a?c?"allOf":"anyOf":"allOf"]:[y]).map(S=>P(S,T));return c?!k.includes(!1):k.includes(!0)}return{parseValueSchema:M}}const N={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"}},le={},Be={};Ee();function J(r,e,n=new Map,s=(b,P,M)=>P,d={},f=b=>b){return Z[e.title]=e,ce[e.title]=s,le[e.title]=d,Be[e.title]=f,(b={})=>{const P=je(b,e,n),M=Object.keys(r).reduce((y,T)=>(y[T]=r[T].default,y),{});return Object.assign(M,P)}}function Ae(r,e){return{customClass:e.class,customStyle:e.style}}function Ie(r,e){return{buttons:e.buttons}}const Fe=new Map([["appearance",Ae],["toolbar",Ie]]),Re={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/page-header.schema.json",title:"page-header",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Page Header",type:"string"},type:{description:"The type string of Page Header component",type:"string",default:"page-header"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},showIcon:{description:"",type:"boolean",default:!0},icon:{description:"",type:"string",default:"f-icon-page-title-record"},iconClass:{description:"",type:"string",default:"f-text-orna-bill"},title:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},toolbar:{description:"",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"},alignment:{description:"The alignment of Response Toolbar Button.",type:"string",default:"right"},buttons:{description:"The items of Response Toolbar.",type:"array",default:[]}}},buttonClass:{description:"",type:"string",default:"col-6"},titleContentClass:{description:"",type:"string",default:""},contentClass:{description:"",type:"string",default:""},downContentClass:{description:"",type:"string",default:""},showPagination:{description:"",type:"boolean",default:!1},prePaginationDisabled:{description:"",type:"boolean",default:!0},nextPaginationDisabled:{description:"",type:"boolean",default:!1}}};function Oe(r,e,n){return e.title="标题",e}const H={customClass:{type:String,default:""},showIcon:{type:Boolean,default:!0},icon:{type:String,default:"f-icon-page-title-record"},iconClass:{type:String,default:"f-text-orna-bill"},title:{type:String,default:""},subTitle:{type:String,default:""},buttonClass:{type:String,default:"col-6"},buttons:{type:Array,default:[]},titleContentClass:{type:String,default:""},contentClass:{type:String,default:""},downContentClass:{type:String,default:""},showPagination:{type:Boolean,default:!1},prePaginationDisabled:{type:Boolean,default:!0},nextPaginationDisabled:{type:Boolean,default:!1}},pe=Object.assign({},H,{componentId:{type:String,default:""}}),ee=J(H,Re,Fe,Oe),G=t.defineComponent({name:"FPageHeader",props:H,emits:["Click","PrePaginationClick","NextPaginationClick"],setup(r,e){const n=t.ref(r.buttons),s=(S,j)=>{e.emit("Click",S,j)};function d(S,j){S&&j&&j.split(" ").reduce((C,g)=>(C[g]=!0,C),S)}const f=t.computed(()=>{const S={"f-page-header":!0};return d(S,r.customClass),S}),b=t.computed(()=>{const S={"f-title-icon":!0};return d(S,r.iconClass),S}),P=t.computed(()=>{const S={"f-icon":!0};return d(S,r.icon),S}),M=t.computed(()=>{const S={"f-title":!0};return d(S,r.titleContentClass),S}),y=t.computed(()=>{const S={"f-content":!0};return d(S,r.contentClass),S}),T=t.computed(()=>{const S={"f-content":!0};return d(S,r.downContentClass),S}),p=t.computed(()=>({"f-icon f-icon-arrow-w":!0,"f-state-disabled":r.prePaginationDisabled})),c=t.computed(()=>({"f-icon f-icon-arrow-e":!0,"f-state-disabled":r.nextPaginationDisabled}));function m(S){r.prePaginationDisabled||e.emit("PrePaginationClick",S)}function a(S){r.nextPaginationDisabled||e.emit("NextPaginationClick",S)}function v(){return e.slots.titleContent?t.createVNode("div",{class:M.value},[t.createTextVNode(" "),e.slots.titleContent()]):t.createVNode("div",{class:"f-title"},[r.showIcon&&r.icon?t.createVNode("span",{class:b.value},[t.createVNode("i",{class:P.value},null)]):"",t.createVNode("h4",{class:"f-title-text"},[r.title]),r.subTitle?t.createVNode("h5",{class:"f-title-subtitle"},[r.subTitle]):"",r.showPagination?t.createVNode("div",{class:"f-title-pagination"},[t.createVNode("span",{class:p.value,onClick:m},null),t.createVNode("span",{class:c.value,onClick:a},null)]):""])}function w(){return e.slots.content?t.createVNode("div",{class:y.value},[t.createTextVNode(" "),e.slots.content()]):""}function k(){if(r.buttons&&r.buttons.length>0)return t.createVNode(ke,{customClass:r.buttonClass,items:n.value,onClick:s},null)}function A(){return e.slots.downContent?t.createVNode("div",{class:T.value},[t.createTextVNode(" "),e.slots.downContent()]):""}return t.watch(()=>r.buttons,S=>{n.value=S},{deep:!0}),()=>t.createVNode("div",{class:f.value},[t.createVNode("nav",{class:"f-page-header-base"},[v(),w(),k()]),A()])}});function $e(r,e,n){var F;function s(){n!=null&&n.resolveComponentContext&&n.resolveComponentContext()}s();const d=n&&n.getStyles&&n.getStyles()||"",f=n&&n.getDesignerClass&&n.getDesignerClass()||"",b=t.ref();function P(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function M(){return!1}function y(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function T(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function p(C){if(!C||!C.value)return null;if(C.value.schema&&C.value.schema.type==="component")return C.value;const g=t.ref(C==null?void 0:C.value.parent),D=p(g);return D||null}function c(C=e){const{componentInstance:g,designerItemElementRef:D}=C;return!g||!g.value?null:g.value.canMove?D:c(C.parent)}function m(C){return!!n&&n.canAccepts(C)}function a(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function v(){}function w(C,g){g&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(g)}function k(C){const{componentType:g}=C;let D=U(g,C);n&&n.onResolveNewComponentSchema&&(D=n.onResolveNewComponentSchema(C,D));const V=g.toLowerCase().replace("-","_");return D&&!D.id&&D.type===g&&(D.id=`${V}_${Math.random().toString().slice(2,6)}`),D}function A(C,g){const D=String(C.getAttribute("data-controltype")),V=C.getAttribute("data-feature"),u=V?JSON.parse(V):{};u.parentComponentInstance=b.value;let i=U(D,u);n&&n.onAcceptNewChildElement&&(i=n.onAcceptNewChildElement(C,g,i));const o=D.toLowerCase().replace("-","_");return i&&!i.id&&i.type===D&&(i.id=`${o}_${Math.random().toString().slice(2,6)}`),i}function S(C){}function j(...C){if(n&&n.getPropsConfig)return n.getPropsConfig(...C)}return b.value={canMove:P(),canSelectParent:M(),canDelete:y(),canNested:!T(),contents:e==null?void 0:e.schema.contents,elementRef:r,parent:(F=e==null?void 0:e.parent)==null?void 0:F.componentInstance,schema:e==null?void 0:e.schema,styles:d,designerClass:f,canAccepts:m,getBelongedComponentInstance:p,getDraggableDesignItemElement:c,getDraggingDisplayText:a,getPropConfig:j,getDragScopeElement:v,onAcceptMovedChildElement:w,onAcceptNewChildElement:A,onChildElementMovedOut:S,addNewChildComponentSchema:k,updateDragAndDropRules:s,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||t.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||t.ref(!1)},b}class de{static getEditorTypesByMDataType(e){const n=this.fieldControlTypeMapping[e];return n||[{key:"",value:""}]}}I(de,"fieldControlTypeMapping",{String:[{key:N["input-group"].type,value:N["input-group"].name},{key:N.lookup.type,value:N.lookup.name},{key:N.Image.type,value:N.Image.name},{key:N["date-picker"].type,value:N["date-picker"].name},{key:N["check-box"].type,value:N["check-box"].name},{key:N["radio-group"].type,value:N["radio-group"].name},{key:N["combo-list"].type,value:N["combo-list"].name},{key:N.textarea.type,value:N.textarea.name}],Text:[{key:N.textarea.type,value:N.textarea.name},{key:N.avatar.type,value:N.avatar.name},{key:N.lookup.type,value:N.lookup.name}],Decimal:[{key:N["number-spinner"].type,value:N["number-spinner"].name}],Integer:[{key:N["number-spinner"].type,value:N["number-spinner"].name}],Number:[{key:N["number-spinner"].type,value:N["number-spinner"].name}],BigNumber:[{key:N["number-spinner"].type,value:N["number-spinner"].name}],Date:[{key:N["date-picker"].type,value:N["date-picker"].name}],DateTime:[{key:N["date-picker"].type,value:N["date-picker"].name}],Boolean:[{key:N.switch.type,value:N.switch.name},{key:N["check-box"].type,value:N["check-box"].name}],Enum:[{key:N["combo-list"].type,value:N["combo-list"].name},{key:N["radio-group"].type,value:N["radio-group"].name}],Object:[{key:N.lookup.type,value:N.lookup.name},{key:N["combo-list"].type,value:N["combo-list"].name},{key:N["radio-group"].type,value:N["radio-group"].name}],EmployeeSelector:[{key:N.EmployeeSelector.type,value:N.EmployeeSelector.name}],AdminOrganizationSelector:[{key:N.AdminOrganizationSelector.type,value:N.AdminOrganizationSelector.name}]});class Q{constructor(e,n){I(this,"componentId");I(this,"viewModelId");I(this,"eventsEditorUtils");I(this,"formSchemaUtils");I(this,"formMetadataConverter");I(this,"designViewModelUtils");I(this,"designViewModelField");I(this,"controlCreatorUtils");I(this,"designerHostService");I(this,"schemaService",null);I(this,"metadataService",null);I(this,"propertyConfig",{type:"object",categories:{}});var s;this.componentId=e,this.designerHostService=n,this.eventsEditorUtils=n.eventsEditorUtils,this.formSchemaUtils=n.formSchemaUtils,this.formMetadataConverter=n.formMetadataConverter,this.viewModelId=((s=this.formSchemaUtils)==null?void 0:s.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=n.designViewModelUtils,this.controlCreatorUtils=n.controlCreatorUtils,this.metadataService=n.metadataService,this.schemaService=n.schemaService}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){const n=e.binding&&e.binding.type==="Form"&&e.binding.field;if(n){if(!this.designViewModelField){const s=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=s.fields.find(d=>d.id===n)}e.updateOn=this.designViewModelField.updateOn}}changeFieldEditorType(e,n){}getBasicPropConfig(e){var s,d;var n=this;return this.setDesignViewModelField(e),{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:de.getEditorTypesByMDataType(((d=(s=n.designViewModelField)==null?void 0:s.type)==null?void 0:d.name)||""),editable:!1}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"}},setPropertyRelates(f,b){if(f)switch(f&&f.propertyID){case"type":{n.changeControlType(e,f);break}}}}}changeControlType(e,n){var y,T,p,c,m;const s=n.propertyValue,d=this.formSchemaUtils.getComponentById(this.componentId);let f=this.getControlParentContainer(e.id,d);if(!f)return;const b=f.contents.findIndex(a=>a.id===e.id),P=f.contents[b];let M;this.designViewModelField&&(this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,{editor:{$type:s},name:this.designViewModelField.name,require:this.designViewModelField.require,readonly:this.designViewModelField.readonly},!1),M=this.controlCreatorUtils.setFormFieldProperty("Form",this.designViewModelField,null,s)),Object.assign(M,{id:P.id,appearance:P.appearance,size:P.size,label:P.label}),Object.assign(M.editor,{isTextArea:M.isTextArea&&P.isTextArea,type:s||"",placeHolder:(y=P.editor)==null?void 0:y.placeHolder,holdPlace:(T=P.editor)==null?void 0:T.holdPlace,readonly:(p=P.editor)==null?void 0:p.readonly,require:(c=P.editor)==null?void 0:c.require,visible:(m=P.editor)==null?void 0:m.visible}),f.contents.splice(b,1,M)}getAppearanceConfig(e=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(e,n){let s;if(!n||!n.contents||n.contents.length===0)return null;for(const d of n.contents){if(d.id===e)return s=n,n;if(s=this.getControlParentContainer(e,d),s)return s}}getBindingFieldEditorOptions(e){const n=this.formSchemaUtils.getFormMetadataBasicInfo();return{type:"field-selector",bindingType:{enable:!1},editorParams:{propertyData:e,formBasicInfo:n},columns:[{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"fieldType",title:"字段类型"}],beforeOpenDialog:s=>{const d=this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);s.instance.loadData(d)},textField:"bindingField"}}}class Le extends Q{constructor(e,n){super(e,n)}getPropertyConfig(e){return this.getBasicPropConfig(e),this.getAppearanceProperties(e),this.propertyConfig}getBasicPropConfig(e){this.propertyConfig.categories.basic={description:"Basic Information",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:"page-header",value:N["page-header"].name}]}},icon:{title:"图标",type:"string",description:"图标"},title:{title:"标题",type:"string",description:"标题"}}}}getAppearanceProperties(e){this.propertyConfig.categories.appearance={title:"样式",description:"Appearance",properties:{class:{title:"class",type:"string",description:""},style:{title:"style",type:"string",description:""}}}}getEventPropConfig(e){const n=[{label:"click",name:"点击事件"}],s=this,d=s.eventsEditorUtils.formProperties(e,s.viewModelId,n);this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:{"data-grid-component-viewmodel":{type:"events-editor",editor:{initialData:d}}},refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(f,b){const P=f.propertyValue;delete e[s.viewModelId],P&&(P.setPropertyRelates=this.setPropertyRelates,s.eventsEditorUtils.saveRelatedParameters(e,s.viewModelId,P.events,P))}}}}function _e(r,e){function n(f){return!1}function s(){return!0}function d(f){return new Le(f,e).getPropertyConfig(r)}return{canAccepts:n,hideNestedPaddingInDesginerView:s,getPropsConfig:d}}class ue{constructor(e){I(this,"id","");I(this,"class","btn-secondary");I(this,"icon","");I(this,"groupId","");I(this,"order",-1);I(this,"asDropDownTop",!1);I(this,"text","");I(this,"visible",!0);I(this,"responsed",!1);I(this,"tipsEnable",!1);I(this,"tipsText","");I(this,"width",0);I(this,"onClick",()=>{});I(this,"options");this.options=e;const n=["id","class","icon","groupId","order","asDropDownTop","text","isDP","visible","responsed","width","tipsEnable","tipsText","onClick"];Object.keys(e).filter(s=>n.indexOf(s)>-1).forEach(s=>{this[s]=e[s]})}get enable(){return Object.keys(this.options).indexOf("enable")>-1?this.options.enable:t.computed(()=>!0)}setWidth(e){this.width=parseInt(e,10)}getWidth(){return this.visible?this.width:!1}}class Ue extends ue{constructor(e){super(e)}}function fe(){function r(e){const n=[];return e.reduce((s,d)=>(d.children&&d.children.length>0?s.push(new z(d)):s.push(new Ue(d)),s),n),n}return{buildResponseToolbarItems:r}}const{buildResponseToolbarItems:We}=fe();class z extends ue{constructor(n){super(n);I(this,"placement","");I(this,"dropdownClass","");I(this,"menuClass","");I(this,"split",!1);I(this,"children",[]);I(this,"expanded",!1);const s=["isDP","class","dropdownClass","menuClass","placement","split","expanded"];Object.keys(n).filter(d=>s.indexOf(d)>-1).forEach(d=>{this[d]=n[d]}),n.children&&n.children.length&&(this.children=We(n.children))}}const me=new Map([["buttons","items"]]);function ge(r,e,n){return e}const qe={$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"]},te={$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"]},ye={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:""}}}}},ne={customClass:{type:String,default:""},alignment:{Type:String,default:"right"},items:{Type:Array,default:[]}};Z[te.title]=te,le[ye.title]=ye;const ze=Object.assign({},ne,{componentId:{type:String,default:""}}),oe=J(ne,qe,me,ge),he={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:""}},He=J(he,te,me,ge);function be(){function r(n){const s={"f-icon":!0};if(n.icon){const d=n.icon.trim().split(" ");d&&d.length&&d.reduce((f,b)=>(f[b]=!0,f),s)}return s}function e(n){return!!(n.icon&&n.icon.trim())}return{iconClass:r,shouldShowIcon:e}}function Ge(r){function e(p){const c={"dropdown-menu":!0};if(p.class){const m=p.menuClass.split(" ");m&&m.length&&m.reduce((a,v)=>(a[v]=!0,a),c)}return c}function n(p){const c={disabled:!p.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},m=p.dropdownClass.split(" ");return m&&m.length&&m.reduce((a,v)=>(a[v]=!0,a),c),c}function s(p){const c={disabled:!p.enable,"dropdown-item":!0,"f-rt-btn":!0},m=p.class.split(" ");return m&&m.length&&m.reduce((a,v)=>(a[v]=!0,a),c),c}let d;const f=new Map;function b(p,c,m){var v;((v=p.target)==null?void 0:v.id)===c.id&&p.stopPropagation();const a=m?m.id:"__top_item__";if(c.children&&c.children.length&&(c.expanded=!c.expanded,c.expanded?f.set(a,c):f.delete(a)),f.has(a)&&f.get(a)!==c){const w=f.get(a);w&&(w.expanded=!1)}}function P(p,c){document.body.click(),c.enable&&c.onClick(p,c.id)}function M(p){return p.children.map(c=>c.children&&c.children.length?t.createVNode("li",{class:n(c),id:c.id,onClick:m=>c.enable&&b(m,c,p)},[t.createVNode("span",{id:c.id,class:s(c),onMouseover:m=>c.enable&&b(m,c,p)},[c.text,t.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),d(c,c)]):t.createVNode("li",{class:s(c),id:c.id,onClick:m=>P(m,c),onMouseover:m=>c.enable&&b(m,c,p)},[r.shouldShowIcon(c)&&t.createVNode("i",{class:r.iconClass(c)},null),c.text]))}function y(p,c,m){const a={display:p.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},v=document.getElementsByTagName("body")[0].getClientRects()[0].width,w=c,k=w==null?void 0:w.getClientRects();if(w&&k&&k.length){const{top:A,width:S,left:j,right:F,height:C}=k[0],g=Math.ceil(C+A);a.top=`${g}px`,a.left=`${j}px`;const D=p.id+"_menu",V=c?c.querySelector("#"+D):null;if(V){a.display==="block"&&(V.style.display="block");const u=V.getBoundingClientRect();if(m){a.top=`${A-6}px`;const i=Math.ceil(S+j);a.left=`${i}px`}v-j-S<u.width&&(a.left=`${(m?j:F)-u.width}px`)}}return a}d=function(p,c){var w,k;const m=t.getCurrentInstance(),a=c?c.id:p.id,v=(k=(w=m==null?void 0:m.exposed)==null?void 0:w.elementRef.value)==null?void 0:k.querySelector("#"+a);return t.createVNode("ul",{class:e(p),style:y(p,v,c),id:p.id+"_menu"},[M(p)])};function T(){f.forEach(p=>{p.expanded=!1}),f.clear()}return{renderDropdownMenu:d,clearAllDropDownMenu:T}}function Qe(r,e){const n=t.ref(r.alignment),{renderDropdownMenu:s,clearAllDropDownMenu:d}=Ge(e);function f(T){const p={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":n.value==="right","f-btn-mr":n.value==="left"},c=T.dropdownClass.split(" ");return c&&c.length&&c.reduce((m,a)=>(m[a]=!0,m),p),p}function b(T){const p={btn:!0,disabled:!T.enable,"f-rt-btn":!0,"btn-icontext":!!(T.icon&&T.icon.trim())};if(T.class){const c=T.class.split(" ");c&&c.length&&c.reduce((m,a)=>(m[a]=!0,m),p)}return p}function P(T,p){T.stopPropagation();const c=p.expanded;document.body.click(),p.expanded=!c}function M(T){return t.createVNode("div",{id:T.id,class:f(T)},[t.createVNode("div",{class:b(T),style:"display: flex;padding-right: 0.1rem;border-top-right-radius: 6px;border-bottom-right-radius: 6px",onClick:p=>T.enable&&P(p,T)},[e.shouldShowIcon(T)&&t.createVNode("i",{class:e.iconClass(T)},null),t.createVNode("span",null,[T.text]),t.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(T)])}function y(){d()}return{renderToolbarDropdown:M,clearAllDropDown:y}}const{buildResponseToolbarItems:Ce}=fe(),X=t.defineComponent({name:"FResponseToolbar",props:ne,emits:["click"],setup(r,e){const n=t.ref(Ce(r.items)),s=t.ref(),d=t.ref(),f=t.ref(),b=t.ref(r.alignment),P={id:"__more_buttons__",text:"更多"},M=t.ref(new z(P)),y=be(),T=t.computed(()=>M.value.children.length>0),p=t.computed(()=>{const g={"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0};if(r.customClass){const D=r.customClass.split(" ");D&&D.length&&D.reduce((V,u)=>(V[u]=!0,V),g)}return g}),c=t.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":b.value==="right","justify-content-start":b.value==="left"})),{renderToolbarDropdown:m,clearAllDropDown:a}=Qe(r,y);function v(){n.value.filter(g=>g.children&&g.children.length>0).forEach(g=>{g.expanded=!1}),M.value.expanded=!1,a()}function w(g){const D={btn:!0,"f-rt-btn":!0,"f-btn-ml":b.value==="right","f-btn-mr":b.value==="left","btn-icontext":!!(g.icon&&g.icon.trim())};if(g.class){const V=g.class.split(" ");V&&V.length&&V.reduce((u,i)=>(u[i]=!0,u),D)}return D}function k(g,D){document.body.click(),D.onClick(g,D.id),e.emit("click",g,D.id)}function A(g){return t.createVNode("button",{type:"button",class:w(g),id:g.id,disabled:!g.enable,onClick:D=>k(D,g)},[y.shouldShowIcon(g)&&t.createVNode("i",{class:y.iconClass(g)},null),g.text])}const S=new Map,j=[];function F(g){const D=f.value;let V=g;const u=Array.from(D.children),i=u[u.length-1].id==="__more_buttons__"?u[u.length-1]:null;if(i){const x=i.computedStyleMap().get("margin-left"),B=i.computedStyleMap().get("margin-right"),L=(x?x.value:0)+i.getBoundingClientRect().width+(B?B.value:0);V-=L}const o=u.filter(x=>x.id!=="__more_buttons__");for(const x of o){const B=x.computedStyleMap().get("margin-left"),L=x.computedStyleMap().get("margin-right"),R=(B?B.value:0)+x.getBoundingClientRect().width+(L?L.value:0);V<R?(S.set(x.id,!0),j.push({id:x.id,width:R})):V-=R}if(j.length)for(let x=j.length-1;x>=0;x--){const B=j[x].width;if(V>=B)V-=B,S.delete(j[x].id),j.pop();else break}const l=Object.assign({},M.value);l.children=[];const h=new z(l),E=n.value.reduce((x,B)=>(S.has(B.id)&&h.children.push(B),B.visible=!S.has(B.id),x.push(B),x),[]);M.value=h,n.value=E}const C=new ResizeObserver(g=>{if(g.length){const V=g[0].contentRect.width,i=f.value.getBoundingClientRect().width;(V<i||j.length)&&(F(V),v())}});return t.onMounted(()=>{const g=d.value;C.observe(g),document.body.addEventListener("click",v),document.body.addEventListener("wheel",v)}),t.onUnmounted(()=>{C.disconnect(),document.body.removeEventListener("click",v),document.body.removeEventListener("wheel",v)}),t.watch(()=>r.items,()=>{n.value=Ce(r.items)},{deep:!0}),e.expose({elementRef:s}),()=>t.createVNode("div",{class:p.value,ref:s},[t.createVNode("div",{ref:d,class:c.value},[t.createVNode("div",{ref:f,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[n.value.filter(g=>g.visible).map(g=>g.children&&g.children.length>0?m(g):A(g)),T.value&&m(M.value)])])])}});function Xe(r,e){const n=t.inject("design-item-context"),s=t.inject("toolbar-item-handler",()=>{});function d(){s&&s()}function f(i){const o={"dropdown-menu":!0};if(i.class){const l=i.menuClass.split(" ");l&&l.length&&l.reduce((h,E)=>(h[E]=!0,h),o)}return o}function b(i){const o={disabled:!i.enable,"dropdown-submenu":!0,"f-rt-dropdown":!0},l=i.dropdownClass.split(" ");return l&&l.length&&l.reduce((h,E)=>(h[E]=!0,h),o),o}function P(i){const o={disabled:!i.enable,"dropdown-item":!0,"f-rt-btn":!0,"position-relative":!0,"farris-component":!0},l=i.class.split(" ");return l&&l.length&&l.reduce((h,E)=>(h[E]=!0,h),o),o}let M;const y=new Map;function T(i,o,l){var E;((E=i.target)==null?void 0:E.id)===o.id&&i.stopPropagation();const h=l?l.id:"__top_item__";if(o.children&&o.children.length&&(o.expanded=!o.expanded,o.expanded?y.set(h,o):y.delete(h)),y.has(h)&&y.get(h)!==o){const x=y.get(h);x&&(x.expanded=!1)}}function p(i){i&&(i.stopPropagation(),i.preventDefault())}function c(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(o=>o.classList.remove("dgComponentFocused"));const i=document.getElementsByClassName("dgComponentSelected");Array.from(i).forEach(o=>o.classList.remove("dgComponentSelected"))}function m(i){i.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function a(i){const{buttons:o=[]}=n.schema;let l=[];o.forEach(x=>{l=l.concat(x.children||[])});const h=l.findIndex(x=>x.id===i),E=h===-1?null:l[h];return{index:h,item:E}}function v(i){const{buttons:o=[]}=n.schema,l=o.findIndex(E=>E.id===i),h=l===-1?null:o[l];return{index:l,item:h}}function w(i){var h;n.schema;const{index:o,item:l}=a(i);(h=n==null?void 0:n.setupContext)==null||h.emit("selectionChange",l==null?void 0:l.type,l)}const k=function(i){const{componentType:o}=i,l=U(o,i),h=o.toLowerCase().replace("-","_");return l&&!l.id&&l.type===o&&(l.id=`${h}_${Math.random().toString().slice(2,6)}`),l},A=function(){const i={componentType:"response-toolbar-item",parentComponentInstance:e.value,targetPosition:-1};return k(i)};function S(i,o){p(i),c(),m(i),w(o.id)}function j(i,o,l){p(i);const h=o.id,E=l&&l.id,{buttons:x=[]}=n.schema;if(!E)return;const{index:B}=v(E);if(B===-1)return;const{index:L}=a(h);L!==-1&&(x[B].children.splice(L,1),d())}function F(i,o,l){p(i);const h=l&&l.id,{buttons:E=[]}=n.schema;if(!h)return;const{index:x}=v(h);if(x===-1)return;const B=A(),L=Object.assign({},B,{text:o.text});E[x].children.push(L),d()}function C(i,o,l){p(i);const h=l&&l.id,{buttons:E=[]}=n.schema;if(!h)return;const{index:x}=v(h);if(x===-1)return;const B=A(),L=Object.assign({},B,{text:"按钮"});E[x].children.push(L),d()}function g(i,o){return t.createVNode("div",{class:"component-btn-group"},[t.createVNode("div",null,[t.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:l=>j(l,i,o)},[t.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),t.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:l=>F(l,i,o)},[t.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),t.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增同级",ref:"appendSame",style:"width:85px!important;padding:0 5px;position:static;",onClick:l=>C(l,i,o)},[t.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),t.createVNode("span",{style:"font-size:13px;margin:auto"},[t.createTextVNode("新增同级")])])])])}function D(i){return i.children.map(o=>o.children&&o.children.length?t.createVNode("li",{class:b(o),id:o.id,onClick:l=>o.enable&&T(l,o,i)},[t.createVNode("span",{id:o.id,class:P(o),onMouseover:l=>o.enable&&T(l,o,i)},[o.text,t.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right",style:"display: inline-block;float: right;line-height: 1.25rem;"},null)]),M(o,o)]):t.createVNode("li",{class:P(o),id:o.id,onClick:l=>S(l,o)},[g(o,i),r.shouldShowIcon(o)&&t.createVNode("i",{class:r.iconClass(o)},null),o.text]))}function V(i,o,l){const h={display:i.expanded?"block":"none",position:"fixed",maxWidth:"300px",width:"auto",minWidth:"120px"},E=document.getElementsByTagName("body")[0].getClientRects()[0].width,x=o,B=x==null?void 0:x.getClientRects();if(x&&B&&B.length){const{top:L,width:R,left:O,right:_,height:W}=B[0],ie=Math.ceil(W+L);h.top=`${ie}px`,h.left=`${O}px`;const dt=i.id+"_menu",se=o?o.querySelector("#"+dt):null;if(se){h.display==="block"&&(se.style.display="block");const Me=se.getBoundingClientRect();if(l){h.top=`${L-6}px`;const ut=Math.ceil(R+O);h.left=`${ut}px`}E-O-R<Me.width&&(h.left=`${(l?O:_)-Me.width}px`)}}return h}M=function(i,o){var x,B;const l=t.getCurrentInstance(),h=o?o.id:i.id,E=(B=(x=l==null?void 0:l.exposed)==null?void 0:x.elementRef.value)==null?void 0:B.querySelector("#"+h);return t.createVNode("ul",{class:f(i),style:V(i,E,o),id:i.id+"_menu"},[D(i)])};function u(){y.forEach(i=>{i.expanded=!1}),y.clear()}return{renderDropdownMenu:M,clearAllDropDownMenu:u}}function Ye(r,e,n){const s=t.ref(r.alignment),{renderDropdownMenu:d,clearAllDropDownMenu:f}=Xe(e,n),b=t.inject("design-item-context"),P=t.inject("toolbar-item-handler",()=>{});function M(){P&&P()}function y(u){const i={"btn-group":!0,"f-rt-dropdown":!0,"f-btn-ml":s.value==="right","f-btn-mr":s.value==="left"},o=u.dropdownClass.split(" ");return o&&o.length&&o.reduce((l,h)=>(l[h]=!0,l),i),i}function T(u){const i={btn:!0,disabled:!u.enable,"position-relative":!0,"farris-component":!0,"f-rt-btn":!0,"btn-icontext":!!(u.icon&&u.icon.trim())};if(u.class){const o=u.class.split(" ");o&&o.length&&o.reduce((l,h)=>(l[h]=!0,l),i)}return i}function p(u){u&&(u.stopPropagation(),u.preventDefault())}function c(u,i){p(u);const o=i.expanded;document.body.click(),i.expanded=!o}const m=function(u){const{componentType:i}=u,o=U(i,u),l=i.toLowerCase().replace("-","_");return o&&!o.id&&o.type===i&&(o.id=`${l}_${Math.random().toString().slice(2,6)}`),o},a=function(){const u={componentType:"response-toolbar-item",parentComponentInstance:n.value,targetPosition:-1};return m(u)};function v(u){const i=b.schema.buttons||b.schema.contents,o=i==null?void 0:i.findIndex(h=>h.id===u),l=o===-1?null:i[o];return{index:o,toolbarItem:l}}function w(u,i){var B;const{index:o,toolbarItem:l}=v(i);if(o===-1)return;const h=l.text||"按钮",E=a(),x=Object.assign({},E,{text:h});(B=b.schema.buttons)==null||B.push(x),M()}function k(u,i){const{index:o,toolbarItem:l}=v(i);if(o===-1)return;const h=l.text||"按钮",E=a(),x=Object.assign({},E,{text:h}),B=b.schema.buttons[o].children||[];B.push(x),b.schema.buttons[o].children=B,M()}function A(u,i){const o=b.schema.buttons||b.schema.contents,l=o==null?void 0:o.findIndex(h=>h.id===i);l!==-1&&(o.splice(l,1),M())}function S(u){return t.createVNode("div",{class:"component-btn-group"},[t.createVNode("div",null,[t.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeButton",style:"position:static;",onClick:i=>A(i,u)},[t.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)]),t.createVNode("div",{role:"button",class:"btn component-settings-button",title:"复制",ref:"copyButton",style:"position:static;",onClick:i=>w(i,u)},[t.createVNode("i",{class:"f-icon f-icon-yxs_copy"},null)]),t.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增子级",ref:"appendChildButton",style:"width:85px!important;padding:0 5px;position:static;",onClick:i=>k(i,u)},[t.createVNode("i",{class:"f-icon f-icon-plus-circle text-white mr-1"},null),t.createVNode("span",{style:"font-size:13px;margin:auto"},[t.createTextVNode("新增子级")])])])])}function j(){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(i=>i.classList.remove("dgComponentFocused"));const u=document.getElementsByClassName("dgComponentSelected");Array.from(u).forEach(i=>i.classList.remove("dgComponentSelected"))}function F(u){u.currentTarget.classList.add("dgComponentFocused","dgComponentSelected")}function C(u){var h;const i=b.schema.buttons||b.schema.contents,o=i==null?void 0:i.findIndex(E=>E.id===u);if(o===-1)return;const l=i[o];(h=b==null?void 0:b.setupContext)==null||h.emit("selectionChange","response-toolbar-item",l)}function g(u,i){p(u),j(),F(u),p(u),c(u,i),C(i.id)}function D(u){return t.createVNode("div",{id:u.id,class:y(u)},[t.createVNode("div",{class:T(u),style:"display: flex;padding-right: 0.1rem;",onClick:i=>u.enable&&g(i,u)},[S(u.id),e.shouldShowIcon(u)&&t.createVNode("i",{class:e.iconClass(u)},null),t.createVNode("span",null,[u.text]),t.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)]),d(u)])}function V(){f()}return{renderToolbarDropdown:D,clearAllDropDown:V}}function Ze(){function r(e){var d,f;if(!e)return!1;const n=((d=e.targetContainer)==null?void 0:d.componentInstance)&&e.targetContainer.componentInstance.value;if(!n)return!1;const s=(f=n.schema.appearance)==null?void 0:f.class;if(e.controlCategory==="input"||e.controlType==="form-group"){const b=n.schema.type,P=(b==="response-form"||b==="content-container")&&s&&s.includes("farris-form");if(n.schema.type!=="response-layout-item"&&!P)return!1}return e.controlType!=="field-set"}return{basalDragulaRuleForContainer:r}}const Ke={$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:[]},re=new Map;function ve(){function r(a,v,w,k){var A;if(typeof w=="number")return((A=k[a])==null?void 0:A.length)===w;if(typeof w=="object"){const S=Object.keys(w)[0],j=w[S];if(S==="not")return Number(k[a].length)!==Number(j);if(S==="moreThan")return Number(k[a].length)>=Number(j);if(S==="lessThan")return Number(k[a].length)<=Number(j)}return!1}function e(a,v,w,k){return typeof w=="boolean"?k.childrenClassList.includes(v)===!!w:!1}function n(a,v,w,k){return typeof w=="boolean"?k.parentClassList.includes(v)===!!w:!1}function s(a,v,w,k){return typeof w=="boolean"?k.parentClassList.includes(v)===!!w:!1}const d=new Map([["length",r],["hasChildren",e],["hasSibling",s],["hasParent",n]]);function f(a,v){const w=a;return typeof v=="number"?[{target:w,operator:"length",param:null,value:Number(v)}]:typeof v=="object"?Object.keys(v).map(k=>{if(k==="length")return{target:w,operator:"length",param:null,value:v[k]};const A=k,S=v[k];return{target:w,operator:a==="children"?"hasChildren":a==="parent"?"hasParent":"hasSibling",param:A,value:S}}):[]}function b(a,v){if(d.has(a.operator)){const w=d.get(a.operator);return w&&w(a.target,a.param,a.value,v)||!1}return!1}function P(a,v){return Object.keys(a).reduce((S,j)=>{const F=f(j,a[j]);return S.push(...F),S},[]).reduce((S,j)=>S&&b(j,v),!0)}function M(a,v){const w=Object.keys(a),k=w.includes("allOf"),A=w.includes("anyOf"),S=k||A,C=(S?a[S?k?"allOf":"anyOf":"allOf"]:[a]).map(D=>P(D,v));return k?!C.includes(!1):C.includes(!0)}function y(a,v){const w=a.const;return w?typeof w=="boolean"?w:typeof w=="object"?M(w,v):!1:!1}function T(a){return v=>{const w={canAccept:!0,fixed:!1,hidePadding:!1};return a&&a.properties&&Object.keys(a.properties).reduce((k,A)=>{const S=a.properties[A];return k[A]=y(S,v),k},w),w}}function p(a,v,w){if(v.type==="object"&&v.properties){const{rules:k,contents:A}=v.properties;w.set(a,T(k)),A&&Object.keys(A.properties).forEach(S=>p(S,A.properties[S],w))}}function c(){const{properties:a}=Ke;Object.keys(a).forEach(v=>{p(v,a[v],re)})}function m(a,v){const w={canAccept:!0,fixed:!1,hidePadding:!0};return re.has(a)?re.get(a)(v):w}return c(),{getRuleValue:m}}class Je extends Q{constructor(e,n){super(e,n)}getPropertyConfig(e){return this.getBasicPropConfig(e),this.getBehaviorProperties(e),this.propertyConfig}getBasicPropConfig(e){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:N["response-toolbar"].name}]}}}}}getBehaviorProperties(e){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 et(r,e,n,s){const d=ve(),f=t.ref(!1),b=t.ref(!1);let P=!0,M=!1,y;function T(C){return y&&y.componentClassList&&y.componentClassList.includes("f-form-layout")&&y.componentClassList.includes("farris-form")?C.sourceType==="control"&&C.controlCategory==="input"||C.sourceType==="move"&&C.controlType==="form-group":!0}function p(C){return!Ze().basalDragulaRuleForContainer(C)||!P||!T(C),!1}function c(){f.value=!1,b.value=!1;const C=r,g=C.appearance&&C.appearance.class||"",D=g.split(" "),V=C.buttons||[],u=V.length?V[0]:null,i=u&&u.appearance?u.appearance.class:"",o=i?i.split(" "):[],l=V.length?V.reduce((O,_)=>{const W=_&&_.appearance?_.appearance.class:"",ie=W?W.split(" "):[];return O.push(...ie),O},[]):[],h=n==null?void 0:n.schema,E=h&&h.appearance&&h.appearance.class||"",x=E?E.split(" "):[];y={componentClass:g,componentClassList:D,childContents:V,firstChildContent:u,firstChildClass:i,firstChildClassList:o,parent:h,parentClass:E,parentClassList:x,children:V,childrenClassList:l};const{canAccept:B,fixed:L,hidePadding:R}=d.getRuleValue(D[0],y);return P=B,M=R,!0}function m(C){}function a(){return r.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function v(C,g){return g.text=C.label,g}function w(C,g,D){const V=r;if((V.appearance&&V.appearance.class||"").split(" ").includes("f-form-layout")){const o=String(C.innerText),l=U("form-group");return l.editor=D,l.label=o,l}return D}function k(){return!1}function A(){return!1}function S(){return!0}function j(){return M}function F(C){return new Je(C,e).getPropertyConfig(r)}return{canAccepts:p,checkCanAddComponent:S,checkCanDeleteComponent:A,checkCanMoveComponent:k,getStyles:a,hideNestedPaddingInDesginerView:j,onAcceptNewChildElement:w,onAcceptMovedChildElement:m,onResolveNewComponentSchema:v,resolveComponentContext:c,getPropsConfig:F,triggerBelongedComponentToMoveWhenMoved:f,triggerBelongedComponentToDeleteWhenDeleted:b}}const tt={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}},Y=t.ref(0);function nt(r,e){const n=e.getBoundingClientRect(),s=r.getBoundingClientRect(),d=s.top>=n.top,f=s.top<=n.bottom;return d&&f}function ot(r){if(!r)return;let e;if(r.className.includes("dgComponentSelected")?e=r:e=r.querySelector(".dgComponentSelected"),!e)return;const n=e.getBoundingClientRect();if(n.width===0&&n.height===0)return;const s=e.querySelector(".component-btn-group");if(s){if(!nt(e,r)){s.style.display="none";return}s.style.display="";const f=s.getBoundingClientRect(),b=s.querySelector("div");if(b){const P=b.getBoundingClientRect();b.style.top=f.top+"px",b.style.left=f.left-P.width+"px"}}}function rt(r,e,n){var F;function s(){}const d="",f=t.ref();function b(){return!0}function P(){return!1}function M(){return!0}function y(){return!0}function T(){return!0}function p(C){if(!C||!C.value)return null;const g=t.ref(C==null?void 0:C.value.parent),D=p(g);return D||null}function c(C=e){const{componentInstance:g,designerItemElementRef:D}=C;return!g||!g.value?null:g.value.canMove||g.value.canAdd||g.value.canDelete?D:c(C.parent)}function m(C){return!!n}function a(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function v(){}function w(C,g){}function k(C){const{componentType:g}=C;let D=U(g,C);const V=g.toLowerCase().replace("-","_");return D&&!D.id&&D.type===g&&(D.id=`${V}_${Math.random().toString().slice(2,6)}`),D}function A(C,g){const D=String(C.getAttribute("data-controltype")),V=C.getAttribute("data-feature"),u=V?JSON.parse(V):{};u.parentComponentInstance=f.value;let i=U(D,u);const o=D.toLowerCase().replace("-","_");return i&&!i.id&&i.type===D&&(i.id=`${o}_${Math.random().toString().slice(2,6)}`),i}function S(C){}function j(...C){return[]}return f.value={canMove:b(),canSelectParent:P(),canAdd:y(),canDelete:M(),canNested:!T(),contents:[],elementRef:r,parent:(F=e.parent)==null?void 0:F.componentInstance,schema:e.schema,styles:d,canAccepts:m,getBelongedComponentInstance:p,getDraggableDesignItemElement:c,getDraggingDisplayText:a,getPropConfig:j,getDragScopeElement:v,onAcceptMovedChildElement:w,onAcceptNewChildElement:A,onChildElementMovedOut:S,addNewChildComponentSchema:k,updateDragAndDropRules:s,triggerBelongedComponentToMoveWhenMoved:t.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:t.ref(!1)},f}const we=t.defineComponent({name:"FDesignerInnerItem",props:tt,emits:["selectionChange","addComponent","removeComponent"],setup(r,e){const n=t.ref(r.canMove),s=t.ref(r.canAdd),d=t.ref(r.canDelete),f=t.ref(!1),b=t.ref(r.contentKey),P=t.ref(r.childType),M=t.ref(r.childLabel),y=t.ref(r.modelValue),T=t.ref(""),p=t.ref(),c=t.inject("canvas-dragula"),m=t.ref(),a=t.inject("design-item-context"),v={designerItemElementRef:p,componentInstance:m,schema:y.value,parent:a,setupContext:e};t.provide("design-item-context",v);const w=t.computed(()=>({"farris-component":!0,"flex-fill":r.id=="root-component","position-relative":n.value||d.value,"farris-nested":f.value,"can-move":n.value,"d-none":p.value&&p.value.classList.contains("d-none")})),k=t.computed(()=>{const o={};return T.value&&T.value.split(";").reduce((l,h)=>{const[E,x]=h.split(":");return E&&(l[E]=x),l},o),o});function A(o,l){if(a&&a.schema[b.value]){const h=a.schema[b.value].findIndex(E=>E.id===l.id);if(h>-1){const E=a.schema[b.value].length,x=a.schema[b.value][h%E];a.designerItemElementRef.value.querySelector(`#${x.id}-design-item`),a.schema[b.value].splice(h,1),a.componentInstance.value.updateDragAndDropRules(),Y.value++,e.emit("removeComponent")}}}function S(o){if(m.value.addNewChildComponentSchema){const l={componentType:P.value,label:M.value,parentComponentInstance:m.value,targetPosition:-1},h=m.value.addNewChildComponentSchema(l);y.value[b.value].push(h),e.emit("addComponent")}}function j(){return s.value&&t.createVNode("div",{role:"button",class:"btn component-settings-button",title:"新增",ref:"removeComponent",onClick:o=>{S()}},[t.createVNode("i",{class:"f-icon f-icon-plus-circle"},null)])}function F(o){return d.value&&t.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:t.withModifiers(l=>A(l,o),["stop"])},[t.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function C(){return n.value&&t.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[t.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function g(o){return t.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[t.createVNode("div",null,[j(),C(),F(o)])])}t.watch(()=>r.modelValue,o=>{y.value=o,v.schema=o});function D(o){const l=o.target;ot(l)}function V(){var o,l;(l=(o=y.value)==null?void 0:o.contents)!=null&&l.length&&p.value&&p.value.addEventListener("scroll",D)}function u(){const o=p.value,l=t.ref(o.children[1]);return rt(l,v).value}t.onMounted(()=>{if(p.value){const o=p.value.querySelector(`[data-dragref='${y.value.id}-container']`);m.value=o&&o.componentInstance?o.componentInstance.value:u(),c&&o&&c.attachComponents(o,y.value),f.value=m.value.canNested!==void 0?m.value.canNested:f.value,s.value=m.value.canAdd!==void 0?m.value.canAdd:s.value,d.value=m.value.canDelete!==void 0?m.value.canDelete:d.value,n.value=m.value.canMove!==void 0?m.value.canMove:n.value,T.value=m.value.styles||"",p.value&&(p.value.componentInstance=m,p.value.designItemContext=v)}V(),Y.value++}),t.onBeforeUnmount(()=>{p.value&&p.value.removeEventListener("scroll",D)});function i(o){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(h=>h.classList.remove("dgComponentFocused")),o&&(o.preventDefault(),o.stopPropagation());const l=p.value;if(l){const h=document.getElementsByClassName("dgComponentSelected");if(!(h&&h.length===1&&h[0]===p.value)){Array.from(h).forEach(B=>B.classList.remove("dgComponentSelected")),l.classList.add("dgComponentFocused"),e.emit("selectionChange",y.value.type,y.value,r.componentId,m.value);const x=m.value.getDraggableDesignItemElement(v);x&&x.value&&x.value.classList.add("dgComponentSelected")}}Y.value++}return()=>t.createVNode("div",{id:`${r.id}-design-item`,ref:p,class:w.value,style:k.value,onClick:i},[g(y.value),e.slots.default&&e.slots.default()])}});class it extends Q{constructor(e,n){super(e,n)}getPropertyConfig(e){return this.getBasicPropConfig(e),this.getAppearanceProperties(e),this.getEventPropConfig(e),this.propertyConfig}getBasicPropConfig(e){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(e){this.propertyConfig.categories.appearance={title:"外观",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"}},setPropertyRelates(n,s){}}}getEventPropConfig(e){const n=[{label:"click",name:"点击事件"}];var s=this;const d=s.eventsEditorUtils.formProperties(e,s.viewModelId,n),f={};f[s.viewModelId]={type:"events-editor",editor:{initialData:d}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:f,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(b,P){const M=b.propertyValue;delete e[s.viewModelId],M&&(M.setPropertyRelates=this.setPropertyRelates,s.eventsEditorUtils.saveRelatedParameters(e,s.viewModelId,M.events,M))}}}}class st extends Q{constructor(e,n){super(e,n)}getPropertyConfig(e){return this.getBasicPropConfig(),this.getAppearanceProperties(e),this.getEventPropConfig(e),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:N["response-toolbar-item"].name}]}},text:{title:"文本",type:"string",description:"",refreshPanelAfterChanged:!0},icon:{title:"图标",type:"string",description:""}}}}getAppearanceProperties(e){}getEventPropConfig(e){const n=[{label:"click",name:"点击事件"}],s=this,d=s.eventsEditorUtils.formProperties(e,s.viewModelId,n),f={};f[s.viewModelId]={type:"events-editor",editor:{initialData:d}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:f,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(b,P){const M=b.propertyValue;delete e[s.viewModelId],M&&(M.setPropertyRelates=this.setPropertyRelates,s.eventsEditorUtils.saveRelatedParameters(e,s.viewModelId,M.events,M))}}}}function at(r,e){ve();const n=t.ref(!1),s=t.ref(!1);let d=!1,f=!1;function b(w){return!1}function P(w){}function M(){return""}function y(w,k){return k.text=w.label,k}function T(w,k,A){const S=r.schema;if((S.appearance&&S.appearance.class||"").split(" ").includes("f-form-layout")){const C=String(w.innerText),g=U("form-group");return g.editor=A,g.label=C,g}return A}function p(){return!1}function c(){return!f}function m(){return!1}function a(){return d}function v(w){let k;switch(r.schema.type){case"tab-toolbar-item":k=new it(w,e);break;default:k=new st(w,e)}return k.getPropertyConfig(r.schema)}return{canAccepts:b,checkCanAddComponent:m,checkCanDeleteComponent:c,checkCanMoveComponent:p,getStyles:M,hideNestedPaddingInDesginerView:a,onAcceptNewChildElement:T,onAcceptMovedChildElement:P,onResolveNewComponentSchema:y,getPropsConfig:v,triggerBelongedComponentToMoveWhenMoved:n,triggerBelongedComponentToDeleteWhenDeleted:s}}const Te=t.defineComponent({name:"FResponseToolbarItemDesign",props:he,emits:["Click"],setup(r,e){t.ref(),t.ref();const n=t.ref(r.alignment),s={id:"__more_buttons__",text:"More"},d=t.ref(new z(s));t.computed(()=>d.value.children.length>0);const f=t.ref(),b=t.inject("designer-host-service"),P=t.inject("design-item-context"),M=at(P,b),y=ae.useDesignerInnerComponent(f,P,M);t.inject("toolbar-item-handler",()=>{}),t.onMounted(()=>{f.value.componentInstance=y}),e.expose(y.value);function T(){const m={"f-icon":!0};if(r.icon){const a=r.icon.trim().split(" ");a&&a.length&&a.reduce((v,w)=>(v[w]=!0,v),m)}return m}function p(){return!!(r.icon&&r.icon.trim())}function c(){const m={btn:!0,"f-rt-btn":!0,"f-btn-ml":n.value==="right","f-btn-mr":n.value==="left","btn-icontext":!!(r.icon&&r.icon.trim())};if(r.class){const a=r.class.split(" ");a&&a.length&&a.reduce((v,w)=>(v[w]=!0,v),m)}return m}return t.onMounted(()=>{}),t.onUnmounted(()=>{}),()=>t.createVNode("div",{ref:f,"data-dragref":`${P.schema.id}-container`,class:"farris-component position-relative",style:"display:inline-block!important;"},[t.createVNode("button",{type:"button",class:c(),id:r.id},[p()&&t.createVNode("i",{class:T()},null),r.text])])}}),Se=t.defineComponent({name:"FResponseToolbarDesign",props:ze,emits:["Click"],setup(r,e){const n=t.ref(r.items);let s=new Array(n.value.length).fill(t.ref());const d=t.ref(),f=t.ref(),b=t.ref(r.alignment),P={id:"__more_buttons__",text:"More"},M=t.ref(new z(P)),y=be();t.computed(()=>M.value.children.length>0);const T=t.ref(),p=t.inject("designer-host-service"),c=t.inject("design-item-context"),m=et(c.schema,p,c),a=ae.useDesignerInnerComponent(T,c,m);t.inject("toolbar-item-handler",()=>{}),t.onMounted(()=>{T.value.componentInstance=a}),e.expose(a.value);const v=t.computed(()=>({"f-toolbar":!0,"f-response-toolbar":!0,"position-relative":!0})),w=t.computed(()=>({"d-flex":!0,"flex-nowrap":!0,"justify-content-end":b.value==="right","justify-content-start":b.value==="left"})),{renderToolbarDropdown:k,clearAllDropDown:A}=Ye(r,y,a);function S(){n.value.filter(u=>u.children&&u.children.length>0).forEach(u=>{u.expanded=!1}),M.value.expanded=!1,A()}const j=new Map,F=[];function C(u){const i=f.value;let o=u;const l=Array.from(i.children),h=l[l.length-1].id==="__more_buttons__"?l[l.length-1]:null;if(h){const R=h.computedStyleMap().get("margin-left"),O=h.computedStyleMap().get("margin-right"),_=(R?R.value:0)+h.getBoundingClientRect().width+(O?O.value:0);o-=_}const E=l.filter(R=>R.id!=="__more_buttons__");for(const R of E){const O=R.computedStyleMap().get("margin-left"),_=R.computedStyleMap().get("margin-right"),W=(O?O.value:0)+R.getBoundingClientRect().width+(_?_.value:0);o<W?(j.set(R.id,!0),F.push({id:R.id,width:W})):o-=W}if(F.length)for(let R=F.length-1;R>=0;R--){const O=F[R].width;if(o>=O)o-=O,j.delete(F[R].id),F.pop();else break}const x=Object.assign({},M.value);x.children=[];const B=new z(x),L=n.value.reduce((R,O)=>(j.has(O.id)&&B.children.push(O),O.visible=!j.has(O.id),R.push(O),R),[]);M.value=B,n.value=L}const g=new ResizeObserver(u=>{if(u.length){const o=u[0].contentRect.width,h=f.value.getBoundingClientRect().width;(o<h||F.length)&&C(o)}});t.onMounted(()=>{const u=d.value;g.observe(u),document.body.addEventListener("click",S)}),t.onUnmounted(()=>{g.disconnect(),document.body.removeEventListener("click",S)}),t.watch(()=>r.items,()=>{n.value=r.items},{deep:!0}),t.watch(n,u=>{s=new Array(n.value.length).fill(t.ref())});function D(u,i,o,l){c&&c.setupContext&&c.setupContext.emit("selectionChange",u,i,o,l)}function V(){const u=f.value.querySelector(".dgComponentFocused.dgComponentSelected");u==null||u.classList.remove("dgComponentSelected"),u==null||u.classList.remove("dgComponentFocused")}return()=>t.createVNode("div",{ref:T,"data-dragref":`${c.schema.id}-container`,class:v.value},[t.createVNode("div",{ref:d,class:w.value},[t.createVNode("div",{ref:f,class:"d-inline-block f-response-content",style:"white-space: nowrap;"},[n.value.map((u,i)=>t.createVNode(we,{ref:s[i],class:"p-0 display-inline-block",modelValue:u,"onUpdate:modelValue":o=>u=o,canMove:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",componentId:r.componentId,id:u.id,style:"padding:0 !important;display:inline-block",onSelectionChange:D,onRemoveComponent:V},{default:()=>[t.createVNode(Te,{id:u.id,disable:u.disable,text:u.text,icon:u.icon,componentId:r.componentId},null)]}))])])])}}),Pe=oe;X.register=(r,e,n)=>{r["response-toolbar"]=X,e["response-toolbar"]=oe},X.registerDesigner=(r,e,n)=>{r["response-toolbar"]=Se,e["response-toolbar"]=oe,r["response-toolbar-item"]=Te,e["response-toolbar-item"]=He},xe.withInstall(X);const ct={id:{type:String,default:""},componentId:{type:String,default:""},type:{type:String,default:""},canDelete:{type:Boolean,default:!0},canMove:{type:Boolean,default:!0},canSelectParent:{type:Boolean,default:!0},customButtons:{type:Array,default:[]},customClass:{type:String,default:""},customStyle:{type:String,default:""},modelValue:{type:Object},ignore:{type:Boolean,default:!1}},De=t.defineComponent({name:"FDesignerTemplateItem",props:ct,emits:["selectionChange"],setup(r,e){const n=t.ref(),s=t.computed(()=>({"farris-component":!0}));function d(f){Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(P=>P.classList.remove("dgComponentFocused")),f&&(f.preventDefault(),f.stopPropagation());const b=n.value;if(b){const P=document.getElementsByClassName("dgComponentSelected");P&&P.length===1&&P[0]===n.value||(Array.from(P).forEach(y=>y.classList.remove("dgComponentSelected")),b.classList.add("dgComponentFocused"))}Y.value++}return()=>t.createVNode("div",{id:`${r.id}-design-item`,ref:n,class:s.value,onClick:d},[e.slots.default&&e.slots.default()])}}),lt=t.defineComponent({name:"FPageHeaderDesign",props:pe,emits:["Click"],setup(r,e){const n=t.ref(),s=t.inject("designer-host-service"),d=t.inject("design-item-context"),f=_e(d.schema,s),b=$e(n,d,f),P=t.ref(d.schema.toolbar||{type:"response-toolbar",buttons:[]}),M=t.ref(Pe(P.value));t.onMounted(()=>{n.value.componentInstance=b}),t.watch(()=>d.schema.toolbar,()=>{P.value=d.schema.toolbar||{type:"response-toolbar",buttons:[]},M.value=Pe(P.value)},{deep:!0});const y=t.computed(()=>[...M.value.items]);function T(p,c,m,a){d&&d.setupContext&&d.setupContext.emit("selectionChange",p,c,m,a)}return e.expose(b.value),()=>t.createVNode("div",{ref:n},[t.createVNode("nav",{class:"f-page-header-base"},[t.createVNode("div",{class:"f-title"},[t.createVNode(De,null,{default:()=>[t.createVNode("span",{class:"f-title-icon f-text-orna-manage"},[t.createVNode("i",{class:r.icon},null)])]}),t.createVNode(De,null,{default:()=>[t.createVNode("h4",{class:"f-title-text"},[r.title])]})]),t.createVNode(we,{class:"col-5",modelValue:P.value,"onUpdate:modelValue":p=>P.value=p,canAdd:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",id:P.value.id,componentId:r.componentId,onSelectionChange:T},{default:()=>[t.createVNode(Se,{items:y.value,componentId:r.componentId},null)]})])])}}),pt={install(r){r.component(G.name,G)},register(r,e,n,s){r["page-header"]=G,e["page-header"]=ee},registerDesigner(r,e,n){r["page-header"]=lt,e["page-header"]=ee}};$.PageHeader=G,$.default=pt,$.pageHeaderDesignerProps=pe,$.pageHeaderProps=H,$.propsResolver=ee,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(M,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("@farris/ui-vue/components/common")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","@farris/ui-vue/components/common"],e):(M=typeof globalThis<"u"?globalThis:M||self,e(M.pagination={},M.Vue,M.LodashES,M.common))})(this,function(M,e,ae,re){"use strict";const X={},Y={};function _(o){const{properties:t,title:n}=o,u=Object.keys(t).reduce((r,m)=>(r[m]=t[m].type==="object"&&t[m].properties?_(t[m]):ae.cloneDeep(t[m].default),r),{});return u.id=`${n}-${Date.now()}`,u}function B(o,t={}){const n=X[o];if(n){let u=_(n);const r=Y[o];return u=r?r({getSchemaByType:B},u,t):u,u}return null}function se(o,t){const n=_(t);return Object.keys(o).reduce((u,r)=>(u[r]=o[r],u),n),n}function ce(o,t){return Object.keys(o).filter(u=>o[u]!=null).reduce((u,r)=>{if(t.has(r)){const m=t.get(r);if(typeof m=="string")u[m]=o[r];else{const a=m(r,o[r],o);Object.assign(u,a)}}else u[r]=o[r];return u},{})}function le(o,t,n=new Map){const u=se(o,t);return ce(u,n)}function ie(o={}){function t(f,g,b,y){if(typeof b=="number")return y[f].length===b;if(typeof b=="object"){const P=Object.keys(b)[0],l=b[P];if(P==="not")return Number(y[f].length)!==Number(l);if(P==="moreThan")return Number(y[f].length)>=Number(l);if(P==="lessThan")return Number(y[f].length)<=Number(l)}return!1}function n(f,g,b,y){return y[f]&&y[f].propertyValue&&String(y[f].propertyValue.value)===String(b)}const u=new Map([["length",t],["getProperty",n]]);Object.keys(o).reduce((f,g)=>(f.set(g,o[g]),f),u);function r(f,g){const b=f;return typeof g=="number"?[{target:b,operator:"length",param:null,value:Number(g)}]:typeof g=="boolean"?[{target:b,operator:"getProperty",param:f,value:!!g}]:typeof g=="object"?Object.keys(g).map(y=>{if(y==="length")return{target:b,operator:"length",param:null,value:g[y]};const P=y,l=g[y];return{target:b,operator:"getProperty",param:P,value:l}}):[]}function m(f){return Object.keys(f).reduce((b,y)=>{const P=r(y,f[y]);return b.push(...P),b},[])}function a(f,g){if(u.has(f.operator)){const b=u.get(f.operator);return b&&b(f.target,f.param,f.value,g)||!1}return!1}function s(f,g){return m(f).reduce((P,l)=>P&&a(l,g),!0)}function i(f,g){const b=Object.keys(f),y=b.includes("allOf"),P=b.includes("anyOf"),l=y||P,h=(l?f[l?y?"allOf":"anyOf":"allOf"]:[f]).map(j=>s(j,g));return y?!h.includes(!1):h.includes(!0)}return{parseValueSchema:i}}const pe={},ue={};ie();function fe(o,t,n=new Map,u=(a,s,i)=>s,r={},m=a=>a){return X[t.title]=t,Y[t.title]=u,pe[t.title]=r,ue[t.title]=m,(a={})=>{const s=le(a,t,n),i=Object.keys(o).reduce((f,g)=>(f[g]=o[g].default,f),{});return Object.assign(i,s)}}function de(o,t){return{customClass:t.class,customStyle:t.style}}const me=new Map([["appearance",de]]),ge={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/pagination.schema.json",title:"pagination",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a pagination",type:"string"},type:{description:"The type string of pagination component",type:"string",default:"pagination"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]},he={title:"pagination",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{editable:{description:"",title:"允许编辑",type:"boolean"},readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"},textAlign:{description:"",title:"对齐方式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"left",name:"左对齐"},{value:"center",name:"居中对齐"},{value:"right",name:"右对齐"}]}}}}}};function ye(o,t,n){return t}const G={currentPage:{type:Number,default:1},mode:{type:String,default:"default"},pageSize:{type:Number,default:20},totalItems:{type:Number,default:0},showPageList:{type:Boolean,default:!0},showPageNumbers:{type:Boolean,default:!0},showRedirection:{type:Boolean,default:!0},pageList:{type:Array,default:[20,50,100]}},H=fe(G,ge,me,ye,he);function Z(o,t){const n=e.ref("跳转至"),u=e.ref(""),r=e.ref(o.value);e.watch(r,(i,f)=>{i>=1&&i<=t.value?o.value=i:r.value=f}),e.watch(o,i=>{r.value!==i&&(r.value=i)});function m(i){r.value=i.target.valueAsNumber}function a(i){i.key==="Enter"&&(r.value=i.target.valueAsNumber)}function s(){return e.createVNode("li",{class:"page-goto-input d-flex flex-row",style:"padding-left: 10px; white-space: nowrap;"},[e.createVNode("span",{class:"pg-message-text"},[n.value]),e.createVNode("input",{type:"number",class:"form-control farris-gotopagenumber",value:r.value,min:"1",max:t.value,style:"display: inline-block;margin-left:3px;",onBlur:i=>m(i),onKeyup:i=>a(i)},null),u.value])}return{renderGotoButton:s}}function I(o,t,n){const u=e.computed(()=>({"page-item":!0,disabled:t.value}));function r(i){o.value=o.value<n.value?o.value+1:n.value}function m(i){o.value=n.value}function a(){return e.createVNode("li",{class:u.value},[!t.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:i=>r()},[e.createVNode("span",{class:"f-icon f-page-next"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-next"},null)])])}function s(){return e.createVNode("li",{class:u.value},[!t.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:i=>m()},[e.createVNode("span",{class:"f-icon f-page-last"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-last"},null)])])}return{renderLastPage:s,renderNextPage:a}}function K(o,t){const n=e.ref("共"),u=e.ref("条"),r=e.computed(()=>({"pagination-message":!0,"text-truncate":!0,"d-flex":!0,"ml-auto":o.value==="right","flex-fill":o.value==="right"}));function m(){return e.createVNode("li",{class:r.value},[e.createVNode("div",{class:"text-truncate",style:"line-height: 26px"},[e.createVNode("span",{class:"pg-message-text"},[n.value]),e.createVNode("b",{class:"pg-message-total"},[t.value]),e.createVNode("span",{class:"pg-message-text"},[u.value])])])}return{renderPageInfo:m}}function R(o,t,n,u){const r=e.ref(!1),m=e.ref("显示"),a=e.ref("条"),s=e.computed(()=>({dropup:!0,"dropdown-right":!0,"pg-pagelist":!0,"pagelist-disabled":u.value===0,show:r.value})),i=e.computed(()=>({"dropdown-menu":!0,show:r.value})),f=c=>({"w-100":!0,"dropdown-item":!0,active:t.value===c});function g(c){r.value=!0}function b(c){r.value=!1}function y(c,p,h){const j=c*p-p+1;return Math.ceil(j/h)}function P(c,p){o.value=y(o.value,t.value,p),t.value=p,r.value=!1}function l(){return e.createVNode("li",{class:"pagination-pagelist"},[e.createVNode("div",{class:s.value,onMouseenter:c=>g(),onMouseleave:c=>b()},[e.createVNode("div",{class:"pg-pagelist-info"},[e.createVNode("span",{class:"pagelist-text"},[m.value]),e.createVNode("b",{class:"cur-pagesize"},[t.value]),e.createVNode("span",{class:"pagelist-text"},[a.value]),e.createVNode("i",{class:"f-icon f-icon-dropdown"},null)]),e.createVNode("div",{class:i.value,style:"margin-bottom: -1px;"},[n.value.map(c=>e.createVNode("li",{class:f(c),onClick:p=>P(p,c)},[e.createVNode("span",null,[c])]))])])])}return{renderPageList:l}}function ee(o,t){const n=a=>({"page-item":!0,current:o.value===a.value,ellipsis:a.label==="..."}),u=a=>({"f-icon":!0,"f-icon-arrow-seek-left":a.value<o.value,"f-icon-arrow-seek-right":a.value>o.value});function r(a,s){o.value=s}function m(){return t.value.map(a=>e.createVNode("li",{class:n(a)},[o.value!==a.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:s=>r(s,a.value)},[e.createVNode("span",{class:"page-link-label"},[a.label]),a.label==="..."&&e.createVNode("i",{class:u(a)},null)]),o.value===a.value&&e.createVNode("span",{class:"page-link"},[a.label])]))}return{renderPageNumbers:m}}function te(o,t,n){const u=e.computed(()=>({"page-item":!0,disabled:t.value}));function r(i){o.value=1}function m(i){o.value=o.value>2?o.value-1:1}function a(){return e.createVNode("li",{class:u.value},[n.value&&e.createVNode("a",{tabindex:"0",class:"page-link",onClick:i=>r()},[e.createVNode("span",{class:"f-icon f-page-first"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-first"},null)])])}function s(){return e.createVNode("li",{class:u.value},[n.value&&e.createVNode("a",{tabindex:"0",class:"page-link",onClick:i=>m()},[e.createVNode("span",{class:"f-icon f-page-pre"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-pre"},null)])])}return{renderFirstPage:a,renderPreviousPage:s}}function ne(o){const t=e.ref([]);function n(r,m,a,s){const i=Math.ceil(a/2);return r===a?s:r===1?r:a<s?s-i<m?s-a+r:i<m?m-i+r:r:r}function u(r,m,a,s){const i=[],f=Math.ceil(a/m),g=Math.ceil(s/2),b=r<=g,y=f-g<r,P=!b&&!y,l=s<f;let c=1;for(;c<=f&&c<=s;){const p=n(c,r,s,f),h=c===2&&(P||y),C=c===s-1&&(P||b),j=l&&(h||C)?"...":""+p;i.push({label:j,value:p}),c++}t.value=i}return{pages:t,updatePages:u}}const F=e.defineComponent({name:"FPagination",props:G,emits:["pageIndexChanged","pageSizeChanged","update:currentPage","update:pageSize"],setup(o,t){const n=e.ref(!1),u=e.ref(o.mode),r=e.ref(""),m=e.ref(!1),a=e.ref(o.pageSize),s=e.ref(o.currentPage),i=e.ref(o.totalItems),{pages:f,updatePages:g}=ne(),b=e.computed(()=>s.value===1),y=e.computed(()=>o.pageList),P=e.computed(()=>Math.ceil(i.value/a.value)),l=e.computed(()=>s.value===P.value),c=e.computed(()=>o.showGoButton),p=e.computed(()=>s.value>1),h=e.computed(()=>!(m.value&&f.value.length<=1)),C=e.computed(()=>!0),j=e.computed(()=>o.showPageList),T=e.computed(()=>o.showPageNumbers),k=e.computed(()=>!0),{renderFirstPage:N,renderPreviousPage:V}=te(s,b,p),{renderLastPage:d,renderNextPage:v}=I(s,l,P),{renderPageInfo:O}=K(r,i),{renderPageList:w}=R(s,a,y,i),{renderPageNumbers:A}=ee(s,f),{renderGotoButton:$}=Z(s,P);g(s.value,a.value,i.value,7),e.watch(()=>o.totalItems,L=>{i.value=L}),e.watch([s,a,i],()=>{g(s.value,a.value,i.value,7)}),e.watch(s,()=>{t.emit("update:currentPage",s.value),t.emit("pageIndexChanged",s.value)}),e.watch(a,()=>{t.emit("update:pageSize",a.value),t.emit("pageSizeChanged",a.value)}),e.watch(()=>o.totalItems,L=>{i.value=L,g(s.value,a.value,i.value,7)}),e.watchEffect(()=>{const L=y.value.includes(a.value);a.value=L?a.value:y.value[0]})();const D=e.computed(()=>({"ngx-pagination":!0,pagination:!0,responsive:n.value,"pager-viewmode-default":u.value==="default","pager-viewmode-simple":u.value==="simple"})),x=e.computed(()=>({position:"relative","justify-content":r.value==="center"?"center":"start"}));function E(){return e.createVNode(e.Fragment,null,[C.value&&O(),j.value&&w(),k.value&&N(),k.value&&V(),T.value&&A(),k.value&&v(),k.value&&d(),c.value&&$()])}function z(){return e.createVNode(e.Fragment,null,[e.createVNode("li",{class:"page-item d-flex flex-fill"},null),k.value&&N(),k.value&&V(),$(),e.createVNode("li",{class:"page-item page-separator",style:"margin-left: 10px"},[e.createVNode("span",{style:"font-size: 15px; font-weight: 200;"},[e.createTextVNode(" /")])]),e.createVNode("li",{class:"page-item page-total",style:"margin-left: 5px"},[e.createVNode("span",{style:"font-size: 16px; font-weight: 600;"},[e.createTextVNode(" "),P.value])]),k.value&&v(),k.value&&d()])}return()=>e.createVNode("div",{class:"pagination-container"},[h.value&&e.createVNode("ul",{role:"navigation",class:D.value,style:x.value},[u.value==="default"?E():z()])])}});function be(o,t,n){var k;function u(){n!=null&&n.resolveComponentContext&&n.resolveComponentContext()}u();const r=n&&n.getStyles&&n.getStyles()||"",m=n&&n.getDesignerClass&&n.getDesignerClass()||"",a=e.ref();function s(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function i(){return!1}function f(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function g(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function b(N){if(!N||!N.value)return null;if(N.value.schema&&N.value.schema.type==="component")return N.value;const V=e.ref(N==null?void 0:N.value.parent),d=b(V);return d||null}function y(N=t){const{componentInstance:V,designerItemElementRef:d}=N;return!V||!V.value?null:V.value.canMove?d:y(N.parent)}function P(N){return!!n&&n.canAccepts(N)}function l(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function c(){}function p(N,V){V&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(V)}function h(N){const{componentType:V}=N;let d=B(V,N);n&&n.onResolveNewComponentSchema&&(d=n.onResolveNewComponentSchema(N,d));const v=V.toLowerCase().replace("-","_");return d&&!d.id&&d.type===V&&(d.id=`${v}_${Math.random().toString().slice(2,6)}`),d}function C(N,V){const d=String(N.getAttribute("data-controltype")),v=N.getAttribute("data-feature"),O=v?JSON.parse(v):{};O.parentComponentInstance=a.value;let w=B(d,O);n&&n.onAcceptNewChildElement&&(w=n.onAcceptNewChildElement(N,V,w));const A=d.toLowerCase().replace("-","_");return w&&!w.id&&w.type===d&&(w.id=`${A}_${Math.random().toString().slice(2,6)}`),w}function j(N){}function T(...N){if(n&&n.getPropsConfig)return n.getPropsConfig(...N)}return a.value={canMove:s(),canSelectParent:i(),canDelete:f(),canNested:!g(),contents:t==null?void 0:t.schema.contents,elementRef:o,parent:(k=t==null?void 0:t.parent)==null?void 0:k.componentInstance,schema:t==null?void 0:t.schema,styles:r,designerClass:m,canAccepts:P,getBelongedComponentInstance:b,getDraggableDesignItemElement:y,getDraggingDisplayText:l,getPropConfig:T,getDragScopeElement:c,onAcceptMovedChildElement:p,onAcceptNewChildElement:C,onChildElementMovedOut:j,addNewChildComponentSchema:h,updateDragAndDropRules:u,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1)},a}function ve(){function o(t){var r,m;if(!t)return!1;const n=((r=t.targetContainer)==null?void 0:r.componentInstance)&&t.targetContainer.componentInstance.value;if(!n)return!1;const u=(m=n.schema.appearance)==null?void 0:m.class;if(t.controlCategory==="input"||t.controlType==="form-group"){const a=n.schema.type,s=(a==="response-form"||a==="content-container")&&u&&u.includes("farris-form");if(n.schema.type!=="response-layout-item"&&!s)return!1}return t.controlType!=="field-set"}return{basalDragulaRuleForContainer:o}}const Ne={$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:[]},J=new Map;function je(){function o(l,c,p,h){var C;if(typeof p=="number")return((C=h[l])==null?void 0:C.length)===p;if(typeof p=="object"){const j=Object.keys(p)[0],T=p[j];if(j==="not")return Number(h[l].length)!==Number(T);if(j==="moreThan")return Number(h[l].length)>=Number(T);if(j==="lessThan")return Number(h[l].length)<=Number(T)}return!1}function t(l,c,p,h){return typeof p=="boolean"?h.childrenClassList.includes(c)===!!p:!1}function n(l,c,p,h){return typeof p=="boolean"?h.parentClassList.includes(c)===!!p:!1}function u(l,c,p,h){return typeof p=="boolean"?h.parentClassList.includes(c)===!!p:!1}const r=new Map([["length",o],["hasChildren",t],["hasSibling",u],["hasParent",n]]);function m(l,c){const p=l;return typeof c=="number"?[{target:p,operator:"length",param:null,value:Number(c)}]:typeof c=="object"?Object.keys(c).map(h=>{if(h==="length")return{target:p,operator:"length",param:null,value:c[h]};const C=h,j=c[h];return{target:p,operator:l==="children"?"hasChildren":l==="parent"?"hasParent":"hasSibling",param:C,value:j}}):[]}function a(l,c){if(r.has(l.operator)){const p=r.get(l.operator);return p&&p(l.target,l.param,l.value,c)||!1}return!1}function s(l,c){return Object.keys(l).reduce((j,T)=>{const k=m(T,l[T]);return j.push(...k),j},[]).reduce((j,T)=>j&&a(T,c),!0)}function i(l,c){const p=Object.keys(l),h=p.includes("allOf"),C=p.includes("anyOf"),j=h||C,N=(j?l[j?h?"allOf":"anyOf":"allOf"]:[l]).map(d=>s(d,c));return h?!N.includes(!1):N.includes(!0)}function f(l,c){const p=l.const;return p?typeof p=="boolean"?p:typeof p=="object"?i(p,c):!1:!1}function g(l){return c=>{const p={canAccept:!0,fixed:!1,hidePadding:!1};return l&&l.properties&&Object.keys(l.properties).reduce((h,C)=>{const j=l.properties[C];return h[C]=f(j,c),h},p),p}}function b(l,c,p){if(c.type==="object"&&c.properties){const{rules:h,contents:C}=c.properties;p.set(l,g(h)),C&&Object.keys(C.properties).forEach(j=>b(j,C.properties[j],p))}}function y(){const{properties:l}=Ne;Object.keys(l).forEach(c=>{b(c,l[c],J)})}function P(l,c){const p={canAccept:!0,fixed:!1,hidePadding:!0};return J.has(l)?J.get(l)(c):p}return y(),{getRuleValue:P}}function Pe(o,t){var V;const n=o.schema,u=(V=o.parent)==null?void 0:V.schema,r=je(),m=e.ref(!1),a=e.ref(!1);let s=!0,i=!1,f,g=!1;function b(d){return f&&f.componentClassList&&f.componentClassList.includes("f-form-layout")&&f.componentClassList.includes("farris-form")?d.sourceType==="control"&&d.controlCategory==="input"||d.sourceType==="move"&&d.controlType==="form-group":!0}function y(d){return!(!ve().basalDragulaRuleForContainer(d)||!s||!b(d))}function P(){m.value=!1,a.value=!1;const d=n,v=d.appearance&&d.appearance.class||"",O=v.split(" "),w=d.contents||[],A=w.length?w[0]:null,$=A&&A.appearance?A.appearance.class:"",S=$?$.split(" "):[],D=w.length?w.reduce((q,W)=>{const oe=W&&W.appearance?W.appearance.class:"",Ve=oe?oe.split(" "):[];return q.push(...Ve),q},[]):[],x=u,E=x&&x.appearance&&x.appearance.class||"",z=E?E.split(" "):[];f={componentClass:v,componentClassList:O,childContents:w,firstChildContent:A,firstChildClass:$,firstChildClassList:S,parent:x,parentClass:E,parentClassList:z,children:w,childrenClassList:D};const{canAccept:L,fixed:Q,hidePadding:U}=r.getRuleValue(O[0],f);return s=L,i=U,g=Q,!0}function l(d){e.nextTick()}function c(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function p(d,v){const O=n;if((O.appearance&&O.appearance.class||"").split(" ").includes("f-form-layout")){const{label:$}=d,S=B("form-group");return S.editor=v,S.label=$,h(S),delete S.editor.id,delete S.editor.binding,delete S.editor.appearance,delete S.editor.visible,S}return v}function h(d){const v=o.componentInstance.value.getBelongedComponentInstance(o.componentInstance);if(v&&v.schema&&v.schema.componentType){const O=v.schema.componentType,w=C(O);d.appearance||(d.appearance={}),d.appearance.class=w}}function C(d){let v="";switch(d){case"form-col-1":{v="col-12 col-md-12 col-xl-12 col-el-12";break}case"form-col-12":{v="col-12 col-md-12 col-xl-12 col-el-12";break}case"form-col-2":{v="col-12 col-md-6 col-xl-6 col-el-6";break}case"form-col-3":{v="col-12 col-md-6 col-xl-4 col-el-4";break}case"form-col-4":{v="col-12 col-md-6 col-xl-3 col-el-2";break}case"form-col-6":{v="col-12 col-md-6 col-xl-6 col-el-6";break}case"frame":{v="col-12";break}}return v}function j(d,v,O){const w=n;if((w.appearance&&w.appearance.class||"").split(" ").includes("f-form-layout")){const S=String(d.innerText),D=B("form-group");return D.editor=O,D.label=S,D}return O}function T(){return!g}function k(){return!g}function N(){return i}return{canAccepts:y,checkCanDeleteComponent:k,checkCanMoveComponent:T,getStyles:c,hideNestedPaddingInDesginerView:N,onAcceptNewChildElement:j,onAcceptMovedChildElement:l,resolveComponentContext:P,onResolveNewComponentSchema:p,triggerBelongedComponentToMoveWhenMoved:m,triggerBelongedComponentToDeleteWhenDeleted:a}}const Ce=e.defineComponent({name:"FPagination",props:G,emits:["pageIndexChanged","pageSizeChanged"],setup(o,t){var q;const n=e.ref(!1),u=e.ref(o.mode),r=e.ref(""),m=e.ref(!1),a=e.ref(o.pageSize),s=e.ref(o.currentPage),i=e.ref(o.totalItems),f=e.ref(),g=e.inject("design-item-context"),b=Pe(g.schema,(q=g.parent)==null?void 0:q.schema),y=be(f,g,b);e.onMounted(()=>{f.value.componentInstance=y}),t.expose(y.value);const{pages:P,updatePages:l}=ne(),c=e.computed(()=>s.value===1),p=e.computed(()=>[20,50,100]),h=e.computed(()=>Math.ceil(i.value/a.value)),C=e.computed(()=>s.value===h.value),j=e.computed(()=>!0),T=e.computed(()=>s.value>1),k=e.computed(()=>!(m.value&&P.value.length<=1)),N=e.computed(()=>!0),V=e.computed(()=>!0),d=e.computed(()=>!0),v=e.computed(()=>!0),{renderFirstPage:O,renderPreviousPage:w}=te(s,c,T),{renderLastPage:A,renderNextPage:$}=I(s,C,h),{renderPageInfo:S}=K(r,i),{renderPageList:D}=R(s,a,p,i),{renderPageNumbers:x}=ee(s,P),{renderGotoButton:E}=Z(s,h);l(s.value,a.value,i.value,7),e.watch([s,a],()=>{l(s.value,a.value,i.value,7)}),e.watch(s,()=>{t.emit("pageIndexChanged",s.value)}),e.watch(a,()=>{t.emit("pageSizeChanged",a.value)});const z=e.computed(()=>({"ngx-pagination":!0,pagination:!0,responsive:n.value,"pager-viewmode-default":u.value==="default","pager-viewmode-simple":u.value==="simple"})),L=e.computed(()=>({position:"relative","justify-content":r.value==="center"?"center":"start"}));function Q(){return e.createVNode(e.Fragment,null,[N.value&&S(),V.value&&D(),v.value&&O(),v.value&&w(),d.value&&x(),v.value&&$(),v.value&&A(),j.value&&E()])}function U(){return e.createVNode(e.Fragment,null,[e.createVNode("li",{class:"page-item d-flex flex-fill"},null),v.value&&O(),v.value&&w(),E(),e.createVNode("li",{class:"page-item page-separator",style:"margin-left: 10px"},[e.createVNode("span",{style:"font-size: 15px; font-weight: 200;"},[e.createTextVNode(" /")])]),e.createVNode("li",{class:"page-item page-total",style:"margin-left: 5px"},[e.createVNode("span",{style:"font-size: 16px; font-weight: 600;"},[e.createTextVNode(" "),h.value])]),v.value&&$(),v.value&&A()])}return()=>e.createVNode("div",{ref:f,class:"pagination-container"},[k.value&&e.createVNode("ul",{role:"navigation",class:z.value,style:L.value},[u.value==="default"?Q():U()])])}});F.register=(o,t,n)=>{o.pagination=F,t.pagination=H},F.registerDesigner=(o,t,n)=>{o.pagination=Ce,t.pagination=H};const we=re.withInstall(F);M.FPagination=F,M.default=we,M.paginationProps=G,M.propsResolver=H,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(m,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(m=typeof globalThis<"u"?globalThis:m||self,t(m.popover={},m.Vue))})(this,function(m,t){"use strict";const $={id:{type:String},title:{type:String},placement:{type:String,default:"bottom"},reference:{type:Object},host:{type:Object},leftBoundary:{type:Object},rightBoundary:{type:Object},visible:{type:Boolean,default:!1},class:{type:String},offsetX:{type:Object,default:t.ref(0)},zIndex:{type:Number,default:-1},keepWidthWithReference:{type:Boolean,default:!1},fitContent:{type:Boolean,default:!1},minWidth:{type:Number,default:-1}};function D(e){const o=e.host?e.host:"body",l=t.computed(()=>o==="body"?0:o?o.getBoundingClientRect().top:0),c=t.computed(()=>o==="body"?0:o?o.getBoundingClientRect().left:0),r=t.computed(()=>o==="body"?document.body.getBoundingClientRect().width:o?o.getBoundingClientRect().width-(e.rightBoundary?e.rightBoundary.getBoundingClientRect().width:0):document.body.getBoundingClientRect().width),f=t.computed(()=>o==="body"?document.body.getBoundingClientRect().height:o?o.getBoundingClientRect().height:document.body.getBoundingClientRect().height);return{host:o,hostLeft:c,hostTop:l,hostWidth:r,hostHeight:f}}function A(e,o,l,c){var H;const r=t.ref(0),f=t.ref(((H=e.offsetX)==null?void 0:H.value)||0),g=t.ref(e.minWidth),a=t.ref(-1),L=t.ref(-1),y=t.ref(e.placement),w=t.ref(0),v=t.ref(0),R=t.ref(0),T=t.ref(document.documentElement.scrollLeft),u=t.ref(document.documentElement.scrollTop),{hostLeft:p,hostTop:k,hostWidth:S,hostHeight:x}=c;t.watch(e.offsetX,n=>{r.value=n-f.value});const N=t.computed(()=>{const n={left:`${v.value}px`,top:`${R.value}px`,transform:`translateX(${r.value}px)`};return e.zIndex!==-1&&(n["z-index"]=e.zIndex),g.value!==-1&&(n.width=`${g.value}px`),n}),C=t.computed(()=>({left:`${w.value}px`}));function b(n){if(n&&e.keepWidthWithReference){const i=n.getBoundingClientRect();g.value=Math.max(e.minWidth,i.width)}}function B(n,i){const s=S.value-n.width-4;return s>0?s:i}function V(n,i){const s=x.value-n.height-4;return s>0?s:i}function j(n,i,s){const d=w.value,h=i.left-p.value+i.width/2+T.value,P=i.top-k.value-(n.height+s.height)+u.value;return{popoverLeft:h,popoverTop:P,arrowLeft:d}}function z(n,i,s){const d=i.top-k.value+(i.height+s.height)+u.value,h=V(n,d);return Math.min(d,h)}function X(n,i){const s=B(i,n),d=n<=s?w.value:n-s;return{popoverLeft:Math.min(n,s),arrowLeft:d}}function U(n,i,s){const d=i.left-p.value+i.width/2-(s.width/2-(n.left-p.value))+T.value,{arrowLeft:h,popoverLeft:P}=X(d,n),W=z(n,i,s);return{popoverLeft:P,popoverTop:W,arrowLeft:h}}function G(n,i,s){const d=i.left-p.value+T.value,{arrowLeft:h,popoverLeft:P}=X(d,n),W=z(n,i,s);return{popoverLeft:P,popoverTop:W,arrowLeft:h}}const J=new Map([["top",j],["bottom",U],["bottom-left",G]]);function E(n){var P,W;const i=n.getBoundingClientRect();a.value=i.top,L.value=i.left;const s=(P=o.value)==null?void 0:P.getBoundingClientRect(),d=(W=l.value)==null?void 0:W.getBoundingClientRect(),h=J.get(y.value);if(h){const{arrowLeft:Q,popoverLeft:Y,popoverTop:Z}=h(d,i,s);w.value=Q,v.value=Y,R.value=Z}e.keepWidthWithReference&&b(n)}function K(n){if(n){const i=n.getBoundingClientRect();(i.left!==L.value||i.top!==a.value)&&E(n)}}return{arrowStyle:C,popoverStyle:N,position:y,popoverWidth:g,fitToReference:b,followToReferencePosition:K,locateToReference:E}}function F(e,o,l,c,r,f,g){const a=t.ref(e.visible),L=t.computed(()=>a.value),{fitToReference:y,locateToReference:w}=g;let v;function R(){a.value=!1,document.body.removeEventListener("click",v),o.emit("hidden")}v=u=>{if(!r.value.contains(u.target)){const p=r.value.closest(".popover");p&&p.removeEventListener("click",v),R()}};async function T(u){if(c.value&&l.value&&u){a.value=!0,r.value=u,f.value&&y(u),await t.nextTick(),w(u),document.body.addEventListener("click",v);const p=u.closest(".popover");p&&p.addEventListener("click",v),o.emit("shown")}}return o.expose({hide:R,show:T,shown:L}),{showPopover:a,hidePopverOnClickBodyHandler:v}}function _(e,o,l,c,r){const{popoverWidth:f,fitToReference:g,followToReferencePosition:a}=r;function L(){if(l.value){a(l.value);const y=l.value.getBoundingClientRect();c.value&&y.width!==f.value&&g(l.value)}}return{onResize:L}}const O=t.defineComponent({name:"FPopover",props:$,emits:["shown","hidden"],setup(e,o){const l=t.ref(),c=t.ref(),r=t.ref(e.reference),f=t.ref(e.keepWidthWithReference),g=t.computed(()=>!!e.title),a=D(e),{host:L}=a,y=A(e,l,c,a),{position:w,arrowStyle:v,popoverStyle:R,fitToReference:T,locateToReference:u}=y,{showPopover:p,hidePopverOnClickBodyHandler:k}=F(e,o,l,c,r,f,y),{onResize:S}=_(e,o,r,f,y),x=t.computed(()=>{const C=`popover in popover-${w.value}`,b=`bs-popover-${w.value}`,B={"popover-fitcontent":e.fitContent};return B[C]=!0,B[b]=!0,(e.class||"").split(" ").reduce((j,z)=>(j[z]=!0,j),B),B}),N=t.computed(()=>({"popover-content":!0,"popover-body":!0}));return t.onMounted(()=>{e.reference&&u(r.value),f.value&&T(r.value),window.addEventListener("resize",S)}),t.onUnmounted(()=>{document.body.removeEventListener("click",k),window.removeEventListener("resize",S)}),()=>t.createVNode(t.Teleport,{to:L},{default:()=>{var C;return[t.withDirectives(t.createVNode("div",{ref:c,class:x.value,style:R.value,onClick:b=>{b.stopPropagation()}},[t.createVNode("div",{ref:l,class:"popover-arrow arrow",style:v.value},null),g.value&&t.createVNode("h3",{class:"popover-title popover-header"},[e.title]),t.createVNode("div",{class:N.value},[o.slots.default&&((C=o.slots)==null?void 0:C.default())])]),[[t.vShow,p.value]])]}})}});function M(e,o,l){e.stopPropagation();const c=o.value;c&&c.value&&c.value.show(l)}function q(e,o){e.stopPropagation(),o.value.value.hide()}const I={mounted:(e,o,l)=>{o.modifiers.hover?(e.addEventListener("mouseenter",c=>M(c,o,e)),e.addEventListener("mouseleave",c=>q(c,o))):o.modifiers.click?e.addEventListener("click",c=>M(c,o,e)):e.addEventListener("click",c=>M(c,o,e))},unMounted:(e,o,l)=>{}};O.install=e=>{e.component(O.name,O),e.directive("popover",I)},m.Popover=O,m.PopoverDirective=I,m.default=O,m.popoverProps=$,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(function(N,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("lodash-es"),require("@farris/ui-vue/components/common")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","@farris/ui-vue/components/common"],r):(N=typeof globalThis<"u"?globalThis:N||self,r(N.progress={},N.Vue,N.LodashES,N.common))})(this,function(N,r,F,q){"use strict";const R={},A={};function G(e){const{properties:t,title:f}=e,n=Object.keys(t).reduce((o,u)=>(o[u]=t[u].type==="object"&&t[u].properties?G(t[u]):F.cloneDeep(t[u].default),o),{});return n.id=`${f}-${Date.now()}`,n}function W(e,t={}){const f=R[e];if(f){let n=G(f);const o=A[e];return n=o?o({getSchemaByType:W},n,t):n,n}return null}function z(e,t){const f=G(t);return Object.keys(e).reduce((n,o)=>(n[o]=e[o],n),f),f}function _(e,t){return Object.keys(e).filter(n=>e[n]!=null).reduce((n,o)=>{if(t.has(o)){const u=t.get(o);if(typeof u=="string")n[u]=e[o];else{const g=u(o,e[o],e);Object.assign(n,g)}}else n[o]=e[o];return n},{})}function X(e,t,f=new Map){const n=z(e,t);return _(n,f)}function Y(e={}){function t(s,c,l,a){if(typeof l=="number")return a[s].length===l;if(typeof l=="object"){const h=Object.keys(l)[0],b=l[h];if(h==="not")return Number(a[s].length)!==Number(b);if(h==="moreThan")return Number(a[s].length)>=Number(b);if(h==="lessThan")return Number(a[s].length)<=Number(b)}return!1}function f(s,c,l,a){return a[s]&&a[s].propertyValue&&String(a[s].propertyValue.value)===String(l)}const n=new Map([["length",t],["getProperty",f]]);Object.keys(e).reduce((s,c)=>(s.set(c,e[c]),s),n);function o(s,c){const l=s;return typeof c=="number"?[{target:l,operator:"length",param:null,value:Number(c)}]:typeof c=="boolean"?[{target:l,operator:"getProperty",param:s,value:!!c}]:typeof c=="object"?Object.keys(c).map(a=>{if(a==="length")return{target:l,operator:"length",param:null,value:c[a]};const h=a,b=c[a];return{target:l,operator:"getProperty",param:h,value:b}}):[]}function u(s){return Object.keys(s).reduce((l,a)=>{const h=o(a,s[a]);return l.push(...h),l},[])}function g(s,c){if(n.has(s.operator)){const l=n.get(s.operator);return l&&l(s.target,s.param,s.value,c)||!1}return!1}function p(s,c){return u(s).reduce((h,b)=>h&&g(b,c),!0)}function y(s,c){const l=Object.keys(s),a=l.includes("allOf"),h=l.includes("anyOf"),b=a||h,d=(b?s[b?a?"allOf":"anyOf":"allOf"]:[s]).map(S=>p(S,c));return a?!d.includes(!1):d.includes(!0)}return{parseValueSchema:y}}const J={},H={};Y();function Q(e,t,f=new Map,n=(g,p,y)=>p,o={},u=g=>g){return R[t.title]=t,A[t.title]=n,J[t.title]=o,H[t.title]=u,(g={})=>{const p=X(g,t,f),y=Object.keys(e).reduce((s,c)=>(s[c]=e[c].default,s),{});return Object.assign(y,p)}}function U(e,t){return{customClass:t.class,customStyle:t.style}}const Z=new Map([["appearance",U]]);function x(e,t,f){return t}const K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/progress.schema.json",title:"progress",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for progress",type:"string"},type:{description:"The type string of progress",type:"string",default:"progress"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},I={title:"progress",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},E={progressType:{type:String,default:"line"},strokeWidth:{type:Number,default:0},size:{type:String,default:"default"},showInfo:{type:Boolean,default:!0},progressStatus:{type:String,default:"default"},successPercent:{type:Number,default:0},strokeColor:{type:String,default:""},strokeLinecap:{type:String,default:"round"},width:{type:Number,default:100},percent:{type:Number,default:20},enableBackgroundImg:{type:Boolean,default:!1},backgroundImg:{type:String,default:""},gapPosition:{type:String},gapDegree:{type:Number,default:0},format:{type:Function,default:(e,t)=>`${e}%`}},L=Q(E,K,Z,x,I);function ee(e){function t(g){return+g.replace("%","")}function f(g){let p=[];return Object.keys(g).forEach(y=>{const s=g[y],c=t(y);isNaN(c)||p.push({key:c,value:s})}),p=p.sort((y,s)=>y.key-s.key),p}const n=r.computed(()=>!!e.strokeColor&&typeof e.strokeColor!="string"),o=r.computed(()=>{const{from:g="#59a1ff",to:p="#59a1ff",direction:y="to right",...s}=e.strokeColor;if(Object.keys(s).length!==0){const c=f(s).map(({key:l,value:a})=>`${a} ${l}%`).join(", ");return`linear-gradient(${y}, ${c})`}return`linear-gradient(${y}, ${g}, ${p})`}),u=r.computed(()=>f(e.strokeColor).map(({key:g,value:p})=>({offset:`${g}%`,color:p})));return{isGradient:n,linearGradient:o,circleGradient:u}}function re(e){return{strokeWidth:r.computed(()=>e.strokeWidth||(e.progressType==="line"&&e.size!=="small"?8:6))}}function te(e){return{formatPercentageText:r.computed(()=>e.format(e.percent,e.successPercent))}}function se(e,t,f,n){const{isCircleStyle:o}=t,{isGradient:u,linearGradient:g}=f,{strokeWidth:p}=n,y=r.computed(()=>{const d={"f-progress":!0,"f-progress-line":e.progressType==="line","ant-progress-small":e.size==="small","f-progress-show-info":e.showInfo,"f-progress-circle":o.value},P=`f-progress-status-${e.progressStatus}`;return d[P]=!0,d}),s=r.computed(()=>({width:`${e.width}px`,height:`${e.width}px`,"font-size":`${e.width*.15+6}px`,"f-progress-circle-gradient":u.value})),c=r.computed(()=>({"f-progress-inner":!0,"f-progress-circle-gradient":u.value})),l=0,a=r.computed(()=>l+1),h=r.computed(()=>{const d=50-p.value/2,P=e.gapPosition||(e.progressType==="circle"?"top":"bottom");let S=0,$=-d,w=0,i=d*-2;switch(P){case"left":S=-d,$=0,w=d*2,i=0;break;case"right":S=d,$=0,w=d*-2,i=0;break;case"bottom":$=d,i=d*2;break}return`M 50,50 m ${S},${$}
|
|
2
|
-
a ${d},${d} 0 1 1 ${w},${-i}
|
|
3
|
-
a ${d},${d} 0 1 1 ${-w},${i}`}),b=r.computed(()=>{const d=50-p.value/2,P=Math.PI*2*d,S=e.gapDegree||(e.progressType==="circle"?0:75);return{strokeDasharray:`${P-S}px ${P}px`,strokeDashoffset:`-${S/2}px`,transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"}}),O=r.computed(()=>{const d=50-p.value/2,P=Math.PI*2*d,S=e.gapDegree||(e.progressType==="circle"?0:75),$=e.successPercent!==void 0&&e.successPercent!==null?[e.successPercent,e.percent]:[e.percent];return $.map((w,i)=>{const m=$.length===2&&i===0;return{stroke:u.value&&!m?`url(#gradient-${a.value})`:null,strokePathStyle:{stroke:u.value?null:m?"default":e.strokeColor,transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s",strokeDasharray:`${(w||0)/100*(P-S)}px ${P}px`,strokeDashoffset:`-${S/2}px`}}}).reverse()}),j=r.computed(()=>({width:`${e.percent}%`,"border-radius":e.strokeLinecap==="round"?"100px":"0",background:u.value?null:e.strokeColor,"background-image":u.value?g.value:null,height:`${p.value}px`}));return{progressClass:y,inCircleProgressBarStyle:s,inCircleProgressBarClass:c,pathString:h,trailPathStyle:b,progressCirclePaths:O,gradientId:a,inlineProgressBackgroundStyle:j}}function ne(e){return{isCircleStyle:r.computed(()=>e.progressType==="circle"||e.progressType==="dashboard")}}function oe(e){const t=r.computed(()=>{const o={"f-progress-text-icon":!0,"f-icon":!0},u=`f-icon-${e.progressStatus}`;return o[u]=!0,o}),f=r.computed(()=>{const o={"f-progress-text-icon":!0,"f-icon":!0},u=e.progressStatus==="success"?"f-icon-checkmark":"f-icon-x";return o[u]=!0,o}),n=r.computed(()=>e.progressStatus==="error"||e.progressStatus==="success");return{inlineProgrssStatusClass:t,circleProgrssStatusClass:f,shouldShowStatus:n}}function ce(e){const t=r.computed(()=>({width:`${e.successPercent}%`,"border-radius":e.strokeLinecap==="round"?"100px":"0",height:`${e.strokeWidth}px`,"background-image":e.enableBackgroundImg?`url(${e.backgroundImg})`:null})),f=r.computed(()=>e.successPercent||e.successPercent===0);return{inlineProgressSuccessBackgroundStyle:t,shouldShowSuccessInlineProgressBackground:f}}const C=r.defineComponent({name:"FProgress",props:E,emits:[],setup(e){const t=r.ref(e.progressType),f=r.ref(e.showInfo),n=r.ref(e.percent),o=r.ref(e.strokeLinecap),u=ee(e),{isGradient:g,circleGradient:p}=u,y=re(e),{strokeWidth:s}=y,{formatPercentageText:c}=te(e),l=ne(e),{isCircleStyle:a}=l,{progressClass:h,inCircleProgressBarStyle:b,inCircleProgressBarClass:O,pathString:j,trailPathStyle:d,progressCirclePaths:P,gradientId:S,inlineProgressBackgroundStyle:$}=se(e,l,u,y),{inlineProgrssStatusClass:w,circleProgrssStatusClass:i,shouldShowStatus:m}=oe(e),{inlineProgressSuccessBackgroundStyle:k,shouldShowSuccessInlineProgressBackground:B}=ce(e);r.watch(()=>e.percent,V=>{n.value=V||0});function D(){return f.value&&r.createVNode("span",{class:"f-progress-text"},[m.value?r.createVNode("span",{class:a.value?i.value:w.value},null):c.value])}function T(){return r.createVNode(r.Fragment,null,[r.createVNode("div",{class:"f-progress-outer"},[r.createVNode("div",{class:"f-progress-inner"},[r.createVNode("div",{class:"f-progress-bg",style:$.value},null),B.value&&r.createVNode("div",{class:"f-progress-success-bg",style:k.value},null)])]),D()])}function M(){return r.createVNode("div",{class:O.value,style:b.value},[r.createVNode("svg",{class:"f-progress-circle",viewBox:"0 0 100 100"},[g.value&&r.createVNode("defs",null,[r.createVNode("linearGradient",{id:"gradient-"+S.value,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[p.value.map(V=>r.createVNode("stop",{offset:V.offset,"stop-color":V.color},null))])]),r.createVNode("path",{class:"f-progress-circle-trail",stroke:"#efefef","fill-opacity":"0","stroke-width":s.value,d:j.value,style:d.value},null),P.value.map(V=>r.createVNode("path",{class:"f-progress-circle-path","fill-opacity":"0",d:j.value,"stroke-linecap":o.value,stroke:V.stroke,"stroke-width":n.value?s.value:0,style:V.strokePathStyle},null))]),D()])}return()=>r.createVNode("div",{class:h.value},[t.value==="line"&&T(),a.value&&M()])}});function ae(e,t,f){var w;function n(){}const o="",u="",g=r.ref();function p(){return(t==null?void 0:t.schema.componentType)!=="frame"}function y(){return!1}function s(){return(t==null?void 0:t.schema.componentType)!=="frame"}function c(){return(t==null?void 0:t.schema.componentType)==="frame"}function l(i){if(!i||!i.value)return null;if(i.value.schema&&i.value.schema.type==="component")return i.value;const m=r.ref(i==null?void 0:i.value.parent),k=l(m);return k||null}function a(i=t){const{componentInstance:m,designerItemElementRef:k}=i;return!m||!m.value?null:m.value.canMove?k:a(i.parent)}function h(i){return!!f}function b(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function O(){}function j(i,m){}function d(i){const{componentType:m}=i;let k=W(m,i);const B=m.toLowerCase().replace("-","_");return k&&!k.id&&k.type===m&&(k.id=`${B}_${Math.random().toString().slice(2,6)}`),k}function P(i,m){const k=String(i.getAttribute("data-controltype")),B=i.getAttribute("data-feature"),D=B?JSON.parse(B):{};D.parentComponentInstance=g.value;let T=W(k,D);const M=k.toLowerCase().replace("-","_");return T&&!T.id&&T.type===k&&(T.id=`${M}_${Math.random().toString().slice(2,6)}`),T}function S(i){}function $(...i){}return g.value={canMove:p(),canSelectParent:y(),canDelete:s(),canNested:!c(),contents:t==null?void 0:t.schema.contents,elementRef:e,parent:(w=t==null?void 0:t.parent)==null?void 0:w.componentInstance,schema:t==null?void 0:t.schema,styles:o,designerClass:u,canAccepts:h,getBelongedComponentInstance:l,getDraggableDesignItemElement:a,getDraggingDisplayText:b,getPropConfig:$,getDragScopeElement:O,onAcceptMovedChildElement:j,onAcceptNewChildElement:P,onChildElementMovedOut:S,addNewChildComponentSchema:d,updateDragAndDropRules:n,triggerBelongedComponentToMoveWhenMoved:r.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:r.ref(!1)},g}const le=r.defineComponent({name:"FProgressDesign",props:E,emits:[],setup(e,t){const f=r.ref(e.progressStatus),n=r.ref(e.progressType),o=r.ref(e.size),u=r.ref(e.showInfo),g=r.ref(e.strokeWidth),p=r.ref(e.percent),y=r.ref(e.strokeLinecap),s=r.ref(!1),c=r.ref(e.strokeColor),l=r.ref(null),a=r.ref(0),h=r.ref(e.width),b=r.ref(""),O=r.ref([]),j=r.ref(""),d=r.ref([]),P=r.ref(e.enableBackgroundImg),S=r.ref(e.backgroundImg),$=r.ref(),w=r.inject("design-item-context"),i=ae($,w);r.onMounted(()=>{$.value.componentInstance=i}),t.expose(i.value),r.watch(()=>e.percent,v=>{p.value=v||0});const m=r.computed(()=>g.value||(n.value==="line"&&o.value!=="small"?8:6)),k=r.computed(()=>n.value==="circle"||n.value==="dashboard"),B=r.computed(()=>{const v={"f-progress":!0,"f-progress-line":n.value==="line","ant-progress-small":o.value==="small","f-progress-show-info":u.value,".f-progress-circle":k.value},pe=`f-progress-status-${f.value}`;return v[pe]=!0,v}),D=r.computed(()=>({width:`${p.value}%`,"border-radius":y.value==="round"?"100px":"0",backgroud:s.value?null:c.value,"background-image":s.value?l.value:null,height:`${m.value}px`})),T=r.computed(()=>({width:`${p.value}%`,"border-radius":y.value==="round"?"100px":"0",height:`${m.value}px`,"background-image":P.value?S.value:null})),M=r.computed(()=>a.value||a.value===0);function V(){return r.createVNode("div",{class:"f-progress-outer"},[r.createVNode("div",{class:"f-progress-inner"},[r.createVNode("div",{class:"f-progress-bg",style:D.value},null),M.value&&r.createVNode("div",{class:"f-progress-success-bg",style:T.value},null)])])}const ue=r.computed(()=>({width:`${h.value}px`,height:`${h.value}px`,"font-size":`${h.value*.15+6}px`,"f-progress-circle-gradient":s.value})),fe=r.computed(()=>({}));function de(){return r.createVNode("div",{class:"f-progress-inner",style:ue.value},[r.createVNode("svg",{class:"f-progress-circle",viewBox:"0 0 100 100"},[s.value&&r.createVNode("defs",null,[r.createVNode("linearGradient",{id:"gradient-"+b.value,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[O.value.map(v=>r.createVNode("stop",{offset:v.offset,"stop-color":v.color},null))])]),r.createVNode("path",{class:"f-progress-circle-trail",stroke:"#efefef","fill-opacity":"0","stroke-width":m.value,d:j.value,style:fe.value},null),d.value.map(v=>r.createVNode("path",{class:"f-progress-circle-path","fill-opacity":"0",d:j.value,"stroke-linecap":y.value,stroke:v.stroke,"stroke-width":p.value?m.value:0,style:v.strokePathStyle},null))])])}return()=>r.createVNode("div",{ref:$,class:B.value},[n.value==="line"&&V(),k.value&&de()])}});C.register=(e,t,f)=>{e.progress=C,t.progress=L},C.registerDesigner=(e,t,f)=>{e.progress=le,t.progress=L};const ie=q.withInstall(C);N.Progress=C,N.default=ie,N.progressProps=E,N.propsResolver=L,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|