@farris/ui-vue 1.2.8 → 1.2.9
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 +129 -129
- package/components/accordion/index.umd.cjs +1 -0
- package/components/avatar/index.esm.js +166 -157
- package/components/avatar/index.umd.cjs +1 -0
- package/components/border-editor/index.umd.cjs +1 -0
- package/components/button/index.umd.cjs +1 -0
- package/components/button-edit/index.esm.js +343 -325
- package/components/button-edit/index.umd.cjs +1 -0
- package/components/button-group/index.umd.cjs +1 -0
- package/components/calculator/index.umd.cjs +1 -0
- package/components/calendar/index.esm.js +338 -338
- package/components/calendar/index.umd.cjs +1 -0
- package/components/capsule/index.esm.js +182 -182
- package/components/capsule/index.umd.cjs +1 -0
- package/components/checkbox/index.esm.js +326 -317
- package/components/checkbox/index.umd.cjs +1 -0
- package/components/color-picker/index.esm.js +118 -118
- package/components/color-picker/index.umd.cjs +3 -0
- package/components/combo-list/index.esm.js +338 -325
- package/components/combo-list/index.umd.cjs +1 -0
- package/components/combo-tree/index.esm.js +62 -62
- package/components/combo-tree/index.umd.cjs +1 -0
- package/components/common/index.umd.cjs +1 -0
- package/components/component/index.esm.js +382 -270
- package/components/component/index.umd.cjs +1 -0
- package/components/condition/index.esm.js +1018 -895
- package/components/condition/index.umd.cjs +1 -0
- package/components/content-container/index.esm.js +285 -212
- package/components/content-container/index.umd.cjs +1 -0
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +4761 -4319
- package/components/data-grid/index.umd.cjs +1 -0
- package/components/data-view/index.esm.js +2901 -2664
- package/components/data-view/index.umd.cjs +1 -0
- package/components/date-picker/index.esm.js +1502 -1488
- package/components/date-picker/index.umd.cjs +1 -0
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +938 -928
- package/components/designer-canvas/index.umd.cjs +1 -0
- package/components/designer-outline/index.css +1 -1
- package/components/designer-outline/index.esm.js +27 -27
- package/components/designer-outline/index.umd.cjs +1 -0
- package/components/designer-toolbox/index.esm.js +36 -12
- package/components/designer-toolbox/index.umd.cjs +1 -0
- package/components/discussion-editor/index.umd.cjs +3 -0
- package/components/discussion-list/index.umd.cjs +1 -0
- package/components/drawer/index.umd.cjs +1 -0
- package/components/dropdown/index.esm.js +241 -241
- package/components/dropdown/index.umd.cjs +2 -0
- package/components/dynamic-form/index.esm.js +1074 -885
- package/components/dynamic-form/index.umd.cjs +1 -0
- package/components/dynamic-resolver/index.esm.js +99 -94
- package/components/dynamic-resolver/index.umd.cjs +1 -0
- package/components/dynamic-view/index.umd.cjs +1 -0
- package/components/enum-editor/index.umd.cjs +1 -0
- package/components/events-editor/index.esm.js +577 -522
- package/components/events-editor/index.umd.cjs +1 -0
- package/components/expression-editor/index.esm.js +70 -70
- package/components/expression-editor/index.umd.cjs +1 -0
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +2938 -2619
- package/components/external-container/index.umd.cjs +1 -0
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +4766 -4325
- package/components/field-selector/index.umd.cjs +1 -0
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1231 -1215
- package/components/filter-bar/index.umd.cjs +1 -0
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +1062 -1052
- package/components/flow-canvas/index.umd.cjs +1 -0
- package/components/image-cropper/index.esm.js +373 -373
- package/components/image-cropper/index.umd.cjs +1 -0
- package/components/input-group/index.esm.js +398 -394
- package/components/input-group/index.umd.cjs +1 -0
- package/components/layout/index.esm.js +268 -268
- package/components/layout/index.umd.cjs +1 -0
- package/components/list-nav/index.esm.js +234 -161
- package/components/list-nav/index.umd.cjs +1 -0
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +2288 -2048
- package/components/list-view/index.umd.cjs +1 -0
- package/components/loading/index.umd.cjs +8 -0
- package/components/locale/index.umd.cjs +1 -0
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +5776 -5305
- package/components/lookup/index.umd.cjs +1 -0
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +5496 -5036
- package/components/mapping-editor/index.umd.cjs +1 -0
- package/components/message-box/index.umd.cjs +1 -0
- package/components/modal/index.umd.cjs +1 -0
- package/components/nav/index.esm.js +383 -322
- package/components/nav/index.umd.cjs +3 -0
- package/components/notify/index.umd.cjs +1 -0
- package/components/number-range/index.esm.js +273 -269
- package/components/number-range/index.umd.cjs +1 -0
- package/components/number-spinner/index.esm.js +292 -283
- package/components/number-spinner/index.umd.cjs +1 -0
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1008 -925
- package/components/order/index.umd.cjs +1 -0
- package/components/page-footer/index.esm.js +98 -98
- package/components/page-footer/index.umd.cjs +1 -0
- package/components/page-header/index.esm.js +949 -847
- package/components/page-header/index.umd.cjs +1 -0
- package/components/pagination/index.esm.js +464 -403
- package/components/pagination/index.umd.cjs +1 -0
- package/components/popover/index.umd.cjs +1 -0
- package/components/progress/index.esm.js +226 -226
- package/components/progress/index.umd.cjs +3 -0
- package/components/property-editor/index.esm.js +1110 -1092
- package/components/property-editor/index.umd.cjs +3 -0
- package/components/property-panel/index.esm.js +520 -513
- package/components/property-panel/index.umd.cjs +1 -0
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +1714 -1575
- package/components/query-solution/index.umd.cjs +1 -0
- package/components/radio-button/index.esm.js +67 -67
- package/components/radio-button/index.umd.cjs +1 -0
- package/components/radio-group/index.esm.js +298 -289
- package/components/radio-group/index.umd.cjs +1 -0
- package/components/rate/index.esm.js +195 -190
- package/components/rate/index.umd.cjs +1 -0
- package/components/response-layout/index.esm.js +112 -112
- package/components/response-layout/index.umd.cjs +1 -0
- package/components/response-layout-editor/index.esm.js +902 -877
- package/components/response-layout-editor/index.umd.cjs +1 -0
- package/components/response-toolbar/index.esm.js +874 -778
- package/components/response-toolbar/index.umd.cjs +1 -0
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +4594 -4289
- package/components/schema-selector/index.umd.cjs +8 -0
- package/components/search-box/index.esm.js +126 -126
- package/components/search-box/index.umd.cjs +1 -0
- package/components/section/index.esm.js +645 -503
- package/components/section/index.umd.cjs +1 -0
- package/components/smoke-detector/index.esm.js +120 -120
- package/components/smoke-detector/index.umd.cjs +1 -0
- package/components/spacing-editor/index.umd.cjs +1 -0
- package/components/splitter/index.esm.js +421 -348
- package/components/splitter/index.umd.cjs +1 -0
- package/components/step/index.esm.js +219 -219
- package/components/step/index.umd.cjs +1 -0
- package/components/switch/index.esm.js +232 -222
- package/components/switch/index.umd.cjs +1 -0
- package/components/tabs/index.esm.js +1823 -1744
- package/components/tabs/index.umd.cjs +1 -0
- package/components/tags/index.esm.js +399 -401
- package/components/tags/index.umd.cjs +1 -0
- package/components/text/index.esm.js +164 -164
- package/components/text/index.umd.cjs +1 -0
- package/components/textarea/index.esm.js +220 -215
- package/components/textarea/index.umd.cjs +1 -0
- package/components/time-picker/index.esm.js +693 -666
- package/components/time-picker/index.umd.cjs +1 -0
- package/components/tooltip/index.umd.cjs +1 -0
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +422 -413
- package/components/transfer/index.umd.cjs +1 -0
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +4799 -4358
- package/components/tree-grid/index.umd.cjs +1 -0
- package/components/tree-view/index.esm.js +2448 -2215
- package/components/tree-view/index.umd.cjs +1 -0
- package/components/uploader/index.esm.js +164 -164
- package/components/uploader/index.umd.cjs +2 -0
- package/components/verify-detail/index.esm.js +143 -143
- package/components/verify-detail/index.umd.cjs +1 -0
- package/components/video/index.esm.js +410 -331
- package/components/video/index.umd.cjs +1 -0
- package/components/weather/index.esm.js +901 -901
- package/components/weather/index.umd.cjs +16 -0
- package/farris.all.esm.js +12305 -11403
- package/farris.all.umd.cjs +8 -8
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/button-edit/src/designer/button-group.design.component.d.ts +7 -0
- package/types/combo-list/src/components/list-container.component.d.ts +3 -0
- package/types/combo-list/src/components/list-container.props.d.ts +5 -1
- package/types/common/entity/entity-schema.d.ts +258 -0
- package/types/component/src/component-ref.props.d.ts +4 -0
- package/types/component/src/composition/inner-component-build-info.d.ts +27 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-grid/index.d.ts +5 -2
- package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +33 -0
- package/types/data-grid/src/data-grid.component.d.ts +2 -1
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/use-group-column.d.ts +20 -0
- package/types/data-grid/src/property-config/data-grid.property-config.d.ts +4 -0
- package/types/data-grid/src/schema/schema-resolver.d.ts +2 -1
- package/types/data-view/components/column-format/boolean.component.d.ts +4 -0
- package/types/data-view/components/column-format/column-format.component.d.ts +4 -0
- package/types/data-view/components/column-format/date.component.d.ts +4 -0
- package/types/data-view/components/column-format/enum.component.d.ts +4 -0
- package/types/data-view/components/column-format/number.component.d.ts +4 -0
- package/types/data-view/composition/pagination/use-pagination.d.ts +1 -0
- package/types/data-view/composition/types.d.ts +18 -6
- package/types/data-view/composition/use-edit.d.ts +2 -1
- package/types/designer-canvas/src/composition/function/use-dragula.d.ts +2 -2
- package/types/designer-canvas/src/types.d.ts +2 -2
- package/types/dynamic-form/index.d.ts +2 -1
- package/types/dynamic-form/src/composition/response-form-component-creator.service.d.ts +31 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +2 -1
- package/types/dynamic-resolver/src/schema-resolver.d.ts +2 -1
- package/types/dynamic-resolver/src/types.d.ts +3 -2
- package/types/response-toolbar/src/response-toolbar.props.d.ts +2 -2
- package/types/response-toolbar/src/schema/schema-mapper.d.ts +4 -0
- package/types/section/src/property-config/section.property-config.d.ts +93 -0
- package/types/section/src/schema/schema-resolver.d.ts +2 -1
- package/types/tabs/src/composition/types.d.ts +2 -2
- package/types/tabs/src/designer/tab-header-item.design.component.d.ts +3 -1
- package/types/tabs/src/property-config/tab-page.property-config.d.ts +60 -0
- package/types/tabs/src/schema/schema-resolver.d.ts +2 -1
- package/types/tags/index.d.ts +36 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(P,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):(P=typeof globalThis<"u"?globalThis:P||self,e(P.calendar={},P.Vue,P.LodashES))})(this,function(P,e,ae){"use strict";const Q={},X={};function z(t){const{properties:a,title:d,ignore:m}=t,f=m&&Array.isArray(m),u=Object.keys(a).reduce((c,s)=>((!f||!m.find(V=>V==s))&&(c[s]=a[s].type==="object"&&a[s].properties?z(a[s]):ae.cloneDeep(a[s].default)),c),{});return(!f||!m.find(c=>c=="id"))&&(u.id=`${d}-${Date.now()}`),u}function x(t,a={},d){const m=Q[t];if(m){let f=z(m);const u=X[t];return f=u?u({getSchemaByType:x},f,a,d):f,f}return null}function re(t,a){const d=z(a);return Object.keys(t).reduce((m,f)=>(m[f]&&typeof m[f]=="object"?Object.assign(m[f],t[f]):m[f]=t[f],m),d),d}function oe(t,a){return Object.keys(t).filter(m=>t[m]!=null).reduce((m,f)=>{if(a.has(f)){const u=a.get(f);if(typeof u=="string")m[u]=t[f];else{const c=u(f,t[f],t);Object.assign(m,c)}}else m[f]=t[f];return m},{})}function ce(t,a,d=new Map){const m=re(t,a);return oe(m,d)}function se(t={}){function a(n,p,g,D){if(typeof g=="number")return D[n].length===g;if(typeof g=="object"){const l=Object.keys(g)[0],y=g[l];if(l==="not")return Number(D[n].length)!==Number(y);if(l==="moreThan")return Number(D[n].length)>=Number(y);if(l==="lessThan")return Number(D[n].length)<=Number(y)}return!1}function d(n,p,g,D){return D[n]&&D[n].propertyValue&&String(D[n].propertyValue.value)===String(g)}const m=new Map([["length",a],["getProperty",d]]);Object.keys(t).reduce((n,p)=>(n.set(p,t[p]),n),m);function f(n,p){const g=n;return typeof p=="number"?[{target:g,operator:"length",param:null,value:Number(p)}]:typeof p=="boolean"?[{target:g,operator:"getProperty",param:n,value:!!p}]:typeof p=="object"?Object.keys(p).map(D=>{if(D==="length")return{target:g,operator:"length",param:null,value:p[D]};const l=D,y=p[D];return{target:g,operator:"getProperty",param:l,value:y}}):[]}function u(n){return Object.keys(n).reduce((g,D)=>{const l=f(D,n[D]);return g.push(...l),g},[])}function c(n,p){if(m.has(n.operator)){const g=m.get(n.operator);return g&&g(n.target,n.param,n.value,p)||!1}return!1}function s(n,p){return u(n).reduce((l,y)=>l&&c(y,p),!0)}function V(n,p){const g=Object.keys(n),D=g.includes("allOf"),l=g.includes("anyOf"),y=D||l,i=(y?n[y?D?"allOf":"anyOf":"allOf"]:[n]).map(o=>s(o,p));return D?!i.includes(!1):i.includes(!0)}return{parseValueSchema:V}}const le={},ie={};se();function ue(t,a,d=new Map,m=(c,s,V)=>s,f={},u=c=>c){return Q[a.title]=a,X[a.title]=m,le[a.title]=f,ie[a.title]=u,(c={})=>{const s=ce(c,a,d),V=Object.keys(t).reduce((n,p)=>(n[p]=t[p].default,n),{});return Object.assign(V,s)}}function de(t,a){return{customClass:a.class,customStyle:a.style}}const fe=new Map([["appearance",de]]);function ye(t,a,d){return a}const he={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/calendar.schema.json",title:"calendar",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for calendar",type:"string"},type:{description:"The type string of calendar",type:"string",default:"calendar"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}}},required:["id","type"]},me={title:"calendar",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:[]}}}}}},_={events:{Type:Array,default:[]},firstDayOfTheWeek:{type:String,default:"Sun."}},U=ue(_,he,fe,ye,me),$=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var A=(t=>(t[t.previous=1]="previous",t[t.current=2]="current",t[t.next=3]="next",t))(A||{});function G(){function t(){return{year:0,month:0,day:0}}function a(n){return new Date(n.year||0,n.month?n.month-1:0,n.day||0,n.hour?n.hour:0,n.minute?n.minute:0,n.second?n.second:0,0)}function d(n){const p=new Date;return n.year||(n.year=p.getFullYear()),n.month||(n.month=p.getMonth()+1),n.day||(n.day=1),new Date(n.year,n.month-1,n.day,n.hour?n.hour:0,n.minute?n.minute:0,n.second?n.second:0,0)}function m(n){return new Date(n.year||1,(n.month||1)-1,n.day,n.hour?n.hour:0,n.minute?n.minute:0,n.second?n.second:0,0).getDay()}function f(n){return $.indexOf(n)}function u(n){return a(n).getTime()}function c(n){return Math.round(u(n)/1e3)}function s(n,p,g){const D=u(p),l=u(g),y=u(n);return l-y>y-D?p:g}function V(){const n=new Date;return{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate(),hour:n.getHours(),minute:n.getMinutes(),second:n.getSeconds()}}return{emptyDate:t,getDate:a,getDate2:d,getDayNumber:m,getEpocTime:c,getNearDate:s,getWeekdayIndex:f,getTimeInMilliseconds:u,getToday:V}}function pe(){function t(u,c){return new Date(c,u,0).getDate()}function a(u,c,s){return new Date(u,c-1,s,0,0,0,0)}function d(u,c){const s=a(c,u,1);return s.setMonth(s.getMonth()-1),t(s.getMonth()+1,s.getFullYear())}function m(u,c){const s={year:u===12?c+1:c},V=u===12?1:u+1;return s.month=V,s}function f(u,c){const s={year:u===1?c-1:c},V=u===1?12:u-1;return s.month=V,s}return{daysInMonth:t,daysInPreMonth:d,getNextMonth:m,getPreviousMonth:f}}function Z(){const{getToday:t,getDayNumber:a}=G(),{daysInMonth:d,daysInPreMonth:m,getNextMonth:f,getPreviousMonth:u}=pe();function c(h){const k=$.indexOf(h);return k>0?7-k:0}function s(h){const{day:k,month:i,year:r}=h;if(k===void 0||i===void 0||r===void 0)throw new Error("invalided date.");const o=k===1,v=o?m(i,r):k-1,N=o?i-1:i,w=N<1,M=w?12:N;return{year:w?r-1:r,month:M,day:v}}function V(h){const{day:k,month:i,year:r}=h;if(k===void 0||i===void 0||r===void 0)throw new Error("invalided date.");const o=d(i,r),v=k===o,N=v?1:k+1,w=v?i+1:i,M=w>12,b=M?1:w;return{year:M?r+1:r,month:b,day:N}}function n(h){const k=u(h.month||1,h.year||1),i=d(k.month||1,k.year||1);return{day:(h.day||1)<=i?h.day:i,month:k.month,year:k.year}}function p(h){const k=f(h.month||1,h.year||1),i=d(k.month||1,k.year||1);return{day:(h.day||1)<=i?h.day:i,month:k.month,year:k.year}}function g(h){const i=(h.day||1)-7,r=i<1,o=r?d(h.month||1,h.year||1)+i:i,v=r?u(h.month||1,h.year||1):h;return{day:o,month:v.month,year:v.year}}function D(h){const i=(h.day||1)+7,r=d(h.month||1,h.year||1),o=i>r,v=o?i-r:i,N=o?f(h.month||1,h.year||1):h;return{day:v,month:N.month,year:N.year}}function l(h,k,i,r){const o={day:h,month:k,year:i},N=c(r)===0?1:0,w=a(o)+N,M=t();let b=s(o);const O=[];for(let j=w-1;j>=1;j--){const H=b.month!==o.month?A.previous:A.current,C=b.month===k&&b.day===M.day&&b.month===M.month&&b.year===M.year;O.push({date:b,monthTag:H,isCurrent:C}),j>1&&(b=s(b))}let W=V(o);const S=[];for(let j=w+1;j<=7;j++){const H=b.month!==o.month?A.next:A.current,C=W.day===M.day&&W.month===M.month&&W.year===M.year;S.push({date:W,monthTag:H,isCurrent:C}),j<7&&(W=V(W))}const T=h===M.day&&k===M.month&&i===M.year;return{days:[...O.reverse(),{date:o,monthTag:A.current,isCurrent:T},...S],weekNumber:0,year:i}}function y(h,k,i){const r=[],o=d(h,k);for(let v=1;v<=o;v+=7){const N=l(v,h,k,i);r.push(N)}return r}return{getMonthlyCalendar:y,getWeeklyCalendar:l,getPreviousDay:s,getNextDay:V,getDayInPreviousWeek:g,getDayInNextWeek:D,getDayInPreviousMonth:n,getDayInNextMonth:p}}function F(){const{getTimeInMilliseconds:t}=G();function a(l){return l&&l.year!==0&&l.month!==0&&l.day!==0}function d(l){return l&&l.year!==0&&l.month!==0}function m(l){return l&&l.year!==0}function f(l,y){return t(l)<t(y)}function u(l,y){return t(l)<=t(y)}function c(l,y){return t(l)===t(y)}function s(l,y){const h=t(y);return t(l.from)===h||t(l.to)===h}function V(l,y){return!y||!a(y.to)||!a(y.from)?!1:u(y.from,l)&&u(l,y.to)}function n(l,y){return a(y)&&t(l)>=t(y)}function p(l,y){return a(y)&&t(l)<=t(y)}function g(l,y){return t({year:l.year,month:l.month,day:l.day})===t({year:y.year,month:y.month,day:y.day})}function D(l,y){return t({hour:l.hour,minute:l.minute,second:l.second})===t({hour:y.hour,minute:y.minute,second:y.second})}return{isDateEarlier:f,equal:c,inPeriod:V,isPoint:s,equalOrEarlier:u,isInitializedDate:a,isInitializedMonth:d,isInitializedYear:m,isMonthDisabledByDisableSince:n,isMonthDisabledByDisableUntil:p,sameTime:D,sameDay:g}}const L={1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"},K={activeView:{Type:Number,default:3},title:{Type:String,default:""},dailyViewTitle:{Type:String,default:"Day"},weeklyViewTitle:{Type:String,default:"Week"},monthlyViewTitle:{Type:String,default:"Month"}},I=e.defineComponent({name:"FCalendarHeader",props:K,emits:["ViewChange","Previous","Next","ResetToToday"],setup(t,a){const d=e.ref(t.title),m=e.ref(t.dailyViewTitle),f=e.ref(t.weeklyViewTitle),u=e.ref(t.monthlyViewTitle),c=2,s=62,V=e.ref(t.activeView),n=e.ref("Today");e.watch(()=>t.title,()=>{d.value=t.title});const p=e.computed(()=>({top:`${c}px`,left:`${V.value*(c+1)+(V.value-1)*(s+1)}px`})),g=e.computed(()=>V.value===1?m.value:V.value===2?f.value:u.value);function D(){V.value=1,a.emit("ViewChange",1)}function l(){V.value=2,a.emit("ViewChange",2)}function y(){V.value=3,a.emit("ViewChange",3)}function h(){a.emit("Previous",V.value)}function k(){a.emit("Next",V.value)}function i(){a.emit("ResetToToday")}return()=>e.createVNode("div",{class:"f-calendar-header"},[e.createVNode("div",{class:"f-calendar-title"},[d.value]),e.createVNode("div",{class:"f-calendar-navigator"},[e.createVNode("div",{class:"f-calendar-navigator-today btn btn-default",onClick:()=>i()},[n.value]),e.createVNode("div",{class:"f-calendar-navigator-button-group"},[e.createVNode("div",{class:"f-calendar-navigator-previous btn btn-default",onClick:()=>h()},[e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-left"},null)]),e.createVNode("div",{class:"f-calendar-navigator-next btn btn-default",onClick:()=>k()},[e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right"},null)])])]),e.createVNode("div",{class:"f-calendar-view-switch"},[e.createVNode("div",{class:"f-calendar-view-switch-panel"},[e.createVNode("span",{class:"f-calendar-view-switch-daily",onClick:r=>D()},[m.value]),e.createVNode("span",{class:"f-calendar-view-switch-weekly",onClick:r=>l()},[f.value]),e.createVNode("span",{class:"f-calendar-view-switch-monthly",onClick:r=>y()},[u.value])]),e.createVNode("div",{class:"f-calendar-view-switch-active-view",style:p.value},[g.value])])])}}),ee={dates:{Type:Array,default:[]},daysInWeek:{Type:Array,default:$},enableKeyboadNavigate:{Type:Boolean,default:!0},enableMarkCurrent:{Type:Boolean,default:!0},events:{Type:Array,default:[]},activeDay:{Type:Object,default:null}};var Y=(t=>(t[t.enter=13]="enter",t[t.esc=27]="esc",t[t.space=32]="space",t[t.leftArrow=37]="leftArrow",t[t.upArrow=38]="upArrow",t[t.rightArrow=39]="rightArrow",t[t.downArrow=40]="downArrow",t[t.tab=9]="tab",t[t.shift=16]="shift",t))(Y||{});function ve(){function t(a){const d=a.key||a.keyCode;return d==="Enter"||d===13?13:d==="Escape"||d===27?27:d===" "||d===32?32:d==="ArrowLeft"||d===37?37:d==="ArrowUp"||d===38?38:d==="ArrowRight"||d===39?39:d==="ArrowDown"||d===40?40:d==="Tab"||d===9?9:d==="Shift"||d===16?16:-1}return{getKeyCodeFromEvent:t}}const B=e.defineComponent({name:"FCalendarMonthView",props:ee,emits:["click","keyDown"],setup(t,a){const d=e.ref(t.daysInWeek),m=e.ref(t.enableKeyboadNavigate),f=e.ref(t.enableMarkCurrent),u=e.ref(t.activeDay),c=e.ref(t.events),{equal:s,sameDay:V}=F(),{getKeyCodeFromEvent:n}=ve();function p(i,r){return i.forEach(o=>{o.days.forEach(v=>{const N=r.filter(w=>V(w.starts,v.date));N&&N.length&&(v.events=[...N])})}),i}const g=e.ref(p(t.dates,c.value));e.watch(()=>t.dates,()=>{g.value=p(t.dates,c.value)}),e.watch(()=>t.activeDay,()=>{u.value=t.activeDay}),e.watch(()=>t.events,()=>{c.value=t.events});function D(i){return!!u.value&&s({year:u.value.year,month:u.value.month,day:u.value.day},i)}const l=(i,r,o)=>{const N={"f-datepicker-no-currmonth":i.monthTag===A.previous||i.monthTag===A.next},w=`d_${r}_${o}`;return N[w]=!0,N},y=i=>{const r=i.monthTag===A.current&&D(i.date),o=i.isCurrent&&f.value;return{"f-calendar-month-view-date":!0,"f-calendar-month-view-selected":r,"f-calendar-month-view-current":o}};function h(i,r){i.stopPropagation(),a.emit("click",r.date)}function k(i,r){const o=n(i);o!==Y.tab&&(i.preventDefault(),o===Y.enter||o===Y.space?h(i,r):m.value&&a.emit("keyDown",r.date))}return()=>e.createVNode("div",{class:"f-calendar-month-view"},[e.createVNode("table",{class:"f-datepicker-table",cellpadding:"0"},[e.createVNode("thead",null,[e.createVNode("tr",null,[d.value&&d.value.map(i=>e.createVNode("th",{scope:"col",style:"padding: 4px 4px 8px"},[i]))])]),e.createVNode("tbody",null,[g.value&&g.value.map((i,r)=>e.createVNode("tr",null,[i.days&&i.days.map((o,v)=>e.createVNode("td",{id:`d_${r}_${v}`,tabindex:"0",class:l(o,r,v),onClick:N=>h(N,o),onKeydown:N=>k(N,o)},[e.createVNode("div",{class:"f-calendar-month-view-title"},[e.createVNode("div",{class:y(o)},[o.date.day]),e.createVNode("div",{class:"f-calendar-month-view-date-month"},[o.date.day===1?L[o.date.month||1]:""])]),o.events&&o.events.length&&o.events.map(N=>e.createVNode("div",{class:"f-calendar-month-view-event-item"},[N.title]))]))]))])])])}}),te={daysInWeek:{Type:Array,default:$},enableMarkCurrent:{Type:Boolean,default:!0},events:{Type:Array,default:[]},week:{Type:Object,default:{days:[],weekNumber:0,year:0}}},R=e.defineComponent({name:"FCalendarWeekView",props:te,emits:[],setup(t){const a=e.ref(),d=e.ref(),m=e.ref(t.daysInWeek),f=e.ref(t.week),u=e.ref(t.enableMarkCurrent),c=e.ref(t.events),s=e.ref([]),{equal:V}=F();function n(r){return f.value.days.map(v=>{const N={year:v.date.year,month:v.date.month,day:v.date.day,hour:r.hour,minute:r.minute,second:r.second},w=c.value.filter(M=>V(M.starts,N));return{day:N,events:w}})}function p(){const r=[];for(let o=0;o<24;o++){const v={hour:o,minute:0,second:0},N={hour:o,minute:30,second:0},w=n(v),M=n(N);r.push({time:v,events:w,title:o>0?`${o}:00`:"",part:"upper"}),r.push({time:N,events:M,title:`${o}:30`,part:"lower"})}s.value=r}p(),e.watch(()=>t.week,()=>{f.value=t.week,p()}),e.watch(()=>t.events,()=>{c.value=t.events,p()});const g=r=>({"f-calendar-week-view-date":!0,"f-calendar-week-view-current":r.isCurrent&&u.value});function D(){return e.createVNode("div",{class:"f-calendar-week-view-header"},[e.createVNode("div",{class:"f-calendar-week-view-header-corner"},null),e.createVNode("div",{class:"f-calendar-week-view-header-primary"},[e.createVNode("div",{class:"f-calendar-week-view-header-columns"},[m.value.map((r,o)=>e.createVNode("div",{class:"f-calendar-week-view-header-cell"},[e.createVNode("div",{class:g(f.value.days[o])},[f.value.days[o].date.day]),e.createVNode("span",null,[r])]))])])])}function l(){return e.createVNode("div",{class:"f-calendar-week-view-content-side"},[e.createVNode("div",{class:"f-calendar-side"},[s.value.map(r=>e.createVNode("div",{class:"f-calendar-side-row"},[e.createVNode("div",{class:"f-calendar-side-row-number"},[r.part==="upper"?r.title:""])]))])])}function y(r){return{"f-calendar-week-view-item":!0,"f-calendar-week-view-item-upper":r.part==="upper","f-calendar-week-view-item-lower":r.part==="lower"}}function h(r){const b=(r.starts.hour||0)+(r.starts.minute||0)/60;return{height:`${44*((r.ends.hour||0)+(r.ends.minute||0)/60-b)-2-2-1-1}px`}}function k(){return s.value.map(r=>e.createVNode("div",{class:y(r)},[r.events.map(o=>e.createVNode("div",{class:"f-calendar-week-view-item-cell"},[o.events.length>0&&o.events.map(v=>e.createVNode("div",{class:"f-calendar-event",style:h(v)},[v.title]))]))]))}function i(){return e.createVNode("div",{ref:d,class:"f-calendar-content-primary"},[e.createVNode("div",{class:"f-calendar-content-data"},[k()])])}return e.onMounted(()=>{a.value&&a.value.scrollTo(0,250)}),()=>e.createVNode("div",{class:"f-calendar-week-view"},[D(),e.createVNode("div",{class:"f-calendar-week-view-content",ref:a},[l(),i()])])}}),ne={day:{Type:Object,default:{}},dayInWeek:{Type:String,default:""},enableMarkCurrent:{Type:Boolean,default:!0},events:{Type:Array,default:[]}},q=e.defineComponent({name:"FCalendarDayView",props:ne,emits:[],setup(t){const a=e.ref(),d=e.ref(),m=e.ref(t.dayInWeek),f=e.ref(t.day),u=e.ref(t.enableMarkCurrent),c=e.ref(t.events),s=e.ref([]),{equal:V}=F();function n(r){const o={year:f.value.date.year,month:f.value.date.month,day:f.value.date.day,hour:r.hour,minute:r.minute,second:r.second},v=c.value.filter(N=>V(N.starts,o));return[{day:o,events:v}]}function p(){const r=[];for(let o=0;o<24;o++){const v={hour:o,minute:0,second:0},N={hour:o,minute:30,second:0},w=n(v),M=n(N);r.push({time:v,events:w,title:o>0?`${o}:00`:"",part:"upper"}),r.push({time:N,events:M,title:`${o}:30`,part:"lower"})}s.value=r}p(),e.watch(()=>t.day,()=>{f.value=t.day,p()}),e.watch(()=>t.events,()=>{c.value=t.events,p()});const g=r=>({"f-calendar-day-view-date":!0,"f-calendar-day-view-current":r.isCurrent&&u.value});function D(){return e.createVNode("div",{class:"f-calendar-day-view-header"},[e.createVNode("div",{class:"f-calendar-day-view-header-corner"},null),e.createVNode("div",{class:"f-calendar-day-view-header-primary"},[e.createVNode("div",{class:"f-calendar-day-view-header-columns"},[e.createVNode("div",{class:"f-calendar-day-view-header-cell"},[e.createVNode("div",{class:g(f.value)},[f.value.date.day]),e.createVNode("span",null,[m.value])])])])])}function l(){return e.createVNode("div",{class:"f-calendar-day-view-content-side"},[e.createVNode("div",{class:"f-calendar-side"},[s.value.map(r=>e.createVNode("div",{class:"f-calendar-side-row"},[e.createVNode("div",{class:"f-calendar-side-row-number"},[r.part==="upper"?r.title:""])]))])])}function y(r){return{"f-calendar-day-view-item":!0,"f-calendar-day-view-item-upper":r.part==="upper","f-calendar-day-view-item-lower":r.part==="lower"}}function h(r){const b=(r.starts.hour||0)+(r.starts.minute||0)/60;return{height:`${44*((r.ends.hour||0)+(r.ends.minute||0)/60-b)-2-2-1-1}px`}}function k(){return s.value.map(r=>e.createVNode("div",{class:y(r)},[r.events.map(o=>e.createVNode("div",{class:"f-calendar-day-view-item-cell"},[o.events.length>0&&o.events.map(v=>e.createVNode("div",{class:"f-calendar-event",style:h(v)},[v.title]))]))]))}function i(){return e.createVNode("div",{ref:d,class:"f-calendar-content-primary"},[e.createVNode("div",{class:"f-calendar-content-data"},[k()])])}return e.onMounted(()=>{a.value&&a.value.scrollTo(0,250)}),()=>e.createVNode("div",{class:"f-calendar-day-view"},[D(),e.createVNode("div",{class:"f-calendar-day-view-content",ref:a},[l(),i()])])}}),E=e.defineComponent({name:"FCalendar",props:_,emits:[],setup(t){const{sameDay:a}=F(),{getToday:d}=G(),m=e.ref(t.firstDayOfTheWeek),f=e.ref(t.events),u=d(),c=e.ref({year:u.year||1,month:u.month||1,day:u.day||1}),s=e.ref(3),{getMonthlyCalendar:V,getWeeklyCalendar:n,getPreviousDay:p,getNextDay:g,getDayInPreviousWeek:D,getDayInNextWeek:l,getDayInPreviousMonth:y,getDayInNextMonth:h}=Z(),k=e.computed(()=>`${L[c.value.month||1]} ${c.value.year}`),i=e.computed(()=>V(c.value.month||1,c.value.year||1,m.value)),r=e.computed(()=>n(c.value.day||1,c.value.month||1,c.value.year||1,m.value)),o=e.computed(()=>r.value.days.find(T=>a(T.date,c.value))||r.value.days[1]),v=e.computed(()=>{const T=r.value.days.findIndex(j=>a(j.date,c.value)),J=T>-1?T:1;return $[J]}),N=e.computed(()=>s.value===3),w=e.computed(()=>s.value===2),M=e.computed(()=>s.value===1);function b(T){s.value=T}function O(T){T===1&&(c.value=p(c.value)),T===2&&(c.value=D(c.value)),T===3&&(c.value=y(c.value))}function W(T){T===1&&(c.value=g(c.value)),T===2&&(c.value=l(c.value)),T===3&&(c.value=h(c.value))}function S(){c.value={year:u.year||1,month:u.month||1,day:u.day||1}}return()=>e.createVNode("div",{class:"f-calendar"},[e.createVNode(I,{activeView:s.value,title:k.value,onViewChange:T=>b(T),onPrevious:T=>O(T),onNext:T=>W(T),onResetToToday:()=>S()},null),e.createVNode("div",null,[M.value&&e.createVNode(q,{day:o.value,dayInWeek:v.value,events:f.value},null),w.value&&e.createVNode(R,{week:r.value,events:f.value},null),N.value&&e.createVNode(B,{activeDay:c.value,dates:i.value,events:f.value},null)])])}});function we(t,a,d){var N;function m(){}const f="",u="",c=e.ref();function s(){return(a==null?void 0:a.schema.componentType)!=="frame"}function V(){return!1}function n(){return(a==null?void 0:a.schema.componentType)!=="frame"}function p(){return(a==null?void 0:a.schema.componentType)==="frame"}function g(w){if(!w||!w.value)return null;if(w.value.schema&&w.value.schema.type==="component")return w.value;const M=e.ref(w==null?void 0:w.value.parent),b=g(M);return b||null}function D(w=a){const{componentInstance:M,designerItemElementRef:b}=w;return!M||!M.value?null:M.value.canMove?b:D(w.parent)}function l(w){return!!d}function y(){return(a==null?void 0:a.schema.label)||(a==null?void 0:a.schema.title)||(a==null?void 0:a.schema.name)}function h(){}function k(w,M){}function i(w,M){const{componentType:b}=w;let O=x(b,w,M);const W=b.toLowerCase().replace("-","_");return O&&!O.id&&O.type===b&&(O.id=`${W}_${Math.random().toString().slice(2,6)}`),O}function r(w,M){const b=String(w.getAttribute("data-controltype")),O=w.getAttribute("data-feature"),W=O?JSON.parse(O):{};W.parentComponentInstance=c.value;let S=x(b,W);const T=b.toLowerCase().replace("-","_");return S&&!S.id&&S.type===b&&(S.id=`${T}_${Math.random().toString().slice(2,6)}`),S}function o(w){}function v(...w){}return c.value={canMove:s(),canSelectParent:V(),canDelete:n(),canNested:!p(),contents:a==null?void 0:a.schema.contents,elementRef:t,parent:(N=a==null?void 0:a.parent)==null?void 0:N.componentInstance,schema:a==null?void 0:a.schema,styles:f,designerClass:u,canAccepts:l,getBelongedComponentInstance:g,getDraggableDesignItemElement:D,getDraggingDisplayText:y,getPropConfig:v,getDragScopeElement:h,onAcceptMovedChildElement:k,onAcceptNewChildElement:r,onChildElementMovedOut:o,addNewChildComponentSchema:i,updateDragAndDropRules:m,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},c}const ge=e.defineComponent({name:"FCalendarDesign",props:_,emits:[],setup(t,a){const{sameDay:d}=F(),{getToday:m}=G(),f=e.ref(t.firstDayOfTheWeek),u=e.ref(t.events),c=m(),s=e.ref({year:c.year||1,month:c.month||1,day:c.day||1}),V=e.ref(3),n=e.ref(),p=e.inject("design-item-context"),g=we(n,p);e.onMounted(()=>{n.value.componentInstance=g}),a.expose(g.value);const{getMonthlyCalendar:D,getWeeklyCalendar:l,getPreviousDay:y,getNextDay:h,getDayInPreviousWeek:k,getDayInNextWeek:i,getDayInPreviousMonth:r,getDayInNextMonth:o}=Z(),v=e.computed(()=>`${L[s.value.month||1]} ${s.value.year}`),N=e.computed(()=>D(s.value.month||1,s.value.year||1,f.value)),w=e.computed(()=>l(s.value.day||1,s.value.month||1,s.value.year||1,f.value)),M=e.computed(()=>w.value.days.find(C=>d(C.date,s.value))||w.value.days[1]),b=e.computed(()=>{const C=w.value.days.findIndex(ke=>d(ke.date,s.value)),Ve=C>-1?C:1;return $[Ve]}),O=e.computed(()=>V.value===3),W=e.computed(()=>V.value===2),S=e.computed(()=>V.value===1);function T(C){V.value=C}function J(C){C===1&&(s.value=y(s.value)),C===2&&(s.value=k(s.value)),C===3&&(s.value=r(s.value))}function j(C){C===1&&(s.value=h(s.value)),C===2&&(s.value=i(s.value)),C===3&&(s.value=o(s.value))}function H(){s.value={year:c.year||1,month:c.month||1,day:c.day||1}}return()=>e.createVNode("div",{ref:n,class:"f-calendar"},[e.createVNode(I,{activeView:V.value,title:v.value,onViewChange:C=>T(C),onPrevious:C=>J(C),onNext:C=>j(C),onResetToToday:()=>H()},null),e.createVNode("div",null,[S.value&&e.createVNode(q,{day:M.value,dayInWeek:b.value,events:u.value},null),W.value&&e.createVNode(R,{week:w.value,events:u.value},null),O.value&&e.createVNode(B,{activeDay:s.value,dates:N.value,events:u.value},null)])])}});E.install=t=>{t.component(E.name,E).component(q.name,q).component(I.name,I).component(B.name,B).component(R.name,R)},E.register=(t,a,d,m)=>{t.calendar=E,a.calendar=U},E.registerDesigner=(t,a,d)=>{t.calendar=ge,a.calendar=U},P.FCalendar=E,P.FCalendarDayView=q,P.FCalendarHeader=I,P.FCalendarMonthView=B,P.FCalendarWeekView=R,P.MonthTag=A,P.calendarProps=_,P.dayViewProps=ne,P.default=E,P.defaultNameOfMonths=L,P.headerProps=K,P.monthViewProps=ee,P.propsResolver=U,P.weekDays=$,P.weekViewProps=te,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as F, ref as y, watch as D, computed as
|
|
1
|
+
import { defineComponent as F, ref as y, watch as D, computed as S, onMounted as P, createVNode as w, nextTick as T, inject as H } from "vue";
|
|
2
2
|
import { cloneDeep as Q } from "lodash-es";
|
|
3
3
|
import { withInstall as U } from "../common/index.esm.js";
|
|
4
4
|
const X = "https://json-schema.org/draft/2020-12/schema", Y = "https://farris-design.gitee.io/capsule.schema.json", Z = "capsule", I = "A Farris Component", K = "object", x = {
|
|
@@ -76,101 +76,101 @@ const X = "https://json-schema.org/draft/2020-12/schema", Y = "https://farris-de
|
|
|
76
76
|
required: ee
|
|
77
77
|
}, q = {}, _ = {};
|
|
78
78
|
function W(n) {
|
|
79
|
-
const { properties: e, title:
|
|
80
|
-
return l.id = `${
|
|
79
|
+
const { properties: e, title: u, ignore: l } = n, c = l && Array.isArray(l), o = Object.keys(e).reduce((i, g) => ((!c || !l.find((O) => O == g)) && (i[g] = e[g].type === "object" && e[g].properties ? W(e[g]) : Q(e[g].default)), i), {});
|
|
80
|
+
return (!c || !l.find((i) => i == "id")) && (o.id = `${u}-${Date.now()}`), o;
|
|
81
81
|
}
|
|
82
|
-
function N(n, e = {}) {
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
let
|
|
86
|
-
const
|
|
87
|
-
return
|
|
82
|
+
function N(n, e = {}, u) {
|
|
83
|
+
const l = q[n];
|
|
84
|
+
if (l) {
|
|
85
|
+
let c = W(l);
|
|
86
|
+
const o = _[n];
|
|
87
|
+
return c = o ? o({ getSchemaByType: N }, c, e, u) : c, c;
|
|
88
88
|
}
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
91
91
|
function ne(n, e) {
|
|
92
|
-
const
|
|
93
|
-
return Object.keys(n).reduce((l,
|
|
92
|
+
const u = W(e);
|
|
93
|
+
return Object.keys(n).reduce((l, c) => (l[c] && typeof l[c] == "object" ? Object.assign(l[c], n[c]) : l[c] = n[c], l), u), u;
|
|
94
94
|
}
|
|
95
95
|
function ae(n, e) {
|
|
96
|
-
return Object.keys(n).filter((l) => n[l] != null).reduce((l,
|
|
97
|
-
if (e.has(
|
|
98
|
-
const o = e.get(
|
|
96
|
+
return Object.keys(n).filter((l) => n[l] != null).reduce((l, c) => {
|
|
97
|
+
if (e.has(c)) {
|
|
98
|
+
const o = e.get(c);
|
|
99
99
|
if (typeof o == "string")
|
|
100
|
-
l[o] = n[
|
|
100
|
+
l[o] = n[c];
|
|
101
101
|
else {
|
|
102
|
-
const
|
|
103
|
-
Object.assign(l,
|
|
102
|
+
const i = o(c, n[c], n);
|
|
103
|
+
Object.assign(l, i);
|
|
104
104
|
}
|
|
105
105
|
} else
|
|
106
|
-
l[
|
|
106
|
+
l[c] = n[c];
|
|
107
107
|
return l;
|
|
108
108
|
}, {});
|
|
109
109
|
}
|
|
110
|
-
function le(n, e,
|
|
110
|
+
function le(n, e, u = /* @__PURE__ */ new Map()) {
|
|
111
111
|
const l = ne(n, e);
|
|
112
|
-
return ae(l,
|
|
112
|
+
return ae(l, u);
|
|
113
113
|
}
|
|
114
114
|
function se(n = {}) {
|
|
115
|
-
function e(
|
|
116
|
-
if (typeof
|
|
117
|
-
return
|
|
118
|
-
if (typeof
|
|
119
|
-
const h = Object.keys(
|
|
115
|
+
function e(r, f, p, d) {
|
|
116
|
+
if (typeof p == "number")
|
|
117
|
+
return d[r].length === p;
|
|
118
|
+
if (typeof p == "object") {
|
|
119
|
+
const h = Object.keys(p)[0], b = p[h];
|
|
120
120
|
if (h === "not")
|
|
121
|
-
return Number(
|
|
121
|
+
return Number(d[r].length) !== Number(b);
|
|
122
122
|
if (h === "moreThan")
|
|
123
|
-
return Number(
|
|
123
|
+
return Number(d[r].length) >= Number(b);
|
|
124
124
|
if (h === "lessThan")
|
|
125
|
-
return Number(
|
|
125
|
+
return Number(d[r].length) <= Number(b);
|
|
126
126
|
}
|
|
127
127
|
return !1;
|
|
128
128
|
}
|
|
129
|
-
function r
|
|
130
|
-
return
|
|
129
|
+
function u(r, f, p, d) {
|
|
130
|
+
return d[r] && d[r].propertyValue && String(d[r].propertyValue.value) === String(p);
|
|
131
131
|
}
|
|
132
132
|
const l = /* @__PURE__ */ new Map([
|
|
133
133
|
["length", e],
|
|
134
|
-
["getProperty",
|
|
134
|
+
["getProperty", u]
|
|
135
135
|
]);
|
|
136
|
-
Object.keys(n).reduce((
|
|
137
|
-
function
|
|
138
|
-
const
|
|
139
|
-
return typeof
|
|
140
|
-
if (
|
|
141
|
-
return { target:
|
|
142
|
-
const h =
|
|
143
|
-
return { target:
|
|
136
|
+
Object.keys(n).reduce((r, f) => (r.set(f, n[f]), r), l);
|
|
137
|
+
function c(r, f) {
|
|
138
|
+
const p = r;
|
|
139
|
+
return typeof f == "number" ? [{ target: p, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: p, operator: "getProperty", param: r, value: !!f }] : typeof f == "object" ? Object.keys(f).map((d) => {
|
|
140
|
+
if (d === "length")
|
|
141
|
+
return { target: p, operator: "length", param: null, value: f[d] };
|
|
142
|
+
const h = d, b = f[d];
|
|
143
|
+
return { target: p, operator: "getProperty", param: h, value: b };
|
|
144
144
|
}) : [];
|
|
145
145
|
}
|
|
146
|
-
function o(
|
|
147
|
-
return Object.keys(
|
|
148
|
-
const h =
|
|
149
|
-
return
|
|
146
|
+
function o(r) {
|
|
147
|
+
return Object.keys(r).reduce((p, d) => {
|
|
148
|
+
const h = c(d, r[d]);
|
|
149
|
+
return p.push(...h), p;
|
|
150
150
|
}, []);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
if (l.has(
|
|
154
|
-
const
|
|
155
|
-
return
|
|
152
|
+
function i(r, f) {
|
|
153
|
+
if (l.has(r.operator)) {
|
|
154
|
+
const p = l.get(r.operator);
|
|
155
|
+
return p && p(r.target, r.param, r.value, f) || !1;
|
|
156
156
|
}
|
|
157
157
|
return !1;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
return o(
|
|
159
|
+
function g(r, f) {
|
|
160
|
+
return o(r).reduce((h, b) => h && i(b, f), !0);
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const
|
|
164
|
-
return
|
|
162
|
+
function O(r, f) {
|
|
163
|
+
const p = Object.keys(r), d = p.includes("allOf"), h = p.includes("anyOf"), b = d || h, V = (b ? r[b ? d ? "allOf" : "anyOf" : "allOf"] : [r]).map((C) => g(C, f));
|
|
164
|
+
return d ? !V.includes(!1) : V.includes(!0);
|
|
165
165
|
}
|
|
166
|
-
return { parseValueSchema:
|
|
166
|
+
return { parseValueSchema: O };
|
|
167
167
|
}
|
|
168
|
-
const ce = {},
|
|
168
|
+
const ce = {}, re = {};
|
|
169
169
|
se();
|
|
170
|
-
function
|
|
171
|
-
return q[e.title] = e, _[e.title] = l, ce[e.title] =
|
|
172
|
-
const
|
|
173
|
-
return Object.assign(
|
|
170
|
+
function ue(n, e, u = /* @__PURE__ */ new Map(), l = (i, g, O) => g, c = {}, o = (i) => i) {
|
|
171
|
+
return q[e.title] = e, _[e.title] = l, ce[e.title] = c, re[e.title] = o, (i = {}) => {
|
|
172
|
+
const g = le(i, e, u), O = Object.keys(n).reduce((r, f) => (r[f] = n[f].default, r), {});
|
|
173
|
+
return Object.assign(O, g);
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
function oe(n, e) {
|
|
@@ -179,7 +179,7 @@ function oe(n, e) {
|
|
|
179
179
|
const ie = /* @__PURE__ */ new Map([
|
|
180
180
|
["appearance", oe]
|
|
181
181
|
]);
|
|
182
|
-
function pe(n, e,
|
|
182
|
+
function pe(n, e, u) {
|
|
183
183
|
return e;
|
|
184
184
|
}
|
|
185
185
|
const fe = "capsule", de = "A Farris Component", ve = "object", me = {
|
|
@@ -230,34 +230,34 @@ const fe = "capsule", de = "A Farris Component", ve = "object", me = {
|
|
|
230
230
|
index: { type: Number, default: 0 },
|
|
231
231
|
show: { type: Boolean, default: !0 },
|
|
232
232
|
disabled: { type: Boolean, default: !1 }
|
|
233
|
-
}, J =
|
|
233
|
+
}, J = ue(L, te, ie, pe, ye), z = /* @__PURE__ */ F({
|
|
234
234
|
name: "FCapsuleItem",
|
|
235
235
|
props: he,
|
|
236
236
|
emits: ["mounted", "active"],
|
|
237
237
|
setup(n, e) {
|
|
238
|
-
const
|
|
239
|
-
D(() => n.isActive, (
|
|
240
|
-
l.value =
|
|
238
|
+
const u = y(), l = y(n.isActive);
|
|
239
|
+
D(() => n.isActive, (i) => {
|
|
240
|
+
l.value = i;
|
|
241
241
|
});
|
|
242
|
-
const
|
|
242
|
+
const c = S(() => ({
|
|
243
243
|
"f-capsule-item": !0,
|
|
244
244
|
"f-capsule-active-item": l.value,
|
|
245
245
|
"f-capsule-disabled": n.disabled
|
|
246
246
|
}));
|
|
247
247
|
P(() => {
|
|
248
|
-
e.emit("mounted",
|
|
248
|
+
e.emit("mounted", u, n.value);
|
|
249
249
|
});
|
|
250
|
-
function o(
|
|
251
|
-
n.disabled || e.emit("active",
|
|
250
|
+
function o(i) {
|
|
251
|
+
n.disabled || e.emit("active", i, {
|
|
252
252
|
name: n.name,
|
|
253
253
|
value: n.value
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
return () =>
|
|
257
|
-
ref:
|
|
258
|
-
class:
|
|
259
|
-
onClick: (
|
|
260
|
-
}, [n.icon &&
|
|
256
|
+
return () => w("div", {
|
|
257
|
+
ref: u,
|
|
258
|
+
class: c.value,
|
|
259
|
+
onClick: (i) => o(i)
|
|
260
|
+
}, [n.icon && w("i", {
|
|
261
261
|
class: n.icon
|
|
262
262
|
}, null), n.name]);
|
|
263
263
|
}
|
|
@@ -266,59 +266,59 @@ const fe = "capsule", de = "A Farris Component", ve = "object", me = {
|
|
|
266
266
|
props: L,
|
|
267
267
|
emits: ["change", "update:modelValue"],
|
|
268
268
|
setup(n, e) {
|
|
269
|
-
const
|
|
269
|
+
const u = y(n.items), l = y(), c = 2, o = y(n.modelValue), i = y("none"), g = y(n.type), O = S(() => {
|
|
270
270
|
const a = {
|
|
271
271
|
"f-capsule-container": !0
|
|
272
272
|
};
|
|
273
|
-
return
|
|
274
|
-
}),
|
|
273
|
+
return g.value && (a[g.value] = !0), a;
|
|
274
|
+
}), r = S(() => ({})), f = S(() => ({
|
|
275
275
|
"f-capsule": !0
|
|
276
|
-
})),
|
|
277
|
-
left: `${
|
|
278
|
-
width: `${
|
|
279
|
-
transition:
|
|
280
|
-
})), R =
|
|
276
|
+
})), p = y(c), d = y(0), h = y(0), b = S(() => ({
|
|
277
|
+
left: `${p.value}px`,
|
|
278
|
+
width: `${d.value}px`,
|
|
279
|
+
transition: i.value
|
|
280
|
+
})), R = S(() => ({
|
|
281
281
|
width: `${h.value}px`
|
|
282
|
-
})),
|
|
282
|
+
})), A = /* @__PURE__ */ new Map();
|
|
283
283
|
function V(a) {
|
|
284
284
|
var t;
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
287
|
-
if (
|
|
288
|
-
const m =
|
|
289
|
-
|
|
285
|
+
if (A.has(a.value)) {
|
|
286
|
+
const s = (t = A.get(a.value)) == null ? void 0 : t.value;
|
|
287
|
+
if (s) {
|
|
288
|
+
const m = s.getBoundingClientRect(), B = l.value.getBoundingClientRect();
|
|
289
|
+
p.value = m.left - B.left + c + l.value.scrollLeft, d.value = m.width - 2 * c;
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
o.value =
|
|
293
|
+
function M(a, t) {
|
|
294
|
+
const s = a.value;
|
|
295
|
+
o.value = s, e.emit("update:modelValue", s), V(a), t && e.emit("change", s);
|
|
296
296
|
}
|
|
297
297
|
function C(a) {
|
|
298
|
-
const t =
|
|
299
|
-
t > -1 &&
|
|
298
|
+
const t = u.value.findIndex((s) => s.value === a);
|
|
299
|
+
t > -1 && M(u.value[t], !1);
|
|
300
300
|
}
|
|
301
301
|
D(() => n.modelValue, (a) => {
|
|
302
302
|
o.value = a, C(o.value);
|
|
303
303
|
}), D(() => n.items, async (a) => {
|
|
304
|
-
const t = a.filter((
|
|
305
|
-
v(t),
|
|
304
|
+
const t = a.filter((s) => s.show);
|
|
305
|
+
v(t), u.value = t, await T(), C(o.value), h.value = Array.from(A.values()).reduce((s, m) => (s += m.value.clientWidth, s), 0);
|
|
306
306
|
}), P(async () => {
|
|
307
|
-
C(o.value), await T(),
|
|
307
|
+
C(o.value), await T(), i.value = "0.1s ease-out all", h.value = Array.from(A.values()).reduce((a, t) => (a += t.value.clientWidth, a), 0);
|
|
308
308
|
});
|
|
309
309
|
function $(a, t) {
|
|
310
|
-
|
|
310
|
+
M(t, !0);
|
|
311
311
|
}
|
|
312
312
|
function E(a, t) {
|
|
313
|
-
|
|
313
|
+
A.set(t, a);
|
|
314
314
|
}
|
|
315
315
|
function v(a) {
|
|
316
|
-
Array.from(
|
|
317
|
-
a.find((m) => m.value === t) ||
|
|
316
|
+
Array.from(A.keys()).forEach((t) => {
|
|
317
|
+
a.find((m) => m.value === t) || A.delete(t);
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
return
|
|
320
|
+
function j(a, t) {
|
|
321
|
+
return w(z, {
|
|
322
322
|
name: a.name,
|
|
323
323
|
value: a.value,
|
|
324
324
|
isActive: a.value === o.value,
|
|
@@ -329,70 +329,70 @@ const fe = "capsule", de = "A Farris Component", ve = "object", me = {
|
|
|
329
329
|
onActive: $
|
|
330
330
|
}, null);
|
|
331
331
|
}
|
|
332
|
-
return () =>
|
|
332
|
+
return () => w("span", {
|
|
333
333
|
ref: l,
|
|
334
|
-
class:
|
|
335
|
-
style:
|
|
336
|
-
}, [
|
|
334
|
+
class: O.value,
|
|
335
|
+
style: r.value
|
|
336
|
+
}, [w("span", {
|
|
337
337
|
class: "f-capsule-pane"
|
|
338
|
-
}, [
|
|
339
|
-
class:
|
|
340
|
-
style:
|
|
341
|
-
}, null),
|
|
338
|
+
}, [u.value.map((a, t) => j(a, t))]), w("small", {
|
|
339
|
+
class: f.value,
|
|
340
|
+
style: b.value
|
|
341
|
+
}, null), w("div", {
|
|
342
342
|
class: "f-capsule-board",
|
|
343
343
|
style: R.value
|
|
344
344
|
}, null)]);
|
|
345
345
|
}
|
|
346
346
|
});
|
|
347
|
-
function ge(n, e,
|
|
347
|
+
function ge(n, e, u) {
|
|
348
348
|
var E;
|
|
349
349
|
function l() {
|
|
350
350
|
}
|
|
351
|
-
const
|
|
352
|
-
function
|
|
351
|
+
const c = "", o = "", i = y();
|
|
352
|
+
function g() {
|
|
353
353
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function O() {
|
|
356
356
|
return !1;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function r() {
|
|
359
359
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function f() {
|
|
362
362
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function p(v) {
|
|
365
365
|
if (!v || !v.value)
|
|
366
366
|
return null;
|
|
367
367
|
if (v.value.schema && v.value.schema.type === "component")
|
|
368
368
|
return v.value;
|
|
369
|
-
const
|
|
369
|
+
const j = y(v == null ? void 0 : v.value.parent), a = p(j);
|
|
370
370
|
return a || null;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
const { componentInstance:
|
|
374
|
-
return !
|
|
372
|
+
function d(v = e) {
|
|
373
|
+
const { componentInstance: j, designerItemElementRef: a } = v;
|
|
374
|
+
return !j || !j.value ? null : j.value.canMove ? a : d(v.parent);
|
|
375
375
|
}
|
|
376
376
|
function h(v) {
|
|
377
|
-
return !!
|
|
377
|
+
return !!u;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function b() {
|
|
380
380
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
381
381
|
}
|
|
382
382
|
function R() {
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function A(v, j) {
|
|
385
385
|
}
|
|
386
|
-
function V(v) {
|
|
387
|
-
const { componentType:
|
|
388
|
-
let
|
|
389
|
-
const
|
|
390
|
-
return
|
|
386
|
+
function V(v, j) {
|
|
387
|
+
const { componentType: a } = v;
|
|
388
|
+
let t = N(a, v, j);
|
|
389
|
+
const s = a.toLowerCase().replace("-", "_");
|
|
390
|
+
return t && !t.id && t.type === a && (t.id = `${s}_${Math.random().toString().slice(2, 6)}`), t;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
const a = String(v.getAttribute("data-controltype")), t = v.getAttribute("data-feature"),
|
|
394
|
-
|
|
395
|
-
let m = N(a,
|
|
392
|
+
function M(v, j) {
|
|
393
|
+
const a = String(v.getAttribute("data-controltype")), t = v.getAttribute("data-feature"), s = t ? JSON.parse(t) : {};
|
|
394
|
+
s.parentComponentInstance = i.value;
|
|
395
|
+
let m = N(a, s);
|
|
396
396
|
const B = a.toLowerCase().replace("-", "_");
|
|
397
397
|
return m && !m.id && m.type === a && (m.id = `${B}_${Math.random().toString().slice(2, 6)}`), m;
|
|
398
398
|
}
|
|
@@ -400,115 +400,115 @@ function ge(n, e, r) {
|
|
|
400
400
|
}
|
|
401
401
|
function $(...v) {
|
|
402
402
|
}
|
|
403
|
-
return
|
|
404
|
-
canMove:
|
|
405
|
-
canSelectParent:
|
|
406
|
-
canDelete:
|
|
407
|
-
canNested: !
|
|
403
|
+
return i.value = {
|
|
404
|
+
canMove: g(),
|
|
405
|
+
canSelectParent: O(),
|
|
406
|
+
canDelete: r(),
|
|
407
|
+
canNested: !f(),
|
|
408
408
|
contents: e == null ? void 0 : e.schema.contents,
|
|
409
409
|
elementRef: n,
|
|
410
410
|
parent: (E = e == null ? void 0 : e.parent) == null ? void 0 : E.componentInstance,
|
|
411
411
|
schema: e == null ? void 0 : e.schema,
|
|
412
|
-
styles:
|
|
412
|
+
styles: c,
|
|
413
413
|
designerClass: o,
|
|
414
414
|
canAccepts: h,
|
|
415
|
-
getBelongedComponentInstance:
|
|
416
|
-
getDraggableDesignItemElement:
|
|
417
|
-
getDraggingDisplayText:
|
|
415
|
+
getBelongedComponentInstance: p,
|
|
416
|
+
getDraggableDesignItemElement: d,
|
|
417
|
+
getDraggingDisplayText: b,
|
|
418
418
|
getPropConfig: $,
|
|
419
419
|
getDragScopeElement: R,
|
|
420
|
-
onAcceptMovedChildElement:
|
|
421
|
-
onAcceptNewChildElement:
|
|
420
|
+
onAcceptMovedChildElement: A,
|
|
421
|
+
onAcceptNewChildElement: M,
|
|
422
422
|
onChildElementMovedOut: C,
|
|
423
423
|
addNewChildComponentSchema: V,
|
|
424
424
|
updateDragAndDropRules: l,
|
|
425
425
|
triggerBelongedComponentToMoveWhenMoved: y(!1),
|
|
426
426
|
triggerBelongedComponentToDeleteWhenDeleted: y(!1)
|
|
427
|
-
},
|
|
427
|
+
}, i;
|
|
428
428
|
}
|
|
429
429
|
const be = /* @__PURE__ */ F({
|
|
430
430
|
name: "FCapsuleDesign",
|
|
431
431
|
props: L,
|
|
432
432
|
emits: ["change", "update:modelValue"],
|
|
433
433
|
setup(n, e) {
|
|
434
|
-
const
|
|
434
|
+
const u = y(n.items), l = y(), c = 2, o = y(n.modelValue), i = y("none"), g = y(n.type), O = H("design-item-context"), r = ge(l, O);
|
|
435
435
|
P(() => {
|
|
436
|
-
l.value.componentInstance =
|
|
437
|
-
}), e.expose(
|
|
438
|
-
const
|
|
436
|
+
l.value.componentInstance = r;
|
|
437
|
+
}), e.expose(r.value);
|
|
438
|
+
const f = S(() => {
|
|
439
439
|
const t = {
|
|
440
440
|
"f-capsule-container": !0
|
|
441
441
|
};
|
|
442
|
-
return
|
|
443
|
-
}),
|
|
442
|
+
return g.value && (t[g.value] = !0), t;
|
|
443
|
+
}), p = S(() => ({})), d = S(() => ({
|
|
444
444
|
"f-capsule": !0
|
|
445
|
-
})), h = y(
|
|
445
|
+
})), h = y(c), b = y(0), R = y(0), A = S(() => ({
|
|
446
446
|
left: `${h.value}px`,
|
|
447
|
-
width: `${
|
|
448
|
-
transition:
|
|
449
|
-
})), V =
|
|
447
|
+
width: `${b.value}px`,
|
|
448
|
+
transition: i.value
|
|
449
|
+
})), V = S(() => ({
|
|
450
450
|
width: `${R.value}px`
|
|
451
|
-
})),
|
|
451
|
+
})), M = /* @__PURE__ */ new Map();
|
|
452
452
|
function C(t) {
|
|
453
|
-
var
|
|
454
|
-
if (
|
|
455
|
-
const m = (
|
|
453
|
+
var s;
|
|
454
|
+
if (M.has(t.value)) {
|
|
455
|
+
const m = (s = M.get(t.value)) == null ? void 0 : s.value;
|
|
456
456
|
if (m) {
|
|
457
457
|
const B = m.getBoundingClientRect(), G = l.value.getBoundingClientRect();
|
|
458
|
-
h.value = B.left - G.left +
|
|
458
|
+
h.value = B.left - G.left + c + l.value.scrollLeft, b.value = B.width - 2 * c;
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
function $(t,
|
|
462
|
+
function $(t, s) {
|
|
463
463
|
const m = t.value;
|
|
464
|
-
o.value = m, e.emit("update:modelValue", m), C(t),
|
|
464
|
+
o.value = m, e.emit("update:modelValue", m), C(t), s && e.emit("change", m);
|
|
465
465
|
}
|
|
466
466
|
function E(t) {
|
|
467
|
-
const
|
|
468
|
-
|
|
467
|
+
const s = u.value.findIndex((m) => m.value === t);
|
|
468
|
+
s > -1 && $(u.value[s], !1);
|
|
469
469
|
}
|
|
470
470
|
D(() => n.modelValue, (t) => {
|
|
471
471
|
o.value = t, E(o.value);
|
|
472
472
|
}), D(() => n.items, async (t) => {
|
|
473
|
-
|
|
473
|
+
u.value = t, await T(), E(o.value), R.value = Array.from(M.values()).reduce((s, m) => (s += m.value.clientWidth, s), 0);
|
|
474
474
|
}), P(async () => {
|
|
475
|
-
E(o.value), await T(),
|
|
475
|
+
E(o.value), await T(), i.value = "0.1s ease-out all", R.value = Array.from(M.values()).reduce((t, s) => (t += s.value.clientWidth, t), 0);
|
|
476
476
|
});
|
|
477
|
-
function v(t,
|
|
478
|
-
$(
|
|
477
|
+
function v(t, s) {
|
|
478
|
+
$(s, !0);
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
|
|
480
|
+
function j(t, s) {
|
|
481
|
+
M.set(s, t);
|
|
482
482
|
}
|
|
483
|
-
function a(t,
|
|
484
|
-
return
|
|
483
|
+
function a(t, s) {
|
|
484
|
+
return w(z, {
|
|
485
485
|
name: t.name,
|
|
486
486
|
value: t.value,
|
|
487
487
|
isActive: t.value === o.value,
|
|
488
|
-
index:
|
|
489
|
-
onMounted:
|
|
488
|
+
index: s,
|
|
489
|
+
onMounted: j,
|
|
490
490
|
onActive: v
|
|
491
491
|
}, null);
|
|
492
492
|
}
|
|
493
|
-
return () =>
|
|
493
|
+
return () => w("span", {
|
|
494
494
|
ref: l,
|
|
495
|
-
class: p.value,
|
|
496
|
-
style: i.value
|
|
497
|
-
}, [A("span", {
|
|
498
|
-
class: "f-capsule-pane"
|
|
499
|
-
}, [r.value.map((t, c) => a(t, c))]), A("small", {
|
|
500
495
|
class: f.value,
|
|
501
|
-
style:
|
|
502
|
-
},
|
|
496
|
+
style: p.value
|
|
497
|
+
}, [w("span", {
|
|
498
|
+
class: "f-capsule-pane"
|
|
499
|
+
}, [u.value.map((t, s) => a(t, s))]), w("small", {
|
|
500
|
+
class: d.value,
|
|
501
|
+
style: A.value
|
|
502
|
+
}, null), w("div", {
|
|
503
503
|
class: "f-capsule-board",
|
|
504
504
|
style: V.value
|
|
505
505
|
}, null)]);
|
|
506
506
|
}
|
|
507
507
|
});
|
|
508
|
-
k.register = (n, e,
|
|
508
|
+
k.register = (n, e, u) => {
|
|
509
509
|
n.capsule = k, e.capsule = J;
|
|
510
510
|
};
|
|
511
|
-
k.registerDesigner = (n, e,
|
|
511
|
+
k.registerDesigner = (n, e, u) => {
|
|
512
512
|
n.capsule = be, e.capsule = J;
|
|
513
513
|
};
|
|
514
514
|
const we = U(k);
|