@farris/ui-vue 1.3.0 → 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 +454 -398
- 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 +479 -476
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +255 -252
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +652 -567
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +518 -521
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +659 -553
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +162 -155
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +866 -747
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +371 -998
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1174 -1280
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +340 -991
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +6066 -5847
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3400 -3486
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2328 -2446
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +9551 -1200
- 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 +234 -231
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1996 -2630
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +138 -123
- 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 +548 -586
- 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 +2871 -3736
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +3380 -3645
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +10543 -3207
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +9775 -1312
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +442 -438
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +587 -807
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +415 -381
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +361 -1024
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +2265 -2371
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +6425 -6257
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +6164 -5946
- 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 +524 -1474
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +547 -502
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +646 -574
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1181 -2028
- 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 +1185 -2027
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +442 -1368
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +238 -235
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1635 -1713
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +791 -716
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +12203 -5274
- 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 +1873 -520
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +299 -300
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +176 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +715 -659
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +1032 -1883
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +4767 -5693
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +169 -161
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +490 -1167
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +154 -151
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +575 -1204
- package/components/splitter/index.umd.cjs +1 -1
- package/components/splitter/style.js +2 -0
- package/components/step/index.esm.js +279 -276
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +478 -428
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +2591 -3326
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +442 -439
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +309 -307
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +500 -430
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +1391 -1341
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +574 -575
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3422 -3536
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2661 -2764
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +675 -674
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +300 -297
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +454 -1089
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +709 -706
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +54780 -52757
- 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/directive/area-response.d.ts +10 -0
- package/types/common/entity/entity-schema.d.ts +26 -11
- package/types/common/index.d.ts +9 -0
- package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
- package/types/common/types.d.ts +2 -2
- package/types/common/utils/resolve-field.d.ts +2 -0
- package/types/common/utils/use-class.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/condition/src/condition-fields.design.component.d.ts +18 -0
- package/types/condition/src/types.d.ts +5 -4
- package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/data-grid/index.d.ts +8 -5
- 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.component.d.ts +3 -2
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/designer/grid-field-editor.component.d.ts +14 -14
- package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-grid/src/schema/schema-resolver.d.ts +1 -1
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +9 -11
- 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 +3 -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/rule/use-dragula-common-rule.d.ts +4 -0
- package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
- package/types/designer-canvas/src/composition/types.d.ts +49 -41
- package/types/designer-canvas/src/types.d.ts +10 -21
- 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/designer/response-form-use-designer-rules.d.ts +3 -0
- package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
- package/types/dynamic-form/src/property-config/{form.property-config.d.ts → response-form.property-config.d.ts} +1 -1
- 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 +6 -1
- 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/external-container/src/designer/use-designer-rules.d.ts +3 -3
- 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/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
- package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
- 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/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
- package/types/property-panel/index.d.ts +3 -1
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -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 +43 -35
- package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
- package/types/query-solution/src/designer/query-solution-config/composition/use-property.d.ts +19 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
- 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 +12 -0
- package/types/query-solution/src/query-solution.d.ts +10 -2
- package/types/query-solution/src/solutions.d.ts +108 -509
- 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-layout-editor/index.d.ts +3 -1
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -0
- package/types/section/src/designer/use-designer-rules.d.ts +3 -3
- 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/splitter/src/components/splitter-pane.component.d.ts +1 -1
- package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
- package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/composition/types.d.ts +4 -1
- package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
- 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/tree-grid/index.d.ts +3 -3
- package/types/tree-grid/src/tree-grid.component.d.ts +1 -1
- 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/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
- package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +0 -3
- package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
- package/types/property-panel/src/composition/entity/use-input-rules.d.ts +0 -3
- package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
- package/types/tree-grid/src/schema/column-resolver.d.ts +0 -3
- package/types/weather/src/composition/types.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("lodash-es"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../response-layout-editor/index.umd.js/src/composition/converter/use-response-layout-editor-setting"),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","../response-layout-editor/index.umd.js/src/composition/converter/use-response-layout-editor-setting","../common/index.umd.js"],d):(f=typeof globalThis<"u"?globalThis:f||self,d(f.avatar={},f.Vue,f.LodashES,f.dynamicResolver,f.designerCanvas,f.useResponseLayoutEditorSetting,f.common))})(this,function(f,d,v,I,E,V,S){"use strict";var te=Object.defineProperty;var ne=(f,d,v)=>d in f?te(f,d,{enumerable:!0,configurable:!0,writable:!0,value:v}):f[d]=v;var h=(f,d,v)=>ne(f,typeof d!="symbol"?d+"":d,v);const R={},L={};function w(i){const{properties:o,title:e,ignore:t}=i,n=t&&Array.isArray(t),a=Object.keys(o).reduce((c,A)=>((!n||!t.find(p=>p==A))&&(c[A]=o[A].type==="object"&&o[A].properties?w(o[A]):v.cloneDeep(o[A].default)),c),{});return(!n||!t.find(c=>c=="id"))&&(a.id=`${e}-${Date.now()}`),a}function N(i,o){const e=w(o);return Object.keys(i).reduce((t,n)=>(t[n]&&v.isPlainObject(t[n])&&v.isPlainObject(i[n])?Object.assign(t[n],i[n]):t[n]=i[n],t),e),e}function q(i,o){return Object.keys(i).filter(t=>i[t]!=null).reduce((t,n)=>{if(o.has(n)){const a=o.get(n);if(typeof a=="string")t[a]=i[n];else{const c=a(n,i[n],i);Object.assign(t,c)}}else t[n]=i[n];return t},{})}function j(i,o,e=new Map){const t=N(i,o);return q(t,e)}function D(i={}){function o(r,u,s,y){if(typeof s=="number")return y[r].length===s;if(typeof s=="object"){const m=Object.keys(s)[0],g=s[m];if(m==="not")return Number(y[r].length)!==Number(g);if(m==="moreThan")return Number(y[r].length)>=Number(g);if(m==="lessThan")return Number(y[r].length)<=Number(g)}return!1}function e(r,u,s,y){return y[r]&&y[r].propertyValue&&String(y[r].propertyValue.value)===String(s)}const t=new Map([["length",o],["getProperty",e]]);Object.keys(i).reduce((r,u)=>(r.set(u,i[u]),r),t);function n(r,u){const s=r;return typeof u=="number"?[{target:s,operator:"length",param:null,value:Number(u)}]:typeof u=="boolean"?[{target:s,operator:"getProperty",param:r,value:!!u}]:typeof u=="object"?Object.keys(u).map(y=>{if(y==="length")return{target:s,operator:"length",param:null,value:u[y]};const m=y,g=u[y];return{target:s,operator:"getProperty",param:m,value:g}}):[]}function a(r){return Object.keys(r).reduce((s,y)=>{const m=n(y,r[y]);return s.push(...m),s},[])}function c(r,u){if(t.has(r.operator)){const s=t.get(r.operator);return s&&s(r.target,r.param,r.value,u)||!1}return!1}function A(r,u){return a(r).reduce((m,g)=>m&&c(g,u),!0)}function p(r,u){const s=Object.keys(r),y=s.includes("allOf"),m=s.includes("anyOf"),g=y||m,F=(g?r[g?y?"allOf":"anyOf":"allOf"]:[r]).map(ee=>A(ee,u));return y?!F.includes(!1):F.includes(!0)}return{parseValueSchema:p}}const l={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"}},H={},U={};D();function Q(i,o,e=new Map,t=(c,A,p)=>A,n={},a=c=>c){return R[o.title]=o,L[o.title]=t,H[o.title]=n,U[o.title]=a,(c={})=>{const A=j(c,o,e),p=Object.keys(i).reduce((r,u)=>(r[u]=i[u].default,r),{});return Object.assign(p,A)}}function O(i,o,e){return o}const W=new Map([["appearance",I.resolveAppearance]]),G={$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"]},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"]}},x=Q(T,G,W,O);function P(i,o,e,t){const n="data:image/jpeg;base64,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",a=d.ref(i.readonly);function c(m){return m.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/)!=null}function A(m){return m.indexOf("data:image/")>-1}function p(m){return m?"data:image/jpeg;base64,"+m:""}const r=d.computed(()=>{var g;if(!i.imageType||!i.imageType.length)return"";const m=(g=i.imageType)==null?void 0:g.map(C=>(C==="jpg"&&(C="jpeg"),`image/${C}`));return!m||!m.length?"image/*":m.join(",")}),u=d.computed(()=>{const m=t.value||i.cover||n;return c(m)||A(m)?m:p(m)}),s=d.computed(()=>a.value?"":i.title);function y(){a.value||e&&e.value&&e.value.click()}return{acceptTypes:r,imageSource:u,imageTitle:s,onClickImage:y}}const B=d.defineComponent({name:"FAvatar",props:T,emits:["change","update:modelValue"],setup(i,o){const e=d.computed(()=>({"f-avatar":!0,"f-avatar-readonly":i.readonly,"f-avatar-circle":i.shape==="circle","f-avatar-square":i.shape==="square"})),t=d.ref(i.modelValue),n=d.computed(()=>({width:i.avatarWidth+"px",height:i.avatarHeight+"px"})),a=!1;function c(){return""}function A(){}const p=d.ref(null),{acceptTypes:r,imageSource:u,onClickImage:s}=P(i,o,p,t);return()=>d.createVNode("div",{class:e.value,style:n.value,onClick:s},[a,d.createVNode("img",{title:i.title,class:"f-avatar-image",src:u.value,onError:c},null),!i.readonly&&d.createVNode("div",{class:"f-avatar-icon"},[d.createVNode("span",{class:"f-icon f-icon-camera"},null)]),d.createVNode("input",{ref:"file",name:"file-input",type:"file",class:"f-avatar-upload",accept:r.value,onChange:A,style:"display: none;"},null)])}});function Z(i,o){i.schema;const e=d.ref(!0),t=d.ref(!0);function n(s){return!1}function a(){return!1}function c(){return!1}function A(){return!0}function p(s){}function r(){}function u(s){return null}return{canAccepts:n,checkCanDeleteComponent:a,checkCanMoveComponent:c,hideNestedPaddingInDesginerView:A,onAcceptMovedChildElement:p,resolveComponentContext:r,triggerBelongedComponentToMoveWhenMoved:e,triggerBelongedComponentToDeleteWhenDeleted:t,getPropsConfig:u}}class z{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 t;this.componentId=o,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((t=this.formSchemaUtils)==null?void 0:t.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){const e=o.binding&&o.binding.type==="Form"&&o.binding.field;if(e){if(!this.designViewModelField){const t=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=t.fields.find(n=>n.id===e)}o.updateOn=this.designViewModelField.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:l[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 t=e&&e.parent&&e.parent.schema;if(!t)return;const n=t.contents.findIndex(c=>c.id===o),a=v.cloneDeep(t.contents[n]);t.contents.splice(n,1),t.contents.splice(n,0,a)}}const b=class b{static getEditorTypesByMDataType(o){const e=b.fieldControlTypeMapping[o];return e||[{key:"",value:""}]}static getAllInputTypes(){const o=[];for(let e in b.fieldControlTypeMapping)b.fieldControlTypeMapping[e].forEach(t=>{o.find(n=>n.key===t.key&&n.value===t.value)||o.push({key:t.key,value:t.value})});return o}};h(b,"fieldControlTypeMapping",{String:[{key:l["input-group"].type,value:l["input-group"].name},{key:l.lookup.type,value:l.lookup.name},{key:l["date-picker"].type,value:l["date-picker"].name},{key:l["check-box"].type,value:l["check-box"].name},{key:l["radio-group"].type,value:l["radio-group"].name},{key:l["combo-list"].type,value:l["combo-list"].name},{key:l.textarea.type,value:l.textarea.name}],Text:[{key:l.textarea.type,value:l.textarea.name},{key:l.lookup.type,value:l.lookup.name}],Decimal:[{key:l["number-spinner"].type,value:l["number-spinner"].name}],Integer:[{key:l["number-spinner"].type,value:l["number-spinner"].name}],Number:[{key:l["number-spinner"].type,value:l["number-spinner"].name}],BigNumber:[{key:l["number-spinner"].type,value:l["number-spinner"].name}],Date:[{key:l["date-picker"].type,value:l["date-picker"].name}],DateTime:[{key:l["date-picker"].type,value:l["date-picker"].name}],Boolean:[{key:l.switch.type,value:l.switch.name},{key:l["check-box"].type,value:l["check-box"].name}],Enum:[{key:l["combo-list"].type,value:l["combo-list"].name},{key:l["radio-group"].type,value:l["radio-group"].name}],Object:[{key:l.lookup.type,value:l.lookup.name},{key:l["combo-list"].type,value:l["combo-list"].name},{key:l["radio-group"].type,value:l["radio-group"].name}]});let k=b;const K=d.ref(0);class J extends z{constructor(e,t){super(e,t);h(this,"responseLayoutEditorFunction");this.responseLayoutEditorFunction=V.useResponseLayoutEditorSetting(this.formSchemaUtils)}getPropertyConfig(e,t){return this.propertyConfig.categories.basic=this.getBasicProperties(e,t),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e,t),this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig}getBasicProperties(e,t){var A;var n=this;this.setDesignViewModelField(e);const a=this.formSchemaUtils.getFormMetadataBasicInfo(),c=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:n.designViewModelField?k.getEditorTypesByMDataType((A=n.designViewModelField.type)==null?void 0:A.name):k.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:e,formBasicInfo:a},columns:[{field:"name",title:"字段名称"},{field:"bindingField",title:"绑定字段"},{field:"fieldType",title:"字段类型"}],textField:"bindingField",data:c}}},setPropertyRelates(p,r){if(p)switch(p&&p.propertyID){case"type":{n.changeControlType(e,p,t);break}case"label":{p.needRefreshControlTree=!0;break}}}}}getAppearanceProperties(e,t){var n=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:n.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e,n.componentId)}}},setPropertyRelates(a,c){if(a)switch(a&&a.propertyID){case"responseLayout":n.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(a.propertyValue,n.componentId||e.id),n.updateUnifiedLayoutAfterResponseLayoutChanged(n.componentId),n.updateElementByParentContainer(e.id,t),delete e.responseLayout;break;case"class":n.updateUnifiedLayoutAfterControlChanged(a.propertyValue,e.id,this.componentId),n.updateElementByParentContainer(e.id,t);break}}}}getEditorProperties(e){return this.getComponentConfig(e)}changeControlType(e,t,n){var u,s,y,m;const a=t.propertyValue,c=n&&n.parent&&n.parent.schema;if(!c)return;const A=c.contents.findIndex(g=>g.id===e.id),p=c.contents[A];let r;this.designViewModelField&&(this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,{editor:{$type:a},name:this.designViewModelField.name,require:this.designViewModelField.require,readonly:this.designViewModelField.readonly},!1),r=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)),r||(r=I.getSchemaByType("form-group")||{},r.editor=I.getSchemaByType(a)||{},delete r.editor.id,delete r.editor.binding,delete r.editor.appearance),Object.assign(r,{id:p.id,appearance:p.appearance,size:p.size,label:p.label,binding:p.binding,visible:p.visible}),Object.assign(r.editor,{isTextArea:r.isTextArea&&p.isTextArea,placeholder:(u=p.editor)==null?void 0:u.placeholder,holdPlace:(s=p.editor)==null?void 0:s.holdPlace,readonly:(y=p.editor)==null?void 0:y.readonly,require:(m=p.editor)==null?void 0:m.require}),c.contents.splice(A,1),c.contents.splice(A,0,r),n.schema=Object.assign(p,r),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(g=>g.classList.remove("dgComponentSelected")),K.value++}getComponentConfig(e,t={},n={}){const a=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter"},t),c=Object.assign({readonly:{description:"",title:"只读",type:"boolean"},disabled:{description:"",title:"禁用",type:"boolean"},placeholder:{description:"空值时,输入控件内的占位文本",title:"提示文本",type:"string"}},n);return{...a,properties:{...c}}}updateUnifiedLayoutAfterControlChanged(e,t,n){const a=e.split(" ");let c=a.find(s=>/^col-([1-9]|10|11|12)$/.test(s)),A=a.find(s=>/^col-md-([1-9]|10|11|12)$/.test(s)),p=a.find(s=>/^col-xl-([1-9]|10|11|12)$/.test(s)),r=a.find(s=>/^col-el-([1-9]|10|11|12)$/.test(s));c=c||"col-12",A=A||"col-md-"+c.replace("col-",""),p=p||"col-xl-"+A.replace("col-md-",""),r=r||"col-el-"+p.replace("col-xl-","");const u={id:t,columnInSM:parseInt(c.replace("col-",""),10),columnInMD:parseInt(A.replace("col-md-",""),10),columnInLG:parseInt(p.replace("col-xl-",""),10),columnInEL:parseInt(r.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(n,u)}updateUnifiedLayoutAfterResponseLayoutChanged(e,t){const{formNode:n}=this.responseLayoutEditorFunction.checkCanFindFormNode(e);if(!n||!n.unifiedLayout)return;const a=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(n,a,1),t){const g=a.find(C=>C.id===t.id);Object.assign(g||{},t)}const c=a.map(g=>g.columnInSM),A=a.map(g=>g.columnInMD),p=a.map(g=>g.columnInLG),r=a.map(g=>g.columnInEL),u=this.checkIsUniqueColumn(c)?c[0]:null,s=this.checkIsUniqueColumn(A)?A[0]:null,y=this.checkIsUniqueColumn(p)?p[0]:null,m=this.checkIsUniqueColumn(r)?r[0]:null;Object.assign(n.unifiedLayout,{uniqueColClassInSM:u,uniqueColClassInMD:s,uniqueColClassInLG:y,uniqueColClassInEL:m})}checkIsUniqueColumn(e){const t=new Set(e);return Array.from(t).length===1}}class Y extends J{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 X(i,o){const{canAccepts:e,checkCanDeleteComponent:t,checkCanMoveComponent:n,hideNestedPaddingInDesginerView:a,onAcceptMovedChildElement:c,resolveComponentContext:A,triggerBelongedComponentToMoveWhenMoved:p,triggerBelongedComponentToDeleteWhenDeleted:r}=Z(i),u=i.schema;function s(y,m){return new Y(y,o).getPropertyConfig(u,m)}return{canAccepts:e,checkCanDeleteComponent:t,checkCanMoveComponent:n,hideNestedPaddingInDesginerView:a,onAcceptMovedChildElement:c,resolveComponentContext:A,triggerBelongedComponentToMoveWhenMoved:p,triggerBelongedComponentToDeleteWhenDeleted:r,getPropsConfig:s}}const $=d.defineComponent({name:"FAvatarDesign",props:T,emits:["change","update:modelValue"],setup(i,o){const e=d.ref(),t=d.inject("designer-host-service"),n=d.inject("design-item-context"),a=X(n,t),c=E.useDesignerComponent(e,n,a);d.onMounted(()=>{e.value.componentInstance=c}),o.expose(c.value);const A=d.computed(()=>({"f-avatar":!0,"f-avatar-readonly":i.readonly,"f-avatar-circle":i.shape==="circle","f-avatar-square":i.shape==="square"})),p=d.ref(i.modelValue),r=d.computed(()=>({width:i.avatarWidth+"px",height:i.avatarHeight+"px"})),u=!1;function s(){return""}function y(){}const m=d.ref(null),{acceptTypes:g,imageSource:C,onClickImage:M}=P(i,o,m,p);return()=>d.createVNode("div",{ref:e,class:A.value,style:r.value,onClick:M},[u,d.createVNode("img",{title:i.title,class:"f-avatar-image",src:C.value,onError:s},null),!i.readonly&&d.createVNode("div",{class:"f-avatar-icon"},[d.createVNode("span",{class:"f-icon f-icon-camera"},null)]),d.createVNode("input",{ref:"file",name:"file-input",type:"file",class:"f-avatar-upload",accept:g.value,onChange:y,style:"display: none;"},null)])}});B.register=(i,o,e,t)=>{i.avatar=B,o.avatar=x},B.registerDesigner=(i,o,e)=>{i.avatar=$,o.avatar=x};const _=S.withInstall(B);f.FAvatar=B,f.avatarProps=T,f.default=_,f.propsResolver=x,Object.defineProperties(f,{__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(" "),
|