UNPKG

@xysfe/actui

Version:

A fantastic mobile ui lib implement by Vue

1 lines • 9.15 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@xysfe/actui/es/assets/utils/create/index.js"),require("@xysfe/actui/es/assets/mixins/gold-visible.js"),require("@xysfe/actui/es/assets/svgicon.js"),require("@xysfe/actui/es/assets/utils/position.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/svgicon.js","@xysfe/actui/es/assets/utils/position.js"],e):"object"==typeof exports?exports.NoticeTips=e(require("@xysfe/actui/es/assets/utils/create/index.js"),require("@xysfe/actui/es/assets/mixins/gold-visible.js"),require("@xysfe/actui/es/assets/svgicon.js"),require("@xysfe/actui/es/assets/utils/position.js")):t.NoticeTips=e(t["@xysfe/actui/es/assets/utils/create/index.js"],t["@xysfe/actui/es/assets/mixins/gold-visible.js"],t["@xysfe/actui/es/assets/svgicon.js"],t["@xysfe/actui/es/assets/utils/position.js"])}("undefined"!=typeof self?self:this,function(t,e,s,i){return function(t){function e(i){if(s[i])return s[i].exports;var o=s[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var s={};return e.m=t,e.c=s,e.d=function(t,s,i){e.o(t,s)||Object.defineProperty(t,s,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var s=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(s,"a",s),s},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="../es",e(e.s=1616)}({105:function(t,s){t.exports=e},1112:function(t,e,s){"use strict";var i=s(1618),o=s(940),n=s(105),c=s.n(n);e.a={name:"ActNoticeTips",mixins:[c.a],props:{text:{type:String,default:""},color:{type:String,default:""},background:{type:String,default:""},scroll:{type:Boolean,default:!0},wrap:{type:Boolean,default:!1},delay:{type:Number,default:2},speed:{type:Number,default:30},closable:{type:Boolean,default:!1},leftIcon:{type:String,default:""},position:{type:String,default:"static"},zIndex:{type:[Number,String],default:100}},data:function(){return{}},methods:{closeNoticeTips:function(){this.hide(),this.$emit("close")},clickText:function(){this.$emit("click")}},components:{noticeTips:i.a,actSticky:o.a}}},1113:function(t,e,s){"use strict";var i=s(143),o=s.n(i);e.a={name:"NoticeTips",props:{text:{type:String,default:""},color:{type:String,default:""},background:{type:String,default:""},scroll:{type:Boolean,default:!0},wrap:{type:Boolean,default:!1},delay:{type:Number,default:2},speed:{type:Number,default:30},closable:{type:Boolean,default:!1},leftIcon:{type:String,default:""},position:{type:String,default:"static"},zIndex:{type:[Number,String],default:100}},data:function(){return{wrapWidth:"",offsetWidth:"",duration:""}},watch:{text:{handler:function(){var t=this;this.$nextTick(function(){var e=t.$refs,s=e.wrap,i=e.content;if(s&&i){var o=i.getBoundingClientRect().width,n=s.getBoundingClientRect().width;t.wrapWidth=n,t.offsetWidth=o,t.duration=o/t.speed,console.log(n,o)}})},immediate:!0}},computed:{scrollStyle:function(){var t={};return this.duration&&this.delay&&(t.animationDelay=this.delay+"s",t.animationDuration=this.duration+"s"),t},noticeStyle:function(){var t={};return t.color=this.color,t.backgroundColor=this.background,"fixed"===this.position&&(t.zIndex=this.zIndex,t.position=this.position,t.width="100%",t.top=0),t}},methods:{closeNotice:function(){this.closable&&this.$emit("closeNoticeTips")},clickText:function(){this.$emit("clickText")}},components:{svgIcon:o.a}}},143:function(t,e){t.exports=s},1616:function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(26),o=s.n(i),n=s(1617);n.a.install=function(t){t.component(n.a.name,n.a),t.prototype.$createNoticeTips=o()(n.a,t)},e.default=n.a},1617:function(t,e,s){"use strict";var i=s(1112),o=s(1621),n=s(7),c=Object(n.a)(i.a,o.a,o.b,!1,null,null,null);c.options.__file="src\\components\\NoticeTips\\src\\index.vue",e.a=c.exports},1618:function(t,e,s){"use strict";function i(t){r||s(1619)}var o=s(1113),n=s(1620),c=s(7),r=!1,l=i,a=Object(c.a)(o.a,n.a,n.b,!1,l,"data-v-484a6b18",null);a.options.__file="src\\components\\NoticeTips\\src\\noticeTips.vue",e.a=a.exports},1619:function(t,e){},1620:function(t,e,s){"use strict";s.d(e,"a",function(){return i}),s.d(e,"b",function(){return o});var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"notice-tips",style:t.noticeStyle},[t.$slots.leftIcon||t.leftIcon?s("div",{staticClass:"notice-left"},[t.$slots.leftIcon?t._t("leftIcon"):t.leftIcon?s("svg-icon",{attrs:{iconClass:t.leftIcon}}):t._e()],2):t._e(),t._v(" "),s("div",{ref:"wrap",staticClass:"notice-content",on:{click:function(e){return e.stopPropagation(),t.clickText.apply(null,arguments)}}},[t.$slots.default?t._t("default"):s("div",{ref:"content",staticClass:"text",class:[{"notice-scroll":t.scroll&&t.wrapWidth<t.offsetWidth},{"notice-nowrap":!t.wrap}],style:t.scrollStyle,domProps:{textContent:t._s(t.text)}})],2),t._v(" "),t.$slots.rightIcon||t.closable?s("div",{staticClass:"notice-right",on:{click:function(e){return e.stopPropagation(),t.closeNotice.apply(null,arguments)}}},[t.$slots.rightIcon?t._t("rightIcon"):t.closable?s("svg-icon",{attrs:{iconClass:"close"}}):t._e()],2):t._e()])},o=[];i._withStripped=!0},1621:function(t,e,s){"use strict";s.d(e,"a",function(){return i}),s.d(e,"b",function(){return o});var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return"sticky"===t.position?s("act-sticky",{directives:[{name:"show",rawName:"v-show",value:t.isVisible,expression:"isVisible"}],attrs:{zIndex:t.zIndex}},[s("notice-tips",{attrs:{text:t.text,color:t.color,background:t.background,scroll:t.scroll,wrap:t.wrap,delay:t.delay,speed:t.speed,closable:t.closable,leftIcon:t.leftIcon,position:t.position,zIndex:t.zIndex},on:{closeNoticeTips:t.closeNoticeTips,clickText:t.clickText}},[t.$slots.leftIcon?t._t("leftIcon",null,{slot:"leftIcon"}):t._e(),t._v(" "),t.$slots.default?t._t("default",null,{slot:"default"}):t._e(),t._v(" "),t.$slots.rightIcon?t._t("rightIcon",null,{slot:"rightIcon"}):t._e()],2)],1):s("notice-tips",{directives:[{name:"show",rawName:"v-show",value:t.isVisible,expression:"isVisible"}],attrs:{text:t.text,color:t.color,background:t.background,scroll:t.scroll,wrap:t.wrap,delay:t.delay,speed:t.speed,closable:t.closable,leftIcon:t.leftIcon,position:t.position,zIndex:t.zIndex},on:{closeNoticeTips:t.closeNoticeTips,clickText:t.clickText}},[t.$slots.leftIcon?t._t("leftIcon",null,{slot:"leftIcon"}):t._e(),t._v(" "),t.$slots.default?t._t("default",null,{slot:"default"}):t._e(),t._v(" "),t.$slots.rightIcon?t._t("rightIcon",null,{slot:"rightIcon"}):t._e()],2)},o=[];i._withStripped=!0},26:function(e,s){e.exports=t},7:function(t,e,s){"use strict";function i(t,e,s,i,o,n,c,r){t=t||{};var l=typeof t.default;"object"!==l&&"function"!==l||(t=t.default);var a="function"==typeof t?t.options:t;e&&(a.render=e,a.staticRenderFns=s,a._compiled=!0),i&&(a.functional=!0),n&&(a._scopeId=n);var u;if(c?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(c)},a._ssrRegister=u):o&&(u=r?function(){o.call(this,this.$root.$options.shadowRoot)}:o),u)if(a.functional){a._injectStyles=u;var f=a.render;a.render=function(t,e){return u.call(e),f(t,e)}}else{var d=a.beforeCreate;a.beforeCreate=d?[].concat(d,u):[u]}return{exports:t,options:a}}e.a=i},872:function(t,e,s){"use strict";var i=s(942);s.n(i);e.a={name:"ActSticky",props:{offsetTop:{type:[Number,String],default:0},zIndex:{type:[Number,String],default:""}},data:function(){return{height:0,fixed:!1}},computed:{containerStyle:function(){var t={};return this.fixed&&this.height&&(t.height=this.height+"px"),t},stickyStyle:function(){if(this.fixed){var t={};return this.zIndex&&(t.zIndex=this.zIndex),this.offsetTop&&this.fixed&&(t.top=this.offsetTop+"px"),t}}},mounted:function(){this.scroller=window,window.addEventListener("scroll",this.onScroll,!0),this.onScroll()},watch:{value:function(t){t!==this.currentValue&&(this.currentValue=this.format(t))},currentValue:function(t){this.$emit("input",t)}},methods:{onScroll:function(){this.height=this.$el.offsetHeight;var t=+this.offsetTop,e=Object(i.getScrollTop)(window),s=Object(i.getElementTop)(this.$el);this.fixed=e+t>s,this.$emit("scroll",{scrollTop:e,isFixed:this.fixed})}},beforeDestroy:function(){window.removeEventListener("scroll",this.onScroll,!0)}}},940:function(t,e,s){"use strict";function i(t){r||s(941)}var o=s(872),n=s(943),c=s(7),r=!1,l=i,a=Object(c.a)(o.a,n.a,n.b,!1,l,"data-v-70e26592",null);a.options.__file="src\\components\\Sticky\\src\\index.vue",e.a=a.exports},941:function(t,e){},942:function(t,e){t.exports=i},943:function(t,e,s){"use strict";s.d(e,"a",function(){return i}),s.d(e,"b",function(){return o});var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{style:t.containerStyle},[s("div",{class:{"sticky-fixed":t.fixed},style:t.stickyStyle},[t._t("default")],2)])},o=[];i._withStripped=!0}})});