{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\@jiaminghi\\data-view\\lib\\components\\scrollBoard\\src\\main.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\@jiaminghi\\data-view\\lib\\components\\scrollBoard\\src\\main.vue","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\babel.config.js","mtime":1667327525434},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport \"core-js/modules/es6.array.fill\";\nimport _defineProperty from \"D:/jenkins/workspace/xq-web-fvue/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport _toConsumableArray from \"D:/jenkins/workspace/xq-web-fvue/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport autoResize from \"../../../mixin/autoResize\";\nimport { deepMerge } from '@jiaminghi/charts/lib/util/index';\nimport { deepClone } from '@jiaminghi/c-render/lib/plugin/util';\nexport default {\n name: 'DvScrollBoard',\n mixins: [autoResize],\n props: {\n config: {\n type: Object,\n default: function _default() {\n return {};\n }\n }\n },\n data: function data() {\n return {\n ref: 'scroll-board',\n defaultConfig: {\n /**\n * @description Board header\n * @type {Array}\n * @default header = []\n * @example header = ['column1', 'column2', 'column3']\n */\n header: [],\n\n /**\n * @description Board data\n * @type {Array}\n * @default data = []\n */\n data: [],\n\n /**\n * @description Row num\n * @type {Number}\n * @default rowNum = 5\n */\n rowNum: 5,\n\n /**\n * @description Header background color\n * @type {String}\n * @default headerBGC = '#00BAFF'\n */\n headerBGC: '#00BAFF',\n\n /**\n * @description Odd row background color\n * @type {String}\n * @default oddRowBGC = '#003B51'\n */\n oddRowBGC: '#003B51',\n\n /**\n * @description Even row background color\n * @type {String}\n * @default evenRowBGC = '#003B51'\n */\n evenRowBGC: '#0A2732',\n\n /**\n * @description Scroll wait time\n * @type {Number}\n * @default waitTime = 2000\n */\n waitTime: 2000,\n\n /**\n * @description Header height\n * @type {Number}\n * @default headerHeight = 35\n */\n headerHeight: 35,\n\n /**\n * @description Column width\n * @type {Array}\n * @default columnWidth = []\n */\n columnWidth: [],\n\n /**\n * @description Column align\n * @type {Array}\n * @default align = []\n * @example align = ['left', 'center', 'right']\n */\n align: [],\n\n /**\n * @description Show index\n * @type {Boolean}\n * @default index = false\n */\n index: false,\n\n /**\n * @description index Header\n * @type {String}\n * @default indexHeader = '#'\n */\n indexHeader: '#',\n\n /**\n * @description Carousel type\n * @type {String}\n * @default carousel = 'single'\n * @example carousel = 'single' | 'page'\n */\n carousel: 'single',\n\n /**\n * @description Pause scroll when mouse hovered\n * @type {Boolean}\n * @default hoverPause = true\n * @example hoverPause = true | false\n */\n hoverPause: true\n },\n mergedConfig: null,\n header: [],\n rowsData: [],\n rows: [],\n widths: [],\n heights: [],\n avgHeight: 0,\n aligns: [],\n animationIndex: 0,\n animationHandler: '',\n updater: 0,\n needCalc: false\n };\n },\n watch: {\n config: function config() {\n var stopAnimation = this.stopAnimation,\n calcData = this.calcData;\n stopAnimation();\n this.animationIndex = 0;\n calcData();\n }\n },\n methods: {\n handleHover: function handleHover(enter, ri, ci, row, ceil) {\n var mergedConfig = this.mergedConfig,\n emitEvent = this.emitEvent,\n stopAnimation = this.stopAnimation,\n animation = this.animation;\n if (enter) emitEvent('mouseover', ri, ci, row, ceil);\n if (!mergedConfig.hoverPause) return;\n\n if (enter) {\n stopAnimation();\n } else {\n animation(true);\n }\n },\n afterAutoResizeMixinInit: function afterAutoResizeMixinInit() {\n var calcData = this.calcData;\n calcData();\n },\n onResize: function onResize() {\n var mergedConfig = this.mergedConfig,\n calcWidths = this.calcWidths,\n calcHeights = this.calcHeights;\n if (!mergedConfig) return;\n calcWidths();\n calcHeights();\n },\n calcData: function calcData() {\n var mergeConfig = this.mergeConfig,\n calcHeaderData = this.calcHeaderData,\n calcRowsData = this.calcRowsData;\n mergeConfig();\n calcHeaderData();\n calcRowsData();\n var calcWidths = this.calcWidths,\n calcHeights = this.calcHeights,\n calcAligns = this.calcAligns;\n calcWidths();\n calcHeights();\n calcAligns();\n var animation = this.animation;\n animation(true);\n },\n mergeConfig: function mergeConfig() {\n var config = this.config,\n defaultConfig = this.defaultConfig;\n this.mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {});\n },\n calcHeaderData: function calcHeaderData() {\n var _this$mergedConfig = this.mergedConfig,\n header = _this$mergedConfig.header,\n index = _this$mergedConfig.index,\n indexHeader = _this$mergedConfig.indexHeader;\n\n if (!header.length) {\n this.header = [];\n return;\n }\n\n header = _toConsumableArray(header);\n if (index) header.unshift(indexHeader);\n this.header = header;\n },\n calcRowsData: function calcRowsData() {\n var _this$mergedConfig2 = this.mergedConfig,\n data = _this$mergedConfig2.data,\n index = _this$mergedConfig2.index,\n headerBGC = _this$mergedConfig2.headerBGC,\n rowNum = _this$mergedConfig2.rowNum;\n\n if (index) {\n data = data.map(function (row, i) {\n row = _toConsumableArray(row);\n var indexTag = \"\").concat(i + 1, \"\");\n row.unshift(indexTag);\n return row;\n });\n }\n\n data = data.map(function (ceils, i) {\n return {\n ceils: ceils,\n rowIndex: i\n };\n });\n var rowLength = data.length;\n\n if (rowLength > rowNum && rowLength < 2 * rowNum) {\n data = [].concat(_toConsumableArray(data), _toConsumableArray(data));\n }\n\n data = data.map(function (d, i) {\n return _objectSpread(_objectSpread({}, d), {}, {\n scroll: i\n });\n });\n this.rowsData = data;\n this.rows = data;\n },\n calcWidths: function calcWidths() {\n var width = this.width,\n mergedConfig = this.mergedConfig,\n rowsData = this.rowsData;\n var columnWidth = mergedConfig.columnWidth,\n header = mergedConfig.header;\n var usedWidth = columnWidth.reduce(function (all, w) {\n return all + w;\n }, 0);\n var columnNum = 0;\n\n if (rowsData[0]) {\n columnNum = rowsData[0].ceils.length;\n } else if (header.length) {\n columnNum = header.length;\n }\n\n var avgWidth = (width - usedWidth) / (columnNum - columnWidth.length);\n var widths = new Array(columnNum).fill(avgWidth);\n this.widths = deepMerge(widths, columnWidth);\n },\n calcHeights: function calcHeights() {\n var onresize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var height = this.height,\n mergedConfig = this.mergedConfig,\n header = this.header;\n var headerHeight = mergedConfig.headerHeight,\n rowNum = mergedConfig.rowNum,\n data = mergedConfig.data;\n var allHeight = height;\n if (header.length) allHeight -= headerHeight;\n var avgHeight = allHeight / rowNum;\n this.avgHeight = avgHeight;\n if (!onresize) this.heights = new Array(data.length).fill(avgHeight);\n },\n calcAligns: function calcAligns() {\n var header = this.header,\n mergedConfig = this.mergedConfig;\n var columnNum = header.length;\n var aligns = new Array(columnNum).fill('left');\n var align = mergedConfig.align;\n this.aligns = deepMerge(aligns, align);\n },\n animation: function () {\n var _animation = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var _this$heights;\n\n var start,\n needCalc,\n calcHeights,\n calcRowsData,\n avgHeight,\n animationIndex,\n mergedConfig,\n rowsData,\n animation,\n updater,\n waitTime,\n carousel,\n rowNum,\n rowLength,\n animationNum,\n rows,\n back,\n _args = arguments;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n start = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;\n needCalc = this.needCalc, calcHeights = this.calcHeights, calcRowsData = this.calcRowsData;\n\n if (needCalc) {\n calcRowsData();\n calcHeights();\n this.needCalc = false;\n }\n\n avgHeight = this.avgHeight, animationIndex = this.animationIndex, mergedConfig = this.mergedConfig, rowsData = this.rowsData, animation = this.animation, updater = this.updater;\n waitTime = mergedConfig.waitTime, carousel = mergedConfig.carousel, rowNum = mergedConfig.rowNum;\n rowLength = rowsData.length;\n\n if (!(rowNum >= rowLength)) {\n _context.next = 8;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 8:\n if (!start) {\n _context.next = 13;\n break;\n }\n\n _context.next = 11;\n return new Promise(function (resolve) {\n return setTimeout(resolve, waitTime);\n });\n\n case 11:\n if (!(updater !== this.updater)) {\n _context.next = 13;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 13:\n animationNum = carousel === 'single' ? 1 : rowNum;\n rows = rowsData.slice(animationIndex);\n rows.push.apply(rows, _toConsumableArray(rowsData.slice(0, animationIndex)));\n this.rows = rows.slice(0, carousel === 'page' ? rowNum * 2 : rowNum + 1);\n this.heights = new Array(rowLength).fill(avgHeight);\n _context.next = 20;\n return new Promise(function (resolve) {\n return setTimeout(resolve, 300);\n });\n\n case 20:\n if (!(updater !== this.updater)) {\n _context.next = 22;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 22:\n (_this$heights = this.heights).splice.apply(_this$heights, [0, animationNum].concat(_toConsumableArray(new Array(animationNum).fill(0))));\n\n animationIndex += animationNum;\n back = animationIndex - rowLength;\n if (back >= 0) animationIndex = back;\n this.animationIndex = animationIndex;\n this.animationHandler = setTimeout(animation, waitTime - 300);\n\n case 28:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function animation() {\n return _animation.apply(this, arguments);\n }\n\n return animation;\n }(),\n stopAnimation: function stopAnimation() {\n var animationHandler = this.animationHandler,\n updater = this.updater;\n this.updater = (updater + 1) % 999999;\n if (!animationHandler) return;\n clearTimeout(animationHandler);\n },\n emitEvent: function emitEvent(type, ri, ci, row, ceil) {\n var ceils = row.ceils,\n rowIndex = row.rowIndex;\n this.$emit(type, {\n row: ceils,\n ceil: ceil,\n rowIndex: rowIndex,\n columnIndex: ci\n });\n },\n updateRows: function updateRows(rows, animationIndex) {\n var mergedConfig = this.mergedConfig,\n animationHandler = this.animationHandler,\n animation = this.animation;\n this.mergedConfig = _objectSpread(_objectSpread({}, mergedConfig), {}, {\n data: _toConsumableArray(rows)\n });\n this.needCalc = true;\n if (typeof animationIndex === 'number') this.animationIndex = animationIndex;\n if (!animationHandler) animation(true);\n }\n },\n destroyed: function destroyed() {\n var stopAnimation = this.stopAnimation;\n stopAnimation();\n }\n};",null]}