@farris/ui-vue 1.3.1 → 1.3.3
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 +103 -99
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +301 -351
- package/components/avatar/index.umd.cjs +1 -1
- package/components/binding-selector/index.esm.js +444 -0
- package/components/binding-selector/index.umd.cjs +1 -0
- package/components/binding-selector/package.json +8 -0
- package/components/border-editor/index.esm.js +5 -3
- package/components/border-editor/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +143 -139
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +407 -396
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +266 -255
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +628 -641
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +379 -374
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +471 -471
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +155 -148
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +487 -478
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +330 -279
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1171 -1277
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +220 -204
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4743 -4641
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2916 -3019
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2375 -2590
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +9518 -1198
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +2 -1
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +34 -38
- package/components/drawer/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +149 -138
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1602 -1740
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +159 -151
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +218 -218
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +311 -0
- package/components/event-parameter/index.umd.cjs +1 -0
- package/components/event-parameter/package.json +8 -0
- package/components/events-editor/index.css +1 -1
- package/components/events-editor/index.esm.js +533 -563
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +95 -91
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +2356 -2455
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +3048 -3308
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +10537 -3249
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +9781 -1327
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +353 -341
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +510 -827
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +278 -268
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +144 -136
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +2139 -2237
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +6414 -6367
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +5216 -5114
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +252 -252
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +70 -70
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +486 -984
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +446 -498
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +363 -388
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1050 -1308
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +134 -131
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1072 -1082
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +412 -910
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +214 -203
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1361 -1536
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +650 -677
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +12344 -5048
- package/components/query-solution/index.umd.cjs +6 -1
- package/components/radio-button/index.esm.js +97 -97
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.css +1 -1
- package/components/radio-group/index.esm.js +1821 -565
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +251 -244
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +151 -140
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +707 -676
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +719 -740
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +4977 -5249
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +145 -134
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +348 -337
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +141 -130
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +311 -301
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +231 -220
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +385 -432
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +1932 -1914
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +351 -340
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +209 -199
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +388 -415
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +619 -666
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +493 -486
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3169 -3278
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2320 -2418
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +563 -554
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +287 -276
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +368 -324
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +498 -487
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +51302 -47651
- package/farris.all.umd.cjs +14 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/binding-selector/index.d.ts +55 -0
- package/types/binding-selector/src/binding-selector.component.d.ts +11 -0
- package/types/binding-selector/src/binding-selector.props.d.ts +52 -0
- package/types/binding-selector/src/components/binding-selector-container.component.d.ts +13 -0
- package/types/binding-selector/src/composition/use-field-selection.d.ts +9 -0
- package/types/combo-list/src/components/list-container.component.d.ts +6 -6
- package/types/combo-list/src/components/list-container.props.d.ts +1 -1
- package/types/combo-tree/src/components/tree-container.component.d.ts +5 -5
- package/types/common/entity/entity-schema.d.ts +26 -11
- package/types/common/index.d.ts +1 -0
- package/types/common/types.d.ts +2 -2
- package/types/condition/src/condition-fields.design.component.d.ts +18 -0
- package/types/condition/src/types.d.ts +6 -6
- package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +20 -0
- package/types/data-grid/src/{designer/data-grid-column.props.d.ts → data-grid-column.props.d.ts} +1 -1
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/grid-field-editor.component.d.ts +14 -14
- package/types/data-grid/src/schema/schema-resolver.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +2 -2
- package/types/date-picker/src/components/calendar/calendar.component.d.ts +3 -3
- package/types/date-picker/src/components/month/month.component.d.ts +3 -3
- package/types/date-picker/src/components/year/year.component.d.ts +3 -3
- package/types/designer-canvas/index.d.ts +2 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/function/drag-resolve.d.ts +5 -0
- package/types/designer-canvas/src/composition/types.d.ts +49 -40
- package/types/designer-canvas/src/types.d.ts +8 -20
- package/types/dynamic-form/index.d.ts +1 -1
- package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +3 -0
- package/types/dynamic-form/src/schema/{schema-resolver.d.ts → response-form-schema-resolver.d.ts} +1 -1
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +5 -0
- package/types/dynamic-resolver/src/converter/row-number.converter.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +7 -0
- package/types/entity-binding-selector/entity-binding-selector.component.d.ts +11 -0
- package/types/entity-binding-selector/entity-binding-selector.props.d.ts +3 -0
- package/types/enum-editor/src/components/enum-editor-container.component.d.ts +3 -3
- package/types/enum-editor/src/enum-editor.component.d.ts +3 -3
- package/types/event-parameter/index.d.ts +31 -0
- package/types/event-parameter/src/composition/type.d.ts +77 -0
- package/types/event-parameter/src/composition/use-editor-combotree.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-input.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-select.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-switch.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor.d.ts +3 -0
- package/types/event-parameter/src/event-parameter.component.d.ts +8 -0
- package/types/event-parameter/src/event-parameter.props.d.ts +34 -0
- package/types/external-container/src/designer/import-external-schema.component.d.ts +1 -1
- package/types/field-selector/src/field-selector.component.d.ts +1 -2
- package/types/field-selector/src/field-selector.props.d.ts +0 -9
- package/types/input-group/src/designer/use-input-group-rules.d.ts +1 -2
- package/types/list-view/src/designer/list-view-table.design.component.d.ts +15 -0
- package/types/list-view/src/list-view-table.component.d.ts +15 -0
- package/types/lookup/src/composition/use-user-data.d.ts +2 -2
- package/types/lookup/src/property-config/lookup.property-config.d.ts +2 -6
- package/types/modal/src/composition/modal.service.d.ts +2 -1
- package/types/page-header/src/designer/page-header.design.component.d.ts +1 -1
- package/types/page-header/src/page-header.component.d.ts +1 -1
- package/types/property-panel/index.d.ts +2 -1
- package/types/property-panel/src/composition/entity/property-entity.d.ts +1 -1
- package/types/property-panel/src/composition/type.d.ts +0 -13
- package/types/query-solution/src/composition/types.d.ts +35 -4
- package/types/query-solution/src/composition/use-header.d.ts +21 -0
- package/types/query-solution/src/composition/{use-filter.d.ts → use-http.d.ts} +2 -2
- package/types/query-solution/src/composition/use-solution.d.ts +20 -0
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +17 -16
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +14 -14
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +3 -51
- package/types/query-solution/src/query-solution.d.ts +10 -2
- package/types/radio-group/src/designer/item-collection-editor-inner.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.props.d.ts +21 -0
- package/types/radio-group/src/schema/schema-mapper.d.ts +1 -0
- package/types/radio-group/src/schema/schema-resolver.d.ts +1 -0
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -0
- package/types/section/src/property-config/section.property-config.d.ts +17 -17
- package/types/section/src/schema/schema-resolver.d.ts +1 -2
- package/types/section/src/schema/toolbar-resolver.d.ts +1 -1
- package/types/tabs/src/composition/types.d.ts +4 -1
- package/types/tabs/src/property-config/tab-page.property-config.d.ts +9 -59
- package/types/tabs/src/property-config/tabs.property-config.d.ts +8 -71
- package/types/tabs/src/schema/schema-resolver.d.ts +1 -2
- package/types/text/src/composition/types.d.ts +4 -4
- package/types/textarea/src/property-config/textarea.property-config.d.ts +23 -0
- package/types/weather/src/composition/use-weather-charts.d.ts +15 -0
- package/types/weather/src/composition/use-weather-color.d.ts +15 -0
- package/types/weather/src/composition/use-weather-data.d.ts +15 -0
- package/types/weather/src/composition/use-weather-format-number.d.ts +15 -0
- package/types/property-panel/src/composition/entity/use-input-rules.d.ts +0 -3
- package/types/tree-grid/src/schema/column-resolver.d.ts +0 -3
- package/types/weather/src/composition/types.d.ts +0 -2
- /package/types/dynamic-form/src/designer/{use-designer-rules.d.ts → response-form-use-designer-rules.d.ts} +0 -0
- /package/types/dynamic-form/src/property-config/{form.property-config.d.ts → response-form.property-config.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(C,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("lodash-es"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../common/index.umd.js"],f):(C=typeof globalThis<"u"?globalThis:C||self,f(C.avatar={},C.Vue,C.LodashES,C.dynamicResolver,C.designerCanvas,C.common))})(this,function(C,f,B,D,P,L){"use strict";var de=Object.defineProperty;var pe=(C,f,B)=>f in C?de(C,f,{enumerable:!0,configurable:!0,writable:!0,value:B}):C[f]=B;var h=(C,f,B)=>pe(C,typeof f!="symbol"?f+"":f,B);const q={},j={};function N(i){const{properties:r,title:t,ignore:n}=i,o=n&&Array.isArray(n),c=Object.keys(r).reduce((d,y)=>((!o||!n.find(m=>m==y))&&(d[y]=r[y].type==="object"&&r[y].properties?N(r[y]):B.cloneDeep(r[y].default)),d),{});return t&&(!o||!n.find(d=>d=="id"))&&(c.id=`${t}-${Date.now()}`),c}function U(i,r){const t=N(r);return Object.keys(i).reduce((n,o)=>(n[o]&&B.isPlainObject(n[o])&&B.isPlainObject(i[o])?Object.assign(n[o],i[o]):n[o]=i[o],n),t),t}function H(i,r){return Object.keys(i).filter(n=>i[n]!=null).reduce((n,o)=>{if(r.has(o)){const c=r.get(o);if(typeof c=="string")n[c]=i[o];else{const d=c(o,i[o],i);Object.assign(n,d)}}else n[o]=i[o];return n},{})}function W(i,r,t=new Map){const n=U(i,r);return H(n,t)}function R(i={}){function r(a,l,e,p){if(typeof e=="number")return p[a].length===e;if(typeof e=="object"){const s=Object.keys(e)[0],A=e[s];if(s==="not")return Number(p[a].length)!==Number(A);if(s==="moreThan")return Number(p[a].length)>=Number(A);if(s==="lessThan")return Number(p[a].length)<=Number(A)}return!1}function t(a,l,e,p){return p[a]&&p[a].propertyValue&&String(p[a].propertyValue.value)===String(e)}const n=new Map([["length",r],["getProperty",t]]);Object.keys(i).reduce((a,l)=>(a.set(l,i[l]),a),n);function o(a,l){const e=a;return typeof l=="number"?[{target:e,operator:"length",param:null,value:Number(l)}]:typeof l=="boolean"?[{target:e,operator:"getProperty",param:a,value:!!l}]:typeof l=="object"?Object.keys(l).map(p=>{if(p==="length")return{target:e,operator:"length",param:null,value:l[p]};const s=p,A=l[p];return{target:e,operator:"getProperty",param:s,value:A}}):[]}function c(a){return Object.keys(a).reduce((e,p)=>{const s=o(p,a[p]);return e.push(...s),e},[])}function d(a,l){if(n.has(a.operator)){const e=n.get(a.operator);return e&&e(a.target,a.param,a.value,l)||!1}return!1}function y(a,l){return c(a).reduce((s,A)=>s&&d(A,l),!0)}function m(a,l){const e=Object.keys(a),p=e.includes("allOf"),s=e.includes("anyOf"),A=p||s,b=(A?a[A?p?"allOf":"anyOf":"allOf"]:[a]).map(T=>y(T,l));return p?!b.includes(!1):b.includes(!0)}return{parseValueSchema:m}}const u={button:{type:"button",name:"按钮",icon:"Button"},"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"},"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"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"}},G={},Q={};R();function O(i,r,t=new Map,n=(d,y,m)=>y,o={},c=d=>d){return q[r.title]=r,j[r.title]=n,G[r.title]=o,Q[r.title]=c,(d={})=>{const y=W(d,r,t),m=Object.keys(i).reduce((a,l)=>(a[l]=i[l].default,a),{});return Object.assign(m,y)}}function Z(i,r,t){return r}const z=new Map([["appearance",D.resolveAppearance]]),K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/avatar.schema.json",title:"avatar",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for avatar",type:"string"},type:{description:"The type string of avatar",type:"string",default:"avatar"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},avatarWidth:{description:"",type:"number",default:100},avatarHeight:{description:"",type:"number",default:100},readonly:{description:"",type:"boolean",default:!1},cover:{description:"",type:"string",default:""},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"],ignore:["id","appearance","binding"]},F={avatarWidth:{type:Number,default:100},avatarHeight:{type:Number,default:100},cover:{type:String},readonly:{type:Boolean,default:!1},shape:{type:String,default:"circle"},maxSize:{type:Number,default:1},modelValue:{type:String,default:""},title:{type:String,default:""},imageType:{type:Array,default:["jpeg"]}},V=O(F,K,z,Z);function x(i,r,t,n){const o="data:image/jpeg;base64,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",c=f.ref(i.readonly);function d(s){return s.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/)!=null}function y(s){return s.indexOf("data:image/")>-1}function m(s){return s?"data:image/jpeg;base64,"+s:""}const a=f.computed(()=>{var A;if(!i.imageType||!i.imageType.length)return"";const s=(A=i.imageType)==null?void 0:A.map(g=>(g==="jpg"&&(g="jpeg"),`image/${g}`));return!s||!s.length?"image/*":s.join(",")}),l=f.computed(()=>{const s=n.value||i.cover||o;return d(s)||y(s)?s:m(s)}),e=f.computed(()=>c.value?"":i.title);function p(){c.value||t&&t.value&&t.value.click()}return{acceptTypes:a,imageSource:l,imageTitle:e,onClickImage:p}}const k=f.defineComponent({name:"FAvatar",props:F,emits:["change","update:modelValue"],setup(i,r){const t=f.computed(()=>({"f-avatar":!0,"f-avatar-readonly":i.readonly,"f-avatar-circle":i.shape==="circle","f-avatar-square":i.shape==="square"})),n=f.ref(i.modelValue),o=f.computed(()=>({width:i.avatarWidth+"px",height:i.avatarHeight+"px"})),c=!1;function d(){return""}function y(){}const m=f.ref(null),{acceptTypes:a,imageSource:l,onClickImage:e}=x(i,r,m,n);return()=>f.createVNode("div",{class:t.value,style:o.value,onClick:e},[c,f.createVNode("img",{title:i.title,class:"f-avatar-image",src:l.value,onError:d},null),!i.readonly&&f.createVNode("div",{class:"f-avatar-icon"},[f.createVNode("span",{class:"f-icon f-icon-camera"},null)]),f.createVNode("input",{ref:"file",name:"file-input",type:"file",class:"f-avatar-upload",accept:a.value,onChange:y,style:"display: none;"},null)])}});function J(i,r){i.schema;const t=f.ref(!0),n=f.ref(!0);function o(e){return!1}function c(){return!1}function d(){return!1}function y(){return!0}function m(e){}function a(){}function l(e){return null}return{canAccepts:o,checkCanDeleteComponent:c,checkCanMoveComponent:d,hideNestedPaddingInDesginerView:y,onAcceptMovedChildElement:m,resolveComponentContext:a,triggerBelongedComponentToMoveWhenMoved:t,triggerBelongedComponentToDeleteWhenDeleted:n,getPropsConfig:l}}class X{constructor(r,t){h(this,"componentId");h(this,"viewModelId");h(this,"eventsEditorUtils");h(this,"formSchemaUtils");h(this,"formMetadataConverter");h(this,"designViewModelUtils");h(this,"designViewModelField");h(this,"controlCreatorUtils");h(this,"designerHostService");h(this,"schemaService",null);h(this,"metadataService",null);h(this,"propertyConfig",{type:"object",categories:{}});var n;this.componentId=r,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((n=this.formSchemaUtils)==null?void 0:n.getViewModelIdByComponentId(r))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService}getTableInfo(){var r;return(r=this.schemaService)==null?void 0:r.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(r){const t=r.binding&&r.binding.type==="Form"&&r.binding.field;if(t){if(!this.designViewModelField){const n=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=n.fields.find(o=>o.id===t)}r.updateOn=this.designViewModelField.updateOn}}changeFieldEditorType(r,t){}getBasicPropConfig(r){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:r.type,name:u[r.type].name}]}}}}}getAppearanceConfig(r=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"}}}}updateElementByParentContainer(r,t){const n=t&&t.parent&&t.parent.schema;if(!n)return;const o=n.contents.findIndex(d=>d.id===r),c=B.cloneDeep(n.contents[o]);n.contents.splice(o,1),n.contents.splice(o,0,c)}}const M=class M{static getEditorTypesByMDataType(r){const t=M.fieldControlTypeMapping[r];return t||[{key:"",value:""}]}static getAllInputTypes(){const r=[];for(let t in M.fieldControlTypeMapping)M.fieldControlTypeMapping[t].forEach(n=>{r.find(o=>o.key===n.key&&o.value===n.value)||r.push({key:n.key,value:n.value})});return r}};h(M,"fieldControlTypeMapping",{String:[{key:u["input-group"].type,value:u["input-group"].name},{key:u.lookup.type,value:u.lookup.name},{key:u["date-picker"].type,value:u["date-picker"].name},{key:u["check-box"].type,value:u["check-box"].name},{key:u["check-group"].type,value:u["check-group"].name},{key:u["radio-group"].type,value:u["radio-group"].name},{key:u["combo-list"].type,value:u["combo-list"].name},{key:u.textarea.type,value:u.textarea.name}],Text:[{key:u.textarea.type,value:u.textarea.name},{key:u.lookup.type,value:u.lookup.name}],Decimal:[{key:u["number-spinner"].type,value:u["number-spinner"].name}],Integer:[{key:u["number-spinner"].type,value:u["number-spinner"].name}],Number:[{key:u["number-spinner"].type,value:u["number-spinner"].name}],BigNumber:[{key:u["number-spinner"].type,value:u["number-spinner"].name}],Date:[{key:u["date-picker"].type,value:u["date-picker"].name}],DateTime:[{key:u["date-picker"].type,value:u["date-picker"].name}],Boolean:[{key:u.switch.type,value:u.switch.name},{key:u["check-box"].type,value:u["check-box"].name}],Enum:[{key:u["combo-list"].type,value:u["combo-list"].name},{key:u["radio-group"].type,value:u["radio-group"].name}],Object:[{key:u.lookup.type,value:u.lookup.name},{key:u["combo-list"].type,value:u["combo-list"].name},{key:u["radio-group"].type,value:u["radio-group"].name}]});let E=M;const Y=f.ref(0);class ${constructor(){h(this,"label","");h(this,"id","");h(this,"columnInSM",12);h(this,"columnInMD",6);h(this,"columnInLG",3);h(this,"columnInEL",2);h(this,"displayWidthInSM",1);h(this,"displayWidthInMD",1);h(this,"displayWidthInLG",1);h(this,"displayWidthInEL",1);h(this,"displayColumnCountAtBreakPoint","md");h(this,"tagRow",0);h(this,"showTopBorder",0);h(this,"group",1);h(this,"isSupportedClass",!0);h(this,"fieldSetId","")}}function _(i){let r,t;const n=new Map;let o=[];function c(l,e){const s=l.split(" ").filter(I=>I.startsWith("col-"));if(s.length===0){e.isSupportedClass=!1;return}let A=s.find(I=>/^col-([1-9]|10|11|12)$/.test(I)),g=s.find(I=>/^col-md-([1-9]|10|11|12)$/.test(I)),v=s.find(I=>/^col-xl-([1-9]|10|11|12)$/.test(I)),b=s.find(I=>/^col-el-([1-9]|10|11|12)$/.test(I));A=A||"col-12",e.columnInSM=parseInt(A.replace("col-",""),10),e.displayWidthInSM=e.columnInSM/12,e.displayWidthInSM!==1&&(e.isSupportedClass=!1),g=g||"col-md-"+e.columnInSM,e.columnInMD=parseInt(g.replace("col-md-",""),10),e.displayWidthInMD=e.columnInMD/6,[1,2].includes(e.displayWidthInMD)||(e.isSupportedClass=!1),v=v||"col-xl-"+e.columnInMD,e.columnInLG=parseInt(v.replace("col-xl-",""),10),e.displayWidthInLG=e.columnInLG/3,[1,2,3,4].includes(e.displayWidthInLG)||(e.isSupportedClass=!1),b=b||"col-el-"+e.columnInLG,e.columnInEL=parseInt(b.replace("col-el-",""),10),e.displayWidthInEL=e.columnInEL/2,[1,2,3,4,5,6].includes(e.displayWidthInEL)||(e.isSupportedClass=!1)}function d(l,e,p,s=!1){let A=!1;l.contents.forEach(g=>{if(g.type==="fieldset"){p+=1,d(g,e,p,!0),A=!0;return}A&&(p+=1,A=!1);const v=g.appearance&&g.appearance.class,b=new $;v?c(v,b):b.isSupportedClass=!1,b.label=g.label||g.id,b.id=g.id,b.group=p,s&&(b.fieldSetId=l.id),t===g.id&&(r=p),n.set(g.id,g),e.push(b)})}function y(l){const e=i.getComponentById(l);if(!e||!e.componentType||!e.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const p=i.selectNode(e,s=>s.type===P.DgControl["response-form"].type);return!p||!p.contents||p.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:p}}function m(l,e){e=e||l.id;const{result:p,message:s,formNode:A}=y(e);if(!p)return{result:p,message:s};t=l.id,o=[],n.clear();const g=A.contents[0].type===P.DgControl.fieldset.type?0:1;d(A,o,g);const v=o.find(I=>!I.isSupportedClass);return{defaultState:{defaultGroupNumber:r||1,model:v?"customize":"standard"},importData:o}}function a(l,e){e=e;const{result:p,formNode:s}=y(e);if(!p)return"";const A=[];return l.forEach(g=>{var I;const v=n.get(g.id),b=v.appearance&&v.appearance.class;if(b){const w=b.split(" ").filter(ce=>!ce.startsWith("col-")),S="col-"+g.columnInSM,ie="col-md-"+g.columnInMD,ae="col-xl-"+g.columnInLG,se="col-el-"+g.columnInEL,le=[S,ie,ae,se].concat(w);v.appearance.class=le.join(" ")}if(g.fieldSetId){const T=s.contents.find(S=>S.id===g.fieldSetId),w=A.find(S=>S.id===g.fieldSetId);w?(I=w.contents)==null||I.push(v):(A.push(T),T.contents=[v])}else A.push(v)}),s.contents=A,s.id}return{checkCanFindFormNode:y,checkCanOpenLayoutEditor:m,changeFormControlsByResponseLayoutConfig:a,getResonseFormLayoutConfig:d}}class ee extends X{constructor(t,n){super(t,n);h(this,"responseLayoutEditorFunction");this.responseLayoutEditorFunction=_(this.formSchemaUtils)}getPropertyConfig(t,n){return this.propertyConfig.categories.basic=this.getBasicProperties(t,n),this.propertyConfig.categories.appearance=this.getAppearanceProperties(t,n),this.propertyConfig.categories.editor=this.getEditorProperties(t),this.propertyConfig}getBasicProperties(t,n){var y;var o=this;this.setDesignViewModelField(t);const c=this.formSchemaUtils.getFormMetadataBasicInfo(),d=this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);return{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",editable:!1,data:o.designViewModelField?E.getEditorTypesByMDataType((y=o.designViewModelField.type)==null?void 0:y.name):E.getAllInputTypes()}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},binding:{description:"绑定的表单字段",title:"绑定",$converter:"/converter/field-selector.converter",editor:{type:"field-selector",bindingType:{enable:!1},editorParams:{propertyData:t,formBasicInfo:c},columns:[{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"fieldType",title:"字段类型"}],textField:"bindingField",data:d}}},setPropertyRelates(m,a){if(m)switch(m&&m.propertyID){case"type":{o.changeControlType(t,m,n);break}case"label":{m.needRefreshControlTree=!0;break}}}}}getAppearanceProperties(t,n){var o=this;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:!0,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",initialState:o.responseLayoutEditorFunction.checkCanOpenLayoutEditor(t,o.componentId)}}},setPropertyRelates(c,d){if(c)switch(c&&c.propertyID){case"responseLayout":o.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(c.propertyValue,o.componentId||t.id),o.updateUnifiedLayoutAfterResponseLayoutChanged(o.componentId),o.updateElementByParentContainer(t.id,n),delete t.responseLayout;break;case"class":o.updateUnifiedLayoutAfterControlChanged(c.propertyValue,t.id,this.componentId),o.updateElementByParentContainer(t.id,n);break}}}}getEditorProperties(t){return this.getComponentConfig(t)}changeControlType(t,n,o){var l,e,p,s;const c=n.propertyValue,d=o&&o.parent&&o.parent.schema;if(!d)return;const y=d.contents.findIndex(A=>A.id===t.id),m=d.contents[y];let a;this.designViewModelField&&(this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,{editor:{$type:c},name:this.designViewModelField.name,require:this.designViewModelField.require,readonly:this.designViewModelField.readonly},!1),a=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,c)),a||(a=this.controlCreatorUtils.createFormGroupWithoutField(c)),Object.assign(a,{id:m.id,appearance:m.appearance,size:m.size,label:m.label,binding:m.binding,visible:m.visible}),Object.assign(a.editor,{isTextArea:a.isTextArea&&m.isTextArea,placeholder:(l=m.editor)==null?void 0:l.placeholder,holdPlace:(e=m.editor)==null?void 0:e.holdPlace,readonly:(p=m.editor)==null?void 0:p.readonly,require:(s=m.editor)==null?void 0:s.require}),d.contents.splice(y,1),d.contents.splice(y,0,a),o.schema=Object.assign(m,a),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(A=>A.classList.remove("dgComponentSelected")),Y.value++}getComponentConfig(t,n={},o={}){const c=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter"},n),d=Object.assign({readonly:{description:"",title:"只读",type:"boolean"},disabled:{description:"",title:"禁用",type:"boolean"},placeholder:{description:"空值时,输入控件内的占位文本",title:"提示文本",type:"string"}},o);return{...c,properties:{...d}}}updateUnifiedLayoutAfterControlChanged(t,n,o){const c=t.split(" ");let d=c.find(e=>/^col-([1-9]|10|11|12)$/.test(e)),y=c.find(e=>/^col-md-([1-9]|10|11|12)$/.test(e)),m=c.find(e=>/^col-xl-([1-9]|10|11|12)$/.test(e)),a=c.find(e=>/^col-el-([1-9]|10|11|12)$/.test(e));d=d||"col-12",y=y||"col-md-"+d.replace("col-",""),m=m||"col-xl-"+y.replace("col-md-",""),a=a||"col-el-"+m.replace("col-xl-","");const l={id:n,columnInSM:parseInt(d.replace("col-",""),10),columnInMD:parseInt(y.replace("col-md-",""),10),columnInLG:parseInt(m.replace("col-xl-",""),10),columnInEL:parseInt(a.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(o,l)}updateUnifiedLayoutAfterResponseLayoutChanged(t,n){const{formNode:o}=this.responseLayoutEditorFunction.checkCanFindFormNode(t);if(!o||!o.unifiedLayout)return;const c=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(o,c,1),n){const A=c.find(g=>g.id===n.id);Object.assign(A||{},n)}const d=c.map(A=>A.columnInSM),y=c.map(A=>A.columnInMD),m=c.map(A=>A.columnInLG),a=c.map(A=>A.columnInEL),l=this.checkIsUniqueColumn(d)?d[0]:null,e=this.checkIsUniqueColumn(y)?y[0]:null,p=this.checkIsUniqueColumn(m)?m[0]:null,s=this.checkIsUniqueColumn(a)?a[0]:null;Object.assign(o.unifiedLayout,{uniqueColClassInSM:l,uniqueColClassInMD:e,uniqueColClassInLG:p,uniqueColClassInEL:s})}checkIsUniqueColumn(t){const n=new Set(t);return Array.from(n).length===1}}class te extends ee{constructor(r,t){super(r,t)}getEditorProperties(r){return{description:"编辑器",title:"编辑器",type:"avatar",$converter:"/converter/property-editor.converter",properties:{readonly:{description:"",title:"只读",type:"boolean"},avatarWidth:{description:"",title:"头像宽度",type:"number"},avatarHeight:{description:"",title:"头像高度",type:"number"},cover:{description:"",title:"封面",type:"string"}}}}}function ne(i,r){const{canAccepts:t,checkCanDeleteComponent:n,checkCanMoveComponent:o,hideNestedPaddingInDesginerView:c,onAcceptMovedChildElement:d,resolveComponentContext:y,triggerBelongedComponentToMoveWhenMoved:m,triggerBelongedComponentToDeleteWhenDeleted:a}=J(i),l=i.schema;function e(p,s){return new te(p,r).getPropertyConfig(l,s)}return{canAccepts:t,checkCanDeleteComponent:n,checkCanMoveComponent:o,hideNestedPaddingInDesginerView:c,onAcceptMovedChildElement:d,resolveComponentContext:y,triggerBelongedComponentToMoveWhenMoved:m,triggerBelongedComponentToDeleteWhenDeleted:a,getPropsConfig:e}}const oe=f.defineComponent({name:"FAvatarDesign",props:F,emits:["change","update:modelValue"],setup(i,r){const t=f.ref(),n=f.inject("designer-host-service"),o=f.inject("design-item-context"),c=ne(o,n),d=P.useDesignerComponent(t,o,c);f.onMounted(()=>{t.value.componentInstance=d}),r.expose(d.value);const y=f.computed(()=>({"f-avatar":!0,"f-avatar-readonly":i.readonly,"f-avatar-circle":i.shape==="circle","f-avatar-square":i.shape==="square"})),m=f.ref(i.modelValue),a=f.computed(()=>({width:i.avatarWidth+"px",height:i.avatarHeight+"px"})),l=!1;function e(){return""}function p(){}const s=f.ref(null),{acceptTypes:A,imageSource:g,onClickImage:v}=x(i,r,s,m);return()=>f.createVNode("div",{ref:t,class:y.value,style:a.value,onClick:v},[l,f.createVNode("img",{title:i.title,class:"f-avatar-image",src:g.value,onError:e},null),!i.readonly&&f.createVNode("div",{class:"f-avatar-icon"},[f.createVNode("span",{class:"f-icon f-icon-camera"},null)]),f.createVNode("input",{ref:"file",name:"file-input",type:"file",class:"f-avatar-upload",accept:A.value,onChange:p,style:"display: none;"},null)])}});k.register=(i,r,t,n)=>{i.avatar=k,r.avatar=V},k.registerDesigner=(i,r,t)=>{i.avatar=oe,r.avatar=V};const re=L.withInstall(k);C.FAvatar=k,C.avatarProps=F,C.default=re,C.propsResolver=V,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(C,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("vue"),require("lodash-es"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../common/index.umd.js"],m):(C=typeof globalThis<"u"?globalThis:C||self,m(C.avatar={},C.Vue,C.LodashES,C.dynamicResolver,C.designerCanvas,C.common))})(this,function(C,m,B,L,P,q){"use strict";var ce=Object.defineProperty;var de=(C,m,B)=>m in C?ce(C,m,{enumerable:!0,configurable:!0,writable:!0,value:B}):C[m]=B;var h=(C,m,B)=>de(C,typeof m!="symbol"?m+"":m,B);const j={},D={};function N(i){const{properties:o,title:e,ignore:n}=i,r=n&&Array.isArray(n),s=Object.keys(o).reduce((l,y)=>((!r||!n.find(f=>f===y))&&(l[y]=o[y].type==="object"&&o[y].properties?N(o[y]):B.cloneDeep(o[y].default)),l),{});if(e&&(!r||!n.find(l=>l==="id"))){const l=e.toLowerCase().replace(/-/g,"_");s.id=`${l}_${Math.random().toString().slice(2,6)}`}return s}function H(i,o){const e=N(o);return Object.keys(e).reduce((n,r)=>(n[r]&&B.isPlainObject(n[r])&&B.isPlainObject(i[r]||!i[r])?Object.assign(n[r],i[r]||{}):n[r]=i[r],n),e),e}function U(i,o){return Object.keys(i).filter(n=>i[n]!=null).reduce((n,r)=>{if(o.has(r)){const s=o.get(r);if(typeof s=="string")n[s]=i[r];else{const l=s(r,i[r],i);Object.assign(n,l)}}else n[r]=i[r];return n},{})}function R(i,o,e=new Map){const n=H(i,o);return U(n,e)}function Q(i={}){function o(a,d,t,u){if(typeof t=="number")return u[a].length===t;if(typeof t=="object"){const c=Object.keys(t)[0],A=t[c];if(c==="not")return Number(u[a].length)!==Number(A);if(c==="moreThan")return Number(u[a].length)>=Number(A);if(c==="lessThan")return Number(u[a].length)<=Number(A)}return!1}function e(a,d,t,u){return u[a]&&u[a].propertyValue&&String(u[a].propertyValue.value)===String(t)}const n=new Map([["length",o],["getProperty",e]]);Object.keys(i).reduce((a,d)=>(a.set(d,i[d]),a),n);function r(a,d){const t=a;return typeof d=="number"?[{target:t,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:t,operator:"getProperty",param:a,value:!!d}]:typeof d=="object"?Object.keys(d).map(u=>{if(u==="length")return{target:t,operator:"length",param:null,value:d[u]};const c=u,A=d[u];return{target:t,operator:"getProperty",param:c,value:A}}):[]}function s(a){return Object.keys(a).reduce((t,u)=>{const c=r(u,a[u]);return t.push(...c),t},[])}function l(a,d){if(n.has(a.operator)){const t=n.get(a.operator);return t&&t(a.target,a.param,a.value,d)||!1}return!1}function y(a,d){return s(a).reduce((c,A)=>c&&l(A,d),!0)}function f(a,d){const t=Object.keys(a),u=t.includes("allOf"),c=t.includes("anyOf"),A=u||c,b=(A?a[A?u?"allOf":"anyOf":"allOf"]:[a]).map(k=>y(k,d));return u?!b.includes(!1):b.includes(!0)}return{parseValueSchema:f}}const p={button:{type:"button",name:"按钮",icon:"Button"},"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"},"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"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},W={},G={};Q();function O(i,o,e=new Map,n=(l,y,f,a)=>y,r={},s=l=>l){return j[o.title]=o,D[o.title]=n,W[o.title]=r,G[o.title]=s,(l={})=>{const y=R(l,o,e),f=Object.keys(i).reduce((a,d)=>(a[d]=i[d].default,a),{});return Object.assign(f,y)}}function Z(i,o,e){return o}const z=new Map([["appearance",L.resolveAppearance]]),K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/avatar.schema.json",title:"avatar",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for avatar",type:"string"},type:{description:"The type string of avatar",type:"string",default:"avatar"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},avatarWidth:{description:"",type:"number",default:100},avatarHeight:{description:"",type:"number",default:100},readonly:{description:"",type:"boolean",default:!1},cover:{description:"",type:"string",default:""},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"],ignore:["id","appearance","binding","visible"]},T={avatarWidth:{type:Number,default:100},avatarHeight:{type:Number,default:100},cover:{type:String},readonly:{type:Boolean,default:!1},shape:{type:String,default:"circle"},maxSize:{type:Number,default:1},modelValue:{type:String,default:""},title:{type:String,default:""},imageType:{type:Array,default:["jpeg"]}},V=O(T,K,z,Z);function x(i,o,e,n){const r="data:image/jpeg;base64,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",s=m.ref(i.readonly);function l(c){return c.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/)!=null}function y(c){return c.indexOf("data:image/")>-1}function f(c){return c?"data:image/jpeg;base64,"+c:""}const a=m.computed(()=>{var A;if(!i.imageType||!i.imageType.length)return"";const c=(A=i.imageType)==null?void 0:A.map(g=>(g==="jpg"&&(g="jpeg"),`image/${g}`));return!c||!c.length?"image/*":c.join(",")}),d=m.computed(()=>{const c=n.value||i.cover||r;return l(c)||y(c)?c:f(c)}),t=m.computed(()=>s.value?"":i.title);function u(){s.value||e&&e.value&&e.value.click()}return{acceptTypes:a,imageSource:d,imageTitle:t,onClickImage:u}}const M=m.defineComponent({name:"FAvatar",props:T,emits:["change","update:modelValue"],setup(i,o){const e=m.computed(()=>({"f-avatar":!0,"f-avatar-readonly":i.readonly,"f-avatar-circle":i.shape==="circle","f-avatar-square":i.shape==="square"})),n=m.ref(i.modelValue),r=m.computed(()=>({width:i.avatarWidth+"px",height:i.avatarHeight+"px"})),s=!1;function l(){return""}function y(){}const f=m.ref(null),{acceptTypes:a,imageSource:d,onClickImage:t}=x(i,o,f,n);return()=>m.createVNode("div",{class:e.value,style:r.value,onClick:t},[s,m.createVNode("img",{title:i.title,class:"f-avatar-image",src:d.value,onError:l},null),!i.readonly&&m.createVNode("div",{class:"f-avatar-icon"},[m.createVNode("span",{class:"f-icon f-icon-camera"},null)]),m.createVNode("input",{ref:"file",name:"file-input",type:"file",class:"f-avatar-upload",accept:a.value,onChange:y,style:"display: none;"},null)])}});class J{constructor(o,e){h(this,"componentId");h(this,"viewModelId");h(this,"eventsEditorUtils");h(this,"formSchemaUtils");h(this,"formMetadataConverter");h(this,"designViewModelUtils");h(this,"designViewModelField");h(this,"controlCreatorUtils");h(this,"designerHostService");h(this,"schemaService",null);h(this,"metadataService",null);h(this,"propertyConfig",{type:"object",categories:{}});var n;this.componentId=o,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((n=this.formSchemaUtils)==null?void 0:n.getViewModelIdByComponentId(o))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService}getTableInfo(){var o;return(o=this.schemaService)==null?void 0:o.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(o){var n;const e=o.binding&&o.binding.type==="Form"&&o.binding.field;if(e){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(s=>s.id===e)}o.updateOn=(n=this.designViewModelField)==null?void 0:n.updateOn}}changeFieldEditorType(o,e){}getBasicPropConfig(o){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:o.type,name:p[o.type].name}]}}}}}getAppearanceConfig(o=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"}}}}updateElementByParentContainer(o,e){const n=e&&e.parent&&e.parent.schema;if(!n)return;const r=n.contents.findIndex(l=>l.id===o),s=B.cloneDeep(n.contents[r]);n.contents.splice(r,1),n.contents.splice(r,0,s)}}const S=class S{static getEditorTypesByMDataType(o){const e=S.fieldControlTypeMapping[o];return e||[{key:"",value:""}]}static getAllInputTypes(){const o=[];for(const e in S.fieldControlTypeMapping)S.fieldControlTypeMapping[e].forEach(n=>{o.find(r=>r.key===n.key&&r.value===n.value)||o.push({key:n.key,value:n.value})});return o}};h(S,"fieldControlTypeMapping",{String:[{key:p["input-group"].type,value:p["input-group"].name},{key:p.lookup.type,value:p.lookup.name},{key:p["date-picker"].type,value:p["date-picker"].name},{key:p["check-box"].type,value:p["check-box"].name},{key:p["check-group"].type,value:p["check-group"].name},{key:p["radio-group"].type,value:p["radio-group"].name},{key:p["combo-list"].type,value:p["combo-list"].name},{key:p.textarea.type,value:p.textarea.name}],Text:[{key:p.textarea.type,value:p.textarea.name},{key:p.lookup.type,value:p.lookup.name}],Decimal:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],Integer:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],Number:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],BigNumber:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],Date:[{key:p["date-picker"].type,value:p["date-picker"].name}],DateTime:[{key:p["date-picker"].type,value:p["date-picker"].name}],Boolean:[{key:p.switch.type,value:p.switch.name},{key:p["check-box"].type,value:p["check-box"].name}],Enum:[{key:p["combo-list"].type,value:p["combo-list"].name},{key:p["radio-group"].type,value:p["radio-group"].name}],Object:[{key:p.lookup.type,value:p.lookup.name},{key:p["combo-list"].type,value:p["combo-list"].name},{key:p["radio-group"].type,value:p["radio-group"].name}]});let w=S;const X=m.ref(0);class Y{constructor(){h(this,"label","");h(this,"id","");h(this,"columnInSM",12);h(this,"columnInMD",6);h(this,"columnInLG",3);h(this,"columnInEL",2);h(this,"displayWidthInSM",1);h(this,"displayWidthInMD",1);h(this,"displayWidthInLG",1);h(this,"displayWidthInEL",1);h(this,"displayColumnCountAtBreakPoint","md");h(this,"tagRow",0);h(this,"showTopBorder",0);h(this,"group",1);h(this,"isSupportedClass",!0);h(this,"fieldSetId","")}}function $(i){let o,e;const n=new Map;let r=[];function s(d,t){const c=d.split(" ").filter(I=>I.startsWith("col-"));if(c.length===0){t.isSupportedClass=!1;return}let A=c.find(I=>/^col-([1-9]|10|11|12)$/.test(I)),g=c.find(I=>/^col-md-([1-9]|10|11|12)$/.test(I)),v=c.find(I=>/^col-xl-([1-9]|10|11|12)$/.test(I)),b=c.find(I=>/^col-el-([1-9]|10|11|12)$/.test(I));A=A||"col-12",t.columnInSM=parseInt(A.replace("col-",""),10),t.displayWidthInSM=t.columnInSM/12,t.displayWidthInSM!==1&&(t.isSupportedClass=!1),g=g||"col-md-"+t.columnInSM,t.columnInMD=parseInt(g.replace("col-md-",""),10),t.displayWidthInMD=t.columnInMD/6,[1,2].includes(t.displayWidthInMD)||(t.isSupportedClass=!1),v=v||"col-xl-"+t.columnInMD,t.columnInLG=parseInt(v.replace("col-xl-",""),10),t.displayWidthInLG=t.columnInLG/3,[1,2,3,4].includes(t.displayWidthInLG)||(t.isSupportedClass=!1),b=b||"col-el-"+t.columnInLG,t.columnInEL=parseInt(b.replace("col-el-",""),10),t.displayWidthInEL=t.columnInEL/2,[1,2,3,4,5,6].includes(t.displayWidthInEL)||(t.isSupportedClass=!1)}function l(d,t,u,c=!1){let A=!1;d.contents.forEach(g=>{if(g.type==="fieldset"){u+=1,l(g,t,u,!0),A=!0;return}A&&(u+=1,A=!1);const v=g.appearance&&g.appearance.class,b=new Y;v?s(v,b):b.isSupportedClass=!1,b.label=g.label||g.id,b.id=g.id,b.group=u,c&&(b.fieldSetId=d.id),e===g.id&&(o=u),n.set(g.id,g),t.push(b)})}function y(d){const t=i.getComponentById(d);if(!t||!t.componentType||!t.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const u=i.selectNode(t,c=>c.type===P.DgControl["response-form"].type);return!u||!u.contents||u.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:u}}function f(d,t){t=t||d.id;const{result:u,message:c,formNode:A}=y(t);if(!u)return{result:u,message:c};e=d.id,r=[],n.clear();const g=A.contents[0].type===P.DgControl.fieldset.type?0:1;l(A,r,g);const v=r.find(I=>!I.isSupportedClass);return{defaultState:{defaultGroupNumber:o||1,model:v?"customize":"standard"},importData:r}}function a(d,t){t=t;const{result:u,formNode:c}=y(t);if(!u)return"";const A=[];return d.forEach(g=>{var I;const v=n.get(g.id),b=v.appearance&&v.appearance.class;if(b){const E=b.split(" ").filter(le=>!le.startsWith("col-")),F="col-"+g.columnInSM,oe="col-md-"+g.columnInMD,ie="col-xl-"+g.columnInLG,ae="col-el-"+g.columnInEL,se=[F,oe,ie,ae].concat(E);v.appearance.class=se.join(" ")}if(g.fieldSetId){const k=c.contents.find(F=>F.id===g.fieldSetId),E=A.find(F=>F.id===g.fieldSetId);E?(I=E.contents)==null||I.push(v):(A.push(k),k.contents=[v])}else A.push(v)}),c.contents=A,c.id}return{checkCanFindFormNode:y,checkCanOpenLayoutEditor:f,changeFormControlsByResponseLayoutConfig:a,getResonseFormLayoutConfig:l}}class _ extends J{constructor(e,n){super(e,n);h(this,"responseLayoutEditorFunction");this.responseLayoutEditorFunction=$(this.formSchemaUtils)}getPropertyConfig(e,n){return this.propertyConfig.categories.basic=this.getBasicProperties(e,n),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e,n),this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig}getBasicProperties(e,n){var s;const r=this;return this.setDesignViewModelField(e),this.formSchemaUtils.getFormMetadataBasicInfo(),{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",editable:!1,data:r.designViewModelField?w.getEditorTypesByMDataType((s=r.designViewModelField.type)==null?void 0:s.name):w.getAllInputTypes()}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:e,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"}}},setPropertyRelates(l,y){if(l)switch(l&&l.propertyID){case"type":{r.changeControlType(e,l,n);break}case"label":{l.needRefreshControlTree=!0;break}}}}}getAppearanceProperties(e,n){const r=this;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:!0,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",initialState:r.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e,r.componentId)}}},setPropertyRelates(s,l){if(s)switch(s&&s.propertyID){case"responseLayout":r.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(s.propertyValue,r.componentId||e.id),r.updateUnifiedLayoutAfterResponseLayoutChanged(r.componentId),r.updateElementByParentContainer(e.id,n),delete e.responseLayout;break;case"class":r.updateUnifiedLayoutAfterControlChanged(s.propertyValue,e.id,this.componentId),r.updateElementByParentContainer(e.id,n);break}}}}getEditorProperties(e){return this.getComponentConfig(e)}changeControlType(e,n,r){var d,t,u,c;const s=n.propertyValue,l=r&&r.parent&&r.parent.schema;if(!l)return;const y=l.contents.findIndex(A=>A.id===e.id),f=l.contents[y];let a;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),a=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,s)),a||(a=this.controlCreatorUtils.createFormGroupWithoutField(s)),Object.assign(a,{id:f.id,appearance:f.appearance,size:f.size,label:f.label,binding:f.binding,visible:f.visible}),Object.assign(a.editor,{isTextArea:a.isTextArea&&f.isTextArea,placeholder:(d=f.editor)==null?void 0:d.placeholder,holdPlace:(t=f.editor)==null?void 0:t.holdPlace,readonly:(u=f.editor)==null?void 0:u.readonly,require:(c=f.editor)==null?void 0:c.require}),l.contents.splice(y,1),l.contents.splice(y,0,a),r.schema=Object.assign(f,a),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(A=>A.classList.remove("dgComponentSelected")),X.value++}getComponentConfig(e,n={},r={}){const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter"},n),l=Object.assign({readonly:{description:"",title:"只读",type:"boolean"},disabled:{description:"",title:"禁用",type:"boolean"},placeholder:{description:"空值时,输入控件内的占位文本",title:"提示文本",type:"string"}},r);return{...s,properties:{...l}}}updateUnifiedLayoutAfterControlChanged(e,n,r){const s=e.split(" ");let l=s.find(t=>/^col-([1-9]|10|11|12)$/.test(t)),y=s.find(t=>/^col-md-([1-9]|10|11|12)$/.test(t)),f=s.find(t=>/^col-xl-([1-9]|10|11|12)$/.test(t)),a=s.find(t=>/^col-el-([1-9]|10|11|12)$/.test(t));l=l||"col-12",y=y||"col-md-"+l.replace("col-",""),f=f||"col-xl-"+y.replace("col-md-",""),a=a||"col-el-"+f.replace("col-xl-","");const d={id:n,columnInSM:parseInt(l.replace("col-",""),10),columnInMD:parseInt(y.replace("col-md-",""),10),columnInLG:parseInt(f.replace("col-xl-",""),10),columnInEL:parseInt(a.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(r,d)}updateUnifiedLayoutAfterResponseLayoutChanged(e,n){const{formNode:r}=this.responseLayoutEditorFunction.checkCanFindFormNode(e);if(!r||!r.unifiedLayout)return;const s=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(r,s,1),n){const A=s.find(g=>g.id===n.id);Object.assign(A||{},n)}const l=s.map(A=>A.columnInSM),y=s.map(A=>A.columnInMD),f=s.map(A=>A.columnInLG),a=s.map(A=>A.columnInEL),d=this.checkIsUniqueColumn(l)?l[0]:null,t=this.checkIsUniqueColumn(y)?y[0]:null,u=this.checkIsUniqueColumn(f)?f[0]:null,c=this.checkIsUniqueColumn(a)?a[0]:null;Object.assign(r.unifiedLayout,{uniqueColClassInSM:d,uniqueColClassInMD:t,uniqueColClassInLG:u,uniqueColClassInEL:c})}checkIsUniqueColumn(e){const n=new Set(e);return Array.from(n).length===1}}class ee extends _{constructor(o,e){super(o,e)}getEditorProperties(o){return{description:"编辑器",title:"编辑器",type:"avatar",$converter:"/converter/property-editor.converter",properties:{readonly:{description:"",title:"只读",type:"boolean"},avatarWidth:{description:"",title:"头像宽度",type:"number"},avatarHeight:{description:"",title:"头像高度",type:"number"},cover:{description:"",title:"封面",type:"string"}}}}}function te(i,o){const e=i.schema;function n(r,s){return new ee(r,o).getPropertyConfig(e,s)}return{getPropsConfig:n}}const ne=m.defineComponent({name:"FAvatarDesign",props:T,emits:["change","update:modelValue"],setup(i,o){const e=m.ref(),n=m.inject("designer-host-service"),r=m.inject("design-item-context"),s=te(r,n),l=P.useDesignerComponent(e,r,s);m.onMounted(()=>{e.value.componentInstance=l}),o.expose(l.value);const y=m.computed(()=>({"f-avatar":!0,"f-avatar-readonly":i.readonly,"f-avatar-circle":i.shape==="circle","f-avatar-square":i.shape==="square"})),f=m.ref(i.modelValue),a=m.computed(()=>({width:i.avatarWidth+"px",height:i.avatarHeight+"px"})),d=!1;function t(){return""}function u(){}const c=m.ref(null),{acceptTypes:A,imageSource:g,onClickImage:v}=x(i,o,c,f);return()=>m.createVNode("div",{ref:e,class:y.value,style:a.value,onClick:v},[d,m.createVNode("img",{title:i.title,class:"f-avatar-image",src:g.value,onError:t},null),!i.readonly&&m.createVNode("div",{class:"f-avatar-icon"},[m.createVNode("span",{class:"f-icon f-icon-camera"},null)]),m.createVNode("input",{ref:"file",name:"file-input",type:"file",class:"f-avatar-upload",accept:A.value,onChange:u,style:"display: none;"},null)])}});M.register=(i,o,e,n)=>{i.avatar=M,o.avatar=V},M.registerDesigner=(i,o,e)=>{i.avatar=ne,o.avatar=V};const re=q.withInstall(M);C.FAvatar=M,C.avatarProps=T,C.default=re,C.propsResolver=V,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import { defineComponent as A, ref as p, onBeforeMount as G, onMounted as W, createVNode as y, createTextVNode as j } from "vue";
|
|
2
|
+
import z from "../button-edit/index.esm.js";
|
|
3
|
+
import { FNotifyService as D } from "../notify/index.esm.js";
|
|
4
|
+
import q from "../tree-grid/index.esm.js";
|
|
5
|
+
import J from "../radio-group/index.esm.js";
|
|
6
|
+
import { FormSchemaEntityField$Type as K } from "../common/index.esm.js";
|
|
7
|
+
import { createPropsResolver as Q } from "../dynamic-resolver/index.esm.js";
|
|
8
|
+
import { SchemaDOMMapping as X } from "../property-panel/index.esm.js";
|
|
9
|
+
import { merge as E } from "lodash-es";
|
|
10
|
+
const Y = "https://json-schema.org/draft/2020-12/schema", Z = "https://farris-design.gitee.io/binding-selector.schema.json", _ = "binding-selector", ee = "字段绑定选择器", te = "object", ne = {
|
|
11
|
+
disabled: {
|
|
12
|
+
description: "",
|
|
13
|
+
type: "boolean",
|
|
14
|
+
default: !1
|
|
15
|
+
},
|
|
16
|
+
readonly: {
|
|
17
|
+
description: "",
|
|
18
|
+
type: "boolean",
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
bindingType: {
|
|
22
|
+
description: "",
|
|
23
|
+
type: "object",
|
|
24
|
+
default: {}
|
|
25
|
+
},
|
|
26
|
+
idField: {
|
|
27
|
+
description: "",
|
|
28
|
+
type: "string",
|
|
29
|
+
default: "id"
|
|
30
|
+
},
|
|
31
|
+
title: {
|
|
32
|
+
description: "",
|
|
33
|
+
type: "string",
|
|
34
|
+
default: "字段选择器"
|
|
35
|
+
},
|
|
36
|
+
modalWidth: {
|
|
37
|
+
description: "",
|
|
38
|
+
type: "number",
|
|
39
|
+
default: 800
|
|
40
|
+
},
|
|
41
|
+
modalHeight: {
|
|
42
|
+
description: "",
|
|
43
|
+
type: "number",
|
|
44
|
+
default: 600
|
|
45
|
+
},
|
|
46
|
+
separator: {
|
|
47
|
+
description: "",
|
|
48
|
+
type: "string",
|
|
49
|
+
default: ","
|
|
50
|
+
},
|
|
51
|
+
bindingData: {
|
|
52
|
+
description: "",
|
|
53
|
+
type: "array",
|
|
54
|
+
default: []
|
|
55
|
+
},
|
|
56
|
+
textField: {
|
|
57
|
+
description: "",
|
|
58
|
+
type: "string",
|
|
59
|
+
default: "code"
|
|
60
|
+
},
|
|
61
|
+
editorParams: {
|
|
62
|
+
description: "",
|
|
63
|
+
type: "object",
|
|
64
|
+
default: {}
|
|
65
|
+
}
|
|
66
|
+
}, ie = {
|
|
67
|
+
$schema: Y,
|
|
68
|
+
$id: Z,
|
|
69
|
+
title: _,
|
|
70
|
+
description: ee,
|
|
71
|
+
type: te,
|
|
72
|
+
properties: ne
|
|
73
|
+
}, L = [
|
|
74
|
+
{ field: "name", title: "名称" },
|
|
75
|
+
{ field: "bindingField", title: "绑定字段" },
|
|
76
|
+
{ field: "fieldType", title: "字段类型" }
|
|
77
|
+
], H = [
|
|
78
|
+
{ field: "name", title: "名称" },
|
|
79
|
+
{ field: "code", title: "编号" },
|
|
80
|
+
{ field: "displayTypeName", title: "变量类型" }
|
|
81
|
+
], oe = [
|
|
82
|
+
{ value: "Form", text: "绑定字段" },
|
|
83
|
+
{ value: "LocaleVariable", text: "绑定组件变量" },
|
|
84
|
+
{ value: "RemoteVariable", text: "绑定表单变量" }
|
|
85
|
+
], k = {
|
|
86
|
+
disabled: { type: Boolean, default: !1 },
|
|
87
|
+
readonly: { type: Boolean, default: !1 },
|
|
88
|
+
modelValue: { type: Object, default: null },
|
|
89
|
+
bindingType: {
|
|
90
|
+
type: Object,
|
|
91
|
+
default: {
|
|
92
|
+
enable: !0,
|
|
93
|
+
value: "Form",
|
|
94
|
+
textField: "text",
|
|
95
|
+
valueField: "value"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
data: { type: Array, default: [] },
|
|
99
|
+
idField: { type: String, default: "id" },
|
|
100
|
+
title: { type: String, default: "字段选择器" },
|
|
101
|
+
modalWidth: { type: Number, default: 800 },
|
|
102
|
+
modalHeight: { type: Number, default: 600 },
|
|
103
|
+
multiSelect: { type: Boolean, default: !1 },
|
|
104
|
+
/**
|
|
105
|
+
* 可选,分隔符
|
|
106
|
+
* 默认`,`
|
|
107
|
+
*/
|
|
108
|
+
separator: { type: String, default: "," },
|
|
109
|
+
bindingData: { type: Array, default: [] },
|
|
110
|
+
textField: { type: String, default: "code" },
|
|
111
|
+
beforeOpenDialog: { type: Function, default: null },
|
|
112
|
+
editorParams: { type: Object, default: null },
|
|
113
|
+
onFieldSelected: { type: Function, default: null },
|
|
114
|
+
/** 是否显示自定义的底部按钮区域 */
|
|
115
|
+
showCustomFooter: { type: Boolean, default: !1 }
|
|
116
|
+
}, ae = Q(k, ie);
|
|
117
|
+
function U(e) {
|
|
118
|
+
const { designViewModelUtils: g } = e.editorParams.designerHostService, { formSchemaUtils: d } = e.editorParams.designerHostService, { viewModelId: o } = e.editorParams;
|
|
119
|
+
let h = [], f = [], S = [];
|
|
120
|
+
function v(t) {
|
|
121
|
+
switch (t) {
|
|
122
|
+
case "LocaleVariable":
|
|
123
|
+
return f;
|
|
124
|
+
case "RemoteVariable":
|
|
125
|
+
return S;
|
|
126
|
+
default:
|
|
127
|
+
return h;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function T() {
|
|
131
|
+
h = g.getAllFields2TreeByVMId(o);
|
|
132
|
+
}
|
|
133
|
+
function w() {
|
|
134
|
+
const t = d.getViewModelById(o);
|
|
135
|
+
if (t.parent) {
|
|
136
|
+
const a = d.getLocaleVariablesByViewModelId(t.parent);
|
|
137
|
+
a && a.length && (a[0].data.name = "根组件", f = f.concat(a));
|
|
138
|
+
}
|
|
139
|
+
const i = d.getLocaleVariablesByViewModelId(o);
|
|
140
|
+
f = f.concat(i);
|
|
141
|
+
}
|
|
142
|
+
function C() {
|
|
143
|
+
S = d.getRemoteVariables();
|
|
144
|
+
}
|
|
145
|
+
function M(t) {
|
|
146
|
+
var c, u, m;
|
|
147
|
+
const i = E({}, t.rawData, { groupId: null, groupName: null }), a = (c = e.editorParams.componentSchema) == null ? void 0 : c.binding, l = g.getDgViewModel(o);
|
|
148
|
+
if (a != null && a.field) {
|
|
149
|
+
const n = l.fields.find((s) => s.id === a.field);
|
|
150
|
+
if (l.removeField([a.field]), n) {
|
|
151
|
+
const { groupId: s, groupName: r, editor: b } = n;
|
|
152
|
+
E(i, { editor: b, groupId: s, groupName: r });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
l.addField(i), (m = (u = e.editorParams.componentSchema) == null ? void 0 : u.editor) != null && m.type && l.changeField(i.id, { editor: e.editorParams.componentSchema.editor.type });
|
|
156
|
+
}
|
|
157
|
+
function F(t) {
|
|
158
|
+
var c;
|
|
159
|
+
const i = (c = e.editorParams.componentSchema) == null ? void 0 : c.binding, a = g.getDgViewModel(o), l = {
|
|
160
|
+
type: "Variable",
|
|
161
|
+
id: t.id,
|
|
162
|
+
fieldName: t.code,
|
|
163
|
+
groupId: "",
|
|
164
|
+
groupName: ""
|
|
165
|
+
};
|
|
166
|
+
if (i != null && i.field) {
|
|
167
|
+
const u = d.getViewModelById(o), m = u == null ? void 0 : u.fields.find((n) => n.id === (i == null ? void 0 : i.field));
|
|
168
|
+
m && (l.groupName = m.groupName, l.groupId = m.groupId), a.removeField([i == null ? void 0 : i.field]);
|
|
169
|
+
}
|
|
170
|
+
d.addViewModelField(o, l);
|
|
171
|
+
}
|
|
172
|
+
function B(t, i) {
|
|
173
|
+
if (!e.editorParams.needSyncToViewModel || !e.editorParams.viewModelId || !e.editorParams.designerHostService)
|
|
174
|
+
return;
|
|
175
|
+
const a = e.editorParams.componentSchema.binding;
|
|
176
|
+
a && a.field === t.id || (i === "Form" ? M(t) : F(t));
|
|
177
|
+
}
|
|
178
|
+
function x(t, i) {
|
|
179
|
+
if (e.editorParams.componentSchema) {
|
|
180
|
+
switch (e.editorParams.componentSchema.binding || (e.editorParams.componentSchema.binding = {}), i) {
|
|
181
|
+
case "Form": {
|
|
182
|
+
e.editorParams.componentSchema.binding.path = t.bindingField, e.editorParams.componentSchema.binding.field = t.id, e.editorParams.componentSchema.binding.fullPath = t.path;
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
case "LocaleVariable": {
|
|
186
|
+
e.editorParams.componentSchema.binding.path = t.viewModelId === o ? t.code : "root-component." + t.code, e.editorParams.componentSchema.binding.field = t.id, e.editorParams.componentSchema.binding.fullPath = t.code;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
case "RemoteVariable": {
|
|
190
|
+
e.editorParams.componentSchema.binding.path = "root-component." + t.code, e.editorParams.componentSchema.binding.field = t.id, e.editorParams.componentSchema.binding.fullPath = t.code;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return e.editorParams.componentSchema.binding.type = i, e.editorParams.componentSchema.path = t.bindingPath, e.editorParams.componentSchema.binding;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function I(t) {
|
|
198
|
+
const i = t == null ? void 0 : t.field, a = /* @__PURE__ */ new Set(), l = d.getFormSchema().module, c = d.getViewModelById(o);
|
|
199
|
+
let m = l.components.find((n) => n.viewModel === o).componentType;
|
|
200
|
+
return (m === "frame" || m === "table") && (m = "form"), l.viewmodels.forEach((n) => {
|
|
201
|
+
if (!n.fields || n.fields.length === 0)
|
|
202
|
+
return;
|
|
203
|
+
const s = l.components.find((b) => b.viewModel === n.id);
|
|
204
|
+
let { componentType: r } = s;
|
|
205
|
+
(r === "frame" || r === "table") && (r = "form"), !(r !== m || n.bindTo !== c.bindTo) && n.fields.forEach((b) => {
|
|
206
|
+
b.id !== i && a.add(b.id);
|
|
207
|
+
});
|
|
208
|
+
}), a;
|
|
209
|
+
}
|
|
210
|
+
function V(t) {
|
|
211
|
+
if (!t)
|
|
212
|
+
return [];
|
|
213
|
+
const i = {}, { fieldControlTypeMapping: a } = X;
|
|
214
|
+
for (const l in a) {
|
|
215
|
+
const c = a[l];
|
|
216
|
+
!c || !c.length || c.forEach((u) => {
|
|
217
|
+
i[u.key] = i[u.key] || [], i[u.key].push(l);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return i[t];
|
|
221
|
+
}
|
|
222
|
+
function P() {
|
|
223
|
+
T(), w(), C();
|
|
224
|
+
}
|
|
225
|
+
return {
|
|
226
|
+
initTreeData: P,
|
|
227
|
+
getTreeDataSource: v,
|
|
228
|
+
updateViewModel: B,
|
|
229
|
+
updateComponentSchema: x,
|
|
230
|
+
resolveOccupiedFields: I,
|
|
231
|
+
resolveFieldTypesByEditorType: V
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const O = /* @__PURE__ */ A({
|
|
235
|
+
name: "FBindingSelectorContainer",
|
|
236
|
+
props: k,
|
|
237
|
+
emits: ["selected", "bindingTypeChange", "cancel", "submit"],
|
|
238
|
+
setup(e, g) {
|
|
239
|
+
var c, u, m;
|
|
240
|
+
const d = p(e.data), o = p(((c = e.modelValue) == null ? void 0 : c.type) || "Form"), h = p(e.bindingData), f = p(), S = p(), v = p(), {
|
|
241
|
+
getTreeDataSource: T,
|
|
242
|
+
initTreeData: w,
|
|
243
|
+
resolveOccupiedFields: C,
|
|
244
|
+
resolveFieldTypesByEditorType: M
|
|
245
|
+
} = U(e), F = p([]);
|
|
246
|
+
G(() => {
|
|
247
|
+
var n, s, r, b, R, $;
|
|
248
|
+
w(), d.value = T(o.value), (n = e.editorParams) != null && n.disableOccupiedFields && (S.value = C((r = (s = e.editorParams) == null ? void 0 : s.componentSchema) == null ? void 0 : r.binding)), v.value = M(($ = (R = (b = e.editorParams) == null ? void 0 : b.componentSchema) == null ? void 0 : R.editor) == null ? void 0 : $.type), F.value = o.value === "Form" ? L : H;
|
|
249
|
+
}), W(() => {
|
|
250
|
+
var s, r, b;
|
|
251
|
+
const n = (b = (r = (s = e.editorParams) == null ? void 0 : s.componentSchema) == null ? void 0 : r.binding) == null ? void 0 : b.field;
|
|
252
|
+
n && f.value.selectItemById(n);
|
|
253
|
+
});
|
|
254
|
+
const B = {
|
|
255
|
+
"f-utils-fill": !0,
|
|
256
|
+
"m-2": (u = e.bindingType) == null ? void 0 : u.enable,
|
|
257
|
+
"mx-2": !((m = e.bindingType) != null && m.enable),
|
|
258
|
+
border: !0
|
|
259
|
+
};
|
|
260
|
+
function x(n) {
|
|
261
|
+
F.value = n === "Form" ? L : H, f.value.updateColumns(F.value), d.value = T(n), f.value.updateDataSource(d.value), f.value.clearSelection(), h.value = [], g.emit("selected", []), g.emit("bindingTypeChange", n);
|
|
262
|
+
}
|
|
263
|
+
function I(n) {
|
|
264
|
+
h.value = n, g.emit("selected", n);
|
|
265
|
+
}
|
|
266
|
+
function V() {
|
|
267
|
+
return y("div", {
|
|
268
|
+
class: "px-3"
|
|
269
|
+
}, [y(J, {
|
|
270
|
+
name: "bindingType",
|
|
271
|
+
textField: e.bindingType.textField,
|
|
272
|
+
valueField: e.bindingType.valueField,
|
|
273
|
+
enumData: oe,
|
|
274
|
+
modelValue: o.value,
|
|
275
|
+
"onUpdate:modelValue": (n) => o.value = n,
|
|
276
|
+
onChangeValue: x
|
|
277
|
+
}, null)]);
|
|
278
|
+
}
|
|
279
|
+
const P = {
|
|
280
|
+
customRowStatus: (n) => {
|
|
281
|
+
var r;
|
|
282
|
+
if (n.raw.$type && n.raw.$type !== K.SimpleField || S.value && S.value.has(n.raw.id))
|
|
283
|
+
return n.disabled = !0, n;
|
|
284
|
+
const s = o.value === "Form" ? (r = n.raw.type) == null ? void 0 : r.name : n.raw.type;
|
|
285
|
+
return s && v.value && !v.value.includes(s) ? (n.disabled = !0, n) : (n.disabled = !1, n);
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
function t() {
|
|
289
|
+
return y(q, {
|
|
290
|
+
ref: f,
|
|
291
|
+
fit: !0,
|
|
292
|
+
data: d.value,
|
|
293
|
+
idField: e.idField,
|
|
294
|
+
columns: F.value,
|
|
295
|
+
rowNumber: {
|
|
296
|
+
enable: !1
|
|
297
|
+
},
|
|
298
|
+
columnOption: {
|
|
299
|
+
fitColumns: !0
|
|
300
|
+
},
|
|
301
|
+
onSelectionChange: I,
|
|
302
|
+
"row-option": P
|
|
303
|
+
}, null);
|
|
304
|
+
}
|
|
305
|
+
function i() {
|
|
306
|
+
g.emit("cancel");
|
|
307
|
+
}
|
|
308
|
+
function a() {
|
|
309
|
+
if (!h.value || !h.value.length) {
|
|
310
|
+
const n = new D();
|
|
311
|
+
return n.globalConfig = {
|
|
312
|
+
position: "top-center"
|
|
313
|
+
}, n.warning({
|
|
314
|
+
message: "请先选择数据"
|
|
315
|
+
}), !1;
|
|
316
|
+
}
|
|
317
|
+
return !0;
|
|
318
|
+
}
|
|
319
|
+
function l() {
|
|
320
|
+
a() && g.emit("submit", {
|
|
321
|
+
selectedData: h.value[0],
|
|
322
|
+
bindingType: o.value
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
return () => y("div", {
|
|
326
|
+
class: "h-100 d-flex flex-column"
|
|
327
|
+
}, [e.bindingType.enable && V(), y("div", {
|
|
328
|
+
class: B,
|
|
329
|
+
style: "position:relative;border-radius:10px;"
|
|
330
|
+
}, [t()]), e.showCustomFooter ? y("div", {
|
|
331
|
+
class: "modal-footer"
|
|
332
|
+
}, [y("button", {
|
|
333
|
+
type: "button",
|
|
334
|
+
class: "btn btn-secondary",
|
|
335
|
+
onClick: i
|
|
336
|
+
}, [j("取消")]), y("button", {
|
|
337
|
+
type: "button",
|
|
338
|
+
class: "btn btn-primary",
|
|
339
|
+
onClick: l
|
|
340
|
+
}, [j("确定")])]) : ""]);
|
|
341
|
+
}
|
|
342
|
+
}), N = /* @__PURE__ */ A({
|
|
343
|
+
name: "FBindingSelector",
|
|
344
|
+
props: k,
|
|
345
|
+
emits: ["selected", "bindingTypeChanged"],
|
|
346
|
+
setup(e, g) {
|
|
347
|
+
var V, P;
|
|
348
|
+
const d = '<i class="f-icon f-icon-lookup"></i>', o = p(e.bindingData), h = p(e.data), f = p(), S = p(((V = e.modelValue) == null ? void 0 : V.type) || "Form"), v = p((P = e.modelValue) == null ? void 0 : P.path), {
|
|
349
|
+
updateViewModel: T,
|
|
350
|
+
updateComponentSchema: w
|
|
351
|
+
} = U(e);
|
|
352
|
+
function C(t) {
|
|
353
|
+
o.value = t;
|
|
354
|
+
}
|
|
355
|
+
function M(t) {
|
|
356
|
+
S.value = t;
|
|
357
|
+
}
|
|
358
|
+
function F(t) {
|
|
359
|
+
v.value = t.path;
|
|
360
|
+
}
|
|
361
|
+
function B() {
|
|
362
|
+
return y(O, {
|
|
363
|
+
ref: f,
|
|
364
|
+
data: h.value,
|
|
365
|
+
onSelected: C,
|
|
366
|
+
modelValue: e.modelValue,
|
|
367
|
+
idField: e.idField,
|
|
368
|
+
bindingData: o.value,
|
|
369
|
+
onBindingTypeChange: M,
|
|
370
|
+
editorParams: e.editorParams,
|
|
371
|
+
bindingType: e.bindingType,
|
|
372
|
+
showCustomFooter: !1
|
|
373
|
+
}, null);
|
|
374
|
+
}
|
|
375
|
+
function x() {
|
|
376
|
+
if (!o.value || !o.value.length) {
|
|
377
|
+
const t = new D();
|
|
378
|
+
return t.globalConfig = {
|
|
379
|
+
position: "top-center"
|
|
380
|
+
}, t.warning({
|
|
381
|
+
message: "请先选择数据"
|
|
382
|
+
}), !1;
|
|
383
|
+
}
|
|
384
|
+
return !0;
|
|
385
|
+
}
|
|
386
|
+
const I = {
|
|
387
|
+
title: e.title,
|
|
388
|
+
fitContent: !1,
|
|
389
|
+
height: e.modalHeight,
|
|
390
|
+
width: e.modalWidth,
|
|
391
|
+
buttons: [{
|
|
392
|
+
name: "cancel",
|
|
393
|
+
text: "取消",
|
|
394
|
+
class: "btn btn-secondary",
|
|
395
|
+
handle: (t) => (o.value = [], !0)
|
|
396
|
+
}, {
|
|
397
|
+
name: "accept",
|
|
398
|
+
text: "确定",
|
|
399
|
+
class: "btn btn-primary",
|
|
400
|
+
handle: (t) => {
|
|
401
|
+
if (!x())
|
|
402
|
+
return !1;
|
|
403
|
+
T(o.value[0], S.value);
|
|
404
|
+
const i = w(o.value[0], S.value);
|
|
405
|
+
return F(i), e.onFieldSelected && typeof e.onFieldSelected == "function" && e.onFieldSelected(i), !0;
|
|
406
|
+
}
|
|
407
|
+
}],
|
|
408
|
+
reiszeable: !0,
|
|
409
|
+
draggable: !0
|
|
410
|
+
};
|
|
411
|
+
return () => y(z, {
|
|
412
|
+
modelValue: v.value,
|
|
413
|
+
"onUpdate:modelValue": (t) => v.value = t,
|
|
414
|
+
editable: !1,
|
|
415
|
+
disabled: e.disabled,
|
|
416
|
+
readonly: e.readonly,
|
|
417
|
+
inputType: "text",
|
|
418
|
+
enableClear: !1,
|
|
419
|
+
buttonContent: d,
|
|
420
|
+
buttonBehavior: "Modal",
|
|
421
|
+
modalOptions: I
|
|
422
|
+
}, {
|
|
423
|
+
default: () => [y("div", {
|
|
424
|
+
class: "h-100 d-flex flex-column"
|
|
425
|
+
}, [B()])]
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
N.install = (e) => {
|
|
430
|
+
e.component(N.name, N), e.component(O.name, O);
|
|
431
|
+
};
|
|
432
|
+
N.register = (e, g, d, o) => {
|
|
433
|
+
e["binding-selector"] = N, g["binding-selector"] = ae;
|
|
434
|
+
};
|
|
435
|
+
export {
|
|
436
|
+
N as BindingSelector,
|
|
437
|
+
O as FBindingSelectorContainer,
|
|
438
|
+
k as bindingSelectorProps,
|
|
439
|
+
oe as bindingTypes,
|
|
440
|
+
N as default,
|
|
441
|
+
L as fieldColumns,
|
|
442
|
+
ae as propsResolver,
|
|
443
|
+
H as variableColumns
|
|
444
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(l,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("../button-edit/index.umd.js"),require("../notify/index.umd.js"),require("../tree-grid/index.umd.js"),require("../radio-group/index.umd.js"),require("../common/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../property-panel/index.umd.js"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","../button-edit/index.umd.js","../notify/index.umd.js","../tree-grid/index.umd.js","../radio-group/index.umd.js","../common/index.umd.js","../dynamic-resolver/index.umd.js","../property-panel/index.umd.js","lodash-es"],i):(l=typeof globalThis<"u"?globalThis:l||self,i(l["binding-selector"]={},l.Vue,l.FButtonEdit,l.notify,l.FTreeGrid,l.FRadioGroup,l.common,l.dynamicResolver,l.propertyPanel,l.LodashES))})(this,function(l,i,U,$,G,W,_,z,J,q){"use strict";const K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/binding-selector.schema.json",title:"binding-selector",description:"字段绑定选择器",type:"object",properties:{disabled:{description:"",type:"boolean",default:!1},readonly:{description:"",type:"boolean",default:!1},bindingType:{description:"",type:"object",default:{}},idField:{description:"",type:"string",default:"id"},title:{description:"",type:"string",default:"字段选择器"},modalWidth:{description:"",type:"number",default:800},modalHeight:{description:"",type:"number",default:600},separator:{description:"",type:"string",default:","},bindingData:{description:"",type:"array",default:[]},textField:{description:"",type:"string",default:"code"},editorParams:{description:"",type:"object",default:{}}}},R=[{field:"name",title:"名称"},{field:"bindingField",title:"绑定字段"},{field:"fieldType",title:"字段类型"}],k=[{field:"name",title:"名称"},{field:"code",title:"编号"},{field:"displayTypeName",title:"变量类型"}],E=[{value:"Form",text:"绑定字段"},{value:"LocaleVariable",text:"绑定组件变量"},{value:"RemoteVariable",text:"绑定表单变量"}],I={disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},modelValue:{type:Object,default:null},bindingType:{type:Object,default:{enable:!0,value:"Form",textField:"text",valueField:"value"}},data:{type:Array,default:[]},idField:{type:String,default:"id"},title:{type:String,default:"字段选择器"},modalWidth:{type:Number,default:800},modalHeight:{type:Number,default:600},multiSelect:{type:Boolean,default:!1},separator:{type:String,default:","},bindingData:{type:Array,default:[]},textField:{type:String,default:"code"},beforeOpenDialog:{type:Function,default:null},editorParams:{type:Object,default:null},onFieldSelected:{type:Function,default:null},showCustomFooter:{type:Boolean,default:!1}},L=z.createPropsResolver(I,K);function H(e){const{designViewModelUtils:p}=e.editorParams.designerHostService,{formSchemaUtils:c}=e.editorParams.designerHostService,{viewModelId:d}=e.editorParams;let h=[],g=[],S=[];function F(t){switch(t){case"LocaleVariable":return g;case"RemoteVariable":return S;default:return h}}function v(){h=p.getAllFields2TreeByVMId(d)}function C(){const t=c.getViewModelById(d);if(t.parent){const a=c.getLocaleVariablesByViewModelId(t.parent);a&&a.length&&(a[0].data.name="根组件",g=g.concat(a))}const o=c.getLocaleVariablesByViewModelId(d);g=g.concat(o)}function M(){S=c.getRemoteVariables()}function N(t){var s,m,f;const o=q.merge({},t.rawData,{groupId:null,groupName:null}),a=(s=e.editorParams.componentSchema)==null?void 0:s.binding,r=p.getDgViewModel(d);if(a!=null&&a.field){const n=r.fields.find(y=>y.id===a.field);if(r.removeField([a.field]),n){const{groupId:y,groupName:u,editor:b}=n;q.merge(o,{editor:b,groupId:y,groupName:u})}}r.addField(o),(f=(m=e.editorParams.componentSchema)==null?void 0:m.editor)!=null&&f.type&&r.changeField(o.id,{editor:e.editorParams.componentSchema.editor.type})}function V(t){var s;const o=(s=e.editorParams.componentSchema)==null?void 0:s.binding,a=p.getDgViewModel(d),r={type:"Variable",id:t.id,fieldName:t.code,groupId:"",groupName:""};if(o!=null&&o.field){const m=c.getViewModelById(d),f=m==null?void 0:m.fields.find(n=>n.id===(o==null?void 0:o.field));f&&(r.groupName=f.groupName,r.groupId=f.groupId),a.removeField([o==null?void 0:o.field])}c.addViewModelField(d,r)}function x(t,o){if(!e.editorParams.needSyncToViewModel||!e.editorParams.viewModelId||!e.editorParams.designerHostService)return;const a=e.editorParams.componentSchema.binding;a&&a.field===t.id||(o==="Form"?N(t):V(t))}function j(t,o){if(e.editorParams.componentSchema){switch(e.editorParams.componentSchema.binding||(e.editorParams.componentSchema.binding={}),o){case"Form":{e.editorParams.componentSchema.binding.path=t.bindingField,e.editorParams.componentSchema.binding.field=t.id,e.editorParams.componentSchema.binding.fullPath=t.path;break}case"LocaleVariable":{e.editorParams.componentSchema.binding.path=t.viewModelId===d?t.code:"root-component."+t.code,e.editorParams.componentSchema.binding.field=t.id,e.editorParams.componentSchema.binding.fullPath=t.code;break}case"RemoteVariable":{e.editorParams.componentSchema.binding.path="root-component."+t.code,e.editorParams.componentSchema.binding.field=t.id,e.editorParams.componentSchema.binding.fullPath=t.code;break}}return e.editorParams.componentSchema.binding.type=o,e.editorParams.componentSchema.path=t.bindingPath,e.editorParams.componentSchema.binding}}function B(t){const o=t==null?void 0:t.field,a=new Set,r=c.getFormSchema().module,s=c.getViewModelById(d);let f=r.components.find(n=>n.viewModel===d).componentType;return(f==="frame"||f==="table")&&(f="form"),r.viewmodels.forEach(n=>{if(!n.fields||n.fields.length===0)return;const y=r.components.find(b=>b.viewModel===n.id);let{componentType:u}=y;(u==="frame"||u==="table")&&(u="form"),!(u!==f||n.bindTo!==s.bindTo)&&n.fields.forEach(b=>{b.id!==o&&a.add(b.id)})}),a}function P(t){if(!t)return[];const o={},{fieldControlTypeMapping:a}=J.SchemaDOMMapping;for(const r in a){const s=a[r];!s||!s.length||s.forEach(m=>{o[m.key]=o[m.key]||[],o[m.key].push(r)})}return o[t]}function w(){v(),C(),M()}return{initTreeData:w,getTreeDataSource:F,updateViewModel:x,updateComponentSchema:j,resolveOccupiedFields:B,resolveFieldTypesByEditorType:P}}const O=i.defineComponent({name:"FBindingSelectorContainer",props:I,emits:["selected","bindingTypeChange","cancel","submit"],setup(e,p){var s,m,f;const c=i.ref(e.data),d=i.ref(((s=e.modelValue)==null?void 0:s.type)||"Form"),h=i.ref(e.bindingData),g=i.ref(),S=i.ref(),F=i.ref(),{getTreeDataSource:v,initTreeData:C,resolveOccupiedFields:M,resolveFieldTypesByEditorType:N}=H(e),V=i.ref([]);i.onBeforeMount(()=>{var n,y,u,b,A,D;C(),c.value=v(d.value),(n=e.editorParams)!=null&&n.disableOccupiedFields&&(S.value=M((u=(y=e.editorParams)==null?void 0:y.componentSchema)==null?void 0:u.binding)),F.value=N((D=(A=(b=e.editorParams)==null?void 0:b.componentSchema)==null?void 0:A.editor)==null?void 0:D.type),V.value=d.value==="Form"?R:k}),i.onMounted(()=>{var y,u,b;const n=(b=(u=(y=e.editorParams)==null?void 0:y.componentSchema)==null?void 0:u.binding)==null?void 0:b.field;n&&g.value.selectItemById(n)});const x={"f-utils-fill":!0,"m-2":(m=e.bindingType)==null?void 0:m.enable,"mx-2":!((f=e.bindingType)!=null&&f.enable),border:!0};function j(n){V.value=n==="Form"?R:k,g.value.updateColumns(V.value),c.value=v(n),g.value.updateDataSource(c.value),g.value.clearSelection(),h.value=[],p.emit("selected",[]),p.emit("bindingTypeChange",n)}function B(n){h.value=n,p.emit("selected",n)}function P(){return i.createVNode("div",{class:"px-3"},[i.createVNode(W,{name:"bindingType",textField:e.bindingType.textField,valueField:e.bindingType.valueField,enumData:E,modelValue:d.value,"onUpdate:modelValue":n=>d.value=n,onChangeValue:j},null)])}const w={customRowStatus:n=>{var u;if(n.raw.$type&&n.raw.$type!==_.FormSchemaEntityField$Type.SimpleField||S.value&&S.value.has(n.raw.id))return n.disabled=!0,n;const y=d.value==="Form"?(u=n.raw.type)==null?void 0:u.name:n.raw.type;return y&&F.value&&!F.value.includes(y)?(n.disabled=!0,n):(n.disabled=!1,n)}};function t(){return i.createVNode(G,{ref:g,fit:!0,data:c.value,idField:e.idField,columns:V.value,rowNumber:{enable:!1},columnOption:{fitColumns:!0},onSelectionChange:B,"row-option":w},null)}function o(){p.emit("cancel")}function a(){if(!h.value||!h.value.length){const n=new $.FNotifyService;return n.globalConfig={position:"top-center"},n.warning({message:"请先选择数据"}),!1}return!0}function r(){a()&&p.emit("submit",{selectedData:h.value[0],bindingType:d.value})}return()=>i.createVNode("div",{class:"h-100 d-flex flex-column"},[e.bindingType.enable&&P(),i.createVNode("div",{class:x,style:"position:relative;border-radius:10px;"},[t()]),e.showCustomFooter?i.createVNode("div",{class:"modal-footer"},[i.createVNode("button",{type:"button",class:"btn btn-secondary",onClick:o},[i.createTextVNode("取消")]),i.createVNode("button",{type:"button",class:"btn btn-primary",onClick:r},[i.createTextVNode("确定")])]):""])}}),T=i.defineComponent({name:"FBindingSelector",props:I,emits:["selected","bindingTypeChanged"],setup(e,p){var P,w;const c='<i class="f-icon f-icon-lookup"></i>',d=i.ref(e.bindingData),h=i.ref(e.data),g=i.ref(),S=i.ref(((P=e.modelValue)==null?void 0:P.type)||"Form"),F=i.ref((w=e.modelValue)==null?void 0:w.path),{updateViewModel:v,updateComponentSchema:C}=H(e);function M(t){d.value=t}function N(t){S.value=t}function V(t){F.value=t.path}function x(){return i.createVNode(O,{ref:g,data:h.value,onSelected:M,modelValue:e.modelValue,idField:e.idField,bindingData:d.value,onBindingTypeChange:N,editorParams:e.editorParams,bindingType:e.bindingType,showCustomFooter:!1},null)}function j(){if(!d.value||!d.value.length){const t=new $.FNotifyService;return t.globalConfig={position:"top-center"},t.warning({message:"请先选择数据"}),!1}return!0}const B={title:e.title,fitContent:!1,height:e.modalHeight,width:e.modalWidth,buttons:[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:t=>(d.value=[],!0)},{name:"accept",text:"确定",class:"btn btn-primary",handle:t=>{if(!j())return!1;v(d.value[0],S.value);const o=C(d.value[0],S.value);return V(o),e.onFieldSelected&&typeof e.onFieldSelected=="function"&&e.onFieldSelected(o),!0}}],reiszeable:!0,draggable:!0};return()=>i.createVNode(U,{modelValue:F.value,"onUpdate:modelValue":t=>F.value=t,editable:!1,disabled:e.disabled,readonly:e.readonly,inputType:"text",enableClear:!1,buttonContent:c,buttonBehavior:"Modal",modalOptions:B},{default:()=>[i.createVNode("div",{class:"h-100 d-flex flex-column"},[x()])]})}});T.install=e=>{e.component(T.name,T),e.component(O.name,O)},T.register=(e,p,c,d)=>{e["binding-selector"]=T,p["binding-selector"]=L},l.BindingSelector=T,l.FBindingSelectorContainer=O,l.bindingSelectorProps=I,l.bindingTypes=E,l.default=T,l.fieldColumns=R,l.propsResolver=L,l.variableColumns=k,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -24,9 +24,11 @@ const w = {
|
|
|
24
24
|
radiuses: { type: Array, default: [0, 0, 0, 0, 0] }
|
|
25
25
|
};
|
|
26
26
|
function V(o, b) {
|
|
27
|
-
const
|
|
27
|
+
const {
|
|
28
|
+
defaultBorderStyles: a
|
|
29
|
+
} = o, s = u(o.styles), c = u(o.widths), i = u(o.colors), n = u(o.radiuses), r = u(4), v = u(!0), y = B(() => function(t) {
|
|
28
30
|
return {
|
|
29
|
-
background: r.value
|
|
31
|
+
background: r.value === t ? "linear-gradient(rgba(0, 0, 0, .4), rgba(0, 0, 0, .2))" : "rgba(0, 0, 0, 0)"
|
|
30
32
|
};
|
|
31
33
|
}), f = B(() => ({
|
|
32
34
|
borderStyle: s.value.slice(0, 4).join(" "),
|
|
@@ -127,7 +129,7 @@ function V(o, b) {
|
|
|
127
129
|
function O(o, b) {
|
|
128
130
|
const a = u(o.styles), s = u(o.widths), c = u(o.colors), i = u(o.radiuses), n = u(4), r = u(!0), v = B(() => function(d) {
|
|
129
131
|
return {
|
|
130
|
-
background: n.value
|
|
132
|
+
background: n.value === d ? "linear-gradient(rgba(0, 0, 0, .4), rgba(0, 0, 0, .2))" : "rgba(0, 0, 0, 0)"
|
|
131
133
|
};
|
|
132
134
|
}), y = B(() => ({
|
|
133
135
|
borderStyle: a.value.slice(0, 4).join(" "),
|