UNPKG

@ykcl/smart-ui-oversea

Version:

A Component Library for Vue.js.

1,712 lines (1,454 loc) 288 kB
module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 107); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; }); /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier /* server only */, shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call( this, (options.functional ? this.parent : this).$root.$options.shadowRoot ) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functional component in vue file var originalRender = options.render options.render = function renderWithStyleInjection(h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }), /* 1 */, /* 2 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/utils/util"); /***/ }), /* 3 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/utils/dom"); /***/ }), /* 4 */, /* 5 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/utils/vue-popper"); /***/ }), /* 6 */ /***/ (function(module, exports) { module.exports = require("vue"); /***/ }), /* 7 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/mixins/locale"); /***/ }), /* 8 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCell; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return orderBy; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getColumnById; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getColumnByKey; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getColumnByCell; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getRowIdentity; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getKeysMap; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return mergeOptions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return parseWidth; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return parseMinWidth; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return parseHeight; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return compose; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return toggleRowStatus; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return walkTreeNode; }); /* harmony import */ var _ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var _ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0__); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var getCell = function getCell(event) { var cell = event.target; while (cell && cell.tagName.toUpperCase() !== 'HTML') { if (cell.tagName.toUpperCase() === 'TD') { return cell; } cell = cell.parentNode; } return null; }; var isObject = function isObject(obj) { return obj !== null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object'; }; var orderBy = function orderBy(array, sortKey, reverse, sortMethod, sortBy) { if (!sortKey && !sortMethod && (!sortBy || Array.isArray(sortBy) && !sortBy.length)) { return array; } if (typeof reverse === 'string') { reverse = reverse === 'descending' ? -1 : 1; } else { reverse = reverse && reverse < 0 ? -1 : 1; } var getKey = sortMethod ? null : function (value, index) { if (sortBy) { if (!Array.isArray(sortBy)) { sortBy = [sortBy]; } return sortBy.map(function (by) { if (typeof by === 'string') { return Object(_ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0__["getValueByPath"])(value, by); } else { return by(value, index, array); } }); } if (sortKey !== '$key') { if (isObject(value) && '$value' in value) value = value.$value; } return [isObject(value) ? Object(_ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0__["getValueByPath"])(value, sortKey) : value]; }; var compare = function compare(a, b) { if (sortMethod) { return sortMethod(a.value, b.value); } for (var i = 0, len = a.key.length; i < len; i++) { if (a.key[i] < b.key[i]) { return -1; } if (a.key[i] > b.key[i]) { return 1; } } return 0; }; return array.map(function (value, index) { return { value: value, index: index, key: getKey ? getKey(value, index) : null }; }).sort(function (a, b) { var order = compare(a, b); if (!order) { // make stable https://en.wikipedia.org/wiki/Sorting_algorithm#Stability order = a.index - b.index; } return order * reverse; }).map(function (item) { return item.value; }); }; var getColumnById = function getColumnById(table, columnId) { var column = null; table.columns.forEach(function (item) { if (item.id === columnId) { column = item; } }); return column; }; var getColumnByKey = function getColumnByKey(table, columnKey) { var column = null; for (var i = 0; i < table.columns.length; i++) { var item = table.columns[i]; if (item.columnKey === columnKey) { column = item; break; } } return column; }; var getColumnByCell = function getColumnByCell(table, cell) { var matches = (cell.className || '').match(/yk-table_[^\s]+/gm); if (matches) { return getColumnById(table, matches[0]); } return null; }; var getRowIdentity = function getRowIdentity(row, rowKey) { if (!row) throw new Error('row is required when get row identity'); if (typeof rowKey === 'string') { if (rowKey.indexOf('.') < 0) { return row[rowKey]; } var key = rowKey.split('.'); var current = row; for (var i = 0; i < key.length; i++) { current = current[key[i]]; } return current; } else if (typeof rowKey === 'function') { return rowKey.call(null, row); } }; var getKeysMap = function getKeysMap(array, rowKey) { var arrayMap = {}; (array || []).forEach(function (row, index) { arrayMap[getRowIdentity(row, rowKey)] = { row: row, index: index }; }); return arrayMap; }; function hasOwn(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); } function mergeOptions(defaults, config) { var options = {}; var key = void 0; for (key in defaults) { options[key] = defaults[key]; } for (key in config) { if (hasOwn(config, key)) { var value = config[key]; if (typeof value !== 'undefined') { options[key] = value; } } } return options; } function parseWidth(width) { if (width !== undefined) { width = parseInt(width, 10); if (isNaN(width)) { width = null; } } return width; } function parseMinWidth(minWidth) { if (typeof minWidth !== 'undefined') { minWidth = parseWidth(minWidth); if (isNaN(minWidth)) { minWidth = 80; } } return minWidth; }; function parseHeight(height) { if (typeof height === 'number') { return height; } if (typeof height === 'string') { if (/^\d+(?:px)?$/.test(height)) { return parseInt(height, 10); } else { return height; } } return null; } // https://github.com/reduxjs/redux/blob/master/src/compose.js function compose() { for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } if (funcs.length === 0) { return function (arg) { return arg; }; } if (funcs.length === 1) { return funcs[0]; } return funcs.reduce(function (a, b) { return function () { return a(b.apply(undefined, arguments)); }; }); } function toggleRowStatus(statusArr, row, newVal) { var changed = false; var index = statusArr.indexOf(row); var included = index !== -1; var addRow = function addRow() { statusArr.push(row); changed = true; }; var removeRow = function removeRow() { statusArr.splice(index, 1); changed = true; }; if (typeof newVal === 'boolean') { if (newVal && !included) { addRow(); } else if (!newVal && included) { removeRow(); } } else { if (included) { removeRow(); } else { addRow(); } } return changed; } function walkTreeNode(root, cb) { var childrenKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children'; var lazyKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'hasChildren'; var isNil = function isNil(array) { return !(Array.isArray(array) && array.length); }; function _walker(parent, children, level) { cb(parent, children, level); children.forEach(function (item) { if (item[lazyKey]) { cb(item, null, level + 1); return; } var children = item[childrenKey]; if (!isNil(children)) { _walker(item, children, level + 1); } }); } root.forEach(function (item) { if (item[lazyKey]) { cb(item, null, 0); return; } var children = item[childrenKey]; if (!isNil(children)) { _walker(item, children, 0); } }); } /***/ }), /* 9 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/utils/merge"); /***/ }), /* 10 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/input"); /***/ }), /* 11 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/mixins/migrating"); /***/ }), /* 12 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/utils/clickoutside"); /***/ }), /* 13 */, /* 14 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/utils/popup"); /***/ }), /* 15 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/scrollbar"); /***/ }), /* 16 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/utils/resize-event"); /***/ }), /* 17 */, /* 18 */ /***/ (function(module, exports) { module.exports = require("throttle-debounce/debounce"); /***/ }), /* 19 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/checkbox"); /***/ }), /* 20 */, /* 21 */, /* 22 */, /* 23 */, /* 24 */, /* 25 */, /* 26 */, /* 27 */, /* 28 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return cellStarts; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cellForced; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return defaultRenderCell; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return treeCellPrefix; }); /* harmony import */ var _ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var _ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__); var cellStarts = { default: { order: '' }, selection: { width: 48, minWidth: 48, realWidth: 48, order: '', className: 'yk-table-column--selection' }, expand: { width: 48, minWidth: 48, realWidth: 48, order: '' }, index: { width: 48, minWidth: 48, realWidth: 48, order: '' } }; // 这些选项不应该被覆盖 var cellForced = { selection: { renderHeader: function renderHeader(h, _ref) { var store = _ref.store; return h('yk-checkbox', { attrs: { disabled: store.states.data && store.states.data.length === 0, indeterminate: store.states.selection.length > 0 && !this.isAllSelected, value: this.isAllSelected }, nativeOn: { 'click': this.toggleAllSelection } }); }, renderCell: function renderCell(h, _ref2) { var row = _ref2.row, column = _ref2.column, store = _ref2.store, $index = _ref2.$index; return h('yk-checkbox', { nativeOn: { 'click': function click(event) { return event.stopPropagation(); } }, attrs: { value: store.isSelected(row), disabled: column.selectable ? !column.selectable.call(null, row, $index) : false }, on: { 'input': function input() { store.commit('rowSelectedChanged', row); } } }); }, sortable: false, resizable: false }, index: { renderHeader: function renderHeader(h, _ref3) { var column = _ref3.column; return column.label || '#'; }, renderCell: function renderCell(h, _ref4) { var $index = _ref4.$index, column = _ref4.column; var i = $index + 1; var index = column.index; if (typeof index === 'number') { i = $index + index; } else if (typeof index === 'function') { i = index($index); } return h('div', [i]); }, sortable: false }, expand: { renderHeader: function renderHeader(h, _ref5) { var column = _ref5.column; return column.label || ''; }, renderCell: function renderCell(h, _ref6) { var row = _ref6.row, store = _ref6.store; var classes = ['yk-table__expand-icon']; if (store.states.expandRows.indexOf(row) > -1) { classes.push(vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$ELEMENT.isRTL ? 'yk-table__expand-icon--expandedRtl' : 'yk-table__expand-icon--expanded'); } var callback = function callback(e) { e.stopPropagation(); store.toggleRowExpansion(row); }; return h( 'div', { 'class': classes, on: { 'click': callback } }, [h('i', { 'class': 'el-icon ' + (vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$ELEMENT.isRTL ? 'el-icon-arrow-left' : 'el-icon-arrow-right') })] ); }, sortable: false, resizable: false, className: 'yk-table__expand-column' } }; function defaultRenderCell(h, _ref7) { var row = _ref7.row, column = _ref7.column, $index = _ref7.$index; var property = column.property; var value = property && Object(_ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0__["getPropByPath"])(row, property).v; if (column && column.formatter) { return column.formatter(row, column, value, $index); } return value; } function treeCellPrefix(h, _ref8) { var row = _ref8.row, treeNode = _ref8.treeNode, store = _ref8.store; if (!treeNode) return null; var ele = []; var callback = function callback(e) { e.stopPropagation(); store.loadOrToggle(row); }; if (treeNode.indent) { ele.push(h('span', { 'class': 'yk-table__indent', style: { 'padding-left': treeNode.indent + 'px' } })); } if (typeof treeNode.expanded === 'boolean' && !treeNode.noLazyChildren) { var expandClasses = ['yk-table__expand-icon', treeNode.expanded ? vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$ELEMENT.isRTL ? 'yk-table__expand-icon--expandedRtl' : 'yk-table__expand-icon--expanded' : '']; var iconClasses = vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$ELEMENT.isRTL ? ['el-icon-arrow-left'] : ['el-icon-arrow-right']; if (treeNode.loading) { iconClasses = ['el-icon-loading']; } ele.push(h( 'div', { 'class': expandClasses, on: { 'click': callback } }, [h('i', { 'class': iconClasses })] )); } else { ele.push(h('span', { 'class': 'yk-table__placeholder' })); } return ele; } /***/ }), /* 29 */, /* 30 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/tooltip"); /***/ }), /* 31 */, /* 32 */, /* 33 */, /* 34 */, /* 35 */, /* 36 */, /* 37 */, /* 38 */, /* 39 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/utils/scrollbar-width"); /***/ }), /* 40 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/lib/checkbox-group"); /***/ }), /* 41 */, /* 42 */, /* 43 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var _ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8); /* harmony default export */ __webpack_exports__["a"] = ({ data: function data() { return { states: { // 不可响应的,设置 currentRowKey 时,data 不一定存在,也许无法算出正确的 currentRow // 把该值缓存一下,当用户点击修改 currentRow 时,把该值重置为 null _currentRowKey: null, currentRow: null } }; }, methods: { setCurrentRowKey: function setCurrentRowKey(key) { this.assertRowKey(); this.states._currentRowKey = key; this.setCurrentRowByKey(key); }, restoreCurrentRowKey: function restoreCurrentRowKey() { this.states._currentRowKey = null; }, setCurrentRowByKey: function setCurrentRowByKey(key) { var states = this.states; var _states$data = states.data, data = _states$data === undefined ? [] : _states$data, rowKey = states.rowKey; var currentRow = null; if (rowKey) { currentRow = Object(_ykcl_smart_ui_oversea_src_utils_util__WEBPACK_IMPORTED_MODULE_0__["arrayFind"])(data, function (item) { return Object(_util__WEBPACK_IMPORTED_MODULE_1__[/* getRowIdentity */ "g"])(item, rowKey) === key; }); } states.currentRow = currentRow; }, updateCurrentRow: function updateCurrentRow(currentRow) { var states = this.states, table = this.table; var oldCurrentRow = states.currentRow; if (currentRow && currentRow !== oldCurrentRow) { states.currentRow = currentRow; table.$emit('current-change', currentRow, oldCurrentRow); return; } if (!currentRow && oldCurrentRow) { states.currentRow = null; table.$emit('current-change', null, oldCurrentRow); } }, updateCurrentRowData: function updateCurrentRowData() { var states = this.states, table = this.table; var rowKey = states.rowKey, _currentRowKey = states._currentRowKey; // data 为 null 时,解构时的默认值会被忽略 var data = states.data || []; var oldCurrentRow = states.currentRow; // 当 currentRow 不在 data 中时尝试更新数据 if (data.indexOf(oldCurrentRow) === -1 && oldCurrentRow) { if (rowKey) { var currentRowKey = Object(_util__WEBPACK_IMPORTED_MODULE_1__[/* getRowIdentity */ "g"])(oldCurrentRow, rowKey); this.setCurrentRowByKey(currentRowKey); } else { states.currentRow = null; } if (states.currentRow === null) { table.$emit('current-change', null, oldCurrentRow); } } else if (_currentRowKey) { // 把初始时下设置的 rowKey 转化成 rowData this.setCurrentRowByKey(_currentRowKey); this.restoreCurrentRowKey(); } } } }); /***/ }), /* 44 */, /* 45 */, /* 46 */, /* 47 */ /***/ (function(module, exports) { module.exports = require("throttle-debounce"); /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(66); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(68)(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /* 49 */, /* 50 */, /* 51 */, /* 52 */ /***/ (function(module, exports) { module.exports = require("@ykcl/smart-ui-oversea/src/directives/mousewheel"); /***/ }), /* 53 */ /***/ (function(module, exports) { module.exports = require("perfect-scrollbar"); /***/ }), /* 54 */ /***/ (function(module, exports) { module.exports = require("vuedraggable"); /***/ }), /* 55 */ /***/ (function(module, exports) { module.exports = require("crypto-js"); /***/ }), /* 56 */, /* 57 */, /* 58 */, /* 59 */, /* 60 */, /* 61 */, /* 62 */, /* 63 */, /* 64 */ /***/ (function(module, exports) { module.exports = require("perfect-scrollbar/css/perfect-scrollbar.css"); /***/ }), /* 65 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _node_modules_style_loader_0_23_1_style_loader_index_js_node_modules_css_loader_2_1_1_css_loader_dist_cjs_js_node_modules_vue_loader_15_11_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_15_11_1_vue_loader_lib_index_js_vue_loader_options_table_header_field_order_vue_vue_type_style_index_0_id_212f3f8b_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48); /* harmony import */ var _node_modules_style_loader_0_23_1_style_loader_index_js_node_modules_css_loader_2_1_1_css_loader_dist_cjs_js_node_modules_vue_loader_15_11_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_15_11_1_vue_loader_lib_index_js_vue_loader_options_table_header_field_order_vue_vue_type_style_index_0_id_212f3f8b_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_0_23_1_style_loader_index_js_node_modules_css_loader_2_1_1_css_loader_dist_cjs_js_node_modules_vue_loader_15_11_1_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_15_11_1_vue_loader_lib_index_js_vue_loader_options_table_header_field_order_vue_vue_type_style_index_0_id_212f3f8b_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__); /* unused harmony reexport * */ /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(67)(false); // Module exports.push([module.i, "\n.table-field-sort .header {\r\n /* white-space: nowrap; */\r\n display: flex;\r\n align-items: center;\n}\n.table-field-sort .header .yk-checkbox__label {\r\n display: inline-block;\r\n width: 120px;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\n}\n.table-header-filter-checked-item .yk-checkbox {\r\n cursor: grab;\n}\n.table-header-field-unDrag .yk_icon_move {\r\n cursor: no-drop;\n}\n.table-header-field-unDrag .yk-checkbox {\r\n cursor: pointer;\n}\n.ps__rail-x {\r\n display: none !important;\n}\r\n", ""]); /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function (useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if (item[2]) { return '@media ' + item[2] + '{' + content + '}'; } else { return content; } }).join(''); }; // import a list of modules into the list list.i = function (modules, mediaQuery) { if (typeof modules === 'string') { modules = [[null, modules, '']]; } var alreadyImportedModules = {}; for (var i = 0; i < this.length; i++) { var id = this[i][0]; if (id != null) { alreadyImportedModules[id] = true; } } for (i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if (item[0] == null || !alreadyImportedModules[item[0]]) { if (mediaQuery && !item[2]) { item[2] = mediaQuery; } else if (mediaQuery) { item[2] = '(' + item[2] + ') and (' + mediaQuery + ')'; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var stylesInDom = {}; var memoize = function (fn) { var memo; return function () { if (typeof memo === "undefined") memo = fn.apply(this, arguments); return memo; }; }; var isOldIE = memoize(function () { // Test for IE <= 9 as proposed by Browserhacks // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 // Tests for existence of standard globals is to allow style-loader // to operate correctly into non-standard environments // @see https://github.com/webpack-contrib/style-loader/issues/177 return window && document && document.all && !window.atob; }); var getTarget = function (target, parent) { if (parent){ return parent.querySelector(target); } return document.querySelector(target); }; var getElement = (function (fn) { var memo = {}; return function(target, parent) { // If passing function in options, then use it for resolve "head" element. // Useful for Shadow Root style i.e // { // insertInto: function () { return document.querySelector("#foo").shadowRoot } // } if (typeof target === 'function') { return target(); } if (typeof memo[target] === "undefined") { var styleTarget = getTarget.call(this, target, parent); // Special case to return head of iframe instead of iframe itself if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { try { // This will throw an exception if access to iframe is blocked // due to cross-origin restrictions styleTarget = styleTarget.contentDocument.head; } catch(e) { styleTarget = null; } } memo[target] = styleTarget; } return memo[target] }; })(); var singleton = null; var singletonCounter = 0; var stylesInsertedAtTop = []; var fixUrls = __webpack_require__(69); module.exports = function(list, options) { if (typeof DEBUG !== "undefined" && DEBUG) { if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); } options = options || {}; options.attrs = typeof options.attrs === "object" ? options.attrs : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> // tags it will allow on a page if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE(); // By default, add <style> tags to the <head> element if (!options.insertInto) options.insertInto = "head"; // By default, add <style> tags to the bottom of the target if (!options.insertAt) options.insertAt = "bottom"; var styles = listToStyles(list, options); addStylesToDom(styles, options); return function update (newList) { var mayRemove = []; for (var i = 0; i < styles.length; i++) { var item = styles[i]; var domStyle = stylesInDom[item.id]; domStyle.refs--; mayRemove.push(domStyle); } if(newList) { var newStyles = listToStyles(newList, options); addStylesToDom(newStyles, options); } for (var i = 0; i < mayRemove.length; i++) { var domStyle = mayRemove[i]; if(domStyle.refs === 0) { for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](); delete stylesInDom[domStyle.id]; } } }; }; function addStylesToDom (styles, options) { for (var i = 0; i < styles.length; i++) { var item = styles[i]; var domStyle = stylesInDom[item.id]; if(domStyle) { domStyle.refs++; for(var j = 0; j < domStyle.parts.length; j++) { domStyle.parts[j](item.parts[j]); } for(; j < item.parts.length; j++) { domStyle.parts.push(addStyle(item.parts[j], options)); } } else { var parts = []; for(var j = 0; j < item.parts.length; j++) { parts.push(addStyle(item.parts[j], options)); } stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts}; } } } function listToStyles (list, options) { var styles = []; var newStyles = {}; for (var i = 0; i < list.length; i++) { var item = list[i]; var id = options.base ? item[0] + options.base : item[0]; var css = item[1]; var media = item[2]; var sourceMap = item[3]; var part = {css: css, media: media, sourceMap: sourceMap}; if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]}); else newStyles[id].parts.push(part); } return styles; } function insertStyleElement (options, style) { var target = getElement(options.insertInto) if (!target) { throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid."); } var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1]; if (options.insertAt === "top") { if (!lastStyleElementInsertedAtTop) { target.insertBefore(style, target.firstChild); } else if (lastStyleElementInsertedAtTop.nextSibling) { target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling); } else { target.appendChild(style); } stylesInsertedAtTop.push(style); } else if (options.insertAt === "bottom") { target.appendChild(style); } else if (typeof options.insertAt === "object" && options.insertAt.before) { var nextSibling = getElement(options.insertAt.before, target); target.insertBefore(style, nextSibling); } else { throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n"); } } function removeStyleElement (style) { if (style.parentNode === null) return false; style.parentNode.removeChild(style); var idx = stylesInsertedAtTop.indexOf(style); if(idx >= 0) { stylesInsertedAtTop.splice(idx, 1); } } function createStyleElement (options) { var style = document.createElement("style"); if(options.attrs.type === undefined) { options.attrs.type = "text/css"; } if(options.attrs.nonce === undefined) { var nonce = getNonce(); if (nonce) { options.attrs.nonce = nonce; } } addAttrs(style, options.attrs); insertStyleElement(options, style); return style; } function createLinkElement (options) { var link = document.createElement("link"); if(options.attrs.type === undefined) { options.attrs.type = "text/css"; } options.attrs.rel = "stylesheet"; addAttrs(link, options.attrs); insertStyleElement(options, link); return link; } function addAttrs (el, attrs) { Object.keys(attrs).forEach(function (key) { el.setAttribute(key, attrs[key]); }); } function getNonce() { if (false) {} return __webpack_require__.nc; } function addStyle (obj, options) { var style, update, remove, result; // If a transform function was defined, run it on the css if (options.transform && obj.css) { result = typeof options.transform === 'function' ? options.transform(obj.css) : options.transform.default(obj.css); if (result) { // If transform returns a value, use that instead of the original css. // This allows running runtime transformations on the css. obj.css = result; } else { // If the transform function returns a falsy value, don't add this css. // This allows conditional loading of css return function() { // noop }; } } if (options.singleton) { var styleIndex = singletonCounter++; style = singleton || (singleton = createStyleElement(options)); update = applyToSingletonTag.bind(null, style, styleIndex, false); remove = applyToSingletonTag.bind(null, style, styleIndex, true); } else if ( obj.sourceMap && typeof URL === "function" && typeof URL.createObjectURL === "function" && typeof URL.revokeObjectURL === "function" && typeof Blob === "function" && typeof btoa === "function" ) { style = createLinkElement(options); update = updateLink.bind(null, style, options); remove = function () { removeStyleElement(style); if(style.href) URL.revokeObjectURL(style.href); }; } else { style = createStyleElement(options); update = applyToTag.bind(null, style); remove = function () { removeStyleElement(style); }; } update(obj); return function updateStyle (newObj) { if (newObj) { if ( newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap ) { return; } update(obj = newObj); } else { remove(); } }; } var replaceText = (function () { var textStore = []; return function (index, replacement) { textStore[index] = replacement; return textStore.filter(Boolean).join('\n'); }; })(); function applyToSingletonTag (style, index, remove, obj) { var css = remove ? "" : obj.css; if (style.styleSheet) { style.styleSheet.cssText = replaceText(index, css); } else { var cssNode = document.createTextNode(css); var childNodes = style.childNodes; if (childNodes[index]) style.removeChild(childNodes[index]); if (childNodes.length) { style.insertBefore(cssNode, childNodes[index]); } else { style.appendChild(cssNode); } } } function applyToTag (style, obj) { var css = obj.css; var media = obj.media; if(media) { style.setAttribute("media", media) } if(style.styleSheet) { style.styleSheet.cssText = css; } else { while(style.firstChild) { style.removeChild(style.firstChild); } style.appendChild(document.createTextNode(css)); } } function updateLink (link, options, obj) { var css = obj.css; var sourceMap = obj.sourceMap; /* If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled and there is no publicPath defined then lets turn convertToAbsoluteUrls on by default. Otherwise default to the convertToAbsoluteUrls option directly */ var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap; if (options.convertToAbsoluteUrls || autoFixUrls) { css = fixUrls(css); } if (sourceMap) { // http://stackoverflow.com/a/26603875 css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"; } var blob = new Blob([css], { type: "text/css" }); var oldSrc = link.href; link.href = URL.createObjectURL(blob); if(oldSrc) URL.revokeObjectURL(oldSrc); } /***/ }), /* 69 */ /***/ (function(module, exports) { /** * When source maps are enabled, `style-loader` uses a link element with a data-uri to * embed the css on the page. This breaks all relative urls because now they are relative to a * bundle instead of the current page. * * One solution is to only use full urls, but that may be impossible. * * Instead, this function "fixes" the relative urls to be absolute according to the current page location. * * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command. * */ module.exports = function (css) { // get current location var location = typeof window !== "undefined" && window.location; if (!location) { throw new Error("fixUrls requires window.location"); } // blank or null? if (!css || typeof css !== "string") { return css; } var baseUrl = location.protocol + "//" + location.host; var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/"); // convert each url(...) /* This regular expression is just a way to recursively match brackets within a string. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens ( = Start a capturing group (?: = Start a non-capturing group [^)(] = Match anything that isn't a parentheses | = OR \( = Match a start parentheses (?: = Start another non-capturing groups [^)(]+ = Match anything that isn't a parentheses | = OR \( = Match a start parentheses [^)(]* = Match anything that isn't a parentheses \) = Match a end parentheses ) = End Group *\) = Match anything and then a close parens ) = Close non-capturing group * = Match anything ) = Close capturing group \) = Match a close parens /gi = Get all matches, not the first. Be case insensitive. */ var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) { // strip quotes (if they exist) var unquotedOrigUrl = origUrl .trim() .replace(/^"(.*)"$/, function(o, $1){ return $1; }) .replace(/^'(.*)'$/, function(o, $1){ return $1; }); // already a full url? no change if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) { return fullMatch; } // convert the url to a full url var newUrl; if (unquotedOrigUrl.indexOf("//") === 0) { //TODO: should we add protocol? newUrl = unquotedOrigUrl; } else if (unquotedOrigUrl.indexOf("/") === 0) { // path should be relative to the base url newUrl = baseUrl + unquotedOrigUrl; // already starts with '/' } else { // path should be relative to current directory newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './' } // send back the fixed url(...) return "url(" + JSON.stringify(newUrl) + ")"; }); // send back the fixed css return fixedCss; }; /***/ }), /* 70 */, /* 71 */, /* 72 */, /* 73 */, /* 74 */, /* 75 */, /* 76 */, /* 77 */, /* 78 */, /* 79 */, /* 80 */, /* 81 */, /* 82 */, /* 83 */, /* 84 */, /* 85 */, /* 86 */, /* 87 */, /* 88 */, /* 89 */, /* 90 */, /* 91 */, /* 92 */, /* 93 */, /* 94 */, /* 95 */, /* 96 */, /* 97 */, /* 98 */, /* 99 */, /* 100 */, /* 101 */, /* 102 */, /* 103 */, /* 104 */, /* 105 */, /* 106 */, /* 107 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.11.1@vue-loader/lib??vue-loader-options!./packages/table/src/table.vue?vue&type=template&id=b9c7f876 var render = function () { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c("div", [ _vm.showTableTitle ? _c( "div", { ref: "tableHeaderTitleRef", staticClass: "table-header-title" }, [ _c( "div", { staticClass: "left" }, [ _vm._t("title-text", [ _c("div", { staticClass: "table-title-left" }, [ _c( "div", { staticClass: "table-title-left-content" }, [ _c("table-header-icon", { staticClass: "table-title-icon", }), _c("div", { staticClass: "table-title-text-total" }, [ _vm._v(_vm._s(_vm.title)), ]), _vm.total > -1 ? _c("div", { staticClass: "table-title-total" }, [ _vm._v("(" + _vm._s(_vm.total) + ")"), ]) : _vm._e(), ], 1 ), ]), ]), ], 2 ), _c("div", { staticClass: "right" }, [ _c("div", { staticClass: "controller" }, [ _c("span", { staticClass: "btn-label" }, [ _vm._v(_vm._s(_vm.t("el.table.tableSize")) + ":"), ]), _c("div", { staticClass: "btn-group" }, [ _c( "span", { staticClass: "btn-item", class: { active: _vm.tableSize === "mini" }, on: { click: function ($event) { _vm.setTableSize("mini") }, }, }, [_vm._v(_vm._s(_vm.t("el.table.small")))] ), _c( "span", { staticClass: "btn-item", class: { active: _vm.tableSize === "small" }, on: { click: function ($event) { _vm.setTableSize("small") }, }, }, [_vm._v(_vm._s(_vm.t("el.table.medium")))] ), _c( "span", { staticClass: "btn-item", class: { active: _vm.tableSize === "medium" }, on: { click: function ($event) { _vm.setTableSize("medium") }, }, }, [_vm._v(_vm._s(_vm.t("el.table.large")))] ), ]), ]), _c( "d