rx-compo 1.0.75 → 1.0.76

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("rx-compo/lib/utils/with-install"),t=require("vue"),o=require("@vueuse/core"),r=require("rx-compo/lib/components/RxInput"),l=require("rx-compo/lib/components/RxTooltip"),n=require("rx-compo/lib/components/RxScrollbar"),a=require("lodash-es"),c=require("element-plus"),i=require("@element-plus/icons-vue"),s=require("rx-compo/lib/components/RxFormSelect"),p=require("rx-compo/lib/components/RxDatePicker");const u={columns:{type:Array,default:[]}},m={useSearchValue:{type:[Array,String,Number,Boolean,Object],default:""},component:{type:String,default:""},componentProps:{type:Object,default:void 0}},d={useSearchValue:{type:[Array,String,Number,Boolean,Object],default:""},rxInputStyleCustom:{type:String,default:"!max-w-[150px] inline-block"},rxOutSideStyleCustom:{type:String,default:"!max-w-[68px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}}};const x=Symbol();function f(e){return function(e,o=Symbol(),r={}){const{readonly:l=!0,createProvider:n=!1,native:a=!1}=r,c=t.reactive(e),i=l?t.readonly(c):c;return!n&&t.provide(o,a?e:i),{state:c}}(e,x)}function g(){return function(e=Symbol(),o){return t.inject(e,o||{})}(x)}var h=t.defineComponent({name:"RxFormPlusInput",components:{RxInput:r.RxInput,RxTooltip:l.RxTooltip,RxScrollbar:n.RxScrollbar,Search:i.Search,ElIcon:c.ElIcon},props:d,setup(e,{attrs:r,emit:l}){const n=o.useVModel(e,"useSearchValue",l),{clickRef:c,rxInputRef:i,rxFormItemRef:s,setClickRef:p}=(e=>{const o=t.ref(!1),r=t.ref(),l=t.ref();return{clickRef:o,rxInputRef:r,rxFormItemRef:l,getClickRef:function(){return o.value},setClickRef:function(e){o.value=e}}})(),{getRxToolTipConfig:u,updateRxToolTipConfig:m}=function(e,o,r){const l=t.ref();function n(){const{toolTipConfig:o}=e,n=r.value.getBoundingClientRect(),a={width:(null==o?void 0:o.tooltipWidth)?o.tooltipWidth:`${null==n?void 0:n.width}px`,maxHeight:(null==o?void 0:o.maxHeight)?o.maxHeight:"80px"},c=t.ref();if(null==o?void 0:o.content){const{content:e}=o;c.value=e}else c.value=e.useSearchValue;l.value=Object.assign(Object.assign({},o),{style:a,content:c.value})}return t.nextTick((()=>n())),{updateRxToolTipConfig:n,getRxToolTipConfig:()=>l.value}}(e,0,s);return((e,r,l,n,a)=>{const c=g(),i=o.useDebounceFn((()=>{c.handleSearchCallBack()}),1e3);o.onClickOutside(l,(()=>r(!1))),t.watch((()=>n),(()=>{t.nextTick((()=>{e()}))}),{deep:!0}),t.watch((()=>a.useSearchValue),(()=>{t.nextTick((()=>{e()})),i()}),{deep:!0})})(m,p,i,c,e),{clickRef:c,useSearchValueLocal:n,rxInputRef:i,rxFormItemRef:s,getRxToolTipConfig:u,setClickRef:p,isEmpty:a.isEmpty}}});const C={ref:"rxFormItemRef"},S={class:"flex items-center"},k={class:"cursor-pointer h-[32px] rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7]"},R={class:"text-[14px] leading-[22px] text-[#8B9199]"};h.render=function(e,o,r,l,n,a){const c=t.resolveComponent("Search"),i=t.resolveComponent("el-icon"),s=t.resolveComponent("RxInput"),p=t.resolveComponent("RxScrollbar"),u=t.resolveComponent("RxTooltip");return t.openBlock(),t.createElementBlock("div",C,[t.createCommentVNode(" 输入状态 "),e.clickRef?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"rxInputRef",class:t.normalizeClass(e.rxInputStyleCustom)},[e.clickRef?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":o[0]||(o[0]=t=>e.useSearchValueLocal=t)}),{prefix:t.withCtx((()=>[t.createElementVNode("div",S,[t.createVNode(i,{color:"#5C6781"},{default:t.withCtx((()=>[t.createVNode(c)])),_:1})])])),_:1},16,["modelValue"])):t.createCommentVNode("v-if",!0)],2)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 极值、有值、hover/点击、无操作 "),t.createElementVNode("div",k,[t.createVNode(u,t.mergeProps({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:t.withCtx((()=>[t.createCommentVNode(" 值 "),e.isEmpty(e.useSearchValueLocal)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 标题 "),t.createElementVNode("div",{class:"flex items-center space-x-1",onClick:o[2]||(o[2]=t=>e.setClickRef(!0))},[t.createElementVNode("p",R,t.toDisplayString(e.$attrs.label),1),t.createVNode(i,{color:"#5C6781"},{default:t.withCtx((()=>[t.createVNode(c)])),_:1})])],2112)):(t.openBlock(),t.createElementBlock("div",{key:0,class:"flex items-center space-x-1 group",onClick:o[1]||(o[1]=t=>e.setClickRef(!0))},[t.createElementVNode("p",{class:t.normalizeClass(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.useSearchValueLocal),3),t.createVNode(i,{color:"#0F1114",class:"group-hover:text-[#3370FF]"},{default:t.withCtx((()=>[t.createVNode(c)])),_:1})]))])),content:t.withCtx((()=>[t.createElementVNode("div",{style:t.normalizeStyle(e.getRxToolTipConfig().style)},[t.createVNode(p,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.useSearchValueLocal),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])])],2112))],512)},h.__file="packages/components/RxFormPlusBeta/src/components/formInput/index.vue";const v={useSearchValue:{type:Array,default:[]},rxOutSideStyleCustom:{type:String,default:"!max-w-[68px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}},rxFormSelectOptions:{type:Array,default:[]}};var V=t.defineComponent({name:"RxFormPlusSelect",components:{RxTooltip:l.RxTooltip,RxScrollbar:n.RxScrollbar,RxFormSelect:s.RxFormSelect,ArrowDownBold:i.ArrowDownBold,ArrowUpBold:i.ArrowUpBold,ElIcon:c.ElIcon},props:v,setup(e,{attrs:r,emit:l}){const n=o.useVModel(e,"useSearchValue",l),{rxSelectRef:c,rxFormItemRef:s,searchValueComputed:p,formSelectText:u,setPopoverStatus:m,getPopoverStatus:d}=((e,o)=>{const r=t.ref(!1);return{rxSelectRef:t.ref(),rxFormItemRef:t.ref(),searchValueComputed:t.computed((()=>a.map(e.useSearchValue,(e=>e.label)).toString())),formSelectText:t.computed((()=>o.multiple?`已选${e.useSearchValue.length}项`:e.useSearchValue[0].value)),popoverStatus:r,setPopoverStatus:e=>r.value=e,getPopoverStatus:()=>r.value}})(e,r),{getRxToolTipConfig:x,updateRxToolTipConfig:f}=function(e,o){const r=t.ref();function l(){const{toolTipConfig:t}=e,l=o.value.getBoundingClientRect(),n={width:(null==t?void 0:t.tooltipWidth)?t.tooltipWidth:`${null==l?void 0:l.width}px`,maxHeight:(null==t?void 0:t.maxHeight)?t.maxHeight:"80px"};r.value=Object.assign(Object.assign({},t),{style:n})}return t.nextTick((()=>l())),{getRxToolTipConfig:()=>r.value,updateRxToolTipConfig:l}}(e,s);return((e,r)=>{const l=g(),n=o.useDebounceFn((()=>{l.handleSearchCallBack()}),1e3);t.watch((()=>r.useSearchValue),(()=>{t.nextTick((()=>{e()})),n()}),{deep:!0})})(f,e),{useSearchValueLocal:n,rxSelectRef:c,rxFormItemRef:s,searchValueComputed:p,formSelectText:u,ArrowDownBold:i.ArrowDownBold,ArrowUpBold:i.ArrowUpBold,getRxToolTipConfig:x,isEmpty:a.isEmpty,setPopoverStatus:m,getPopoverStatus:d}}});const y={ref:"rxFormItemRef"},T={class:"h-[32px] rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7]"},F={key:0,class:"flex items-center space-x-1 cursor-pointer group"},B={class:"flex items-center space-x-1 cursor-pointer"},P={class:"text-[14px] leading-[22px] text-[#8B9199]"};V.render=function(e,o,r,l,n,a){const c=t.resolveComponent("ArrowUpBold"),i=t.resolveComponent("ArrowDownBold"),s=t.resolveComponent("el-icon"),p=t.resolveComponent("RxFormSelect"),u=t.resolveComponent("RxScrollbar"),m=t.resolveComponent("RxTooltip");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createCommentVNode(" {{ $attrs }} "),t.createElementVNode("div",y,[t.createElementVNode("div",T,[t.createVNode(m,t.mergeProps({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:t.withCtx((()=>[t.createVNode(p,t.mergeProps({trigger:"click",teleported:!0},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":o[0]||(o[0]=t=>e.useSearchValueLocal=t),onShow:o[1]||(o[1]=t=>e.setPopoverStatus(!0)),onHide:o[2]||(o[2]=t=>e.setPopoverStatus(!1))}),{default:t.withCtx((()=>[t.createCommentVNode(" 值 "),e.isEmpty(e.useSearchValueLocal)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 标题 "),t.createElementVNode("div",B,[t.createElementVNode("p",P,t.toDisplayString(e.$attrs.label),1),t.createVNode(s,{size:12,color:"#5C6781"},{default:t.withCtx((()=>[e.getPopoverStatus()?(t.openBlock(),t.createBlock(c,{key:0})):(t.openBlock(),t.createBlock(i,{key:1}))])),_:1})])],2112)):(t.openBlock(),t.createElementBlock("div",F,[t.createElementVNode("p",{class:t.normalizeClass(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.formSelectText),3),t.createVNode(s,{size:12,color:"#0F1114",class:"group-hover:text-[#3370FF]"},{default:t.withCtx((()=>[e.getPopoverStatus()?(t.openBlock(),t.createBlock(c,{key:0})):(t.openBlock(),t.createBlock(i,{key:1}))])),_:1})]))])),_:1},16,["modelValue"])])),content:t.withCtx((()=>[t.createElementVNode("div",{style:t.normalizeStyle(e.getRxToolTipConfig().style)},[t.createVNode(u,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:t.withCtx((()=>[t.createElementVNode("p",null,t.toDisplayString(e.$attrs.label)+":",1),t.createTextVNode(" "+t.toDisplayString(e.searchValueComputed),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])])],512)],2112)},V.__file="packages/components/RxFormPlusBeta/src/components/formSelect/index.vue";const N={useSearchValue:{type:[Array,String,Number,Date],default:""},rxOutSideStyleCustom:{type:String,default:""},toolTipConfig:{type:Object,default:{placement:"top",disabled:!0}},rxDatePickerOptions:{type:Object,default:{type:"daterange",format:"YYYY/MM/DD",valueFormat:"YYYY-MM-DD",teleported:!1}}};function b(e){return e.replace(/-/g,"/")}function w(e,t){if(a.isEmpty(e.useSearchValue))return t.placeholder;if(a.includes(["datetimerange","daterange","monthrange"],e.rxDatePickerOptions.type)){return`${b(e.useSearchValue[0])}~${b(e.useSearchValue[1])}`}return`${e.useSearchValue}`}var E=t.defineComponent({name:"RxFormPlusDatePicker",components:{RxDatePicker:p.RxDatePicker,RxTooltip:l.RxTooltip,RxScrollbar:n.RxScrollbar,Calendar:i.Calendar,ElIcon:c.ElIcon},props:N,setup(e,{attrs:r,emit:l}){const n=o.useVModel(e,"useSearchValue",l),{rxDatePickerRef:c,rxDatePickerComponentsRef:i,rxFormItemRef:s,datePickerFormat:p}=((e,o)=>{const r=t.ref(),l=t.ref(),n=t.ref();return{rxDatePickerRef:r,datePickerFormat:t.computed((()=>w(e,o))),rxFormItemRef:l,rxDatePickerComponentsRef:n}})(e,r),{getRxToolTipConfig:u,updateRxToolTipConfig:m}=function(e,o,r){const l=t.ref();function n(){const{toolTipConfig:n}=e,{width:a}=r.value.getBoundingClientRect(),c={width:(null==n?void 0:n.tooltipWidth)?n.tooltipWidth:`${a}px`,maxHeight:(null==n?void 0:n.maxHeight)?n.maxHeight:"80px"},i=t.ref();if(null==n?void 0:n.content){const{content:e}=n;i.value=e}else i.value=w(e,o);l.value=Object.assign(Object.assign({},n),{style:c,content:i.value})}return t.nextTick((()=>n())),{getRxToolTipConfig:()=>l.value,updateRxToolTipConfig:n}}(e,r,s),{handleOpenRxDatePicker:d}=((e,r,l)=>{const n=g(),a=o.useDebounceFn((()=>{n.handleSearchCallBack()}),1e3);return t.watch((()=>r.useSearchValue),(()=>{t.nextTick((()=>{e()})),a()}),{deep:!0}),{handleOpenRxDatePicker:function(){t.nextTick((()=>{l.value.rxDatePickerRef.focus()}))}}})(m,e,i);return{useSearchValueLocal:n,rxDatePickerRef:c,datePickerFormat:p,rxFormItemRef:s,rxDatePickerComponentsRef:i,getRxToolTipConfig:u,handleOpenRxDatePicker:d,isEmpty:a.isEmpty}}});const D={ref:"rxFormItemRef",class:"rounded-[4px] px-[8px] py-[5px] group hover:bg-[#F5F6F7]"},I={class:"w-0 h-0 overflow-hidden",ref:"rxDatePickerRef"},O={class:"text-[14px] leading-[22px] text-[#8B9199]"};E.render=function(e,o,r,l,n,a){const c=t.resolveComponent("RxDatePicker"),i=t.resolveComponent("Calendar"),s=t.resolveComponent("el-icon"),p=t.resolveComponent("RxScrollbar"),u=t.resolveComponent("RxTooltip");return t.openBlock(),t.createElementBlock("div",D,[t.createVNode(u,t.normalizeProps(t.guardReactiveProps(e.getRxToolTipConfig())),{default:t.withCtx((()=>[t.createElementVNode("div",{class:"flex items-center space-x-1 cursor-pointer",onClick:o[1]||(o[1]=(...t)=>e.handleOpenRxDatePicker&&e.handleOpenRxDatePicker(...t))},[t.createCommentVNode(" 隐藏控件 "),t.createElementVNode("div",I,[t.createVNode(c,t.mergeProps({ref:"rxDatePickerComponentsRef",modelValue:e.useSearchValueLocal,"onUpdate:modelValue":o[0]||(o[0]=t=>e.useSearchValueLocal=t)},{...e.$attrs,...e.$props,...e.$props.rxDatePickerOptions}),null,16,["modelValue"])],512),t.createCommentVNode(" 值 "),e.isEmpty(e.useSearchValue)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 标题 "),t.createElementVNode("p",O,t.toDisplayString(e.$attrs.label),1),t.createVNode(s,{color:"#5C6781"},{default:t.withCtx((()=>[t.createVNode(i)])),_:1})],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("p",{class:t.normalizeClass(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.datePickerFormat),3),t.createVNode(s,{class:"text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",color:"#0F1114"},{default:t.withCtx((()=>[t.createVNode(i)])),_:1})],64))])])),content:t.withCtx((()=>[t.createElementVNode("div",{style:t.normalizeStyle(e.getRxToolTipConfig().style)},[t.createVNode(p,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.datePickerFormat),1)])),_:1},8,["max-height"])],4)])),_:1},16)],512)},E.__file="packages/components/RxFormPlusBeta/src/components/formDatePicker/index.vue";const _=new Map;function L(e,t){_.set(e,t)}L("RxFormPlusInput",h),L("RxFormPlusSelect",V),L("RxFormPlusDatePicker",E);var $={add:L,del:function(e){_.delete(e)},get:function(e){return e&&_.get(e)||e}},A=t.defineComponent({name:"FormComponent",props:m,setup(e,{emit:r}){const l=$.get(e.component),n=o.useVModel(e,"useSearchValue",r);return{componentLocal:l,componentPropsLocal:t.computed((()=>e.componentProps)),useSearchValueLocal:n}}});A.render=function(e,o,r,l,n,a){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.componentLocal),t.normalizeProps(t.guardReactiveProps({...e.$attrs,...e.$props,...e.componentPropsLocal})),null,16)},A.__file="packages/components/RxFormPlusBeta/src/components/formComponent/index.vue";var j=t.defineComponent({name:"RxFormPlusBeta",components:{FormComponent:A},props:u,emits:["handleSearch"],setup(e,{emit:t,expose:o}){const r=()=>t("handleSearch",e);return f({handleSearchCallBack:r}),o({handleSearchCallBack:r}),{}}});const H={class:"flex items-center space-x-2"};j.render=function(e,o,r,l,n,a){const c=t.resolveComponent("form-component");return t.openBlock(),t.createElementBlock("div",H,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.columns,(e=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.component?(t.openBlock(),t.createBlock(c,t.mergeProps({key:0,key:e},e,{modelValue:e.useSearchValue,"onUpdate:modelValue":t=>e.useSearchValue=t}),null,16,["modelValue","onUpdate:modelValue"])):t.createCommentVNode("v-if",!0)],64)))),256))])},j.__file="packages/components/RxFormPlusBeta/src/RxFormPlusBeta.vue";const q=e.withInstall(j);exports.RxFormPlusBeta=q,exports.default=q;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("rx-compo/lib/utils/with-install"),t=require("vue"),o=require("@vueuse/core"),r=require("rx-compo/lib/components/RxInput"),l=require("rx-compo/lib/components/RxTooltip"),n=require("rx-compo/lib/components/RxScrollbar"),a=require("lodash-es"),c=require("element-plus"),i=require("@element-plus/icons-vue"),s=require("rx-compo/lib/components/RxFormSelect"),p=require("rx-compo/lib/components/RxDatePicker");const u={columns:{type:Array,default:[]},customClass:{type:String,default:"space-x-8"}},m={useSearchValue:{type:[Array,String,Number,Boolean,Object],default:""},component:{type:String,default:""},componentProps:{type:Object,default:void 0}},d={useSearchValue:{type:[Array,String,Number,Boolean,Object],default:""},rxInputStyleCustom:{type:String,default:"!max-w-[150px] inline-block"},rxOutSideStyleCustom:{type:String,default:"!max-w-[68px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}}};const x=Symbol();function f(e){return function(e,o=Symbol(),r={}){const{readonly:l=!0,createProvider:n=!1,native:a=!1}=r,c=t.reactive(e),i=l?t.readonly(c):c;return!n&&t.provide(o,a?e:i),{state:c}}(e,x)}function g(){return function(e=Symbol(),o){return t.inject(e,o||{})}(x)}var h=t.defineComponent({name:"RxFormPlusInput",components:{RxInput:r.RxInput,RxTooltip:l.RxTooltip,RxScrollbar:n.RxScrollbar,Search:i.Search,ElIcon:c.ElIcon},props:d,setup(e,{attrs:r,emit:l}){const n=o.useVModel(e,"useSearchValue",l),{clickRef:c,rxInputRef:i,rxFormItemRef:s,setClickRef:p}=(e=>{const o=t.ref(!1),r=t.ref(),l=t.ref();return{clickRef:o,rxInputRef:r,rxFormItemRef:l,getClickRef:function(){return o.value},setClickRef:function(e){o.value=e}}})(),{getRxToolTipConfig:u,updateRxToolTipConfig:m}=function(e,o,r){const l=t.ref();function n(){const{toolTipConfig:o}=e,n=r.value.getBoundingClientRect(),a={width:(null==o?void 0:o.tooltipWidth)?o.tooltipWidth:`${null==n?void 0:n.width}px`,maxHeight:(null==o?void 0:o.maxHeight)?o.maxHeight:"80px"},c=t.ref();if(null==o?void 0:o.content){const{content:e}=o;c.value=e}else c.value=e.useSearchValue;l.value=Object.assign(Object.assign({},o),{style:a,content:c.value})}return t.nextTick((()=>n())),{updateRxToolTipConfig:n,getRxToolTipConfig:()=>l.value}}(e,0,s);return((e,r,l,n,a)=>{const c=g(),i=o.useDebounceFn((function(){c.handleSearchCallBack()}),1e3);o.onClickOutside(l,(()=>r(!1))),t.watch((()=>n),(()=>{t.nextTick((()=>{e()}))}),{deep:!0}),t.watch((()=>a.useSearchValue),(()=>{t.nextTick((()=>{e()})),i()}),{deep:!0})})(m,p,i,c,e),{clickRef:c,useSearchValueLocal:n,rxInputRef:i,rxFormItemRef:s,getRxToolTipConfig:u,setClickRef:p,isEmpty:a.isEmpty}}});const C={ref:"rxFormItemRef"},k={class:"flex items-center"},S={class:"cursor-pointer h-[32px] flex items-center rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7]"},R={class:"text-[14px] leading-[22px] text-[#8B9199]"};h.render=function(e,o,r,l,n,a){const c=t.resolveComponent("Search"),i=t.resolveComponent("el-icon"),s=t.resolveComponent("RxInput"),p=t.resolveComponent("RxScrollbar"),u=t.resolveComponent("RxTooltip");return t.openBlock(),t.createElementBlock("div",C,[t.createCommentVNode(" 输入状态 "),e.clickRef?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"rxInputRef",class:t.normalizeClass(e.rxInputStyleCustom)},[e.clickRef?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":o[0]||(o[0]=t=>e.useSearchValueLocal=t)}),{prefix:t.withCtx((()=>[t.createElementVNode("div",k,[t.createVNode(i,{color:"#5C6781"},{default:t.withCtx((()=>[t.createVNode(c)])),_:1})])])),_:1},16,["modelValue"])):t.createCommentVNode("v-if",!0)],2)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 极值、有值、hover/点击、无操作 "),t.createElementVNode("div",S,[t.createVNode(u,t.mergeProps({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:t.withCtx((()=>[t.createCommentVNode(" 值 "),e.isEmpty(e.useSearchValueLocal)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 标题 "),t.createElementVNode("div",{class:"flex items-center space-x-1",onClick:o[2]||(o[2]=t=>e.setClickRef(!0))},[t.createElementVNode("p",R,t.toDisplayString(e.$attrs.label),1),t.createVNode(i,{color:"#5C6781"},{default:t.withCtx((()=>[t.createVNode(c)])),_:1})])],2112)):(t.openBlock(),t.createElementBlock("div",{key:0,class:"flex items-center space-x-1 group",onClick:o[1]||(o[1]=t=>e.setClickRef(!0))},[t.createElementVNode("p",{class:t.normalizeClass(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.useSearchValueLocal),3),t.createVNode(i,{color:"#0F1114",class:"group-hover:text-[#3370FF]"},{default:t.withCtx((()=>[t.createVNode(c)])),_:1})]))])),content:t.withCtx((()=>[t.createElementVNode("div",{style:t.normalizeStyle(e.getRxToolTipConfig().style)},[t.createVNode(p,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.useSearchValueLocal),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])])],2112))],512)},h.__file="packages/components/RxFormPlusBeta/src/components/formInput/index.vue";const v={useSearchValue:{type:Array,default:[]},rxOutSideStyleCustom:{type:String,default:"!max-w-[68px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}},rxFormSelectOptions:{type:Array,default:[]}};var V=t.defineComponent({name:"RxFormPlusSelect",components:{RxTooltip:l.RxTooltip,RxScrollbar:n.RxScrollbar,RxFormSelect:s.RxFormSelect,ArrowDownBold:i.ArrowDownBold,ArrowUpBold:i.ArrowUpBold,ElIcon:c.ElIcon},props:v,setup(e,{attrs:r,emit:l}){const n=o.useVModel(e,"useSearchValue",l),{rxSelectRef:c,rxFormItemRef:s,searchValueComputed:p,formSelectText:u,setPopoverStatus:m,getPopoverStatus:d}=((e,o)=>{const r=t.ref(!1);return{rxSelectRef:t.ref(),rxFormItemRef:t.ref(),searchValueComputed:t.computed((()=>a.map(e.useSearchValue,(e=>e.label)).toString())),formSelectText:t.computed((()=>o.multiple?`已选${e.useSearchValue.length}项`:e.useSearchValue[0].value)),popoverStatus:r,setPopoverStatus:e=>r.value=e,getPopoverStatus:()=>r.value}})(e,r),{getRxToolTipConfig:x,updateRxToolTipConfig:f}=function(e,o){const r=t.ref();function l(){const{toolTipConfig:t}=e,l=o.value.getBoundingClientRect(),n={width:(null==t?void 0:t.tooltipWidth)?t.tooltipWidth:`${null==l?void 0:l.width}px`,maxHeight:(null==t?void 0:t.maxHeight)?t.maxHeight:"80px"};r.value=Object.assign(Object.assign({},t),{style:n})}return t.nextTick((()=>l())),{getRxToolTipConfig:()=>r.value,updateRxToolTipConfig:l}}(e,s);return((e,r)=>{const l=g(),n=o.useDebounceFn((function(){l.handleSearchCallBack()}),1e3);t.watch((()=>r.useSearchValue),(()=>{t.nextTick((()=>{e()})),n()}),{deep:!0})})(f,e),{useSearchValueLocal:n,rxSelectRef:c,rxFormItemRef:s,searchValueComputed:p,formSelectText:u,ArrowDownBold:i.ArrowDownBold,ArrowUpBold:i.ArrowUpBold,getRxToolTipConfig:x,isEmpty:a.isEmpty,setPopoverStatus:m,getPopoverStatus:d}}});const y={ref:"rxFormItemRef"},T={class:"h-[32px] flex items-center rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7]"},F={key:0,class:"flex items-center space-x-1 cursor-pointer group"},B={class:"flex items-center space-x-1 cursor-pointer"},P={class:"text-[14px] leading-[22px] text-[#8B9199]"};V.render=function(e,o,r,l,n,a){const c=t.resolveComponent("ArrowUpBold"),i=t.resolveComponent("ArrowDownBold"),s=t.resolveComponent("el-icon"),p=t.resolveComponent("RxFormSelect"),u=t.resolveComponent("RxScrollbar"),m=t.resolveComponent("RxTooltip");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createCommentVNode(" {{ $attrs }} "),t.createElementVNode("div",y,[t.createElementVNode("div",T,[t.createVNode(m,t.mergeProps({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:t.withCtx((()=>[t.createVNode(p,t.mergeProps({trigger:"click",teleported:!0},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":o[0]||(o[0]=t=>e.useSearchValueLocal=t),onShow:o[1]||(o[1]=t=>e.setPopoverStatus(!0)),onHide:o[2]||(o[2]=t=>e.setPopoverStatus(!1))}),{default:t.withCtx((()=>[t.createCommentVNode(" 值 "),e.isEmpty(e.useSearchValueLocal)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 标题 "),t.createElementVNode("div",B,[t.createElementVNode("p",P,t.toDisplayString(e.$attrs.label),1),t.createVNode(s,{size:12,color:"#5C6781"},{default:t.withCtx((()=>[e.getPopoverStatus()?(t.openBlock(),t.createBlock(c,{key:0})):(t.openBlock(),t.createBlock(i,{key:1}))])),_:1})])],2112)):(t.openBlock(),t.createElementBlock("div",F,[t.createElementVNode("p",{class:t.normalizeClass(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.formSelectText),3),t.createVNode(s,{size:12,color:"#0F1114",class:"group-hover:text-[#3370FF]"},{default:t.withCtx((()=>[e.getPopoverStatus()?(t.openBlock(),t.createBlock(c,{key:0})):(t.openBlock(),t.createBlock(i,{key:1}))])),_:1})]))])),_:1},16,["modelValue"])])),content:t.withCtx((()=>[t.createElementVNode("div",{style:t.normalizeStyle(e.getRxToolTipConfig().style)},[t.createVNode(u,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:t.withCtx((()=>[t.createElementVNode("p",null,t.toDisplayString(e.$attrs.label)+":",1),t.createTextVNode(" "+t.toDisplayString(e.searchValueComputed),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])])],512)],2112)},V.__file="packages/components/RxFormPlusBeta/src/components/formSelect/index.vue";const N={useSearchValue:{type:[Array,String,Number,Date],default:""},rxOutSideStyleCustom:{type:String,default:""},toolTipConfig:{type:Object,default:{placement:"top",disabled:!0}},rxDatePickerOptions:{type:Object,default:{type:"daterange",format:"YYYY/MM/DD",valueFormat:"YYYY-MM-DD",teleported:!1}}};function b(e){return e.replace(/-/g,"/")}function w(e,t){if(a.isEmpty(e.useSearchValue))return t.placeholder;if(a.includes(["datetimerange","daterange","monthrange"],e.rxDatePickerOptions.type)){return`${b(e.useSearchValue[0])}~${b(e.useSearchValue[1])}`}return`${e.useSearchValue}`}var E=t.defineComponent({name:"RxFormPlusDatePicker",components:{RxDatePicker:p.RxDatePicker,RxTooltip:l.RxTooltip,RxScrollbar:n.RxScrollbar,Calendar:i.Calendar,ElIcon:c.ElIcon},props:N,setup(e,{attrs:r,emit:l}){const n=o.useVModel(e,"useSearchValue",l),{rxDatePickerRef:c,rxDatePickerComponentsRef:i,rxFormItemRef:s,datePickerFormat:p}=((e,o)=>{const r=t.ref(),l=t.ref(),n=t.ref();return{rxDatePickerRef:r,datePickerFormat:t.computed((()=>w(e,o))),rxFormItemRef:l,rxDatePickerComponentsRef:n}})(e,r),{getRxToolTipConfig:u,updateRxToolTipConfig:m}=function(e,o,r){const l=t.ref();function n(){const{toolTipConfig:n}=e,{width:a}=r.value.getBoundingClientRect(),c={width:(null==n?void 0:n.tooltipWidth)?n.tooltipWidth:`${a}px`,maxHeight:(null==n?void 0:n.maxHeight)?n.maxHeight:"80px"},i=t.ref();if(null==n?void 0:n.content){const{content:e}=n;i.value=e}else i.value=w(e,o);l.value=Object.assign(Object.assign({},n),{style:c,content:i.value})}return t.nextTick((()=>n())),{getRxToolTipConfig:()=>l.value,updateRxToolTipConfig:n}}(e,r,s),{handleOpenRxDatePicker:d}=((e,r,l)=>{const n=g(),a=o.useDebounceFn((function(){n.handleSearchCallBack()}),1e3);return t.watch((()=>r.useSearchValue),(()=>{t.nextTick((()=>{e()})),a()}),{deep:!0}),{handleOpenRxDatePicker:function(){t.nextTick((()=>{l.value.rxDatePickerRef.focus()}))}}})(m,e,i);return{useSearchValueLocal:n,rxDatePickerRef:c,datePickerFormat:p,rxFormItemRef:s,rxDatePickerComponentsRef:i,getRxToolTipConfig:u,handleOpenRxDatePicker:d,isEmpty:a.isEmpty}}});const D={ref:"rxFormItemRef",class:"rounded-[4px] px-[8px] py-[5px] group hover:bg-[#F5F6F7] h-[32px] flex items-center"},I={class:"w-0 h-0 overflow-hidden",ref:"rxDatePickerRef"},O={class:"text-[14px] leading-[22px] text-[#8B9199]"};E.render=function(e,o,r,l,n,a){const c=t.resolveComponent("RxDatePicker"),i=t.resolveComponent("Calendar"),s=t.resolveComponent("el-icon"),p=t.resolveComponent("RxScrollbar"),u=t.resolveComponent("RxTooltip");return t.openBlock(),t.createElementBlock("div",D,[t.createVNode(u,t.normalizeProps(t.guardReactiveProps(e.getRxToolTipConfig())),{default:t.withCtx((()=>[t.createElementVNode("div",{class:"flex items-center space-x-1 cursor-pointer",onClick:o[1]||(o[1]=(...t)=>e.handleOpenRxDatePicker&&e.handleOpenRxDatePicker(...t))},[t.createCommentVNode(" 隐藏控件 "),t.createElementVNode("div",I,[t.createVNode(c,t.mergeProps({ref:"rxDatePickerComponentsRef",modelValue:e.useSearchValueLocal,"onUpdate:modelValue":o[0]||(o[0]=t=>e.useSearchValueLocal=t)},{...e.$attrs,...e.$props,...e.$props.rxDatePickerOptions}),null,16,["modelValue"])],512),t.createCommentVNode(" 值 "),e.isEmpty(e.useSearchValue)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 标题 "),t.createElementVNode("p",O,t.toDisplayString(e.$attrs.label),1),t.createVNode(s,{color:"#5C6781"},{default:t.withCtx((()=>[t.createVNode(i)])),_:1})],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("p",{class:t.normalizeClass(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.datePickerFormat),3),t.createVNode(s,{class:"text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",color:"#0F1114"},{default:t.withCtx((()=>[t.createVNode(i)])),_:1})],64))])])),content:t.withCtx((()=>[t.createElementVNode("div",{style:t.normalizeStyle(e.getRxToolTipConfig().style)},[t.createVNode(p,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.datePickerFormat),1)])),_:1},8,["max-height"])],4)])),_:1},16)],512)},E.__file="packages/components/RxFormPlusBeta/src/components/formDatePicker/index.vue";const _=new Map;function L(e,t){_.set(e,t)}L("RxFormPlusInput",h),L("RxFormPlusSelect",V),L("RxFormPlusDatePicker",E);var $={add:L,del:function(e){_.delete(e)},get:function(e){return e&&_.get(e)||e}},A=t.defineComponent({name:"FormComponent",props:m,setup(e,{emit:r}){const l=$.get(e.component),n=o.useVModel(e,"useSearchValue",r);return{componentLocal:l,componentPropsLocal:t.computed((()=>e.componentProps)),useSearchValueLocal:n}}});A.render=function(e,o,r,l,n,a){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.componentLocal),t.normalizeProps(t.guardReactiveProps({...e.$attrs,...e.$props,...e.componentPropsLocal})),null,16)},A.__file="packages/components/RxFormPlusBeta/src/components/formComponent/index.vue";var j=t.defineComponent({name:"RxFormPlusBeta",components:{FormComponent:A},props:u,emits:["handleSearch"],setup(e,{emit:t,expose:o}){const r=()=>t("handleSearch",e);return f({handleSearchCallBack:r}),o({handleSearchCallBack:r}),{}}});j.render=function(e,o,r,l,n,a){const c=t.resolveComponent("form-component");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex items-center",e.customClass])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.columns,(e=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.component?(t.openBlock(),t.createElementBlock("div",{key:e,class:t.normalizeClass(e.componentLayoutClass)},[(t.openBlock(),t.createBlock(c,t.mergeProps({key:e},e,{modelValue:e.useSearchValue,"onUpdate:modelValue":t=>e.useSearchValue=t}),null,16,["modelValue","onUpdate:modelValue"]))],2)):t.createCommentVNode("v-if",!0)],64)))),256))],2)},j.__file="packages/components/RxFormPlusBeta/src/RxFormPlusBeta.vue";const z=e.withInstall(j);exports.RxFormPlusBeta=z,exports.default=z;
@@ -4,6 +4,10 @@ export declare const RxFormPlusBetaProps: {
4
4
  type: any;
5
5
  default: any[];
6
6
  };
7
+ customClass: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
7
11
  };
8
12
  export declare type RxFormPlusBetaPropsType = ExtractPropTypes<typeof RxFormPlusBetaProps>;
9
13
  export declare type RxFormPlusBetaComponent = DefineComponent<typeof RxFormPlusBetaProps>;
@@ -3,14 +3,23 @@ declare const _default: import("vue").DefineComponent<{
3
3
  type: any;
4
4
  default: any[];
5
5
  };
6
+ customClass: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
6
10
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "handleSearch"[], "handleSearch", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
11
  columns: {
8
12
  type: any;
9
13
  default: any[];
10
14
  };
15
+ customClass: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
11
19
  }>> & {
12
20
  onHandleSearch?: (...args: any[]) => any;
13
21
  }, {
22
+ customClass: string;
14
23
  columns: any;
15
24
  }>;
16
25
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rx-compo",
3
- "version": "1.0.75",
3
+ "version": "1.0.76",
4
4
  "private": false,
5
5
  "description": "components for ruixue",
6
6
  "main": "lib/index.js",