luna-data-grid
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -15,2 +15,3 @@ import Component, { IComponentOptions } from '../share/Component'; | ||
minHeight?: number; | ||
filter?: string | RegExp | types.AnyFn; | ||
} | ||
@@ -27,2 +28,7 @@ export interface IDataGridNodeOptions { | ||
private $dataContainer; | ||
private $resizers; | ||
private resizeIdx; | ||
private resizeStartX; | ||
private resizeStartLeft; | ||
private resizeDeltaX; | ||
private resizeSensor; | ||
@@ -32,7 +38,8 @@ private onResize; | ||
private nodes; | ||
private columnWidthsInitialized; | ||
private columnMap; | ||
private colWidthsInitialized; | ||
private colMap; | ||
private sortId?; | ||
private selectedNode; | ||
private isAscending; | ||
private colWidths; | ||
constructor(container: HTMLElement, options: IOptions); | ||
@@ -45,8 +52,14 @@ destroy(): void; | ||
private selectNode; | ||
private onResizeColStart; | ||
private onResizeColMove; | ||
private onResizeColEnd; | ||
private bindEvent; | ||
private sortNodes; | ||
private updateWeights; | ||
private applyColumnWeights; | ||
private applyColWeights; | ||
private positionResizers; | ||
private renderData; | ||
private filterNode; | ||
private renderHeader; | ||
private renderResizers; | ||
private initTpl; | ||
@@ -61,2 +74,3 @@ } | ||
constructor(dataGrid: DataGrid, data: types.PlainObj<string | HTMLElement>, options?: IDataGridNodeOptions); | ||
text(): string; | ||
detach(): void; | ||
@@ -63,0 +77,0 @@ select(): void; |
@@ -40,3 +40,15 @@ "use strict"; | ||
var isNull_1 = __importDefault(require("licia/isNull")); | ||
var isFn_1 = __importDefault(require("licia/isFn")); | ||
var isRegExp_1 = __importDefault(require("licia/isRegExp")); | ||
var isStr_1 = __importDefault(require("licia/isStr")); | ||
var trim_1 = __importDefault(require("licia/trim")); | ||
var contain_1 = __importDefault(require("licia/contain")); | ||
var toNum_1 = __importDefault(require("licia/toNum")); | ||
var lowerCase_1 = __importDefault(require("licia/lowerCase")); | ||
var clamp_1 = __importDefault(require("licia/clamp")); | ||
var max_1 = __importDefault(require("licia/max")); | ||
var min_1 = __importDefault(require("licia/min")); | ||
var util_1 = require("../share/util"); | ||
var $document = (0, _1.default)(document); | ||
var MIN_COL_WIDTH = 24; | ||
var DataGrid = (function (_super) { | ||
@@ -46,7 +58,49 @@ __extends(DataGrid, _super); | ||
var _this = _super.call(this, container, { compName: 'data-grid' }, options) || this; | ||
_this.resizeIdx = 0; | ||
_this.resizeStartX = 0; | ||
_this.resizeStartLeft = 0; | ||
_this.resizeDeltaX = 0; | ||
_this.nodes = []; | ||
_this.columnWidthsInitialized = false; | ||
_this.columnMap = {}; | ||
_this.colWidthsInitialized = false; | ||
_this.colMap = {}; | ||
_this.selectedNode = null; | ||
_this.isAscending = true; | ||
_this.colWidths = []; | ||
_this.onResizeColMove = function (e) { | ||
var _a = _this, resizeIdx = _a.resizeIdx, $resizers = _a.$resizers, colWidths = _a.colWidths, $colgroup = _a.$colgroup; | ||
e = e.origEvent; | ||
var deltaX = (0, util_1.eventClient)('x', e) - _this.resizeStartX; | ||
var leftColWidth = colWidths[resizeIdx]; | ||
var rightColWidth = colWidths[resizeIdx + 1]; | ||
var lowerBound = (0, min_1.default)(-leftColWidth + MIN_COL_WIDTH, 0); | ||
var upperBound = (0, max_1.default)(rightColWidth - MIN_COL_WIDTH, 0); | ||
deltaX = (0, clamp_1.default)(deltaX, lowerBound, upperBound); | ||
$colgroup.each(function () { | ||
var $cols = (0, _1.default)(this).find('col'); | ||
$cols.eq(resizeIdx).css('width', leftColWidth + deltaX + 'px'); | ||
$cols.eq(resizeIdx + 1).css('width', rightColWidth - deltaX + 'px'); | ||
}); | ||
_this.resizeDeltaX = deltaX; | ||
var newLeft = _this.resizeStartLeft + deltaX; | ||
$resizers.eq(resizeIdx).css('left', "".concat(newLeft, "px")); | ||
}; | ||
_this.onResizeColEnd = function (e) { | ||
_this.onResizeColMove(e); | ||
var _a = _this, c = _a.c, colWidths = _a.colWidths, resizeIdx = _a.resizeIdx, resizeDeltaX = _a.resizeDeltaX; | ||
var columns = _this.options.columns; | ||
var leftCol = columns[resizeIdx]; | ||
var rightCol = columns[resizeIdx + 1]; | ||
var leftColWidth = colWidths[resizeIdx] + resizeDeltaX; | ||
var rightColWidth = colWidths[resizeIdx + 1] - resizeDeltaX; | ||
var totalWidth = leftColWidth + rightColWidth; | ||
var totalWeight = leftCol.weight + rightCol.weight; | ||
var leftWeight = totalWeight * (leftColWidth / totalWidth); | ||
var rightWeight = totalWeight - leftWeight; | ||
leftCol.weight = leftWeight; | ||
rightCol.weight = rightWeight; | ||
_this.applyColWeights(); | ||
(0, _1.default)(document.body).rmClass(c('resizing')); | ||
$document.off((0, util_1.drag)('move'), _this.onResizeColMove); | ||
$document.off((0, util_1.drag)('end'), _this.onResizeColEnd); | ||
}; | ||
_this.$container.attr('tabindex', '0'); | ||
@@ -65,2 +119,3 @@ _this.resizeSensor = new ResizeSensor_1.default(container); | ||
maxHeight: Infinity, | ||
filter: '', | ||
}); | ||
@@ -72,3 +127,3 @@ var _a = _this.options, columns = _a.columns, minHeight = _a.minHeight, maxHeight = _a.maxHeight; | ||
}); | ||
_this.columnMap[column.id] = column; | ||
_this.colMap[column.id] = column; | ||
}); | ||
@@ -78,2 +133,4 @@ if (maxHeight < minHeight) { | ||
} | ||
; | ||
('width'); | ||
_this.initTpl(); | ||
@@ -88,2 +145,3 @@ _this.$headerRow = _this.find('.header').find('tr'); | ||
_this.renderHeader(); | ||
_this.renderResizers(); | ||
_this.updateWeights(); | ||
@@ -118,4 +176,6 @@ _this.updateHeight(); | ||
else { | ||
this.tableBody.insertBefore(node.container, this.fillerRow); | ||
this.updateHeight(); | ||
if (this.filterNode(node)) { | ||
this.tableBody.insertBefore(node.container, this.fillerRow); | ||
this.updateHeight(); | ||
} | ||
} | ||
@@ -139,3 +199,3 @@ return node; | ||
maxHeight -= 23; | ||
var height = this.nodes.length * 20; | ||
var height = (this.$dataContainer.find('tr').length - 1) * 20; | ||
if (height > minHeight) { | ||
@@ -173,5 +233,16 @@ $fillerRow.hide(); | ||
}; | ||
DataGrid.prototype.onResizeColStart = function (e) { | ||
var _a = this, c = _a.c, resizeIdx = _a.resizeIdx, $resizers = _a.$resizers; | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
e = e.origEvent; | ||
this.resizeStartX = (0, util_1.eventClient)('x', e); | ||
this.resizeStartLeft = (0, util_1.pxToNum)($resizers.eq(resizeIdx).css('left')); | ||
(0, _1.default)(document.body).addClass(c('resizing')); | ||
$document.on((0, util_1.drag)('move'), this.onResizeColMove); | ||
$document.on((0, util_1.drag)('end'), this.onResizeColEnd); | ||
}; | ||
DataGrid.prototype.bindEvent = function () { | ||
var _this = this; | ||
var _a = this, c = _a.c, $headerRow = _a.$headerRow, $tableBody = _a.$tableBody; | ||
var _a = this, c = _a.c, $headerRow = _a.$headerRow, $tableBody = _a.$tableBody, $resizers = _a.$resizers; | ||
this.resizeSensor.addListener(this.onResize); | ||
@@ -197,2 +268,7 @@ var self = this; | ||
}); | ||
$resizers.on((0, util_1.drag)('start'), function (e) { | ||
var $this = (0, _1.default)(this); | ||
self.resizeIdx = (0, toNum_1.default)($this.data('idx')); | ||
self.onResizeColStart(e); | ||
}); | ||
this.on('optionChange', function (name) { | ||
@@ -203,2 +279,4 @@ switch (name) { | ||
_this.updateHeight(); | ||
case 'filter': | ||
_this.renderData(); | ||
break; | ||
@@ -209,3 +287,3 @@ } | ||
DataGrid.prototype.sortNodes = function (id, isAscending) { | ||
var column = this.columnMap[id]; | ||
var column = this.colMap[id]; | ||
var comparator = column.comparator || naturalOrderComparator; | ||
@@ -231,3 +309,3 @@ this.nodes.sort(function (a, b) { | ||
var tableWidth = container.offsetWidth; | ||
if (!this.columnWidthsInitialized && tableWidth) { | ||
if (!this.colWidthsInitialized && tableWidth) { | ||
for (var i = 0, len = columns.length; i < len; i++) { | ||
@@ -241,7 +319,7 @@ var column = columns[i]; | ||
} | ||
this.columnWidthsInitialized = true; | ||
this.colWidthsInitialized = true; | ||
} | ||
this.applyColumnWeights(); | ||
this.applyColWeights(); | ||
}; | ||
DataGrid.prototype.applyColumnWeights = function () { | ||
DataGrid.prototype.applyColWeights = function () { | ||
var _a = this, container = _a.container, $colgroup = _a.$colgroup; | ||
@@ -262,2 +340,3 @@ var columns = this.options.columns; | ||
var lastOffset = 0; | ||
this.colWidths = []; | ||
for (var i = 0; i < len; i++) { | ||
@@ -270,13 +349,50 @@ var column = columns[i]; | ||
html += "<col style=\"width:".concat(width, "px\"></col>"); | ||
this.colWidths[i] = width; | ||
} | ||
$colgroup.html(html); | ||
this.positionResizers(); | ||
}; | ||
DataGrid.prototype.positionResizers = function () { | ||
var colWidths = this.colWidths; | ||
var resizerLeft = []; | ||
var len = colWidths.length - 1; | ||
for (var i = 0; i < len; i++) { | ||
resizerLeft[i] = (resizerLeft[i - 1] || 0) + colWidths[i]; | ||
} | ||
for (var i = 0; i < len; i++) { | ||
this.$resizers.eq(i).css('left', resizerLeft[i] + 'px'); | ||
} | ||
}; | ||
DataGrid.prototype.renderData = function () { | ||
var _this = this; | ||
var _a = this, tableBody = _a.tableBody, nodes = _a.nodes, fillerRow = _a.fillerRow; | ||
(0, each_1.default)(nodes, function (node) { return node.detach(); }); | ||
(0, each_1.default)(nodes, function (node) { | ||
tableBody.insertBefore(node.container, fillerRow); | ||
if (_this.filterNode(node)) { | ||
tableBody.insertBefore(node.container, fillerRow); | ||
} | ||
}); | ||
if (this.selectedNode && !this.filterNode(this.selectedNode)) { | ||
this.selectNode(null); | ||
} | ||
this.updateHeight(); | ||
}; | ||
DataGrid.prototype.filterNode = function (node) { | ||
var filter = this.options.filter; | ||
if (filter) { | ||
if ((0, isFn_1.default)(filter)) { | ||
return filter(node); | ||
} | ||
else if ((0, isRegExp_1.default)(filter)) { | ||
return filter.test(node.text()); | ||
} | ||
else if ((0, isStr_1.default)(filter)) { | ||
filter = (0, trim_1.default)(filter); | ||
if (filter) { | ||
return (0, contain_1.default)((0, lowerCase_1.default)(node.text()), (0, lowerCase_1.default)(filter)); | ||
} | ||
} | ||
} | ||
return true; | ||
}; | ||
DataGrid.prototype.renderHeader = function () { | ||
@@ -299,2 +415,11 @@ var c = this.c; | ||
}; | ||
DataGrid.prototype.renderResizers = function () { | ||
var resizers = ''; | ||
var len = this.options.columns.length - 1; | ||
for (var i = 0; i < len; i++) { | ||
resizers += this.c("<div class=\"resizer\" data-idx=\"".concat(i, "\"></div>")); | ||
} | ||
this.$container.append(resizers); | ||
this.$resizers = this.find('.resizer'); | ||
}; | ||
DataGrid.prototype.initTpl = function () { | ||
@@ -324,2 +449,5 @@ this.$container.html(this.c((0, stripIndent_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n <div class=\"header-container\">\n <table class=\"header\">\n <colgroup></colgroup>\n <tbody>\n <tr></tr>\n </tbody>\n </table>\n </div>\n <div class=\"data-container\">\n <table class=\"data\">\n <colgroup></colgroup>\n <tbody>\n <tr class=\"filler-row\"></tr>\n </tbody>\n </table>\n </div>\n "], ["\n <div class=\"header-container\">\n <table class=\"header\">\n <colgroup></colgroup>\n <tbody>\n <tr></tr>\n </tbody>\n </table>\n </div>\n <div class=\"data-container\">\n <table class=\"data\">\n <colgroup></colgroup>\n <tbody>\n <tr class=\"filler-row\"></tr>\n </tbody>\n </table>\n </div>\n "]))))); | ||
} | ||
DataGridNode.prototype.text = function () { | ||
return this.$container.text(); | ||
}; | ||
DataGridNode.prototype.detach = function () { | ||
@@ -326,0 +454,0 @@ this.$container.remove(); |
export declare function exportCjs(module: any, clazz: any): void; | ||
export declare function classPrefix(name: string): (str: string) => string; | ||
export declare const hasTouchSupport: boolean; | ||
export declare function drag(name: string): any; | ||
@@ -4,0 +5,0 @@ export declare function eventClient(type: string, e: any): any; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resetCanvasSize = exports.getPlatform = exports.pxToNum = exports.executeAfterTransition = exports.hasVerticalScrollbar = exports.measuredScrollbarWidth = exports.eventPage = exports.eventClient = exports.drag = exports.classPrefix = exports.exportCjs = void 0; | ||
exports.resetCanvasSize = exports.getPlatform = exports.pxToNum = exports.executeAfterTransition = exports.hasVerticalScrollbar = exports.measuredScrollbarWidth = exports.eventPage = exports.eventClient = exports.drag = exports.hasTouchSupport = exports.classPrefix = exports.exportCjs = void 0; | ||
var map_1 = __importDefault(require("licia/map")); | ||
@@ -64,3 +64,3 @@ var trim_1 = __importDefault(require("licia/trim")); | ||
} | ||
var hasTouchSupport = 'ontouchstart' in root_1.default; | ||
exports.hasTouchSupport = 'ontouchstart' in root_1.default; | ||
var touchEvents = { | ||
@@ -77,3 +77,3 @@ start: 'touchstart', | ||
function drag(name) { | ||
return hasTouchSupport ? touchEvents[name] : mouseEvents[name]; | ||
return exports.hasTouchSupport ? touchEvents[name] : mouseEvents[name]; | ||
} | ||
@@ -80,0 +80,0 @@ exports.drag = drag; |
@@ -15,2 +15,3 @@ import Component, { IComponentOptions } from '../share/Component'; | ||
minHeight?: number; | ||
filter?: string | RegExp | types.AnyFn; | ||
} | ||
@@ -27,2 +28,7 @@ export interface IDataGridNodeOptions { | ||
private $dataContainer; | ||
private $resizers; | ||
private resizeIdx; | ||
private resizeStartX; | ||
private resizeStartLeft; | ||
private resizeDeltaX; | ||
private resizeSensor; | ||
@@ -32,7 +38,8 @@ private onResize; | ||
private nodes; | ||
private columnWidthsInitialized; | ||
private columnMap; | ||
private colWidthsInitialized; | ||
private colMap; | ||
private sortId?; | ||
private selectedNode; | ||
private isAscending; | ||
private colWidths; | ||
constructor(container: HTMLElement, options: IOptions); | ||
@@ -45,8 +52,14 @@ destroy(): void; | ||
private selectNode; | ||
private onResizeColStart; | ||
private onResizeColMove; | ||
private onResizeColEnd; | ||
private bindEvent; | ||
private sortNodes; | ||
private updateWeights; | ||
private applyColumnWeights; | ||
private applyColWeights; | ||
private positionResizers; | ||
private renderData; | ||
private filterNode; | ||
private renderHeader; | ||
private renderResizers; | ||
private initTpl; | ||
@@ -61,2 +74,3 @@ } | ||
constructor(dataGrid: DataGrid, data: types.PlainObj<string | HTMLElement>, options?: IDataGridNodeOptions); | ||
text(): string; | ||
detach(): void; | ||
@@ -63,0 +77,0 @@ select(): void; |
@@ -15,11 +15,65 @@ import $ from 'licia/$'; | ||
import isNull from 'licia/isNull'; | ||
import { exportCjs } from '../share/util'; | ||
import isFn from 'licia/isFn'; | ||
import isRegExp from 'licia/isRegExp'; | ||
import isStr from 'licia/isStr'; | ||
import trim from 'licia/trim'; | ||
import contain from 'licia/contain'; | ||
import toNum from 'licia/toNum'; | ||
import lowerCase from 'licia/lowerCase'; | ||
import clamp from 'licia/clamp'; | ||
import max from 'licia/max'; | ||
import min from 'licia/min'; | ||
import { exportCjs, drag, eventClient, pxToNum } from '../share/util'; | ||
const $document = $(document); | ||
const MIN_COL_WIDTH = 24; | ||
export default class DataGrid extends Component { | ||
constructor(container, options) { | ||
super(container, { compName: 'data-grid' }, options); | ||
this.resizeIdx = 0; | ||
this.resizeStartX = 0; | ||
this.resizeStartLeft = 0; | ||
this.resizeDeltaX = 0; | ||
this.nodes = []; | ||
this.columnWidthsInitialized = false; | ||
this.columnMap = {}; | ||
this.colWidthsInitialized = false; | ||
this.colMap = {}; | ||
this.selectedNode = null; | ||
this.isAscending = true; | ||
this.colWidths = []; | ||
this.onResizeColMove = (e) => { | ||
const { resizeIdx, $resizers, colWidths, $colgroup } = this; | ||
e = e.origEvent; | ||
let deltaX = eventClient('x', e) - this.resizeStartX; | ||
const leftColWidth = colWidths[resizeIdx]; | ||
const rightColWidth = colWidths[resizeIdx + 1]; | ||
const lowerBound = min(-leftColWidth + MIN_COL_WIDTH, 0); | ||
const upperBound = max(rightColWidth - MIN_COL_WIDTH, 0); | ||
deltaX = clamp(deltaX, lowerBound, upperBound); | ||
$colgroup.each(function () { | ||
const $cols = $(this).find('col'); | ||
$cols.eq(resizeIdx).css('width', leftColWidth + deltaX + 'px'); | ||
$cols.eq(resizeIdx + 1).css('width', rightColWidth - deltaX + 'px'); | ||
}); | ||
this.resizeDeltaX = deltaX; | ||
let newLeft = this.resizeStartLeft + deltaX; | ||
$resizers.eq(resizeIdx).css('left', `${newLeft}px`); | ||
}; | ||
this.onResizeColEnd = (e) => { | ||
this.onResizeColMove(e); | ||
const { c, colWidths, resizeIdx, resizeDeltaX } = this; | ||
const { columns } = this.options; | ||
const leftCol = columns[resizeIdx]; | ||
const rightCol = columns[resizeIdx + 1]; | ||
const leftColWidth = colWidths[resizeIdx] + resizeDeltaX; | ||
const rightColWidth = colWidths[resizeIdx + 1] - resizeDeltaX; | ||
const totalWidth = leftColWidth + rightColWidth; | ||
const totalWeight = leftCol.weight + rightCol.weight; | ||
const leftWeight = totalWeight * (leftColWidth / totalWidth); | ||
const rightWeight = totalWeight - leftWeight; | ||
leftCol.weight = leftWeight; | ||
rightCol.weight = rightWeight; | ||
this.applyColWeights(); | ||
$(document.body).rmClass(c('resizing')); | ||
$document.off(drag('move'), this.onResizeColMove); | ||
$document.off(drag('end'), this.onResizeColEnd); | ||
}; | ||
this.$container.attr('tabindex', '0'); | ||
@@ -38,2 +92,3 @@ this.resizeSensor = new ResizeSensor(container); | ||
maxHeight: Infinity, | ||
filter: '', | ||
}); | ||
@@ -45,3 +100,3 @@ const { columns, minHeight, maxHeight } = this.options; | ||
}); | ||
this.columnMap[column.id] = column; | ||
this.colMap[column.id] = column; | ||
}); | ||
@@ -51,2 +106,4 @@ if (maxHeight < minHeight) { | ||
} | ||
; | ||
('width'); | ||
this.initTpl(); | ||
@@ -61,2 +118,3 @@ this.$headerRow = this.find('.header').find('tr'); | ||
this.renderHeader(); | ||
this.renderResizers(); | ||
this.updateWeights(); | ||
@@ -90,4 +148,6 @@ this.updateHeight(); | ||
else { | ||
this.tableBody.insertBefore(node.container, this.fillerRow); | ||
this.updateHeight(); | ||
if (this.filterNode(node)) { | ||
this.tableBody.insertBefore(node.container, this.fillerRow); | ||
this.updateHeight(); | ||
} | ||
} | ||
@@ -111,3 +171,3 @@ return node; | ||
maxHeight -= 23; | ||
let height = this.nodes.length * 20; | ||
let height = (this.$dataContainer.find('tr').length - 1) * 20; | ||
if (height > minHeight) { | ||
@@ -144,4 +204,15 @@ $fillerRow.hide(); | ||
} | ||
onResizeColStart(e) { | ||
const { c, resizeIdx, $resizers } = this; | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
e = e.origEvent; | ||
this.resizeStartX = eventClient('x', e); | ||
this.resizeStartLeft = pxToNum($resizers.eq(resizeIdx).css('left')); | ||
$(document.body).addClass(c('resizing')); | ||
$document.on(drag('move'), this.onResizeColMove); | ||
$document.on(drag('end'), this.onResizeColEnd); | ||
} | ||
bindEvent() { | ||
const { c, $headerRow, $tableBody } = this; | ||
const { c, $headerRow, $tableBody, $resizers } = this; | ||
this.resizeSensor.addListener(this.onResize); | ||
@@ -167,2 +238,7 @@ const self = this; | ||
}); | ||
$resizers.on(drag('start'), function (e) { | ||
const $this = $(this); | ||
self.resizeIdx = toNum($this.data('idx')); | ||
self.onResizeColStart(e); | ||
}); | ||
this.on('optionChange', (name) => { | ||
@@ -173,2 +249,4 @@ switch (name) { | ||
this.updateHeight(); | ||
case 'filter': | ||
this.renderData(); | ||
break; | ||
@@ -179,3 +257,3 @@ } | ||
sortNodes(id, isAscending) { | ||
const column = this.columnMap[id]; | ||
const column = this.colMap[id]; | ||
const comparator = column.comparator || naturalOrderComparator; | ||
@@ -201,3 +279,3 @@ this.nodes.sort(function (a, b) { | ||
const tableWidth = container.offsetWidth; | ||
if (!this.columnWidthsInitialized && tableWidth) { | ||
if (!this.colWidthsInitialized && tableWidth) { | ||
for (let i = 0, len = columns.length; i < len; i++) { | ||
@@ -211,7 +289,7 @@ const column = columns[i]; | ||
} | ||
this.columnWidthsInitialized = true; | ||
this.colWidthsInitialized = true; | ||
} | ||
this.applyColumnWeights(); | ||
this.applyColWeights(); | ||
} | ||
applyColumnWeights() { | ||
applyColWeights() { | ||
const { container, $colgroup } = this; | ||
@@ -232,2 +310,3 @@ const { columns } = this.options; | ||
let lastOffset = 0; | ||
this.colWidths = []; | ||
for (let i = 0; i < len; i++) { | ||
@@ -240,5 +319,18 @@ const column = columns[i]; | ||
html += `<col style="width:${width}px"></col>`; | ||
this.colWidths[i] = width; | ||
} | ||
$colgroup.html(html); | ||
this.positionResizers(); | ||
} | ||
positionResizers() { | ||
const { colWidths } = this; | ||
const resizerLeft = []; | ||
const len = colWidths.length - 1; | ||
for (let i = 0; i < len; i++) { | ||
resizerLeft[i] = (resizerLeft[i - 1] || 0) + colWidths[i]; | ||
} | ||
for (let i = 0; i < len; i++) { | ||
this.$resizers.eq(i).css('left', resizerLeft[i] + 'px'); | ||
} | ||
} | ||
renderData() { | ||
@@ -248,6 +340,29 @@ const { tableBody, nodes, fillerRow } = this; | ||
each(nodes, (node) => { | ||
tableBody.insertBefore(node.container, fillerRow); | ||
if (this.filterNode(node)) { | ||
tableBody.insertBefore(node.container, fillerRow); | ||
} | ||
}); | ||
if (this.selectedNode && !this.filterNode(this.selectedNode)) { | ||
this.selectNode(null); | ||
} | ||
this.updateHeight(); | ||
} | ||
filterNode(node) { | ||
let { filter } = this.options; | ||
if (filter) { | ||
if (isFn(filter)) { | ||
return filter(node); | ||
} | ||
else if (isRegExp(filter)) { | ||
return filter.test(node.text()); | ||
} | ||
else if (isStr(filter)) { | ||
filter = trim(filter); | ||
if (filter) { | ||
return contain(lowerCase(node.text()), lowerCase(filter)); | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
renderHeader() { | ||
@@ -270,2 +385,11 @@ const { c } = this; | ||
} | ||
renderResizers() { | ||
let resizers = ''; | ||
const len = this.options.columns.length - 1; | ||
for (let i = 0; i < len; i++) { | ||
resizers += this.c(`<div class="resizer" data-idx="${i}"></div>`); | ||
} | ||
this.$container.append(resizers); | ||
this.$resizers = this.find('.resizer'); | ||
} | ||
initTpl() { | ||
@@ -309,2 +433,5 @@ this.$container.html(this.c(stripIndent ` | ||
} | ||
text() { | ||
return this.$container.text(); | ||
} | ||
detach() { | ||
@@ -311,0 +438,0 @@ this.$container.remove(); |
export declare function exportCjs(module: any, clazz: any): void; | ||
export declare function classPrefix(name: string): (str: string) => string; | ||
export declare const hasTouchSupport: boolean; | ||
export declare function drag(name: string): any; | ||
@@ -4,0 +5,0 @@ export declare function eventClient(type: string, e: any): any; |
@@ -55,3 +55,3 @@ import map from 'licia/map'; | ||
} | ||
const hasTouchSupport = 'ontouchstart' in root; | ||
export const hasTouchSupport = 'ontouchstart' in root; | ||
const touchEvents = { | ||
@@ -58,0 +58,0 @@ start: 'touchstart', |
@@ -1,2 +0,2 @@ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.LunaDataGrid=n():t.LunaDataGrid=n()}(window,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="/assets/",e(e.s=42)}([function(t,n,e){var r=e(10),i=e(4),o=e(24);n=function(t,n,e){var s,u;if(n=o(n,e),r(t))for(s=0,u=t.length;s<u;s++)n(t[s],s,t);else{var a=i(t);for(s=0,u=a.length;s<u;s++)n(t[a[s]],a[s],t)}return t},t.exports=n},function(t,n,e){var r=e(15);n=function(t){return"[object String]"===r(t)},t.exports=n},function(t,n){n=function(t){return void 0===t},t.exports=n},function(t,n,e){var r=e(1),i=e(7),o=e(23);n=function(t){return i(r(t)?new o(t):t)},t.exports=n},function(t,n,e){var r=e(11);n=Object.keys?Object.keys:function(t){var n=[];for(var e in t)r(t,e)&&n.push(e);return n},t.exports=n},function(t,n){n=function(t){var n=typeof t;return!!t&&("function"===n||"object"===n)},t.exports=n},function(t,n,e){var r=e(15);n=function(t){var n=r(t);return"[object Function]"===n||"[object GeneratorFunction]"===n||"[object AsyncFunction]"===n},t.exports=n},function(t,n,e){var r=e(10),i=e(18),o=e(8),s=e(1);n=function(t){return t?o(t)?t:r(t)&&!s(t)?i(t):[t]:[]},t.exports=n},function(t,n,e){var r=e(15);n=Array.isArray?Array.isArray:function(t){return"[object Array]"===r(t)},t.exports=n},function(t,n,e){var r=e(13),i=e(7),o=e(55),s=e(26),u=e(57);var a=(n=function(t,n){return a.extend(t,n)}).Base=function t(n,e,a){a=a||{};var c=e.className||s(e,"initialize.name")||"";delete e.className;var f=function(){var t=i(arguments);return this.initialize&&this.initialize.apply(this,t)||this};if(!u)try{f=new Function("toArr","return function "+c+"(){var args = toArr(arguments);return this.initialize ? this.initialize.apply(this, args) || this : this;};")(i)}catch(t){}return o(f,n),f.prototype.constructor=f,f.extend=function(n,e){return t(f,n,e)},f.inherits=function(t){o(f,t)},f.methods=function(t){return r(f.prototype,t),f},f.statics=function(t){return r(f,t),f},f.methods(e).statics(a),f}(Object,{className:"Base",callSuper:function(t,n,e){return t.prototype[n].apply(this,e)},toString:function(){return this.constructor.name}});t.exports=n},function(t,n,e){var r=e(14),i=e(6),o=Math.pow(2,53)-1;n=function(t){if(!t)return!1;var n=t.length;return r(n)&&n>=0&&n<=o&&!i(t)},t.exports=n},function(t,n){var e=Object.prototype.hasOwnProperty;n=function(t,n){return e.call(t,n)},t.exports=n},function(t,n,e){var r=e(6),i=e(5),o=e(8),s=e(24),u=e(49),a=e(52),c=e(53);n=function(t,n,e){return null==t?a:r(t)?s(t,n,e):i(t)&&!o(t)?u(t):c(t)},t.exports=n},function(t,n,e){n=e(17)(e(25)),t.exports=n},function(t,n,e){var r=e(15);n=function(t){return"[object Number]"===r(t)},t.exports=n},function(t,n){var e=Object.prototype.toString;n=function(t){return e.call(t)},t.exports=n},function(t,n,e){var r=e(61),i=e(1),o=e(10),s=e(62);n=function(t,n){return i(t)?t.indexOf(n)>-1:(o(t)||(t=s(t)),r(t,n)>=0)},t.exports=n},function(t,n,e){var r=e(2),i=e(0);n=function(t,n){return function(e){return i(arguments,(function(o,s){if(0!==s){var u=t(o);i(u,(function(t){n&&!r(e[t])||(e[t]=o[t])}))}})),e}},t.exports=n},function(t,n,e){var r=e(12),i=e(4),o=e(10);n=function(t,n,e){n=r(n,e);for(var s=!o(t)&&i(t),u=(s||t).length,a=Array(u),c=0;c<u;c++){var f=s?s[c]:c;a[c]=n(t[f],f,t)}return a},t.exports=n},function(t,n,e){var r=e(1),i=e(5),o=e(28),s=e(2),u=e(16),a=e(14),c=e(3),f=e(63),l=e(0);n=function(t,n,e){if(t=c(t),s(e)&&r(n))return function(t,n){return t.style[f(n)]||getComputedStyle(t,"").getPropertyValue(n)}(t[0],n);var p=n;i(p)||((p={})[n]=e),function(t,n){l(t,(function(t){var e=";";l(n,(function(t,n){n=f.dash(n),e+=n+":"+function(t,n){return a(n)&&!u(h,o(t))?n+"px":n}(n,t)+";"})),t.style.cssText+=e}))}(t,p)};var h=["column-count","columns","font-weight","line-weight","opacity","z-index","zoom"];t.exports=n},function(t,n,e){(function(r){var i=e(37);n=i?window:r,t.exports=n}).call(this,e(83))},function(t,n){n=function(t,n){return 0===t.indexOf(n)},t.exports=n},function(t,n,e){var r=e(23),i=e(59),o=e(60),s=e(19),u=e(30),a=e(67),c=e(31),f=e(68),l=e(69),h=e(32),p=e(33),d=e(72),v=e(2),g=e(1);n=function(t){return new r(t)},r.methods({offset:function(){return i(this)},hide:function(){return this.css("display","none")},show:function(){return o(this),this},first:function(){return n(this[0])},last:function(){return n(c(this))},get:function(t){return this[t]},eq:function(t){return n(this[t])},on:function(t,n,e){return h.on(this,t,n,e),this},off:function(t,n,e){return h.off(this,t,n,e),this},html:function(t){var n=a.html(this,t);return v(t)?n:this},text:function(t){var n=a.text(this,t);return v(t)?n:this},val:function(t){var n=a.val(this,t);return v(t)?n:this},css:function(t,n){var e=s(this,t,n);return m(t,n)?e:this},attr:function(t,n){var e=u(this,t,n);return m(t,n)?e:this},data:function(t,n){var e=l(this,t,n);return m(t,n)?e:this},rmAttr:function(t){return u.remove(this,t),this},remove:function(){return f(this),this},addClass:function(t){return p.add(this,t),this},rmClass:function(t){return p.remove(this,t),this},toggleClass:function(t){return p.toggle(this,t),this},hasClass:function(t){return p.has(this,t)},parent:function(){return n(this[0].parentNode)},append:function(t){return d.append(this,t),this},prepend:function(t){return d.prepend(this,t),this},before:function(t){return d.before(this,t),this},after:function(t){return d.after(this,t),this}});var m=function(t,n){return v(n)&&g(t)};t.exports=n},function(t,n,e){var r=e(9),i=e(1),o=e(0),s=e(58),u=new(n=r({className:"Select",initialize:function(t){return this.length=0,t?i(t)?u.find(t):void(t.nodeType&&(this[0]=t,this.length=1)):this},find:function(t){var e=new n;return this.each((function(){s(e,this.querySelectorAll(t))})),e},each:function(t){return o(this,(function(n,e){t.call(n,e,n)})),this}}))(document);t.exports=n},function(t,n,e){var r=e(2);n=function(t,n,e){if(r(n))return t;switch(null==e?3:e){case 1:return function(e){return t.call(n,e)};case 3:return function(e,r,i){return t.call(n,e,r,i)};case 4:return function(e,r,i,o){return t.call(n,e,r,i,o)}}return function(){return t.apply(n,arguments)}},t.exports=n},function(t,n,e){var r=e(4),i=e(46),o=e(47),s=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols;n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=n.prototype,a=void 0===e||e,c=n.unenumerable,f=void 0!==c&&c,l=n.symbol,h=void 0!==l&&l,p=[];if((f||h)&&s){var d=r;f&&s&&(d=s);do{p=p.concat(d(t)),h&&u&&(p=p.concat(u(t)))}while(a&&(t=i(t))&&t!==Object.prototype);p=o(p)}else if(a)for(var v in t)p.push(v);else p=r(t);return p},t.exports=n},function(t,n,e){var r=e(2),i=e(54);n=function(t,n){var e;for(e=(n=i(n,t)).shift();!r(e);){if(null==(t=t[e]))return;e=n.shift()}return t},t.exports=n},function(t,n){n=function(t,n){return n=null==n?t.length-1:+n,function(){var e,r=Math.max(arguments.length-n,0),i=new Array(r);for(e=0;e<r;e++)i[e]=arguments[e+n];switch(n){case 0:return t.call(this,i);case 1:return t.call(this,arguments[0],i);case 2:return t.call(this,arguments[0],arguments[1],i)}var o=new Array(n+1);for(e=0;e<n;e++)o[e]=arguments[e];return o[n]=i,t.apply(this,o)}},t.exports=n},function(t,n,e){var r=e(29);n=function(t){return r(t).join("-")},t.exports=n},function(t,n){var e=/([A-Z])/g,r=/[_.\- ]+/g,i=/(^-)|(-$)/g;n=function(t){return(t=t.replace(e,"-$1").toLowerCase().replace(r,"-").replace(i,"")).split("-")},t.exports=n},function(t,n,e){var r=e(7),i=e(5),o=e(1),s=e(0),u=e(2),a=e(3);(n=function(t,n,e){if(t=a(t),u(e)&&o(n))return function(t,n){return t.getAttribute(n)}(t[0],n);var r=n;i(r)||((r={})[n]=e),function(t,n){s(t,(function(t){s(n,(function(n,e){t.setAttribute(e,n)}))}))}(t,r)}).remove=function(t,n){t=a(t),n=r(n),s(t,(function(t){s(n,(function(n){t.removeAttribute(n)}))}))},t.exports=n},function(t,n){n=function(t){var n=t?t.length:0;if(n)return t[n-1]},t.exports=n},function(t,n,e){var r=e(70),i=e(2),o=e(3),s=e(0);function u(t){return function(n,e,u,a){n=o(n),i(a)&&(a=u,u=void 0),s(n,(function(n){r[t](n,e,u,a)}))}}n={on:u("add"),off:u("remove")},t.exports=n},function(t,n,e){var r=e(7),i=e(71),o=e(3),s=e(1),u=e(0);function a(t){return s(t)?t.split(/\s+/):r(t)}n={add:function(t,e){t=o(t);var r=a(e);u(t,(function(t){var e=[];u(r,(function(r){n.has(t,r)||e.push(r)})),0!==e.length&&(t.className+=(t.className?" ":"")+e.join(" "))}))},has:function(t,n){t=o(t);var e=new RegExp("(^|\\s)"+n+"(\\s|$)");return i(t,(function(t){return e.test(t.className)}))},toggle:function(t,e){t=o(t),u(t,(function(t){if(!n.has(t,e))return n.add(t,e);n.remove(t,e)}))},remove:function(t,n){t=o(t);var e=a(n);u(t,(function(t){u(e,(function(n){t.classList.remove(n)}))}))}},t.exports=n},function(t,n,e){var r=e(75),i=e(76);n=function(t,n){return null==n&&t.trim?t.trim():r(i(t,n),n)},t.exports=n},function(t,n,e){var r=e(5),i=e(8),o=e(13);n=function(t){return r(t)?i(t)?t.slice():o({},t):t},t.exports=n},function(t,n,e){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0}),n.resetCanvasSize=n.getPlatform=n.pxToNum=n.executeAfterTransition=n.hasVerticalScrollbar=n.measuredScrollbarWidth=n.eventPage=n.eventClient=n.drag=n.classPrefix=n.exportCjs=void 0;var i=r(e(18)),o=r(e(34)),s=r(e(20)),u=r(e(84)),a=r(e(14)),c=r(e(16)),f=r(e(91)),l=r(e(92)),h=r(e(93));n.exportCjs=function(t,n){try{t.exports=n,t.exports.default=n}catch(t){}},n.classPrefix=function(t){var n="luna-".concat(t,"-");function e(t){return(0,i.default)((0,o.default)(t).split(/\s+/),(function(t){return(0,c.default)(t,n)?t:t.replace(/[\w-]+/,(function(t){return"".concat(n).concat(t)}))})).join(" ")}return function(t){if(/<[^>]*>/g.test(t))try{var n=u.default.parse(t);return function t(n,e){for(var r=0,i=n.length;r<i;r++){var o=n[r];e(o),o.content&&t(o.content,e)}}(n,(function(t){t.attrs&&t.attrs.class&&(t.attrs.class=e(t.attrs.class))})),u.default.stringify(n)}catch(n){return e(t)}return e(t)}};var p,d="ontouchstart"in s.default,v={start:"touchstart",move:"touchmove",end:"touchend"},g={start:"mousedown",move:"mousemove",end:"mouseup"};n.drag=function(t){return d?v[t]:g[t]},n.eventClient=function(t,n){var e="x"===t?"clientX":"clientY";return n[e]?n[e]:n.changedTouches?n.changedTouches[0][e]:0},n.eventPage=function(t,n){var e="x"===t?"pageX":"pageY";return n[e]?n[e]:n.changedTouches?n.changedTouches[0][e]:0},n.measuredScrollbarWidth=function(){if((0,a.default)(p))return p;if(!document)return 16;var t=document.createElement("div"),n=document.createElement("div");t.setAttribute("style","display: block; width: 100px; height: 100px; overflow: scroll;"),n.setAttribute("style","height: 200px"),t.appendChild(n);var e=document.body||document.documentElement;return e.appendChild(t),p=t.offsetWidth-t.clientWidth,e.removeChild(t),p},n.hasVerticalScrollbar=function(t){return t.scrollHeight>t.offsetHeight},n.executeAfterTransition=function(t,n){if((0,h.default)(t))return n();var e=function(r){r.target===t&&(t.removeEventListener("transitionend",e),n())};t.addEventListener("transitionend",e)},n.pxToNum=function(t){return(0,f.default)(t.replace("px",""))},n.getPlatform=function(){var t=(0,l.default)();return"os x"===t?"mac":t},n.resetCanvasSize=function(t){t.width=Math.round(t.offsetWidth*window.devicePixelRatio),t.height=Math.round(t.offsetHeight*window.devicePixelRatio)}},function(t,n){n="object"==typeof window&&"object"==typeof document&&9===document.nodeType,t.exports=n},function(t,n){n=function(t){return null==t?"":t.toString()},t.exports=n},function(t,n,e){n=e(17)(e(25),!0),t.exports=n},function(t,n,e){var r=e(41),i=e(1),o=e(21),s=e(33),u=e(19),a=e(0),c=e(6);function f(t){for(var n="div",e="",r=[],i=[],s="",u=0,a=t.length;u<a;u++){var c=t[u];"#"===c||"."===c?(i.push(s),s=c):s+=c}i.push(s);for(var f=0,l=i.length;f<l;f++)(s=i[f])&&(o(s,"#")?e=s.slice(1):o(s,".")?r.push(s.slice(1)):n=s);return{tagName:n,id:e,classes:r}}n=function(t,n){for(var e=arguments.length,l=new Array(e>2?e-2:0),h=2;h<e;h++)l[h-2]=arguments[h];(r(n)||i(n))&&(l.unshift(n),n=null),n||(n={});var p=f(t),d=p.tagName,v=p.id,g=p.classes,m=document.createElement(d);return v&&m.setAttribute("id",v),s.add(m,g),a(l,(function(t){i(t)?m.appendChild(document.createTextNode(t)):r(t)&&m.appendChild(t)})),a(n,(function(t,n){i(t)?m.setAttribute(n,t):c(t)&&o(n,"on")?m.addEventListener(n.slice(2),t,!1):"style"===n&&u(m,t)})),m},t.exports=n},function(t,n){n=function(t){return!(!t||1!==t.nodeType)},t.exports=n},function(t,n,e){e(43),t.exports=e(44)},function(t,n,e){},function(t,n,e){"use strict";(function(t){var r,i=this&&this.__extends||(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),o=this&&this.__makeTemplateObject||function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0}),n.DataGridNode=void 0;var u=s(e(22)),a=s(e(73)),c=s(e(77)),f=s(e(0)),l=s(e(95)),h=s(e(40)),p=s(e(38)),d=s(e(41)),v=s(e(2)),g=s(e(96)),m=s(e(98)),x=s(e(39)),y=s(e(21)),b=s(e(100)),_=e(36),w=function(t){function n(n,e){var r=t.call(this,n,{compName:"data-grid"},e)||this;r.nodes=[],r.columnWidthsInitialized=!1,r.columnMap={},r.selectedNode=null,r.isAscending=!0,r.$container.attr("tabindex","0"),r.resizeSensor=new g.default(n),r.onResize=(0,m.default)((function(){r.updateHeight(),r.updateWeights()}),16),e.height&&(e.maxHeight=e.height,e.minHeight=e.height),r.initOptions(e,{minHeight:41,maxHeight:1/0});var i=r.options,o=i.columns,s=i.minHeight,u=i.maxHeight;return(0,f.default)(o,(function(t){(0,x.default)(t,{sortable:!1}),r.columnMap[t.id]=t})),u<s&&r.setOption("maxHeight",s),r.initTpl(),r.$headerRow=r.find(".header").find("tr"),r.$fillerRow=r.find(".filler-row"),r.fillerRow=r.$fillerRow.get(0),r.$tableBody=r.find(".data").find("tbody"),r.tableBody=r.$tableBody.get(0),r.$colgroup=r.$container.find("colgroup"),r.$dataContainer=r.find(".data-container"),r.renderHeader(),r.updateWeights(),r.updateHeight(),r.bindEvent(),r}return i(n,t),n.prototype.destroy=function(){t.prototype.destroy.call(this),this.resizeSensor.destroy(),this.$container.rmAttr("tabindex")},n.prototype.remove=function(t){var n=this.nodes,e=n.indexOf(t);e>-1&&(t.detach(),n.splice(e,1),t===this.selectedNode&&this.selectNode(n[e]||n[e-1]||null),this.updateHeight())},n.prototype.append=function(t,n){var e=new O(this,t,n);return this.nodes.push(e),this.sortId?this.sortNodes(this.sortId,this.isAscending):(this.tableBody.insertBefore(e.container,this.fillerRow),this.updateHeight()),e},n.prototype.clear=function(){(0,f.default)(this.nodes,(function(t){return t.detach()})),this.nodes=[],this.selectNode(null),this.updateHeight()},n.prototype.updateHeight=function(){var t=this.$fillerRow,n=this.options,e=n.maxHeight,r=n.minHeight;this.$dataContainer.css({height:"auto"}),(r-=23)<0&&(r=0),e-=23;var i=20*this.nodes.length;i>r?t.hide():t.show(),i<r?i=r:i>=e&&(i=e),this.$dataContainer.css({height:i})},n.prototype.selectNode=function(t){var n;((0,b.default)(t)||(null==t?void 0:t.selectable))&&(this.selectedNode&&(this.selectedNode.deselect(),this.selectedNode=null),(0,b.default)(t)?this.emit("deselect"):(this.selectedNode=t,null===(n=this.selectedNode)||void 0===n||n.select(),this.emit("select",t)))},n.prototype.bindEvent=function(){var t=this,n=this.c,e=this.$headerRow,r=this.$tableBody;this.resizeSensor.addListener(this.onResize);var i=this;r.on("click",n(".node"),(function(){i.selectNode(this.dataGridNode)})),e.on("click",n(".sortable"),(function(t){t.stopPropagation();var n=(0,u.default)(this),r=n.data("id"),o="descending"!==n.data("order");n.data("order",o?"descending":"ascending"),i.sortNodes(r,o),e.find("th").each((function(){var t=(0,u.default)(this);t.data("id")!==r&&t.rmAttr("data-order")}))})),this.on("optionChange",(function(n){switch(n){case"minHeight":case"maxHeight":t.updateHeight()}}))},n.prototype.sortNodes=function(t,n){var e=this.columnMap[t].comparator||z;this.nodes.sort((function(r,i){var o=r.data[t],s=i.data[t];return(0,d.default)(o)&&(o=o.innerText),(0,d.default)(s)&&(s=s.innerText),n?e(o,s):e(s,o)})),this.renderData(),this.sortId=t,this.isAscending=n},n.prototype.updateWeights=function(){var t=this.container,n=this.$headerRow,e=this.options.columns,r=t.offsetWidth;if(!this.columnWidthsInitialized&&r){for(var i=0,o=e.length;i<o;i++){var s=e[i];if(!s.weight){var u=n.find("th").get(i).offsetWidth;s.weight=100*u/r}}this.columnWidthsInitialized=!0}this.applyColumnWeights()},n.prototype.applyColumnWeights=function(){var t=this.container,n=this.$colgroup,e=this.options.columns,r=t.offsetWidth;if(!(r<=0)){for(var i=0,o=e.length,s=0;s<o;s++)i+=e[s].weight;var u="",a=0,c=0;for(s=0;s<o;s++){var f=(a+=e[s].weight)*r/i|0,l=Math.max(f-c,14);c=f,u+='<col style="width:'.concat(l,'px"></col>')}n.html(u)}},n.prototype.renderData=function(){var t=this.tableBody,n=this.nodes,e=this.fillerRow;(0,f.default)(n,(function(t){return t.detach()})),(0,f.default)(n,(function(n){t.insertBefore(n.container,e)})),this.updateHeight()},n.prototype.renderHeader=function(){var t=this.c,n="",e="";(0,f.default)(this.options.columns,(function(r){var i=(0,l.default)(r.title);r.sortable?n+=t('<th class="sortable" data-id="'.concat(r.id,'">').concat(i,"</th>")):n+="<th>".concat(i,"</th>"),e+="<td></td>"})),this.$headerRow.html(n),this.$fillerRow.html(e)},n.prototype.initTpl=function(){this.$container.html(this.c((0,a.default)(C||(C=o(['\n <div class="header-container">\n <table class="header">\n <colgroup></colgroup>\n <tbody>\n <tr></tr>\n </tbody>\n </table>\n </div>\n <div class="data-container">\n <table class="data">\n <colgroup></colgroup>\n <tbody>\n <tr class="filler-row"></tr>\n </tbody>\n </table>\n </div>\n '],['\n <div class="header-container">\n <table class="header">\n <colgroup></colgroup>\n <tbody>\n <tr></tr>\n </tbody>\n </table>\n </div>\n <div class="data-container">\n <table class="data">\n <colgroup></colgroup>\n <tbody>\n <tr class="filler-row"></tr>\n </tbody>\n </table>\n </div>\n '])))))},n}(c.default);n.default=w;var C,O=function(){function t(t,n,e){void 0===e&&(e={selectable:!1}),this.container=(0,h.default)("tr"),this.selectable=!1,this.container.dataGridNode=this,this.$container=(0,u.default)(this.container),this.$container.addClass(t.c("node")),this.dataGrid=t,this.data=n,e.selectable&&(this.selectable=e.selectable),this.render()}return t.prototype.detach=function(){this.$container.remove()},t.prototype.select=function(){this.$container.addClass(this.dataGrid.c("selected"))},t.prototype.deselect=function(){this.$container.rmClass(this.dataGrid.c("selected"))},t.prototype.render=function(){var t=this.data,n=this.$container,e=this.container,r=this.dataGrid.getOption("columns");n.html(""),(0,f.default)(r,(function(n){var r=(0,h.default)("td"),i=t[n.id];(0,v.default)(i)||((0,d.default)(i)?r.appendChild(i):r.innerText=(0,p.default)(i)),e.appendChild(r)}))},t}();function z(t,n){if(t=(0,p.default)(t),n=(0,p.default)(n),(0,y.default)(t,"_")&&!(0,y.default)(n,"_"))return 1;if((0,y.default)(n,"_")&&!(0,y.default)(t,"_"))return-1;for(var e,r,i,o,s=/^\d+|^\D+/;;){if(!t)return n?-1:0;if(!n)return 1;if(e=t.match(s)[0],r=n.match(s)[0],i=!isNaN(e),o=!isNaN(r),i&&!o)return-1;if(o&&!i)return 1;if(i&&o){var u=e-r;if(u)return u;if(e.length!==r.length)return+e||+r?r.length-e.length:e.length-r.length}else if(e!==r)return e<r?-1:1;t=t.substring(e.length),n=n.substring(r.length)}}n.DataGridNode=O,(0,_.exportCjs)(t,w)}).call(this,e(45)(t))},function(t,n){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,n,e){var r=e(5),i=e(6),o=Object.getPrototypeOf,s={}.constructor;n=function(t){if(r(t)){if(o)return o(t);var n=t.__proto__;return n||null===n?n:i(t.constructor)?t.constructor.prototype:t instanceof s?s.prototype:void 0}},t.exports=n},function(t,n,e){var r=e(48);function i(t,n){return t===n}n=function(t,n){return n=n||i,r(t,(function(t,e,r){for(var i=r.length;++e<i;)if(n(t,r[e]))return!1;return!0}))},t.exports=n},function(t,n,e){var r=e(12),i=e(0);n=function(t,n,e){var o=[];return n=r(n,e),i(t,(function(t,e,r){n(t,e,r)&&o.push(t)})),o},t.exports=n},function(t,n,e){var r=e(50),i=e(51);n=function(t){return t=r({},t),function(n){return i(n,t)}},t.exports=n},function(t,n,e){var r=e(4);n=e(17)(r),t.exports=n},function(t,n,e){var r=e(4);n=function(t,n){var e=r(n),i=e.length;if(null==t)return!i;t=Object(t);for(var o=0;o<i;o++){var s=e[o];if(n[s]!==t[s]||!(s in t))return!1}return!0},t.exports=n},function(t,n){n=function(t){return t},t.exports=n},function(t,n,e){var r=e(8),i=e(26);n=function(t){return r(t)?function(n){return i(n,t)}:(n=t,function(t){return null==t?void 0:t[n]});var n},t.exports=n},function(t,n,e){var r=e(11),i=e(8);n=function(t,n){if(i(t))return t;if(n&&r(n,t))return[t];var e=[];return t.replace(o,(function(t,n,r,i){e.push(r?i.replace(s,"$1"):n||t)})),e};var o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g;t.exports=n},function(t,n,e){var r=e(56);n=function(t,n){t.prototype=r(n.prototype)},t.exports=n},function(t,n,e){var r=e(5);n=function(t){if(!r(t))return{};if(i)return i(t);function n(){}return n.prototype=t,new n};var i=Object.create;t.exports=n},function(t,n,e){var r=e(6);n="undefined"!=typeof wx&&r(wx.openLocation),t.exports=n},function(t,n,e){n=e(27)((function(t,n){for(var e=t.length,r=0,i=n.length;r<i;r++)for(var o=n[r],s=0,u=o.length;s<u;s++)t[e++]=o[s];return t.length=e,t})),t.exports=n},function(t,n,e){var r=e(3);n=function(t){var n=(t=r(t))[0].getBoundingClientRect();return{left:n.left+window.pageXOffset,top:n.top+window.pageYOffset,width:Math.round(n.width),height:Math.round(n.height)}},t.exports=n},function(t,n,e){var r=e(0),i=e(3);n=function(t){t=i(t),r(t,(function(t){(function(t){return"none"==getComputedStyle(t,"").getPropertyValue("display")})(t)&&(t.style.display=function(t){var n,e;o[t]||(n=document.createElement(t),document.documentElement.appendChild(n),e=getComputedStyle(n,"").getPropertyValue("display"),n.parentNode.removeChild(n),"none"==e&&(e="block"),o[t]=e);return o[t]}(t.nodeName))}))};var o={};t.exports=n},function(t,n){n=function(t,n,e){return Array.prototype.indexOf.call(t,n,e)},t.exports=n},function(t,n,e){var r=e(0);n=function(t){var n=[];return r(t,(function(t){n.push(t)})),n},t.exports=n},function(t,n,e){var r=e(64),i=e(65),o=e(66),s=e(11),u=e(28);(n=r((function(t){if(t=t.replace(c,""),t=i(t),s(f,t))return t;for(var n=a.length;n--;){var e=a[n]+o(t);if(s(f,e))return e}return t}))).dash=r((function(t){var e=n(t);return(c.test(e)?"-":"")+u(e)}));var a=["O","ms","Moz","Webkit"],c=/^(O)|(ms)|(Moz)|(Webkit)|(-o-)|(-ms-)|(-moz-)|(-webkit-)/g,f=document.createElement("p").style;t.exports=n},function(t,n,e){var r=e(11);n=function(t,n){var e=function(i){var o=e.cache,s=""+(n?n.apply(this,arguments):i);return r(o,s)||(o[s]=t.apply(this,arguments)),o[s]};return e.cache={},e},t.exports=n},function(t,n,e){var r=e(29);function i(t,n){this[n]=t.replace(/\w/,(function(t){return t.toUpperCase()}))}n=function(t){var n=r(t),e=n[0];return n.shift(),n.forEach(i,n),e+=n.join("")},t.exports=n},function(t,n){n=function(t){return t.length<1?t:t[0].toUpperCase()+t.slice(1)},t.exports=n},function(t,n,e){var r=e(2),i=e(0),o=e(3);function s(t){return function(n,e){var s=(n=o(n))[0];if(r(e))return s?s[t]:"";s&&i(n,(function(n){n[t]=e}))}}n={html:s("innerHTML"),text:s("textContent"),val:s("value")},t.exports=n},function(t,n,e){var r=e(0),i=e(3);n=function(t){t=i(t),r(t,(function(t){var n=t.parentNode;n&&n.removeChild(t)}))},t.exports=n},function(t,n,e){var r=e(30),i=e(1),o=e(5),s=e(0);e(3);n=function(t,n,e){var u=n;return i(n)&&(u="data-"+n),o(n)&&(u={},s(n,(function(t,n){u["data-"+n]=t}))),r(t,u,e)},t.exports=n},function(t,n,e){var r=e(9),i=e(16);function o(){return!0}function s(){return!1}function u(t){var e,r=this.events[t.type],i=a.call(this,t,r);t=new n.Event(t);for(var o,s,u=0;(s=i[u++])&&!t.isPropagationStopped();)for(t.curTarget=s.el,o=0;(e=s.handlers[o++])&&!t.isImmediatePropagationStopped();)!1===e.handler.apply(s.el,[t])&&(t.preventDefault(),t.stopPropagation())}function a(t,n){var e,r,o,s,u=t.target,a=[],c=n.delegateCount;if(u.nodeType)for(;u!==this;u=u.parentNode||this){for(r=[],s=0;s<c;s++)void 0===r[e=(o=n[s]).selector+" "]&&(r[e]=i(this.querySelectorAll(e),u)),r[e]&&r.push(o);r.length&&a.push({el:u,handlers:r})}return c<n.length&&a.push({el:this,handlers:n.slice(c)}),a}n={add:function(t,n,e,r){var i,o={selector:e,handler:r};t.events||(t.events={}),(i=t.events[n])||((i=t.events[n]=[]).delegateCount=0,t.addEventListener(n,(function(){u.apply(t,arguments)}),!1)),e?i.splice(i.delegateCount++,0,o):i.push(o)},remove:function(t,n,e,r){var i=t.events;if(i&&i[n])for(var o,s=i[n],u=s.length;u--;)o=s[u],e&&o.selector!=e||o.handler!=r||(s.splice(u,1),o.selector&&s.delegateCount--)},Event:r({className:"Event",initialize:function(t){this.origEvent=t},isDefaultPrevented:s,isPropagationStopped:s,isImmediatePropagationStopped:s,preventDefault:function(){var t=this.origEvent;this.isDefaultPrevented=o,t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){var t=this.origEvent;this.isPropagationStopped=o,t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.origEvent;this.isImmediatePropagationStopped=o,t&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),this.stopPropagation()}})},t.exports=n},function(t,n,e){var r=e(12),i=e(10),o=e(4);n=function(t,n,e){n=r(n,e);for(var s=!i(t)&&o(t),u=(s||t).length,a=0;a<u;a++){var c=s?s[a]:a;if(n(t[c],c,t))return!0}return!1},t.exports=n},function(t,n,e){var r=e(0),i=e(3),o=e(1);function s(t){return function(n,e){n=i(n),r(n,(function(n){if(o(e))n.insertAdjacentHTML(t,e);else{var r=n.parentNode;switch(t){case"beforebegin":r&&r.insertBefore(e,n);break;case"afterend":r&&r.insertBefore(e,n.nextSibling);break;case"beforeend":n.appendChild(e);break;case"afterbegin":n.prepend(e)}}}))}}n={before:s("beforebegin"),after:s("afterend"),append:s("beforeend"),prepend:s("afterbegin")},t.exports=n},function(t,n,e){var r=e(1),i=e(7),o=e(74),s=e(18),u=e(34);n=function(t){r(t)&&(t=i(t));for(var n="",e=arguments.length,c=new Array(e>1?e-1:0),f=1;f<e;f++)c[f-1]=arguments[f];for(var l=0,h=t.length;l<h;l++)n+=t[l],c[l]&&(n+=c[l]);for(var p=n.split("\n"),d=[],v=0,g=p.length;v<g;v++){var m=p[v],x=m.match(a);x&&d.push(x[1].length)}var y=d.length>0?o.apply(null,d):0;return u(s(p,(function(t){return" "===t[0]?t.slice(y):t})).join("\n"))};var a=/^(\s+)\S+/;t.exports=n},function(t,n){n=function(){for(var t=arguments,n=t[0],e=1,r=t.length;e<r;e++)t[e]<n&&(n=t[e]);return n},t.exports=n},function(t,n){var e=/^\s+/;n=function(t,n){if(null==n)return t.trimLeft?t.trimLeft():t.replace(e,"");for(var r,i,o=0,s=t.length,u=n.length,a=!0;a&&o<s;)for(a=!1,r=-1,i=t.charAt(o);++r<u;)if(i===n[r]){a=!0,o++;break}return o>=s?"":t.substr(o,s)},t.exports=n},function(t,n){n=function(t,n){if(null==n){if(t.trimRight)return t.trimRight();n=" \r\n\t\f\v"}for(var e,r,i=t.length-1,o=n.length,s=!0;s&&i>=0;)for(s=!1,e=-1,r=t.charAt(i);++e<o;)if(r===n[e]){s=!0,i--;break}return i>=0?t.substring(0,i+1):""},t.exports=n},function(t,n,e){"use strict";var r,i=this&&this.__extends||(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var s=o(e(78)),u=o(e(22)),a=e(36),c=o(e(0)),f=o(e(13)),l=o(e(39)),h=o(e(94)),p=function(t){function n(n,e,r){var i=e.compName,o=(void 0===r?{}:r).theme,s=void 0===o?"light":o,f=t.call(this)||this;return f.subComponents=[],f.compName=i,f.c=(0,a.classPrefix)(i),f.options={},f.container=n,f.$container=(0,u.default)(n),f.$container.addClass(["luna-".concat(i),f.c("platform-".concat((0,a.getPlatform)()))]),f.on("optionChange",(function(t,n,e){var r=f.c;"theme"===t&&(f.$container.rmClass(r("theme-".concat(e))).addClass(r("theme-".concat(n))),(0,c.default)(f.subComponents,(function(t){return t.setOption("theme",n)})))})),f.setOption("theme",s),f}return i(n,t),n.prototype.destroy=function(){this.destroySubComponents();var t=this.c;this.$container.rmClass("luna-".concat(this.compName)).rmClass(t("platform-".concat((0,a.getPlatform)()))).rmClass(t("theme-".concat(this.options.theme))),this.$container.html(""),this.emit("destroy"),this.removeAllListeners()},n.prototype.setOption=function(t,n){var e=this,r=this.options,i={};"string"==typeof t?i[t]=n:i=t,(0,c.default)(i,(function(t,n){var i=r[n];r[n]=t,e.emit("optionChange",n,t,i)}))},n.prototype.getOption=function(t){return this.options[t]},n.prototype.addSubComponent=function(t){t.setOption("theme",this.options.theme),this.subComponents.push(t)},n.prototype.removeSubComponent=function(t){(0,h.default)(this.subComponents,(function(n){return n===t}))},n.prototype.destroySubComponents=function(){(0,c.default)(this.subComponents,(function(t){return t.destroy()})),this.subComponents=[]},n.prototype.initOptions=function(t,n){void 0===n&&(n={}),(0,l.default)(t,n),(0,f.default)(this.options,t)},n.prototype.find=function(t){return this.$container.find(this.c(t))},n}(s.default);n.default=p},function(t,n,e){var r=e(9),i=e(11),o=e(0),s=e(79),u=e(80),a=e(35);n=r({initialize:function(){this._events=this._events||{}},on:function(t,n){return this._events[t]=this._events[t]||[],this._events[t].push(n),this},off:function(t,n){var e=this._events;if(i(e,t)){var r=e[t].indexOf(n);return r>-1&&e[t].splice(r,1),this}},once:function(t,n){return this.on(t,u(n)),this},emit:function(t){var n=this;if(i(this._events,t)){var e=s(arguments,1),r=a(this._events[t]);return o(r,(function(t){return t.apply(n,e)}),this),this}},removeAllListeners:function(t){return t?delete this._events[t]:this._events={},this}},{mixin:function(t){o(["on","off","once","emit","removeAllListeners"],(function(e){t[e]=n.prototype[e]})),t._events=t._events||{}}}),t.exports=n},function(t,n){n=function(t,n,e){var r=t.length;n=null==n?0:n<0?Math.max(r+n,0):Math.min(n,r),e=null==e?r:e<0?Math.max(r+e,0):Math.min(e,r);for(var i=[];n<e;)i.push(t[n++]);return i},t.exports=n},function(t,n,e){n=e(81)(e(82),2),t.exports=n},function(t,n,e){var r=e(27),i=e(7);n=r((function(t,n){return function(){var e=[];return e=(e=e.concat(n)).concat(i(arguments)),t.apply(this,e)}})),t.exports=n},function(t,n){n=function(t,n){var e;return function(){return--t>0&&(e=n.apply(this,arguments)),t<=1&&(n=null),e}},t.exports=n},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){var r=e(85),i=e(88),o=e(8),s=e(0),u=e(1),a=e(90);var c=function(t){return t.replace(/"/g,'"')},f=function(t){return t.replace(/"/g,""")};n={parse:function(t){var n=[],e=new i;return r(t,{start:function(t,n){n=a(n,(function(t){return c(t)})),e.push({tag:t,attrs:n})},end:function(){var t=e.pop();if(e.size){var r=e.peek();o(r.content)||(r.content=[]),r.content.push(t)}else n.push(t)},comment:function(t){var r="\x3c!--".concat(t,"--\x3e"),i=e.peek();i?(i.content||(i.content=[]),i.content.push(r)):n.push(r)},text:function(t){var r=e.peek();r?(r.content||(r.content=[]),r.content.push(t)):n.push(t)}}),n},stringify:function t(n){var e="";return o(n)?s(n,(function(n){return e+=t(n)})):u(n)?e=n:(e+="<".concat(n.tag),s(n.attrs,(function(t,n){return e+=" ".concat(n,'="').concat(f(t),'"')})),e+=">",n.content&&(e+=t(n.content)),e+="</".concat(n.tag,">")),e}},t.exports=n},function(t,n,e){var r=e(31),i=e(86),o=e(21),s=e(87);n=function(t,n){for(var e,i=[],h=t;t;){if(e=!0,r(i)&&l[r(i)]){var p=new RegExp("</".concat(r(i),"[^>]*>")).exec(t);if(p){var d=t.substring(0,p.index);t=t.substring(p.index+p[0].length),d&&n.text&&n.text(d)}w("",r(i))}else{if(o(t,"\x3c!--")){var v=t.indexOf("--\x3e");v>=0&&(n.comment&&n.comment(t.substring(4,v)),t=t.substring(v+3),e=!1)}else if(o(t,"<!")){var g=t.match(u);g&&(n.text&&n.text(t.substring(0,g[0].length)),t=t.substring(g[0].length),e=!1)}else if(o(t,"</")){var m=t.match(a);m&&(t=t.substring(m[0].length),m[0].replace(a,w),e=!1)}else if(o(t,"<")){var x=t.match(c);x&&(t=t.substring(x[0].length),x[0].replace(c,_),e=!1)}if(e){var y=t.indexOf("<"),b=y<0?t:t.substring(0,y);t=y<0?"":t.substring(y),n.text&&n.text(b)}}if(h===t)throw Error("Parse Error: "+t);h=t}function _(t,e,r,o){if(e=s(e),(o=!!o)||i.push(e),n.start){var u={};r.replace(f,(function(t,n,e,r,i){u[n]=e||r||i||""})),n.start(e,u,o)}}function w(t,e){var r;if(e=s(e))for(r=i.length-1;r>=0&&i[r]!==e;r--);else r=0;if(r>=0){for(var o=i.length-1;o>=r;o--)n.end&&n.end(i[o]);i.length=r}}w()};var u=/^<!\s*doctype((?:\s+[\w:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/i,a=/^<\/([-A-Za-z0-9_]+)[^>]*>/,c=/^<([-A-Za-z0-9_]+)((?:\s+[-A-Za-z0-9_:@.]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/i,f=/([-A-Za-z0-9_:@.]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,l=i("script,style".split(","));t.exports=n},function(t,n,e){var r=e(0),i=e(2),o=e(6);n=function(t,n){i(n)&&(n=!0);var e=o(n),s={};return r(t,(function(t){s[t]=e?n(t):n})),s},t.exports=n},function(t,n,e){var r=e(38);n=function(t){return r(t).toLocaleLowerCase()},t.exports=n},function(t,n,e){var r=e(9),i=e(89);n=r({initialize:function(){this.clear()},clear:function(){this._items=[],this.size=0},push:function(t){return this._items.push(t),++this.size},pop:function(){if(this.size)return this.size--,this._items.pop()},peek:function(){return this._items[this.size-1]},forEach:function(t,n){n=arguments.length>1?n:this;for(var e=this._items,r=this.size-1,i=0;r>=0;r--,i++)t.call(n,e[r],i,this)},toArr:function(){return i(this._items)}}),t.exports=n},function(t,n){n=function(t){var n=t.length,e=Array(n);n--;for(var r=0;r<=n;r++)e[n-r]=t[r];return e},t.exports=n},function(t,n,e){var r=e(12),i=e(4);n=function(t,n,e){n=r(n,e);for(var o=i(t),s=o.length,u={},a=0;a<s;a++){var c=o[a];u[c]=n(t[c],c,t)}return u},t.exports=n},function(t,n,e){var r=e(14),i=e(5),o=e(6),s=e(1);n=function(t){if(r(t))return t;if(i(t)){var n=o(t.valueOf)?t.valueOf():t;t=i(n)?n+"":n}return s(t)?+t:0===t?t:+t},t.exports=n},function(t,n,e){var r=e(37);n=function(t){if(t=(t=t||(r?navigator.userAgent:"")).toLowerCase(),n("windows phone"))return"windows phone";if(n("win"))return"windows";if(n("android"))return"android";if(n("ipad")||n("iphone")||n("ipod"))return"ios";if(n("mac"))return"os x";if(n("linux"))return"linux";function n(n){return t.indexOf(n)>-1}return"unknown"},t.exports=n},function(t,n,e){var r=e(20),i=r.getComputedStyle,o=r.document;function s(t,n){return t.right<n.left||t.left>n.right||t.bottom<n.top||t.top>n.bottom}n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=n.display,r=void 0===e||e,u=n.visibility,a=void 0!==u&&u,c=n.opacity,f=void 0!==c&&c,l=n.size,h=void 0!==l&&l,p=n.viewport,d=void 0!==p&&p,v=n.overflow,g=void 0!==v&&v;if(r)return null===t.offsetParent;var m=i(t);if(a&&"hidden"===m.visibility)return!0;if(f){if("0"===m.opacity)return!0;for(var x=t;x=x.parentElement;){var y=i(x);if("0"===y.opacity)return!0}}var b=t.getBoundingClientRect();if(h&&(0===b.width||0===b.height))return!0;if(d){var _={top:0,left:0,right:o.documentElement.clientWidth,bottom:o.documentElement.clientHeight};return s(b,_)}if(g)for(var w=t;w=w.parentElement;){var C=i(w),O=C.overflow;if("scroll"===O||"hidden"===O){var z=w.getBoundingClientRect();if(s(b,z))return!0}}return!1},t.exports=n},function(t,n,e){var r=e(12);n=function(t,n,e){var i=[];n=r(n,e);for(var o=-1,s=t.length;++o<s;){var u=t[o];n(u,o,t)&&(i.push(u),t.splice(o,1))}return i},t.exports=n},function(t,n,e){var r=e(4),i=(n=function(t){return s.test(t)?t.replace(u,a):t}).map={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},o="(?:"+r(i).join("|")+")",s=new RegExp(o),u=new RegExp(o,"g"),a=function(t){return i[t]};t.exports=n},function(t,n,e){var r=e(97),i=e(40),o=e(32),s=e(19),u=e(16),a=e(13),c=e(20);n=c.ResizeObserver?r.extend({initialize:function(t){var n=this;if(t._resizeSensor)return t._resizeSensor;this.callSuper(r,"initialize");var e=new c.ResizeObserver((function(){return n.emit()}));e.observe(t),t._resizeSensor=this,this._resizeObserver=e,this._el=t},destroy:function(){var t=this._el;t._resizeSensor&&(this.rmAllListeners(),delete t._resizeSensor,this._resizeObserver.unobserve(t))}}):r.extend({initialize:function(t){if(t._resizeSensor)return t._resizeSensor;this.callSuper(r,"initialize"),this._el=t,t._resizeSensor=this,u(["absolute","relative","fixed","sticky"],s(t,"position"))||s(t,"position","relative"),this._appendResizeSensor(),this._bindEvent()},destroy:function(){var t=this._el;t._resizeSensor&&(this.rmAllListeners(),delete t._resizeSensor,t.removeChild(this._resizeSensorEl))},_appendResizeSensor:function(){var t=this._el,n={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},e={position:"absolute",left:"0px",top:"0px",transition:"0s"},r=i("div",{style:e}),o=i("div.resize-sensor-expand",{style:n},r),s=i("div.resize-sensor-shrink",{style:n},i("div",{style:a({width:"200%",height:"200%"},e)})),u=i("div.resize-sensor",{dir:"ltr",style:n},o,s);this._expandEl=o,this._expandChildEl=r,this._shrinkEl=s,this._resizeSensorEl=u,t.appendChild(u),this._resetExpandShrink()},_bindEvent:function(){var t=this;o.on(this._expandEl,"scroll",(function(){return t._onScroll()})),o.on(this._shrinkEl,"scroll",(function(){return t._onScroll()}))},_onScroll:function(){this.emit(),this._resetExpandShrink()},_resetExpandShrink:function(){var t=this._el,n=t.offsetWidth,e=t.offsetHeight;s(this._expandChildEl,{width:n+10,height:e+10}),a(this._expandEl,{scrollLeft:n+10,scrollTop:e+10}),a(this._shrinkEl,{scrollLeft:n+10,scrollTop:e+10})}}),t.exports=n},function(t,n,e){var r=e(9),i=e(35),o=e(0),s=e(7);n=r({initialize:function(){this._listeners=[]},addListener:function(t){this._listeners.push(t)},rmListener:function(t){var n=this._listeners.indexOf(t);n>-1&&this._listeners.splice(n,1)},rmAllListeners:function(){this._listeners=[]},emit:function(){var t=this,n=s(arguments),e=i(this._listeners);o(e,(function(e){return e.apply(t,n)}),this)}},{mixin:function(t){o(["addListener","rmListener","emit","rmAllListeners"],(function(e){t[e]=n.prototype[e]})),t._listeners=t._listeners||[]}}),t.exports=n},function(t,n,e){var r=e(99);n=function(t,n){return r(t,n,!0)},t.exports=n},function(t,n){n=function(t,n,e){var r;return function(){var i=this,o=arguments,s=function(){r=null,t.apply(i,o)};e||clearTimeout(r),e&&r||(r=setTimeout(s,n))}},t.exports=n},function(t,n){n=function(t){return null===t},t.exports=n}])})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.LunaDataGrid=e():t.LunaDataGrid=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/assets/",n(n.s=45)}([function(t,e,n){var r=n(10),i=n(5),o=n(25);e=function(t,e,n){var s,a;if(e=o(e,n),r(t))for(s=0,a=t.length;s<a;s++)e(t[s],s,t);else{var u=i(t);for(s=0,a=u.length;s<a;s++)e(t[u[s]],u[s],t)}return t},t.exports=e},function(t,e,n){var r=n(11);e=function(t){return"[object String]"===r(t)},t.exports=e},function(t,e){e=function(t){return void 0===t},t.exports=e},function(t,e,n){var r=n(1),i=n(7),o=n(24);e=function(t){return i(r(t)?new o(t):t)},t.exports=e},function(t,e,n){var r=n(11);e=function(t){var e=r(t);return"[object Function]"===e||"[object GeneratorFunction]"===e||"[object AsyncFunction]"===e},t.exports=e},function(t,e,n){var r=n(12);e=Object.keys?Object.keys:function(t){var e=[];for(var n in t)r(t,n)&&e.push(n);return e},t.exports=e},function(t,e){e=function(t){var e=typeof t;return!!t&&("function"===e||"object"===e)},t.exports=e},function(t,e,n){var r=n(10),i=n(18),o=n(8),s=n(1);e=function(t){return t?o(t)?t:r(t)&&!s(t)?i(t):[t]:[]},t.exports=e},function(t,e,n){var r=n(11);e=Array.isArray?Array.isArray:function(t){return"[object Array]"===r(t)},t.exports=e},function(t,e,n){var r=n(15),i=n(7),o=n(58),s=n(27),a=n(60);var u=(e=function(t,e){return u.extend(t,e)}).Base=function t(e,n,u){u=u||{};var c=n.className||s(n,"initialize.name")||"";delete n.className;var f=function(){var t=i(arguments);return this.initialize&&this.initialize.apply(this,t)||this};if(!a)try{f=new Function("toArr","return function "+c+"(){var args = toArr(arguments);return this.initialize ? this.initialize.apply(this, args) || this : this;};")(i)}catch(t){}return o(f,e),f.prototype.constructor=f,f.extend=function(e,n){return t(f,e,n)},f.inherits=function(t){o(f,t)},f.methods=function(t){return r(f.prototype,t),f},f.statics=function(t){return r(f,t),f},f.methods(n).statics(u),f}(Object,{className:"Base",callSuper:function(t,e,n){return t.prototype[e].apply(this,n)},toString:function(){return this.constructor.name}});t.exports=e},function(t,e,n){var r=n(16),i=n(4),o=Math.pow(2,53)-1;e=function(t){if(!t)return!1;var e=t.length;return r(e)&&e>=0&&e<=o&&!i(t)},t.exports=e},function(t,e){var n=Object.prototype.toString;e=function(t){return n.call(t)},t.exports=e},function(t,e){var n=Object.prototype.hasOwnProperty;e=function(t,e){return n.call(t,e)},t.exports=e},function(t,e,n){var r=n(4),i=n(6),o=n(8),s=n(25),a=n(52),u=n(55),c=n(56);e=function(t,e,n){return null==t?u:r(t)?s(t,e,n):i(t)&&!o(t)?a(t):c(t)},t.exports=e},function(t,e,n){var r=n(64),i=n(1),o=n(10),s=n(65);e=function(t,e){return i(t)?t.indexOf(e)>-1:(o(t)||(t=s(t)),r(t,e)>=0)},t.exports=e},function(t,e,n){e=n(17)(n(26)),t.exports=e},function(t,e,n){var r=n(11);e=function(t){return"[object Number]"===r(t)},t.exports=e},function(t,e,n){var r=n(2),i=n(0);e=function(t,e){return function(n){return i(arguments,(function(o,s){if(0!==s){var a=t(o);i(a,(function(t){e&&!r(n[t])||(n[t]=o[t])}))}})),n}},t.exports=e},function(t,e,n){var r=n(13),i=n(5),o=n(10);e=function(t,e,n){e=r(e,n);for(var s=!o(t)&&i(t),a=(s||t).length,u=Array(a),c=0;c<a;c++){var f=s?s[c]:c;u[c]=e(t[f],f,t)}return u},t.exports=e},function(t,e,n){var r=n(1),i=n(6),o=n(29),s=n(2),a=n(14),u=n(16),c=n(3),f=n(66),l=n(0);e=function(t,e,n){if(t=c(t),s(n)&&r(e))return function(t,e){return t.style[f(e)]||getComputedStyle(t,"").getPropertyValue(e)}(t[0],e);var d=e;i(d)||((d={})[e]=n),function(t,e){l(t,(function(t){var n=";";l(e,(function(t,e){e=f.dash(e),n+=e+":"+function(t,e){return u(e)&&!a(h,o(t))?e+"px":e}(e,t)+";"})),t.style.cssText+=n}))}(t,d)};var h=["column-count","columns","font-weight","line-weight","opacity","z-index","zoom"];t.exports=e},function(t,e,n){var r=n(77),i=n(78);e=function(t,e){return null==e&&t.trim?t.trim():r(i(t,e),e)},t.exports=e},function(t,e,n){(function(r){var i=n(38);e=i?window:r,t.exports=e}).call(this,n(85))},function(t,e){e=function(t,e){return 0===t.indexOf(e)},t.exports=e},function(t,e,n){var r=n(24),i=n(62),o=n(63),s=n(19),a=n(31),u=n(70),c=n(32),f=n(71),l=n(72),h=n(33),d=n(34),p=n(75),v=n(2),g=n(1);e=function(t){return new r(t)},r.methods({offset:function(){return i(this)},hide:function(){return this.css("display","none")},show:function(){return o(this),this},first:function(){return e(this[0])},last:function(){return e(c(this))},get:function(t){return this[t]},eq:function(t){return e(this[t])},on:function(t,e,n){return h.on(this,t,e,n),this},off:function(t,e,n){return h.off(this,t,e,n),this},html:function(t){var e=u.html(this,t);return v(t)?e:this},text:function(t){var e=u.text(this,t);return v(t)?e:this},val:function(t){var e=u.val(this,t);return v(t)?e:this},css:function(t,e){var n=s(this,t,e);return m(t,e)?n:this},attr:function(t,e){var n=a(this,t,e);return m(t,e)?n:this},data:function(t,e){var n=l(this,t,e);return m(t,e)?n:this},rmAttr:function(t){return a.remove(this,t),this},remove:function(){return f(this),this},addClass:function(t){return d.add(this,t),this},rmClass:function(t){return d.remove(this,t),this},toggleClass:function(t){return d.toggle(this,t),this},hasClass:function(t){return d.has(this,t)},parent:function(){return e(this[0].parentNode)},append:function(t){return p.append(this,t),this},prepend:function(t){return p.prepend(this,t),this},before:function(t){return p.before(this,t),this},after:function(t){return p.after(this,t),this}});var m=function(t,e){return v(e)&&g(t)};t.exports=e},function(t,e,n){var r=n(9),i=n(1),o=n(0),s=n(61),a=new(e=r({className:"Select",initialize:function(t){return this.length=0,t?i(t)?a.find(t):void(t.nodeType&&(this[0]=t,this.length=1)):this},find:function(t){var n=new e;return this.each((function(){s(n,this.querySelectorAll(t))})),n},each:function(t){return o(this,(function(e,n){t.call(e,n,e)})),this}}))(document);t.exports=e},function(t,e,n){var r=n(2);e=function(t,e,n){if(r(e))return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},t.exports=e},function(t,e,n){var r=n(5),i=n(49),o=n(50),s=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols;e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.prototype,u=void 0===n||n,c=e.unenumerable,f=void 0!==c&&c,l=e.symbol,h=void 0!==l&&l,d=[];if((f||h)&&s){var p=r;f&&s&&(p=s);do{d=d.concat(p(t)),h&&a&&(d=d.concat(a(t)))}while(u&&(t=i(t))&&t!==Object.prototype);d=o(d)}else if(u)for(var v in t)d.push(v);else d=r(t);return d},t.exports=e},function(t,e,n){var r=n(2),i=n(57);e=function(t,e){var n;for(n=(e=i(e,t)).shift();!r(n);){if(null==(t=t[n]))return;n=e.shift()}return t},t.exports=e},function(t,e){e=function(t,e){return e=null==e?t.length-1:+e,function(){var n,r=Math.max(arguments.length-e,0),i=new Array(r);for(n=0;n<r;n++)i[n]=arguments[n+e];switch(e){case 0:return t.call(this,i);case 1:return t.call(this,arguments[0],i);case 2:return t.call(this,arguments[0],arguments[1],i)}var o=new Array(e+1);for(n=0;n<e;n++)o[n]=arguments[n];return o[e]=i,t.apply(this,o)}},t.exports=e},function(t,e,n){var r=n(30);e=function(t){return r(t).join("-")},t.exports=e},function(t,e){var n=/([A-Z])/g,r=/[_.\- ]+/g,i=/(^-)|(-$)/g;e=function(t){return(t=t.replace(n,"-$1").toLowerCase().replace(r,"-").replace(i,"")).split("-")},t.exports=e},function(t,e,n){var r=n(7),i=n(6),o=n(1),s=n(0),a=n(2),u=n(3);(e=function(t,e,n){if(t=u(t),a(n)&&o(e))return function(t,e){return t.getAttribute(e)}(t[0],e);var r=e;i(r)||((r={})[e]=n),function(t,e){s(t,(function(t){s(e,(function(e,n){t.setAttribute(n,e)}))}))}(t,r)}).remove=function(t,e){t=u(t),e=r(e),s(t,(function(t){s(e,(function(e){t.removeAttribute(e)}))}))},t.exports=e},function(t,e){e=function(t){var e=t?t.length:0;if(e)return t[e-1]},t.exports=e},function(t,e,n){var r=n(73),i=n(2),o=n(3),s=n(0);function a(t){return function(e,n,a,u){e=o(e),i(u)&&(u=a,a=void 0),s(e,(function(e){r[t](e,n,a,u)}))}}e={on:a("add"),off:a("remove")},t.exports=e},function(t,e,n){var r=n(7),i=n(74),o=n(3),s=n(1),a=n(0);function u(t){return s(t)?t.split(/\s+/):r(t)}e={add:function(t,n){t=o(t);var r=u(n);a(t,(function(t){var n=[];a(r,(function(r){e.has(t,r)||n.push(r)})),0!==n.length&&(t.className+=(t.className?" ":"")+n.join(" "))}))},has:function(t,e){t=o(t);var n=new RegExp("(^|\\s)"+e+"(\\s|$)");return i(t,(function(t){return n.test(t.className)}))},toggle:function(t,n){t=o(t),a(t,(function(t){if(!e.has(t,n))return e.add(t,n);e.remove(t,n)}))},remove:function(t,e){t=o(t);var n=u(e);a(t,(function(t){a(n,(function(e){t.classList.remove(e)}))}))}},t.exports=e},function(t,e){e=function(){for(var t=arguments,e=t[0],n=1,r=t.length;n<r;n++)t[n]<e&&(e=t[n]);return e},t.exports=e},function(t,e,n){var r=n(6),i=n(8),o=n(15);e=function(t){return r(t)?i(t)?t.slice():o({},t):t},t.exports=e},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.resetCanvasSize=e.getPlatform=e.pxToNum=e.executeAfterTransition=e.hasVerticalScrollbar=e.measuredScrollbarWidth=e.eventPage=e.eventClient=e.drag=e.hasTouchSupport=e.classPrefix=e.exportCjs=void 0;var i=r(n(18)),o=r(n(20)),s=r(n(21)),a=r(n(86)),u=r(n(16)),c=r(n(14)),f=r(n(41)),l=r(n(92)),h=r(n(93));e.exportCjs=function(t,e){try{t.exports=e,t.exports.default=e}catch(t){}},e.classPrefix=function(t){var e="luna-".concat(t,"-");function n(t){return(0,i.default)((0,o.default)(t).split(/\s+/),(function(t){return(0,c.default)(t,e)?t:t.replace(/[\w-]+/,(function(t){return"".concat(e).concat(t)}))})).join(" ")}return function(t){if(/<[^>]*>/g.test(t))try{var e=a.default.parse(t);return function t(e,n){for(var r=0,i=e.length;r<i;r++){var o=e[r];n(o),o.content&&t(o.content,n)}}(e,(function(t){t.attrs&&t.attrs.class&&(t.attrs.class=n(t.attrs.class))})),a.default.stringify(e)}catch(e){return n(t)}return n(t)}},e.hasTouchSupport="ontouchstart"in s.default;var d,p={start:"touchstart",move:"touchmove",end:"touchend"},v={start:"mousedown",move:"mousemove",end:"mouseup"};e.drag=function(t){return e.hasTouchSupport?p[t]:v[t]},e.eventClient=function(t,e){var n="x"===t?"clientX":"clientY";return e[n]?e[n]:e.changedTouches?e.changedTouches[0][n]:0},e.eventPage=function(t,e){var n="x"===t?"pageX":"pageY";return e[n]?e[n]:e.changedTouches?e.changedTouches[0][n]:0},e.measuredScrollbarWidth=function(){if((0,u.default)(d))return d;if(!document)return 16;var t=document.createElement("div"),e=document.createElement("div");t.setAttribute("style","display: block; width: 100px; height: 100px; overflow: scroll;"),e.setAttribute("style","height: 200px"),t.appendChild(e);var n=document.body||document.documentElement;return n.appendChild(t),d=t.offsetWidth-t.clientWidth,n.removeChild(t),d},e.hasVerticalScrollbar=function(t){return t.scrollHeight>t.offsetHeight},e.executeAfterTransition=function(t,e){if((0,h.default)(t))return e();var n=function(r){r.target===t&&(t.removeEventListener("transitionend",n),e())};t.addEventListener("transitionend",n)},e.pxToNum=function(t){return(0,f.default)(t.replace("px",""))},e.getPlatform=function(){var t=(0,l.default)();return"os x"===t?"mac":t},e.resetCanvasSize=function(t){t.width=Math.round(t.offsetWidth*window.devicePixelRatio),t.height=Math.round(t.offsetHeight*window.devicePixelRatio)}},function(t,e){e="object"==typeof window&&"object"==typeof document&&9===document.nodeType,t.exports=e},function(t,e,n){var r=n(40);e=function(t){return r(t).toLocaleLowerCase()},t.exports=e},function(t,e){e=function(t){return null==t?"":t.toString()},t.exports=e},function(t,e,n){var r=n(16),i=n(6),o=n(4),s=n(1);e=function(t){if(r(t))return t;if(i(t)){var e=o(t.valueOf)?t.valueOf():t;t=i(e)?e+"":e}return s(t)?+t:0===t?t:+t},t.exports=e},function(t,e,n){e=n(17)(n(26),!0),t.exports=e},function(t,e,n){var r=n(44),i=n(1),o=n(22),s=n(34),a=n(19),u=n(0),c=n(4);function f(t){for(var e="div",n="",r=[],i=[],s="",a=0,u=t.length;a<u;a++){var c=t[a];"#"===c||"."===c?(i.push(s),s=c):s+=c}i.push(s);for(var f=0,l=i.length;f<l;f++)(s=i[f])&&(o(s,"#")?n=s.slice(1):o(s,".")?r.push(s.slice(1)):e=s);return{tagName:e,id:n,classes:r}}e=function(t,e){for(var n=arguments.length,l=new Array(n>2?n-2:0),h=2;h<n;h++)l[h-2]=arguments[h];(r(e)||i(e))&&(l.unshift(e),e=null),e||(e={});var d=f(t),p=d.tagName,v=d.id,g=d.classes,m=document.createElement(p);return v&&m.setAttribute("id",v),s.add(m,g),u(l,(function(t){i(t)?m.appendChild(document.createTextNode(t)):r(t)&&m.appendChild(t)})),u(e,(function(t,e){i(t)?m.setAttribute(e,t):c(t)&&o(e,"on")?m.addEventListener(e.slice(2),t,!1):"style"===e&&a(m,t)})),m},t.exports=e},function(t,e){e=function(t){return!(!t||1!==t.nodeType)},t.exports=e},function(t,e,n){n(46),t.exports=n(47)},function(t,e,n){},function(t,e,n){"use strict";(function(t){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DataGridNode=void 0;var a=s(n(23)),u=s(n(76)),c=s(n(79)),f=s(n(0)),l=s(n(95)),h=s(n(43)),d=s(n(40)),p=s(n(44)),v=s(n(2)),g=s(n(96)),m=s(n(98)),x=s(n(42)),y=s(n(22)),b=s(n(100)),_=s(n(4)),w=s(n(101)),z=s(n(1)),C=s(n(20)),S=s(n(14)),O=s(n(41)),j=s(n(39)),E=s(n(102)),P=s(n(103)),N=s(n(35)),A=n(37),$=(0,a.default)(document),R=function(t){function e(e,n){var r=t.call(this,e,{compName:"data-grid"},n)||this;r.resizeIdx=0,r.resizeStartX=0,r.resizeStartLeft=0,r.resizeDeltaX=0,r.nodes=[],r.colWidthsInitialized=!1,r.colMap={},r.selectedNode=null,r.isAscending=!0,r.colWidths=[],r.onResizeColMove=function(t){var e=r,n=e.resizeIdx,i=e.$resizers,o=e.colWidths,s=e.$colgroup;t=t.origEvent;var u=(0,A.eventClient)("x",t)-r.resizeStartX,c=o[n],f=o[n+1],l=(0,N.default)(24-c,0),h=(0,P.default)(f-24,0);u=(0,E.default)(u,l,h),s.each((function(){var t=(0,a.default)(this).find("col");t.eq(n).css("width",c+u+"px"),t.eq(n+1).css("width",f-u+"px")})),r.resizeDeltaX=u;var d=r.resizeStartLeft+u;i.eq(n).css("left","".concat(d,"px"))},r.onResizeColEnd=function(t){r.onResizeColMove(t);var e=r,n=e.c,i=e.colWidths,o=e.resizeIdx,s=e.resizeDeltaX,u=r.options.columns,c=u[o],f=u[o+1],l=i[o]+s,h=l+(i[o+1]-s),d=c.weight+f.weight,p=d*(l/h),v=d-p;c.weight=p,f.weight=v,r.applyColWeights(),(0,a.default)(document.body).rmClass(n("resizing")),$.off((0,A.drag)("move"),r.onResizeColMove),$.off((0,A.drag)("end"),r.onResizeColEnd)},r.$container.attr("tabindex","0"),r.resizeSensor=new g.default(e),r.onResize=(0,m.default)((function(){r.updateHeight(),r.updateWeights()}),16),n.height&&(n.maxHeight=n.height,n.minHeight=n.height),r.initOptions(n,{minHeight:41,maxHeight:1/0,filter:""});var i=r.options,o=i.columns,s=i.minHeight,u=i.maxHeight;return(0,f.default)(o,(function(t){(0,x.default)(t,{sortable:!1}),r.colMap[t.id]=t})),u<s&&r.setOption("maxHeight",s),r.initTpl(),r.$headerRow=r.find(".header").find("tr"),r.$fillerRow=r.find(".filler-row"),r.fillerRow=r.$fillerRow.get(0),r.$tableBody=r.find(".data").find("tbody"),r.tableBody=r.$tableBody.get(0),r.$colgroup=r.$container.find("colgroup"),r.$dataContainer=r.find(".data-container"),r.renderHeader(),r.renderResizers(),r.updateWeights(),r.updateHeight(),r.bindEvent(),r}return i(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.resizeSensor.destroy(),this.$container.rmAttr("tabindex")},e.prototype.remove=function(t){var e=this.nodes,n=e.indexOf(t);n>-1&&(t.detach(),e.splice(n,1),t===this.selectedNode&&this.selectNode(e[n]||e[n-1]||null),this.updateHeight())},e.prototype.append=function(t,e){var n=new L(this,t,e);return this.nodes.push(n),this.sortId?this.sortNodes(this.sortId,this.isAscending):this.filterNode(n)&&(this.tableBody.insertBefore(n.container,this.fillerRow),this.updateHeight()),n},e.prototype.clear=function(){(0,f.default)(this.nodes,(function(t){return t.detach()})),this.nodes=[],this.selectNode(null),this.updateHeight()},e.prototype.updateHeight=function(){var t=this.$fillerRow,e=this.options,n=e.maxHeight,r=e.minHeight;this.$dataContainer.css({height:"auto"}),(r-=23)<0&&(r=0),n-=23;var i=20*(this.$dataContainer.find("tr").length-1);i>r?t.hide():t.show(),i<r?i=r:i>=n&&(i=n),this.$dataContainer.css({height:i})},e.prototype.selectNode=function(t){var e;((0,b.default)(t)||(null==t?void 0:t.selectable))&&(this.selectedNode&&(this.selectedNode.deselect(),this.selectedNode=null),(0,b.default)(t)?this.emit("deselect"):(this.selectedNode=t,null===(e=this.selectedNode)||void 0===e||e.select(),this.emit("select",t)))},e.prototype.onResizeColStart=function(t){var e=this.c,n=this.resizeIdx,r=this.$resizers;t.stopPropagation(),t.preventDefault(),t=t.origEvent,this.resizeStartX=(0,A.eventClient)("x",t),this.resizeStartLeft=(0,A.pxToNum)(r.eq(n).css("left")),(0,a.default)(document.body).addClass(e("resizing")),$.on((0,A.drag)("move"),this.onResizeColMove),$.on((0,A.drag)("end"),this.onResizeColEnd)},e.prototype.bindEvent=function(){var t=this,e=this.c,n=this.$headerRow,r=this.$tableBody,i=this.$resizers;this.resizeSensor.addListener(this.onResize);var o=this;r.on("click",e(".node"),(function(){o.selectNode(this.dataGridNode)})),n.on("click",e(".sortable"),(function(t){t.stopPropagation();var e=(0,a.default)(this),r=e.data("id"),i="descending"!==e.data("order");e.data("order",i?"descending":"ascending"),o.sortNodes(r,i),n.find("th").each((function(){var t=(0,a.default)(this);t.data("id")!==r&&t.rmAttr("data-order")}))})),i.on((0,A.drag)("start"),(function(t){var e=(0,a.default)(this);o.resizeIdx=(0,O.default)(e.data("idx")),o.onResizeColStart(t)})),this.on("optionChange",(function(e){switch(e){case"minHeight":case"maxHeight":t.updateHeight();case"filter":t.renderData()}}))},e.prototype.sortNodes=function(t,e){var n=this.colMap[t].comparator||M;this.nodes.sort((function(r,i){var o=r.data[t],s=i.data[t];return(0,p.default)(o)&&(o=o.innerText),(0,p.default)(s)&&(s=s.innerText),e?n(o,s):n(s,o)})),this.renderData(),this.sortId=t,this.isAscending=e},e.prototype.updateWeights=function(){var t=this.container,e=this.$headerRow,n=this.options.columns,r=t.offsetWidth;if(!this.colWidthsInitialized&&r){for(var i=0,o=n.length;i<o;i++){var s=n[i];if(!s.weight){var a=e.find("th").get(i).offsetWidth;s.weight=100*a/r}}this.colWidthsInitialized=!0}this.applyColWeights()},e.prototype.applyColWeights=function(){var t=this.container,e=this.$colgroup,n=this.options.columns,r=t.offsetWidth;if(!(r<=0)){for(var i=0,o=n.length,s=0;s<o;s++)i+=n[s].weight;var a="",u=0,c=0;this.colWidths=[];for(s=0;s<o;s++){var f=(u+=n[s].weight)*r/i|0,l=Math.max(f-c,14);c=f,a+='<col style="width:'.concat(l,'px"></col>'),this.colWidths[s]=l}e.html(a),this.positionResizers()}},e.prototype.positionResizers=function(){for(var t=this.colWidths,e=[],n=t.length-1,r=0;r<n;r++)e[r]=(e[r-1]||0)+t[r];for(r=0;r<n;r++)this.$resizers.eq(r).css("left",e[r]+"px")},e.prototype.renderData=function(){var t=this,e=this.tableBody,n=this.nodes,r=this.fillerRow;(0,f.default)(n,(function(t){return t.detach()})),(0,f.default)(n,(function(n){t.filterNode(n)&&e.insertBefore(n.container,r)})),this.selectedNode&&!this.filterNode(this.selectedNode)&&this.selectNode(null),this.updateHeight()},e.prototype.filterNode=function(t){var e=this.options.filter;if(e){if((0,_.default)(e))return e(t);if((0,w.default)(e))return e.test(t.text());if((0,z.default)(e)&&(e=(0,C.default)(e)))return(0,S.default)((0,j.default)(t.text()),(0,j.default)(e))}return!0},e.prototype.renderHeader=function(){var t=this.c,e="",n="";(0,f.default)(this.options.columns,(function(r){var i=(0,l.default)(r.title);r.sortable?e+=t('<th class="sortable" data-id="'.concat(r.id,'">').concat(i,"</th>")):e+="<th>".concat(i,"</th>"),n+="<td></td>"})),this.$headerRow.html(e),this.$fillerRow.html(n)},e.prototype.renderResizers=function(){for(var t="",e=this.options.columns.length-1,n=0;n<e;n++)t+=this.c('<div class="resizer" data-idx="'.concat(n,'"></div>'));this.$container.append(t),this.$resizers=this.find(".resizer")},e.prototype.initTpl=function(){this.$container.html(this.c((0,u.default)(T||(T=o(['\n <div class="header-container">\n <table class="header">\n <colgroup></colgroup>\n <tbody>\n <tr></tr>\n </tbody>\n </table>\n </div>\n <div class="data-container">\n <table class="data">\n <colgroup></colgroup>\n <tbody>\n <tr class="filler-row"></tr>\n </tbody>\n </table>\n </div>\n '],['\n <div class="header-container">\n <table class="header">\n <colgroup></colgroup>\n <tbody>\n <tr></tr>\n </tbody>\n </table>\n </div>\n <div class="data-container">\n <table class="data">\n <colgroup></colgroup>\n <tbody>\n <tr class="filler-row"></tr>\n </tbody>\n </table>\n </div>\n '])))))},e}(c.default);e.default=R;var T,L=function(){function t(t,e,n){void 0===n&&(n={selectable:!1}),this.container=(0,h.default)("tr"),this.selectable=!1,this.container.dataGridNode=this,this.$container=(0,a.default)(this.container),this.$container.addClass(t.c("node")),this.dataGrid=t,this.data=e,n.selectable&&(this.selectable=n.selectable),this.render()}return t.prototype.text=function(){return this.$container.text()},t.prototype.detach=function(){this.$container.remove()},t.prototype.select=function(){this.$container.addClass(this.dataGrid.c("selected"))},t.prototype.deselect=function(){this.$container.rmClass(this.dataGrid.c("selected"))},t.prototype.render=function(){var t=this.data,e=this.$container,n=this.container,r=this.dataGrid.getOption("columns");e.html(""),(0,f.default)(r,(function(e){var r=(0,h.default)("td"),i=t[e.id];(0,v.default)(i)||((0,p.default)(i)?r.appendChild(i):r.innerText=(0,d.default)(i)),n.appendChild(r)}))},t}();function M(t,e){if(t=(0,d.default)(t),e=(0,d.default)(e),(0,y.default)(t,"_")&&!(0,y.default)(e,"_"))return 1;if((0,y.default)(e,"_")&&!(0,y.default)(t,"_"))return-1;for(var n,r,i,o,s=/^\d+|^\D+/;;){if(!t)return e?-1:0;if(!e)return 1;if(n=t.match(s)[0],r=e.match(s)[0],i=!isNaN(n),o=!isNaN(r),i&&!o)return-1;if(o&&!i)return 1;if(i&&o){var a=n-r;if(a)return a;if(n.length!==r.length)return+n||+r?r.length-n.length:n.length-r.length}else if(n!==r)return n<r?-1:1;t=t.substring(n.length),e=e.substring(r.length)}}e.DataGridNode=L,(0,A.exportCjs)(t,R)}).call(this,n(48)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(6),i=n(4),o=Object.getPrototypeOf,s={}.constructor;e=function(t){if(r(t)){if(o)return o(t);var e=t.__proto__;return e||null===e?e:i(t.constructor)?t.constructor.prototype:t instanceof s?s.prototype:void 0}},t.exports=e},function(t,e,n){var r=n(51);function i(t,e){return t===e}e=function(t,e){return e=e||i,r(t,(function(t,n,r){for(var i=r.length;++n<i;)if(e(t,r[n]))return!1;return!0}))},t.exports=e},function(t,e,n){var r=n(13),i=n(0);e=function(t,e,n){var o=[];return e=r(e,n),i(t,(function(t,n,r){e(t,n,r)&&o.push(t)})),o},t.exports=e},function(t,e,n){var r=n(53),i=n(54);e=function(t){return t=r({},t),function(e){return i(e,t)}},t.exports=e},function(t,e,n){var r=n(5);e=n(17)(r),t.exports=e},function(t,e,n){var r=n(5);e=function(t,e){var n=r(e),i=n.length;if(null==t)return!i;t=Object(t);for(var o=0;o<i;o++){var s=n[o];if(e[s]!==t[s]||!(s in t))return!1}return!0},t.exports=e},function(t,e){e=function(t){return t},t.exports=e},function(t,e,n){var r=n(8),i=n(27);e=function(t){return r(t)?function(e){return i(e,t)}:(e=t,function(t){return null==t?void 0:t[e]});var e},t.exports=e},function(t,e,n){var r=n(12),i=n(8);e=function(t,e){if(i(t))return t;if(e&&r(e,t))return[t];var n=[];return t.replace(o,(function(t,e,r,i){n.push(r?i.replace(s,"$1"):e||t)})),n};var o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g;t.exports=e},function(t,e,n){var r=n(59);e=function(t,e){t.prototype=r(e.prototype)},t.exports=e},function(t,e,n){var r=n(6);e=function(t){if(!r(t))return{};if(i)return i(t);function e(){}return e.prototype=t,new e};var i=Object.create;t.exports=e},function(t,e,n){var r=n(4);e="undefined"!=typeof wx&&r(wx.openLocation),t.exports=e},function(t,e,n){e=n(28)((function(t,e){for(var n=t.length,r=0,i=e.length;r<i;r++)for(var o=e[r],s=0,a=o.length;s<a;s++)t[n++]=o[s];return t.length=n,t})),t.exports=e},function(t,e,n){var r=n(3);e=function(t){var e=(t=r(t))[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},t.exports=e},function(t,e,n){var r=n(0),i=n(3);e=function(t){t=i(t),r(t,(function(t){(function(t){return"none"==getComputedStyle(t,"").getPropertyValue("display")})(t)&&(t.style.display=function(t){var e,n;o[t]||(e=document.createElement(t),document.documentElement.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),o[t]=n);return o[t]}(t.nodeName))}))};var o={};t.exports=e},function(t,e){e=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},t.exports=e},function(t,e,n){var r=n(0);e=function(t){var e=[];return r(t,(function(t){e.push(t)})),e},t.exports=e},function(t,e,n){var r=n(67),i=n(68),o=n(69),s=n(12),a=n(29);(e=r((function(t){if(t=t.replace(c,""),t=i(t),s(f,t))return t;for(var e=u.length;e--;){var n=u[e]+o(t);if(s(f,n))return n}return t}))).dash=r((function(t){var n=e(t);return(c.test(n)?"-":"")+a(n)}));var u=["O","ms","Moz","Webkit"],c=/^(O)|(ms)|(Moz)|(Webkit)|(-o-)|(-ms-)|(-moz-)|(-webkit-)/g,f=document.createElement("p").style;t.exports=e},function(t,e,n){var r=n(12);e=function(t,e){var n=function(i){var o=n.cache,s=""+(e?e.apply(this,arguments):i);return r(o,s)||(o[s]=t.apply(this,arguments)),o[s]};return n.cache={},n},t.exports=e},function(t,e,n){var r=n(30);function i(t,e){this[e]=t.replace(/\w/,(function(t){return t.toUpperCase()}))}e=function(t){var e=r(t),n=e[0];return e.shift(),e.forEach(i,e),n+=e.join("")},t.exports=e},function(t,e){e=function(t){return t.length<1?t:t[0].toUpperCase()+t.slice(1)},t.exports=e},function(t,e,n){var r=n(2),i=n(0),o=n(3);function s(t){return function(e,n){var s=(e=o(e))[0];if(r(n))return s?s[t]:"";s&&i(e,(function(e){e[t]=n}))}}e={html:s("innerHTML"),text:s("textContent"),val:s("value")},t.exports=e},function(t,e,n){var r=n(0),i=n(3);e=function(t){t=i(t),r(t,(function(t){var e=t.parentNode;e&&e.removeChild(t)}))},t.exports=e},function(t,e,n){var r=n(31),i=n(1),o=n(6),s=n(0);n(3);e=function(t,e,n){var a=e;return i(e)&&(a="data-"+e),o(e)&&(a={},s(e,(function(t,e){a["data-"+e]=t}))),r(t,a,n)},t.exports=e},function(t,e,n){var r=n(9),i=n(14);function o(){return!0}function s(){return!1}function a(t){var n,r=this.events[t.type],i=u.call(this,t,r);t=new e.Event(t);for(var o,s,a=0;(s=i[a++])&&!t.isPropagationStopped();)for(t.curTarget=s.el,o=0;(n=s.handlers[o++])&&!t.isImmediatePropagationStopped();)!1===n.handler.apply(s.el,[t])&&(t.preventDefault(),t.stopPropagation())}function u(t,e){var n,r,o,s,a=t.target,u=[],c=e.delegateCount;if(a.nodeType)for(;a!==this;a=a.parentNode||this){for(r=[],s=0;s<c;s++)void 0===r[n=(o=e[s]).selector+" "]&&(r[n]=i(this.querySelectorAll(n),a)),r[n]&&r.push(o);r.length&&u.push({el:a,handlers:r})}return c<e.length&&u.push({el:this,handlers:e.slice(c)}),u}e={add:function(t,e,n,r){var i,o={selector:n,handler:r};t.events||(t.events={}),(i=t.events[e])||((i=t.events[e]=[]).delegateCount=0,t.addEventListener(e,(function(){a.apply(t,arguments)}),!1)),n?i.splice(i.delegateCount++,0,o):i.push(o)},remove:function(t,e,n,r){var i=t.events;if(i&&i[e])for(var o,s=i[e],a=s.length;a--;)o=s[a],n&&o.selector!=n||o.handler!=r||(s.splice(a,1),o.selector&&s.delegateCount--)},Event:r({className:"Event",initialize:function(t){this.origEvent=t},isDefaultPrevented:s,isPropagationStopped:s,isImmediatePropagationStopped:s,preventDefault:function(){var t=this.origEvent;this.isDefaultPrevented=o,t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){var t=this.origEvent;this.isPropagationStopped=o,t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.origEvent;this.isImmediatePropagationStopped=o,t&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),this.stopPropagation()}})},t.exports=e},function(t,e,n){var r=n(13),i=n(10),o=n(5);e=function(t,e,n){e=r(e,n);for(var s=!i(t)&&o(t),a=(s||t).length,u=0;u<a;u++){var c=s?s[u]:u;if(e(t[c],c,t))return!0}return!1},t.exports=e},function(t,e,n){var r=n(0),i=n(3),o=n(1);function s(t){return function(e,n){e=i(e),r(e,(function(e){if(o(n))e.insertAdjacentHTML(t,n);else{var r=e.parentNode;switch(t){case"beforebegin":r&&r.insertBefore(n,e);break;case"afterend":r&&r.insertBefore(n,e.nextSibling);break;case"beforeend":e.appendChild(n);break;case"afterbegin":e.prepend(n)}}}))}}e={before:s("beforebegin"),after:s("afterend"),append:s("beforeend"),prepend:s("afterbegin")},t.exports=e},function(t,e,n){var r=n(1),i=n(7),o=n(35),s=n(18),a=n(20);e=function(t){r(t)&&(t=i(t));for(var e="",n=arguments.length,c=new Array(n>1?n-1:0),f=1;f<n;f++)c[f-1]=arguments[f];for(var l=0,h=t.length;l<h;l++)e+=t[l],c[l]&&(e+=c[l]);for(var d=e.split("\n"),p=[],v=0,g=d.length;v<g;v++){var m=d[v],x=m.match(u);x&&p.push(x[1].length)}var y=p.length>0?o.apply(null,p):0;return a(s(d,(function(t){return" "===t[0]?t.slice(y):t})).join("\n"))};var u=/^(\s+)\S+/;t.exports=e},function(t,e){var n=/^\s+/;e=function(t,e){if(null==e)return t.trimLeft?t.trimLeft():t.replace(n,"");for(var r,i,o=0,s=t.length,a=e.length,u=!0;u&&o<s;)for(u=!1,r=-1,i=t.charAt(o);++r<a;)if(i===e[r]){u=!0,o++;break}return o>=s?"":t.substr(o,s)},t.exports=e},function(t,e){e=function(t,e){if(null==e){if(t.trimRight)return t.trimRight();e=" \r\n\t\f\v"}for(var n,r,i=t.length-1,o=e.length,s=!0;s&&i>=0;)for(s=!1,n=-1,r=t.charAt(i);++n<o;)if(r===e[n]){s=!0,i--;break}return i>=0?t.substring(0,i+1):""},t.exports=e},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=o(n(80)),a=o(n(23)),u=n(37),c=o(n(0)),f=o(n(15)),l=o(n(42)),h=o(n(94)),d=function(t){function e(e,n,r){var i=n.compName,o=(void 0===r?{}:r).theme,s=void 0===o?"light":o,f=t.call(this)||this;return f.subComponents=[],f.compName=i,f.c=(0,u.classPrefix)(i),f.options={},f.container=e,f.$container=(0,a.default)(e),f.$container.addClass(["luna-".concat(i),f.c("platform-".concat((0,u.getPlatform)()))]),f.on("optionChange",(function(t,e,n){var r=f.c;"theme"===t&&(f.$container.rmClass(r("theme-".concat(n))).addClass(r("theme-".concat(e))),(0,c.default)(f.subComponents,(function(t){return t.setOption("theme",e)})))})),f.setOption("theme",s),f}return i(e,t),e.prototype.destroy=function(){this.destroySubComponents();var t=this.c;this.$container.rmClass("luna-".concat(this.compName)).rmClass(t("platform-".concat((0,u.getPlatform)()))).rmClass(t("theme-".concat(this.options.theme))),this.$container.html(""),this.emit("destroy"),this.removeAllListeners()},e.prototype.setOption=function(t,e){var n=this,r=this.options,i={};"string"==typeof t?i[t]=e:i=t,(0,c.default)(i,(function(t,e){var i=r[e];r[e]=t,n.emit("optionChange",e,t,i)}))},e.prototype.getOption=function(t){return this.options[t]},e.prototype.addSubComponent=function(t){t.setOption("theme",this.options.theme),this.subComponents.push(t)},e.prototype.removeSubComponent=function(t){(0,h.default)(this.subComponents,(function(e){return e===t}))},e.prototype.destroySubComponents=function(){(0,c.default)(this.subComponents,(function(t){return t.destroy()})),this.subComponents=[]},e.prototype.initOptions=function(t,e){void 0===e&&(e={}),(0,l.default)(t,e),(0,f.default)(this.options,t)},e.prototype.find=function(t){return this.$container.find(this.c(t))},e}(s.default);e.default=d},function(t,e,n){var r=n(9),i=n(12),o=n(0),s=n(81),a=n(82),u=n(36);e=r({initialize:function(){this._events=this._events||{}},on:function(t,e){return this._events[t]=this._events[t]||[],this._events[t].push(e),this},off:function(t,e){var n=this._events;if(i(n,t)){var r=n[t].indexOf(e);return r>-1&&n[t].splice(r,1),this}},once:function(t,e){return this.on(t,a(e)),this},emit:function(t){var e=this;if(i(this._events,t)){var n=s(arguments,1),r=u(this._events[t]);return o(r,(function(t){return t.apply(e,n)}),this),this}},removeAllListeners:function(t){return t?delete this._events[t]:this._events={},this}},{mixin:function(t){o(["on","off","once","emit","removeAllListeners"],(function(n){t[n]=e.prototype[n]})),t._events=t._events||{}}}),t.exports=e},function(t,e){e=function(t,e,n){var r=t.length;e=null==e?0:e<0?Math.max(r+e,0):Math.min(e,r),n=null==n?r:n<0?Math.max(r+n,0):Math.min(n,r);for(var i=[];e<n;)i.push(t[e++]);return i},t.exports=e},function(t,e,n){e=n(83)(n(84),2),t.exports=e},function(t,e,n){var r=n(28),i=n(7);e=r((function(t,e){return function(){var n=[];return n=(n=n.concat(e)).concat(i(arguments)),t.apply(this,n)}})),t.exports=e},function(t,e){e=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},t.exports=e},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(87),i=n(89),o=n(8),s=n(0),a=n(1),u=n(91);var c=function(t){return t.replace(/"/g,'"')},f=function(t){return t.replace(/"/g,""")};e={parse:function(t){var e=[],n=new i;return r(t,{start:function(t,e){e=u(e,(function(t){return c(t)})),n.push({tag:t,attrs:e})},end:function(){var t=n.pop();if(n.size){var r=n.peek();o(r.content)||(r.content=[]),r.content.push(t)}else e.push(t)},comment:function(t){var r="\x3c!--".concat(t,"--\x3e"),i=n.peek();i?(i.content||(i.content=[]),i.content.push(r)):e.push(r)},text:function(t){var r=n.peek();r?(r.content||(r.content=[]),r.content.push(t)):e.push(t)}}),e},stringify:function t(e){var n="";return o(e)?s(e,(function(e){return n+=t(e)})):a(e)?n=e:(n+="<".concat(e.tag),s(e.attrs,(function(t,e){return n+=" ".concat(e,'="').concat(f(t),'"')})),n+=">",e.content&&(n+=t(e.content)),n+="</".concat(e.tag,">")),n}},t.exports=e},function(t,e,n){var r=n(32),i=n(88),o=n(22),s=n(39);e=function(t,e){for(var n,i=[],h=t;t;){if(n=!0,r(i)&&l[r(i)]){var d=new RegExp("</".concat(r(i),"[^>]*>")).exec(t);if(d){var p=t.substring(0,d.index);t=t.substring(d.index+d[0].length),p&&e.text&&e.text(p)}w("",r(i))}else{if(o(t,"\x3c!--")){var v=t.indexOf("--\x3e");v>=0&&(e.comment&&e.comment(t.substring(4,v)),t=t.substring(v+3),n=!1)}else if(o(t,"<!")){var g=t.match(a);g&&(e.text&&e.text(t.substring(0,g[0].length)),t=t.substring(g[0].length),n=!1)}else if(o(t,"</")){var m=t.match(u);m&&(t=t.substring(m[0].length),m[0].replace(u,w),n=!1)}else if(o(t,"<")){var x=t.match(c);x&&(t=t.substring(x[0].length),x[0].replace(c,_),n=!1)}if(n){var y=t.indexOf("<"),b=y<0?t:t.substring(0,y);t=y<0?"":t.substring(y),e.text&&e.text(b)}}if(h===t)throw Error("Parse Error: "+t);h=t}function _(t,n,r,o){if(n=s(n),(o=!!o)||i.push(n),e.start){var a={};r.replace(f,(function(t,e,n,r,i){a[e]=n||r||i||""})),e.start(n,a,o)}}function w(t,n){var r;if(n=s(n))for(r=i.length-1;r>=0&&i[r]!==n;r--);else r=0;if(r>=0){for(var o=i.length-1;o>=r;o--)e.end&&e.end(i[o]);i.length=r}}w()};var a=/^<!\s*doctype((?:\s+[\w:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/i,u=/^<\/([-A-Za-z0-9_]+)[^>]*>/,c=/^<([-A-Za-z0-9_]+)((?:\s+[-A-Za-z0-9_:@.]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/i,f=/([-A-Za-z0-9_:@.]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,l=i("script,style".split(","));t.exports=e},function(t,e,n){var r=n(0),i=n(2),o=n(4);e=function(t,e){i(e)&&(e=!0);var n=o(e),s={};return r(t,(function(t){s[t]=n?e(t):e})),s},t.exports=e},function(t,e,n){var r=n(9),i=n(90);e=r({initialize:function(){this.clear()},clear:function(){this._items=[],this.size=0},push:function(t){return this._items.push(t),++this.size},pop:function(){if(this.size)return this.size--,this._items.pop()},peek:function(){return this._items[this.size-1]},forEach:function(t,e){e=arguments.length>1?e:this;for(var n=this._items,r=this.size-1,i=0;r>=0;r--,i++)t.call(e,n[r],i,this)},toArr:function(){return i(this._items)}}),t.exports=e},function(t,e){e=function(t){var e=t.length,n=Array(e);e--;for(var r=0;r<=e;r++)n[e-r]=t[r];return n},t.exports=e},function(t,e,n){var r=n(13),i=n(5);e=function(t,e,n){e=r(e,n);for(var o=i(t),s=o.length,a={},u=0;u<s;u++){var c=o[u];a[c]=e(t[c],c,t)}return a},t.exports=e},function(t,e,n){var r=n(38);e=function(t){if(t=(t=t||(r?navigator.userAgent:"")).toLowerCase(),e("windows phone"))return"windows phone";if(e("win"))return"windows";if(e("android"))return"android";if(e("ipad")||e("iphone")||e("ipod"))return"ios";if(e("mac"))return"os x";if(e("linux"))return"linux";function e(e){return t.indexOf(e)>-1}return"unknown"},t.exports=e},function(t,e,n){var r=n(21),i=r.getComputedStyle,o=r.document;function s(t,e){return t.right<e.left||t.left>e.right||t.bottom<e.top||t.top>e.bottom}e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.display,r=void 0===n||n,a=e.visibility,u=void 0!==a&&a,c=e.opacity,f=void 0!==c&&c,l=e.size,h=void 0!==l&&l,d=e.viewport,p=void 0!==d&&d,v=e.overflow,g=void 0!==v&&v;if(r)return null===t.offsetParent;var m=i(t);if(u&&"hidden"===m.visibility)return!0;if(f){if("0"===m.opacity)return!0;for(var x=t;x=x.parentElement;){var y=i(x);if("0"===y.opacity)return!0}}var b=t.getBoundingClientRect();if(h&&(0===b.width||0===b.height))return!0;if(p){var _={top:0,left:0,right:o.documentElement.clientWidth,bottom:o.documentElement.clientHeight};return s(b,_)}if(g)for(var w=t;w=w.parentElement;){var z=i(w),C=z.overflow;if("scroll"===C||"hidden"===C){var S=w.getBoundingClientRect();if(s(b,S))return!0}}return!1},t.exports=e},function(t,e,n){var r=n(13);e=function(t,e,n){var i=[];e=r(e,n);for(var o=-1,s=t.length;++o<s;){var a=t[o];e(a,o,t)&&(i.push(a),t.splice(o,1))}return i},t.exports=e},function(t,e,n){var r=n(5),i=(e=function(t){return s.test(t)?t.replace(a,u):t}).map={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},o="(?:"+r(i).join("|")+")",s=new RegExp(o),a=new RegExp(o,"g"),u=function(t){return i[t]};t.exports=e},function(t,e,n){var r=n(97),i=n(43),o=n(33),s=n(19),a=n(14),u=n(15),c=n(21);e=c.ResizeObserver?r.extend({initialize:function(t){var e=this;if(t._resizeSensor)return t._resizeSensor;this.callSuper(r,"initialize");var n=new c.ResizeObserver((function(){return e.emit()}));n.observe(t),t._resizeSensor=this,this._resizeObserver=n,this._el=t},destroy:function(){var t=this._el;t._resizeSensor&&(this.rmAllListeners(),delete t._resizeSensor,this._resizeObserver.unobserve(t))}}):r.extend({initialize:function(t){if(t._resizeSensor)return t._resizeSensor;this.callSuper(r,"initialize"),this._el=t,t._resizeSensor=this,a(["absolute","relative","fixed","sticky"],s(t,"position"))||s(t,"position","relative"),this._appendResizeSensor(),this._bindEvent()},destroy:function(){var t=this._el;t._resizeSensor&&(this.rmAllListeners(),delete t._resizeSensor,t.removeChild(this._resizeSensorEl))},_appendResizeSensor:function(){var t=this._el,e={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},n={position:"absolute",left:"0px",top:"0px",transition:"0s"},r=i("div",{style:n}),o=i("div.resize-sensor-expand",{style:e},r),s=i("div.resize-sensor-shrink",{style:e},i("div",{style:u({width:"200%",height:"200%"},n)})),a=i("div.resize-sensor",{dir:"ltr",style:e},o,s);this._expandEl=o,this._expandChildEl=r,this._shrinkEl=s,this._resizeSensorEl=a,t.appendChild(a),this._resetExpandShrink()},_bindEvent:function(){var t=this;o.on(this._expandEl,"scroll",(function(){return t._onScroll()})),o.on(this._shrinkEl,"scroll",(function(){return t._onScroll()}))},_onScroll:function(){this.emit(),this._resetExpandShrink()},_resetExpandShrink:function(){var t=this._el,e=t.offsetWidth,n=t.offsetHeight;s(this._expandChildEl,{width:e+10,height:n+10}),u(this._expandEl,{scrollLeft:e+10,scrollTop:n+10}),u(this._shrinkEl,{scrollLeft:e+10,scrollTop:n+10})}}),t.exports=e},function(t,e,n){var r=n(9),i=n(36),o=n(0),s=n(7);e=r({initialize:function(){this._listeners=[]},addListener:function(t){this._listeners.push(t)},rmListener:function(t){var e=this._listeners.indexOf(t);e>-1&&this._listeners.splice(e,1)},rmAllListeners:function(){this._listeners=[]},emit:function(){var t=this,e=s(arguments),n=i(this._listeners);o(n,(function(n){return n.apply(t,e)}),this)}},{mixin:function(t){o(["addListener","rmListener","emit","rmAllListeners"],(function(n){t[n]=e.prototype[n]})),t._listeners=t._listeners||[]}}),t.exports=e},function(t,e,n){var r=n(99);e=function(t,e){return r(t,e,!0)},t.exports=e},function(t,e){e=function(t,e,n){var r;return function(){var i=this,o=arguments,s=function(){r=null,t.apply(i,o)};n||clearTimeout(r),n&&r||(r=setTimeout(s,e))}},t.exports=e},function(t,e){e=function(t){return null===t},t.exports=e},function(t,e,n){var r=n(11);e=function(t){return"[object RegExp]"===r(t)},t.exports=e},function(t,e,n){var r=n(2);e=function(t,e,n){return r(n)&&(n=e,e=void 0),!r(e)&&t<e?e:t>n?n:t},t.exports=e},function(t,e){e=function(){for(var t=arguments,e=t[0],n=1,r=t.length;n<r;n++)t[n]>e&&(e=t[n]);return e},t.exports=e}])})); | ||
//# sourceMappingURL=luna-data-grid.js.map |
{ | ||
"name": "luna-data-grid", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "Grid for displaying datasets", | ||
@@ -5,0 +5,0 @@ "main": "cjs/data-grid/index.js", |
@@ -55,2 +55,3 @@ # Luna Data Grid | ||
* columns(IColumn[]): Table columns. | ||
* filter(string | RegExp | AnyFn): Data filter. | ||
* height(number): Table height. | ||
@@ -57,0 +58,0 @@ * maxHeight(number): Max table height. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
273485
1909
87
0