xt-element-ui 2.2.3 → 2.2.4
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/README.md +140 -192
- package/docs/README.md +162 -88
- package/docs/components/base/theme.md +248 -0
- package/docs/components/base/xt-list.md +1 -1
- package/docs/components/base/xt-scroll-arrow.md +87 -1
- package/docs/components/base/xt-scroll.md +237 -0
- package/docs/components/utils/config.md +18 -4
- package/docs/components/utils/theme.md +280 -183
- package/lib/index.common.1.js +4 -26
- package/lib/index.common.2.js +1 -1
- package/lib/index.common.js +1871 -671
- package/lib/index.css +1 -1
- package/lib/index.umd.1.js +4 -26
- package/lib/index.umd.2.js +1 -1
- package/lib/index.umd.js +1871 -671
- package/lib/index.umd.min.1.js +1 -1
- package/lib/index.umd.min.js +1 -1
- package/lib/theme/element-overrides.css +607 -0
- package/lib/theme/element-vars.css +280 -0
- package/lib/xt-badge/xt-badge.common.js +1 -1
- package/lib/xt-badge/xt-badge.umd.js +1 -1
- package/lib/xt-button/xt-button.common.js +1 -1
- package/lib/xt-button/xt-button.umd.js +1 -1
- package/lib/xt-card/xt-card.common.js +1 -1
- package/lib/xt-card/xt-card.umd.js +1 -1
- package/lib/xt-card-item/xt-card-item.common.js +1 -1
- package/lib/xt-card-item/xt-card-item.umd.js +1 -1
- package/lib/xt-chart/xt-chart.common.js +5 -5
- package/lib/xt-chart/xt-chart.umd.js +5 -5
- package/lib/xt-config-provider/xt-config-provider.css +1 -1
- package/lib/xt-date-picker/xt-date-picker.common.1.js +4 -26
- package/lib/xt-date-picker/xt-date-picker.common.2.js +1 -1
- package/lib/xt-date-picker/xt-date-picker.common.js +1 -47
- package/lib/xt-date-picker/xt-date-picker.css +1 -1
- package/lib/xt-date-picker/xt-date-picker.umd.1.js +4 -26
- package/lib/xt-date-picker/xt-date-picker.umd.2.js +1 -1
- package/lib/xt-date-picker/xt-date-picker.umd.js +1 -47
- package/lib/xt-date-picker/xt-date-picker.umd.min.1.js +1 -1
- package/lib/xt-date-picker/xt-date-picker.umd.min.js +1 -1
- package/lib/xt-flex-box/xt-flex-box.common.js +1 -1
- package/lib/xt-flex-box/xt-flex-box.umd.js +1 -1
- package/lib/xt-flow/xt-flow.common.js +1 -1
- package/lib/xt-flow/xt-flow.umd.js +1 -1
- package/lib/xt-form-schema/xt-form-schema.common.js +1 -1
- package/lib/xt-form-schema/xt-form-schema.umd.js +1 -1
- package/lib/xt-grid-box/xt-grid-box.common.js +1 -1
- package/lib/xt-grid-box/xt-grid-box.umd.js +1 -1
- package/lib/xt-grid-item/xt-grid-item.common.js +1 -1
- package/lib/xt-grid-item/xt-grid-item.umd.js +1 -1
- package/lib/xt-icon/xt-icon.common.js +1 -1
- package/lib/xt-icon/xt-icon.umd.js +1 -1
- package/lib/xt-input/xt-input.common.js +1 -1
- package/lib/xt-input/xt-input.umd.js +1 -1
- package/lib/xt-list/xt-list.common.js +457 -118
- package/lib/xt-list/xt-list.css +1 -1
- package/lib/xt-list/xt-list.umd.js +457 -118
- package/lib/xt-list/xt-list.umd.min.js +1 -1
- package/lib/xt-map/xt-map.common.js +1 -1
- package/lib/xt-map/xt-map.umd.js +1 -1
- package/lib/xt-map-provider/xt-map-provider.common.js +1 -1
- package/lib/xt-map-provider/xt-map-provider.umd.js +1 -1
- package/lib/xt-page/xt-page.common.js +1 -1
- package/lib/xt-page/xt-page.umd.js +1 -1
- package/lib/xt-progress/xt-progress.common.js +1 -1
- package/lib/xt-progress/xt-progress.umd.js +1 -1
- package/lib/xt-scroll/demo.html +10 -0
- package/lib/xt-scroll/index.js +1 -0
- package/lib/xt-scroll/xt-scroll.common.js +551 -0
- package/lib/xt-scroll/xt-scroll.css +1 -0
- package/lib/xt-scroll/xt-scroll.umd.js +561 -0
- package/lib/xt-scroll/xt-scroll.umd.min.js +1 -0
- package/lib/xt-scroll-arrow/xt-scroll-arrow.common.js +591 -170
- package/lib/xt-scroll-arrow/xt-scroll-arrow.css +1 -1
- package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.js +591 -170
- package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.min.js +1 -1
- package/lib/xt-select-tree/xt-select-tree.common.js +1 -1
- package/lib/xt-select-tree/xt-select-tree.umd.js +1 -1
- package/lib/xt-step-price/xt-step-price.common.js +2 -2
- package/lib/xt-step-price/xt-step-price.umd.js +2 -2
- package/lib/xt-step-price-item/xt-step-price-item.common.js +1 -1
- package/lib/xt-step-price-item/xt-step-price-item.umd.js +1 -1
- package/lib/xt-tab-pane/xt-tab-pane.common.js +1 -1
- package/lib/xt-tab-pane/xt-tab-pane.umd.js +1 -1
- package/lib/xt-table/xt-table.common.js +2 -2
- package/lib/xt-table/xt-table.umd.js +2 -2
- package/lib/xt-tabs/xt-tabs.common.js +1 -1
- package/lib/xt-tabs/xt-tabs.umd.js +1 -1
- package/lib/xt-text/xt-text.common.js +1 -1
- package/lib/xt-text/xt-text.umd.js +1 -1
- package/lib/xt-time/xt-time.common.js +1 -1
- package/lib/xt-time/xt-time.umd.js +1 -1
- package/lib/xt-transfer-tree/xt-transfer-tree.common.js +1 -1
- package/lib/xt-transfer-tree/xt-transfer-tree.umd.js +1 -1
- package/lib/xt-upload/xt-upload.common.js +2 -2
- package/lib/xt-upload/xt-upload.umd.js +2 -2
- package/package.json +5 -3
- package/src/components/index.scss +3 -0
- package/src/components/theme/element-overrides.css +607 -0
- package/src/components/theme/element-vars.css +280 -0
- package/src/components/theme/iframe-injector.js +502 -0
- package/src/components/theme/index.js +64 -0
- package/src/components/xt-config-provider/style/index.scss +0 -11
- package/src/components/xt-date-picker/component/RangeDate.vue +1 -29
- package/src/components/xt-date-picker/style/index.scss +80 -53
- package/src/components/xt-list/index.vue +23 -12
- package/src/components/xt-scroll/index.js +9 -0
- package/src/components/xt-scroll/index.vue +363 -0
- package/src/components/xt-scroll/style/index.scss +107 -0
- package/src/components/xt-scroll-arrow/index.vue +200 -83
- package/src/components/xt-scroll-arrow/style/index.scss +16 -5
- package/src/index.js +9 -2
- package/src/utils/color.js +105 -0
- package/src/utils/index.js +456 -468
- package/src/utils/theme-vars.js +134 -0
- package/lib/css/1.87a493be.css +0 -1
- package/lib/xt-date-picker/css/1.87a493be.css +0 -1
|
@@ -96,18 +96,25 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
96
96
|
/************************************************************************/
|
|
97
97
|
/******/ ({
|
|
98
98
|
|
|
99
|
-
/***/ "
|
|
99
|
+
/***/ "3ae0":
|
|
100
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
101
|
+
|
|
102
|
+
// extracted by mini-css-extract-plugin
|
|
103
|
+
|
|
104
|
+
/***/ }),
|
|
105
|
+
|
|
106
|
+
/***/ "52fd":
|
|
100
107
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
101
108
|
|
|
102
109
|
"use strict";
|
|
103
|
-
/* harmony import */ var
|
|
104
|
-
/* harmony import */ var
|
|
110
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_084d1476_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("3ae0");
|
|
111
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_084d1476_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_084d1476_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
|
|
105
112
|
/* unused harmony reexport * */
|
|
106
113
|
|
|
107
114
|
|
|
108
115
|
/***/ }),
|
|
109
116
|
|
|
110
|
-
/***/ "
|
|
117
|
+
/***/ "f699":
|
|
111
118
|
/***/ (function(module, exports, __webpack_require__) {
|
|
112
119
|
|
|
113
120
|
// extracted by mini-css-extract-plugin
|
|
@@ -140,22 +147,447 @@ if (typeof window !== 'undefined') {
|
|
|
140
147
|
// Indicate to webpack that this file can be concatenated
|
|
141
148
|
/* harmony default export */ var setPublicPath = (null);
|
|
142
149
|
|
|
143
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
144
|
-
var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-list",class:{ 'xt-list--loading': _vm.loading }},[(_vm.title || _vm.filterable || _vm.sortable || _vm.$slots.toolbar)?_c('div',{staticClass:"xt-list__header"},[(_vm.title)?_c('span',{staticClass:"xt-list__title"},[_vm._v(_vm._s(_vm.title))]):_vm._e(),_c('div',{staticClass:"xt-list__toolbar"},[(_vm.filterable)?_c('div',{staticClass:"xt-list__search"},[_c('el-input',{attrs:{"placeholder":_vm.filterPlaceholder,"size":"small","clearable":"","prefix-icon":"el-icon-search"},on:{"input":_vm.handleSearch},model:{value:(_vm.searchText),callback:function ($$v) {_vm.searchText=$$v},expression:"searchText"}})],1):_vm._e(),(_vm.sortable && _vm.sortBy)?_c('el-button',{attrs:{"size":"small","icon":"el-icon-sort","type":_vm.currentSortOrder ? 'primary' : 'default',"plain":""},on:{"click":_vm.handleSortToggle}},[_vm._v(" "+_vm._s(_vm.sortLabel)+" ")]):_vm._e(),_vm._t("toolbar")],2)]):_vm._e(),_c('
|
|
150
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1d9e3ae5-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-list/index.vue?vue&type=template&id=084d1476&scoped=true
|
|
151
|
+
var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-list",class:{ 'xt-list--loading': _vm.loading }},[(_vm.title || _vm.filterable || _vm.sortable || _vm.$slots.toolbar)?_c('div',{staticClass:"xt-list__header"},[(_vm.title)?_c('span',{staticClass:"xt-list__title"},[_vm._v(_vm._s(_vm.title))]):_vm._e(),_c('div',{staticClass:"xt-list__toolbar"},[(_vm.filterable)?_c('div',{staticClass:"xt-list__search"},[_c('el-input',{attrs:{"placeholder":_vm.filterPlaceholder,"size":"small","clearable":"","prefix-icon":"el-icon-search"},on:{"input":_vm.handleSearch},model:{value:(_vm.searchText),callback:function ($$v) {_vm.searchText=$$v},expression:"searchText"}})],1):_vm._e(),(_vm.sortable && _vm.sortBy)?_c('el-button',{attrs:{"size":"small","icon":"el-icon-sort","type":_vm.currentSortOrder ? 'primary' : 'default',"plain":""},on:{"click":_vm.handleSortToggle}},[_vm._v(" "+_vm._s(_vm.sortLabel)+" ")]):_vm._e(),_vm._t("toolbar")],2)]):_vm._e(),_c('xt-scroll',{ref:"scrollContainer",class:['xt-list__body', { 'xt-list__body--virtual': _vm.virtualScroll }],style:(_vm.bodyStyle),on:{"scroll":_vm.onScroll}},[(_vm.virtualScroll)?_c('div',{staticClass:"xt-list__phantom",style:({ height: _vm.totalHeight + 'px' })},[_c('div',{style:({ paddingTop: _vm.offsetY + 'px' })},[(_vm.groupedData.length)?[_vm._l((_vm.visibleGroups),function(group,gIdx){return [_c('div',{key:group._key,staticClass:"xt-list__group"},[_c('div',{staticClass:"xt-list__group-title",on:{"click":function($event){return _vm.toggleGroup(group._key)}}},[_c('span',{staticClass:"xt-list__group-arrow",class:{ 'is-expanded': group._expanded }},[_c('i',{staticClass:"el-icon-arrow-right"})]),_vm._t("group-title",function(){return [_c('span',{staticClass:"xt-list__group-label"},[_vm._v(_vm._s(_vm.getGroupLabel(group)))]),_c('span',{staticClass:"xt-list__group-count"},[_vm._v("("+_vm._s(group._items.length)+")")])]},{"group":group,"items":group._items,"expanded":group._expanded})],2),(group._expanded)?_c('div',{class:['xt-list__cards', 'xt-list__cols-' + _vm.columns]},_vm._l((_vm.getVisibleItems(group)),function(item,idx){return _c('div',{key:item._id || idx,staticClass:"xt-list__item",on:{"click":function($event){return _vm.handleItemClick(item, group._key)}}},[_c('el-card',{attrs:{"shadow":_vm.shadow,"body-style":_vm.cardBodyStyle}},[_vm._t("default",function(){return [(_vm.getImage(item))?_c('div',{staticClass:"xt-list__image"},[_c('img',{attrs:{"src":_vm.getImage(item),"alt":_vm.getConfigValue(_vm.cardConfig.title, item)}})]):_vm._e(),(_vm.getTag(item))?_c('div',{staticClass:"xt-list__tag"},[_c('el-tag',{attrs:{"size":"small","type":_vm.getTagType(item)}},[_vm._v(_vm._s(_vm.getTag(item)))])],1):_vm._e(),(_vm.getConfigValue(_vm.cardConfig.title, item))?_c('div',{staticClass:"xt-list__card-title"},[_vm._v(" "+_vm._s(_vm.getConfigValue(_vm.cardConfig.title, item))+" ")]):_vm._e(),(_vm.getConfigValue(_vm.cardConfig.subtitle, item))?_c('div',{staticClass:"xt-list__card-subtitle"},[_vm._v(" "+_vm._s(_vm.getConfigValue(_vm.cardConfig.subtitle, item))+" ")]):_vm._e(),(_vm.getConfigValue(_vm.cardConfig.content, item))?_c('div',{staticClass:"xt-list__card-content"},[_vm._v(" "+_vm._s(_vm.getConfigValue(_vm.cardConfig.content, item))+" ")]):_vm._e(),(_vm.getConfigValue(_vm.cardConfig.footer, item))?_c('div',{staticClass:"xt-list__card-footer"},[_vm._t("card-footer",function(){return [_vm._v(" "+_vm._s(_vm.getConfigValue(_vm.cardConfig.footer, item))+" ")]},{"item":item,"index":_vm.getItemIndex(item, group)})],2):_vm._e()]},{"item":item,"index":_vm.getItemIndex(item, group),"group":group})],2)],1)}),0):_vm._e()])]})]:(!_vm.loading)?_c('div',{staticClass:"xt-list__empty"},[_vm._t("empty",function(){return [_c('span',[_vm._v(_vm._s(_vm.emptyText))])]})],2):_vm._e()],2)]):(_vm.groupedData.length)?[_vm._l((_vm.groupedData),function(group){return [_c('div',{key:group._key,staticClass:"xt-list__group"},[_c('div',{staticClass:"xt-list__group-title",on:{"click":function($event){return _vm.toggleGroup(group._key)}}},[_c('span',{staticClass:"xt-list__group-arrow",class:{ 'is-expanded': group._expanded }},[_c('i',{staticClass:"el-icon-arrow-right"})]),_vm._t("group-title",function(){return [_c('span',{staticClass:"xt-list__group-label"},[_vm._v(_vm._s(_vm.getGroupLabel(group)))]),_c('span',{staticClass:"xt-list__group-count"},[_vm._v("("+_vm._s(group._items.length)+")")])]},{"group":group,"items":group._items,"expanded":group._expanded})],2),(group._expanded)?_c('div',{class:['xt-list__cards', 'xt-list__cols-' + _vm.columns]},_vm._l((group._items),function(item,idx){return _c('div',{key:item._id || idx,staticClass:"xt-list__item",on:{"click":function($event){return _vm.handleItemClick(item, group._key)}}},[_c('el-card',{attrs:{"shadow":_vm.shadow,"body-style":_vm.cardBodyStyle}},[_vm._t("default",function(){return [(_vm.getImage(item))?_c('div',{staticClass:"xt-list__image"},[_c('img',{attrs:{"src":_vm.getImage(item),"alt":_vm.getConfigValue(_vm.cardConfig.title, item)}})]):_vm._e(),(_vm.getTag(item))?_c('div',{staticClass:"xt-list__tag"},[_c('el-tag',{attrs:{"size":"small","type":_vm.getTagType(item)}},[_vm._v(_vm._s(_vm.getTag(item)))])],1):_vm._e(),(_vm.getConfigValue(_vm.cardConfig.title, item))?_c('div',{staticClass:"xt-list__card-title"},[_vm._v(" "+_vm._s(_vm.getConfigValue(_vm.cardConfig.title, item))+" ")]):_vm._e(),(_vm.getConfigValue(_vm.cardConfig.subtitle, item))?_c('div',{staticClass:"xt-list__card-subtitle"},[_vm._v(" "+_vm._s(_vm.getConfigValue(_vm.cardConfig.subtitle, item))+" ")]):_vm._e(),(_vm.getConfigValue(_vm.cardConfig.content, item))?_c('div',{staticClass:"xt-list__card-content"},[_vm._v(" "+_vm._s(_vm.getConfigValue(_vm.cardConfig.content, item))+" ")]):_vm._e(),(_vm.getConfigValue(_vm.cardConfig.footer, item))?_c('div',{staticClass:"xt-list__card-footer"},[_vm._t("card-footer",function(){return [_vm._v(" "+_vm._s(_vm.getConfigValue(_vm.cardConfig.footer, item))+" ")]},{"item":item,"index":idx})],2):_vm._e()]},{"item":item,"index":idx,"group":group})],2)],1)}),0):_vm._e()])]})]:(!_vm.loading)?_c('div',{staticClass:"xt-list__empty"},[_vm._t("empty",function(){return [_c('span',[_vm._v(_vm._s(_vm.emptyText))])]})],2):_vm._e(),(_vm.loadMore && _vm.hasMore && !_vm.loading)?_c('div',{staticClass:"xt-list__loadmore"},[_c('el-button',{attrs:{"type":"text","loading":_vm.loadMoreLoading},on:{"click":_vm.handleLoadMore}},[_vm._v(" "+_vm._s(_vm.loadMoreText)+" ")])],1):_vm._e()],2),(_vm.loading)?_c('div',{staticClass:"xt-list__loading"},[_vm._t("loading",function(){return [_c('i',{staticClass:"el-icon-loading"}),_c('span',[_vm._v("加载中...")])]})],2):_vm._e(),(_vm.showPagination)?_c('div',{staticClass:"xt-list__footer"},[_c('el-pagination',{attrs:{"background":"","small":"","current-page":_vm.pagination.pageNum,"page-size":_vm.pagination.pageSize,"total":_vm.total,"page-sizes":_vm.pagination.pageSizes || [10, 20, 50],"layout":"total, prev, pager, next"},on:{"size-change":_vm.handleSizeChange,"current-change":_vm.handleCurrentChange}})],1):_vm._e()],1)
|
|
145
152
|
}
|
|
146
153
|
var staticRenderFns = []
|
|
147
154
|
|
|
148
155
|
|
|
149
|
-
// CONCATENATED MODULE: ./src/components/xt-list/index.vue?vue&type=template&id=
|
|
156
|
+
// CONCATENATED MODULE: ./src/components/xt-list/index.vue?vue&type=template&id=084d1476&scoped=true
|
|
157
|
+
|
|
158
|
+
// EXTERNAL MODULE: ./src/components/xt-scroll/style/index.scss
|
|
159
|
+
var style = __webpack_require__("f699");
|
|
160
|
+
|
|
161
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1d9e3ae5-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-scroll/index.vue?vue&type=template&id=74170e40
|
|
162
|
+
var xt_scrollvue_type_template_id_74170e40_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-scroll",class:[`xt-scroll--${_vm.scrollDirection}`],style:(_vm.containerStyle)},[_c('div',{ref:"scrollWrap",staticClass:"xt-scroll__wrap",class:[`xt-scroll__wrap--${_vm.scrollDirection}`],on:{"scroll":_vm.onScroll}},[(_vm.vScroll)?_c('div',{staticClass:"xt-scroll__virtual",style:(_vm.virtualWrapperStyle)},[(_vm.scrollDirection === 'vertical')?_c('div',{staticClass:"xt-scroll__phantom",style:({ height: _vm.totalSize + 'px' })},[_c('div',{style:({ transform: `translateY(${_vm.offsetStart}px)` })},[_vm._l((_vm.visibleData),function(item,index){return [_c('div',{key:_vm.getItemKey(item, index),staticClass:"xt-scroll__item",class:_vm.itemClassName,style:(_vm.itemStyle)},[_vm._t("item",function(){return [_vm._v(" "+_vm._s(item)+" ")]},{"item":item,"index":_vm.getOriginalIndex(index)})],2)]})],2)]):(_vm.scrollDirection === 'horizontal')?_c('div',{staticClass:"xt-scroll__phantom",style:({ width: _vm.totalSize + 'px' })},[_c('div',{style:({ transform: `translateX(${_vm.offsetStart}px)` })},[_vm._l((_vm.visibleData),function(item,index){return [_c('div',{key:_vm.getItemKey(item, index),staticClass:"xt-scroll__item",class:_vm.itemClassName,style:(_vm.itemStyle)},[_vm._t("item",function(){return [_vm._v(" "+_vm._s(item)+" ")]},{"item":item,"index":_vm.getOriginalIndex(index)})],2)]})],2)]):_vm._e()]):_vm._e(),(_vm.vScroll && (!_vm.data || !_vm.data.length) && !_vm.loading)?_c('div',{staticClass:"xt-scroll__empty"},[_vm._t("empty",function(){return [_c('span',[_vm._v(_vm._s(_vm.emptyText))])]})],2):_vm._e(),(_vm.loading)?_c('div',{staticClass:"xt-scroll__loading"},[_vm._t("loading",function(){return [_c('i',{staticClass:"el-icon-loading"}),_c('span',[_vm._v("加载中...")])]})],2):_vm._e(),(!_vm.vScroll)?_c('div',{staticClass:"xt-scroll__default"},[_vm._t("default")],2):_vm._e(),(_vm.vScroll && _vm.showLoadMore && !_vm.loading)?_c('div',{staticClass:"xt-scroll__loadmore",on:{"click":_vm.onLoadMore}},[_c('el-button',{attrs:{"type":"text","loading":_vm.loadMoreLoading}},[_vm._v(" "+_vm._s(_vm.loadMoreText)+" ")])],1):_vm._e()])])
|
|
163
|
+
}
|
|
164
|
+
var xt_scrollvue_type_template_id_74170e40_staticRenderFns = []
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
// CONCATENATED MODULE: ./src/components/xt-scroll/index.vue?vue&type=template&id=74170e40
|
|
168
|
+
|
|
169
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-scroll/index.vue?vue&type=script&lang=js
|
|
170
|
+
|
|
171
|
+
/* harmony default export */ var xt_scrollvue_type_script_lang_js = ({
|
|
172
|
+
name: 'XtScroll',
|
|
173
|
+
|
|
174
|
+
props: {
|
|
175
|
+
// ========== 虚拟滚动配置 ==========
|
|
176
|
+
/** 是否启用虚拟滚动 */
|
|
177
|
+
vScroll: { type: Boolean, default: false },
|
|
178
|
+
/** 数据源 */
|
|
179
|
+
data: { type: Array, default: () => [] },
|
|
180
|
+
/** 每个 item 的固定尺寸(px),纵向为高度,横向为宽度 */
|
|
181
|
+
itemSize: { type: Number, default: 50 },
|
|
182
|
+
/** item 的唯一键字段名 */
|
|
183
|
+
keyField: { type: String, default: 'id' },
|
|
184
|
+
/** 预渲染缓冲区大小(item 数量) */
|
|
185
|
+
bufferSize: { type: Number, default: 5 },
|
|
186
|
+
/** 虚拟滚动方向 */
|
|
187
|
+
scrollDirection: {
|
|
188
|
+
type: String,
|
|
189
|
+
default: 'vertical',
|
|
190
|
+
validator: (v) => ['vertical', 'horizontal'].includes(v)
|
|
191
|
+
},
|
|
192
|
+
/** item 的自定义 CSS 类名 */
|
|
193
|
+
itemClassName: { type: String, default: '' },
|
|
194
|
+
|
|
195
|
+
// ========== 容器尺寸 ==========
|
|
196
|
+
height: { type: [Number, String], default: '' },
|
|
197
|
+
maxHeight: { type: [Number, String], default: '' },
|
|
198
|
+
width: { type: [Number, String], default: '' },
|
|
199
|
+
maxWidth: { type: [Number, String], default: '' },
|
|
200
|
+
|
|
201
|
+
// ========== 状态 ==========
|
|
202
|
+
loading: { type: Boolean, default: false },
|
|
203
|
+
emptyText: { type: String, default: '暂无数据' },
|
|
204
|
+
|
|
205
|
+
// ========== 加载更多 ==========
|
|
206
|
+
loadMore: { type: Boolean, default: false },
|
|
207
|
+
loadMoreText: { type: String, default: '加载更多' },
|
|
208
|
+
loadMoreLoading: { type: Boolean, default: false }
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
data() {
|
|
212
|
+
return {
|
|
213
|
+
scrollPos: 0,
|
|
214
|
+
containerSize: 0,
|
|
215
|
+
resizeObserver: null,
|
|
216
|
+
rafId: null
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
computed: {
|
|
221
|
+
containerStyle() {
|
|
222
|
+
const style = {}
|
|
223
|
+
if (this.height) {
|
|
224
|
+
style.height = typeof this.height === 'number' ? this.height + 'px' : this.height
|
|
225
|
+
}
|
|
226
|
+
if (this.maxHeight) {
|
|
227
|
+
style.maxHeight = typeof this.maxHeight === 'number' ? this.maxHeight + 'px' : this.maxHeight
|
|
228
|
+
}
|
|
229
|
+
if (this.width) {
|
|
230
|
+
style.width = typeof this.width === 'number' ? this.width + 'px' : this.width
|
|
231
|
+
}
|
|
232
|
+
if (this.maxWidth) {
|
|
233
|
+
style.maxWidth = typeof this.maxWidth === 'number' ? this.maxWidth + 'px' : this.maxWidth
|
|
234
|
+
}
|
|
235
|
+
return style
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
virtualWrapperStyle() {
|
|
239
|
+
const style = {}
|
|
240
|
+
if (this.scrollDirection === 'horizontal') {
|
|
241
|
+
style.height = '100%'
|
|
242
|
+
}
|
|
243
|
+
return style
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
itemStyle() {
|
|
247
|
+
return this.scrollDirection === 'vertical'
|
|
248
|
+
? { height: this.itemSize + 'px' }
|
|
249
|
+
: { width: this.itemSize + 'px', display: 'inline-block' }
|
|
250
|
+
},
|
|
251
|
+
|
|
252
|
+
/** 数据总条数 */
|
|
253
|
+
dataCount() {
|
|
254
|
+
return (this.data && this.data.length) || 0
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
/** 总滚动尺寸 */
|
|
258
|
+
totalSize() {
|
|
259
|
+
return this.dataCount * this.itemSize
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
/** 虚拟滚动:可见范围起始索引 */
|
|
263
|
+
visibleStartIndex() {
|
|
264
|
+
if (!this.vScroll) return 0
|
|
265
|
+
const start = Math.floor(this.scrollPos / this.itemSize)
|
|
266
|
+
return Math.max(0, start - this.bufferSize)
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
/** 虚拟滚动:可见范围结束索引 */
|
|
270
|
+
visibleEndIndex() {
|
|
271
|
+
if (!this.vScroll) return this.dataCount
|
|
272
|
+
const visibleCount = Math.ceil(this.containerSize / this.itemSize)
|
|
273
|
+
const end = Math.ceil(this.scrollPos / this.itemSize) + visibleCount
|
|
274
|
+
return Math.min(this.dataCount, end + this.bufferSize)
|
|
275
|
+
},
|
|
276
|
+
|
|
277
|
+
/** 可见数据 */
|
|
278
|
+
visibleData() {
|
|
279
|
+
if (!this.vScroll || !this.data) return this.data || []
|
|
280
|
+
return this.data.slice(this.visibleStartIndex, this.visibleEndIndex)
|
|
281
|
+
},
|
|
282
|
+
|
|
283
|
+
/** 偏移量(px) */
|
|
284
|
+
offsetStart() {
|
|
285
|
+
return this.visibleStartIndex * this.itemSize
|
|
286
|
+
},
|
|
287
|
+
|
|
288
|
+
/** 是否显示加载更多 */
|
|
289
|
+
showLoadMore() {
|
|
290
|
+
if (!this.loadMore || !this.dataCount) return false
|
|
291
|
+
if (this.scrollDirection === 'vertical') {
|
|
292
|
+
return this.scrollPos + this.containerSize >= this.totalSize - this.itemSize * 2
|
|
293
|
+
}
|
|
294
|
+
return false
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
|
|
298
|
+
watch: {
|
|
299
|
+
data: {
|
|
300
|
+
handler() {
|
|
301
|
+
this.$nextTick(() => {
|
|
302
|
+
this.updateContainerSize()
|
|
303
|
+
})
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
vScroll(val) {
|
|
307
|
+
if (val) {
|
|
308
|
+
this.$nextTick(() => {
|
|
309
|
+
this.updateContainerSize()
|
|
310
|
+
this.bindResizeObserver()
|
|
311
|
+
})
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
|
|
316
|
+
mounted() {
|
|
317
|
+
this.$nextTick(() => {
|
|
318
|
+
this.updateContainerSize()
|
|
319
|
+
if (this.vScroll) {
|
|
320
|
+
this.bindResizeObserver()
|
|
321
|
+
}
|
|
322
|
+
})
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
beforeDestroy() {
|
|
326
|
+
this.unbindResizeObserver()
|
|
327
|
+
if (this.rafId && typeof cancelAnimationFrame !== 'undefined') {
|
|
328
|
+
cancelAnimationFrame(this.rafId)
|
|
329
|
+
this.rafId = null
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
methods: {
|
|
334
|
+
// ========== 虚拟滚动 ==========
|
|
335
|
+
onScroll() {
|
|
336
|
+
const wrap = this.$refs.scrollWrap
|
|
337
|
+
if (!wrap) return
|
|
338
|
+
|
|
339
|
+
const pos = this.scrollDirection === 'vertical' ? wrap.scrollTop : wrap.scrollLeft
|
|
340
|
+
this.scrollPos = pos
|
|
341
|
+
|
|
342
|
+
// 对外 emit scroll 事件,传递 scrollTop/scrollLeft 方便父组件使用
|
|
343
|
+
this.$emit('scroll', {
|
|
344
|
+
scrollTop: wrap.scrollTop,
|
|
345
|
+
scrollLeft: wrap.scrollLeft
|
|
346
|
+
})
|
|
347
|
+
|
|
348
|
+
if (this.rafId) return
|
|
349
|
+
if (typeof requestAnimationFrame === 'undefined') return
|
|
350
|
+
this.rafId = requestAnimationFrame(() => {
|
|
351
|
+
this.$forceUpdate()
|
|
352
|
+
this.rafId = null
|
|
353
|
+
})
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
getItemKey(item, index) {
|
|
357
|
+
if (item && typeof item === 'object' && this.keyField && item[this.keyField] != null) {
|
|
358
|
+
return item[this.keyField]
|
|
359
|
+
}
|
|
360
|
+
return `vitem_${this.visibleStartIndex + index}`
|
|
361
|
+
},
|
|
362
|
+
|
|
363
|
+
getOriginalIndex(index) {
|
|
364
|
+
return this.visibleStartIndex + index
|
|
365
|
+
},
|
|
366
|
+
|
|
367
|
+
// ========== 容器尺寸 ==========
|
|
368
|
+
updateContainerSize() {
|
|
369
|
+
const wrap = this.$refs.scrollWrap
|
|
370
|
+
if (!wrap) return
|
|
371
|
+
|
|
372
|
+
this.containerSize = this.scrollDirection === 'vertical'
|
|
373
|
+
? wrap.clientHeight
|
|
374
|
+
: wrap.clientWidth
|
|
375
|
+
},
|
|
376
|
+
|
|
377
|
+
bindResizeObserver() {
|
|
378
|
+
if (typeof ResizeObserver === 'undefined') return
|
|
379
|
+
this.unbindResizeObserver()
|
|
380
|
+
|
|
381
|
+
const wrap = this.$refs.scrollWrap
|
|
382
|
+
if (!wrap) return
|
|
383
|
+
|
|
384
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
385
|
+
this.updateContainerSize()
|
|
386
|
+
})
|
|
387
|
+
this.resizeObserver.observe(wrap)
|
|
388
|
+
},
|
|
389
|
+
|
|
390
|
+
unbindResizeObserver() {
|
|
391
|
+
if (this.resizeObserver) {
|
|
392
|
+
this.resizeObserver.disconnect()
|
|
393
|
+
this.resizeObserver = null
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
|
|
397
|
+
// ========== 加载更多 ==========
|
|
398
|
+
onLoadMore() {
|
|
399
|
+
this.$emit('load-more')
|
|
400
|
+
},
|
|
401
|
+
|
|
402
|
+
// ========== 对外暴露方法 ==========
|
|
403
|
+
/** 获取原生滚动容器 DOM 元素 */
|
|
404
|
+
getScrollContainer() {
|
|
405
|
+
return this.$refs.scrollWrap
|
|
406
|
+
},
|
|
407
|
+
|
|
408
|
+
/** 滚动到指定位置 */
|
|
409
|
+
scrollTo(pos, behavior) {
|
|
410
|
+
const wrap = this.$refs.scrollWrap
|
|
411
|
+
if (!wrap) return
|
|
412
|
+
|
|
413
|
+
const opts = behavior && typeof behavior === 'string'
|
|
414
|
+
? { behavior }
|
|
415
|
+
: { behavior: 'smooth' }
|
|
416
|
+
|
|
417
|
+
if (this.scrollDirection === 'vertical') {
|
|
418
|
+
wrap.scrollTo({ top: pos, ...opts })
|
|
419
|
+
} else {
|
|
420
|
+
wrap.scrollTo({ left: pos, ...opts })
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
|
|
424
|
+
/** 滚动到指定索引的 item */
|
|
425
|
+
scrollToItem(index) {
|
|
426
|
+
const pos = index * this.itemSize
|
|
427
|
+
this.scrollTo(pos)
|
|
428
|
+
},
|
|
429
|
+
|
|
430
|
+
/** 滚动到顶部/左侧 */
|
|
431
|
+
scrollToStart() {
|
|
432
|
+
this.scrollTo(0)
|
|
433
|
+
},
|
|
434
|
+
|
|
435
|
+
/** 滚动到底部/右侧 */
|
|
436
|
+
scrollToEnd() {
|
|
437
|
+
this.scrollTo(this.totalSize)
|
|
438
|
+
},
|
|
439
|
+
|
|
440
|
+
/** 获取当前滚动位置 */
|
|
441
|
+
getScrollPos() {
|
|
442
|
+
return this.scrollPos
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
// CONCATENATED MODULE: ./src/components/xt-scroll/index.vue?vue&type=script&lang=js
|
|
448
|
+
/* harmony default export */ var components_xt_scrollvue_type_script_lang_js = (xt_scrollvue_type_script_lang_js);
|
|
449
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
450
|
+
/* globals __VUE_SSR_CONTEXT__ */
|
|
451
|
+
|
|
452
|
+
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
453
|
+
// This module is a runtime utility for cleaner component module output and will
|
|
454
|
+
// be included in the final webpack user bundle.
|
|
455
|
+
|
|
456
|
+
function normalizeComponent(
|
|
457
|
+
scriptExports,
|
|
458
|
+
render,
|
|
459
|
+
staticRenderFns,
|
|
460
|
+
functionalTemplate,
|
|
461
|
+
injectStyles,
|
|
462
|
+
scopeId,
|
|
463
|
+
moduleIdentifier /* server only */,
|
|
464
|
+
shadowMode /* vue-cli only */
|
|
465
|
+
) {
|
|
466
|
+
// Vue.extend constructor export interop
|
|
467
|
+
var options =
|
|
468
|
+
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
469
|
+
|
|
470
|
+
// render functions
|
|
471
|
+
if (render) {
|
|
472
|
+
options.render = render
|
|
473
|
+
options.staticRenderFns = staticRenderFns
|
|
474
|
+
options._compiled = true
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// functional template
|
|
478
|
+
if (functionalTemplate) {
|
|
479
|
+
options.functional = true
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// scopedId
|
|
483
|
+
if (scopeId) {
|
|
484
|
+
options._scopeId = 'data-v-' + scopeId
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
var hook
|
|
488
|
+
if (moduleIdentifier) {
|
|
489
|
+
// server build
|
|
490
|
+
hook = function (context) {
|
|
491
|
+
// 2.3 injection
|
|
492
|
+
context =
|
|
493
|
+
context || // cached call
|
|
494
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
495
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
496
|
+
// 2.2 with runInNewContext: true
|
|
497
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
498
|
+
context = __VUE_SSR_CONTEXT__
|
|
499
|
+
}
|
|
500
|
+
// inject component styles
|
|
501
|
+
if (injectStyles) {
|
|
502
|
+
injectStyles.call(this, context)
|
|
503
|
+
}
|
|
504
|
+
// register component module identifier for async chunk inferrence
|
|
505
|
+
if (context && context._registeredComponents) {
|
|
506
|
+
context._registeredComponents.add(moduleIdentifier)
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
// used by ssr in case component is cached and beforeCreate
|
|
510
|
+
// never gets called
|
|
511
|
+
options._ssrRegister = hook
|
|
512
|
+
} else if (injectStyles) {
|
|
513
|
+
hook = shadowMode
|
|
514
|
+
? function () {
|
|
515
|
+
injectStyles.call(
|
|
516
|
+
this,
|
|
517
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
518
|
+
)
|
|
519
|
+
}
|
|
520
|
+
: injectStyles
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
if (hook) {
|
|
524
|
+
if (options.functional) {
|
|
525
|
+
// for template-only hot-reload because in that case the render fn doesn't
|
|
526
|
+
// go through the normalizer
|
|
527
|
+
options._injectStyles = hook
|
|
528
|
+
// register for functional component in vue file
|
|
529
|
+
var originalRender = options.render
|
|
530
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
531
|
+
hook.call(context)
|
|
532
|
+
return originalRender(h, context)
|
|
533
|
+
}
|
|
534
|
+
} else {
|
|
535
|
+
// inject component registration as beforeCreate hook
|
|
536
|
+
var existing = options.beforeCreate
|
|
537
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
return {
|
|
542
|
+
exports: scriptExports,
|
|
543
|
+
options: options
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// CONCATENATED MODULE: ./src/components/xt-scroll/index.vue
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
/* normalize component */
|
|
554
|
+
|
|
555
|
+
var component = normalizeComponent(
|
|
556
|
+
components_xt_scrollvue_type_script_lang_js,
|
|
557
|
+
xt_scrollvue_type_template_id_74170e40_render,
|
|
558
|
+
xt_scrollvue_type_template_id_74170e40_staticRenderFns,
|
|
559
|
+
false,
|
|
560
|
+
null,
|
|
561
|
+
null,
|
|
562
|
+
null
|
|
563
|
+
|
|
564
|
+
)
|
|
565
|
+
|
|
566
|
+
/* harmony default export */ var xt_scroll = (component.exports);
|
|
567
|
+
// CONCATENATED MODULE: ./src/components/xt-scroll/index.js
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
xt_scroll.install = function (Vue) {
|
|
572
|
+
Vue.component(xt_scroll.name, xt_scroll)
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/* harmony default export */ var components_xt_scroll = (xt_scroll);
|
|
150
576
|
|
|
151
577
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-list/index.vue?vue&type=script&lang=js
|
|
152
578
|
|
|
579
|
+
|
|
580
|
+
|
|
153
581
|
const CARD_ITEM_HEIGHT = 160
|
|
154
582
|
const GROUP_HEADER_HEIGHT = 44
|
|
155
583
|
|
|
156
584
|
/* harmony default export */ var xt_listvue_type_script_lang_js = ({
|
|
157
585
|
name: 'XtList',
|
|
158
586
|
|
|
587
|
+
components: {
|
|
588
|
+
XtScroll: components_xt_scroll
|
|
589
|
+
},
|
|
590
|
+
|
|
159
591
|
props: {
|
|
160
592
|
data: { type: Array, default: () => [] },
|
|
161
593
|
// 分组配置
|
|
@@ -485,9 +917,10 @@ const GROUP_HEADER_HEIGHT = 44
|
|
|
485
917
|
return group._items.indexOf(item)
|
|
486
918
|
},
|
|
487
919
|
|
|
488
|
-
onScroll() {
|
|
920
|
+
onScroll(e) {
|
|
489
921
|
if (!this.virtualScroll) return
|
|
490
|
-
|
|
922
|
+
// xt-scroll 传递的是 { scrollTop, scrollLeft } 对象
|
|
923
|
+
this.scrollTop = e && e.scrollTop != null ? e.scrollTop : 0
|
|
491
924
|
if (this.rafId) return
|
|
492
925
|
if (typeof requestAnimationFrame === 'undefined') return
|
|
493
926
|
this.rafId = requestAnimationFrame(() => {
|
|
@@ -498,18 +931,22 @@ const GROUP_HEADER_HEIGHT = 44
|
|
|
498
931
|
|
|
499
932
|
updateContainerHeight() {
|
|
500
933
|
if (this.$refs.scrollContainer) {
|
|
501
|
-
|
|
934
|
+
const scrollCmp = this.$refs.scrollContainer
|
|
935
|
+
const wrap = scrollCmp.getScrollContainer && scrollCmp.getScrollContainer()
|
|
936
|
+
this.containerHeight = wrap ? wrap.clientHeight : 0
|
|
502
937
|
}
|
|
503
938
|
},
|
|
504
939
|
|
|
505
940
|
bindResizeObserver() {
|
|
506
941
|
if (typeof ResizeObserver === 'undefined') return
|
|
507
|
-
const
|
|
508
|
-
if (!
|
|
942
|
+
const scrollCmp = this.$refs.scrollContainer
|
|
943
|
+
if (!scrollCmp) return
|
|
944
|
+
const wrap = scrollCmp.getScrollContainer && scrollCmp.getScrollContainer()
|
|
945
|
+
if (!wrap) return
|
|
509
946
|
this.resizeObserver = new ResizeObserver(() => {
|
|
510
947
|
this.updateContainerHeight()
|
|
511
948
|
})
|
|
512
|
-
this.resizeObserver.observe(
|
|
949
|
+
this.resizeObserver.observe(wrap)
|
|
513
950
|
},
|
|
514
951
|
|
|
515
952
|
unbindResizeObserver() {
|
|
@@ -549,8 +986,8 @@ const GROUP_HEADER_HEIGHT = 44
|
|
|
549
986
|
|
|
550
987
|
// ========== 对外暴露方法 ==========
|
|
551
988
|
scrollToTop() {
|
|
552
|
-
if (this.$refs.scrollContainer) {
|
|
553
|
-
this.$refs.scrollContainer.
|
|
989
|
+
if (this.$refs.scrollContainer && this.$refs.scrollContainer.scrollToStart) {
|
|
990
|
+
this.$refs.scrollContainer.scrollToStart()
|
|
554
991
|
}
|
|
555
992
|
},
|
|
556
993
|
|
|
@@ -580,106 +1017,8 @@ const GROUP_HEADER_HEIGHT = 44
|
|
|
580
1017
|
|
|
581
1018
|
// CONCATENATED MODULE: ./src/components/xt-list/index.vue?vue&type=script&lang=js
|
|
582
1019
|
/* harmony default export */ var components_xt_listvue_type_script_lang_js = (xt_listvue_type_script_lang_js);
|
|
583
|
-
// EXTERNAL MODULE: ./src/components/xt-list/index.vue?vue&type=style&index=0&id=
|
|
584
|
-
var
|
|
585
|
-
|
|
586
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
587
|
-
/* globals __VUE_SSR_CONTEXT__ */
|
|
588
|
-
|
|
589
|
-
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
590
|
-
// This module is a runtime utility for cleaner component module output and will
|
|
591
|
-
// be included in the final webpack user bundle.
|
|
592
|
-
|
|
593
|
-
function normalizeComponent(
|
|
594
|
-
scriptExports,
|
|
595
|
-
render,
|
|
596
|
-
staticRenderFns,
|
|
597
|
-
functionalTemplate,
|
|
598
|
-
injectStyles,
|
|
599
|
-
scopeId,
|
|
600
|
-
moduleIdentifier /* server only */,
|
|
601
|
-
shadowMode /* vue-cli only */
|
|
602
|
-
) {
|
|
603
|
-
// Vue.extend constructor export interop
|
|
604
|
-
var options =
|
|
605
|
-
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
606
|
-
|
|
607
|
-
// render functions
|
|
608
|
-
if (render) {
|
|
609
|
-
options.render = render
|
|
610
|
-
options.staticRenderFns = staticRenderFns
|
|
611
|
-
options._compiled = true
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
// functional template
|
|
615
|
-
if (functionalTemplate) {
|
|
616
|
-
options.functional = true
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
// scopedId
|
|
620
|
-
if (scopeId) {
|
|
621
|
-
options._scopeId = 'data-v-' + scopeId
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
var hook
|
|
625
|
-
if (moduleIdentifier) {
|
|
626
|
-
// server build
|
|
627
|
-
hook = function (context) {
|
|
628
|
-
// 2.3 injection
|
|
629
|
-
context =
|
|
630
|
-
context || // cached call
|
|
631
|
-
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
632
|
-
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
633
|
-
// 2.2 with runInNewContext: true
|
|
634
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
635
|
-
context = __VUE_SSR_CONTEXT__
|
|
636
|
-
}
|
|
637
|
-
// inject component styles
|
|
638
|
-
if (injectStyles) {
|
|
639
|
-
injectStyles.call(this, context)
|
|
640
|
-
}
|
|
641
|
-
// register component module identifier for async chunk inferrence
|
|
642
|
-
if (context && context._registeredComponents) {
|
|
643
|
-
context._registeredComponents.add(moduleIdentifier)
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
// used by ssr in case component is cached and beforeCreate
|
|
647
|
-
// never gets called
|
|
648
|
-
options._ssrRegister = hook
|
|
649
|
-
} else if (injectStyles) {
|
|
650
|
-
hook = shadowMode
|
|
651
|
-
? function () {
|
|
652
|
-
injectStyles.call(
|
|
653
|
-
this,
|
|
654
|
-
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
655
|
-
)
|
|
656
|
-
}
|
|
657
|
-
: injectStyles
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
if (hook) {
|
|
661
|
-
if (options.functional) {
|
|
662
|
-
// for template-only hot-reload because in that case the render fn doesn't
|
|
663
|
-
// go through the normalizer
|
|
664
|
-
options._injectStyles = hook
|
|
665
|
-
// register for functional component in vue file
|
|
666
|
-
var originalRender = options.render
|
|
667
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
668
|
-
hook.call(context)
|
|
669
|
-
return originalRender(h, context)
|
|
670
|
-
}
|
|
671
|
-
} else {
|
|
672
|
-
// inject component registration as beforeCreate hook
|
|
673
|
-
var existing = options.beforeCreate
|
|
674
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
return {
|
|
679
|
-
exports: scriptExports,
|
|
680
|
-
options: options
|
|
681
|
-
}
|
|
682
|
-
}
|
|
1020
|
+
// EXTERNAL MODULE: ./src/components/xt-list/index.vue?vue&type=style&index=0&id=084d1476&prod&scoped=true&lang=css
|
|
1021
|
+
var xt_listvue_type_style_index_0_id_084d1476_prod_scoped_true_lang_css = __webpack_require__("52fd");
|
|
683
1022
|
|
|
684
1023
|
// CONCATENATED MODULE: ./src/components/xt-list/index.vue
|
|
685
1024
|
|
|
@@ -690,18 +1029,18 @@ function normalizeComponent(
|
|
|
690
1029
|
|
|
691
1030
|
/* normalize component */
|
|
692
1031
|
|
|
693
|
-
var
|
|
1032
|
+
var xt_list_component = normalizeComponent(
|
|
694
1033
|
components_xt_listvue_type_script_lang_js,
|
|
695
1034
|
render,
|
|
696
1035
|
staticRenderFns,
|
|
697
1036
|
false,
|
|
698
1037
|
null,
|
|
699
|
-
"
|
|
1038
|
+
"084d1476",
|
|
700
1039
|
null
|
|
701
1040
|
|
|
702
1041
|
)
|
|
703
1042
|
|
|
704
|
-
/* harmony default export */ var xt_list = (
|
|
1043
|
+
/* harmony default export */ var xt_list = (xt_list_component.exports);
|
|
705
1044
|
// CONCATENATED MODULE: ./src/components/xt-list/index.js
|
|
706
1045
|
|
|
707
1046
|
|