vxe-pc-ui 3.3.46 → 3.3.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/calendar/src/calendar.js +44 -1
- package/es/icon/style.css +1 -1
- package/es/menu/src/menu.js +34 -10
- package/es/menu/style.css +6 -2
- package/es/menu/style.min.css +1 -1
- package/es/number-input/src/number-input.js +15 -11
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-menu/style.css +6 -2
- package/es/vxe-menu/style.min.css +1 -1
- package/lib/calendar/src/calendar.js +47 -1
- package/lib/calendar/src/calendar.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +91 -19
- package/lib/index.umd.min.js +1 -1
- package/lib/menu/src/menu.js +28 -5
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/menu/style/style.css +6 -2
- package/lib/menu/style/style.min.css +1 -1
- package/lib/number-input/src/number-input.js +13 -11
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-menu/style/style.css +6 -2
- package/lib/vxe-menu/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/calendar/src/calendar.ts +45 -1
- package/packages/menu/src/menu.ts +35 -10
- package/packages/number-input/src/number-input.ts +13 -11
- package/styles/components/menu.scss +6 -2
- package/types/components/calendar.d.ts +47 -4
- package/types/components/menu.d.ts +16 -12
- package/types/components/option.d.ts +1 -1
- package/types/components/table.d.ts +1 -0
- /package/es/icon/{iconfont.1735027679703.ttf → iconfont.1735200251672.ttf} +0 -0
- /package/es/icon/{iconfont.1735027679703.woff → iconfont.1735200251672.woff} +0 -0
- /package/es/icon/{iconfont.1735027679703.woff2 → iconfont.1735200251672.woff2} +0 -0
- /package/es/{iconfont.1735027679703.ttf → iconfont.1735200251672.ttf} +0 -0
- /package/es/{iconfont.1735027679703.woff → iconfont.1735200251672.woff} +0 -0
- /package/es/{iconfont.1735027679703.woff2 → iconfont.1735200251672.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1735027679703.ttf → iconfont.1735200251672.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1735027679703.woff → iconfont.1735200251672.woff} +0 -0
- /package/lib/icon/style/{iconfont.1735027679703.woff2 → iconfont.1735200251672.woff2} +0 -0
- /package/lib/{iconfont.1735027679703.ttf → iconfont.1735200251672.ttf} +0 -0
- /package/lib/{iconfont.1735027679703.woff → iconfont.1735200251672.woff} +0 -0
- /package/lib/{iconfont.1735027679703.woff2 → iconfont.1735200251672.woff2} +0 -0
package/lib/menu/src/menu.js
CHANGED
|
@@ -9,6 +9,7 @@ var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
|
9
9
|
var _ui = require("../../ui");
|
|
10
10
|
var _dom = require("../../ui/src/dom");
|
|
11
11
|
var _utils = require("../../ui/src/utils");
|
|
12
|
+
var _vn = require("../../ui/src/vn");
|
|
12
13
|
var _index = _interopRequireDefault(require("../../loading/index"));
|
|
13
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
15
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
@@ -69,7 +70,7 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
69
70
|
return collapsed;
|
|
70
71
|
}
|
|
71
72
|
if ($xeLayoutAside) {
|
|
72
|
-
return
|
|
73
|
+
return !!$xeLayoutAside.collapsed;
|
|
73
74
|
}
|
|
74
75
|
return false;
|
|
75
76
|
},
|
|
@@ -114,6 +115,19 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
114
115
|
$xeMenu.$emit('model-value', value);
|
|
115
116
|
}
|
|
116
117
|
},
|
|
118
|
+
callSlot: function callSlot(slotFunc, params, h) {
|
|
119
|
+
var $xeMenu = this;
|
|
120
|
+
var slots = $xeMenu.$scopedSlots;
|
|
121
|
+
if (slotFunc) {
|
|
122
|
+
if (_xeUtils.default.isString(slotFunc)) {
|
|
123
|
+
slotFunc = slots[slotFunc] || null;
|
|
124
|
+
}
|
|
125
|
+
if (_xeUtils.default.isFunction(slotFunc)) {
|
|
126
|
+
return (0, _vn.getSlotVNs)(slotFunc.call($xeMenu, params, h));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return [];
|
|
130
|
+
},
|
|
117
131
|
getMenuTitle: function getMenuTitle(item) {
|
|
118
132
|
return "".concat(item.title || item.name);
|
|
119
133
|
},
|
|
@@ -270,20 +284,29 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
270
284
|
//
|
|
271
285
|
renderMenuTitle: function renderMenuTitle(h, item) {
|
|
272
286
|
var $xeMenu = this;
|
|
287
|
+
var slots = $xeMenu.$scopedSlots;
|
|
273
288
|
var icon = item.icon,
|
|
274
289
|
isExpand = item.isExpand,
|
|
275
|
-
hasChild = item.hasChild
|
|
290
|
+
hasChild = item.hasChild,
|
|
291
|
+
itemSlots = item.slots;
|
|
292
|
+
var optionSlot = itemSlots ? itemSlots.default : slots.option;
|
|
276
293
|
var title = $xeMenu.getMenuTitle(item);
|
|
277
|
-
|
|
294
|
+
var isCollapsed = $xeMenu.computeIsCollapsed;
|
|
295
|
+
return [h('div', {
|
|
278
296
|
class: 'vxe-menu--item-link-icon'
|
|
279
297
|
}, icon ? [h('i', {
|
|
280
298
|
class: icon
|
|
281
|
-
})] : []), h('
|
|
299
|
+
})] : []), optionSlot ? h('div', {
|
|
300
|
+
class: 'vxe-menu--item-custom-title'
|
|
301
|
+
}, $xeMenu.callSlot(optionSlot, {
|
|
302
|
+
option: item,
|
|
303
|
+
collapsed: isCollapsed
|
|
304
|
+
}, h)) : h('div', {
|
|
282
305
|
class: 'vxe-menu--item-link-title',
|
|
283
306
|
attrs: {
|
|
284
307
|
title: title
|
|
285
308
|
}
|
|
286
|
-
}, title), hasChild ? h('
|
|
309
|
+
}, title), hasChild ? h('div', {
|
|
287
310
|
class: 'vxe-menu--item-link-collapse',
|
|
288
311
|
on: {
|
|
289
312
|
click: function click(evnt) {
|
package/lib/menu/src/menu.min.js
CHANGED
|
@@ -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"),_index=_interopRequireDefault(require("../../loading/index"));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,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,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 i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);i=i.call(e,t||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeMenu",mixins:[_ui.globalMixins.sizeMixin,_ui.globalMixins.permissionMixin],props:{value:[String,Number],expandAll:Boolean,collapsed:{type:Boolean,default:null},collapseFixed:Boolean,loading:Boolean,options:{type:Array,default:function(){return[]}},size:{type:String,default:function(){return(0,_ui.getConfig)().image.size||(0,_ui.getConfig)().size}}},inject:{$xeLayoutAside:{default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,isEnterCollapse:!1,collapseStyle:{},collapseZindex:0,activeName:null,menuList:[],itemHeight:1}}},computed:Object.assign(Object.assign({},{}),{computeIsCollapsed:function(){var e=this.$xeLayoutAside,t=this.collapsed;return _xeUtils.default.isBoolean(t)?t:!!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"),_index=_interopRequireDefault(require("../../loading/index"));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,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,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 i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);i=i.call(e,t||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeMenu",mixins:[_ui.globalMixins.sizeMixin,_ui.globalMixins.permissionMixin],props:{value:[String,Number],expandAll:Boolean,collapsed:{type:Boolean,default:null},collapseFixed:Boolean,loading:Boolean,options:{type:Array,default:function(){return[]}},size:{type:String,default:function(){return(0,_ui.getConfig)().image.size||(0,_ui.getConfig)().size}}},inject:{$xeLayoutAside:{default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,isEnterCollapse:!1,collapseStyle:{},collapseZindex:0,activeName:null,menuList:[],itemHeight:1}}},computed:Object.assign(Object.assign({},{}),{computeIsCollapsed:function(){var e=this.$xeLayoutAside,t=this.collapsed;return _xeUtils.default.isBoolean(t)?t:!!e&&!!e.collapsed},computeCollapseWidth:function(){var e=this.$xeLayoutAside,t="";return t=e?e.collapseWidth||"":t},computeCollapseEnterWidth:function(){var e=this.$xeLayoutAside,t="";return t=e?e.width||"":t}}),methods:{dispatchEvent:function(e,t,i){this.$emit(e,(0,_ui.createEvent)(i,{$menu:this},t))},emitModel:function(e){var t=this,i=t.reactData,n=t._events;i.activeName=e,t.$emit("input",e),n&&n.modelValue?t.$emit("modelValue",e):t.$emit("model-value",e)},callSlot:function(e,t,i){var n=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=n[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,i)):[]},getMenuTitle:function(e){return"".concat(e.title||e.name)},updateZindex:function(){var e=this.reactData;e.collapseZindex<(0,_utils.getLastZIndex)()&&(e.collapseZindex=(0,_utils.nextZIndex)())},updateActiveMenu:function(a){var e=this.reactData,s=e.activeName;_xeUtils.default.eachTree(e.menuList,function(e,t,i,n,l,o){e.itemKey===s?(o.forEach(function(e){e.isActive=!0,a&&(e.isExpand=!0)}),e.isExactActive=!0):(e.isExactActive=!1,e.isActive=!1)},{children:"childList"})},updateMenuConfig:function(){var e=this.reactData,t=this.options,o=this.expandAll;e.menuList=_xeUtils.default.mapTree(t,function(e,t,i,n,l){return Object.assign(Object.assign({},e),{parentKey:l?l.name||n.slice(0,n.length-1).join(","):"",level:n.length,itemKey:e.name||n.join(","),isExactActive:!1,isActive:!1,isExpand:_xeUtils.default.isBoolean(e.expanded)?e.expanded:!!o,hasChild:e.children&&0<e.children.length})},{children:"children",mapChildren:"childList"})},updateCollapseStyle:function(){var a=this,s=a.reactData;a.collapseFixed&&a.$nextTick(function(){var e,t=s.isEnterCollapse,i=a.computeIsCollapsed,n=a.computeCollapseEnterWidth,l=a.computeCollapseWidth,o=a.$refs.refElem;o&&(e=o.getBoundingClientRect(),o=o.parentNode,s.collapseStyle=i?{top:(0,_dom.toCssUnit)(e.top),left:(0,_dom.toCssUnit)(e.left),height:(0,_dom.toCssUnit)(o.clientHeight),width:t?n?(0,_dom.toCssUnit)(n):"":l?(0,_dom.toCssUnit)(l):"",zIndex:s.collapseZindex}:{})})},handleCollapseMenu:function(){var e,t=this,i=t.reactData;t.collapseFixed&&(e=i.initialized,t.computeIsCollapsed&&!e&&(i.initialized=!0,t.$nextTick(function(){var e=t.$refs.refCollapseElem;e&&document.body.appendChild(e)})),i.isEnterCollapse=!1,t.updateZindex(),t.updateCollapseStyle())},handleClickIconCollapse:function(e,t){var i=t.hasChild,n=t.isExpand;i&&(e.stopPropagation(),e.preventDefault(),t.isExpand=!n)},handleClickMenu:function(e,t){var i=t.itemKey;!t.routerLink&&t.hasChild?this.handleClickIconCollapse(e,t):this.emitModel(i),this.dispatchEvent("click",{menu:t},e)},handleMenuMouseenter:function(){var e=this.reactData,t=e.collapseStyle,i=this.computeCollapseEnterWidth;e.collapseStyle=Object.assign({},t,{width:i?(0,_dom.toCssUnit)(i):""}),e.isEnterCollapse=!0},handleMenuMouseleave:function(){var e=this.reactData,t=e.collapseStyle,i=this.$refs.refElem;e.collapseStyle=Object.assign({},t,{width:i?(0,_dom.toCssUnit)(i.offsetWidth):""}),e.isEnterCollapse=!1},renderMenuTitle:function(e,t){var i=this,n=i.$scopedSlots,l=t.icon,o=t.isExpand,a=t.hasChild,s=t.slots,s=s?s.default:n.option,n=i.getMenuTitle(t),r=i.computeIsCollapsed;return[e("div",{class:"vxe-menu--item-link-icon"},l?[e("i",{class:l})]:[]),s?e("div",{class:"vxe-menu--item-custom-title"},i.callSlot(s,{option:t,collapsed:r},e)):e("div",{class:"vxe-menu--item-link-title",attrs:{title:n}},n),a?e("div",{class:"vxe-menu--item-link-collapse",on:{click:function(e){i.handleClickIconCollapse(e,t)}}},[e("i",{class:o?(0,_ui.getIcon)().MENU_ITEM_EXPAND_OPEN:(0,_ui.getIcon)().MENU_ITEM_EXPAND_CLOSE})]):(0,_ui.renderEmptyElement)(i)]},renderDefaultChildren:function(t,i){var n=this,e=n.reactData,l=i.itemKey,o=i.level,a=i.hasChild,s=i.isActive,r=i.isExactActive,u=i.isExpand,c=i.routerLink,d=i.childList,e=e.isEnterCollapse,p=n.computeIsCollapsed;return i.permissionCode&&!_ui.permission.checkVisible(i.permissionCode)?(0,_ui.renderEmptyElement)(n):t("div",{key:l,class:["vxe-menu--item-wrapper","vxe-menu--item-level".concat(o),{"is--exact-active":r,"is--active":s,"is--expand":(!p||e)&&u}]},[c?t("router-link",{class:"vxe-menu--item-link",props:{custom:!0,to:c},on:{click:function(e){n.handleClickMenu(e,i)}}},n.renderMenuTitle(t,i)):t("div",{class:"vxe-menu--item-link",on:{click:function(e){n.handleClickMenu(e,i)}}},n.renderMenuTitle(t,i)),a?t("div",{class:"vxe-menu--item-group"},d.map(function(e){return n.renderDefaultChildren(t,e)})):(0,_ui.renderEmptyElement)(n)])},renderCollapseChildren:function(t,i){var n=this,e=i.itemKey,l=i.level,o=i.hasChild,a=i.isActive,s=i.isExactActive,r=i.routerLink,u=i.childList;return i.permissionCode&&!_ui.permission.checkVisible(i.permissionCode)?(0,_ui.renderEmptyElement)(n):t("div",{key:e,class:["vxe-menu--item-wrapper","vxe-menu--item-level".concat(l),{"is--exact-active":s,"is--active":a}]},[r?t("router-link",{class:"vxe-menu--item-link",props:{custom:!0,to:r},on:{click:function(e){n.handleClickMenu(e,i)}}},n.renderMenuTitle(t,i)):t("div",{class:"vxe-menu--item-link",on:{click:function(e){n.handleClickMenu(e,i)}}},n.renderMenuTitle(t,i)),o?t("div",{class:"vxe-menu--item-group"},u.map(function(e){return n.renderDefaultChildren(t,e)})):(0,_ui.renderEmptyElement)(n)])},renderVN:function(t){var i=this,e=i.reactData,n=i.loading,l=e.initialized,o=e.menuList,a=e.collapseStyle,e=e.isEnterCollapse,s=i.computeSize,r=i.computeIsCollapsed;return t("div",{ref:"refElem",class:["vxe-menu",_defineProperty(_defineProperty(_defineProperty({},"size--".concat(s),s),"is--collapsed",r),"is--loading",n)]},[t("div",{class:"vxe-menu--item-list"},o.map(function(e){return r?i.renderCollapseChildren(t,e):i.renderDefaultChildren(t,e)})),l?t("div",{ref:"refCollapseElem",class:["vxe-menu--collapse-wrapper",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(s),s),"is--collapsed",r),"is--enter",e),"is--loading",n)],style:a,on:{mouseenter:i.handleMenuMouseenter,mouseleave:i.handleMenuMouseleave}},[r?t("div",{class:"vxe-menu--item-list"},o.map(function(e){return i.renderDefaultChildren(t,e)})):(0,_ui.renderEmptyElement)(i)]):(0,_ui.renderEmptyElement)(i),t(_index.default,{class:"vxe-list-view--loading",props:{value:n}})])}},watch:{value:function(e){this.reactData.activeName=e},options:function(){this.updateMenuConfig(),this.updateActiveMenu(!0)},"reactData.activeName":function(){this.updateActiveMenu(!0)},computeIsCollapsed:function(){this.handleCollapseMenu()}},mounted:function(){_ui.globalEvents.on(this,"resize",this.updateCollapseStyle),this.updateCollapseStyle()},beforeDestroy:function(){_ui.globalEvents.off(this,"resize");var e,t=this.$refs.refCollapseElem;t&&(e=t.parentNode)&&e.removeChild(t)},created:function(){var e=this.reactData;e.initialized=!!this.collapsed,e.activeName=this.value,this.updateMenuConfig(),this.updateActiveMenu(!0)},render:function(e){return this.renderVN(e)}});
|
package/lib/menu/style/style.css
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
position: relative;
|
|
3
3
|
}
|
|
4
4
|
.vxe-menu.is--collapsed .vxe-menu--item-link-title,
|
|
5
|
+
.vxe-menu.is--collapsed .vxe-menu--item-custom-title,
|
|
5
6
|
.vxe-menu.is--collapsed .vxe-menu--item-link-collapse {
|
|
6
7
|
display: none;
|
|
7
8
|
}
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
transition: all 0.25s ease-in-out;
|
|
28
29
|
}
|
|
29
30
|
.vxe-menu--collapse-wrapper:not(.is--enter) .vxe-menu--item-link-title,
|
|
31
|
+
.vxe-menu--collapse-wrapper:not(.is--enter) .vxe-menu--item-custom-title,
|
|
30
32
|
.vxe-menu--collapse-wrapper:not(.is--enter) .vxe-menu--item-link-collapse {
|
|
31
33
|
display: none;
|
|
32
34
|
}
|
|
@@ -52,7 +54,8 @@
|
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
.vxe-menu--item-link,
|
|
55
|
-
.vxe-menu--item-link-title
|
|
57
|
+
.vxe-menu--item-link-title,
|
|
58
|
+
.vxe-menu--item-custom-title {
|
|
56
59
|
overflow: hidden;
|
|
57
60
|
text-overflow: ellipsis;
|
|
58
61
|
white-space: nowrap;
|
|
@@ -64,7 +67,8 @@
|
|
|
64
67
|
text-align: center;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
.vxe-menu--item-link-title
|
|
70
|
+
.vxe-menu--item-link-title,
|
|
71
|
+
.vxe-menu--item-custom-title {
|
|
68
72
|
flex-grow: 1;
|
|
69
73
|
padding-left: 0.2em;
|
|
70
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.vxe-menu{position:relative}.vxe-menu.is--collapsed .vxe-menu--item-link-collapse,.vxe-menu.is--collapsed .vxe-menu--item-link-title{display:none}.vxe-menu.is--loading{min-height:4em}.vxe-menu,.vxe-menu--collapse-wrapper{font-size:var(--vxe-ui-font-size-default);color:var(--vxe-ui-font-color);font-family:var(--vxe-ui-font-family);background-color:var(--vxe-ui-layout-background-color)}.vxe-menu--collapse-wrapper{display:none;position:absolute;overflow:auto}.vxe-menu--collapse-wrapper.is--collapsed{display:block;transition:all .25s ease-in-out}.vxe-menu--collapse-wrapper:not(.is--enter) .vxe-menu--item-link-collapse,.vxe-menu--collapse-wrapper:not(.is--enter) .vxe-menu--item-link-title{display:none}.vxe-menu--collapse-wrapper.is--enter{box-shadow:var(--vxe-ui-menu-collapse-wrapper-box-shadow)}.vxe-menu--item-link{display:flex;flex-direction:row;align-items:center;height:var(--vxe-ui-menu-item-height);color:var(--vxe-ui-font-color);text-decoration:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-menu--item-link:hover{color:var(--vxe-ui-menu-item-hover-color);background-color:var(--vxe-ui-base-hover-background-color)}.vxe-menu--item-link,.vxe-menu--item-link-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vxe-menu--item-link-icon{flex-shrink:0;width:var(--vxe-ui-menu-icon-width);text-align:center}.vxe-menu--item-link-title{flex-grow:1;padding-left:.2em}.vxe-menu--item-link-collapse{flex-shrink:0;padding:.5em}.vxe-menu--item-link-collapse i{display:inline-block;transition:transform .25s ease-in-out}.vxe-menu--item-wrapper.vxe-menu--item-level1>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double)}.vxe-menu--item-wrapper.vxe-menu--item-level1>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 1)}.vxe-menu--item-wrapper.vxe-menu--item-level2>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 2)}.vxe-menu--item-wrapper.vxe-menu--item-level3>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 3)}.vxe-menu--item-wrapper.vxe-menu--item-level4>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 4)}.vxe-menu--item-wrapper.vxe-menu--item-level5>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 5)}.vxe-menu--item-wrapper.vxe-menu--item-level6>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 6)}.vxe-menu--item-wrapper.vxe-menu--item-level7>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 7)}.vxe-menu--item-level3{font-size:13px}.vxe-menu--item-group{display:none}.vxe-menu--item-wrapper.is--active>.vxe-menu--item-link{font-weight:700}.vxe-menu--item-wrapper.is--exact-active>.vxe-menu--item-link{color:var(--vxe-ui-font-primary-color);background-color:var(--vxe-ui-base-active-background-color)}.vxe-menu--item-wrapper.is--expand>.vxe-menu--item-group{display:block}
|
|
1
|
+
.vxe-menu{position:relative}.vxe-menu.is--collapsed .vxe-menu--item-custom-title,.vxe-menu.is--collapsed .vxe-menu--item-link-collapse,.vxe-menu.is--collapsed .vxe-menu--item-link-title{display:none}.vxe-menu.is--loading{min-height:4em}.vxe-menu,.vxe-menu--collapse-wrapper{font-size:var(--vxe-ui-font-size-default);color:var(--vxe-ui-font-color);font-family:var(--vxe-ui-font-family);background-color:var(--vxe-ui-layout-background-color)}.vxe-menu--collapse-wrapper{display:none;position:absolute;overflow:auto}.vxe-menu--collapse-wrapper.is--collapsed{display:block;transition:all .25s ease-in-out}.vxe-menu--collapse-wrapper:not(.is--enter) .vxe-menu--item-custom-title,.vxe-menu--collapse-wrapper:not(.is--enter) .vxe-menu--item-link-collapse,.vxe-menu--collapse-wrapper:not(.is--enter) .vxe-menu--item-link-title{display:none}.vxe-menu--collapse-wrapper.is--enter{box-shadow:var(--vxe-ui-menu-collapse-wrapper-box-shadow)}.vxe-menu--item-link{display:flex;flex-direction:row;align-items:center;height:var(--vxe-ui-menu-item-height);color:var(--vxe-ui-font-color);text-decoration:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-menu--item-link:hover{color:var(--vxe-ui-menu-item-hover-color);background-color:var(--vxe-ui-base-hover-background-color)}.vxe-menu--item-custom-title,.vxe-menu--item-link,.vxe-menu--item-link-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vxe-menu--item-link-icon{flex-shrink:0;width:var(--vxe-ui-menu-icon-width);text-align:center}.vxe-menu--item-custom-title,.vxe-menu--item-link-title{flex-grow:1;padding-left:.2em}.vxe-menu--item-link-collapse{flex-shrink:0;padding:.5em}.vxe-menu--item-link-collapse i{display:inline-block;transition:transform .25s ease-in-out}.vxe-menu--item-wrapper.vxe-menu--item-level1>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double)}.vxe-menu--item-wrapper.vxe-menu--item-level1>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 1)}.vxe-menu--item-wrapper.vxe-menu--item-level2>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 2)}.vxe-menu--item-wrapper.vxe-menu--item-level3>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 3)}.vxe-menu--item-wrapper.vxe-menu--item-level4>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 4)}.vxe-menu--item-wrapper.vxe-menu--item-level5>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 5)}.vxe-menu--item-wrapper.vxe-menu--item-level6>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 6)}.vxe-menu--item-wrapper.vxe-menu--item-level7>.vxe-menu--item-link{padding:0 var(--vxe-ui-layout-padding-double) 0 calc(var(--vxe-ui-layout-padding-double) * 7)}.vxe-menu--item-level3{font-size:13px}.vxe-menu--item-group{display:none}.vxe-menu--item-wrapper.is--active>.vxe-menu--item-link{font-weight:700}.vxe-menu--item-wrapper.is--exact-active>.vxe-menu--item-link{color:var(--vxe-ui-font-primary-color);background-color:var(--vxe-ui-base-active-background-color)}.vxe-menu--item-wrapper.is--expand>.vxe-menu--item-group{display:block}
|
|
@@ -501,19 +501,19 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
501
501
|
var inputValue = reactData.inputValue;
|
|
502
502
|
var digitsValue = $xeNumberInput.computeDigitsValue;
|
|
503
503
|
var decimalsType = $xeNumberInput.computeDecimalsType;
|
|
504
|
-
if (
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
if (textValue !== inputValue) {
|
|
514
|
-
reactData.inputValue = textValue;
|
|
504
|
+
if ((0, _utils.eqEmptyValue)(val)) {
|
|
505
|
+
reactData.inputValue = '';
|
|
506
|
+
} else {
|
|
507
|
+
var textValue = "".concat(val);
|
|
508
|
+
if (decimalsType) {
|
|
509
|
+
textValue = (0, _util.toFloatValueFixed)(val, digitsValue);
|
|
510
|
+
if (!autoFill) {
|
|
511
|
+
textValue = "".concat(_xeUtils.default.toNumber(textValue));
|
|
515
512
|
}
|
|
516
513
|
}
|
|
514
|
+
if (textValue !== inputValue) {
|
|
515
|
+
reactData.inputValue = textValue;
|
|
516
|
+
}
|
|
517
517
|
}
|
|
518
518
|
},
|
|
519
519
|
/**
|
|
@@ -542,6 +542,8 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
542
542
|
$xeNumberInput.handleChange(validValue, textValue, {
|
|
543
543
|
type: 'init'
|
|
544
544
|
});
|
|
545
|
+
} else {
|
|
546
|
+
reactData.inputValue = textValue;
|
|
545
547
|
}
|
|
546
548
|
}
|
|
547
549
|
}
|
|
@@ -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,i=Array(t);n<t;n++)i[n]=e[n];return i}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,u,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=(i=r.call(n)).done)&&(l.push(i.value),l.length!==t);o=!0);}catch(e){s=!0,u=e}finally{try{if(!o&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw u}}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:[String,Number],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}},multiple:Boolean,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}},controls:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.controls}},digits:{type:[String,Number],default:null},autoFill:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.autoFill}},prefixIcon:String,suffixIcon:String,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},computeDecimalsType:function(){var e=this.type;return"float"===e||"amount"===e},computeStepValue:function(){var e=this.type,t=this.computeDigitsValue,n=this.computeDecimalsType,i=this.step;return"integer"===e?_xeUtils.default.toInteger(i)||1:n?_xeUtils.default.toNumber(i)||1/Math.pow(10,t):_xeUtils.default.toNumber(i)||1},computeIsClearable:function(){return this.clearable},computeInputReadonly:function(){var e=this.multiple;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.maxLength,t=this.maxlength;return _xeUtils.default.toNumber(e||t)||16},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.reactData,t=this.type,n=this.showCurrency,i=this.currencySymbol,u=this.autoFill,e=e.inputValue,r=this.computeDigitsValue;return"amount"===t?(t=_xeUtils.default.commafy(_xeUtils.default.toNumber(e),{digits:r}),!u&&(u=(r=_slicedToArray(t.split("."),2))[0],r=r[1])&&(t=(r=r.replace(/0+$/,""))?[u,".",r].join(""):u),n?"".concat(i||(0,_ui.getI18n)("vxe.numberInput.currencySymbol")||"").concat(t):t):_xeUtils.default.toString(e)},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=this.reactData,t=this.$refs.refInputTarget;return e.isActivated=!0,t.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.exponential,n=this.autoFill,i=this.computeInpMaxLength,u=this.computeDigitsValue,r="";return this.computeDecimalsType?(r=(0,_util.toFloatValueFixed)(e,u),n||(r=handleNumberString(_xeUtils.default.toNumber(r)))):r=handleNumberString(e),!t||e!==r&&handleNumberString(e).toLowerCase()!==_xeUtils.default.toNumber(r).toExponential()?r.slice(0,i):e},triggerEvent:function(e){var t=this.reactData.inputValue;this.dispatchEvent(e.type,{value:t},e)},handleChange:function(e,t,n){var i=this,u=i,r=i.reactData,a=i.internalData,l=i.$xeForm,o=i.formItemInfo,e=(0,_utils.eqEmptyValue)(e)?null:Number(e),u=e!==u.value;a.isUM=!0,u&&i.emitModel(e),r.inputValue!==t&&i.$nextTick(function(){r.inputValue=t||""}),i.dispatchEvent("input",{value:e},n),u&&(i.dispatchEvent("change",{value:e},n),l)&&o&&l.triggerItemEvent(n,o.itemConfig.field,e)},emitInputEvent:function(e,t){var n=this.reactData,i=this.computeInpImmediate,u=e===(0,_utils.eqEmptyValue)(e)?null:_xeUtils.default.toNumber(e);n.inputValue=e,i?this.handleChange(u,e,t):this.dispatchEvent("input",{value:u},t)},inputEvent:function(e){var t=e.target.value;this.emitInputEvent(t,e)},changeEvent:function(e){this.computeInpImmediate||this.triggerEvent(e)},focusEvent:function(e){var t=this.reactData,n=t.inputValue;t.inputValue=(0,_utils.eqEmptyValue)(n)?"":"".concat(_xeUtils.default.toNumber(n)),t.isFocus=!0,t.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)},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,i=this.autoFill,u=n.inputValue,r=this.computeDigitsValue;this.computeDecimalsType&&e&&(t="",e&&(t=(0,_util.toFloatValueFixed)(e,r),i||(t="".concat(_xeUtils.default.toNumber(t)))),t!==u)&&(n.inputValue=t)},initValue:function(){var e,t,n=this,i=n.reactData,u=n.autoFill,i=i.inputValue;n.computeDecimalsType&&i&&(e="",t=null,i&&(e=(0,_util.toFloatValueFixed)(i,n.computeDigitsValue),t=_xeUtils.default.toNumber(e),u||(e="".concat(t))),i!==t)&&n.handleChange(t,e,{type:"init"})},validMaxNum:function(e){return null===this.max||_xeUtils.default.toNumber(e)<=_xeUtils.default.toNumber(this.max)},validMinNum:function(e){return null===this.min||_xeUtils.default.toNumber(e)>=_xeUtils.default.toNumber(this.min)},afterCheckValue:function(){var e,t,n=this,i=n.reactData,u=n.type,r=n.min,a=n.max,l=n.exponential,i=i.inputValue;n.computeInputReadonly||((0,_utils.eqEmptyValue)(i)?(e=null,t=i,!r&&0!==r||(e=_xeUtils.default.toNumber(r),t="".concat(e)),n.handleChange(e,"".concat(t||""),{type:"check"})):(i||r||a)&&(e="integer"===u?_xeUtils.default.toInteger((0,_util.handleNumber)(i)):_xeUtils.default.toNumber((0,_util.handleNumber)(i)),n.validMinNum(e)?n.validMaxNum(e)||(e=a):e=r,l&&(t=handleNumberString(i).toLowerCase())===_xeUtils.default.toNumber(e).toExponential()&&(e=t),u=n.getNumberValue(e),n.handleChange((0,_utils.eqEmptyValue)(u)?null:Number(u),u,{type:"check"})))},blurEvent:function(e){var t=this,n=t.reactData,i=t.$xeForm,u=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),i&&u&&i.triggerItemEvent(e,u.itemConfig.field,l)},numberChange:function(e,t){var n=this,i=n.reactData,u=n.min,r=n.max,i=i.inputValue,a=n.computeStepValue,i="integer"===n.type?_xeUtils.default.toInteger((0,_util.handleNumber)(i)):_xeUtils.default.toNumber((0,_util.handleNumber)(i)),e=e?_xeUtils.default.add(i,a):_xeUtils.default.subtract(i,a),i=n.validMinNum(e)?n.validMaxNum(e)?e:r:u;n.emitInputEvent(n.getNumberValue(i),t)},numberNextEvent:function(e){var t=this,n=t.reactData,i=t.computeIsDisabled,u=t.computeFormReadonly,r=t.computeIsDisabledSubtractNumber;t.numberStopDown(),i||u||r||t.numberChange(!1,e),n.isActivated=!0,t.dispatchEvent("next-number",{value:n.inputValue},e)},numberDownNextEvent:function(e){var t=this;t.internalData.dnTimeout=window.setTimeout(function(){t.numberNextEvent(e),t.numberDownNextEvent(e)},60)},numberPrevEvent:function(e){var t=this,n=t.reactData,i=t.computeIsDisabled,u=t.computeFormReadonly,r=t.computeIsDisabledAddNumber;t.numberStopDown(),i||u||r||t.numberChange(!0,e),n.isActivated=!0,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.numberPrevEvent(e):this.numberNextEvent(e))},keydownEvent:function(e){var t=this.exponential,n=this.controls,i=e.ctrlKey,u=e.shiftKey,r=e.altKey,a=e.keyCode,l=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),o=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),s=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);i||u||r||!(_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.SPACEBAR)||(!t||69!==a)&&65<=a&&a<=90||186<=a&&a<=188||191<=a)||e.preventDefault(),l?this.afterCheckValue():(o||s)&&n&&this.numberKeydownEvent(e),this.triggerEvent(e)},keyupEvent:function(e){this.triggerEvent(e)},numberStopDown:function(){var e=this.internalData,t=e.dnTimeout;t&&(clearTimeout(t),e.dnTimeout=void 0)},numberDownPrevEvent:function(e){var t=this;t.internalData.dnTimeout=window.setTimeout(function(){t.numberPrevEvent(e),t.numberDownPrevEvent(e)},60)},numberMousedownEvent:function(e){var t,n=this,i=n.internalData;n.numberStopDown(),0===e.button&&((t=(0,_dom.hasClass)(e.currentTarget,"is--prev"))?n.numberPrevEvent(e):n.numberNextEvent(e),i.dnTimeout=window.setTimeout(function(){t?n.numberDownPrevEvent(e):n.numberDownNextEvent(e)},500))},wheelEvent:function(e){var t=this,n=t.reactData;t.controls&&n.isActivated&&(e.stopPropagation(),e.preventDefault(),0<(n=e.deltaY)?t.numberNextEvent(e):n<0&&t.numberPrevEvent(e)),t.triggerEvent(e)},clickEvent:function(e){this.triggerEvent(e)},handleGlobalMousedownEvent:function(e){var t=this,n=t.reactData,i=n.isActivated,u=t.$refs.refElem,r=t.$refs.refInputPanel,a=t.computeInpImmediate;!t.computeIsDisabled&&i&&(n.isActivated=(0,_dom.getEventTargetNode)(e,u).flag||(0,_dom.getEventTargetNode)(e,r).flag,n.isActivated||(a||(u=(i=n.inputValue)?Number(i):null,t.handleChange(u,handleNumberString(i),e)),t.afterCheckValue()))},handleGlobalKeydownEvent:function(e){var t,n,i,u=this,r=u.reactData,a=u.clearable;u.computeIsDisabled||(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.TAB),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.DELETE),i=r.isActivated,t&&(i&&u.afterCheckValue(),r.isActivated=i=!1),n&&a&&i&&u.clearValueEvent(e,null))},handleGlobalBlurEvent:function(){this.reactData.isActivated&&this.afterCheckValue()},renderNumberIcon:function(e){var t=this,n=t.computeIsDisabledAddNumber,i=t.computeIsDisabledSubtractNumber;return e("div",{class:"vxe-input--control-icon"},[e("div",{class:"vxe-input--number-icon"},[e("div",{class:["vxe-input--number-btn is--prev",{"is--disabled":n}],on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:(0,_ui.getIcon)().NUMBER_INPUT_PREV_NUM})]),e("div",{class:["vxe-input--number-btn is--next",{"is--disabled":i}],on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:(0,_ui.getIcon)().NUMBER_INPUT_NEXT_NUM})])])])},renderPrefixIcon:function(e){var t=this.$scopedSlots,n=this.prefixIcon,t=t.prefix;return t||n?e("div",{class:"vxe-number-input--prefix",on:{click:this.clickPrefixEvent}},[e("div",{class:"vxe-number-input--prefix-icon"},t?(0,_vn.getSlotVNs)(t({})):[e("i",{class:n})])]):null},renderSuffixIcon:function(e){var t=this,n=t.$scopedSlots,i=t.suffixIcon,u=t.reactData.inputValue,n=n.suffix,r=t.computeIsClearable;return e("div",{class:["vxe-number-input--suffix",{"is--clear":r&&!t.computeIsDisabled&&!(""===u||_xeUtils.default.eqNull(u))}]},[r?e("div",{class:"vxe-number-input--clear-icon",on:{click:t.clearValueEvent}},[e("i",{class:(0,_ui.getIcon)().INPUT_CLEAR})]):(0,_ui.renderEmptyElement)(t),t.renderExtraSuffixIcon(e),n||i?e("div",{class:"vxe-number-input--suffix-icon",on:{click:t.clickSuffixEvent}},n?(0,_vn.getSlotVNs)(n({})):[e("i",{class:i})]):(0,_ui.renderEmptyElement)(t)])},renderExtraSuffixIcon:function(e){return this.controls?this.renderNumberIcon(e):(0,_ui.renderEmptyElement)(this)},renderVN:function(e){var t,n,i,u,r,a,l=this,o=l.reactData,s=l.className,c=l.controls,m=l.type,p=l.align,d=l.name,f=l.autocomplete,v=l.autoComplete,h=o.inputValue,b=o.isFocus,o=o.isActivated,_=l.computeSize,g=l.computeIsDisabled,y=l.computeNumLabel;return l.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-number-input--readonly","type--".concat(m),s]},y):(t=l.computeInputReadonly,n=l.computeInpMaxLength,i=l.computeInpPlaceholder,u=l.computeIsClearable,r=l.renderPrefixIcon(e),a=l.renderSuffixIcon(e),e("div",{ref:"refElem",class:["vxe-number-input","type--".concat(m),s,_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(_),_),"is--".concat(p),p),"is--controls",c),"is--prefix",!!r),"is--suffix",!!a),"is--disabled",g),"is--active",o),"show--clear",u&&!g&&!(""===h||_xeUtils.default.eqNull(h)))],attrs:{spellcheck:!1}},[r||(0,_ui.renderEmptyElement)(l),e("div",{class:"vxe-number-input--wrapper"},[e("input",{ref:"refInputTarget",class:"vxe-number-input--inner",domProps:{value:b||"amount"!==m?h:y},attrs:{name:d,type:"text",placeholder:i,maxlength:n,readonly:t,disabled:g,autocomplete:v||f},on:{keydown:l.keydownEvent,keyup:l.keyupEvent,wheel:l.wheelEvent,click:l.clickEvent,input:l.inputEvent,change:l.changeEvent,focus:l.focusEvent,blur:l.blurEvent}})]),a||(0,_ui.renderEmptyElement)(l)]))}},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.reactData.inputValue=this.value,this.initValue()},mounted:function(){var e=this;_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;e.reactData.isFocus=!1,e.numberStopDown(),e.afterCheckValue(),_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,i=Array(t);n<t;n++)i[n]=e[n];return i}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,u,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=(i=r.call(n)).done)&&(l.push(i.value),l.length!==t);o=!0);}catch(e){s=!0,u=e}finally{try{if(!o&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw u}}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:[String,Number],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}},multiple:Boolean,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}},controls:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.controls}},digits:{type:[String,Number],default:null},autoFill:{type:Boolean,default:function(){return(0,_ui.getConfig)().numberInput.autoFill}},prefixIcon:String,suffixIcon:String,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},computeDecimalsType:function(){var e=this.type;return"float"===e||"amount"===e},computeStepValue:function(){var e=this.type,t=this.computeDigitsValue,n=this.computeDecimalsType,i=this.step;return"integer"===e?_xeUtils.default.toInteger(i)||1:n?_xeUtils.default.toNumber(i)||1/Math.pow(10,t):_xeUtils.default.toNumber(i)||1},computeIsClearable:function(){return this.clearable},computeInputReadonly:function(){var e=this.multiple;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.maxLength,t=this.maxlength;return _xeUtils.default.toNumber(e||t)||16},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.reactData,t=this.type,n=this.showCurrency,i=this.currencySymbol,u=this.autoFill,e=e.inputValue,r=this.computeDigitsValue;return"amount"===t?(t=_xeUtils.default.commafy(_xeUtils.default.toNumber(e),{digits:r}),!u&&(u=(r=_slicedToArray(t.split("."),2))[0],r=r[1])&&(t=(r=r.replace(/0+$/,""))?[u,".",r].join(""):u),n?"".concat(i||(0,_ui.getI18n)("vxe.numberInput.currencySymbol")||"").concat(t):t):_xeUtils.default.toString(e)},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=this.reactData,t=this.$refs.refInputTarget;return e.isActivated=!0,t.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.exponential,n=this.autoFill,i=this.computeInpMaxLength,u=this.computeDigitsValue,r="";return this.computeDecimalsType?(r=(0,_util.toFloatValueFixed)(e,u),n||(r=handleNumberString(_xeUtils.default.toNumber(r)))):r=handleNumberString(e),!t||e!==r&&handleNumberString(e).toLowerCase()!==_xeUtils.default.toNumber(r).toExponential()?r.slice(0,i):e},triggerEvent:function(e){var t=this.reactData.inputValue;this.dispatchEvent(e.type,{value:t},e)},handleChange:function(e,t,n){var i=this,u=i,r=i.reactData,a=i.internalData,l=i.$xeForm,o=i.formItemInfo,e=(0,_utils.eqEmptyValue)(e)?null:Number(e),u=e!==u.value;a.isUM=!0,u&&i.emitModel(e),r.inputValue!==t&&i.$nextTick(function(){r.inputValue=t||""}),i.dispatchEvent("input",{value:e},n),u&&(i.dispatchEvent("change",{value:e},n),l)&&o&&l.triggerItemEvent(n,o.itemConfig.field,e)},emitInputEvent:function(e,t){var n=this.reactData,i=this.computeInpImmediate,u=e===(0,_utils.eqEmptyValue)(e)?null:_xeUtils.default.toNumber(e);n.inputValue=e,i?this.handleChange(u,e,t):this.dispatchEvent("input",{value:u},t)},inputEvent:function(e){var t=e.target.value;this.emitInputEvent(t,e)},changeEvent:function(e){this.computeInpImmediate||this.triggerEvent(e)},focusEvent:function(e){var t=this.reactData,n=t.inputValue;t.inputValue=(0,_utils.eqEmptyValue)(n)?"":"".concat(_xeUtils.default.toNumber(n)),t.isFocus=!0,t.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)},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,i=this.autoFill,u=n.inputValue,r=this.computeDigitsValue,a=this.computeDecimalsType;(0,_utils.eqEmptyValue)(e)?n.inputValue="":(t="".concat(e),a&&(t=(0,_util.toFloatValueFixed)(e,r),i||(t="".concat(_xeUtils.default.toNumber(t)))),t!==u&&(n.inputValue=t))},initValue:function(){var e,t,n=this,i=n.reactData,u=n.autoFill,r=i.inputValue;n.computeDecimalsType&&r&&(e="",t=null,r&&(e=(0,_util.toFloatValueFixed)(r,n.computeDigitsValue),t=_xeUtils.default.toNumber(e),u||(e="".concat(t))),r!==t?n.handleChange(t,e,{type:"init"}):i.inputValue=e)},validMaxNum:function(e){return null===this.max||_xeUtils.default.toNumber(e)<=_xeUtils.default.toNumber(this.max)},validMinNum:function(e){return null===this.min||_xeUtils.default.toNumber(e)>=_xeUtils.default.toNumber(this.min)},afterCheckValue:function(){var e,t,n=this,i=n.reactData,u=n.type,r=n.min,a=n.max,l=n.exponential,i=i.inputValue;n.computeInputReadonly||((0,_utils.eqEmptyValue)(i)?(e=null,t=i,!r&&0!==r||(e=_xeUtils.default.toNumber(r),t="".concat(e)),n.handleChange(e,"".concat(t||""),{type:"check"})):(i||r||a)&&(e="integer"===u?_xeUtils.default.toInteger((0,_util.handleNumber)(i)):_xeUtils.default.toNumber((0,_util.handleNumber)(i)),n.validMinNum(e)?n.validMaxNum(e)||(e=a):e=r,l&&(t=handleNumberString(i).toLowerCase())===_xeUtils.default.toNumber(e).toExponential()&&(e=t),u=n.getNumberValue(e),n.handleChange((0,_utils.eqEmptyValue)(u)?null:Number(u),u,{type:"check"})))},blurEvent:function(e){var t=this,n=t.reactData,i=t.$xeForm,u=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),i&&u&&i.triggerItemEvent(e,u.itemConfig.field,l)},numberChange:function(e,t){var n=this,i=n.reactData,u=n.min,r=n.max,i=i.inputValue,a=n.computeStepValue,i="integer"===n.type?_xeUtils.default.toInteger((0,_util.handleNumber)(i)):_xeUtils.default.toNumber((0,_util.handleNumber)(i)),e=e?_xeUtils.default.add(i,a):_xeUtils.default.subtract(i,a),i=n.validMinNum(e)?n.validMaxNum(e)?e:r:u;n.emitInputEvent(n.getNumberValue(i),t)},numberNextEvent:function(e){var t=this,n=t.reactData,i=t.computeIsDisabled,u=t.computeFormReadonly,r=t.computeIsDisabledSubtractNumber;t.numberStopDown(),i||u||r||t.numberChange(!1,e),n.isActivated=!0,t.dispatchEvent("next-number",{value:n.inputValue},e)},numberDownNextEvent:function(e){var t=this;t.internalData.dnTimeout=window.setTimeout(function(){t.numberNextEvent(e),t.numberDownNextEvent(e)},60)},numberPrevEvent:function(e){var t=this,n=t.reactData,i=t.computeIsDisabled,u=t.computeFormReadonly,r=t.computeIsDisabledAddNumber;t.numberStopDown(),i||u||r||t.numberChange(!0,e),n.isActivated=!0,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.numberPrevEvent(e):this.numberNextEvent(e))},keydownEvent:function(e){var t=this.exponential,n=this.controls,i=e.ctrlKey,u=e.shiftKey,r=e.altKey,a=e.keyCode,l=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),o=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),s=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);i||u||r||!(_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.SPACEBAR)||(!t||69!==a)&&65<=a&&a<=90||186<=a&&a<=188||191<=a)||e.preventDefault(),l?this.afterCheckValue():(o||s)&&n&&this.numberKeydownEvent(e),this.triggerEvent(e)},keyupEvent:function(e){this.triggerEvent(e)},numberStopDown:function(){var e=this.internalData,t=e.dnTimeout;t&&(clearTimeout(t),e.dnTimeout=void 0)},numberDownPrevEvent:function(e){var t=this;t.internalData.dnTimeout=window.setTimeout(function(){t.numberPrevEvent(e),t.numberDownPrevEvent(e)},60)},numberMousedownEvent:function(e){var t,n=this,i=n.internalData;n.numberStopDown(),0===e.button&&((t=(0,_dom.hasClass)(e.currentTarget,"is--prev"))?n.numberPrevEvent(e):n.numberNextEvent(e),i.dnTimeout=window.setTimeout(function(){t?n.numberDownPrevEvent(e):n.numberDownNextEvent(e)},500))},wheelEvent:function(e){var t=this,n=t.reactData;t.controls&&n.isActivated&&(e.stopPropagation(),e.preventDefault(),0<(n=e.deltaY)?t.numberNextEvent(e):n<0&&t.numberPrevEvent(e)),t.triggerEvent(e)},clickEvent:function(e){this.triggerEvent(e)},handleGlobalMousedownEvent:function(e){var t=this,n=t.reactData,i=n.isActivated,u=t.$refs.refElem,r=t.$refs.refInputPanel,a=t.computeInpImmediate;!t.computeIsDisabled&&i&&(n.isActivated=(0,_dom.getEventTargetNode)(e,u).flag||(0,_dom.getEventTargetNode)(e,r).flag,n.isActivated||(a||(u=(i=n.inputValue)?Number(i):null,t.handleChange(u,handleNumberString(i),e)),t.afterCheckValue()))},handleGlobalKeydownEvent:function(e){var t,n,i,u=this,r=u.reactData,a=u.clearable;u.computeIsDisabled||(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.TAB),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.DELETE),i=r.isActivated,t&&(i&&u.afterCheckValue(),r.isActivated=i=!1),n&&a&&i&&u.clearValueEvent(e,null))},handleGlobalBlurEvent:function(){this.reactData.isActivated&&this.afterCheckValue()},renderNumberIcon:function(e){var t=this,n=t.computeIsDisabledAddNumber,i=t.computeIsDisabledSubtractNumber;return e("div",{class:"vxe-input--control-icon"},[e("div",{class:"vxe-input--number-icon"},[e("div",{class:["vxe-input--number-btn is--prev",{"is--disabled":n}],on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:(0,_ui.getIcon)().NUMBER_INPUT_PREV_NUM})]),e("div",{class:["vxe-input--number-btn is--next",{"is--disabled":i}],on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:(0,_ui.getIcon)().NUMBER_INPUT_NEXT_NUM})])])])},renderPrefixIcon:function(e){var t=this.$scopedSlots,n=this.prefixIcon,t=t.prefix;return t||n?e("div",{class:"vxe-number-input--prefix",on:{click:this.clickPrefixEvent}},[e("div",{class:"vxe-number-input--prefix-icon"},t?(0,_vn.getSlotVNs)(t({})):[e("i",{class:n})])]):null},renderSuffixIcon:function(e){var t=this,n=t.$scopedSlots,i=t.suffixIcon,u=t.reactData.inputValue,n=n.suffix,r=t.computeIsClearable;return e("div",{class:["vxe-number-input--suffix",{"is--clear":r&&!t.computeIsDisabled&&!(""===u||_xeUtils.default.eqNull(u))}]},[r?e("div",{class:"vxe-number-input--clear-icon",on:{click:t.clearValueEvent}},[e("i",{class:(0,_ui.getIcon)().INPUT_CLEAR})]):(0,_ui.renderEmptyElement)(t),t.renderExtraSuffixIcon(e),n||i?e("div",{class:"vxe-number-input--suffix-icon",on:{click:t.clickSuffixEvent}},n?(0,_vn.getSlotVNs)(n({})):[e("i",{class:i})]):(0,_ui.renderEmptyElement)(t)])},renderExtraSuffixIcon:function(e){return this.controls?this.renderNumberIcon(e):(0,_ui.renderEmptyElement)(this)},renderVN:function(e){var t,n,i,u,r,a,l=this,o=l.reactData,s=l.className,c=l.controls,m=l.type,p=l.align,d=l.name,f=l.autocomplete,v=l.autoComplete,h=o.inputValue,b=o.isFocus,o=o.isActivated,_=l.computeSize,y=l.computeIsDisabled,g=l.computeNumLabel;return l.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-number-input--readonly","type--".concat(m),s]},g):(t=l.computeInputReadonly,n=l.computeInpMaxLength,i=l.computeInpPlaceholder,u=l.computeIsClearable,r=l.renderPrefixIcon(e),a=l.renderSuffixIcon(e),e("div",{ref:"refElem",class:["vxe-number-input","type--".concat(m),s,_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(_),_),"is--".concat(p),p),"is--controls",c),"is--prefix",!!r),"is--suffix",!!a),"is--disabled",y),"is--active",o),"show--clear",u&&!y&&!(""===h||_xeUtils.default.eqNull(h)))],attrs:{spellcheck:!1}},[r||(0,_ui.renderEmptyElement)(l),e("div",{class:"vxe-number-input--wrapper"},[e("input",{ref:"refInputTarget",class:"vxe-number-input--inner",domProps:{value:b||"amount"!==m?h:g},attrs:{name:d,type:"text",placeholder:i,maxlength:n,readonly:t,disabled:y,autocomplete:v||f},on:{keydown:l.keydownEvent,keyup:l.keyupEvent,wheel:l.wheelEvent,click:l.clickEvent,input:l.inputEvent,change:l.changeEvent,focus:l.focusEvent,blur:l.blurEvent}})]),a||(0,_ui.renderEmptyElement)(l)]))}},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.reactData.inputValue=this.value,this.initValue()},mounted:function(){var e=this;_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;e.reactData.isFocus=!1,e.numberStopDown(),e.afterCheckValue(),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"keydown"),_ui.globalEvents.off(e,"blur")},render:function(e){return this.renderVN(e)}});
|