vxe-pc-ui 4.6.26 → 4.6.27

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.
Files changed (65) hide show
  1. package/es/button/src/button.js +8 -0
  2. package/es/color-picker/src/color-picker.js +8 -0
  3. package/es/date-picker/src/date-picker.js +8 -0
  4. package/es/date-range-picker/src/date-range-picker.js +8 -0
  5. package/es/icon/style.css +1 -1
  6. package/es/pulldown/src/pulldown.js +8 -0
  7. package/es/select/src/select.js +8 -0
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/table-select/src/table-select.js +8 -0
  11. package/es/tree-select/src/tree-select.js +8 -0
  12. package/es/ui/index.js +1 -1
  13. package/es/ui/src/dom.js +14 -11
  14. package/es/ui/src/log.js +1 -1
  15. package/lib/button/src/button.js +10 -0
  16. package/lib/button/src/button.min.js +1 -1
  17. package/lib/color-picker/src/color-picker.js +10 -0
  18. package/lib/color-picker/src/color-picker.min.js +1 -1
  19. package/lib/date-picker/src/date-picker.js +10 -0
  20. package/lib/date-picker/src/date-picker.min.js +1 -1
  21. package/lib/date-range-picker/src/date-range-picker.js +10 -0
  22. package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
  23. package/lib/icon/style/style.css +1 -1
  24. package/lib/icon/style/style.min.css +1 -1
  25. package/lib/index.umd.js +96 -13
  26. package/lib/index.umd.min.js +1 -1
  27. package/lib/pulldown/src/pulldown.js +10 -0
  28. package/lib/pulldown/src/pulldown.min.js +1 -1
  29. package/lib/select/src/select.js +10 -0
  30. package/lib/select/src/select.min.js +1 -1
  31. package/lib/style.css +1 -1
  32. package/lib/style.min.css +1 -1
  33. package/lib/table-select/src/table-select.js +10 -0
  34. package/lib/table-select/src/table-select.min.js +1 -1
  35. package/lib/tree-select/src/tree-select.js +10 -0
  36. package/lib/tree-select/src/tree-select.min.js +1 -1
  37. package/lib/ui/index.js +1 -1
  38. package/lib/ui/index.min.js +1 -1
  39. package/lib/ui/src/dom.js +14 -11
  40. package/lib/ui/src/dom.min.js +1 -1
  41. package/lib/ui/src/log.js +1 -1
  42. package/lib/ui/src/log.min.js +1 -1
  43. package/package.json +1 -1
  44. package/packages/button/src/button.ts +9 -0
  45. package/packages/color-picker/src/color-picker.ts +9 -0
  46. package/packages/date-picker/src/date-picker.ts +9 -0
  47. package/packages/date-range-picker/src/date-range-picker.ts +9 -0
  48. package/packages/pulldown/src/pulldown.ts +9 -0
  49. package/packages/select/src/select.ts +9 -0
  50. package/packages/table-select/src/table-select.ts +9 -0
  51. package/packages/tree-select/src/tree-select.ts +9 -0
  52. package/packages/ui/src/dom.ts +14 -11
  53. package/types/components/table.d.ts +28 -16
  54. /package/es/icon/{iconfont.1750240538007.ttf → iconfont.1750386624144.ttf} +0 -0
  55. /package/es/icon/{iconfont.1750240538007.woff → iconfont.1750386624144.woff} +0 -0
  56. /package/es/icon/{iconfont.1750240538007.woff2 → iconfont.1750386624144.woff2} +0 -0
  57. /package/es/{iconfont.1750240538007.ttf → iconfont.1750386624144.ttf} +0 -0
  58. /package/es/{iconfont.1750240538007.woff → iconfont.1750386624144.woff} +0 -0
  59. /package/es/{iconfont.1750240538007.woff2 → iconfont.1750386624144.woff2} +0 -0
  60. /package/lib/icon/style/{iconfont.1750240538007.ttf → iconfont.1750386624144.ttf} +0 -0
  61. /package/lib/icon/style/{iconfont.1750240538007.woff → iconfont.1750386624144.woff} +0 -0
  62. /package/lib/icon/style/{iconfont.1750240538007.woff2 → iconfont.1750386624144.woff2} +0 -0
  63. /package/lib/{iconfont.1750240538007.ttf → iconfont.1750386624144.ttf} +0 -0
  64. /package/lib/{iconfont.1750240538007.woff → iconfont.1750386624144.woff} +0 -0
  65. /package/lib/{iconfont.1750240538007.woff2 → iconfont.1750386624144.woff2} +0 -0
@@ -444,6 +444,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
444
444
  const handleGlobalBlurEvent = () => {
445
445
  hideOptionPanel();
446
446
  };
447
+ const handleGlobalResizeEvent = () => {
448
+ const {
449
+ visiblePanel
450
+ } = reactData;
451
+ if (visiblePanel) {
452
+ updatePlacement();
453
+ }
454
+ };
447
455
  const focusEvent = evnt => {
448
456
  const isDisabled = computeIsDisabled.value;
449
457
  if (!isDisabled) {
@@ -631,11 +639,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
631
639
  _ui.globalEvents.on($xeTableSelect, 'mousewheel', handleGlobalMousewheelEvent);
632
640
  _ui.globalEvents.on($xeTableSelect, 'mousedown', handleGlobalMousedownEvent);
633
641
  _ui.globalEvents.on($xeTableSelect, 'blur', handleGlobalBlurEvent);
642
+ _ui.globalEvents.on($xeTableSelect, 'resize', handleGlobalResizeEvent);
634
643
  });
635
644
  (0, _vue.onUnmounted)(() => {
636
645
  _ui.globalEvents.off($xeTableSelect, 'mousewheel');
637
646
  _ui.globalEvents.off($xeTableSelect, 'mousedown');
638
647
  _ui.globalEvents.off($xeTableSelect, 'blur');
648
+ _ui.globalEvents.off($xeTableSelect, 'resize');
639
649
  });
640
650
  (0, _vue.nextTick)(() => {
641
651
  if (!VxeTableGridComponent) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.getRowUniqueId=getRowUniqueId;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_utils=require("../../ui/src/utils"),_log=require("../../ui/src/log"),_input=_interopRequireDefault(require("../../input/src/input"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getRowUniqueId(){return _xeUtils.default.uniqueId("row_")}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableSelect",props:{modelValue:[String,Number,Array],clearable:Boolean,placeholder:{type:String,default:()=>_xeUtils.default.eqNull((0,_ui.getConfig)().tableSelect.placeholder)?(0,_ui.getI18n)("vxe.base.pleaseSelect"):(0,_ui.getConfig)().tableSelect.placeholder},readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},multiple:Boolean,className:[String,Function],prefixIcon:String,placement:String,columns:Array,options:Array,optionProps:Object,size:{type:String,default:()=>(0,_ui.getConfig)().select.size||(0,_ui.getConfig)().size},popupConfig:Object,gridConfig:Object,transfer:{type:Boolean,default:null}},emits:["update:modelValue","change","clear","blur","focus","click","form-submit","form-reset","form-collapse","page-change"],setup(h,e){const{emit:i,slots:C}=e,T=_ui.VxeUI.getComponent("VxeGrid"),t=(0,_vue.inject)("$xeModal",null),a=(0,_vue.inject)("$xeDrawer",null),u=(0,_vue.inject)("$xeTable",null),o=(0,_vue.inject)("$xeForm",null),n=(0,_vue.inject)("xeFormItemInfo",null);var l=_xeUtils.default.uniqueId();const L=(0,_ui.useSize)(h)["computeSize"],E=(0,_vue.ref)(),k=(0,_vue.ref)(),z=(0,_vue.ref)(),y=(0,_vue.ref)(),w=(0,_vue.ref)(),I=(0,_vue.reactive)({initialized:!1,tableColumns:[],fullOptionList:[],fullRowMaps:{},panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1}),r={},N={refElem:E},$=(0,_vue.computed)(()=>{var e=h["readonly"];return null===e?!!o&&o.props.readonly:e}),S=(0,_vue.computed)(()=>{var e=h["disabled"];return null===e?!!o&&o.props.disabled:e}),P=(0,_vue.computed)(()=>{var e=h["transfer"];if(null===e){var l=(0,_ui.getConfig)().select.transfer;if(_xeUtils.default.isBoolean(l))return l;if(u||t||a||o)return!0}return e}),s=(0,_vue.computed)(()=>h.optionProps||{}),q=(0,_vue.computed)(()=>{var e=U.value;return Object.assign({},e.rowConfig,{isCurrent:!0})}),v=(0,_vue.computed)(()=>{return q.value.keyField||"_X_ROW_KEY"}),F=(0,_vue.computed)(()=>{return s.value.label||"label"}),c=(0,_vue.computed)(()=>{return s.value.value||"value"}),R=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().tableSelect.popupConfig,h.popupConfig)),U=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().tableSelect.gridConfig,h.gridConfig,{data:void 0,columns:void 0})),B=(0,_vue.computed)(()=>{var e=h["modelValue"];const t=I["fullRowMaps"],a=F.value;return(_xeUtils.default.isArray(e)?e:[e]).map(e=>{var l=t[e];return l?l.item[a]:e}).join(", ")}),M=(0,_vue.computed)(()=>{var{height:e,width:l}=R.value,t={};return l&&(t.width=(0,_dom.toCssUnit)(l)),e&&(t.height=(0,_dom.toCssUnit)(e)),t}),D={},A={xID:l,props:h,context:e,reactData:I,getRefMaps:()=>N,getComputeMaps:()=>D};const O={},d=(["form-submit","form-reset","form-collapse","page-change"].forEach(l=>{O[(0,_vn.getOnName)(_xeUtils.default.camelCase(l))]=e=>{d(l,e,e.$event)}}),(e,l,t)=>{i(e,(0,_ui.createEvent)(t,{$tableSelect:A},l))});l={dispatchEvent:d};const K=e=>{const l=I["fullRowMaps"],t=[];return(_xeUtils.default.eqNull(e)?[]:_xeUtils.default.isArray(e)?e:[e]).forEach(e=>{e=l[e];e&&t.push(e.item)}),t},p=t=>{const a=h["multiple"];(0,_vue.nextTick)(()=>{var e,l=w.value;l&&(e=K(t)).length&&(a?l.setCheckboxRow(e,!0):l.setRadioRow(e[0]))})},_=e=>{var l=h["multiple"],t=[];t.push(l?{type:"checkbox",width:70}:{type:"radio",width:70}),I.tableColumns=t.concat(e||[])},m=()=>{var e=h["options"];const u=v.value,o=c.value;var l=U.value["treeConfig"];const n={},r={};l||_xeUtils.default.arrayEach(e||[],(e,l,t)=>{let a=(e=>{e=e[v.value];return e?encodeURIComponent(e):""})(e);a=a||getRowUniqueId(),r[a]&&(0,_log.errLog)("vxe.error.repeatKey",[u,a]),r[a]=!0;var i=e[o];n[i]&&(0,_log.errLog)("vxe.error.repeatKey",[o,i]),n[i]={item:e,index:l,items:t,parent:null,nodes:[]}}),I.fullOptionList=e||[],I.fullRowMaps=n,p(h.modelValue)},g=()=>{const t=h["placement"],a=I["panelIndex"],i=E.value,u=y.value,o=P.value;var e=()=>{var e=(0,_dom.updatePanelPlacement)(i,u,{placement:t,teleportTo:o}),l=Object.assign(e.style,{zIndex:a});I.panelStyle=l,I.panelPlacement=e.placement};return e(),(0,_vue.nextTick)().then(e)},f=()=>{var e=h["loading"],l=S.value;e||l||(r.vpTimeout&&clearTimeout(r.vpTimeout),r.hpTimeout&&clearTimeout(r.hpTimeout),I.initialized||(I.initialized=!0),I.isActivated=!0,I.isAniVisible=!0,r.vpTimeout=setTimeout(()=>{I.visiblePanel=!0,p(h.modelValue),r.vpTimeout=void 0},10),I.panelIndex<(0,_utils.getLastZIndex)()&&(I.panelIndex=(0,_utils.nextZIndex)()),g())},b=()=>{I.visiblePanel=!1,r.vpTimeout&&clearTimeout(r.vpTimeout),r.hpTimeout&&clearTimeout(r.hpTimeout),r.hpTimeout=setTimeout(()=>{I.isAniVisible=!1,r.hpTimeout=void 0},350)},x=(e,l)=>{var t,a=I["fullRowMaps"];t=l,i("update:modelValue",t),l!==h.modelValue&&(t=a[l],d("change",{value:l,row:t?t.item:null},e),o)&&n&&o.triggerItemEvent(e,n.itemConfig.field,l)},Z=(e,l)=>{x(e,l),d("clear",{value:l},e)},G=(e,l)=>{Z(l,null),b()},W=e=>{var l=I["visiblePanel"];S.value||l&&(l=y.value,((0,_dom.getEventTargetNode)(e,l).flag?g:b)())},X=e=>{var l,t,a=I["visiblePanel"];S.value||(l=E.value,t=y.value,I.isActivated=(0,_dom.getEventTargetNode)(e,l).flag||(0,_dom.getEventTargetNode)(e,t).flag,a&&!I.isActivated&&b())},Y=()=>{b()},H=e=>{S.value||I.visiblePanel||(I.triggerFocusPanel=!0,f(),setTimeout(()=>{I.triggerFocusPanel=!1},150)),d("focus",{},e)},J=e=>{j(e),d("click",{},e)},Q=e=>{I.isActivated=!1,d("blur",{},e)},j=e=>{e=e.$event;e.preventDefault(),I.triggerFocusPanel?I.triggerFocusPanel=!1:(I.visiblePanel?b:f)()},ee=e=>{var{$event:e,row:l}=e,l=l[c.value];x(e,l),b()},V=e=>{var{$grid:e,$event:l}=e;const t=c.value;e&&(e=e.getCheckboxRecords().map(e=>e[t]),x(l,e))},le=e=>{V(e)};Object.assign(A,l,{});return(0,_vue.watch)(()=>h.options,()=>{m()}),(0,_vue.watch)(()=>h.columns,e=>{_(e||[])}),(0,_vue.watch)(()=>h.modelValue,e=>{p(e)}),_(h.columns||[]),m(),(0,_vue.onMounted)(()=>{_ui.globalEvents.on(A,"mousewheel",W),_ui.globalEvents.on(A,"mousedown",X),_ui.globalEvents.on(A,"blur",Y)}),(0,_vue.onUnmounted)(()=>{_ui.globalEvents.off(A,"mousewheel"),_ui.globalEvents.off(A,"mousedown"),_ui.globalEvents.off(A,"blur")}),(0,_vue.nextTick)(()=>{T||(0,_log.errLog)("vxe.error.reqComp",["vxe-grid"])}),(0,_vue.provide)("$xeTableSelect",A),A.renderVN=()=>{var{className:e,options:l,loading:t}=h,{initialized:a,isActivated:i,isAniVisible:u,visiblePanel:o,tableColumns:n}=I,r=L.value,s=S.value,v=B.value,c=P.value,d=$.value,p=R.value["className"],_=U.value,m=q.value,g=M.value,f=C.header,b=C.footer;const x=C.prefix;return d?(0,_vue.h)("div",{ref:E,class:["vxe-table-select--readonly",e]},[(0,_vue.h)("span",{class:"vxe-table-select-label"},v)]):(0,_vue.h)("div",{ref:E,class:["vxe-table-select",e?_xeUtils.default.isFunction(e)?e({$tableSelect:A}):e:"",{["size--"+r]:r,"is--visible":o,"is--disabled":s,"is--loading":t,"is--active":i}]},[(0,_vue.h)(_input.default,{ref:k,clearable:h.clearable,placeholder:t?(0,_ui.getI18n)("vxe.select.loadingText"):h.placeholder,readonly:!0,disabled:s,type:"text",prefixIcon:h.prefixIcon,suffixIcon:t?(0,_ui.getIcon)().TABLE_SELECT_LOADED:o?(0,_ui.getIcon)().TABLE_SELECT_OPEN:(0,_ui.getIcon)().TABLE_SELECT_CLOSE,modelValue:t?"":v,onClear:G,onClick:J,onFocus:H,onBlur:Q,onSuffixClick:j},x?{prefix:()=>x({})}:{}),(0,_vue.h)(_vue.Teleport,{to:"body",disabled:!c||!a},[(0,_vue.h)("div",{ref:y,class:["vxe-table--ignore-clear vxe-table-select--panel",p?_xeUtils.default.isFunction(p)?p({$tableSelect:A}):p:"",{["size--"+r]:r,"is--transfer":c,"ani--leave":!t&&u,"ani--enter":!t&&o}],placement:I.panelPlacement,style:I.panelStyle},a?[(0,_vue.h)("div",{class:"vxe-table-select--panel-wrapper"},[f?(0,_vue.h)("div",{class:"vxe-table-select--panel-header"},f({})):(0,_ui.renderEmptyElement)(A),(0,_vue.h)("div",{class:"vxe-table-select--panel-body"},[(0,_vue.h)("div",{ref:z,class:"vxe-table-select-grid--wrapper",style:g},[T?(0,_vue.h)(T,Object.assign(Object.assign(Object.assign({},_),O),{class:"vxe-table-select--grid",ref:w,rowConfig:m,data:l,columns:n,height:"100%",autoResize:!0,onRadioChange:ee,onCheckboxChange:V,onCheckboxAll:le}),Object.assign({},C,{header:void 0,footer:void 0,prefixSlot:void 0})):(0,_ui.renderEmptyElement)(A)])]),b?(0,_vue.h)("div",{class:"vxe-table-select--panel-footer"},b({})):(0,_ui.renderEmptyElement)(A)])]:[])])])},A},render(){return this.renderVN()}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.getRowUniqueId=getRowUniqueId;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_utils=require("../../ui/src/utils"),_log=require("../../ui/src/log"),_input=_interopRequireDefault(require("../../input/src/input"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getRowUniqueId(){return _xeUtils.default.uniqueId("row_")}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableSelect",props:{modelValue:[String,Number,Array],clearable:Boolean,placeholder:{type:String,default:()=>_xeUtils.default.eqNull((0,_ui.getConfig)().tableSelect.placeholder)?(0,_ui.getI18n)("vxe.base.pleaseSelect"):(0,_ui.getConfig)().tableSelect.placeholder},readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},multiple:Boolean,className:[String,Function],prefixIcon:String,placement:String,columns:Array,options:Array,optionProps:Object,size:{type:String,default:()=>(0,_ui.getConfig)().select.size||(0,_ui.getConfig)().size},popupConfig:Object,gridConfig:Object,transfer:{type:Boolean,default:null}},emits:["update:modelValue","change","clear","blur","focus","click","form-submit","form-reset","form-collapse","page-change"],setup(h,e){const{emit:i,slots:C}=e,E=_ui.VxeUI.getComponent("VxeGrid"),t=(0,_vue.inject)("$xeModal",null),a=(0,_vue.inject)("$xeDrawer",null),u=(0,_vue.inject)("$xeTable",null),o=(0,_vue.inject)("$xeForm",null),n=(0,_vue.inject)("xeFormItemInfo",null);var l=_xeUtils.default.uniqueId();const z=(0,_ui.useSize)(h)["computeSize"],T=(0,_vue.ref)(),L=(0,_vue.ref)(),k=(0,_vue.ref)(),y=(0,_vue.ref)(),w=(0,_vue.ref)(),I=(0,_vue.reactive)({initialized:!1,tableColumns:[],fullOptionList:[],fullRowMaps:{},panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1}),r={},N={refElem:T},$=(0,_vue.computed)(()=>{var e=h["readonly"];return null===e?!!o&&o.props.readonly:e}),S=(0,_vue.computed)(()=>{var e=h["disabled"];return null===e?!!o&&o.props.disabled:e}),P=(0,_vue.computed)(()=>{var e=h["transfer"];if(null===e){var l=(0,_ui.getConfig)().select.transfer;if(_xeUtils.default.isBoolean(l))return l;if(u||t||a||o)return!0}return e}),s=(0,_vue.computed)(()=>h.optionProps||{}),q=(0,_vue.computed)(()=>{var e=U.value;return Object.assign({},e.rowConfig,{isCurrent:!0})}),v=(0,_vue.computed)(()=>{return q.value.keyField||"_X_ROW_KEY"}),F=(0,_vue.computed)(()=>{return s.value.label||"label"}),c=(0,_vue.computed)(()=>{return s.value.value||"value"}),R=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().tableSelect.popupConfig,h.popupConfig)),U=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().tableSelect.gridConfig,h.gridConfig,{data:void 0,columns:void 0})),B=(0,_vue.computed)(()=>{var e=h["modelValue"];const t=I["fullRowMaps"],a=F.value;return(_xeUtils.default.isArray(e)?e:[e]).map(e=>{var l=t[e];return l?l.item[a]:e}).join(", ")}),M=(0,_vue.computed)(()=>{var{height:e,width:l}=R.value,t={};return l&&(t.width=(0,_dom.toCssUnit)(l)),e&&(t.height=(0,_dom.toCssUnit)(e)),t}),D={},A={xID:l,props:h,context:e,reactData:I,getRefMaps:()=>N,getComputeMaps:()=>D};const O={},d=(["form-submit","form-reset","form-collapse","page-change"].forEach(l=>{O[(0,_vn.getOnName)(_xeUtils.default.camelCase(l))]=e=>{d(l,e,e.$event)}}),(e,l,t)=>{i(e,(0,_ui.createEvent)(t,{$tableSelect:A},l))});l={dispatchEvent:d};const K=e=>{const l=I["fullRowMaps"],t=[];return(_xeUtils.default.eqNull(e)?[]:_xeUtils.default.isArray(e)?e:[e]).forEach(e=>{e=l[e];e&&t.push(e.item)}),t},p=t=>{const a=h["multiple"];(0,_vue.nextTick)(()=>{var e,l=w.value;l&&(e=K(t)).length&&(a?l.setCheckboxRow(e,!0):l.setRadioRow(e[0]))})},_=e=>{var l=h["multiple"],t=[];t.push(l?{type:"checkbox",width:70}:{type:"radio",width:70}),I.tableColumns=t.concat(e||[])},m=()=>{var e=h["options"];const u=v.value,o=c.value;var l=U.value["treeConfig"];const n={},r={};l||_xeUtils.default.arrayEach(e||[],(e,l,t)=>{let a=(e=>{e=e[v.value];return e?encodeURIComponent(e):""})(e);a=a||getRowUniqueId(),r[a]&&(0,_log.errLog)("vxe.error.repeatKey",[u,a]),r[a]=!0;var i=e[o];n[i]&&(0,_log.errLog)("vxe.error.repeatKey",[o,i]),n[i]={item:e,index:l,items:t,parent:null,nodes:[]}}),I.fullOptionList=e||[],I.fullRowMaps=n,p(h.modelValue)},g=()=>{const t=h["placement"],a=I["panelIndex"],i=T.value,u=y.value,o=P.value;var e=()=>{var e=(0,_dom.updatePanelPlacement)(i,u,{placement:t,teleportTo:o}),l=Object.assign(e.style,{zIndex:a});I.panelStyle=l,I.panelPlacement=e.placement};return e(),(0,_vue.nextTick)().then(e)},f=()=>{var e=h["loading"],l=S.value;e||l||(r.vpTimeout&&clearTimeout(r.vpTimeout),r.hpTimeout&&clearTimeout(r.hpTimeout),I.initialized||(I.initialized=!0),I.isActivated=!0,I.isAniVisible=!0,r.vpTimeout=setTimeout(()=>{I.visiblePanel=!0,p(h.modelValue),r.vpTimeout=void 0},10),I.panelIndex<(0,_utils.getLastZIndex)()&&(I.panelIndex=(0,_utils.nextZIndex)()),g())},b=()=>{I.visiblePanel=!1,r.vpTimeout&&clearTimeout(r.vpTimeout),r.hpTimeout&&clearTimeout(r.hpTimeout),r.hpTimeout=setTimeout(()=>{I.isAniVisible=!1,r.hpTimeout=void 0},350)},x=(e,l)=>{var t,a=I["fullRowMaps"];t=l,i("update:modelValue",t),l!==h.modelValue&&(t=a[l],d("change",{value:l,row:t?t.item:null},e),o)&&n&&o.triggerItemEvent(e,n.itemConfig.field,l)},Z=(e,l)=>{x(e,l),d("clear",{value:l},e)},G=(e,l)=>{Z(l,null),b()},W=e=>{var l=I["visiblePanel"];S.value||l&&(l=y.value,((0,_dom.getEventTargetNode)(e,l).flag?g:b)())},X=e=>{var l,t,a=I["visiblePanel"];S.value||(l=T.value,t=y.value,I.isActivated=(0,_dom.getEventTargetNode)(e,l).flag||(0,_dom.getEventTargetNode)(e,t).flag,a&&!I.isActivated&&b())},Y=()=>{b()},H=()=>{var e=I["visiblePanel"];e&&g()},J=e=>{S.value||I.visiblePanel||(I.triggerFocusPanel=!0,f(),setTimeout(()=>{I.triggerFocusPanel=!1},150)),d("focus",{},e)},Q=e=>{j(e),d("click",{},e)},ee=e=>{I.isActivated=!1,d("blur",{},e)},j=e=>{e=e.$event;e.preventDefault(),I.triggerFocusPanel?I.triggerFocusPanel=!1:(I.visiblePanel?b:f)()},le=e=>{var{$event:e,row:l}=e,l=l[c.value];x(e,l),b()},V=e=>{var{$grid:e,$event:l}=e;const t=c.value;e&&(e=e.getCheckboxRecords().map(e=>e[t]),x(l,e))},te=e=>{V(e)};Object.assign(A,l,{});return(0,_vue.watch)(()=>h.options,()=>{m()}),(0,_vue.watch)(()=>h.columns,e=>{_(e||[])}),(0,_vue.watch)(()=>h.modelValue,e=>{p(e)}),_(h.columns||[]),m(),(0,_vue.onMounted)(()=>{_ui.globalEvents.on(A,"mousewheel",W),_ui.globalEvents.on(A,"mousedown",X),_ui.globalEvents.on(A,"blur",Y),_ui.globalEvents.on(A,"resize",H)}),(0,_vue.onUnmounted)(()=>{_ui.globalEvents.off(A,"mousewheel"),_ui.globalEvents.off(A,"mousedown"),_ui.globalEvents.off(A,"blur"),_ui.globalEvents.off(A,"resize")}),(0,_vue.nextTick)(()=>{E||(0,_log.errLog)("vxe.error.reqComp",["vxe-grid"])}),(0,_vue.provide)("$xeTableSelect",A),A.renderVN=()=>{var{className:e,options:l,loading:t}=h,{initialized:a,isActivated:i,isAniVisible:u,visiblePanel:o,tableColumns:n}=I,r=z.value,s=S.value,v=B.value,c=P.value,d=$.value,p=R.value["className"],_=U.value,m=q.value,g=M.value,f=C.header,b=C.footer;const x=C.prefix;return d?(0,_vue.h)("div",{ref:T,class:["vxe-table-select--readonly",e]},[(0,_vue.h)("span",{class:"vxe-table-select-label"},v)]):(0,_vue.h)("div",{ref:T,class:["vxe-table-select",e?_xeUtils.default.isFunction(e)?e({$tableSelect:A}):e:"",{["size--"+r]:r,"is--visible":o,"is--disabled":s,"is--loading":t,"is--active":i}]},[(0,_vue.h)(_input.default,{ref:L,clearable:h.clearable,placeholder:t?(0,_ui.getI18n)("vxe.select.loadingText"):h.placeholder,readonly:!0,disabled:s,type:"text",prefixIcon:h.prefixIcon,suffixIcon:t?(0,_ui.getIcon)().TABLE_SELECT_LOADED:o?(0,_ui.getIcon)().TABLE_SELECT_OPEN:(0,_ui.getIcon)().TABLE_SELECT_CLOSE,modelValue:t?"":v,onClear:G,onClick:Q,onFocus:J,onBlur:ee,onSuffixClick:j},x?{prefix:()=>x({})}:{}),(0,_vue.h)(_vue.Teleport,{to:"body",disabled:!c||!a},[(0,_vue.h)("div",{ref:y,class:["vxe-table--ignore-clear vxe-table-select--panel",p?_xeUtils.default.isFunction(p)?p({$tableSelect:A}):p:"",{["size--"+r]:r,"is--transfer":c,"ani--leave":!t&&u,"ani--enter":!t&&o}],placement:I.panelPlacement,style:I.panelStyle},a?[(0,_vue.h)("div",{class:"vxe-table-select--panel-wrapper"},[f?(0,_vue.h)("div",{class:"vxe-table-select--panel-header"},f({})):(0,_ui.renderEmptyElement)(A),(0,_vue.h)("div",{class:"vxe-table-select--panel-body"},[(0,_vue.h)("div",{ref:k,class:"vxe-table-select-grid--wrapper",style:g},[E?(0,_vue.h)(E,Object.assign(Object.assign(Object.assign({},_),O),{class:"vxe-table-select--grid",ref:w,rowConfig:m,data:l,columns:n,height:"100%",autoResize:!0,onRadioChange:le,onCheckboxChange:V,onCheckboxAll:te}),Object.assign({},C,{header:void 0,footer:void 0,prefixSlot:void 0})):(0,_ui.renderEmptyElement)(A)])]),b?(0,_vue.h)("div",{class:"vxe-table-select--panel-footer"},b({})):(0,_ui.renderEmptyElement)(A)])]:[])])])},A},render(){return this.renderVN()}});
@@ -392,6 +392,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
392
392
  const handleGlobalBlurEvent = () => {
393
393
  hideOptionPanel();
394
394
  };
395
+ const handleGlobalResizeEvent = () => {
396
+ const {
397
+ visiblePanel
398
+ } = reactData;
399
+ if (visiblePanel) {
400
+ updatePlacement();
401
+ }
402
+ };
395
403
  const focusEvent = evnt => {
396
404
  const isDisabled = computeIsDisabled.value;
397
405
  if (!isDisabled) {
@@ -595,11 +603,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
595
603
  _ui.globalEvents.on($xeTreeSelect, 'mousewheel', handleGlobalMousewheelEvent);
596
604
  _ui.globalEvents.on($xeTreeSelect, 'mousedown', handleGlobalMousedownEvent);
597
605
  _ui.globalEvents.on($xeTreeSelect, 'blur', handleGlobalBlurEvent);
606
+ _ui.globalEvents.on($xeTreeSelect, 'resize', handleGlobalResizeEvent);
598
607
  });
599
608
  (0, _vue.onUnmounted)(() => {
600
609
  _ui.globalEvents.off($xeTreeSelect, 'mousewheel');
601
610
  _ui.globalEvents.off($xeTreeSelect, 'mousedown');
602
611
  _ui.globalEvents.off($xeTreeSelect, 'blur');
612
+ _ui.globalEvents.off($xeTreeSelect, 'resize');
603
613
  });
604
614
  (0, _vue.provide)('$xeTreeSelect', $xeTreeSelect);
605
615
  $xeTreeSelect.renderVN = renderVN;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_log=require("../../ui/src/log"),_xeUtils=_interopRequireDefault(require("xe-utils")),_input=_interopRequireDefault(require("../../input/src/input")),_tree=_interopRequireDefault(require("../../tree/src/tree"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getOptUniqueId(){return _xeUtils.default.uniqueId("node_")}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTreeSelect",props:{modelValue:[String,Number,Array],clearable:Boolean,placeholder:{type:String,default:()=>_xeUtils.default.eqNull((0,_ui.getConfig)().treeSelect.placeholder)?(0,_ui.getI18n)("vxe.base.pleaseSelect"):(0,_ui.getConfig)().treeSelect.placeholder},readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},multiple:Boolean,className:[String,Function],popupClassName:[String,Function],prefixIcon:String,placement:String,options:Array,optionProps:Object,size:{type:String,default:()=>(0,_ui.getConfig)().select.size||(0,_ui.getConfig)().size},remote:Boolean,remoteMethod:Function,popupConfig:Object,treeConfig:Object,transfer:{type:Boolean,default:null}},emits:["update:modelValue","change","clear","blur","focus","click","node-click"],setup(w,e){const{emit:a,slots:N}=e,t=(0,_vue.inject)("$xeModal",null),i=(0,_vue.inject)("$xeDrawer",null),n=(0,_vue.inject)("$xeTable",null),o=(0,_vue.inject)("$xeForm",null),u=(0,_vue.inject)("xeFormItemInfo",null);var l=_xeUtils.default.uniqueId();const O=(0,_ui.useSize)(w)["computeSize"],q=(0,_vue.ref)(),j=(0,_vue.ref)(),k=(0,_vue.ref)(),A=(0,_vue.ref)(),U=(0,_vue.reactive)({initialized:!1,fullOptionList:[],fullNodeMaps:{},panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1}),r={hpTimeout:void 0},s={refElem:q},L=(0,_vue.computed)(()=>{var e=w["readonly"];return null===e?!!o&&o.props.readonly:e}),M=(0,_vue.computed)(()=>{var e=w["disabled"];return null===e?!!o&&o.props.disabled:e}),V=(0,_vue.computed)(()=>{var e=w["transfer"];if(null===e){var l=(0,_ui.getConfig)().select.transfer;if(_xeUtils.default.isBoolean(l))return l;if(n||t||i||o)return!0}return e}),z=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().treeSelect.popupConfig,w.popupConfig)),R=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().treeSelect.treeConfig,w.treeConfig,{data:void 0})),G=(0,_vue.computed)(()=>{var e=R.value;return Object.assign({isHover:!0},e.nodeConfig)}),J=(0,_vue.computed)(()=>{var e=R.value;return Object.assign({showIcon:!!e.showCheckbox},e.checkboxConfig,{trigger:"node"})}),Q=(0,_vue.computed)(()=>{var e=R.value;return Object.assign({showIcon:!!e.showRadio},e.radioConfig,{trigger:"node"})}),d=(0,_vue.computed)(()=>w.optionProps||{}),$=(0,_vue.computed)(()=>{return R.value.keyField||"id"}),D=(0,_vue.computed)(()=>{return d.value.label||"label"}),B=(0,_vue.computed)(()=>{return d.value.value||"value"}),K=(0,_vue.computed)(()=>{return d.value.children||"children"}),W=(0,_vue.computed)(()=>{return d.value.parent||"parentField"}),X=(0,_vue.computed)(()=>{return d.value.hasChild||"hasChild"}),Y=(0,_vue.computed)(()=>{var e=w["modelValue"];const t=U["fullNodeMaps"],i=D.value;return(_xeUtils.default.isArray(e)?e:[e]).map(e=>{var l=t[e];return l?l.item[i]:e}).join(", ")}),ee=(0,_vue.computed)(()=>{var{height:e,width:l}=z.value,t={};return l&&(t.width=(0,_dom.toCssUnit)(l)),e&&(t.height=(0,_dom.toCssUnit)(e),t.maxHeight=(0,_dom.toCssUnit)(e)),t}),m={},H={xID:l,props:w,context:e,reactData:U,internalData:r,getRefMaps:()=>s,getComputeMaps:()=>m},c=(e,l,t)=>{a(e,(0,_ui.createEvent)(t,{$treeSelect:H},l))};l={dispatchEvent:c};const v=()=>{var e=w["options"];const r=$.value;var l=K.value;const s=B.value,d={},c={};_xeUtils.default.eachTree(e,(e,l,t,i,a,n)=>{let o=(e=>{e=e[$.value];return e?encodeURIComponent(e):""})(e);o=o||getOptUniqueId(),c[o]&&(0,_log.errLog)("vxe.error.repeatKey",[r,o]),c[o]=!0;var u=e[s];d[u]&&(0,_log.errLog)("vxe.error.repeatKey",[s,u]),d[u]={item:e,index:l,items:t,parent:a,nodes:n}},{children:l}),U.fullOptionList=e||[],U.fullNodeMaps=d},p=()=>{const t=w["placement"],i=U["panelIndex"],a=q.value,n=A.value,o=V.value;var e=()=>{var e=(0,_dom.updatePanelPlacement)(a,n,{placement:t,teleportTo:o}),l=Object.assign(e.style,{zIndex:i});U.panelStyle=l,U.panelPlacement=e.placement};return e(),(0,_vue.nextTick)().then(e)},_=()=>{var e=w["loading"],l=M.value;e||l||(clearTimeout(r.hpTimeout),U.initialized||(U.initialized=!0),U.isActivated=!0,U.isAniVisible=!0,setTimeout(()=>{U.visiblePanel=!0},10),U.panelIndex<(0,_utils.getLastZIndex)()&&(U.panelIndex=(0,_utils.nextZIndex)()),p())},g=()=>{U.visiblePanel=!1,r.hpTimeout=setTimeout(()=>{U.isAniVisible=!1},350)},f=(e,l)=>{var t,i=U["fullNodeMaps"];t=l,a("update:modelValue",t),l!==w.modelValue&&(t=i[l],c("change",{value:l,option:t?t.item:null},e),o)&&u&&o.triggerItemEvent(e,u.itemConfig.field,l)},h=(e,l)=>{f(e,l),c("clear",{value:l},e)},le=(e,l)=>{h(l,null),g()},x=e=>{var l=U["visiblePanel"];M.value||l&&(l=A.value,((0,_dom.getEventTargetNode)(e,l).flag?p:g)())},b=e=>{var l,t,i=U["visiblePanel"];M.value||(l=q.value,t=A.value,U.isActivated=(0,_dom.getEventTargetNode)(e,l).flag||(0,_dom.getEventTargetNode)(e,t).flag,i&&!U.isActivated&&g())},C=()=>{g()},te=e=>{M.value||U.visiblePanel||(U.triggerFocusPanel=!0,_(),setTimeout(()=>{U.triggerFocusPanel=!1},150)),c("focus",{},e)},ie=e=>{Z(e),c("click",{},e)},ae=e=>{U.isActivated=!1,c("blur",{},e)},Z=e=>{e=e.$event;e.preventDefault(),U.triggerFocusPanel?U.triggerFocusPanel=!1:(U.visiblePanel?g:_)()},ne=e=>{var l=e["$event"];c("node-click",e,l)},oe=e=>{var{value:e,$event:l}=e;f(l,e),g()},ue=e=>{var{value:e,$event:l}=e;f(l,e)},re=()=>{v()};Object.assign(H,l,{});return(0,_vue.watch)(()=>w.options,()=>{v()}),v(),(0,_vue.onMounted)(()=>{_ui.globalEvents.on(H,"mousewheel",x),_ui.globalEvents.on(H,"mousedown",b),_ui.globalEvents.on(H,"blur",C)}),(0,_vue.onUnmounted)(()=>{_ui.globalEvents.off(H,"mousewheel"),_ui.globalEvents.off(H,"mousedown"),_ui.globalEvents.off(H,"blur")}),(0,_vue.provide)("$xeTreeSelect",H),H.renderVN=()=>{var{className:e,modelValue:l,multiple:t,options:i,loading:a}=w,{initialized:n,isActivated:o,isAniVisible:u,visiblePanel:r}=U,s=O.value,d=M.value,c=Y.value,v=V.value,p=L.value,_=ee.value,g=N.header,f=N.footer;const m=N.prefix;var h=z.value.className||w.popupClassName,x=R.value,b=G.value,C=J.value,y=Q.value,E=$.value,I=D.value,S=B.value,F=K.value,T=W.value,P=X.value;return p?(0,_vue.h)("div",{ref:q,class:["vxe-tree-select--readonly",e]},[(0,_vue.h)("span",{class:"vxe-tree-select-label"},c)]):(0,_vue.h)("div",{ref:q,class:["vxe-tree-select",e?_xeUtils.default.isFunction(e)?e({$treeSelect:H}):e:"",{["size--"+s]:s,"is--visible":r,"is--disabled":d,"is--loading":a,"is--active":o}]},[(0,_vue.h)(_input.default,{ref:j,clearable:w.clearable,placeholder:a?(0,_ui.getI18n)("vxe.select.loadingText"):w.placeholder,readonly:!0,disabled:d,type:"text",prefixIcon:w.prefixIcon,suffixIcon:a?(0,_ui.getIcon)().TREE_SELECT_LOADED:r?(0,_ui.getIcon)().TREE_SELECT_OPEN:(0,_ui.getIcon)().TREE_SELECT_CLOSE,modelValue:a?"":c,onClear:le,onClick:ie,onFocus:te,onBlur:ae,onSuffixClick:Z},m?{prefix:()=>m({})}:{}),(0,_vue.h)(_vue.Teleport,{to:"body",disabled:!v||!n},[(0,_vue.h)("div",{ref:A,class:["vxe-table--ignore-clear vxe-tree-select--panel",h?_xeUtils.default.isFunction(h)?h({$treeSelect:H}):h:"",{["size--"+s]:s,"is--transfer":v,"ani--leave":!a&&u,"ani--enter":!a&&r}],placement:U.panelPlacement,style:U.panelStyle},n?[(0,_vue.h)("div",{class:"vxe-tree-select--panel-wrapper"},[g?(0,_vue.h)("div",{class:"vxe-tree-select--panel-header"},g({})):(0,_ui.renderEmptyElement)(H),(0,_vue.h)("div",{class:"vxe-tree-select--panel-body"},[(0,_vue.h)("div",{ref:k,class:"vxe-tree-select-tree--wrapper",style:_},[(0,_vue.h)(_tree.default,{class:"vxe-tree-select--tree",data:i,indent:x.indent,showRadio:!t,radioConfig:y,checkNodeKey:t?null:l,showCheckbox:!!t,checkNodeKeys:t?l:null,checkboxConfig:C,titleField:I,valueField:S,keyField:E,childrenField:x.childrenField||F,parentField:x.parentField||T,hasChildField:x.hasChildField||P,accordion:x.accordion,expandAll:x.expandAll,nodeConfig:b,lazy:x.lazy,loadMethod:x.loadMethod,toggleMethod:x.toggleMethod,transform:x.transform,trigger:x.trigger,showIcon:x.showIcon,showLine:x.showLine,iconOpen:x.iconOpen,iconLoaded:x.iconLoaded,iconClose:x.iconClose,onNodeClick:ne,onRadioChange:oe,onCheckboxChange:ue,onLoadSuccess:re})])]),f?(0,_vue.h)("div",{class:"vxe-tree-select--panel-footer"},f({})):(0,_ui.renderEmptyElement)(H)])]:[])])])},H},render(){return this.renderVN()}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_log=require("../../ui/src/log"),_xeUtils=_interopRequireDefault(require("xe-utils")),_input=_interopRequireDefault(require("../../input/src/input")),_tree=_interopRequireDefault(require("../../tree/src/tree"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getOptUniqueId(){return _xeUtils.default.uniqueId("node_")}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTreeSelect",props:{modelValue:[String,Number,Array],clearable:Boolean,placeholder:{type:String,default:()=>_xeUtils.default.eqNull((0,_ui.getConfig)().treeSelect.placeholder)?(0,_ui.getI18n)("vxe.base.pleaseSelect"):(0,_ui.getConfig)().treeSelect.placeholder},readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},multiple:Boolean,className:[String,Function],popupClassName:[String,Function],prefixIcon:String,placement:String,options:Array,optionProps:Object,size:{type:String,default:()=>(0,_ui.getConfig)().select.size||(0,_ui.getConfig)().size},remote:Boolean,remoteMethod:Function,popupConfig:Object,treeConfig:Object,transfer:{type:Boolean,default:null}},emits:["update:modelValue","change","clear","blur","focus","click","node-click"],setup(w,e){const{emit:a,slots:N}=e,t=(0,_vue.inject)("$xeModal",null),i=(0,_vue.inject)("$xeDrawer",null),n=(0,_vue.inject)("$xeTable",null),o=(0,_vue.inject)("$xeForm",null),u=(0,_vue.inject)("xeFormItemInfo",null);var l=_xeUtils.default.uniqueId();const O=(0,_ui.useSize)(w)["computeSize"],q=(0,_vue.ref)(),j=(0,_vue.ref)(),k=(0,_vue.ref)(),z=(0,_vue.ref)(),A=(0,_vue.reactive)({initialized:!1,fullOptionList:[],fullNodeMaps:{},panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1}),r={hpTimeout:void 0},s={refElem:q},U=(0,_vue.computed)(()=>{var e=w["readonly"];return null===e?!!o&&o.props.readonly:e}),L=(0,_vue.computed)(()=>{var e=w["disabled"];return null===e?!!o&&o.props.disabled:e}),M=(0,_vue.computed)(()=>{var e=w["transfer"];if(null===e){var l=(0,_ui.getConfig)().select.transfer;if(_xeUtils.default.isBoolean(l))return l;if(n||t||i||o)return!0}return e}),V=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().treeSelect.popupConfig,w.popupConfig)),R=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().treeSelect.treeConfig,w.treeConfig,{data:void 0})),G=(0,_vue.computed)(()=>{var e=R.value;return Object.assign({isHover:!0},e.nodeConfig)}),J=(0,_vue.computed)(()=>{var e=R.value;return Object.assign({showIcon:!!e.showCheckbox},e.checkboxConfig,{trigger:"node"})}),Q=(0,_vue.computed)(()=>{var e=R.value;return Object.assign({showIcon:!!e.showRadio},e.radioConfig,{trigger:"node"})}),d=(0,_vue.computed)(()=>w.optionProps||{}),$=(0,_vue.computed)(()=>{return R.value.keyField||"id"}),D=(0,_vue.computed)(()=>{return d.value.label||"label"}),B=(0,_vue.computed)(()=>{return d.value.value||"value"}),K=(0,_vue.computed)(()=>{return d.value.children||"children"}),W=(0,_vue.computed)(()=>{return d.value.parent||"parentField"}),X=(0,_vue.computed)(()=>{return d.value.hasChild||"hasChild"}),Y=(0,_vue.computed)(()=>{var e=w["modelValue"];const t=A["fullNodeMaps"],i=D.value;return(_xeUtils.default.isArray(e)?e:[e]).map(e=>{var l=t[e];return l?l.item[i]:e}).join(", ")}),ee=(0,_vue.computed)(()=>{var{height:e,width:l}=V.value,t={};return l&&(t.width=(0,_dom.toCssUnit)(l)),e&&(t.height=(0,_dom.toCssUnit)(e),t.maxHeight=(0,_dom.toCssUnit)(e)),t}),m={},H={xID:l,props:w,context:e,reactData:A,internalData:r,getRefMaps:()=>s,getComputeMaps:()=>m},c=(e,l,t)=>{a(e,(0,_ui.createEvent)(t,{$treeSelect:H},l))};l={dispatchEvent:c};const v=()=>{var e=w["options"];const r=$.value;var l=K.value;const s=B.value,d={},c={};_xeUtils.default.eachTree(e,(e,l,t,i,a,n)=>{let o=(e=>{e=e[$.value];return e?encodeURIComponent(e):""})(e);o=o||getOptUniqueId(),c[o]&&(0,_log.errLog)("vxe.error.repeatKey",[r,o]),c[o]=!0;var u=e[s];d[u]&&(0,_log.errLog)("vxe.error.repeatKey",[s,u]),d[u]={item:e,index:l,items:t,parent:a,nodes:n}},{children:l}),A.fullOptionList=e||[],A.fullNodeMaps=d},p=()=>{const t=w["placement"],i=A["panelIndex"],a=q.value,n=z.value,o=M.value;var e=()=>{var e=(0,_dom.updatePanelPlacement)(a,n,{placement:t,teleportTo:o}),l=Object.assign(e.style,{zIndex:i});A.panelStyle=l,A.panelPlacement=e.placement};return e(),(0,_vue.nextTick)().then(e)},_=()=>{var e=w["loading"],l=L.value;e||l||(clearTimeout(r.hpTimeout),A.initialized||(A.initialized=!0),A.isActivated=!0,A.isAniVisible=!0,setTimeout(()=>{A.visiblePanel=!0},10),A.panelIndex<(0,_utils.getLastZIndex)()&&(A.panelIndex=(0,_utils.nextZIndex)()),p())},g=()=>{A.visiblePanel=!1,r.hpTimeout=setTimeout(()=>{A.isAniVisible=!1},350)},f=(e,l)=>{var t,i=A["fullNodeMaps"];t=l,a("update:modelValue",t),l!==w.modelValue&&(t=i[l],c("change",{value:l,option:t?t.item:null},e),o)&&u&&o.triggerItemEvent(e,u.itemConfig.field,l)},h=(e,l)=>{f(e,l),c("clear",{value:l},e)},le=(e,l)=>{h(l,null),g()},x=e=>{var l=A["visiblePanel"];L.value||l&&(l=z.value,((0,_dom.getEventTargetNode)(e,l).flag?p:g)())},b=e=>{var l,t,i=A["visiblePanel"];L.value||(l=q.value,t=z.value,A.isActivated=(0,_dom.getEventTargetNode)(e,l).flag||(0,_dom.getEventTargetNode)(e,t).flag,i&&!A.isActivated&&g())},C=()=>{g()},E=()=>{var e=A["visiblePanel"];e&&p()},te=e=>{L.value||A.visiblePanel||(A.triggerFocusPanel=!0,_(),setTimeout(()=>{A.triggerFocusPanel=!1},150)),c("focus",{},e)},ie=e=>{Z(e),c("click",{},e)},ae=e=>{A.isActivated=!1,c("blur",{},e)},Z=e=>{e=e.$event;e.preventDefault(),A.triggerFocusPanel?A.triggerFocusPanel=!1:(A.visiblePanel?g:_)()},ne=e=>{var l=e["$event"];c("node-click",e,l)},oe=e=>{var{value:e,$event:l}=e;f(l,e),g()},ue=e=>{var{value:e,$event:l}=e;f(l,e)},re=()=>{v()};Object.assign(H,l,{});return(0,_vue.watch)(()=>w.options,()=>{v()}),v(),(0,_vue.onMounted)(()=>{_ui.globalEvents.on(H,"mousewheel",x),_ui.globalEvents.on(H,"mousedown",b),_ui.globalEvents.on(H,"blur",C),_ui.globalEvents.on(H,"resize",E)}),(0,_vue.onUnmounted)(()=>{_ui.globalEvents.off(H,"mousewheel"),_ui.globalEvents.off(H,"mousedown"),_ui.globalEvents.off(H,"blur"),_ui.globalEvents.off(H,"resize")}),(0,_vue.provide)("$xeTreeSelect",H),H.renderVN=()=>{var{className:e,modelValue:l,multiple:t,options:i,loading:a}=w,{initialized:n,isActivated:o,isAniVisible:u,visiblePanel:r}=A,s=O.value,d=L.value,c=Y.value,v=M.value,p=U.value,_=ee.value,g=N.header,f=N.footer;const m=N.prefix;var h=V.value.className||w.popupClassName,x=R.value,b=G.value,C=J.value,E=Q.value,y=$.value,I=D.value,S=B.value,F=K.value,T=W.value,P=X.value;return p?(0,_vue.h)("div",{ref:q,class:["vxe-tree-select--readonly",e]},[(0,_vue.h)("span",{class:"vxe-tree-select-label"},c)]):(0,_vue.h)("div",{ref:q,class:["vxe-tree-select",e?_xeUtils.default.isFunction(e)?e({$treeSelect:H}):e:"",{["size--"+s]:s,"is--visible":r,"is--disabled":d,"is--loading":a,"is--active":o}]},[(0,_vue.h)(_input.default,{ref:j,clearable:w.clearable,placeholder:a?(0,_ui.getI18n)("vxe.select.loadingText"):w.placeholder,readonly:!0,disabled:d,type:"text",prefixIcon:w.prefixIcon,suffixIcon:a?(0,_ui.getIcon)().TREE_SELECT_LOADED:r?(0,_ui.getIcon)().TREE_SELECT_OPEN:(0,_ui.getIcon)().TREE_SELECT_CLOSE,modelValue:a?"":c,onClear:le,onClick:ie,onFocus:te,onBlur:ae,onSuffixClick:Z},m?{prefix:()=>m({})}:{}),(0,_vue.h)(_vue.Teleport,{to:"body",disabled:!v||!n},[(0,_vue.h)("div",{ref:z,class:["vxe-table--ignore-clear vxe-tree-select--panel",h?_xeUtils.default.isFunction(h)?h({$treeSelect:H}):h:"",{["size--"+s]:s,"is--transfer":v,"ani--leave":!a&&u,"ani--enter":!a&&r}],placement:A.panelPlacement,style:A.panelStyle},n?[(0,_vue.h)("div",{class:"vxe-tree-select--panel-wrapper"},[g?(0,_vue.h)("div",{class:"vxe-tree-select--panel-header"},g({})):(0,_ui.renderEmptyElement)(H),(0,_vue.h)("div",{class:"vxe-tree-select--panel-body"},[(0,_vue.h)("div",{ref:k,class:"vxe-tree-select-tree--wrapper",style:_},[(0,_vue.h)(_tree.default,{class:"vxe-tree-select--tree",data:i,indent:x.indent,showRadio:!t,radioConfig:E,checkNodeKey:t?null:l,showCheckbox:!!t,checkNodeKeys:t?l:null,checkboxConfig:C,titleField:I,valueField:S,keyField:y,childrenField:x.childrenField||F,parentField:x.parentField||T,hasChildField:x.hasChildField||P,accordion:x.accordion,expandAll:x.expandAll,nodeConfig:b,lazy:x.lazy,loadMethod:x.loadMethod,toggleMethod:x.toggleMethod,transform:x.transform,trigger:x.trigger,showIcon:x.showIcon,showLine:x.showLine,iconOpen:x.iconOpen,iconLoaded:x.iconLoaded,iconClose:x.iconClose,onNodeClick:ne,onRadioChange:oe,onCheckboxChange:ue,onLoadSuccess:re})])]),f?(0,_vue.h)("div",{class:"vxe-tree-select--panel-footer"},f({})):(0,_ui.renderEmptyElement)(H)])]:[])])])},H},render(){return this.renderVN()}});
package/lib/ui/index.js CHANGED
@@ -26,7 +26,7 @@ Object.keys(_core).forEach(function (key) {
26
26
  });
27
27
  var _dynamics = require("../dynamics");
28
28
  var _log = require("./src/log");
29
- const version = exports.version = "4.6.26";
29
+ const version = exports.version = "4.6.27";
30
30
  _core.VxeUI.uiVersion = version;
31
31
  _core.VxeUI.dynamicApp = _dynamics.dynamicApp;
32
32
  function config(options) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log");const version=exports.version="4.6.26";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0}},buttonGroup:{},calendar:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1},card:{border:!0,padding:!0},carousel:{height:200,loop:!0,interval:5e3},carouselItem:{},checkbox:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"hex",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:null,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{destroyOnClose:!0},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:100,oSize:2}},split:{resize:!0,itemConfig:{minWidth:40,minHeight:40}},splitPane:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0}},treeSelect:{treeConfig:{radioConfig:{},checkboxConfig:{}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{}});const iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_COPY:iconPrefix+"copy",EYE_DROPPER:iconPrefix+"dropper",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"});var _default=exports.default=_core.VxeUI;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log");const version=exports.version="4.6.27";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0}},buttonGroup:{},calendar:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1},card:{border:!0,padding:!0},carousel:{height:200,loop:!0,interval:5e3},carouselItem:{},checkbox:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"hex",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:null,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{destroyOnClose:!0},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:100,oSize:2}},split:{resize:!0,itemConfig:{minWidth:40,minHeight:40}},splitPane:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0}},treeSelect:{treeConfig:{radioConfig:{},checkboxConfig:{}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{}});const iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_COPY:iconPrefix+"copy",EYE_DROPPER:iconPrefix+"dropper",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"});var _default=exports.default=_core.VxeUI;
package/lib/ui/src/dom.js CHANGED
@@ -173,7 +173,7 @@ function updatePanelPlacement(targetElem, panelElem, options) {
173
173
  marginSize
174
174
  } = Object.assign({
175
175
  teleportTo: false,
176
- marginSize: 5
176
+ marginSize: 32
177
177
  }, options);
178
178
  let panelPlacement = 'bottom';
179
179
  let top = '';
@@ -188,28 +188,27 @@ function updatePanelPlacement(targetElem, panelElem, options) {
188
188
  const targetHeight = targetElem.offsetHeight;
189
189
  const panelHeight = panelElem.offsetHeight;
190
190
  const panelWidth = panelElem.offsetWidth;
191
- const bounding = targetElem.getBoundingClientRect();
192
- const boundingTop = bounding.top;
193
- const boundingLeft = bounding.left;
191
+ const panelRect = panelElem.getBoundingClientRect();
192
+ const targetRect = targetElem.getBoundingClientRect();
194
193
  const visibleHeight = documentElement.clientHeight || bodyElem.clientHeight;
195
194
  const visibleWidth = documentElement.clientWidth || bodyElem.clientWidth;
196
195
  minWidth = targetElem.offsetWidth;
197
196
  if (teleportTo) {
198
- left = boundingLeft;
199
- top = boundingTop + targetHeight;
197
+ left = targetRect.left;
198
+ top = targetRect.top + targetHeight;
200
199
  if (placement === 'top') {
201
200
  panelPlacement = 'top';
202
- top = boundingTop - panelHeight;
201
+ top = targetRect.top - panelHeight;
203
202
  } else if (!placement) {
204
203
  // 如果下面不够放,则向上
205
204
  if (top + panelHeight + marginSize > visibleHeight) {
206
205
  panelPlacement = 'top';
207
- top = boundingTop - panelHeight;
206
+ top = targetRect.top - panelHeight;
208
207
  }
209
208
  // 如果上面不够放,则向下(优先)
210
209
  if (top < marginSize) {
211
210
  panelPlacement = 'bottom';
212
- top = boundingTop + targetHeight;
211
+ top = targetRect.top + targetHeight;
213
212
  }
214
213
  }
215
214
  // 如果溢出右边
@@ -227,15 +226,19 @@ function updatePanelPlacement(targetElem, panelElem, options) {
227
226
  } else if (!placement) {
228
227
  // 如果下面不够放,则向上
229
228
  top = targetHeight;
230
- if (boundingTop + targetHeight + panelHeight > visibleHeight) {
229
+ if (targetRect.top + targetRect.height + marginSize > visibleHeight) {
231
230
  // 如果上面不够放,则向下(优先)
232
- if (boundingTop - targetHeight - panelHeight > marginSize) {
231
+ if (targetRect.top - targetHeight - panelHeight > marginSize) {
233
232
  panelPlacement = 'top';
234
233
  top = '';
235
234
  bottom = targetHeight;
236
235
  }
237
236
  }
238
237
  }
238
+ // 是否超出右侧
239
+ if (panelRect.left + panelRect.width + marginSize > visibleWidth) {
240
+ left = -(panelRect.left + panelRect.width + marginSize - visibleWidth);
241
+ }
239
242
  }
240
243
  if (_xeUtils.default.isNumber(top)) {
241
244
  stys.top = toCssUnit(top);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addClass=addClass,exports.getAbsolutePos=getAbsolutePos,exports.getDomNode=getDomNode,exports.getEventTargetNode=getEventTargetNode,exports.getOffsetPos=getOffsetPos,exports.getTpImg=getTpImg,exports.hasClass=hasClass,exports.hasControlKey=hasControlKey,exports.initTpImg=initTpImg,exports.isNodeElement=isNodeElement,exports.isPx=isPx,exports.isScale=isScale,exports.removeClass=removeClass,exports.scrollToView=scrollToView,exports.toCssUnit=toCssUnit,exports.triggerEvent=triggerEvent,exports.updatePanelPlacement=updatePanelPlacement;var _xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let tpImgEl;function initTpImg(){return tpImgEl||((tpImgEl=new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),tpImgEl}function getTpImg(){return tpImgEl||initTpImg()}const reClsMap={};function getClsRE(e){return reClsMap[e]||(reClsMap[e]=new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g")),reClsMap[e]}function getNodeOffset(e,t,o){if(e){var s=e.parentNode;if(o.top+=e.offsetTop,o.left+=e.offsetLeft,s&&s!==document.documentElement&&s!==document.body&&(o.top-=s.scrollTop,o.left-=s.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return getNodeOffset(e.offsetParent,t,o)}return o}function isPx(e){return e&&/^\d+(px)?$/.test(e)}function isScale(e){return e&&/^\d+%$/.test(e)}function hasClass(e,t){return!!(e&&e.className&&e.className.match&&e.className.match(getClsRE(t)))}function removeClass(e,t){e&&hasClass(e,t)&&(e.className=e.className.replace(getClsRE(t),""))}function addClass(e,t){e&&!hasClass(e,t)&&(removeClass(e,t),e.className=e.className+" "+t)}function hasControlKey(e){return e.ctrlKey||e.metaKey}function toCssUnit(e,t="px"){return _xeUtils.default.isNumber(e)||/^\d+$/.test(""+e)?""+e+t:""+(e||"")}function getDomNode(){var e=document.documentElement,t=document.body;return{scrollTop:e.scrollTop||t.scrollTop,scrollLeft:e.scrollLeft||t.scrollLeft,visibleHeight:e.clientHeight||t.clientHeight,visibleWidth:e.clientWidth||t.clientWidth}}function getEventTargetNode(e,t,o,s){let l,n=e.target.shadowRoot&&e.composed&&e.composedPath()[0]||e.target;for(;n&&n.nodeType&&n!==document;){if(o&&hasClass(n,o)&&(!s||s(n)))l=n;else if(n===t)return{flag:!o||!!l,container:t,targetElem:l};n=n.parentNode}return{flag:!1}}function getOffsetPos(e,t){return getNodeOffset(e,t,{left:0,top:0})}function getAbsolutePos(e){var e=e.getBoundingClientRect(),t=e.top,e=e.left,{scrollTop:o,scrollLeft:s,visibleHeight:l,visibleWidth:n}=getDomNode();return{boundingTop:t,top:o+t,boundingLeft:e,left:s+e,visibleHeight:l,visibleWidth:n}}const scrollIntoViewIfNeeded="scrollIntoViewIfNeeded",scrollIntoView="scrollIntoView";function scrollToView(e){e&&(e[scrollIntoViewIfNeeded]?e[scrollIntoViewIfNeeded]():e[scrollIntoView]&&e[scrollIntoView]())}function triggerEvent(e,t){e&&e.dispatchEvent(new Event(t))}function isNodeElement(e){return e&&1===e.nodeType}function updatePanelPlacement(e,t,o){var{placement:o,teleportTo:s,marginSize:l}=Object.assign({teleportTo:!1,marginSize:5},o);let n="bottom",i="",r="",a="";var c,f,u,d,p,g,m,C="",h={};return t&&e&&(m=document.documentElement,c=document.body,f=e.offsetHeight,u=t.offsetHeight,t=t.offsetWidth,d=(p=e.getBoundingClientRect()).top,p=p.left,g=m.clientHeight||c.clientHeight,m=m.clientWidth||c.clientWidth,C=e.offsetWidth,s?(a=p,i=d+f,"top"===o?(n="top",i=d-u):o||(i+u+l>g&&(n="top",i=d-u),i<l&&(n="bottom",i=d+f)),a+t+l>m&&(a-=a+t+l-m),a<l&&(a=l)):"top"===o?(n="top",r=f):o||g<d+(i=f)+u&&l<d-f-u&&(n="top",i="",r=f),_xeUtils.default.isNumber(i)&&(h.top=toCssUnit(i)),_xeUtils.default.isNumber(r)&&(h.bottom=toCssUnit(r)),_xeUtils.default.isNumber(a)&&(h.left=toCssUnit(a)),_xeUtils.default.isNumber("")&&(h.right=toCssUnit("")),_xeUtils.default.isNumber(C))&&(h.minWidth=toCssUnit(C)),{top:i||0,bottom:r||0,left:a||0,right:0,style:h,placement:n}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addClass=addClass,exports.getAbsolutePos=getAbsolutePos,exports.getDomNode=getDomNode,exports.getEventTargetNode=getEventTargetNode,exports.getOffsetPos=getOffsetPos,exports.getTpImg=getTpImg,exports.hasClass=hasClass,exports.hasControlKey=hasControlKey,exports.initTpImg=initTpImg,exports.isNodeElement=isNodeElement,exports.isPx=isPx,exports.isScale=isScale,exports.removeClass=removeClass,exports.scrollToView=scrollToView,exports.toCssUnit=toCssUnit,exports.triggerEvent=triggerEvent,exports.updatePanelPlacement=updatePanelPlacement;var _xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let tpImgEl;function initTpImg(){return tpImgEl||((tpImgEl=new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),tpImgEl}function getTpImg(){return tpImgEl||initTpImg()}const reClsMap={};function getClsRE(e){return reClsMap[e]||(reClsMap[e]=new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g")),reClsMap[e]}function getNodeOffset(e,t,o){if(e){var s=e.parentNode;if(o.top+=e.offsetTop,o.left+=e.offsetLeft,s&&s!==document.documentElement&&s!==document.body&&(o.top-=s.scrollTop,o.left-=s.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return getNodeOffset(e.offsetParent,t,o)}return o}function isPx(e){return e&&/^\d+(px)?$/.test(e)}function isScale(e){return e&&/^\d+%$/.test(e)}function hasClass(e,t){return!!(e&&e.className&&e.className.match&&e.className.match(getClsRE(t)))}function removeClass(e,t){e&&hasClass(e,t)&&(e.className=e.className.replace(getClsRE(t),""))}function addClass(e,t){e&&!hasClass(e,t)&&(removeClass(e,t),e.className=e.className+" "+t)}function hasControlKey(e){return e.ctrlKey||e.metaKey}function toCssUnit(e,t="px"){return _xeUtils.default.isNumber(e)||/^\d+$/.test(""+e)?""+e+t:""+(e||"")}function getDomNode(){var e=document.documentElement,t=document.body;return{scrollTop:e.scrollTop||t.scrollTop,scrollLeft:e.scrollLeft||t.scrollLeft,visibleHeight:e.clientHeight||t.clientHeight,visibleWidth:e.clientWidth||t.clientWidth}}function getEventTargetNode(e,t,o,s){let l,n=e.target.shadowRoot&&e.composed&&e.composedPath()[0]||e.target;for(;n&&n.nodeType&&n!==document;){if(o&&hasClass(n,o)&&(!s||s(n)))l=n;else if(n===t)return{flag:!o||!!l,container:t,targetElem:l};n=n.parentNode}return{flag:!1}}function getOffsetPos(e,t){return getNodeOffset(e,t,{left:0,top:0})}function getAbsolutePos(e){var e=e.getBoundingClientRect(),t=e.top,e=e.left,{scrollTop:o,scrollLeft:s,visibleHeight:l,visibleWidth:n}=getDomNode();return{boundingTop:t,top:o+t,boundingLeft:e,left:s+e,visibleHeight:l,visibleWidth:n}}const scrollIntoViewIfNeeded="scrollIntoViewIfNeeded",scrollIntoView="scrollIntoView";function scrollToView(e){e&&(e[scrollIntoViewIfNeeded]?e[scrollIntoViewIfNeeded]():e[scrollIntoView]&&e[scrollIntoView]())}function triggerEvent(e,t){e&&e.dispatchEvent(new Event(t))}function isNodeElement(e){return e&&1===e.nodeType}function updatePanelPlacement(e,t,o){var{placement:o,teleportTo:s,marginSize:l}=Object.assign({teleportTo:!1,marginSize:32},o);let n="bottom",i="",r="",a="";var c,f,d,p,u,g,m,C="",h={};return t&&e&&(m=document.documentElement,c=document.body,f=e.offsetHeight,d=t.offsetHeight,p=t.offsetWidth,t=t.getBoundingClientRect(),u=e.getBoundingClientRect(),g=m.clientHeight||c.clientHeight,m=m.clientWidth||c.clientWidth,C=e.offsetWidth,s?(a=u.left,i=u.top+f,"top"===o?(n="top",i=u.top-d):o||(i+d+l>g&&(n="top",i=u.top-d),i<l&&(n="bottom",i=u.top+f)),a+p+l>m&&(a-=a+p+l-m),a<l&&(a=l)):("top"===o?(n="top",r=f):o||(i=f,u.top+u.height+l>g&&u.top-f-d>l&&(n="top",i="",r=f)),t.left+t.width+l>m&&(a=-(t.left+t.width+l-m))),_xeUtils.default.isNumber(i)&&(h.top=toCssUnit(i)),_xeUtils.default.isNumber(r)&&(h.bottom=toCssUnit(r)),_xeUtils.default.isNumber(a)&&(h.left=toCssUnit(a)),_xeUtils.default.isNumber("")&&(h.right=toCssUnit("")),_xeUtils.default.isNumber(C))&&(h.minWidth=toCssUnit(C)),{top:i||0,bottom:r||0,left:a||0,right:0,style:h,placement:n}}
package/lib/ui/src/log.js CHANGED
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.warnLog = exports.errLog = void 0;
7
7
  var _core = require("@vxe-ui/core");
8
- const version = `ui v${"4.6.26"}`;
8
+ const version = `ui v${"4.6.27"}`;
9
9
  const warnLog = exports.warnLog = _core.log.create('warn', version);
10
10
  const errLog = exports.errLog = _core.log.create('error', version);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");const version="ui v4.6.26",warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");const version="ui v4.6.27",warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-pc-ui",
3
- "version": "4.6.26",
3
+ "version": "4.6.27",
4
4
  "description": "A vue based PC component library",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -528,6 +528,13 @@ const VxeButtonComponent = defineVxeComponent({
528
528
  }
529
529
  }
530
530
 
531
+ const handleGlobalResizeEvent = () => {
532
+ const { visiblePanel } = reactData
533
+ if (visiblePanel) {
534
+ updatePlacement()
535
+ }
536
+ }
537
+
531
538
  Object.assign($xeButton, buttonMethods)
532
539
 
533
540
  const renderVN = () => {
@@ -724,11 +731,13 @@ const VxeButtonComponent = defineVxeComponent({
724
731
 
725
732
  globalEvents.on($xeButton, 'mousewheel', handleGlobalMousewheelEvent)
726
733
  globalEvents.on($xeButton, 'mousedown', handleGlobalMousedownEvent)
734
+ globalEvents.on($xeButton, 'resize', handleGlobalResizeEvent)
727
735
  })
728
736
 
729
737
  onUnmounted(() => {
730
738
  globalEvents.off($xeButton, 'mousewheel')
731
739
  globalEvents.off($xeButton, 'mousedown')
740
+ globalEvents.off($xeButton, 'resize')
732
741
  })
733
742
 
734
743
  return $xeButton
@@ -603,6 +603,13 @@ export default defineVxeComponent({
603
603
  hideOptionPanel()
604
604
  }
605
605
 
606
+ const handleGlobalResizeEvent = () => {
607
+ const { visiblePanel } = reactData
608
+ if (visiblePanel) {
609
+ updatePlacement()
610
+ }
611
+ }
612
+
606
613
  const dispatchEvent = (type: ValueOf<VxeColorPickerEmits>, params: Record<string, any>, evnt: Event | null) => {
607
614
  emit(type, createEvent(evnt, { $colorPicker: $xeColorPicker }, params))
608
615
  }
@@ -961,12 +968,14 @@ export default defineVxeComponent({
961
968
  globalEvents.on($xeColorPicker, 'mousewheel', handleGlobalMousewheelEvent)
962
969
  globalEvents.on($xeColorPicker, 'mousedown', handleGlobalMousedownEvent)
963
970
  globalEvents.on($xeColorPicker, 'blur', handleGlobalBlurEvent)
971
+ globalEvents.on($xeColorPicker, 'resize', handleGlobalResizeEvent)
964
972
  })
965
973
 
966
974
  onUnmounted(() => {
967
975
  globalEvents.off($xeColorPicker, 'mousewheel')
968
976
  globalEvents.off($xeColorPicker, 'mousedown')
969
977
  globalEvents.off($xeColorPicker, 'blur')
978
+ globalEvents.off($xeColorPicker, 'resize')
970
979
  })
971
980
 
972
981
  updateMode()
@@ -521,6 +521,13 @@ export default defineVxeComponent({
521
521
  }
522
522
  }
523
523
 
524
+ const handleGlobalResizeEvent = () => {
525
+ const { visiblePanel } = reactData
526
+ if (visiblePanel) {
527
+ updatePlacement()
528
+ }
529
+ }
530
+
524
531
  // 弹出面板
525
532
  const updateZindex = () => {
526
533
  if (reactData.panelIndex < getLastZIndex()) {
@@ -974,12 +981,14 @@ export default defineVxeComponent({
974
981
  globalEvents.on($xeDatePicker, 'mousewheel', handleGlobalMousewheelEvent)
975
982
  globalEvents.on($xeDatePicker, 'mousedown', handleGlobalMousedownEvent)
976
983
  globalEvents.on($xeDatePicker, 'blur', handleGlobalBlurEvent)
984
+ globalEvents.on($xeDatePicker, 'resize', handleGlobalResizeEvent)
977
985
  })
978
986
 
979
987
  onUnmounted(() => {
980
988
  globalEvents.off($xeDatePicker, 'mousewheel')
981
989
  globalEvents.off($xeDatePicker, 'mousedown')
982
990
  globalEvents.off($xeDatePicker, 'blur')
991
+ globalEvents.off($xeDatePicker, 'resize')
983
992
  })
984
993
 
985
994
  updateModelValue()
@@ -625,6 +625,13 @@ export default defineVxeComponent({
625
625
  }
626
626
  }
627
627
 
628
+ const handleGlobalResizeEvent = () => {
629
+ const { visiblePanel } = reactData
630
+ if (visiblePanel) {
631
+ updatePlacement()
632
+ }
633
+ }
634
+
628
635
  // 弹出面板
629
636
  const updateZindex = () => {
630
637
  if (reactData.panelIndex < getLastZIndex()) {
@@ -1112,6 +1119,7 @@ export default defineVxeComponent({
1112
1119
  globalEvents.on($xeDateRangePicker, 'mousewheel', handleGlobalMousewheelEvent)
1113
1120
  globalEvents.on($xeDateRangePicker, 'mousedown', handleGlobalMousedownEvent)
1114
1121
  globalEvents.on($xeDateRangePicker, 'blur', handleGlobalBlurEvent)
1122
+ globalEvents.on($xeDateRangePicker, 'resize', handleGlobalResizeEvent)
1115
1123
  })
1116
1124
 
1117
1125
  onDeactivated(() => {
@@ -1122,6 +1130,7 @@ export default defineVxeComponent({
1122
1130
  globalEvents.off($xeDateRangePicker, 'mousewheel')
1123
1131
  globalEvents.off($xeDateRangePicker, 'mousedown')
1124
1132
  globalEvents.off($xeDateRangePicker, 'blur')
1133
+ globalEvents.off($xeDateRangePicker, 'resize')
1125
1134
  })
1126
1135
 
1127
1136
  onBeforeUnmount(() => {
@@ -263,6 +263,13 @@ export default defineVxeComponent({
263
263
  }
264
264
  }
265
265
 
266
+ const handleGlobalResizeEvent = () => {
267
+ const { visiblePanel } = reactData
268
+ if (visiblePanel) {
269
+ updatePlacement()
270
+ }
271
+ }
272
+
266
273
  const dispatchEvent = (type: ValueOf<VxePulldownEmits>, params: Record<string, any>, evnt: Event | null) => {
267
274
  emit(type, createEvent(evnt, { $pulldown: $xePulldown }, params))
268
275
  }
@@ -293,12 +300,14 @@ export default defineVxeComponent({
293
300
  globalEvents.on($xePulldown, 'mousewheel', handleGlobalMousewheelEvent)
294
301
  globalEvents.on($xePulldown, 'mousedown', handleGlobalMousedownEvent)
295
302
  globalEvents.on($xePulldown, 'blur', handleGlobalBlurEvent)
303
+ globalEvents.on($xePulldown, 'resize', handleGlobalResizeEvent)
296
304
  })
297
305
 
298
306
  onUnmounted(() => {
299
307
  globalEvents.off($xePulldown, 'mousewheel')
300
308
  globalEvents.off($xePulldown, 'mousedown')
301
309
  globalEvents.off($xePulldown, 'blur')
310
+ globalEvents.off($xePulldown, 'resize')
302
311
  })
303
312
 
304
313
  const renderDefaultPanel = (options?: VxePulldownPropTypes.Options) => {
@@ -688,6 +688,13 @@ export default defineVxeComponent({
688
688
  hideOptionPanel()
689
689
  }
690
690
 
691
+ const handleGlobalResizeEvent = () => {
692
+ const { visiblePanel } = reactData
693
+ if (visiblePanel) {
694
+ updatePlacement()
695
+ }
696
+ }
697
+
691
698
  const handleFocusSearch = () => {
692
699
  if (props.filterable) {
693
700
  nextTick(() => {
@@ -1366,6 +1373,7 @@ export default defineVxeComponent({
1366
1373
  globalEvents.on($xeSelect, 'mousedown', handleGlobalMousedownEvent)
1367
1374
  globalEvents.on($xeSelect, 'keydown', handleGlobalKeydownEvent)
1368
1375
  globalEvents.on($xeSelect, 'blur', handleGlobalBlurEvent)
1376
+ globalEvents.on($xeSelect, 'resize', handleGlobalResizeEvent)
1369
1377
  })
1370
1378
 
1371
1379
  onUnmounted(() => {
@@ -1373,6 +1381,7 @@ export default defineVxeComponent({
1373
1381
  globalEvents.off($xeSelect, 'mousedown')
1374
1382
  globalEvents.off($xeSelect, 'keydown')
1375
1383
  globalEvents.off($xeSelect, 'blur')
1384
+ globalEvents.off($xeSelect, 'resize')
1376
1385
  })
1377
1386
 
1378
1387
  provide('$xeSelect', $xeSelect)
@@ -455,6 +455,13 @@ export default defineVxeComponent({
455
455
  hideOptionPanel()
456
456
  }
457
457
 
458
+ const handleGlobalResizeEvent = () => {
459
+ const { visiblePanel } = reactData
460
+ if (visiblePanel) {
461
+ updatePlacement()
462
+ }
463
+ }
464
+
458
465
  const focusEvent = (evnt: FocusEvent) => {
459
466
  const isDisabled = computeIsDisabled.value
460
467
  if (!isDisabled) {
@@ -661,12 +668,14 @@ export default defineVxeComponent({
661
668
  globalEvents.on($xeTableSelect, 'mousewheel', handleGlobalMousewheelEvent)
662
669
  globalEvents.on($xeTableSelect, 'mousedown', handleGlobalMousedownEvent)
663
670
  globalEvents.on($xeTableSelect, 'blur', handleGlobalBlurEvent)
671
+ globalEvents.on($xeTableSelect, 'resize', handleGlobalResizeEvent)
664
672
  })
665
673
 
666
674
  onUnmounted(() => {
667
675
  globalEvents.off($xeTableSelect, 'mousewheel')
668
676
  globalEvents.off($xeTableSelect, 'mousedown')
669
677
  globalEvents.off($xeTableSelect, 'blur')
678
+ globalEvents.off($xeTableSelect, 'resize')
670
679
  })
671
680
 
672
681
  nextTick(() => {
@@ -397,6 +397,13 @@ export default defineVxeComponent({
397
397
  hideOptionPanel()
398
398
  }
399
399
 
400
+ const handleGlobalResizeEvent = () => {
401
+ const { visiblePanel } = reactData
402
+ if (visiblePanel) {
403
+ updatePlacement()
404
+ }
405
+ }
406
+
400
407
  const focusEvent = (evnt: FocusEvent) => {
401
408
  const isDisabled = computeIsDisabled.value
402
409
  if (!isDisabled) {
@@ -615,12 +622,14 @@ export default defineVxeComponent({
615
622
  globalEvents.on($xeTreeSelect, 'mousewheel', handleGlobalMousewheelEvent)
616
623
  globalEvents.on($xeTreeSelect, 'mousedown', handleGlobalMousedownEvent)
617
624
  globalEvents.on($xeTreeSelect, 'blur', handleGlobalBlurEvent)
625
+ globalEvents.on($xeTreeSelect, 'resize', handleGlobalResizeEvent)
618
626
  })
619
627
 
620
628
  onUnmounted(() => {
621
629
  globalEvents.off($xeTreeSelect, 'mousewheel')
622
630
  globalEvents.off($xeTreeSelect, 'mousedown')
623
631
  globalEvents.off($xeTreeSelect, 'blur')
632
+ globalEvents.off($xeTreeSelect, 'resize')
624
633
  })
625
634
 
626
635
  provide('$xeTreeSelect', $xeTreeSelect)