@farris/ui-vue 1.5.7 → 1.5.8
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/avatar/index.esm.js +4 -4
- package/components/avatar/index.umd.cjs +1 -1
- package/components/component/index.esm.js +4 -4
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +4 -4
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +4 -4
- package/components/content-container/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +1082 -1421
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +4 -4
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +4 -4
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +4 -4
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +4 -4
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +12 -11
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +4 -4
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +4 -4
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +4 -4
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1584 -2320
- package/components/page-header/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +4 -4
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +77 -76
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/response-layout/index.esm.js +4 -4
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +500 -3662
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +3008 -7347
- package/components/schema-selector/index.umd.cjs +6 -6
- package/components/section/index.esm.js +1564 -1635
- package/components/section/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +545 -4943
- package/components/tabs/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +100 -5841
- package/components/textarea/index.umd.cjs +2 -2
- package/components/time-picker/index.esm.js +4 -4
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/video/index.esm.js +4 -4
- package/components/video/index.umd.cjs +1 -1
- package/designer/button-edit/index.css +1 -0
- package/designer/button-edit/index.esm.js +1556 -0
- package/designer/button-edit/index.umd.cjs +1 -0
- package/designer/checkbox/index.esm.js +207 -0
- package/designer/checkbox/index.umd.cjs +1 -0
- package/designer/checkbox-group/index.esm.js +377 -0
- package/designer/checkbox-group/index.umd.cjs +1 -0
- package/designer/data-grid/index.css +1 -0
- package/designer/data-grid/index.esm.js +14332 -0
- package/designer/data-grid/index.umd.cjs +20 -0
- package/designer/data-view/index.esm.js +271 -0
- package/designer/data-view/index.umd.cjs +1 -0
- package/designer/date-picker/index.esm.js +1879 -0
- package/designer/date-picker/index.umd.cjs +1 -0
- package/designer/drawer/index.css +1 -0
- package/designer/drawer/index.esm.js +463 -0
- package/designer/drawer/index.umd.cjs +1 -0
- package/designer/farris-designer.all.esm.js +16815 -0
- package/designer/farris-designer.all.umd.cjs +32 -0
- package/designer/index.css +1 -0
- package/designer/input-group/index.esm.js +647 -0
- package/designer/input-group/index.umd.cjs +1 -0
- package/designer/radio-group/index.esm.js +6959 -0
- package/designer/radio-group/index.umd.cjs +1 -0
- package/designer/response-toolbar/index.esm.js +3015 -0
- package/designer/response-toolbar/index.umd.cjs +1 -0
- package/designer/tabs/index.esm.js +2200 -0
- package/designer/tabs/index.umd.cjs +1 -0
- package/designer/textarea/index.esm.js +249 -0
- package/designer/textarea/index.umd.cjs +1 -0
- package/designer/tree-grid/index.css +1 -0
- package/designer/tree-grid/index.esm.js +1673 -0
- package/designer/tree-grid/index.umd.cjs +1 -0
- package/farris.all.esm.js +57107 -57105
- package/farris.all.umd.cjs +16 -16
- package/package.json +1 -1
- package/types/date-picker/designer.d.ts +29 -0
- package/types/date-picker/index.d.ts +2 -1
- package/types/date-picker/src/date-picker.props.d.ts +0 -5
- package/types/date-picker/src/designer/date-picker.design.props.d.ts +22 -0
- package/types/response-toolbar/designer.d.ts +37 -0
- package/types/response-toolbar/index.d.ts +6 -5
- package/types/response-toolbar/src/composition/toolbar-item-dragula.d.ts +1 -2
- package/types/response-toolbar/src/composition/types.d.ts +1 -1
- package/types/response-toolbar/src/designer/response-toolbar.design.props.d.ts +13 -0
- package/types/response-toolbar/src/designer/use-designer-item-rules.d.ts +1 -2
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +1 -2
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
- package/types/response-toolbar/src/response-toolbar.props.d.ts +0 -12
- package/types/response-toolbar/src/schema/schema-resolver.d.ts +1 -1
- package/types/tabs/designer.d.ts +28 -0
- package/types/tabs/index.d.ts +1 -0
- package/types/tabs/src/components/tab-page.props.d.ts +0 -1
- package/types/tabs/src/designer/tab-page.design.props.d.ts +1 -0
- package/types/tabs/src/designer/tabs.design.props.d.ts +12 -0
- package/types/tabs/src/tabs.props.d.ts +0 -11
- package/types/textarea/designer.d.ts +28 -0
- package/types/textarea/index.d.ts +0 -15
- package/types/textarea/src/designer/textarea.design.props.d.ts +6 -0
- package/types/textarea/src/designer/use-design-rules.d.ts +1 -2
- package/types/textarea/src/property-config/textarea.property-config.d.ts +1 -1
- package/types/textarea/src/schema/schema-resolver.d.ts +1 -1
- package/types/textarea/src/textarea.props.d.ts +0 -5
- /package/{components/textarea → designer/radio-group}/index.css +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(F,G){typeof exports=="object"&&typeof module<"u"?G(exports,require("../../components/common/index.umd.js"),require("../../components/date-picker/index.umd.js"),require("vue"),require("../button-edit/index.umd.js"),require("../../components/designer-canvas/index.umd.js"),require("../../components/dynamic-resolver/index.umd.js"),require("../../components/property-panel/index.umd.js"),require("lodash-es"),require("../../components/time-picker/index.umd.js"),require("../../components/button/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","../../components/common/index.umd.js","../../components/date-picker/index.umd.js","vue","../button-edit/index.umd.js","../../components/designer-canvas/index.umd.js","../../components/dynamic-resolver/index.umd.js","../../components/property-panel/index.umd.js","lodash-es","../../components/time-picker/index.umd.js","../../components/button/index.umd.js"],G):(F=typeof globalThis<"u"?globalThis:F||self,G(F["date-picker"]={},F.common,F.datePicker,F.Vue,F.FButtonEditDesign,F.designerCanvas,F.dynamicResolver,F.propertyPanel,F.LodashES,F.timePicker,F.button))})(this,function(F,G,se,e,Ee,ve,de,Ae,Z,We,Re){"use strict";function ge(t,n,o){return n}const ke=new Map([["appearance",de.resolveAppearance]]),qe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/date-picker.schema.json",title:"date-picker",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for date picker",type:"string"},type:{description:"The type string of date picker",type:"string",default:"date-picker"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!1},placeholder:{description:"",type:"string",default:"请选择日期"},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0},displayFormat:{description:"",type:"enum",default:"yyyy-MM-dd"},valueFormat:{description:"",type:"enum",default:"yyyy-MM-dd"},maxDate:{description:"",type:"string"},minDate:{description:"",type:"string"},showTime:{description:"",type:"boolean",default:!1}},required:["type"],ignore:["id","appearance","binding","visible"]},Le={year:9999,month:12,day:31,hour:23,minute:59,second:59},_e={year:1900,month:1,day:1,hour:0,minute:0,second:0},Pe=Object.assign({},se.datePickerProps,{readonly:{}}),ce=de.createPropsResolver(se.datePickerProps,qe,ke,ge);function Ke(){let t="zh-CHS";window&&window.top&&window.top.localStorage&&window.top.localStorage.languageCode&&({languageCode:t}=window.top.localStorage);const n=[{id:"yyyy-MM-dd HH:mm:ss",name:"yyyy-MM-dd HH:mm:ss"},{id:"yyyy/MM/dd HH:mm:ss",name:"yyyy/MM/dd HH:mm:ss"},{id:"yyyyMMddHHmmss",name:"yyyyMMddHHmmss"},{id:"yyyy-MM-dd HH:mm",name:"yyyy-MM-dd HH:mm"},{id:"yyyy/MM/dd HH:mm",name:"yyyy/MM/dd HH:mm"},{id:"yyyyMMddHHmm",name:"yyyyMMddHHmm"}],o=[{id:"yyyy-MM-dd",name:"yyyy-MM-dd"},{id:"yyyy/MM/dd",name:"yyyy/MM/dd"},{id:"yyyyMMdd",name:"yyyyMMdd"},{id:"MM/dd/yyyy",name:"MM/dd/yyyy"}],m=[{id:"yyyy-MM",name:"yyyy-MM"},{id:"yyyy/MM",name:"yyyy/MM"},{id:"yyyyMM",name:"yyyyMM"}],l=[{id:"MM/dd",name:"MM/dd"},{id:"MMdd",name:"MMdd"},{id:"MM-dd",name:"MM-dd"}],c=[{id:"yyyy",name:"yyyy"}];return t==="zh-CHS"&&(n.push({id:"yyyy年MM月dd日 HH时mm分ss秒",name:"yyyy年MM月dd日 HH时mm分ss秒"},{id:"yyyy年MM月dd日 HH时mm分",name:"yyyy年MM月dd日 HH时mm分"}),o.push({id:"yyyy年MM月dd日",name:"yyyy年MM月dd日"}),m.push({id:"yyyy年MM月",name:"yyyy年MM月"}),l.push({id:"MM月dd日",name:"MM月dd日"}),c.push({id:"yyyy年",name:"yyyy年"})),t==="zh-CHT"&&(n.push({id:"yyyy年MM月dd日 HH時mm分ss秒",name:"yyyy年MM月dd日 HH時mm分ss秒"},{id:"yyyy年MM月dd日 HH時mm分",name:"yyyy年MM月dd日 HH時mm分"}),o.push({id:"yyyy年MM月dd日",name:"yyyy年MM月dd日"}),m.push({id:"yyyy年MM月",name:"yyyy年MM月"}),l.push({id:"MM月dd日",name:"MM月dd日"}),c.push({id:"yyyy年",name:"yyyy年"})),{timeFormats:n,yMFormats:m,yMdFormats:o,mdFormats:l,yFormats:c}}class ze extends Ae.InputBaseProperty{constructor(n,o){super(n,o)}getEditorProperties(n){var l,c,P,M,f,b,g,s,u,a;const o=this.getDateFormatOptions(n==null?void 0:n.editor),m=this.getValueFormatOptions();return this.getComponentConfig(n,{type:"date-picker"},{showTime:{description:"",title:"启用时间选择",type:"boolean",readonly:((l=n==null?void 0:n.editor)==null?void 0:l.fieldType)==="Date",refreshPanelAfterChanged:!0},displayFormat:{description:"",title:"展示格式",type:"enum",editor:{data:o}},valueFormat:{description:"",title:"存储格式",type:"enum",editor:{data:m},visible:((c=n==null?void 0:n.editor)==null?void 0:c.fieldType)==="String"},maxDate:{description:"",title:"最大日期",type:"string",editor:{type:"date-picker",displayFormat:"yyyy-MM-dd"+((P=n==null?void 0:n.editor)!=null&&P.showTime?" HH:mm:ss":""),valueFormat:"yyyy-MM-dd"+((M=n==null?void 0:n.editor)!=null&&M.showTime?" HH:mm:ss":""),minDate:((f=n==null?void 0:n.editor)==null?void 0:f.minDate)||"1900-01-01",maxDate:"9999-12-31",showTime:(b=n==null?void 0:n.editor)==null?void 0:b.showTime},refreshPanelAfterChanged:!0},minDate:{description:"",title:"最小日期",type:"string",editor:{type:"date-picker",displayFormat:"yyyy-MM-dd"+((g=n==null?void 0:n.editor)!=null&&g.showTime?" HH:mm:ss":""),valueFormat:"yyyy-MM-dd"+((s=n==null?void 0:n.editor)!=null&&s.showTime?" HH:mm:ss":""),minDate:"1900-01-01",maxDate:((u=n==null?void 0:n.editor)==null?void 0:u.maxDate)||"9999-12-31",showTime:(a=n==null?void 0:n.editor)==null?void 0:a.showTime},refreshPanelAfterChanged:!0}},this.setEditorPropertyRelates)}setEditorPropertyRelates(n,o,m){if(!(!n||!o.editor))switch(n.propertyID){case"showTime":{const l=o.editor;n.propertyValue?(l.displayFormat="yyyy-MM-dd HH:mm:ss",l.valueFormat="yyyy-MM-dd HH:mm:ss"):(l.displayFormat="yyyy-MM-dd",l.valueFormat="yyyy-MM-dd"),o.formatter&&(o.formatter.dateFormat=l.displayFormat);break}case"displayFormat":{o.formatter&&(o.formatter.dateFormat=n.propertyValue);break}}}getDateFormatOptions(n){let o=[];const{timeFormats:m,yMdFormats:l,yMFormats:c,mdFormats:P,yFormats:M}=Ke();return n.showTime&&(o=o.concat(m)),o=o.concat(l),o=o.concat(c),o=o.concat(M),o=o.concat(P),o}getValueFormatOptions(){return[{id:"yyyy-MM-dd",name:"yyyy-MM-dd"},{id:"yyyy/MM/dd",name:"yyyy/MM/dd"},{id:"MM/dd/yyyy",name:"MM/dd/yyyy"},{id:"yyyy-MM-dd HH:mm:ss",name:"yyyy-MM-dd HH:mm:ss"},{id:"yyyy/MM/dd HH:mm:ss",name:"yyyy/MM/dd HH:mm:ss"},{id:"yyyyMM",name:"yyyyMM"},{id:"yyyy",name:"yyyy"}]}}function Ue(t,n){const o=t.schema;function m(l,c){return new ze(l,n).getPropertyConfig(o,c)}return{getPropsConfig:m}}const ne=e.defineComponent({name:"FDatePickerDesign",props:Pe,emits:["update:modelValue","datePicked"],setup(t,n){const o='<span class="f-icon f-icon-date"></span>',m=e.ref(t.modelValue),l=e.ref(),c=e.inject("designer-host-service"),P=e.inject("design-item-context"),M=Ue(P,c),f=ve.useDesignerComponent(l,P,M);return e.onMounted(()=>{l.value.componentInstance=f}),n.expose(f.value),()=>e.createVNode(Ee,{ref:l,modelValue:m.value,"onUpdate:modelValue":b=>m.value=b,buttonContent:o,readonly:!0,editable:!1,forcePlaceholder:!0,placeholder:t.placeholder,enableClear:!0},null)}}),Te={1:"一月",2:"二月",3:"三月",4:"四月",5:"五月",6:"六月",7:"七月",8:"八月",9:"九月",10:"十月",11:"十一月",12:"十二月"},Xe={editable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disableDates:{Type:Array,default:[]},disablePeriod:{Type:Array,default:[]},disableSince:{Type:Object,default:{year:0,month:0,day:0}},disableWeekdays:{Type:Array,default:[]},disableWeekends:{Type:Boolean,default:!1},disableUntil:{Type:Object,default:{year:0,month:0,day:0}},displayTime:{Type:Boolean,default:!1},highlightDates:{Type:Array,default:[]},highlightSaturday:{Type:Boolean,default:!1},highlightSunday:{Type:Boolean,default:!1},maxDate:{Type:String,default:"9999-12-31 23:59:59"},minDate:{Type:String,default:"1900-01-01 00:00:00"},modelValue:{type:String,default:""},nameOfMonths:{Type:Object,default:Te},selectMode:{Type:String,default:"day"},valueFormat:{Type:String,default:"yyyy-MM-dd"},displayFormat:{Type:String,default:"yyyy-MM-dd"},enablePeriod:{type:Boolean,default:!1},focusOnCreated:{type:Boolean,default:!1},placeholder:{type:String,default:"请选择日期"},selectOnCreated:{type:Boolean,default:!1},showTime:{type:Boolean,default:!1},showEndDate:{type:Boolean,default:!0},showMiddleIcon:{type:Boolean,default:!0},startDateValue:{type:String},endDateValue:{type:String},showPeriod:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!0}},le=["日","一","二","三","四","五","六"];var L=(t=>(t[t.previous=1]="previous",t[t.current=2]="current",t[t.next=3]="next",t))(L||{});const Ge={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/date-view.schema.json",title:"date-view",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for date picker",type:"string"},type:{description:"The type string of date picker",type:"string",default:"date-view"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},disable:{type:"string",default:!1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},Je={title:"date-view",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:{visible:{description:"",title:"可见",type:"boolean"}}}}},we={top:{type:Number,default:0},left:{type:Number,default:0},position:{type:String,default:"bottom"},enablePeriod:{type:Boolean,default:!1},dateFormat:{type:String,default:"yyyy-MM-dd"},valueFormat:{type:String,default:"yyyy-MM-dd"},dates:{type:Array,default:[]},daysInWeek:{type:Array,default:le},disableDates:{Type:Array,default:[]},disablePeriod:{Type:Array,default:[]},disableSince:{Type:Object,default:{year:0,month:0,day:0}},disableWeekdays:{Type:Array,default:[]},disableWeekends:{Type:Boolean,default:!1},disableUntil:{Type:Object,default:{year:0,month:0,day:0}},enableKeyboadNavigate:{type:Boolean,default:!0},enableMarkCurrent:{type:Boolean,default:!0},firstDayOfTheWeek:{type:String,default:"Sun."},highlightDates:{Type:Array,default:[]},highlightSaturday:{Type:Boolean,default:!1},highlightSunday:{Type:Boolean,default:!1},maxYear:{Type:Number,default:1e4},minYear:{Type:Number,default:1},mode:{Type:String,default:"Embedded"},months:{type:Array,default:[[]]},nameOfMonths:{Type:Object,default:Te},secondaryDates:{type:Array,default:[]},secondaryMonths:{type:Array,default:[[]]},selectedDate:{type:Object,default:null},selectedSecondDate:{type:Object,default:null},selectedMonth:{type:Object,default:null},selectedPeriod:{type:Object,default:null},selectedWeek:{type:Object,default:null},selectMode:{type:String,default:"day"},showWeekNumber:{type:Boolean,default:!1},weekTitle:{type:String,default:"Week"},years:{Type:Array,default:[[]]},value:{type:String,default:null},showTime:{type:Boolean,default:!1}},Ne=de.createPropsResolver(we,Ge,ke,ge,Je),Qe={activeMonth:{type:Object,require:!0},ariaLabelPrevMonth:{type:String,default:""},ariaLabelNextMonth:{type:String,default:""},dateFormat:{type:String,default:"yyyy-MM-dd"},disablePrePage:{type:Boolean,default:!1},disablePreRecord:{type:Boolean,default:!1},disableNextRecord:{type:Boolean,default:!1},disableNextPage:{type:Boolean,default:!1},years:{type:Array,default:[[{}]]},selectingMonth:{type:Boolean,default:!1},selectingYear:{type:Boolean,default:!1},selectMode:{type:String,default:"day"}},Ze=e.defineComponent({name:"FDatePickerCalendarNavbar",props:Qe,emits:["clickMonth","clickYear","prePage","preRecord","nextRecord","nextPage"],setup(t,n){return()=>{const o=e.ref(t.ariaLabelPrevMonth),m=e.ref(t.ariaLabelNextMonth),l=e.ref(t.dateFormat),c=e.ref(t.disablePrePage),P=e.ref(t.disablePreRecord),M=e.ref(t.disableNextRecord),f=e.ref(t.disableNextPage),b=e.ref(t.activeMonth),g=e.ref(t.years),s=e.ref(t.selectingMonth),u=e.ref(t.selectingYear),a=e.ref(t.selectMode),i=e.ref(!0),N=e.ref(!0);e.watch(()=>t.activeMonth,()=>{var r,C,D,Y;b.value={month:(r=t.activeMonth)==null?void 0:r.month,year:(C=t.activeMonth)==null?void 0:C.year,displayTextOfMonth:(D=t.activeMonth)==null?void 0:D.displayTextOfMonth,displayTextOfYear:(Y=t.activeMonth)==null?void 0:Y.displayTextOfMonth}});const h=e.computed(()=>({"f-datepicker-header":!0,monthYearSelBarBorder:s.value||u.value})),v=e.computed(()=>({"f-datepicker-header-btn":!0,"f-datepicker-header-btn-disabled":c.value})),p=e.computed(()=>!s.value&&!u.value),B=e.computed(()=>({"f-datepicker-header-btn":!0,"f-datepicker-header-btn-disabled":P.value})),$=e.computed(()=>({"f-datepicker-header-btn":!0,"f-datepicker-header-btn-disabled":M.value})),T=e.computed(()=>({"f-datepicker-header-btn":!0,"f-datepicker-header-btn-disabled":f.value})),y=e.computed(()=>({"f-datepicker-header-btn":!0,"f-datepicker-yearLabel":i.value,"f-datepicker-labelBtnNotEdit":!i.value})),x=e.computed(()=>({"f-datepicker-header-btn":!0,"f-datepicker-monthLabel":N.value,"f-datepicker-labelBtnNotEdit":!N.value})),j=e.computed(()=>{const r=l.value?l.value.indexOf("yyyy"):0,C=l.value?l.value.indexOf("MM"):0;return r>C?"MM-yyyy":"yyyy-MM"});function E(r){r.stopPropagation(),n.emit("prePage")}function K(r){r.stopPropagation(),n.emit("preRecord")}function W(r){r.stopPropagation(),n.emit("clickYear")}function H(r){r.stopPropagation(),n.emit("clickMonth")}function _(r){r.stopPropagation(),n.emit("nextRecord")}function R(r){r.stopPropagation(),n.emit("nextPage")}function z(){return e.createVNode("button",{type:"button",class:y.value,onClick:r=>{i.value&&W(r)},tabindex:i.value?"0":"-1",disabled:a.value==="year"},[u.value?g.value.length>3?g.value[0][1].year+" - "+g.value[3][1].year:"":b.value.displayTextOfYear])}function O(){return!u.value&&a.value!=="month"&&e.createVNode("button",{type:"button",class:x.value,onClick:r=>{N.value&&H(r)},tabindex:N.value?"0":"-1"},[b.value.displayTextOfMonth])}return e.createVNode("div",{class:h.value,style:"height:40px; overflow:hidden;"},[e.createVNode("div",{class:"f-datepicker-prev-btn"},[e.createVNode("button",{type:"button",class:v.value,onClick:E},[e.createVNode("i",{class:"f-icon f-icon-arrow-double-60-left"},null)]),p.value&&e.createVNode("button",{type:"button","aria-label":o.value,class:B.value,onClick:K},[e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-left"},null)])]),e.createVNode("div",{class:"f-datepicker-monthYearText"},[j.value==="yyyy-MM"?[z(),O()]:[O(),z()]]),e.createVNode("div",{class:"f-datepicker-next-btn"},[p.value&&e.createVNode("button",{type:"button","aria-label":m.value,class:$.value,onClick:_},[e.createVNode("i",{class:"f-icon f-icon-arrow-chevron-right"},null)]),e.createVNode("button",{type:"button",class:T.value,onClick:R},[e.createVNode("i",{class:"f-icon f-icon-arrow-double-60-right"},null)])])])}}}),et={dates:{Type:Array,default:[]},daysInWeek:{Type:Array,default:le},enableKeyboadNavigate:{Type:Boolean,default:!0},enableMarkCurrent:{Type:Boolean,default:!0},enablePeriod:{Type:Boolean,default:!1},firstDayOfTheWeek:{Type:Boolean,default:"Sun."},selected:{Type:Object,default:null},selectedPeriod:{Type:Object,default:null},selectedWeek:{Type:Object,default:null},selectMode:{Type:String,default:"day"},showWeekNumber:{Type:Boolean,default:!1},weekTitle:{Type:String,default:"Week"}};var U=(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))(U||{});function ue(){function t(n){const o=n.key||n.keyCode;return o==="Enter"||o===13?13:o==="Escape"||o===27?27:o===" "||o===32?32:o==="ArrowLeft"||o===37?37:o==="ArrowUp"||o===38?38:o==="ArrowRight"||o===39?39:o==="ArrowDown"||o===40?40:o==="Tab"||o===9?9:o==="Shift"||o===16?16:-1}return{getKeyCodeFromEvent:t}}function tt(t){const n=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&n==="[object Date]"?new t.constructor(+t):typeof t=="number"||n==="[object Number]"||typeof t=="string"||n==="[object String]"?new Date(t):new Date(NaN)}function at(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function nt(t){if(!at(t)&&typeof t!="number")return!1;const n=tt(t);return!isNaN(Number(n))}function Q(){function t(){return{year:0,month:0,day:0}}function n(a){return new Date(a.year||0,a.month?a.month-1:0,a.day||0,a.hour?a.hour:0,a.minute?a.minute:0,a.second?a.second:0,0)}function o(a){const i=new Date;return a.year||(a.year=i.getFullYear()),a.month||(a.month=i.getMonth()+1),a.day||(a.day=1),new Date(a.year,a.month-1,a.day,a.hour?a.hour:0,a.minute?a.minute:0,a.second?a.second:0,0)}function m(a){return new Date(a.year||1,(a.month||1)-1,a.day,a.hour?a.hour:0,a.minute?a.minute:0,a.second?a.second:0,0).getDay()}function l(a){return le.indexOf(a)}function c(a){return n(a).getTime()}function P(a){return Math.round(c(a)/1e3)}function M(a,i,N){const h=c(i),v=c(N),p=c(a);return v-p>p-h?i:N}function f(){const a=new Date;return{year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate(),hour:a.getHours(),minute:a.getMinutes(),second:a.getSeconds()}}function b(a,i){const N=i.match(/[^(DdMmYy)]{1,}/g),h={};if(N){let v=N[0];N[0]!==N[1]&&(v=N[0]+N[1],N[2]&&N[1]!==N[2]&&(v+=N[2]));const p=new RegExp("["+v+"]"),B=a.split(p),$=i.split(p);for(let T=0;T<$.length;T++)$[T].indexOf("yyyy")!==-1&&(h.year=Number(B[T])),$[T].indexOf("M")!==-1&&(h.month=Number(B[T]||"1")),$[T].indexOf("d")!==-1&&(h.day=Number(B[T]||"1"))}else{const v=(i+"").indexOf("yyyy"),p=(i+"").indexOf("MM"),B=(i+"").indexOf("dd");if(v>=0){const $=a.substring(v,v+4);h.year=Number($)}p>=0&&(h.month=Number(a.substring(p,p+2)||"1")),B>=0&&(h.day=Number(a.substring(B,B+2)||"01"))}return h.year===void 0&&(h.year=f().year),h}function g(a,i=!0){const N=new Date(1900,1,1,0,0,0),h=new Date(9999,12,31,23,59,59),v=i?N:h;let p;return a instanceof Date?p=a:typeof a=="string"?p=a.trim()?new Date(a):v:p=v,nt(p)||(p=v),{year:p.getFullYear(),month:p.getMonth()+1,day:p.getDate(),hour:p.getHours(),minute:p.getMinutes(),second:p.getSeconds()}}function s(a){return g(a,!0)}function u(a){return g(a,!1)}return{emptyDate:t,getDate:n,getDate2:o,getDayNumber:m,getEpocTime:P,getNearDate:M,getWeekdayIndex:l,getTimeInMilliseconds:c,getToday:f,getDateObject:b,getMinDate:s,getMaxDate:u}}function oe(){const{getTimeInMilliseconds:t}=Q();function n(s){return s&&s.year!==0&&s.month!==0&&s.day!==0}function o(s){return s&&s.year!==0&&s.month!==0}function m(s){return s&&s.year!==0}function l(s,u){return t(s)<t(u)}function c(s,u){return t(s)<=t(u)}function P(s,u){return t(s)===t(u)}function M(s,u){const a=t(u);return t(s.from)===a||t(s.to)===a}function f(s,u){return!u||!n(u.to)||!n(u.from)?!1:c(u.from,s)&&c(s,u.to)}function b(s,u){return n(u)&&t(s)>=t(u)}function g(s,u){return n(u)&&t(s)<=t(u)}return{isDateEarlier:l,equal:P,inPeriod:f,isPoint:M,equalOrEarlier:c,isInitializedDate:n,isInitializedMonth:o,isInitializedYear:m,isMonthDisabledByDisableSince:b,isMonthDisabledByDisableUntil:g}}const ot=e.defineComponent({name:"FDatePickerCalendarView",props:et,emits:["click","clickWeek","keyDown","mouseEnter","mouseLeave"],setup(t,n){const o=e.ref(t.dates),m=e.ref(t.daysInWeek),l=e.ref(t.enableKeyboadNavigate),c=e.ref(t.enableMarkCurrent),P=e.ref(t.enablePeriod),M=e.ref(t.firstDayOfTheWeek),f=e.ref(t.selected),b=e.ref(t.selectedPeriod),g=e.ref(t.selectedWeek),s=e.ref(t.selectMode),u=e.ref(t.showWeekNumber),a=e.ref(t.weekTitle),i=e.computed(()=>u.value&&M.value==="Mon");e.watch(()=>t.dates,()=>{o.value=t.dates}),e.watch(()=>t.selected,()=>{f.value=t.selected}),e.watch(()=>t.enablePeriod,(r,C)=>{r!==C&&(P.value=r)});const{equal:N,inPeriod:h,isInitializedDate:v,equalOrEarlier:p,isPoint:B}=oe(),{getKeyCodeFromEvent:$}=ue(),T=r=>{const C=!!g.value&&r.numberInTheYear===g.value.numberInTheYear&&r.year===g.value.year;return{"f-datepicker-selectWeek":s.value==="week","f-datepicker-selectedWeek":s.value==="week"&&C}},y=e.computed(()=>u.value&&M.value==="Mon");function x(r){return h(r,b.value)}function j(r){return!!b.value&&B(b.value,r)}function E(r){return!!f.value&&N({year:f.value.year,month:f.value.month,day:f.value.day},{year:r.year,month:r.month,day:r.day})}const K=(r,C,D)=>{const Y=s.value!=="week"&&r.tag===L.current&&(P.value&&x(r.date)&&!j(r.date)||r.range),q=r.tag===L.previous||r.tag===L.next,J={"f-datepicker-range":Y,"f-datepicker-no-currmonth":q,"f-datepicker-disabled":r.disable,"f-datepicker-singledate":!r.disable},A=`d_${C}_${D}`;return J[A]=!0,J},W=r=>{const C=s.value!=="week"&&r.tag===L.current&&(!P.value&&E(r.date)||P.value&&j(r.date)),D=r.isCurrent&&c.value,Y=r.highlight&&(r.tag===L.previous||r.tag===L.next||r.disable);return{"f-datepicker-date":!0,"f-datepicker-selected":C,"f-datepicker-current":D,"f-datepicker-opacity":Y,"f-datepicker-highlight":r.highlight,"f-datepicker-disabled":r.disable}};function H(r,C){C.disable||s.value==="week"||(r.stopPropagation(),n.emit("click",{event:r,dayItem:C}))}function _(r,C){s.value==="week"&&(r.stopPropagation(),n.emit("clickWeek",C))}function R(r,C){const D=$(r);D!==U.tab&&(r.preventDefault(),D===U.enter||D===U.space?H(r,C):l.value&&n.emit("keyDown",C.date))}function z(r){b.value&&v(b.value.from)&&!v(b.value.to)&&(o.value.forEach(C=>{C.days.forEach(D=>{D.range=!!b.value&&(p(b.value.from,D.date)&&p(D.date,r.date)||p(D.date,b.value.from)&&p(r.date,D.date))})}),n.emit("mouseEnter",r.date))}function O(){o.value.forEach(r=>{r.days.forEach(C=>{C.range=!1})}),n.emit("mouseLeave")}return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-datepicker-table-wrapper"},[e.createVNode("table",{class:"f-datepicker-table",cellpadding:"0"},[e.createVNode("thead",null,[e.createVNode("tr",null,[i.value&&e.createVNode("th",{class:"f-datepicker-weeknbr-title"},[a.value]),m.value&&m.value.map(r=>e.createVNode("th",{scope:"col",style:"padding-bottom: 8px;padding-top: 4px"},[r]))])]),e.createVNode("tbody",null,[o.value&&o.value.map((r,C)=>e.createVNode("tr",{class:T(r),onClick:D=>_(D,r)},[y.value&&e.createVNode("td",{class:"f-datepicker-weeknbr"},[e.createVNode("div",{class:"f-datepicker-date"},[r.numberInTheYear])]),r.days&&r.days.map((D,Y)=>e.createVNode("td",{id:`d_${C}_${Y}`,tabindex:"0",class:K(D,C,Y),onClick:q=>H(q,D),onKeydown:q=>R(q,D),onMouseenter:()=>z(D),onMouseleave:()=>O()},[D.marked&&D.marked.marked&&e.createVNode("span",{class:"f-datepicker-markdate",style:{"background-color":D.marked.color}},null),e.createVNode("div",{class:W(D)},[D.date.day])]))]))])])])])}}),rt={months:{Type:Array,default:[[]]},enableMarkCurrent:{Type:Boolean,default:!1},enableKeyboadNavigate:{Type:Boolean,default:!0},enablePeriod:{Type:Boolean,default:!1},selected:{Type:Object,default:null},selectedPeriod:{Type:Object,default:null}},st=e.defineComponent({name:"FDatePickerMonthView",props:rt,emits:["click","keyDown","mouseEnter","mouseLeave"],setup(t,n){const o=e.ref(t.months),m=e.ref(t.enableMarkCurrent),l=e.ref(t.enableKeyboadNavigate),c=e.ref(t.enablePeriod),P=e.ref(t.selected),M=e.ref(t.selectedPeriod),{equal:f,inPeriod:b,isInitializedDate:g,equalOrEarlier:s}=oe(),{getKeyCodeFromEvent:u}=ue();e.watch(()=>t.months,()=>{o.value=t.months}),e.watch(()=>t.selected,()=>{P.value=t.selected});function a(T,y){T.stopPropagation(),!y.disable&&n.emit("click",y.date)}function i(T,y){const x=u(T);x!==U.tab&&(T.preventDefault(),x===U.enter||x===U.space?a(T,y):l.value&&n.emit("keyDown",y))}function N(T){M.value&&g(M.value.from)&&!g(M.value.to)&&(o.value.forEach(y=>{y.forEach(x=>{x.range=!!M.value&&(s(M.value.from,x.date)&&s(x.date,T.date)||s(x.date,M.value.from)&&s(T.date,x.date))})}),n.emit("mouseEnter",T))}function h(){o.value.forEach(T=>{T.forEach(y=>{y.range=!1})}),n.emit("mouseLeave")}function v(T){return!!P.value&&f({year:P.value.year,month:P.value.month},{year:T.year,month:T.month})}function p(T){return!!M.value&&(f({year:M.value.from.month},T)||f({year:M.value.to.month},T))}function B(T){return b(T,M.value)}const $=T=>({"f-datepicker-month-cell":!0,"f-datepicker-current":T.isCurrent&&m.value,"f-datepicker-selected":!c.value&&v(T.date)||c.value&&p(T.date),"f-datepicker-disabled":T.disable,"f-datepicker-range":B(T.date)||T.range});return()=>e.createVNode("div",{class:"f-datepicker-table-wrapper"},[e.createVNode("table",{class:"f-datepicker-table"},[e.createVNode("tbody",null,[o.value&&o.value.map((T,y)=>e.createVNode("tr",null,[T.map((x,j)=>e.createVNode("td",{id:`m_${y}_${j}`,class:`m_${y}_${j}`,onClick:E=>a(E,x),onKeydown:E=>i(E,x),onMouseenter:()=>N(x),onMouseleave:()=>h(),tabindex:"0",style:"width: 33.3%"},[e.createVNode("div",{class:"f-datepicker-month"},[e.createVNode("span",{class:$(x)},[x.displayText])])]))]))])])])}}),lt={years:{Type:Array,default:[[]]},enableKeyboadNavigate:{Type:Boolean,default:!0},enableMarkCurrent:{Type:Boolean,default:!0},enablePeriod:{Type:Boolean,default:!1},selected:{Type:Object,default:null},selectedPeriod:{Type:Object,default:null}},it=e.defineComponent({name:"FDatePickerYearView",props:lt,emits:["click","keyDown","mouseEnter","mouseLeave"],setup(t,n){const o=e.ref(t.years),m=e.ref(t.enableMarkCurrent),l=e.ref(t.enableKeyboadNavigate),c=e.ref(t.enablePeriod),P=e.ref(t.selected),M=e.ref(t.selectedPeriod),{equal:f,inPeriod:b,isInitializedDate:g,equalOrEarlier:s}=oe(),{getKeyCodeFromEvent:u}=ue();e.watch(()=>t.years,()=>{o.value=t.years}),e.watch(()=>t.selected,()=>{P.value=t.selected});const a=(y,x)=>{const j=`y_${y}_${x}`,E={"f-datepicker-no-currmonth":y===0&&x===0||y===3&&x===2};return E[j]=!0,E};function i(y){return b(y,M.value)}function N(y){return!!P.value&&f({year:P.value.year},y)}function h(y){return!!M.value&&(f({year:M.value.from.year},y)||f({year:M.value.to.year},y))}const v=y=>({"f-datepicker-year-cell":!0,"f-datepicker-current":y.isCurrent&&m.value,"f-datepicker-selected":!M.value&&N(y.date)||c.value&&h(y.date),"f-datepicker-disabled":y.disable,"f-datepicker-range":i(y.date)||y.range});function p(y,x){y.stopPropagation(),!x.disable&&n.emit("click",x)}function B(y,x){const j=u(y);j!==U.tab&&(y.preventDefault(),j===U.enter||j===U.space?p(y,x):l.value&&n.emit("keyDown",x))}function $(y){M.value&&g(M.value.from)&&!g(M.value.to)&&(o.value.forEach(x=>{x.forEach(j=>{j.range=!!M.value&&(s(M.value.from,j.date)&&s(j.date,y.date)||s(j.date,M.value.from)&&s(y.date,j.date))})}),n.emit("mouseEnter",y))}function T(){o.value.forEach(y=>{y.forEach(x=>{x.range=!1})}),n.emit("mouseLeave")}return()=>e.createVNode("table",{class:"f-datepicker-table-wrapper"},[e.createVNode("tbody",{class:"f-datepicker-table"},[o.value&&o.value.map((y,x)=>e.createVNode("tr",null,[y.map((j,E)=>e.createVNode("td",{id:"y_{yi}_{i}",class:a(x,E),onClick:K=>p(K,j),onKeydown:K=>B(K,j),onMouseenter:()=>$(j),onMouseleave:()=>T(),tabindex:"0"},[e.createVNode("div",{class:"f-datepicker-year"},[e.createVNode("span",{class:v(j)},[j.year])])]))]))])])}});function ye(){function t(l){return new Date(l.year||0,(l.month||1)-1,l.day,l.hour?l.hour:0,l.minute?l.minute:0,l.second?l.second:0,0).getDay()}function n(l){if(!l)return 1;if(!/^\d+$/.test(l.value))return-1;let c=Number(l.value);return(l.format.length===1&&l.value.length!==1&&c<10||l.format.length===1&&l.value.length!==2&&c>=10||l.format.length===2&&l.value.length>2)&&(c=-1),c}function o(l,c){if(l.value){for(let P=1;P<=12;P++)if(l.value.toLowerCase()===c[P].toLowerCase())return P}return-1}function m(l){const c=new Date(l.year||0,(l.month||1)-1,l.day,0,0,0,0);return c.setDate(c.getDate()+(c.getDay()===0?-3:4-c.getDay())),Math.round((c.getTime()-new Date(c.getFullYear(),0,4).getTime())/864e5/7)+1}return{getNumberByValue:n,getDayNumber:t,getMonthNumberByMonthName:o,getWeekNumber:m}}function dt(t,n,o,m,l,c,P,M){const{getTimeInMilliseconds:f,getWeekdayIndex:b}=Q(),{isInitializedDate:g}=oe(),{getDayNumber:s}=ye();function u(a){if(a.year&&a.year<t||a.year&&a.year>n)return!0;const i=f(a),N=a.hour!==void 0;if(g(m)&&(N?i:i+24*60*60*1e3-1)<f(m)||g(o)&&i>f(o))return!0;if(P){const v=s(a);if(v===0||v===6)return!0}const h=s(a);return!!(M.length>0&&M.find(p=>b(p)===h)||l.length>0&&l.find(p=>(p.year===0||p.year===a.year)&&(p.month===0||p.month===a.month)&&p.day===a.day)||c.length>0&&c.find(p=>g(p.from)&&g(p.to)&&i>=f(p.from)&&i<=f(p.to)))}return{isDisabledDate:u}}function ct(){const{getDayNumber:t}=ye();function n(m,l,c){let P=[];P=l.reduce((f,b)=>{const g=b.dates.map(s=>({date:s,color:b.color}));return[...f,...g]},P);const M=P.find(f=>(f.date.year===0||f.date.year===m.year)&&(f.date.month===0||f.date.month===m.month)&&f.date.day===m.day);if(M)return{marked:!0,color:M.color};if(c&&c.marked){const f=t(m);if(f===0||f===6)return{marked:!0,color:c.color}}return{marked:!1,color:""}}function o(m,l,c,P){const M=t(m);return l&&M===0||c&&M===6?!0:!!P.find(b=>(b.year===0||b.year===m.year)&&(b.month===0||b.month===m.month)&&b.day===m.day)}return{isHighlightedDate:o,isMarkedDate:n}}function xe(){const{getTimeInMilliseconds:t}=Q(),{isInitializedDate:n}=oe();function o(l,c){return n(c)&&t(l)<t(c)}function m(l,c){return n(c)&&t(l)>t(c)}return{isMonthDisabledByDisableSince:m,isMonthDisabledByDisableUntil:o}}function De(){const{getToday:t}=Q(),{isMonthDisabledByDisableSince:n,isMonthDisabledByDisableUntil:o}=xe();function m(g){const s={displayTextOfMonth:"",month:0,year:0,displayTextOfYear:""};if(g){const u=g.match(/[^0-9]/),a=u&&u.length?u[0]:"",i=g.split(a);s.month=i[0].length===2?Number(i[0]):Number(i[1]),s.year=i[0].length===2?Number(i[1]):Number(i[0])}return s}function l(g,s){return new Date(s,g,0).getDate()}function c(g,s,u){return new Date(g,s-1,u,0,0,0,0)}function P(g,s){const u=c(s,g,1);return u.setMonth(u.getMonth()-1),l(u.getMonth()+1,u.getFullYear())}function M(g,s,u,a){const i=t(),N=[],{year:h}=s,v=3,p={year:u.year,month:u.month,day:u.day},B={year:a.year,month:a.month,day:a.day};for(let $=1;$<=12;$+=v){const T=[];for(let y=$;y<$+v;y++){const x=n({year:h,month:y,day:1},p)||o({year:h,month:y,day:l(y,h||0)},B);T.push({month:y,displayText:g[y],isCurrent:y===i.month&&h===i.year,disable:x,date:{year:h,month:y}})}N.push(T)}return N}function f(g,s){const u={year:g===12?s+1:s},a=g===12?1:g+1;return u.month=a,u}function b(g,s){const u={year:g===1?s-1:s},a=g===1?12:g-1;return u.month=a,u}return{daysInMonth:l,daysInPreMonth:P,generateMonths:M,parseDefaultMonth:m,getNextMonth:f,getPreviousMonth:b}}function ut({isDisabledDate:t}){const{getToday:n}=Q(),{daysInMonth:o,daysInPreMonth:m,getNextMonth:l,getPreviousMonth:c}=De(),{isHighlightedDate:P,isMarkedDate:M}=ct(),{getWeekNumber:f}=ye();function b(a){const i=le.indexOf(a);return i>0?7-i:0}function g(a,i,N){const h=new Date;h.setDate(1),h.setMonth(i-1),h.setFullYear(a);const v=h.getDay()+N;return v>=7?v-7:v}function s(a,i,N,h,v){return a===v.day&&i===v.month&&N===v.year&&h===L.current}function u(a,i,N,h,v,p,B,$,T){const y=[],x=n(),j=g(i,a,b(N)),E=o(a,i),K=m(a,i);let W=1,H=L.previous;for(let _=1;_<7;_++){const R=[];if(_===1){const O=K-j+1;for(let C=O;C<=K;C++){const D={year:a===1?i-1:i,month:a===1?12:a-1,day:C},Y=s(C,a,i,H,x),q=t(D),J=M(D,h,v),A=P(D,$,B,p);R.push({date:D,tag:H,isCurrent:Y,disable:q,marked:J,highlight:A})}H=L.current;const r=7-R.length;for(let C=0;C<r;C++){const D={year:i,month:a,day:W},Y=s(W,a,i,H,x),q=t(D),J=M(D,h,v),A=P(D,$,B,p);R.push({date:D,tag:H,isCurrent:Y,disable:q,marked:J,highlight:A}),W++}}else for(let O=1;O<=7;O++){W>E&&(W=1,H=L.next);const r={year:H===L.next&&a===12?i+1:i,month:H===L.current?a:H===L.next&&a<12?a+1:1,day:W},C=s(W,a,i,H,x),D=t(r),Y=M(r,h,v),q=P(r,$,B,p);R.push({date:r,tag:H,isCurrent:C,disable:D,marked:Y,highlight:q}),W++}const z=T&&N==="Mon."?f(R[0].date):0;y.push({days:R,numberInTheYear:z,year:i})}return y}return{generateCalendar:u}}function yt(){const{getToday:t}=Q();function n(o,m,l,c,P,M){const f=[],b=o-o%10,{year:g,month:s}=m,u=t(),a=3,i=b+10;for(let N=b-1;N<i;N+=a){const h=[];for(let v=N;v<N+a;v++){const p=v<l||v>c;h.push({year:v,isCurrent:v===u.year,selected:v===g,disable:p,date:{year:v}})}f.push(h)}return f}return{generateYears:n}}const ft=e.defineComponent({name:"FDateView",props:we,emits:["datePicked","confirm"],setup(t,n){const o=e.ref(),m=e.ref(""),l=e.ref(t.mode),c=e.ref(t.top),P=e.ref(t.left),M=e.ref(t.position),f=e.ref(t.enablePeriod),b=e.ref(t.selectMode),g=e.ref(t.dateFormat),s=e.ref(t.nameOfMonths),u=e.ref(t.valueFormat),a=e.ref([]),i=e.ref(!1),N=e.ref(""),h=e.ref(!1),v=e.ref(""),p=e.ref(),B=e.ref(!1),$=e.ref(!1),T=e.ref(!1),y=e.ref(!1),x=e.ref(!1),j=e.ref(!1),E=e.ref(!1),K=e.ref(!1);e.ref(t.secondaryDates);const W=e.ref(t.daysInWeek),H=e.ref(t.enableKeyboadNavigate),_=e.ref(t.enableMarkCurrent),R=e.ref(t.firstDayOfTheWeek),z=e.ref(t.showWeekNumber),O=e.ref(t.selectedDate),r=e.ref(t.selectedSecondDate),C=e.ref(t.value),D=e.ref(t.selectedWeek),Y=e.ref(t.selectedPeriod),q=e.ref(t.weekTitle),J=e.ref(t.secondaryMonths),A=e.ref(t.selectedMonth),fe=e.ref(t.minYear),me=e.ref(t.maxYear),ee=e.ref(t.disableSince),te=e.ref(t.disableUntil),pt=e.ref(t.disableDates),bt=e.ref(t.disablePeriod),Mt=e.ref(t.disableWeekdays),vt=e.ref(t.disableWeekends),Ce=dt(fe.value,me.value,ee.value,te.value,pt.value,bt.value,vt.value,Mt.value),{formatTo:Oe,parseToDate:Ve}=G.useDateFormat(),{isMonthDisabledByDisableSince:gt,isMonthDisabledByDisableUntil:kt}=xe(),{generateCalendar:Se}=ut(Ce),{getToday:Pt,getDateObject:Tt}=Q(),{generateMonths:wt,getNextMonth:Nt,getPreviousMonth:xt,daysInMonth:Dt}=De(),{generateYears:Ct}=yt(),V=Pt(),X=e.computed(()=>{const d=Z.cloneDeep(V),w=C.value&&Ve(C.value,u.value);return w?Tt(Oe(w,"yyyy-MM-dd"),"yyyy-MM-dd"):d});O.value=X.value;const S=e.ref({year:X.value.year||1,month:X.value.month||1,displayTextOfMonth:s.value[X.value.month||"1"],displayTextOfYear:`${X.value.year}`});A.value={year:X.value.year?X.value.year:void 0,month:X.value.month?X.value.month:void 0};const je=V.month===12?(V.year||1)+1:V.year,Ot=(V.month||1)<12?(V.month||1)+1:1,he=e.ref({year:je,month:Ot,displayTextOfMonth:s.value[V.month||"1"],displayTextOfYear:`${je}`}),Vt=e.computed(()=>Se(S.value.month,S.value.year,R.value,[],{marked:!0,color:""},t.highlightDates,t.highlightSaturday,t.highlightSunday,z.value)),St=e.computed(()=>Se(he.value.month,he.value.year,R.value,[],{marked:!0,color:""},t.highlightDates,t.highlightSaturday,t.highlightSunday,z.value)),jt=e.computed(()=>wt(s.value,{year:S.value.year,month:S.value.month},ee.value,te.value)),pe=e.computed(()=>Ct(S.value.year,{year:S.value.year,month:S.value.month},fe.value,me.value,ee.value,te.value)),$t=e.computed(()=>{const d={"f-datepicker-container":!0},w=`container-position-${M.value}`;return d[w]=!0,d});e.watch(()=>t.enablePeriod,(d,w)=>{d!==w&&(f.value=d)});function Bt(){return f.value?"":t.showTime?"487px":"287px"}const Ht=e.computed(()=>({top:`${c.value}px`,left:`${P.value}px`,width:Bt(),position:"relative","z-index":l.value==="Embedded"?0:9999,"margin-top":"0px"}));function $a(d){}function Yt(d){d.stopPropagation()}function Ft(d,w){const k=S.value.year-(h.value?10:1),I={year:k,month:S.value.month,displayTextOfMonth:s.value[S.value.month||"1"],displayTextOfYear:`${k}`};S.value=I}function be(d,w){const k=xt(S.value.month,S.value.year),I={year:k.year||1,month:k.month||1,displayTextOfMonth:s.value[k.month||"1"],displayTextOfYear:`${k.year}`};S.value=I}function Me(d,w){const k=Nt(S.value.month,S.value.year),I={year:k.year||1,month:k.month||1,displayTextOfMonth:s.value[k.month||"1"],displayTextOfYear:`${k.year}`};S.value=I}function It(d,w){let k=S.value.year+1;h.value&&(k=pe.value[3][0].year+2);const I={year:k,month:S.value.month,displayTextOfMonth:s.value[S.value.month||"1"],displayTextOfYear:`${k}`};S.value=I}function Et(d){i.value=!i.value,h.value=!1}function At(d){i.value=b.value==="month"?!i.value:!1,h.value=b.value==="year"?!0:!h.value}const Wt=e.computed(()=>({"active-month":S.value,"date-format":g.value,"disable-pre-page":B.value,"disable-pre-record":$.value,"disable-next-record":T.value,"disable-next-page":y.value,years:pe.value,"selecting-month":i.value,"selecting-year":h.value,"select-mode":b.value})),Rt=e.computed(()=>({"active-month":he.value,"date-format":g.value,"disable-pre-page":x.value,"disable-pre-record":j.value,"disable-next-record":E.value,"disable-next-page":K.value,years:a.value,"selecting-month":N.value,"selecting-year":v.value,"select-mode":b.value}));function $e(d,w){return e.createVNode(Ze,e.mergeProps(w,{onPrePage:k=>Ft(),onPreRecord:k=>be(),onNextRecord:k=>Me(),onNextPage:k=>It(),onClickMonth:k=>Et(),onClickYear:k=>At()}),null)}const ie=e.computed(()=>!i.value&&!h.value&&!p.value||f.value&&b.value!=="week"&&!N.value&&!v.value&&!p.value),qt=e.computed(()=>i.value&&!h.value),Lt=e.computed(()=>h.value&&!i.value);e.watchEffect(()=>{ie.value&&(S.value={year:A.value.year||1,month:A.value.month||1,displayTextOfMonth:s.value[A.value.month||"1"],displayTextOfYear:`${A.value.year}`})});const _t=e.computed(()=>({dates:Vt.value,daysInWeek:W.value,enableKeyboadNavigate:H.value,enableMarkCurrent:_.value,enablePeriod:f.value,firstDayOfTheWeek:R.value,selected:O.value,selectedPeriod:Y.value,selectedWeek:D.value,selectMode:b.value,showWeekNumber:z.value,weekTitle:q.value})),Kt=e.computed(()=>({dates:St.value,daysInWeek:W.value,enableKeyboadNavigate:H.value,enableMarkCurrent:_.value,enablePeriod:f.value,firstDayOfTheWeek:R.value,selected:r.value,selectedPeriod:Y.value,selectMode:b.value,showWeekNumber:z.value,weekTitle:q.value}));function zt(d,w,k){const{event:I,dayItem:ae}=d,re=ae.date;if(ae.tag===1?be():ae.tag===3&&Me(),!t.showTime)k==="start"?O.value=re:r.value=re,n.emit("datePicked",re);else{const{year:ua,month:ya,day:fa}=re;O.value.year=ua,O.value.month=ya,O.value.day=fa}const{year:da,month:ca}=re;A.value={year:da,month:ca}}function Ba(d){}function Ha(d){}function Ya(d,w){}function Fa(d,w){}function Be(d,w,k="start"){return ie.value&&e.createVNode(ot,e.mergeProps(w,{onClick:I=>zt(I,d,k),onClickWeek:I=>void 0,onKeyDown:I=>void 0,onMouseEnter:I=>void 0,onMouseLeave:I=>void 0}),null)}const Ut=e.computed(()=>({months:jt.value,enableMarkCurrent:_.value,enableKeyboadNavigate:H.value,enablePeriod:f.value,selected:A.value,selectedPeriod:Y.value})),Xt=e.computed(()=>({months:J.value,enableMarkCurrent:_.value,enableKeyboadNavigate:H.value,enablePeriod:f.value,selected:A.value,selectedPeriod:Y.value}));function Gt(d,w){if(i.value=!1,h.value=!1,A.value=d,S.value={month:d.month||1,displayTextOfMonth:s.value[d.month||"1"],year:d.year||1,displayTextOfYear:`${d.year}`},b.value==="month"){const k=Z.cloneDeep(d);k.day=1,n.emit("datePicked",k)}}function Ia(d){}function Ea(d,w){}function Aa(d,w){}function He(d,w){return e.createVNode(st,e.mergeProps(w,{onClick:k=>Gt(k),onKeyDownMonthView:k=>void 0,onMouseEnterMonthView:k=>void 0,onMouseLeaveMonthView:k=>void 0}),null)}const Jt=e.computed(()=>({years:pe.value,enableKeyboadNavigate:H.value,enableMarkCurrent:_.value,enablePeriod:f.value,selected:O.value,selectedPeriod:Y.value})),Qt=e.computed(()=>({years:a.value,enableKeyboadNavigate:H.value,enableMarkCurrent:_.value,enablePeriod:f.value,selected:O.value,selectedPeriod:Y.value}));function Zt(d,w){if(i.value=!0,h.value=!1,S.value={month:S.value.month,displayTextOfMonth:S.value.displayTextOfMonth,year:d.year||1,displayTextOfYear:`${d.year}`},b.value==="year"){const k=Z.cloneDeep(d);k.month=1,k.day=1,n.emit("datePicked",k)}}function Wa(d){}function Ra(d,w){}function qa(d,w){}function ea(){if(t.showTime)n.emit("confirm",O.value);else{const d={startDate:{},endDate:{}};O.value&&(d.startDate=O.value),r.value&&(d.endDate=r.value),n.emit("confirm",d)}}function ta(d){S.value={year:V.year||1,month:V.month||1,displayTextOfMonth:s.value[V.month||"1"],displayTextOfYear:`${V.year}`},O.value=Z.cloneDeep(V),n.emit("datePicked",V)}function aa(d){S.value={year:V.year||1,month:V.month||1,displayTextOfMonth:s.value[V.month||"1"],displayTextOfYear:`${V.year}`},O.value=Z.cloneDeep(V),A.value={year:V.year,month:V.month}}function na(d){S.value={year:V.year||1,month:V.month||1,displayTextOfMonth:s.value[V.month||"1"],displayTextOfYear:`${V.year}`},O.value=Z.cloneDeep(V)}const Ye=e.computed(()=>f.value&&b.value!=="week"),oa=e.computed(()=>ie.value&&Ye.value||t.showTime);function Fe(d,w){return e.createVNode(it,e.mergeProps(w,{onClick:k=>Zt(k),onKeyDownYearView:k=>void 0,onClickPreRecord:k=>be(),onClickNextRecord:k=>Me(),onMouseEnterYearView:k=>void 0,onMouseLeaveYearView:k=>void 0}),null)}function ra(){const d="HH:mm:ss";if(C.value){const w=Ve(C.value,u.value);m.value=Oe(w||"",d)||"00:00:00",O.value&&(O.value.hour=(w==null?void 0:w.getHours())||0,O.value.minute=(w==null?void 0:w.getMinutes())||0,O.value.second=(w==null?void 0:w.getSeconds())||0)}else{const{hour:w,minute:k,second:I}=O.value;m.value=`${w||"0"}:${k||0}:${I||0}`,m.value=G.formatTime(m.value)}}e.onMounted(()=>{t.showTime&&ra(),b.value==="month"?(i.value=!0,h.value=!1):b.value==="year"&&(h.value=!0,i.value=!1)});const sa=d=>{m.value=d.text;const{hour:w,minute:k,second:I}=G.getTimeObject(m.value);O.value&&(O.value.hour=w||0,O.value.minute=k||0,O.value.second=I||0)},Ie=e.computed(()=>d=>{const w=d.day==null||Ce.isDisabledDate(t.showTime?d:{year:d.year,month:d.month,day:d.day});return{"pointer-events":w?"none":"auto",opacity:w?.3:1}}),la=e.computed(()=>{const{year:d,month:w}=V,k={year:ee.value.year,month:ee.value.month,day:ee.value.day},I={year:te.value.year,month:te.value.month,day:te.value.day},ae=gt({year:d,month:w,day:1},k)||kt({year:d,month:w,day:Dt(w||0,d||0)},I);return{"pointer-events":ae?"none":"auto",opacity:ae?.3:1}}),ia=e.computed(()=>{const d=V.year?V.year>=fe.value&&V.year<=me.value:!1;return{"pointer-events":d?"auto":"none",opacity:d?1:.3}});return()=>e.createVNode("div",{class:$t.value,style:Ht.value,tabindex:"0",onKeyup:d=>void 0,onClick:d=>Yt(d)},[e.createVNode("div",{class:"f-datepicker-content",style:"width:287px"},[$e(!1,Wt.value),Be(!1,_t.value),i.value&&He(!1,Ut.value),h.value&&Fe(!1,Jt.value),e.createVNode("div",{class:"f-datepicker-footer"},[e.createVNode("div",{class:"f-datepicker-redirect"},[ie.value&&e.createVNode("button",{class:"btn btn-link",style:Ie.value(V),onClick:ta},[e.createTextVNode("今天")]),qt.value&&e.createVNode("button",{class:"btn btn-link",style:la.value,onClick:aa},[e.createTextVNode("本月")]),Lt.value&&e.createVNode("button",{class:"btn btn-link",style:ia.value,onClick:na},[e.createTextVNode("今年")])])])]),t.showTime&&e.createVNode("div",{class:"f-datepicker-content position-relative datepicker-content-has-timer",style:"width:200px"},[e.createVNode("div",{style:"height: 40px; border-bottom: 1px solid #E4E7EF; text-align: center; line-height: 40px; font-size: 16px; font-weight: 500;"},[m.value]),e.createVNode(We.FTimePickerTimeView,{style:"top:41px;",ref:o,modelValue:m.value,onValueChange:sa},null)]),Ye.value&&e.createVNode("div",{class:"f-datepicker-content"},[$e(!0,Rt.value),Be(!0,Kt.value,"end"),N.value&&He(!0,Xt.value),v.value&&Fe(!0,Qt.value)]),oa.value&&e.createVNode("div",{class:"f-datepicker-commitBtn-wrapper",style:"justify-content: end;"},[e.createVNode(Re.FButton,{onClick:ea,style:Ie.value(O.value)},{default:()=>[e.createTextVNode("确定")]})])])}}),mt=e.defineComponent({name:"FDateViewDesign",props:Xe,emits:[],setup(t,n){const o=e.ref(),m=e.inject("design-item-context"),l=ve.useDesignerComponent(o,m);return e.onMounted(()=>{o.value.componentInstance=l}),n.expose(l.value),()=>e.createVNode(ft,{ref:o},null)}});ne.register=(t,n,o,m)=>{t["date-picker"]=se.DatePicker,t["date-view"]=se.DatePickerContainer,n["date-picker"]=ce,n["date-view"]=Ne},ne.registerDesigner=(t,n,o)=>{t["date-picker"]=ne,t["date-view"]=mt,n["date-picker"]=ce,n["date-view"]=Ne};const ht=G.withInstall(ne);F.FDatePickerDesign=ne,F.MAX_DATE=Le,F.MIN_DATE=_e,F.datePickerDesignProps=Pe,F.datePickerPropsResolver=ce,F.default=ht,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.f-drawer{position:fixed;z-index:1000;top:0;right:0;bottom:0;left:0;pointer-events:none}.f-drawer.f-drawer-inline{position:absolute}.f-drawer-container{display:flex;flex-direction:column;width:100%;height:100%}.f-drawer-header{display:flex;padding:16px 24px;justify-content:space-between}.f-drawer-close:hover{cursor:pointer}.f-drawer-body{flex:1;padding:24px}.f-drawer-mask{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1000;background:#00000073;pointer-events:auto}.f-drawer-wrapper{position:absolute;z-index:1000;transition:all .3s;pointer-events:auto;background-color:#fff}.f-drawer-wrapper-right{top:0;right:0;bottom:0;height:100%!important}.f-drawer-wrapper-left{top:0;left:0;bottom:0;height:100%!important}.f-drawer-wrapper-top{top:0;left:0;width:100%!important}.f-drawer-wrapper-bottom{bottom:0;left:0;width:100%!important}.f-drawer-entry{position:absolute;z-index:850;transition:transform 1s}.f-drawer-entry-left{top:30px;left:0}.f-drawer-entry-right{top:30px;right:0}.f-drawer-entry-top{left:30px;top:0}.f-drawer-entry-bottom{left:30px;bottom:0}.f-drawer-entry-icon{width:24px;height:30px;background:#2a87ff;color:#fff;box-shadow:0 2px 3px #6081ba33;text-align:center;cursor:pointer}.f-drawer-entry-icon .f-icon{font-size:24px;line-height:30px}.f-drawer-right-enter-active,.f-drawer-right-leave-active,.f-drawer-left-enter-active,.f-drawer-left-leave-active,.f-drawer-top-enter-active,.f-drawer-top-leave-active,.f-drawer-bottom-enter-active,.f-drawer-bottom-leave-active,.f-drawer-mask-enter-active,.f-drawer-mask-leave-active{transition:all .3s}.f-drawer-right-enter-from,.f-drawer-right-leave-to{transform:translate(100%)}.f-drawer-right-enter-to,.f-drawer-right-leave-from,.f-drawer-left-enter-to,.f-drawer-left-leave-from{transform:translate(0)}.f-drawer-left-enter-from,.f-drawer-left-leave-to{transform:translate(-100%)}.f-drawer-top-enter-from,.f-drawer-top-leave-to{transform:translateY(-100%)}.f-drawer-top-enter-to,.f-drawer-top-leave-from,.f-drawer-bottom-enter-to,.f-drawer-bottom-leave-from{transform:translateY(0)}.f-drawer-bottom-enter-from,.f-drawer-bottom-leave-to{transform:translateY(100%)}.f-drawer-mask-enter-from,.f-drawer-mask-leave-to{opacity:0}.f-drawer-mask-enter-to,.f-drawer-mask-leave-from{opacity:1}.f-drawer-footer{height:60px;display:flex;justify-content:end;align-items:center}
|
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import { resolveAppearance as G, createPropsResolver as J } from "../../components/dynamic-resolver/index.esm.js";
|
|
2
|
+
import { withInstall as Q } from "../../components/common/index.esm.js";
|
|
3
|
+
import { defineComponent as B, ref as w, computed as a, watch as D, createVNode as t, Teleport as $, Transition as y, withModifiers as v, withDirectives as X, Fragment as Y, createTextVNode as S, vShow as Z, inject as I, onMounted as _ } from "vue";
|
|
4
|
+
import R from "../../components/button/index.esm.js";
|
|
5
|
+
import { UseTemplateDragAndDropRules as O, useDesignerComponent as ee, FDesignerInnerItem as te } from "../../components/designer-canvas/index.esm.js";
|
|
6
|
+
import re, { responseToolbarResolver as M } from "../response-toolbar/index.esm.js";
|
|
7
|
+
import { BaseControlProperty as oe } from "../../components/property-panel/index.esm.js";
|
|
8
|
+
const V = {
|
|
9
|
+
/** 背景色 */
|
|
10
|
+
backgroundColor: { type: String, default: "#fff" },
|
|
11
|
+
/**
|
|
12
|
+
* 关闭对话框前事件, 是个函数,返回true或者false
|
|
13
|
+
*/
|
|
14
|
+
beforeClose: { type: Function, default: () => !0 },
|
|
15
|
+
/**
|
|
16
|
+
* 自定义抽屉样式
|
|
17
|
+
*/
|
|
18
|
+
class: { type: String, default: "" },
|
|
19
|
+
/**
|
|
20
|
+
* 自定义抽屉蒙层样式
|
|
21
|
+
*/
|
|
22
|
+
modalClass: { type: String, default: "" },
|
|
23
|
+
/** 高度 */
|
|
24
|
+
height: { type: String, default: 300 },
|
|
25
|
+
/** 打开关闭抽屉 */
|
|
26
|
+
modelValue: { type: Boolean, default: !1 },
|
|
27
|
+
/** 从哪个位置呼出 */
|
|
28
|
+
position: { type: String, default: "right" },
|
|
29
|
+
/** 抽屉插入位置 */
|
|
30
|
+
appendTo: { type: String, default: "body" },
|
|
31
|
+
/** 是否展示打开抽屉入口 */
|
|
32
|
+
showEntry: { type: Boolean, default: !1 },
|
|
33
|
+
/** 是否展示关闭按钮 */
|
|
34
|
+
showClose: { type: Boolean, default: !0 },
|
|
35
|
+
/** 是否展示遮罩层 */
|
|
36
|
+
// mask: { type: Boolean, default: true },
|
|
37
|
+
/** 点击遮罩是否关闭抽屉 */
|
|
38
|
+
allowClickMaskToClose: { type: Boolean, default: !0 },
|
|
39
|
+
/** 标题 */
|
|
40
|
+
title: { type: String, default: "" },
|
|
41
|
+
/** 宽度 */
|
|
42
|
+
width: { type: String, default: 300 },
|
|
43
|
+
/**
|
|
44
|
+
* 渲染的DOM容器
|
|
45
|
+
*/
|
|
46
|
+
host: { type: Object, default: "body" }
|
|
47
|
+
}, ne = /* @__PURE__ */ B({
|
|
48
|
+
name: "FDrawer",
|
|
49
|
+
props: V,
|
|
50
|
+
emits: ["afterClose", "update:modelValue"],
|
|
51
|
+
setup(e, r) {
|
|
52
|
+
const n = w(e.modelValue), h = a(() => ({
|
|
53
|
+
"f-drawer": !0,
|
|
54
|
+
// 在某个DOM内部打开抽屉
|
|
55
|
+
"f-drawer-inline": typeof e.host == "string" ? e.host !== "body" : document.querySelector(e.host) !== document.body
|
|
56
|
+
}));
|
|
57
|
+
a(() => ({}));
|
|
58
|
+
const i = a(() => {
|
|
59
|
+
const o = {};
|
|
60
|
+
return e.maskClass && e.maskClass.split(" ").forEach((s) => {
|
|
61
|
+
o[s] = !0;
|
|
62
|
+
}), {
|
|
63
|
+
"f-drawer-mask": !0,
|
|
64
|
+
...o
|
|
65
|
+
};
|
|
66
|
+
}), g = a(() => {
|
|
67
|
+
const o = {};
|
|
68
|
+
return e.maskClass && e.class.split(" ").forEach((s) => {
|
|
69
|
+
o[s] = !0;
|
|
70
|
+
}), {
|
|
71
|
+
"f-drawer-wrapper": !0,
|
|
72
|
+
[`f-drawer-wrapper-${e.position}`]: !0,
|
|
73
|
+
...o
|
|
74
|
+
};
|
|
75
|
+
}), f = a(() => {
|
|
76
|
+
const o = e.width;
|
|
77
|
+
return typeof o == "string" ? o : typeof o == "number" ? `${o}px` : "20%";
|
|
78
|
+
}), d = a(() => {
|
|
79
|
+
const o = e.height;
|
|
80
|
+
return typeof o == "string" ? o : typeof o == "number" ? `${o}px` : "20%";
|
|
81
|
+
}), m = a(() => `f-drawer-${e.position}`), c = (o) => {
|
|
82
|
+
Promise.resolve().then(() => {
|
|
83
|
+
var s;
|
|
84
|
+
return (s = e.beforeClose) == null ? void 0 : s.call(e);
|
|
85
|
+
}).then((s) => {
|
|
86
|
+
s && (n.value = !1, r.emit("update:modelValue", n.value), r.emit("afterClose"));
|
|
87
|
+
});
|
|
88
|
+
}, p = (o) => {
|
|
89
|
+
c();
|
|
90
|
+
};
|
|
91
|
+
return D(() => e.modelValue, (o, s) => {
|
|
92
|
+
o !== s && (n.value = o);
|
|
93
|
+
}), () => t($, {
|
|
94
|
+
to: e.host
|
|
95
|
+
}, {
|
|
96
|
+
default: () => [t("div", {
|
|
97
|
+
class: h.value
|
|
98
|
+
}, [t(y, {
|
|
99
|
+
name: "f-drawer-mask",
|
|
100
|
+
appear: !0
|
|
101
|
+
}, {
|
|
102
|
+
default: () => [n.value && t("div", {
|
|
103
|
+
class: i.value,
|
|
104
|
+
onClick: v((o) => {
|
|
105
|
+
e.allowClickMaskToClose && c();
|
|
106
|
+
}, ["stop"])
|
|
107
|
+
}, null)]
|
|
108
|
+
}), t(y, {
|
|
109
|
+
name: m.value
|
|
110
|
+
}, {
|
|
111
|
+
default: () => {
|
|
112
|
+
var o, s;
|
|
113
|
+
return [X(t("div", {
|
|
114
|
+
class: g.value,
|
|
115
|
+
style: {
|
|
116
|
+
width: f.value,
|
|
117
|
+
height: d.value,
|
|
118
|
+
backgroundColor: e.backgroundColor
|
|
119
|
+
}
|
|
120
|
+
}, [t("div", {
|
|
121
|
+
class: "f-drawer-container"
|
|
122
|
+
}, [t("div", {
|
|
123
|
+
class: "f-drawer-header"
|
|
124
|
+
}, [t("div", {
|
|
125
|
+
class: "f-drawer-title"
|
|
126
|
+
}, [r.slots.headerTemplate ? r.slots.headerTemplate() : e.title]), e.showClose && t("div", {
|
|
127
|
+
class: "f-drawer-close"
|
|
128
|
+
}, [t("span", {
|
|
129
|
+
class: "f-icon f-icon-close",
|
|
130
|
+
onClick: v((T) => {
|
|
131
|
+
c();
|
|
132
|
+
}, ["stop"])
|
|
133
|
+
}, null)])]), t("div", {
|
|
134
|
+
class: "f-drawer-body"
|
|
135
|
+
}, [(s = (o = r.slots).content) == null ? void 0 : s.call(o)]), t("div", {
|
|
136
|
+
class: "f-drawer-footer"
|
|
137
|
+
}, [r.slots.footerTemplate ? r.slots.footerTemplate() : t(Y, null, [t(R, {
|
|
138
|
+
class: "mr-2",
|
|
139
|
+
onClick: c
|
|
140
|
+
}, {
|
|
141
|
+
default: () => [S("取消")]
|
|
142
|
+
}), t(R, {
|
|
143
|
+
onClick: p
|
|
144
|
+
}, {
|
|
145
|
+
default: () => [S("确定")]
|
|
146
|
+
})])])])]), [[Z, n.value]])];
|
|
147
|
+
}
|
|
148
|
+
})])]
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
class se extends oe {
|
|
153
|
+
constructor(r, n) {
|
|
154
|
+
super(r, n);
|
|
155
|
+
}
|
|
156
|
+
getPropertyConfig(r) {
|
|
157
|
+
return this.propertyConfig.categories.basic = this.getBasicPropConfig(r), this.propertyConfig.categories.appearance = this.getAppearanceConfig(r), this.getBehaviorConfig(), this.propertyConfig;
|
|
158
|
+
}
|
|
159
|
+
getBehaviorConfig() {
|
|
160
|
+
this.propertyConfig.categories.behavior = {
|
|
161
|
+
title: "行为",
|
|
162
|
+
description: "Behavior",
|
|
163
|
+
properties: {
|
|
164
|
+
title: {
|
|
165
|
+
title: "标题",
|
|
166
|
+
description: "标题",
|
|
167
|
+
type: "string"
|
|
168
|
+
},
|
|
169
|
+
position: {
|
|
170
|
+
title: "显示位置",
|
|
171
|
+
description: "抽屉显示位置",
|
|
172
|
+
type: "select",
|
|
173
|
+
default: "right",
|
|
174
|
+
editor: {
|
|
175
|
+
type: "combo-list",
|
|
176
|
+
textField: "name",
|
|
177
|
+
valueField: "value",
|
|
178
|
+
editable: !1,
|
|
179
|
+
data: [
|
|
180
|
+
{ value: "left", name: "左侧" },
|
|
181
|
+
{ value: "right", name: "右侧" }
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
width: {
|
|
186
|
+
title: "宽度",
|
|
187
|
+
description: "抽屉宽度",
|
|
188
|
+
type: "number"
|
|
189
|
+
},
|
|
190
|
+
showMask: {
|
|
191
|
+
title: "显示遮罩",
|
|
192
|
+
description: "是否显示遮罩",
|
|
193
|
+
type: "boolean",
|
|
194
|
+
default: !0
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
setPropertyRelates(r, n) {
|
|
198
|
+
if (r)
|
|
199
|
+
switch (r && r.propertyID) {
|
|
200
|
+
case "title": {
|
|
201
|
+
r.needRefreshControlTree = !0;
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function ae(e, r) {
|
|
210
|
+
new O();
|
|
211
|
+
function n() {
|
|
212
|
+
return !1;
|
|
213
|
+
}
|
|
214
|
+
function h() {
|
|
215
|
+
return !1;
|
|
216
|
+
}
|
|
217
|
+
function i() {
|
|
218
|
+
return !1;
|
|
219
|
+
}
|
|
220
|
+
function g() {
|
|
221
|
+
return !0;
|
|
222
|
+
}
|
|
223
|
+
function f() {
|
|
224
|
+
return "position: absolute !important;border: none !important;left: 0;right: 0;padding: 0;";
|
|
225
|
+
}
|
|
226
|
+
function d(m) {
|
|
227
|
+
const c = new se(m, r), { schema: p } = e;
|
|
228
|
+
return c.getPropertyConfig(p);
|
|
229
|
+
}
|
|
230
|
+
return { canAccepts: n, checkCanDeleteComponent: h, checkCanMoveComponent: i, hideNestedPaddingInDesginerView: g, getStyles: f, getPropsConfig: d };
|
|
231
|
+
}
|
|
232
|
+
const F = Object.assign({}, V, {
|
|
233
|
+
componentId: { type: String, default: "" }
|
|
234
|
+
}), C = /* @__PURE__ */ B({
|
|
235
|
+
name: "FDrawerDesign",
|
|
236
|
+
props: F,
|
|
237
|
+
setup(e, r) {
|
|
238
|
+
const n = w(), h = I("designer-host-service"), i = I("design-item-context"), g = ae(i, h), f = ee(n, i, g), d = w(i.schema.toolbar || {
|
|
239
|
+
type: "response-toolbar",
|
|
240
|
+
buttons: []
|
|
241
|
+
}), m = w(M(d.value));
|
|
242
|
+
D(() => i.schema.toolbar, () => {
|
|
243
|
+
d.value = i.schema.toolbar || {
|
|
244
|
+
type: "response-toolbar",
|
|
245
|
+
buttons: []
|
|
246
|
+
}, m.value = M(d.value);
|
|
247
|
+
}, {
|
|
248
|
+
deep: !0
|
|
249
|
+
});
|
|
250
|
+
const c = a(() => [...m.value.items]);
|
|
251
|
+
_(() => {
|
|
252
|
+
n.value.componentInstance = f;
|
|
253
|
+
}), r.expose(f.value);
|
|
254
|
+
const p = w(e.modelValue);
|
|
255
|
+
D(() => e.modelValue, () => {
|
|
256
|
+
p.value = e.modelValue;
|
|
257
|
+
});
|
|
258
|
+
const o = a(() => ["f-drawer-wrapper", `f-drawer-wrapper-${e.position}`, e.wrapperClass]), s = a(() => {
|
|
259
|
+
const l = e.width, u = e.height, b = typeof l == "string" ? l : typeof l == "number" ? `${l}px` : "20%", k = typeof u == "string" ? u : typeof u == "number" ? `${u}px` : "20%";
|
|
260
|
+
return {
|
|
261
|
+
width: b,
|
|
262
|
+
height: k,
|
|
263
|
+
backgroundColor: e.backgroundColor
|
|
264
|
+
};
|
|
265
|
+
}), T = a(() => ["f-drawer-entry", `f-drawer-entry-${e.position}`, e.entryClass]), A = a(() => `f-icon-arrow-chevron-${{
|
|
266
|
+
left: "right",
|
|
267
|
+
right: "left",
|
|
268
|
+
top: "down",
|
|
269
|
+
bottom: "up"
|
|
270
|
+
}[e.position] ?? "right"}`), j = a(() => `f-drawer-${e.position}`), P = () => {
|
|
271
|
+
p.value = !1;
|
|
272
|
+
}, E = () => {
|
|
273
|
+
p.value = !0;
|
|
274
|
+
}, q = () => t("div", {
|
|
275
|
+
class: T.value,
|
|
276
|
+
onClick: E
|
|
277
|
+
}, [r.slots.button ? r.slots.button() : t("div", {
|
|
278
|
+
class: "f-drawer-entry-icon"
|
|
279
|
+
}, [t("span", {
|
|
280
|
+
class: `f-icon ${A.value}`
|
|
281
|
+
}, null)])]), x = () => t(y, {
|
|
282
|
+
name: "f-drawer-mask",
|
|
283
|
+
appear: !0
|
|
284
|
+
}, {
|
|
285
|
+
default: () => [p.value && e.showMask && t("div", {
|
|
286
|
+
class: "f-drawer-mask",
|
|
287
|
+
onClick: e.closeByMask && v(P, ["stop"])
|
|
288
|
+
}, null)]
|
|
289
|
+
});
|
|
290
|
+
function H(l, u, b, k) {
|
|
291
|
+
i && i.setupContext && i.setupContext.emit("selectionChange", l, u, b, k);
|
|
292
|
+
}
|
|
293
|
+
const U = () => {
|
|
294
|
+
if (c.value && c.value.length > 0)
|
|
295
|
+
return t(te, {
|
|
296
|
+
modelValue: d.value,
|
|
297
|
+
"onUpdate:modelValue": (l) => d.value = l,
|
|
298
|
+
canAdd: !0,
|
|
299
|
+
childType: "response-toolbar-item",
|
|
300
|
+
childLabel: "按钮",
|
|
301
|
+
contentKey: "buttons",
|
|
302
|
+
id: d.value.id,
|
|
303
|
+
componentId: e.componentId,
|
|
304
|
+
onSelectionChange: H
|
|
305
|
+
}, {
|
|
306
|
+
default: () => [t(re, {
|
|
307
|
+
customClass: "w-100",
|
|
308
|
+
items: c.value,
|
|
309
|
+
componentId: e.componentId
|
|
310
|
+
}, null)]
|
|
311
|
+
});
|
|
312
|
+
}, K = () => t("div", {
|
|
313
|
+
class: "f-drawer-close"
|
|
314
|
+
}, [t("span", {
|
|
315
|
+
class: "f-icon f-icon-close",
|
|
316
|
+
onClick: v(P, ["stop"])
|
|
317
|
+
}, null)]), L = () => t("div", {
|
|
318
|
+
class: "f-drawer-header"
|
|
319
|
+
}, [t("div", {
|
|
320
|
+
class: "f-drawer-header-left"
|
|
321
|
+
}, [t("div", {
|
|
322
|
+
class: "f-drawer-title"
|
|
323
|
+
}, [r.slots.title ? r.slots.title() : e.title])]), t("div", {
|
|
324
|
+
class: "f-drawer-header-right"
|
|
325
|
+
}, [U(), e.showClose && K()])]), W = () => t(y, {
|
|
326
|
+
name: j.value,
|
|
327
|
+
appear: !0
|
|
328
|
+
}, {
|
|
329
|
+
default: () => {
|
|
330
|
+
var l, u;
|
|
331
|
+
return [p.value && t("div", {
|
|
332
|
+
class: o.value,
|
|
333
|
+
style: s.value
|
|
334
|
+
}, [t("div", {
|
|
335
|
+
class: "f-drawer-container"
|
|
336
|
+
}, [L(), t("div", {
|
|
337
|
+
class: "f-drawer-body"
|
|
338
|
+
}, [(u = (l = r.slots).default) == null ? void 0 : u.call(l)])])])];
|
|
339
|
+
}
|
|
340
|
+
}), z = () => t($, {
|
|
341
|
+
to: ".editorPanel "
|
|
342
|
+
}, {
|
|
343
|
+
default: () => [t("div", {
|
|
344
|
+
class: "f-drawer"
|
|
345
|
+
}, [x(), W()])]
|
|
346
|
+
});
|
|
347
|
+
return () => t("div", {
|
|
348
|
+
ref: n
|
|
349
|
+
}, [z(), q()]);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
function ie(e, r, n) {
|
|
353
|
+
return r;
|
|
354
|
+
}
|
|
355
|
+
const le = /* @__PURE__ */ new Map([
|
|
356
|
+
["appearance", G]
|
|
357
|
+
]), de = "https://json-schema.org/draft/2020-12/schema", ce = "https://farris-design.gitee.io/drawer.schema.json", ue = "drawer", pe = "A Farris Component", fe = "object", me = {
|
|
358
|
+
id: {
|
|
359
|
+
description: "The unique identifier for drawer",
|
|
360
|
+
type: "string"
|
|
361
|
+
},
|
|
362
|
+
type: {
|
|
363
|
+
description: "The type string of drawer",
|
|
364
|
+
type: "string",
|
|
365
|
+
default: "drawer"
|
|
366
|
+
},
|
|
367
|
+
appearance: {
|
|
368
|
+
description: "",
|
|
369
|
+
type: "object",
|
|
370
|
+
properties: {
|
|
371
|
+
class: {
|
|
372
|
+
type: "string"
|
|
373
|
+
},
|
|
374
|
+
style: {
|
|
375
|
+
type: "string"
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
default: {}
|
|
379
|
+
},
|
|
380
|
+
visible: {
|
|
381
|
+
description: "",
|
|
382
|
+
type: "boolean",
|
|
383
|
+
default: !0
|
|
384
|
+
},
|
|
385
|
+
title: {
|
|
386
|
+
description: "",
|
|
387
|
+
type: "string",
|
|
388
|
+
default: "标题"
|
|
389
|
+
},
|
|
390
|
+
position: {
|
|
391
|
+
description: "",
|
|
392
|
+
type: "string",
|
|
393
|
+
default: "right"
|
|
394
|
+
},
|
|
395
|
+
width: {
|
|
396
|
+
description: "",
|
|
397
|
+
type: "number"
|
|
398
|
+
},
|
|
399
|
+
showMask: {
|
|
400
|
+
description: "",
|
|
401
|
+
type: "boolean",
|
|
402
|
+
default: !0
|
|
403
|
+
},
|
|
404
|
+
toolbar: {
|
|
405
|
+
description: "",
|
|
406
|
+
type: "object",
|
|
407
|
+
properties: {
|
|
408
|
+
appearance: {
|
|
409
|
+
description: "",
|
|
410
|
+
type: "object",
|
|
411
|
+
properties: {
|
|
412
|
+
class: {
|
|
413
|
+
type: "string",
|
|
414
|
+
default: "col-3"
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
id: {
|
|
419
|
+
description: "",
|
|
420
|
+
type: "string"
|
|
421
|
+
},
|
|
422
|
+
type: {
|
|
423
|
+
description: "",
|
|
424
|
+
type: "string",
|
|
425
|
+
default: "response-toolbar"
|
|
426
|
+
},
|
|
427
|
+
alignment: {
|
|
428
|
+
description: "The alignment of Response Toolbar Button.",
|
|
429
|
+
type: "string",
|
|
430
|
+
default: "right"
|
|
431
|
+
},
|
|
432
|
+
buttons: {
|
|
433
|
+
description: "The items of Response Toolbar.",
|
|
434
|
+
type: "array",
|
|
435
|
+
default: []
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}, he = [
|
|
440
|
+
"id",
|
|
441
|
+
"type",
|
|
442
|
+
"contents"
|
|
443
|
+
], ge = {
|
|
444
|
+
$schema: de,
|
|
445
|
+
$id: ce,
|
|
446
|
+
title: ue,
|
|
447
|
+
description: pe,
|
|
448
|
+
type: fe,
|
|
449
|
+
properties: me,
|
|
450
|
+
required: he
|
|
451
|
+
}, N = J(F, ge, le, ie);
|
|
452
|
+
C.register = (e, r, n) => {
|
|
453
|
+
e.drawer = ne, r.drawer = N;
|
|
454
|
+
};
|
|
455
|
+
C.registerDesigner = (e, r, n) => {
|
|
456
|
+
e.drawer = C, r.drawer = N;
|
|
457
|
+
};
|
|
458
|
+
const Te = Q(C);
|
|
459
|
+
export {
|
|
460
|
+
Te as default,
|
|
461
|
+
V as drawerProps,
|
|
462
|
+
N as propsResolver
|
|
463
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(s,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("../../components/dynamic-resolver/index.umd.js"),require("../../components/common/index.umd.js"),require("vue"),require("../../components/button/index.umd.js"),require("../../components/designer-canvas/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../../components/property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","../../components/dynamic-resolver/index.umd.js","../../components/common/index.umd.js","vue","../../components/button/index.umd.js","../../components/designer-canvas/index.umd.js","../response-toolbar/index.umd.js","../../components/property-panel/index.umd.js"],f):(s=typeof globalThis<"u"?globalThis:s||self,f(s.drawer={},s.dynamicResolver,s.common,s.Vue,s.FButton,s.designerCanvas,s.FResponseToolbarDesignComponent,s.propertyPanel))})(this,function(s,f,S,e,D,C,b,I){"use strict";const V={backgroundColor:{type:String,default:"#fff"},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},modalClass:{type:String,default:""},height:{type:String,default:300},modelValue:{type:Boolean,default:!1},position:{type:String,default:"right"},appendTo:{type:String,default:"body"},showEntry:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},allowClickMaskToClose:{type:Boolean,default:!0},title:{type:String,default:""},width:{type:String,default:300},host:{type:Object,default:"body"}},R=e.defineComponent({name:"FDrawer",props:V,emits:["afterClose","update:modelValue"],setup(t,r){const n=e.ref(t.modelValue),w=e.computed(()=>({"f-drawer":!0,"f-drawer-inline":typeof t.host=="string"?t.host!=="body":document.querySelector(t.host)!==document.body}));e.computed(()=>({}));const i=e.computed(()=>{const o={};return t.maskClass&&t.maskClass.split(" ").forEach(a=>{o[a]=!0}),{"f-drawer-mask":!0,...o}}),y=e.computed(()=>{const o={};return t.maskClass&&t.class.split(" ").forEach(a=>{o[a]=!0}),{"f-drawer-wrapper":!0,[`f-drawer-wrapper-${t.position}`]:!0,...o}}),m=e.computed(()=>{const o=t.width;return typeof o=="string"?o:typeof o=="number"?`${o}px`:"20%"}),l=e.computed(()=>{const o=t.height;return typeof o=="string"?o:typeof o=="number"?`${o}px`:"20%"}),h=e.computed(()=>`f-drawer-${t.position}`),c=o=>{Promise.resolve().then(()=>{var a;return(a=t.beforeClose)==null?void 0:a.call(t)}).then(a=>{a&&(n.value=!1,r.emit("update:modelValue",n.value),r.emit("afterClose"))})},u=o=>{c()};return e.watch(()=>t.modelValue,(o,a)=>{o!==a&&(n.value=o)}),()=>e.createVNode(e.Teleport,{to:t.host},{default:()=>[e.createVNode("div",{class:w.value},[e.createVNode(e.Transition,{name:"f-drawer-mask",appear:!0},{default:()=>[n.value&&e.createVNode("div",{class:i.value,onClick:e.withModifiers(o=>{t.allowClickMaskToClose&&c()},["stop"])},null)]}),e.createVNode(e.Transition,{name:h.value},{default:()=>{var o,a;return[e.withDirectives(e.createVNode("div",{class:y.value,style:{width:m.value,height:l.value,backgroundColor:t.backgroundColor}},[e.createVNode("div",{class:"f-drawer-container"},[e.createVNode("div",{class:"f-drawer-header"},[e.createVNode("div",{class:"f-drawer-title"},[r.slots.headerTemplate?r.slots.headerTemplate():t.title]),t.showClose&&e.createVNode("div",{class:"f-drawer-close"},[e.createVNode("span",{class:"f-icon f-icon-close",onClick:e.withModifiers(j=>{c()},["stop"])},null)])]),e.createVNode("div",{class:"f-drawer-body"},[(a=(o=r.slots).content)==null?void 0:a.call(o)]),e.createVNode("div",{class:"f-drawer-footer"},[r.slots.footerTemplate?r.slots.footerTemplate():e.createVNode(e.Fragment,null,[e.createVNode(D,{class:"mr-2",onClick:c},{default:()=>[e.createTextVNode("取消")]}),e.createVNode(D,{onClick:u},{default:()=>[e.createTextVNode("确定")]})])])])]),[[e.vShow,n.value]])]}})])]})}});class $ extends I.BaseControlProperty{constructor(r,n){super(r,n)}getPropertyConfig(r){return this.propertyConfig.categories.basic=this.getBasicPropConfig(r),this.propertyConfig.categories.appearance=this.getAppearanceConfig(r),this.getBehaviorConfig(),this.propertyConfig}getBehaviorConfig(){this.propertyConfig.categories.behavior={title:"行为",description:"Behavior",properties:{title:{title:"标题",description:"标题",type:"string"},position:{title:"显示位置",description:"抽屉显示位置",type:"select",default:"right",editor:{type:"combo-list",textField:"name",valueField:"value",editable:!1,data:[{value:"left",name:"左侧"},{value:"right",name:"右侧"}]}},width:{title:"宽度",description:"抽屉宽度",type:"number"},showMask:{title:"显示遮罩",description:"是否显示遮罩",type:"boolean",default:!0}},setPropertyRelates(r,n){if(r)switch(r&&r.propertyID){case"title":{r.needRefreshControlTree=!0;break}}}}}}function x(t,r){new C.UseTemplateDragAndDropRules;function n(){return!1}function w(){return!1}function i(){return!1}function y(){return!0}function m(){return"position: absolute !important;border: none !important;left: 0;right: 0;padding: 0;"}function l(h){const c=new $(h,r),{schema:u}=t;return c.getPropertyConfig(u)}return{canAccepts:n,checkCanDeleteComponent:w,checkCanMoveComponent:i,hideNestedPaddingInDesginerView:y,getStyles:m,getPropsConfig:l}}const P=Object.assign({},V,{componentId:{type:String,default:""}}),g=e.defineComponent({name:"FDrawerDesign",props:P,setup(t,r){const n=e.ref(),w=e.inject("designer-host-service"),i=e.inject("design-item-context"),y=x(i,w),m=C.useDesignerComponent(n,i,y),l=e.ref(i.schema.toolbar||{type:"response-toolbar",buttons:[]}),h=e.ref(b.responseToolbarResolver(l.value));e.watch(()=>i.schema.toolbar,()=>{l.value=i.schema.toolbar||{type:"response-toolbar",buttons:[]},h.value=b.responseToolbarResolver(l.value)},{deep:!0});const c=e.computed(()=>[...h.value.items]);e.onMounted(()=>{n.value.componentInstance=m}),r.expose(m.value);const u=e.ref(t.modelValue);e.watch(()=>t.modelValue,()=>{u.value=t.modelValue});const o=e.computed(()=>["f-drawer-wrapper",`f-drawer-wrapper-${t.position}`,t.wrapperClass]),a=e.computed(()=>{const d=t.width,p=t.height,k=typeof d=="string"?d:typeof d=="number"?`${d}px`:"20%",T=typeof p=="string"?p:typeof p=="number"?`${p}px`:"20%";return{width:k,height:T,backgroundColor:t.backgroundColor}}),j=e.computed(()=>["f-drawer-entry",`f-drawer-entry-${t.position}`,t.entryClass]),A=e.computed(()=>`f-icon-arrow-chevron-${{left:"right",right:"left",top:"down",bottom:"up"}[t.position]??"right"}`),E=e.computed(()=>`f-drawer-${t.position}`),M=()=>{u.value=!1},H=()=>{u.value=!0},U=()=>e.createVNode("div",{class:j.value,onClick:H},[r.slots.button?r.slots.button():e.createVNode("div",{class:"f-drawer-entry-icon"},[e.createVNode("span",{class:`f-icon ${A.value}`},null)])]),_=()=>e.createVNode(e.Transition,{name:"f-drawer-mask",appear:!0},{default:()=>[u.value&&t.showMask&&e.createVNode("div",{class:"f-drawer-mask",onClick:t.closeByMask&&e.withModifiers(M,["stop"])},null)]});function K(d,p,k,T){i&&i.setupContext&&i.setupContext.emit("selectionChange",d,p,k,T)}const L=()=>{if(c.value&&c.value.length>0)return e.createVNode(C.FDesignerInnerItem,{modelValue:l.value,"onUpdate:modelValue":d=>l.value=d,canAdd:!0,childType:"response-toolbar-item",childLabel:"按钮",contentKey:"buttons",id:l.value.id,componentId:t.componentId,onSelectionChange:K},{default:()=>[e.createVNode(b,{customClass:"w-100",items:c.value,componentId:t.componentId},null)]})},W=()=>e.createVNode("div",{class:"f-drawer-close"},[e.createVNode("span",{class:"f-icon f-icon-close",onClick:e.withModifiers(M,["stop"])},null)]),z=()=>e.createVNode("div",{class:"f-drawer-header"},[e.createVNode("div",{class:"f-drawer-header-left"},[e.createVNode("div",{class:"f-drawer-title"},[r.slots.title?r.slots.title():t.title])]),e.createVNode("div",{class:"f-drawer-header-right"},[L(),t.showClose&&W()])]),G=()=>e.createVNode(e.Transition,{name:E.value,appear:!0},{default:()=>{var d,p;return[u.value&&e.createVNode("div",{class:o.value,style:a.value},[e.createVNode("div",{class:"f-drawer-container"},[z(),e.createVNode("div",{class:"f-drawer-body"},[(p=(d=r.slots).default)==null?void 0:p.call(d)])])])]}}),J=()=>e.createVNode(e.Teleport,{to:".editorPanel "},{default:()=>[e.createVNode("div",{class:"f-drawer"},[_(),G()])]});return()=>e.createVNode("div",{ref:n},[J(),U()])}});function B(t,r,n){return r}const v=new Map([["appearance",f.resolveAppearance]]),q={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/drawer.schema.json",title:"drawer",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for drawer",type:"string"},type:{description:"The type string of drawer",type:"string",default:"drawer"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},visible:{description:"",type:"boolean",default:!0},title:{description:"",type:"string",default:"标题"},position:{description:"",type:"string",default:"right"},width:{description:"",type:"number"},showMask:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{appearance:{description:"",type:"object",properties:{class:{type:"string",default:"col-3"}}},id:{description:"",type:"string"},type:{description:"",type:"string",default:"response-toolbar"},alignment:{description:"The alignment of Response Toolbar Button.",type:"string",default:"right"},buttons:{description:"The items of Response Toolbar.",type:"array",default:[]}}}},required:["id","type","contents"]},N=f.createPropsResolver(P,q,v,B);g.register=(t,r,n)=>{t.drawer=R,r.drawer=N},g.registerDesigner=(t,r,n)=>{t.drawer=g,r.drawer=N};const F=S.withInstall(g);s.default=F,s.drawerProps=V,s.propsResolver=N,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|