@farris/ui-vue 1.2.8 → 1.2.9
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 +129 -129
- package/components/accordion/index.umd.cjs +1 -0
- package/components/avatar/index.esm.js +166 -157
- package/components/avatar/index.umd.cjs +1 -0
- package/components/border-editor/index.umd.cjs +1 -0
- package/components/button/index.umd.cjs +1 -0
- package/components/button-edit/index.esm.js +343 -325
- package/components/button-edit/index.umd.cjs +1 -0
- package/components/button-group/index.umd.cjs +1 -0
- package/components/calculator/index.umd.cjs +1 -0
- package/components/calendar/index.esm.js +338 -338
- package/components/calendar/index.umd.cjs +1 -0
- package/components/capsule/index.esm.js +182 -182
- package/components/capsule/index.umd.cjs +1 -0
- package/components/checkbox/index.esm.js +326 -317
- package/components/checkbox/index.umd.cjs +1 -0
- package/components/color-picker/index.esm.js +118 -118
- package/components/color-picker/index.umd.cjs +3 -0
- package/components/combo-list/index.esm.js +338 -325
- package/components/combo-list/index.umd.cjs +1 -0
- package/components/combo-tree/index.esm.js +62 -62
- package/components/combo-tree/index.umd.cjs +1 -0
- package/components/common/index.umd.cjs +1 -0
- package/components/component/index.esm.js +382 -270
- package/components/component/index.umd.cjs +1 -0
- package/components/condition/index.esm.js +1018 -895
- package/components/condition/index.umd.cjs +1 -0
- package/components/content-container/index.esm.js +285 -212
- package/components/content-container/index.umd.cjs +1 -0
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +4761 -4319
- package/components/data-grid/index.umd.cjs +1 -0
- package/components/data-view/index.esm.js +2901 -2664
- package/components/data-view/index.umd.cjs +1 -0
- package/components/date-picker/index.esm.js +1502 -1488
- package/components/date-picker/index.umd.cjs +1 -0
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +938 -928
- package/components/designer-canvas/index.umd.cjs +1 -0
- package/components/designer-outline/index.css +1 -1
- package/components/designer-outline/index.esm.js +27 -27
- package/components/designer-outline/index.umd.cjs +1 -0
- package/components/designer-toolbox/index.esm.js +36 -12
- package/components/designer-toolbox/index.umd.cjs +1 -0
- package/components/discussion-editor/index.umd.cjs +3 -0
- package/components/discussion-list/index.umd.cjs +1 -0
- package/components/drawer/index.umd.cjs +1 -0
- package/components/dropdown/index.esm.js +241 -241
- package/components/dropdown/index.umd.cjs +2 -0
- package/components/dynamic-form/index.esm.js +1074 -885
- package/components/dynamic-form/index.umd.cjs +1 -0
- package/components/dynamic-resolver/index.esm.js +99 -94
- package/components/dynamic-resolver/index.umd.cjs +1 -0
- package/components/dynamic-view/index.umd.cjs +1 -0
- package/components/enum-editor/index.umd.cjs +1 -0
- package/components/events-editor/index.esm.js +577 -522
- package/components/events-editor/index.umd.cjs +1 -0
- package/components/expression-editor/index.esm.js +70 -70
- package/components/expression-editor/index.umd.cjs +1 -0
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +2938 -2619
- package/components/external-container/index.umd.cjs +1 -0
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +4766 -4325
- package/components/field-selector/index.umd.cjs +1 -0
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1231 -1215
- package/components/filter-bar/index.umd.cjs +1 -0
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +1062 -1052
- package/components/flow-canvas/index.umd.cjs +1 -0
- package/components/image-cropper/index.esm.js +373 -373
- package/components/image-cropper/index.umd.cjs +1 -0
- package/components/input-group/index.esm.js +398 -394
- package/components/input-group/index.umd.cjs +1 -0
- package/components/layout/index.esm.js +268 -268
- package/components/layout/index.umd.cjs +1 -0
- package/components/list-nav/index.esm.js +234 -161
- package/components/list-nav/index.umd.cjs +1 -0
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +2288 -2048
- package/components/list-view/index.umd.cjs +1 -0
- package/components/loading/index.umd.cjs +8 -0
- package/components/locale/index.umd.cjs +1 -0
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +5776 -5305
- package/components/lookup/index.umd.cjs +1 -0
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +5496 -5036
- package/components/mapping-editor/index.umd.cjs +1 -0
- package/components/message-box/index.umd.cjs +1 -0
- package/components/modal/index.umd.cjs +1 -0
- package/components/nav/index.esm.js +383 -322
- package/components/nav/index.umd.cjs +3 -0
- package/components/notify/index.umd.cjs +1 -0
- package/components/number-range/index.esm.js +273 -269
- package/components/number-range/index.umd.cjs +1 -0
- package/components/number-spinner/index.esm.js +292 -283
- package/components/number-spinner/index.umd.cjs +1 -0
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1008 -925
- package/components/order/index.umd.cjs +1 -0
- package/components/page-footer/index.esm.js +98 -98
- package/components/page-footer/index.umd.cjs +1 -0
- package/components/page-header/index.esm.js +949 -847
- package/components/page-header/index.umd.cjs +1 -0
- package/components/pagination/index.esm.js +464 -403
- package/components/pagination/index.umd.cjs +1 -0
- package/components/popover/index.umd.cjs +1 -0
- package/components/progress/index.esm.js +226 -226
- package/components/progress/index.umd.cjs +3 -0
- package/components/property-editor/index.esm.js +1110 -1092
- package/components/property-editor/index.umd.cjs +3 -0
- package/components/property-panel/index.esm.js +520 -513
- package/components/property-panel/index.umd.cjs +1 -0
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +1714 -1575
- package/components/query-solution/index.umd.cjs +1 -0
- package/components/radio-button/index.esm.js +67 -67
- package/components/radio-button/index.umd.cjs +1 -0
- package/components/radio-group/index.esm.js +298 -289
- package/components/radio-group/index.umd.cjs +1 -0
- package/components/rate/index.esm.js +195 -190
- package/components/rate/index.umd.cjs +1 -0
- package/components/response-layout/index.esm.js +112 -112
- package/components/response-layout/index.umd.cjs +1 -0
- package/components/response-layout-editor/index.esm.js +902 -877
- package/components/response-layout-editor/index.umd.cjs +1 -0
- package/components/response-toolbar/index.esm.js +874 -778
- package/components/response-toolbar/index.umd.cjs +1 -0
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +4594 -4289
- package/components/schema-selector/index.umd.cjs +8 -0
- package/components/search-box/index.esm.js +126 -126
- package/components/search-box/index.umd.cjs +1 -0
- package/components/section/index.esm.js +645 -503
- package/components/section/index.umd.cjs +1 -0
- package/components/smoke-detector/index.esm.js +120 -120
- package/components/smoke-detector/index.umd.cjs +1 -0
- package/components/spacing-editor/index.umd.cjs +1 -0
- package/components/splitter/index.esm.js +421 -348
- package/components/splitter/index.umd.cjs +1 -0
- package/components/step/index.esm.js +219 -219
- package/components/step/index.umd.cjs +1 -0
- package/components/switch/index.esm.js +232 -222
- package/components/switch/index.umd.cjs +1 -0
- package/components/tabs/index.esm.js +1823 -1744
- package/components/tabs/index.umd.cjs +1 -0
- package/components/tags/index.esm.js +399 -401
- package/components/tags/index.umd.cjs +1 -0
- package/components/text/index.esm.js +164 -164
- package/components/text/index.umd.cjs +1 -0
- package/components/textarea/index.esm.js +220 -215
- package/components/textarea/index.umd.cjs +1 -0
- package/components/time-picker/index.esm.js +693 -666
- package/components/time-picker/index.umd.cjs +1 -0
- package/components/tooltip/index.umd.cjs +1 -0
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +422 -413
- package/components/transfer/index.umd.cjs +1 -0
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +4799 -4358
- package/components/tree-grid/index.umd.cjs +1 -0
- package/components/tree-view/index.esm.js +2448 -2215
- package/components/tree-view/index.umd.cjs +1 -0
- package/components/uploader/index.esm.js +164 -164
- package/components/uploader/index.umd.cjs +2 -0
- package/components/verify-detail/index.esm.js +143 -143
- package/components/verify-detail/index.umd.cjs +1 -0
- package/components/video/index.esm.js +410 -331
- package/components/video/index.umd.cjs +1 -0
- package/components/weather/index.esm.js +901 -901
- package/components/weather/index.umd.cjs +16 -0
- package/farris.all.esm.js +12305 -11403
- package/farris.all.umd.cjs +8 -8
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/button-edit/src/designer/button-group.design.component.d.ts +7 -0
- package/types/combo-list/src/components/list-container.component.d.ts +3 -0
- package/types/combo-list/src/components/list-container.props.d.ts +5 -1
- package/types/common/entity/entity-schema.d.ts +258 -0
- package/types/component/src/component-ref.props.d.ts +4 -0
- package/types/component/src/composition/inner-component-build-info.d.ts +27 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-grid/index.d.ts +5 -2
- package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +33 -0
- package/types/data-grid/src/data-grid.component.d.ts +2 -1
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/use-group-column.d.ts +20 -0
- package/types/data-grid/src/property-config/data-grid.property-config.d.ts +4 -0
- package/types/data-grid/src/schema/schema-resolver.d.ts +2 -1
- package/types/data-view/components/column-format/boolean.component.d.ts +4 -0
- package/types/data-view/components/column-format/column-format.component.d.ts +4 -0
- package/types/data-view/components/column-format/date.component.d.ts +4 -0
- package/types/data-view/components/column-format/enum.component.d.ts +4 -0
- package/types/data-view/components/column-format/number.component.d.ts +4 -0
- package/types/data-view/composition/pagination/use-pagination.d.ts +1 -0
- package/types/data-view/composition/types.d.ts +18 -6
- package/types/data-view/composition/use-edit.d.ts +2 -1
- package/types/designer-canvas/src/composition/function/use-dragula.d.ts +2 -2
- package/types/designer-canvas/src/types.d.ts +2 -2
- package/types/dynamic-form/index.d.ts +2 -1
- package/types/dynamic-form/src/composition/response-form-component-creator.service.d.ts +31 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +2 -1
- package/types/dynamic-resolver/src/schema-resolver.d.ts +2 -1
- package/types/dynamic-resolver/src/types.d.ts +3 -2
- package/types/response-toolbar/src/response-toolbar.props.d.ts +2 -2
- package/types/response-toolbar/src/schema/schema-mapper.d.ts +4 -0
- package/types/section/src/property-config/section.property-config.d.ts +93 -0
- package/types/section/src/schema/schema-resolver.d.ts +2 -1
- package/types/tabs/src/composition/types.d.ts +2 -2
- package/types/tabs/src/designer/tab-header-item.design.component.d.ts +3 -1
- package/types/tabs/src/property-config/tab-page.property-config.d.ts +60 -0
- package/types/tabs/src/schema/schema-resolver.d.ts +2 -1
- package/types/tags/index.d.ts +36 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E.rate={},E.Vue,E.LodashES))})(this,function(E,e,U){"use strict";const G={},Q={};function W(a){const{properties:t,title:r,ignore:n}=a,s=n&&Array.isArray(n),v=Object.keys(t).reduce((g,b)=>((!s||!n.find(C=>C==b))&&(g[b]=t[b].type==="object"&&t[b].properties?W(t[b]):U.cloneDeep(t[b].default)),g),{});return(!s||!n.find(g=>g=="id"))&&(v.id=`${r}-${Date.now()}`),v}function q(a,t={},r){const n=G[a];if(n){let s=W(n);const v=Q[a];return s=v?v({getSchemaByType:q},s,t,r):s,s}return null}function Z(a,t){const r=W(t);return Object.keys(a).reduce((n,s)=>(n[s]&&typeof n[s]=="object"?Object.assign(n[s],a[s]):n[s]=a[s],n),r),r}function K(a,t){return Object.keys(a).filter(n=>a[n]!=null).reduce((n,s)=>{if(t.has(s)){const v=t.get(s);if(typeof v=="string")n[v]=a[s];else{const g=v(s,a[s],a);Object.assign(n,g)}}else n[s]=a[s];return n},{})}function x(a,t,r=new Map){const n=Z(a,t);return K(n,r)}function I(a={}){function t(l,i,d,f){if(typeof d=="number")return f[l].length===d;if(typeof d=="object"){const S=Object.keys(d)[0],M=d[S];if(S==="not")return Number(f[l].length)!==Number(M);if(S==="moreThan")return Number(f[l].length)>=Number(M);if(S==="lessThan")return Number(f[l].length)<=Number(M)}return!1}function r(l,i,d,f){return f[l]&&f[l].propertyValue&&String(f[l].propertyValue.value)===String(d)}const n=new Map([["length",t],["getProperty",r]]);Object.keys(a).reduce((l,i)=>(l.set(i,a[i]),l),n);function s(l,i){const d=l;return typeof i=="number"?[{target:d,operator:"length",param:null,value:Number(i)}]:typeof i=="boolean"?[{target:d,operator:"getProperty",param:l,value:!!i}]:typeof i=="object"?Object.keys(i).map(f=>{if(f==="length")return{target:d,operator:"length",param:null,value:i[f]};const S=f,M=i[f];return{target:d,operator:"getProperty",param:S,value:M}}):[]}function v(l){return Object.keys(l).reduce((d,f)=>{const S=s(f,l[f]);return d.push(...S),d},[])}function g(l,i){if(n.has(l.operator)){const d=n.get(l.operator);return d&&d(l.target,l.param,l.value,i)||!1}return!1}function b(l,i){return v(l).reduce((S,M)=>S&&g(M,i),!0)}function C(l,i){const d=Object.keys(l),f=d.includes("allOf"),S=d.includes("anyOf"),M=f||S,N=(M?l[M?f?"allOf":"anyOf":"allOf"]:[l]).map(p=>b(p,i));return f?!N.includes(!1):N.includes(!0)}return{parseValueSchema:C}}const ee={},te={};I();function ae(a,t,r=new Map,n=(g,b,C)=>b,s={},v=g=>g){return G[t.title]=t,Q[t.title]=n,ee[t.title]=s,te[t.title]=v,(g={})=>{const b=x(g,t,r),C=Object.keys(a).reduce((l,i)=>(l[i]=a[i].default,l),{});return Object.assign(C,b)}}function re(a,t){return{customClass:t.class,customStyle:t.style}}const le=new Map([["appearance",re]]);function ne(a,t,r){return t}const oe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/rate.schema.json",title:"rate",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for rate",type:"string"},type:{description:"The type string of rate",type:"string",default:"rate"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"],ignore:["id","appearance","binding"]},se={title:"rate",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},F={size:{type:String,default:"large"},enableHalf:{type:Boolean,default:!1},enableClear:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},pointSystem:{type:Number,default:5},lightColor:{type:String,default:""},darkColor:{type:String,default:""},iconClass:{type:String,default:"f-icon-star"},numOfStar:{type:Number,default:5},toolTipDisabled:{type:Boolean,default:!0},toolTipContents:{type:Array,default:["很不满意","不满意","一般","满意","非常满意"]},enableScore:{type:Boolean,default:!0},enableSatisfaction:{type:Boolean,default:!1},value:{type:Number,default:0},modelValue:{type:Number,default:0}},_=ae(F,oe,le,ne,se),P=e.defineComponent({name:"FRate",props:F,emits:["selectedValue","update:modelValue"],setup(a,t){const r=e.ref(a.size),n=e.ref(a.enableHalf),s=e.ref(a.enableClear),v=e.ref(a.disabled),g=e.ref(a.pointSystem),b=e.ref(a.lightColor),C=e.ref(a.darkColor),l=e.ref(a.iconClass),i=e.ref(a.numOfStar),d=e.ref(a.toolTipDisabled),f=e.ref(a.toolTipContents),S=e.ref(a.enableScore),M=e.ref(a.enableSatisfaction);let m;const V=e.ref(0),N=e.ref(0),T=e.ref(0),p=e.ref(a.modelValue);let O=1,D,u,h;const y=4;e.onMounted(()=>{});function j(){const c=i.value;h=[];for(let k=1;k<=c;k++)h.push({id:k})}function $(){let c;n.value?c=Math.ceil(p.value/O):c=p.value,N.value=(m*p.value+Math.floor(p.value)*y)/O,D=f.value[c-1]}function R(){switch(r.value){case"small":m=14;break;case"middle":m=16;break;case"large":m=18;break;case"extraLarge":m=24;break}j(),i.value&&(O=g.value/i.value),p.value&&$()}R();function L(c){return c.className.indexOf("f-icon")!==-1}function z(){return V.value===N.value&&s.value&&N.value!==0?(N.value=0,p.value=0,u=null,V.value=0,T.value=0,t.emit("selectedValue",p.value),t.emit("update:modelValue",p.value),!0):!1}function H(c,k,o){if(c.movementX||c.movementY){if(v.value)return;M.value&&(D=f.value[k-1]),c.offsetX<m/2&&n.value===!0?(V.value=m*k-m/2+y*(k-1),T.value=O*k-O/2):(V.value=m*k+y*(k-1),T.value=O*k)}if(o===!0){if(z())return;p.value=T.value,N.value=V.value,u=D,t.emit("update:modelValue",p.value),t.emit("selectedValue",p.value)}}function B(c,k){var o;if(L(c.target)&&c.target){const w=parseInt((o=c.target)==null?void 0:o.id);H(c,w,k)}}const X=e.computed(()=>T.value?T.value+"分":p.value+"分"),Y=e.computed(()=>({width:(V.value||N.value)+"px"}));function A(){V.value=0}return e.watch(()=>a.modelValue,c=>{p.value=c,$()}),()=>e.createVNode("div",{class:"farris-star-rating",onMouseover:e.withModifiers(c=>B(c,!1),["prevent"]),onMousemove:e.withModifiers(c=>B(c,!1),["prevent"]),onMouseleave:e.withModifiers(c=>A(),["prevent"]),onClick:e.withModifiers(c=>B(c,!0),["prevent"])},[e.createVNode("div",{class:"star-light-area",style:Y.value},[h.map(c=>e.createVNode("span",{class:["f-icon default-light-color ",l.value,{"f-star-sm":r.value==="small"},{"f-star-md":r.value==="middle"},{"f-star-lg":r.value==="large"},{"f-star-exlarge":r.value==="extraLarge"},{disabled:d.value}],id:c.id,style:{color:b.value}},null))]),e.createVNode("div",{class:["star-dark-area",{small:r.value==="small"},{middle:r.value==="middle"},{large:r.value==="large"}]},[h.map(c=>e.createVNode("span",{class:["f-icon default-dark-color",l.value,{"f-star-sm":r.value==="small"},{"f-star-md":r.value==="middle"},{"f-star-lg":r.value==="large"},{"f-star-exlarge":r.value==="extraLarge"}],id:c.id,style:{color:C.value}},null))]),e.createVNode("div",{class:["f-utils-fill",{"font-small":r.value==="small"},{"font-middle":r.value==="middle"},{"font-large":r.value==="large"},{"font-exlarge":r.value==="extraLarge"}]},[S.value&&e.createVNode("span",null,[e.createTextVNode(" "),X.value,e.createTextVNode(" ")]),M.value&&(u||D)&&e.createVNode("span",null,[e.createTextVNode(" "),D||u])])])}});function ie(a,t,r){var D;function n(){}const s="",v="",g=e.ref();function b(){return(t==null?void 0:t.schema.componentType)!=="frame"}function C(){return!1}function l(){return(t==null?void 0:t.schema.componentType)!=="frame"}function i(){return(t==null?void 0:t.schema.componentType)==="frame"}function d(u){if(!u||!u.value)return null;if(u.value.schema&&u.value.schema.type==="component")return u.value;const h=e.ref(u==null?void 0:u.value.parent),y=d(h);return y||null}function f(u=t){const{componentInstance:h,designerItemElementRef:y}=u;return!h||!h.value?null:h.value.canMove?y:f(u.parent)}function S(u){return!!r}function M(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function m(){}function V(u,h){}function N(u,h){const{componentType:y}=u;let j=q(y,u,h);const $=y.toLowerCase().replace("-","_");return j&&!j.id&&j.type===y&&(j.id=`${$}_${Math.random().toString().slice(2,6)}`),j}function T(u,h){const y=String(u.getAttribute("data-controltype")),j=u.getAttribute("data-feature"),$=j?JSON.parse(j):{};$.parentComponentInstance=g.value;let R=q(y,$);const L=y.toLowerCase().replace("-","_");return R&&!R.id&&R.type===y&&(R.id=`${L}_${Math.random().toString().slice(2,6)}`),R}function p(u){}function O(...u){}return g.value={canMove:b(),canSelectParent:C(),canDelete:l(),canNested:!i(),contents:t==null?void 0:t.schema.contents,elementRef:a,parent:(D=t==null?void 0:t.parent)==null?void 0:D.componentInstance,schema:t==null?void 0:t.schema,styles:s,designerClass:v,canAccepts:S,getBelongedComponentInstance:d,getDraggableDesignItemElement:f,getDraggingDisplayText:M,getPropConfig:O,getDragScopeElement:m,onAcceptMovedChildElement:V,onAcceptNewChildElement:T,onChildElementMovedOut:p,addNewChildComponentSchema:N,updateDragAndDropRules:n,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},g}const ce=e.defineComponent({name:"FRateDesign",props:F,emits:["selectedValue"],setup(a,t){const r=e.ref(a.size),n=e.ref(a.enableHalf),s=e.ref(a.enableClear),v=e.ref(a.disabled),g=e.ref(a.pointSystem),b=e.ref(a.lightColor),C=e.ref(a.darkColor),l=e.ref(a.iconClass),i=e.ref(a.numOfStar),d=e.ref(a.toolTipDisabled),f=e.ref(a.toolTipContents),S=e.ref(a.enableScore),M=e.ref(a.enableSatisfaction);let m;const V=e.ref(1);let N=0;const T=e.ref(0),p=e.ref(0);let O=1,D,u,h;const y=4,j=e.ref(),$=e.inject("design-item-context"),R=ie(j,$);e.onMounted(()=>{j.value.componentInstance=R}),t.expose(R.value),e.onMounted(()=>{});function L(){const o=i.value;h=[];for(let w=1;w<=o;w++)h.push({id:w})}function z(){let o;n.value?o=Math.ceil(p.value/O):o=p.value,N=(m*p.value+Math.floor(p.value)*y)/O,D=f.value[o-1]}function H(){switch(r.value){case"small":m=14;break;case"middle":m=16;break;case"large":m=18;break;case"extraLarge":m=24;break}L(),i.value&&(O=g.value/i.value),p.value&&z()}H();function B(o){return o.className.indexOf("f-icon")!==-1}function X(){return V.value===N&&s&&N!==0?(N=0,p.value=0,u=null,V.value=0,T.value=0,t.emit("selectedValue",p.value),!0):!1}function Y(o,w,J){if(o.movementX||o.movementY){if(v.value)return;M.value&&(D=f.value[w-1]),o.offsetX<m/2&&n.value===!0?(V.value=m*w-m/2+y*(w-1),T.value=O*w-O/2):(V.value=m*w+y*(w-1),T.value=O*w)}if(J===!0){if(X())return;p.value=T.value,N=V.value,u=D,t.emit("selectedValue",p.value)}}function A(o,w){if(B(o.target)&&o.target){const J=parseInt(o.target.id);Y(o,J,w)}}const c=e.computed(()=>T.value?T.value+"分":p.value+"分"),k=e.computed(()=>({width:(V.value||N)+"px"}));return()=>e.createVNode("div",{class:"farris-star-rating",ref:j,onMouseover:e.withModifiers(o=>A(o,!1),["prevent"]),onMousemove:e.withModifiers(o=>A(o,!1),["prevent"]),onMouseout:e.withModifiers(o=>A(o,!1),["prevent"]),onClick:e.withModifiers(o=>A(o,!0),["prevent"])},[e.createVNode("div",{class:"star-light-area",style:k.value},[h.map(o=>e.createVNode("span",{class:["f-icon default-light-color ",l.value,{"f-star-sm":r.value==="small"},{"f-star-md":r.value==="middle"},{"f-star-lg":r.value==="large"},{"f-star-exlarge":r.value==="extraLarge"},{disabled:d.value}],id:o.id,style:{color:b.value}},null))]),e.createVNode("div",{class:["star-dark-area",{small:r.value==="small"},{middle:r.value==="middle"},{large:r.value==="large"}]},[h.map(o=>e.createVNode("span",{class:["f-icon default-dark-color",l.value,{"f-star-sm":r.value==="small"},{"f-star-md":r.value==="middle"},{"f-star-lg":r.value==="large"},{"f-star-exlarge":r.value==="extraLarge"}],id:o.id,style:{color:C.value}},null))]),e.createVNode("div",{class:["f-utils-fill",{"font-small":r.value==="small"},{"font-middle":r.value==="middle"},{"font-large":r.value==="large"},{"font-exlarge":r.value==="extraLarge"}]},[S.value&&e.createVNode("span",null,[e.createTextVNode(" "),c.value,e.createTextVNode(" ")]),M.value&&(u||D)&&e.createVNode("span",null,[e.createTextVNode(" "),D||u])])])}}),ue=a=>{const t=a;return t.install=function(r){r.component(t.name,a)},a};P.register=(a,t,r,n)=>{a.rate=P,t.rate=_},P.registerDesigner=(a,t,r)=>{a.rate=ce,t.rate=_};const fe=ue(P);E.FRate=P,E.default=fe,E.propsResolver=_,E.rateProps=F,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as D, createVNode as j, ref as v, inject as q, onMounted as _ } from "vue";
|
|
2
2
|
import { cloneDeep as X } from "lodash-es";
|
|
3
3
|
const z = {}, W = {};
|
|
4
|
-
function
|
|
5
|
-
const { properties: e, title: o } = t, n = Object.keys(e).reduce((
|
|
6
|
-
return n.id = `${o}-${Date.now()}
|
|
4
|
+
function O(t) {
|
|
5
|
+
const { properties: e, title: o, ignore: n } = t, r = n && Array.isArray(n), l = Object.keys(e).reduce((u, f) => ((!r || !n.find((g) => g == f)) && (u[f] = e[f].type === "object" && e[f].properties ? O(e[f]) : X(e[f].default)), u), {});
|
|
6
|
+
return (!r || !n.find((u) => u == "id")) && (l.id = `${o}-${Date.now()}`), l;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
return
|
|
8
|
+
function E(t, e = {}, o) {
|
|
9
|
+
const n = z[t];
|
|
10
|
+
if (n) {
|
|
11
|
+
let r = O(n);
|
|
12
|
+
const l = W[t];
|
|
13
|
+
return r = l ? l({ getSchemaByType: E }, r, e, o) : r, r;
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
function Y(t, e) {
|
|
18
|
-
const o =
|
|
18
|
+
const o = O(e);
|
|
19
19
|
return Object.keys(t).reduce((n, r) => (n[r] && typeof n[r] == "object" ? Object.assign(n[r], t[r]) : n[r] = t[r], n), o), o;
|
|
20
20
|
}
|
|
21
21
|
function Z(t, e) {
|
|
22
22
|
return Object.keys(t).filter((n) => t[n] != null).reduce((n, r) => {
|
|
23
23
|
if (e.has(r)) {
|
|
24
|
-
const
|
|
25
|
-
if (typeof
|
|
26
|
-
n[
|
|
24
|
+
const l = e.get(r);
|
|
25
|
+
if (typeof l == "string")
|
|
26
|
+
n[l] = t[r];
|
|
27
27
|
else {
|
|
28
|
-
const
|
|
29
|
-
Object.assign(n,
|
|
28
|
+
const u = l(r, t[r], t);
|
|
29
|
+
Object.assign(n, u);
|
|
30
30
|
}
|
|
31
31
|
} else
|
|
32
32
|
n[r] = t[r];
|
|
@@ -38,22 +38,22 @@ function C(t, e, o = /* @__PURE__ */ new Map()) {
|
|
|
38
38
|
return Z(n, o);
|
|
39
39
|
}
|
|
40
40
|
function K(t = {}) {
|
|
41
|
-
function e(s, a,
|
|
42
|
-
if (typeof
|
|
43
|
-
return
|
|
44
|
-
if (typeof
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
return Number(
|
|
48
|
-
if (
|
|
49
|
-
return Number(
|
|
50
|
-
if (
|
|
51
|
-
return Number(
|
|
41
|
+
function e(s, a, i, c) {
|
|
42
|
+
if (typeof i == "number")
|
|
43
|
+
return c[s].length === i;
|
|
44
|
+
if (typeof i == "object") {
|
|
45
|
+
const y = Object.keys(i)[0], m = i[y];
|
|
46
|
+
if (y === "not")
|
|
47
|
+
return Number(c[s].length) !== Number(m);
|
|
48
|
+
if (y === "moreThan")
|
|
49
|
+
return Number(c[s].length) >= Number(m);
|
|
50
|
+
if (y === "lessThan")
|
|
51
|
+
return Number(c[s].length) <= Number(m);
|
|
52
52
|
}
|
|
53
53
|
return !1;
|
|
54
54
|
}
|
|
55
|
-
function o(s, a,
|
|
56
|
-
return
|
|
55
|
+
function o(s, a, i, c) {
|
|
56
|
+
return c[s] && c[s].propertyValue && String(c[s].propertyValue.value) === String(i);
|
|
57
57
|
}
|
|
58
58
|
const n = /* @__PURE__ */ new Map([
|
|
59
59
|
["length", e],
|
|
@@ -61,42 +61,42 @@ function K(t = {}) {
|
|
|
61
61
|
]);
|
|
62
62
|
Object.keys(t).reduce((s, a) => (s.set(a, t[a]), s), n);
|
|
63
63
|
function r(s, a) {
|
|
64
|
-
const
|
|
65
|
-
return typeof a == "number" ? [{ target:
|
|
66
|
-
if (
|
|
67
|
-
return { target:
|
|
68
|
-
const
|
|
69
|
-
return { target:
|
|
64
|
+
const i = s;
|
|
65
|
+
return typeof a == "number" ? [{ target: i, operator: "length", param: null, value: Number(a) }] : typeof a == "boolean" ? [{ target: i, operator: "getProperty", param: s, value: !!a }] : typeof a == "object" ? Object.keys(a).map((c) => {
|
|
66
|
+
if (c === "length")
|
|
67
|
+
return { target: i, operator: "length", param: null, value: a[c] };
|
|
68
|
+
const y = c, m = a[c];
|
|
69
|
+
return { target: i, operator: "getProperty", param: y, value: m };
|
|
70
70
|
}) : [];
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return Object.keys(s).reduce((
|
|
74
|
-
const
|
|
75
|
-
return
|
|
72
|
+
function l(s) {
|
|
73
|
+
return Object.keys(s).reduce((i, c) => {
|
|
74
|
+
const y = r(c, s[c]);
|
|
75
|
+
return i.push(...y), i;
|
|
76
76
|
}, []);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function u(s, a) {
|
|
79
79
|
if (n.has(s.operator)) {
|
|
80
|
-
const
|
|
81
|
-
return
|
|
80
|
+
const i = n.get(s.operator);
|
|
81
|
+
return i && i(s.target, s.param, s.value, a) || !1;
|
|
82
82
|
}
|
|
83
83
|
return !1;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
85
|
+
function f(s, a) {
|
|
86
|
+
return l(s).reduce((y, m) => y && u(m, a), !0);
|
|
87
87
|
}
|
|
88
88
|
function g(s, a) {
|
|
89
|
-
const
|
|
90
|
-
return
|
|
89
|
+
const i = Object.keys(s), c = i.includes("allOf"), y = i.includes("anyOf"), m = c || y, R = (m ? s[m ? c ? "allOf" : "anyOf" : "allOf"] : [s]).map((T) => f(T, a));
|
|
90
|
+
return c ? !R.includes(!1) : R.includes(!0);
|
|
91
91
|
}
|
|
92
92
|
return { parseValueSchema: g };
|
|
93
93
|
}
|
|
94
94
|
const I = {}, x = {};
|
|
95
95
|
K();
|
|
96
|
-
function J(t, e, o = /* @__PURE__ */ new Map(), n = (
|
|
97
|
-
return z[e.title] = e, W[e.title] = n, I[e.title] = r, x[e.title] =
|
|
98
|
-
const
|
|
99
|
-
return Object.assign(g,
|
|
96
|
+
function J(t, e, o = /* @__PURE__ */ new Map(), n = (u, f, g) => f, r = {}, l = (u) => u) {
|
|
97
|
+
return z[e.title] = e, W[e.title] = n, I[e.title] = r, x[e.title] = l, (u = {}) => {
|
|
98
|
+
const f = C(u, e, o), g = Object.keys(t).reduce((s, a) => (s[a] = t[a].default, s), {});
|
|
99
|
+
return Object.assign(g, f);
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
function ee(t, e) {
|
|
@@ -113,7 +113,7 @@ function te(t, e, o) {
|
|
|
113
113
|
}, r;
|
|
114
114
|
})), e;
|
|
115
115
|
}
|
|
116
|
-
const re = "https://json-schema.org/draft/2020-12/schema", ne = "https://farris-design.gitee.io/response-layout.schema.json", se = "response-layout", oe = "A Farris Container Component", ae = "object",
|
|
116
|
+
const re = "https://json-schema.org/draft/2020-12/schema", ne = "https://farris-design.gitee.io/response-layout.schema.json", se = "response-layout", oe = "A Farris Container Component", ae = "object", ie = {
|
|
117
117
|
id: {
|
|
118
118
|
description: "The unique identifier for a Respnse Layout",
|
|
119
119
|
type: "string"
|
|
@@ -159,7 +159,7 @@ const re = "https://json-schema.org/draft/2020-12/schema", ne = "https://farris-
|
|
|
159
159
|
type: "boolean",
|
|
160
160
|
default: !0
|
|
161
161
|
}
|
|
162
|
-
},
|
|
162
|
+
}, ce = [
|
|
163
163
|
"id",
|
|
164
164
|
"type",
|
|
165
165
|
"contents"
|
|
@@ -169,8 +169,8 @@ const re = "https://json-schema.org/draft/2020-12/schema", ne = "https://farris-
|
|
|
169
169
|
title: se,
|
|
170
170
|
description: oe,
|
|
171
171
|
type: ae,
|
|
172
|
-
properties:
|
|
173
|
-
required:
|
|
172
|
+
properties: ie,
|
|
173
|
+
required: ce
|
|
174
174
|
}, ue = "responseLayout", le = "A Farris Container Component", fe = "object", ye = {
|
|
175
175
|
basic: {
|
|
176
176
|
description: "Basic Infomation",
|
|
@@ -254,14 +254,14 @@ const re = "https://json-schema.org/draft/2020-12/schema", ne = "https://farris-
|
|
|
254
254
|
description: le,
|
|
255
255
|
type: fe,
|
|
256
256
|
categories: ye
|
|
257
|
-
},
|
|
257
|
+
}, N = {
|
|
258
258
|
customClass: { type: String, default: "" }
|
|
259
|
-
}, B = J(
|
|
259
|
+
}, B = J(N, pe, G, te, me), M = /* @__PURE__ */ D({
|
|
260
260
|
name: "FResponseLayout",
|
|
261
|
-
props:
|
|
261
|
+
props: N,
|
|
262
262
|
emits: [],
|
|
263
263
|
setup(t, e) {
|
|
264
|
-
return () =>
|
|
264
|
+
return () => j("div", {
|
|
265
265
|
class: t.customClass
|
|
266
266
|
}, [e.slots.default && e.slots.default()]);
|
|
267
267
|
}
|
|
@@ -323,24 +323,24 @@ const re = "https://json-schema.org/draft/2020-12/schema", ne = "https://farris-
|
|
|
323
323
|
type: ve,
|
|
324
324
|
properties: Le,
|
|
325
325
|
required: Re
|
|
326
|
-
},
|
|
326
|
+
}, w = {
|
|
327
327
|
customClass: { type: String, default: "" }
|
|
328
|
-
}, V = J(
|
|
328
|
+
}, V = J(w, $e, G), S = /* @__PURE__ */ D({
|
|
329
329
|
name: "FResponseLayoutItem",
|
|
330
|
-
props:
|
|
330
|
+
props: w,
|
|
331
331
|
emits: [],
|
|
332
332
|
setup(t, e) {
|
|
333
|
-
return () =>
|
|
333
|
+
return () => j("div", {
|
|
334
334
|
class: t.customClass
|
|
335
335
|
}, [e.slots.default && e.slots.default()]);
|
|
336
336
|
}
|
|
337
337
|
});
|
|
338
338
|
function H(t, e, o) {
|
|
339
|
-
var
|
|
339
|
+
var k;
|
|
340
340
|
function n() {
|
|
341
341
|
}
|
|
342
|
-
const r = "",
|
|
343
|
-
function
|
|
342
|
+
const r = "", l = "", u = v();
|
|
343
|
+
function f() {
|
|
344
344
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
345
345
|
}
|
|
346
346
|
function g() {
|
|
@@ -352,93 +352,93 @@ function H(t, e, o) {
|
|
|
352
352
|
function a() {
|
|
353
353
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function i(p) {
|
|
356
356
|
if (!p || !p.value)
|
|
357
357
|
return null;
|
|
358
358
|
if (p.value.schema && p.value.schema.type === "component")
|
|
359
359
|
return p.value;
|
|
360
|
-
const
|
|
361
|
-
return
|
|
360
|
+
const h = v(p == null ? void 0 : p.value.parent), d = i(h);
|
|
361
|
+
return d || null;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
const { componentInstance:
|
|
365
|
-
return !
|
|
363
|
+
function c(p = e) {
|
|
364
|
+
const { componentInstance: h, designerItemElementRef: d } = p;
|
|
365
|
+
return !h || !h.value ? null : h.value.canMove ? d : c(p.parent);
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function y(p) {
|
|
368
368
|
return !!o;
|
|
369
369
|
}
|
|
370
370
|
function m() {
|
|
371
371
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function P() {
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function A(p, h) {
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function R(p, h) {
|
|
378
378
|
const { componentType: d } = p;
|
|
379
|
-
let
|
|
380
|
-
const
|
|
381
|
-
return
|
|
379
|
+
let b = E(d, p, h);
|
|
380
|
+
const $ = d.toLowerCase().replace("-", "_");
|
|
381
|
+
return b && !b.id && b.type === d && (b.id = `${$}_${Math.random().toString().slice(2, 6)}`), b;
|
|
382
382
|
}
|
|
383
|
-
function F(p,
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
let
|
|
387
|
-
const U =
|
|
388
|
-
return
|
|
383
|
+
function F(p, h) {
|
|
384
|
+
const d = String(p.getAttribute("data-controltype")), b = p.getAttribute("data-feature"), $ = b ? JSON.parse(b) : {};
|
|
385
|
+
$.parentComponentInstance = u.value;
|
|
386
|
+
let L = E(d, $);
|
|
387
|
+
const U = d.toLowerCase().replace("-", "_");
|
|
388
|
+
return L && !L.id && L.type === d && (L.id = `${U}_${Math.random().toString().slice(2, 6)}`), L;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function T(p) {
|
|
391
391
|
}
|
|
392
392
|
function Q(...p) {
|
|
393
393
|
}
|
|
394
|
-
return
|
|
395
|
-
canMove:
|
|
394
|
+
return u.value = {
|
|
395
|
+
canMove: f(),
|
|
396
396
|
canSelectParent: g(),
|
|
397
397
|
canDelete: s(),
|
|
398
398
|
canNested: !a(),
|
|
399
399
|
contents: e == null ? void 0 : e.schema.contents,
|
|
400
400
|
elementRef: t,
|
|
401
|
-
parent: (
|
|
401
|
+
parent: (k = e == null ? void 0 : e.parent) == null ? void 0 : k.componentInstance,
|
|
402
402
|
schema: e == null ? void 0 : e.schema,
|
|
403
403
|
styles: r,
|
|
404
|
-
designerClass:
|
|
405
|
-
canAccepts:
|
|
406
|
-
getBelongedComponentInstance:
|
|
407
|
-
getDraggableDesignItemElement:
|
|
404
|
+
designerClass: l,
|
|
405
|
+
canAccepts: y,
|
|
406
|
+
getBelongedComponentInstance: i,
|
|
407
|
+
getDraggableDesignItemElement: c,
|
|
408
408
|
getDraggingDisplayText: m,
|
|
409
409
|
getPropConfig: Q,
|
|
410
|
-
getDragScopeElement:
|
|
411
|
-
onAcceptMovedChildElement:
|
|
410
|
+
getDragScopeElement: P,
|
|
411
|
+
onAcceptMovedChildElement: A,
|
|
412
412
|
onAcceptNewChildElement: F,
|
|
413
|
-
onChildElementMovedOut:
|
|
414
|
-
addNewChildComponentSchema:
|
|
413
|
+
onChildElementMovedOut: T,
|
|
414
|
+
addNewChildComponentSchema: R,
|
|
415
415
|
updateDragAndDropRules: n,
|
|
416
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
417
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
418
|
-
},
|
|
416
|
+
triggerBelongedComponentToMoveWhenMoved: v(!1),
|
|
417
|
+
triggerBelongedComponentToDeleteWhenDeleted: v(!1)
|
|
418
|
+
}, u;
|
|
419
419
|
}
|
|
420
|
-
const Se = /* @__PURE__ */
|
|
420
|
+
const Se = /* @__PURE__ */ D({
|
|
421
421
|
name: "FResponseLayoutDesign",
|
|
422
|
-
props:
|
|
422
|
+
props: N,
|
|
423
423
|
emits: [],
|
|
424
424
|
setup(t, e) {
|
|
425
|
-
const o =
|
|
425
|
+
const o = v(), n = q("design-item-context"), r = H(o, n);
|
|
426
426
|
return r.value.canNested = !1, _(() => {
|
|
427
427
|
o.value.componentInstance = r;
|
|
428
|
-
}), e.expose(r.value), () =>
|
|
428
|
+
}), e.expose(r.value), () => j("div", {
|
|
429
429
|
ref: o,
|
|
430
430
|
class: "d-flex response-layout"
|
|
431
431
|
}, [e.slots.default && e.slots.default()]);
|
|
432
432
|
}
|
|
433
|
-
}), De = /* @__PURE__ */
|
|
433
|
+
}), De = /* @__PURE__ */ D({
|
|
434
434
|
name: "FResponseLayoutItemDesign",
|
|
435
|
-
props:
|
|
435
|
+
props: w,
|
|
436
436
|
emits: [],
|
|
437
437
|
setup(t, e) {
|
|
438
|
-
const o =
|
|
438
|
+
const o = v(), n = q("design-item-context"), r = H(o, n);
|
|
439
439
|
return r.value.canNested = !1, r.value.canMove = !1, r.value.canDelete = !1, _(() => {
|
|
440
440
|
o.value.componentInstance = r;
|
|
441
|
-
}), e.expose(r.value), () =>
|
|
441
|
+
}), e.expose(r.value), () => j(S, {
|
|
442
442
|
ref: o
|
|
443
443
|
}, {
|
|
444
444
|
default: () => [e.slots.default && e.slots.default()]
|
|
@@ -446,19 +446,19 @@ const Se = /* @__PURE__ */ S({
|
|
|
446
446
|
}
|
|
447
447
|
}), Te = {
|
|
448
448
|
install(t) {
|
|
449
|
-
t.component(
|
|
449
|
+
t.component(M.name, M).component(S.name, S);
|
|
450
450
|
},
|
|
451
451
|
register(t, e, o, n) {
|
|
452
|
-
t["response-layout"] =
|
|
452
|
+
t["response-layout"] = M, t["response-layout-item"] = S, e["response-layout"] = B, e["response-layout-item"] = V;
|
|
453
453
|
},
|
|
454
454
|
registerDesigner(t, e, o) {
|
|
455
455
|
t["response-layout"] = Se, t["response-layout-item"] = De, e["response-layout"] = B, e["response-layout-item"] = V;
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
458
|
export {
|
|
459
|
-
|
|
460
|
-
|
|
459
|
+
M as FResponseLayout,
|
|
460
|
+
S as FResponseLayoutItem,
|
|
461
461
|
Te as default,
|
|
462
|
-
|
|
462
|
+
N as responseLayoutProps,
|
|
463
463
|
B as responseLayoutPropsResolver
|
|
464
464
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(m,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],p):(m=typeof globalThis<"u"?globalThis:m||self,p(m["response-layout"]={},m.Vue,m.LodashES))})(this,function(m,p,J){"use strict";const w={},A={};function M(t){const{properties:e,title:o,ignore:r}=t,n=r&&Array.isArray(r),f=Object.keys(e).reduce((l,y)=>((!n||!r.find($=>$==y))&&(l[y]=e[y].type==="object"&&e[y].properties?M(e[y]):J.cloneDeep(e[y].default)),l),{});return(!n||!r.find(l=>l=="id"))&&(f.id=`${o}-${Date.now()}`),f}function v(t,e={},o){const r=w[t];if(r){let n=M(r);const f=A[t];return n=f?f({getSchemaByType:v},n,e,o):n,n}return null}function G(t,e){const o=M(e);return Object.keys(t).reduce((r,n)=>(r[n]&&typeof r[n]=="object"?Object.assign(r[n],t[n]):r[n]=t[n],r),o),o}function H(t,e){return Object.keys(t).filter(r=>t[r]!=null).reduce((r,n)=>{if(e.has(n)){const f=e.get(n);if(typeof f=="string")r[f]=t[n];else{const l=f(n,t[n],t);Object.assign(r,l)}}else r[n]=t[n];return r},{})}function Q(t,e,o=new Map){const r=G(t,e);return H(r,o)}function U(t={}){function e(s,a,i,c){if(typeof i=="number")return c[s].length===i;if(typeof i=="object"){const d=Object.keys(i)[0],h=i[d];if(d==="not")return Number(c[s].length)!==Number(h);if(d==="moreThan")return Number(c[s].length)>=Number(h);if(d==="lessThan")return Number(c[s].length)<=Number(h)}return!1}function o(s,a,i,c){return c[s]&&c[s].propertyValue&&String(c[s].propertyValue.value)===String(i)}const r=new Map([["length",e],["getProperty",o]]);Object.keys(t).reduce((s,a)=>(s.set(a,t[a]),s),r);function n(s,a){const i=s;return typeof a=="number"?[{target:i,operator:"length",param:null,value:Number(a)}]:typeof a=="boolean"?[{target:i,operator:"getProperty",param:s,value:!!a}]:typeof a=="object"?Object.keys(a).map(c=>{if(c==="length")return{target:i,operator:"length",param:null,value:a[c]};const d=c,h=a[c];return{target:i,operator:"getProperty",param:d,value:h}}):[]}function f(s){return Object.keys(s).reduce((i,c)=>{const d=n(c,s[c]);return i.push(...d),i},[])}function l(s,a){if(r.has(s.operator)){const i=r.get(s.operator);return i&&i(s.target,s.param,s.value,a)||!1}return!1}function y(s,a){return f(s).reduce((d,h)=>d&&l(h,a),!0)}function $(s,a){const i=Object.keys(s),c=i.includes("allOf"),d=i.includes("anyOf"),h=c||d,D=(h?s[h?c?"allOf":"anyOf":"allOf"]:[s]).map(F=>y(F,a));return c?!D.includes(!1):D.includes(!0)}return{parseValueSchema:$}}const X={},Y={};U();function V(t,e,o=new Map,r=(l,y,$)=>y,n={},f=l=>l){return w[e.title]=e,A[e.title]=r,X[e.title]=n,Y[e.title]=f,(l={})=>{const y=Q(l,e,o),$=Object.keys(t).reduce((s,a)=>(s[a]=t[a].default,s),{});return Object.assign($,y)}}function Z(t,e){return{customClass:e.class,customStyle:e.style}}const q=new Map([["appearance",Z]]);function C(t,e,o){return o.splitter&&(e.contents=String(o.splitter).split(":").map(r=>{const n=t.getSchemaByType("response-layout-item");return n.appearance={class:`h-100 col-${r} px-0`},n})),e}const K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-layout.schema.json",title:"response-layout",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Respnse Layout",type:"string"},type:{description:"The type string of Respnse Layout component",type:"string",default:"response-layout"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},I={title:"responseLayout",description:"A Farris Container Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"ResponseLayout",enum:[]}}}},appearance:{description:"",title:"外观",properties:{appearance:{description:"",type:"cascade",title:"外联样式",properties:{class:{description:"组件的CSS样式",title:"class样式",type:"string"}}},appearanceStyle:{description:"样式",type:"cascade",title:"内联样式",properties:{inlineStyle:{description:"",title:"inlineStyle",type:"custom"}}}}},behavior:{description:"",title:"行为",properties:{visible:{description:"运行时组件是否可见",type:"boolean",title:"是否可见"}}},layout:{description:"",title:"布局",properties:{layout:{description:"配置布局容器内区块个数及比例",type:"custom",title:"是否可见",editor:{},editorParams:{layout:[]}}}}}},j={customClass:{type:String,default:""}},N=V(j,K,q,C,I),P=p.defineComponent({name:"FResponseLayout",props:j,emits:[],setup(t,e){return()=>p.createVNode("div",{class:t.customClass},[e.slots.default&&e.slots.default()])}}),x={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-layout-item.schema.json",title:"response-layout-item",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Respnse Layout Item",type:"string"},type:{description:"The type string of Respnse Layout Item component",type:"string",default:"response-layout-item"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},E={customClass:{type:String,default:""}},k=V(E,x,q),R=p.defineComponent({name:"FResponseLayoutItem",props:E,emits:[],setup(t,e){return()=>p.createVNode("div",{class:t.customClass},[e.slots.default&&e.slots.default()])}});function B(t,e,o){var W;function r(){}const n="",f="",l=p.ref();function y(){return(e==null?void 0:e.schema.componentType)!=="frame"}function $(){return!1}function s(){return(e==null?void 0:e.schema.componentType)!=="frame"}function a(){return(e==null?void 0:e.schema.componentType)==="frame"}function i(u){if(!u||!u.value)return null;if(u.value.schema&&u.value.schema.type==="component")return u.value;const b=p.ref(u==null?void 0:u.value.parent),g=i(b);return g||null}function c(u=e){const{componentInstance:b,designerItemElementRef:g}=u;return!b||!b.value?null:b.value.canMove?g:c(u.parent)}function d(u){return!!o}function h(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function O(){}function _(u,b){}function D(u,b){const{componentType:g}=u;let L=v(g,u,b);const T=g.toLowerCase().replace("-","_");return L&&!L.id&&L.type===g&&(L.id=`${T}_${Math.random().toString().slice(2,6)}`),L}function z(u,b){const g=String(u.getAttribute("data-controltype")),L=u.getAttribute("data-feature"),T=L?JSON.parse(L):{};T.parentComponentInstance=l.value;let S=v(g,T);const se=g.toLowerCase().replace("-","_");return S&&!S.id&&S.type===g&&(S.id=`${se}_${Math.random().toString().slice(2,6)}`),S}function F(u){}function re(...u){}return l.value={canMove:y(),canSelectParent:$(),canDelete:s(),canNested:!a(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(W=e==null?void 0:e.parent)==null?void 0:W.componentInstance,schema:e==null?void 0:e.schema,styles:n,designerClass:f,canAccepts:d,getBelongedComponentInstance:i,getDraggableDesignItemElement:c,getDraggingDisplayText:h,getPropConfig:re,getDragScopeElement:O,onAcceptMovedChildElement:_,onAcceptNewChildElement:z,onChildElementMovedOut:F,addNewChildComponentSchema:D,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:p.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:p.ref(!1)},l}const ee=p.defineComponent({name:"FResponseLayoutDesign",props:j,emits:[],setup(t,e){const o=p.ref(),r=p.inject("design-item-context"),n=B(o,r);return n.value.canNested=!1,p.onMounted(()=>{o.value.componentInstance=n}),e.expose(n.value),()=>p.createVNode("div",{ref:o,class:"d-flex response-layout"},[e.slots.default&&e.slots.default()])}}),te=p.defineComponent({name:"FResponseLayoutItemDesign",props:E,emits:[],setup(t,e){const o=p.ref(),r=p.inject("design-item-context"),n=B(o,r);return n.value.canNested=!1,n.value.canMove=!1,n.value.canDelete=!1,p.onMounted(()=>{o.value.componentInstance=n}),e.expose(n.value),()=>p.createVNode(R,{ref:o},{default:()=>[e.slots.default&&e.slots.default()]})}}),ne={install(t){t.component(P.name,P).component(R.name,R)},register(t,e,o,r){t["response-layout"]=P,t["response-layout-item"]=R,e["response-layout"]=N,e["response-layout-item"]=k},registerDesigner(t,e,o){t["response-layout"]=ee,t["response-layout-item"]=te,e["response-layout"]=N,e["response-layout-item"]=k}};m.FResponseLayout=P,m.FResponseLayoutItem=R,m.default=ne,m.responseLayoutProps=j,m.responseLayoutPropsResolver=N,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|