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