vxe-pc-ui 3.16.25 → 3.16.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 (71) hide show
  1. package/es/cascader/src/cascader.js +2 -2
  2. package/es/icon/style.css +1 -1
  3. package/es/input/src/input.js +10 -0
  4. package/es/list/src/list.js +16 -10
  5. package/es/number-input/src/number-input.js +6 -0
  6. package/es/select/src/select.js +2 -2
  7. package/es/style.css +1 -1
  8. package/es/style.min.css +1 -1
  9. package/es/textarea/src/textarea.js +8 -0
  10. package/es/tree/src/tree.js +19 -13
  11. package/es/tree-select/src/tree-select.js +9 -0
  12. package/es/tree-select/style.css +6 -0
  13. package/es/tree-select/style.min.css +1 -1
  14. package/es/ui/index.js +1 -1
  15. package/es/ui/src/log.js +1 -1
  16. package/es/vxe-tree-select/style.css +6 -0
  17. package/es/vxe-tree-select/style.min.css +1 -1
  18. package/lib/cascader/src/cascader.js +2 -2
  19. package/lib/cascader/src/cascader.min.js +1 -1
  20. package/lib/icon/style/style.css +1 -1
  21. package/lib/icon/style/style.min.css +1 -1
  22. package/lib/index.umd.js +80 -42
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/input/src/input.js +10 -0
  25. package/lib/input/src/input.min.js +1 -1
  26. package/lib/list/src/list.js +20 -16
  27. package/lib/list/src/list.min.js +1 -1
  28. package/lib/number-input/src/number-input.js +6 -0
  29. package/lib/number-input/src/number-input.min.js +1 -1
  30. package/lib/select/src/select.js +2 -2
  31. package/lib/select/src/select.min.js +1 -1
  32. package/lib/style.css +1 -1
  33. package/lib/style.min.css +1 -1
  34. package/lib/textarea/src/textarea.js +7 -0
  35. package/lib/textarea/src/textarea.min.js +1 -1
  36. package/lib/tree/src/tree.js +22 -20
  37. package/lib/tree/src/tree.min.js +1 -1
  38. package/lib/tree-select/src/tree-select.js +9 -0
  39. package/lib/tree-select/src/tree-select.min.js +1 -1
  40. package/lib/tree-select/style/style.css +6 -0
  41. package/lib/tree-select/style/style.min.css +1 -1
  42. package/lib/ui/index.js +1 -1
  43. package/lib/ui/index.min.js +1 -1
  44. package/lib/ui/src/log.js +1 -1
  45. package/lib/ui/src/log.min.js +1 -1
  46. package/lib/vxe-tree-select/style/style.css +6 -0
  47. package/lib/vxe-tree-select/style/style.min.css +1 -1
  48. package/package.json +1 -1
  49. package/packages/cascader/src/cascader.ts +2 -2
  50. package/packages/input/src/input.ts +10 -0
  51. package/packages/list/src/list.ts +16 -10
  52. package/packages/number-input/src/number-input.ts +6 -0
  53. package/packages/select/src/select.ts +2 -2
  54. package/packages/textarea/src/textarea.ts +7 -0
  55. package/packages/tree/src/tree.ts +19 -13
  56. package/packages/tree-select/src/tree-select.ts +9 -0
  57. package/styles/components/tree-select.scss +7 -0
  58. package/types/components/grid.d.ts +176 -0
  59. package/types/components/tree-select.d.ts +10 -4
  60. /package/es/icon/{iconfont.1785727475628.ttf → iconfont.1785940501934.ttf} +0 -0
  61. /package/es/icon/{iconfont.1785727475628.woff → iconfont.1785940501934.woff} +0 -0
  62. /package/es/icon/{iconfont.1785727475628.woff2 → iconfont.1785940501934.woff2} +0 -0
  63. /package/es/{iconfont.1785727475628.ttf → iconfont.1785940501934.ttf} +0 -0
  64. /package/es/{iconfont.1785727475628.woff → iconfont.1785940501934.woff} +0 -0
  65. /package/es/{iconfont.1785727475628.woff2 → iconfont.1785940501934.woff2} +0 -0
  66. /package/lib/icon/style/{iconfont.1785727475628.ttf → iconfont.1785940501934.ttf} +0 -0
  67. /package/lib/icon/style/{iconfont.1785727475628.woff → iconfont.1785940501934.woff} +0 -0
  68. /package/lib/icon/style/{iconfont.1785727475628.woff2 → iconfont.1785940501934.woff2} +0 -0
  69. /package/lib/{iconfont.1785727475628.ttf → iconfont.1785940501934.ttf} +0 -0
  70. /package/lib/{iconfont.1785727475628.woff → iconfont.1785940501934.woff} +0 -0
  71. /package/lib/{iconfont.1785727475628.woff2 → iconfont.1785940501934.woff2} +0 -0
@@ -490,6 +490,8 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
490
490
  emitInputEvent: function emitInputEvent(inputValue, evnt) {
491
491
  var $xeNumberInput = this;
492
492
  var reactData = $xeNumberInput.reactData;
493
+ var $xeForm = $xeNumberInput.$xeForm;
494
+ var formItemInfo = $xeNumberInput.formItemInfo;
493
495
  var inpImmediate = $xeNumberInput.computeInpImmediate;
494
496
  var value = inputValue === (0, _utils.eqEmptyValue)(inputValue) ? null : _xeUtils.default.toNumber(inputValue);
495
497
  reactData.inputValue = inputValue;
@@ -499,6 +501,10 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
499
501
  $xeNumberInput.dispatchEvent('input', {
500
502
  value: value
501
503
  }, evnt);
504
+ // 自动更新校验状态
505
+ if ($xeForm && formItemInfo) {
506
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
507
+ }
502
508
  }
503
509
  },
504
510
  inputEvent: function inputEvent(evnt) {
@@ -1 +1 @@
1
- function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_utils=require("../../ui/src/utils"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_util=require("./util");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,u=Array(t);n<t;n++)u[n]=e[n];return u}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var u,i,r,a,l=[],o=!0,s=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;o=!1}else for(;!(o=(u=r.call(n)).done)&&(l.push(u.value),l.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{if(!o&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}function _arrayWithHoles(e){if(Array.isArray(e))return e}var handleNumberString=function(e){return _xeUtils.default.eqNull(e)?"":"".concat(e)},_default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeNumberInput",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number],immediate:{type:Boolean,default:!0},name:String,type:{type:String,default:"number"},clearable:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.clearable}},readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},placeholder:String,maxLength:{type:[String,Number],default:function(){return(0,_ui.getConfig)().numberInput.maxLength}},autoComplete:{type:String,default:"off"},align:String,form:String,className:String,size:{type:String,default:function(){return(0,_ui.getConfig)().numberInput.size||(0,_ui.getConfig)().size}},min:{type:[String,Number],default:null},max:{type:[String,Number],default:null},step:[String,Number],exponential:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.exponential}},showCurrency:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.showCurrency}},currencySymbol:{type:String,default:function(){return(0,_ui.getConfig)().numberInput.currencySymbol}},controlConfig:Object,roundingMode:{type:String,default:function(){return(0,_ui.getConfig)().numberInput.roundingMode}},digits:{type:[String,Number],default:null},autoFill:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.autoFill}},editable:{type:Boolean,default:!0},plusIcon:String,minusIcon:String,prefixIcon:String,prefixConfig:Object,suffixIcon:String,suffixConfig:Object,controls:{type:Boolean,default:null},maxlength:[String,Number],autocomplete:String},inject:{$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{isFocus:!1,isActivated:!1,inputValue:""},internalData:{}}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeDigitsValue:function(){var e=this.type,t=this.digits;return null===t&&null===(t=(0,_ui.getConfig)().numberInput.digits)&&"amount"===e&&(t=2),_xeUtils.default.toInteger(t)||1},computeControlOpts:function(){return Object.assign({},(0,_ui.getConfig)().numberInput.controlConfig,this.controlConfig)},computePrefixOpts:function(){return Object.assign({},(0,_ui.getConfig)().numberInput.prefixConfig,this.prefixConfig)},computeSuffixOpts:function(){return Object.assign({},(0,_ui.getConfig)().numberInput.suffixConfig,this.suffixConfig)},computeDecimalsType:function(){var e=this.type;return"float"===e||"amount"===e},computeStepValue:function(){var e=this.type,t=this.computeDigitsValue,n=this.computeDecimalsType,u=this.step;return"integer"===e?_xeUtils.default.toInteger(u)||1:n?_xeUtils.default.toNumber(u)||1/Math.pow(10,t):_xeUtils.default.toNumber(u)||1},computeIsClearable:function(){return this.clearable},computeInputReadonly:function(){var e=this.editable;return this.computeFormReadonly||!e},computeInpPlaceholder:function(){var e=this.placeholder;return(e=e||(0,_ui.getConfig)().numberInput.placeholder)?(0,_utils.getFuncText)(e):(0,_ui.getI18n)("vxe.base.pleaseInput")},computeInpMaxLength:function(){var e=this,t=e.type,n=e.maxLength,u=e.maxlength,i=e.min,e=e.max,r=this.computeDigitsValue;return(0,_utils.eqEmptyValue)(i)||(0,_utils.eqEmptyValue)(e)?n||u?_xeUtils.default.toNumber(n||u):16:"".concat(e).length+("integer"===t?0:r+1)+(0<=_xeUtils.default.toNumber(i)?0:1)},computeInpImmediate:function(){return this.immediate},computeNumValue:function(){var e=this.reactData,t=this.type,e=e.inputValue;return"integer"===t?_xeUtils.default.toInteger((0,_util.handleNumber)(e)):_xeUtils.default.toNumber((0,_util.handleNumber)(e))},computeNumLabel:function(){var e=this,t=this.reactData,n=e.type,u=e.roundingMode,i=e.showCurrency,r=e.currencySymbol,e=e.autoFill,t=t.inputValue,a=this.computeDigitsValue;return"amount"===n?(n=_xeUtils.default.toNumber(t),a={digits:a},"floor"===u?a.floor=!0:"ceil"===u?a.ceil=!0:a.round=!0,u=_xeUtils.default.commafy(n,a),!e&&(a=(n=_slicedToArray(u.split("."),2))[0],e=n[1])&&(u=(n=e.replace(/0+$/,""))?[a,".",n].join(""):a),i?"".concat(r||(0,_ui.getI18n)("vxe.numberInput.currencySymbol")||"").concat(u):u):_xeUtils.default.toString(t)},computeIsDisabledSubtractNumber:function(){var e=this.reactData,t=this.min,e=e.inputValue,n=this.computeNumValue;return!(!e&&0!==e||null===t)&&n<=_xeUtils.default.toNumber(t)},computeIsDisabledAddNumber:function(){var e=this.reactData,t=this.max,e=e.inputValue,n=this.computeNumValue;return!(!e&&0!==e||null===t)&&n>=_xeUtils.default.toNumber(t)}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$numberInput:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},focus:function(){var e,t=this.reactData;return this.computeInputReadonly||(e=this.$refs.refInputTarget,t.isActivated=!0,e.focus()),this.$nextTick()},blur:function(){var e=this.reactData;return this.$refs.refInputTarget.blur(),e.isActivated=!1,this.$nextTick()},select:function(){var e=this.reactData;return this.$refs.refInputTarget.select(),e.isActivated=!1,this.$nextTick()},getNumberValue:function(e){var t=this.type,n=this.exponential,u=this.roundingMode,i=this.autoFill,r=this.computeInpMaxLength,a=this.computeDigitsValue,l="";return this.computeDecimalsType?(l=(0,_util.toFloatValueFixed)(e,t,a,u),i||(l=handleNumberString(_xeUtils.default.toNumber(l)))):l=handleNumberString(e),!n||e!==l&&handleNumberString(e).toLowerCase()!==_xeUtils.default.toNumber(l).toExponential()?l.slice(0,r):e},triggerEvent:function(e){var t=this.reactData.inputValue;this.dispatchEvent(e.type,{value:t},e)},handleChange:function(e,t,n){var u=this,i=u,r=u.reactData,a=u.internalData,l=u.$xeForm,o=u.formItemInfo,e=(0,_utils.eqEmptyValue)(e)?null:Number(e),i=e!==i.value;i&&(a.isUM=!0,u.emitModel(e)),r.inputValue!==t&&u.$nextTick(function(){r.inputValue=t||""}),u.dispatchEvent("input",{value:e},n),i&&(u.dispatchEvent("change",{value:e},n),l)&&o&&l.triggerItemEvent(n,o.itemConfig.field,e)},emitInputEvent:function(e,t){var n=this.reactData,u=this.computeInpImmediate,i=e===(0,_utils.eqEmptyValue)(e)?null:_xeUtils.default.toNumber(e);n.inputValue=e,u?this.handleChange(i,e,t):this.dispatchEvent("input",{value:i},t)},inputEvent:function(e){var t=e.target.value;this.emitInputEvent(t,e)},changeEvent:function(e){var t=this.reactData;this.computeInpImmediate||this.triggerEvent(e),this.dispatchEvent("lazy-change",{value:t.inputValue},e)},focusEvent:function(e){var t,n=this.reactData;this.computeInputReadonly||(t=n.inputValue,n.inputValue=(0,_utils.eqEmptyValue)(t)?"":"".concat(_xeUtils.default.toNumber(t)),n.isFocus=!0,n.isActivated=!0,this.triggerEvent(e))},clickPrefixEvent:function(e){var t=this.reactData;this.computeIsDisabled||(t=t.inputValue,this.dispatchEvent("prefix-click",{value:t},e))},clearValueEvent:function(e,t){this.focus(),this.handleChange(null,"",e),this.dispatchEvent("clear",{value:t},e),this.dispatchEvent("lazy-change",{value:t},e)},clickSuffixEvent:function(e){var t=this.reactData;this.computeIsDisabled||(t=t.inputValue,this.dispatchEvent("suffix-click",{value:t},e))},updateModel:function(e){var t,n=this.reactData,u=this.type,i=this.roundingMode,r=this.autoFill,a=n.inputValue,l=this.computeDigitsValue,o=this.computeDecimalsType;(0,_utils.eqEmptyValue)(e)?n.inputValue="":(t=""+e,o&&(t=(0,_util.toFloatValueFixed)(e,u,l,i),r||(t=""+_xeUtils.default.toNumber(t))),t!==a&&(n.inputValue=t))},initValue:function(){var e,t,n=this,u=n.reactData,i=n.type,r=n.autoFill,a=u.inputValue;n.computeDecimalsType&&a&&(e="",t=null,a&&(e=(0,_util.toFloatValueFixed)(a,i,n.computeDigitsValue,n.roundingMode),t=_xeUtils.default.toNumber(e),r||(e="".concat(t))),a!==t?n.handleChange(t,e,{type:"init"}):u.inputValue=e)},validMaxNum:function(e){return null===this.max||""===this.max||_xeUtils.default.toNumber(e)<=_xeUtils.default.toNumber(this.max)},validMinNum:function(e){return null===this.min||""===this.min||_xeUtils.default.toNumber(e)>=_xeUtils.default.toNumber(this.min)},afterCheckValue:function(){var e,t,n=this,u=n.reactData,i=n.type,r=n.min,a=n.max,l=n.exponential,u=u.inputValue;n.computeInputReadonly||((0,_utils.eqEmptyValue)(u)?(e=null,t=u,!r&&0!==r||(e=_xeUtils.default.toNumber(r),t="".concat(e)),n.handleChange(e,"".concat(t||""),{type:"check"})):(u||r||a)&&(e="integer"===i?_xeUtils.default.toInteger((0,_util.handleNumber)(u)):_xeUtils.default.toNumber((0,_util.handleNumber)(u)),n.validMinNum(e)?n.validMaxNum(e)||(e=a):e=r,l&&(t=handleNumberString(u).toLowerCase())===_xeUtils.default.toNumber(e).toExponential()&&(e=t),i=n.getNumberValue(e),n.handleChange((0,_utils.eqEmptyValue)(i)?null:Number(i),i,{type:"check"})))},blurEvent:function(e){var t=this,n=t.reactData,u=t.$xeForm,i=t.formItemInfo,r=n.inputValue,a=t.computeInpImmediate,l=r?Number(r):null;a||t.handleChange(l,handleNumberString(r),e),t.afterCheckValue(),n.isFocus=!1,n.isActivated=!1,t.dispatchEvent("blur",{value:l},e),u&&i&&u.triggerItemEvent(e,i.itemConfig.field,l)},numberChange:function(e,t){var n=this,u=n.reactData,i=n.min,r=n.max,u=u.inputValue,a=n.computeStepValue,u="integer"===n.type?_xeUtils.default.toInteger((0,_util.handleNumber)(u)):_xeUtils.default.toNumber((0,_util.handleNumber)(u)),e=e?_xeUtils.default.add(u,a):_xeUtils.default.subtract(u,a),u=n.validMinNum(e)?n.validMaxNum(e)?e:r:i;n.emitInputEvent(n.getNumberValue(u),t)},numberPlusEvent:function(e){var t=this,n=t.reactData;t.computeIsDisabled||t.computeFormReadonly||t.computeIsDisabledAddNumber||t.numberChange(!0,e),n.isActivated=!0,t.dispatchEvent("plus-number",{value:n.inputValue},e),t.dispatchEvent("lazy-change",{value:n.inputValue},e),t.dispatchEvent("next-number",{value:n.inputValue},e)},numberMinusEvent:function(e){var t=this,n=t.reactData;t.computeIsDisabled||t.computeFormReadonly||t.computeIsDisabledSubtractNumber||t.numberChange(!1,e),n.isActivated=!0,t.dispatchEvent("minus-number",{value:n.inputValue},e),t.dispatchEvent("lazy-change",{value:n.inputValue},e),t.dispatchEvent("prev-number",{value:n.inputValue},e)},numberKeydownEvent:function(e){var t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);(t||n)&&(e.preventDefault(),t?this.numberPlusEvent(e):this.numberMinusEvent(e))},keydownEvent:function(e){var t=this,n=t.type,u=t.exponential,i=t.controls,r=t.computeControlOpts,a=r.isArrow,l=t.computeInputReadonly,o=(0,_dom.hasControlKey)(e),s=e.shiftKey,c=e.altKey,m=e.keyCode,p=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),f=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),d=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);o||s||c||(_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.SPACEBAR)||"integer"===n&&110===m||(!u||69!==m)&&65<=m&&m<=90||186<=m&&m<=188||191<=m)&&e.preventDefault(),p?t.afterCheckValue():(f||d)&&(0,_utils.isEnableConf)(r)&&(!1===i?i:a)&&!l&&t.numberKeydownEvent(e),t.triggerEvent(e)},keyupEvent:function(e){this.triggerEvent(e)},stopDown:function(){var e=this.internalData,t=e.dnTimeout;t&&(clearTimeout(t),e.dnTimeout=void 0)},stopAutoIncrement:function(){var e=this.internalData,t=e.ainTimeout;t&&(clearTimeout(t),e.ainTimeout=void 0)},numberDownMinusEvent:function(e){var t=this,n=t.internalData;t.numberStopAll(),n.ainTimeout=setTimeout(function(){t.numberMinusEvent(e),t.numberDownMinusEvent(e)},60)},numberDownPlusEvent:function(e){var t=this,n=t.internalData;t.numberStopAll(),n.ainTimeout=setTimeout(function(){t.numberPlusEvent(e),t.numberDownPlusEvent(e)},60)},numberStopAll:function(){this.stopDown(),this.stopAutoIncrement()},numberClickEvent:function(e){var t=this.internalData;t.isMouseDown?t.isMouseDown=!1:(this.numberStopAll(),(0,_dom.hasClass)(e.currentTarget,"is--plus")?this.numberPlusEvent(e):this.numberMinusEvent(e))},numberMousedownEvent:function(e){var t,n=this,u=n.internalData;n.numberStopAll(),u.isMouseDown=!0,0===e.button&&((t=(0,_dom.hasClass)(e.currentTarget,"is--plus"))?n.numberPlusEvent(e):n.numberMinusEvent(e),u.dnTimeout=setTimeout(function(){t?n.numberDownPlusEvent(e):n.numberDownMinusEvent(e)},500))},wheelEvent:function(e){var t=this,n=t.reactData,u=t.controls,i=t.computeControlOpts,r=i.isWheel,a=t.computeInputReadonly;(0,_utils.isEnableConf)(i)&&(!1===u?u:r)&&!a&&n.isActivated&&(e.stopPropagation(),e.preventDefault(),0<(i=e.deltaY)?t.numberMinusEvent(e):i<0&&t.numberPlusEvent(e)),t.triggerEvent(e)},clickEvent:function(e){this.triggerEvent(e)},handleGlobalMousedownEvent:function(e){var t=this,n=t.reactData,u=n.isActivated,i=t.$refs.refElem,r=t.$refs.refInputPanel,a=t.computeInpImmediate;t.computeIsDisabled||t.computeInputReadonly||!u||(n.isActivated=(0,_dom.getEventTargetNode)(e,i).flag||(0,_dom.getEventTargetNode)(e,r).flag,n.isActivated)||(a||(i=(u=n.inputValue)?Number(u):null,t.handleChange(i,handleNumberString(u),e)),t.afterCheckValue())},handleGlobalKeydownEvent:function(e){var t,n,u,i=this,r=i.reactData,a=i.clearable;i.computeIsDisabled||i.computeInputReadonly||(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.TAB),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.DELETE),u=r.isActivated,t&&(u&&i.afterCheckValue(),r.isActivated=u=!1),n&&a&&u&&i.clearValueEvent(e,null))},handleGlobalBlurEvent:function(){this.reactData.isActivated&&this.afterCheckValue()},renderPrefixIcon:function(e){var t=this,n=t.$scopedSlots,u=t.prefixIcon,i=t.computePrefixOpts,n=n.prefix,u=u||i.icon,i=i.content;return n||u||i?e("div",{class:"vxe-number-input--prefix",on:{click:t.clickPrefixEvent}},[e("div",{class:"vxe-number-input--prefix-icon"},n?(0,_vn.getSlotVNs)(n({})):[u?e("i",{class:u}):(0,_ui.renderEmptyElement)(t),i?e("span",{class:"vxe-prefix-input--suffix-text"},"".concat(i)):(0,_ui.renderEmptyElement)(t)])]):(0,_ui.renderEmptyElement)(t)},renderSuffixIcon:function(e){var t=this,n=t.reactData,u=t.suffixIcon,n=n.inputValue,i=t.$scopedSlots.suffix,r=t.computeSuffixOpts,a=t.computeIsClearable,u=u||r.icon,r=r.content;return e("div",{class:["vxe-number-input--suffix",{"is--clear":a&&!t.computeIsDisabled&&!(""===n||_xeUtils.default.eqNull(n))}]},[a?e("div",{class:"vxe-number-input--clear-icon",on:{click:t.clearValueEvent}},[e("i",{class:(0,_ui.getIcon)().INPUT_CLEAR})]):(0,_ui.renderEmptyElement)(t),i||u||r?e("div",{class:"vxe-number-input--suffix-icon",on:{click:t.clickSuffixEvent}},i?(0,_vn.getSlotVNs)(i({})):[u?e("i",{class:u}):(0,_ui.renderEmptyElement)(t),r?e("span",{class:"vxe-number-input--suffix-text"},"".concat(r)):(0,_ui.renderEmptyElement)(t)]):(0,_ui.renderEmptyElement)(t)])},renderInput:function(e){var t=this,n=t.reactData,u=t.type,i=t.name,r=t.autocomplete,a=t.autoComplete,l=n.inputValue,n=n.isFocus,o=t.computeIsDisabled,s=t.computeNumLabel,c=t.computeInputReadonly,m=t.computeInpMaxLength,p=t.computeInpPlaceholder;return e("div",{key:"ni",class:"vxe-number-input--input-wrapper"},[t.renderPrefixIcon(e),e("div",{class:"vxe-number-input--input-inner"},[e("input",{ref:"refInputTarget",class:"vxe-number-input--input",domProps:{value:n||"amount"!==u?l:s},attrs:{name:i,type:"text",placeholder:p,maxlength:m,readonly:c,disabled:o,autocomplete:a||r},on:{keydown:t.keydownEvent,keyup:t.keyupEvent,click:t.clickEvent,input:t.inputEvent,change:t.changeEvent,focus:t.focusEvent,blur:t.blurEvent}})]),t.renderSuffixIcon(e)])},renderMinusBtn:function(e){var t=this,n=t.minusIcon;return e("button",{key:"prev",class:["vxe-number-input--minus-btn is--minus",{"is--disabled":t.computeIsDisabledSubtractNumber}],attrs:{type:"button"},on:{click:t.numberClickEvent,mousedown:t.numberMousedownEvent,mouseup:t.numberStopAll,mouseleave:t.numberStopAll}},[e("i",{class:n||(0,_ui.getIcon)().NUMBER_INPUT_MINUS_NUM})])},renderPlusBtn:function(e){var t=this,n=t.plusIcon;return e("button",{key:"next",class:["vxe-number-input--plus-btn is--plus",{"is--disabled":t.computeIsDisabledAddNumber}],attrs:{type:"button"},on:{click:t.numberClickEvent,mousedown:t.numberMousedownEvent,mouseup:t.numberStopAll,mouseleave:t.numberStopAll}},[e("i",{class:n||(0,_ui.getIcon)().NUMBER_INPUT_PLUS_NUM})])},renderSideControl:function(e){return e("div",{key:"cplr",class:"vxe-number-input--side-control"},[this.renderPlusBtn(e),this.renderMinusBtn(e)])},renderVN:function(e){var t,n=this,u=n.reactData,i=n.$scopedSlots,r=n.className,a=n.controls,l=n.type,o=n.align,s=n.prefixIcon,c=n.suffixIcon,m=u.inputValue,u=u.isActivated,p=n.computeSize,f=n.computeControlOpts,d=f.layout,v=f.showButton,h=n.computeIsDisabled,b=n.computeNumLabel,g=i.prefix,i=i.suffix;return n.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-number-input--readonly","type--".concat(l),r]},b):(b=n.computeInputReadonly,t=n.computeIsClearable,f=(0,_utils.isEnableConf)(f)&&(!1===a?a:v),e("div",{ref:"refElem",class:["vxe-number-input","type--".concat(l),"ctl--".concat("right"===d||"left"===d?d:"default"),r,_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(p),p),"is--".concat(o),o),"is--controls",f&&!b),"is--prefix",!!g||s),"is--suffix",!!i||c),"is--disabled",h),"is--active",u),"show--clear",t&&!h&&!(""===m||_xeUtils.default.eqNull(m)))],attrs:{spellcheck:!1}},f?"right"===d?[n.renderInput(e),n.renderSideControl(e)]:"left"===d?[n.renderSideControl(e),n.renderInput(e)]:[n.renderMinusBtn(e),n.renderInput(e),n.renderPlusBtn(e)]:[n.renderInput(e)]))}},watch:{value:function(e){var t=this.internalData;t.isUM||this.updateModel(e),t.isUM=!1},type:function(){var e=this.reactData;Object.assign(e,{inputValue:this.value}),this.initValue()}},created:function(){this.updateModel(this.value),this.initValue()},mounted:function(){var e=this,t=e.$refs.refInputTarget;t&&t.addEventListener("wheel",e.wheelEvent,{passive:!1}),_ui.globalEvents.on(e,"mousedown",e.handleGlobalMousedownEvent),_ui.globalEvents.on(e,"keydown",e.handleGlobalKeydownEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent)},beforeDestroy:function(){var e=this,t=(e.reactData.isFocus=!1,e.numberStopAll(),e.afterCheckValue(),e.$refs.refInputTarget);t&&t.removeEventListener("wheel",e.wheelEvent),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"keydown"),_ui.globalEvents.off(e,"blur")},render:function(e){return this.renderVN(e)}});
1
+ function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_utils=require("../../ui/src/utils"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_util=require("./util");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,u=Array(t);n<t;n++)u[n]=e[n];return u}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var u,i,r,a,l=[],o=!0,s=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;o=!1}else for(;!(o=(u=r.call(n)).done)&&(l.push(u.value),l.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{if(!o&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}function _arrayWithHoles(e){if(Array.isArray(e))return e}var handleNumberString=function(e){return _xeUtils.default.eqNull(e)?"":"".concat(e)},_default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeNumberInput",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number],immediate:{type:Boolean,default:!0},name:String,type:{type:String,default:"number"},clearable:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.clearable}},readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},placeholder:String,maxLength:{type:[String,Number],default:function(){return(0,_ui.getConfig)().numberInput.maxLength}},autoComplete:{type:String,default:"off"},align:String,form:String,className:String,size:{type:String,default:function(){return(0,_ui.getConfig)().numberInput.size||(0,_ui.getConfig)().size}},min:{type:[String,Number],default:null},max:{type:[String,Number],default:null},step:[String,Number],exponential:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.exponential}},showCurrency:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.showCurrency}},currencySymbol:{type:String,default:function(){return(0,_ui.getConfig)().numberInput.currencySymbol}},controlConfig:Object,roundingMode:{type:String,default:function(){return(0,_ui.getConfig)().numberInput.roundingMode}},digits:{type:[String,Number],default:null},autoFill:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.autoFill}},editable:{type:Boolean,default:!0},plusIcon:String,minusIcon:String,prefixIcon:String,prefixConfig:Object,suffixIcon:String,suffixConfig:Object,controls:{type:Boolean,default:null},maxlength:[String,Number],autocomplete:String},inject:{$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{isFocus:!1,isActivated:!1,inputValue:""},internalData:{}}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeDigitsValue:function(){var e=this.type,t=this.digits;return null===t&&null===(t=(0,_ui.getConfig)().numberInput.digits)&&"amount"===e&&(t=2),_xeUtils.default.toInteger(t)||1},computeControlOpts:function(){return Object.assign({},(0,_ui.getConfig)().numberInput.controlConfig,this.controlConfig)},computePrefixOpts:function(){return Object.assign({},(0,_ui.getConfig)().numberInput.prefixConfig,this.prefixConfig)},computeSuffixOpts:function(){return Object.assign({},(0,_ui.getConfig)().numberInput.suffixConfig,this.suffixConfig)},computeDecimalsType:function(){var e=this.type;return"float"===e||"amount"===e},computeStepValue:function(){var e=this.type,t=this.computeDigitsValue,n=this.computeDecimalsType,u=this.step;return"integer"===e?_xeUtils.default.toInteger(u)||1:n?_xeUtils.default.toNumber(u)||1/Math.pow(10,t):_xeUtils.default.toNumber(u)||1},computeIsClearable:function(){return this.clearable},computeInputReadonly:function(){var e=this.editable;return this.computeFormReadonly||!e},computeInpPlaceholder:function(){var e=this.placeholder;return(e=e||(0,_ui.getConfig)().numberInput.placeholder)?(0,_utils.getFuncText)(e):(0,_ui.getI18n)("vxe.base.pleaseInput")},computeInpMaxLength:function(){var e=this,t=e.type,n=e.maxLength,u=e.maxlength,i=e.min,e=e.max,r=this.computeDigitsValue;return(0,_utils.eqEmptyValue)(i)||(0,_utils.eqEmptyValue)(e)?n||u?_xeUtils.default.toNumber(n||u):16:"".concat(e).length+("integer"===t?0:r+1)+(0<=_xeUtils.default.toNumber(i)?0:1)},computeInpImmediate:function(){return this.immediate},computeNumValue:function(){var e=this.reactData,t=this.type,e=e.inputValue;return"integer"===t?_xeUtils.default.toInteger((0,_util.handleNumber)(e)):_xeUtils.default.toNumber((0,_util.handleNumber)(e))},computeNumLabel:function(){var e=this,t=this.reactData,n=e.type,u=e.roundingMode,i=e.showCurrency,r=e.currencySymbol,e=e.autoFill,t=t.inputValue,a=this.computeDigitsValue;return"amount"===n?(n=_xeUtils.default.toNumber(t),a={digits:a},"floor"===u?a.floor=!0:"ceil"===u?a.ceil=!0:a.round=!0,u=_xeUtils.default.commafy(n,a),!e&&(a=(n=_slicedToArray(u.split("."),2))[0],e=n[1])&&(u=(n=e.replace(/0+$/,""))?[a,".",n].join(""):a),i?"".concat(r||(0,_ui.getI18n)("vxe.numberInput.currencySymbol")||"").concat(u):u):_xeUtils.default.toString(t)},computeIsDisabledSubtractNumber:function(){var e=this.reactData,t=this.min,e=e.inputValue,n=this.computeNumValue;return!(!e&&0!==e||null===t)&&n<=_xeUtils.default.toNumber(t)},computeIsDisabledAddNumber:function(){var e=this.reactData,t=this.max,e=e.inputValue,n=this.computeNumValue;return!(!e&&0!==e||null===t)&&n>=_xeUtils.default.toNumber(t)}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$numberInput:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},focus:function(){var e,t=this.reactData;return this.computeInputReadonly||(e=this.$refs.refInputTarget,t.isActivated=!0,e.focus()),this.$nextTick()},blur:function(){var e=this.reactData;return this.$refs.refInputTarget.blur(),e.isActivated=!1,this.$nextTick()},select:function(){var e=this.reactData;return this.$refs.refInputTarget.select(),e.isActivated=!1,this.$nextTick()},getNumberValue:function(e){var t=this.type,n=this.exponential,u=this.roundingMode,i=this.autoFill,r=this.computeInpMaxLength,a=this.computeDigitsValue,l="";return this.computeDecimalsType?(l=(0,_util.toFloatValueFixed)(e,t,a,u),i||(l=handleNumberString(_xeUtils.default.toNumber(l)))):l=handleNumberString(e),!n||e!==l&&handleNumberString(e).toLowerCase()!==_xeUtils.default.toNumber(l).toExponential()?l.slice(0,r):e},triggerEvent:function(e){var t=this.reactData.inputValue;this.dispatchEvent(e.type,{value:t},e)},handleChange:function(e,t,n){var u=this,i=u,r=u.reactData,a=u.internalData,l=u.$xeForm,o=u.formItemInfo,e=(0,_utils.eqEmptyValue)(e)?null:Number(e),i=e!==i.value;i&&(a.isUM=!0,u.emitModel(e)),r.inputValue!==t&&u.$nextTick(function(){r.inputValue=t||""}),u.dispatchEvent("input",{value:e},n),i&&(u.dispatchEvent("change",{value:e},n),l)&&o&&l.triggerItemEvent(n,o.itemConfig.field,e)},emitInputEvent:function(e,t){var n=this,u=n.reactData,i=n.$xeForm,r=n.formItemInfo,a=n.computeInpImmediate,l=e===(0,_utils.eqEmptyValue)(e)?null:_xeUtils.default.toNumber(e);u.inputValue=e,a?n.handleChange(l,e,t):(n.dispatchEvent("input",{value:l},t),i&&r&&i.triggerItemEvent(t,r.itemConfig.field,l))},inputEvent:function(e){var t=e.target.value;this.emitInputEvent(t,e)},changeEvent:function(e){var t=this.reactData;this.computeInpImmediate||this.triggerEvent(e),this.dispatchEvent("lazy-change",{value:t.inputValue},e)},focusEvent:function(e){var t,n=this.reactData;this.computeInputReadonly||(t=n.inputValue,n.inputValue=(0,_utils.eqEmptyValue)(t)?"":"".concat(_xeUtils.default.toNumber(t)),n.isFocus=!0,n.isActivated=!0,this.triggerEvent(e))},clickPrefixEvent:function(e){var t=this.reactData;this.computeIsDisabled||(t=t.inputValue,this.dispatchEvent("prefix-click",{value:t},e))},clearValueEvent:function(e,t){this.focus(),this.handleChange(null,"",e),this.dispatchEvent("clear",{value:t},e),this.dispatchEvent("lazy-change",{value:t},e)},clickSuffixEvent:function(e){var t=this.reactData;this.computeIsDisabled||(t=t.inputValue,this.dispatchEvent("suffix-click",{value:t},e))},updateModel:function(e){var t,n=this.reactData,u=this.type,i=this.roundingMode,r=this.autoFill,a=n.inputValue,l=this.computeDigitsValue,o=this.computeDecimalsType;(0,_utils.eqEmptyValue)(e)?n.inputValue="":(t=""+e,o&&(t=(0,_util.toFloatValueFixed)(e,u,l,i),r||(t=""+_xeUtils.default.toNumber(t))),t!==a&&(n.inputValue=t))},initValue:function(){var e,t,n=this,u=n.reactData,i=n.type,r=n.autoFill,a=u.inputValue;n.computeDecimalsType&&a&&(e="",t=null,a&&(e=(0,_util.toFloatValueFixed)(a,i,n.computeDigitsValue,n.roundingMode),t=_xeUtils.default.toNumber(e),r||(e="".concat(t))),a!==t?n.handleChange(t,e,{type:"init"}):u.inputValue=e)},validMaxNum:function(e){return null===this.max||""===this.max||_xeUtils.default.toNumber(e)<=_xeUtils.default.toNumber(this.max)},validMinNum:function(e){return null===this.min||""===this.min||_xeUtils.default.toNumber(e)>=_xeUtils.default.toNumber(this.min)},afterCheckValue:function(){var e,t,n=this,u=n.reactData,i=n.type,r=n.min,a=n.max,l=n.exponential,u=u.inputValue;n.computeInputReadonly||((0,_utils.eqEmptyValue)(u)?(e=null,t=u,!r&&0!==r||(e=_xeUtils.default.toNumber(r),t="".concat(e)),n.handleChange(e,"".concat(t||""),{type:"check"})):(u||r||a)&&(e="integer"===i?_xeUtils.default.toInteger((0,_util.handleNumber)(u)):_xeUtils.default.toNumber((0,_util.handleNumber)(u)),n.validMinNum(e)?n.validMaxNum(e)||(e=a):e=r,l&&(t=handleNumberString(u).toLowerCase())===_xeUtils.default.toNumber(e).toExponential()&&(e=t),i=n.getNumberValue(e),n.handleChange((0,_utils.eqEmptyValue)(i)?null:Number(i),i,{type:"check"})))},blurEvent:function(e){var t=this,n=t.reactData,u=t.$xeForm,i=t.formItemInfo,r=n.inputValue,a=t.computeInpImmediate,l=r?Number(r):null;a||t.handleChange(l,handleNumberString(r),e),t.afterCheckValue(),n.isFocus=!1,n.isActivated=!1,t.dispatchEvent("blur",{value:l},e),u&&i&&u.triggerItemEvent(e,i.itemConfig.field,l)},numberChange:function(e,t){var n=this,u=n.reactData,i=n.min,r=n.max,u=u.inputValue,a=n.computeStepValue,u="integer"===n.type?_xeUtils.default.toInteger((0,_util.handleNumber)(u)):_xeUtils.default.toNumber((0,_util.handleNumber)(u)),e=e?_xeUtils.default.add(u,a):_xeUtils.default.subtract(u,a),u=n.validMinNum(e)?n.validMaxNum(e)?e:r:i;n.emitInputEvent(n.getNumberValue(u),t)},numberPlusEvent:function(e){var t=this,n=t.reactData;t.computeIsDisabled||t.computeFormReadonly||t.computeIsDisabledAddNumber||t.numberChange(!0,e),n.isActivated=!0,t.dispatchEvent("plus-number",{value:n.inputValue},e),t.dispatchEvent("lazy-change",{value:n.inputValue},e),t.dispatchEvent("next-number",{value:n.inputValue},e)},numberMinusEvent:function(e){var t=this,n=t.reactData;t.computeIsDisabled||t.computeFormReadonly||t.computeIsDisabledSubtractNumber||t.numberChange(!1,e),n.isActivated=!0,t.dispatchEvent("minus-number",{value:n.inputValue},e),t.dispatchEvent("lazy-change",{value:n.inputValue},e),t.dispatchEvent("prev-number",{value:n.inputValue},e)},numberKeydownEvent:function(e){var t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);(t||n)&&(e.preventDefault(),t?this.numberPlusEvent(e):this.numberMinusEvent(e))},keydownEvent:function(e){var t=this,n=t.type,u=t.exponential,i=t.controls,r=t.computeControlOpts,a=r.isArrow,l=t.computeInputReadonly,o=(0,_dom.hasControlKey)(e),s=e.shiftKey,c=e.altKey,m=e.keyCode,p=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),f=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),d=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);o||s||c||(_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.SPACEBAR)||"integer"===n&&110===m||(!u||69!==m)&&65<=m&&m<=90||186<=m&&m<=188||191<=m)&&e.preventDefault(),p?t.afterCheckValue():(f||d)&&(0,_utils.isEnableConf)(r)&&(!1===i?i:a)&&!l&&t.numberKeydownEvent(e),t.triggerEvent(e)},keyupEvent:function(e){this.triggerEvent(e)},stopDown:function(){var e=this.internalData,t=e.dnTimeout;t&&(clearTimeout(t),e.dnTimeout=void 0)},stopAutoIncrement:function(){var e=this.internalData,t=e.ainTimeout;t&&(clearTimeout(t),e.ainTimeout=void 0)},numberDownMinusEvent:function(e){var t=this,n=t.internalData;t.numberStopAll(),n.ainTimeout=setTimeout(function(){t.numberMinusEvent(e),t.numberDownMinusEvent(e)},60)},numberDownPlusEvent:function(e){var t=this,n=t.internalData;t.numberStopAll(),n.ainTimeout=setTimeout(function(){t.numberPlusEvent(e),t.numberDownPlusEvent(e)},60)},numberStopAll:function(){this.stopDown(),this.stopAutoIncrement()},numberClickEvent:function(e){var t=this.internalData;t.isMouseDown?t.isMouseDown=!1:(this.numberStopAll(),(0,_dom.hasClass)(e.currentTarget,"is--plus")?this.numberPlusEvent(e):this.numberMinusEvent(e))},numberMousedownEvent:function(e){var t,n=this,u=n.internalData;n.numberStopAll(),u.isMouseDown=!0,0===e.button&&((t=(0,_dom.hasClass)(e.currentTarget,"is--plus"))?n.numberPlusEvent(e):n.numberMinusEvent(e),u.dnTimeout=setTimeout(function(){t?n.numberDownPlusEvent(e):n.numberDownMinusEvent(e)},500))},wheelEvent:function(e){var t=this,n=t.reactData,u=t.controls,i=t.computeControlOpts,r=i.isWheel,a=t.computeInputReadonly;(0,_utils.isEnableConf)(i)&&(!1===u?u:r)&&!a&&n.isActivated&&(e.stopPropagation(),e.preventDefault(),0<(i=e.deltaY)?t.numberMinusEvent(e):i<0&&t.numberPlusEvent(e)),t.triggerEvent(e)},clickEvent:function(e){this.triggerEvent(e)},handleGlobalMousedownEvent:function(e){var t=this,n=t.reactData,u=n.isActivated,i=t.$refs.refElem,r=t.$refs.refInputPanel,a=t.computeInpImmediate;t.computeIsDisabled||t.computeInputReadonly||!u||(n.isActivated=(0,_dom.getEventTargetNode)(e,i).flag||(0,_dom.getEventTargetNode)(e,r).flag,n.isActivated)||(a||(i=(u=n.inputValue)?Number(u):null,t.handleChange(i,handleNumberString(u),e)),t.afterCheckValue())},handleGlobalKeydownEvent:function(e){var t,n,u,i=this,r=i.reactData,a=i.clearable;i.computeIsDisabled||i.computeInputReadonly||(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.TAB),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.DELETE),u=r.isActivated,t&&(u&&i.afterCheckValue(),r.isActivated=u=!1),n&&a&&u&&i.clearValueEvent(e,null))},handleGlobalBlurEvent:function(){this.reactData.isActivated&&this.afterCheckValue()},renderPrefixIcon:function(e){var t=this,n=t.$scopedSlots,u=t.prefixIcon,i=t.computePrefixOpts,n=n.prefix,u=u||i.icon,i=i.content;return n||u||i?e("div",{class:"vxe-number-input--prefix",on:{click:t.clickPrefixEvent}},[e("div",{class:"vxe-number-input--prefix-icon"},n?(0,_vn.getSlotVNs)(n({})):[u?e("i",{class:u}):(0,_ui.renderEmptyElement)(t),i?e("span",{class:"vxe-prefix-input--suffix-text"},"".concat(i)):(0,_ui.renderEmptyElement)(t)])]):(0,_ui.renderEmptyElement)(t)},renderSuffixIcon:function(e){var t=this,n=t.reactData,u=t.suffixIcon,n=n.inputValue,i=t.$scopedSlots.suffix,r=t.computeSuffixOpts,a=t.computeIsClearable,u=u||r.icon,r=r.content;return e("div",{class:["vxe-number-input--suffix",{"is--clear":a&&!t.computeIsDisabled&&!(""===n||_xeUtils.default.eqNull(n))}]},[a?e("div",{class:"vxe-number-input--clear-icon",on:{click:t.clearValueEvent}},[e("i",{class:(0,_ui.getIcon)().INPUT_CLEAR})]):(0,_ui.renderEmptyElement)(t),i||u||r?e("div",{class:"vxe-number-input--suffix-icon",on:{click:t.clickSuffixEvent}},i?(0,_vn.getSlotVNs)(i({})):[u?e("i",{class:u}):(0,_ui.renderEmptyElement)(t),r?e("span",{class:"vxe-number-input--suffix-text"},"".concat(r)):(0,_ui.renderEmptyElement)(t)]):(0,_ui.renderEmptyElement)(t)])},renderInput:function(e){var t=this,n=t.reactData,u=t.type,i=t.name,r=t.autocomplete,a=t.autoComplete,l=n.inputValue,n=n.isFocus,o=t.computeIsDisabled,s=t.computeNumLabel,c=t.computeInputReadonly,m=t.computeInpMaxLength,p=t.computeInpPlaceholder;return e("div",{key:"ni",class:"vxe-number-input--input-wrapper"},[t.renderPrefixIcon(e),e("div",{class:"vxe-number-input--input-inner"},[e("input",{ref:"refInputTarget",class:"vxe-number-input--input",domProps:{value:n||"amount"!==u?l:s},attrs:{name:i,type:"text",placeholder:p,maxlength:m,readonly:c,disabled:o,autocomplete:a||r},on:{keydown:t.keydownEvent,keyup:t.keyupEvent,click:t.clickEvent,input:t.inputEvent,change:t.changeEvent,focus:t.focusEvent,blur:t.blurEvent}})]),t.renderSuffixIcon(e)])},renderMinusBtn:function(e){var t=this,n=t.minusIcon;return e("button",{key:"prev",class:["vxe-number-input--minus-btn is--minus",{"is--disabled":t.computeIsDisabledSubtractNumber}],attrs:{type:"button"},on:{click:t.numberClickEvent,mousedown:t.numberMousedownEvent,mouseup:t.numberStopAll,mouseleave:t.numberStopAll}},[e("i",{class:n||(0,_ui.getIcon)().NUMBER_INPUT_MINUS_NUM})])},renderPlusBtn:function(e){var t=this,n=t.plusIcon;return e("button",{key:"next",class:["vxe-number-input--plus-btn is--plus",{"is--disabled":t.computeIsDisabledAddNumber}],attrs:{type:"button"},on:{click:t.numberClickEvent,mousedown:t.numberMousedownEvent,mouseup:t.numberStopAll,mouseleave:t.numberStopAll}},[e("i",{class:n||(0,_ui.getIcon)().NUMBER_INPUT_PLUS_NUM})])},renderSideControl:function(e){return e("div",{key:"cplr",class:"vxe-number-input--side-control"},[this.renderPlusBtn(e),this.renderMinusBtn(e)])},renderVN:function(e){var t,n=this,u=n.reactData,i=n.$scopedSlots,r=n.className,a=n.controls,l=n.type,o=n.align,s=n.prefixIcon,c=n.suffixIcon,m=u.inputValue,u=u.isActivated,p=n.computeSize,f=n.computeControlOpts,d=f.layout,v=f.showButton,h=n.computeIsDisabled,b=n.computeNumLabel,g=i.prefix,i=i.suffix;return n.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-number-input--readonly","type--".concat(l),r]},b):(b=n.computeInputReadonly,t=n.computeIsClearable,f=(0,_utils.isEnableConf)(f)&&(!1===a?a:v),e("div",{ref:"refElem",class:["vxe-number-input","type--".concat(l),"ctl--".concat("right"===d||"left"===d?d:"default"),r,_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(p),p),"is--".concat(o),o),"is--controls",f&&!b),"is--prefix",!!g||s),"is--suffix",!!i||c),"is--disabled",h),"is--active",u),"show--clear",t&&!h&&!(""===m||_xeUtils.default.eqNull(m)))],attrs:{spellcheck:!1}},f?"right"===d?[n.renderInput(e),n.renderSideControl(e)]:"left"===d?[n.renderSideControl(e),n.renderInput(e)]:[n.renderMinusBtn(e),n.renderInput(e),n.renderPlusBtn(e)]:[n.renderInput(e)]))}},watch:{value:function(e){var t=this.internalData;t.isUM||this.updateModel(e),t.isUM=!1},type:function(){var e=this.reactData;Object.assign(e,{inputValue:this.value}),this.initValue()}},created:function(){this.updateModel(this.value),this.initValue()},mounted:function(){var e=this,t=e.$refs.refInputTarget;t&&t.addEventListener("wheel",e.wheelEvent,{passive:!1}),_ui.globalEvents.on(e,"mousedown",e.handleGlobalMousedownEvent),_ui.globalEvents.on(e,"keydown",e.handleGlobalKeydownEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent)},beforeDestroy:function(){var e=this,t=(e.reactData.isFocus=!1,e.numberStopAll(),e.afterCheckValue(),e.$refs.refInputTarget);t&&t.removeEventListener("wheel",e.wheelEvent),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"keydown"),_ui.globalEvents.off(e,"blur")},render:function(e){return this.renderVN(e)}});
@@ -1728,7 +1728,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
1728
1728
  }],
1729
1729
  on: ons
1730
1730
  }, [h('span', {
1731
- class: ['vxe-radio--icon', isChecked ? (0, _ui.getIcon)().RADIO_CHECKED : (0, _ui.getIcon)().RADIO_UNCHECKED]
1731
+ class: ['vxe-radio--icon', isChecked ? (0, _ui.getIcon)().RADIO_CHECKED : isDisabled ? (0, _ui.getIcon)().RADIO_DISABLED_UNCHECKED : (0, _ui.getIcon)().RADIO_UNCHECKED]
1732
1732
  })]);
1733
1733
  },
1734
1734
  renderCheckbox: function renderCheckbox(h, option, isOptGroup, isChecked, isDisabled) {
@@ -1755,7 +1755,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
1755
1755
  }],
1756
1756
  on: ons
1757
1757
  }, [h('span', {
1758
- class: ['vxe-checkbox--icon', isChecked ? (0, _ui.getIcon)().CHECKBOX_CHECKED : (0, _ui.getIcon)().CHECKBOX_UNCHECKED]
1758
+ class: ['vxe-checkbox--icon', isChecked ? (0, _ui.getIcon)().CHECKBOX_CHECKED : isDisabled ? (0, _ui.getIcon)().CHECKBOX_DISABLED_UNCHECKED : (0, _ui.getIcon)().CHECKBOX_UNCHECKED]
1759
1759
  })]);
1760
1760
  },
1761
1761
  renderOption: function renderOption(h, list) {
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_input=_interopRequireDefault(require("../../input/src/input")),_button=_interopRequireDefault(require("../../button/src/button"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}var _createComponentLog=(0,_log.createComponentLog)("select"),errLog=_createComponentLog.errLog;function isOptionVisible(e){return!1!==e.visible}function getOptUniqueId(){return _xeUtils.default.uniqueId("opt_")}function createReactData(){return{initialized:!1,scrollYLoad:!1,bodyHeight:0,topSpaceHeight:0,optList:[],staticOptions:[],reactFlag:0,currentOption:null,searchValue:"",searchLoading:!1,panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1}}function createInternalData(){return{synchData:[],fullData:[],afterVisibleList:[],optAddMaps:{},optGroupKeyMaps:{},optFullValMaps:{},remoteValMaps:{},lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0},lastScrollTime:0,hpTimeout:void 0}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeSelect",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Boolean,Array],defaultConfig:Object,emptyValue:{type:[String,Number,Boolean,Array],default:function(){return(0,_ui.getConfig)().select.emptyValue}},clearable:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.clearable}},placeholder:String,readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},multiple:Boolean,multiCharOverflow:{type:[Number,String],default:function(){return(0,_ui.getConfig)().select.multiCharOverflow}},prefixIcon:String,allowCreate:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.allowCreate}},placement:String,lazyOptions:Array,options:Array,optionProps:Object,optionGroups:Array,optionGroupProps:Object,optionConfig:Object,className:[String,Function],popupClassName:[String,Function],max:{type:[String,Number],default:null},showRadio:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showRadio}},radioConfig:Object,showCheckbox:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showCheckedButton}},checkboxConfig:Object,zIndex:Number,size:{type:String,default:function(){return(0,_ui.getConfig)().select.size||(0,_ui.getConfig)().size}},filterable:Boolean,filterMethod:Function,filterConfig:Object,remote:Boolean,remoteConfig:Object,emptyText:String,checkedClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.checkedClosable}},clearClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.clearClosable}},showCloseButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showCloseButton}},showTotalButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showTotalButton}},showCheckedButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showCheckedButton}},showClearButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showClearButton}},transfer:{type:Boolean,default:null},popupConfig:Object,virtualYConfig:Object,scrollY:Object,remoteMethod:Function,optionId:{type:String,default:function(){return(0,_ui.getConfig)().select.optionId}},optionKey:Boolean},inject:{$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},provide:function(){return{$xeSelect:this}},data:function(){var e=_xeUtils.default.uniqueId(),t=createReactData();return Object.assign(Object.assign({},{}),{xID:e,reactData:t})},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeBtnTransfer:function(){var e=this,t=e.$xeTable,n=e.$xeModal,i=e.$xeDrawer,l=e.$xeCard,o=e.$xeForm,a=e.transfer,e=e.computePopupOpts;if(_xeUtils.default.isBoolean(e.transfer))return e.transfer;if(null===a){e=(0,_ui.getConfig)().select.transfer;if(_xeUtils.default.isBoolean(e))return e;if(t||n||i||l||o)return!0}return a},computeInpPlaceholder:function(){var e=this.placeholder;return(e=e||(0,_ui.getConfig)().select.placeholder)?(0,_utils.getFuncText)(e):(0,_ui.getI18n)("vxe.base.pleaseSelect")},computeDefaultOpts:function(){return Object.assign({},this.defaultConfig)},computePropsOpts:function(){return Object.assign({},this.optionProps)},computeGroupPropsOpts:function(){return Object.assign({},this.optionGroupProps)},computeLabelField:function(){return this.computePropsOpts.label||"label"},computeValueField:function(){return this.computePropsOpts.value||"value"},computeGroupLabelField:function(){return this.computeGroupPropsOpts.label||"label"},computeGroupOptionsField:function(){return this.computeGroupPropsOpts.options||"options"},computeIsMaximize:function(){var e=this.computeSelectVals;return this.checkMaxLimit(e)},computePopupOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.popupConfig,this.popupConfig)},computeVirtualYOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.virtualYConfig||(0,_ui.getConfig)().select.scrollY,this.virtualYConfig||this.scrollY)},computeRemoteOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.remoteConfig,this.remoteConfig)},computeFilterOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.filterConfig,this.filterConfig)},computeOptionOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.optionConfig,this.optionConfig)},computeRadioOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.radioConfig,this.radioConfig)},computeCheckboxOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.checkboxConfig,this.checkboxConfig)},computeIsGroup:function(){return this.reactData.fullGroupList.some(function(e){return e.options&&e.options.length})},computeMultiMaxCharNum:function(){return _xeUtils.default.toNumber(this.multiCharOverflow)},computePopupWrapperStyle:function(){var e=this.computePopupOpts,t=e.height,e=e.width,n={};return e&&(n.width=(0,_dom.toCssUnit)(e)),t&&(n.height=(0,_dom.toCssUnit)(t),n.maxHeight=(0,_dom.toCssUnit)(t)),n},computeSelectVals:function(){var e=this.value,t=this.multiple,n=[];return _xeUtils.default.isArray(e)?n=e:t?(0,_utils.eqEmptyValue)(e)||(n=-1<"".concat(e).indexOf(",")?"".concat(e).split(","):[e]):n=null==e?[]:[e],n},computeFullLabel:function(){var t=this,e=t.reactData,n=t.remote,e=e.reactFlag,i=t.computeSelectVals;return(n&&e?i.map(function(e){return t.getRemoteSelectLabel(e)}):i.map(function(e){return t.getSelectLabel(e)})).join(", ")},computeSelectLabel:function(){var t=this,e=t.reactData,n=t.remote,i=t.multiple,e=e.reactFlag,l=t.computeMultiMaxCharNum,o=t.computeSelectVals;return n&&e?o.map(function(e){return t.getRemoteSelectLabel(e)}).join(", "):(n=o.map(function(e){return t.getSelectLabel(e)}),i&&0<l&&n.length>l?"".concat(n.slice(0,l),"..."):n.join(", "))}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$select:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},emitDefaultValue:function(e){this.emitModel(e),this.dispatchEvent("default-change",{value:e},null)},isPanelVisible:function(){return this.reactData.visiblePanel},togglePanel:function(){return this.reactData.visiblePanel?this.hideOptionPanel():this.showOptionPanel(),this.$nextTick()},hidePanel:function(){return this.reactData.visiblePanel&&this.hideOptionPanel(),this.$nextTick()},showPanel:function(){return this.reactData.visiblePanel||this.showOptionPanel(),this.$nextTick()},focus:function(){var e=this.reactData,t=this.$refs.refInput;return t&&t.blur(),e.isActivated=!0,this.$nextTick()},blur:function(){var e=this.reactData,t=this.$refs.refInput;return t&&t.blur(),e.isActivated=!1,this.$nextTick()},callSlot:function(e,t,n){var i=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=i[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,n)):[]},getOptKey:function(){return this.computeOptionOpts.keyField||this.optionId||"_X_OPTION_KEY"},getOptId:function(e){e=e[this.getOptKey()];return e?encodeURIComponent(e):""},checkMaxLimit:function(e){var t=this.multiple,n=this.max;return!(!t||!n)&&e.length>=_xeUtils.default.toNumber(n)},getRemoteSelectLabel:function(t){var e=this.internalData,n=this.lazyOptions,i=e.remoteValMaps,l=this.computeValueField,o=this.computeLabelField,i=i[t]||e.optFullValMaps[t],e=i?i.item:null;if(e)return _xeUtils.default.toValueString(e[o]);if(n){i=n.find(function(e){return e[l]===t});if(i)return i[o]}return t},getSelectLabel:function(t){var e=this,n=e.reactData,i=e.lazyOptions,l=e.internalData.optFullValMaps,o=e.computeValueField,e=e.computeLabelField,n=n.reactFlag?l[t]:null;if(n)return n.item[e];if(i){l=i.find(function(e){return e[o]===t});if(l)return l[e]}return t},getOptkey:function(){return this.computeOptionOpts.keyField||this.optionId||"_X_OPTION_KEY"},getOptid:function(e){e=e[this.getOptkey()];return e?encodeURIComponent(e):""},handleOption:function(){var t=this,e=t.reactData,n=t.internalData,i=t.remote,l=t.value,o=t.filterable,a=e.searchValue,e=n.fullData,r=n.optFullValMaps,s=t.computeLabelField,c=t.computeValueField,u=t.computeFilterOpts.filterMethod||t.filterMethod,p="".concat(a||"").toLowerCase(),f=[];return(f=i?e.filter(isOptionVisible):o&&u?e.filter(function(e){return isOptionVisible(e)&&u({$select:t,group:null,option:e,searchValue:a,value:l})}):o?e.filter(function(e){return isOptionVisible(e)&&(!p||-1<"".concat(e[s]||e[c]).toLowerCase().indexOf(p))}):e.filter(isOptionVisible)).forEach(function(e,t){e=r[e[c]];e&&(e._index=t)}),n.afterVisibleList=f,t.$nextTick()},refreshOption:function(){return this.handleOption(),this.updateYData(),this.$nextTick()},cacheItemMap:function(e){function t(e){u.push(e);var t=n.getOptId(e);t||(t=getOptUniqueId(),e[r]=t),c[e[a]]={key:t,item:e,_index:-1}}var n=this,i=n.reactData,l=n.internalData,o=n.computeGroupOptionsField,a=n.computeValueField,r=n.getOptKey(),s={},c={},u=[];e.forEach(function(e){t(e),e[o]&&(s[e[r]]=e)[o].forEach(t)}),l.fullData=u,l.optGroupKeyMaps=s,l.optFullValMaps=c,i.reactFlag++,n.handleOption()},setCurrentOption:function(e){var t=this.reactData;e&&(t.currentOption=e)},scrollToOption:function(i,l){var o=this;return o.$nextTick().then(function(){var e,t,n;i&&(e=o.$refs.refOptionWrapper,t=o.$refs.refOptionPanel.querySelector("[optid='".concat(o.getOptid(i),"']")),e)&&t&&(n=e.offsetHeight,l?t.offsetTop+t.offsetHeight-e.scrollTop>n&&(e.scrollTop=t.offsetTop+t.offsetHeight-n):(t.offsetTop+5<e.scrollTop||t.offsetTop+5>e.scrollTop+e.clientHeight)&&(e.scrollTop=t.offsetTop-5))})},updateZindex:function(){var e=this.reactData,t=this.computePopupOpts.zIndex||this.zIndex;t?e.panelIndex=_xeUtils.default.toNumber(t):e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updateZIndex:function(){var e=this.reactData;e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){function e(){var e=(0,_dom.updatePanelPlacement)(o,a,{placement:s.placement||i,defaultPlacement:s.defaultPlacement,teleportTo:r}),t=Object.assign(e.style,{zIndex:l});n.panelStyle=t,n.panelPlacement=e.placement}var t=this,n=t.reactData,i=t.placement,l=n.panelIndex,o=t.$refs.refElem,a=t.$refs.refOptionPanel,r=t.computeBtnTransfer,s=t.computePopupOpts;return e(),t.$nextTick().then(e)},handleScrollSelect:function(){var l=this,o=l.reactData,a=l.internalData;l.$nextTick(function(){var e=o.isAniVisible,t=o.visiblePanel,n=a.optFullValMaps,i=l.computeSelectVals;i.length&&e&&t&&(e=o.reactFlag?n["".concat(i[0])]:null)&&(o.currentOption=e.item,l.handleScrollToOption(e.item))})},showOptionPanel:function(){var e=this,t=e.reactData,n=e.internalData,i=e.loading,l=e.filterable,o=e.remote,a=n.fullData,r=n.hpTimeout,s=e.computeRemoteOpts,c=e.computeSelectVals,u=e.computePopupOpts;i||e.computeIsDisabled||(r&&(clearTimeout(r),n.hpTimeout=void 0),t.initialized||(t.initialized=!0,i=e.computeBtnTransfer,r=e.$refs.refOptionPanel,i&&r&&(n=u.appendTo,(0,_dom.getPopupContainer)(n).appendChild(r))),t.isActivated=!0,t.isAniVisible=!0,l&&(o&&s.enabled&&(s.autoLoad&&!a.length||a.length&&s.clearOnClose)?e.handleSearchEvent():(e.handleOption(),e.updateYData())),setTimeout(function(){t.visiblePanel=!0,e.handleFocusSearch(),e.recalculate().then(function(){c&&c.length?e.handleScrollSelect():e.refreshScroll()}),e.updatePlacement()},10),setTimeout(function(){e.recalculate().then(function(){return e.refreshScroll()})},100),e.updateZIndex(),e.updatePlacement(),e.dispatchEvent("visible-change",{visible:!0},null))},hideOptionPanel:function(e){var t=this,n=t.reactData,i=t.internalData,l=t.filterable,o=t.computeFilterOpts;t.remote?t.computeRemoteOpts.clearOnClose&&(n.searchValue=""):l&&!o.clearOnClose||(n.searchValue=""),n.searchLoading=!1,n.visiblePanel=!1,i.hpTimeout=setTimeout(function(){n.isAniVisible=!1},350),t.dispatchEvent("visible-change",{visible:!1},e||null)},changeEvent:function(e,t,n){var i=this,l=i,o=i.$xeForm,a=i.formItemInfo;i.emitModel(t),t!==l.value&&(i.dispatchEvent("change",{value:t,option:n},e),o)&&a&&o.triggerItemEvent(e,a.itemConfig.field,t)},clearValueEvent:function(e,t){this.internalData.remoteValMaps={},this.changeEvent(e,t,null),this.dispatchEvent("clear",{value:t},e)},clearEvent:function(e){var t=this.emptyValue,e=e.$event;this.clearValueEvent(e,t),this.hideOptionPanel(e)},allCheckedPanelEvent:function(e){var n=this,t=n.reactData,e=e.$event,i=n.multiple,l=n.max,o=n.checkedClosable,a=t.optList,r=n.computeValueField;if(i){for(var s=n.computeSelectVals.slice(0),c=0;c<a.length&&!(()=>{var t=a[c][r];if(n.checkMaxLimit(s))return _ui.VxeUI&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.select.overSizeErr",[l]),status:"warning"}),1;s.some(function(e){return e===t})||s.push(t)})();c++);n.changeEvent(e,s,a[0]),o&&n.hideOptionPanel(e),n.dispatchEvent("all-change",{value:s},e)}},clearCheckedPanelEvent:function(e){var t=this.emptyValue,n=this.clearClosable,e=e.$event;this.clearValueEvent(e,t),n&&this.hideOptionPanel(e)},closePanelEvent:function(e){e=e.$event;this.hideOptionPanel(e)},changeOptionEvent:function(e,t){var n=this,i=n.reactData,l=n.multiple,o=n.internalData.remoteValMaps,a=t[n.computeValueField],r=o[a];i.visiblePanel&&(r?r.item=t:o[a]={key:n.getOptId(t),item:t,_index:-1},l?(r=[],o=n.computeSelectVals,r=-1===_xeUtils.default.findIndexOf(o,function(e){return e===a})?o.concat([a]):o.filter(function(e){return e!==a}),n.changeEvent(e,r,t)):(n.changeEvent(e,a,t),n.hideOptionPanel(e)),i.reactFlag++)},handleGlobalMousewheelEvent:function(e){var t=this,n=t.reactData.visiblePanel;t.computeIsDisabled||n&&(n=t.$refs.refOptionPanel,(0,_dom.getEventTargetNode)(e,n).flag?t.updatePlacement():t.hideOptionPanel(e))},handleGlobalMousedownEvent:function(e){var t,n,i=this,l=i.reactData,o=l.visiblePanel,a=i.computePopupOpts.trigger;i.computeIsDisabled||(t=i.$refs.refElem,n=i.$refs.refOptionPanel,l.isActivated=(0,_dom.getEventTargetNode)(e,t).flag||(0,_dom.getEventTargetNode)(e,n).flag,o&&!l.isActivated&&"manual"!==a&&i.hideOptionPanel(e))},validOffsetOption:function(e){var t=e.disabled,e=this.getOptId(e);return!t&&!this.hasOptGroupById(e)},findOffsetOption:function(e,t){var n=this,i=n.reactData,l=n.internalData,o=n.allowCreate,i=i.optList,a=l.optFullValMaps,r=l.optAddMaps,s=n.computeValueField,c=l.afterVisibleList,l=0;if(o&&i.length&&(o=i[0],r[i=n.getOptId(o)])&&(l=1,c=[r[i]].concat(c)),!e)if(t)for(var u=0;u<c.length;u++){var p=c[u];if(n.validOffsetOption(p))return p}else for(var f=c.length-1;0<=f;f--){var d=c[f];if(n.validOffsetOption(d))return d}o=0,r=e?a[e[s]]:null;if(-1<(o=r?r._index+l:o))if(t)for(var h=o+1;h<=c.length-1;h++){var m=c[h];if(n.validOffsetOption(m))return m}else if(0<o)for(var v=o-1;0<=v;v--){var g=c[v];if(n.validOffsetOption(g))return g}return null},handleGlobalKeydownEvent:function(e){var t,n,i,l,o,a,r=this,s=r.reactData,c=r.emptyValue,u=r.clearable,p=s.visiblePanel,f=s.currentOption,d=r.computePopupOpts.trigger;r.computeIsDisabled||(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.TAB),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ENTER),i=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),l=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),o=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN),a=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.DELETE),t&&(s.isActivated=!1),p?i||t?"manual"!==d&&r.hideOptionPanel(e):n?f&&(e.preventDefault(),e.stopPropagation(),r.changeOptionEvent(e,f)):(l||o)&&(e.preventDefault(),p=(p=r.findOffsetOption(f,o))||r.findOffsetOption(null,o))&&(r.setCurrentOption(p),r.handleScrollToOption(p,o)):(l||o||n)&&s.isActivated&&(e.preventDefault(),r.showOptionPanel()),s.isActivated&&a&&u&&r.clearValueEvent(e,c))},handleGlobalBlurEvent:function(e){var t=this.reactData,n=t.visiblePanel,i=t.isActivated,l=this.computePopupOpts.trigger;n&&"manual"!==l&&this.hideOptionPanel(e),i&&(t.isActivated=!1),(n||i)&&(l=this.$refs.refInput)&&l.blur()},handleGlobalResizeEvent:function(){this.reactData.visiblePanel&&this.updatePlacement()},handleFocusSearch:function(){var t=this;t.filterable&&t.$nextTick(function(){var e=t.$refs.refInpSearch;e&&e.focus()})},focusEvent:function(e){var t=this,n=t.reactData,i=t.computePopupOpts.trigger;t.computeIsDisabled||n.visiblePanel||i&&"default"!==i||(n.triggerFocusPanel=!0,t.showOptionPanel(),setTimeout(function(){n.triggerFocusPanel=!1},500)),t.dispatchEvent("focus",{},e)},clickEvent:function(e){var t=this.reactData,n=this.computePopupOpts.trigger;n&&"default"!==n||this.togglePanelEvent(e),this.dispatchEvent("click",{triggerButton:!1,visible:t.visiblePanel},e)},blurEvent:function(e){this.reactData.isActivated=!1,this.dispatchEvent("blur",{},e)},suffixClickEvent:function(e){var t=this.reactData,n=this.computePopupOpts.trigger;n&&"default"!==n&&"icon"!==n||this.togglePanelEvent(e),this.dispatchEvent("click",{triggerButton:!0,visible:t.visiblePanel},e)},modelSearchEvent:function(e){this.reactData.searchValue=e},focusSearchEvent:function(){this.reactData.isActivated=!0},handleSearchEvent:function(){var e=this,t=e.reactData,n=e.value,i=t.searchValue,l=e.computeRemoteOpts,o=l.queryMethod||e.remoteMethod;e.remote&&o&&l.enabled?(t.searchLoading=!0,Promise.resolve(o({$select:e,searchValue:i,value:n})).then(function(){return e.$nextTick()}).catch(function(){return e.$nextTick()}).finally(function(){t.searchLoading=!1,e.handleOption(),e.updateYData()})):(e.handleOption(),e.updateYData())},triggerSearchEvent:_xeUtils.default.debounce(function(){this.handleSearchEvent()},350,{trailing:!0}),togglePanelEvent:function(e){var t=this.reactData,e=e.$event;e.preventDefault(),t.triggerFocusPanel?t.triggerFocusPanel=!1:t.visiblePanel?this.hideOptionPanel(e):this.showOptionPanel()},checkOptionDisabled:function(e,t){return!!t.disabled||!(!this.computeIsMaximize||e)},updateYSpace:function(){var e=this.reactData,t=this.internalData,n=e.scrollYLoad,i=t.scrollYStore;e.bodyHeight=n?t.afterVisibleList.length*i.rowHeight:0,e.topSpaceHeight=n?Math.max(i.startIndex*i.rowHeight,0):0},handleData:function(){var e=this,t=e.reactData,n=e.internalData,i=e.filterable,l=e.allowCreate,o=t.scrollYLoad,a=t.searchValue,r=n.optAddMaps,s=n.scrollYStore,n=n.afterVisibleList,c=e.computeLabelField,u=e.computeValueField,o=o?n.slice(s.startIndex,s.endIndex):n.slice(0);return i&&l&&a&&(o.some(function(e){return e[c]===a})||(s=r[a]||_defineProperty(_defineProperty(_defineProperty({},e.getOptKey(),a),c,a),u,a),r[a]=s,o.unshift(s))),t.optList=o,e.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var a=this,r=a.reactData,s=a.internalData;return a.$nextTick().then(function(){var e,t=r.scrollYLoad,n=s.scrollYStore,i=a.$refs.refVirtualBody,l=a.computeVirtualYOpts,o=0;(e=i?e||i.children[0]:e)&&(o=e.offsetHeight),o=Math.max(20,o),n.rowHeight=o,t?(i=a.$refs.refVirtualWrapper,e=Math.max(8,i?Math.ceil(i.clientHeight/o):0),t=Math.max(0,Math.min(2,_xeUtils.default.toNumber(l.oSize))),n.offsetSize=t,n.visibleSize=e,n.endIndex=Math.max(n.startIndex,e+t,n.endIndex),a.updateYData()):a.updateYSpace()})},handleScrollToOption:function(e,t){var n,i,l=this.internalData,o=l.optFullValMaps,l=l.scrollYStore,o=o[e[this.computeValueField]];o&&(e=o.key,-1<(o=o._index))&&(n=this.$refs.refVirtualWrapper,e=this.$refs.refOptionPanel.querySelector("[optid='".concat(e,"']")),n)&&(e?(i=n.offsetHeight,t?Math.ceil(e.offsetTop+e.offsetHeight-n.scrollTop)>=i?n.scrollTop=e.offsetTop+e.offsetHeight-i:(e.offsetTop+1<n.scrollTop||e.offsetTop+1>n.scrollTop+n.clientHeight)&&(n.scrollTop=e.offsetTop-1):e.offsetTop+1<n.scrollTop||e.offsetTop+1>n.scrollTop+n.clientHeight?n.scrollTop=e.offsetTop-1:e.offsetTop+e.offsetHeight-n.scrollTop>i&&(n.scrollTop=e.offsetTop+e.offsetHeight-i)):n.scrollTop=t?o*l.rowHeight-n.clientHeight+l.rowHeight:o*l.rowHeight)},scrollTo:function(e,t){var n=this,i=n.reactData,l=n.$refs.refVirtualWrapper;return l&&(_xeUtils.default.isNumber(e)&&(l.scrollLeft=e),_xeUtils.default.isNumber(t))&&(l.scrollTop=t),i.scrollYLoad?new Promise(function(e){setTimeout(function(){n.$nextTick(function(){e()})},50)}):n.$nextTick()},refreshScroll:function(){var e=this,t=e.internalData,n=t.lastScrollLeft,i=t.lastScrollTop;return e.clearScroll().then(function(){if(n||i)return t.lastScrollLeft=0,t.lastScrollTop=0,e.scrollTo(n,i)})},recalculate:function(){var e=this.$refs.refElem;return e&&e.clientWidth&&e.clientHeight?this.computeScrollLoad():Promise.resolve()},loadYData:function(e){var t=this.internalData.scrollYStore,n=t.startIndex,i=t.endIndex,l=t.visibleSize,o=t.offsetSize,e=e.target.scrollTop,e=Math.floor(e/t.rowHeight),a=Math.max(0,e-1-o),o=e+l+o;!(e<=n||i-l-1<=e)||n===a&&i===o||(t.startIndex=a,t.endIndex=o,this.updateYData())},isVMScrollProcess:function(){var e=this.internalData.lastScrollTime;return!!(e&&Date.now()<e+250)},scrollEvent:function(e){var t=this.reactData,n=this.internalData,i=e.target,l=i.scrollTop,i=i.scrollLeft,o=i!==n.lastScrollLeft,a=l!==n.lastScrollTop;n.lastScrollTop=l,n.lastScrollLeft=i,t.scrollYLoad&&this.loadYData(e),n.lastScrollTime=Date.now(),this.dispatchEvent("scroll",{scrollLeft:i,scrollTop:l,isX:o,isY:a},e)},loadData:function(e){var t,n=this,i=n,l=n.reactData,o=n.internalData,a=(n.cacheItemMap(e||[]),i.multiple),r=o.isLoaded,s=o.fullData,c=o.scrollYStore,u=n.computeDefaultOpts,p=n.computeVirtualYOpts,f=n.computeValueField;return Object.assign(c,{startIndex:0,endIndex:1,visibleSize:0}),o.synchData=e||[],l.scrollYLoad=!!p.enabled&&-1<p.gt&&(0===p.gt||p.gt<=s.length),n.handleData(),r||(c=u.selectMode,0<e.length&&_xeUtils.default.eqNull(i.value)&&("all"===c?a?n.$nextTick(function(){n.emitDefaultValue(e.map(function(e){return e[f]}))}):errLog("vxe.error.notConflictProp",["default-config.selectMode=all","multiple=true"]):"first"!==c&&"last"!==c||(t=_xeUtils.default[c](e))&&n.$nextTick(function(){_xeUtils.default.eqNull(i.value)&&n.emitDefaultValue(t[f])}),o.isLoaded=!0)),n.computeScrollLoad().then(function(){n.refreshScroll()})},reloadData:function(e){return this.internalData.isLoaded=!1,this.clearScroll(),this.loadData(e)},clearScroll:function(){var e=this.internalData,t=this.$refs.refVirtualWrapper;return t&&(t.scrollTop=0,t.scrollLeft=0),e.lastScrollTop=0,e.lastScrollLeft=0,this.$nextTick()},hasOptGroupById:function(e){return!!this.internalData.optGroupKeyMaps[e]},renderRadio:function(e,t,n,i,l){var o=this,a=o.computeRadioOpts,r=a.showIcon,a=a.trigger;return n||!1===r?(0,_ui.renderEmptyElement)(o):(r={},a&&"default"!==a||(r.click=function(e){l||n||o.changeOptionEvent(e,t)}),e("div",{key:2,class:["vxe-select-option--radio",{"is--checked":i,"is--disabled":l}],on:r},[e("span",{class:["vxe-radio--icon",i?(0,_ui.getIcon)().RADIO_CHECKED:(0,_ui.getIcon)().RADIO_UNCHECKED]})]))},renderCheckbox:function(e,t,n,i,l){var o=this,a=o.computeCheckboxOpts,r=a.showIcon,a=a.trigger;return n||!1===r?(0,_ui.renderEmptyElement)(o):(r={},a&&"default"!==a||(r.click=function(e){l||n||o.changeOptionEvent(e,t)}),e("div",{key:3,class:["vxe-select-option--checkbox",{"is--checked":i,"is--disabled":l}],on:r},[e("span",{class:["vxe-checkbox--icon",i?(0,_ui.getIcon)().CHECKBOX_CHECKED:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})]))},renderOption:function(m,e){var v=this,t=v.$scopedSlots,g=v.allowCreate,b=v.optionKey,n=v.multiple,O=v.reactData.currentOption,x=v.internalData.optAddMaps,i=v.computeOptionOpts,_=v.computeLabelField,E=v.computeValueField,y=v.computeGroupLabelField,D=v.computeSelectVals,S=v.computeRadioOpts,P=v.computeCheckboxOpts,C=i.useKey,T=i.height,I=t.option,V=v.showCheckbox&&n,L=v.showRadio&&!n;return e.map(function(t,e){var n=t.slots,i=t.className,l=v.getOptId(t),o=t[E],a=v.hasOptGroupById(l),r=!(!g||!x[l]),s=!r&&-1<D.indexOf(o),c=r||!a||isOptionVisible(t),u=!r&&v.checkOptionDisabled(s,t),n=(n?n.default:null)||I,p={option:t,group:a?t:null,$select:v},f="",d=[],h=(V?d.push(v.renderCheckbox(m,t,a,s,u)):L&&d.push(v.renderRadio(m,t,a,s,u)),[]),h=n?v.callSlot(n,p,m):[f=(0,_utils.getFuncText)(t[a?y:_]||o)],n=(d.push(m("div",{key:1,class:"vxe-select-option--label"},h)),{mousedown:function(e){0===e.button&&e.stopPropagation()},mouseenter:function(){u||a||v.isVMScrollProcess()||v.setCurrentOption(t)}});return(V?"option"!==P.trigger:L&&"option"!==S.trigger)||(n.click=function(e){u||a||v.changeOptionEvent(e,t)}),c?m("div",{key:C||b?l:e,class:["vxe-select-option",i?_xeUtils.default.isFunction(i)?i(p):i:"",{"vxe-select-optgroup":a,"is--disabled":u,"is--selected":s,"is--add":r,"is--hover":O&&v.getOptId(O)===l}],attrs:{optid:l,title:f||null},style:T?{height:(0,_dom.toCssUnit)(T)}:void 0,on:n},g?[m("span",{key:1,class:"vxe-select-option--add-label"},d),r?m("span",{key:2,class:"vxe-select-option--add-icon"},[m("i",{class:(0,_ui.getIcon)().SELECT_ADD_OPTION})]):(0,_ui.renderEmptyElement)(v)]:d):(0,_ui.renderEmptyElement)(v)})},renderOpts:function(e){var t=this.reactData,n=t.optList;return t.searchLoading?[e("div",{class:"vxe-select--search-loading"},[e("i",{class:["vxe-select--search-icon",(0,_ui.getIcon)().SELECT_LOADED]}),e("span",{class:"vxe-select--search-text"},(0,_ui.getI18n)("vxe.select.loadingText"))])]:n.length?this.renderOption(e,n):[e("div",{class:"vxe-select--empty-placeholder"},this.emptyText||(0,_ui.getI18n)("vxe.select.emptyText"))]},renderVN:function(e){var t,n=this,i=n,l=n.$scopedSlots,o=n.reactData,a=i.className,r=i.multiple,s=i.loading,c=i.filterable,u=i.showTotalButton,p=i.showCheckedButton,f=i.showClearButton,d=i.showCloseButton,h=o.initialized,m=o.isActivated,v=o.isAniVisible,g=o.optList,b=o.visiblePanel,O=o.bodyHeight,x=o.topSpaceHeight,_=n.computeSize,E=n.computeIsDisabled,y=n.computeSelectLabel,D=n.computeFullLabel,S=n.computeBtnTransfer,P=n.computeInpPlaceholder,C=n.computePopupWrapperStyle,T=l.default,I=l.header,V=l.footer,L=l.prefix,l=n.computePopupOpts.className||i.popupClassName;return n.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-select--readonly",a]},[e("div",{class:"vxe-select-slots",ref:"hideOption"},T?n.callSlot(T,{},e):[]),e("span",{class:"vxe-select-label",attrs:{fullLabel:D}},y)]):(t=n.computeSelectVals,e("div",{ref:"refElem",class:["vxe-select",a?_xeUtils.default.isFunction(a)?a({$select:n}):a:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(_),_),"is--visible",b),"is--disabled",E),"is--filter",c),"is--loading",s),"is--active",m)]},[e("div",{class:"vxe-select-slots",ref:"hideOption"},T?T.call(n,{}):[]),e(_input.default,{ref:"refInput",props:{clearable:i.clearable,placeholder:P,editable:!1,disabled:E,type:"text",prefixIcon:i.prefixIcon,suffixIcon:s?(0,_ui.getIcon)().SELECT_LOADED:b?(0,_ui.getIcon)().SELECT_OPEN:(0,_ui.getIcon)().SELECT_CLOSE,autoFocus:!1,title:D,value:y},on:{clear:n.clearEvent,click:n.clickEvent,focus:n.focusEvent,blur:n.blurEvent,"suffix-click":n.suffixClickEvent},scopedSlots:L?{prefix:function(){return L({})}}:{}}),e("div",{ref:"refOptionPanel",class:["vxe-table--ignore-clear vxe-select--panel",l?_xeUtils.default.isFunction(l)?l({$select:n}):l:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(_),_),"is--transfer",S),"ani--leave",!s&&v),"ani--enter",!s&&b)],attrs:{placement:o.panelPlacement},style:o.panelStyle},h&&(b||v)?[e("div",{class:"vxe-select--panel-wrapper",style:C},[c?e("div",{class:"vxe-select--panel-search"},[e(_input.default,{ref:"refInpSearch",class:"vxe-select-search--input",props:{value:o.searchValue,type:"text",clearable:!0,disabled:!1,readonly:!1,placeholder:(0,_ui.getI18n)("vxe.select.search"),prefixIcon:(0,_ui.getIcon)().INPUT_SEARCH},on:{"model-value":n.modelSearchEvent,focus:n.focusSearchEvent,change:n.triggerSearchEvent,search:n.triggerSearchEvent}})]):(0,_ui.renderEmptyElement)(n),p&&r||f||I?e("div",{class:"vxe-select--panel-header"},I?n.callSlot(I,{},e):[e("div",{class:"vxe-tree-select--header-button"},[e("div",{class:"vxe-tree-select--header-btns"},[p&&r?e(_button.default,{props:{content:(0,_ui.getI18n)("vxe.select.allChecked"),mode:"text"},on:{click:n.allCheckedPanelEvent}}):(0,_ui.renderEmptyElement)(n),f?e(_button.default,{props:{content:(0,_ui.getI18n)("vxe.select.clear"),mode:"text"},on:{click:n.clearCheckedPanelEvent}}):(0,_ui.renderEmptyElement)(n)])])]):(0,_ui.renderEmptyElement)(n),e("div",{class:"vxe-select--panel-body"},[e("div",{ref:"refVirtualWrapper",class:"vxe-select-option--wrapper",on:{scroll:n.scrollEvent}},[e("div",{class:"vxe-select--y-space",style:{height:O?"".concat(O,"px"):""}}),e("div",{ref:"refVirtualBody",class:"vxe-select--body",style:{transform:"translateY(".concat(x,"px)")}},n.renderOpts(e))])]),V||u||d&&r?e("div",{class:"vxe-select--panel-footer"},V?n.callSlot(V,{},e):[e("div",{class:"vxe-select--footer-button"},[u?e("div",{class:"vxe-select--total-btns"},(0,_ui.getI18n)("vxe.select.total",[t.length,g.length])):(0,_ui.renderEmptyElement)(n),d&&r?e("div",{class:"vxe-select--oper-btns"},[e(_button.default,{props:{content:(0,_ui.getI18n)("vxe.select.close"),mode:"text"},on:{click:n.closePanelEvent}})]):(0,_ui.renderEmptyElement)(n)])]):(0,_ui.renderEmptyElement)(n)])]:[])]))}},watch:{"reactData.staticOptions":function(e){this.loadData(e)},options:function(e){this.loadData(e)},optionGroups:function(e){this.loadData(e)}},created:function(){this.internalData=createInternalData()},mounted:function(){var n=this,i=n;n.$nextTick(function(){var e=i.options,t=i.optionGroups;t?n.loadData(t):e&&n.loadData(e)}),_ui.globalEvents.on(n,"mousewheel",n.handleGlobalMousewheelEvent),_ui.globalEvents.on(n,"mousedown",n.handleGlobalMousedownEvent),_ui.globalEvents.on(n,"keydown",n.handleGlobalKeydownEvent),_ui.globalEvents.on(n,"blur",n.handleGlobalBlurEvent),_ui.globalEvents.on(n,"resize",n.handleGlobalResizeEvent)},beforeDestroy:function(){var e=this,t=e.$refs.refOptionPanel;t&&t.parentNode&&t.parentNode.removeChild(t),_ui.globalEvents.off(e,"mousewheel"),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"keydown"),_ui.globalEvents.off(e,"blur"),_ui.globalEvents.off(e,"resize")},destroyed:function(){var e=this.reactData,t=this.internalData;_xeUtils.default.assign(e,createReactData()),_xeUtils.default.assign(t,createInternalData())},render:function(e){return this.renderVN(e)}});
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_input=_interopRequireDefault(require("../../input/src/input")),_button=_interopRequireDefault(require("../../button/src/button"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}var _createComponentLog=(0,_log.createComponentLog)("select"),errLog=_createComponentLog.errLog;function isOptionVisible(e){return!1!==e.visible}function getOptUniqueId(){return _xeUtils.default.uniqueId("opt_")}function createReactData(){return{initialized:!1,scrollYLoad:!1,bodyHeight:0,topSpaceHeight:0,optList:[],staticOptions:[],reactFlag:0,currentOption:null,searchValue:"",searchLoading:!1,panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1}}function createInternalData(){return{synchData:[],fullData:[],afterVisibleList:[],optAddMaps:{},optGroupKeyMaps:{},optFullValMaps:{},remoteValMaps:{},lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0},lastScrollTime:0,hpTimeout:void 0}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeSelect",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Boolean,Array],defaultConfig:Object,emptyValue:{type:[String,Number,Boolean,Array],default:function(){return(0,_ui.getConfig)().select.emptyValue}},clearable:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.clearable}},placeholder:String,readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},multiple:Boolean,multiCharOverflow:{type:[Number,String],default:function(){return(0,_ui.getConfig)().select.multiCharOverflow}},prefixIcon:String,allowCreate:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.allowCreate}},placement:String,lazyOptions:Array,options:Array,optionProps:Object,optionGroups:Array,optionGroupProps:Object,optionConfig:Object,className:[String,Function],popupClassName:[String,Function],max:{type:[String,Number],default:null},showRadio:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showRadio}},radioConfig:Object,showCheckbox:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showCheckedButton}},checkboxConfig:Object,zIndex:Number,size:{type:String,default:function(){return(0,_ui.getConfig)().select.size||(0,_ui.getConfig)().size}},filterable:Boolean,filterMethod:Function,filterConfig:Object,remote:Boolean,remoteConfig:Object,emptyText:String,checkedClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.checkedClosable}},clearClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.clearClosable}},showCloseButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showCloseButton}},showTotalButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showTotalButton}},showCheckedButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showCheckedButton}},showClearButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().select.showClearButton}},transfer:{type:Boolean,default:null},popupConfig:Object,virtualYConfig:Object,scrollY:Object,remoteMethod:Function,optionId:{type:String,default:function(){return(0,_ui.getConfig)().select.optionId}},optionKey:Boolean},inject:{$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},provide:function(){return{$xeSelect:this}},data:function(){var e=_xeUtils.default.uniqueId(),t=createReactData();return Object.assign(Object.assign({},{}),{xID:e,reactData:t})},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeBtnTransfer:function(){var e=this,t=e.$xeTable,n=e.$xeModal,i=e.$xeDrawer,l=e.$xeCard,o=e.$xeForm,a=e.transfer,e=e.computePopupOpts;if(_xeUtils.default.isBoolean(e.transfer))return e.transfer;if(null===a){e=(0,_ui.getConfig)().select.transfer;if(_xeUtils.default.isBoolean(e))return e;if(t||n||i||l||o)return!0}return a},computeInpPlaceholder:function(){var e=this.placeholder;return(e=e||(0,_ui.getConfig)().select.placeholder)?(0,_utils.getFuncText)(e):(0,_ui.getI18n)("vxe.base.pleaseSelect")},computeDefaultOpts:function(){return Object.assign({},this.defaultConfig)},computePropsOpts:function(){return Object.assign({},this.optionProps)},computeGroupPropsOpts:function(){return Object.assign({},this.optionGroupProps)},computeLabelField:function(){return this.computePropsOpts.label||"label"},computeValueField:function(){return this.computePropsOpts.value||"value"},computeGroupLabelField:function(){return this.computeGroupPropsOpts.label||"label"},computeGroupOptionsField:function(){return this.computeGroupPropsOpts.options||"options"},computeIsMaximize:function(){var e=this.computeSelectVals;return this.checkMaxLimit(e)},computePopupOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.popupConfig,this.popupConfig)},computeVirtualYOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.virtualYConfig||(0,_ui.getConfig)().select.scrollY,this.virtualYConfig||this.scrollY)},computeRemoteOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.remoteConfig,this.remoteConfig)},computeFilterOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.filterConfig,this.filterConfig)},computeOptionOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.optionConfig,this.optionConfig)},computeRadioOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.radioConfig,this.radioConfig)},computeCheckboxOpts:function(){return Object.assign({},(0,_ui.getConfig)().select.checkboxConfig,this.checkboxConfig)},computeIsGroup:function(){return this.reactData.fullGroupList.some(function(e){return e.options&&e.options.length})},computeMultiMaxCharNum:function(){return _xeUtils.default.toNumber(this.multiCharOverflow)},computePopupWrapperStyle:function(){var e=this.computePopupOpts,t=e.height,e=e.width,n={};return e&&(n.width=(0,_dom.toCssUnit)(e)),t&&(n.height=(0,_dom.toCssUnit)(t),n.maxHeight=(0,_dom.toCssUnit)(t)),n},computeSelectVals:function(){var e=this.value,t=this.multiple,n=[];return _xeUtils.default.isArray(e)?n=e:t?(0,_utils.eqEmptyValue)(e)||(n=-1<"".concat(e).indexOf(",")?"".concat(e).split(","):[e]):n=null==e?[]:[e],n},computeFullLabel:function(){var t=this,e=t.reactData,n=t.remote,e=e.reactFlag,i=t.computeSelectVals;return(n&&e?i.map(function(e){return t.getRemoteSelectLabel(e)}):i.map(function(e){return t.getSelectLabel(e)})).join(", ")},computeSelectLabel:function(){var t=this,e=t.reactData,n=t.remote,i=t.multiple,e=e.reactFlag,l=t.computeMultiMaxCharNum,o=t.computeSelectVals;return n&&e?o.map(function(e){return t.getRemoteSelectLabel(e)}).join(", "):(n=o.map(function(e){return t.getSelectLabel(e)}),i&&0<l&&n.length>l?"".concat(n.slice(0,l),"..."):n.join(", "))}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$select:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},emitDefaultValue:function(e){this.emitModel(e),this.dispatchEvent("default-change",{value:e},null)},isPanelVisible:function(){return this.reactData.visiblePanel},togglePanel:function(){return this.reactData.visiblePanel?this.hideOptionPanel():this.showOptionPanel(),this.$nextTick()},hidePanel:function(){return this.reactData.visiblePanel&&this.hideOptionPanel(),this.$nextTick()},showPanel:function(){return this.reactData.visiblePanel||this.showOptionPanel(),this.$nextTick()},focus:function(){var e=this.reactData,t=this.$refs.refInput;return t&&t.blur(),e.isActivated=!0,this.$nextTick()},blur:function(){var e=this.reactData,t=this.$refs.refInput;return t&&t.blur(),e.isActivated=!1,this.$nextTick()},callSlot:function(e,t,n){var i=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=i[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,n)):[]},getOptKey:function(){return this.computeOptionOpts.keyField||this.optionId||"_X_OPTION_KEY"},getOptId:function(e){e=e[this.getOptKey()];return e?encodeURIComponent(e):""},checkMaxLimit:function(e){var t=this.multiple,n=this.max;return!(!t||!n)&&e.length>=_xeUtils.default.toNumber(n)},getRemoteSelectLabel:function(t){var e=this.internalData,n=this.lazyOptions,i=e.remoteValMaps,l=this.computeValueField,o=this.computeLabelField,i=i[t]||e.optFullValMaps[t],e=i?i.item:null;if(e)return _xeUtils.default.toValueString(e[o]);if(n){i=n.find(function(e){return e[l]===t});if(i)return i[o]}return t},getSelectLabel:function(t){var e=this,n=e.reactData,i=e.lazyOptions,l=e.internalData.optFullValMaps,o=e.computeValueField,e=e.computeLabelField,n=n.reactFlag?l[t]:null;if(n)return n.item[e];if(i){l=i.find(function(e){return e[o]===t});if(l)return l[e]}return t},getOptkey:function(){return this.computeOptionOpts.keyField||this.optionId||"_X_OPTION_KEY"},getOptid:function(e){e=e[this.getOptkey()];return e?encodeURIComponent(e):""},handleOption:function(){var t=this,e=t.reactData,n=t.internalData,i=t.remote,l=t.value,o=t.filterable,a=e.searchValue,e=n.fullData,r=n.optFullValMaps,s=t.computeLabelField,c=t.computeValueField,u=t.computeFilterOpts.filterMethod||t.filterMethod,p="".concat(a||"").toLowerCase(),f=[];return(f=i?e.filter(isOptionVisible):o&&u?e.filter(function(e){return isOptionVisible(e)&&u({$select:t,group:null,option:e,searchValue:a,value:l})}):o?e.filter(function(e){return isOptionVisible(e)&&(!p||-1<"".concat(e[s]||e[c]).toLowerCase().indexOf(p))}):e.filter(isOptionVisible)).forEach(function(e,t){e=r[e[c]];e&&(e._index=t)}),n.afterVisibleList=f,t.$nextTick()},refreshOption:function(){return this.handleOption(),this.updateYData(),this.$nextTick()},cacheItemMap:function(e){function t(e){u.push(e);var t=n.getOptId(e);t||(t=getOptUniqueId(),e[r]=t),c[e[a]]={key:t,item:e,_index:-1}}var n=this,i=n.reactData,l=n.internalData,o=n.computeGroupOptionsField,a=n.computeValueField,r=n.getOptKey(),s={},c={},u=[];e.forEach(function(e){t(e),e[o]&&(s[e[r]]=e)[o].forEach(t)}),l.fullData=u,l.optGroupKeyMaps=s,l.optFullValMaps=c,i.reactFlag++,n.handleOption()},setCurrentOption:function(e){var t=this.reactData;e&&(t.currentOption=e)},scrollToOption:function(i,l){var o=this;return o.$nextTick().then(function(){var e,t,n;i&&(e=o.$refs.refOptionWrapper,t=o.$refs.refOptionPanel.querySelector("[optid='".concat(o.getOptid(i),"']")),e)&&t&&(n=e.offsetHeight,l?t.offsetTop+t.offsetHeight-e.scrollTop>n&&(e.scrollTop=t.offsetTop+t.offsetHeight-n):(t.offsetTop+5<e.scrollTop||t.offsetTop+5>e.scrollTop+e.clientHeight)&&(e.scrollTop=t.offsetTop-5))})},updateZindex:function(){var e=this.reactData,t=this.computePopupOpts.zIndex||this.zIndex;t?e.panelIndex=_xeUtils.default.toNumber(t):e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updateZIndex:function(){var e=this.reactData;e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){function e(){var e=(0,_dom.updatePanelPlacement)(o,a,{placement:s.placement||i,defaultPlacement:s.defaultPlacement,teleportTo:r}),t=Object.assign(e.style,{zIndex:l});n.panelStyle=t,n.panelPlacement=e.placement}var t=this,n=t.reactData,i=t.placement,l=n.panelIndex,o=t.$refs.refElem,a=t.$refs.refOptionPanel,r=t.computeBtnTransfer,s=t.computePopupOpts;return e(),t.$nextTick().then(e)},handleScrollSelect:function(){var l=this,o=l.reactData,a=l.internalData;l.$nextTick(function(){var e=o.isAniVisible,t=o.visiblePanel,n=a.optFullValMaps,i=l.computeSelectVals;i.length&&e&&t&&(e=o.reactFlag?n["".concat(i[0])]:null)&&(o.currentOption=e.item,l.handleScrollToOption(e.item))})},showOptionPanel:function(){var e=this,t=e.reactData,n=e.internalData,i=e.loading,l=e.filterable,o=e.remote,a=n.fullData,r=n.hpTimeout,s=e.computeRemoteOpts,c=e.computeSelectVals,u=e.computePopupOpts;i||e.computeIsDisabled||(r&&(clearTimeout(r),n.hpTimeout=void 0),t.initialized||(t.initialized=!0,i=e.computeBtnTransfer,r=e.$refs.refOptionPanel,i&&r&&(n=u.appendTo,(0,_dom.getPopupContainer)(n).appendChild(r))),t.isActivated=!0,t.isAniVisible=!0,l&&(o&&s.enabled&&(s.autoLoad&&!a.length||a.length&&s.clearOnClose)?e.handleSearchEvent():(e.handleOption(),e.updateYData())),setTimeout(function(){t.visiblePanel=!0,e.handleFocusSearch(),e.recalculate().then(function(){c&&c.length?e.handleScrollSelect():e.refreshScroll()}),e.updatePlacement()},10),setTimeout(function(){e.recalculate().then(function(){return e.refreshScroll()})},100),e.updateZIndex(),e.updatePlacement(),e.dispatchEvent("visible-change",{visible:!0},null))},hideOptionPanel:function(e){var t=this,n=t.reactData,i=t.internalData,l=t.filterable,o=t.computeFilterOpts;t.remote?t.computeRemoteOpts.clearOnClose&&(n.searchValue=""):l&&!o.clearOnClose||(n.searchValue=""),n.searchLoading=!1,n.visiblePanel=!1,i.hpTimeout=setTimeout(function(){n.isAniVisible=!1},350),t.dispatchEvent("visible-change",{visible:!1},e||null)},changeEvent:function(e,t,n){var i=this,l=i,o=i.$xeForm,a=i.formItemInfo;i.emitModel(t),t!==l.value&&(i.dispatchEvent("change",{value:t,option:n},e),o)&&a&&o.triggerItemEvent(e,a.itemConfig.field,t)},clearValueEvent:function(e,t){this.internalData.remoteValMaps={},this.changeEvent(e,t,null),this.dispatchEvent("clear",{value:t},e)},clearEvent:function(e){var t=this.emptyValue,e=e.$event;this.clearValueEvent(e,t),this.hideOptionPanel(e)},allCheckedPanelEvent:function(e){var n=this,t=n.reactData,e=e.$event,i=n.multiple,l=n.max,o=n.checkedClosable,a=t.optList,r=n.computeValueField;if(i){for(var s=n.computeSelectVals.slice(0),c=0;c<a.length&&!(()=>{var t=a[c][r];if(n.checkMaxLimit(s))return _ui.VxeUI&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.select.overSizeErr",[l]),status:"warning"}),1;s.some(function(e){return e===t})||s.push(t)})();c++);n.changeEvent(e,s,a[0]),o&&n.hideOptionPanel(e),n.dispatchEvent("all-change",{value:s},e)}},clearCheckedPanelEvent:function(e){var t=this.emptyValue,n=this.clearClosable,e=e.$event;this.clearValueEvent(e,t),n&&this.hideOptionPanel(e)},closePanelEvent:function(e){e=e.$event;this.hideOptionPanel(e)},changeOptionEvent:function(e,t){var n=this,i=n.reactData,l=n.multiple,o=n.internalData.remoteValMaps,a=t[n.computeValueField],r=o[a];i.visiblePanel&&(r?r.item=t:o[a]={key:n.getOptId(t),item:t,_index:-1},l?(r=[],o=n.computeSelectVals,r=-1===_xeUtils.default.findIndexOf(o,function(e){return e===a})?o.concat([a]):o.filter(function(e){return e!==a}),n.changeEvent(e,r,t)):(n.changeEvent(e,a,t),n.hideOptionPanel(e)),i.reactFlag++)},handleGlobalMousewheelEvent:function(e){var t=this,n=t.reactData.visiblePanel;t.computeIsDisabled||n&&(n=t.$refs.refOptionPanel,(0,_dom.getEventTargetNode)(e,n).flag?t.updatePlacement():t.hideOptionPanel(e))},handleGlobalMousedownEvent:function(e){var t,n,i=this,l=i.reactData,o=l.visiblePanel,a=i.computePopupOpts.trigger;i.computeIsDisabled||(t=i.$refs.refElem,n=i.$refs.refOptionPanel,l.isActivated=(0,_dom.getEventTargetNode)(e,t).flag||(0,_dom.getEventTargetNode)(e,n).flag,o&&!l.isActivated&&"manual"!==a&&i.hideOptionPanel(e))},validOffsetOption:function(e){var t=e.disabled,e=this.getOptId(e);return!t&&!this.hasOptGroupById(e)},findOffsetOption:function(e,t){var n=this,i=n.reactData,l=n.internalData,o=n.allowCreate,i=i.optList,a=l.optFullValMaps,r=l.optAddMaps,s=n.computeValueField,c=l.afterVisibleList,l=0;if(o&&i.length&&(o=i[0],r[i=n.getOptId(o)])&&(l=1,c=[r[i]].concat(c)),!e)if(t)for(var u=0;u<c.length;u++){var p=c[u];if(n.validOffsetOption(p))return p}else for(var f=c.length-1;0<=f;f--){var d=c[f];if(n.validOffsetOption(d))return d}o=0,r=e?a[e[s]]:null;if(-1<(o=r?r._index+l:o))if(t)for(var h=o+1;h<=c.length-1;h++){var m=c[h];if(n.validOffsetOption(m))return m}else if(0<o)for(var v=o-1;0<=v;v--){var g=c[v];if(n.validOffsetOption(g))return g}return null},handleGlobalKeydownEvent:function(e){var t,n,i,l,o,a,r=this,s=r.reactData,c=r.emptyValue,u=r.clearable,p=s.visiblePanel,f=s.currentOption,d=r.computePopupOpts.trigger;r.computeIsDisabled||(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.TAB),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ENTER),i=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),l=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),o=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN),a=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.DELETE),t&&(s.isActivated=!1),p?i||t?"manual"!==d&&r.hideOptionPanel(e):n?f&&(e.preventDefault(),e.stopPropagation(),r.changeOptionEvent(e,f)):(l||o)&&(e.preventDefault(),p=(p=r.findOffsetOption(f,o))||r.findOffsetOption(null,o))&&(r.setCurrentOption(p),r.handleScrollToOption(p,o)):(l||o||n)&&s.isActivated&&(e.preventDefault(),r.showOptionPanel()),s.isActivated&&a&&u&&r.clearValueEvent(e,c))},handleGlobalBlurEvent:function(e){var t=this.reactData,n=t.visiblePanel,i=t.isActivated,l=this.computePopupOpts.trigger;n&&"manual"!==l&&this.hideOptionPanel(e),i&&(t.isActivated=!1),(n||i)&&(l=this.$refs.refInput)&&l.blur()},handleGlobalResizeEvent:function(){this.reactData.visiblePanel&&this.updatePlacement()},handleFocusSearch:function(){var t=this;t.filterable&&t.$nextTick(function(){var e=t.$refs.refInpSearch;e&&e.focus()})},focusEvent:function(e){var t=this,n=t.reactData,i=t.computePopupOpts.trigger;t.computeIsDisabled||n.visiblePanel||i&&"default"!==i||(n.triggerFocusPanel=!0,t.showOptionPanel(),setTimeout(function(){n.triggerFocusPanel=!1},500)),t.dispatchEvent("focus",{},e)},clickEvent:function(e){var t=this.reactData,n=this.computePopupOpts.trigger;n&&"default"!==n||this.togglePanelEvent(e),this.dispatchEvent("click",{triggerButton:!1,visible:t.visiblePanel},e)},blurEvent:function(e){this.reactData.isActivated=!1,this.dispatchEvent("blur",{},e)},suffixClickEvent:function(e){var t=this.reactData,n=this.computePopupOpts.trigger;n&&"default"!==n&&"icon"!==n||this.togglePanelEvent(e),this.dispatchEvent("click",{triggerButton:!0,visible:t.visiblePanel},e)},modelSearchEvent:function(e){this.reactData.searchValue=e},focusSearchEvent:function(){this.reactData.isActivated=!0},handleSearchEvent:function(){var e=this,t=e.reactData,n=e.value,i=t.searchValue,l=e.computeRemoteOpts,o=l.queryMethod||e.remoteMethod;e.remote&&o&&l.enabled?(t.searchLoading=!0,Promise.resolve(o({$select:e,searchValue:i,value:n})).then(function(){return e.$nextTick()}).catch(function(){return e.$nextTick()}).finally(function(){t.searchLoading=!1,e.handleOption(),e.updateYData()})):(e.handleOption(),e.updateYData())},triggerSearchEvent:_xeUtils.default.debounce(function(){this.handleSearchEvent()},350,{trailing:!0}),togglePanelEvent:function(e){var t=this.reactData,e=e.$event;e.preventDefault(),t.triggerFocusPanel?t.triggerFocusPanel=!1:t.visiblePanel?this.hideOptionPanel(e):this.showOptionPanel()},checkOptionDisabled:function(e,t){return!!t.disabled||!(!this.computeIsMaximize||e)},updateYSpace:function(){var e=this.reactData,t=this.internalData,n=e.scrollYLoad,i=t.scrollYStore;e.bodyHeight=n?t.afterVisibleList.length*i.rowHeight:0,e.topSpaceHeight=n?Math.max(i.startIndex*i.rowHeight,0):0},handleData:function(){var e=this,t=e.reactData,n=e.internalData,i=e.filterable,l=e.allowCreate,o=t.scrollYLoad,a=t.searchValue,r=n.optAddMaps,s=n.scrollYStore,n=n.afterVisibleList,c=e.computeLabelField,u=e.computeValueField,o=o?n.slice(s.startIndex,s.endIndex):n.slice(0);return i&&l&&a&&(o.some(function(e){return e[c]===a})||(s=r[a]||_defineProperty(_defineProperty(_defineProperty({},e.getOptKey(),a),c,a),u,a),r[a]=s,o.unshift(s))),t.optList=o,e.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var a=this,r=a.reactData,s=a.internalData;return a.$nextTick().then(function(){var e,t=r.scrollYLoad,n=s.scrollYStore,i=a.$refs.refVirtualBody,l=a.computeVirtualYOpts,o=0;(e=i?e||i.children[0]:e)&&(o=e.offsetHeight),o=Math.max(20,o),n.rowHeight=o,t?(i=a.$refs.refVirtualWrapper,e=Math.max(8,i?Math.ceil(i.clientHeight/o):0),t=Math.max(0,Math.min(2,_xeUtils.default.toNumber(l.oSize))),n.offsetSize=t,n.visibleSize=e,n.endIndex=Math.max(n.startIndex,e+t,n.endIndex),a.updateYData()):a.updateYSpace()})},handleScrollToOption:function(e,t){var n,i,l=this.internalData,o=l.optFullValMaps,l=l.scrollYStore,o=o[e[this.computeValueField]];o&&(e=o.key,-1<(o=o._index))&&(n=this.$refs.refVirtualWrapper,e=this.$refs.refOptionPanel.querySelector("[optid='".concat(e,"']")),n)&&(e?(i=n.offsetHeight,t?Math.ceil(e.offsetTop+e.offsetHeight-n.scrollTop)>=i?n.scrollTop=e.offsetTop+e.offsetHeight-i:(e.offsetTop+1<n.scrollTop||e.offsetTop+1>n.scrollTop+n.clientHeight)&&(n.scrollTop=e.offsetTop-1):e.offsetTop+1<n.scrollTop||e.offsetTop+1>n.scrollTop+n.clientHeight?n.scrollTop=e.offsetTop-1:e.offsetTop+e.offsetHeight-n.scrollTop>i&&(n.scrollTop=e.offsetTop+e.offsetHeight-i)):n.scrollTop=t?o*l.rowHeight-n.clientHeight+l.rowHeight:o*l.rowHeight)},scrollTo:function(e,t){var n=this,i=n.reactData,l=n.$refs.refVirtualWrapper;return l&&(_xeUtils.default.isNumber(e)&&(l.scrollLeft=e),_xeUtils.default.isNumber(t))&&(l.scrollTop=t),i.scrollYLoad?new Promise(function(e){setTimeout(function(){n.$nextTick(function(){e()})},50)}):n.$nextTick()},refreshScroll:function(){var e=this,t=e.internalData,n=t.lastScrollLeft,i=t.lastScrollTop;return e.clearScroll().then(function(){if(n||i)return t.lastScrollLeft=0,t.lastScrollTop=0,e.scrollTo(n,i)})},recalculate:function(){var e=this.$refs.refElem;return e&&e.clientWidth&&e.clientHeight?this.computeScrollLoad():Promise.resolve()},loadYData:function(e){var t=this.internalData.scrollYStore,n=t.startIndex,i=t.endIndex,l=t.visibleSize,o=t.offsetSize,e=e.target.scrollTop,e=Math.floor(e/t.rowHeight),a=Math.max(0,e-1-o),o=e+l+o;!(e<=n||i-l-1<=e)||n===a&&i===o||(t.startIndex=a,t.endIndex=o,this.updateYData())},isVMScrollProcess:function(){var e=this.internalData.lastScrollTime;return!!(e&&Date.now()<e+250)},scrollEvent:function(e){var t=this.reactData,n=this.internalData,i=e.target,l=i.scrollTop,i=i.scrollLeft,o=i!==n.lastScrollLeft,a=l!==n.lastScrollTop;n.lastScrollTop=l,n.lastScrollLeft=i,t.scrollYLoad&&this.loadYData(e),n.lastScrollTime=Date.now(),this.dispatchEvent("scroll",{scrollLeft:i,scrollTop:l,isX:o,isY:a},e)},loadData:function(e){var t,n=this,i=n,l=n.reactData,o=n.internalData,a=(n.cacheItemMap(e||[]),i.multiple),r=o.isLoaded,s=o.fullData,c=o.scrollYStore,u=n.computeDefaultOpts,p=n.computeVirtualYOpts,f=n.computeValueField;return Object.assign(c,{startIndex:0,endIndex:1,visibleSize:0}),o.synchData=e||[],l.scrollYLoad=!!p.enabled&&-1<p.gt&&(0===p.gt||p.gt<=s.length),n.handleData(),r||(c=u.selectMode,0<e.length&&_xeUtils.default.eqNull(i.value)&&("all"===c?a?n.$nextTick(function(){n.emitDefaultValue(e.map(function(e){return e[f]}))}):errLog("vxe.error.notConflictProp",["default-config.selectMode=all","multiple=true"]):"first"!==c&&"last"!==c||(t=_xeUtils.default[c](e))&&n.$nextTick(function(){_xeUtils.default.eqNull(i.value)&&n.emitDefaultValue(t[f])}),o.isLoaded=!0)),n.computeScrollLoad().then(function(){n.refreshScroll()})},reloadData:function(e){return this.internalData.isLoaded=!1,this.clearScroll(),this.loadData(e)},clearScroll:function(){var e=this.internalData,t=this.$refs.refVirtualWrapper;return t&&(t.scrollTop=0,t.scrollLeft=0),e.lastScrollTop=0,e.lastScrollLeft=0,this.$nextTick()},hasOptGroupById:function(e){return!!this.internalData.optGroupKeyMaps[e]},renderRadio:function(e,t,n,i,l){var o=this,a=o.computeRadioOpts,r=a.showIcon,a=a.trigger;return n||!1===r?(0,_ui.renderEmptyElement)(o):(r={},a&&"default"!==a||(r.click=function(e){l||n||o.changeOptionEvent(e,t)}),e("div",{key:2,class:["vxe-select-option--radio",{"is--checked":i,"is--disabled":l}],on:r},[e("span",{class:["vxe-radio--icon",i?(0,_ui.getIcon)().RADIO_CHECKED:l?(0,_ui.getIcon)().RADIO_DISABLED_UNCHECKED:(0,_ui.getIcon)().RADIO_UNCHECKED]})]))},renderCheckbox:function(e,t,n,i,l){var o=this,a=o.computeCheckboxOpts,r=a.showIcon,a=a.trigger;return n||!1===r?(0,_ui.renderEmptyElement)(o):(r={},a&&"default"!==a||(r.click=function(e){l||n||o.changeOptionEvent(e,t)}),e("div",{key:3,class:["vxe-select-option--checkbox",{"is--checked":i,"is--disabled":l}],on:r},[e("span",{class:["vxe-checkbox--icon",i?(0,_ui.getIcon)().CHECKBOX_CHECKED:l?(0,_ui.getIcon)().CHECKBOX_DISABLED_UNCHECKED:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})]))},renderOption:function(m,e){var v=this,t=v.$scopedSlots,g=v.allowCreate,b=v.optionKey,n=v.multiple,O=v.reactData.currentOption,_=v.internalData.optAddMaps,i=v.computeOptionOpts,x=v.computeLabelField,E=v.computeValueField,y=v.computeGroupLabelField,D=v.computeSelectVals,S=v.computeRadioOpts,P=v.computeCheckboxOpts,C=i.useKey,I=i.height,T=t.option,V=v.showCheckbox&&n,L=v.showRadio&&!n;return e.map(function(t,e){var n=t.slots,i=t.className,l=v.getOptId(t),o=t[E],a=v.hasOptGroupById(l),r=!(!g||!_[l]),s=!r&&-1<D.indexOf(o),c=r||!a||isOptionVisible(t),u=!r&&v.checkOptionDisabled(s,t),n=(n?n.default:null)||T,p={option:t,group:a?t:null,$select:v},f="",d=[],h=(V?d.push(v.renderCheckbox(m,t,a,s,u)):L&&d.push(v.renderRadio(m,t,a,s,u)),[]),h=n?v.callSlot(n,p,m):[f=(0,_utils.getFuncText)(t[a?y:x]||o)],n=(d.push(m("div",{key:1,class:"vxe-select-option--label"},h)),{mousedown:function(e){0===e.button&&e.stopPropagation()},mouseenter:function(){u||a||v.isVMScrollProcess()||v.setCurrentOption(t)}});return(V?"option"!==P.trigger:L&&"option"!==S.trigger)||(n.click=function(e){u||a||v.changeOptionEvent(e,t)}),c?m("div",{key:C||b?l:e,class:["vxe-select-option",i?_xeUtils.default.isFunction(i)?i(p):i:"",{"vxe-select-optgroup":a,"is--disabled":u,"is--selected":s,"is--add":r,"is--hover":O&&v.getOptId(O)===l}],attrs:{optid:l,title:f||null},style:I?{height:(0,_dom.toCssUnit)(I)}:void 0,on:n},g?[m("span",{key:1,class:"vxe-select-option--add-label"},d),r?m("span",{key:2,class:"vxe-select-option--add-icon"},[m("i",{class:(0,_ui.getIcon)().SELECT_ADD_OPTION})]):(0,_ui.renderEmptyElement)(v)]:d):(0,_ui.renderEmptyElement)(v)})},renderOpts:function(e){var t=this.reactData,n=t.optList;return t.searchLoading?[e("div",{class:"vxe-select--search-loading"},[e("i",{class:["vxe-select--search-icon",(0,_ui.getIcon)().SELECT_LOADED]}),e("span",{class:"vxe-select--search-text"},(0,_ui.getI18n)("vxe.select.loadingText"))])]:n.length?this.renderOption(e,n):[e("div",{class:"vxe-select--empty-placeholder"},this.emptyText||(0,_ui.getI18n)("vxe.select.emptyText"))]},renderVN:function(e){var t,n=this,i=n,l=n.$scopedSlots,o=n.reactData,a=i.className,r=i.multiple,s=i.loading,c=i.filterable,u=i.showTotalButton,p=i.showCheckedButton,f=i.showClearButton,d=i.showCloseButton,h=o.initialized,m=o.isActivated,v=o.isAniVisible,g=o.optList,b=o.visiblePanel,O=o.bodyHeight,_=o.topSpaceHeight,x=n.computeSize,E=n.computeIsDisabled,y=n.computeSelectLabel,D=n.computeFullLabel,S=n.computeBtnTransfer,P=n.computeInpPlaceholder,C=n.computePopupWrapperStyle,I=l.default,T=l.header,V=l.footer,L=l.prefix,l=n.computePopupOpts.className||i.popupClassName;return n.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-select--readonly",a]},[e("div",{class:"vxe-select-slots",ref:"hideOption"},I?n.callSlot(I,{},e):[]),e("span",{class:"vxe-select-label",attrs:{fullLabel:D}},y)]):(t=n.computeSelectVals,e("div",{ref:"refElem",class:["vxe-select",a?_xeUtils.default.isFunction(a)?a({$select:n}):a:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(x),x),"is--visible",b),"is--disabled",E),"is--filter",c),"is--loading",s),"is--active",m)]},[e("div",{class:"vxe-select-slots",ref:"hideOption"},I?I.call(n,{}):[]),e(_input.default,{ref:"refInput",props:{clearable:i.clearable,placeholder:P,editable:!1,disabled:E,type:"text",prefixIcon:i.prefixIcon,suffixIcon:s?(0,_ui.getIcon)().SELECT_LOADED:b?(0,_ui.getIcon)().SELECT_OPEN:(0,_ui.getIcon)().SELECT_CLOSE,autoFocus:!1,title:D,value:y},on:{clear:n.clearEvent,click:n.clickEvent,focus:n.focusEvent,blur:n.blurEvent,"suffix-click":n.suffixClickEvent},scopedSlots:L?{prefix:function(){return L({})}}:{}}),e("div",{ref:"refOptionPanel",class:["vxe-table--ignore-clear vxe-select--panel",l?_xeUtils.default.isFunction(l)?l({$select:n}):l:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(x),x),"is--transfer",S),"ani--leave",!s&&v),"ani--enter",!s&&b)],attrs:{placement:o.panelPlacement},style:o.panelStyle},h&&(b||v)?[e("div",{class:"vxe-select--panel-wrapper",style:C},[c?e("div",{class:"vxe-select--panel-search"},[e(_input.default,{ref:"refInpSearch",class:"vxe-select-search--input",props:{value:o.searchValue,type:"text",clearable:!0,disabled:!1,readonly:!1,placeholder:(0,_ui.getI18n)("vxe.select.search"),prefixIcon:(0,_ui.getIcon)().INPUT_SEARCH},on:{"model-value":n.modelSearchEvent,focus:n.focusSearchEvent,change:n.triggerSearchEvent,search:n.triggerSearchEvent}})]):(0,_ui.renderEmptyElement)(n),p&&r||f||T?e("div",{class:"vxe-select--panel-header"},T?n.callSlot(T,{},e):[e("div",{class:"vxe-tree-select--header-button"},[e("div",{class:"vxe-tree-select--header-btns"},[p&&r?e(_button.default,{props:{content:(0,_ui.getI18n)("vxe.select.allChecked"),mode:"text"},on:{click:n.allCheckedPanelEvent}}):(0,_ui.renderEmptyElement)(n),f?e(_button.default,{props:{content:(0,_ui.getI18n)("vxe.select.clear"),mode:"text"},on:{click:n.clearCheckedPanelEvent}}):(0,_ui.renderEmptyElement)(n)])])]):(0,_ui.renderEmptyElement)(n),e("div",{class:"vxe-select--panel-body"},[e("div",{ref:"refVirtualWrapper",class:"vxe-select-option--wrapper",on:{scroll:n.scrollEvent}},[e("div",{class:"vxe-select--y-space",style:{height:O?"".concat(O,"px"):""}}),e("div",{ref:"refVirtualBody",class:"vxe-select--body",style:{transform:"translateY(".concat(_,"px)")}},n.renderOpts(e))])]),V||u||d&&r?e("div",{class:"vxe-select--panel-footer"},V?n.callSlot(V,{},e):[e("div",{class:"vxe-select--footer-button"},[u?e("div",{class:"vxe-select--total-btns"},(0,_ui.getI18n)("vxe.select.total",[t.length,g.length])):(0,_ui.renderEmptyElement)(n),d&&r?e("div",{class:"vxe-select--oper-btns"},[e(_button.default,{props:{content:(0,_ui.getI18n)("vxe.select.close"),mode:"text"},on:{click:n.closePanelEvent}})]):(0,_ui.renderEmptyElement)(n)])]):(0,_ui.renderEmptyElement)(n)])]:[])]))}},watch:{"reactData.staticOptions":function(e){this.loadData(e)},options:function(e){this.loadData(e)},optionGroups:function(e){this.loadData(e)}},created:function(){this.internalData=createInternalData()},mounted:function(){var n=this,i=n;n.$nextTick(function(){var e=i.options,t=i.optionGroups;t?n.loadData(t):e&&n.loadData(e)}),_ui.globalEvents.on(n,"mousewheel",n.handleGlobalMousewheelEvent),_ui.globalEvents.on(n,"mousedown",n.handleGlobalMousedownEvent),_ui.globalEvents.on(n,"keydown",n.handleGlobalKeydownEvent),_ui.globalEvents.on(n,"blur",n.handleGlobalBlurEvent),_ui.globalEvents.on(n,"resize",n.handleGlobalResizeEvent)},beforeDestroy:function(){var e=this,t=e.$refs.refOptionPanel;t&&t.parentNode&&t.parentNode.removeChild(t),_ui.globalEvents.off(e,"mousewheel"),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"keydown"),_ui.globalEvents.off(e,"blur"),_ui.globalEvents.off(e,"resize")},destroyed:function(){var e=this.reactData,t=this.internalData;_xeUtils.default.assign(e,createReactData()),_xeUtils.default.assign(t,createInternalData())},render:function(e){return this.renderVN(e)}});