{"ast":null,"code":"// Utils\nimport { createNamespace } from '../utils';\nimport { isHidden } from '../utils/dom/style';\nimport { getScroller } from '../utils/dom/scroll'; // Mixins\n\nimport { BindEventMixin } from '../mixins/bind-event'; // Components\n\nimport Loading from '../loading';\nvar _createNamespace = createNamespace('list'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\nexport default createComponent({\n mixins: [BindEventMixin(function (bind) {\n if (!this.scroller) {\n this.scroller = getScroller(this.$el);\n }\n bind(this.scroller, 'scroll', this.check);\n })],\n model: {\n prop: 'loading'\n },\n props: {\n error: Boolean,\n loading: Boolean,\n finished: Boolean,\n errorText: String,\n loadingText: String,\n finishedText: String,\n immediateCheck: {\n type: Boolean,\n default: true\n },\n offset: {\n type: [Number, String],\n default: 300\n },\n direction: {\n type: String,\n default: 'down'\n }\n },\n data: function data() {\n return {\n // use sync innerLoading state to avoid repeated loading in some edge cases\n innerLoading: this.loading\n };\n },\n updated: function updated() {\n this.innerLoading = this.loading;\n },\n mounted: function mounted() {\n if (this.immediateCheck) {\n this.check();\n }\n },\n watch: {\n loading: 'check',\n finished: 'check'\n },\n methods: {\n // @exposed-api\n check: function check() {\n var _this = this;\n this.$nextTick(function () {\n if (_this.innerLoading || _this.finished || _this.error) {\n return;\n }\n var el = _this.$el,\n scroller = _this.scroller,\n offset = _this.offset,\n direction = _this.direction;\n var scrollerRect;\n if (scroller.getBoundingClientRect) {\n scrollerRect = scroller.getBoundingClientRect();\n } else {\n scrollerRect = {\n top: 0,\n bottom: scroller.innerHeight\n };\n }\n var scrollerHeight = scrollerRect.bottom - scrollerRect.top;\n /* istanbul ignore next */\n\n if (!scrollerHeight || isHidden(el)) {\n return false;\n }\n var isReachEdge = false;\n var placeholderRect = _this.$refs.placeholder.getBoundingClientRect();\n if (direction === 'up') {\n isReachEdge = scrollerRect.top - placeholderRect.top <= offset;\n } else {\n isReachEdge = placeholderRect.bottom - scrollerRect.bottom <= offset;\n }\n if (isReachEdge) {\n _this.innerLoading = true;\n _this.$emit('input', true);\n _this.$emit('load');\n }\n });\n },\n clickErrorText: function clickErrorText() {\n this.$emit('update:error', false);\n this.check();\n },\n genLoading: function genLoading() {\n var h = this.$createElement;\n if (this.innerLoading && !this.finished) {\n return h(\"div\", {\n \"key\": \"loading\",\n \"class\": bem('loading')\n }, [this.slots('loading') || h(Loading, {\n \"attrs\": {\n \"size\": \"16\"\n }\n }, [this.loadingText || t('loading')])]);\n }\n },\n genFinishedText: function genFinishedText() {\n var h = this.$createElement;\n if (this.finished) {\n var text = this.slots('finished') || this.finishedText;\n if (text) {\n return h(\"div\", {\n \"class\": bem('finished-text')\n }, [text]);\n }\n }\n },\n genErrorText: function genErrorText() {\n var h = this.$createElement;\n if (this.error) {\n var text = this.slots('error') || this.errorText;\n if (text) {\n return h(\"div\", {\n \"on\": {\n \"click\": this.clickErrorText\n },\n \"class\": bem('error-text')\n }, [text]);\n }\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n var Placeholder = h(\"div\", {\n \"ref\": \"placeholder\",\n \"key\": \"placeholder\",\n \"class\": bem('placeholder')\n });\n return h(\"div\", {\n \"class\": bem(),\n \"attrs\": {\n \"role\": \"feed\",\n \"aria-busy\": this.innerLoading\n }\n }, [this.direction === 'down' ? this.slots() : Placeholder, this.genLoading(), this.genFinishedText(), this.genErrorText(), this.direction === 'up' ? this.slots() : Placeholder]);\n }\n});","map":{"version":3,"names":["createNamespace","isHidden","getScroller","BindEventMixin","Loading","_createNamespace","createComponent","bem","t","mixins","bind","scroller","$el","check","model","prop","props","error","Boolean","loading","finished","errorText","String","loadingText","finishedText","immediateCheck","type","default","offset","Number","direction","data","innerLoading","updated","mounted","watch","methods","_this","$nextTick","el","scrollerRect","getBoundingClientRect","top","bottom","innerHeight","scrollerHeight","isReachEdge","placeholderRect","$refs","placeholder","$emit","clickErrorText","genLoading","h","$createElement","slots","genFinishedText","text","genErrorText","render","arguments","Placeholder"],"sources":["C:/Users/zhouxueli/Desktop/scheduling-app/node_modules/vant/es/list/index.js"],"sourcesContent":["// Utils\nimport { createNamespace } from '../utils';\nimport { isHidden } from '../utils/dom/style';\nimport { getScroller } from '../utils/dom/scroll'; // Mixins\n\nimport { BindEventMixin } from '../mixins/bind-event'; // Components\n\nimport Loading from '../loading';\n\nvar _createNamespace = createNamespace('list'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nexport default createComponent({\n mixins: [BindEventMixin(function (bind) {\n if (!this.scroller) {\n this.scroller = getScroller(this.$el);\n }\n\n bind(this.scroller, 'scroll', this.check);\n })],\n model: {\n prop: 'loading'\n },\n props: {\n error: Boolean,\n loading: Boolean,\n finished: Boolean,\n errorText: String,\n loadingText: String,\n finishedText: String,\n immediateCheck: {\n type: Boolean,\n default: true\n },\n offset: {\n type: [Number, String],\n default: 300\n },\n direction: {\n type: String,\n default: 'down'\n }\n },\n data: function data() {\n return {\n // use sync innerLoading state to avoid repeated loading in some edge cases\n innerLoading: this.loading\n };\n },\n updated: function updated() {\n this.innerLoading = this.loading;\n },\n mounted: function mounted() {\n if (this.immediateCheck) {\n this.check();\n }\n },\n watch: {\n loading: 'check',\n finished: 'check'\n },\n methods: {\n // @exposed-api\n check: function check() {\n var _this = this;\n\n this.$nextTick(function () {\n if (_this.innerLoading || _this.finished || _this.error) {\n return;\n }\n\n var el = _this.$el,\n scroller = _this.scroller,\n offset = _this.offset,\n direction = _this.direction;\n var scrollerRect;\n\n if (scroller.getBoundingClientRect) {\n scrollerRect = scroller.getBoundingClientRect();\n } else {\n scrollerRect = {\n top: 0,\n bottom: scroller.innerHeight\n };\n }\n\n var scrollerHeight = scrollerRect.bottom - scrollerRect.top;\n /* istanbul ignore next */\n\n if (!scrollerHeight || isHidden(el)) {\n return false;\n }\n\n var isReachEdge = false;\n\n var placeholderRect = _this.$refs.placeholder.getBoundingClientRect();\n\n if (direction === 'up') {\n isReachEdge = scrollerRect.top - placeholderRect.top <= offset;\n } else {\n isReachEdge = placeholderRect.bottom - scrollerRect.bottom <= offset;\n }\n\n if (isReachEdge) {\n _this.innerLoading = true;\n\n _this.$emit('input', true);\n\n _this.$emit('load');\n }\n });\n },\n clickErrorText: function clickErrorText() {\n this.$emit('update:error', false);\n this.check();\n },\n genLoading: function genLoading() {\n var h = this.$createElement;\n\n if (this.innerLoading && !this.finished) {\n return h(\"div\", {\n \"key\": \"loading\",\n \"class\": bem('loading')\n }, [this.slots('loading') || h(Loading, {\n \"attrs\": {\n \"size\": \"16\"\n }\n }, [this.loadingText || t('loading')])]);\n }\n },\n genFinishedText: function genFinishedText() {\n var h = this.$createElement;\n\n if (this.finished) {\n var text = this.slots('finished') || this.finishedText;\n\n if (text) {\n return h(\"div\", {\n \"class\": bem('finished-text')\n }, [text]);\n }\n }\n },\n genErrorText: function genErrorText() {\n var h = this.$createElement;\n\n if (this.error) {\n var text = this.slots('error') || this.errorText;\n\n if (text) {\n return h(\"div\", {\n \"on\": {\n \"click\": this.clickErrorText\n },\n \"class\": bem('error-text')\n }, [text]);\n }\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n var Placeholder = h(\"div\", {\n \"ref\": \"placeholder\",\n \"key\": \"placeholder\",\n \"class\": bem('placeholder')\n });\n return h(\"div\", {\n \"class\": bem(),\n \"attrs\": {\n \"role\": \"feed\",\n \"aria-busy\": this.innerLoading\n }\n }, [this.direction === 'down' ? this.slots() : Placeholder, this.genLoading(), this.genFinishedText(), this.genErrorText(), this.direction === 'up' ? this.slots() : Placeholder]);\n }\n});"],"mappings":"AAAA;AACA,SAASA,eAAe,QAAQ,UAAU;AAC1C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,WAAW,QAAQ,qBAAqB,CAAC,CAAC;;AAEnD,SAASC,cAAc,QAAQ,sBAAsB,CAAC,CAAC;;AAEvD,OAAOC,OAAO,MAAM,YAAY;AAEhC,IAAIC,gBAAgB,GAAGL,eAAe,CAAC,MAAM,CAAC;EAC1CM,eAAe,GAAGD,gBAAgB,CAAC,CAA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