vxe-pc-ui 3.0.0 → 3.0.1
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/button/src/button.js +3 -0
- package/es/carousel/index.js +12 -0
- package/es/carousel/src/carousel-item.js +100 -0
- package/es/carousel/src/carousel.js +418 -0
- package/es/carousel/src/util.js +17 -0
- package/es/carousel/style.css +185 -0
- package/es/carousel/style.min.css +1 -0
- package/es/carousel-item/index.js +12 -0
- package/es/carousel-item/style.css +0 -0
- package/es/carousel-item/style.min.css +0 -0
- package/es/checkbox/index.js +12 -0
- package/es/checkbox/src/checkbox.js +159 -0
- package/es/checkbox/src/group.js +154 -0
- package/es/checkbox/style.css +117 -0
- package/es/checkbox/style.min.css +1 -0
- package/es/checkbox-group/index.js +12 -0
- package/es/checkbox-group/style.css +0 -0
- package/es/checkbox-group/style.min.css +0 -0
- package/es/components.js +39 -39
- package/es/date-picker/src/date-picker.js +3 -0
- package/es/icon/style.css +1 -1
- package/es/icon-picker/index.js +12 -0
- package/es/icon-picker/src/icon-picker.js +668 -0
- package/es/icon-picker/style.css +207 -0
- package/es/icon-picker/style.min.css +1 -0
- package/es/input/index.js +12 -0
- package/es/input/src/input.js +2892 -0
- package/es/input/style.css +941 -0
- package/es/input/style.min.css +1 -0
- package/es/layout-footer/src/layout-footer.js +2 -1
- package/es/layout-header/src/layout-header.js +2 -1
- package/es/optgroup/index.js +12 -0
- package/es/optgroup/style.css +0 -0
- package/es/optgroup/style.min.css +0 -0
- package/es/option/index.js +12 -0
- package/es/option/style.css +0 -0
- package/es/option/style.min.css +0 -0
- package/es/pager/index.js +12 -0
- package/es/pager/src/pager.js +687 -0
- package/es/password-input/index.js +12 -0
- package/es/password-input/src/password-input.js +388 -0
- package/es/password-input/style.css +604 -0
- package/es/password-input/style.min.css +1 -0
- package/es/pulldown/src/pulldown.js +5 -1
- package/es/select/index.js +12 -0
- package/es/select/src/optgroup.js +90 -0
- package/es/select/src/option-info.js +16 -0
- package/es/select/src/option.js +86 -0
- package/es/select/src/select.js +1269 -0
- package/es/select/src/util.js +35 -0
- package/es/select/style.css +207 -0
- package/es/select/style.min.css +1 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tab-pane/index.js +12 -0
- package/es/tab-pane/style.css +0 -0
- package/es/tab-pane/style.min.css +0 -0
- package/es/tabs/index.js +12 -0
- package/es/tabs/src/tab-pane.js +119 -0
- package/es/tabs/src/tabs.js +593 -0
- package/es/tabs/src/util.js +17 -0
- package/es/tabs/style.css +342 -0
- package/es/tabs/style.min.css +1 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-carousel/index.js +3 -0
- package/es/vxe-carousel/style.css +185 -0
- package/es/vxe-carousel/style.min.css +1 -0
- package/es/vxe-carousel-item/index.js +3 -0
- package/es/vxe-carousel-item/style.css +0 -0
- package/es/vxe-carousel-item/style.min.css +0 -0
- package/es/vxe-checkbox/index.js +3 -0
- package/es/vxe-checkbox/style.css +117 -0
- package/es/vxe-checkbox/style.min.css +1 -0
- package/es/vxe-checkbox-group/index.js +3 -0
- package/es/vxe-checkbox-group/style.css +0 -0
- package/es/vxe-checkbox-group/style.min.css +0 -0
- package/es/vxe-icon-picker/index.js +3 -0
- package/es/vxe-icon-picker/style.css +207 -0
- package/es/vxe-icon-picker/style.min.css +1 -0
- package/es/vxe-input/index.js +3 -0
- package/es/vxe-input/style.css +941 -0
- package/es/vxe-input/style.min.css +1 -0
- package/es/vxe-optgroup/index.js +3 -0
- package/es/vxe-optgroup/style.css +0 -0
- package/es/vxe-optgroup/style.min.css +0 -0
- package/es/vxe-option/index.js +3 -0
- package/es/vxe-option/style.css +0 -0
- package/es/vxe-option/style.min.css +0 -0
- package/es/vxe-password-input/index.js +3 -0
- package/es/vxe-password-input/style.css +604 -0
- package/es/vxe-password-input/style.min.css +1 -0
- package/es/vxe-select/index.js +3 -0
- package/es/vxe-select/style.css +207 -0
- package/es/vxe-select/style.min.css +1 -0
- package/es/vxe-tab-pane/index.js +3 -0
- package/es/vxe-tab-pane/style.css +0 -0
- package/es/vxe-tab-pane/style.min.css +0 -0
- package/es/vxe-tabs/index.js +3 -0
- package/es/vxe-tabs/style.css +342 -0
- package/es/vxe-tabs/style.min.css +1 -0
- package/lib/button/src/button.js +3 -0
- package/lib/button/src/button.min.js +1 -1
- package/lib/carousel/index.js +19 -0
- package/lib/carousel/index.min.js +1 -0
- package/lib/carousel/src/carousel-item.js +107 -0
- package/lib/carousel/src/carousel-item.min.js +1 -0
- package/lib/carousel/src/carousel.js +437 -0
- package/lib/carousel/src/carousel.min.js +1 -0
- package/lib/carousel/src/util.js +27 -0
- package/lib/carousel/src/util.min.js +1 -0
- package/lib/carousel/style/index.js +1 -0
- package/lib/carousel/style/style.css +185 -0
- package/lib/carousel/style/style.min.css +1 -0
- package/lib/carousel-item/index.js +19 -0
- package/lib/carousel-item/index.min.js +1 -0
- package/lib/carousel-item/style/index.js +1 -0
- package/lib/carousel-item/style/style.css +0 -0
- package/lib/carousel-item/style/style.min.css +0 -0
- package/lib/checkbox/index.js +19 -0
- package/lib/checkbox/index.min.js +1 -0
- package/lib/checkbox/src/checkbox.js +169 -0
- package/lib/checkbox/src/checkbox.min.js +1 -0
- package/lib/checkbox/src/group.js +164 -0
- package/lib/checkbox/src/group.min.js +1 -0
- package/lib/checkbox/style/index.js +1 -0
- package/lib/checkbox/style/style.css +117 -0
- package/lib/checkbox/style/style.min.css +1 -0
- package/lib/checkbox-group/index.js +19 -0
- package/lib/checkbox-group/index.min.js +1 -0
- package/lib/checkbox-group/style/index.js +1 -0
- package/lib/checkbox-group/style/style.css +0 -0
- package/lib/checkbox-group/style/style.min.css +0 -0
- package/lib/components.js +159 -60
- package/lib/components.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +3 -0
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/icon-picker/index.js +19 -0
- package/lib/icon-picker/index.min.js +1 -0
- package/lib/icon-picker/src/icon-picker.js +646 -0
- package/lib/icon-picker/src/icon-picker.min.js +1 -0
- package/lib/icon-picker/style/index.js +1 -0
- package/lib/icon-picker/style/style.css +207 -0
- package/lib/icon-picker/style/style.min.css +1 -0
- package/lib/index.umd.js +15870 -7738
- package/lib/index.umd.min.js +1 -1
- package/lib/input/index.js +19 -0
- package/lib/input/index.min.js +1 -0
- package/lib/input/src/input.js +2897 -0
- package/lib/input/src/input.min.js +1 -0
- package/lib/input/style/index.js +1 -0
- package/lib/input/style/style.css +941 -0
- package/lib/input/style/style.min.css +1 -0
- package/lib/layout-footer/src/layout-footer.js +2 -1
- package/lib/layout-header/src/layout-header.js +2 -1
- package/lib/optgroup/index.js +19 -0
- package/lib/optgroup/index.min.js +1 -0
- package/lib/optgroup/style/index.js +1 -0
- package/lib/optgroup/style/style.css +0 -0
- package/lib/optgroup/style/style.min.css +0 -0
- package/lib/option/index.js +19 -0
- package/lib/option/index.min.js +1 -0
- package/lib/option/style/index.js +1 -0
- package/lib/option/style/style.css +0 -0
- package/lib/option/style/style.min.css +0 -0
- package/lib/pager/index.js +19 -0
- package/lib/pager/index.min.js +1 -0
- package/lib/pager/src/pager.js +714 -0
- package/lib/pager/src/pager.min.js +1 -0
- package/lib/password-input/index.js +19 -0
- package/lib/password-input/index.min.js +1 -0
- package/lib/password-input/src/password-input.js +398 -0
- package/lib/password-input/src/password-input.min.js +1 -0
- package/lib/password-input/style/index.js +1 -0
- package/lib/password-input/style/style.css +604 -0
- package/lib/password-input/style/style.min.css +1 -0
- package/lib/pulldown/src/pulldown.js +5 -1
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/select/index.js +19 -0
- package/lib/select/index.min.js +1 -0
- package/lib/select/src/optgroup.js +97 -0
- package/lib/select/src/optgroup.min.js +1 -0
- package/lib/select/src/option-info.js +33 -0
- package/lib/select/src/option-info.min.js +1 -0
- package/lib/select/src/option.js +93 -0
- package/lib/select/src/option.min.js +1 -0
- package/lib/select/src/select.js +1315 -0
- package/lib/select/src/select.min.js +1 -0
- package/lib/select/src/util.js +50 -0
- package/lib/select/src/util.min.js +1 -0
- package/lib/select/style/index.js +1 -0
- package/lib/select/style/style.css +207 -0
- package/lib/select/style/style.min.css +1 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tab-pane/index.js +19 -0
- package/lib/tab-pane/index.min.js +1 -0
- package/lib/tab-pane/style/index.js +1 -0
- package/lib/tab-pane/style/style.css +0 -0
- package/lib/tab-pane/style/style.min.css +0 -0
- package/lib/tabs/index.js +19 -0
- package/lib/tabs/index.min.js +1 -0
- package/lib/tabs/src/tab-pane.js +128 -0
- package/lib/tabs/src/tab-pane.min.js +1 -0
- package/lib/tabs/src/tabs.js +630 -0
- package/lib/tabs/src/tabs.min.js +1 -0
- package/lib/tabs/src/util.js +29 -0
- package/lib/tabs/src/util.min.js +1 -0
- package/lib/tabs/style/index.js +1 -0
- package/lib/tabs/style/style.css +342 -0
- package/lib/tabs/style/style.min.css +1 -0
- 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-carousel/index.js +23 -0
- package/lib/vxe-carousel/index.min.js +1 -0
- package/lib/vxe-carousel/style/index.js +1 -0
- package/lib/vxe-carousel/style/style.css +185 -0
- package/lib/vxe-carousel/style/style.min.css +1 -0
- package/lib/vxe-carousel-item/index.js +23 -0
- package/lib/vxe-carousel-item/index.min.js +1 -0
- package/lib/vxe-carousel-item/style/index.js +1 -0
- package/lib/vxe-carousel-item/style/style.css +0 -0
- package/lib/vxe-carousel-item/style/style.min.css +0 -0
- package/lib/vxe-checkbox/index.js +23 -0
- package/lib/vxe-checkbox/index.min.js +1 -0
- package/lib/vxe-checkbox/style/index.js +1 -0
- package/lib/vxe-checkbox/style/style.css +117 -0
- package/lib/vxe-checkbox/style/style.min.css +1 -0
- package/lib/vxe-checkbox-group/index.js +23 -0
- package/lib/vxe-checkbox-group/index.min.js +1 -0
- package/lib/vxe-checkbox-group/style/index.js +1 -0
- package/lib/vxe-checkbox-group/style/style.css +0 -0
- package/lib/vxe-checkbox-group/style/style.min.css +0 -0
- package/lib/vxe-icon-picker/index.js +23 -0
- package/lib/vxe-icon-picker/index.min.js +1 -0
- package/lib/vxe-icon-picker/style/index.js +1 -0
- package/lib/vxe-icon-picker/style/style.css +207 -0
- package/lib/vxe-icon-picker/style/style.min.css +1 -0
- package/lib/vxe-input/index.js +23 -0
- package/lib/vxe-input/index.min.js +1 -0
- package/lib/vxe-input/style/index.js +1 -0
- package/lib/vxe-input/style/style.css +941 -0
- package/lib/vxe-input/style/style.min.css +1 -0
- package/lib/vxe-optgroup/index.js +23 -0
- package/lib/vxe-optgroup/index.min.js +1 -0
- package/lib/vxe-optgroup/style/index.js +1 -0
- package/lib/vxe-optgroup/style/style.css +0 -0
- package/lib/vxe-optgroup/style/style.min.css +0 -0
- package/lib/vxe-option/index.js +23 -0
- package/lib/vxe-option/index.min.js +1 -0
- package/lib/vxe-option/style/index.js +1 -0
- package/lib/vxe-option/style/style.css +0 -0
- package/lib/vxe-option/style/style.min.css +0 -0
- package/lib/vxe-password-input/index.js +23 -0
- package/lib/vxe-password-input/index.min.js +1 -0
- package/lib/vxe-password-input/style/index.js +1 -0
- package/lib/vxe-password-input/style/style.css +604 -0
- package/lib/vxe-password-input/style/style.min.css +1 -0
- package/lib/vxe-select/index.js +23 -0
- package/lib/vxe-select/index.min.js +1 -0
- package/lib/vxe-select/style/index.js +1 -0
- package/lib/vxe-select/style/style.css +207 -0
- package/lib/vxe-select/style/style.min.css +1 -0
- package/lib/vxe-tab-pane/index.js +23 -0
- package/lib/vxe-tab-pane/index.min.js +1 -0
- package/lib/vxe-tab-pane/style/index.js +1 -0
- package/lib/vxe-tab-pane/style/style.css +0 -0
- package/lib/vxe-tab-pane/style/style.min.css +0 -0
- package/lib/vxe-tabs/index.js +23 -0
- package/lib/vxe-tabs/index.min.js +1 -0
- package/lib/vxe-tabs/style/index.js +1 -0
- package/lib/vxe-tabs/style/style.css +342 -0
- package/lib/vxe-tabs/style/style.min.css +1 -0
- package/package.json +1 -1
- package/packages/button/src/button.ts +3 -0
- package/packages/carousel/index.ts +16 -0
- package/packages/carousel/src/carousel-item.ts +114 -0
- package/packages/carousel/src/carousel.ts +449 -0
- package/packages/carousel/src/util.ts +21 -0
- package/packages/carousel-item/index.ts +16 -0
- package/packages/checkbox/index.ts +16 -0
- package/packages/checkbox/src/checkbox.ts +176 -0
- package/packages/checkbox/src/group.ts +178 -0
- package/packages/checkbox-group/index.ts +16 -0
- package/packages/components.ts +39 -39
- package/packages/date-picker/src/date-picker.ts +3 -0
- package/packages/icon-picker/index.ts +16 -0
- package/packages/icon-picker/src/icon-picker.ts +711 -0
- package/packages/input/index.ts +16 -0
- package/packages/input/src/input.ts +2995 -0
- package/packages/layout-footer/src/layout-footer.ts +4 -3
- package/packages/layout-header/src/layout-header.ts +2 -1
- package/packages/optgroup/index.ts +16 -0
- package/packages/option/index.ts +16 -0
- package/packages/pager/index.ts +16 -0
- package/packages/pager/src/pager.ts +743 -0
- package/packages/password-input/index.ts +16 -0
- package/packages/password-input/src/password-input.ts +427 -0
- package/packages/pulldown/src/pulldown.ts +5 -1
- package/packages/select/index.ts +16 -0
- package/packages/select/src/optgroup.ts +107 -0
- package/packages/select/src/option-info.ts +20 -0
- package/packages/select/src/option.ts +103 -0
- package/packages/select/src/select.ts +1325 -0
- package/packages/select/src/util.ts +46 -0
- package/packages/tab-pane/index.ts +16 -0
- package/packages/tabs/index.ts +16 -0
- package/packages/tabs/src/tab-pane.ts +136 -0
- package/packages/tabs/src/tabs.ts +630 -0
- package/packages/tabs/src/util.ts +21 -0
- package/types/components/carousel.d.ts +5 -0
- package/types/components/icon-picker.d.ts +4 -0
- package/types/components/input.d.ts +9 -1
- package/types/components/optgroup.d.ts +10 -4
- package/types/components/tabs.d.ts +4 -0
- /package/es/icon/style/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
- /package/es/icon/style/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
- /package/es/icon/style/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
- /package/es/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
- /package/es/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
- /package/es/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
- /package/lib/icon/style/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
- /package/lib/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
- /package/lib/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
- /package/lib/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
|
@@ -0,0 +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"),_log=require("../../ui/src/log"),_select=_interopRequireDefault(require("../../select/src/select")),_input=_interopRequireDefault(require("../../input/src/input"));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 _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxePager",mixins:[_ui.globalMixins.sizeMixin],props:{size:{type:String,default:function(){return(0,_ui.getConfig)().pager.size||(0,_ui.getConfig)().size}},layouts:{type:Array,default:function(){return(0,_ui.getConfig)().pager.layouts||["PrevJump","PrevPage","Jump","PageCount","NextPage","NextJump","Sizes","Total"]}},currentPage:{type:Number,default:1},loading:Boolean,pageSize:{type:Number,default:function(){return(0,_ui.getConfig)().pager.pageSize||10}},total:{type:Number,default:0},pagerCount:{type:Number,default:function(){return(0,_ui.getConfig)().pager.pagerCount||7}},pageSizes:{type:Array,default:function(){return(0,_ui.getConfig)().pager.pageSizes||[10,15,20,50,100]}},align:{type:String,default:function(){return(0,_ui.getConfig)().pager.align}},border:{type:Boolean,default:function(){return(0,_ui.getConfig)().pager.border}},background:{type:Boolean,default:function(){return(0,_ui.getConfig)().pager.background}},perfect:{type:Boolean,default:function(){return(0,_ui.getConfig)().pager.perfect}},autoHidden:{type:Boolean,default:function(){return(0,_ui.getConfig)().pager.autoHidden}},transfer:{type:Boolean,default:function(){return(0,_ui.getConfig)().pager.transfer}},className:[String,Function],pageSizePlacement:{type:String,default:function(){return(0,_ui.getConfig)().pager.pageSizePlacement}},iconPrevPage:String,iconJumpPrev:String,iconJumpNext:String,iconNextPage:String,iconJumpMore:String,iconHomePage:String,iconEndPage:String},inject:{$xeGrid:{default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{inpCurrPage:1}}},computed:Object.assign(Object.assign({},{}),{computePageCount:function(){return this.getPageCount(this.total,this.pageSize)},computeNumList:function(){for(var e=this.pagerCount,t=e<this.computePageCount?e-2:e,n=[],r=0;r<t;r++)n.push(r);return n},computeOffsetNumber:function(){return Math.floor((this.pagerCount-2)/2)},computeSizeList:function(){return this.pageSizes.map(function(e){return _xeUtils.default.isNumber(e)?{value:e,label:"".concat((0,_ui.getI18n)("vxe.pager.pagesize",[e]))}:Object.assign({value:"",label:""},e)})}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$pager:this},t))},homePage:function(){return this.handleHomePage(),this.$nextTick()},endPage:function(){return this.handleEndPage(),this.$nextTick()},prevPage:function(){return this.handlePrevPage(),this.$nextTick()},nextPage:function(){return this.handleNextPage(),this.$nextTick()},prevJump:function(){return this.handlePrevJump(),this.$nextTick()},nextJump:function(){return this.handleNextJump(),this.$nextTick()},getPageCount:function(e,t){return Math.max(Math.ceil(e/t),1)},jumpPageEvent:function(e,t){this.$emit("update:currentPage",t),e&&t!==this.currentPage&&this.dispatchEvent("page-change",{type:"current",pageSize:this.pageSize,currentPage:t},e)},changeCurrentPage:function(e,t){this.$emit("update:currentPage",e),t&&e!==this.currentPage&&this.dispatchEvent("page-change",{type:"current",pageSize:this.pageSize,currentPage:e},t)},triggerJumpEvent:function(e){var t=this.reactData,e=e.$event,n=e.target,r=_xeUtils.default.toInteger(n.value),a=this.computePageCount.value,a=r<=0?1:a<=r?a:r,r=_xeUtils.default.toValueString(a);n.value=r,t.inpCurrPage=r,this.changeCurrentPage(a,e)},handleHomePage:function(e){1<this.currentPage&&this.changeCurrentPage(1,e)},handleEndPage:function(e){var t=this.currentPage,n=this.computePageCount;t<n&&this.changeCurrentPage(n,e)},handlePrevPage:function(e){var t=this.currentPage,n=this.computePageCount;1<t&&this.changeCurrentPage(Math.min(n,Math.max(t-1,1)),e)},handleNextPage:function(e){var t=this.currentPage,n=this.computePageCount;t<n&&this.changeCurrentPage(Math.min(n,t+1),e)},handlePrevJump:function(e){var t=this.computeNumList;this.changeCurrentPage(Math.max(this.currentPage-t.length,1),e)},handleNextJump:function(e){var t=this.computePageCount,n=this.computeNumList;this.changeCurrentPage(Math.min(this.currentPage+n.length,t),e)},pageSizeEvent:function(e){var t=this,n=t,r=e.value,r=_xeUtils.default.toNumber(r),a=t.getPageCount(n.total,r),n=n.currentPage;a<n&&t.$emit("update:currentPage",n=a),t.$emit("update:pageSize",r),t.dispatchEvent("page-change",{type:"size",pageSize:r,currentPage:n},e.$event)},jumpKeydownEvent:function(e){var t=e.$event;_ui.globalEvents.hasKey(t,_ui.GLOBAL_EVENT_KEYS.ENTER)?this.triggerJumpEvent(e):_ui.globalEvents.hasKey(t,_ui.GLOBAL_EVENT_KEYS.ARROW_UP)?(t.preventDefault(),this.handleNextPage(t)):_ui.globalEvents.hasKey(t,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN)&&(t.preventDefault(),this.handlePrevPage(t))},renderHomePage:function(e){return e("button",{class:["vxe-pager--prev-btn",{"is--disabled":this.currentPage<=1}],attrs:{type:"button",title:(0,_ui.getI18n)("vxe.pager.homePageTitle")},on:{click:this.handleHomePage}},[e("i",{class:["vxe-pager--btn-icon",this.iconHomePage||(0,_ui.getIcon)().PAGER_HOME]})])},renderPrevPage:function(e){return e("button",{class:["vxe-pager--prev-btn",{"is--disabled":this.currentPage<=1}],attrs:{type:"button",title:(0,_ui.getI18n)("vxe.pager.prevPageTitle")},on:{click:this.handlePrevPage}},[e("i",{class:["vxe-pager--btn-icon",this.iconPrevPage||(0,_ui.getIcon)().PAGER_PREV_PAGE]})])},renderPrevJump:function(e,t){return e(t||"button",{class:["vxe-pager--jump-prev",{"is--fixed":!t,"is--disabled":this.currentPage<=1}],attrs:{type:"button",title:(0,_ui.getI18n)("vxe.pager.prevJumpTitle")},on:{click:this.handlePrevJump}},[t?e("i",{class:["vxe-pager--jump-more-icon",this.iconJumpMore||(0,_ui.getIcon)().PAGER_JUMP_MORE]}):null,e("i",{class:["vxe-pager--jump-icon",this.iconJumpPrev||(0,_ui.getIcon)().PAGER_JUMP_PREV]})])},renderNextJump:function(e,t){var n=this.computePageCount;return e(t||"button",{class:["vxe-pager--jump-next",{"is--fixed":!t,"is--disabled":this.currentPage>=n}],attrs:{type:"button",title:(0,_ui.getI18n)("vxe.pager.nextJumpTitle")},on:{click:this.handleNextJump}},[t?e("i",{class:["vxe-pager--jump-more-icon",this.iconJumpMore||(0,_ui.getIcon)().PAGER_JUMP_MORE]}):null,e("i",{class:["vxe-pager--jump-icon",this.iconJumpNext||(0,_ui.getIcon)().PAGER_JUMP_NEXT]})])},renderNextPage:function(e){var t=this.computePageCount;return e("button",{class:["vxe-pager--next-btn",{"is--disabled":this.currentPage>=t}],attrs:{type:"button",title:(0,_ui.getI18n)("vxe.pager.nextPageTitle")},on:{click:this.handleNextPage}},[e("i",{class:["vxe-pager--btn-icon",this.iconNextPage||(0,_ui.getIcon)().PAGER_NEXT_PAGE]})])},renderEndPage:function(e){var t=this.computePageCount;return e("button",{class:["vxe-pager--prev-btn",{"is--disabled":this.currentPage>=t}],attrs:{type:"button",title:(0,_ui.getI18n)("vxe.pager.endPageTitle")},on:{click:this.handleEndPage}},[e("i",{class:["vxe-pager--btn-icon",this.iconEndPage||(0,_ui.getIcon)().PAGER_END]})])},renderNumber:function(r,e){var a=this,i=a.currentPage,u=[],o=a.computePageCount,t=a.computeNumList,n=a.computeOffsetNumber,s=a.pagerCount<o,g=s&&n+1<i,c=s&&i<o-n,p=1;return s&&(p=o-n<=i?Math.max(o-t.length+1,1):Math.max(i-n,1)),e&&g&&u.push(r("button",{class:"vxe-pager--num-btn",attrs:{type:"button"},on:{click:function(e){return a.jumpPageEvent(e,1)}}},"1"),a.renderPrevJump(r,"span")),t.forEach(function(e,t){var n=p+t;n<=o&&u.push(r("button",{key:n,class:["vxe-pager--num-btn",{"is--active":i===n}],attrs:{type:"button"},on:{click:function(e){return a.jumpPageEvent(e,n)}}},"".concat(n)))}),e&&c&&u.push(a.renderNextJump(r,"button"),r("button",{class:"vxe-pager--num-btn",attrs:{type:"button"},on:{click:function(e){return a.jumpPageEvent(e,o)}}},o)),r("span",{class:"vxe-pager--btn-wrapper"},u)},renderJumpNumber:function(e){return this.renderNumber(e,!0)},renderSizes:function(e){var t=this.computeSizeList;return e(_select.default,{class:"vxe-pager--sizes",props:{value:this.pageSize,placement:this.pageSizePlacement,transfer:this.transfer,options:t},on:{change:this.pageSizeEvent}})},renderJump:function(e,t){var n=this.reactData,r=this.computePageCount;return e("span",{class:"vxe-pager--jump"},[t?e("span",{class:"vxe-pager--goto-text"},(0,_ui.getI18n)("vxe.pager.goto")):null,e(_input.default,{class:"vxe-pager--goto",props:{value:n.inpCurrPage,placeholder:(0,_ui.getI18n)("vxe.pager.gotoTitle"),align:"center",type:"integer",max:r,min:1,controls:!1},on:{keydown:this.jumpKeydownEvent,blur:this.triggerJumpEvent,modelValue:function(e){n.inpCurrPage=e}}}),t?e("span",{class:"vxe-pager--classifier-text"},(0,_ui.getI18n)("vxe.pager.pageClassifier")):null])},renderFullJump:function(e){return this.renderJump(e,!0)},renderPageCount:function(e){var t=this.computePageCount;return e("span",{class:"vxe-pager--count"},[e("span",{class:"vxe-pager--separator"}),e("span",t)])},renderTotal:function(e){return e("span",{class:"vxe-pager--total"},(0,_ui.getI18n)("vxe.pager.total",[this.total]))},renderVN:function(n){var r=this,e=r,t=r.$scopedSlots,a=r.$xeGrid,i=e.align,u=e.layouts,o=e.className,s=[],g=r.computeSize,c=r.computePageCount;return t.left&&s.push(n("span",{class:"vxe-pager--left-wrapper"},t.left({$grid:a}))),u.forEach(function(e){var t;switch(e){case"Home":t=r.renderHomePage;break;case"PrevJump":t=r.renderPrevJump;break;case"PrevPage":t=r.renderPrevPage;break;case"Number":t=r.renderNumber;break;case"JumpNumber":t=r.renderJumpNumber;break;case"NextPage":t=r.renderNextPage;break;case"NextJump":t=r.renderNextJump;break;case"End":t=r.renderEndPage;break;case"Sizes":t=r.renderSizes;break;case"FullJump":t=r.renderFullJump;break;case"Jump":t=r.renderJump;break;case"PageCount":t=r.renderPageCount;break;case"Total":t=r.renderTotal}t?s.push(t(n)):"development"===process.env.NODE_ENV&&(0,_log.errLog)("vxe.error.notProp",["layouts -> ".concat(e)])}),t.right&&s.push(n("span",{class:"vxe-pager--right-wrapper"},t.right({$grid:a}))),n("div",{ref:"refElem",class:["vxe-pager",o?_xeUtils.default.isFunction(o)?o({$pager:r}):o:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(g),g),"align--".concat(i),i),"is--border",e.border),"is--background",e.background),"is--perfect",e.perfect),"is--hidden",e.autoHidden&&1===c),"is--loading",e.loading)]},[n("div",{class:"vxe-pager--wrapper"},s)])}},watch:{currentPage:function(e){this.reactData.inpCurrPage=e}},created:function(){this.reactData.inpCurrPage=this.currentPage},render:function(e){return this.renderVN(e)}});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.VxePasswordInput = exports.PasswordInput = void 0;
|
|
7
|
+
var _core = require("@vxe-ui/core");
|
|
8
|
+
var _passwordInput = _interopRequireDefault(require("./src/password-input"));
|
|
9
|
+
var _dynamics = require("../dynamics");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
var VxePasswordInput = exports.VxePasswordInput = Object.assign({}, _passwordInput.default, {
|
|
12
|
+
install: function install(app) {
|
|
13
|
+
app.component(_passwordInput.default.name, _passwordInput.default);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
_dynamics.dynamicApp.use(VxePasswordInput);
|
|
17
|
+
_core.VxeUI.component(_passwordInput.default);
|
|
18
|
+
var PasswordInput = exports.PasswordInput = VxePasswordInput;
|
|
19
|
+
var _default = exports.default = VxePasswordInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.VxePasswordInput=exports.PasswordInput=void 0;var _core=require("@vxe-ui/core"),_passwordInput=_interopRequireDefault(require("./src/password-input")),_dynamics=require("../dynamics");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var VxePasswordInput=exports.VxePasswordInput=Object.assign({},_passwordInput.default,{install:function(e){e.component(_passwordInput.default.name,_passwordInput.default)}}),PasswordInput=(_dynamics.dynamicApp.use(VxePasswordInput),_core.VxeUI.component(_passwordInput.default),exports.PasswordInput=VxePasswordInput),_default=exports.default=VxePasswordInput;
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _comp = require("../../ui/src/comp");
|
|
8
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
|
+
var _ui = require("../../ui");
|
|
10
|
+
var _utils = require("../../ui/src/utils");
|
|
11
|
+
var _vn = require("../..//ui/src/vn");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
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); }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
+
var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
18
|
+
name: 'VxePasswordInput',
|
|
19
|
+
mixins: [_ui.globalMixins.sizeMixin],
|
|
20
|
+
model: {
|
|
21
|
+
prop: 'value',
|
|
22
|
+
event: 'modelValue'
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
value: String,
|
|
26
|
+
name: String,
|
|
27
|
+
clearable: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: function _default() {
|
|
30
|
+
return (0, _ui.getConfig)().passwordInput.clearable;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
readonly: Boolean,
|
|
34
|
+
disabled: Boolean,
|
|
35
|
+
maxLength: [String, Number],
|
|
36
|
+
placeholder: String,
|
|
37
|
+
autoComplete: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'off'
|
|
40
|
+
},
|
|
41
|
+
className: String,
|
|
42
|
+
size: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: function _default() {
|
|
45
|
+
return (0, _ui.getConfig)().passwordInput.size || (0, _ui.getConfig)().size;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
prefixIcon: String,
|
|
49
|
+
suffixIcon: String,
|
|
50
|
+
// 已废弃
|
|
51
|
+
autocomplete: String
|
|
52
|
+
},
|
|
53
|
+
inject: {
|
|
54
|
+
$xeForm: {
|
|
55
|
+
default: null
|
|
56
|
+
},
|
|
57
|
+
formItemInfo: {
|
|
58
|
+
from: 'xeFormItemInfo',
|
|
59
|
+
default: null
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
data: function data() {
|
|
63
|
+
var xID = _xeUtils.default.uniqueId();
|
|
64
|
+
var reactData = {
|
|
65
|
+
showPwd: false,
|
|
66
|
+
isActivated: false,
|
|
67
|
+
inputValue: ''
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
xID: xID,
|
|
71
|
+
reactData: reactData
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
computed: Object.assign(Object.assign({}, {}), {
|
|
75
|
+
computeIsClearable: function computeIsClearable() {
|
|
76
|
+
var $xePasswordInput = this;
|
|
77
|
+
var props = $xePasswordInput;
|
|
78
|
+
return props.clearable;
|
|
79
|
+
},
|
|
80
|
+
computeInpReadonly: function computeInpReadonly() {
|
|
81
|
+
var $xePasswordInput = this;
|
|
82
|
+
var props = $xePasswordInput;
|
|
83
|
+
var readonly = props.readonly;
|
|
84
|
+
return readonly;
|
|
85
|
+
},
|
|
86
|
+
computeInpPlaceholder: function computeInpPlaceholder() {
|
|
87
|
+
var $xePasswordInput = this;
|
|
88
|
+
var props = $xePasswordInput;
|
|
89
|
+
var placeholder = props.placeholder;
|
|
90
|
+
if (placeholder) {
|
|
91
|
+
return (0, _utils.getFuncText)(placeholder);
|
|
92
|
+
}
|
|
93
|
+
var globalPlaceholder = (0, _ui.getConfig)().passwordInput.placeholder;
|
|
94
|
+
if (globalPlaceholder) {
|
|
95
|
+
return (0, _utils.getFuncText)(globalPlaceholder);
|
|
96
|
+
}
|
|
97
|
+
return (0, _ui.getI18n)('vxe.base.pleaseInput');
|
|
98
|
+
},
|
|
99
|
+
computeInputType: function computeInputType() {
|
|
100
|
+
var $xePasswordInput = this;
|
|
101
|
+
var reactData = $xePasswordInput.reactData;
|
|
102
|
+
var showPwd = reactData.showPwd;
|
|
103
|
+
if (showPwd) {
|
|
104
|
+
return 'text';
|
|
105
|
+
}
|
|
106
|
+
return 'password';
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
methods: {
|
|
110
|
+
//
|
|
111
|
+
// Method
|
|
112
|
+
//
|
|
113
|
+
dispatchEvent: function dispatchEvent(type, params, evnt) {
|
|
114
|
+
var $xePasswordInput = this;
|
|
115
|
+
$xePasswordInput.$emit(type, (0, _ui.createEvent)(evnt, {
|
|
116
|
+
$passwordInput: $xePasswordInput
|
|
117
|
+
}, params));
|
|
118
|
+
},
|
|
119
|
+
focus: function focus() {
|
|
120
|
+
var $xePasswordInput = this;
|
|
121
|
+
var reactData = $xePasswordInput.reactData;
|
|
122
|
+
var inputElem = $xePasswordInput.$refs.refInputTarget;
|
|
123
|
+
reactData.isActivated = true;
|
|
124
|
+
inputElem.focus();
|
|
125
|
+
return $xePasswordInput.$nextTick();
|
|
126
|
+
},
|
|
127
|
+
blur: function blur() {
|
|
128
|
+
var $xePasswordInput = this;
|
|
129
|
+
var reactData = $xePasswordInput.reactData;
|
|
130
|
+
var inputElem = $xePasswordInput.$refs.refInputTarget;
|
|
131
|
+
inputElem.blur();
|
|
132
|
+
reactData.isActivated = false;
|
|
133
|
+
return $xePasswordInput.$nextTick();
|
|
134
|
+
},
|
|
135
|
+
select: function select() {
|
|
136
|
+
var $xePasswordInput = this;
|
|
137
|
+
var reactData = $xePasswordInput.reactData;
|
|
138
|
+
var inputElem = $xePasswordInput.$refs.refInputTarget;
|
|
139
|
+
inputElem.select();
|
|
140
|
+
reactData.isActivated = false;
|
|
141
|
+
return $xePasswordInput.$nextTick();
|
|
142
|
+
},
|
|
143
|
+
triggerEvent: function triggerEvent(evnt) {
|
|
144
|
+
var $xePasswordInput = this;
|
|
145
|
+
var reactData = $xePasswordInput.reactData;
|
|
146
|
+
var inputValue = reactData.inputValue;
|
|
147
|
+
$xePasswordInput.dispatchEvent(evnt.type, {
|
|
148
|
+
value: inputValue
|
|
149
|
+
}, evnt);
|
|
150
|
+
},
|
|
151
|
+
emitInputEvent: function emitInputEvent(value, evnt) {
|
|
152
|
+
var $xePasswordInput = this;
|
|
153
|
+
var reactData = $xePasswordInput.reactData;
|
|
154
|
+
reactData.inputValue = value;
|
|
155
|
+
$xePasswordInput.dispatchEvent('input', {
|
|
156
|
+
value: value
|
|
157
|
+
}, evnt);
|
|
158
|
+
},
|
|
159
|
+
inputEvent: function inputEvent(evnt) {
|
|
160
|
+
var $xePasswordInput = this;
|
|
161
|
+
var inputElem = evnt.target;
|
|
162
|
+
var value = inputElem.value;
|
|
163
|
+
$xePasswordInput.emitInputEvent(value, evnt);
|
|
164
|
+
},
|
|
165
|
+
emitModel: function emitModel(value, evnt) {
|
|
166
|
+
var $xePasswordInput = this;
|
|
167
|
+
var props = $xePasswordInput;
|
|
168
|
+
var reactData = $xePasswordInput.reactData;
|
|
169
|
+
var $xeForm = $xePasswordInput.$xeForm;
|
|
170
|
+
var formItemInfo = $xePasswordInput.formItemInfo;
|
|
171
|
+
reactData.inputValue = value;
|
|
172
|
+
$xePasswordInput.$emit('modelValue', value);
|
|
173
|
+
$xePasswordInput.dispatchEvent('input', {
|
|
174
|
+
value: value
|
|
175
|
+
}, evnt);
|
|
176
|
+
if (_xeUtils.default.toValueString(props.value) !== value) {
|
|
177
|
+
$xePasswordInput.dispatchEvent('change', {
|
|
178
|
+
value: value
|
|
179
|
+
}, evnt);
|
|
180
|
+
// 自动更新校验状态
|
|
181
|
+
if ($xeForm && formItemInfo) {
|
|
182
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
changeEvent: function changeEvent(evnt) {
|
|
187
|
+
var $xePasswordInput = this;
|
|
188
|
+
var reactData = $xePasswordInput.reactData;
|
|
189
|
+
var $xeForm = $xePasswordInput.$xeForm;
|
|
190
|
+
var formItemInfo = $xePasswordInput.formItemInfo;
|
|
191
|
+
$xePasswordInput.triggerEvent(evnt);
|
|
192
|
+
var inputValue = reactData.inputValue;
|
|
193
|
+
// 自动更新校验状态
|
|
194
|
+
if ($xeForm && formItemInfo) {
|
|
195
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, inputValue);
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
focusEvent: function focusEvent(evnt) {
|
|
199
|
+
var $xePasswordInput = this;
|
|
200
|
+
var reactData = $xePasswordInput.reactData;
|
|
201
|
+
reactData.isActivated = true;
|
|
202
|
+
$xePasswordInput.triggerEvent(evnt);
|
|
203
|
+
},
|
|
204
|
+
blurEvent: function blurEvent(evnt) {
|
|
205
|
+
var $xePasswordInput = this;
|
|
206
|
+
var reactData = $xePasswordInput.reactData;
|
|
207
|
+
var inputValue = reactData.inputValue;
|
|
208
|
+
$xePasswordInput.dispatchEvent('blur', {
|
|
209
|
+
value: inputValue
|
|
210
|
+
}, evnt);
|
|
211
|
+
},
|
|
212
|
+
passwordToggleEvent: function passwordToggleEvent(evnt) {
|
|
213
|
+
var $xePasswordInput = this;
|
|
214
|
+
var props = $xePasswordInput;
|
|
215
|
+
var reactData = $xePasswordInput.reactData;
|
|
216
|
+
var readonly = props.readonly,
|
|
217
|
+
disabled = props.disabled;
|
|
218
|
+
var showPwd = reactData.showPwd;
|
|
219
|
+
if (!disabled && !readonly) {
|
|
220
|
+
reactData.showPwd = !showPwd;
|
|
221
|
+
}
|
|
222
|
+
$xePasswordInput.dispatchEvent('toggle-visible', {
|
|
223
|
+
visible: reactData.showPwd
|
|
224
|
+
}, evnt);
|
|
225
|
+
},
|
|
226
|
+
clickEvent: function clickEvent(evnt) {
|
|
227
|
+
var $xePasswordInput = this;
|
|
228
|
+
$xePasswordInput.triggerEvent(evnt);
|
|
229
|
+
},
|
|
230
|
+
clearValueEvent: function clearValueEvent(evnt, value) {
|
|
231
|
+
var $xePasswordInput = this;
|
|
232
|
+
$xePasswordInput.focus();
|
|
233
|
+
$xePasswordInput.emitModel('', evnt);
|
|
234
|
+
$xePasswordInput.dispatchEvent('clear', {
|
|
235
|
+
value: value
|
|
236
|
+
}, evnt);
|
|
237
|
+
},
|
|
238
|
+
clickSuffixEvent: function clickSuffixEvent(evnt) {
|
|
239
|
+
var $xePasswordInput = this;
|
|
240
|
+
var props = $xePasswordInput;
|
|
241
|
+
var reactData = $xePasswordInput.reactData;
|
|
242
|
+
var disabled = props.disabled;
|
|
243
|
+
if (!disabled) {
|
|
244
|
+
var inputValue = reactData.inputValue;
|
|
245
|
+
$xePasswordInput.dispatchEvent('suffix-click', {
|
|
246
|
+
value: inputValue
|
|
247
|
+
}, evnt);
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
clickPrefixEvent: function clickPrefixEvent(evnt) {
|
|
251
|
+
var $xePasswordInput = this;
|
|
252
|
+
var props = $xePasswordInput;
|
|
253
|
+
var reactData = $xePasswordInput.reactData;
|
|
254
|
+
var disabled = props.disabled;
|
|
255
|
+
if (!disabled) {
|
|
256
|
+
var inputValue = reactData.inputValue;
|
|
257
|
+
$xePasswordInput.dispatchEvent('prefix-click', {
|
|
258
|
+
value: inputValue
|
|
259
|
+
}, evnt);
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
//
|
|
263
|
+
// Render
|
|
264
|
+
//
|
|
265
|
+
renderPasswordIcon: function renderPasswordIcon(h) {
|
|
266
|
+
var $xePasswordInput = this;
|
|
267
|
+
var reactData = $xePasswordInput.reactData;
|
|
268
|
+
var showPwd = reactData.showPwd;
|
|
269
|
+
return h('div', {
|
|
270
|
+
class: 'password-input--control-icon',
|
|
271
|
+
on: {
|
|
272
|
+
click: $xePasswordInput.passwordToggleEvent
|
|
273
|
+
}
|
|
274
|
+
}, [h('i', {
|
|
275
|
+
class: ['password-input--password-icon', showPwd ? (0, _ui.getIcon)().PASSWORD_INPUT_SHOW_PWD : (0, _ui.getIcon)().PASSWORD_INPUT_HIDE_PWD]
|
|
276
|
+
})]);
|
|
277
|
+
},
|
|
278
|
+
renderPrefixIcon: function renderPrefixIcon(h) {
|
|
279
|
+
var $xePasswordInput = this;
|
|
280
|
+
var props = $xePasswordInput;
|
|
281
|
+
var slots = $xePasswordInput.$scopedSlots;
|
|
282
|
+
var prefixIcon = props.prefixIcon;
|
|
283
|
+
var prefixSlot = slots.prefix;
|
|
284
|
+
return prefixSlot || prefixIcon ? h('div', {
|
|
285
|
+
class: 'password-input--prefix',
|
|
286
|
+
on: {
|
|
287
|
+
click: $xePasswordInput.clickPrefixEvent
|
|
288
|
+
}
|
|
289
|
+
}, [h('div', {
|
|
290
|
+
class: 'password-input--prefix-icon'
|
|
291
|
+
}, prefixSlot ? (0, _vn.getSlotVNs)(prefixSlot({})) : [h('i', {
|
|
292
|
+
class: prefixIcon
|
|
293
|
+
})])]) : null;
|
|
294
|
+
},
|
|
295
|
+
renderSuffixIcon: function renderSuffixIcon(h) {
|
|
296
|
+
var $xePasswordInput = this;
|
|
297
|
+
var props = $xePasswordInput;
|
|
298
|
+
var slots = $xePasswordInput.$scopedSlots;
|
|
299
|
+
var reactData = $xePasswordInput.reactData;
|
|
300
|
+
var disabled = props.disabled,
|
|
301
|
+
suffixIcon = props.suffixIcon;
|
|
302
|
+
var inputValue = reactData.inputValue;
|
|
303
|
+
var suffixSlot = slots.suffix;
|
|
304
|
+
var isClearable = $xePasswordInput.computeIsClearable;
|
|
305
|
+
return isClearable || suffixSlot || suffixIcon ? h('div', {
|
|
306
|
+
class: ['password-input--suffix', {
|
|
307
|
+
'is--clear': isClearable && !disabled && !(inputValue === '' || _xeUtils.default.eqNull(inputValue))
|
|
308
|
+
}]
|
|
309
|
+
}, [isClearable ? h('div', {
|
|
310
|
+
class: 'password-input--clear-icon',
|
|
311
|
+
on: {
|
|
312
|
+
click: $xePasswordInput.clearValueEvent
|
|
313
|
+
}
|
|
314
|
+
}, [h('i', {
|
|
315
|
+
class: (0, _ui.getIcon)().INPUT_CLEAR
|
|
316
|
+
})]) : (0, _ui.renderEmptyElement)($xePasswordInput), $xePasswordInput.renderExtraSuffixIcon(h), suffixSlot || suffixIcon ? h('div', {
|
|
317
|
+
class: 'password-input--suffix-icon',
|
|
318
|
+
on: {
|
|
319
|
+
click: $xePasswordInput.clickSuffixEvent
|
|
320
|
+
}
|
|
321
|
+
}, suffixSlot ? (0, _vn.getSlotVNs)(suffixSlot({})) : [h('i', {
|
|
322
|
+
class: suffixIcon
|
|
323
|
+
})]) : (0, _ui.renderEmptyElement)($xePasswordInput)]) : null;
|
|
324
|
+
},
|
|
325
|
+
renderExtraSuffixIcon: function renderExtraSuffixIcon(h) {
|
|
326
|
+
var $xePasswordInput = this;
|
|
327
|
+
return $xePasswordInput.renderPasswordIcon(h);
|
|
328
|
+
},
|
|
329
|
+
renderVN: function renderVN(h) {
|
|
330
|
+
var $xePasswordInput = this;
|
|
331
|
+
var props = $xePasswordInput;
|
|
332
|
+
var reactData = $xePasswordInput.reactData;
|
|
333
|
+
var className = props.className,
|
|
334
|
+
name = props.name,
|
|
335
|
+
disabled = props.disabled,
|
|
336
|
+
readonly = props.readonly,
|
|
337
|
+
autocomplete = props.autocomplete,
|
|
338
|
+
autoComplete = props.autoComplete,
|
|
339
|
+
maxLength = props.maxLength;
|
|
340
|
+
var inputValue = reactData.inputValue,
|
|
341
|
+
isActivated = reactData.isActivated;
|
|
342
|
+
var vSize = $xePasswordInput.computeSize;
|
|
343
|
+
var inpReadonly = $xePasswordInput.computeInpReadonly;
|
|
344
|
+
var inputType = $xePasswordInput.computeInputType;
|
|
345
|
+
var inpPlaceholder = $xePasswordInput.computeInpPlaceholder;
|
|
346
|
+
var isClearable = $xePasswordInput.computeIsClearable;
|
|
347
|
+
var prefix = $xePasswordInput.renderPrefixIcon(h);
|
|
348
|
+
var suffix = $xePasswordInput.renderSuffixIcon(h);
|
|
349
|
+
return h('div', {
|
|
350
|
+
ref: 'refElem',
|
|
351
|
+
class: ['password-input', className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "size--".concat(vSize), vSize), 'is--prefix', !!prefix), 'is--suffix', !!suffix), 'is--readonly', readonly), 'is--disabled', disabled), 'is--active', isActivated), 'show--clear', isClearable && !disabled && !(inputValue === '' || _xeUtils.default.eqNull(inputValue)))],
|
|
352
|
+
attrs: {
|
|
353
|
+
spellcheck: false
|
|
354
|
+
}
|
|
355
|
+
}, [prefix || (0, _ui.renderEmptyElement)($xePasswordInput), h('div', {
|
|
356
|
+
class: 'password-input--wrapper'
|
|
357
|
+
}, [h('input', {
|
|
358
|
+
ref: 'refInputTarget',
|
|
359
|
+
class: 'password-input--inner',
|
|
360
|
+
domProps: {
|
|
361
|
+
value: inputValue
|
|
362
|
+
},
|
|
363
|
+
attrs: {
|
|
364
|
+
name: name,
|
|
365
|
+
type: inputType,
|
|
366
|
+
placeholder: inpPlaceholder,
|
|
367
|
+
readonly: inpReadonly,
|
|
368
|
+
disabled: disabled,
|
|
369
|
+
autocomplete: autocomplete || autoComplete,
|
|
370
|
+
maxlength: maxLength
|
|
371
|
+
},
|
|
372
|
+
on: {
|
|
373
|
+
click: $xePasswordInput.clickEvent,
|
|
374
|
+
input: $xePasswordInput.inputEvent,
|
|
375
|
+
change: $xePasswordInput.changeEvent,
|
|
376
|
+
focus: $xePasswordInput.focusEvent,
|
|
377
|
+
blur: $xePasswordInput.blurEvent
|
|
378
|
+
}
|
|
379
|
+
})]), suffix || (0, _ui.renderEmptyElement)($xePasswordInput)]);
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
watch: {
|
|
383
|
+
value: function value(val) {
|
|
384
|
+
var $xePasswordInput = this;
|
|
385
|
+
var reactData = $xePasswordInput.reactData;
|
|
386
|
+
reactData.inputValue = val;
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
created: function created() {
|
|
390
|
+
var $xePasswordInput = this;
|
|
391
|
+
var props = $xePasswordInput;
|
|
392
|
+
var reactData = $xePasswordInput.reactData;
|
|
393
|
+
reactData.inputValue = props.value;
|
|
394
|
+
},
|
|
395
|
+
render: function render(h) {
|
|
396
|
+
return this.renderVN(h);
|
|
397
|
+
}
|
|
398
|
+
});
|
|
@@ -0,0 +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"),_utils=require("../../ui/src/utils"),_vn=require("../..//ui/src/vn");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:"VxePasswordInput",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:String,name:String,clearable:{type:Boolean,default:function(){return(0,_ui.getConfig)().passwordInput.clearable}},readonly:Boolean,disabled:Boolean,maxLength:[String,Number],placeholder:String,autoComplete:{type:String,default:"off"},className:String,size:{type:String,default:function(){return(0,_ui.getConfig)().passwordInput.size||(0,_ui.getConfig)().size}},prefixIcon:String,suffixIcon:String,autocomplete:String},inject:{$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{showPwd:!1,isActivated:!1,inputValue:""}}},computed:Object.assign(Object.assign({},{}),{computeIsClearable:function(){return this.clearable},computeInpReadonly:function(){return this.readonly},computeInpPlaceholder:function(){var e=this.placeholder;return(e=e||(0,_ui.getConfig)().passwordInput.placeholder)?(0,_utils.getFuncText)(e):(0,_ui.getI18n)("vxe.base.pleaseInput")},computeInputType:function(){return this.reactData.showPwd?"text":"password"}}),methods:{dispatchEvent:function(e,t,i){this.$emit(e,(0,_ui.createEvent)(i,{$passwordInput:this},t))},focus:function(){var e=this,t=e.reactData,i=e.$refs.refInputTarget;return t.isActivated=!0,i.focus(),e.$nextTick()},blur:function(){var e=this,t=e.reactData;return e.$refs.refInputTarget.blur(),t.isActivated=!1,e.$nextTick()},select:function(){var e=this,t=e.reactData;return e.$refs.refInputTarget.select(),t.isActivated=!1,e.$nextTick()},triggerEvent:function(e){var t=this.reactData.inputValue;this.dispatchEvent(e.type,{value:t},e)},emitInputEvent:function(e,t){this.reactData.inputValue=e,this.dispatchEvent("input",{value:e},t)},inputEvent:function(e){var t=e.target.value;this.emitInputEvent(t,e)},emitModel:function(e,t){var i=this,n=i,r=i.reactData,a=i.$xeForm,u=i.formItemInfo;r.inputValue=e,i.$emit("modelValue",e),i.dispatchEvent("input",{value:e},t),_xeUtils.default.toValueString(n.value)!==e&&(i.dispatchEvent("change",{value:e},t),a)&&u&&a.triggerItemEvent(t,u.itemConfig.field,e)},changeEvent:function(e){var t=this.reactData,i=this.$xeForm,n=this.formItemInfo,t=(this.triggerEvent(e),t.inputValue);i&&n&&i.triggerItemEvent(e,n.itemConfig.field,t)},focusEvent:function(e){this.reactData.isActivated=!0,this.triggerEvent(e)},blurEvent:function(e){var t=this.reactData.inputValue;this.dispatchEvent("blur",{value:t},e)},passwordToggleEvent:function(e){var t=this.reactData,i=this.readonly,n=this.disabled,r=t.showPwd;n||i||(t.showPwd=!r),this.dispatchEvent("toggle-visible",{visible:t.showPwd},e)},clickEvent:function(e){this.triggerEvent(e)},clearValueEvent:function(e,t){this.focus(),this.emitModel("",e),this.dispatchEvent("clear",{value:t},e)},clickSuffixEvent:function(e){var t=this.reactData;this.disabled||(t=t.inputValue,this.dispatchEvent("suffix-click",{value:t},e))},clickPrefixEvent:function(e){var t=this.reactData;this.disabled||(t=t.inputValue,this.dispatchEvent("prefix-click",{value:t},e))},renderPasswordIcon:function(e){var t=this.reactData.showPwd;return e("div",{class:"password-input--control-icon",on:{click:this.passwordToggleEvent}},[e("i",{class:["password-input--password-icon",t?(0,_ui.getIcon)().PASSWORD_INPUT_SHOW_PWD:(0,_ui.getIcon)().PASSWORD_INPUT_HIDE_PWD]})])},renderPrefixIcon:function(e){var t=this.$scopedSlots,i=this.prefixIcon,t=t.prefix;return t||i?e("div",{class:"password-input--prefix",on:{click:this.clickPrefixEvent}},[e("div",{class:"password-input--prefix-icon"},t?(0,_vn.getSlotVNs)(t({})):[e("i",{class:i})])]):null},renderSuffixIcon:function(e){var t=this,i=t.$scopedSlots,n=t.disabled,r=t.suffixIcon,a=t.reactData.inputValue,i=i.suffix,u=t.computeIsClearable;return u||i||r?e("div",{class:["password-input--suffix",{"is--clear":u&&!n&&!(""===a||_xeUtils.default.eqNull(a))}]},[u?e("div",{class:"password-input--clear-icon",on:{click:t.clearValueEvent}},[e("i",{class:(0,_ui.getIcon)().INPUT_CLEAR})]):(0,_ui.renderEmptyElement)(t),t.renderExtraSuffixIcon(e),i||r?e("div",{class:"password-input--suffix-icon",on:{click:t.clickSuffixEvent}},i?(0,_vn.getSlotVNs)(i({})):[e("i",{class:r})]):(0,_ui.renderEmptyElement)(t)]):null},renderExtraSuffixIcon:function(e){return this.renderPasswordIcon(e)},renderVN:function(e){var t=this,i=t.reactData,n=t.className,r=t.name,a=t.disabled,u=t.readonly,o=t.autocomplete,s=t.autoComplete,c=t.maxLength,l=i.inputValue,i=i.isActivated,p=t.computeSize,f=t.computeInpReadonly,d=t.computeInputType,v=t.computeInpPlaceholder,m=t.computeIsClearable,h=t.renderPrefixIcon(e),g=t.renderSuffixIcon(e);return e("div",{ref:"refElem",class:["password-input",n,_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(p),p),"is--prefix",!!h),"is--suffix",!!g),"is--readonly",u),"is--disabled",a),"is--active",i),"show--clear",m&&!a&&!(""===l||_xeUtils.default.eqNull(l)))],attrs:{spellcheck:!1}},[h||(0,_ui.renderEmptyElement)(t),e("div",{class:"password-input--wrapper"},[e("input",{ref:"refInputTarget",class:"password-input--inner",domProps:{value:l},attrs:{name:r,type:d,placeholder:v,readonly:f,disabled:a,autocomplete:o||s,maxlength:c},on:{click:t.clickEvent,input:t.inputEvent,change:t.changeEvent,focus:t.focusEvent,blur:t.blurEvent}})]),g||(0,_ui.renderEmptyElement)(t)])}},watch:{value:function(e){this.reactData.inputValue=e}},created:function(){this.reactData.inputValue=this.value},render:function(e){return this.renderVN(e)}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./style.css')
|