@farris/ui-vue 1.3.4 → 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 (145) 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 +9 -7
  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 +746 -730
  26. package/components/data-grid/index.umd.cjs +1 -1
  27. package/components/data-view/index.esm.js +9 -7
  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 +3096 -3069
  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 +78 -82
  40. package/components/event-parameter/index.umd.cjs +1 -1
  41. package/components/events-editor/index.esm.js +501 -487
  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 +487 -472
  46. package/components/external-container/index.umd.cjs +1 -1
  47. package/components/field-selector/index.esm.js +440 -433
  48. package/components/field-selector/index.umd.cjs +1 -1
  49. package/components/filter-bar/index.esm.js +594 -587
  50. package/components/filter-bar/index.umd.cjs +1 -1
  51. package/components/flow-canvas/index.esm.js +2766 -2739
  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 +314 -298
  62. package/components/list-view/index.umd.cjs +1 -1
  63. package/components/lookup/index.esm.js +862 -843
  64. package/components/lookup/index.umd.cjs +1 -1
  65. package/components/mapping-editor/index.esm.js +1031 -1015
  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 +776 -770
  88. package/components/query-solution/index.umd.cjs +6 -6
  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 +296 -283
  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 +634 -619
  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 +383 -376
  128. package/components/tree-grid/index.umd.cjs +1 -1
  129. package/components/tree-view/index.esm.js +595 -575
  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 +5492 -5470
  140. package/farris.all.umd.cjs +13 -13
  141. package/index.css +1 -1
  142. package/package.json +1 -1
  143. package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -1
  144. package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
  145. package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
@@ -1,3 +1,3 @@
1
- (function(N,r){typeof exports=="object"&&typeof module<"u"?r(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"],r):(N=typeof globalThis<"u"?globalThis:N||self,r(N.progress={},N.Vue,N.LodashES,N.common))})(this,function(N,r,G,A){"use strict";const q={},C={};function E(e){const{properties:t,title:f,ignore:n}=e,o=n&&Array.isArray(n),l=Object.keys(t).reduce((p,a)=>((!o||!n.find(y=>y===a))&&(p[a]=t[a].type==="object"&&t[a].properties?E(t[a]):G.cloneDeep(t[a].default)),p),{});if(f&&(!o||!n.find(p=>p==="id"))){const p=f.toLowerCase().replace(/-/g,"_");l.id=`${p}_${Math.random().toString().slice(2,6)}`}return l}function F(e,t={},f){const n=q[e];if(n){let o=E(n);const l=C[e];return o=l?l({getSchemaByType:F},o,t,f):o,o}return null}function z(e,t){const f=E(t);return Object.keys(f).reduce((n,o)=>(n[o]&&G.isPlainObject(n[o])&&G.isPlainObject(e[o]||!e[o])?Object.assign(n[o],e[o]||{}):n[o]=e[o],n),f),f}function _(e,t){return Object.keys(e).filter(n=>e[n]!=null).reduce((n,o)=>{if(t.has(o)){const l=t.get(o);if(typeof l=="string")n[l]=e[o];else{const p=l(o,e[o],e);Object.assign(n,p)}}else n[o]=e[o];return n},{})}function X(e,t,f=new Map){const n=z(e,t);return _(n,f)}function Y(e={}){function t(s,c,i,u){if(typeof i=="number")return u[s].length===i;if(typeof i=="object"){const k=Object.keys(i)[0],b=i[k];if(k==="not")return Number(u[s].length)!==Number(b);if(k==="moreThan")return Number(u[s].length)>=Number(b);if(k==="lessThan")return Number(u[s].length)<=Number(b)}return!1}function f(s,c,i,u){return u[s]&&u[s].propertyValue&&String(u[s].propertyValue.value)===String(i)}const n=new Map([["length",t],["getProperty",f]]);Object.keys(e).reduce((s,c)=>(s.set(c,e[c]),s),n);function o(s,c){const i=s;return typeof c=="number"?[{target:i,operator:"length",param:null,value:Number(c)}]:typeof c=="boolean"?[{target:i,operator:"getProperty",param:s,value:!!c}]:typeof c=="object"?Object.keys(c).map(u=>{if(u==="length")return{target:i,operator:"length",param:null,value:c[u]};const k=u,b=c[u];return{target:i,operator:"getProperty",param:k,value:b}}):[]}function l(s){return Object.keys(s).reduce((i,u)=>{const k=o(u,s[u]);return i.push(...k),i},[])}function p(s,c){if(n.has(s.operator)){const i=n.get(s.operator);return i&&i(s.target,s.param,s.value,c)||!1}return!1}function a(s,c){return l(s).reduce((k,b)=>k&&p(b,c),!0)}function y(s,c){const i=Object.keys(s),u=i.includes("allOf"),k=i.includes("anyOf"),b=u||k,g=(b?s[b?u?"allOf":"anyOf":"allOf"]:[s]).map(P=>a(P,c));return u?!g.includes(!1):g.includes(!0)}return{parseValueSchema:y}}const H={},J={};Y();function Q(e,t,f=new Map,n=(p,a,y,s)=>a,o={},l=p=>p){return q[t.title]=t,C[t.title]=n,H[t.title]=o,J[t.title]=l,(p={})=>{const a=X(p,t,f),y=Object.keys(e).reduce((s,c)=>(s[c]=e[c].default,s),{});return Object.assign(y,a)}}function U(e,t){return{customClass:t.class,customStyle:t.style}}const Z=new Map([["appearance",U]]);function x(e,t,f){return t}const K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/progress.schema.json",title:"progress",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for progress",type:"string"},type:{description:"The type string of progress",type:"string",default:"progress"},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"]},I={title:"progress",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:[]}}}}}},M={progressType:{type:String,default:"line"},strokeWidth:{type:Number,default:0},size:{type:String,default:"default"},showInfo:{type:Boolean,default:!0},progressStatus:{type:String,default:"default"},successPercent:{type:Number,default:0},strokeColor:{type:String,default:""},strokeLinecap:{type:String,default:"round"},width:{type:Number,default:100},percent:{type:Number,default:20},enableBackgroundImg:{type:Boolean,default:!1},backgroundImg:{type:String,default:""},gapPosition:{type:String},gapDegree:{type:Number,default:0},format:{type:Function,default:(e,t)=>`${e}%`}},L=Q(M,K,Z,x,I);function ee(e){function t(p){return+p.replace("%","")}function f(p){let a=[];return Object.keys(p).forEach(y=>{const s=p[y],c=t(y);isNaN(c)||a.push({key:c,value:s})}),a=a.sort((y,s)=>y.key-s.key),a}const n=r.computed(()=>!!e.strokeColor&&typeof e.strokeColor!="string"),o=r.computed(()=>{const{from:p="#59a1ff",to:a="#59a1ff",direction:y="to right",...s}=e.strokeColor;if(Object.keys(s).length!==0){const c=f(s).map(({key:i,value:u})=>`${u} ${i}%`).join(", ");return`linear-gradient(${y}, ${c})`}return`linear-gradient(${y}, ${p}, ${a})`}),l=r.computed(()=>f(e.strokeColor).map(({key:p,value:a})=>({offset:`${p}%`,color:a})));return{isGradient:n,linearGradient:o,circleGradient:l}}function re(e){return{strokeWidth:r.computed(()=>e.strokeWidth||(e.progressType==="line"&&e.size!=="small"?8:6))}}function te(e){return{formatPercentageText:r.computed(()=>e.format(e.percent,e.successPercent))}}function se(e,t,f,n){const{isCircleStyle:o}=t,{isGradient:l,linearGradient:p}=f,{strokeWidth:a}=n,y=r.computed(()=>{const g={"f-progress":!0,"f-progress-line":e.progressType==="line","ant-progress-small":e.size==="small","f-progress-show-info":e.showInfo,"f-progress-circle":o.value},S=`f-progress-status-${e.progressStatus}`;return g[S]=!0,g}),s=r.computed(()=>({width:`${e.width}px`,height:`${e.width}px`,"font-size":`${e.width*.15+6}px`,"f-progress-circle-gradient":l.value})),c=r.computed(()=>({"f-progress-inner":!0,"f-progress-circle-gradient":l.value})),i=0,u=r.computed(()=>i+1),k=r.computed(()=>{const g=50-a.value/2,S=e.gapPosition||(e.progressType==="circle"?"top":"bottom");let P=0,$=-g,d=0,h=g*-2;switch(S){case"left":P=-g,$=0,d=g*2,h=0;break;case"right":P=g,$=0,d=g*-2,h=0;break;case"bottom":$=g,h=g*2;break}return`M 50,50 m ${P},${$}
2
- a ${g},${g} 0 1 1 ${d},${-h}
3
- a ${g},${g} 0 1 1 ${-d},${h}`}),b=r.computed(()=>{const g=50-a.value/2,S=Math.PI*2*g,P=e.gapDegree||(e.progressType==="circle"?0:75);return{strokeDasharray:`${S-P}px ${S}px`,strokeDashoffset:`-${P/2}px`,transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"}}),O=r.computed(()=>{const g=50-a.value/2,S=Math.PI*2*g,P=e.gapDegree||(e.progressType==="circle"?0:75),$=e.successPercent!==void 0&&e.successPercent!==null?[e.successPercent,e.percent]:[e.percent];return $.map((d,h)=>{const m=$.length===2&&h===0;return{stroke:l.value&&!m?`url(#gradient-${u.value})`:null,strokePathStyle:{stroke:l.value?null:m?"default":e.strokeColor,transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s",strokeDasharray:`${(d||0)/100*(S-P)}px ${S}px`,strokeDashoffset:`-${P/2}px`}}}).reverse()}),j=r.computed(()=>({width:`${e.percent}%`,"border-radius":e.strokeLinecap==="round"?"100px":"0",background:l.value?null:e.strokeColor,"background-image":l.value?p.value:null,height:`${a.value}px`}));return{progressClass:y,inCircleProgressBarStyle:s,inCircleProgressBarClass:c,pathString:k,trailPathStyle:b,progressCirclePaths:O,gradientId:u,inlineProgressBackgroundStyle:j}}function ne(e){return{isCircleStyle:r.computed(()=>e.progressType==="circle"||e.progressType==="dashboard")}}function oe(e){const t=r.computed(()=>{const o={"f-progress-text-icon":!0,"f-icon":!0},l=`f-icon-${e.progressStatus}`;return o[l]=!0,o}),f=r.computed(()=>{const o={"f-progress-text-icon":!0,"f-icon":!0},l=e.progressStatus==="success"?"f-icon-checkmark":"f-icon-x";return o[l]=!0,o}),n=r.computed(()=>e.progressStatus==="error"||e.progressStatus==="success");return{inlineProgrssStatusClass:t,circleProgrssStatusClass:f,shouldShowStatus:n}}function ce(e){const t=r.computed(()=>({width:`${e.successPercent}%`,"border-radius":e.strokeLinecap==="round"?"100px":"0",height:`${e.strokeWidth}px`,"background-image":e.enableBackgroundImg?`url(${e.backgroundImg})`:null})),f=r.computed(()=>e.successPercent||e.successPercent===0);return{inlineProgressSuccessBackgroundStyle:t,shouldShowSuccessInlineProgressBackground:f}}const V=r.defineComponent({name:"FProgress",props:M,emits:[],setup(e){const t=r.ref(e.progressType),f=r.ref(e.showInfo),n=r.ref(e.percent),o=r.ref(e.strokeLinecap),l=ee(e),{isGradient:p,circleGradient:a}=l,y=re(e),{strokeWidth:s}=y,{formatPercentageText:c}=te(e),i=ne(e),{isCircleStyle:u}=i,{progressClass:k,inCircleProgressBarStyle:b,inCircleProgressBarClass:O,pathString:j,trailPathStyle:g,progressCirclePaths:S,gradientId:P,inlineProgressBackgroundStyle:$}=se(e,i,l,y),{inlineProgrssStatusClass:d,circleProgrssStatusClass:h,shouldShowStatus:m}=oe(e),{inlineProgressSuccessBackgroundStyle:w,shouldShowSuccessInlineProgressBackground:B}=ce(e);r.watch(()=>e.percent,T=>{n.value=T||0});function D(){return f.value&&r.createVNode("span",{class:"f-progress-text"},[m.value?r.createVNode("span",{class:u.value?h.value:d.value},null):c.value])}function R(){return r.createVNode(r.Fragment,null,[r.createVNode("div",{class:"f-progress-outer"},[r.createVNode("div",{class:"f-progress-inner"},[r.createVNode("div",{class:"f-progress-bg",style:$.value},null),B.value&&r.createVNode("div",{class:"f-progress-success-bg",style:w.value},null)])]),D()])}function W(){return r.createVNode("div",{class:O.value,style:b.value},[r.createVNode("svg",{class:"f-progress-circle",viewBox:"0 0 100 100"},[p.value&&r.createVNode("defs",null,[r.createVNode("linearGradient",{id:"gradient-"+P.value,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[a.value.map(T=>r.createVNode("stop",{offset:T.offset,"stop-color":T.color},null))])]),r.createVNode("path",{class:"f-progress-circle-trail",stroke:"#efefef","fill-opacity":"0","stroke-width":s.value,d:j.value,style:g.value},null),S.value.map(T=>r.createVNode("path",{class:"f-progress-circle-path","fill-opacity":"0",d:j.value,"stroke-linecap":o.value,stroke:T.stroke,"stroke-width":n.value?s.value:0,style:T.strokePathStyle},null))]),D()])}return()=>r.createVNode("div",{class:k.value},[t.value==="line"&&R(),u.value&&W()])}});function ae(e,t,f){var $;const n="",o="",l=r.ref();function p(){return(t==null?void 0:t.schema.componentType)!=="frame"}function a(){return!1}function y(){return(t==null?void 0:t.schema.componentType)!=="frame"}function s(){return(t==null?void 0:t.schema.componentType)==="frame"}function c(d){if(!d||!d.value)return null;if(d.value.schema&&d.value.schema.type==="component")return d.value;const h=r.ref(d==null?void 0:d.value.parent),m=c(h);return m||null}function i(d=t){const{componentInstance:h,designerItemElementRef:m}=d;return!h||!h.value?null:h.value.canMove?m:i(d.parent)}function u(d){return!!f}function k(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function b(){}function O(d,h){}function j(d,h){const{componentType:m}=d;let w=F(m,d,h);const B=m.toLowerCase().replace(/-/g,"_");return w&&!w.id&&w.type===m&&(w.id=`${B}_${Math.random().toString().slice(2,6)}`),w}function g(d){}function S(...d){}function P(){t!=null&&t.schema.contents&&t.schema.contents.map(d=>{var w;let h=d.id;d.type==="component-ref"&&(h=d.component);const m=e.value.querySelector(`#${h}-design-item`);(w=m==null?void 0:m.componentInstance)!=null&&w.value.onRemoveComponent&&m.componentInstance.value.onRemoveComponent()})}return l.value={canMove:p(),canSelectParent:a(),canDelete:y(),canNested:!s(),contents:t==null?void 0:t.schema.contents,elementRef:e,parent:($=t==null?void 0:t.parent)==null?void 0:$.componentInstance,schema:t==null?void 0:t.schema,styles:n,designerClass:o,canAccepts:u,getBelongedComponentInstance:c,getDraggableDesignItemElement:i,getDraggingDisplayText:k,getPropConfig:S,getDragScopeElement:b,onAcceptMovedChildElement:O,onChildElementMovedOut:g,addNewChildComponentSchema:j,triggerBelongedComponentToMoveWhenMoved:r.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:r.ref(!1),onRemoveComponent:P},l}const le=r.defineComponent({name:"FProgressDesign",props:M,emits:[],setup(e,t){const f=r.ref(e.progressStatus),n=r.ref(e.progressType),o=r.ref(e.size),l=r.ref(e.showInfo),p=r.ref(e.strokeWidth),a=r.ref(e.percent),y=r.ref(e.strokeLinecap),s=r.ref(!1),c=r.ref(e.strokeColor),i=r.ref(null),u=r.ref(0),k=r.ref(e.width),b=r.ref(""),O=r.ref([]),j=r.ref(""),g=r.ref([]),S=r.ref(e.enableBackgroundImg),P=r.ref(e.backgroundImg),$=r.ref(),d=r.inject("design-item-context"),h=ae($,d);r.onMounted(()=>{$.value.componentInstance=h}),t.expose(h.value),r.watch(()=>e.percent,v=>{a.value=v||0});const m=r.computed(()=>p.value||(n.value==="line"&&o.value!=="small"?8:6)),w=r.computed(()=>n.value==="circle"||n.value==="dashboard"),B=r.computed(()=>{const v={"f-progress":!0,"f-progress-line":n.value==="line","ant-progress-small":o.value==="small","f-progress-show-info":l.value,".f-progress-circle":w.value},pe=`f-progress-status-${f.value}`;return v[pe]=!0,v}),D=r.computed(()=>({width:`${a.value}%`,"border-radius":y.value==="round"?"100px":"0",backgroud:s.value?null:c.value,"background-image":s.value?i.value:null,height:`${m.value}px`})),R=r.computed(()=>({width:`${a.value}%`,"border-radius":y.value==="round"?"100px":"0",height:`${m.value}px`,"background-image":S.value?P.value:null})),W=r.computed(()=>u.value||u.value===0);function T(){return r.createVNode("div",{class:"f-progress-outer"},[r.createVNode("div",{class:"f-progress-inner"},[r.createVNode("div",{class:"f-progress-bg",style:D.value},null),W.value&&r.createVNode("div",{class:"f-progress-success-bg",style:R.value},null)])])}const ue=r.computed(()=>({width:`${k.value}px`,height:`${k.value}px`,"font-size":`${k.value*.15+6}px`,"f-progress-circle-gradient":s.value})),fe=r.computed(()=>({}));function de(){return r.createVNode("div",{class:"f-progress-inner",style:ue.value},[r.createVNode("svg",{class:"f-progress-circle",viewBox:"0 0 100 100"},[s.value&&r.createVNode("defs",null,[r.createVNode("linearGradient",{id:"gradient-"+b.value,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[O.value.map(v=>r.createVNode("stop",{offset:v.offset,"stop-color":v.color},null))])]),r.createVNode("path",{class:"f-progress-circle-trail",stroke:"#efefef","fill-opacity":"0","stroke-width":m.value,d:j.value,style:fe.value},null),g.value.map(v=>r.createVNode("path",{class:"f-progress-circle-path","fill-opacity":"0",d:j.value,"stroke-linecap":y.value,stroke:v.stroke,"stroke-width":a.value?m.value:0,style:v.strokePathStyle},null))])])}return()=>r.createVNode("div",{ref:$,class:B.value},[n.value==="line"&&T(),w.value&&de()])}});V.register=(e,t,f)=>{e.progress=V,t.progress=L},V.registerDesigner=(e,t,f)=>{e.progress=le,t.progress=L};const ie=A.withInstall(V);N.Progress=V,N.default=ie,N.progressProps=M,N.propsResolver=L,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(N,r){typeof exports=="object"&&typeof module<"u"?r(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"],r):(N=typeof globalThis<"u"?globalThis:N||self,r(N.progress={},N.Vue,N.LodashES,N.common))})(this,function(N,r,D,F){"use strict";const q={},A={};function L(e){const{properties:t,title:l,ignore:n}=e,o=n&&Array.isArray(n),c=Object.keys(t).reduce((a,u)=>((!o||!n.find(y=>y===u))&&(a[u]=t[u].type==="object"&&t[u].properties?L(t[u]):D.cloneDeep(t[u].default)),a),{});if(l&&(!o||!n.find(a=>a==="id"))){const a=l.toLowerCase().replace(/-/g,"_");c.id=`${a}_${Math.random().toString().slice(2,6)}`}return c}function _(e){const{properties:t,title:l,required:n}=e;if(n&&Array.isArray(n)){const o=n.reduce((c,a)=>(c[a]=t[a].type==="object"&&t[a].properties?L(t[a]):D.cloneDeep(t[a].default),c),{});if(l&&n.find(c=>c==="id")){const c=l.toLowerCase().replace(/-/g,"_");o.id=`${c}_${Math.random().toString().slice(2,6)}`}return o}return{type:l}}function C(e,t={},l){const n=q[e];if(n){let o=_(n);const c=A[e];return o=c?c({getSchemaByType:C},o,t,l):o,o}return null}function z(e,t){const l=L(t);return Object.keys(l).reduce((n,o)=>(Object.prototype.hasOwnProperty.call(e,o)&&(n[o]&&D.isPlainObject(n[o])&&D.isPlainObject(e[o]||!e[o])?Object.assign(n[o],e[o]||{}):n[o]=e[o]),n),l),l}function X(e,t){return Object.keys(e).filter(n=>e[n]!=null).reduce((n,o)=>{if(t.has(o)){const c=t.get(o);if(typeof c=="string")n[c]=e[o];else{const a=c(o,e[o],e);Object.assign(n,a)}}else n[o]=e[o];return n},{})}function Y(e,t,l=new Map){const n=z(e,t);return X(n,l)}function H(e={}){function t(s,i,f,d){if(typeof f=="number")return d[s].length===f;if(typeof f=="object"){const k=Object.keys(f)[0],b=f[k];if(k==="not")return Number(d[s].length)!==Number(b);if(k==="moreThan")return Number(d[s].length)>=Number(b);if(k==="lessThan")return Number(d[s].length)<=Number(b)}return!1}function l(s,i,f,d){return d[s]&&d[s].propertyValue&&String(d[s].propertyValue.value)===String(f)}const n=new Map([["length",t],["getProperty",l]]);Object.keys(e).reduce((s,i)=>(s.set(i,e[i]),s),n);function o(s,i){const f=s;return typeof i=="number"?[{target:f,operator:"length",param:null,value:Number(i)}]:typeof i=="boolean"?[{target:f,operator:"getProperty",param:s,value:!!i}]:typeof i=="object"?Object.keys(i).map(d=>{if(d==="length")return{target:f,operator:"length",param:null,value:i[d]};const k=d,b=i[d];return{target:f,operator:"getProperty",param:k,value:b}}):[]}function c(s){return Object.keys(s).reduce((f,d)=>{const k=o(d,s[d]);return f.push(...k),f},[])}function a(s,i){if(n.has(s.operator)){const f=n.get(s.operator);return f&&f(s.target,s.param,s.value,i)||!1}return!1}function u(s,i){return c(s).reduce((k,b)=>k&&a(b,i),!0)}function y(s,i){const f=Object.keys(s),d=f.includes("allOf"),k=f.includes("anyOf"),b=d||k,g=(b?s[b?d?"allOf":"anyOf":"allOf"]:[s]).map(P=>u(P,i));return d?!g.includes(!1):g.includes(!0)}return{parseValueSchema:y}}const J={},Q={};H();function U(e,t,l=new Map,n=(a,u,y,s)=>u,o={},c=a=>a){return q[t.title]=t,A[t.title]=n,J[t.title]=o,Q[t.title]=c,(a={})=>{const u=Y(a,t,l),y=Object.keys(e).reduce((s,i)=>(s[i]=e[i].default,s),{});return Object.assign(y,u)}}function Z(e,t){return{customClass:t.class,customStyle:t.style}}const x=new Map([["appearance",Z]]);function I(e,t,l){return t}const K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/progress.schema.json",title:"progress",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for progress",type:"string"},type:{description:"The type string of progress",type:"string",default:"progress"},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"]},ee={title:"progress",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:[]}}}}}},M={progressType:{type:String,default:"line"},strokeWidth:{type:Number,default:0},size:{type:String,default:"default"},showInfo:{type:Boolean,default:!0},progressStatus:{type:String,default:"default"},successPercent:{type:Number,default:0},strokeColor:{type:String,default:""},strokeLinecap:{type:String,default:"round"},width:{type:Number,default:100},percent:{type:Number,default:20},enableBackgroundImg:{type:Boolean,default:!1},backgroundImg:{type:String,default:""},gapPosition:{type:String},gapDegree:{type:Number,default:0},format:{type:Function,default:(e,t)=>`${e}%`}},R=U(M,K,x,I,ee);function re(e){function t(a){return+a.replace("%","")}function l(a){let u=[];return Object.keys(a).forEach(y=>{const s=a[y],i=t(y);isNaN(i)||u.push({key:i,value:s})}),u=u.sort((y,s)=>y.key-s.key),u}const n=r.computed(()=>!!e.strokeColor&&typeof e.strokeColor!="string"),o=r.computed(()=>{const{from:a="#59a1ff",to:u="#59a1ff",direction:y="to right",...s}=e.strokeColor;if(Object.keys(s).length!==0){const i=l(s).map(({key:f,value:d})=>`${d} ${f}%`).join(", ");return`linear-gradient(${y}, ${i})`}return`linear-gradient(${y}, ${a}, ${u})`}),c=r.computed(()=>l(e.strokeColor).map(({key:a,value:u})=>({offset:`${a}%`,color:u})));return{isGradient:n,linearGradient:o,circleGradient:c}}function te(e){return{strokeWidth:r.computed(()=>e.strokeWidth||(e.progressType==="line"&&e.size!=="small"?8:6))}}function se(e){return{formatPercentageText:r.computed(()=>e.format(e.percent,e.successPercent))}}function ne(e,t,l,n){const{isCircleStyle:o}=t,{isGradient:c,linearGradient:a}=l,{strokeWidth:u}=n,y=r.computed(()=>{const g={"f-progress":!0,"f-progress-line":e.progressType==="line","ant-progress-small":e.size==="small","f-progress-show-info":e.showInfo,"f-progress-circle":o.value},S=`f-progress-status-${e.progressStatus}`;return g[S]=!0,g}),s=r.computed(()=>({width:`${e.width}px`,height:`${e.width}px`,"font-size":`${e.width*.15+6}px`,"f-progress-circle-gradient":c.value})),i=r.computed(()=>({"f-progress-inner":!0,"f-progress-circle-gradient":c.value})),f=0,d=r.computed(()=>f+1),k=r.computed(()=>{const g=50-u.value/2,S=e.gapPosition||(e.progressType==="circle"?"top":"bottom");let P=0,$=-g,p=0,h=g*-2;switch(S){case"left":P=-g,$=0,p=g*2,h=0;break;case"right":P=g,$=0,p=g*-2,h=0;break;case"bottom":$=g,h=g*2;break}return`M 50,50 m ${P},${$}
2
+ a ${g},${g} 0 1 1 ${p},${-h}
3
+ a ${g},${g} 0 1 1 ${-p},${h}`}),b=r.computed(()=>{const g=50-u.value/2,S=Math.PI*2*g,P=e.gapDegree||(e.progressType==="circle"?0:75);return{strokeDasharray:`${S-P}px ${S}px`,strokeDashoffset:`-${P/2}px`,transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"}}),O=r.computed(()=>{const g=50-u.value/2,S=Math.PI*2*g,P=e.gapDegree||(e.progressType==="circle"?0:75),$=e.successPercent!==void 0&&e.successPercent!==null?[e.successPercent,e.percent]:[e.percent];return $.map((p,h)=>{const m=$.length===2&&h===0;return{stroke:c.value&&!m?`url(#gradient-${d.value})`:null,strokePathStyle:{stroke:c.value?null:m?"default":e.strokeColor,transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s",strokeDasharray:`${(p||0)/100*(S-P)}px ${S}px`,strokeDashoffset:`-${P/2}px`}}}).reverse()}),j=r.computed(()=>({width:`${e.percent}%`,"border-radius":e.strokeLinecap==="round"?"100px":"0",background:c.value?null:e.strokeColor,"background-image":c.value?a.value:null,height:`${u.value}px`}));return{progressClass:y,inCircleProgressBarStyle:s,inCircleProgressBarClass:i,pathString:k,trailPathStyle:b,progressCirclePaths:O,gradientId:d,inlineProgressBackgroundStyle:j}}function oe(e){return{isCircleStyle:r.computed(()=>e.progressType==="circle"||e.progressType==="dashboard")}}function ce(e){const t=r.computed(()=>{const o={"f-progress-text-icon":!0,"f-icon":!0},c=`f-icon-${e.progressStatus}`;return o[c]=!0,o}),l=r.computed(()=>{const o={"f-progress-text-icon":!0,"f-icon":!0},c=e.progressStatus==="success"?"f-icon-checkmark":"f-icon-x";return o[c]=!0,o}),n=r.computed(()=>e.progressStatus==="error"||e.progressStatus==="success");return{inlineProgrssStatusClass:t,circleProgrssStatusClass:l,shouldShowStatus:n}}function ae(e){const t=r.computed(()=>({width:`${e.successPercent}%`,"border-radius":e.strokeLinecap==="round"?"100px":"0",height:`${e.strokeWidth}px`,"background-image":e.enableBackgroundImg?`url(${e.backgroundImg})`:null})),l=r.computed(()=>e.successPercent||e.successPercent===0);return{inlineProgressSuccessBackgroundStyle:t,shouldShowSuccessInlineProgressBackground:l}}const B=r.defineComponent({name:"FProgress",props:M,emits:[],setup(e){const t=r.ref(e.progressType),l=r.ref(e.showInfo),n=r.ref(e.percent),o=r.ref(e.strokeLinecap),c=re(e),{isGradient:a,circleGradient:u}=c,y=te(e),{strokeWidth:s}=y,{formatPercentageText:i}=se(e),f=oe(e),{isCircleStyle:d}=f,{progressClass:k,inCircleProgressBarStyle:b,inCircleProgressBarClass:O,pathString:j,trailPathStyle:g,progressCirclePaths:S,gradientId:P,inlineProgressBackgroundStyle:$}=ne(e,f,c,y),{inlineProgrssStatusClass:p,circleProgrssStatusClass:h,shouldShowStatus:m}=ce(e),{inlineProgressSuccessBackgroundStyle:w,shouldShowSuccessInlineProgressBackground:V}=ae(e);r.watch(()=>e.percent,T=>{n.value=T||0});function G(){return l.value&&r.createVNode("span",{class:"f-progress-text"},[m.value?r.createVNode("span",{class:d.value?h.value:p.value},null):i.value])}function W(){return r.createVNode(r.Fragment,null,[r.createVNode("div",{class:"f-progress-outer"},[r.createVNode("div",{class:"f-progress-inner"},[r.createVNode("div",{class:"f-progress-bg",style:$.value},null),V.value&&r.createVNode("div",{class:"f-progress-success-bg",style:w.value},null)])]),G()])}function E(){return r.createVNode("div",{class:O.value,style:b.value},[r.createVNode("svg",{class:"f-progress-circle",viewBox:"0 0 100 100"},[a.value&&r.createVNode("defs",null,[r.createVNode("linearGradient",{id:"gradient-"+P.value,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[u.value.map(T=>r.createVNode("stop",{offset:T.offset,"stop-color":T.color},null))])]),r.createVNode("path",{class:"f-progress-circle-trail",stroke:"#efefef","fill-opacity":"0","stroke-width":s.value,d:j.value,style:g.value},null),S.value.map(T=>r.createVNode("path",{class:"f-progress-circle-path","fill-opacity":"0",d:j.value,"stroke-linecap":o.value,stroke:T.stroke,"stroke-width":n.value?s.value:0,style:T.strokePathStyle},null))]),G()])}return()=>r.createVNode("div",{class:k.value},[t.value==="line"&&W(),d.value&&E()])}});function le(e,t,l){var $;const n="",o="",c=r.ref();function a(){return(t==null?void 0:t.schema.componentType)!=="frame"}function u(){return!1}function y(){return(t==null?void 0:t.schema.componentType)!=="frame"}function s(){return(t==null?void 0:t.schema.componentType)==="frame"}function i(p){if(!p||!p.value)return null;if(p.value.schema&&p.value.schema.type==="component")return p.value;const h=r.ref(p==null?void 0:p.value.parent),m=i(h);return m||null}function f(p=t){const{componentInstance:h,designerItemElementRef:m}=p;return!h||!h.value?null:h.value.canMove?m:f(p.parent)}function d(p){return!!l}function k(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function b(){}function O(p,h){}function j(p,h){const{componentType:m}=p;let w=C(m,p,h);const V=m.toLowerCase().replace(/-/g,"_");return w&&!w.id&&w.type===m&&(w.id=`${V}_${Math.random().toString().slice(2,6)}`),w}function g(p){}function S(...p){}function P(){t!=null&&t.schema.contents&&t.schema.contents.map(p=>{var w;let h=p.id;p.type==="component-ref"&&(h=p.component);const m=e.value.querySelector(`#${h}-design-item`);(w=m==null?void 0:m.componentInstance)!=null&&w.value.onRemoveComponent&&m.componentInstance.value.onRemoveComponent()})}return c.value={canMove:a(),canSelectParent:u(),canDelete:y(),canNested:!s(),contents:t==null?void 0:t.schema.contents,elementRef:e,parent:($=t==null?void 0:t.parent)==null?void 0:$.componentInstance,schema:t==null?void 0:t.schema,styles:n,designerClass:o,canAccepts:d,getBelongedComponentInstance:i,getDraggableDesignItemElement:f,getDraggingDisplayText:k,getPropConfig:S,getDragScopeElement:b,onAcceptMovedChildElement:O,onChildElementMovedOut:g,addNewChildComponentSchema:j,triggerBelongedComponentToMoveWhenMoved:r.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:r.ref(!1),onRemoveComponent:P},c}const ie=r.defineComponent({name:"FProgressDesign",props:M,emits:[],setup(e,t){const l=r.ref(e.progressStatus),n=r.ref(e.progressType),o=r.ref(e.size),c=r.ref(e.showInfo),a=r.ref(e.strokeWidth),u=r.ref(e.percent),y=r.ref(e.strokeLinecap),s=r.ref(!1),i=r.ref(e.strokeColor),f=r.ref(null),d=r.ref(0),k=r.ref(e.width),b=r.ref(""),O=r.ref([]),j=r.ref(""),g=r.ref([]),S=r.ref(e.enableBackgroundImg),P=r.ref(e.backgroundImg),$=r.ref(),p=r.inject("design-item-context"),h=le($,p);r.onMounted(()=>{$.value.componentInstance=h}),t.expose(h.value),r.watch(()=>e.percent,v=>{u.value=v||0});const m=r.computed(()=>a.value||(n.value==="line"&&o.value!=="small"?8:6)),w=r.computed(()=>n.value==="circle"||n.value==="dashboard"),V=r.computed(()=>{const v={"f-progress":!0,"f-progress-line":n.value==="line","ant-progress-small":o.value==="small","f-progress-show-info":c.value,".f-progress-circle":w.value},ge=`f-progress-status-${l.value}`;return v[ge]=!0,v}),G=r.computed(()=>({width:`${u.value}%`,"border-radius":y.value==="round"?"100px":"0",backgroud:s.value?null:i.value,"background-image":s.value?f.value:null,height:`${m.value}px`})),W=r.computed(()=>({width:`${u.value}%`,"border-radius":y.value==="round"?"100px":"0",height:`${m.value}px`,"background-image":S.value?P.value:null})),E=r.computed(()=>d.value||d.value===0);function T(){return r.createVNode("div",{class:"f-progress-outer"},[r.createVNode("div",{class:"f-progress-inner"},[r.createVNode("div",{class:"f-progress-bg",style:G.value},null),E.value&&r.createVNode("div",{class:"f-progress-success-bg",style:W.value},null)])])}const fe=r.computed(()=>({width:`${k.value}px`,height:`${k.value}px`,"font-size":`${k.value*.15+6}px`,"f-progress-circle-gradient":s.value})),de=r.computed(()=>({}));function pe(){return r.createVNode("div",{class:"f-progress-inner",style:fe.value},[r.createVNode("svg",{class:"f-progress-circle",viewBox:"0 0 100 100"},[s.value&&r.createVNode("defs",null,[r.createVNode("linearGradient",{id:"gradient-"+b.value,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[O.value.map(v=>r.createVNode("stop",{offset:v.offset,"stop-color":v.color},null))])]),r.createVNode("path",{class:"f-progress-circle-trail",stroke:"#efefef","fill-opacity":"0","stroke-width":m.value,d:j.value,style:de.value},null),g.value.map(v=>r.createVNode("path",{class:"f-progress-circle-path","fill-opacity":"0",d:j.value,"stroke-linecap":y.value,stroke:v.stroke,"stroke-width":u.value?m.value:0,style:v.strokePathStyle},null))])])}return()=>r.createVNode("div",{ref:$,class:V.value},[n.value==="line"&&T(),w.value&&pe()])}});B.register=(e,t,l)=>{e.progress=B,t.progress=R},B.registerDesigner=(e,t,l)=>{e.progress=ie,t.progress=R};const ue=F.withInstall(B);N.Progress=B,N.default=ue,N.progressProps=M,N.propsResolver=R,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});