Files
supplier-dispatch-h5/node_modules/.cache/babel-loader/0825b1cdb3854bfa5c5a974b8aadb191867da4c72c1f9a60b05d315b2d507cb4.json
2023-08-11 10:45:20 +08:00

1 line
17 KiB
JSON

{"ast":null,"code":"import { createNamespace, isDef } from '../utils';\nimport { doubleRaf, raf } from '../utils/dom/raf';\nimport { BindEventMixin } from '../mixins/bind-event';\nimport Icon from '../icon';\nvar _createNamespace = createNamespace('notice-bar'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\nexport default createComponent({\n mixins: [BindEventMixin(function (bind) {\n // fix cache issues with forwards and back history in safari\n // see: https://guwii.com/cache-issues-with-forwards-and-back-history-in-safari/\n bind(window, 'pageshow', this.reset);\n })],\n inject: {\n vanPopup: {\n default: null\n }\n },\n props: {\n text: String,\n mode: String,\n color: String,\n leftIcon: String,\n wrapable: Boolean,\n background: String,\n scrollable: {\n type: Boolean,\n default: null\n },\n delay: {\n type: [Number, String],\n default: 1\n },\n speed: {\n type: [Number, String],\n default: 60\n }\n },\n data: function data() {\n return {\n show: true,\n offset: 0,\n duration: 0,\n wrapWidth: 0,\n contentWidth: 0\n };\n },\n watch: {\n scrollable: 'reset',\n text: {\n handler: 'reset',\n immediate: true\n }\n },\n created: function created() {\n // https://github.com/vant-ui/vant/issues/8634\n if (this.vanPopup) {\n this.vanPopup.onReopen(this.reset);\n }\n },\n activated: function activated() {\n this.reset();\n },\n methods: {\n onClickIcon: function onClickIcon(event) {\n if (this.mode === 'closeable') {\n this.show = false;\n this.$emit('close', event);\n }\n },\n onTransitionEnd: function onTransitionEnd() {\n var _this = this;\n this.offset = this.wrapWidth;\n this.duration = 0; // wait for Vue to render offset\n // using nextTick won't work in iOS14\n\n raf(function () {\n // use double raf to ensure animation can start\n doubleRaf(function () {\n _this.offset = -_this.contentWidth;\n _this.duration = (_this.contentWidth + _this.wrapWidth) / _this.speed;\n _this.$emit('replay');\n });\n });\n },\n // not an exposed-api, but may used by some users\n start: function start() {\n this.reset();\n },\n // @exposed-api\n reset: function reset() {\n var _this2 = this;\n var delay = isDef(this.delay) ? this.delay * 1000 : 0;\n this.offset = 0;\n this.duration = 0;\n this.wrapWidth = 0;\n this.contentWidth = 0;\n clearTimeout(this.startTimer);\n this.startTimer = setTimeout(function () {\n var _this2$$refs = _this2.$refs,\n wrap = _this2$$refs.wrap,\n content = _this2$$refs.content;\n if (!wrap || !content || _this2.scrollable === false) {\n return;\n }\n var wrapWidth = wrap.getBoundingClientRect().width;\n var contentWidth = content.getBoundingClientRect().width;\n if (_this2.scrollable || contentWidth > wrapWidth) {\n doubleRaf(function () {\n _this2.offset = -contentWidth;\n _this2.duration = contentWidth / _this2.speed;\n _this2.wrapWidth = wrapWidth;\n _this2.contentWidth = contentWidth;\n });\n }\n }, delay);\n }\n },\n render: function render() {\n var _this3 = this;\n var h = arguments[0];\n var slots = this.slots,\n mode = this.mode,\n leftIcon = this.leftIcon,\n onClickIcon = this.onClickIcon;\n var barStyle = {\n color: this.color,\n background: this.background\n };\n var contentStyle = {\n transform: this.offset ? \"translateX(\" + this.offset + \"px)\" : '',\n transitionDuration: this.duration + 's'\n };\n function LeftIcon() {\n var slot = slots('left-icon');\n if (slot) {\n return slot;\n }\n if (leftIcon) {\n return h(Icon, {\n \"class\": bem('left-icon'),\n \"attrs\": {\n \"name\": leftIcon\n }\n });\n }\n }\n function RightIcon() {\n var slot = slots('right-icon');\n if (slot) {\n return slot;\n }\n var iconName;\n if (mode === 'closeable') {\n iconName = 'cross';\n } else if (mode === 'link') {\n iconName = 'arrow';\n }\n if (iconName) {\n return h(Icon, {\n \"class\": bem('right-icon'),\n \"attrs\": {\n \"name\": iconName\n },\n \"on\": {\n \"click\": onClickIcon\n }\n });\n }\n }\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"alert\"\n },\n \"directives\": [{\n name: \"show\",\n value: this.show\n }],\n \"class\": bem({\n wrapable: this.wrapable\n }),\n \"style\": barStyle,\n \"on\": {\n \"click\": function click(event) {\n _this3.$emit('click', event);\n }\n }\n }, [LeftIcon(), h(\"div\", {\n \"ref\": \"wrap\",\n \"class\": bem('wrap'),\n \"attrs\": {\n \"role\": \"marquee\"\n }\n }, [h(\"div\", {\n \"ref\": \"content\",\n \"class\": [bem('content'), {\n 'van-ellipsis': this.scrollable === false && !this.wrapable\n }],\n \"style\": contentStyle,\n \"on\": {\n \"transitionend\": this.onTransitionEnd\n }\n }, [this.slots() || this.text])]), RightIcon()]);\n }\n});","map":{"version":3,"names":["createNamespace","isDef","doubleRaf","raf","BindEventMixin","Icon","_createNamespace","createComponent","bem","mixins","bind","window","reset","inject","vanPopup","default","props","text","String","mode","color","leftIcon","wrapable","Boolean","background","scrollable","type","delay","Number","speed","data","show","offset","duration","wrapWidth","contentWidth","watch","handler","immediate","created","onReopen","activated","methods","onClickIcon","event","$emit","onTransitionEnd","_this","start","_this2","clearTimeout","startTimer","setTimeout","_this2$$refs","$refs","wrap","content","getBoundingClientRect","width","render","_this3","h","arguments","slots","barStyle","contentStyle","transform","transitionDuration","LeftIcon","slot","RightIcon","iconName","name","value","click"],"sources":["E:/work/sino/sino-h5/node_modules/vant/es/notice-bar/index.js"],"sourcesContent":["import { createNamespace, isDef } from '../utils';\nimport { doubleRaf, raf } from '../utils/dom/raf';\nimport { BindEventMixin } from '../mixins/bind-event';\nimport Icon from '../icon';\n\nvar _createNamespace = createNamespace('notice-bar'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [BindEventMixin(function (bind) {\n // fix cache issues with forwards and back history in safari\n // see: https://guwii.com/cache-issues-with-forwards-and-back-history-in-safari/\n bind(window, 'pageshow', this.reset);\n })],\n inject: {\n vanPopup: {\n default: null\n }\n },\n props: {\n text: String,\n mode: String,\n color: String,\n leftIcon: String,\n wrapable: Boolean,\n background: String,\n scrollable: {\n type: Boolean,\n default: null\n },\n delay: {\n type: [Number, String],\n default: 1\n },\n speed: {\n type: [Number, String],\n default: 60\n }\n },\n data: function data() {\n return {\n show: true,\n offset: 0,\n duration: 0,\n wrapWidth: 0,\n contentWidth: 0\n };\n },\n watch: {\n scrollable: 'reset',\n text: {\n handler: 'reset',\n immediate: true\n }\n },\n created: function created() {\n // https://github.com/vant-ui/vant/issues/8634\n if (this.vanPopup) {\n this.vanPopup.onReopen(this.reset);\n }\n },\n activated: function activated() {\n this.reset();\n },\n methods: {\n onClickIcon: function onClickIcon(event) {\n if (this.mode === 'closeable') {\n this.show = false;\n this.$emit('close', event);\n }\n },\n onTransitionEnd: function onTransitionEnd() {\n var _this = this;\n\n this.offset = this.wrapWidth;\n this.duration = 0; // wait for Vue to render offset\n // using nextTick won't work in iOS14\n\n raf(function () {\n // use double raf to ensure animation can start\n doubleRaf(function () {\n _this.offset = -_this.contentWidth;\n _this.duration = (_this.contentWidth + _this.wrapWidth) / _this.speed;\n\n _this.$emit('replay');\n });\n });\n },\n // not an exposed-api, but may used by some users\n start: function start() {\n this.reset();\n },\n // @exposed-api\n reset: function reset() {\n var _this2 = this;\n\n var delay = isDef(this.delay) ? this.delay * 1000 : 0;\n this.offset = 0;\n this.duration = 0;\n this.wrapWidth = 0;\n this.contentWidth = 0;\n clearTimeout(this.startTimer);\n this.startTimer = setTimeout(function () {\n var _this2$$refs = _this2.$refs,\n wrap = _this2$$refs.wrap,\n content = _this2$$refs.content;\n\n if (!wrap || !content || _this2.scrollable === false) {\n return;\n }\n\n var wrapWidth = wrap.getBoundingClientRect().width;\n var contentWidth = content.getBoundingClientRect().width;\n\n if (_this2.scrollable || contentWidth > wrapWidth) {\n doubleRaf(function () {\n _this2.offset = -contentWidth;\n _this2.duration = contentWidth / _this2.speed;\n _this2.wrapWidth = wrapWidth;\n _this2.contentWidth = contentWidth;\n });\n }\n }, delay);\n }\n },\n render: function render() {\n var _this3 = this;\n\n var h = arguments[0];\n var slots = this.slots,\n mode = this.mode,\n leftIcon = this.leftIcon,\n onClickIcon = this.onClickIcon;\n var barStyle = {\n color: this.color,\n background: this.background\n };\n var contentStyle = {\n transform: this.offset ? \"translateX(\" + this.offset + \"px)\" : '',\n transitionDuration: this.duration + 's'\n };\n\n function LeftIcon() {\n var slot = slots('left-icon');\n\n if (slot) {\n return slot;\n }\n\n if (leftIcon) {\n return h(Icon, {\n \"class\": bem('left-icon'),\n \"attrs\": {\n \"name\": leftIcon\n }\n });\n }\n }\n\n function RightIcon() {\n var slot = slots('right-icon');\n\n if (slot) {\n return slot;\n }\n\n var iconName;\n\n if (mode === 'closeable') {\n iconName = 'cross';\n } else if (mode === 'link') {\n iconName = 'arrow';\n }\n\n if (iconName) {\n return h(Icon, {\n \"class\": bem('right-icon'),\n \"attrs\": {\n \"name\": iconName\n },\n \"on\": {\n \"click\": onClickIcon\n }\n });\n }\n }\n\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"alert\"\n },\n \"directives\": [{\n name: \"show\",\n value: this.show\n }],\n \"class\": bem({\n wrapable: this.wrapable\n }),\n \"style\": barStyle,\n \"on\": {\n \"click\": function click(event) {\n _this3.$emit('click', event);\n }\n }\n }, [LeftIcon(), h(\"div\", {\n \"ref\": \"wrap\",\n \"class\": bem('wrap'),\n \"attrs\": {\n \"role\": \"marquee\"\n }\n }, [h(\"div\", {\n \"ref\": \"content\",\n \"class\": [bem('content'), {\n 'van-ellipsis': this.scrollable === false && !this.wrapable\n }],\n \"style\": contentStyle,\n \"on\": {\n \"transitionend\": this.onTransitionEnd\n }\n }, [this.slots() || this.text])]), RightIcon()]);\n }\n});"],"mappings":"AAAA,SAASA,eAAe,EAAEC,KAAK,QAAQ,UAAU;AACjD,SAASC,SAAS,EAAEC,GAAG,QAAQ,kBAAkB;AACjD,SAASC,cAAc,QAAQ,sBAAsB;AACrD,OAAOC,IAAI,MAAM,SAAS;AAE1B,IAAIC,gBAAgB,GAAGN,eAAe,CAAC,YAAY,CAAC;EAChDO,eAAe,GAAGD,gBAAgB,CAAC,CAAC,CAAC;EACrCE,GAAG,GAAGF,gBAAgB,CAAC,CAAC,CAAC;AAE7B,eAAeC,eAAe,CAAC;EAC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