rx-compo 1.0.73 → 1.0.74
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/es/components/RxFormPlusBeta/index.js +1 -1
- package/es/components/RxFormPlusBeta/src/RxFormPlusBeta.vue.d.ts +4 -2
- package/es/components/RxFormPlusBeta/src/components/formInput/hooks/useController.d.ts +2 -1
- package/es/components/RxFormPlusBeta/src/hooks/useContext.d.ts +10 -0
- package/es/components/RxFormPlusBeta/src/hooks/useFormPlusBetaContext.d.ts +4 -0
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/lib/components/RxFormPlusBeta/index.js +1 -1
- package/lib/components/RxFormPlusBeta/src/RxFormPlusBeta.vue.d.ts +4 -2
- package/lib/components/RxFormPlusBeta/src/components/formInput/hooks/useController.d.ts +2 -1
- package/lib/components/RxFormPlusBeta/src/hooks/useContext.d.ts +10 -0
- package/lib/components/RxFormPlusBeta/src/hooks/useFormPlusBetaContext.d.ts +4 -0
- package/package.json +1 -1
- package/theme-chalk/index.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{withInstall as e}from"rx-compo/es/utils/with-install";import{ref as t,watch as o,nextTick as r,defineComponent as l,resolveComponent as a,openBlock as n,createElementBlock as c,createCommentVNode as u,normalizeClass as i,createBlock as s,mergeProps as p,Fragment as x,createElementVNode as m,createVNode as d,withCtx as f,toDisplayString as g,normalizeStyle as h,createTextVNode as R,computed as S,normalizeProps as v,guardReactiveProps as y,resolveDynamicComponent as C,renderList as k}from"vue";import{onClickOutside as F,useVModel as T}from"@vueuse/core";import{RxInput as P}from"rx-compo/es/components/RxInput";import{RxTooltip as V}from"rx-compo/es/components/RxTooltip";import{RxScrollbar as b}from"rx-compo/es/components/RxScrollbar";import{isEmpty as D,map as O,includes as I}from"lodash-es";import{ElIcon as w}from"element-plus";import{Search as _,ArrowDownBold as B,ArrowUpBold as $,Calendar as L}from"@element-plus/icons-vue";import{RxFormSelect as j}from"rx-compo/es/components/RxFormSelect";import{RxDatePicker as H}from"rx-compo/es/components/RxDatePicker";const A={columns:{type:Array,default:[]}},E={useSearchValue:{type:[Array,String,Number,Boolean,Object],default:""},component:{type:String,default:""},componentProps:{type:Object,default:void 0}},U={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"}}};var Y=l({name:"RxFormPlusInput",components:{RxInput:P,RxTooltip:V,RxScrollbar:b,Search:_,ElIcon:w},props:U,setup(e,{attrs:l,emit:a}){const n=T(e,"useSearchValue",a),{clickRef:c,rxInputRef:u,rxFormItemRef:i,setClickRef:s}=(e=>{const o=t(!1),r=t(),l=t();return{clickRef:o,rxInputRef:r,rxFormItemRef:l,getClickRef:function(){return o.value},setClickRef:function(e){o.value=e}}})(),{getRxToolTipConfig:p,updateRxToolTipConfig:x}=function(e,o,r){const l=t();return{updateRxToolTipConfig:function(){const{toolTipConfig:o}=e,a=r.value.getBoundingClientRect(),n={width:(null==o?void 0:o.tooltipWidth)?o.tooltipWidth:`${null==a?void 0:a.width}px`,maxHeight:(null==o?void 0:o.maxHeight)?o.maxHeight:"80px"},c=t();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:n,content:c.value})},getRxToolTipConfig:()=>l.value}}(e,0,i);return((e,t,l,a)=>{F(l,(()=>t(!1))),o((()=>a),(()=>{r((()=>{e()}))}),{deep:!0,immediate:!0})})(x,s,u,c),{clickRef:c,useSearchValueLocal:n,rxInputRef:u,rxFormItemRef:i,getRxToolTipConfig:p,setClickRef:s,isEmpty:D}}});const W={ref:"rxFormItemRef"},M={class:"cursor-pointer h-[32px] rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7]"},N={class:"text-[14px] leading-[22px] text-[#8B9199]"};Y.render=function(e,t,o,r,l,S){const v=a("RxInput"),y=a("Search"),C=a("el-icon"),k=a("RxScrollbar"),F=a("RxTooltip");return n(),c("div",W,[u(" 输入状态 "),e.clickRef?(n(),c("div",{key:0,ref:"rxInputRef",class:i(e.rxInputStyleCustom)},[e.clickRef?(n(),s(v,p({key:0,"prefix-icon":"Search"},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":t[0]||(t[0]=t=>e.useSearchValueLocal=t)}),null,16,["modelValue"])):u("v-if",!0)],2)):(n(),c(x,{key:1},[u(" 极值、有值、hover/点击、无操作 "),m("div",M,[d(F,p({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:f((()=>[u(" 值 "),e.isEmpty(e.useSearchValueLocal)?(n(),c(x,{key:1},[u(" 标题 "),m("div",{class:"flex items-center space-x-1",onClick:t[2]||(t[2]=t=>e.setClickRef(!0))},[m("p",N,g(e.$attrs.label),1),d(C,{color:"#5C6781"},{default:f((()=>[d(y)])),_:1})])],2112)):(n(),c("div",{key:0,class:"flex items-center space-x-1 group",onClick:t[1]||(t[1]=t=>e.setClickRef(!0))},[m("p",{class:i(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},g(e.useSearchValueLocal),3),d(C,{color:"#0F1114",class:"group-hover:text-[#3370FF]"},{default:f((()=>[d(y)])),_:1})]))])),content:f((()=>[m("div",{style:h(e.getRxToolTipConfig().style)},[d(k,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:f((()=>[R(g(e.useSearchValueLocal),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])])],2112))],512)},Y.__file="packages/components/RxFormPlusBeta/src/components/formInput/index.vue";var z=l({name:"RxFormPlusSelect",components:{RxTooltip:V,RxScrollbar:b,RxFormSelect:j,ArrowDownBold:B,ArrowUpBold:$,ElIcon:w},props:{useSearchValue:{type:Array,default:[]},rxOutSideStyleCustom:{type:String,default:"!max-w-[68px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}},rxFormSelectOptions:{type:Array,default:[]}},setup(e,{attrs:l,emit:a}){const n=T(e,"useSearchValue",a),{rxSelectRef:c,rxFormItemRef:u,searchValueComputed:i,formSelectText:s,setPopoverStatus:p,getPopoverStatus:x}=((e,o)=>{const r=t(!1);return{rxSelectRef:t(),rxFormItemRef:t(),searchValueComputed:S((()=>O(e.useSearchValue,(e=>e.label)).toString())),formSelectText:S((()=>o.multiple?`已选${e.useSearchValue.length}项`:e.useSearchValue[0].value)),popoverStatus:r,setPopoverStatus:e=>r.value=e,getPopoverStatus:()=>r.value}})(e,l),{getRxToolTipConfig:m,updateRxToolTipConfig:d}=function(e,o){const r=t();return{getRxToolTipConfig:()=>r.value,updateRxToolTipConfig:function(){const{toolTipConfig:t}=e,l=o.value.getBoundingClientRect(),a={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:a})}}}(e,u);return((e,t)=>{o((()=>t.useSearchValue),(()=>{r((()=>{e()}))}),{deep:!0,immediate:!0})})(d,e),{useSearchValueLocal:n,rxSelectRef:c,rxFormItemRef:u,searchValueComputed:i,formSelectText:s,ArrowDownBold:B,ArrowUpBold:$,getRxToolTipConfig:m,isEmpty:D,setPopoverStatus:p,getPopoverStatus:x}}});const q={ref:"rxFormItemRef"},G={class:"h-[32px] rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7]"},J={key:0,class:"flex items-center space-x-1 cursor-pointer group"},K={class:"flex items-center space-x-1 cursor-pointer"},Q={class:"text-[14px] leading-[22px] text-[#8B9199]"};z.render=function(e,t,o,r,l,S){const v=a("ArrowUpBold"),y=a("ArrowDownBold"),C=a("el-icon"),k=a("RxFormSelect"),F=a("RxScrollbar"),T=a("RxTooltip");return n(),c(x,null,[u(" {{ $attrs }} "),m("div",q,[m("div",G,[d(T,p({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:f((()=>[d(k,p({trigger:"click",teleported:!0},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":t[0]||(t[0]=t=>e.useSearchValueLocal=t),onShow:t[1]||(t[1]=t=>e.setPopoverStatus(!0)),onHide:t[2]||(t[2]=t=>e.setPopoverStatus(!1))}),{default:f((()=>[u(" 值 "),e.isEmpty(e.useSearchValueLocal)?(n(),c(x,{key:1},[u(" 标题 "),m("div",K,[m("p",Q,g(e.$attrs.label),1),d(C,{size:12,color:"#5C6781"},{default:f((()=>[e.getPopoverStatus()?(n(),s(v,{key:0})):(n(),s(y,{key:1}))])),_:1})])],2112)):(n(),c("div",J,[m("p",{class:i(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},g(e.formSelectText),3),d(C,{size:12,color:"#0F1114",class:"group-hover:text-[#3370FF]"},{default:f((()=>[e.getPopoverStatus()?(n(),s(v,{key:0})):(n(),s(y,{key:1}))])),_:1})]))])),_:1},16,["modelValue"])])),content:f((()=>[m("div",{style:h(e.getRxToolTipConfig().style)},[d(F,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:f((()=>[m("p",null,g(e.$attrs.label)+":",1),R(" "+g(e.searchValueComputed),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])])],512)],2112)},z.__file="packages/components/RxFormPlusBeta/src/components/formSelect/index.vue";const X={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 Z(e){return e.replace(/-/g,"/")}function ee(e,t){if(D(e.useSearchValue))return t.placeholder;if(I(["datetimerange","daterange","monthrange"],e.rxDatePickerOptions.type)){return`${Z(e.useSearchValue[0])}~${Z(e.useSearchValue[1])}`}return`${e.useSearchValue}`}var te=l({name:"RxFormPlusDatePicker",components:{RxDatePicker:H,RxTooltip:V,RxScrollbar:b,Calendar:L,ElIcon:w},props:X,setup(e,{attrs:l,emit:a}){const n=T(e,"useSearchValue",a),{rxDatePickerRef:c,rxDatePickerComponentsRef:u,rxFormItemRef:i,datePickerFormat:s}=((e,o)=>{const r=t(),l=t(),a=t();return{rxDatePickerRef:r,datePickerFormat:S((()=>ee(e,o))),rxFormItemRef:l,rxDatePickerComponentsRef:a}})(e,l),{getRxToolTipConfig:p,updateRxToolTipConfig:x}=function(e,o,r){const l=t();return{getRxToolTipConfig:()=>l.value,updateRxToolTipConfig:function(){const{toolTipConfig:a}=e,{width:n}=r.value.getBoundingClientRect(),c={width:(null==a?void 0:a.tooltipWidth)?a.tooltipWidth:`${n}px`,maxHeight:(null==a?void 0:a.maxHeight)?a.maxHeight:"80px"},u=t();if(null==a?void 0:a.content){const{content:e}=a;u.value=e}else u.value=ee(e,o);l.value=Object.assign(Object.assign({},a),{style:c,content:u.value})}}}(e,l,i),{handleOpenRxDatePicker:m}=((e,t,l)=>(o((()=>t.useSearchValue),(()=>{r((()=>{e()}))}),{deep:!0,immediate:!0}),{handleOpenRxDatePicker:function(){r((()=>{l.value.rxDatePickerRef.focus()}))}}))(x,e,u);return{useSearchValueLocal:n,rxDatePickerRef:c,datePickerFormat:s,rxFormItemRef:i,rxDatePickerComponentsRef:u,getRxToolTipConfig:p,handleOpenRxDatePicker:m,isEmpty:D}}});const oe={ref:"rxFormItemRef",class:"rounded-[4px] px-[8px] py-[5px] group hover:bg-[#F5F6F7]"},re={class:"w-0 h-0 overflow-hidden",ref:"rxDatePickerRef"},le={class:"text-[14px] leading-[22px] text-[#8B9199]"};te.render=function(e,t,o,r,l,s){const S=a("RxDatePicker"),C=a("Calendar"),k=a("el-icon"),F=a("RxScrollbar"),T=a("RxTooltip");return n(),c("div",oe,[d(T,v(y(e.getRxToolTipConfig())),{default:f((()=>[m("div",{class:"flex items-center space-x-1 cursor-pointer",onClick:t[1]||(t[1]=(...t)=>e.handleOpenRxDatePicker&&e.handleOpenRxDatePicker(...t))},[u(" 隐藏控件 "),m("div",re,[d(S,p({ref:"rxDatePickerComponentsRef",modelValue:e.useSearchValueLocal,"onUpdate:modelValue":t[0]||(t[0]=t=>e.useSearchValueLocal=t)},{...e.$attrs,...e.$props,...e.$props.rxDatePickerOptions}),null,16,["modelValue"])],512),u(" 值 "),e.isEmpty(e.useSearchValue)?(n(),c(x,{key:1},[u(" 标题 "),m("p",le,g(e.$attrs.label),1),d(k,{color:"#5C6781"},{default:f((()=>[d(C)])),_:1})],64)):(n(),c(x,{key:0},[m("p",{class:i(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},g(e.datePickerFormat),3),d(k,{class:"text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",color:"#0F1114"},{default:f((()=>[d(C)])),_:1})],64))])])),content:f((()=>[m("div",{style:h(e.getRxToolTipConfig().style)},[d(F,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:f((()=>[R(g(e.datePickerFormat),1)])),_:1},8,["max-height"])],4)])),_:1},16)],512)},te.__file="packages/components/RxFormPlusBeta/src/components/formDatePicker/index.vue";const ae=new Map;function ne(e,t){ae.set(e,t)}ne("RxFormPlusInput",Y),ne("RxFormPlusSelect",z),ne("RxFormPlusDatePicker",te);var ce={add:ne,del:function(e){ae.delete(e)},get:function(e){return e&&ae.get(e)||e}},ue=l({name:"FormComponent",props:E,setup(e,{emit:t}){const o=ce.get(e.component),r=T(e,"useSearchValue",t);return{componentLocal:o,componentPropsLocal:S((()=>e.componentProps)),useSearchValueLocal:r}}});ue.render=function(e,t,o,r,l,a){return n(),s(C(e.componentLocal),v(y({...e.$attrs,...e.$props,...e.componentPropsLocal})),null,16)},ue.__file="packages/components/RxFormPlusBeta/src/components/formComponent/index.vue";var ie=l({name:"RxFormPlusBeta",components:{FormComponent:ue},props:A,setup:()=>({})});const se={class:"flex items-center space-x-2"};ie.render=function(e,t,o,r,l,i){const s=a("form-component");return n(),c(x,null,[u(" {{ columns }} "),m("div",se,[(n(!0),c(x,null,k(e.columns,((e,t)=>(n(),c("div",{key:t},[d(s,p(e,{useSearchValue:e.useSearchValue,"onUpdate:useSearchValue":t=>e.useSearchValue=t}),null,16,["useSearchValue","onUpdate:useSearchValue"])])))),128))])],2112)},ie.__file="packages/components/RxFormPlusBeta/src/RxFormPlusBeta.vue";const pe=e(ie);export{pe as RxFormPlusBeta,pe as default};
|
|
1
|
+
import{withInstall as e}from"rx-compo/es/utils/with-install";import{ref as t,reactive as o,readonly as r,provide as l,inject as a,watch as n,nextTick as c,defineComponent as u,resolveComponent as i,openBlock as s,createElementBlock as p,createCommentVNode as x,normalizeClass as m,createBlock as d,mergeProps as f,withCtx as g,createElementVNode as h,createVNode as S,Fragment as R,toDisplayString as v,normalizeStyle as y,createTextVNode as C,computed as k,normalizeProps as F,guardReactiveProps as T,resolveDynamicComponent as P,renderList as V}from"vue";import{useDebounceFn as b,onClickOutside as D,useVModel as O}from"@vueuse/core";import{RxInput as I}from"rx-compo/es/components/RxInput";import{RxTooltip as B}from"rx-compo/es/components/RxTooltip";import{RxScrollbar as _}from"rx-compo/es/components/RxScrollbar";import{isEmpty as w,map as $,includes as L}from"lodash-es";import{ElIcon as j}from"element-plus";import{Search as H,ArrowDownBold as A,ArrowUpBold as E,Calendar as U}from"@element-plus/icons-vue";import{RxFormSelect as Y}from"rx-compo/es/components/RxFormSelect";import{RxDatePicker as W}from"rx-compo/es/components/RxDatePicker";const M={columns:{type:Array,default:[]}},N={useSearchValue:{type:[Array,String,Number,Boolean,Object],default:""},component:{type:String,default:""},componentProps:{type:Object,default:void 0}},z={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 q=Symbol();function G(e){return function(e,t=Symbol(),a={}){const{readonly:n=!0,createProvider:c=!1,native:u=!1}=a,i=o(e),s=n?r(i):i;return!c&&l(t,u?e:s),{state:i}}(e,q)}function J(){return function(e=Symbol(),t){return a(e,t||{})}(q)}var K=u({name:"RxFormPlusInput",components:{RxInput:I,RxTooltip:B,RxScrollbar:_,Search:H,ElIcon:j},props:z,setup(e,{attrs:o,emit:r}){const l=O(e,"useSearchValue",r),{clickRef:a,rxInputRef:u,rxFormItemRef:i,setClickRef:s}=(e=>{const o=t(!1),r=t(),l=t();return{clickRef:o,rxInputRef:r,rxFormItemRef:l,getClickRef:function(){return o.value},setClickRef:function(e){o.value=e}}})(),{getRxToolTipConfig:p,updateRxToolTipConfig:x}=function(e,o,r){const l=t();function a(){const{toolTipConfig:o}=e,a=r.value.getBoundingClientRect(),n={width:(null==o?void 0:o.tooltipWidth)?o.tooltipWidth:`${null==a?void 0:a.width}px`,maxHeight:(null==o?void 0:o.maxHeight)?o.maxHeight:"80px"},c=t();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:n,content:c.value})}return c((()=>a())),{updateRxToolTipConfig:a,getRxToolTipConfig:()=>l.value}}(e,0,i);return((e,t,o,r,l)=>{const a=J(),u=b((()=>{a.handleSearchCallBack()}),1e3);D(o,(()=>t(!1))),n((()=>r),(()=>{c((()=>{e()}))}),{deep:!0}),n((()=>l.useSearchValue),(()=>{c((()=>{e(),u()}))}),{deep:!0})})(x,s,u,a,e),{clickRef:a,useSearchValueLocal:l,rxInputRef:u,rxFormItemRef:i,getRxToolTipConfig:p,setClickRef:s,isEmpty:w}}});const Q={ref:"rxFormItemRef"},X={class:"flex items-center"},Z={class:"cursor-pointer h-[32px] rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7]"},ee={class:"text-[14px] leading-[22px] text-[#8B9199]"};K.render=function(e,t,o,r,l,a){const n=i("Search"),c=i("el-icon"),u=i("RxInput"),k=i("RxScrollbar"),F=i("RxTooltip");return s(),p("div",Q,[x(" 输入状态 "),e.clickRef?(s(),p("div",{key:0,ref:"rxInputRef",class:m(e.rxInputStyleCustom)},[e.clickRef?(s(),d(u,f({key:0},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":t[0]||(t[0]=t=>e.useSearchValueLocal=t)}),{prefix:g((()=>[h("div",X,[S(c,{color:"#5C6781"},{default:g((()=>[S(n)])),_:1})])])),_:1},16,["modelValue"])):x("v-if",!0)],2)):(s(),p(R,{key:1},[x(" 极值、有值、hover/点击、无操作 "),h("div",Z,[S(F,f({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:g((()=>[x(" 值 "),e.isEmpty(e.useSearchValueLocal)?(s(),p(R,{key:1},[x(" 标题 "),h("div",{class:"flex items-center space-x-1",onClick:t[2]||(t[2]=t=>e.setClickRef(!0))},[h("p",ee,v(e.$attrs.label),1),S(c,{color:"#5C6781"},{default:g((()=>[S(n)])),_:1})])],2112)):(s(),p("div",{key:0,class:"flex items-center space-x-1 group",onClick:t[1]||(t[1]=t=>e.setClickRef(!0))},[h("p",{class:m(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},v(e.useSearchValueLocal),3),S(c,{color:"#0F1114",class:"group-hover:text-[#3370FF]"},{default:g((()=>[S(n)])),_:1})]))])),content:g((()=>[h("div",{style:y(e.getRxToolTipConfig().style)},[S(k,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:g((()=>[C(v(e.useSearchValueLocal),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])])],2112))],512)},K.__file="packages/components/RxFormPlusBeta/src/components/formInput/index.vue";var te=u({name:"RxFormPlusSelect",components:{RxTooltip:B,RxScrollbar:_,RxFormSelect:Y,ArrowDownBold:A,ArrowUpBold:E,ElIcon:j},props:{useSearchValue:{type:Array,default:[]},rxOutSideStyleCustom:{type:String,default:"!max-w-[68px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}},rxFormSelectOptions:{type:Array,default:[]}},setup(e,{attrs:o,emit:r}){const l=O(e,"useSearchValue",r),{rxSelectRef:a,rxFormItemRef:u,searchValueComputed:i,formSelectText:s,setPopoverStatus:p,getPopoverStatus:x}=((e,o)=>{const r=t(!1);return{rxSelectRef:t(),rxFormItemRef:t(),searchValueComputed:k((()=>$(e.useSearchValue,(e=>e.label)).toString())),formSelectText:k((()=>o.multiple?`已选${e.useSearchValue.length}项`:e.useSearchValue[0].value)),popoverStatus:r,setPopoverStatus:e=>r.value=e,getPopoverStatus:()=>r.value}})(e,o),{getRxToolTipConfig:m,updateRxToolTipConfig:d}=function(e,o){const r=t();function l(){const{toolTipConfig:t}=e,l=o.value.getBoundingClientRect(),a={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:a})}return c((()=>l())),{getRxToolTipConfig:()=>r.value,updateRxToolTipConfig:l}}(e,u);return((e,t)=>{const o=J(),r=b((()=>{o.handleSearchCallBack()}),1e3);n((()=>t.useSearchValue),(()=>{c((()=>{e(),r()}))}),{deep:!0})})(d,e),{useSearchValueLocal:l,rxSelectRef:a,rxFormItemRef:u,searchValueComputed:i,formSelectText:s,ArrowDownBold:A,ArrowUpBold:E,getRxToolTipConfig:m,isEmpty:w,setPopoverStatus:p,getPopoverStatus:x}}});const oe={ref:"rxFormItemRef"},re={class:"h-[32px] rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7]"},le={key:0,class:"flex items-center space-x-1 cursor-pointer group"},ae={class:"flex items-center space-x-1 cursor-pointer"},ne={class:"text-[14px] leading-[22px] text-[#8B9199]"};te.render=function(e,t,o,r,l,a){const n=i("ArrowUpBold"),c=i("ArrowDownBold"),u=i("el-icon"),k=i("RxFormSelect"),F=i("RxScrollbar"),T=i("RxTooltip");return s(),p(R,null,[x(" {{ $attrs }} "),h("div",oe,[h("div",re,[S(T,f({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:g((()=>[S(k,f({trigger:"click",teleported:!0},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":t[0]||(t[0]=t=>e.useSearchValueLocal=t),onShow:t[1]||(t[1]=t=>e.setPopoverStatus(!0)),onHide:t[2]||(t[2]=t=>e.setPopoverStatus(!1))}),{default:g((()=>[x(" 值 "),e.isEmpty(e.useSearchValueLocal)?(s(),p(R,{key:1},[x(" 标题 "),h("div",ae,[h("p",ne,v(e.$attrs.label),1),S(u,{size:12,color:"#5C6781"},{default:g((()=>[e.getPopoverStatus()?(s(),d(n,{key:0})):(s(),d(c,{key:1}))])),_:1})])],2112)):(s(),p("div",le,[h("p",{class:m(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},v(e.formSelectText),3),S(u,{size:12,color:"#0F1114",class:"group-hover:text-[#3370FF]"},{default:g((()=>[e.getPopoverStatus()?(s(),d(n,{key:0})):(s(),d(c,{key:1}))])),_:1})]))])),_:1},16,["modelValue"])])),content:g((()=>[h("div",{style:y(e.getRxToolTipConfig().style)},[S(F,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:g((()=>[h("p",null,v(e.$attrs.label)+":",1),C(" "+v(e.searchValueComputed),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])])],512)],2112)},te.__file="packages/components/RxFormPlusBeta/src/components/formSelect/index.vue";const ce={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 ue(e){return e.replace(/-/g,"/")}function ie(e,t){if(w(e.useSearchValue))return t.placeholder;if(L(["datetimerange","daterange","monthrange"],e.rxDatePickerOptions.type)){return`${ue(e.useSearchValue[0])}~${ue(e.useSearchValue[1])}`}return`${e.useSearchValue}`}var se=u({name:"RxFormPlusDatePicker",components:{RxDatePicker:W,RxTooltip:B,RxScrollbar:_,Calendar:U,ElIcon:j},props:ce,setup(e,{attrs:o,emit:r}){const l=O(e,"useSearchValue",r),{rxDatePickerRef:a,rxDatePickerComponentsRef:u,rxFormItemRef:i,datePickerFormat:s}=((e,o)=>{const r=t(),l=t(),a=t();return{rxDatePickerRef:r,datePickerFormat:k((()=>ie(e,o))),rxFormItemRef:l,rxDatePickerComponentsRef:a}})(e,o),{getRxToolTipConfig:p,updateRxToolTipConfig:x}=function(e,o,r){const l=t();function a(){const{toolTipConfig:a}=e,{width:n}=r.value.getBoundingClientRect(),c={width:(null==a?void 0:a.tooltipWidth)?a.tooltipWidth:`${n}px`,maxHeight:(null==a?void 0:a.maxHeight)?a.maxHeight:"80px"},u=t();if(null==a?void 0:a.content){const{content:e}=a;u.value=e}else u.value=ie(e,o);l.value=Object.assign(Object.assign({},a),{style:c,content:u.value})}return c((()=>a())),{getRxToolTipConfig:()=>l.value,updateRxToolTipConfig:a}}(e,o,i),{handleOpenRxDatePicker:m}=((e,t,o)=>{const r=J(),l=b((()=>{r.handleSearchCallBack()}),1e3);return n((()=>t.useSearchValue),(()=>{c((()=>{e(),l()}))}),{deep:!0}),{handleOpenRxDatePicker:function(){c((()=>{o.value.rxDatePickerRef.focus()}))}}})(x,e,u);return{useSearchValueLocal:l,rxDatePickerRef:a,datePickerFormat:s,rxFormItemRef:i,rxDatePickerComponentsRef:u,getRxToolTipConfig:p,handleOpenRxDatePicker:m,isEmpty:w}}});const pe={ref:"rxFormItemRef",class:"rounded-[4px] px-[8px] py-[5px] group hover:bg-[#F5F6F7]"},xe={class:"w-0 h-0 overflow-hidden",ref:"rxDatePickerRef"},me={class:"text-[14px] leading-[22px] text-[#8B9199]"};se.render=function(e,t,o,r,l,a){const n=i("RxDatePicker"),c=i("Calendar"),u=i("el-icon"),d=i("RxScrollbar"),k=i("RxTooltip");return s(),p("div",pe,[S(k,F(T(e.getRxToolTipConfig())),{default:g((()=>[h("div",{class:"flex items-center space-x-1 cursor-pointer",onClick:t[1]||(t[1]=(...t)=>e.handleOpenRxDatePicker&&e.handleOpenRxDatePicker(...t))},[x(" 隐藏控件 "),h("div",xe,[S(n,f({ref:"rxDatePickerComponentsRef",modelValue:e.useSearchValueLocal,"onUpdate:modelValue":t[0]||(t[0]=t=>e.useSearchValueLocal=t)},{...e.$attrs,...e.$props,...e.$props.rxDatePickerOptions}),null,16,["modelValue"])],512),x(" 值 "),e.isEmpty(e.useSearchValue)?(s(),p(R,{key:1},[x(" 标题 "),h("p",me,v(e.$attrs.label),1),S(u,{color:"#5C6781"},{default:g((()=>[S(c)])),_:1})],64)):(s(),p(R,{key:0},[h("p",{class:m(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},v(e.datePickerFormat),3),S(u,{class:"text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",color:"#0F1114"},{default:g((()=>[S(c)])),_:1})],64))])])),content:g((()=>[h("div",{style:y(e.getRxToolTipConfig().style)},[S(d,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:g((()=>[C(v(e.datePickerFormat),1)])),_:1},8,["max-height"])],4)])),_:1},16)],512)},se.__file="packages/components/RxFormPlusBeta/src/components/formDatePicker/index.vue";const de=new Map;function fe(e,t){de.set(e,t)}fe("RxFormPlusInput",K),fe("RxFormPlusSelect",te),fe("RxFormPlusDatePicker",se);var ge={add:fe,del:function(e){de.delete(e)},get:function(e){return e&&de.get(e)||e}},he=u({name:"FormComponent",props:N,setup(e,{emit:t}){const o=ge.get(e.component),r=O(e,"useSearchValue",t);return{componentLocal:o,componentPropsLocal:k((()=>e.componentProps)),useSearchValueLocal:r}}});he.render=function(e,t,o,r,l,a){return s(),d(P(e.componentLocal),F(T({...e.$attrs,...e.$props,...e.componentPropsLocal})),null,16)},he.__file="packages/components/RxFormPlusBeta/src/components/formComponent/index.vue";var Se=u({name:"RxFormPlusBeta",components:{FormComponent:he},props:M,emits:["handleSearch"],setup(e,{emit:t,expose:o}){const r=()=>t("handleSearch",e);return G({handleSearchCallBack:r}),o({handleSearchCallBack:r}),{}}});const Re={class:"flex items-center space-x-2"};Se.render=function(e,t,o,r,l,a){const n=i("form-component");return s(),p("div",Re,[(s(!0),p(R,null,V(e.columns,((e,t)=>(s(),p("div",{key:t},[S(n,f(e,{useSearchValue:e.useSearchValue,"onUpdate:useSearchValue":t=>e.useSearchValue=t}),null,16,["useSearchValue","onUpdate:useSearchValue"])])))),128))])},Se.__file="packages/components/RxFormPlusBeta/src/RxFormPlusBeta.vue";const ve=e(Se);export{ve as RxFormPlusBeta,ve as default};
|
|
@@ -3,12 +3,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3
3
|
type: ArrayConstructor;
|
|
4
4
|
default: any[];
|
|
5
5
|
};
|
|
6
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
6
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "handleSearch"[], "handleSearch", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
7
|
columns: {
|
|
8
8
|
type: ArrayConstructor;
|
|
9
9
|
default: any[];
|
|
10
10
|
};
|
|
11
|
-
}
|
|
11
|
+
}>> & {
|
|
12
|
+
onHandleSearch?: (...args: any[]) => any;
|
|
13
|
+
}, {
|
|
12
14
|
columns: unknown[];
|
|
13
15
|
}>;
|
|
14
16
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
|
|
2
|
+
import type { RxFormInputPropsType } from '../props';
|
|
3
|
+
export declare const useController: (updateRxToolTipConfig: Function, setClickRef: Function, rxInputRef: any, clickRef: Ref<boolean>, props: RxFormInputPropsType) => {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InjectionKey } from 'vue';
|
|
2
|
+
export interface CreateContextOptions {
|
|
3
|
+
readonly?: boolean;
|
|
4
|
+
createProvider?: boolean;
|
|
5
|
+
native?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function createContext<T>(context: any, key?: InjectionKey<T>, options?: CreateContextOptions): {
|
|
8
|
+
state: any;
|
|
9
|
+
};
|
|
10
|
+
export declare function useContext<T>(key: InjectionKey<T>, native?: boolean): T;
|