rx-compo 1.0.85 → 1.0.86
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/hooks/useRxFormColumns.d.ts +3 -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/hooks/useRxFormColumns.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{withInstall as e}from"rx-compo/es/utils/with-install";import{ref as t,reactive as o,readonly as l,provide as r,inject as a,nextTick as n,watch as c,defineComponent as u,createElementVNode as i,resolveComponent as s,openBlock as p,createElementBlock as x,createCommentVNode as m,normalizeClass as d,createVNode as f,mergeProps as h,withCtx as g,Fragment as S,toDisplayString as v,normalizeStyle as R,createTextVNode as C,computed as V,createBlock as F,normalizeProps as k,guardReactiveProps as y,resolveDynamicComponent as T,renderList as P}from"vue";import{useDebounceFn as w,onClickOutside as b,useVModel as B}from"@vueuse/core";import{RxInput as H}from"rx-compo/es/components/RxInput";import{RxTooltip as D}from"rx-compo/es/components/RxTooltip";import{RxScrollbar as O}from"rx-compo/es/components/RxScrollbar";import{isEmpty as I,map as L,includes as $,reduce as _}from"lodash-es";import{ElIcon as M}from"element-plus";import{Search as j,ArrowDownBold as E}from"@element-plus/icons-vue";import{RxFormSelect as A}from"rx-compo/es/components/RxFormSelect";import{RxDatePicker as Y}from"rx-compo/es/components/RxDatePicker";const W={columns:{type:Array,default:[]},customClass:{type:String,default:"space-x-8"}},Z={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-[84px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}},singleMode:{type:Boolean,default:!1}};const N=Symbol();function z(e){return function(e,t=Symbol(),a={}){const{readonly:n=!0,createProvider:c=!1,native:u=!1}=a,i=o(e),s=n?l(i):i;return!c&&r(t,u?e:s),{state:i}}(e,N)}function q(){return function(e=Symbol(),t){return a(e,t||{})}(N)}var G=u({name:"RxFormPlusInput",components:{RxInput:H,RxTooltip:D,RxScrollbar:O,Search:j,ElIcon:M},props:U,setup(e,{attrs:o,emit:l}){const r=B(e,"useSearchValue",l),{clickRef:a,rxInputRef:u,rxInputOutSideRef:i,rxFormItemRef:s,setClickRef:p}=(e=>{const o=t(e.singleMode),l=t(),r=t(),a=t();return{clickRef:o,rxInputRef:l,rxInputOutSideRef:r,rxFormItemRef:a,getClickRef:function(){return o.value},setClickRef:function(e){o.value=e}}})(e),{getRxToolTipConfig:x,updateRxToolTipConfig:m}=function(e,o,l){const r=t();function a(){const{toolTipConfig:o}=e,a=l.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;r.value=Object.assign(Object.assign({},o),{style:n,content:c.value})}return n((()=>a())),{updateRxToolTipConfig:a,getRxToolTipConfig:()=>r.value}}(e,0,s),{handleBlur:d,handleFocus:f}=((e,t,o,l,r,a)=>{const u=q(),i=w((function(){u.handleSearchCallBack()}),1e3);return b(l,(()=>{a.singleMode?t(!0):t(!1)})),c((()=>r),(()=>{n((()=>{e()}))}),{deep:!0}),{handleBlur:function(){i()},handleFocus:function(){t(!0),n((()=>{var e,t;return null===(t=null===(e=o.value)||void 0===e?void 0:e.elInputRef)||void 0===t?void 0:t.focus()}))}}})(m,p,u,i,a,e);return{clickRef:a,useSearchValueLocal:r,rxInputRef:u,rxInputOutSideRef:i,rxFormItemRef:s,getRxToolTipConfig:x,setClickRef:p,isEmpty:I,handleBlur:d,handleFocus:f}}});const J={ref:"rxFormItemRef"},K={class:"flex items-center"},Q={key:0,class:"flex items-center space-x-1"},X=i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"text-[##5C6781] group-hover:text-[#3370FF]"},[i("circle",{cx:"8",cy:"8",r:"4.1",stroke:"currentColor","stroke-width":"1.8"}),i("path",{d:"M11 11L12.5 12.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1),ee={class:"flex items-center space-x-1"},te={class:"text-[14px] leading-[22px] text-[#8B9199]"},oe=i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"text-[##5C6781] group-hover:text-[#3370FF]"},[i("circle",{cx:"8",cy:"8",r:"4.1",stroke:"currentColor","stroke-width":"1.8"}),i("path",{d:"M11 11L12.5 12.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1);G.render=function(e,t,o,l,r,a){const n=s("Search"),c=s("el-icon"),u=s("RxInput"),V=s("RxScrollbar"),F=s("RxTooltip");return p(),x("div",J,[m(" 输入状态 "),e.clickRef?(p(),x("div",{key:0,ref:"rxInputOutSideRef",class:d(e.rxInputStyleCustom)},[f(u,h({ref:"rxInputRef"},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":t[0]||(t[0]=t=>e.useSearchValueLocal=t),onBlur:e.handleBlur}),{prefix:g((()=>[i("div",K,[f(c,{color:"#5C6781"},{default:g((()=>[f(n)])),_:1})])])),_:1},16,["modelValue","onBlur"])],2)):(p(),x(S,{key:1},[m(" 极值、有值、hover/点击、无操作 "),f(F,h({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:g((()=>[i("div",{onClick:t[1]||(t[1]=(...t)=>e.handleFocus&&e.handleFocus(...t)),class:"cursor-pointer h-[32px] flex items-center rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7]"},[m(" 值 "),e.isEmpty(e.useSearchValueLocal)?(p(),x(S,{key:1},[m(" 标题 "),i("div",ee,[i("p",te,v(e.$attrs.label),1),oe])],2112)):(p(),x("div",Q,[i("p",{class:d(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},v(e.useSearchValueLocal),3),X]))])])),content:g((()=>[i("div",{style:R(e.getRxToolTipConfig().style)},[f(V,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:g((()=>[i("p",null,v(e.$attrs.label)+":",1),C(" "+v(e.useSearchValueLocal),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])],2112))],512)},G.__file="packages/components/RxFormPlusBeta/src/components/formInput/index.vue";const le={useSearchValue:{type:Array,default:[]},visibleValue:{type:Boolean,default:null},rxOutSideStyleCustom:{type:String,default:"!max-w-[84px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}},rxFormSelectOptions:{type:Array,default:[]},multiple:{type:Boolean,default:!1}};var re=u({name:"RxFormPlusSelect",components:{RxTooltip:D,RxScrollbar:O,RxFormSelect:A,ArrowDownBold:E,ElIcon:M},props:le,setup(e,{attrs:o,emit:l}){const r=B(e,"useSearchValue",l),{refFormSelectRef:a,rxSelectRef:u,rxFormItemRef:i,searchValueComputed:s,formSelectText:p,setPopoverStatus:x,getPopoverStatus:m,getRefFormSelect:d}=((e,o)=>{const l=t(),r=t(!1),a=t(),n=t(),c=V((()=>L(e.useSearchValue,(e=>e.label)).toString())),u=V((()=>o.multiple?`已选${e.useSearchValue.length}项`:e.useSearchValue[0].value));return{refFormSelectRef:l,rxSelectRef:a,rxFormItemRef:n,searchValueComputed:c,formSelectText:u,popoverStatus:r,setPopoverStatus:e=>r.value=e,getPopoverStatus:()=>r.value,getRefFormSelect:()=>l.value}})(e,o),{getRxToolTipConfig:f,updateRxToolTipConfig:h}=function(e,o){const l=t();function r(){const{toolTipConfig:t}=e,r=o.value.getBoundingClientRect(),a={width:(null==t?void 0:t.tooltipWidth)?t.tooltipWidth:`${null==r?void 0:r.width}px`,maxHeight:(null==t?void 0:t.maxHeight)?t.maxHeight:"80px"};l.value=Object.assign(Object.assign({},t),{style:a})}return n((()=>r())),{getRxToolTipConfig:()=>l.value,updateRxToolTipConfig:r}}(e,i),{handleSetCallBack:g,handleSetPopover:S}=((e,t,o)=>{const l=q(),r=w((function(){l.handleSearchCallBack()}),1e3);return n((()=>{var e;b(null===(e=t())||void 0===e?void 0:e.defaultSlotPopoverRef,(()=>{t().setVisiblePopover(!1)}))})),c((()=>o.useSearchValue),(()=>{n((()=>{e()})),r()}),{deep:!0}),{handleSetCallBack:function(e){o.multiple||t().setVisiblePopover(!1)},handleSetPopover:function(){t().setVisiblePopover(!0)}}})(h,d,e);return{refFormSelectRef:a,useSearchValueLocal:r,rxSelectRef:u,rxFormItemRef:i,searchValueComputed:s,formSelectText:p,ArrowDownBold:E,getRxToolTipConfig:f,isEmpty:I,setPopoverStatus:x,getPopoverStatus:m,handleSetCallBack:g,handleSetPopover:S}}});const ae={ref:"rxFormItemRef"},ne={class:"text-[14px] leading-[22px] text-[#8B9199]"};re.render=function(e,t,o,l,r,a){const n=s("ArrowDownBold"),c=s("el-icon"),u=s("RxFormSelect"),V=s("RxScrollbar"),F=s("RxTooltip");return p(),x("div",ae,[f(F,h({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:g((()=>[f(u,h({ref:"refFormSelectRef"},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":t[1]||(t[1]=t=>e.useSearchValueLocal=t),onShow:t[2]||(t[2]=t=>e.setPopoverStatus(!0)),onHide:t[3]||(t[3]=t=>e.setPopoverStatus(!1)),onRxFormSelectClick:e.handleSetCallBack}),{default:g((()=>[i("div",{onClick:t[0]||(t[0]=(...t)=>e.handleSetPopover&&e.handleSetPopover(...t)),class:"h-[32px] flex items-center rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7] cursor-pointer space-x-1"},[m(" 值 "),e.isEmpty(e.useSearchValueLocal)?(p(),x(S,{key:1},[m(" 标题 "),i("p",ne,v(e.$attrs.label),1)],2112)):(p(),x("p",{key:0,class:d(["text-[14px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},v(e.formSelectText),3)),f(c,{size:12,color:"#5C6781",class:"text-[#0F1114] group-hover:text-[#3370FF]"},{default:g((()=>[f(n,{class:d(["transition",{"-rotate-180":e.getPopoverStatus()}])},null,8,["class"])])),_:1})])])),_:1},16,["modelValue","onRxFormSelectClick"])])),content:g((()=>[i("div",{style:R(e.getRxToolTipConfig().style)},[f(V,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:g((()=>[i("p",null,v(e.$attrs.label)+":",1),C(" "+v(e.searchValueComputed),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])],512)},re.__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(I(e.useSearchValue))return t.placeholder;if($(["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:Y,RxTooltip:D,RxScrollbar:O},props:ce,setup(e,{attrs:o,emit:l}){const r=B(e,"useSearchValue",l),{rxDatePickerRef:a,rxDatePickerComponentsRef:u,rxFormItemRef:i,datePickerFormat:s}=((e,o)=>{const l=t(),r=t(),a=t();return{rxDatePickerRef:l,datePickerFormat:V((()=>ie(e,o))),rxFormItemRef:r,rxDatePickerComponentsRef:a}})(e,o),{getRxToolTipConfig:p,updateRxToolTipConfig:x}=function(e,o,l){const r=t();function a(){const{toolTipConfig:a}=e,{width:n}=l.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);r.value=Object.assign(Object.assign({},a),{style:c,content:u.value})}return n((()=>a())),{getRxToolTipConfig:()=>r.value,updateRxToolTipConfig:a}}(e,o,i),{handleOpenRxDatePicker:m}=((e,t,o)=>{const l=q(),r=w((function(){l.handleSearchCallBack()}),1e3);return c((()=>t.useSearchValue),(()=>{n((()=>{e()})),r()}),{deep:!0}),{handleOpenRxDatePicker:function(){n((()=>{o.value.rxDatePickerRef.focus()}))}}})(x,e,u);return{useSearchValueLocal:r,rxDatePickerRef:a,datePickerFormat:s,rxFormItemRef:i,rxDatePickerComponentsRef:u,getRxToolTipConfig:p,handleOpenRxDatePicker:m,isEmpty:I}}});const pe={class:"w-0 h-0 overflow-hidden",ref:"rxDatePickerRef"},xe={key:0,class:"flex items-center space-x-1"},me=i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"text-[#0F1114] group-hover:text-[#3370FF]"},[i("path",{d:"M11.5 2.4H14.3C14.4856 2.4 14.6637 2.47375 14.795 2.60502C14.9262 2.7363 15 2.91435 15 3.1V14.3C15 14.4856 14.9262 14.6637 14.795 14.795C14.6637 14.9262 14.4856 15 14.3 15H1.7C1.51435 15 1.3363 14.9262 1.20502 14.795C1.07375 14.6637 1 14.4856 1 14.3V3.1C1 2.91435 1.07375 2.7363 1.20502 2.60502C1.3363 2.47375 1.51435 2.4 1.7 2.4H4.5V1H5.9V2.4H10.1V1H11.5V2.4ZM10.1 3.8H5.9V5.2H4.5V3.8H2.4V6.6H13.6V3.8H11.5V5.2H10.1V3.8ZM13.6 8H2.4V13.6H13.6V8Z",fill:"currentColor"})],-1),de={class:"text-[14px] leading-[22px] text-[#8B9199]"},fe=i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"text-[#0F1114] group-hover:text-[#3370FF]"},[i("path",{d:"M11.5 2.4H14.3C14.4856 2.4 14.6637 2.47375 14.795 2.60502C14.9262 2.7363 15 2.91435 15 3.1V14.3C15 14.4856 14.9262 14.6637 14.795 14.795C14.6637 14.9262 14.4856 15 14.3 15H1.7C1.51435 15 1.3363 14.9262 1.20502 14.795C1.07375 14.6637 1 14.4856 1 14.3V3.1C1 2.91435 1.07375 2.7363 1.20502 2.60502C1.3363 2.47375 1.51435 2.4 1.7 2.4H4.5V1H5.9V2.4H10.1V1H11.5V2.4ZM10.1 3.8H5.9V5.2H4.5V3.8H2.4V6.6H13.6V3.8H11.5V5.2H10.1V3.8ZM13.6 8H2.4V13.6H13.6V8Z",fill:"currentColor"})],-1);se.render=function(e,t,o,l,r,a){const n=s("RxDatePicker"),c=s("RxScrollbar"),u=s("RxTooltip");return p(),F(u,k(y(e.getRxToolTipConfig())),{default:g((()=>[i("div",{onClick:t[1]||(t[1]=(...t)=>e.handleOpenRxDatePicker&&e.handleOpenRxDatePicker(...t)),ref:"rxFormItemRef",class:"rounded-[4px] px-[8px] py-[5px] group hover:bg-[#F5F6F7] h-[32px] flex items-center cursor-pointer"},[m(" 隐藏控件 "),i("div",pe,[f(n,h({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),m(" 值 "),e.isEmpty(e.useSearchValue)?(p(),x(S,{key:1},[m(" 标题 "),i("p",de,v(e.$attrs.label),1),fe],64)):(p(),x("div",xe,[i("p",{class:d(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},v(e.datePickerFormat),3),me]))],512)])),content:g((()=>[i("div",{style:R(e.getRxToolTipConfig().style)},[f(c,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:g((()=>[C(v(e.datePickerFormat),1)])),_:1},8,["max-height"])],4)])),_:1},16)},se.__file="packages/components/RxFormPlusBeta/src/components/formDatePicker/index.vue";const he=new Map;function ge(e,t){he.set(e,t)}ge("RxFormPlusInput",G),ge("RxFormPlusSelect",re),ge("RxFormPlusDatePicker",se);var Se={add:ge,del:function(e){he.delete(e)},get:function(e){return e&&he.get(e)||e}},ve=u({name:"FormComponent",props:Z,setup(e,{emit:t}){const o=Se.get(e.component),l=B(e,"useSearchValue",t);return{componentLocal:o,componentPropsLocal:V((()=>e.componentProps)),useSearchValueLocal:l}}});ve.render=function(e,t,o,l,r,a){return p(),F(T(e.componentLocal),k(y({...e.$attrs,...e.$props,...e.componentPropsLocal})),null,16)},ve.__file="packages/components/RxFormPlusBeta/src/components/formComponent/index.vue";var Re=u({name:"RxFormPlusBeta",components:{FormComponent:ve},props:W,emits:["handleSearch"],setup(e,{emit:t,expose:o}){const{handleSearchCallBack:l}=((e,t)=>({handleSearchCallBack:()=>{const o=_(e.columns,((e,t)=>(t.useSearchValue&&t.prop&&(e[t.prop]=t.useSearchValue),e)),{});t("handleSearch",{searchData:o})}}))(e,t);return z({handleSearchCallBack:l}),o({handleSearchCallBack:l}),{}}});Re.render=function(e,t,o,l,r,a){const n=s("form-component");return p(),x("div",{class:d(["flex items-center",e.customClass])},[(p(!0),x(S,null,P(e.columns,(e=>(p(),x(S,null,[e.component?(p(),x("div",{key:e,class:d(e.componentLayoutClass)},[(p(),F(n,h({key:e},e,{modelValue:e.useSearchValue,"onUpdate:modelValue":t=>e.useSearchValue=t}),null,16,["modelValue","onUpdate:modelValue"]))],2)):m("v-if",!0)],64)))),256))],2)},Re.__file="packages/components/RxFormPlusBeta/src/RxFormPlusBeta.vue";const Ce=e(Re);export{Ce as RxFormPlusBeta,Ce as default};
|
|
1
|
+
import{withInstall as e}from"rx-compo/es/utils/with-install";import{ref as t,reactive as o,readonly as l,provide as r,inject as a,nextTick as n,watch as c,defineComponent as u,createElementVNode as i,resolveComponent as s,openBlock as p,createElementBlock as x,createCommentVNode as m,normalizeClass as d,createVNode as f,mergeProps as h,withCtx as g,Fragment as S,toDisplayString as v,normalizeStyle as R,createTextVNode as C,computed as V,createBlock as F,normalizeProps as k,guardReactiveProps as y,resolveDynamicComponent as T,renderList as P}from"vue";import{useDebounceFn as w,onClickOutside as b,useVModel as B}from"@vueuse/core";import{RxInput as H}from"rx-compo/es/components/RxInput";import{RxTooltip as D}from"rx-compo/es/components/RxTooltip";import{RxScrollbar as O}from"rx-compo/es/components/RxScrollbar";import{isEmpty as I,map as L,includes as $,reduce as _}from"lodash-es";import{ElIcon as M}from"element-plus";import{Search as j,ArrowDownBold as E}from"@element-plus/icons-vue";import{RxFormSelect as A}from"rx-compo/es/components/RxFormSelect";import{RxDatePicker as Y}from"rx-compo/es/components/RxDatePicker";const W={columns:{type:Array,default:[]},customClass:{type:String,default:"space-x-8"}},Z={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-[84px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}},singleMode:{type:Boolean,default:!1}};const N=Symbol();function z(e){return function(e,t=Symbol(),a={}){const{readonly:n=!0,createProvider:c=!1,native:u=!1}=a,i=o(e),s=n?l(i):i;return!c&&r(t,u?e:s),{state:i}}(e,N)}function q(){return function(e=Symbol(),t){return a(e,t||{})}(N)}var G=u({name:"RxFormPlusInput",components:{RxInput:H,RxTooltip:D,RxScrollbar:O,Search:j,ElIcon:M},props:U,setup(e,{attrs:o,emit:l}){const r=B(e,"useSearchValue",l),{clickRef:a,rxInputRef:u,rxInputOutSideRef:i,rxFormItemRef:s,setClickRef:p}=(e=>{const o=t(e.singleMode),l=t(),r=t(),a=t();return{clickRef:o,rxInputRef:l,rxInputOutSideRef:r,rxFormItemRef:a,getClickRef:function(){return o.value},setClickRef:function(e){o.value=e}}})(e),{getRxToolTipConfig:x,updateRxToolTipConfig:m}=function(e,o,l){const r=t();function a(){const{toolTipConfig:o}=e,a=l.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;r.value=Object.assign(Object.assign({},o),{style:n,content:c.value})}return n((()=>a())),{updateRxToolTipConfig:a,getRxToolTipConfig:()=>r.value}}(e,0,s),{handleBlur:d,handleFocus:f}=((e,t,o,l,r,a)=>{const u=q(),i=w((function(){u.handleSearchCallBack()}),1e3);return b(l,(()=>{a.singleMode?t(!0):t(!1)})),c((()=>r),(()=>{n((()=>{e()}))}),{deep:!0}),{handleBlur:function(){i()},handleFocus:function(){t(!0),n((()=>{var e,t;return null===(t=null===(e=o.value)||void 0===e?void 0:e.elInputRef)||void 0===t?void 0:t.focus()}))}}})(m,p,u,i,a,e);return{clickRef:a,useSearchValueLocal:r,rxInputRef:u,rxInputOutSideRef:i,rxFormItemRef:s,getRxToolTipConfig:x,setClickRef:p,isEmpty:I,handleBlur:d,handleFocus:f}}});const J={ref:"rxFormItemRef"},K={class:"flex items-center"},Q={key:0,class:"flex items-center space-x-1"},X=i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"text-[##5C6781] group-hover:text-[#3370FF]"},[i("circle",{cx:"8",cy:"8",r:"4.1",stroke:"currentColor","stroke-width":"1.8"}),i("path",{d:"M11 11L12.5 12.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1),ee={class:"flex items-center space-x-1"},te={class:"text-[14px] leading-[22px] text-[#8B9199]"},oe=i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"text-[##5C6781] group-hover:text-[#3370FF]"},[i("circle",{cx:"8",cy:"8",r:"4.1",stroke:"currentColor","stroke-width":"1.8"}),i("path",{d:"M11 11L12.5 12.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1);G.render=function(e,t,o,l,r,a){const n=s("Search"),c=s("el-icon"),u=s("RxInput"),V=s("RxScrollbar"),F=s("RxTooltip");return p(),x("div",J,[m(" 输入状态 "),e.clickRef?(p(),x("div",{key:0,ref:"rxInputOutSideRef",class:d(e.rxInputStyleCustom)},[f(u,h({ref:"rxInputRef"},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":t[0]||(t[0]=t=>e.useSearchValueLocal=t),onBlur:e.handleBlur}),{prefix:g((()=>[i("div",K,[f(c,{color:"#5C6781"},{default:g((()=>[f(n)])),_:1})])])),_:1},16,["modelValue","onBlur"])],2)):(p(),x(S,{key:1},[m(" 极值、有值、hover/点击、无操作 "),f(F,h({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:g((()=>[i("div",{onClick:t[1]||(t[1]=(...t)=>e.handleFocus&&e.handleFocus(...t)),class:"cursor-pointer h-[32px] flex items-center rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7]"},[m(" 值 "),e.isEmpty(e.useSearchValueLocal)?(p(),x(S,{key:1},[m(" 标题 "),i("div",ee,[i("p",te,v(e.$attrs.label),1),oe])],2112)):(p(),x("div",Q,[i("p",{class:d(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},v(e.useSearchValueLocal),3),X]))])])),content:g((()=>[i("div",{style:R(e.getRxToolTipConfig().style)},[f(V,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:g((()=>[i("p",null,v(e.$attrs.label)+":",1),C(" "+v(e.useSearchValueLocal),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])],2112))],512)},G.__file="packages/components/RxFormPlusBeta/src/components/formInput/index.vue";const le={useSearchValue:{type:Array,default:[]},visibleValue:{type:Boolean,default:null},rxOutSideStyleCustom:{type:String,default:"!max-w-[84px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}},rxFormSelectOptions:{type:Array,default:[]},multiple:{type:Boolean,default:!1}};var re=u({name:"RxFormPlusSelect",components:{RxTooltip:D,RxScrollbar:O,RxFormSelect:A,ArrowDownBold:E,ElIcon:M},props:le,setup(e,{attrs:o,emit:l}){const r=B(e,"useSearchValue",l),{refFormSelectRef:a,rxSelectRef:u,rxFormItemRef:i,searchValueComputed:s,formSelectText:p,setPopoverStatus:x,getPopoverStatus:m,getRefFormSelect:d}=((e,o)=>{const l=t(),r=t(!1),a=t(),n=t(),c=V((()=>L(e.useSearchValue,(e=>e.label)).toString())),u=V((()=>o.multiple?`已选${e.useSearchValue.length}项`:e.useSearchValue[0].value));return{refFormSelectRef:l,rxSelectRef:a,rxFormItemRef:n,searchValueComputed:c,formSelectText:u,popoverStatus:r,setPopoverStatus:e=>r.value=e,getPopoverStatus:()=>r.value,getRefFormSelect:()=>l.value}})(e,o),{getRxToolTipConfig:f,updateRxToolTipConfig:h}=function(e,o){const l=t();function r(){const{toolTipConfig:t}=e,r=o.value.getBoundingClientRect(),a={width:(null==t?void 0:t.tooltipWidth)?t.tooltipWidth:`${null==r?void 0:r.width}px`,maxHeight:(null==t?void 0:t.maxHeight)?t.maxHeight:"80px"};l.value=Object.assign(Object.assign({},t),{style:a})}return n((()=>r())),{getRxToolTipConfig:()=>l.value,updateRxToolTipConfig:r}}(e,i),{handleSetCallBack:g,handleSetPopover:S}=((e,t,o)=>{const l=q(),r=w((function(){l.handleSearchCallBack()}),1e3);return n((()=>{var e;b(null===(e=t())||void 0===e?void 0:e.defaultSlotPopoverRef,(()=>{t().setVisiblePopover(!1)}))})),c((()=>o.useSearchValue),(()=>{n((()=>{e()})),r()}),{deep:!0}),{handleSetCallBack:function(e){o.multiple||t().setVisiblePopover(!1)},handleSetPopover:function(){t().setVisiblePopover(!0)}}})(h,d,e);return{refFormSelectRef:a,useSearchValueLocal:r,rxSelectRef:u,rxFormItemRef:i,searchValueComputed:s,formSelectText:p,ArrowDownBold:E,getRxToolTipConfig:f,isEmpty:I,setPopoverStatus:x,getPopoverStatus:m,handleSetCallBack:g,handleSetPopover:S}}});const ae={ref:"rxFormItemRef"},ne={class:"text-[14px] leading-[22px] text-[#8B9199]"};re.render=function(e,t,o,l,r,a){const n=s("ArrowDownBold"),c=s("el-icon"),u=s("RxFormSelect"),V=s("RxScrollbar"),F=s("RxTooltip");return p(),x("div",ae,[f(F,h({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:g((()=>[f(u,h({ref:"refFormSelectRef"},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":t[1]||(t[1]=t=>e.useSearchValueLocal=t),onShow:t[2]||(t[2]=t=>e.setPopoverStatus(!0)),onHide:t[3]||(t[3]=t=>e.setPopoverStatus(!1)),onRxFormSelectClick:e.handleSetCallBack}),{default:g((()=>[i("div",{onClick:t[0]||(t[0]=(...t)=>e.handleSetPopover&&e.handleSetPopover(...t)),class:"h-[32px] flex items-center rounded-[4px] px-[8px] py-[5px] inline-block group hover:bg-[#F5F6F7] cursor-pointer space-x-1"},[m(" 值 "),e.isEmpty(e.useSearchValueLocal)?(p(),x(S,{key:1},[m(" 标题 "),i("p",ne,v(e.$attrs.label),1)],2112)):(p(),x("p",{key:0,class:d(["text-[14px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},v(e.formSelectText),3)),f(c,{size:12,color:"#5C6781",class:"text-[#0F1114] group-hover:text-[#3370FF]"},{default:g((()=>[f(n,{class:d(["transition",{"-rotate-180":e.getPopoverStatus()}])},null,8,["class"])])),_:1})])])),_:1},16,["modelValue","onRxFormSelectClick"])])),content:g((()=>[i("div",{style:R(e.getRxToolTipConfig().style)},[f(V,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:g((()=>[i("p",null,v(e.$attrs.label)+":",1),C(" "+v(e.searchValueComputed),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])],512)},re.__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(I(e.useSearchValue))return t.placeholder;if($(["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:Y,RxTooltip:D,RxScrollbar:O},props:ce,setup(e,{attrs:o,emit:l}){const r=B(e,"useSearchValue",l),{rxDatePickerRef:a,rxDatePickerComponentsRef:u,rxFormItemRef:i,datePickerFormat:s}=((e,o)=>{const l=t(),r=t(),a=t();return{rxDatePickerRef:l,datePickerFormat:V((()=>ie(e,o))),rxFormItemRef:r,rxDatePickerComponentsRef:a}})(e,o),{getRxToolTipConfig:p,updateRxToolTipConfig:x}=function(e,o,l){const r=t();function a(){const{toolTipConfig:a}=e,{width:n}=l.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);r.value=Object.assign(Object.assign({},a),{style:c,content:u.value})}return n((()=>a())),{getRxToolTipConfig:()=>r.value,updateRxToolTipConfig:a}}(e,o,i),{handleOpenRxDatePicker:m}=((e,t,o)=>{const l=q(),r=w((function(){l.handleSearchCallBack()}),1e3);return c((()=>t.useSearchValue),(()=>{n((()=>{e()})),r()}),{deep:!0}),{handleOpenRxDatePicker:function(){n((()=>{o.value.rxDatePickerRef.focus()}))}}})(x,e,u);return{useSearchValueLocal:r,rxDatePickerRef:a,datePickerFormat:s,rxFormItemRef:i,rxDatePickerComponentsRef:u,getRxToolTipConfig:p,handleOpenRxDatePicker:m,isEmpty:I}}});const pe={class:"w-0 h-0 overflow-hidden",ref:"rxDatePickerRef"},xe={key:0,class:"flex items-center space-x-1"},me=i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"text-[#0F1114] group-hover:text-[#3370FF]"},[i("path",{d:"M11.5 2.4H14.3C14.4856 2.4 14.6637 2.47375 14.795 2.60502C14.9262 2.7363 15 2.91435 15 3.1V14.3C15 14.4856 14.9262 14.6637 14.795 14.795C14.6637 14.9262 14.4856 15 14.3 15H1.7C1.51435 15 1.3363 14.9262 1.20502 14.795C1.07375 14.6637 1 14.4856 1 14.3V3.1C1 2.91435 1.07375 2.7363 1.20502 2.60502C1.3363 2.47375 1.51435 2.4 1.7 2.4H4.5V1H5.9V2.4H10.1V1H11.5V2.4ZM10.1 3.8H5.9V5.2H4.5V3.8H2.4V6.6H13.6V3.8H11.5V5.2H10.1V3.8ZM13.6 8H2.4V13.6H13.6V8Z",fill:"currentColor"})],-1),de={class:"text-[14px] leading-[22px] text-[#8B9199]"},fe=i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"text-[#0F1114] group-hover:text-[#3370FF]"},[i("path",{d:"M11.5 2.4H14.3C14.4856 2.4 14.6637 2.47375 14.795 2.60502C14.9262 2.7363 15 2.91435 15 3.1V14.3C15 14.4856 14.9262 14.6637 14.795 14.795C14.6637 14.9262 14.4856 15 14.3 15H1.7C1.51435 15 1.3363 14.9262 1.20502 14.795C1.07375 14.6637 1 14.4856 1 14.3V3.1C1 2.91435 1.07375 2.7363 1.20502 2.60502C1.3363 2.47375 1.51435 2.4 1.7 2.4H4.5V1H5.9V2.4H10.1V1H11.5V2.4ZM10.1 3.8H5.9V5.2H4.5V3.8H2.4V6.6H13.6V3.8H11.5V5.2H10.1V3.8ZM13.6 8H2.4V13.6H13.6V8Z",fill:"currentColor"})],-1);se.render=function(e,t,o,l,r,a){const n=s("RxDatePicker"),c=s("RxScrollbar"),u=s("RxTooltip");return p(),F(u,k(y(e.getRxToolTipConfig())),{default:g((()=>[i("div",{onClick:t[1]||(t[1]=(...t)=>e.handleOpenRxDatePicker&&e.handleOpenRxDatePicker(...t)),ref:"rxFormItemRef",class:"rounded-[4px] px-[8px] py-[5px] group hover:bg-[#F5F6F7] h-[32px] flex items-center cursor-pointer"},[m(" 隐藏控件 "),i("div",pe,[f(n,h({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),m(" 值 "),e.isEmpty(e.useSearchValue)?(p(),x(S,{key:1},[m(" 标题 "),i("p",de,v(e.$attrs.label),1),fe],64)):(p(),x("div",xe,[i("p",{class:d(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},v(e.datePickerFormat),3),me]))],512)])),content:g((()=>[i("div",{style:R(e.getRxToolTipConfig().style)},[f(c,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:g((()=>[C(v(e.datePickerFormat),1)])),_:1},8,["max-height"])],4)])),_:1},16)},se.__file="packages/components/RxFormPlusBeta/src/components/formDatePicker/index.vue";const he=new Map;function ge(e,t){he.set(e,t)}ge("RxFormPlusInput",G),ge("RxFormPlusSelect",re),ge("RxFormPlusDatePicker",se);var Se={add:ge,del:function(e){he.delete(e)},get:function(e){return e&&he.get(e)||e}},ve=u({name:"FormComponent",props:Z,setup(e,{emit:t}){const o=Se.get(e.component),l=B(e,"useSearchValue",t);return{componentLocal:o,componentPropsLocal:V((()=>e.componentProps)),useSearchValueLocal:l}}});ve.render=function(e,t,o,l,r,a){return p(),F(T(e.componentLocal),k(y({...e.$attrs,...e.$props,...e.componentPropsLocal})),null,16)},ve.__file="packages/components/RxFormPlusBeta/src/components/formComponent/index.vue";var Re=u({name:"RxFormPlusBeta",components:{FormComponent:ve},props:W,emits:["handleSearch"],setup(e,{emit:t,expose:o}){const{handleSearchCallBack:l,getSearchValue:r}=((e,t)=>{const o=()=>({searchData:_(e.columns,((e,t)=>(t.useSearchValue&&t.prop&&(e[t.prop]=t.useSearchValue),e)),{})});return{handleSearchCallBack:()=>{t("handleSearch",o())},getSearchValue:o}})(e,t);return z({handleSearchCallBack:l}),o({handleSearchCallBack:l,getSearchValue:r}),{}}});Re.render=function(e,t,o,l,r,a){const n=s("form-component");return p(),x("div",{class:d(["flex items-center",e.customClass])},[(p(!0),x(S,null,P(e.columns,(e=>(p(),x(S,null,[e.component?(p(),x("div",{key:e,class:d(e.componentLayoutClass)},[(p(),F(n,h({key:e},e,{modelValue:e.useSearchValue,"onUpdate:modelValue":t=>e.useSearchValue=t}),null,16,["modelValue","onUpdate:modelValue"]))],2)):m("v-if",!0)],64)))),256))],2)},Re.__file="packages/components/RxFormPlusBeta/src/RxFormPlusBeta.vue";const Ce=e(Re);export{Ce as RxFormPlusBeta,Ce as default};
|