@farris/ui-vue 1.2.4 → 1.2.5
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 +58 -58
- package/components/accordion/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +1 -1
- package/components/capsule/index.umd.cjs +1 -1
- package/components/common/index.esm.js +2 -2
- package/components/common/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +137 -135
- package/components/condition/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +2316 -2299
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +1929 -1920
- package/components/data-view/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +1 -1
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-canvas/style.css +1 -1
- package/components/designer-outline/index.esm.js +44 -42
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/designer-toolbox/index.esm.js +28 -467
- package/components/designer-toolbox/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +836 -790
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +382 -378
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +1167 -1150
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +131 -127
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +1 -1
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/flow-canvas/style.css +1 -1
- package/components/list-view/index.esm.js +128 -124
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +2156 -2139
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +3137 -3120
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +511 -469
- package/components/nav/index.umd.cjs +2 -2
- package/components/order/index.esm.js +859 -815
- package/components/order/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +491 -449
- package/components/pagination/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +75 -73
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +63 -61
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +2002 -1956
- package/components/schema-selector/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +165 -192
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +2 -2
- package/components/tabs/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +95 -93
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +2316 -2299
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +296 -295
- package/components/tree-view/index.umd.cjs +1 -1
- package/farris.all.esm.js +2517 -2483
- package/farris.all.umd.cjs +7 -7
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/condition/index.d.ts +60 -1
- package/types/data-view/components/column-setting/column-setting.component.d.ts +2 -1
- package/types/data-view/composition/types.d.ts +2 -0
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +3 -3
- package/types/list-view/src/composition/types.d.ts +1 -1
- package/types/message-box/index.d.ts +84 -1
- package/types/notify/index.d.ts +84 -1
- package/types/tree-grid/src/schema/column-resolver.d.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("@farris/ui-vue/components/common")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","@farris/ui-vue/components/common"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.pagination={},k.Vue,k.LodashES,k.common))})(this,function(k,e,te,ne){"use strict";const J={},Q={};function G(o){const{properties:t,title:n}=o,p=Object.keys(t).reduce((s,g)=>(s[g]=t[g].type==="object"&&t[g].properties?G(t[g]):te.cloneDeep(t[g].default),s),{});return p.id=`${n}-${Date.now()}`,p}function E(o,t={}){const n=J[o];if(n){let p=G(n);const s=Q[o];return p=s?s({getSchemaByType:E},p,t):p,p}return null}function oe(o,t){const n=G(t);return Object.keys(o).reduce((p,s)=>(p[s]=o[s],p),n),n}function ae(o,t){return Object.keys(o).filter(p=>o[p]!=null).reduce((p,s)=>{if(t.has(s)){const g=t.get(s);if(typeof g=="string")p[g]=o[s];else{const a=g(s,o[s],o);Object.assign(p,a)}}else p[s]=o[s];return p},{})}function re(o,t,n=new Map){const p=oe(o,t);return ae(p,n)}function se(o={}){function t(f,h,N,b){if(typeof N=="number")return b[f].length===N;if(typeof N=="object"){const v=Object.keys(N)[0],i=N[v];if(v==="not")return Number(b[f].length)!==Number(i);if(v==="moreThan")return Number(b[f].length)>=Number(i);if(v==="lessThan")return Number(b[f].length)<=Number(i)}return!1}function n(f,h,N,b){return b[f]&&b[f].propertyValue&&String(b[f].propertyValue.value)===String(N)}const p=new Map([["length",t],["getProperty",n]]);Object.keys(o).reduce((f,h)=>(f.set(h,o[h]),f),p);function s(f,h){const N=f;return typeof h=="number"?[{target:N,operator:"length",param:null,value:Number(h)}]:typeof h=="boolean"?[{target:N,operator:"getProperty",param:f,value:!!h}]:typeof h=="object"?Object.keys(h).map(b=>{if(b==="length")return{target:N,operator:"length",param:null,value:h[b]};const v=b,i=h[b];return{target:N,operator:"getProperty",param:v,value:i}}):[]}function g(f){return Object.keys(f).reduce((N,b)=>{const v=s(b,f[b]);return N.push(...v),N},[])}function a(f,h){if(p.has(f.operator)){const N=p.get(f.operator);return N&&N(f.target,f.param,f.value,h)||!1}return!1}function r(f,h){return g(f).reduce((v,i)=>v&&a(i,h),!0)}function l(f,h){const N=Object.keys(f),b=N.includes("allOf"),v=N.includes("anyOf"),i=b||v,m=(i?f[i?b?"allOf":"anyOf":"allOf"]:[f]).map(d=>r(d,h));return b?!m.includes(!1):m.includes(!0)}return{parseValueSchema:l}}const ce={},le={};se();function ie(o,t,n=new Map,p=(a,r,l)=>r,s={},g=a=>a){return J[t.title]=t,Q[t.title]=p,ce[t.title]=s,le[t.title]=g,(a={})=>{const r=re(a,t,n),l=Object.keys(o).reduce((f,h)=>(f[h]=o[h].default,f),{});return Object.assign(l,r)}}function pe(o,t){return{customClass:t.class,customStyle:t.style}}const ue=new Map([["appearance",pe]]),fe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/pagination.schema.json",title:"pagination",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a pagination",type:"string"},type:{description:"The type string of pagination component",type:"string",default:"pagination"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]},de={title:"pagination",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:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{editable:{description:"",title:"允许编辑",type:"boolean"},readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"},textAlign:{description:"",title:"对齐方式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"left",name:"左对齐"},{value:"center",name:"居中对齐"},{value:"right",name:"右对齐"}]}}}}}};function ge(o,t,n){return t}const z={currentPage:{type:Number,default:1},mode:{type:String,default:"default"},pageSize:{type:Number,default:20},totalItems:{type:Number,default:0},showPageList:{type:Boolean,default:!0},showPageNumbers:{type:Boolean,default:!0},showRedirection:{type:Boolean,default:!0},pageList:{type:Array,default:[20,50,100]}},W=ie(z,fe,ue,ge,de);function U(o,t){const n=e.ref("跳转至"),p=e.ref(""),s=e.ref(o.value);e.watch(s,(l,f)=>{l>=1&&l<=t.value?o.value=l:s.value=f}),e.watch(o,l=>{s.value!==l&&(s.value=l)});function g(l){s.value=l.target.valueAsNumber}function a(l){l.key==="Enter"&&(s.value=l.target.valueAsNumber)}function r(){return e.createVNode("li",{class:"page-goto-input d-flex flex-row",style:"padding-left: 10px; white-space: nowrap;"},[e.createVNode("span",{class:"pg-message-text"},[n.value]),e.createVNode("input",{type:"number",class:"form-control farris-gotopagenumber",value:s.value,min:"1",max:t.value,style:"display: inline-block;margin-left:3px;",onBlur:l=>g(l),onKeyup:l=>a(l)},null),p.value])}return{renderGotoButton:r}}function X(o,t,n){const p=e.computed(()=>({"page-item":!0,disabled:t.value}));function s(l){o.value=o.value<n.value?o.value+1:n.value}function g(l){o.value=n.value}function a(){return e.createVNode("li",{class:p.value},[!t.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:l=>s()},[e.createVNode("span",{class:"f-icon f-page-next"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-next"},null)])])}function r(){return e.createVNode("li",{class:p.value},[!t.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:l=>g()},[e.createVNode("span",{class:"f-icon f-page-last"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-last"},null)])])}return{renderLastPage:r,renderNextPage:a}}function Y(o,t){const n=e.ref("共"),p=e.ref("条"),s=e.computed(()=>({"pagination-message":!0,"text-truncate":!0,"d-flex":!0,"ml-auto":o.value==="right","flex-fill":o.value==="right"}));function g(){return e.createVNode("li",{class:s.value},[e.createVNode("div",{class:"text-truncate",style:"line-height: 26px"},[e.createVNode("span",{class:"pg-message-text"},[n.value]),e.createVNode("b",{class:"pg-message-total"},[t.value]),e.createVNode("span",{class:"pg-message-text"},[p.value])])])}return{renderPageInfo:g}}function Z(o,t,n,p){const s=e.ref(!1),g=e.ref("显示"),a=e.ref("条"),r=e.computed(()=>({dropup:!0,"dropdown-right":!0,"pg-pagelist":!0,"pagelist-disabled":p.value===0,show:s.value})),l=e.computed(()=>({"dropdown-menu":!0,show:s.value})),f=c=>({"w-100":!0,"dropdown-item":!0,active:t.value===c});function h(c){s.value=!0}function N(c){s.value=!1}function b(c,u,m){const d=c*u-u+1;return Math.ceil(d/m)}function v(c,u){o.value=b(o.value,t.value,u),t.value=u,s.value=!1}function i(){return e.createVNode("li",{class:"pagination-pagelist"},[e.createVNode("div",{class:r.value,onMouseenter:c=>h(),onMouseleave:c=>N()},[e.createVNode("div",{class:"pg-pagelist-info"},[e.createVNode("span",{class:"pagelist-text"},[g.value]),e.createVNode("b",{class:"cur-pagesize"},[t.value]),e.createVNode("span",{class:"pagelist-text"},[a.value]),e.createVNode("i",{class:"f-icon f-icon-dropdown"},null)]),e.createVNode("div",{class:l.value,style:"margin-bottom: -1px;"},[n.value.map(c=>e.createVNode("li",{class:f(c),onClick:u=>v(u,c)},[e.createVNode("span",null,[c])]))])])])}return{renderPageList:i}}function I(o,t){const n=a=>({"page-item":!0,current:o.value===a.value,ellipsis:a.label==="..."}),p=a=>({"f-icon":!0,"f-icon-arrow-seek-left":a.value<o.value,"f-icon-arrow-seek-right":a.value>o.value});function s(a,r){o.value=r}function g(){return t.value.map(a=>e.createVNode("li",{class:n(a)},[o.value!==a.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:r=>s(r,a.value)},[e.createVNode("span",{class:"page-link-label"},[a.label]),a.label==="..."&&e.createVNode("i",{class:p(a)},null)]),o.value===a.value&&e.createVNode("span",{class:"page-link"},[a.label])]))}return{renderPageNumbers:g}}function K(o,t,n){const p=e.computed(()=>({"page-item":!0,disabled:t.value}));function s(l){o.value=1}function g(l){o.value=o.value>2?o.value-1:1}function a(){return e.createVNode("li",{class:p.value},[n.value&&e.createVNode("a",{tabindex:"0",class:"page-link",onClick:l=>s()},[e.createVNode("span",{class:"f-icon f-page-first"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-first"},null)])])}function r(){return e.createVNode("li",{class:p.value},[n.value&&e.createVNode("a",{tabindex:"0",class:"page-link",onClick:l=>g()},[e.createVNode("span",{class:"f-icon f-page-pre"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-pre"},null)])])}return{renderFirstPage:a,renderPreviousPage:r}}function R(o){const t=e.ref([]);function n(s,g,a,r){const l=Math.ceil(a/2);return s===a?r:s===1?s:a<r?r-l<g?r-a+s:l<g?g-l+s:s:s}function p(s,g,a,r){const l=[],f=Math.ceil(a/g),h=Math.ceil(r/2),N=s<=h,b=f-h<s,v=!N&&!b,i=r<f;let c=1;for(;c<=f&&c<=r;){const u=n(c,s,r,f),m=c===2&&(v||b),C=c===r-1&&(v||N),d=i&&(m||C)?"...":""+u;l.push({label:d,value:u}),c++}t.value=l}return{pages:t,updatePages:p}}const x=e.defineComponent({name:"FPagination",props:z,emits:["pageIndexChanged","pageSizeChanged","update:currentPage","update:pageSize"],setup(o,t){const n=e.ref(!1),p=e.ref(o.mode),s=e.ref(""),g=e.ref(!1),a=e.ref(o.pageSize),r=e.ref(o.currentPage),l=e.ref(o.totalItems),{pages:f,updatePages:h}=R(),N=e.computed(()=>r.value===1),b=e.computed(()=>o.pageList),v=e.computed(()=>Math.ceil(l.value/a.value)),i=e.computed(()=>r.value===v.value),c=e.computed(()=>o.showGoButton),u=e.computed(()=>r.value>1),m=e.computed(()=>!(g.value&&f.value.length<=1)),C=e.computed(()=>!0),d=e.computed(()=>o.showPageList),w=e.computed(()=>o.showPageNumbers),V=e.computed(()=>!0),{renderFirstPage:y,renderPreviousPage:P}=K(r,N,u),{renderLastPage:j,renderNextPage:T}=X(r,i,v),{renderPageInfo:S}=Y(s,l),{renderPageList:O}=Z(r,a,b,l),{renderPageNumbers:M}=I(r,f),{renderGotoButton:$}=U(r,v);h(r.value,a.value,l.value,7),e.watch(()=>o.totalItems,A=>{l.value=A}),e.watch([r,a,l],()=>{h(r.value,a.value,l.value,7)}),e.watch(r,()=>{t.emit("update:currentPage",r.value),t.emit("pageIndexChanged",r.value)}),e.watch(a,()=>{t.emit("update:pageSize",a.value),t.emit("pageSizeChanged",a.value)}),e.watch(()=>o.totalItems,A=>{l.value=A,h(r.value,a.value,l.value,7)}),e.watchEffect(()=>{const A=b.value.includes(a.value);a.value=A?a.value:b.value[0]})();const B=e.computed(()=>({"ngx-pagination":!0,pagination:!0,responsive:n.value,"pager-viewmode-default":p.value==="default","pager-viewmode-simple":p.value==="simple"})),F=e.computed(()=>({position:"relative","justify-content":s.value==="center"?"center":"start"}));function L(){return e.createVNode(e.Fragment,null,[C.value&&S(),d.value&&O(),V.value&&y(),V.value&&P(),w.value&&M(),V.value&&T(),V.value&&j(),c.value&&$()])}function D(){return e.createVNode(e.Fragment,null,[e.createVNode("li",{class:"page-item d-flex flex-fill"},null),V.value&&y(),V.value&&P(),$(),e.createVNode("li",{class:"page-item page-separator",style:"margin-left: 10px"},[e.createVNode("span",{style:"font-size: 15px; font-weight: 200;"},[e.createTextVNode(" /")])]),e.createVNode("li",{class:"page-item page-total",style:"margin-left: 5px"},[e.createVNode("span",{style:"font-size: 16px; font-weight: 600;"},[e.createTextVNode(" "),v.value])]),V.value&&T(),V.value&&j()])}return()=>e.createVNode("div",{class:"pagination-container"},[m.value&&e.createVNode("ul",{role:"navigation",class:B.value,style:F.value},[p.value==="default"?L():D()])])}});function me(o,t,n){var V;function p(){n!=null&&n.resolveComponentContext&&n.resolveComponentContext()}p();const s=n&&n.getStyles&&n.getStyles()||"",g=n&&n.getDesignerClass&&n.getDesignerClass()||"",a=e.ref();function r(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function l(){return!1}function f(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function h(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function N(y){if(!y||!y.value)return null;if(y.value.schema&&y.value.schema.type==="component")return y.value;const P=e.ref(y==null?void 0:y.value.parent),j=N(P);return j||null}function b(y=t){const{componentInstance:P,designerItemElementRef:j}=y;return!P||!P.value?null:P.value.canMove?j:b(y.parent)}function v(y){return!!n&&n.canAccepts(y)}function i(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function c(){}function u(y,P){P&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(P)}function m(y){const{componentType:P}=y;let j=E(P,y);n&&n.onResolveNewComponentSchema&&(j=n.onResolveNewComponentSchema(y,j));const T=P.toLowerCase().replace("-","_");return j&&!j.id&&j.type===P&&(j.id=`${T}_${Math.random().toString().slice(2,6)}`),j}function C(y,P){const j=String(y.getAttribute("data-controltype")),T=y.getAttribute("data-feature"),S=T?JSON.parse(T):{};S.parentComponentInstance=a.value;let O=E(j,S);n&&n.onAcceptNewChildElement&&(O=n.onAcceptNewChildElement(y,P,O));const M=j.toLowerCase().replace("-","_");return O&&!O.id&&O.type===j&&(O.id=`${M}_${Math.random().toString().slice(2,6)}`),O}function d(y){}function w(...y){if(n&&n.getPropsConfig)return n.getPropsConfig(...y)}return a.value={canMove:r(),canSelectParent:l(),canDelete:f(),canNested:!h(),contents:t==null?void 0:t.schema.contents,elementRef:o,parent:(V=t==null?void 0:t.parent)==null?void 0:V.componentInstance,schema:t==null?void 0:t.schema,styles:s,designerClass:g,canAccepts:v,getBelongedComponentInstance:N,getDraggableDesignItemElement:b,getDraggingDisplayText:i,getPropConfig:w,getDragScopeElement:c,onAcceptMovedChildElement:u,onAcceptNewChildElement:C,onChildElementMovedOut:d,addNewChildComponentSchema:m,updateDragAndDropRules:p,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1)},a}function ye(){function o(t){var s,g;if(!t)return!1;const n=((s=t.targetContainer)==null?void 0:s.componentInstance)&&t.targetContainer.componentInstance.value;if(!n)return!1;const p=(g=n.schema.appearance)==null?void 0:g.class;if(t.controlCategory==="input"||t.controlType==="form-group"){const a=n.schema.type,r=(a==="response-form"||a==="content-container")&&p&&p.includes("farris-form");if(n.schema.type!=="response-layout-item"&&!r)return!1}return t.controlType!=="field-set"}return{basalDragulaRuleForContainer:o}}const he={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}},required:[]},_=new Map;function be(){function o(i,c,u,m){var C;if(typeof u=="number")return((C=m[i])==null?void 0:C.length)===u;if(typeof u=="object"){const d=Object.keys(u)[0],w=u[d];if(d==="not")return Number(m[i].length)!==Number(w);if(d==="moreThan")return Number(m[i].length)>=Number(w);if(d==="lessThan")return Number(m[i].length)<=Number(w)}return!1}function t(i,c,u,m){return typeof u=="boolean"?m.childrenClassList.includes(c)===!!u:!1}function n(i,c,u,m){return typeof u=="boolean"?m.parentClassList.includes(c)===!!u:!1}function p(i,c,u,m){return typeof u=="boolean"?m.parentClassList.includes(c)===!!u:!1}const s=new Map([["length",o],["hasChildren",t],["hasSibling",p],["hasParent",n]]);function g(i,c){const u=i;return typeof c=="number"?[{target:u,operator:"length",param:null,value:Number(c)}]:typeof c=="object"?Object.keys(c).map(m=>{if(m==="length")return{target:u,operator:"length",param:null,value:c[m]};const C=m,d=c[m];return{target:u,operator:i==="children"?"hasChildren":i==="parent"?"hasParent":"hasSibling",param:C,value:d}}):[]}function a(i,c){if(s.has(i.operator)){const u=s.get(i.operator);return u&&u(i.target,i.param,i.value,c)||!1}return!1}function r(i,c){return Object.keys(i).reduce((d,w)=>{const V=g(w,i[w]);return d.push(...V),d},[]).reduce((d,w)=>d&&a(w,c),!0)}function l(i,c){const u=Object.keys(i),m=u.includes("allOf"),C=u.includes("anyOf"),d=m||C,y=(d?i[d?m?"allOf":"anyOf":"allOf"]:[i]).map(j=>r(j,c));return m?!y.includes(!1):y.includes(!0)}function f(i,c){const u=i.const;return u?typeof u=="boolean"?u:typeof u=="object"?l(u,c):!1:!1}function h(i){return c=>{const u={canAccept:!0,fixed:!1,hidePadding:!1};return i&&i.properties&&Object.keys(i.properties).reduce((m,C)=>{const d=i.properties[C];return m[C]=f(d,c),m},u),u}}function N(i,c,u){if(c.type==="object"&&c.properties){const{rules:m,contents:C}=c.properties;u.set(i,h(m)),C&&Object.keys(C.properties).forEach(d=>N(d,C.properties[d],u))}}function b(){const{properties:i}=he;Object.keys(i).forEach(c=>{N(c,i[c],_)})}function v(i,c){const u={canAccept:!0,fixed:!1,hidePadding:!0};return _.has(i)?_.get(i)(c):u}return b(),{getRuleValue:v}}function Ne(o,t){const n=be(),p=e.ref(!1),s=e.ref(!1);let g=!0,a=!1,r,l=!1;function f(d){return r&&r.componentClassList&&r.componentClassList.includes("f-form-layout")&&r.componentClassList.includes("farris-form")?d.sourceType==="control"&&d.controlCategory==="input"||d.sourceType==="move"&&d.controlType==="form-group":!0}function h(d){return!(!ye().basalDragulaRuleForContainer(d)||!g||!f(d))}function N(){p.value=!1,s.value=!1;const d=o,w=d.appearance&&d.appearance.class||"",V=w.split(" "),y=d.contents||[],P=y.length?y[0]:null,j=P&&P.appearance?P.appearance.class:"",T=j?j.split(" "):[],S=y.length?y.reduce((L,D)=>{const A=D&&D.appearance?D.appearance.class:"",H=A?A.split(" "):[];return L.push(...H),L},[]):[],O=t,M=O&&O.appearance&&O.appearance.class||"",$=M?M.split(" "):[];r={componentClass:w,componentClassList:V,childContents:y,firstChildContent:P,firstChildClass:j,firstChildClassList:T,parent:O,parentClass:M,parentClassList:$,children:y,childrenClassList:S};const{canAccept:q,fixed:B,hidePadding:F}=n.getRuleValue(V[0],r);return g=q,a=F,l=B,!0}function b(d){e.nextTick()}function v(){return o.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function i(d,w){const V=o;if((V.appearance&&V.appearance.class||"").split(" ").includes("f-form-layout")){const{label:j}=d,T=E("form-group");return T.editor=w,T.label=j,T}return w}function c(d,w,V){const y=o;if((y.appearance&&y.appearance.class||"").split(" ").includes("f-form-layout")){const T=String(d.innerText),S=E("form-group");return S.editor=V,S.label=T,S}return V}function u(){return!l}function m(){return!l}function C(){return a}return{canAccepts:h,checkCanDeleteComponent:m,checkCanMoveComponent:u,getStyles:v,hideNestedPaddingInDesginerView:C,onAcceptNewChildElement:c,onAcceptMovedChildElement:b,resolveComponentContext:N,onResolveNewComponentSchema:i,triggerBelongedComponentToMoveWhenMoved:p,triggerBelongedComponentToDeleteWhenDeleted:s}}const ve=e.defineComponent({name:"FPagination",props:z,emits:["pageIndexChanged","pageSizeChanged"],setup(o,t){var ee;const n=e.ref(!1),p=e.ref(o.mode),s=e.ref(""),g=e.ref(!1),a=e.ref(o.pageSize),r=e.ref(o.currentPage),l=e.ref(o.totalItems),f=e.ref(),h=e.inject("design-item-context"),N=Ne(h.schema,(ee=h.parent)==null?void 0:ee.schema),b=me(f,h,N);e.onMounted(()=>{f.value.componentInstance=b}),t.expose(b.value);const{pages:v,updatePages:i}=R(),c=e.computed(()=>r.value===1),u=e.computed(()=>[20,50,100]),m=e.computed(()=>Math.ceil(l.value/a.value)),C=e.computed(()=>r.value===m.value),d=e.computed(()=>!0),w=e.computed(()=>r.value>1),V=e.computed(()=>!(g.value&&v.value.length<=1)),y=e.computed(()=>!0),P=e.computed(()=>!0),j=e.computed(()=>!0),T=e.computed(()=>!0),{renderFirstPage:S,renderPreviousPage:O}=K(r,c,w),{renderLastPage:M,renderNextPage:$}=X(r,C,m),{renderPageInfo:q}=Y(s,l),{renderPageList:B}=Z(r,a,u,l),{renderPageNumbers:F}=I(r,v),{renderGotoButton:L}=U(r,m);i(r.value,a.value,l.value,7),e.watch([r,a],()=>{i(r.value,a.value,l.value,7)}),e.watch(r,()=>{t.emit("pageIndexChanged",r.value)}),e.watch(a,()=>{t.emit("pageSizeChanged",a.value)});const D=e.computed(()=>({"ngx-pagination":!0,pagination:!0,responsive:n.value,"pager-viewmode-default":p.value==="default","pager-viewmode-simple":p.value==="simple"})),A=e.computed(()=>({position:"relative","justify-content":s.value==="center"?"center":"start"}));function H(){return e.createVNode(e.Fragment,null,[y.value&&q(),P.value&&B(),T.value&&S(),T.value&&O(),j.value&&F(),T.value&&$(),T.value&&M(),d.value&&L()])}function Pe(){return e.createVNode(e.Fragment,null,[e.createVNode("li",{class:"page-item d-flex flex-fill"},null),T.value&&S(),T.value&&O(),L(),e.createVNode("li",{class:"page-item page-separator",style:"margin-left: 10px"},[e.createVNode("span",{style:"font-size: 15px; font-weight: 200;"},[e.createTextVNode(" /")])]),e.createVNode("li",{class:"page-item page-total",style:"margin-left: 5px"},[e.createVNode("span",{style:"font-size: 16px; font-weight: 600;"},[e.createTextVNode(" "),m.value])]),T.value&&$(),T.value&&M()])}return()=>e.createVNode("div",{ref:f,class:"pagination-container"},[V.value&&e.createVNode("ul",{role:"navigation",class:D.value,style:A.value},[p.value==="default"?H():Pe()])])}});x.register=(o,t,n)=>{o.pagination=x,t.pagination=W},x.registerDesigner=(o,t,n)=>{o.pagination=ve,t.pagination=W};const je=ne.withInstall(x);k.FPagination=x,k.default=je,k.paginationProps=z,k.propsResolver=W,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(M,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("@farris/ui-vue/components/common")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","@farris/ui-vue/components/common"],e):(M=typeof globalThis<"u"?globalThis:M||self,e(M.pagination={},M.Vue,M.LodashES,M.common))})(this,function(M,e,ae,re){"use strict";const X={},Y={};function _(o){const{properties:t,title:n}=o,u=Object.keys(t).reduce((r,m)=>(r[m]=t[m].type==="object"&&t[m].properties?_(t[m]):ae.cloneDeep(t[m].default),r),{});return u.id=`${n}-${Date.now()}`,u}function B(o,t={}){const n=X[o];if(n){let u=_(n);const r=Y[o];return u=r?r({getSchemaByType:B},u,t):u,u}return null}function se(o,t){const n=_(t);return Object.keys(o).reduce((u,r)=>(u[r]=o[r],u),n),n}function ce(o,t){return Object.keys(o).filter(u=>o[u]!=null).reduce((u,r)=>{if(t.has(r)){const m=t.get(r);if(typeof m=="string")u[m]=o[r];else{const a=m(r,o[r],o);Object.assign(u,a)}}else u[r]=o[r];return u},{})}function le(o,t,n=new Map){const u=se(o,t);return ce(u,n)}function ie(o={}){function t(f,g,b,y){if(typeof b=="number")return y[f].length===b;if(typeof b=="object"){const P=Object.keys(b)[0],l=b[P];if(P==="not")return Number(y[f].length)!==Number(l);if(P==="moreThan")return Number(y[f].length)>=Number(l);if(P==="lessThan")return Number(y[f].length)<=Number(l)}return!1}function n(f,g,b,y){return y[f]&&y[f].propertyValue&&String(y[f].propertyValue.value)===String(b)}const u=new Map([["length",t],["getProperty",n]]);Object.keys(o).reduce((f,g)=>(f.set(g,o[g]),f),u);function r(f,g){const b=f;return typeof g=="number"?[{target:b,operator:"length",param:null,value:Number(g)}]:typeof g=="boolean"?[{target:b,operator:"getProperty",param:f,value:!!g}]:typeof g=="object"?Object.keys(g).map(y=>{if(y==="length")return{target:b,operator:"length",param:null,value:g[y]};const P=y,l=g[y];return{target:b,operator:"getProperty",param:P,value:l}}):[]}function m(f){return Object.keys(f).reduce((b,y)=>{const P=r(y,f[y]);return b.push(...P),b},[])}function a(f,g){if(u.has(f.operator)){const b=u.get(f.operator);return b&&b(f.target,f.param,f.value,g)||!1}return!1}function s(f,g){return m(f).reduce((P,l)=>P&&a(l,g),!0)}function i(f,g){const b=Object.keys(f),y=b.includes("allOf"),P=b.includes("anyOf"),l=y||P,h=(l?f[l?y?"allOf":"anyOf":"allOf"]:[f]).map(j=>s(j,g));return y?!h.includes(!1):h.includes(!0)}return{parseValueSchema:i}}const pe={},ue={};ie();function fe(o,t,n=new Map,u=(a,s,i)=>s,r={},m=a=>a){return X[t.title]=t,Y[t.title]=u,pe[t.title]=r,ue[t.title]=m,(a={})=>{const s=le(a,t,n),i=Object.keys(o).reduce((f,g)=>(f[g]=o[g].default,f),{});return Object.assign(i,s)}}function de(o,t){return{customClass:t.class,customStyle:t.style}}const me=new Map([["appearance",de]]),ge={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/pagination.schema.json",title:"pagination",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a pagination",type:"string"},type:{description:"The type string of pagination component",type:"string",default:"pagination"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]},he={title:"pagination",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:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{editable:{description:"",title:"允许编辑",type:"boolean"},readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"},textAlign:{description:"",title:"对齐方式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"left",name:"左对齐"},{value:"center",name:"居中对齐"},{value:"right",name:"右对齐"}]}}}}}};function ye(o,t,n){return t}const G={currentPage:{type:Number,default:1},mode:{type:String,default:"default"},pageSize:{type:Number,default:20},totalItems:{type:Number,default:0},showPageList:{type:Boolean,default:!0},showPageNumbers:{type:Boolean,default:!0},showRedirection:{type:Boolean,default:!0},pageList:{type:Array,default:[20,50,100]}},H=fe(G,ge,me,ye,he);function Z(o,t){const n=e.ref("跳转至"),u=e.ref(""),r=e.ref(o.value);e.watch(r,(i,f)=>{i>=1&&i<=t.value?o.value=i:r.value=f}),e.watch(o,i=>{r.value!==i&&(r.value=i)});function m(i){r.value=i.target.valueAsNumber}function a(i){i.key==="Enter"&&(r.value=i.target.valueAsNumber)}function s(){return e.createVNode("li",{class:"page-goto-input d-flex flex-row",style:"padding-left: 10px; white-space: nowrap;"},[e.createVNode("span",{class:"pg-message-text"},[n.value]),e.createVNode("input",{type:"number",class:"form-control farris-gotopagenumber",value:r.value,min:"1",max:t.value,style:"display: inline-block;margin-left:3px;",onBlur:i=>m(i),onKeyup:i=>a(i)},null),u.value])}return{renderGotoButton:s}}function I(o,t,n){const u=e.computed(()=>({"page-item":!0,disabled:t.value}));function r(i){o.value=o.value<n.value?o.value+1:n.value}function m(i){o.value=n.value}function a(){return e.createVNode("li",{class:u.value},[!t.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:i=>r()},[e.createVNode("span",{class:"f-icon f-page-next"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-next"},null)])])}function s(){return e.createVNode("li",{class:u.value},[!t.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:i=>m()},[e.createVNode("span",{class:"f-icon f-page-last"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-last"},null)])])}return{renderLastPage:s,renderNextPage:a}}function K(o,t){const n=e.ref("共"),u=e.ref("条"),r=e.computed(()=>({"pagination-message":!0,"text-truncate":!0,"d-flex":!0,"ml-auto":o.value==="right","flex-fill":o.value==="right"}));function m(){return e.createVNode("li",{class:r.value},[e.createVNode("div",{class:"text-truncate",style:"line-height: 26px"},[e.createVNode("span",{class:"pg-message-text"},[n.value]),e.createVNode("b",{class:"pg-message-total"},[t.value]),e.createVNode("span",{class:"pg-message-text"},[u.value])])])}return{renderPageInfo:m}}function R(o,t,n,u){const r=e.ref(!1),m=e.ref("显示"),a=e.ref("条"),s=e.computed(()=>({dropup:!0,"dropdown-right":!0,"pg-pagelist":!0,"pagelist-disabled":u.value===0,show:r.value})),i=e.computed(()=>({"dropdown-menu":!0,show:r.value})),f=c=>({"w-100":!0,"dropdown-item":!0,active:t.value===c});function g(c){r.value=!0}function b(c){r.value=!1}function y(c,p,h){const j=c*p-p+1;return Math.ceil(j/h)}function P(c,p){o.value=y(o.value,t.value,p),t.value=p,r.value=!1}function l(){return e.createVNode("li",{class:"pagination-pagelist"},[e.createVNode("div",{class:s.value,onMouseenter:c=>g(),onMouseleave:c=>b()},[e.createVNode("div",{class:"pg-pagelist-info"},[e.createVNode("span",{class:"pagelist-text"},[m.value]),e.createVNode("b",{class:"cur-pagesize"},[t.value]),e.createVNode("span",{class:"pagelist-text"},[a.value]),e.createVNode("i",{class:"f-icon f-icon-dropdown"},null)]),e.createVNode("div",{class:i.value,style:"margin-bottom: -1px;"},[n.value.map(c=>e.createVNode("li",{class:f(c),onClick:p=>P(p,c)},[e.createVNode("span",null,[c])]))])])])}return{renderPageList:l}}function ee(o,t){const n=a=>({"page-item":!0,current:o.value===a.value,ellipsis:a.label==="..."}),u=a=>({"f-icon":!0,"f-icon-arrow-seek-left":a.value<o.value,"f-icon-arrow-seek-right":a.value>o.value});function r(a,s){o.value=s}function m(){return t.value.map(a=>e.createVNode("li",{class:n(a)},[o.value!==a.value&&e.createVNode("a",{class:"page-link",tabindex:"0",onClick:s=>r(s,a.value)},[e.createVNode("span",{class:"page-link-label"},[a.label]),a.label==="..."&&e.createVNode("i",{class:u(a)},null)]),o.value===a.value&&e.createVNode("span",{class:"page-link"},[a.label])]))}return{renderPageNumbers:m}}function te(o,t,n){const u=e.computed(()=>({"page-item":!0,disabled:t.value}));function r(i){o.value=1}function m(i){o.value=o.value>2?o.value-1:1}function a(){return e.createVNode("li",{class:u.value},[n.value&&e.createVNode("a",{tabindex:"0",class:"page-link",onClick:i=>r()},[e.createVNode("span",{class:"f-icon f-page-first"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-first"},null)])])}function s(){return e.createVNode("li",{class:u.value},[n.value&&e.createVNode("a",{tabindex:"0",class:"page-link",onClick:i=>m()},[e.createVNode("span",{class:"f-icon f-page-pre"},null)]),t.value&&e.createVNode("span",{class:"page-link"},[e.createVNode("span",{class:"f-icon f-page-pre"},null)])])}return{renderFirstPage:a,renderPreviousPage:s}}function ne(o){const t=e.ref([]);function n(r,m,a,s){const i=Math.ceil(a/2);return r===a?s:r===1?r:a<s?s-i<m?s-a+r:i<m?m-i+r:r:r}function u(r,m,a,s){const i=[],f=Math.ceil(a/m),g=Math.ceil(s/2),b=r<=g,y=f-g<r,P=!b&&!y,l=s<f;let c=1;for(;c<=f&&c<=s;){const p=n(c,r,s,f),h=c===2&&(P||y),C=c===s-1&&(P||b),j=l&&(h||C)?"...":""+p;i.push({label:j,value:p}),c++}t.value=i}return{pages:t,updatePages:u}}const F=e.defineComponent({name:"FPagination",props:G,emits:["pageIndexChanged","pageSizeChanged","update:currentPage","update:pageSize"],setup(o,t){const n=e.ref(!1),u=e.ref(o.mode),r=e.ref(""),m=e.ref(!1),a=e.ref(o.pageSize),s=e.ref(o.currentPage),i=e.ref(o.totalItems),{pages:f,updatePages:g}=ne(),b=e.computed(()=>s.value===1),y=e.computed(()=>o.pageList),P=e.computed(()=>Math.ceil(i.value/a.value)),l=e.computed(()=>s.value===P.value),c=e.computed(()=>o.showGoButton),p=e.computed(()=>s.value>1),h=e.computed(()=>!(m.value&&f.value.length<=1)),C=e.computed(()=>!0),j=e.computed(()=>o.showPageList),T=e.computed(()=>o.showPageNumbers),k=e.computed(()=>!0),{renderFirstPage:N,renderPreviousPage:V}=te(s,b,p),{renderLastPage:d,renderNextPage:v}=I(s,l,P),{renderPageInfo:O}=K(r,i),{renderPageList:w}=R(s,a,y,i),{renderPageNumbers:A}=ee(s,f),{renderGotoButton:$}=Z(s,P);g(s.value,a.value,i.value,7),e.watch(()=>o.totalItems,L=>{i.value=L}),e.watch([s,a,i],()=>{g(s.value,a.value,i.value,7)}),e.watch(s,()=>{t.emit("update:currentPage",s.value),t.emit("pageIndexChanged",s.value)}),e.watch(a,()=>{t.emit("update:pageSize",a.value),t.emit("pageSizeChanged",a.value)}),e.watch(()=>o.totalItems,L=>{i.value=L,g(s.value,a.value,i.value,7)}),e.watchEffect(()=>{const L=y.value.includes(a.value);a.value=L?a.value:y.value[0]})();const D=e.computed(()=>({"ngx-pagination":!0,pagination:!0,responsive:n.value,"pager-viewmode-default":u.value==="default","pager-viewmode-simple":u.value==="simple"})),x=e.computed(()=>({position:"relative","justify-content":r.value==="center"?"center":"start"}));function E(){return e.createVNode(e.Fragment,null,[C.value&&O(),j.value&&w(),k.value&&N(),k.value&&V(),T.value&&A(),k.value&&v(),k.value&&d(),c.value&&$()])}function z(){return e.createVNode(e.Fragment,null,[e.createVNode("li",{class:"page-item d-flex flex-fill"},null),k.value&&N(),k.value&&V(),$(),e.createVNode("li",{class:"page-item page-separator",style:"margin-left: 10px"},[e.createVNode("span",{style:"font-size: 15px; font-weight: 200;"},[e.createTextVNode(" /")])]),e.createVNode("li",{class:"page-item page-total",style:"margin-left: 5px"},[e.createVNode("span",{style:"font-size: 16px; font-weight: 600;"},[e.createTextVNode(" "),P.value])]),k.value&&v(),k.value&&d()])}return()=>e.createVNode("div",{class:"pagination-container"},[h.value&&e.createVNode("ul",{role:"navigation",class:D.value,style:x.value},[u.value==="default"?E():z()])])}});function be(o,t,n){var k;function u(){n!=null&&n.resolveComponentContext&&n.resolveComponentContext()}u();const r=n&&n.getStyles&&n.getStyles()||"",m=n&&n.getDesignerClass&&n.getDesignerClass()||"",a=e.ref();function s(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function i(){return!1}function f(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function g(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function b(N){if(!N||!N.value)return null;if(N.value.schema&&N.value.schema.type==="component")return N.value;const V=e.ref(N==null?void 0:N.value.parent),d=b(V);return d||null}function y(N=t){const{componentInstance:V,designerItemElementRef:d}=N;return!V||!V.value?null:V.value.canMove?d:y(N.parent)}function P(N){return!!n&&n.canAccepts(N)}function l(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function c(){}function p(N,V){V&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(V)}function h(N){const{componentType:V}=N;let d=B(V,N);n&&n.onResolveNewComponentSchema&&(d=n.onResolveNewComponentSchema(N,d));const v=V.toLowerCase().replace("-","_");return d&&!d.id&&d.type===V&&(d.id=`${v}_${Math.random().toString().slice(2,6)}`),d}function C(N,V){const d=String(N.getAttribute("data-controltype")),v=N.getAttribute("data-feature"),O=v?JSON.parse(v):{};O.parentComponentInstance=a.value;let w=B(d,O);n&&n.onAcceptNewChildElement&&(w=n.onAcceptNewChildElement(N,V,w));const A=d.toLowerCase().replace("-","_");return w&&!w.id&&w.type===d&&(w.id=`${A}_${Math.random().toString().slice(2,6)}`),w}function j(N){}function T(...N){if(n&&n.getPropsConfig)return n.getPropsConfig(...N)}return a.value={canMove:s(),canSelectParent:i(),canDelete:f(),canNested:!g(),contents:t==null?void 0:t.schema.contents,elementRef:o,parent:(k=t==null?void 0:t.parent)==null?void 0:k.componentInstance,schema:t==null?void 0:t.schema,styles:r,designerClass:m,canAccepts:P,getBelongedComponentInstance:b,getDraggableDesignItemElement:y,getDraggingDisplayText:l,getPropConfig:T,getDragScopeElement:c,onAcceptMovedChildElement:p,onAcceptNewChildElement:C,onChildElementMovedOut:j,addNewChildComponentSchema:h,updateDragAndDropRules:u,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||e.ref(!1)},a}function ve(){function o(t){var r,m;if(!t)return!1;const n=((r=t.targetContainer)==null?void 0:r.componentInstance)&&t.targetContainer.componentInstance.value;if(!n)return!1;const u=(m=n.schema.appearance)==null?void 0:m.class;if(t.controlCategory==="input"||t.controlType==="form-group"){const a=n.schema.type,s=(a==="response-form"||a==="content-container")&&u&&u.includes("farris-form");if(n.schema.type!=="response-layout-item"&&!s)return!1}return t.controlType!=="field-set"}return{basalDragulaRuleForContainer:o}}const Ne={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}},required:[]},J=new Map;function je(){function o(l,c,p,h){var C;if(typeof p=="number")return((C=h[l])==null?void 0:C.length)===p;if(typeof p=="object"){const j=Object.keys(p)[0],T=p[j];if(j==="not")return Number(h[l].length)!==Number(T);if(j==="moreThan")return Number(h[l].length)>=Number(T);if(j==="lessThan")return Number(h[l].length)<=Number(T)}return!1}function t(l,c,p,h){return typeof p=="boolean"?h.childrenClassList.includes(c)===!!p:!1}function n(l,c,p,h){return typeof p=="boolean"?h.parentClassList.includes(c)===!!p:!1}function u(l,c,p,h){return typeof p=="boolean"?h.parentClassList.includes(c)===!!p:!1}const r=new Map([["length",o],["hasChildren",t],["hasSibling",u],["hasParent",n]]);function m(l,c){const p=l;return typeof c=="number"?[{target:p,operator:"length",param:null,value:Number(c)}]:typeof c=="object"?Object.keys(c).map(h=>{if(h==="length")return{target:p,operator:"length",param:null,value:c[h]};const C=h,j=c[h];return{target:p,operator:l==="children"?"hasChildren":l==="parent"?"hasParent":"hasSibling",param:C,value:j}}):[]}function a(l,c){if(r.has(l.operator)){const p=r.get(l.operator);return p&&p(l.target,l.param,l.value,c)||!1}return!1}function s(l,c){return Object.keys(l).reduce((j,T)=>{const k=m(T,l[T]);return j.push(...k),j},[]).reduce((j,T)=>j&&a(T,c),!0)}function i(l,c){const p=Object.keys(l),h=p.includes("allOf"),C=p.includes("anyOf"),j=h||C,N=(j?l[j?h?"allOf":"anyOf":"allOf"]:[l]).map(d=>s(d,c));return h?!N.includes(!1):N.includes(!0)}function f(l,c){const p=l.const;return p?typeof p=="boolean"?p:typeof p=="object"?i(p,c):!1:!1}function g(l){return c=>{const p={canAccept:!0,fixed:!1,hidePadding:!1};return l&&l.properties&&Object.keys(l.properties).reduce((h,C)=>{const j=l.properties[C];return h[C]=f(j,c),h},p),p}}function b(l,c,p){if(c.type==="object"&&c.properties){const{rules:h,contents:C}=c.properties;p.set(l,g(h)),C&&Object.keys(C.properties).forEach(j=>b(j,C.properties[j],p))}}function y(){const{properties:l}=Ne;Object.keys(l).forEach(c=>{b(c,l[c],J)})}function P(l,c){const p={canAccept:!0,fixed:!1,hidePadding:!0};return J.has(l)?J.get(l)(c):p}return y(),{getRuleValue:P}}function Pe(o,t){var V;const n=o.schema,u=(V=o.parent)==null?void 0:V.schema,r=je(),m=e.ref(!1),a=e.ref(!1);let s=!0,i=!1,f,g=!1;function b(d){return f&&f.componentClassList&&f.componentClassList.includes("f-form-layout")&&f.componentClassList.includes("farris-form")?d.sourceType==="control"&&d.controlCategory==="input"||d.sourceType==="move"&&d.controlType==="form-group":!0}function y(d){return!(!ve().basalDragulaRuleForContainer(d)||!s||!b(d))}function P(){m.value=!1,a.value=!1;const d=n,v=d.appearance&&d.appearance.class||"",O=v.split(" "),w=d.contents||[],A=w.length?w[0]:null,$=A&&A.appearance?A.appearance.class:"",S=$?$.split(" "):[],D=w.length?w.reduce((q,W)=>{const oe=W&&W.appearance?W.appearance.class:"",Ve=oe?oe.split(" "):[];return q.push(...Ve),q},[]):[],x=u,E=x&&x.appearance&&x.appearance.class||"",z=E?E.split(" "):[];f={componentClass:v,componentClassList:O,childContents:w,firstChildContent:A,firstChildClass:$,firstChildClassList:S,parent:x,parentClass:E,parentClassList:z,children:w,childrenClassList:D};const{canAccept:L,fixed:Q,hidePadding:U}=r.getRuleValue(O[0],f);return s=L,i=U,g=Q,!0}function l(d){e.nextTick()}function c(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function p(d,v){const O=n;if((O.appearance&&O.appearance.class||"").split(" ").includes("f-form-layout")){const{label:$}=d,S=B("form-group");return S.editor=v,S.label=$,h(S),delete S.editor.id,delete S.editor.binding,delete S.editor.appearance,delete S.editor.visible,S}return v}function h(d){const v=o.componentInstance.value.getBelongedComponentInstance(o.componentInstance);if(v&&v.schema&&v.schema.componentType){const O=v.schema.componentType,w=C(O);d.appearance||(d.appearance={}),d.appearance.class=w}}function C(d){let v="";switch(d){case"form-col-1":{v="col-12 col-md-12 col-xl-12 col-el-12";break}case"form-col-12":{v="col-12 col-md-12 col-xl-12 col-el-12";break}case"form-col-2":{v="col-12 col-md-6 col-xl-6 col-el-6";break}case"form-col-3":{v="col-12 col-md-6 col-xl-4 col-el-4";break}case"form-col-4":{v="col-12 col-md-6 col-xl-3 col-el-2";break}case"form-col-6":{v="col-12 col-md-6 col-xl-6 col-el-6";break}case"frame":{v="col-12";break}}return v}function j(d,v,O){const w=n;if((w.appearance&&w.appearance.class||"").split(" ").includes("f-form-layout")){const S=String(d.innerText),D=B("form-group");return D.editor=O,D.label=S,D}return O}function T(){return!g}function k(){return!g}function N(){return i}return{canAccepts:y,checkCanDeleteComponent:k,checkCanMoveComponent:T,getStyles:c,hideNestedPaddingInDesginerView:N,onAcceptNewChildElement:j,onAcceptMovedChildElement:l,resolveComponentContext:P,onResolveNewComponentSchema:p,triggerBelongedComponentToMoveWhenMoved:m,triggerBelongedComponentToDeleteWhenDeleted:a}}const Ce=e.defineComponent({name:"FPagination",props:G,emits:["pageIndexChanged","pageSizeChanged"],setup(o,t){var q;const n=e.ref(!1),u=e.ref(o.mode),r=e.ref(""),m=e.ref(!1),a=e.ref(o.pageSize),s=e.ref(o.currentPage),i=e.ref(o.totalItems),f=e.ref(),g=e.inject("design-item-context"),b=Pe(g.schema,(q=g.parent)==null?void 0:q.schema),y=be(f,g,b);e.onMounted(()=>{f.value.componentInstance=y}),t.expose(y.value);const{pages:P,updatePages:l}=ne(),c=e.computed(()=>s.value===1),p=e.computed(()=>[20,50,100]),h=e.computed(()=>Math.ceil(i.value/a.value)),C=e.computed(()=>s.value===h.value),j=e.computed(()=>!0),T=e.computed(()=>s.value>1),k=e.computed(()=>!(m.value&&P.value.length<=1)),N=e.computed(()=>!0),V=e.computed(()=>!0),d=e.computed(()=>!0),v=e.computed(()=>!0),{renderFirstPage:O,renderPreviousPage:w}=te(s,c,T),{renderLastPage:A,renderNextPage:$}=I(s,C,h),{renderPageInfo:S}=K(r,i),{renderPageList:D}=R(s,a,p,i),{renderPageNumbers:x}=ee(s,P),{renderGotoButton:E}=Z(s,h);l(s.value,a.value,i.value,7),e.watch([s,a],()=>{l(s.value,a.value,i.value,7)}),e.watch(s,()=>{t.emit("pageIndexChanged",s.value)}),e.watch(a,()=>{t.emit("pageSizeChanged",a.value)});const z=e.computed(()=>({"ngx-pagination":!0,pagination:!0,responsive:n.value,"pager-viewmode-default":u.value==="default","pager-viewmode-simple":u.value==="simple"})),L=e.computed(()=>({position:"relative","justify-content":r.value==="center"?"center":"start"}));function Q(){return e.createVNode(e.Fragment,null,[N.value&&S(),V.value&&D(),v.value&&O(),v.value&&w(),d.value&&x(),v.value&&$(),v.value&&A(),j.value&&E()])}function U(){return e.createVNode(e.Fragment,null,[e.createVNode("li",{class:"page-item d-flex flex-fill"},null),v.value&&O(),v.value&&w(),E(),e.createVNode("li",{class:"page-item page-separator",style:"margin-left: 10px"},[e.createVNode("span",{style:"font-size: 15px; font-weight: 200;"},[e.createTextVNode(" /")])]),e.createVNode("li",{class:"page-item page-total",style:"margin-left: 5px"},[e.createVNode("span",{style:"font-size: 16px; font-weight: 600;"},[e.createTextVNode(" "),h.value])]),v.value&&$(),v.value&&A()])}return()=>e.createVNode("div",{ref:f,class:"pagination-container"},[k.value&&e.createVNode("ul",{role:"navigation",class:z.value,style:L.value},[u.value==="default"?Q():U()])])}});F.register=(o,t,n)=>{o.pagination=F,t.pagination=H},F.registerDesigner=(o,t,n)=>{o.pagination=Ce,t.pagination=H};const we=re.withInstall(F);M.FPagination=F,M.default=we,M.paginationProps=G,M.propsResolver=H,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -33,8 +33,8 @@ import bt from "@farris/ui-vue/components/mapping-editor";
|
|
|
33
33
|
import ht from "@farris/ui-vue/components/nav";
|
|
34
34
|
import Ct from "@farris/ui-vue/components/number-range";
|
|
35
35
|
import Ft from "@farris/ui-vue/components/order";
|
|
36
|
-
import
|
|
37
|
-
import
|
|
36
|
+
import Tt from "@farris/ui-vue/components/page-header";
|
|
37
|
+
import St from "@farris/ui-vue/components/page-footer";
|
|
38
38
|
import Bt from "@farris/ui-vue/components/pagination";
|
|
39
39
|
import wt from "@farris/ui-vue/components/progress";
|
|
40
40
|
import Pt from "@farris/ui-vue/components/query-solution";
|
|
@@ -469,10 +469,10 @@ function fe(e, t) {
|
|
|
469
469
|
return () => gn.parseValueSchema(e, t);
|
|
470
470
|
}
|
|
471
471
|
function vn(e, t, n) {
|
|
472
|
-
return e.includes("visible") ? typeof t.visible == "boolean" ? () => !!t.visible : t.visible === void 0 ? !0 : fe(t.visible, n) : () => !0;
|
|
472
|
+
return e.includes("visible") && t.visible !== void 0 ? typeof t.visible == "boolean" ? () => !!t.visible : t.visible === void 0 ? !0 : fe(t.visible, n) : () => !0;
|
|
473
473
|
}
|
|
474
474
|
function bn(e, t, n) {
|
|
475
|
-
return e.includes("readonly") ? typeof t.visible == "boolean" ? () => !!t.visible : fe(t.readonly, n) : () => !1;
|
|
475
|
+
return e.includes("readonly") && t.readonly !== void 0 ? typeof t.visible == "boolean" ? () => !!t.visible : fe(t.readonly, n) : () => !1;
|
|
476
476
|
}
|
|
477
477
|
function hn(e, t) {
|
|
478
478
|
const n = e.$converter || t;
|
|
@@ -540,7 +540,7 @@ const Fn = {
|
|
|
540
540
|
propertyData: { type: Object, default: {} },
|
|
541
541
|
valueChanged: { type: Function },
|
|
542
542
|
triggerRefreshPanel: { type: Function }
|
|
543
|
-
},
|
|
543
|
+
}, Tn = {
|
|
544
544
|
elementConfig: { type: Object, default: {} },
|
|
545
545
|
category: { type: Object, default: {} }
|
|
546
546
|
};
|
|
@@ -553,7 +553,7 @@ function ye(e, t, n = /* @__PURE__ */ new Map(), r = (y, w, d) => w, s = {}, m =
|
|
|
553
553
|
function ge(e, t) {
|
|
554
554
|
return { customClass: t.class, customStyle: t.style };
|
|
555
555
|
}
|
|
556
|
-
const
|
|
556
|
+
const Sn = /* @__PURE__ */ new Map([
|
|
557
557
|
["appearance", ge]
|
|
558
558
|
]), Bn = "https://json-schema.org/draft/2020-12/schema", wn = "https://farris-design.gitee.io/form-group.schema.json", Pn = "form-group", xn = "A Farris Input Component", In = "object", En = {
|
|
559
559
|
id: {
|
|
@@ -624,7 +624,7 @@ const Tn = /* @__PURE__ */ new Map([
|
|
|
624
624
|
ye(
|
|
625
625
|
ve,
|
|
626
626
|
Ln,
|
|
627
|
-
|
|
627
|
+
Sn,
|
|
628
628
|
void 0
|
|
629
629
|
);
|
|
630
630
|
const Mn = {
|
|
@@ -1339,7 +1339,7 @@ const oo = /* @__PURE__ */ H({
|
|
|
1339
1339
|
}), g = {}, v = {}, b = {}, h = {};
|
|
1340
1340
|
let le = !1;
|
|
1341
1341
|
function ro() {
|
|
1342
|
-
le || (le = !0, Xe.register(g, v, b, h), _e.register(g, v, b, h), Ze.register(g, v, b, h), Je.register(g, v, b, h), Ye.register(g, v, b, h), Ke.register(g, v, b, h), et.register(g, v, b, h), tt.register(g, v, b, h), nt.register(g, v, b, h), rt.register(g, v, b, h), ot.register(g, v, b, h), at.register(g, v, b, h), it.register(g, v, b, h), lt.register(g, v, b, h), st.register(g, v, b, h), ut.register(g, v, b, h), ct.register(g, v, b, h), dt.register(g, v, b, h), pt.register(g, v, b, h), mt.register(g, v, b, h), ft.register(g, v, b, h), gt.register(g, v, b, h), yt.register(g, v, b, h), vt.register(g, v, b, h), bt.register(g, v, b, h), ht.register(g, v, b, h), Ct.register(g, v, b, h), qe.register(g, v, b, h), Ft.register(g, v, b, h),
|
|
1342
|
+
le || (le = !0, Xe.register(g, v, b, h), _e.register(g, v, b, h), Ze.register(g, v, b, h), Je.register(g, v, b, h), Ye.register(g, v, b, h), Ke.register(g, v, b, h), et.register(g, v, b, h), tt.register(g, v, b, h), nt.register(g, v, b, h), rt.register(g, v, b, h), ot.register(g, v, b, h), at.register(g, v, b, h), it.register(g, v, b, h), lt.register(g, v, b, h), st.register(g, v, b, h), ut.register(g, v, b, h), ct.register(g, v, b, h), dt.register(g, v, b, h), pt.register(g, v, b, h), mt.register(g, v, b, h), ft.register(g, v, b, h), gt.register(g, v, b, h), yt.register(g, v, b, h), vt.register(g, v, b, h), bt.register(g, v, b, h), ht.register(g, v, b, h), Ct.register(g, v, b, h), qe.register(g, v, b, h), Ft.register(g, v, b, h), Tt.register(g, v, b, h), St.register(g, v, b, h), Bt.register(g, v, b, h), wt.register(g, v, b, h), Pt.register(g, v, b, h), xt.register(g, v, b, h), It.register(g, v, b, h), kt.register(g, v, b, h), Lt.register(g, v, b, h), Et.register(g, v, b, h), Xt.register(g, v, b), Mt.register(g, v, b, h), Dt.register(g, v, b, h), Ot.register(g, v, b, h), Nt.register(g, v, b, h), At.register(g, v, b, h), Vt.register(g, v, b, h), jt.register(g, v, b, h), Rt.register(g, v, b, h), $t.register(g, v, b, h), Gt.register(g, v, b, h), Wt.register(g, v, b, h), qt.register(g, v, b, h), zt.register(g, v, b, h), Ht.register(g, v, b, h), Ut.register(g, v, b, h), Qt.register(g, v, b, h), _t.register(g, v, b, h));
|
|
1343
1343
|
}
|
|
1344
1344
|
function ao() {
|
|
1345
1345
|
ro();
|
|
@@ -1354,6 +1354,8 @@ function ao() {
|
|
|
1354
1354
|
switch (s) {
|
|
1355
1355
|
case "check-box":
|
|
1356
1356
|
return "onChangeValue";
|
|
1357
|
+
case "switch":
|
|
1358
|
+
return "onModelValueChanged";
|
|
1357
1359
|
case "check-group":
|
|
1358
1360
|
return "onChangeValue";
|
|
1359
1361
|
case "combo-list":
|
|
@@ -1466,7 +1468,7 @@ const io = /* @__PURE__ */ H({
|
|
|
1466
1468
|
}
|
|
1467
1469
|
}), lo = /* @__PURE__ */ H({
|
|
1468
1470
|
name: "FPropertyPanelItem",
|
|
1469
|
-
props:
|
|
1471
|
+
props: Tn,
|
|
1470
1472
|
emits: ["propertyChange", "triggerRefreshPanel"],
|
|
1471
1473
|
setup(e, t) {
|
|
1472
1474
|
var o;
|
|
@@ -1615,51 +1617,51 @@ const io = /* @__PURE__ */ H({
|
|
|
1615
1617
|
let I = [], k = null, M = "";
|
|
1616
1618
|
const P = C();
|
|
1617
1619
|
function $() {
|
|
1618
|
-
f = [], P.value && P.value.categoryList && Array.isArray(P.value.categoryList) && P.value.categoryList.length > 0 && P.value.categoryList.forEach((
|
|
1619
|
-
if (
|
|
1620
|
-
const
|
|
1621
|
-
f = f.concat(
|
|
1620
|
+
f = [], P.value && P.value.categoryList && Array.isArray(P.value.categoryList) && P.value.categoryList.length > 0 && P.value.categoryList.forEach((T) => {
|
|
1621
|
+
if (T.properties.forEach((S) => S.categoryId = T.categoryId), T.properties && Array.isArray(T.properties) && T.properties.length > 0) {
|
|
1622
|
+
const S = T.properties.map((D) => (D.category = T, D));
|
|
1623
|
+
f = f.concat(S);
|
|
1622
1624
|
}
|
|
1623
1625
|
});
|
|
1624
1626
|
}
|
|
1625
1627
|
function N(B) {
|
|
1626
|
-
let
|
|
1627
|
-
for (;
|
|
1628
|
-
|
|
1629
|
-
return
|
|
1628
|
+
let T = B.offsetTop, S = B.offsetParent;
|
|
1629
|
+
for (; S !== null; )
|
|
1630
|
+
T += S.offsetTop, S = S.offsetParent;
|
|
1631
|
+
return T;
|
|
1630
1632
|
}
|
|
1631
|
-
function G(B,
|
|
1632
|
-
B &&
|
|
1633
|
+
function G(B, T) {
|
|
1634
|
+
B && T && Object.keys(T).length > 0 && Object.keys(T).forEach((S) => {
|
|
1633
1635
|
var W;
|
|
1634
|
-
const D = S
|
|
1635
|
-
(W = B.style) == null || W.setProperty(
|
|
1636
|
+
const D = T[S];
|
|
1637
|
+
(W = B.style) == null || W.setProperty(S, D);
|
|
1636
1638
|
});
|
|
1637
1639
|
}
|
|
1638
1640
|
function z() {
|
|
1639
|
-
return f.filter((
|
|
1641
|
+
return f.filter((T) => T.visible ? !!(T.propertyID && T.propertyID.startsWith(F.value) || T.propertyName && (T.propertyName.startsWith(F.value) || T.propertyName.includes(F.value))) : !1);
|
|
1640
1642
|
}
|
|
1641
|
-
function U(B,
|
|
1643
|
+
function U(B, T, S) {
|
|
1642
1644
|
if (B === 0) {
|
|
1643
|
-
const D = N(
|
|
1644
|
-
|
|
1645
|
+
const D = N(T), K = N(S) - D - 5;
|
|
1646
|
+
T == null || T.scroll({
|
|
1645
1647
|
top: K,
|
|
1646
1648
|
behavior: "smooth"
|
|
1647
1649
|
});
|
|
1648
1650
|
}
|
|
1649
1651
|
}
|
|
1650
1652
|
function x(B) {
|
|
1651
|
-
I && I.length > 0 && (I.forEach((
|
|
1652
|
-
|
|
1653
|
+
I && I.length > 0 && (I.forEach((S) => {
|
|
1654
|
+
S.style.cssText = "";
|
|
1653
1655
|
}), I = []), F.value = B || F.value;
|
|
1654
|
-
const
|
|
1656
|
+
const T = document.querySelector(".panel-body");
|
|
1655
1657
|
if (!F.value)
|
|
1656
|
-
O.value &&
|
|
1658
|
+
O.value && T && (T.scrollTop = 0);
|
|
1657
1659
|
else if ($(), f && f.length > 0) {
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1660
|
-
|
|
1660
|
+
const S = z();
|
|
1661
|
+
S && S.length > 0 && (S[0].category.status === "closed" && (S[0].category.status = "open"), setTimeout(() => {
|
|
1662
|
+
S.forEach((D, W) => {
|
|
1661
1663
|
const K = D.propertyType === "cascade" ? `.${D.categoryId}-${D.propertyID} div.col-form-label` : `.property-item .${D.categoryId}-${D.propertyID} label.col-form-label`, X = document.querySelector(K);
|
|
1662
|
-
X && (U(W,
|
|
1664
|
+
X && (U(W, T, X), G(X, {
|
|
1663
1665
|
color: "#5B89FE"
|
|
1664
1666
|
}), I.push(X));
|
|
1665
1667
|
});
|
|
@@ -1671,15 +1673,15 @@ const io = /* @__PURE__ */ H({
|
|
|
1671
1673
|
}
|
|
1672
1674
|
function _(B) {
|
|
1673
1675
|
const {
|
|
1674
|
-
value:
|
|
1676
|
+
value: T
|
|
1675
1677
|
} = B.target;
|
|
1676
|
-
B.key === "Enter" && V(
|
|
1678
|
+
B.key === "Enter" && V(T);
|
|
1677
1679
|
}
|
|
1678
1680
|
function J(B) {
|
|
1679
1681
|
const {
|
|
1680
|
-
value:
|
|
1682
|
+
value: T
|
|
1681
1683
|
} = B.target;
|
|
1682
|
-
V(
|
|
1684
|
+
V(T);
|
|
1683
1685
|
}
|
|
1684
1686
|
function he() {
|
|
1685
1687
|
y.value || (a.value = !1), t.emit("closePropertyPanel");
|
|
@@ -1691,7 +1693,7 @@ const io = /* @__PURE__ */ H({
|
|
|
1691
1693
|
!B.status || B.status === "open" ? B.status = "closed" : B.status = "open";
|
|
1692
1694
|
}
|
|
1693
1695
|
function Q() {
|
|
1694
|
-
var B,
|
|
1696
|
+
var B, T;
|
|
1695
1697
|
if (p = [], !d.value || d.value.length === 0) {
|
|
1696
1698
|
p = [{
|
|
1697
1699
|
tabId: "default",
|
|
@@ -1700,47 +1702,47 @@ const io = /* @__PURE__ */ H({
|
|
|
1700
1702
|
}], P.value = null;
|
|
1701
1703
|
return;
|
|
1702
1704
|
}
|
|
1703
|
-
if ((B = d == null ? void 0 : d.value) == null || B.forEach((
|
|
1704
|
-
if (
|
|
1705
|
-
const D = p.find((W) => W.tabId ===
|
|
1706
|
-
D ? (D.categoryList.push(
|
|
1707
|
-
tabId:
|
|
1708
|
-
tabName:
|
|
1709
|
-
categoryList: [
|
|
1710
|
-
hide:
|
|
1705
|
+
if ((B = d == null ? void 0 : d.value) == null || B.forEach((S) => {
|
|
1706
|
+
if (S.tabId) {
|
|
1707
|
+
const D = p.find((W) => W.tabId === S.tabId);
|
|
1708
|
+
D ? (D.categoryList.push(S), D.hide && (D.hide = S.hide || S.properties.length === 0)) : p.push({
|
|
1709
|
+
tabId: S.tabId,
|
|
1710
|
+
tabName: S.tabName,
|
|
1711
|
+
categoryList: [S],
|
|
1712
|
+
hide: S.hide || S.properties.length === 0
|
|
1711
1713
|
});
|
|
1712
1714
|
} else {
|
|
1713
1715
|
const D = p.find((W) => W.tabId === "default");
|
|
1714
|
-
D ? D.categoryList.push(
|
|
1716
|
+
D ? D.categoryList.push(S) : p.push({
|
|
1715
1717
|
tabId: "default",
|
|
1716
1718
|
tabName: "属性",
|
|
1717
|
-
categoryList: [
|
|
1719
|
+
categoryList: [S]
|
|
1718
1720
|
});
|
|
1719
1721
|
}
|
|
1720
1722
|
}), l.value) {
|
|
1721
|
-
let
|
|
1722
|
-
P.value =
|
|
1723
|
+
let S = p == null ? void 0 : p.find((D) => D.tabId === l.value && !D.hide);
|
|
1724
|
+
P.value = S || p[0];
|
|
1723
1725
|
} else
|
|
1724
1726
|
P.value = p[0];
|
|
1725
|
-
l.value = (
|
|
1727
|
+
l.value = (T = P.value) == null ? void 0 : T.tabId;
|
|
1726
1728
|
}
|
|
1727
1729
|
R(() => [e.schema, e.isShowPanel], () => {
|
|
1728
1730
|
o.value = e.schema, d.value = ee(o.value, L, k, M), Q(), Y(F.value);
|
|
1729
1731
|
}), q(() => {
|
|
1730
1732
|
Q();
|
|
1731
1733
|
});
|
|
1732
|
-
function Fe(B,
|
|
1733
|
-
(!o.value ||
|
|
1734
|
+
function Fe(B, T) {
|
|
1735
|
+
(!o.value || T) && (o.value = T || e.schema), d.value = ee(o.value, L, k, M, B), Q(), Y(F.value);
|
|
1734
1736
|
}
|
|
1735
|
-
function
|
|
1736
|
-
k = B, M =
|
|
1737
|
+
function Te(B, T) {
|
|
1738
|
+
k = B, M = T;
|
|
1737
1739
|
}
|
|
1738
1740
|
function re() {
|
|
1739
1741
|
m.value = m.value === "panel" ? "sidebar" : "panel", m.value === "panel" ? (setTimeout(() => {
|
|
1740
1742
|
V();
|
|
1741
1743
|
}, 100), n.value = "300px") : n.value = "41px";
|
|
1742
1744
|
}
|
|
1743
|
-
function
|
|
1745
|
+
function Se() {
|
|
1744
1746
|
if (u.value)
|
|
1745
1747
|
return c("div", {
|
|
1746
1748
|
class: "title-actions"
|
|
@@ -1773,7 +1775,7 @@ const io = /* @__PURE__ */ H({
|
|
|
1773
1775
|
type: "text",
|
|
1774
1776
|
placeholder: "输入属性名称或编号快速定位",
|
|
1775
1777
|
autocomplete: "off",
|
|
1776
|
-
onKeyup: (
|
|
1778
|
+
onKeyup: (T) => _(T),
|
|
1777
1779
|
value: F.value
|
|
1778
1780
|
}, null), c("div", {
|
|
1779
1781
|
class: "input-group-append",
|
|
@@ -1783,12 +1785,12 @@ const io = /* @__PURE__ */ H({
|
|
|
1783
1785
|
style: [{
|
|
1784
1786
|
display: F.value && F.value.length > 0 ? "" : "none"
|
|
1785
1787
|
}],
|
|
1786
|
-
onClick: (
|
|
1788
|
+
onClick: (T) => Y()
|
|
1787
1789
|
}, [c("i", {
|
|
1788
1790
|
class: "f-icon modal_close"
|
|
1789
1791
|
}, null)]), c("span", {
|
|
1790
1792
|
class: "input-group-text input-group-clear",
|
|
1791
|
-
onClick: (
|
|
1793
|
+
onClick: (T) => J(T)
|
|
1792
1794
|
}, [c("i", {
|
|
1793
1795
|
class: "f-icon f-icon-search"
|
|
1794
1796
|
}, null)])])])]);
|
|
@@ -1800,7 +1802,7 @@ const io = /* @__PURE__ */ H({
|
|
|
1800
1802
|
t.emit("propertyChanged", B);
|
|
1801
1803
|
}
|
|
1802
1804
|
function Ie() {
|
|
1803
|
-
var B,
|
|
1805
|
+
var B, T;
|
|
1804
1806
|
if (P.value)
|
|
1805
1807
|
return c("div", {
|
|
1806
1808
|
class: "panel-body",
|
|
@@ -1809,22 +1811,22 @@ const io = /* @__PURE__ */ H({
|
|
|
1809
1811
|
class: ["property-grid", {
|
|
1810
1812
|
"wide-panel": r.value
|
|
1811
1813
|
}]
|
|
1812
|
-
}, [(
|
|
1813
|
-
key: Pe(
|
|
1814
|
-
"data-category-id":
|
|
1815
|
-
}, [!
|
|
1814
|
+
}, [(T = (B = P.value) == null ? void 0 : B.categoryList) == null ? void 0 : T.map((S) => c("li", {
|
|
1815
|
+
key: Pe(S),
|
|
1816
|
+
"data-category-id": S == null ? void 0 : S.categoryId
|
|
1817
|
+
}, [!S.hide && !S.hideTitle && c("span", {
|
|
1816
1818
|
class: "group-label",
|
|
1817
|
-
onClick: () => Ce(
|
|
1819
|
+
onClick: () => Ce(S)
|
|
1818
1820
|
}, [c("span", {
|
|
1819
1821
|
class: ["f-icon mr-2", {
|
|
1820
|
-
"f-legend-show":
|
|
1822
|
+
"f-legend-show": S.status === "closed"
|
|
1821
1823
|
}, {
|
|
1822
|
-
"f-legend-collapse":
|
|
1824
|
+
"f-legend-collapse": S.status === "open" || S.status === void 0
|
|
1823
1825
|
}]
|
|
1824
|
-
}, null),
|
|
1825
|
-
hidden:
|
|
1826
|
+
}, null), S.categoryName]), c("div", {
|
|
1827
|
+
hidden: S.status === "closed"
|
|
1826
1828
|
}, [c(so, {
|
|
1827
|
-
category:
|
|
1829
|
+
category: S,
|
|
1828
1830
|
propertyData: o.value,
|
|
1829
1831
|
onTriggerRefreshPanel: Be,
|
|
1830
1832
|
onValueChanged: xe
|
|
@@ -1876,7 +1878,7 @@ const io = /* @__PURE__ */ H({
|
|
|
1876
1878
|
}), R(P, () => {
|
|
1877
1879
|
}), t.expose({
|
|
1878
1880
|
updatePropertyConfig: Fe,
|
|
1879
|
-
updateDesignerItem:
|
|
1881
|
+
updateDesignerItem: Te
|
|
1880
1882
|
}), () => c(Z, null, [c("div", {
|
|
1881
1883
|
ref: O,
|
|
1882
1884
|
class: ["property-panel", {
|
|
@@ -1892,7 +1894,7 @@ const io = /* @__PURE__ */ H({
|
|
|
1892
1894
|
}, {
|
|
1893
1895
|
only: p.length === 1
|
|
1894
1896
|
}]
|
|
1895
|
-
}, [De(),
|
|
1897
|
+
}, [De(), Se()]), we(), Ie()]), Le(), Ee()])]);
|
|
1896
1898
|
}
|
|
1897
1899
|
});
|
|
1898
1900
|
var uo = /* @__PURE__ */ ((e) => (e.string = "string", e.boolean = "boolean", e.number = "number", e.select = "select", e.boolOrExp = "boolOrExp", e.editableSelect = "editableSelect", e.multiSelect = "multiSelect", e.date = "date", e.datetime = "datetime", e.modal = "modal", e.cascade = "cascade", e.custom = "custom", e.unity = "unity", e.events = "events", e.switch = "switch", e.multiLanguage = "multiLanguage", e))(uo || {});
|
|
@@ -1905,6 +1907,6 @@ export {
|
|
|
1905
1907
|
se as FPropertyPanel,
|
|
1906
1908
|
uo as PropertyType,
|
|
1907
1909
|
br as default,
|
|
1908
|
-
|
|
1910
|
+
Tn as propertyPanelItemProps,
|
|
1909
1911
|
Zt as propertyPanelProps
|
|
1910
1912
|
};
|