@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.
- package/components/accordion/index.esm.js +16 -16
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +65 -65
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +13 -13
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +504 -490
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +247 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +356 -344
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +159 -145
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +127 -128
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +15 -15
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +101 -87
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +9 -7
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +181 -167
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +746 -730
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +9 -7
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +789 -777
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3096 -3069
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +257 -243
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +322 -306
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +177 -163
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +78 -82
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +501 -487
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +37 -37
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +487 -472
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +440 -433
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +594 -587
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +2766 -2739
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +402 -388
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +201 -202
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +264 -245
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +157 -143
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +314 -298
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +862 -843
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1031 -1015
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +169 -155
- package/components/nav/index.umd.cjs +2 -2
- package/components/number-range/index.esm.js +150 -137
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +207 -194
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +427 -414
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +22 -22
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +510 -492
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +192 -178
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +234 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +288 -277
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +62 -61
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +776 -770
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +296 -283
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +222 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +187 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +554 -542
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +483 -469
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +634 -619
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +228 -214
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +419 -406
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +162 -148
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +308 -284
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +279 -265
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +183 -170
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +307 -294
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +320 -306
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +245 -231
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +260 -247
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +409 -396
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +424 -410
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +383 -376
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +595 -575
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +325 -311
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +304 -290
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +99 -85
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +947 -933
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +5492 -5470
- package/farris.all.umd.cjs +13 -13
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -1
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(N,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],e):(N=typeof globalThis<"u"?globalThis:N||self,e(N["verify-detail"]={},N.Vue,N.LodashES))})(this,function(N,e,j){"use strict";var ie=Object.defineProperty;var se=(N,e,j)=>e in N?ie(N,e,{enumerable:!0,configurable:!0,writable:!0,value:j}):N[e]=j;var q=(N,e,j)=>se(N,typeof e!="symbol"?e+"":e,j);const A={},B={};function $(i){const{properties:t,title:l,ignore:s}=i,o=s&&Array.isArray(s),y=Object.keys(t).reduce((v,u)=>((!o||!s.find(b=>b===u))&&(v[u]=t[u].type==="object"&&t[u].properties?$(t[u]):j.cloneDeep(t[u].default)),v),{});if(l&&(!o||!s.find(v=>v==="id"))){const v=l.toLowerCase().replace(/-/g,"_");y.id=`${v}_${Math.random().toString().slice(2,6)}`}return y}function F(i,t={},l){const s=A[i];if(s){let o=$(s);const y=B[i];return o=y?y({getSchemaByType:F},o,t,l):o,o}return null}function _(i,t){const l=$(t);return Object.keys(l).reduce((s,o)=>(s[o]&&j.isPlainObject(s[o])&&j.isPlainObject(i[o]||!i[o])?Object.assign(s[o],i[o]||{}):s[o]=i[o],s),l),l}function C(i,t){return Object.keys(i).filter(s=>i[s]!=null).reduce((s,o)=>{if(t.has(o)){const y=t.get(o);if(typeof y=="string")s[y]=i[o];else{const v=y(o,i[o],i);Object.assign(s,v)}}else s[o]=i[o];return s},{})}function W(i,t,l=new Map){const s=_(i,t);return C(s,l)}function U(i={}){function t(a,c,p,d){if(typeof p=="number")return d[a].length===p;if(typeof p=="object"){const g=Object.keys(p)[0],V=p[g];if(g==="not")return Number(d[a].length)!==Number(V);if(g==="moreThan")return Number(d[a].length)>=Number(V);if(g==="lessThan")return Number(d[a].length)<=Number(V)}return!1}function l(a,c,p,d){return d[a]&&d[a].propertyValue&&String(d[a].propertyValue.value)===String(p)}const s=new Map([["length",t],["getProperty",l]]);Object.keys(i).reduce((a,c)=>(a.set(c,i[c]),a),s);function o(a,c){const p=a;return typeof c=="number"?[{target:p,operator:"length",param:null,value:Number(c)}]:typeof c=="boolean"?[{target:p,operator:"getProperty",param:a,value:!!c}]:typeof c=="object"?Object.keys(c).map(d=>{if(d==="length")return{target:p,operator:"length",param:null,value:c[d]};const g=d,V=c[d];return{target:p,operator:"getProperty",param:g,value:V}}):[]}function y(a){return Object.keys(a).reduce((p,d)=>{const g=o(d,a[d]);return p.push(...g),p},[])}function v(a,c){if(s.has(a.operator)){const p=s.get(a.operator);return p&&p(a.target,a.param,a.value,c)||!1}return!1}function u(a,c){return y(a).reduce((g,V)=>g&&v(V,c),!0)}function b(a,c){const p=Object.keys(a),d=p.includes("allOf"),g=p.includes("anyOf"),V=d||g,T=(V?a[V?d?"allOf":"anyOf":"allOf"]:[a]).map(M=>u(M,c));return d?!T.includes(!1):T.includes(!0)}return{parseValueSchema:b}}const z={},G={};U();function J(i,t,l=new Map,s=(v,u,b,a)=>u,o={},y=v=>v){return A[t.title]=t,B[t.title]=s,z[t.title]=o,G[t.title]=y,(v={})=>{const u=W(v,t,l),b=Object.keys(i).reduce((a,c)=>(a[c]=i[c].default,a),{});return Object.assign(b,u)}}function Q(i,t){return{customClass:t.class,customStyle:t.style}}const X=new Map([["appearance",Q]]);function Y(i,t,l){return t}const Z={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/verify-detail.schema.json",title:"verify-detail",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for verify-detail",type:"string"},type:{description:"The type string of verify-detail",type:"string",default:"verify-detail"},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"]},K={title:"verify-detail",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:[]}}}}}},P={showType:{type:String,default:""},showList:{type:Boolean,default:!1},verifyList:{type:Array,default:[{id:"111",title:"单据信息[销售组织]",msg:"字段值不能为空",type:"empty"},{id:"222",title:"单据信息[销售组织]",msg:"字段值不能为空",type:"empty"}]},verifyType:{type:Array,default:[{id:"vertifyType1",type:"all",title:"全部"},{id:"vertifyType3",type:"empty",title:"值为空"}]},customClass:{type:String,default:""},maxHeight:{type:Number,default:200}},H=J(P,Z,X,Y,K),E=e.defineComponent({name:"FVerifyDetail",props:P,emits:["validatorClick","listshow"],setup(i,t){let l=[];const s=e.ref(i.showList),o=e.ref(i.maxHeight),y=e.ref(i.verifyList),v=e.ref(i.showType),u=e.ref(i.verifyType),b=e.ref(i.customClass);function a(){s.value=!s.value,t.emit("listshow",s.value)}function c(n){var f;!n&&u.value&&u.value.length>0&&(n=u.value[0].type),(f=u.value)==null||f.forEach(r=>{r.active=r.type===n})}function p(n){n=n||l[0].type,l.forEach(f=>{f.show=f.type===n})}function d(n){n.length<=0||(c(n.type),p(n.type))}function g(){s.value=!1,t.emit("listshow",!1)}function V(n){t.emit("validatorClick",n)}function L(n){return e.createVNode("li",{class:"f-verify-list",onClick:()=>V(n)},[e.createVNode("span",{class:["f-icon f-icon-close-outline list-icon list-error",{"list-warning":n.type==="warn"}]},null),e.createVNode("div",{class:"list-con"},[e.createVNode("p",{class:"list-title",title:n.title},[n.title]),e.createVNode("p",{class:"list-msg",title:n.msg},[n.msg])])])}function O(){return l.map(n=>e.createVNode("ul",{class:["f-verify-list-content",{active:n.show}]},[n.list&&n.list.map(f=>L(f))]))}const T=e.computed(()=>{var n;return((n=y.value)==null?void 0:n.length)>0});function k(n){return{btn:!0,"verify-title-btn":!0,"f-state-selected":n.active,disabled:n.length<=0}}const M=e.computed(()=>{var n;return(n=u.value)==null?void 0:n.map(f=>e.createVNode("button",{class:k(f),onClick:()=>d(f)},[f.title,e.createVNode("span",null,[f.length])]))}),S=e.computed(()=>{var n;return e.createVNode("div",{class:"f-verify-nums",onClick:a},[e.createVNode("span",{class:"nums-icon f-icon f-icon-warning"},null),e.createVNode("span",{class:"nums-count"},[(n=y.value)==null?void 0:n.length])])});function h(){var f;const n=[];u.value&&((f=u.value)!=null&&f.length)&&(u.value.map(r=>{const m={list:r.type==="all"?y.value:[],show:!1,type:r.type};n.push(m)}),n.map((r,m)=>{const w=y.value.filter(D=>D.type===r.type);n[m].list=m!==0?w:n[m].list}),u.value.map((r,m)=>{r.length=n[m].list.length})),l=n}return e.onBeforeMount(()=>{h(),p(v.value),c(v.value)}),()=>e.createVNode("div",{class:T.value?`f-verify-detail ${b.value}`:""},[T.value?e.createVNode("div",{class:"f-verify-detail-content"},[S.value,e.createVNode("div",{class:"f-verify-form-main",hidden:!s.value},[e.createVNode("div",{class:"f-verify-form-content"},[e.createVNode("div",{class:"f-verify-form-content-arrow"},null),e.createVNode("div",{class:"f-verify-form-content-list"},[e.createVNode("div",{class:"f-verify-forms-title"},[e.createVNode("div",{class:"btn-group"},[M.value]),e.createVNode("div",{class:"f-verify-close",onClick:g},[e.createVNode("span",{class:"f-icon f-icon-close"},null)])]),e.createVNode("div",{class:"f-verify-forms-list",style:{maxHeight:o.value+"px"}},[O()])])])])]):null])}});function x(i,t,l){e.createApp({setup(){return e.onUnmounted(()=>{t&&t()}),()=>e.createVNode(E,i,null)}}).mount(l)}class R{static show(t,l){this.clear();let s=0;this.verifyContainer=document.createElement("div"),l?(s=l.offsetHeight-110,l.appendChild(this.verifyContainer)):(s=document.documentElement.clientHeight-110,document.body.appendChild(this.verifyContainer)),t.maxHeight=t.maxHeight?t.maxHeight:s,x(t,this.clear,this.verifyContainer)}static clear(){let t=this.verifyContainer;t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}q(R,"verifyContainer",null);function I(i,t,l){var S;const s="",o="",y=e.ref();function v(){return(t==null?void 0:t.schema.componentType)!=="frame"}function u(){return!1}function b(){return(t==null?void 0:t.schema.componentType)!=="frame"}function a(){return(t==null?void 0:t.schema.componentType)==="frame"}function c(h){if(!h||!h.value)return null;if(h.value.schema&&h.value.schema.type==="component")return h.value;const n=e.ref(h==null?void 0:h.value.parent),f=c(n);return f||null}function p(h=t){const{componentInstance:n,designerItemElementRef:f}=h;return!n||!n.value?null:n.value.canMove?f:p(h.parent)}function d(h){return!!l}function g(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function V(){}function L(h,n){}function O(h,n){const{componentType:f}=h;let r=F(f,h,n);const m=f.toLowerCase().replace(/-/g,"_");return r&&!r.id&&r.type===f&&(r.id=`${m}_${Math.random().toString().slice(2,6)}`),r}function T(h){}function k(...h){}function M(){t!=null&&t.schema.contents&&t.schema.contents.map(h=>{var r;let n=h.id;h.type==="component-ref"&&(n=h.component);const f=i.value.querySelector(`#${n}-design-item`);(r=f==null?void 0:f.componentInstance)!=null&&r.value.onRemoveComponent&&f.componentInstance.value.onRemoveComponent()})}return y.value={canMove:v(),canSelectParent:u(),canDelete:b(),canNested:!a(),contents:t==null?void 0:t.schema.contents,elementRef:i,parent:(S=t==null?void 0:t.parent)==null?void 0:S.componentInstance,schema:t==null?void 0:t.schema,styles:s,designerClass:o,canAccepts:d,getBelongedComponentInstance:c,getDraggableDesignItemElement:p,getDraggingDisplayText:g,getPropConfig:k,getDragScopeElement:V,onAcceptMovedChildElement:L,onChildElementMovedOut:T,addNewChildComponentSchema:O,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1),onRemoveComponent:M},y}const ee=e.defineComponent({name:"FVerifyDetailDesign",props:P,emits:["validatorClick","listshow"],setup(i,t){let l=[];const s=e.ref(i.showList),o=e.ref(i.maxHeight),y=e.ref(i.verifyList),v=e.ref(i.showType),u=e.ref(i.verifyType),b=e.ref(),a=e.inject("design-item-context"),c=I(b,a);e.onMounted(()=>{b.value.componentInstance=c}),t.expose(c.value);function p(){s.value=!s.value,t.emit("listshow",s.value)}function d(r){var m;(m=u.value)==null||m.forEach(w=>{w.active=w.type===r})}function g(r){l.forEach(m=>{m.show=m.type===r})}function V(r){r.length<=0||(d(r.type),g(r.type))}function L(){s.value=!1,t.emit("listshow",!1)}function O(r){t.emit("validatorClick",r)}function T(r){return e.createVNode("li",{class:"f-verify-list",onClick:()=>O(r)},[e.createVNode("span",{class:["f-icon f-icon-close-outline list-icon list-error",{"list-warning":r.type==="warn"}]},null),e.createVNode("div",{class:"list-con"},[e.createVNode("p",{class:"list-title",title:r.title},[r.title]),e.createVNode("p",{class:"list-msg",title:r.msg},[r.msg])])])}function k(){return l.map(r=>e.createVNode("ul",{class:["f-verify-list-content",{active:r.show}]},[r.list&&r.list.map(m=>T(m))]))}const M=e.computed(()=>{var r;return((r=y.value)==null?void 0:r.length)>0});function S(r){return{"btn btn-secondary":!0,active:r.active,disabled:r.length<=0}}const h=e.computed(()=>{var r;return(r=u.value)==null?void 0:r.map(m=>e.createVNode("button",{class:S(m),onClick:()=>V(m)},[m.title,e.createVNode("span",null,[m.length])]))}),n=e.computed(()=>{var r;return e.createVNode("div",{class:"f-verify-nums",onClick:p},[e.createVNode("span",{class:"nums-icon f-icon f-icon-warning"},null),e.createVNode("span",{class:"nums-count"},[(r=y.value)==null?void 0:r.length])])});function f(){var m;const r=[];u.value&&((m=u.value)!=null&&m.length)&&(u.value.map(w=>{const D={list:w.type==="all"?y.value:[],show:!1,type:w.type};r.push(D)}),r.map((w,D)=>{const ne=y.value.filter(re=>re.type===w.type);r[D].list=D!==0?ne:r[D].list}),u.value.map((w,D)=>{w.length=r[D].list.length})),l=r}return e.onBeforeMount(()=>{f(),g(v.value),d(v.value)}),()=>e.createVNode("div",{ref:b},[M.value?e.createVNode("div",{class:"f-verify-detail"},[e.createVNode("div",{class:"f-verify-detail-content"},[n.value,e.createVNode("div",{class:"f-verify-form-main",hidden:!s.value},[e.createVNode("div",{class:"f-verify-form-content"},[e.createVNode("div",{class:"f-verify-form-content-arrow"},null),e.createVNode("div",{class:"f-verify-form-content-list"},[e.createVNode("div",{class:"f-verify-forms-title"},[e.createVNode("div",{class:"btn-group"},[h.value]),e.createVNode("div",{class:"f-verify-close",onClick:L},[e.createVNode("span",{class:"f-icon f-icon-close"},null)])]),e.createVNode("div",{class:"f-verify-forms-list",style:{maxHeight:o.value+"px"}},[k()])])])])])]):null])}}),te={install(i){i.component(E.name,E),i.provide("FVerifyDetailService",R)},register(i,t,l,s){i["verify-detail"]=E,t["verify-detail"]=H},registerDesigner(i,t,l){i["verify-detail"]=ee,t["verify-detail"]=H}};N.FVerifyDetail=E,N.FVerifyDetailService=R,N.default=te,N.propsResolver=H,N.verifyDetailProps=P,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(N,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],t):(N=typeof globalThis<"u"?globalThis:N||self,t(N["verify-detail"]={},N.Vue,N.LodashES))})(this,function(N,t,T){"use strict";var se=Object.defineProperty;var ae=(N,t,T)=>t in N?se(N,t,{enumerable:!0,configurable:!0,writable:!0,value:T}):N[t]=T;var _=(N,t,T)=>ae(N,typeof t!="symbol"?t+"":t,T);const H={},B={};function E(i){const{properties:e,title:a,ignore:s}=i,l=s&&Array.isArray(s),c=Object.keys(e).reduce((y,p)=>((!l||!s.find(b=>b===p))&&(y[p]=e[p].type==="object"&&e[p].properties?E(e[p]):T.cloneDeep(e[p].default)),y),{});if(a&&(!l||!s.find(y=>y==="id"))){const y=a.toLowerCase().replace(/-/g,"_");c.id=`${y}_${Math.random().toString().slice(2,6)}`}return c}function F(i){const{properties:e,title:a,required:s}=i;if(s&&Array.isArray(s)){const l=s.reduce((c,y)=>(c[y]=e[y].type==="object"&&e[y].properties?E(e[y]):T.cloneDeep(e[y].default),c),{});if(a&&s.find(c=>c==="id")){const c=a.toLowerCase().replace(/-/g,"_");l.id=`${c}_${Math.random().toString().slice(2,6)}`}return l}return{type:a}}function q(i,e={},a){const s=H[i];if(s){let l=F(s);const c=B[i];return l=c?c({getSchemaByType:q},l,e,a):l,l}return null}function C(i,e){const a=E(e);return Object.keys(a).reduce((s,l)=>(Object.prototype.hasOwnProperty.call(i,l)&&(s[l]&&T.isPlainObject(s[l])&&T.isPlainObject(i[l]||!i[l])?Object.assign(s[l],i[l]||{}):s[l]=i[l]),s),a),a}function W(i,e){return Object.keys(i).filter(s=>i[s]!=null).reduce((s,l)=>{if(e.has(l)){const c=e.get(l);if(typeof c=="string")s[c]=i[l];else{const y=c(l,i[l],i);Object.assign(s,y)}}else s[l]=i[l];return s},{})}function U(i,e,a=new Map){const s=C(i,e);return W(s,a)}function z(i={}){function e(o,f,d,h){if(typeof d=="number")return h[o].length===d;if(typeof d=="object"){const g=Object.keys(d)[0],V=d[g];if(g==="not")return Number(h[o].length)!==Number(V);if(g==="moreThan")return Number(h[o].length)>=Number(V);if(g==="lessThan")return Number(h[o].length)<=Number(V)}return!1}function a(o,f,d,h){return h[o]&&h[o].propertyValue&&String(h[o].propertyValue.value)===String(d)}const s=new Map([["length",e],["getProperty",a]]);Object.keys(i).reduce((o,f)=>(o.set(f,i[f]),o),s);function l(o,f){const d=o;return typeof f=="number"?[{target:d,operator:"length",param:null,value:Number(f)}]:typeof f=="boolean"?[{target:d,operator:"getProperty",param:o,value:!!f}]:typeof f=="object"?Object.keys(f).map(h=>{if(h==="length")return{target:d,operator:"length",param:null,value:f[h]};const g=h,V=f[h];return{target:d,operator:"getProperty",param:g,value:V}}):[]}function c(o){return Object.keys(o).reduce((d,h)=>{const g=l(h,o[h]);return d.push(...g),d},[])}function y(o,f){if(s.has(o.operator)){const d=s.get(o.operator);return d&&d(o.target,o.param,o.value,f)||!1}return!1}function p(o,f){return c(o).reduce((g,V)=>g&&y(V,f),!0)}function b(o,f){const d=Object.keys(o),h=d.includes("allOf"),g=d.includes("anyOf"),V=h||g,D=(V?o[V?h?"allOf":"anyOf":"allOf"]:[o]).map(M=>p(M,f));return h?!D.includes(!1):D.includes(!0)}return{parseValueSchema:b}}const G={},J={};z();function Q(i,e,a=new Map,s=(y,p,b,o)=>p,l={},c=y=>y){return H[e.title]=e,B[e.title]=s,G[e.title]=l,J[e.title]=c,(y={})=>{const p=U(y,e,a),b=Object.keys(i).reduce((o,f)=>(o[f]=i[f].default,o),{});return Object.assign(b,p)}}function X(i,e){return{customClass:e.class,customStyle:e.style}}const Y=new Map([["appearance",X]]);function Z(i,e,a){return e}const K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/verify-detail.schema.json",title:"verify-detail",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for verify-detail",type:"string"},type:{description:"The type string of verify-detail",type:"string",default:"verify-detail"},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"]},x={title:"verify-detail",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:[]}}}}}},$={showType:{type:String,default:""},showList:{type:Boolean,default:!1},verifyList:{type:Array,default:[{id:"111",title:"单据信息[销售组织]",msg:"字段值不能为空",type:"empty"},{id:"222",title:"单据信息[销售组织]",msg:"字段值不能为空",type:"empty"}]},verifyType:{type:Array,default:[{id:"vertifyType1",type:"all",title:"全部"},{id:"vertifyType3",type:"empty",title:"值为空"}]},customClass:{type:String,default:""},maxHeight:{type:Number,default:200}},R=Q($,K,Y,Z,x),P=t.defineComponent({name:"FVerifyDetail",props:$,emits:["validatorClick","listshow"],setup(i,e){let a=[];const s=t.ref(i.showList),l=t.ref(i.maxHeight),c=t.ref(i.verifyList),y=t.ref(i.showType),p=t.ref(i.verifyType),b=t.ref(i.customClass);function o(){s.value=!s.value,e.emit("listshow",s.value)}function f(n){var u;!n&&p.value&&p.value.length>0&&(n=p.value[0].type),(u=p.value)==null||u.forEach(r=>{r.active=r.type===n})}function d(n){n=n||a[0].type,a.forEach(u=>{u.show=u.type===n})}function h(n){n.length<=0||(f(n.type),d(n.type))}function g(){s.value=!1,e.emit("listshow",!1)}function V(n){e.emit("validatorClick",n)}function L(n){return t.createVNode("li",{class:"f-verify-list",onClick:()=>V(n)},[t.createVNode("span",{class:["f-icon f-icon-close-outline list-icon list-error",{"list-warning":n.type==="warn"}]},null),t.createVNode("div",{class:"list-con"},[t.createVNode("p",{class:"list-title",title:n.title},[n.title]),t.createVNode("p",{class:"list-msg",title:n.msg},[n.msg])])])}function O(){return a.map(n=>t.createVNode("ul",{class:["f-verify-list-content",{active:n.show}]},[n.list&&n.list.map(u=>L(u))]))}const D=t.computed(()=>{var n;return((n=c.value)==null?void 0:n.length)>0});function S(n){return{btn:!0,"verify-title-btn":!0,"f-state-selected":n.active,disabled:n.length<=0}}const M=t.computed(()=>{var n;return(n=p.value)==null?void 0:n.map(u=>t.createVNode("button",{class:S(u),onClick:()=>h(u)},[u.title,t.createVNode("span",null,[u.length])]))}),k=t.computed(()=>{var n;return t.createVNode("div",{class:"f-verify-nums",onClick:o},[t.createVNode("span",{class:"nums-icon f-icon f-icon-warning"},null),t.createVNode("span",{class:"nums-count"},[(n=c.value)==null?void 0:n.length])])});function m(){var u;const n=[];p.value&&((u=p.value)!=null&&u.length)&&(p.value.map(r=>{const v={list:r.type==="all"?c.value:[],show:!1,type:r.type};n.push(v)}),n.map((r,v)=>{const w=c.value.filter(j=>j.type===r.type);n[v].list=v!==0?w:n[v].list}),p.value.map((r,v)=>{r.length=n[v].list.length})),a=n}return t.onBeforeMount(()=>{m(),d(y.value),f(y.value)}),()=>t.createVNode("div",{class:D.value?`f-verify-detail ${b.value}`:""},[D.value?t.createVNode("div",{class:"f-verify-detail-content"},[k.value,t.createVNode("div",{class:"f-verify-form-main",hidden:!s.value},[t.createVNode("div",{class:"f-verify-form-content"},[t.createVNode("div",{class:"f-verify-form-content-arrow"},null),t.createVNode("div",{class:"f-verify-form-content-list"},[t.createVNode("div",{class:"f-verify-forms-title"},[t.createVNode("div",{class:"btn-group"},[M.value]),t.createVNode("div",{class:"f-verify-close",onClick:g},[t.createVNode("span",{class:"f-icon f-icon-close"},null)])]),t.createVNode("div",{class:"f-verify-forms-list",style:{maxHeight:l.value+"px"}},[O()])])])])]):null])}});function I(i,e,a){t.createApp({setup(){return t.onUnmounted(()=>{e&&e()}),()=>t.createVNode(P,i,null)}}).mount(a)}class A{static show(e,a){this.clear();let s=0;this.verifyContainer=document.createElement("div"),a?(s=a.offsetHeight-110,a.appendChild(this.verifyContainer)):(s=document.documentElement.clientHeight-110,document.body.appendChild(this.verifyContainer)),e.maxHeight=e.maxHeight?e.maxHeight:s,I(e,this.clear,this.verifyContainer)}static clear(){let e=this.verifyContainer;e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}_(A,"verifyContainer",null);function ee(i,e,a){var k;const s="",l="",c=t.ref();function y(){return(e==null?void 0:e.schema.componentType)!=="frame"}function p(){return!1}function b(){return(e==null?void 0:e.schema.componentType)!=="frame"}function o(){return(e==null?void 0:e.schema.componentType)==="frame"}function f(m){if(!m||!m.value)return null;if(m.value.schema&&m.value.schema.type==="component")return m.value;const n=t.ref(m==null?void 0:m.value.parent),u=f(n);return u||null}function d(m=e){const{componentInstance:n,designerItemElementRef:u}=m;return!n||!n.value?null:n.value.canMove?u:d(m.parent)}function h(m){return!!a}function g(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function V(){}function L(m,n){}function O(m,n){const{componentType:u}=m;let r=q(u,m,n);const v=u.toLowerCase().replace(/-/g,"_");return r&&!r.id&&r.type===u&&(r.id=`${v}_${Math.random().toString().slice(2,6)}`),r}function D(m){}function S(...m){}function M(){e!=null&&e.schema.contents&&e.schema.contents.map(m=>{var r;let n=m.id;m.type==="component-ref"&&(n=m.component);const u=i.value.querySelector(`#${n}-design-item`);(r=u==null?void 0:u.componentInstance)!=null&&r.value.onRemoveComponent&&u.componentInstance.value.onRemoveComponent()})}return c.value={canMove:y(),canSelectParent:p(),canDelete:b(),canNested:!o(),contents:e==null?void 0:e.schema.contents,elementRef:i,parent:(k=e==null?void 0:e.parent)==null?void 0:k.componentInstance,schema:e==null?void 0:e.schema,styles:s,designerClass:l,canAccepts:h,getBelongedComponentInstance:f,getDraggableDesignItemElement:d,getDraggingDisplayText:g,getPropConfig:S,getDragScopeElement:V,onAcceptMovedChildElement:L,onChildElementMovedOut:D,addNewChildComponentSchema:O,triggerBelongedComponentToMoveWhenMoved:t.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:t.ref(!1),onRemoveComponent:M},c}const te=t.defineComponent({name:"FVerifyDetailDesign",props:$,emits:["validatorClick","listshow"],setup(i,e){let a=[];const s=t.ref(i.showList),l=t.ref(i.maxHeight),c=t.ref(i.verifyList),y=t.ref(i.showType),p=t.ref(i.verifyType),b=t.ref(),o=t.inject("design-item-context"),f=ee(b,o);t.onMounted(()=>{b.value.componentInstance=f}),e.expose(f.value);function d(){s.value=!s.value,e.emit("listshow",s.value)}function h(r){var v;(v=p.value)==null||v.forEach(w=>{w.active=w.type===r})}function g(r){a.forEach(v=>{v.show=v.type===r})}function V(r){r.length<=0||(h(r.type),g(r.type))}function L(){s.value=!1,e.emit("listshow",!1)}function O(r){e.emit("validatorClick",r)}function D(r){return t.createVNode("li",{class:"f-verify-list",onClick:()=>O(r)},[t.createVNode("span",{class:["f-icon f-icon-close-outline list-icon list-error",{"list-warning":r.type==="warn"}]},null),t.createVNode("div",{class:"list-con"},[t.createVNode("p",{class:"list-title",title:r.title},[r.title]),t.createVNode("p",{class:"list-msg",title:r.msg},[r.msg])])])}function S(){return a.map(r=>t.createVNode("ul",{class:["f-verify-list-content",{active:r.show}]},[r.list&&r.list.map(v=>D(v))]))}const M=t.computed(()=>{var r;return((r=c.value)==null?void 0:r.length)>0});function k(r){return{"btn btn-secondary":!0,active:r.active,disabled:r.length<=0}}const m=t.computed(()=>{var r;return(r=p.value)==null?void 0:r.map(v=>t.createVNode("button",{class:k(v),onClick:()=>V(v)},[v.title,t.createVNode("span",null,[v.length])]))}),n=t.computed(()=>{var r;return t.createVNode("div",{class:"f-verify-nums",onClick:d},[t.createVNode("span",{class:"nums-icon f-icon f-icon-warning"},null),t.createVNode("span",{class:"nums-count"},[(r=c.value)==null?void 0:r.length])])});function u(){var v;const r=[];p.value&&((v=p.value)!=null&&v.length)&&(p.value.map(w=>{const j={list:w.type==="all"?c.value:[],show:!1,type:w.type};r.push(j)}),r.map((w,j)=>{const re=c.value.filter(ie=>ie.type===w.type);r[j].list=j!==0?re:r[j].list}),p.value.map((w,j)=>{w.length=r[j].list.length})),a=r}return t.onBeforeMount(()=>{u(),g(y.value),h(y.value)}),()=>t.createVNode("div",{ref:b},[M.value?t.createVNode("div",{class:"f-verify-detail"},[t.createVNode("div",{class:"f-verify-detail-content"},[n.value,t.createVNode("div",{class:"f-verify-form-main",hidden:!s.value},[t.createVNode("div",{class:"f-verify-form-content"},[t.createVNode("div",{class:"f-verify-form-content-arrow"},null),t.createVNode("div",{class:"f-verify-form-content-list"},[t.createVNode("div",{class:"f-verify-forms-title"},[t.createVNode("div",{class:"btn-group"},[m.value]),t.createVNode("div",{class:"f-verify-close",onClick:L},[t.createVNode("span",{class:"f-icon f-icon-close"},null)])]),t.createVNode("div",{class:"f-verify-forms-list",style:{maxHeight:l.value+"px"}},[S()])])])])])]):null])}}),ne={install(i){i.component(P.name,P),i.provide("FVerifyDetailService",A)},register(i,e,a,s){i["verify-detail"]=P,e["verify-detail"]=R},registerDesigner(i,e,a){i["verify-detail"]=te,e["verify-detail"]=R}};N.FVerifyDetail=P,N.FVerifyDetailService=A,N.default=ne,N.propsResolver=R,N.verifyDetailProps=$,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,31 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var z = (o, e, t) => e in o ?
|
|
1
|
+
var W = Object.defineProperty;
|
|
2
|
+
var z = (o, e, t) => e in o ? W(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
3
|
var V = (o, e, t) => z(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { isPlainObject as N, cloneDeep as
|
|
4
|
+
import { defineComponent as S, ref as E, onUnmounted as $, createVNode as k, createTextVNode as R, watch as Y, inject as O, onMounted as Q } from "vue";
|
|
5
|
+
import { isPlainObject as N, cloneDeep as U } from "lodash-es";
|
|
6
6
|
const q = {}, G = {};
|
|
7
|
-
function
|
|
8
|
-
const { properties: e, title: t, ignore: n } = o, r = n && Array.isArray(n), i = Object.keys(e).reduce((a, f) => ((!r || !n.find((h) => h === f)) && (a[f] = e[f].type === "object" && e[f].properties ?
|
|
7
|
+
function A(o) {
|
|
8
|
+
const { properties: e, title: t, ignore: n } = o, r = n && Array.isArray(n), i = Object.keys(e).reduce((a, f) => ((!r || !n.find((h) => h === f)) && (a[f] = e[f].type === "object" && e[f].properties ? A(e[f]) : U(e[f].default)), a), {});
|
|
9
9
|
if (t && (!r || !n.find((a) => a === "id"))) {
|
|
10
10
|
const a = t.toLowerCase().replace(/-/g, "_");
|
|
11
11
|
i.id = `${a}_${Math.random().toString().slice(2, 6)}`;
|
|
12
12
|
}
|
|
13
13
|
return i;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function J(o) {
|
|
16
|
+
const { properties: e, title: t, required: n } = o;
|
|
17
|
+
if (n && Array.isArray(n)) {
|
|
18
|
+
const r = n.reduce((i, a) => (i[a] = e[a].type === "object" && e[a].properties ? A(e[a]) : U(e[a].default), i), {});
|
|
19
|
+
if (t && n.find((i) => i === "id")) {
|
|
20
|
+
const i = t.toLowerCase().replace(/-/g, "_");
|
|
21
|
+
r.id = `${i}_${Math.random().toString().slice(2, 6)}`;
|
|
22
|
+
}
|
|
23
|
+
return r;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
type: t
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function _(o, e = {}, t) {
|
|
16
30
|
const n = q[o];
|
|
17
31
|
if (n) {
|
|
18
|
-
let r =
|
|
32
|
+
let r = J(n);
|
|
19
33
|
const i = G[o];
|
|
20
|
-
return r = i ? i({ getSchemaByType:
|
|
34
|
+
return r = i ? i({ getSchemaByType: _ }, r, e, t) : r, r;
|
|
21
35
|
}
|
|
22
36
|
return null;
|
|
23
37
|
}
|
|
24
|
-
function J(o, e) {
|
|
25
|
-
const t = U(e);
|
|
26
|
-
return Object.keys(t).reduce((n, r) => (n[r] && N(n[r]) && N(o[r] || !o[r]) ? Object.assign(n[r], o[r] || {}) : n[r] = o[r], n), t), t;
|
|
27
|
-
}
|
|
28
38
|
function X(o, e) {
|
|
39
|
+
const t = A(e);
|
|
40
|
+
return Object.keys(t).reduce((n, r) => (Object.prototype.hasOwnProperty.call(o, r) && (n[r] && N(n[r]) && N(o[r] || !o[r]) ? Object.assign(n[r], o[r] || {}) : n[r] = o[r]), n), t), t;
|
|
41
|
+
}
|
|
42
|
+
function Z(o, e) {
|
|
29
43
|
return Object.keys(o).filter((n) => o[n] != null).reduce((n, r) => {
|
|
30
44
|
if (e.has(r)) {
|
|
31
45
|
const i = e.get(r);
|
|
@@ -40,9 +54,9 @@ function X(o, e) {
|
|
|
40
54
|
return n;
|
|
41
55
|
}, {});
|
|
42
56
|
}
|
|
43
|
-
function
|
|
44
|
-
const n =
|
|
45
|
-
return
|
|
57
|
+
function I(o, e, t = /* @__PURE__ */ new Map()) {
|
|
58
|
+
const n = X(o, e);
|
|
59
|
+
return Z(n, t);
|
|
46
60
|
}
|
|
47
61
|
function K(o = {}) {
|
|
48
62
|
function e(c, p, u, d) {
|
|
@@ -98,7 +112,7 @@ function K(o = {}) {
|
|
|
98
112
|
}
|
|
99
113
|
return { parseValueSchema: h };
|
|
100
114
|
}
|
|
101
|
-
const
|
|
115
|
+
const H = {
|
|
102
116
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
103
117
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
104
118
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -138,18 +152,18 @@ const I = {
|
|
|
138
152
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
139
153
|
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
|
|
140
154
|
"query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
|
|
141
|
-
},
|
|
155
|
+
}, x = {}, ee = {};
|
|
142
156
|
K();
|
|
143
|
-
function
|
|
144
|
-
return q[e.title] = e, G[e.title] = n,
|
|
145
|
-
const f =
|
|
157
|
+
function te(o, e, t = /* @__PURE__ */ new Map(), n = (a, f, h, c) => f, r = {}, i = (a) => a) {
|
|
158
|
+
return q[e.title] = e, G[e.title] = n, x[e.title] = r, ee[e.title] = i, (a = {}) => {
|
|
159
|
+
const f = I(a, e, t), h = Object.keys(o).reduce((c, p) => (c[p] = o[p].default, c), {});
|
|
146
160
|
return Object.assign(h, f);
|
|
147
161
|
};
|
|
148
162
|
}
|
|
149
|
-
function
|
|
163
|
+
function oe(o, e) {
|
|
150
164
|
return { customClass: e.class, customStyle: e.style };
|
|
151
165
|
}
|
|
152
|
-
const
|
|
166
|
+
const ne = "https://json-schema.org/draft/2020-12/schema", ae = "https://farris-design.gitee.io/video.schema.json", re = "video", ie = "A Farris Video Component", ce = "object", se = {
|
|
153
167
|
id: {
|
|
154
168
|
description: "The unique identifier for a Video",
|
|
155
169
|
type: "string"
|
|
@@ -177,24 +191,24 @@ const oe = "https://json-schema.org/draft/2020-12/schema", ne = "https://farris-
|
|
|
177
191
|
type: "boolean",
|
|
178
192
|
default: !0
|
|
179
193
|
}
|
|
180
|
-
},
|
|
194
|
+
}, le = [
|
|
181
195
|
"id",
|
|
182
196
|
"type"
|
|
183
|
-
],
|
|
184
|
-
$schema:
|
|
185
|
-
$id:
|
|
186
|
-
title:
|
|
187
|
-
description:
|
|
188
|
-
type:
|
|
189
|
-
properties:
|
|
190
|
-
required:
|
|
191
|
-
},
|
|
192
|
-
["appearance",
|
|
197
|
+
], pe = {
|
|
198
|
+
$schema: ne,
|
|
199
|
+
$id: ae,
|
|
200
|
+
title: re,
|
|
201
|
+
description: ie,
|
|
202
|
+
type: ce,
|
|
203
|
+
properties: se,
|
|
204
|
+
required: le
|
|
205
|
+
}, ue = /* @__PURE__ */ new Map([
|
|
206
|
+
["appearance", oe]
|
|
193
207
|
]);
|
|
194
|
-
function
|
|
208
|
+
function de(o, e, t) {
|
|
195
209
|
return e;
|
|
196
210
|
}
|
|
197
|
-
const
|
|
211
|
+
const fe = "verify-detail", me = "A Farris Component", he = "object", ye = {
|
|
198
212
|
basic: {
|
|
199
213
|
description: "Basic Infomation",
|
|
200
214
|
title: "基本信息",
|
|
@@ -216,12 +230,12 @@ const de = "verify-detail", fe = "A Farris Component", me = "object", he = {
|
|
|
216
230
|
}
|
|
217
231
|
}
|
|
218
232
|
}
|
|
219
|
-
},
|
|
220
|
-
title:
|
|
221
|
-
description:
|
|
222
|
-
type:
|
|
223
|
-
categories:
|
|
224
|
-
},
|
|
233
|
+
}, ge = {
|
|
234
|
+
title: fe,
|
|
235
|
+
description: me,
|
|
236
|
+
type: he,
|
|
237
|
+
categories: ye
|
|
238
|
+
}, F = {
|
|
225
239
|
src: {
|
|
226
240
|
type: String,
|
|
227
241
|
required: !0,
|
|
@@ -258,8 +272,8 @@ const de = "verify-detail", fe = "A Farris Component", me = "object", he = {
|
|
|
258
272
|
type: [String, Number],
|
|
259
273
|
default: 168
|
|
260
274
|
}
|
|
261
|
-
},
|
|
262
|
-
function
|
|
275
|
+
}, j = te(F, pe, ue, de, ge);
|
|
276
|
+
function ve(o, e) {
|
|
263
277
|
function t(s) {
|
|
264
278
|
s.stopPropagation(), e.emit("abort");
|
|
265
279
|
}
|
|
@@ -319,12 +333,12 @@ function ge(o, e) {
|
|
|
319
333
|
onCanplay: g
|
|
320
334
|
};
|
|
321
335
|
}
|
|
322
|
-
const B = /* @__PURE__ */
|
|
336
|
+
const B = /* @__PURE__ */ S({
|
|
323
337
|
name: "FVideo",
|
|
324
|
-
props:
|
|
338
|
+
props: F,
|
|
325
339
|
emits: ["abort", "play", "pause", "ended", "durationchange", "canplay", "error", "loadeddata", "loadedmetadata", "loadstart", "playing", "progress", "timeupdate", "volumechange"],
|
|
326
340
|
setup(o, e) {
|
|
327
|
-
const t =
|
|
341
|
+
const t = E(), {
|
|
328
342
|
onAbort: n,
|
|
329
343
|
onPlay: r,
|
|
330
344
|
onPause: i,
|
|
@@ -339,7 +353,7 @@ const B = /* @__PURE__ */ j({
|
|
|
339
353
|
onTimeupdate: v,
|
|
340
354
|
onVolumechange: g,
|
|
341
355
|
onCanplay: s
|
|
342
|
-
} =
|
|
356
|
+
} = ve(o, e);
|
|
343
357
|
return $(() => {
|
|
344
358
|
}), () => k("video", {
|
|
345
359
|
ref: t,
|
|
@@ -365,12 +379,12 @@ const B = /* @__PURE__ */ j({
|
|
|
365
379
|
onTimeupdate: (l) => v(l),
|
|
366
380
|
onVolumechange: (l) => g(l),
|
|
367
381
|
onCanplay: (l) => s(l)
|
|
368
|
-
}, [
|
|
382
|
+
}, [R("Your browser does not support the video tag.")]);
|
|
369
383
|
}
|
|
370
384
|
});
|
|
371
|
-
function
|
|
372
|
-
var
|
|
373
|
-
const n = t && t.getStyles && t.getStyles() || "", r = t && t.getDesignerClass && t.getDesignerClass() || "", i =
|
|
385
|
+
function be(o, e, t) {
|
|
386
|
+
var D;
|
|
387
|
+
const n = t && t.getStyles && t.getStyles() || "", r = t && t.getDesignerClass && t.getDesignerClass() || "", i = E();
|
|
374
388
|
function a() {
|
|
375
389
|
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : t && t.checkCanMoveComponent ? t.checkCanMoveComponent() : !0;
|
|
376
390
|
}
|
|
@@ -388,7 +402,7 @@ function ve(o, e, t) {
|
|
|
388
402
|
return null;
|
|
389
403
|
if (m.value.schema && m.value.schema.type === "component")
|
|
390
404
|
return m.value;
|
|
391
|
-
const w =
|
|
405
|
+
const w = E(m == null ? void 0 : m.value.parent), M = p(w);
|
|
392
406
|
return M || null;
|
|
393
407
|
}
|
|
394
408
|
function u(m = e) {
|
|
@@ -408,10 +422,10 @@ function ve(o, e, t) {
|
|
|
408
422
|
}
|
|
409
423
|
function s(m, w) {
|
|
410
424
|
const { componentType: M } = m;
|
|
411
|
-
let P =
|
|
425
|
+
let P = _(M, m, w);
|
|
412
426
|
t && t.onResolveNewComponentSchema && (P = t.onResolveNewComponentSchema(m, P));
|
|
413
|
-
const
|
|
414
|
-
return P && !P.id && P.type === M && (P.id = `${
|
|
427
|
+
const T = M.toLowerCase().replace(/-/g, "_");
|
|
428
|
+
return P && !P.id && P.type === M && (P.id = `${T}_${Math.random().toString().slice(2, 6)}`), P;
|
|
415
429
|
}
|
|
416
430
|
function l(m) {
|
|
417
431
|
}
|
|
@@ -435,7 +449,7 @@ function ve(o, e, t) {
|
|
|
435
449
|
canNested: !c(),
|
|
436
450
|
contents: e == null ? void 0 : e.schema.contents,
|
|
437
451
|
elementRef: o,
|
|
438
|
-
parent: (
|
|
452
|
+
parent: (D = e == null ? void 0 : e.parent) == null ? void 0 : D.componentInstance,
|
|
439
453
|
schema: e == null ? void 0 : e.schema,
|
|
440
454
|
styles: n,
|
|
441
455
|
designerClass: r,
|
|
@@ -448,12 +462,12 @@ function ve(o, e, t) {
|
|
|
448
462
|
onAcceptMovedChildElement: g,
|
|
449
463
|
onChildElementMovedOut: l,
|
|
450
464
|
addNewChildComponentSchema: s,
|
|
451
|
-
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved ||
|
|
452
|
-
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted ||
|
|
465
|
+
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || E(!1),
|
|
466
|
+
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || E(!1),
|
|
453
467
|
onRemoveComponent: C
|
|
454
468
|
}, i;
|
|
455
469
|
}
|
|
456
|
-
class
|
|
470
|
+
class Me {
|
|
457
471
|
getTemplateRule(e, t) {
|
|
458
472
|
const n = t == null ? void 0 : t.formSchemaUtils, r = n == null ? void 0 : n.getFormTemplateRule(), i = { canAccept: !0, canDelete: !0, canMove: !0 };
|
|
459
473
|
if (!r)
|
|
@@ -545,7 +559,7 @@ class be {
|
|
|
545
559
|
};
|
|
546
560
|
}
|
|
547
561
|
}
|
|
548
|
-
class
|
|
562
|
+
class we {
|
|
549
563
|
constructor(e, t) {
|
|
550
564
|
V(this, "componentId");
|
|
551
565
|
V(this, "viewModelId");
|
|
@@ -601,7 +615,7 @@ class Me {
|
|
|
601
615
|
type: "combo-list",
|
|
602
616
|
textField: "name",
|
|
603
617
|
valueField: "value",
|
|
604
|
-
data: [{ value: e.type, name:
|
|
618
|
+
data: [{ value: e.type, name: H[e.type].name }]
|
|
605
619
|
}
|
|
606
620
|
}
|
|
607
621
|
}
|
|
@@ -637,11 +651,11 @@ class Me {
|
|
|
637
651
|
const n = t && t.parent && t.parent.schema;
|
|
638
652
|
if (!n)
|
|
639
653
|
return;
|
|
640
|
-
const r = n.contents.findIndex((a) => a.id === e), i =
|
|
654
|
+
const r = n.contents.findIndex((a) => a.id === e), i = U(n.contents[r]);
|
|
641
655
|
n.contents.splice(r, 1), n.contents.splice(r, 0, i);
|
|
642
656
|
}
|
|
643
657
|
}
|
|
644
|
-
class
|
|
658
|
+
class Pe extends we {
|
|
645
659
|
constructor(e, t) {
|
|
646
660
|
super(e, t);
|
|
647
661
|
}
|
|
@@ -679,8 +693,8 @@ class we extends Me {
|
|
|
679
693
|
};
|
|
680
694
|
}
|
|
681
695
|
}
|
|
682
|
-
function
|
|
683
|
-
const t = new
|
|
696
|
+
function Ve(o, e) {
|
|
697
|
+
const t = new Me(), { canMove: n, canDelete: r } = t.getTemplateRule(o, e);
|
|
684
698
|
function i() {
|
|
685
699
|
return !1;
|
|
686
700
|
}
|
|
@@ -697,18 +711,18 @@ function Pe(o, e) {
|
|
|
697
711
|
return " display: inherit;flex-direction: inherit;margin-bottom:10px";
|
|
698
712
|
}
|
|
699
713
|
function p(g) {
|
|
700
|
-
const s = new
|
|
714
|
+
const s = new Pe(g, e), { schema: l } = o;
|
|
701
715
|
return s.getPropertyConfig(l);
|
|
702
716
|
}
|
|
703
717
|
function u() {
|
|
704
|
-
var C,
|
|
718
|
+
var C, D, m, w;
|
|
705
719
|
const g = o == null ? void 0 : o.schema, l = (e == null ? void 0 : e.formSchemaUtils).getViewModelIdByComponentId(g.id);
|
|
706
720
|
if (g.componentType !== "data-grid" && g.componentType !== "form" || !((C = o.componentInstance) != null && C.value.parent))
|
|
707
721
|
return;
|
|
708
|
-
const b = (
|
|
722
|
+
const b = (D = o.componentInstance) == null ? void 0 : D.value.parent.schema;
|
|
709
723
|
if ((m = b == null ? void 0 : b.toolbar) != null && m.buttons && b.toolbar.buttons.length) {
|
|
710
724
|
b.toolbar.buttons.forEach((P) => {
|
|
711
|
-
const
|
|
725
|
+
const T = P.onClick, L = T && T.split(".");
|
|
712
726
|
if (!L || L.length < 3)
|
|
713
727
|
return;
|
|
714
728
|
L[L.length - 2] === l && (P.needRemove = !0);
|
|
@@ -728,8 +742,8 @@ function Pe(o, e) {
|
|
|
728
742
|
const g = e == null ? void 0 : e.designViewModelUtils, s = e == null ? void 0 : e.formSchemaUtils, l = o == null ? void 0 : o.schema, b = s.getViewModelIdByComponentId(l.id);
|
|
729
743
|
g.getDgViewModel(b).fields.forEach((C) => {
|
|
730
744
|
if (s.getExpressions() && s.getExpressions().length) {
|
|
731
|
-
const
|
|
732
|
-
|
|
745
|
+
const D = s.getExpressions().findIndex((m) => m.fieldId === C.id);
|
|
746
|
+
D > -1 && s.getExpressions().splice(D, 1);
|
|
733
747
|
}
|
|
734
748
|
});
|
|
735
749
|
}
|
|
@@ -738,8 +752,8 @@ function Pe(o, e) {
|
|
|
738
752
|
}
|
|
739
753
|
return { canAccepts: i, checkCanDeleteComponent: a, checkCanMoveComponent: f, hideNestedPaddingInDesginerView: h, getStyles: c, getPropsConfig: p, onRemoveComponent: v };
|
|
740
754
|
}
|
|
741
|
-
function
|
|
742
|
-
const t =
|
|
755
|
+
function Ce(o, e) {
|
|
756
|
+
const t = E(o.width), n = E(o.height);
|
|
743
757
|
let r;
|
|
744
758
|
Y(e, (a) => {
|
|
745
759
|
a && (t.value = a.clientWidth, r = new ResizeObserver((f) => {
|
|
@@ -758,15 +772,15 @@ function Ve(o, e) {
|
|
|
758
772
|
height: n
|
|
759
773
|
};
|
|
760
774
|
}
|
|
761
|
-
const
|
|
775
|
+
const De = /* @__PURE__ */ S({
|
|
762
776
|
name: "FVideoDesign",
|
|
763
|
-
props:
|
|
777
|
+
props: F,
|
|
764
778
|
setup(o, e) {
|
|
765
|
-
const t =
|
|
779
|
+
const t = E(), n = O("design-item-context"), r = O("designer-host-service"), i = Ve(n, r), a = be(t, n, i), {
|
|
766
780
|
width: f,
|
|
767
781
|
height: h,
|
|
768
782
|
destory: c
|
|
769
|
-
} =
|
|
783
|
+
} = Ce(o, t);
|
|
770
784
|
return Q(() => {
|
|
771
785
|
t.value.componentInstance = a;
|
|
772
786
|
}), $(() => {
|
|
@@ -783,22 +797,22 @@ const Ce = /* @__PURE__ */ j({
|
|
|
783
797
|
muted: o.muted,
|
|
784
798
|
width: f.value,
|
|
785
799
|
height: h.value
|
|
786
|
-
}, [
|
|
800
|
+
}, [R("Your browser does not support the video tag.")])]);
|
|
787
801
|
}
|
|
788
|
-
}),
|
|
802
|
+
}), ke = {
|
|
789
803
|
install(o) {
|
|
790
804
|
o.component(B.name, B);
|
|
791
805
|
},
|
|
792
806
|
register(o, e, t, n) {
|
|
793
|
-
o.video = B, e.video =
|
|
807
|
+
o.video = B, e.video = j;
|
|
794
808
|
},
|
|
795
809
|
registerDesigner(o, e, t) {
|
|
796
|
-
o.video =
|
|
810
|
+
o.video = De, e.video = j;
|
|
797
811
|
}
|
|
798
812
|
};
|
|
799
813
|
export {
|
|
800
814
|
B as FVideo,
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
815
|
+
ke as default,
|
|
816
|
+
j as propsResolver,
|
|
817
|
+
F as videoProps
|
|
804
818
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(M,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],f):(M=typeof globalThis<"u"?globalThis:M||self,f(M.video={},M.Vue,M.LodashES))})(this,function(M,f,D){"use strict";var ie=Object.defineProperty;var ce=(M,f,D)=>f in M?ie(M,f,{enumerable:!0,configurable:!0,writable:!0,value:D}):M[f]=D;var T=(M,f,D)=>ce(M,typeof f!="symbol"?f+"":f,D);const O={},j={};function F(o){const{properties:e,title:t,ignore:n}=o,r=n&&Array.isArray(n),i=Object.keys(e).reduce((a,m)=>((!r||!n.find(y=>y===m))&&(a[m]=e[m].type==="object"&&e[m].properties?F(e[m]):D.cloneDeep(e[m].default)),a),{});if(t&&(!r||!n.find(a=>a==="id"))){const a=t.toLowerCase().replace(/-/g,"_");i.id=`${a}_${Math.random().toString().slice(2,6)}`}return i}function $(o,e={},t){const n=O[o];if(n){let r=F(n);const i=j[o];return r=i?i({getSchemaByType:$},r,e,t):r,r}return null}function S(o,e){const t=F(e);return Object.keys(t).reduce((n,r)=>(n[r]&&D.isPlainObject(n[r])&&D.isPlainObject(o[r]||!o[r])?Object.assign(n[r],o[r]||{}):n[r]=o[r],n),t),t}function R(o,e){return Object.keys(o).filter(n=>o[n]!=null).reduce((n,r)=>{if(e.has(r)){const i=e.get(r);if(typeof i=="string")n[i]=o[r];else{const a=i(r,o[r],o);Object.assign(n,a)}}else n[r]=o[r];return n},{})}function q(o,e,t=new Map){const n=S(o,e);return R(n,t)}function G(o={}){function e(c,p,u,d){if(typeof u=="number")return d[c].length===u;if(typeof u=="object"){const g=Object.keys(u)[0],v=u[g];if(g==="not")return Number(d[c].length)!==Number(v);if(g==="moreThan")return Number(d[c].length)>=Number(v);if(g==="lessThan")return Number(d[c].length)<=Number(v)}return!1}function t(c,p,u,d){return d[c]&&d[c].propertyValue&&String(d[c].propertyValue.value)===String(u)}const n=new Map([["length",e],["getProperty",t]]);Object.keys(o).reduce((c,p)=>(c.set(p,o[p]),c),n);function r(c,p){const u=c;return typeof p=="number"?[{target:u,operator:"length",param:null,value:Number(p)}]:typeof p=="boolean"?[{target:u,operator:"getProperty",param:c,value:!!p}]:typeof p=="object"?Object.keys(p).map(d=>{if(d==="length")return{target:u,operator:"length",param:null,value:p[d]};const g=d,v=p[d];return{target:u,operator:"getProperty",param:g,value:v}}):[]}function i(c){return Object.keys(c).reduce((u,d)=>{const g=r(d,c[d]);return u.push(...g),u},[])}function a(c,p){if(n.has(c.operator)){const u=n.get(c.operator);return u&&u(c.target,c.param,c.value,p)||!1}return!1}function m(c,p){return i(c).reduce((g,v)=>g&&a(v,p),!0)}function y(c,p){const u=Object.keys(c),d=u.includes("allOf"),g=u.includes("anyOf"),v=d||g,l=(v?c[v?d?"allOf":"anyOf":"allOf"]:[c]).map(L=>m(L,p));return d?!l.includes(!1):l.includes(!0)}return{parseValueSchema:y}}const _={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},W={},z={};G();function Y(o,e,t=new Map,n=(a,m,y,c)=>m,r={},i=a=>a){return O[e.title]=e,j[e.title]=n,W[e.title]=r,z[e.title]=i,(a={})=>{const m=q(a,e,t),y=Object.keys(o).reduce((c,p)=>(c[p]=o[p].default,c),{});return Object.assign(y,m)}}function Q(o,e){return{customClass:e.class,customStyle:e.style}}const J={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/video.schema.json",title:"video",description:"A Farris Video Component",type:"object",properties:{id:{description:"The unique identifier for a Video",type:"string"},type:{description:"The type string of Video component",type:"string",default:"video"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},X=new Map([["appearance",Q]]);function Z(o,e,t){return e}const K={title:"verify-detail",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:[]}}}}}},B={src:{type:String,required:!0,default:""},autoplay:{type:Boolean,default:!0},controls:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},muted:{type:Boolean,default:!1},preload:{type:String,default:"none"},poster:{type:String},width:{type:[String,Number],default:300},height:{type:[String,Number],default:168}},N=Y(B,J,X,Z,K);function I(o,e){function t(s){s.stopPropagation(),e.emit("abort")}function n(s){s.stopPropagation(),e.emit("play")}function r(s){s.stopPropagation(),e.emit("pause")}function i(s){s.stopPropagation(),e.emit("ended")}function a(s){s.stopPropagation(),e.emit("durationchange")}function m(s){s.stopPropagation(),e.emit("error")}function y(s){s.stopPropagation(),e.emit("loadeddata")}function c(s){s.stopPropagation(),e.emit("loadedmetadata")}function p(s){s.stopPropagation(),e.emit("loadstart")}function u(s){s.stopPropagation(),e.emit("playing")}function d(s){s.stopPropagation(),e.emit("progress")}function g(s){s.stopPropagation(),e.emit("timeupdate")}function v(s){s.stopPropagation(),e.emit("volumechange")}function b(s){s.stopPropagation(),e.emit("canplay")}return{onAbort:t,onPlay:n,onPause:r,onEnded:i,onDurationchange:a,onError:m,onLoadeddata:y,onLoadedmetadata:c,onLoadstart:p,onPlaying:u,onProgress:d,onTimeupdate:g,onVolumechange:v,onCanplay:b}}const k=f.defineComponent({name:"FVideo",props:B,emits:["abort","play","pause","ended","durationchange","canplay","error","loadeddata","loadedmetadata","loadstart","playing","progress","timeupdate","volumechange"],setup(o,e){const t=f.ref(),{onAbort:n,onPlay:r,onPause:i,onEnded:a,onDurationchange:m,onError:y,onLoadeddata:c,onLoadedmetadata:p,onLoadstart:u,onPlaying:d,onProgress:g,onTimeupdate:v,onVolumechange:b,onCanplay:s}=I(o,e);return f.onUnmounted(()=>{}),()=>f.createVNode("video",{ref:t,src:o.src,autoplay:o.autoplay,controls:o.controls,loop:o.loop,muted:o.muted,width:o.width,height:o.height,poster:o.poster,onAbort:l=>n(l),onPlay:l=>r(l),onPause:l=>i(l),onEnded:l=>a(l),onDurationchange:l=>m(l),onError:l=>y(l),onLoadeddata:l=>c(l),onLoadedmetadata:l=>p(l),onLoadstart:l=>u(l),onPlaying:l=>d(l),onProgress:l=>g(l),onTimeupdate:l=>v(l),onVolumechange:l=>b(l),onCanplay:l=>s(l)},[f.createTextVNode("Your browser does not support the video tag.")])}});function H(o,e,t){var E;const n=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",i=f.ref();function a(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function m(){return!1}function y(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function p(h){if(!h||!h.value)return null;if(h.value.schema&&h.value.schema.type==="component")return h.value;const V=f.ref(h==null?void 0:h.value.parent),w=p(V);return w||null}function u(h=e){const{componentInstance:V,designerItemElementRef:w}=h;return!V||!V.value?null:V.value.canMove?w:u(h.parent)}function d(h){return!!t&&t.canAccepts(h)}function g(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function v(){}function b(h,V){V&&t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(V)}function s(h,V){const{componentType:w}=h;let C=$(w,h,V);t&&t.onResolveNewComponentSchema&&(C=t.onResolveNewComponentSchema(h,C));const U=w.toLowerCase().replace(/-/g,"_");return C&&!C.id&&C.type===w&&(C.id=`${U}_${Math.random().toString().slice(2,6)}`),C}function l(h){}function P(...h){if(t&&t.getPropsConfig)return t.getPropsConfig(...h)}function L(){t&&t.onRemoveComponent&&t.onRemoveComponent(),e!=null&&e.schema.contents&&e.schema.contents.map(h=>{var C;let V=h.id;h.type==="component-ref"&&(V=h.component);const w=o.value.querySelector(`#${V}-design-item`);(C=w==null?void 0:w.componentInstance)!=null&&C.value.onRemoveComponent&&w.componentInstance.value.onRemoveComponent()})}return i.value={canMove:a(),canSelectParent:m(),canDelete:y(),canNested:!c(),contents:e==null?void 0:e.schema.contents,elementRef:o,parent:(E=e==null?void 0:e.parent)==null?void 0:E.componentInstance,schema:e==null?void 0:e.schema,styles:n,designerClass:r,canAccepts:d,getBelongedComponentInstance:p,getDraggableDesignItemElement:u,getDraggingDisplayText:g,getPropConfig:P,getDragScopeElement:v,onAcceptMovedChildElement:b,onChildElementMovedOut:l,addNewChildComponentSchema:s,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||f.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||f.ref(!1),onRemoveComponent:L},i}class x{getTemplateRule(e,t){const n=t==null?void 0:t.formSchemaUtils,r=n==null?void 0:n.getFormTemplateRule(),i={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return i;const a=this.getComponentContext(e),{componentClassList:m}=a;return m.forEach(y=>{if(!y||!r[y])return;const{canMove:c,canDelete:p,canAccept:u}=r[y];i.canMove=i.canMove&&this.resolveRuleValue(c,a),i.canDelete=i.canDelete&&this.resolveRuleValue(p,a),i.canAccept=i.canAccept&&this.resolveRuleValue(u,a)}),i}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const n=e.invalidContext||[];let r=!0;for(const i of n){if(i.firstLevelChild){if(i.firstLevelChild.class){const{firstLevelChildClassList:a}=t;if(a&&!a.includes(i.firstLevelChild.class)){r=!1;continue}}if(i.firstLevelChild.type){const{firstLevelChildSchema:a}=t;if(!a||a.type!==i.firstLevelChild.type){r=!1;continue}}}if(i.secondLevelChild){if(i.secondLevelChild.class){const{secondLevelChildClassList:a}=t;if(a&&!a.includes(i.secondLevelChild.class)){r=!1;continue}}if(i.secondLevelChild.type){const{secondLevelChildSchema:a}=t;if(!a||a.type!==i.secondLevelChild.type){r=!1;continue}}}if(i.parent){if(i.parent.class){const{parentClassList:a}=t;if(a&&!a.includes(i.parent.class)){r=!1;continue}}if(i.parent.type){const{parentSchema:a}=t;if(a&&a.type!==i.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(e){var b,s,l,P;const t=e.schema,n=t.appearance&&t.appearance.class||"",r=n.split(" ")||[],i=t.contents||[],a=i.length?i[0]:null,m=a&&a.appearance?a.appearance.class:"",y=m?m.split(" "):[],c=(b=a==null?void 0:a.contents)!=null&&b.length?a==null?void 0:a.contents[0]:null,p=c&&c.appearance?c.appearance.class:"",u=p?p.split(" "):[],d=t.type==="component"?(l=(s=e.parent)==null?void 0:s.parent)==null?void 0:l.schema:(P=e.parent)==null?void 0:P.schema,g=d&&d.appearance&&d.appearance.class||"",v=g?g.split(" "):[];return{componentClass:n,componentClassList:r,childContents:i,firstLevelChildSchema:a,firstLevelChildClass:m,firstLevelChildClassList:y,secondLevelChildSchema:c,secondLevelChildClass:p,secondLevelChildClassList:u,parentSchema:d,parentClass:g,parentClassList:v}}}class ee{constructor(e,t){T(this,"componentId");T(this,"viewModelId");T(this,"eventsEditorUtils");T(this,"formSchemaUtils");T(this,"formMetadataConverter");T(this,"designViewModelUtils");T(this,"designViewModelField");T(this,"controlCreatorUtils");T(this,"designerHostService");T(this,"schemaService",null);T(this,"metadataService",null);T(this,"propertyConfig",{type:"object",categories:{}});var n;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((n=this.formSchemaUtils)==null?void 0:n.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var n;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(i=>i.id===t)}e.updateOn=(n=this.designViewModelField)==null?void 0:n.updateOn}}changeFieldEditorType(e,t){}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:e.type,name:_[e.type].name}]}}}}}getAppearanceConfig(e=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(e,t){const n=t&&t.parent&&t.parent.schema;if(!n)return;const r=n.contents.findIndex(a=>a.id===e),i=D.cloneDeep(n.contents[r]);n.contents.splice(r,1),n.contents.splice(r,0,i)}}class te extends ee{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearanceConfig(e),this.getEventPropConfig(e),this.propertyConfig}getEventPropConfig(e){const t=[{label:"onInit",name:"初始化事件"},{label:"onAfterViewInit",name:"视图初始化后事件"}],n=this,r=n.eventsEditorUtils.formProperties(e,n.viewModelId,t),i={};i[n.viewModelId]={type:"events-editor",editor:{initialData:r}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:i,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(a,m){const y=a.propertyValue;delete e[n.viewModelId],y&&(y.setPropertyRelates=this.setPropertyRelates,n.eventsEditorUtils.saveRelatedParameters(e,n.viewModelId,y.events,y))}}}}function oe(o,e){const t=new x,{canMove:n,canDelete:r}=t.getTemplateRule(o,e);function i(){return!1}function a(){return r}function m(){return n}function y(){return!1}function c(){return" display: inherit;flex-direction: inherit;margin-bottom:10px"}function p(b){const s=new te(b,e),{schema:l}=o;return s.getPropertyConfig(l)}function u(){var L,E,h,V;const b=o==null?void 0:o.schema,l=(e==null?void 0:e.formSchemaUtils).getViewModelIdByComponentId(b.id);if(b.componentType!=="data-grid"&&b.componentType!=="form"||!((L=o.componentInstance)!=null&&L.value.parent))return;const P=(E=o.componentInstance)==null?void 0:E.value.parent.schema;if((h=P==null?void 0:P.toolbar)!=null&&h.buttons&&P.toolbar.buttons.length){P.toolbar.buttons.forEach(C=>{const U=C.onClick,A=U&&U.split(".");if(!A||A.length<3)return;A[A.length-2]===l&&(C.needRemove=!0)}),P.toolbar.buttons=P.toolbar.buttons.filter(C=>!C.needRemove);const w=(V=o.componentInstance)==null?void 0:V.value.parent;w.parent&&w.parent.updateToolbarItems&&w.parent.updateToolbarItems()}}function d(){const b=e==null?void 0:e.designViewModelUtils,s=e==null?void 0:e.formSchemaUtils,l=o==null?void 0:o.schema;if(b&&s){const P=s.getViewModelIdByComponentId(l.id);b.deleteViewModelById(P),s.deleteComponent(l.id)}}function g(){const b=e==null?void 0:e.designViewModelUtils,s=e==null?void 0:e.formSchemaUtils,l=o==null?void 0:o.schema,P=s.getViewModelIdByComponentId(l.id);b.getDgViewModel(P).fields.forEach(L=>{if(s.getExpressions()&&s.getExpressions().length){const E=s.getExpressions().findIndex(h=>h.fieldId===L.id);E>-1&&s.getExpressions().splice(E,1)}})}function v(){u(),g(),d()}return{canAccepts:i,checkCanDeleteComponent:a,checkCanMoveComponent:m,hideNestedPaddingInDesginerView:y,getStyles:c,getPropsConfig:p,onRemoveComponent:v}}function ne(o,e){const t=f.ref(o.width),n=f.ref(o.height);let r;f.watch(e,a=>{a&&(t.value=a.clientWidth,r=new ResizeObserver(m=>{if(!m||m.length<1)return;const c=m[0].contentRect;c&&(t.value=c.width)}),r.observe(a))});function i(){r&&r.disconnect()}return{destory:i,width:t,height:n}}const ae=f.defineComponent({name:"FVideoDesign",props:B,setup(o,e){const t=f.ref(),n=f.inject("design-item-context"),r=f.inject("designer-host-service"),i=oe(n,r),a=H(t,n,i),{width:m,height:y,destory:c}=ne(o,t);return f.onMounted(()=>{t.value.componentInstance=a}),f.onUnmounted(()=>{c()}),e.expose(a.value),()=>f.createVNode("div",{ref:t,class:"drag-container","data-dragref":`${n.schema.id}-container`},[f.createVNode("video",{src:o.src,autoplay:o.autoplay,controls:o.controls,loop:o.loop,muted:o.muted,width:m.value,height:y.value},[f.createTextVNode("Your browser does not support the video tag.")])])}}),re={install(o){o.component(k.name,k)},register(o,e,t,n){o.video=k,e.video=N},registerDesigner(o,e,t){o.video=ae,e.video=N}};M.FVideo=k,M.default=re,M.propsResolver=N,M.videoProps=B,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(M,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],f):(M=typeof globalThis<"u"?globalThis:M||self,f(M.video={},M.Vue,M.LodashES))})(this,function(M,f,D){"use strict";var ce=Object.defineProperty;var se=(M,f,D)=>f in M?ce(M,f,{enumerable:!0,configurable:!0,writable:!0,value:D}):M[f]=D;var T=(M,f,D)=>se(M,typeof f!="symbol"?f+"":f,D);const O={},$={};function F(o){const{properties:e,title:t,ignore:n}=o,r=n&&Array.isArray(n),i=Object.keys(e).reduce((a,m)=>((!r||!n.find(y=>y===m))&&(a[m]=e[m].type==="object"&&e[m].properties?F(e[m]):D.cloneDeep(e[m].default)),a),{});if(t&&(!r||!n.find(a=>a==="id"))){const a=t.toLowerCase().replace(/-/g,"_");i.id=`${a}_${Math.random().toString().slice(2,6)}`}return i}function S(o){const{properties:e,title:t,required:n}=o;if(n&&Array.isArray(n)){const r=n.reduce((i,a)=>(i[a]=e[a].type==="object"&&e[a].properties?F(e[a]):D.cloneDeep(e[a].default),i),{});if(t&&n.find(i=>i==="id")){const i=t.toLowerCase().replace(/-/g,"_");r.id=`${i}_${Math.random().toString().slice(2,6)}`}return r}return{type:t}}function j(o,e={},t){const n=O[o];if(n){let r=S(n);const i=$[o];return r=i?i({getSchemaByType:j},r,e,t):r,r}return null}function R(o,e){const t=F(e);return Object.keys(t).reduce((n,r)=>(Object.prototype.hasOwnProperty.call(o,r)&&(n[r]&&D.isPlainObject(n[r])&&D.isPlainObject(o[r]||!o[r])?Object.assign(n[r],o[r]||{}):n[r]=o[r]),n),t),t}function q(o,e){return Object.keys(o).filter(n=>o[n]!=null).reduce((n,r)=>{if(e.has(r)){const i=e.get(r);if(typeof i=="string")n[i]=o[r];else{const a=i(r,o[r],o);Object.assign(n,a)}}else n[r]=o[r];return n},{})}function _(o,e,t=new Map){const n=R(o,e);return q(n,t)}function G(o={}){function e(c,p,u,d){if(typeof u=="number")return d[c].length===u;if(typeof u=="object"){const g=Object.keys(u)[0],v=u[g];if(g==="not")return Number(d[c].length)!==Number(v);if(g==="moreThan")return Number(d[c].length)>=Number(v);if(g==="lessThan")return Number(d[c].length)<=Number(v)}return!1}function t(c,p,u,d){return d[c]&&d[c].propertyValue&&String(d[c].propertyValue.value)===String(u)}const n=new Map([["length",e],["getProperty",t]]);Object.keys(o).reduce((c,p)=>(c.set(p,o[p]),c),n);function r(c,p){const u=c;return typeof p=="number"?[{target:u,operator:"length",param:null,value:Number(p)}]:typeof p=="boolean"?[{target:u,operator:"getProperty",param:c,value:!!p}]:typeof p=="object"?Object.keys(p).map(d=>{if(d==="length")return{target:u,operator:"length",param:null,value:p[d]};const g=d,v=p[d];return{target:u,operator:"getProperty",param:g,value:v}}):[]}function i(c){return Object.keys(c).reduce((u,d)=>{const g=r(d,c[d]);return u.push(...g),u},[])}function a(c,p){if(n.has(c.operator)){const u=n.get(c.operator);return u&&u(c.target,c.param,c.value,p)||!1}return!1}function m(c,p){return i(c).reduce((g,v)=>g&&a(v,p),!0)}function y(c,p){const u=Object.keys(c),d=u.includes("allOf"),g=u.includes("anyOf"),v=d||g,l=(v?c[v?d?"allOf":"anyOf":"allOf"]:[c]).map(L=>m(L,p));return d?!l.includes(!1):l.includes(!0)}return{parseValueSchema:y}}const W={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},z={},Y={};G();function Q(o,e,t=new Map,n=(a,m,y,c)=>m,r={},i=a=>a){return O[e.title]=e,$[e.title]=n,z[e.title]=r,Y[e.title]=i,(a={})=>{const m=_(a,e,t),y=Object.keys(o).reduce((c,p)=>(c[p]=o[p].default,c),{});return Object.assign(y,m)}}function J(o,e){return{customClass:e.class,customStyle:e.style}}const X={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/video.schema.json",title:"video",description:"A Farris Video Component",type:"object",properties:{id:{description:"The unique identifier for a Video",type:"string"},type:{description:"The type string of Video component",type:"string",default:"video"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},Z=new Map([["appearance",J]]);function I(o,e,t){return e}const K={title:"verify-detail",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:[]}}}}}},B={src:{type:String,required:!0,default:""},autoplay:{type:Boolean,default:!0},controls:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},muted:{type:Boolean,default:!1},preload:{type:String,default:"none"},poster:{type:String},width:{type:[String,Number],default:300},height:{type:[String,Number],default:168}},N=Q(B,X,Z,I,K);function H(o,e){function t(s){s.stopPropagation(),e.emit("abort")}function n(s){s.stopPropagation(),e.emit("play")}function r(s){s.stopPropagation(),e.emit("pause")}function i(s){s.stopPropagation(),e.emit("ended")}function a(s){s.stopPropagation(),e.emit("durationchange")}function m(s){s.stopPropagation(),e.emit("error")}function y(s){s.stopPropagation(),e.emit("loadeddata")}function c(s){s.stopPropagation(),e.emit("loadedmetadata")}function p(s){s.stopPropagation(),e.emit("loadstart")}function u(s){s.stopPropagation(),e.emit("playing")}function d(s){s.stopPropagation(),e.emit("progress")}function g(s){s.stopPropagation(),e.emit("timeupdate")}function v(s){s.stopPropagation(),e.emit("volumechange")}function b(s){s.stopPropagation(),e.emit("canplay")}return{onAbort:t,onPlay:n,onPause:r,onEnded:i,onDurationchange:a,onError:m,onLoadeddata:y,onLoadedmetadata:c,onLoadstart:p,onPlaying:u,onProgress:d,onTimeupdate:g,onVolumechange:v,onCanplay:b}}const k=f.defineComponent({name:"FVideo",props:B,emits:["abort","play","pause","ended","durationchange","canplay","error","loadeddata","loadedmetadata","loadstart","playing","progress","timeupdate","volumechange"],setup(o,e){const t=f.ref(),{onAbort:n,onPlay:r,onPause:i,onEnded:a,onDurationchange:m,onError:y,onLoadeddata:c,onLoadedmetadata:p,onLoadstart:u,onPlaying:d,onProgress:g,onTimeupdate:v,onVolumechange:b,onCanplay:s}=H(o,e);return f.onUnmounted(()=>{}),()=>f.createVNode("video",{ref:t,src:o.src,autoplay:o.autoplay,controls:o.controls,loop:o.loop,muted:o.muted,width:o.width,height:o.height,poster:o.poster,onAbort:l=>n(l),onPlay:l=>r(l),onPause:l=>i(l),onEnded:l=>a(l),onDurationchange:l=>m(l),onError:l=>y(l),onLoadeddata:l=>c(l),onLoadedmetadata:l=>p(l),onLoadstart:l=>u(l),onPlaying:l=>d(l),onProgress:l=>g(l),onTimeupdate:l=>v(l),onVolumechange:l=>b(l),onCanplay:l=>s(l)},[f.createTextVNode("Your browser does not support the video tag.")])}});function x(o,e,t){var E;const n=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",i=f.ref();function a(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function m(){return!1}function y(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function p(h){if(!h||!h.value)return null;if(h.value.schema&&h.value.schema.type==="component")return h.value;const V=f.ref(h==null?void 0:h.value.parent),w=p(V);return w||null}function u(h=e){const{componentInstance:V,designerItemElementRef:w}=h;return!V||!V.value?null:V.value.canMove?w:u(h.parent)}function d(h){return!!t&&t.canAccepts(h)}function g(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function v(){}function b(h,V){V&&t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(V)}function s(h,V){const{componentType:w}=h;let C=j(w,h,V);t&&t.onResolveNewComponentSchema&&(C=t.onResolveNewComponentSchema(h,C));const U=w.toLowerCase().replace(/-/g,"_");return C&&!C.id&&C.type===w&&(C.id=`${U}_${Math.random().toString().slice(2,6)}`),C}function l(h){}function P(...h){if(t&&t.getPropsConfig)return t.getPropsConfig(...h)}function L(){t&&t.onRemoveComponent&&t.onRemoveComponent(),e!=null&&e.schema.contents&&e.schema.contents.map(h=>{var C;let V=h.id;h.type==="component-ref"&&(V=h.component);const w=o.value.querySelector(`#${V}-design-item`);(C=w==null?void 0:w.componentInstance)!=null&&C.value.onRemoveComponent&&w.componentInstance.value.onRemoveComponent()})}return i.value={canMove:a(),canSelectParent:m(),canDelete:y(),canNested:!c(),contents:e==null?void 0:e.schema.contents,elementRef:o,parent:(E=e==null?void 0:e.parent)==null?void 0:E.componentInstance,schema:e==null?void 0:e.schema,styles:n,designerClass:r,canAccepts:d,getBelongedComponentInstance:p,getDraggableDesignItemElement:u,getDraggingDisplayText:g,getPropConfig:P,getDragScopeElement:v,onAcceptMovedChildElement:b,onChildElementMovedOut:l,addNewChildComponentSchema:s,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||f.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||f.ref(!1),onRemoveComponent:L},i}class ee{getTemplateRule(e,t){const n=t==null?void 0:t.formSchemaUtils,r=n==null?void 0:n.getFormTemplateRule(),i={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return i;const a=this.getComponentContext(e),{componentClassList:m}=a;return m.forEach(y=>{if(!y||!r[y])return;const{canMove:c,canDelete:p,canAccept:u}=r[y];i.canMove=i.canMove&&this.resolveRuleValue(c,a),i.canDelete=i.canDelete&&this.resolveRuleValue(p,a),i.canAccept=i.canAccept&&this.resolveRuleValue(u,a)}),i}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const n=e.invalidContext||[];let r=!0;for(const i of n){if(i.firstLevelChild){if(i.firstLevelChild.class){const{firstLevelChildClassList:a}=t;if(a&&!a.includes(i.firstLevelChild.class)){r=!1;continue}}if(i.firstLevelChild.type){const{firstLevelChildSchema:a}=t;if(!a||a.type!==i.firstLevelChild.type){r=!1;continue}}}if(i.secondLevelChild){if(i.secondLevelChild.class){const{secondLevelChildClassList:a}=t;if(a&&!a.includes(i.secondLevelChild.class)){r=!1;continue}}if(i.secondLevelChild.type){const{secondLevelChildSchema:a}=t;if(!a||a.type!==i.secondLevelChild.type){r=!1;continue}}}if(i.parent){if(i.parent.class){const{parentClassList:a}=t;if(a&&!a.includes(i.parent.class)){r=!1;continue}}if(i.parent.type){const{parentSchema:a}=t;if(a&&a.type!==i.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(e){var b,s,l,P;const t=e.schema,n=t.appearance&&t.appearance.class||"",r=n.split(" ")||[],i=t.contents||[],a=i.length?i[0]:null,m=a&&a.appearance?a.appearance.class:"",y=m?m.split(" "):[],c=(b=a==null?void 0:a.contents)!=null&&b.length?a==null?void 0:a.contents[0]:null,p=c&&c.appearance?c.appearance.class:"",u=p?p.split(" "):[],d=t.type==="component"?(l=(s=e.parent)==null?void 0:s.parent)==null?void 0:l.schema:(P=e.parent)==null?void 0:P.schema,g=d&&d.appearance&&d.appearance.class||"",v=g?g.split(" "):[];return{componentClass:n,componentClassList:r,childContents:i,firstLevelChildSchema:a,firstLevelChildClass:m,firstLevelChildClassList:y,secondLevelChildSchema:c,secondLevelChildClass:p,secondLevelChildClassList:u,parentSchema:d,parentClass:g,parentClassList:v}}}class te{constructor(e,t){T(this,"componentId");T(this,"viewModelId");T(this,"eventsEditorUtils");T(this,"formSchemaUtils");T(this,"formMetadataConverter");T(this,"designViewModelUtils");T(this,"designViewModelField");T(this,"controlCreatorUtils");T(this,"designerHostService");T(this,"schemaService",null);T(this,"metadataService",null);T(this,"propertyConfig",{type:"object",categories:{}});var n;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((n=this.formSchemaUtils)==null?void 0:n.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var n;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(i=>i.id===t)}e.updateOn=(n=this.designViewModelField)==null?void 0:n.updateOn}}changeFieldEditorType(e,t){}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:e.type,name:W[e.type].name}]}}}}}getAppearanceConfig(e=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(e,t){const n=t&&t.parent&&t.parent.schema;if(!n)return;const r=n.contents.findIndex(a=>a.id===e),i=D.cloneDeep(n.contents[r]);n.contents.splice(r,1),n.contents.splice(r,0,i)}}class oe extends te{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearanceConfig(e),this.getEventPropConfig(e),this.propertyConfig}getEventPropConfig(e){const t=[{label:"onInit",name:"初始化事件"},{label:"onAfterViewInit",name:"视图初始化后事件"}],n=this,r=n.eventsEditorUtils.formProperties(e,n.viewModelId,t),i={};i[n.viewModelId]={type:"events-editor",editor:{initialData:r}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:i,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(a,m){const y=a.propertyValue;delete e[n.viewModelId],y&&(y.setPropertyRelates=this.setPropertyRelates,n.eventsEditorUtils.saveRelatedParameters(e,n.viewModelId,y.events,y))}}}}function ne(o,e){const t=new ee,{canMove:n,canDelete:r}=t.getTemplateRule(o,e);function i(){return!1}function a(){return r}function m(){return n}function y(){return!1}function c(){return" display: inherit;flex-direction: inherit;margin-bottom:10px"}function p(b){const s=new oe(b,e),{schema:l}=o;return s.getPropertyConfig(l)}function u(){var L,E,h,V;const b=o==null?void 0:o.schema,l=(e==null?void 0:e.formSchemaUtils).getViewModelIdByComponentId(b.id);if(b.componentType!=="data-grid"&&b.componentType!=="form"||!((L=o.componentInstance)!=null&&L.value.parent))return;const P=(E=o.componentInstance)==null?void 0:E.value.parent.schema;if((h=P==null?void 0:P.toolbar)!=null&&h.buttons&&P.toolbar.buttons.length){P.toolbar.buttons.forEach(C=>{const U=C.onClick,A=U&&U.split(".");if(!A||A.length<3)return;A[A.length-2]===l&&(C.needRemove=!0)}),P.toolbar.buttons=P.toolbar.buttons.filter(C=>!C.needRemove);const w=(V=o.componentInstance)==null?void 0:V.value.parent;w.parent&&w.parent.updateToolbarItems&&w.parent.updateToolbarItems()}}function d(){const b=e==null?void 0:e.designViewModelUtils,s=e==null?void 0:e.formSchemaUtils,l=o==null?void 0:o.schema;if(b&&s){const P=s.getViewModelIdByComponentId(l.id);b.deleteViewModelById(P),s.deleteComponent(l.id)}}function g(){const b=e==null?void 0:e.designViewModelUtils,s=e==null?void 0:e.formSchemaUtils,l=o==null?void 0:o.schema,P=s.getViewModelIdByComponentId(l.id);b.getDgViewModel(P).fields.forEach(L=>{if(s.getExpressions()&&s.getExpressions().length){const E=s.getExpressions().findIndex(h=>h.fieldId===L.id);E>-1&&s.getExpressions().splice(E,1)}})}function v(){u(),g(),d()}return{canAccepts:i,checkCanDeleteComponent:a,checkCanMoveComponent:m,hideNestedPaddingInDesginerView:y,getStyles:c,getPropsConfig:p,onRemoveComponent:v}}function ae(o,e){const t=f.ref(o.width),n=f.ref(o.height);let r;f.watch(e,a=>{a&&(t.value=a.clientWidth,r=new ResizeObserver(m=>{if(!m||m.length<1)return;const c=m[0].contentRect;c&&(t.value=c.width)}),r.observe(a))});function i(){r&&r.disconnect()}return{destory:i,width:t,height:n}}const re=f.defineComponent({name:"FVideoDesign",props:B,setup(o,e){const t=f.ref(),n=f.inject("design-item-context"),r=f.inject("designer-host-service"),i=ne(n,r),a=x(t,n,i),{width:m,height:y,destory:c}=ae(o,t);return f.onMounted(()=>{t.value.componentInstance=a}),f.onUnmounted(()=>{c()}),e.expose(a.value),()=>f.createVNode("div",{ref:t,class:"drag-container","data-dragref":`${n.schema.id}-container`},[f.createVNode("video",{src:o.src,autoplay:o.autoplay,controls:o.controls,loop:o.loop,muted:o.muted,width:m.value,height:y.value},[f.createTextVNode("Your browser does not support the video tag.")])])}}),ie={install(o){o.component(k.name,k)},register(o,e,t,n){o.video=k,e.video=N},registerDesigner(o,e,t){o.video=re,e.video=N}};M.FVideo=k,M.default=ie,M.propsResolver=N,M.videoProps=B,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|