@farris/ui-vue 1.3.5 → 1.3.6
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 +16 -16
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +65 -65
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +13 -13
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +504 -490
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +247 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +356 -344
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +159 -145
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +127 -128
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +15 -15
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +101 -87
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +7 -5
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +181 -167
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4057 -4304
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2450 -2467
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +789 -777
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3593 -3585
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +257 -243
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +322 -306
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +177 -163
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +163 -2643
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +500 -486
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +37 -37
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +485 -470
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +2611 -2623
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +3825 -3837
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +3720 -3712
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +402 -388
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +201 -202
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +264 -245
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +157 -143
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +312 -296
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +4748 -4992
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +4215 -4462
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +169 -155
- package/components/nav/index.umd.cjs +2 -2
- package/components/number-range/index.esm.js +150 -137
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +207 -194
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +427 -414
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +22 -22
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +510 -492
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +192 -178
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +234 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +288 -277
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +62 -61
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +3015 -3027
- package/components/query-solution/index.umd.cjs +5 -5
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +293 -280
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +222 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +187 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +554 -542
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +483 -469
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +632 -617
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +228 -214
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +419 -406
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +162 -148
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +308 -284
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +279 -265
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +183 -170
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +307 -294
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +320 -306
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +245 -231
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +260 -247
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +409 -396
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +424 -410
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +2994 -3006
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +749 -733
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +325 -311
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +304 -290
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +99 -85
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +947 -933
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +7750 -7990
- package/farris.all.umd.cjs +12 -12
- package/package.json +1 -1
- package/types/data-view/composition/types.d.ts +0 -1
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
- package/components/event-parameter/index.css +0 -1
- package/types/data-grid/src/components/data/data-grid-area.component.d.ts +0 -8
- package/types/data-grid/src/components/data/data-grid-area.props.d.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(D,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js"],e):(D=typeof globalThis<"u"?globalThis:D||self,e(D.rate={},D.Vue,D.LodashES,D.common))})(this,function(D,e,q,Z){"use strict";const J={},Q={};function W(a){const{properties:t,title:r,ignore:n}=a,o=n&&Array.isArray(n),v=Object.keys(t).reduce((y,b)=>((!o||!n.find(R=>R===b))&&(y[b]=t[b].type==="object"&&t[b].properties?W(t[b]):q.cloneDeep(t[b].default)),y),{});if(r&&(!o||!n.find(y=>y==="id"))){const y=r.toLowerCase().replace(/-/g,"_");v.id=`${y}_${Math.random().toString().slice(2,6)}`}return v}function U(a,t={},r){const n=J[a];if(n){let o=W(n);const v=Q[a];return o=v?v({getSchemaByType:U},o,t,r):o,o}return null}function K(a,t){const r=W(t);return Object.keys(r).reduce((n,o)=>(n[o]&&q.isPlainObject(n[o])&&q.isPlainObject(a[o]||!a[o])?Object.assign(n[o],a[o]||{}):n[o]=a[o],n),r),r}function x(a,t){return Object.keys(a).filter(n=>a[n]!=null).reduce((n,o)=>{if(t.has(o)){const v=t.get(o);if(typeof v=="string")n[v]=a[o];else{const y=v(o,a[o],a);Object.assign(n,y)}}else n[o]=a[o];return n},{})}function I(a,t,r=new Map){const n=K(a,t);return x(n,r)}function ee(a={}){function t(l,s,f,d){if(typeof f=="number")return d[l].length===f;if(typeof f=="object"){const S=Object.keys(f)[0],M=f[S];if(S==="not")return Number(d[l].length)!==Number(M);if(S==="moreThan")return Number(d[l].length)>=Number(M);if(S==="lessThan")return Number(d[l].length)<=Number(M)}return!1}function r(l,s,f,d){return d[l]&&d[l].propertyValue&&String(d[l].propertyValue.value)===String(f)}const n=new Map([["length",t],["getProperty",r]]);Object.keys(a).reduce((l,s)=>(l.set(s,a[s]),l),n);function o(l,s){const f=l;return typeof s=="number"?[{target:f,operator:"length",param:null,value:Number(s)}]:typeof s=="boolean"?[{target:f,operator:"getProperty",param:l,value:!!s}]:typeof s=="object"?Object.keys(s).map(d=>{if(d==="length")return{target:f,operator:"length",param:null,value:s[d]};const S=d,M=s[d];return{target:f,operator:"getProperty",param:S,value:M}}):[]}function v(l){return Object.keys(l).reduce((f,d)=>{const S=o(d,l[d]);return f.push(...S),f},[])}function y(l,s){if(n.has(l.operator)){const f=n.get(l.operator);return f&&f(l.target,l.param,l.value,s)||!1}return!1}function b(l,s){return v(l).reduce((S,M)=>S&&y(M,s),!0)}function R(l,s){const f=Object.keys(l),d=f.includes("allOf"),S=f.includes("anyOf"),M=d||S,V=(M?l[M?d?"allOf":"anyOf":"allOf"]:[l]).map(p=>b(p,s));return d?!V.includes(!1):V.includes(!0)}return{parseValueSchema:R}}const te={},ae={};ee();function re(a,t,r=new Map,n=(y,b,R,l)=>b,o={},v=y=>y){return J[t.title]=t,Q[t.title]=n,te[t.title]=o,ae[t.title]=v,(y={})=>{const b=I(y,t,r),R=Object.keys(a).reduce((l,s)=>(l[s]=a[s].default,l),{});return Object.assign(R,b)}}function le(a,t){return{customClass:t.class,customStyle:t.style}}const ne=new Map([["appearance",le]]);function oe(a,t,r){return t}const se={$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"]},ie={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:[]}}}}}},A={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}},H=re(A,se,ne,oe,ie),E=e.defineComponent({name:"FRate",props:A,emits:["selectedValue","update:modelValue"],setup(a,t){const r=e.ref(a.size),n=e.ref(a.enableHalf),o=e.ref(a.enableClear),v=e.ref(a.disabled),y=e.ref(a.pointSystem),b=e.ref(a.lightColor),R=e.ref(a.darkColor),l=e.ref(a.iconClass),s=e.ref(a.numOfStar),f=e.ref(a.toolTipDisabled),d=e.ref(a.toolTipContents),S=e.ref(a.enableScore),M=e.ref(a.enableSatisfaction);let m;const N=e.ref(0),V=e.ref(0),T=e.ref(0),p=e.ref(a.modelValue);let O=1,i,h,g;const k=4;e.onMounted(()=>{});function P(){const u=s.value;g=[];for(let j=1;j<=u;j++)g.push({id:j})}function B(){let u;n.value?u=Math.ceil(p.value/O):u=p.value,V.value=(m*p.value+Math.floor(p.value)*k)/O,i=d.value[u-1]}function F(){switch(r.value){case"small":m=14;break;case"middle":m=16;break;case"large":m=18;break;case"extraLarge":m=24;break}P(),s.value&&(O=y.value/s.value),p.value&&B()}F();function _(u){return u.className.indexOf("f-icon")!==-1}function z(){return N.value===V.value&&o.value&&V.value!==0?(V.value=0,p.value=0,h=null,N.value=0,T.value=0,t.emit("selectedValue",p.value),t.emit("update:modelValue",p.value),!0):!1}function C(u,j,c){if(u.movementX||u.movementY){if(v.value)return;M.value&&(i=d.value[j-1]),u.offsetX<m/2&&n.value===!0?(N.value=m*j-m/2+k*(j-1),T.value=O*j-O/2):(N.value=m*j+k*(j-1),T.value=O*j)}if(c===!0){if(z())return;p.value=T.value,V.value=N.value,h=i,t.emit("update:modelValue",p.value),t.emit("selectedValue",p.value)}}function L(u,j){var c;if(_(u.target)&&u.target){const w=parseInt((c=u.target)==null?void 0:c.id);C(u,w,j)}}const X=e.computed(()=>T.value?T.value+"分":p.value+"分"),Y=e.computed(()=>({width:(N.value||V.value)+"px"}));function $(){N.value=0}return e.watch(()=>a.modelValue,u=>{p.value=u,B()}),()=>e.createVNode("div",{class:"farris-star-rating",onMouseover:e.withModifiers(u=>L(u,!1),["prevent"]),onMousemove:e.withModifiers(u=>L(u,!1),["prevent"]),onMouseleave:e.withModifiers(u=>$(),["prevent"]),onClick:e.withModifiers(u=>L(u,!0),["prevent"])},[e.createVNode("div",{class:"star-light-area",style:Y.value},[g.map(u=>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:f.value}],id:u.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"}]},[g.map(u=>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:u.id,style:{color:R.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&&(h||i)&&e.createVNode("span",null,[e.createTextVNode(" "),i||h])])])}});function ce(a,t,r){var O;const n="",o="",v=e.ref();function y(){return(t==null?void 0:t.schema.componentType)!=="frame"}function b(){return!1}function R(){return(t==null?void 0:t.schema.componentType)!=="frame"}function l(){return(t==null?void 0:t.schema.componentType)==="frame"}function s(i){if(!i||!i.value)return null;if(i.value.schema&&i.value.schema.type==="component")return i.value;const h=e.ref(i==null?void 0:i.value.parent),g=s(h);return g||null}function f(i=t){const{componentInstance:h,designerItemElementRef:g}=i;return!h||!h.value?null:h.value.canMove?g:f(i.parent)}function d(i){return!!r}function S(){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 m(i,h){}function N(i,h){const{componentType:g}=i;let k=U(g,i,h);const P=g.toLowerCase().replace(/-/g,"_");return k&&!k.id&&k.type===g&&(k.id=`${P}_${Math.random().toString().slice(2,6)}`),k}function V(i){}function T(...i){}function p(){t!=null&&t.schema.contents&&t.schema.contents.map(i=>{var k;let h=i.id;i.type==="component-ref"&&(h=i.component);const g=a.value.querySelector(`#${h}-design-item`);(k=g==null?void 0:g.componentInstance)!=null&&k.value.onRemoveComponent&&g.componentInstance.value.onRemoveComponent()})}return v.value={canMove:y(),canSelectParent:b(),canDelete:R(),canNested:!l(),contents:t==null?void 0:t.schema.contents,elementRef:a,parent:(O=t==null?void 0:t.parent)==null?void 0:O.componentInstance,schema:t==null?void 0:t.schema,styles:n,designerClass:o,canAccepts:d,getBelongedComponentInstance:s,getDraggableDesignItemElement:f,getDraggingDisplayText:S,getPropConfig:T,getDragScopeElement:M,onAcceptMovedChildElement:m,onChildElementMovedOut:V,addNewChildComponentSchema:N,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1),onRemoveComponent:p},v}const ue=e.defineComponent({name:"FRateDesign",props:A,emits:["selectedValue"],setup(a,t){const r=e.ref(a.size),n=e.ref(a.enableHalf),o=e.ref(a.enableClear),v=e.ref(a.disabled),y=e.ref(a.pointSystem),b=e.ref(a.lightColor),R=e.ref(a.darkColor),l=e.ref(a.iconClass),s=e.ref(a.numOfStar),f=e.ref(a.toolTipDisabled),d=e.ref(a.toolTipContents),S=e.ref(a.enableScore),M=e.ref(a.enableSatisfaction);let m;const N=e.ref(1);let V=0;const T=e.ref(0),p=e.ref(0);let O=1,i,h,g;const k=4,P=e.ref(),B=e.inject("design-item-context"),F=ce(P,B);e.onMounted(()=>{P.value.componentInstance=F}),t.expose(F.value),e.onMounted(()=>{});function _(){const c=s.value;g=[];for(let w=1;w<=c;w++)g.push({id:w})}function z(){let c;n.value?c=Math.ceil(p.value/O):c=p.value,V=(m*p.value+Math.floor(p.value)*k)/O,i=d.value[c-1]}function C(){switch(r.value){case"small":m=14;break;case"middle":m=16;break;case"large":m=18;break;case"extraLarge":m=24;break}_(),s.value&&(O=y.value/s.value),p.value&&z()}C();function L(c){return c.className.indexOf("f-icon")!==-1}function X(){return N.value===V&&o&&V!==0?(V=0,p.value=0,h=null,N.value=0,T.value=0,t.emit("selectedValue",p.value),!0):!1}function Y(c,w,G){if(c.movementX||c.movementY){if(v.value)return;M.value&&(i=d.value[w-1]),c.offsetX<m/2&&n.value===!0?(N.value=m*w-m/2+k*(w-1),T.value=O*w-O/2):(N.value=m*w+k*(w-1),T.value=O*w)}if(G===!0){if(X())return;p.value=T.value,V=N.value,h=i,t.emit("selectedValue",p.value)}}function $(c,w){if(L(c.target)&&c.target){const G=parseInt(c.target.id);Y(c,G,w)}}const u=e.computed(()=>T.value?T.value+"分":p.value+"分"),j=e.computed(()=>({width:(N.value||V)+"px"}));return()=>e.createVNode("div",{class:"farris-star-rating",ref:P,onMouseover:e.withModifiers(c=>$(c,!1),["prevent"]),onMousemove:e.withModifiers(c=>$(c,!1),["prevent"]),onMouseout:e.withModifiers(c=>$(c,!1),["prevent"]),onClick:e.withModifiers(c=>$(c,!0),["prevent"])},[e.createVNode("div",{class:"star-light-area",style:j.value},[g.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:f.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"}]},[g.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:R.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(" "),u.value,e.createTextVNode(" ")]),M.value&&(h||i)&&e.createVNode("span",null,[e.createTextVNode(" "),i||h])])])}});E.register=(a,t,r,n)=>{a.rate=E,t.rate=H},E.registerDesigner=(a,t,r)=>{a.rate=ue,t.rate=H};const fe=Z.withInstall(E);D.FRate=E,D.default=fe,D.propsResolver=H,D.rateProps=A,Object.defineProperties(D,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(D,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js"],e):(D=typeof globalThis<"u"?globalThis:D||self,e(D.rate={},D.Vue,D.LodashES,D.common))})(this,function(D,e,B,Z){"use strict";const J={},Q={};function W(a){const{properties:t,title:r,ignore:l}=a,o=l&&Array.isArray(l),m=Object.keys(t).reduce((g,b)=>((!o||!l.find(P=>P===b))&&(g[b]=t[b].type==="object"&&t[b].properties?W(t[b]):B.cloneDeep(t[b].default)),g),{});if(r&&(!o||!l.find(g=>g==="id"))){const g=r.toLowerCase().replace(/-/g,"_");m.id=`${g}_${Math.random().toString().slice(2,6)}`}return m}function x(a){const{properties:t,title:r,required:l}=a;if(l&&Array.isArray(l)){const o=l.reduce((m,g)=>(m[g]=t[g].type==="object"&&t[g].properties?W(t[g]):B.cloneDeep(t[g].default),m),{});if(r&&l.find(m=>m==="id")){const m=r.toLowerCase().replace(/-/g,"_");o.id=`${m}_${Math.random().toString().slice(2,6)}`}return o}return{type:r}}function U(a,t={},r){const l=J[a];if(l){let o=x(l);const m=Q[a];return o=m?m({getSchemaByType:U},o,t,r):o,o}return null}function K(a,t){const r=W(t);return Object.keys(r).reduce((l,o)=>(Object.prototype.hasOwnProperty.call(a,o)&&(l[o]&&B.isPlainObject(l[o])&&B.isPlainObject(a[o]||!a[o])?Object.assign(l[o],a[o]||{}):l[o]=a[o]),l),r),r}function I(a,t){return Object.keys(a).filter(l=>a[l]!=null).reduce((l,o)=>{if(t.has(o)){const m=t.get(o);if(typeof m=="string")l[m]=a[o];else{const g=m(o,a[o],a);Object.assign(l,g)}}else l[o]=a[o];return l},{})}function ee(a,t,r=new Map){const l=K(a,t);return I(l,r)}function te(a={}){function t(n,s,f,d){if(typeof f=="number")return d[n].length===f;if(typeof f=="object"){const S=Object.keys(f)[0],M=f[S];if(S==="not")return Number(d[n].length)!==Number(M);if(S==="moreThan")return Number(d[n].length)>=Number(M);if(S==="lessThan")return Number(d[n].length)<=Number(M)}return!1}function r(n,s,f,d){return d[n]&&d[n].propertyValue&&String(d[n].propertyValue.value)===String(f)}const l=new Map([["length",t],["getProperty",r]]);Object.keys(a).reduce((n,s)=>(n.set(s,a[s]),n),l);function o(n,s){const f=n;return typeof s=="number"?[{target:f,operator:"length",param:null,value:Number(s)}]:typeof s=="boolean"?[{target:f,operator:"getProperty",param:n,value:!!s}]:typeof s=="object"?Object.keys(s).map(d=>{if(d==="length")return{target:f,operator:"length",param:null,value:s[d]};const S=d,M=s[d];return{target:f,operator:"getProperty",param:S,value:M}}):[]}function m(n){return Object.keys(n).reduce((f,d)=>{const S=o(d,n[d]);return f.push(...S),f},[])}function g(n,s){if(l.has(n.operator)){const f=l.get(n.operator);return f&&f(n.target,n.param,n.value,s)||!1}return!1}function b(n,s){return m(n).reduce((S,M)=>S&&g(M,s),!0)}function P(n,s){const f=Object.keys(n),d=f.includes("allOf"),S=f.includes("anyOf"),M=d||S,V=(M?n[M?d?"allOf":"anyOf":"allOf"]:[n]).map(p=>b(p,s));return d?!V.includes(!1):V.includes(!0)}return{parseValueSchema:P}}const ae={},re={};te();function le(a,t,r=new Map,l=(g,b,P,n)=>b,o={},m=g=>g){return J[t.title]=t,Q[t.title]=l,ae[t.title]=o,re[t.title]=m,(g={})=>{const b=ee(g,t,r),P=Object.keys(a).reduce((n,s)=>(n[s]=a[s].default,n),{});return Object.assign(P,b)}}function ne(a,t){return{customClass:t.class,customStyle:t.style}}const oe=new Map([["appearance",ne]]);function se(a,t,r){return t}const ie={$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"]},ce={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:[]}}}}}},E={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}},_=le(E,ie,oe,se,ce),A=e.defineComponent({name:"FRate",props:E,emits:["selectedValue","update:modelValue"],setup(a,t){const r=e.ref(a.size),l=e.ref(a.enableHalf),o=e.ref(a.enableClear),m=e.ref(a.disabled),g=e.ref(a.pointSystem),b=e.ref(a.lightColor),P=e.ref(a.darkColor),n=e.ref(a.iconClass),s=e.ref(a.numOfStar),f=e.ref(a.toolTipDisabled),d=e.ref(a.toolTipContents),S=e.ref(a.enableScore),M=e.ref(a.enableSatisfaction);let h;const N=e.ref(0),V=e.ref(0),T=e.ref(0),p=e.ref(a.modelValue);let O=1,i,v,y;const k=4;e.onMounted(()=>{});function R(){const u=s.value;y=[];for(let j=1;j<=u;j++)y.push({id:j})}function q(){let u;l.value?u=Math.ceil(p.value/O):u=p.value,V.value=(h*p.value+Math.floor(p.value)*k)/O,i=d.value[u-1]}function F(){switch(r.value){case"small":h=14;break;case"middle":h=16;break;case"large":h=18;break;case"extraLarge":h=24;break}R(),s.value&&(O=g.value/s.value),p.value&&q()}F();function C(u){return u.className.indexOf("f-icon")!==-1}function H(){return N.value===V.value&&o.value&&V.value!==0?(V.value=0,p.value=0,v=null,N.value=0,T.value=0,t.emit("selectedValue",p.value),t.emit("update:modelValue",p.value),!0):!1}function z(u,j,c){if(u.movementX||u.movementY){if(m.value)return;M.value&&(i=d.value[j-1]),u.offsetX<h/2&&l.value===!0?(N.value=h*j-h/2+k*(j-1),T.value=O*j-O/2):(N.value=h*j+k*(j-1),T.value=O*j)}if(c===!0){if(H())return;p.value=T.value,V.value=N.value,v=i,t.emit("update:modelValue",p.value),t.emit("selectedValue",p.value)}}function L(u,j){var c;if(C(u.target)&&u.target){const w=parseInt((c=u.target)==null?void 0:c.id);z(u,w,j)}}const X=e.computed(()=>T.value?T.value+"分":p.value+"分"),Y=e.computed(()=>({width:(N.value||V.value)+"px"}));function $(){N.value=0}return e.watch(()=>a.modelValue,u=>{p.value=u,q()}),()=>e.createVNode("div",{class:"farris-star-rating",onMouseover:e.withModifiers(u=>L(u,!1),["prevent"]),onMousemove:e.withModifiers(u=>L(u,!1),["prevent"]),onMouseleave:e.withModifiers(u=>$(),["prevent"]),onClick:e.withModifiers(u=>L(u,!0),["prevent"])},[e.createVNode("div",{class:"star-light-area",style:Y.value},[y.map(u=>e.createVNode("span",{class:["f-icon default-light-color ",n.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:f.value}],id:u.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"}]},[y.map(u=>e.createVNode("span",{class:["f-icon default-dark-color",n.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:u.id,style:{color:P.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&&(v||i)&&e.createVNode("span",null,[e.createTextVNode(" "),i||v])])])}});function ue(a,t,r){var O;const l="",o="",m=e.ref();function g(){return(t==null?void 0:t.schema.componentType)!=="frame"}function b(){return!1}function P(){return(t==null?void 0:t.schema.componentType)!=="frame"}function n(){return(t==null?void 0:t.schema.componentType)==="frame"}function s(i){if(!i||!i.value)return null;if(i.value.schema&&i.value.schema.type==="component")return i.value;const v=e.ref(i==null?void 0:i.value.parent),y=s(v);return y||null}function f(i=t){const{componentInstance:v,designerItemElementRef:y}=i;return!v||!v.value?null:v.value.canMove?y:f(i.parent)}function d(i){return!!r}function S(){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 h(i,v){}function N(i,v){const{componentType:y}=i;let k=U(y,i,v);const R=y.toLowerCase().replace(/-/g,"_");return k&&!k.id&&k.type===y&&(k.id=`${R}_${Math.random().toString().slice(2,6)}`),k}function V(i){}function T(...i){}function p(){t!=null&&t.schema.contents&&t.schema.contents.map(i=>{var k;let v=i.id;i.type==="component-ref"&&(v=i.component);const y=a.value.querySelector(`#${v}-design-item`);(k=y==null?void 0:y.componentInstance)!=null&&k.value.onRemoveComponent&&y.componentInstance.value.onRemoveComponent()})}return m.value={canMove:g(),canSelectParent:b(),canDelete:P(),canNested:!n(),contents:t==null?void 0:t.schema.contents,elementRef:a,parent:(O=t==null?void 0:t.parent)==null?void 0:O.componentInstance,schema:t==null?void 0:t.schema,styles:l,designerClass:o,canAccepts:d,getBelongedComponentInstance:s,getDraggableDesignItemElement:f,getDraggingDisplayText:S,getPropConfig:T,getDragScopeElement:M,onAcceptMovedChildElement:h,onChildElementMovedOut:V,addNewChildComponentSchema:N,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1),onRemoveComponent:p},m}const fe=e.defineComponent({name:"FRateDesign",props:E,emits:["selectedValue"],setup(a,t){const r=e.ref(a.size),l=e.ref(a.enableHalf),o=e.ref(a.enableClear),m=e.ref(a.disabled),g=e.ref(a.pointSystem),b=e.ref(a.lightColor),P=e.ref(a.darkColor),n=e.ref(a.iconClass),s=e.ref(a.numOfStar),f=e.ref(a.toolTipDisabled),d=e.ref(a.toolTipContents),S=e.ref(a.enableScore),M=e.ref(a.enableSatisfaction);let h;const N=e.ref(1);let V=0;const T=e.ref(0),p=e.ref(0);let O=1,i,v,y;const k=4,R=e.ref(),q=e.inject("design-item-context"),F=ue(R,q);e.onMounted(()=>{R.value.componentInstance=F}),t.expose(F.value),e.onMounted(()=>{});function C(){const c=s.value;y=[];for(let w=1;w<=c;w++)y.push({id:w})}function H(){let c;l.value?c=Math.ceil(p.value/O):c=p.value,V=(h*p.value+Math.floor(p.value)*k)/O,i=d.value[c-1]}function z(){switch(r.value){case"small":h=14;break;case"middle":h=16;break;case"large":h=18;break;case"extraLarge":h=24;break}C(),s.value&&(O=g.value/s.value),p.value&&H()}z();function L(c){return c.className.indexOf("f-icon")!==-1}function X(){return N.value===V&&o&&V!==0?(V=0,p.value=0,v=null,N.value=0,T.value=0,t.emit("selectedValue",p.value),!0):!1}function Y(c,w,G){if(c.movementX||c.movementY){if(m.value)return;M.value&&(i=d.value[w-1]),c.offsetX<h/2&&l.value===!0?(N.value=h*w-h/2+k*(w-1),T.value=O*w-O/2):(N.value=h*w+k*(w-1),T.value=O*w)}if(G===!0){if(X())return;p.value=T.value,V=N.value,v=i,t.emit("selectedValue",p.value)}}function $(c,w){if(L(c.target)&&c.target){const G=parseInt(c.target.id);Y(c,G,w)}}const u=e.computed(()=>T.value?T.value+"分":p.value+"分"),j=e.computed(()=>({width:(N.value||V)+"px"}));return()=>e.createVNode("div",{class:"farris-star-rating",ref:R,onMouseover:e.withModifiers(c=>$(c,!1),["prevent"]),onMousemove:e.withModifiers(c=>$(c,!1),["prevent"]),onMouseout:e.withModifiers(c=>$(c,!1),["prevent"]),onClick:e.withModifiers(c=>$(c,!0),["prevent"])},[e.createVNode("div",{class:"star-light-area",style:j.value},[y.map(c=>e.createVNode("span",{class:["f-icon default-light-color ",n.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:f.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"}]},[y.map(c=>e.createVNode("span",{class:["f-icon default-dark-color",n.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:P.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(" "),u.value,e.createTextVNode(" ")]),M.value&&(v||i)&&e.createVNode("span",null,[e.createTextVNode(" "),i||v])])])}});A.register=(a,t,r,l)=>{a.rate=A,t.rate=_},A.registerDesigner=(a,t,r)=>{a.rate=fe,t.rate=_};const de=Z.withInstall(A);D.FRate=A,D.default=de,D.propsResolver=_,D.rateProps=E,Object.defineProperties(D,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,123 +1,137 @@
|
|
|
1
|
-
import { defineComponent as $, createVNode as S, ref as v, inject as B, onMounted as
|
|
2
|
-
import { isPlainObject as
|
|
3
|
-
const
|
|
4
|
-
function M(
|
|
5
|
-
const { properties: e, title: o, ignore:
|
|
6
|
-
if (o && (!
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
return
|
|
1
|
+
import { defineComponent as $, createVNode as S, ref as v, inject as B, onMounted as k } from "vue";
|
|
2
|
+
import { isPlainObject as F, cloneDeep as V } from "lodash-es";
|
|
3
|
+
const _ = {}, z = {};
|
|
4
|
+
function M(r) {
|
|
5
|
+
const { properties: e, title: o, ignore: s } = r, t = s && Array.isArray(s), c = Object.keys(e).reduce((p, f) => ((!t || !s.find((g) => g === f)) && (p[f] = e[f].type === "object" && e[f].properties ? M(e[f]) : V(e[f].default)), p), {});
|
|
6
|
+
if (o && (!t || !s.find((p) => p === "id"))) {
|
|
7
|
+
const p = o.toLowerCase().replace(/-/g, "_");
|
|
8
|
+
c.id = `${p}_${Math.random().toString().slice(2, 6)}`;
|
|
9
|
+
}
|
|
10
|
+
return c;
|
|
11
|
+
}
|
|
12
|
+
function U(r) {
|
|
13
|
+
const { properties: e, title: o, required: s } = r;
|
|
14
|
+
if (s && Array.isArray(s)) {
|
|
15
|
+
const t = s.reduce((c, p) => (c[p] = e[p].type === "object" && e[p].properties ? M(e[p]) : V(e[p].default), c), {});
|
|
16
|
+
if (o && s.find((c) => c === "id")) {
|
|
17
|
+
const c = o.toLowerCase().replace(/-/g, "_");
|
|
18
|
+
t.id = `${c}_${Math.random().toString().slice(2, 6)}`;
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
type: o
|
|
24
|
+
};
|
|
11
25
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
let
|
|
16
|
-
const
|
|
17
|
-
return
|
|
26
|
+
function W(r, e = {}, o) {
|
|
27
|
+
const s = _[r];
|
|
28
|
+
if (s) {
|
|
29
|
+
let t = U(s);
|
|
30
|
+
const c = z[r];
|
|
31
|
+
return t = c ? c({ getSchemaByType: W }, t, e, o) : t, t;
|
|
18
32
|
}
|
|
19
33
|
return null;
|
|
20
34
|
}
|
|
21
|
-
function
|
|
35
|
+
function X(r, e) {
|
|
22
36
|
const o = M(e);
|
|
23
|
-
return Object.keys(o).reduce((
|
|
37
|
+
return Object.keys(o).reduce((s, t) => (Object.prototype.hasOwnProperty.call(r, t) && (s[t] && F(s[t]) && F(r[t] || !r[t]) ? Object.assign(s[t], r[t] || {}) : s[t] = r[t]), s), o), o;
|
|
24
38
|
}
|
|
25
|
-
function
|
|
26
|
-
return Object.keys(
|
|
27
|
-
if (e.has(
|
|
28
|
-
const
|
|
29
|
-
if (typeof
|
|
30
|
-
|
|
39
|
+
function Y(r, e) {
|
|
40
|
+
return Object.keys(r).filter((s) => r[s] != null).reduce((s, t) => {
|
|
41
|
+
if (e.has(t)) {
|
|
42
|
+
const c = e.get(t);
|
|
43
|
+
if (typeof c == "string")
|
|
44
|
+
s[c] = r[t];
|
|
31
45
|
else {
|
|
32
|
-
const
|
|
33
|
-
Object.assign(
|
|
46
|
+
const p = c(t, r[t], r);
|
|
47
|
+
Object.assign(s, p);
|
|
34
48
|
}
|
|
35
49
|
} else
|
|
36
|
-
|
|
37
|
-
return
|
|
50
|
+
s[t] = r[t];
|
|
51
|
+
return s;
|
|
38
52
|
}, {});
|
|
39
53
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
return
|
|
54
|
+
function Z(r, e, o = /* @__PURE__ */ new Map()) {
|
|
55
|
+
const s = X(r, e);
|
|
56
|
+
return Y(s, o);
|
|
43
57
|
}
|
|
44
|
-
function
|
|
45
|
-
function e(
|
|
46
|
-
if (typeof
|
|
47
|
-
return
|
|
48
|
-
if (typeof
|
|
49
|
-
const y = Object.keys(
|
|
58
|
+
function C(r = {}) {
|
|
59
|
+
function e(n, a, i, u) {
|
|
60
|
+
if (typeof i == "number")
|
|
61
|
+
return u[n].length === i;
|
|
62
|
+
if (typeof i == "object") {
|
|
63
|
+
const y = Object.keys(i)[0], d = i[y];
|
|
50
64
|
if (y === "not")
|
|
51
|
-
return Number(
|
|
65
|
+
return Number(u[n].length) !== Number(d);
|
|
52
66
|
if (y === "moreThan")
|
|
53
|
-
return Number(
|
|
67
|
+
return Number(u[n].length) >= Number(d);
|
|
54
68
|
if (y === "lessThan")
|
|
55
|
-
return Number(
|
|
69
|
+
return Number(u[n].length) <= Number(d);
|
|
56
70
|
}
|
|
57
71
|
return !1;
|
|
58
72
|
}
|
|
59
|
-
function o(
|
|
60
|
-
return
|
|
73
|
+
function o(n, a, i, u) {
|
|
74
|
+
return u[n] && u[n].propertyValue && String(u[n].propertyValue.value) === String(i);
|
|
61
75
|
}
|
|
62
|
-
const
|
|
76
|
+
const s = /* @__PURE__ */ new Map([
|
|
63
77
|
["length", e],
|
|
64
78
|
["getProperty", o]
|
|
65
79
|
]);
|
|
66
|
-
Object.keys(
|
|
67
|
-
function
|
|
68
|
-
const
|
|
69
|
-
return typeof a == "number" ? [{ target:
|
|
70
|
-
if (
|
|
71
|
-
return { target:
|
|
72
|
-
const y =
|
|
73
|
-
return { target:
|
|
80
|
+
Object.keys(r).reduce((n, a) => (n.set(a, r[a]), n), s);
|
|
81
|
+
function t(n, a) {
|
|
82
|
+
const i = n;
|
|
83
|
+
return typeof a == "number" ? [{ target: i, operator: "length", param: null, value: Number(a) }] : typeof a == "boolean" ? [{ target: i, operator: "getProperty", param: n, value: !!a }] : typeof a == "object" ? Object.keys(a).map((u) => {
|
|
84
|
+
if (u === "length")
|
|
85
|
+
return { target: i, operator: "length", param: null, value: a[u] };
|
|
86
|
+
const y = u, d = a[u];
|
|
87
|
+
return { target: i, operator: "getProperty", param: y, value: d };
|
|
74
88
|
}) : [];
|
|
75
89
|
}
|
|
76
|
-
function
|
|
77
|
-
return Object.keys(
|
|
78
|
-
const y =
|
|
79
|
-
return
|
|
90
|
+
function c(n) {
|
|
91
|
+
return Object.keys(n).reduce((i, u) => {
|
|
92
|
+
const y = t(u, n[u]);
|
|
93
|
+
return i.push(...y), i;
|
|
80
94
|
}, []);
|
|
81
95
|
}
|
|
82
|
-
function
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
85
|
-
return
|
|
96
|
+
function p(n, a) {
|
|
97
|
+
if (s.has(n.operator)) {
|
|
98
|
+
const i = s.get(n.operator);
|
|
99
|
+
return i && i(n.target, n.param, n.value, a) || !1;
|
|
86
100
|
}
|
|
87
101
|
return !1;
|
|
88
102
|
}
|
|
89
|
-
function f(
|
|
90
|
-
return
|
|
103
|
+
function f(n, a) {
|
|
104
|
+
return c(n).reduce((y, d) => y && p(d, a), !0);
|
|
91
105
|
}
|
|
92
|
-
function g(
|
|
93
|
-
const
|
|
94
|
-
return
|
|
106
|
+
function g(n, a) {
|
|
107
|
+
const i = Object.keys(n), u = i.includes("allOf"), y = i.includes("anyOf"), d = u || y, L = (d ? n[d ? u ? "allOf" : "anyOf" : "allOf"] : [n]).map((j) => f(j, a));
|
|
108
|
+
return u ? !L.includes(!1) : L.includes(!0);
|
|
95
109
|
}
|
|
96
110
|
return { parseValueSchema: g };
|
|
97
111
|
}
|
|
98
|
-
const K = {},
|
|
99
|
-
|
|
100
|
-
function
|
|
101
|
-
return
|
|
102
|
-
const f =
|
|
112
|
+
const K = {}, I = {};
|
|
113
|
+
C();
|
|
114
|
+
function H(r, e, o = /* @__PURE__ */ new Map(), s = (p, f, g, n) => f, t = {}, c = (p) => p) {
|
|
115
|
+
return _[e.title] = e, z[e.title] = s, K[e.title] = t, I[e.title] = c, (p = {}) => {
|
|
116
|
+
const f = Z(p, e, o), g = Object.keys(r).reduce((n, a) => (n[a] = r[a].default, n), {});
|
|
103
117
|
return Object.assign(g, f);
|
|
104
118
|
};
|
|
105
119
|
}
|
|
106
|
-
function
|
|
120
|
+
function x(r, e) {
|
|
107
121
|
return { customClass: e.class, customStyle: e.style };
|
|
108
122
|
}
|
|
109
|
-
const
|
|
110
|
-
["appearance",
|
|
123
|
+
const G = /* @__PURE__ */ new Map([
|
|
124
|
+
["appearance", x]
|
|
111
125
|
]);
|
|
112
|
-
function
|
|
113
|
-
return o.splitter && (e.contents = String(o.splitter).split(":").map((
|
|
114
|
-
const
|
|
115
|
-
return
|
|
116
|
-
class: `h-100 col-${
|
|
117
|
-
},
|
|
126
|
+
function ee(r, e, o) {
|
|
127
|
+
return o.splitter && (e.contents = String(o.splitter).split(":").map((s) => {
|
|
128
|
+
const t = r.getSchemaByType("response-layout-item");
|
|
129
|
+
return t.appearance = {
|
|
130
|
+
class: `h-100 col-${s} px-0`
|
|
131
|
+
}, t;
|
|
118
132
|
})), e;
|
|
119
133
|
}
|
|
120
|
-
const
|
|
134
|
+
const te = "https://json-schema.org/draft/2020-12/schema", re = "https://farris-design.gitee.io/response-layout.schema.json", se = "response-layout", ne = "A Farris Container Component", oe = "object", ae = {
|
|
121
135
|
id: {
|
|
122
136
|
description: "The unique identifier for a Respnse Layout",
|
|
123
137
|
type: "string"
|
|
@@ -163,19 +177,19 @@ const ee = "https://json-schema.org/draft/2020-12/schema", te = "https://farris-
|
|
|
163
177
|
type: "boolean",
|
|
164
178
|
default: !0
|
|
165
179
|
}
|
|
166
|
-
},
|
|
180
|
+
}, ie = [
|
|
167
181
|
"id",
|
|
168
182
|
"type",
|
|
169
183
|
"contents"
|
|
170
184
|
], ce = {
|
|
171
|
-
$schema:
|
|
172
|
-
$id:
|
|
185
|
+
$schema: te,
|
|
186
|
+
$id: re,
|
|
173
187
|
title: se,
|
|
174
188
|
description: ne,
|
|
175
|
-
type:
|
|
176
|
-
properties:
|
|
177
|
-
required:
|
|
178
|
-
},
|
|
189
|
+
type: oe,
|
|
190
|
+
properties: ae,
|
|
191
|
+
required: ie
|
|
192
|
+
}, pe = "responseLayout", ue = "A Farris Container Component", le = "object", fe = {
|
|
179
193
|
basic: {
|
|
180
194
|
description: "Basic Infomation",
|
|
181
195
|
title: "基本信息",
|
|
@@ -253,23 +267,23 @@ const ee = "https://json-schema.org/draft/2020-12/schema", te = "https://farris-
|
|
|
253
267
|
}
|
|
254
268
|
}
|
|
255
269
|
}
|
|
256
|
-
},
|
|
257
|
-
title:
|
|
258
|
-
description:
|
|
270
|
+
}, ye = {
|
|
271
|
+
title: pe,
|
|
272
|
+
description: ue,
|
|
259
273
|
type: le,
|
|
260
|
-
categories:
|
|
261
|
-
},
|
|
274
|
+
categories: fe
|
|
275
|
+
}, O = {
|
|
262
276
|
customClass: { type: String, default: "" }
|
|
263
|
-
},
|
|
277
|
+
}, q = H(O, ce, G, ee, ye), D = /* @__PURE__ */ $({
|
|
264
278
|
name: "FResponseLayout",
|
|
265
|
-
props:
|
|
279
|
+
props: O,
|
|
266
280
|
emits: [],
|
|
267
|
-
setup(
|
|
281
|
+
setup(r, e) {
|
|
268
282
|
return () => S("div", {
|
|
269
|
-
class:
|
|
283
|
+
class: r.customClass
|
|
270
284
|
}, [e.slots.default && e.slots.default()]);
|
|
271
285
|
}
|
|
272
|
-
}),
|
|
286
|
+
}), me = "https://json-schema.org/draft/2020-12/schema", de = "https://farris-design.gitee.io/response-layout-item.schema.json", he = "response-layout-item", ge = "A Farris Container Component", be = "object", ve = {
|
|
273
287
|
id: {
|
|
274
288
|
description: "The unique identifier for a Respnse Layout Item",
|
|
275
289
|
type: "string"
|
|
@@ -315,34 +329,34 @@ const ee = "https://json-schema.org/draft/2020-12/schema", te = "https://farris-
|
|
|
315
329
|
type: "boolean",
|
|
316
330
|
default: !0
|
|
317
331
|
}
|
|
318
|
-
},
|
|
332
|
+
}, Le = [
|
|
319
333
|
"id",
|
|
320
334
|
"type",
|
|
321
335
|
"contents"
|
|
322
|
-
],
|
|
323
|
-
$schema:
|
|
324
|
-
$id:
|
|
325
|
-
title:
|
|
326
|
-
description:
|
|
327
|
-
type:
|
|
328
|
-
properties:
|
|
329
|
-
required:
|
|
330
|
-
},
|
|
336
|
+
], Re = {
|
|
337
|
+
$schema: me,
|
|
338
|
+
$id: de,
|
|
339
|
+
title: he,
|
|
340
|
+
description: ge,
|
|
341
|
+
type: be,
|
|
342
|
+
properties: ve,
|
|
343
|
+
required: Le
|
|
344
|
+
}, T = {
|
|
331
345
|
customClass: { type: String, default: "" }
|
|
332
|
-
}, A =
|
|
346
|
+
}, A = H(T, Re, G), R = /* @__PURE__ */ $({
|
|
333
347
|
name: "FResponseLayoutItem",
|
|
334
|
-
props:
|
|
348
|
+
props: T,
|
|
335
349
|
emits: [],
|
|
336
|
-
setup(
|
|
350
|
+
setup(r, e) {
|
|
337
351
|
return () => S("div", {
|
|
338
|
-
class:
|
|
352
|
+
class: r.customClass
|
|
339
353
|
}, [e.slots.default && e.slots.default()]);
|
|
340
354
|
}
|
|
341
355
|
});
|
|
342
|
-
function
|
|
343
|
-
var
|
|
344
|
-
const
|
|
345
|
-
function
|
|
356
|
+
function J(r, e, o) {
|
|
357
|
+
var w;
|
|
358
|
+
const s = "", t = "", c = v();
|
|
359
|
+
function p() {
|
|
346
360
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
347
361
|
}
|
|
348
362
|
function f() {
|
|
@@ -351,22 +365,22 @@ function G(t, e, o) {
|
|
|
351
365
|
function g() {
|
|
352
366
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
353
367
|
}
|
|
354
|
-
function
|
|
368
|
+
function n() {
|
|
355
369
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
356
370
|
}
|
|
357
|
-
function a(
|
|
358
|
-
if (!
|
|
371
|
+
function a(l) {
|
|
372
|
+
if (!l || !l.value)
|
|
359
373
|
return null;
|
|
360
|
-
if (
|
|
361
|
-
return
|
|
362
|
-
const h = v(
|
|
374
|
+
if (l.value.schema && l.value.schema.type === "component")
|
|
375
|
+
return l.value;
|
|
376
|
+
const h = v(l == null ? void 0 : l.value.parent), m = a(h);
|
|
363
377
|
return m || null;
|
|
364
378
|
}
|
|
365
|
-
function
|
|
366
|
-
const { componentInstance: h, designerItemElementRef: m } =
|
|
367
|
-
return !h || !h.value ? null : h.value.canMove ? m :
|
|
379
|
+
function i(l = e) {
|
|
380
|
+
const { componentInstance: h, designerItemElementRef: m } = l;
|
|
381
|
+
return !h || !h.value ? null : h.value.canMove ? m : i(l.parent);
|
|
368
382
|
}
|
|
369
|
-
function
|
|
383
|
+
function u(l) {
|
|
370
384
|
return !!o;
|
|
371
385
|
}
|
|
372
386
|
function y() {
|
|
@@ -374,94 +388,94 @@ function G(t, e, o) {
|
|
|
374
388
|
}
|
|
375
389
|
function d() {
|
|
376
390
|
}
|
|
377
|
-
function
|
|
391
|
+
function P(l, h) {
|
|
378
392
|
}
|
|
379
|
-
function E(
|
|
380
|
-
const { componentType: m } =
|
|
381
|
-
let b =
|
|
382
|
-
const
|
|
383
|
-
return b && !b.id && b.type === m && (b.id = `${
|
|
393
|
+
function E(l, h) {
|
|
394
|
+
const { componentType: m } = l;
|
|
395
|
+
let b = W(m, l, h);
|
|
396
|
+
const Q = m.toLowerCase().replace(/-/g, "_");
|
|
397
|
+
return b && !b.id && b.type === m && (b.id = `${Q}_${Math.random().toString().slice(2, 6)}`), b;
|
|
384
398
|
}
|
|
385
|
-
function L(
|
|
399
|
+
function L(l) {
|
|
386
400
|
}
|
|
387
|
-
function N(...
|
|
401
|
+
function N(...l) {
|
|
388
402
|
}
|
|
389
|
-
function
|
|
390
|
-
e != null && e.schema.contents && e.schema.contents.map((
|
|
403
|
+
function j() {
|
|
404
|
+
e != null && e.schema.contents && e.schema.contents.map((l) => {
|
|
391
405
|
var b;
|
|
392
|
-
let h =
|
|
393
|
-
|
|
394
|
-
const m =
|
|
406
|
+
let h = l.id;
|
|
407
|
+
l.type === "component-ref" && (h = l.component);
|
|
408
|
+
const m = r.value.querySelector(`#${h}-design-item`);
|
|
395
409
|
(b = m == null ? void 0 : m.componentInstance) != null && b.value.onRemoveComponent && m.componentInstance.value.onRemoveComponent();
|
|
396
410
|
});
|
|
397
411
|
}
|
|
398
|
-
return
|
|
399
|
-
canMove:
|
|
412
|
+
return c.value = {
|
|
413
|
+
canMove: p(),
|
|
400
414
|
canSelectParent: f(),
|
|
401
415
|
canDelete: g(),
|
|
402
|
-
canNested: !
|
|
416
|
+
canNested: !n(),
|
|
403
417
|
contents: e == null ? void 0 : e.schema.contents,
|
|
404
|
-
elementRef:
|
|
405
|
-
parent: (
|
|
418
|
+
elementRef: r,
|
|
419
|
+
parent: (w = e == null ? void 0 : e.parent) == null ? void 0 : w.componentInstance,
|
|
406
420
|
schema: e == null ? void 0 : e.schema,
|
|
407
|
-
styles:
|
|
408
|
-
designerClass:
|
|
409
|
-
canAccepts:
|
|
421
|
+
styles: s,
|
|
422
|
+
designerClass: t,
|
|
423
|
+
canAccepts: u,
|
|
410
424
|
getBelongedComponentInstance: a,
|
|
411
|
-
getDraggableDesignItemElement:
|
|
425
|
+
getDraggableDesignItemElement: i,
|
|
412
426
|
getDraggingDisplayText: y,
|
|
413
427
|
getPropConfig: N,
|
|
414
428
|
getDragScopeElement: d,
|
|
415
|
-
onAcceptMovedChildElement:
|
|
429
|
+
onAcceptMovedChildElement: P,
|
|
416
430
|
onChildElementMovedOut: L,
|
|
417
431
|
addNewChildComponentSchema: E,
|
|
418
432
|
triggerBelongedComponentToMoveWhenMoved: v(!1),
|
|
419
433
|
triggerBelongedComponentToDeleteWhenDeleted: v(!1),
|
|
420
|
-
onRemoveComponent:
|
|
421
|
-
},
|
|
434
|
+
onRemoveComponent: j
|
|
435
|
+
}, c;
|
|
422
436
|
}
|
|
423
|
-
const
|
|
437
|
+
const $e = /* @__PURE__ */ $({
|
|
424
438
|
name: "FResponseLayoutDesign",
|
|
425
|
-
props:
|
|
439
|
+
props: O,
|
|
426
440
|
emits: [],
|
|
427
|
-
setup(
|
|
428
|
-
const o = v(),
|
|
429
|
-
return
|
|
430
|
-
o.value.componentInstance =
|
|
431
|
-
}), e.expose(
|
|
441
|
+
setup(r, e) {
|
|
442
|
+
const o = v(), s = B("design-item-context"), t = J(o, s);
|
|
443
|
+
return t.value.canNested = !1, k(() => {
|
|
444
|
+
o.value.componentInstance = t;
|
|
445
|
+
}), e.expose(t.value), () => S("div", {
|
|
432
446
|
ref: o,
|
|
433
447
|
class: "d-flex response-layout"
|
|
434
448
|
}, [e.slots.default && e.slots.default()]);
|
|
435
449
|
}
|
|
436
|
-
}),
|
|
450
|
+
}), Se = /* @__PURE__ */ $({
|
|
437
451
|
name: "FResponseLayoutItemDesign",
|
|
438
|
-
props:
|
|
452
|
+
props: T,
|
|
439
453
|
emits: [],
|
|
440
|
-
setup(
|
|
441
|
-
const o = v(),
|
|
442
|
-
return
|
|
443
|
-
o.value.componentInstance =
|
|
444
|
-
}), e.expose(
|
|
454
|
+
setup(r, e) {
|
|
455
|
+
const o = v(), s = B("design-item-context"), t = J(o, s);
|
|
456
|
+
return t.value.canNested = !1, t.value.canMove = !1, t.value.canDelete = !1, k(() => {
|
|
457
|
+
o.value.componentInstance = t;
|
|
458
|
+
}), e.expose(t.value), () => S(R, {
|
|
445
459
|
ref: o
|
|
446
460
|
}, {
|
|
447
461
|
default: () => [e.slots.default && e.slots.default()]
|
|
448
462
|
});
|
|
449
463
|
}
|
|
450
|
-
}),
|
|
451
|
-
install(
|
|
452
|
-
|
|
464
|
+
}), De = {
|
|
465
|
+
install(r) {
|
|
466
|
+
r.component(D.name, D).component(R.name, R);
|
|
453
467
|
},
|
|
454
|
-
register(
|
|
455
|
-
|
|
468
|
+
register(r, e, o, s) {
|
|
469
|
+
r["response-layout"] = D, r["response-layout-item"] = R, e["response-layout"] = q, e["response-layout-item"] = A;
|
|
456
470
|
},
|
|
457
|
-
registerDesigner(
|
|
458
|
-
|
|
471
|
+
registerDesigner(r, e, o) {
|
|
472
|
+
r["response-layout"] = $e, r["response-layout-item"] = Se, e["response-layout"] = q, e["response-layout-item"] = A;
|
|
459
473
|
}
|
|
460
474
|
};
|
|
461
475
|
export {
|
|
462
476
|
D as FResponseLayout,
|
|
463
477
|
R as FResponseLayoutItem,
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
478
|
+
De as default,
|
|
479
|
+
O as responseLayoutProps,
|
|
480
|
+
q as responseLayoutPropsResolver
|
|
467
481
|
};
|