@gct-paas/design 0.0.1-dev.9 → 0.1.0
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/dist/index.min.cjs +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/constant/index.d.ts +1 -0
- package/es/constant/index.mjs +3 -0
- package/es/constant/variable-type/variable-type.d.ts +12 -0
- package/es/constant/variable-type/variable-type.mjs +13 -0
- package/es/index.mjs +5 -2
- package/es/interface/controller/i-design-drag.controller.d.ts +42 -0
- package/es/interface/controller/i-design-drag.controller.mjs +1 -0
- package/es/interface/controller/i-design-view.controller.d.ts +35 -0
- package/es/interface/controller/i-design-view.controller.mjs +1 -0
- package/es/interface/design-page/design-page.d.ts +141 -0
- package/es/interface/design-page/design-page.mjs +1 -0
- package/es/interface/i-drag-collect/i-drag-collect.d.ts +20 -0
- package/es/interface/i-drag-collect/i-drag-collect.mjs +1 -0
- package/es/interface/i-drag-data-item/i-drag-data-item.d.ts +46 -0
- package/es/interface/i-drag-data-item/i-drag-data-item.mjs +1 -0
- package/es/interface/i-drag-item/i-drag-item.d.ts +32 -0
- package/es/interface/i-drag-item/i-drag-item.mjs +1 -0
- package/es/interface/i-drop-collect/i-drop-collect.d.ts +32 -0
- package/es/interface/i-drop-collect/i-drop-collect.mjs +1 -0
- package/es/interface/i-drop-result/i-drop-result.d.ts +34 -0
- package/es/interface/i-drop-result/i-drop-result.mjs +1 -0
- package/es/interface/index.d.ts +10 -0
- package/es/interface/state/i-design-drag.state.d.ts +15 -0
- package/es/interface/state/i-design-drag.state.mjs +1 -0
- package/es/interface/state/i-design-view.state.d.ts +28 -0
- package/es/interface/state/i-design-view.state.mjs +1 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.mjs +3 -0
- package/es/utils/message/message.d.ts +14 -0
- package/es/utils/message/message.mjs +35 -0
- package/package.json +11 -5
package/dist/index.min.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),t=require("@gct-paas/core"),r=require("lodash-es"),A={position:"",top:"",left:"",right:"",bottom:"",width:"",height:"",backgroundColor:"",marginAll:"",marginTop:"",marginRight:"",marginBottom:"",marginLeft:"",paddingAll:"",paddingTop:"",paddingRight:"",paddingBottom:"",paddingLeft:"",labelFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:t.TextDecoration.NONE,color:""},contentFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:t.TextDecoration.NONE,color:""},tagStyle:{color:"",tagType:t.TagTypeEnum.RADIUS},tagStyleOpen:!1,borderAll:{borderStyle:t.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderLeft:{borderStyle:t.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderRight:{borderStyle:t.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderBottom:{borderStyle:t.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTop:{borderStyle:t.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTopRightRadius:"0",borderTopLeftRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",borderAllRadius:"0"},B=["position","backgroundColor","bold","italic","textDecoration","color","borderStyle","borderColor"];function F(o){return o+"px"}const p={fontAttrs:["fontWeight","fontSize","color","textDecorationLine","textAlign"],mapAttrs:{bold:{attr:"fontWeight",callback:o=>o?700:400},italic:{attr:"fontStyle",callback:o=>o?"italic":"normal"},textDecoration:{attr:"textDecorationLine"},fontSize:{attr:"fontSize",callback:o=>o?F(o):""},align:{attr:"textAlign"}},font(o){if(!o)return{};const e={};return Object.assign(e,r.pick(o,p.fontAttrs)),typeof p.mapAttrs=="object"&&Object.keys(p.mapAttrs).forEach(n=>{const{attr:s,callback:a}=p.mapAttrs[n];e[s]=typeof a=="function"?a(o[n]):o[n]}),e}};function O(o){const{style:e={},ignoringStyle:n=[]}=o||{},s=l.computed(()=>_(e)),a=l.computed(()=>{var c,m,b,g,y,f,E,h,T,D,S,x;const u={position:r.isEmpty(e.position)?"":e.position+" !important",top:r.isEmpty(e.top)?"":e.top+"px !important",left:r.isEmpty(e.left)?"":e.left+"px !important",right:r.isEmpty(e.right)?"":e.right+"px !important",bottom:r.isEmpty(e.bottom)?"":e.bottom+"px !important",width:r.isEmpty(e.width)?"":e.width+"px !important",height:r.isEmpty(e.height)?"":e.height+"px !important",backgroundColor:r.isEmpty(e.backgroundColor)?"":e.backgroundColor+" !important",marginTop:r.isEmpty(e.marginTop)?"":e.marginTop+"px !important",marginRight:r.isEmpty(e.marginRight)?"":e.marginRight+"px !important",marginBottom:r.isEmpty(e.marginBottom)?"":e.marginBottom+"px !important",marginLeft:r.isEmpty(e.marginLeft)?"":e.marginLeft+"px !important",paddingTop:r.isEmpty(e.paddingTop)?"":e.paddingTop+"px !important",paddingRight:r.isEmpty(e.paddingRight)?"":e.paddingRight+"px !important",paddingBottom:r.isEmpty(e.paddingBottom)?"":e.paddingBottom+"px !important",paddingLeft:r.isEmpty(e.paddingLeft)?"":e.paddingLeft+"px !important",borderLeft:`${(c=e.borderLeft)==null?void 0:c.borderWidth}px ${(m=e.borderLeft)==null?void 0:m.borderStyle} ${(b=e.borderLeft)==null?void 0:b.borderColor} !important`,borderRight:`${(g=e.borderRight)==null?void 0:g.borderWidth}px ${(y=e.borderRight)==null?void 0:y.borderStyle} ${(f=e.borderRight)==null?void 0:f.borderColor} !important`,borderBottom:`${(E=e.borderBottom)==null?void 0:E.borderWidth}px ${(h=e.borderBottom)==null?void 0:h.borderStyle} ${(T=e.borderBottom)==null?void 0:T.borderColor} !important`,borderTop:`${(D=e.borderTop)==null?void 0:D.borderWidth}px ${(S=e.borderTop)==null?void 0:S.borderStyle} ${(x=e.borderTop)==null?void 0:x.borderColor} !important`,borderTopRightRadius:r.isEmpty(e.borderTopRightRadius)?"":e.borderTopRightRadius+"px !important",borderTopLeftRadius:r.isEmpty(e.borderTopLeftRadius)?"":e.borderTopLeftRadius+"px !important",borderBottomRightRadius:r.isEmpty(e.borderBottomRightRadius)?"":e.borderBottomRightRadius+"px !important",borderBottomLeftRadius:r.isEmpty(e.borderBottomLeftRadius)?"":e.borderBottomLeftRadius+"px !important"};return n.forEach(I=>{u[I]=void 0}),u}),L=l.computed(()=>p.font(e.labelFont)),P=l.computed(()=>p.font(e.contentFont));return{wrapperStyle:a,wStyle:s,labelFont:L,contentFont:P}}function _(o={}){const e={};for(const n in o)e[n]=G(n,o[n]);return e}function G(o,e){return r.isNil(e)||r.isEmpty(e)?"":B.includes(o)?e+" !important":e+"px !important"}const R=[t.FIELD_TYPE.REF,t.FIELD_TYPE.USER,t.FIELD_TYPE.ORG,t.FIELD_TYPE.RDO_REF,t.FIELD_TYPE.ATTACHMENT],M=({groupName:o})=>[{component:"switch-editor",name:"enableAutofill",label:"sys.pageDesigner.autofill",group:o,hidden:e=>e.props.bindFieldKey||e.props.fieldReadonly?!0:!R.includes(e.props.fieldType)||e.props.multiple},{component:"autofill-editor",name:"autofillRules",label:"",group:o,hidden:e=>e.props.bindFieldKey||e.props.fieldReadonly?!0:!R.includes(e.props.fieldType)||e.props.enableAutofill===!1||e.props.multiple}];function i(o){return Object.prototype.hasOwnProperty.call(o.props,"model")?!o.props.model:Object.prototype.hasOwnProperty.call(o.props,"refForm")?!o.props.refForm:!1}const d={hidden:!1,componentDependency:{sortDependency:[],configDependency:{[t.Dependency_ENUM.HIDDEN]:{expression:""},[t.Dependency_ENUM.READONLY]:{expression:""},[t.Dependency_ENUM.DISABLED]:{expression:""},[t.Dependency_ENUM.REQUIRED]:{expression:""},[t.Dependency_ENUM.ASSIGNMENT]:{expression:"",strategy:t.ASSIGNMENTSTRATEGY_ENUM.alwaysCover}}}},C=[{component:"dependency-editor",name:"componentDependency",label:"",group:t.PropGroup.COMPONENTDEPENDENCY,hidden:o=>o.materialType===t.MaterialEnum.MaterialEmbedTableField||o.type===t.FormComponents.Form&&o.preLocation?!0:i(o)},{component:"switch-editor",name:"notSubmitInHide",label:"sys.pageDesigner.submitWhenHidden",group:t.PropGroup.FIELD_CONFIG,hidden(o){return!o.isField||!o.props.field||!!o.props.bindFieldKey||!!o.props.fieldReadonly||o.materialType===t.MaterialEnum.cardListFormField||[t.FIELD_TYPE.EXPRESSION_CONDITION,t.FIELD_TYPE.SERIALRULE,t.FIELD_TYPE.LABEL_TEMPLATE].includes(o.props.fieldType)}}],U={disabled:!1,icon:"icon-park:all-application",iconColor:"",title:"${sys.pageDesigner.button}",buttonStyle:t.ButtonStyle.ORDINARY,confirm:!1,confirmText:"",hasIcon:!1,hasText:!0,type:t.ButtonType.PRIMARY,danger:!1,size:t.ButtonSize.DEFAULT,enableCustomColor:!1,backgroundColor:"",fontColor:"",...d},k=[{component:"text-editor",name:"title",label:"sys.pageDesigner.buttonName",group:t.PropGroup.BASIC,_config:{i18n:!0,showCount:!0,maxlength:32},changeCallback:(o,e)=>{o.alias=e}},{component:"button-type-editor",name:{type:"type",danger:"danger",icon:"icon",label:"label",hasText:"hasText",hasIcon:"hasIcon"},label:"sys.pageDesigner.buttonType",group:t.PropGroup.BUTTON},{component:"icon-editor",name:{icon:"icon",iconColor:"iconColor"},label:"sys.pageDesigner.buttonIcon",group:t.PropGroup.BUTTON,hidden:o=>!o.props.hasIcon},{component:"radio-bgc-editor",name:"size",label:"sys.pageDesigner.buttonSize",group:t.PropGroup.BUTTON,_config:{options:Object.values(t.ButtonSize).map(o=>({value:o,label:"sys.pageDesigner."+o}))}}],W={disabled:!1,buttonTheme:t.ButtonColorTheme.DEFAULT,buttonType:t.ButtonColorType.DEFAULT,icon:"",iconColor:"",buttonStyle:t.ButtonStyle.ORDINARY,enableCustomColor:!1,backgroundColor:"",fontColor:""},Y=[{component:"button-type-editor",name:{type:"type",danger:"danger",icon:"icon",label:"label",hasText:"hasText",hasIcon:"hasIcon"},label:"sys.pageDesigner.buttonType",group:t.PropGroup.ButtonStyle,hidden:o=>i(o)},{component:"icon-editor",name:{icon:"icon",iconColor:"iconColor"},label:"sys.pageDesigner.buttonIcon",group:t.PropGroup.ButtonStyle,hidden:o=>!o.props.hasIcon||i(o),_config:{clearable:!1}},{component:"switch-editor",name:"enableCustomColor",label:"sys.pageDesigner.customBtnColor",group:t.PropGroup.ButtonStyle,hidden:o=>i(o)},{component:"button-color-editor",name:"fontColor",label:"sys.pageDesigner.buttonNameColor",group:t.PropGroup.ButtonStyle,_config:{isInRow:!0},hidden:o=>!o.props.enableCustomColor},{component:"button-color-editor",name:"backgroundColor",label:"sys.pageDesigner.buttonStyleColor",group:t.PropGroup.ButtonStyle,_config:{isInRow:!0},hidden:o=>!o.props.enableCustomColor||o.props.type==="link"},{component:"radio-bgc-editor",name:"size",label:"sys.pageDesigner.buttonSize",group:t.PropGroup.ButtonStyle,hidden:o=>!!o,_config:{options:Object.values(t.ButtonSize).map(o=>({value:o,label:"sys.pageDesigner."+o}))}},{component:"switch-editor",name:"confirm",label:"sys.pageDesigner.confirm",group:t.PropGroup.ButtonStyle,hidden:o=>i(o),_config:{tooltip:"sys.pageDesigner.buttonConfirm"}},{component:"texteare-editor",name:"confirmText",label:"sys.pageDesigner.regHint",group:t.PropGroup.ButtonStyle,_config:{i18n:!0,placeholder:"sys.pageDesigner.confirmTodo"},hidden:o=>!o.props.confirm||i(o)}],z=[{component:"position-editor",name:"position",label:"sys.pageDesigner.position",group:t.StyleGroup.LAYOUT,hidden:o=>!!o.props.parentWidgetId||!!o.preLocation},{component:"margin-editor",group:t.StyleGroup.MARGIN,hidden:o=>!!o.props.parentWidgetId||!!o.preLocation,_config:{hiddenMarginOrPadding:"padding"}}],$=[{component:"radio-icon-editor",name:"fixedAlign",label:"sys.pageDesigner.columnFixed",group:t.PropGroup.SHOW,_config:{options:[{label:"sys.pageDesigner.left",value:t.fixedAlignENUM.LEFT},{label:"sys.pageDesigner.none",value:t.fixedAlignENUM.NONE},{label:"sys.pageDesigner.right",value:t.fixedAlignENUM.RIGHT}]}}],v={field:"",fieldId:"",label:"",modelKey:"",fieldType:void 0,bindModelKey:void 0,disabled:!1,explain:"",showExplain:!1,displayLabelText:!0,readonly:!1,fieldReadonly:!1,notSubmitInHide:!0,...d},H=[{component:"switch-editor",name:"showExplain",label:"sys.pageDesigner.explain",group:t.PropGroup.BASIC,hidden:o=>o.platform===t.Platform.MOBILE},{component:"texteare-editor",name:"explain",label:"",group:t.PropGroup.BASIC,hidden:o=>!o.props.showExplain,_config:{i18n:!0}},{component:"switch-editor",name:"displayLabelText",label:"sys.pageDesigner.displayLabelText",group:t.PropGroup.ADVANCED},{component:"switch-editor",name:"disabled",label:"sys.pageDesigner.disabled",group:t.PropGroup.ADVANCED},{component:"switch-editor",name:"readonly",label:"sys.pageDesigner.readonly",group:t.PropGroup.ADVANCED},...C],j=[{component:"permission-editor",label:"",group:t.PropGroup.PERMISSION,hidden:o=>i(o)}];function N(){if(!window.gct_paas){console.error("未找到 gct_paas 对象,请先安装 @gct-paas/core 包后再安装 @gct-paas/design 包!");return}}exports.baseBtnEditor=k;exports.baseBtnProp=U;exports.buttonEditor=Y;exports.buttonProps=W;exports.buttonStyleEditor=z;exports.default=N;exports.displayEditor=C;exports.displayProps=d;exports.fixedAlignEditor=$;exports.formItemDisplayEditor=H;exports.formItemProps=v;exports.getAutofillEditor=M;exports.hiddenButtonProps=i;exports.install=N;exports.notNeedPxStyle=B;exports.permissionEditor=j;exports.style=A;exports.useStyle=O;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("ant-design-vue"),d=require("vue"),t=require("@gct-paas/core"),r=require("lodash-es");class F{info(o,n){return new Promise(i=>{s.message.info(o,n,()=>{i()})})}success(o,n){return new Promise(i=>{s.message.success(o,n,()=>{i()})})}warning(o,n){return new Promise(i=>{s.message.warning(o,n,()=>{i()})})}error(o,n){return new Promise(i=>{s.message.error(o,n,()=>{i()})})}}const O={position:"",top:"",left:"",right:"",bottom:"",width:"",height:"",backgroundColor:"",marginAll:"",marginTop:"",marginRight:"",marginBottom:"",marginLeft:"",paddingAll:"",paddingTop:"",paddingRight:"",paddingBottom:"",paddingLeft:"",labelFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:t.TextDecoration.NONE,color:""},contentFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:t.TextDecoration.NONE,color:""},tagStyle:{color:"",tagType:t.TagTypeEnum.RADIUS},tagStyleOpen:!1,borderAll:{borderStyle:t.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderLeft:{borderStyle:t.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderRight:{borderStyle:t.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderBottom:{borderStyle:t.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTop:{borderStyle:t.BorderStyle.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTopRightRadius:"0",borderTopLeftRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",borderAllRadius:"0"},C=["position","backgroundColor","bold","italic","textDecoration","color","borderStyle","borderColor"];function _(e){return e+"px"}const a={fontAttrs:["fontWeight","fontSize","color","textDecorationLine","textAlign"],mapAttrs:{bold:{attr:"fontWeight",callback:e=>e?700:400},italic:{attr:"fontStyle",callback:e=>e?"italic":"normal"},textDecoration:{attr:"textDecorationLine"},fontSize:{attr:"fontSize",callback:e=>e?_(e):""},align:{attr:"textAlign"}},font(e){if(!e)return{};const o={};return Object.assign(o,r.pick(e,a.fontAttrs)),typeof a.mapAttrs=="object"&&Object.keys(a.mapAttrs).forEach(n=>{const{attr:i,callback:l}=a.mapAttrs[n];o[i]=typeof l=="function"?l(e[n]):e[n]}),o}};function G(e){const{style:o={},ignoringStyle:n=[]}=e||{},i=d.computed(()=>M(o)),l=d.computed(()=>{var m,g,b,y,f,E,h,T,D,S,x,R;const c={position:r.isEmpty(o.position)?"":o.position+" !important",top:r.isEmpty(o.top)?"":o.top+"px !important",left:r.isEmpty(o.left)?"":o.left+"px !important",right:r.isEmpty(o.right)?"":o.right+"px !important",bottom:r.isEmpty(o.bottom)?"":o.bottom+"px !important",width:r.isEmpty(o.width)?"":o.width+"px !important",height:r.isEmpty(o.height)?"":o.height+"px !important",backgroundColor:r.isEmpty(o.backgroundColor)?"":o.backgroundColor+" !important",marginTop:r.isEmpty(o.marginTop)?"":o.marginTop+"px !important",marginRight:r.isEmpty(o.marginRight)?"":o.marginRight+"px !important",marginBottom:r.isEmpty(o.marginBottom)?"":o.marginBottom+"px !important",marginLeft:r.isEmpty(o.marginLeft)?"":o.marginLeft+"px !important",paddingTop:r.isEmpty(o.paddingTop)?"":o.paddingTop+"px !important",paddingRight:r.isEmpty(o.paddingRight)?"":o.paddingRight+"px !important",paddingBottom:r.isEmpty(o.paddingBottom)?"":o.paddingBottom+"px !important",paddingLeft:r.isEmpty(o.paddingLeft)?"":o.paddingLeft+"px !important",borderLeft:`${(m=o.borderLeft)==null?void 0:m.borderWidth}px ${(g=o.borderLeft)==null?void 0:g.borderStyle} ${(b=o.borderLeft)==null?void 0:b.borderColor} !important`,borderRight:`${(y=o.borderRight)==null?void 0:y.borderWidth}px ${(f=o.borderRight)==null?void 0:f.borderStyle} ${(E=o.borderRight)==null?void 0:E.borderColor} !important`,borderBottom:`${(h=o.borderBottom)==null?void 0:h.borderWidth}px ${(T=o.borderBottom)==null?void 0:T.borderStyle} ${(D=o.borderBottom)==null?void 0:D.borderColor} !important`,borderTop:`${(S=o.borderTop)==null?void 0:S.borderWidth}px ${(x=o.borderTop)==null?void 0:x.borderStyle} ${(R=o.borderTop)==null?void 0:R.borderColor} !important`,borderTopRightRadius:r.isEmpty(o.borderTopRightRadius)?"":o.borderTopRightRadius+"px !important",borderTopLeftRadius:r.isEmpty(o.borderTopLeftRadius)?"":o.borderTopLeftRadius+"px !important",borderBottomRightRadius:r.isEmpty(o.borderBottomRightRadius)?"":o.borderBottomRightRadius+"px !important",borderBottomLeftRadius:r.isEmpty(o.borderBottomLeftRadius)?"":o.borderBottomLeftRadius+"px !important"};return n.forEach(A=>{c[A]=void 0}),c}),L=d.computed(()=>a.font(o.labelFont)),I=d.computed(()=>a.font(o.contentFont));return{wrapperStyle:l,wStyle:i,labelFont:L,contentFont:I}}function M(e={}){const o={};for(const n in e)o[n]=U(n,e[n]);return o}function U(e,o){return r.isNil(o)||r.isEmpty(o)?"":C.includes(e)?o+" !important":o+"px !important"}const B=[t.FIELD_TYPE.REF,t.FIELD_TYPE.USER,t.FIELD_TYPE.ORG,t.FIELD_TYPE.RDO_REF,t.FIELD_TYPE.ATTACHMENT],k=({groupName:e})=>[{component:"switch-editor",name:"enableAutofill",label:"sys.pageDesigner.autofill",group:e,hidden:o=>o.props.bindFieldKey||o.props.fieldReadonly?!0:!B.includes(o.props.fieldType)||o.props.multiple},{component:"autofill-editor",name:"autofillRules",label:"",group:e,hidden:o=>o.props.bindFieldKey||o.props.fieldReadonly?!0:!B.includes(o.props.fieldType)||o.props.enableAutofill===!1||o.props.multiple}];function p(e){return Object.prototype.hasOwnProperty.call(e.props,"model")?!e.props.model:Object.prototype.hasOwnProperty.call(e.props,"refForm")?!e.props.refForm:!1}const u={hidden:!1,componentDependency:{sortDependency:[],configDependency:{[t.Dependency_ENUM.HIDDEN]:{expression:""},[t.Dependency_ENUM.READONLY]:{expression:""},[t.Dependency_ENUM.DISABLED]:{expression:""},[t.Dependency_ENUM.REQUIRED]:{expression:""},[t.Dependency_ENUM.ASSIGNMENT]:{expression:"",strategy:t.ASSIGNMENTSTRATEGY_ENUM.alwaysCover}}}},P=[{component:"dependency-editor",name:"componentDependency",label:"",group:t.PropGroup.COMPONENTDEPENDENCY,hidden:e=>e.materialType===t.MaterialEnum.MaterialEmbedTableField||e.type===t.FormComponents.Form&&e.preLocation?!0:p(e)},{component:"switch-editor",name:"notSubmitInHide",label:"sys.pageDesigner.submitWhenHidden",group:t.PropGroup.FIELD_CONFIG,hidden(e){return!e.isField||!e.props.field||!!e.props.bindFieldKey||!!e.props.fieldReadonly||e.materialType===t.MaterialEnum.cardListFormField||[t.FIELD_TYPE.EXPRESSION_CONDITION,t.FIELD_TYPE.SERIALRULE,t.FIELD_TYPE.LABEL_TEMPLATE].includes(e.props.fieldType)}}],W={disabled:!1,icon:"icon-park:all-application",iconColor:"",title:"${sys.pageDesigner.button}",buttonStyle:t.ButtonStyle.ORDINARY,confirm:!1,confirmText:"",hasIcon:!1,hasText:!0,type:t.ButtonType.PRIMARY,danger:!1,size:t.ButtonSize.DEFAULT,enableCustomColor:!1,backgroundColor:"",fontColor:"",...u},Y=[{component:"text-editor",name:"title",label:"sys.pageDesigner.buttonName",group:t.PropGroup.BASIC,_config:{i18n:!0,showCount:!0,maxlength:32},changeCallback:(e,o)=>{e.alias=o}},{component:"button-type-editor",name:{type:"type",danger:"danger",icon:"icon",label:"label",hasText:"hasText",hasIcon:"hasIcon"},label:"sys.pageDesigner.buttonType",group:t.PropGroup.BUTTON},{component:"icon-editor",name:{icon:"icon",iconColor:"iconColor"},label:"sys.pageDesigner.buttonIcon",group:t.PropGroup.BUTTON,hidden:e=>!e.props.hasIcon},{component:"radio-bgc-editor",name:"size",label:"sys.pageDesigner.buttonSize",group:t.PropGroup.BUTTON,_config:{options:Object.values(t.ButtonSize).map(e=>({value:e,label:"sys.pageDesigner."+e}))}}],w={disabled:!1,buttonTheme:t.ButtonColorTheme.DEFAULT,buttonType:t.ButtonColorType.DEFAULT,icon:"",iconColor:"",buttonStyle:t.ButtonStyle.ORDINARY,enableCustomColor:!1,backgroundColor:"",fontColor:""},z=[{component:"button-type-editor",name:{type:"type",danger:"danger",icon:"icon",label:"label",hasText:"hasText",hasIcon:"hasIcon"},label:"sys.pageDesigner.buttonType",group:t.PropGroup.ButtonStyle,hidden:e=>p(e)},{component:"icon-editor",name:{icon:"icon",iconColor:"iconColor"},label:"sys.pageDesigner.buttonIcon",group:t.PropGroup.ButtonStyle,hidden:e=>!e.props.hasIcon||p(e),_config:{clearable:!1}},{component:"switch-editor",name:"enableCustomColor",label:"sys.pageDesigner.customBtnColor",group:t.PropGroup.ButtonStyle,hidden:e=>p(e)},{component:"button-color-editor",name:"fontColor",label:"sys.pageDesigner.buttonNameColor",group:t.PropGroup.ButtonStyle,_config:{isInRow:!0},hidden:e=>!e.props.enableCustomColor},{component:"button-color-editor",name:"backgroundColor",label:"sys.pageDesigner.buttonStyleColor",group:t.PropGroup.ButtonStyle,_config:{isInRow:!0},hidden:e=>!e.props.enableCustomColor||e.props.type==="link"},{component:"radio-bgc-editor",name:"size",label:"sys.pageDesigner.buttonSize",group:t.PropGroup.ButtonStyle,hidden:e=>!!e,_config:{options:Object.values(t.ButtonSize).map(e=>({value:e,label:"sys.pageDesigner."+e}))}},{component:"switch-editor",name:"confirm",label:"sys.pageDesigner.confirm",group:t.PropGroup.ButtonStyle,hidden:e=>p(e),_config:{tooltip:"sys.pageDesigner.buttonConfirm"}},{component:"texteare-editor",name:"confirmText",label:"sys.pageDesigner.regHint",group:t.PropGroup.ButtonStyle,_config:{i18n:!0,placeholder:"sys.pageDesigner.confirmTodo"},hidden:e=>!e.props.confirm||p(e)}],$=[{component:"position-editor",name:"position",label:"sys.pageDesigner.position",group:t.StyleGroup.LAYOUT,hidden:e=>!!e.props.parentWidgetId||!!e.preLocation},{component:"margin-editor",group:t.StyleGroup.MARGIN,hidden:e=>!!e.props.parentWidgetId||!!e.preLocation,_config:{hiddenMarginOrPadding:"padding"}}],v=[{component:"radio-icon-editor",name:"fixedAlign",label:"sys.pageDesigner.columnFixed",group:t.PropGroup.SHOW,_config:{options:[{label:"sys.pageDesigner.left",value:t.fixedAlignENUM.LEFT},{label:"sys.pageDesigner.none",value:t.fixedAlignENUM.NONE},{label:"sys.pageDesigner.right",value:t.fixedAlignENUM.RIGHT}]}}],H={field:"",fieldId:"",label:"",modelKey:"",fieldType:void 0,bindModelKey:void 0,disabled:!1,explain:"",showExplain:!1,displayLabelText:!0,readonly:!1,fieldReadonly:!1,notSubmitInHide:!0,...u},j=[{component:"switch-editor",name:"showExplain",label:"sys.pageDesigner.explain",group:t.PropGroup.BASIC,hidden:e=>e.platform===t.Platform.MOBILE},{component:"texteare-editor",name:"explain",label:"",group:t.PropGroup.BASIC,hidden:e=>!e.props.showExplain,_config:{i18n:!0}},{component:"switch-editor",name:"displayLabelText",label:"sys.pageDesigner.displayLabelText",group:t.PropGroup.ADVANCED},{component:"switch-editor",name:"disabled",label:"sys.pageDesigner.disabled",group:t.PropGroup.ADVANCED},{component:"switch-editor",name:"readonly",label:"sys.pageDesigner.readonly",group:t.PropGroup.ADVANCED},...P],K=[{component:"permission-editor",label:"",group:t.PropGroup.PERMISSION,hidden:e=>p(e)}];function N(){if(!window._gct){console.error("未找到 _gct 对象,请先安装 @gct-paas/core 包后再安装 @gct-paas/design 包!");return}window._gct.message=new F}exports.baseBtnEditor=Y;exports.baseBtnProp=W;exports.buttonEditor=z;exports.buttonProps=w;exports.buttonStyleEditor=$;exports.default=N;exports.displayEditor=P;exports.displayProps=u;exports.fixedAlignEditor=v;exports.formItemDisplayEditor=j;exports.formItemProps=H;exports.getAutofillEditor=k;exports.hiddenButtonProps=p;exports.install=N;exports.notNeedPxStyle=C;exports.permissionEditor=K;exports.style=O;exports.useStyle=G;
|
package/dist/index.system.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["vue","@gct-paas/core","lodash-es"],function(i,eo){"use strict";var b,s,S,f,a,d,D,r,y,R,u,C,h,B,x,T,g,N,n,A,I;return{setters:[t=>{b=t.computed},t=>{s=t.BorderStyle,S=t.TagTypeEnum,f=t.TextDecoration,a=t.FIELD_TYPE,d=t.Dependency_ENUM,D=t.ASSIGNMENTSTRATEGY_ENUM,r=t.PropGroup,y=t.MaterialEnum,R=t.FormComponents,u=t.ButtonSize,C=t.ButtonType,h=t.ButtonStyle,B=t.ButtonColorType,x=t.ButtonColorTheme,T=t.StyleGroup,g=t.fixedAlignENUM,N=t.Platform},t=>{n=t.isEmpty,A=t.pick,I=t.isNil}],execute:function(){i({default:O,hiddenButtonProps:l,install:O,useStyle:V});const t=i("style",{position:"",top:"",left:"",right:"",bottom:"",width:"",height:"",backgroundColor:"",marginAll:"",marginTop:"",marginRight:"",marginBottom:"",marginLeft:"",paddingAll:"",paddingTop:"",paddingRight:"",paddingBottom:"",paddingLeft:"",labelFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:f.NONE,color:""},contentFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:f.NONE,color:""},tagStyle:{color:"",tagType:S.RADIUS},tagStyleOpen:!1,borderAll:{borderStyle:s.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderLeft:{borderStyle:s.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderRight:{borderStyle:s.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderBottom:{borderStyle:s.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTop:{borderStyle:s.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTopRightRadius:"0",borderTopLeftRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",borderAllRadius:"0"}),K=i("notNeedPxStyle",["position","backgroundColor","bold","italic","textDecoration","color","borderStyle","borderColor"]);function w(o){return o+"px"}const c={fontAttrs:["fontWeight","fontSize","color","textDecorationLine","textAlign"],mapAttrs:{bold:{attr:"fontWeight",callback:o=>o?700:400},italic:{attr:"fontStyle",callback:o=>o?"italic":"normal"},textDecoration:{attr:"textDecorationLine"},fontSize:{attr:"fontSize",callback:o=>o?w(o):""},align:{attr:"textAlign"}},font(o){if(!o)return{};const e={};return Object.assign(e,A(o,c.fontAttrs)),typeof c.mapAttrs=="object"&&Object.keys(c.mapAttrs).forEach(p=>{const{attr:E,callback:m}=c.mapAttrs[p];e[E]=typeof m=="function"?m(o[p]):o[p]}),e}};function V(o){const{style:e={},ignoringStyle:p=[]}=o||{},E=b(()=>Q(e)),m=b(()=>{var _,M,k,U,W,G,$,z,Y,v,H,j;const P={position:n(e.position)?"":e.position+" !important",top:n(e.top)?"":e.top+"px !important",left:n(e.left)?"":e.left+"px !important",right:n(e.right)?"":e.right+"px !important",bottom:n(e.bottom)?"":e.bottom+"px !important",width:n(e.width)?"":e.width+"px !important",height:n(e.height)?"":e.height+"px !important",backgroundColor:n(e.backgroundColor)?"":e.backgroundColor+" !important",marginTop:n(e.marginTop)?"":e.marginTop+"px !important",marginRight:n(e.marginRight)?"":e.marginRight+"px !important",marginBottom:n(e.marginBottom)?"":e.marginBottom+"px !important",marginLeft:n(e.marginLeft)?"":e.marginLeft+"px !important",paddingTop:n(e.paddingTop)?"":e.paddingTop+"px !important",paddingRight:n(e.paddingRight)?"":e.paddingRight+"px !important",paddingBottom:n(e.paddingBottom)?"":e.paddingBottom+"px !important",paddingLeft:n(e.paddingLeft)?"":e.paddingLeft+"px !important",borderLeft:`${(_=e.borderLeft)==null?void 0:_.borderWidth}px ${(M=e.borderLeft)==null?void 0:M.borderStyle} ${(k=e.borderLeft)==null?void 0:k.borderColor} !important`,borderRight:`${(U=e.borderRight)==null?void 0:U.borderWidth}px ${(W=e.borderRight)==null?void 0:W.borderStyle} ${(G=e.borderRight)==null?void 0:G.borderColor} !important`,borderBottom:`${($=e.borderBottom)==null?void 0:$.borderWidth}px ${(z=e.borderBottom)==null?void 0:z.borderStyle} ${(Y=e.borderBottom)==null?void 0:Y.borderColor} !important`,borderTop:`${(v=e.borderTop)==null?void 0:v.borderWidth}px ${(H=e.borderTop)==null?void 0:H.borderStyle} ${(j=e.borderTop)==null?void 0:j.borderColor} !important`,borderTopRightRadius:n(e.borderTopRightRadius)?"":e.borderTopRightRadius+"px !important",borderTopLeftRadius:n(e.borderTopLeftRadius)?"":e.borderTopLeftRadius+"px !important",borderBottomRightRadius:n(e.borderBottomRightRadius)?"":e.borderBottomRightRadius+"px !important",borderBottomLeftRadius:n(e.borderBottomLeftRadius)?"":e.borderBottomLeftRadius+"px !important"};return p.forEach(oo=>{P[oo]=void 0}),P}),J=b(()=>c.font(e.labelFont)),Z=b(()=>c.font(e.contentFont));return{wrapperStyle:m,wStyle:E,labelFont:J,contentFont:Z}}function Q(o={}){const e={};for(const p in o)e[p]=X(p,o[p]);return e}function X(o,e){return I(e)||n(e)?"":K.includes(o)?e+" !important":e+"px !important"}const L=[a.REF,a.USER,a.ORG,a.RDO_REF,a.ATTACHMENT],to=i("getAutofillEditor",({groupName:o})=>[{component:"switch-editor",name:"enableAutofill",label:"sys.pageDesigner.autofill",group:o,hidden:e=>e.props.bindFieldKey||e.props.fieldReadonly?!0:!L.includes(e.props.fieldType)||e.props.multiple},{component:"autofill-editor",name:"autofillRules",label:"",group:o,hidden:e=>e.props.bindFieldKey||e.props.fieldReadonly?!0:!L.includes(e.props.fieldType)||e.props.enableAutofill===!1||e.props.multiple}]);function l(o){return Object.prototype.hasOwnProperty.call(o.props,"model")?!o.props.model:Object.prototype.hasOwnProperty.call(o.props,"refForm")?!o.props.refForm:!1}const F=i("displayProps",{hidden:!1,componentDependency:{sortDependency:[],configDependency:{[d.HIDDEN]:{expression:""},[d.READONLY]:{expression:""},[d.DISABLED]:{expression:""},[d.REQUIRED]:{expression:""},[d.ASSIGNMENT]:{expression:"",strategy:D.alwaysCover}}}}),q=i("displayEditor",[{component:"dependency-editor",name:"componentDependency",label:"",group:r.COMPONENTDEPENDENCY,hidden:o=>o.materialType===y.MaterialEmbedTableField||o.type===R.Form&&o.preLocation?!0:l(o)},{component:"switch-editor",name:"notSubmitInHide",label:"sys.pageDesigner.submitWhenHidden",group:r.FIELD_CONFIG,hidden(o){return!o.isField||!o.props.field||!!o.props.bindFieldKey||!!o.props.fieldReadonly||o.materialType===y.cardListFormField||[a.EXPRESSION_CONDITION,a.SERIALRULE,a.LABEL_TEMPLATE].includes(o.props.fieldType)}}]),ro=i("baseBtnProp",{disabled:!1,icon:"icon-park:all-application",iconColor:"",title:"${sys.pageDesigner.button}",buttonStyle:h.ORDINARY,confirm:!1,confirmText:"",hasIcon:!1,hasText:!0,type:C.PRIMARY,danger:!1,size:u.DEFAULT,enableCustomColor:!1,backgroundColor:"",fontColor:"",...F}),no=i("baseBtnEditor",[{component:"text-editor",name:"title",label:"sys.pageDesigner.buttonName",group:r.BASIC,_config:{i18n:!0,showCount:!0,maxlength:32},changeCallback:(o,e)=>{o.alias=e}},{component:"button-type-editor",name:{type:"type",danger:"danger",icon:"icon",label:"label",hasText:"hasText",hasIcon:"hasIcon"},label:"sys.pageDesigner.buttonType",group:r.BUTTON},{component:"icon-editor",name:{icon:"icon",iconColor:"iconColor"},label:"sys.pageDesigner.buttonIcon",group:r.BUTTON,hidden:o=>!o.props.hasIcon},{component:"radio-bgc-editor",name:"size",label:"sys.pageDesigner.buttonSize",group:r.BUTTON,_config:{options:Object.values(u).map(o=>({value:o,label:"sys.pageDesigner."+o}))}}]),io=i("buttonProps",{disabled:!1,buttonTheme:x.DEFAULT,buttonType:B.DEFAULT,icon:"",iconColor:"",buttonStyle:h.ORDINARY,enableCustomColor:!1,backgroundColor:"",fontColor:""}),ao=i("buttonEditor",[{component:"button-type-editor",name:{type:"type",danger:"danger",icon:"icon",label:"label",hasText:"hasText",hasIcon:"hasIcon"},label:"sys.pageDesigner.buttonType",group:r.ButtonStyle,hidden:o=>l(o)},{component:"icon-editor",name:{icon:"icon",iconColor:"iconColor"},label:"sys.pageDesigner.buttonIcon",group:r.ButtonStyle,hidden:o=>!o.props.hasIcon||l(o),_config:{clearable:!1}},{component:"switch-editor",name:"enableCustomColor",label:"sys.pageDesigner.customBtnColor",group:r.ButtonStyle,hidden:o=>l(o)},{component:"button-color-editor",name:"fontColor",label:"sys.pageDesigner.buttonNameColor",group:r.ButtonStyle,_config:{isInRow:!0},hidden:o=>!o.props.enableCustomColor},{component:"button-color-editor",name:"backgroundColor",label:"sys.pageDesigner.buttonStyleColor",group:r.ButtonStyle,_config:{isInRow:!0},hidden:o=>!o.props.enableCustomColor||o.props.type==="link"},{component:"radio-bgc-editor",name:"size",label:"sys.pageDesigner.buttonSize",group:r.ButtonStyle,hidden:o=>!!o,_config:{options:Object.values(u).map(o=>({value:o,label:"sys.pageDesigner."+o}))}},{component:"switch-editor",name:"confirm",label:"sys.pageDesigner.confirm",group:r.ButtonStyle,hidden:o=>l(o),_config:{tooltip:"sys.pageDesigner.buttonConfirm"}},{component:"texteare-editor",name:"confirmText",label:"sys.pageDesigner.regHint",group:r.ButtonStyle,_config:{i18n:!0,placeholder:"sys.pageDesigner.confirmTodo"},hidden:o=>!o.props.confirm||l(o)}]),po=i("buttonStyleEditor",[{component:"position-editor",name:"position",label:"sys.pageDesigner.position",group:T.LAYOUT,hidden:o=>!!o.props.parentWidgetId||!!o.preLocation},{component:"margin-editor",group:T.MARGIN,hidden:o=>!!o.props.parentWidgetId||!!o.preLocation,_config:{hiddenMarginOrPadding:"padding"}}]),lo=i("fixedAlignEditor",[{component:"radio-icon-editor",name:"fixedAlign",label:"sys.pageDesigner.columnFixed",group:r.SHOW,_config:{options:[{label:"sys.pageDesigner.left",value:g.LEFT},{label:"sys.pageDesigner.none",value:g.NONE},{label:"sys.pageDesigner.right",value:g.RIGHT}]}}]),so=i("formItemProps",{field:"",fieldId:"",label:"",modelKey:"",fieldType:void 0,bindModelKey:void 0,disabled:!1,explain:"",showExplain:!1,displayLabelText:!0,readonly:!1,fieldReadonly:!1,notSubmitInHide:!0,...F}),co=i("formItemDisplayEditor",[{component:"switch-editor",name:"showExplain",label:"sys.pageDesigner.explain",group:r.BASIC,hidden:o=>o.platform===N.MOBILE},{component:"texteare-editor",name:"explain",label:"",group:r.BASIC,hidden:o=>!o.props.showExplain,_config:{i18n:!0}},{component:"switch-editor",name:"displayLabelText",label:"sys.pageDesigner.displayLabelText",group:r.ADVANCED},{component:"switch-editor",name:"disabled",label:"sys.pageDesigner.disabled",group:r.ADVANCED},{component:"switch-editor",name:"readonly",label:"sys.pageDesigner.readonly",group:r.ADVANCED},...q]),bo=i("permissionEditor",[{component:"permission-editor",label:"",group:r.PERMISSION,hidden:o=>l(o)}]);function O(){if(!window.gct_paas){console.error("未找到 gct_paas 对象,请先安装 @gct-paas/core 包后再安装 @gct-paas/design 包!");return}}}}});
|
|
1
|
+
System.register(["ant-design-vue","vue","@gct-paas/core","lodash-es"],function(a,to){"use strict";var u,b,d,D,h,l,c,R,r,T,C,m,B,E,x,N,S,f,A,n,I,L;return{setters:[t=>{u=t.message},t=>{b=t.computed},t=>{d=t.BorderStyle,D=t.TagTypeEnum,h=t.TextDecoration,l=t.FIELD_TYPE,c=t.Dependency_ENUM,R=t.ASSIGNMENTSTRATEGY_ENUM,r=t.PropGroup,T=t.MaterialEnum,C=t.FormComponents,m=t.ButtonSize,B=t.ButtonType,E=t.ButtonStyle,x=t.ButtonColorType,N=t.ButtonColorTheme,S=t.StyleGroup,f=t.fixedAlignENUM,A=t.Platform},t=>{n=t.isEmpty,I=t.pick,L=t.isNil}],execute:function(){a({default:P,hiddenButtonProps:s,install:P,useStyle:Q});class t{info(o,i){return new Promise(p=>{u.info(o,i,()=>{p()})})}success(o,i){return new Promise(p=>{u.success(o,i,()=>{p()})})}warning(o,i){return new Promise(p=>{u.warning(o,i,()=>{p()})})}error(o,i){return new Promise(p=>{u.error(o,i,()=>{p()})})}}const ro=a("style",{position:"",top:"",left:"",right:"",bottom:"",width:"",height:"",backgroundColor:"",marginAll:"",marginTop:"",marginRight:"",marginBottom:"",marginLeft:"",paddingAll:"",paddingTop:"",paddingRight:"",paddingBottom:"",paddingLeft:"",labelFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:h.NONE,color:""},contentFont:{align:"left",fontSize:"",bold:!1,italic:!1,textDecoration:h.NONE,color:""},tagStyle:{color:"",tagType:D.RADIUS},tagStyleOpen:!1,borderAll:{borderStyle:d.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderLeft:{borderStyle:d.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderRight:{borderStyle:d.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderBottom:{borderStyle:d.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTop:{borderStyle:d.NONE,borderColor:"#F0F0F0",borderWidth:"1"},borderTopRightRadius:"0",borderTopLeftRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",borderAllRadius:"0"}),K=a("notNeedPxStyle",["position","backgroundColor","bold","italic","textDecoration","color","borderStyle","borderColor"]);function V(e){return e+"px"}const g={fontAttrs:["fontWeight","fontSize","color","textDecorationLine","textAlign"],mapAttrs:{bold:{attr:"fontWeight",callback:e=>e?700:400},italic:{attr:"fontStyle",callback:e=>e?"italic":"normal"},textDecoration:{attr:"textDecorationLine"},fontSize:{attr:"fontSize",callback:e=>e?V(e):""},align:{attr:"textAlign"}},font(e){if(!e)return{};const o={};return Object.assign(o,I(e,g.fontAttrs)),typeof g.mapAttrs=="object"&&Object.keys(g.mapAttrs).forEach(i=>{const{attr:p,callback:y}=g.mapAttrs[i];o[p]=typeof y=="function"?y(e[i]):e[i]}),o}};function Q(e){const{style:o={},ignoringStyle:i=[]}=e||{},p=b(()=>X(o)),y=b(()=>{var M,U,k,W,w,G,$,z,Y,v,H,j;const _={position:n(o.position)?"":o.position+" !important",top:n(o.top)?"":o.top+"px !important",left:n(o.left)?"":o.left+"px !important",right:n(o.right)?"":o.right+"px !important",bottom:n(o.bottom)?"":o.bottom+"px !important",width:n(o.width)?"":o.width+"px !important",height:n(o.height)?"":o.height+"px !important",backgroundColor:n(o.backgroundColor)?"":o.backgroundColor+" !important",marginTop:n(o.marginTop)?"":o.marginTop+"px !important",marginRight:n(o.marginRight)?"":o.marginRight+"px !important",marginBottom:n(o.marginBottom)?"":o.marginBottom+"px !important",marginLeft:n(o.marginLeft)?"":o.marginLeft+"px !important",paddingTop:n(o.paddingTop)?"":o.paddingTop+"px !important",paddingRight:n(o.paddingRight)?"":o.paddingRight+"px !important",paddingBottom:n(o.paddingBottom)?"":o.paddingBottom+"px !important",paddingLeft:n(o.paddingLeft)?"":o.paddingLeft+"px !important",borderLeft:`${(M=o.borderLeft)==null?void 0:M.borderWidth}px ${(U=o.borderLeft)==null?void 0:U.borderStyle} ${(k=o.borderLeft)==null?void 0:k.borderColor} !important`,borderRight:`${(W=o.borderRight)==null?void 0:W.borderWidth}px ${(w=o.borderRight)==null?void 0:w.borderStyle} ${(G=o.borderRight)==null?void 0:G.borderColor} !important`,borderBottom:`${($=o.borderBottom)==null?void 0:$.borderWidth}px ${(z=o.borderBottom)==null?void 0:z.borderStyle} ${(Y=o.borderBottom)==null?void 0:Y.borderColor} !important`,borderTop:`${(v=o.borderTop)==null?void 0:v.borderWidth}px ${(H=o.borderTop)==null?void 0:H.borderStyle} ${(j=o.borderTop)==null?void 0:j.borderColor} !important`,borderTopRightRadius:n(o.borderTopRightRadius)?"":o.borderTopRightRadius+"px !important",borderTopLeftRadius:n(o.borderTopLeftRadius)?"":o.borderTopLeftRadius+"px !important",borderBottomRightRadius:n(o.borderBottomRightRadius)?"":o.borderBottomRightRadius+"px !important",borderBottomLeftRadius:n(o.borderBottomLeftRadius)?"":o.borderBottomLeftRadius+"px !important"};return i.forEach(eo=>{_[eo]=void 0}),_}),Z=b(()=>g.font(o.labelFont)),oo=b(()=>g.font(o.contentFont));return{wrapperStyle:y,wStyle:p,labelFont:Z,contentFont:oo}}function X(e={}){const o={};for(const i in e)o[i]=q(i,e[i]);return o}function q(e,o){return L(o)||n(o)?"":K.includes(e)?o+" !important":o+"px !important"}const F=[l.REF,l.USER,l.ORG,l.RDO_REF,l.ATTACHMENT],no=a("getAutofillEditor",({groupName:e})=>[{component:"switch-editor",name:"enableAutofill",label:"sys.pageDesigner.autofill",group:e,hidden:o=>o.props.bindFieldKey||o.props.fieldReadonly?!0:!F.includes(o.props.fieldType)||o.props.multiple},{component:"autofill-editor",name:"autofillRules",label:"",group:e,hidden:o=>o.props.bindFieldKey||o.props.fieldReadonly?!0:!F.includes(o.props.fieldType)||o.props.enableAutofill===!1||o.props.multiple}]);function s(e){return Object.prototype.hasOwnProperty.call(e.props,"model")?!e.props.model:Object.prototype.hasOwnProperty.call(e.props,"refForm")?!e.props.refForm:!1}const O=a("displayProps",{hidden:!1,componentDependency:{sortDependency:[],configDependency:{[c.HIDDEN]:{expression:""},[c.READONLY]:{expression:""},[c.DISABLED]:{expression:""},[c.REQUIRED]:{expression:""},[c.ASSIGNMENT]:{expression:"",strategy:R.alwaysCover}}}}),J=a("displayEditor",[{component:"dependency-editor",name:"componentDependency",label:"",group:r.COMPONENTDEPENDENCY,hidden:e=>e.materialType===T.MaterialEmbedTableField||e.type===C.Form&&e.preLocation?!0:s(e)},{component:"switch-editor",name:"notSubmitInHide",label:"sys.pageDesigner.submitWhenHidden",group:r.FIELD_CONFIG,hidden(e){return!e.isField||!e.props.field||!!e.props.bindFieldKey||!!e.props.fieldReadonly||e.materialType===T.cardListFormField||[l.EXPRESSION_CONDITION,l.SERIALRULE,l.LABEL_TEMPLATE].includes(e.props.fieldType)}}]),io=a("baseBtnProp",{disabled:!1,icon:"icon-park:all-application",iconColor:"",title:"${sys.pageDesigner.button}",buttonStyle:E.ORDINARY,confirm:!1,confirmText:"",hasIcon:!1,hasText:!0,type:B.PRIMARY,danger:!1,size:m.DEFAULT,enableCustomColor:!1,backgroundColor:"",fontColor:"",...O}),ao=a("baseBtnEditor",[{component:"text-editor",name:"title",label:"sys.pageDesigner.buttonName",group:r.BASIC,_config:{i18n:!0,showCount:!0,maxlength:32},changeCallback:(e,o)=>{e.alias=o}},{component:"button-type-editor",name:{type:"type",danger:"danger",icon:"icon",label:"label",hasText:"hasText",hasIcon:"hasIcon"},label:"sys.pageDesigner.buttonType",group:r.BUTTON},{component:"icon-editor",name:{icon:"icon",iconColor:"iconColor"},label:"sys.pageDesigner.buttonIcon",group:r.BUTTON,hidden:e=>!e.props.hasIcon},{component:"radio-bgc-editor",name:"size",label:"sys.pageDesigner.buttonSize",group:r.BUTTON,_config:{options:Object.values(m).map(e=>({value:e,label:"sys.pageDesigner."+e}))}}]),po=a("buttonProps",{disabled:!1,buttonTheme:N.DEFAULT,buttonType:x.DEFAULT,icon:"",iconColor:"",buttonStyle:E.ORDINARY,enableCustomColor:!1,backgroundColor:"",fontColor:""}),lo=a("buttonEditor",[{component:"button-type-editor",name:{type:"type",danger:"danger",icon:"icon",label:"label",hasText:"hasText",hasIcon:"hasIcon"},label:"sys.pageDesigner.buttonType",group:r.ButtonStyle,hidden:e=>s(e)},{component:"icon-editor",name:{icon:"icon",iconColor:"iconColor"},label:"sys.pageDesigner.buttonIcon",group:r.ButtonStyle,hidden:e=>!e.props.hasIcon||s(e),_config:{clearable:!1}},{component:"switch-editor",name:"enableCustomColor",label:"sys.pageDesigner.customBtnColor",group:r.ButtonStyle,hidden:e=>s(e)},{component:"button-color-editor",name:"fontColor",label:"sys.pageDesigner.buttonNameColor",group:r.ButtonStyle,_config:{isInRow:!0},hidden:e=>!e.props.enableCustomColor},{component:"button-color-editor",name:"backgroundColor",label:"sys.pageDesigner.buttonStyleColor",group:r.ButtonStyle,_config:{isInRow:!0},hidden:e=>!e.props.enableCustomColor||e.props.type==="link"},{component:"radio-bgc-editor",name:"size",label:"sys.pageDesigner.buttonSize",group:r.ButtonStyle,hidden:e=>!!e,_config:{options:Object.values(m).map(e=>({value:e,label:"sys.pageDesigner."+e}))}},{component:"switch-editor",name:"confirm",label:"sys.pageDesigner.confirm",group:r.ButtonStyle,hidden:e=>s(e),_config:{tooltip:"sys.pageDesigner.buttonConfirm"}},{component:"texteare-editor",name:"confirmText",label:"sys.pageDesigner.regHint",group:r.ButtonStyle,_config:{i18n:!0,placeholder:"sys.pageDesigner.confirmTodo"},hidden:e=>!e.props.confirm||s(e)}]),so=a("buttonStyleEditor",[{component:"position-editor",name:"position",label:"sys.pageDesigner.position",group:S.LAYOUT,hidden:e=>!!e.props.parentWidgetId||!!e.preLocation},{component:"margin-editor",group:S.MARGIN,hidden:e=>!!e.props.parentWidgetId||!!e.preLocation,_config:{hiddenMarginOrPadding:"padding"}}]),co=a("fixedAlignEditor",[{component:"radio-icon-editor",name:"fixedAlign",label:"sys.pageDesigner.columnFixed",group:r.SHOW,_config:{options:[{label:"sys.pageDesigner.left",value:f.LEFT},{label:"sys.pageDesigner.none",value:f.NONE},{label:"sys.pageDesigner.right",value:f.RIGHT}]}}]),go=a("formItemProps",{field:"",fieldId:"",label:"",modelKey:"",fieldType:void 0,bindModelKey:void 0,disabled:!1,explain:"",showExplain:!1,displayLabelText:!0,readonly:!1,fieldReadonly:!1,notSubmitInHide:!0,...O}),uo=a("formItemDisplayEditor",[{component:"switch-editor",name:"showExplain",label:"sys.pageDesigner.explain",group:r.BASIC,hidden:e=>e.platform===A.MOBILE},{component:"texteare-editor",name:"explain",label:"",group:r.BASIC,hidden:e=>!e.props.showExplain,_config:{i18n:!0}},{component:"switch-editor",name:"displayLabelText",label:"sys.pageDesigner.displayLabelText",group:r.ADVANCED},{component:"switch-editor",name:"disabled",label:"sys.pageDesigner.disabled",group:r.ADVANCED},{component:"switch-editor",name:"readonly",label:"sys.pageDesigner.readonly",group:r.ADVANCED},...J]),bo=a("permissionEditor",[{component:"permission-editor",label:"",group:r.PERMISSION,hidden:e=>s(e)}]);function P(){if(!window._gct){console.error("未找到 _gct 对象,请先安装 @gct-paas/core 包后再安装 @gct-paas/design 包!");return}window._gct.message=new t}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { VariableTypeEnum } from './variable-type/variable-type';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var VariableTypeEnum = /* @__PURE__ */ ((VariableTypeEnum2) => {
|
|
3
|
+
VariableTypeEnum2["String"] = "String";
|
|
4
|
+
VariableTypeEnum2["Number"] = "Number";
|
|
5
|
+
VariableTypeEnum2["Boolean"] = "Boolean";
|
|
6
|
+
VariableTypeEnum2["Object"] = "Object";
|
|
7
|
+
VariableTypeEnum2["Array"] = "Array";
|
|
8
|
+
VariableTypeEnum2["DataTime"] = "DataTime";
|
|
9
|
+
VariableTypeEnum2["Null"] = "Null";
|
|
10
|
+
return VariableTypeEnum2;
|
|
11
|
+
})(VariableTypeEnum || {});
|
|
12
|
+
|
|
13
|
+
export { VariableTypeEnum };
|
package/es/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import './utils/index.mjs';
|
|
1
2
|
import './hooks/index.mjs';
|
|
2
3
|
import './interface/index.mjs';
|
|
3
4
|
import './schema/index.mjs';
|
|
5
|
+
import { MessageUtil } from './utils/message/message.mjs';
|
|
4
6
|
export { useStyle } from './hooks/useStyle.mjs';
|
|
5
7
|
export { getAutofillEditor } from './schema/common-config/autofill-editor-config.mjs';
|
|
6
8
|
export { baseBtnEditor, baseBtnProp } from './schema/common-config/base-button-config.mjs';
|
|
@@ -14,12 +16,13 @@ export { permissionEditor } from './schema/common-config/permission-editor-confi
|
|
|
14
16
|
|
|
15
17
|
"use strict";
|
|
16
18
|
function install() {
|
|
17
|
-
if (!window.
|
|
19
|
+
if (!window._gct) {
|
|
18
20
|
console.error(
|
|
19
|
-
"\u672A\u627E\u5230
|
|
21
|
+
"\u672A\u627E\u5230 _gct \u5BF9\u8C61\uFF0C\u8BF7\u5148\u5B89\u88C5 @gct-paas/core \u5305\u540E\u518D\u5B89\u88C5 @gct-paas/design \u5305\uFF01"
|
|
20
22
|
);
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
25
|
+
window._gct.message = new MessageUtil();
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
export { install as default, install };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/core';
|
|
2
|
+
import { IDesignDragState } from '../state/i-design-drag.state';
|
|
3
|
+
import { IDesignViewController } from './i-design-view.controller';
|
|
4
|
+
/**
|
|
5
|
+
* 设计界面单区域拖拽控制器
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @interface IDesignDragController
|
|
9
|
+
*/
|
|
10
|
+
export interface IDesignDragController {
|
|
11
|
+
/**
|
|
12
|
+
* 设计界面控制器
|
|
13
|
+
*
|
|
14
|
+
* @type {IDesignViewController}
|
|
15
|
+
*/
|
|
16
|
+
readonly view: IDesignViewController;
|
|
17
|
+
/**
|
|
18
|
+
* 设计界面单拖拽区域状态
|
|
19
|
+
*
|
|
20
|
+
* @type {IDesignDragState}
|
|
21
|
+
*/
|
|
22
|
+
readonly state: IDesignDragState;
|
|
23
|
+
/**
|
|
24
|
+
* 新增组件
|
|
25
|
+
*
|
|
26
|
+
* @param {LowCodeWidget.BasicSchema} widget
|
|
27
|
+
* @returns {*} {LowCodeWidget.BasicSchema}
|
|
28
|
+
*/
|
|
29
|
+
addWidget(widget: LowCodeWidget.BasicSchema): LowCodeWidget.BasicSchema;
|
|
30
|
+
/**
|
|
31
|
+
* 删除组件
|
|
32
|
+
*
|
|
33
|
+
* @param {LowCodeWidget.BasicSchema} widget
|
|
34
|
+
*/
|
|
35
|
+
deleteWidget(widget: LowCodeWidget.BasicSchema): void;
|
|
36
|
+
/**
|
|
37
|
+
* 更新组件
|
|
38
|
+
*
|
|
39
|
+
* @param {LowCodeWidget.BasicSchema} widget
|
|
40
|
+
*/
|
|
41
|
+
updateWidget(widget: LowCodeWidget.BasicSchema): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IDesignerProvider, LowCodeWidget } from '@gct-paas/core';
|
|
2
|
+
import { IDesignViewState } from '../state/i-design-view.state';
|
|
3
|
+
/**
|
|
4
|
+
* 设计界面控制器
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IDesignViewController
|
|
8
|
+
*/
|
|
9
|
+
export interface IDesignViewController {
|
|
10
|
+
/**
|
|
11
|
+
* 设计界面状态
|
|
12
|
+
*
|
|
13
|
+
* @type {IDesignViewState}
|
|
14
|
+
*/
|
|
15
|
+
readonly state: IDesignViewState;
|
|
16
|
+
/**
|
|
17
|
+
* 设计界面所有适配器
|
|
18
|
+
*
|
|
19
|
+
* @type {IDesignerProvider[]}
|
|
20
|
+
*/
|
|
21
|
+
readonly providers: IDesignerProvider[];
|
|
22
|
+
/**
|
|
23
|
+
* 获取指定插件适配器
|
|
24
|
+
*
|
|
25
|
+
* @param {string} tag
|
|
26
|
+
* @returns {*} {(IDesignerProvider | undefined)}
|
|
27
|
+
*/
|
|
28
|
+
getProvider(tag: string): IDesignerProvider | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* 激活选中组件
|
|
31
|
+
*
|
|
32
|
+
* @param {LowCodeWidget.BasicSchema} widget
|
|
33
|
+
*/
|
|
34
|
+
setSelect(widget: LowCodeWidget.BasicSchema): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { LowCodeModal, LowCodeWidget } from '@gct-paas/core';
|
|
2
|
+
import { VariableTypeEnum } from '../../constant';
|
|
3
|
+
/**
|
|
4
|
+
* 局部变量
|
|
5
|
+
*/
|
|
6
|
+
export interface VariableInterface {
|
|
7
|
+
name: string;
|
|
8
|
+
type: VariableTypeEnum;
|
|
9
|
+
defaultValue: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface LoDataObject {
|
|
13
|
+
name: string;
|
|
14
|
+
title: string;
|
|
15
|
+
controls: Record<string, object>;
|
|
16
|
+
variables: VariableInterface[];
|
|
17
|
+
graphJSON: object;
|
|
18
|
+
runtimeJs: string;
|
|
19
|
+
createBy: string;
|
|
20
|
+
createTime: string;
|
|
21
|
+
modifyBy: string;
|
|
22
|
+
modifyTime: string;
|
|
23
|
+
bindTo: string[];
|
|
24
|
+
/**输入变量 */
|
|
25
|
+
parameter?: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface PageJson {
|
|
28
|
+
id: string;
|
|
29
|
+
keepAlive: boolean;
|
|
30
|
+
/**页面事件 */
|
|
31
|
+
pageEvents: {
|
|
32
|
+
/**页面加载前 */
|
|
33
|
+
pageBeforeMount?: LowCodeWidget.JsEvent | LowCodeWidget.InnerEvents[];
|
|
34
|
+
/**页面加载事件 */
|
|
35
|
+
pageMounted?: LowCodeWidget.JsEvent | LowCodeWidget.InnerEvents[];
|
|
36
|
+
/**页面离开事件 */
|
|
37
|
+
pageDestroyed?: LowCodeWidget.JsEvent | LowCodeWidget.InnerEvents[];
|
|
38
|
+
};
|
|
39
|
+
widgets: LowCodeWidget.BasicSchema[];
|
|
40
|
+
js: string;
|
|
41
|
+
css: string;
|
|
42
|
+
modals: LowCodeModal.Modal[];
|
|
43
|
+
template: unknown[];
|
|
44
|
+
timestamp?: number;
|
|
45
|
+
newDesigner?: boolean;
|
|
46
|
+
/**全局页面事件 */
|
|
47
|
+
globalEvents: {
|
|
48
|
+
/**页面加载公共事件ID */
|
|
49
|
+
pageMounted?: string;
|
|
50
|
+
/**页面离开公共事件ID */
|
|
51
|
+
pageDestroyed?: string;
|
|
52
|
+
};
|
|
53
|
+
los?: Record<string, LoDataObject>;
|
|
54
|
+
permissions: Record<string, string | null>;
|
|
55
|
+
style: Partial<LowCodeWidget.BasicStyle>;
|
|
56
|
+
pageConfig: Partial<PageConfig>;
|
|
57
|
+
pageVars: LowCodeWidget.PageVars[];
|
|
58
|
+
}
|
|
59
|
+
interface PageConfig {
|
|
60
|
+
title: string;
|
|
61
|
+
i18n: {
|
|
62
|
+
key?: string;
|
|
63
|
+
title?: string;
|
|
64
|
+
};
|
|
65
|
+
hasFooter: boolean;
|
|
66
|
+
}
|
|
67
|
+
interface PageStyle {
|
|
68
|
+
enableHeaderBGColor?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export type ExportMethod = Record<string, {
|
|
71
|
+
params: string;
|
|
72
|
+
source: string;
|
|
73
|
+
type: string;
|
|
74
|
+
}>;
|
|
75
|
+
export interface History {
|
|
76
|
+
createTime: string;
|
|
77
|
+
createUserName: string;
|
|
78
|
+
designJson: string;
|
|
79
|
+
runtimeJson: string;
|
|
80
|
+
}
|
|
81
|
+
export interface RuntimePageJson {
|
|
82
|
+
widgets: LowCodeWidget.BasicSchema[];
|
|
83
|
+
runJs: string;
|
|
84
|
+
modals: RuntimeModal[];
|
|
85
|
+
css: string;
|
|
86
|
+
keepAlive: boolean;
|
|
87
|
+
/**全局页面事件 */
|
|
88
|
+
globalEvents: {
|
|
89
|
+
/**页面加载公共事件ID */
|
|
90
|
+
pageMounted?: string;
|
|
91
|
+
/**页面激活公共事件ID */
|
|
92
|
+
pageActivated?: string;
|
|
93
|
+
/**页面离开公共事件ID */
|
|
94
|
+
pageDestroyed?: string;
|
|
95
|
+
};
|
|
96
|
+
/**页面加载事件 */
|
|
97
|
+
pageEvents: {
|
|
98
|
+
/**页面加载前 */
|
|
99
|
+
pageBeforeMount?: {
|
|
100
|
+
/**JS方法名称 */
|
|
101
|
+
name: string;
|
|
102
|
+
/**event额外参数 */
|
|
103
|
+
extraParams: Record<string, any> | string | number | boolean;
|
|
104
|
+
};
|
|
105
|
+
/**页面加载事件 */
|
|
106
|
+
pageMounted?: {
|
|
107
|
+
/**JS方法名称 */
|
|
108
|
+
name: string;
|
|
109
|
+
/**event额外参数 */
|
|
110
|
+
extraParams: Record<string, any> | string | number | boolean;
|
|
111
|
+
};
|
|
112
|
+
/**页面激活事件 */
|
|
113
|
+
pageActivated?: {
|
|
114
|
+
/**JS方法名称 */
|
|
115
|
+
name: string;
|
|
116
|
+
/**event额外参数 */
|
|
117
|
+
extraParams: Record<string, any> | string | number | boolean;
|
|
118
|
+
};
|
|
119
|
+
/**页面离开事件 */
|
|
120
|
+
pageDestroyed?: {
|
|
121
|
+
/**JS方法名称 */
|
|
122
|
+
name: string;
|
|
123
|
+
/**event额外参数 */
|
|
124
|
+
extraParams: Record<string, any> | string | number | boolean;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
pageConfig: Partial<PageConfig>;
|
|
128
|
+
pageStyle: Partial<PageStyle>;
|
|
129
|
+
}
|
|
130
|
+
export interface RuntimeModal {
|
|
131
|
+
props?: LowCodeModal.ModalProps;
|
|
132
|
+
css?: string;
|
|
133
|
+
modalName?: string;
|
|
134
|
+
id?: string;
|
|
135
|
+
i18n?: Record<string, string>;
|
|
136
|
+
events?: LowCodeWidget.BasicEvents;
|
|
137
|
+
children?: [LowCodeModal.ModalBody, LowCodeModal.ModalBody];
|
|
138
|
+
runJs?: string;
|
|
139
|
+
style: Partial<LowCodeWidget.BasicStyle>;
|
|
140
|
+
}
|
|
141
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 拖拽状态收集器
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @interface IDragCollect
|
|
6
|
+
*/
|
|
7
|
+
export interface IDragCollect {
|
|
8
|
+
/**
|
|
9
|
+
* 是否可以拖拽
|
|
10
|
+
*
|
|
11
|
+
* @type {boolean}
|
|
12
|
+
*/
|
|
13
|
+
canDrag: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 是否正在拖拽
|
|
16
|
+
*
|
|
17
|
+
* @type {boolean}
|
|
18
|
+
*/
|
|
19
|
+
isDragging: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/core';
|
|
2
|
+
/**
|
|
3
|
+
* 拖拽数据项
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @interface IDragDataItem
|
|
7
|
+
* @template O
|
|
8
|
+
*/
|
|
9
|
+
export interface IDragDataItem<O = LowCodeWidget.BasicSchema> {
|
|
10
|
+
/**
|
|
11
|
+
* 当前数据标识,如果是新数据则主键为空
|
|
12
|
+
*
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
id: string;
|
|
16
|
+
/**
|
|
17
|
+
* 拖拽分组实例标识
|
|
18
|
+
*
|
|
19
|
+
* @type {string}
|
|
20
|
+
*/
|
|
21
|
+
group: string;
|
|
22
|
+
/**
|
|
23
|
+
* 拖拽项原位置索引
|
|
24
|
+
*
|
|
25
|
+
* @type {number}
|
|
26
|
+
*/
|
|
27
|
+
index: number;
|
|
28
|
+
/**
|
|
29
|
+
* 当前拖拽数据
|
|
30
|
+
*
|
|
31
|
+
* @type {O}
|
|
32
|
+
*/
|
|
33
|
+
data: O;
|
|
34
|
+
/**
|
|
35
|
+
* 数据模式
|
|
36
|
+
*
|
|
37
|
+
* @type {('create' | 'move')} 新建 | 移动
|
|
38
|
+
*/
|
|
39
|
+
mode: 'create' | 'move';
|
|
40
|
+
/**
|
|
41
|
+
* 包含自身 + 所有子的类型,目前主要用于拖拽限制
|
|
42
|
+
*
|
|
43
|
+
* @type {string[]}
|
|
44
|
+
*/
|
|
45
|
+
types: string[];
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 拖拽项
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @interface IDragItem
|
|
6
|
+
*/
|
|
7
|
+
export interface IDragItem {
|
|
8
|
+
/**
|
|
9
|
+
* 下标
|
|
10
|
+
*
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
index: number;
|
|
14
|
+
/**
|
|
15
|
+
* 标识
|
|
16
|
+
*
|
|
17
|
+
* @type {string}
|
|
18
|
+
*/
|
|
19
|
+
id: string;
|
|
20
|
+
/**
|
|
21
|
+
* 类型
|
|
22
|
+
*
|
|
23
|
+
* @type {string}
|
|
24
|
+
*/
|
|
25
|
+
type: string;
|
|
26
|
+
/**
|
|
27
|
+
* 拖拽数据
|
|
28
|
+
*
|
|
29
|
+
* @type {IObject}
|
|
30
|
+
*/
|
|
31
|
+
data: IObject;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 放置状态收集器
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @interface IDropCollect
|
|
6
|
+
*/
|
|
7
|
+
export interface IDropCollect {
|
|
8
|
+
/**
|
|
9
|
+
* 拖拽元素标识
|
|
10
|
+
*
|
|
11
|
+
* @type {string}
|
|
12
|
+
*/
|
|
13
|
+
handlerId: string;
|
|
14
|
+
/**
|
|
15
|
+
* 是否可以放置
|
|
16
|
+
*
|
|
17
|
+
* @type {boolean}
|
|
18
|
+
*/
|
|
19
|
+
canDrop: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 是否只在单一元素放置
|
|
22
|
+
*
|
|
23
|
+
* @type {boolean}
|
|
24
|
+
*/
|
|
25
|
+
isShallowOver: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 是否放置中
|
|
28
|
+
*
|
|
29
|
+
* @type {boolean}
|
|
30
|
+
*/
|
|
31
|
+
isOver: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 放置结果回执
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @interface IDropResult
|
|
6
|
+
*/
|
|
7
|
+
export interface IDropResultData {
|
|
8
|
+
/**
|
|
9
|
+
* 放置分组标识
|
|
10
|
+
*
|
|
11
|
+
* @type {string}
|
|
12
|
+
*/
|
|
13
|
+
group: string;
|
|
14
|
+
/**
|
|
15
|
+
* 是否成功放置
|
|
16
|
+
*
|
|
17
|
+
* @type {boolean}
|
|
18
|
+
*/
|
|
19
|
+
success: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 拖拽操作返回值
|
|
23
|
+
*
|
|
24
|
+
* @export
|
|
25
|
+
* @interface IDropResult
|
|
26
|
+
*/
|
|
27
|
+
export interface IDropResult {
|
|
28
|
+
/**
|
|
29
|
+
* 放置异步沟通操作
|
|
30
|
+
*
|
|
31
|
+
* @type {Promise<IDropResultData>}
|
|
32
|
+
*/
|
|
33
|
+
asyncDrop: Promise<IDropResultData>;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/es/interface/index.d.ts
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
+
export type { IDesignDragController } from './controller/i-design-drag.controller';
|
|
2
|
+
export type { IDesignViewController } from './controller/i-design-view.controller';
|
|
3
|
+
export type { IDragCollect } from './i-drag-collect/i-drag-collect';
|
|
4
|
+
export type { IDragDataItem } from './i-drag-data-item/i-drag-data-item';
|
|
5
|
+
export type { IDragItem } from './i-drag-item/i-drag-item';
|
|
6
|
+
export type { IDropCollect } from './i-drop-collect/i-drop-collect';
|
|
7
|
+
export type { IDropResult, IDropResultData, } from './i-drop-result/i-drop-result';
|
|
8
|
+
export type { ExportMethod, History, LoDataObject, PageJson, RuntimeModal, RuntimePageJson, VariableInterface, } from './design-page/design-page';
|
|
1
9
|
export * from './props';
|
|
10
|
+
export type { IDesignDragState } from './state/i-design-drag.state';
|
|
11
|
+
export type { IDesignViewState } from './state/i-design-view.state';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/core';
|
|
2
|
+
/**
|
|
3
|
+
* 设计界面拖拽状态
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @interface IDesignDragState
|
|
7
|
+
*/
|
|
8
|
+
export interface IDesignDragState {
|
|
9
|
+
/**
|
|
10
|
+
* 拖拽设计界面组件清单
|
|
11
|
+
*
|
|
12
|
+
* @type {LowCodeWidget.BasicSchema[]}
|
|
13
|
+
*/
|
|
14
|
+
widgets: LowCodeWidget.BasicSchema[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/core';
|
|
2
|
+
import { PageJson } from '../design-page/design-page';
|
|
3
|
+
/**
|
|
4
|
+
* 设计界面状态
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IDesignViewState
|
|
8
|
+
*/
|
|
9
|
+
export interface IDesignViewState {
|
|
10
|
+
/**
|
|
11
|
+
* 是否为移动端
|
|
12
|
+
*
|
|
13
|
+
* @type {boolean}
|
|
14
|
+
*/
|
|
15
|
+
isMobile: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 界面模型
|
|
18
|
+
*
|
|
19
|
+
* @type {PageJson}
|
|
20
|
+
*/
|
|
21
|
+
model: PageJson;
|
|
22
|
+
/**
|
|
23
|
+
* 当前选中激活的组件对象
|
|
24
|
+
*
|
|
25
|
+
* @type {(LowCodeWidget.BasicSchema | null)}
|
|
26
|
+
*/
|
|
27
|
+
selectWidget: LowCodeWidget.BasicSchema | null;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MessageUtil } from './message/message';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IMessageUtil } from '@gct-paas/core';
|
|
2
|
+
/**
|
|
3
|
+
* 消息提示工具
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @class MessageUtil
|
|
7
|
+
* @implements {IMessageUtil}
|
|
8
|
+
*/
|
|
9
|
+
export declare class MessageUtil implements IMessageUtil {
|
|
10
|
+
info(msg: string, duration?: number): Promise<void>;
|
|
11
|
+
success(msg: string, duration?: number): Promise<void>;
|
|
12
|
+
warning(msg: string, duration?: number): Promise<void>;
|
|
13
|
+
error(msg: string, duration?: number): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { message } from 'ant-design-vue';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
class MessageUtil {
|
|
5
|
+
info(msg, duration) {
|
|
6
|
+
return new Promise((resolve) => {
|
|
7
|
+
message.info(msg, duration, () => {
|
|
8
|
+
resolve();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
success(msg, duration) {
|
|
13
|
+
return new Promise((resolve) => {
|
|
14
|
+
message.success(msg, duration, () => {
|
|
15
|
+
resolve();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
warning(msg, duration) {
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
message.warning(msg, duration, () => {
|
|
22
|
+
resolve();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
error(msg, duration) {
|
|
27
|
+
return new Promise((resolve) => {
|
|
28
|
+
message.error(msg, duration, () => {
|
|
29
|
+
resolve();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { MessageUtil };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台设计界面底包",
|
|
6
6
|
"main": "dist/index.min.cjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"scripts": {
|
|
34
34
|
"dev": "rollup -c -w --environment=NODE_ENV:development",
|
|
35
35
|
"build": "npm run lint && rollup -c --environment=NODE_ENV:production && vite build --mode production --config vite.config.ts",
|
|
36
|
-
"lint": "eslint src
|
|
36
|
+
"lint": "eslint src --fix",
|
|
37
37
|
"publish:next": "npm run build && npm publish --access public --tag=next --registry=https://registry.npmjs.org/",
|
|
38
38
|
"publish:dev": "npm run build && npm publish --access public --tag=dev --registry=https://registry.npmjs.org/",
|
|
39
39
|
"publish:alpha": "npm run build && npm publish --access public --tag=alpha --registry=https://registry.npmjs.org/",
|
|
@@ -41,13 +41,19 @@
|
|
|
41
41
|
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@gct-paas/build": "0.
|
|
45
|
-
"@gct-paas/core": "0.
|
|
44
|
+
"@gct-paas/build": "0.1.0",
|
|
45
|
+
"@gct-paas/core": "0.1.0",
|
|
46
|
+
"ant-design-vue": "3.2.20",
|
|
47
|
+
"lodash-es": "^4.17.21",
|
|
48
|
+
"lokijs": "^1.5.12",
|
|
46
49
|
"qx-util": "^0.4.8",
|
|
47
50
|
"vue": "^3.5.13"
|
|
48
51
|
},
|
|
49
52
|
"peerDependencies": {
|
|
50
53
|
"vue": "^3.x"
|
|
51
54
|
},
|
|
52
|
-
"
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/lokijs": "^1.5.14"
|
|
57
|
+
},
|
|
58
|
+
"gitHead": "96fcf21faa16ee10f8a5e0d023aae38641d91d36"
|
|
53
59
|
}
|