@xysfe/actui
Version:
A fantastic mobile ui lib implement by Vue
1 lines • 7.12 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@xysfe/actui/es/assets/utils/create/index.js"),require("@xysfe/actui/es/assets/mixins/gold-visible.js"),require("@xysfe/actui/es/assets/mixins/gold-element.js"),require("@xysfe/actui/es/assets/common/baseelement.js"),require("@xysfe/actui/es/assets/mixins/gold-change.js"),require("@xysfe/actui/es/BaseInput/index.js")):"function"==typeof define&&define.amd?define(["@xysfe/actui/es/assets/utils/create/index.js","@xysfe/actui/es/assets/mixins/gold-visible.js","@xysfe/actui/es/assets/mixins/gold-element.js","@xysfe/actui/es/assets/common/baseelement.js","@xysfe/actui/es/assets/mixins/gold-change.js","@xysfe/actui/es/BaseInput/index.js"],t):"object"==typeof exports?exports.GoldInput=t(require("@xysfe/actui/es/assets/utils/create/index.js"),require("@xysfe/actui/es/assets/mixins/gold-visible.js"),require("@xysfe/actui/es/assets/mixins/gold-element.js"),require("@xysfe/actui/es/assets/common/baseelement.js"),require("@xysfe/actui/es/assets/mixins/gold-change.js"),require("@xysfe/actui/es/BaseInput/index.js")):e.GoldInput=t(e["@xysfe/actui/es/assets/utils/create/index.js"],e["@xysfe/actui/es/assets/mixins/gold-visible.js"],e["@xysfe/actui/es/assets/mixins/gold-element.js"],e["@xysfe/actui/es/assets/common/baseelement.js"],e["@xysfe/actui/es/assets/mixins/gold-change.js"],e["@xysfe/actui/es/BaseInput/index.js"])}("undefined"!=typeof self?self:this,function(e,t,s,i,n,o){return function(e){function t(i){if(s[i])return s[i].exports;var n=s[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var s={};return t.m=e,t.c=s,t.d=function(e,s,i){t.o(e,s)||Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var s=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(s,"a",s),s},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="../es",t(t.s=1469)}({107:function(e,s){e.exports=t},1070:function(e,t,s){"use strict";var i=s(107),n=s.n(i),o=s(128),a=s.n(o),u=s(157),r=s.n(u),c=s(141),l=s.n(c),f=s(630),p=s.n(f);t.a={name:"ActGoldInput",mixins:[n.a,a.a,r.a],data:function(){return{isShowTip:!1,emailAuto:[],selectEmailValue:"",istopTip:!1,showSuggestions:!1,picker:null,decimalPlaces:this.value>0?2:0,maxlength:this.maxLength?this.maxLength:1e4}},computed:{isAutofixEmail:function(){return"email"===this.type},inputValue:function(){return this.getRatioValue(this.value)},showTip:function(){return this.asyncSearch&&this.showSuggestions}},watch:{showTip:function(e,t){e?(this.picker?this.picker.show():(this.picker=this.$GoldAddressLayer({title:"企业搜索",searchUrl:"/enterprise/getCompanyInfo",onSelect:this.selectSuggestion,brandColor:this.brandColor}),this.picker.show()),this.$refs.input.blur()):this.picker.hide()},immediate:!0},methods:{onFocus:function(e){var t=this;this.$emit("focus",e),this.showSuggestions&&(this.showSuggestions=!1),this.$nextTick(function(){t.showSuggestions=!0})},onBlur:function(e){this.isAutofixEmail&&(this.emailAuto=[]),this.$emit("blur",e)},selectEmail:function(e){var t=e&&e.replace(/\s*/gi,"");this.$refs.input.setInputValue(t)},onInput:function(e,t){if(1!==this.displayRatio){e=e.replace(/(^\s*)|(\s*$)/g,"");var s=e.length;if(/^[0-9]+(.[0-9]{1,2})?$/.test(e)){var i=e.split(".");i[1]&&2===i[1].length?this.maxlength=s||0:this.maxlength=1e4}}var n=e;if(this.isAutofixEmail){if(!n)return void(this.emailAuto=[]);var o=n.lastIndexOf("@"),a=n.lastIndexOf("."),u="";a>-1&&o>-1?u=n.substring(o+1,a):o>-1&&(u=n.substring(o+1)),n.match(/@$/)&&(n=n.replace(/@$/,"")),o>-1&&(n=n.substring(0,o)),this.emailAuto=this.emailAutoList.map(function(e){if(e.indexOf(u)>-1)return n+e}).filter(function(e){return!!e})}var r=document.body.clientHeight,c=t.target.getBoundingClientRect().bottom;this.istopTip=r-c<280,this.$emit("input",e)},onChange:function(e){this.change(void 0,this.getRealValue(e))},getRatioValue:function(e){return 1===this.displayRatio||""===e||isNaN(e)?e:(e*this.displayRatio).toFixed(this.decimalPlaces)},getRealValue:function(e){if(1===this.displayRatio||""===e||isNaN(e))return e;var t=e.split(".");return this.decimalPlaces=t[1]?t[1].length:0,(parseFloat(e)/this.displayRatio).toFixed(this.decimalPlaces)},selectSuggestion:function(e){this.change(void 0,e),this.showSuggestions=!1}},components:{ActGoldBaseElement:l.a,ActBaseInput:p.a}}},128:function(e,t){e.exports=s},141:function(e,t){e.exports=i},1469:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=s(28),n=s.n(i),o=s(1470);o.a.install=function(e){e.component(o.a.name,o.a),e.prototype.$createGoldInput=n()(o.a,e)},t.default=o.a},1470:function(e,t,s){"use strict";function i(e){u||s(1471)}var n=s(1070),o=s(1472),a=s(7),u=!1,r=i,c=Object(a.a)(n.a,o.a,o.b,!1,r,"data-v-fb240230",null);c.options.__file="src\\components\\GoldInput\\src\\index.vue",t.a=c.exports},1471:function(e,t){},1472:function(e,t,s){"use strict";s.d(t,"a",function(){return i}),s.d(t,"b",function(){return n});var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("act-gold-base-element",{directives:[{name:"show",rawName:"v-show",value:e.isVisible,expression:"isVisible"}],attrs:{common:e.common,type:e.type,hasSuffix:!!e.$slots.suffix},on:{showTips:e.showTips,takenLink:e.takenLink},scopedSlots:e._u([{key:"email",fn:function(){return["email"===e.type&&e.emailAuto.length>0?s("div",{class:[{"email-auto-fix":!e.istopTip},{"email-auto-fix-top":e.istopTip}]},e._l(e.emailAuto,function(t){return s("p",{key:t,staticClass:"email-item",on:{mousedown:function(s){return e.selectEmail(t)},touchstart:function(s){return e.selectEmail(t)}}},[e._v("\n "+e._s(t)+"\n ")])}),0):e._e()]},proxy:!0}])},[s("act-base-input",{ref:"input",attrs:{type:e.type,placeholder:e.placeholder,value:e.inputValue,"data-key":[e.isWebTester?e.elemKey:""],maxLength:e.maxlength,allowSpace:e.allowSpace},on:{focus:e.onFocus,blur:e.onBlur,input:e.onInput,change:e.onChange,mucChange:function(t){return e.mucChange(t)}}}),e._v(" "),e._v(" "),e.unit?s("span",{staticClass:"element-unit"},[e._v(e._s(e.unit))]):e._e(),e._v(" "),e.$slots.suffix?e._t("suffix"):e._e()],2)},n=[];i._withStripped=!0},157:function(e,t){e.exports=n},28:function(t,s){t.exports=e},630:function(e,t){e.exports=o},7:function(e,t,s){"use strict";function i(e,t,s,i,n,o,a,u){e=e||{};var r=typeof e.default;"object"!==r&&"function"!==r||(e=e.default);var c="function"==typeof e?e.options:e;t&&(c.render=t,c.staticRenderFns=s,c._compiled=!0),i&&(c.functional=!0),o&&(c._scopeId=o);var l;if(a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):n&&(l=u?function(){n.call(this,this.$root.$options.shadowRoot)}:n),l)if(c.functional){c._injectStyles=l;var f=c.render;c.render=function(e,t){return l.call(t),f(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}t.a=i}})});