rx-compo 1.0.84 → 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.
@@ -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"),l=require("rx-compo/lib/components/RxInput"),r=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"),u=require("rx-compo/lib/components/RxDatePicker");const p={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-[84px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}},singleMode:{type:Boolean,default:!1}};const x=Symbol();function f(e){return function(e,o=Symbol(),l={}){const{readonly:r=!0,createProvider:n=!1,native:a=!1}=l,c=t.reactive(e),i=r?t.readonly(c):c;return!n&&t.provide(o,a?e:i),{state:c}}(e,x)}function h(){return function(e=Symbol(),o){return t.inject(e,o||{})}(x)}var g=t.defineComponent({name:"RxFormPlusInput",components:{RxInput:l.RxInput,RxTooltip:r.RxTooltip,RxScrollbar:n.RxScrollbar,Search:i.Search,ElIcon:c.ElIcon},props:d,setup(e,{attrs:l,emit:r}){const n=o.useVModel(e,"useSearchValue",r),{clickRef:c,rxInputRef:i,rxInputOutSideRef:s,rxFormItemRef:u,setClickRef:p}=(e=>{const o=t.ref(e.singleMode),l=t.ref(),r=t.ref(),n=t.ref();return{clickRef:o,rxInputRef:l,rxInputOutSideRef:r,rxFormItemRef:n,getClickRef:function(){return o.value},setClickRef:function(e){o.value=e}}})(e),{getRxToolTipConfig:m,updateRxToolTipConfig:d}=function(e,o,l){const r=t.ref();function n(){const{toolTipConfig:o}=e,n=l.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;r.value=Object.assign(Object.assign({},o),{style:a,content:c.value})}return t.nextTick((()=>n())),{updateRxToolTipConfig:n,getRxToolTipConfig:()=>r.value}}(e,0,u),{handleBlur:x,handleFocus:f}=((e,l,r,n,a,c)=>{const i=h(),s=o.useDebounceFn((function(){i.handleSearchCallBack()}),1e3);return o.onClickOutside(n,(()=>{c.singleMode?l(!0):l(!1)})),t.watch((()=>a),(()=>{t.nextTick((()=>{e()}))}),{deep:!0}),{handleBlur:function(){s()},handleFocus:function(){l(!0),t.nextTick((()=>{var e,t;return null===(t=null===(e=r.value)||void 0===e?void 0:e.elInputRef)||void 0===t?void 0:t.focus()}))}}})(d,p,i,s,c,e);return{clickRef:c,useSearchValueLocal:n,rxInputRef:i,rxInputOutSideRef:s,rxFormItemRef:u,getRxToolTipConfig:m,setClickRef:p,isEmpty:a.isEmpty,handleBlur:x,handleFocus:f}}});const C={ref:"rxFormItemRef"},S={class:"flex items-center"},v={key:0,class:"flex items-center space-x-1"},V=t.createElementVNode("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]"},[t.createElementVNode("circle",{cx:"8",cy:"8",r:"4.1",stroke:"currentColor","stroke-width":"1.8"}),t.createElementVNode("path",{d:"M11 11L12.5 12.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1),R={class:"flex items-center space-x-1"},k={class:"text-[14px] leading-[22px] text-[#8B9199]"},y=t.createElementVNode("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]"},[t.createElementVNode("circle",{cx:"8",cy:"8",r:"4.1",stroke:"currentColor","stroke-width":"1.8"}),t.createElementVNode("path",{d:"M11 11L12.5 12.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1);g.render=function(e,o,l,r,n,a){const c=t.resolveComponent("Search"),i=t.resolveComponent("el-icon"),s=t.resolveComponent("RxInput"),u=t.resolveComponent("RxScrollbar"),p=t.resolveComponent("RxTooltip");return t.openBlock(),t.createElementBlock("div",C,[t.createCommentVNode(" 输入状态 "),e.clickRef?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"rxInputOutSideRef",class:t.normalizeClass(e.rxInputStyleCustom)},[t.createVNode(s,t.mergeProps({ref:"rxInputRef"},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":o[0]||(o[0]=t=>e.useSearchValueLocal=t),onBlur:e.handleBlur}),{prefix:t.withCtx((()=>[t.createElementVNode("div",S,[t.createVNode(i,{color:"#5C6781"},{default:t.withCtx((()=>[t.createVNode(c)])),_:1})])])),_:1},16,["modelValue","onBlur"])],2)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 极值、有值、hover/点击、无操作 "),t.createVNode(p,t.mergeProps({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:o[1]||(o[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]"},[t.createCommentVNode(" 值 "),e.isEmpty(e.useSearchValueLocal)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 标题 "),t.createElementVNode("div",R,[t.createElementVNode("p",k,t.toDisplayString(e.$attrs.label),1),y])],2112)):(t.openBlock(),t.createElementBlock("div",v,[t.createElementVNode("p",{class:t.normalizeClass(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.useSearchValueLocal),3),V]))])])),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.useSearchValueLocal),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])],2112))],512)},g.__file="packages/components/RxFormPlusBeta/src/components/formInput/index.vue";const F={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 T=t.defineComponent({name:"RxFormPlusSelect",components:{RxTooltip:r.RxTooltip,RxScrollbar:n.RxScrollbar,RxFormSelect:s.RxFormSelect,ArrowDownBold:i.ArrowDownBold,ElIcon:c.ElIcon},props:F,setup(e,{attrs:l,emit:r}){const n=o.useVModel(e,"useSearchValue",r),{refFormSelectRef:c,rxSelectRef:s,rxFormItemRef:u,searchValueComputed:p,formSelectText:m,setPopoverStatus:d,getPopoverStatus:x,getRefFormSelect:f}=((e,o)=>{const l=t.ref(),r=t.ref(!1),n=t.ref(),c=t.ref(),i=t.computed((()=>a.map(e.useSearchValue,(e=>e.label)).toString())),s=t.computed((()=>o.multiple?`已选${e.useSearchValue.length}项`:e.useSearchValue[0].value));return{refFormSelectRef:l,rxSelectRef:n,rxFormItemRef:c,searchValueComputed:i,formSelectText:s,popoverStatus:r,setPopoverStatus:e=>r.value=e,getPopoverStatus:()=>r.value,getRefFormSelect:()=>l.value}})(e,l),{getRxToolTipConfig:g,updateRxToolTipConfig:C}=function(e,o){const l=t.ref();function r(){const{toolTipConfig:t}=e,r=o.value.getBoundingClientRect(),n={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:n})}return t.nextTick((()=>r())),{getRxToolTipConfig:()=>l.value,updateRxToolTipConfig:r}}(e,u),{handleSetCallBack:S,handleSetPopover:v}=((e,l,r)=>{const n=h(),a=o.useDebounceFn((function(){n.handleSearchCallBack()}),1e3);return t.nextTick((()=>{var e;o.onClickOutside(null===(e=l())||void 0===e?void 0:e.defaultSlotPopoverRef,(()=>{l().setVisiblePopover(!1)}))})),t.watch((()=>r.useSearchValue),(()=>{t.nextTick((()=>{e()})),a()}),{deep:!0}),{handleSetCallBack:function(e){r.multiple||l().setVisiblePopover(!1)},handleSetPopover:function(){l().setVisiblePopover(!0)}}})(C,f,e);return{refFormSelectRef:c,useSearchValueLocal:n,rxSelectRef:s,rxFormItemRef:u,searchValueComputed:p,formSelectText:m,ArrowDownBold:i.ArrowDownBold,getRxToolTipConfig:g,isEmpty:a.isEmpty,setPopoverStatus:d,getPopoverStatus:x,handleSetCallBack:S,handleSetPopover:v}}});const B={ref:"rxFormItemRef"},P={class:"text-[14px] leading-[22px] text-[#8B9199]"};T.render=function(e,o,l,r,n,a){const c=t.resolveComponent("ArrowDownBold"),i=t.resolveComponent("el-icon"),s=t.resolveComponent("RxFormSelect"),u=t.resolveComponent("RxScrollbar"),p=t.resolveComponent("RxTooltip");return t.openBlock(),t.createElementBlock("div",B,[t.createVNode(p,t.mergeProps({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:t.withCtx((()=>[t.createVNode(s,t.mergeProps({ref:"refFormSelectRef"},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":o[1]||(o[1]=t=>e.useSearchValueLocal=t),onShow:o[2]||(o[2]=t=>e.setPopoverStatus(!0)),onHide:o[3]||(o[3]=t=>e.setPopoverStatus(!1)),onRxFormSelectClick:e.handleSetCallBack}),{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:o[0]||(o[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"},[t.createCommentVNode(" 值 "),e.isEmpty(e.useSearchValueLocal)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 标题 "),t.createElementVNode("p",P,t.toDisplayString(e.$attrs.label),1)],2112)):(t.openBlock(),t.createElementBlock("p",{key:0,class:t.normalizeClass(["text-[14px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.formSelectText),3)),t.createVNode(i,{size:12,color:"#5C6781",class:"text-[#0F1114] group-hover:text-[#3370FF]"},{default:t.withCtx((()=>[t.createVNode(c,{class:t.normalizeClass(["transition",{"-rotate-180":e.getPopoverStatus()}])},null,8,["class"])])),_:1})])])),_:1},16,["modelValue","onRxFormSelectClick"])])),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)},T.__file="packages/components/RxFormPlusBeta/src/components/formSelect/index.vue";const w={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 E(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 N=t.defineComponent({name:"RxFormPlusDatePicker",components:{RxDatePicker:u.RxDatePicker,RxTooltip:r.RxTooltip,RxScrollbar:n.RxScrollbar},props:w,setup(e,{attrs:l,emit:r}){const n=o.useVModel(e,"useSearchValue",r),{rxDatePickerRef:c,rxDatePickerComponentsRef:i,rxFormItemRef:s,datePickerFormat:u}=((e,o)=>{const l=t.ref(),r=t.ref(),n=t.ref();return{rxDatePickerRef:l,datePickerFormat:t.computed((()=>E(e,o))),rxFormItemRef:r,rxDatePickerComponentsRef:n}})(e,l),{getRxToolTipConfig:p,updateRxToolTipConfig:m}=function(e,o,l){const r=t.ref();function n(){const{toolTipConfig:n}=e,{width:a}=l.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=E(e,o);r.value=Object.assign(Object.assign({},n),{style:c,content:i.value})}return t.nextTick((()=>n())),{getRxToolTipConfig:()=>r.value,updateRxToolTipConfig:n}}(e,l,s),{handleOpenRxDatePicker:d}=((e,l,r)=>{const n=h(),a=o.useDebounceFn((function(){n.handleSearchCallBack()}),1e3);return t.watch((()=>l.useSearchValue),(()=>{t.nextTick((()=>{e()})),a()}),{deep:!0}),{handleOpenRxDatePicker:function(){t.nextTick((()=>{r.value.rxDatePickerRef.focus()}))}}})(m,e,i);return{useSearchValueLocal:n,rxDatePickerRef:c,datePickerFormat:u,rxFormItemRef:s,rxDatePickerComponentsRef:i,getRxToolTipConfig:p,handleOpenRxDatePicker:d,isEmpty:a.isEmpty}}});const D={class:"w-0 h-0 overflow-hidden",ref:"rxDatePickerRef"},H={key:0,class:"flex items-center space-x-1"},I=t.createElementVNode("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]"},[t.createElementVNode("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),O={class:"text-[14px] leading-[22px] text-[#8B9199]"},L=t.createElementVNode("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]"},[t.createElementVNode("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);N.render=function(e,o,l,r,n,a){const c=t.resolveComponent("RxDatePicker"),i=t.resolveComponent("RxScrollbar"),s=t.resolveComponent("RxTooltip");return t.openBlock(),t.createBlock(s,t.normalizeProps(t.guardReactiveProps(e.getRxToolTipConfig())),{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:o[1]||(o[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"},[t.createCommentVNode(" 隐藏控件 "),t.createElementVNode("div",D,[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),L],64)):(t.openBlock(),t.createElementBlock("div",H,[t.createElementVNode("p",{class:t.normalizeClass(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.datePickerFormat),3),I]))],512)])),content:t.withCtx((()=>[t.createElementVNode("div",{style:t.normalizeStyle(e.getRxToolTipConfig().style)},[t.createVNode(i,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.datePickerFormat),1)])),_:1},8,["max-height"])],4)])),_:1},16)},N.__file="packages/components/RxFormPlusBeta/src/components/formDatePicker/index.vue";const _=new Map;function M(e,t){_.set(e,t)}M("RxFormPlusInput",g),M("RxFormPlusSelect",T),M("RxFormPlusDatePicker",N);var $={add:M,del:function(e){_.delete(e)},get:function(e){return e&&_.get(e)||e}},j=t.defineComponent({name:"FormComponent",props:m,setup(e,{emit:l}){const r=$.get(e.component),n=o.useVModel(e,"useSearchValue",l);return{componentLocal:r,componentPropsLocal:t.computed((()=>e.componentProps)),useSearchValueLocal:n}}});j.render=function(e,o,l,r,n,a){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.componentLocal),t.normalizeProps(t.guardReactiveProps({...e.$attrs,...e.$props,...e.componentPropsLocal})),null,16)},j.__file="packages/components/RxFormPlusBeta/src/components/formComponent/index.vue";var z=t.defineComponent({name:"RxFormPlusBeta",components:{FormComponent:j},props:p,emits:["handleSearch"],setup(e,{emit:t,expose:o}){const l=()=>t("handleSearch",e);return f({handleSearchCallBack:l}),o({handleSearchCallBack:l}),{}}});z.render=function(e,o,l,r,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)},z.__file="packages/components/RxFormPlusBeta/src/RxFormPlusBeta.vue";const q=e.withInstall(z);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"),l=require("rx-compo/lib/components/RxInput"),r=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"),u=require("rx-compo/lib/components/RxDatePicker");const p={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-[84px] truncate"},toolTipConfig:{type:Object,default:{placement:"top"}},singleMode:{type:Boolean,default:!1}};const x=Symbol();function f(e){return function(e,o=Symbol(),l={}){const{readonly:r=!0,createProvider:n=!1,native:a=!1}=l,c=t.reactive(e),i=r?t.readonly(c):c;return!n&&t.provide(o,a?e:i),{state:c}}(e,x)}function h(){return function(e=Symbol(),o){return t.inject(e,o||{})}(x)}var g=t.defineComponent({name:"RxFormPlusInput",components:{RxInput:l.RxInput,RxTooltip:r.RxTooltip,RxScrollbar:n.RxScrollbar,Search:i.Search,ElIcon:c.ElIcon},props:d,setup(e,{attrs:l,emit:r}){const n=o.useVModel(e,"useSearchValue",r),{clickRef:c,rxInputRef:i,rxInputOutSideRef:s,rxFormItemRef:u,setClickRef:p}=(e=>{const o=t.ref(e.singleMode),l=t.ref(),r=t.ref(),n=t.ref();return{clickRef:o,rxInputRef:l,rxInputOutSideRef:r,rxFormItemRef:n,getClickRef:function(){return o.value},setClickRef:function(e){o.value=e}}})(e),{getRxToolTipConfig:m,updateRxToolTipConfig:d}=function(e,o,l){const r=t.ref();function n(){const{toolTipConfig:o}=e,n=l.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;r.value=Object.assign(Object.assign({},o),{style:a,content:c.value})}return t.nextTick((()=>n())),{updateRxToolTipConfig:n,getRxToolTipConfig:()=>r.value}}(e,0,u),{handleBlur:x,handleFocus:f}=((e,l,r,n,a,c)=>{const i=h(),s=o.useDebounceFn((function(){i.handleSearchCallBack()}),1e3);return o.onClickOutside(n,(()=>{c.singleMode?l(!0):l(!1)})),t.watch((()=>a),(()=>{t.nextTick((()=>{e()}))}),{deep:!0}),{handleBlur:function(){s()},handleFocus:function(){l(!0),t.nextTick((()=>{var e,t;return null===(t=null===(e=r.value)||void 0===e?void 0:e.elInputRef)||void 0===t?void 0:t.focus()}))}}})(d,p,i,s,c,e);return{clickRef:c,useSearchValueLocal:n,rxInputRef:i,rxInputOutSideRef:s,rxFormItemRef:u,getRxToolTipConfig:m,setClickRef:p,isEmpty:a.isEmpty,handleBlur:x,handleFocus:f}}});const C={ref:"rxFormItemRef"},S={class:"flex items-center"},V={key:0,class:"flex items-center space-x-1"},v=t.createElementVNode("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]"},[t.createElementVNode("circle",{cx:"8",cy:"8",r:"4.1",stroke:"currentColor","stroke-width":"1.8"}),t.createElementVNode("path",{d:"M11 11L12.5 12.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1),R={class:"flex items-center space-x-1"},k={class:"text-[14px] leading-[22px] text-[#8B9199]"},y=t.createElementVNode("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]"},[t.createElementVNode("circle",{cx:"8",cy:"8",r:"4.1",stroke:"currentColor","stroke-width":"1.8"}),t.createElementVNode("path",{d:"M11 11L12.5 12.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1);g.render=function(e,o,l,r,n,a){const c=t.resolveComponent("Search"),i=t.resolveComponent("el-icon"),s=t.resolveComponent("RxInput"),u=t.resolveComponent("RxScrollbar"),p=t.resolveComponent("RxTooltip");return t.openBlock(),t.createElementBlock("div",C,[t.createCommentVNode(" 输入状态 "),e.clickRef?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"rxInputOutSideRef",class:t.normalizeClass(e.rxInputStyleCustom)},[t.createVNode(s,t.mergeProps({ref:"rxInputRef"},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":o[0]||(o[0]=t=>e.useSearchValueLocal=t),onBlur:e.handleBlur}),{prefix:t.withCtx((()=>[t.createElementVNode("div",S,[t.createVNode(i,{color:"#5C6781"},{default:t.withCtx((()=>[t.createVNode(c)])),_:1})])])),_:1},16,["modelValue","onBlur"])],2)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 极值、有值、hover/点击、无操作 "),t.createVNode(p,t.mergeProps({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:o[1]||(o[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]"},[t.createCommentVNode(" 值 "),e.isEmpty(e.useSearchValueLocal)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 标题 "),t.createElementVNode("div",R,[t.createElementVNode("p",k,t.toDisplayString(e.$attrs.label),1),y])],2112)):(t.openBlock(),t.createElementBlock("div",V,[t.createElementVNode("p",{class:t.normalizeClass(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.useSearchValueLocal),3),v]))])])),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.useSearchValueLocal),1)])),_:1},8,["max-height"])],4)])),_:1},16,["disabled"])],2112))],512)},g.__file="packages/components/RxFormPlusBeta/src/components/formInput/index.vue";const F={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 T=t.defineComponent({name:"RxFormPlusSelect",components:{RxTooltip:r.RxTooltip,RxScrollbar:n.RxScrollbar,RxFormSelect:s.RxFormSelect,ArrowDownBold:i.ArrowDownBold,ElIcon:c.ElIcon},props:F,setup(e,{attrs:l,emit:r}){const n=o.useVModel(e,"useSearchValue",r),{refFormSelectRef:c,rxSelectRef:s,rxFormItemRef:u,searchValueComputed:p,formSelectText:m,setPopoverStatus:d,getPopoverStatus:x,getRefFormSelect:f}=((e,o)=>{const l=t.ref(),r=t.ref(!1),n=t.ref(),c=t.ref(),i=t.computed((()=>a.map(e.useSearchValue,(e=>e.label)).toString())),s=t.computed((()=>o.multiple?`已选${e.useSearchValue.length}项`:e.useSearchValue[0].value));return{refFormSelectRef:l,rxSelectRef:n,rxFormItemRef:c,searchValueComputed:i,formSelectText:s,popoverStatus:r,setPopoverStatus:e=>r.value=e,getPopoverStatus:()=>r.value,getRefFormSelect:()=>l.value}})(e,l),{getRxToolTipConfig:g,updateRxToolTipConfig:C}=function(e,o){const l=t.ref();function r(){const{toolTipConfig:t}=e,r=o.value.getBoundingClientRect(),n={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:n})}return t.nextTick((()=>r())),{getRxToolTipConfig:()=>l.value,updateRxToolTipConfig:r}}(e,u),{handleSetCallBack:S,handleSetPopover:V}=((e,l,r)=>{const n=h(),a=o.useDebounceFn((function(){n.handleSearchCallBack()}),1e3);return t.nextTick((()=>{var e;o.onClickOutside(null===(e=l())||void 0===e?void 0:e.defaultSlotPopoverRef,(()=>{l().setVisiblePopover(!1)}))})),t.watch((()=>r.useSearchValue),(()=>{t.nextTick((()=>{e()})),a()}),{deep:!0}),{handleSetCallBack:function(e){r.multiple||l().setVisiblePopover(!1)},handleSetPopover:function(){l().setVisiblePopover(!0)}}})(C,f,e);return{refFormSelectRef:c,useSearchValueLocal:n,rxSelectRef:s,rxFormItemRef:u,searchValueComputed:p,formSelectText:m,ArrowDownBold:i.ArrowDownBold,getRxToolTipConfig:g,isEmpty:a.isEmpty,setPopoverStatus:d,getPopoverStatus:x,handleSetCallBack:S,handleSetPopover:V}}});const B={ref:"rxFormItemRef"},P={class:"text-[14px] leading-[22px] text-[#8B9199]"};T.render=function(e,o,l,r,n,a){const c=t.resolveComponent("ArrowDownBold"),i=t.resolveComponent("el-icon"),s=t.resolveComponent("RxFormSelect"),u=t.resolveComponent("RxScrollbar"),p=t.resolveComponent("RxTooltip");return t.openBlock(),t.createElementBlock("div",B,[t.createVNode(p,t.mergeProps({disabled:e.isEmpty(e.useSearchValueLocal)},e.getRxToolTipConfig()),{default:t.withCtx((()=>[t.createVNode(s,t.mergeProps({ref:"refFormSelectRef"},{...e.$attrs,...e.$props},{modelValue:e.useSearchValueLocal,"onUpdate:modelValue":o[1]||(o[1]=t=>e.useSearchValueLocal=t),onShow:o[2]||(o[2]=t=>e.setPopoverStatus(!0)),onHide:o[3]||(o[3]=t=>e.setPopoverStatus(!1)),onRxFormSelectClick:e.handleSetCallBack}),{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:o[0]||(o[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"},[t.createCommentVNode(" 值 "),e.isEmpty(e.useSearchValueLocal)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" 标题 "),t.createElementVNode("p",P,t.toDisplayString(e.$attrs.label),1)],2112)):(t.openBlock(),t.createElementBlock("p",{key:0,class:t.normalizeClass(["text-[14px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.formSelectText),3)),t.createVNode(i,{size:12,color:"#5C6781",class:"text-[#0F1114] group-hover:text-[#3370FF]"},{default:t.withCtx((()=>[t.createVNode(c,{class:t.normalizeClass(["transition",{"-rotate-180":e.getPopoverStatus()}])},null,8,["class"])])),_:1})])])),_:1},16,["modelValue","onRxFormSelectClick"])])),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)},T.__file="packages/components/RxFormPlusBeta/src/components/formSelect/index.vue";const w={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 E(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 N=t.defineComponent({name:"RxFormPlusDatePicker",components:{RxDatePicker:u.RxDatePicker,RxTooltip:r.RxTooltip,RxScrollbar:n.RxScrollbar},props:w,setup(e,{attrs:l,emit:r}){const n=o.useVModel(e,"useSearchValue",r),{rxDatePickerRef:c,rxDatePickerComponentsRef:i,rxFormItemRef:s,datePickerFormat:u}=((e,o)=>{const l=t.ref(),r=t.ref(),n=t.ref();return{rxDatePickerRef:l,datePickerFormat:t.computed((()=>E(e,o))),rxFormItemRef:r,rxDatePickerComponentsRef:n}})(e,l),{getRxToolTipConfig:p,updateRxToolTipConfig:m}=function(e,o,l){const r=t.ref();function n(){const{toolTipConfig:n}=e,{width:a}=l.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=E(e,o);r.value=Object.assign(Object.assign({},n),{style:c,content:i.value})}return t.nextTick((()=>n())),{getRxToolTipConfig:()=>r.value,updateRxToolTipConfig:n}}(e,l,s),{handleOpenRxDatePicker:d}=((e,l,r)=>{const n=h(),a=o.useDebounceFn((function(){n.handleSearchCallBack()}),1e3);return t.watch((()=>l.useSearchValue),(()=>{t.nextTick((()=>{e()})),a()}),{deep:!0}),{handleOpenRxDatePicker:function(){t.nextTick((()=>{r.value.rxDatePickerRef.focus()}))}}})(m,e,i);return{useSearchValueLocal:n,rxDatePickerRef:c,datePickerFormat:u,rxFormItemRef:s,rxDatePickerComponentsRef:i,getRxToolTipConfig:p,handleOpenRxDatePicker:d,isEmpty:a.isEmpty}}});const D={class:"w-0 h-0 overflow-hidden",ref:"rxDatePickerRef"},H={key:0,class:"flex items-center space-x-1"},I=t.createElementVNode("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]"},[t.createElementVNode("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),O={class:"text-[14px] leading-[22px] text-[#8B9199]"},L=t.createElementVNode("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]"},[t.createElementVNode("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);N.render=function(e,o,l,r,n,a){const c=t.resolveComponent("RxDatePicker"),i=t.resolveComponent("RxScrollbar"),s=t.resolveComponent("RxTooltip");return t.openBlock(),t.createBlock(s,t.normalizeProps(t.guardReactiveProps(e.getRxToolTipConfig())),{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:o[1]||(o[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"},[t.createCommentVNode(" 隐藏控件 "),t.createElementVNode("div",D,[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),L],64)):(t.openBlock(),t.createElementBlock("div",H,[t.createElementVNode("p",{class:t.normalizeClass(["text-[14px] leading-[22px] text-[#0F1114] group-hover:text-[#3370FF]",e.rxOutSideStyleCustom])},t.toDisplayString(e.datePickerFormat),3),I]))],512)])),content:t.withCtx((()=>[t.createElementVNode("div",{style:t.normalizeStyle(e.getRxToolTipConfig().style)},[t.createVNode(i,{"max-height":e.getRxToolTipConfig().style.maxHeight},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.datePickerFormat),1)])),_:1},8,["max-height"])],4)])),_:1},16)},N.__file="packages/components/RxFormPlusBeta/src/components/formDatePicker/index.vue";const _=new Map;function M(e,t){_.set(e,t)}M("RxFormPlusInput",g),M("RxFormPlusSelect",T),M("RxFormPlusDatePicker",N);var $={add:M,del:function(e){_.delete(e)},get:function(e){return e&&_.get(e)||e}},j=t.defineComponent({name:"FormComponent",props:m,setup(e,{emit:l}){const r=$.get(e.component),n=o.useVModel(e,"useSearchValue",l);return{componentLocal:r,componentPropsLocal:t.computed((()=>e.componentProps)),useSearchValueLocal:n}}});j.render=function(e,o,l,r,n,a){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.componentLocal),t.normalizeProps(t.guardReactiveProps({...e.$attrs,...e.$props,...e.componentPropsLocal})),null,16)},j.__file="packages/components/RxFormPlusBeta/src/components/formComponent/index.vue";var z=t.defineComponent({name:"RxFormPlusBeta",components:{FormComponent:j},props:p,emits:["handleSearch"],setup(e,{emit:t,expose:o}){const{handleSearchCallBack:l,getSearchValue:r}=((e,t)=>{const o=()=>({searchData:a.reduce(e.columns,((e,t)=>(t.useSearchValue&&t.prop&&(e[t.prop]=t.useSearchValue),e)),{})});return{handleSearchCallBack:()=>{t("handleSearch",o())},getSearchValue:o}})(e,t);return f({handleSearchCallBack:l}),o({handleSearchCallBack:l,getSearchValue:r}),{}}});z.render=function(e,o,l,r,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)},z.__file="packages/components/RxFormPlusBeta/src/RxFormPlusBeta.vue";const q=e.withInstall(z);exports.RxFormPlusBeta=q,exports.default=q;
@@ -1 +1,7 @@
1
- export declare const useRxFormColumns: () => {};
1
+ import type { RxFormPlusBetaPropsType } from '../RxFormPlusBeta';
2
+ export declare const useRxFormColumns: (props: RxFormPlusBetaPropsType, emit: (...args: any[]) => void) => {
3
+ handleSearchCallBack: () => void;
4
+ getSearchValue: () => {
5
+ searchData: any;
6
+ };
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rx-compo",
3
- "version": "1.0.84",
3
+ "version": "1.0.86",
4
4
  "private": false,
5
5
  "description": "components for ruixue",
6
6
  "main": "lib/index.js",