canvas-datagrid 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/canvas-datagrid.debug.js +355 -144
- package/dist/canvas-datagrid.debug.map +1 -1
- package/dist/canvas-datagrid.js +1 -1
- package/dist/canvas-datagrid.module.js +1 -1
- package/dist/canvas-datagrid.module.js.map +1 -1
- package/dist/types.d.ts +12 -8
- package/lib/contextMenu.js +2 -2
- package/lib/defaults.js +9 -7
- package/lib/docs.js +16 -0
- package/lib/dom.js +29 -2
- package/lib/draw.js +157 -60
- package/lib/events/index.js +130 -65
- package/lib/intf.js +8 -14
- package/lib/publicMethods.js +118 -42
- package/package.json +1 -1
|
@@ -1755,7 +1755,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1755
1755
|
function createDisposeEvent() {
|
|
1756
1756
|
requestAnimationFrame(function () {
|
|
1757
1757
|
document.addEventListener('click', self.disposeContextMenu);
|
|
1758
|
-
|
|
1758
|
+
window.removeEventListener('mouseup', createDisposeEvent);
|
|
1759
1759
|
});
|
|
1760
1760
|
}
|
|
1761
1761
|
|
|
@@ -1803,7 +1803,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1803
1803
|
self.contextMenu = createContextMenu(ev, contextPosition, items);
|
|
1804
1804
|
|
|
1805
1805
|
if (e.type == 'mousedown') {
|
|
1806
|
-
|
|
1806
|
+
window.addEventListener('mouseup', createDisposeEvent);
|
|
1807
1807
|
} else {
|
|
1808
1808
|
createDisposeEvent();
|
|
1809
1809
|
}
|
|
@@ -1842,7 +1842,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1842
1842
|
attributes: [['allowColumnReordering', true], ['allowColumnResize', true], ['allowColumnResizeFromCell', false], ['allowFreezingRows', false], ['allowFreezingColumns', false], ['allowMovingSelection', true], ['allowRowHeaderResize', true], ['allowRowReordering', false], ['allowRowResize', true], ['allowRowResizeFromCell', false], ['allowSorting', true], ['allowGroupingRows', true], ['allowGroupingColumns', true], ['animationDurationShowContextMenu', 50], ['animationDurationHideContextMenu', 50], ['autoGenerateSchema', false], ['autoResizeColumns', false], ['autoResizeRows', false], ['autoScrollOnMousemove', false], ['autoScrollMargin', 5], ['blanksText', '(Blanks)'], ['borderDragBehavior', 'none'], ['borderResizeZone', 10], ['clearSettingsOptionText', 'Clear saved settings'], ['columnHeaderClickBehavior', 'sort'], ['columnSelectorHiddenText', ' '], ['columnSelectorText', 'Add/Remove columns'], ['columnSelectorVisibleText', "\u2713"], ['contextHoverScrollAmount', 2], ['contextHoverScrollRateMs', 5], ['copyHeadersOnSelectAll', true], ['copyText', 'Copy'], ['debug', false], ['editable', true], ['ellipsisText', '...'], ['filterOptionText', 'Filter %s'], ['filterTextPrefix', '(filtered) '], ['filterFrozenRows', true], ['globalRowResize', false], ['hideColumnText', 'Hide %s'], ['showUnhideColumnsIndicator', false], ['showUnhideRowsIndicator', false], ['showHideRow', 'Hide row %s'], ['showHideRows', 'Hide rows %s'], ['hoverMode', 'cell'], ['keepFocusOnMouseOut', false], ['maxAutoCompleteItems', 200], ['multiLine', false], ['name', ''], ['pageUpDownOverlap', 1], ['pasteText', 'Paste'], ['persistantSelectionMode', false], ['removeFilterOptionText', 'Remove filter on %s'], ['reorderDeadZone', 3], ['resizeScrollZone', 20], ['rowGrabZoneSize', 5], ['columnGrabZoneSize', 30], ['saveAppearance', true], ['scrollAnimationPPSThreshold', 0.75], ['scrollPointerLock', false], ['scrollRepeatRate', 75], ['selectionFollowsActiveCell', false], ['selectionHandleBehavior', 'none'], ['selectionMode', 'cell'], ['selectionScrollIncrement', 20], ['selectionScrollZone', 20], ['showClearSettingsOption', true], ['showColumnHeaders', true], ['showColumnSelector', true], ['showCopy', false], ['showFilter', true], ['showFilterInCell', false], ['showNewRow', false], ['showOrderByOption', true], ['showOrderByOptionTextAsc', 'Order by %s ascending'], ['showOrderByOptionTextDesc', 'Order by %s descending'], //#region grouping
|
|
1843
1843
|
['showGroupColumns', 'Group columns %s'], ['showGroupRows', 'Group rows %s'], ['showRemoveGroupColumns', 'Remove group %s'], ['showRemoveGroupRows', 'Remove group %s'], ['showRemoveAllGroupColumns', 'Remove all column groups'], ['showRemoveAllGroupRows', 'Remove all row groups'], ['showExpandAllGroupColumns', 'Expand all column groups'], ['showExpandAllGroupRows', 'Expand all row groups'], ['showCollapseAllGroupColumns', 'Collapse all column groups'], ['showCollapseAllGroupRows', 'Collapse all row groups'], ['columnGroupIndicatorPosition', 'right'], ['rowGroupIndicatorPosition', 'bottom'], //#endregion grouping
|
|
1844
1844
|
['showPaste', false], ['showPerformance', false], ['showRowHeaders', true], ['showRowNumbers', true], ['showRowNumberGaps', true], ['singleSelectionMode', false], ['snapToRow', false], ['sortFrozenRows', true], ['touchContextMenuTimeMs', 800], ['touchDeadZone', 3], ['touchEasingMethod', 'easeOutQuad'], ['touchReleaseAcceleration', 1000], ['touchReleaseAnimationDurationMs', 2000], ['touchScrollZone', 20], ['touchSelectHandleZone', 20], ['touchZoomSensitivity', 0.005], ['touchZoomMin', 0.5], ['touchZoomMax', 1.75], ['maxPixelRatio', 2], ['tree', false], ['treeHorizontalScroll', false], ['rowTree', []], ['rowTreeColIndex', 0], ['columnTree', []], ['columnTreeRowStartIndex', 0], ['columnTreeRowEndIndex', 0]],
|
|
1845
|
-
styles: [['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'], ['activeCellBorderWidth', 1], ['activeCellColor', 'rgba(0, 0, 0, 1)'], ['activeCellFont', '16px sans-serif'], ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellHorizontalAlignment', 'left'], ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'], ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['activeCellOverlayBorderWidth', 1], ['activeCellPaddingBottom', 5], ['activeCellPaddingLeft', 5], ['activeCellPaddingRight', 5], ['activeCellPaddingTop', 5], ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'], ['activeCellVerticalAlignment', 'center'], ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['autocompleteBottomMargin', 60], ['autosizeHeaderCellPadding', 8], ['autosizePadding', 5], ['buttonActiveBackgroundColor', 'rgba(255, 255, 255, 1)'], ['buttonActiveBorderColor', 'rgba(110, 168, 255, 1)'], ['buttonArrowColor', 'rgba(50, 50, 50, 1)'], ['buttonArrowDownHTML', '▼'], ['buttonZIndex', 10000], ['buttonBackgroundColor', 'rgba(255, 255, 255, 1)'], ['buttonBorderColor', 'rgba(172, 172, 172, 1)'], ['buttonHoverBackgroundColor', 'rgba(240, 240, 240, 1)'], ['buttonMenuWindowMargin', 30], ['buttonPadding', '3px'], ['cellAutoResizePadding', 13], ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellBorderColor', 'rgba(195, 199, 202, 1)'], ['cellBorderWidth', 1], ['cellColor', 'rgba(0, 0, 0, 1)'], ['cellFont', '16px sans-serif'], ['cellGridHeight', 250], ['cellHeight', 24], ['cellHeightWithChildGrid', 150], ['cellHorizontalAlignment', 'left'], ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellHoverColor', 'rgba(0, 0, 0, 1)'], ['cellPaddingBottom', 5], ['cellPaddingLeft', 5], ['cellPaddingRight', 5], ['cellPaddingTop', 5], ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['cellSelectedColor', 'rgba(0, 0, 0, 1)'], ['cellTreeIconBorderColor', 'rgba(162, 174, 207, 1)'], ['cellTreeIconFillColor', 'rgba(240, 240, 240, 1)'], ['cellTreeIconHoverFillColor', 'rgba(198, 217, 233, 1)'], ['cellTreeIconLineColor', 'rgba(43, 53, 81, 1)'], ['cellTreeIconLineWidth', 1.5], ['cellTreeIconMarginLeft', 0], ['cellTreeIconMarginRight', 5], ['cellTreeIconMarginTop', 6], ['cellTreeIconWidth', 13], ['cellVerticalAlignment', 'center'], ['cellWidth', 250], ['cellWidthWithChildGrid', 250], ['cellWhiteSpace', 'nowrap'], ['cellLineHeight', 1], ['cellLineSpacing', 3], ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['childContextMenuArrowHTML', '►'], ['childContextMenuMarginLeft', -11], ['childContextMenuMarginTop', -6], ['columnGroupRowHeight', 25], ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellBorderWidth', 1], ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellCapBorderWidth', 1], ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['columnHeaderCellFont', '16px sans-serif'], ['columnHeaderCellHeight', 25], ['columnHeaderCellHorizontalAlignment', 'left'], ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['columnHeaderCellPaddingBottom', 5], ['columnHeaderCellPaddingLeft', 5], ['columnHeaderCellPaddingRight', 5], ['columnHeaderCellPaddingTop', 5], ['columnHeaderCellVerticalAlignment', 'center'], ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['columnHeaderOrderByArrowBorderWidth', 1], ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'], ['columnHeaderOrderByArrowHeight', 8], ['columnHeaderOrderByArrowMarginLeft', 0], ['columnHeaderOrderByArrowMarginRight', 5], ['columnHeaderOrderByArrowMarginTop', 6], ['columnHeaderOrderByArrowWidth', 13], ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterButtonBorderRadius', '3px'], ['contextFilterButtonHTML', '▼'], ['contextFilterInputBackground', 'rgba(255,255,255,1)'], ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterInputBorderRadius', '0'], ['contextFilterInputColor', 'rgba(0,0,0,1)'], ['contextFilterInputFontFamily', 'sans-serif'], ['contextFilterInputFontSize', '14px'], ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'], ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'], ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['contextMenuArrowDownHTML', '▼'], ['contextMenuArrowUpHTML', '▲'], ['contextMenuBackground', 'rgba(240, 240, 240, 1)'], ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextMenuBorderRadius', '3px'], ['contextMenuChildArrowFontSize', '12px'], ['contextMenuColor', 'rgba(43, 48, 43, 1)'], ['contextMenuCursor', 'default'], ['contextMenuFilterButtonFontFamily', 'sans-serif'], ['contextMenuFilterButtonFontSize', '10px'], ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'], ['contextMenuFontFamily', 'sans-serif'], ['contextMenuFontSize', '16px'], ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'], ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'], ['contextMenuItemBorderRadius', '3px'], ['contextMenuItemMargin', '2px'], ['contextMenuLabelDisplay', 'inline-block'], ['contextMenuLabelMargin', '0 3px 0 0'], ['contextMenuLabelMaxWidth', '700px'], ['contextMenuLabelMinWidth', '75px'], ['contextMenuMarginLeft', 3], ['contextMenuMarginTop', -3], ['contextMenuOpacity', '0.98'], ['contextMenuPadding', '2px'], ['contextMenuWindowMargin', 30], ['contextMenuZIndex', 10000], ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'], ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'], ['debugColor', 'rgba(255, 15, 24, 1)'], ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'], ['debugFont', '11px sans-serif'], ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'], ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'], ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'], ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'], ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'], ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'], ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'], ['display', 'inline-block'], ['editCellBackgroundColor', 'white'], ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'], ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'], ['editCellColor', 'black'], ['editCellFontFamily', 'sans-serif'], ['editCellFontSize', '16px'], ['editCellPaddingLeft', 4], ['editCellZIndex', 10000], ['filterButtonActiveBackgroundColor', 'rgba(225, 225, 225, 1)'], ['filterButtonArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['filterButtonArrowBorderWidth', 1], ['filterButtonArrowClickRadius', 5], ['filterButtonArrowColor', 'rgba(50, 50, 50, 1)'], ['filterButtonArrowHeight', 5], ['filterButtonArrowWidth', 8], ['filterButtonBackgroundColor', 'rgba(240, 240, 240, 1)'], ['filterButtonBorderColor', 'rgba(172, 172, 172, 1)'], ['filterButtonBorderRadius', 3], ['filterButtonHeight', 20], ['filterButtonHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['filterButtonMenuOffsetTop', 10], ['filterButtonWidth', 20], ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'], ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'], ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'], ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'], ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'], ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'], ['frozenMarkerBorderWidth', 1], ['frozenMarkerWidth', 2], ['groupingAreaBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBorderCollapse', 'collapse'], ['gridBorderColor', 'rgba(202, 202, 202, 1)'], ['gridBorderWidth', 1], ['groupIndicatorColor', 'rgba(155, 155, 155, 1)'], ['groupIndicatorBackgroundColor', 'rgba(255, 255, 255, 1)'], ['height', 'auto'], ['maxHeight', 'inherit'], ['maxWidth', 'inherit'], ['minColumnWidth', 45], ['minHeight', 'inherit'], ['minRowHeight', 24], ['minWidth', 'inherit'], ['mobileContextMenuMargin', 10], ['mobileEditInputHeight', 30], ['mobileEditFontFamily', 'sans-serif'], ['mobileEditFontSize', '16px'], ['moveOverlayBorderWidth', 1], ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['moveOverlayBorderSegments', '12, 7'], ['name', 'default'], ['overflowY', 'auto'], ['overflowX', 'auto'], ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'], ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'], ['reorderMarkerBorderWidth', 1.25], ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'], ['reorderMarkerIndexBorderWidth', 2.75], ['rowGroupColumnWidth', 25], ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'], ['rowHeaderCellBorderWidth', 1], ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellFont', '16px sans-serif'], ['rowHeaderCellHeight', 25], ['rowHeaderCellHorizontalAlignment', 'left'], ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['rowHeaderCellPaddingBottom', 5], ['rowHeaderCellPaddingLeft', 5], ['rowHeaderCellPaddingRight', 5], ['rowHeaderCellPaddingTop', 5], ['rowHeaderCellRowNumberGapHeight', 5], ['rowHeaderCellRowNumberGapColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'], ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellVerticalAlignment', 'center'], ['rowHeaderCellWidth', 57], ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'], ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarBorderWidth', 0.5], ['scrollBarBoxBorderRadius', 4.125], ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'], ['scrollBarBoxMargin', 2], ['scrollBarBoxMinSize', 15], ['scrollBarBoxWidth', 8], ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarWidth', 11], ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'], ['selectionHandleBorderWidth', 1.5], ['selectionHandleColor', 'rgba(66, 133, 244, 1)'], ['selectionHandleSize', 8], ['selectionHandleType', 'square'], ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['selectionOverlayBorderWidth', 1], ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['treeArrowBorderWidth', 1], ['treeArrowClickRadius', 5], ['treeArrowColor', 'rgba(155, 155, 155, 1)'], ['treeArrowHeight', 8], ['treeArrowMarginLeft', 0], ['treeArrowMarginRight', 5], ['treeArrowMarginTop', 6], ['treeArrowWidth', 13], ['treeGridHeight', 250], ['unhideIndicatorColor', 'rgba(0, 0, 0, 1)'], ['unhideIndicatorBackgroundColor', 'rgba(255, 255, 255, 1)'], ['unhideIndicatorBorderColor', 'rgba(174, 193, 232, 1)'], ['unhideIndicatorSize', 16], ['width', 'auto']]
|
|
1845
|
+
styles: [['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'], ['activeCellBorderWidth', 1], ['activeCellColor', 'rgba(0, 0, 0, 1)'], ['activeCellFont', '16px sans-serif'], ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellHorizontalAlignment', 'left'], ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'], ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['activeCellOverlayBorderWidth', 1], ['activeCellPaddingBottom', 5], ['activeCellPaddingLeft', 5], ['activeCellPaddingRight', 5], ['activeCellPaddingTop', 5], ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'], ['activeCellVerticalAlignment', 'center'], ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['autocompleteBottomMargin', 60], ['autosizeHeaderCellPadding', 8], ['autosizePadding', 5], ['buttonActiveBackgroundColor', 'rgba(255, 255, 255, 1)'], ['buttonActiveBorderColor', 'rgba(110, 168, 255, 1)'], ['buttonArrowColor', 'rgba(50, 50, 50, 1)'], ['buttonArrowDownHTML', '▼'], ['buttonZIndex', 10000], ['buttonBackgroundColor', 'rgba(255, 255, 255, 1)'], ['buttonBorderColor', 'rgba(172, 172, 172, 1)'], ['buttonHoverBackgroundColor', 'rgba(240, 240, 240, 1)'], ['buttonMenuWindowMargin', 30], ['buttonPadding', '3px'], ['cellAutoResizePadding', 13], ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellBorderColor', 'rgba(195, 199, 202, 1)'], ['cellBorderWidth', 1], ['cellColor', 'rgba(0, 0, 0, 1)'], ['cellFont', '16px sans-serif'], ['cellGridHeight', 250], ['cellHeight', 24], ['cellHeightWithChildGrid', 150], ['cellHorizontalAlignment', 'left'], ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellHoverColor', 'rgba(0, 0, 0, 1)'], ['cellPaddingBottom', 5], ['cellPaddingLeft', 5], ['cellPaddingRight', 5], ['cellPaddingTop', 5], ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['cellSelectedColor', 'rgba(0, 0, 0, 1)'], ['cellTreeIconBorderColor', 'rgba(162, 174, 207, 1)'], ['cellTreeIconFillColor', 'rgba(240, 240, 240, 1)'], ['cellTreeIconHoverFillColor', 'rgba(198, 217, 233, 1)'], ['cellTreeIconLineColor', 'rgba(43, 53, 81, 1)'], ['cellTreeIconLineWidth', 1.5], ['cellTreeIconMarginLeft', 0], ['cellTreeIconMarginRight', 5], ['cellTreeIconMarginTop', 6], ['cellTreeIconWidth', 13], ['cellVerticalAlignment', 'center'], ['cellWidth', 250], ['cellWidthWithChildGrid', 250], ['cellWhiteSpace', 'nowrap'], ['cellLineHeight', 1], ['cellLineSpacing', 3], ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['childContextMenuArrowHTML', '►'], ['childContextMenuMarginLeft', -11], ['childContextMenuMarginTop', -6], ['columnGroupRowHeight', 25], ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellBorderWidth', 1], ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellCapBorderWidth', 1], ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['columnHeaderCellFont', '16px sans-serif'], ['columnHeaderCellHeight', 25], ['columnHeaderCellHorizontalAlignment', 'left'], ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['columnHeaderCellPaddingBottom', 5], ['columnHeaderCellPaddingLeft', 5], ['columnHeaderCellPaddingRight', 5], ['columnHeaderCellPaddingTop', 5], ['columnHeaderCellVerticalAlignment', 'center'], ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['columnHeaderOrderByArrowBorderWidth', 1], ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'], ['columnHeaderOrderByArrowHeight', 8], ['columnHeaderOrderByArrowMarginLeft', 0], ['columnHeaderOrderByArrowMarginRight', 5], ['columnHeaderOrderByArrowMarginTop', 6], ['columnHeaderOrderByArrowWidth', 13], ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterButtonBorderRadius', '3px'], ['contextFilterButtonHTML', '▼'], ['contextFilterInputBackground', 'rgba(255,255,255,1)'], ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterInputBorderRadius', '0'], ['contextFilterInputColor', 'rgba(0,0,0,1)'], ['contextFilterInputFontFamily', 'sans-serif'], ['contextFilterInputFontSize', '14px'], ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'], ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'], ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['contextMenuArrowDownHTML', '▼'], ['contextMenuArrowUpHTML', '▲'], ['contextMenuBackground', 'rgba(240, 240, 240, 1)'], ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextMenuBorderRadius', '3px'], ['contextMenuChildArrowFontSize', '12px'], ['contextMenuColor', 'rgba(43, 48, 43, 1)'], ['contextMenuCursor', 'default'], ['contextMenuFilterButtonFontFamily', 'sans-serif'], ['contextMenuFilterButtonFontSize', '10px'], ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'], ['contextMenuFontFamily', 'sans-serif'], ['contextMenuFontSize', '16px'], ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'], ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'], ['contextMenuItemBorderRadius', '3px'], ['contextMenuItemMargin', '2px'], ['contextMenuLabelDisplay', 'inline-block'], ['contextMenuLabelMargin', '0 3px 0 0'], ['contextMenuLabelMaxWidth', '700px'], ['contextMenuLabelMinWidth', '75px'], ['contextMenuMarginLeft', 3], ['contextMenuMarginTop', -3], ['contextMenuOpacity', '0.98'], ['contextMenuPadding', '2px'], ['contextMenuWindowMargin', 30], ['contextMenuZIndex', 10000], ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'], ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'], ['debugColor', 'rgba(255, 15, 24, 1)'], ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'], ['debugFont', '11px sans-serif'], ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'], ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'], ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'], ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'], ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'], ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'], ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'], ['display', 'inline-block'], ['editCellBackgroundColor', 'white'], ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'], ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'], ['editCellColor', 'black'], ['editCellFontFamily', 'sans-serif'], ['editCellFontSize', '16px'], ['editCellPaddingLeft', 4], ['editCellZIndex', 10000], ['filterButtonActiveBackgroundColor', 'rgba(225, 225, 225, 1)'], ['filterButtonArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['filterButtonArrowBorderWidth', 1], ['filterButtonArrowClickRadius', 5], ['filterButtonArrowColor', 'rgba(50, 50, 50, 1)'], ['filterButtonArrowHeight', 5], ['filterButtonArrowWidth', 8], ['filterButtonBackgroundColor', 'rgba(240, 240, 240, 1)'], ['filterButtonBorderColor', 'rgba(172, 172, 172, 1)'], ['filterButtonBorderRadius', 3], ['filterButtonHeight', 20], ['filterButtonHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['filterButtonMenuOffsetTop', 10], ['filterButtonWidth', 20], ['frozenMarkerHoverColor', 'rgba(165, 198, 254, 1)'], ['frozenMarkerHoverBorderColor', 'rgba(165, 198, 254, 1)'], ['frozenMarkerActiveColor', 'rgba(165, 198, 254, 0.2)'], ['frozenMarkerActiveBorderColor', 'rgba(165, 198, 254, 0.5)'], ['frozenMarkerActiveHeaderColor', 'rgba(165, 198, 254, 1)'], ['frozenMarkerColor', 'rgba(221, 221, 221, 1)'], ['frozenMarkerBorderColor', 'rgba(221, 221, 221, 1)'], ['frozenMarkerBorderWidth', 1], ['frozenMarkerHeaderColor', 'rgba(188, 188, 188, 1)'], ['frozenMarkerWidth', 4], ['groupingAreaBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBorderCollapse', 'collapse'], ['gridBorderColor', 'rgba(202, 202, 202, 1)'], ['gridBorderWidth', 1], ['groupIndicatorColor', 'rgba(155, 155, 155, 1)'], ['groupIndicatorBackgroundColor', 'rgba(255, 255, 255, 1)'], ['height', 'auto'], ['maxHeight', 'inherit'], ['maxWidth', 'inherit'], ['minColumnWidth', 45], ['minHeight', 'inherit'], ['minRowHeight', 24], ['minWidth', 'inherit'], ['mobileContextMenuMargin', 10], ['mobileEditInputHeight', 30], ['mobileEditFontFamily', 'sans-serif'], ['mobileEditFontSize', '16px'], ['moveOverlayBorderWidth', 1], ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['moveOverlayBorderSegments', '12, 7'], ['name', 'default'], ['overflowY', 'auto'], ['overflowX', 'auto'], ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'], ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'], ['reorderMarkerBorderWidth', 1.25], ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'], ['reorderMarkerIndexBorderWidth', 2.75], ['rowGroupColumnWidth', 25], ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'], ['rowHeaderCellBorderWidth', 1], ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellFont', '16px sans-serif'], ['rowHeaderCellHeight', 25], ['rowHeaderCellHorizontalAlignment', 'left'], ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['rowHeaderCellPaddingBottom', 5], ['rowHeaderCellPaddingLeft', 5], ['rowHeaderCellPaddingRight', 5], ['rowHeaderCellPaddingTop', 5], ['rowHeaderCellRowNumberGapHeight', 5], ['rowHeaderCellRowNumberGapColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'], ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellVerticalAlignment', 'center'], ['rowHeaderCellWidth', 57], ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'], ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarBorderWidth', 0.5], ['scrollBarBoxBorderRadius', 4.125], ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'], ['scrollBarBoxMargin', 2], ['scrollBarBoxMinSize', 15], ['scrollBarBoxWidth', 8], ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarWidth', 11], ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'], ['selectionHandleBorderWidth', 1.5], ['selectionHandleColor', 'rgba(66, 133, 244, 1)'], ['selectionHandleSize', 8], ['selectionHandleType', 'square'], ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['selectionOverlayBorderWidth', 1], ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['treeArrowBorderWidth', 1], ['treeArrowClickRadius', 5], ['treeArrowColor', 'rgba(155, 155, 155, 1)'], ['treeArrowHeight', 8], ['treeArrowMarginLeft', 0], ['treeArrowMarginRight', 5], ['treeArrowMarginTop', 6], ['treeArrowWidth', 13], ['treeGridHeight', 250], ['unhideIndicatorColor', 'rgba(0, 0, 0, 1)'], ['unhideIndicatorBackgroundColor', 'rgba(255, 255, 255, 1)'], ['unhideIndicatorBorderColor', 'rgba(174, 193, 232, 1)'], ['unhideIndicatorSize', 16], ['width', 'auto']]
|
|
1846
1846
|
};
|
|
1847
1847
|
}
|
|
1848
1848
|
|
|
@@ -2246,6 +2246,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2246
2246
|
var cellValueIsEmpty = [null, undefined].indexOf(cell.value) !== -1;
|
|
2247
2247
|
var shouldClearCellValue = cellValueIsEmpty || inEnterMode;
|
|
2248
2248
|
self.input.value = shouldClearCellValue ? '' : cell.value;
|
|
2249
|
+
var width = Math.round(self.input.value.length * parseInt(self.style.editCellFontSize, 10) * 0.7 * self.scale);
|
|
2250
|
+
|
|
2251
|
+
if (width + self.style.cellPaddingLeft < cell.width) {
|
|
2252
|
+
width = cell.width - self.style.cellPaddingLeft;
|
|
2253
|
+
} else if (width > self.width - cell.x - self.style.scrollBarWidth) {
|
|
2254
|
+
width = self.width - cell.x - self.style.scrollBarWidth;
|
|
2255
|
+
self.input.style.height = 'auto';
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
self.input.style.width = width + 'px';
|
|
2249
2259
|
self.input.focus();
|
|
2250
2260
|
self.input.addEventListener('click', self.stopPropagation);
|
|
2251
2261
|
self.input.addEventListener('dblclick', self.stopPropagation);
|
|
@@ -2329,6 +2339,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2329
2339
|
|
|
2330
2340
|
self.scrollIntoView(nx, ny);
|
|
2331
2341
|
self.beginEditAt(nx, ny, e);
|
|
2342
|
+
} else {
|
|
2343
|
+
var _width = Math.round(self.input.value.length * parseInt(self.style.editCellFontSize, 10) * 0.7 * self.scale);
|
|
2344
|
+
|
|
2345
|
+
if (_width + self.style.cellPaddingLeft < cell.width) {
|
|
2346
|
+
_width = cell.width - self.style.cellPaddingLeft;
|
|
2347
|
+
} else if (_width > self.width - cell.x - self.style.scrollBarWidth) {
|
|
2348
|
+
_width = self.width - cell.x - self.style.scrollBarWidth;
|
|
2349
|
+
self.input.style.height = 'auto';
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
self.input.style.width = _width + 'px';
|
|
2332
2353
|
}
|
|
2333
2354
|
});
|
|
2334
2355
|
self.dispatchEvent('beginedit', {
|
|
@@ -2659,11 +2680,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2659
2680
|
});
|
|
2660
2681
|
self.eventParent.addEventListener('scroll', self.resize, false);
|
|
2661
2682
|
self.eventParent.addEventListener('touchstart', self.touchstart, false);
|
|
2662
|
-
self.eventParent.addEventListener('mouseup', self.mouseup, false);
|
|
2663
2683
|
self.eventParent.addEventListener('mousedown', self.mousedown, false);
|
|
2664
2684
|
self.eventParent.addEventListener('dblclick', self.dblclick, false);
|
|
2665
2685
|
self.eventParent.addEventListener('click', self.click, false);
|
|
2666
|
-
|
|
2686
|
+
window.addEventListener('mouseup', self.mouseup, false);
|
|
2687
|
+
window.addEventListener('mousemove', self.mousemove);
|
|
2667
2688
|
self[self.isChildGrid ? 'parentGrid' : 'eventParent'].addEventListener('wheel', self.scrollWheel, false);
|
|
2668
2689
|
self.canvas.addEventListener('contextmenu', self.contextmenuEvent, false);
|
|
2669
2690
|
self.controlInput.addEventListener('copy', self.copy);
|
|
@@ -3702,7 +3723,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
3702
3723
|
isColumnHeaderCellCap = cellStyle === 'columnHeaderCellCap',
|
|
3703
3724
|
rawValue = rowData ? rowData[header.name] : undefined,
|
|
3704
3725
|
isGrid = header.type === 'canvas-datagrid',
|
|
3705
|
-
activeHeader = (self.orders.rows[self.activeCell.rowIndex] === rowOrderIndex || self.orders.columns[self.activeCell.columnIndex] === headerIndex) && (columnOrderIndex === -1 || rowOrderIndex === -1) ? isRowHeader ? 'activeRowHeaderCell' : 'activeColumnHeaderCell' : false,
|
|
3726
|
+
activeHeader = (self.orders.rows[self.activeCell.rowIndex] === rowOrderIndex || self.selectedRows.indexOf(rowOrderIndex) >= 0 || self.orders.columns[self.activeCell.columnIndex] === headerIndex || self.selectedColumns.indexOf(headerIndex) >= 0) && (columnOrderIndex === -1 || rowOrderIndex === -1) ? isRowHeader ? 'activeRowHeaderCell' : 'activeColumnHeaderCell' : false,
|
|
3706
3727
|
val,
|
|
3707
3728
|
f = self.formatters[header.type || 'string'],
|
|
3708
3729
|
orderByArrowSize = 0,
|
|
@@ -4413,7 +4434,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4413
4434
|
} //draw frozen columns
|
|
4414
4435
|
|
|
4415
4436
|
|
|
4416
|
-
x =
|
|
4437
|
+
x = 1;
|
|
4417
4438
|
|
|
4418
4439
|
if (self.attributes.showRowHeaders) {
|
|
4419
4440
|
x += rowHeaderCellWidth;
|
|
@@ -4949,7 +4970,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4949
4970
|
if (self.attributes.allowFreezingRows) {
|
|
4950
4971
|
// HACK great, another stupid magic number.
|
|
4951
4972
|
// Background will appear as a 0.5px artifact behind the row freeze bar without this hack
|
|
4952
|
-
y
|
|
4973
|
+
if (y > columnHeaderCellHeight) y += self.style.frozenMarkerWidth;
|
|
4974
|
+
y += self.style.frozenMarkerBorderWidth - 0.4999999999;
|
|
4953
4975
|
}
|
|
4954
4976
|
|
|
4955
4977
|
self.lastFrozenRowPixel = y;
|
|
@@ -5060,14 +5082,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5060
5082
|
self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;
|
|
5061
5083
|
self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;
|
|
5062
5084
|
|
|
5063
|
-
if (self.currentCell.rowIndex !== self.reorderObject.rowIndex && self.currentCell.rowIndex > -1 && self.currentCell.rowIndex < l) {
|
|
5085
|
+
if (self.selectedRows.indexOf(self.reorderTarget.sortRowIndex) === -1 && self.currentCell.rowIndex !== self.reorderObject.rowIndex && self.currentCell.rowIndex > -1 && self.currentCell.rowIndex < l) {
|
|
5064
5086
|
addBorderLine(m, self.reorderTarget.sortRowIndex > self.reorderObject.sortRowIndex ? 'b' : 't');
|
|
5065
5087
|
}
|
|
5066
5088
|
} else if (self.dragMode === 'column-reorder' && self.reorderObject) {
|
|
5067
5089
|
var selectedColumns = self.selections[0];
|
|
5068
5090
|
|
|
5069
|
-
|
|
5070
|
-
|
|
5091
|
+
if (selectedColumns) {
|
|
5092
|
+
for (var k = 1; k < selectedColumns.length; k++) {
|
|
5093
|
+
b.width += self.getColumnWidth(self.orders.columns[selectedColumns[k]]);
|
|
5094
|
+
}
|
|
5071
5095
|
}
|
|
5072
5096
|
|
|
5073
5097
|
b.height = h;
|
|
@@ -5081,7 +5105,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5081
5105
|
self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;
|
|
5082
5106
|
self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;
|
|
5083
5107
|
|
|
5084
|
-
if (self.currentCell.sortColumnIndex !== self.reorderObject.sortColumnIndex && self.currentCell.sortColumnIndex > -1 && self.currentCell.sortColumnIndex < schema.length) {
|
|
5108
|
+
if (self.selectedColumns.indexOf(self.reorderTarget.sortColumnIndex) === -1 && self.currentCell.sortColumnIndex !== self.reorderObject.sortColumnIndex && self.reorderTarget.columnIndex !== self.reorderObject.columnIndex && self.currentCell.sortColumnIndex > -1 && self.currentCell.sortColumnIndex < schema.length) {
|
|
5085
5109
|
addBorderLine(m, self.reorderTarget.columnIndex > self.reorderObject.columnIndex ? 'r' : 'l');
|
|
5086
5110
|
}
|
|
5087
5111
|
}
|
|
@@ -5175,40 +5199,67 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5175
5199
|
}
|
|
5176
5200
|
|
|
5177
5201
|
function drawFrozenMarkers() {
|
|
5178
|
-
if (self.dragStartObject !== undefined) return;
|
|
5179
5202
|
var my = self.lastFrozenRowPixel - self.style.frozenMarkerWidth,
|
|
5180
|
-
mx = self.lastFrozenColumnPixel - self.style.
|
|
5203
|
+
mx = self.lastFrozenColumnPixel - self.style.frozenMarkerWidth,
|
|
5181
5204
|
xHover = self.currentCell && self.currentCell.style === 'frozen-row-marker',
|
|
5182
5205
|
yHover = self.currentCell && self.currentCell.style === 'frozen-column-marker';
|
|
5206
|
+
var rowHeaderCellWidth = self.getRowHeaderCellWidth();
|
|
5183
5207
|
self.ctx.lineWidth = self.style.frozenMarkerBorderWidth;
|
|
5184
5208
|
|
|
5185
5209
|
if (self.attributes.allowFreezingColumns) {
|
|
5186
|
-
self.
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
style:
|
|
5196
|
-
|
|
5210
|
+
if (!self.freezeMarkerPosition || self.freezeMarkerPosition && self.dragMode === 'frozen-row-marker') {
|
|
5211
|
+
if (mx > self.style.rowHeaderCellWidth) {
|
|
5212
|
+
self.ctx.fillStyle = self.style.frozenMarkerColor;
|
|
5213
|
+
self.ctx.strokeStyle = self.style.frozenMarkerBorderColor;
|
|
5214
|
+
fillRect(mx, 0, self.style.frozenMarkerWidth, self.height);
|
|
5215
|
+
strokeRect(mx, 0, self.style.frozenMarkerWidth, self.height);
|
|
5216
|
+
}
|
|
5217
|
+
|
|
5218
|
+
self.ctx.fillStyle = yHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerHeaderColor;
|
|
5219
|
+
self.ctx.strokeStyle = yHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerHeaderColor;
|
|
5220
|
+
fillRect(mx, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
|
|
5221
|
+
strokeRect(mx, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
|
|
5222
|
+
}
|
|
5223
|
+
|
|
5224
|
+
if (!self.dragStartObject || self.dragStartObject && self.dragStartObject.style !== 'rowHeaderCell') {
|
|
5225
|
+
self.visibleCells.unshift({
|
|
5226
|
+
x: mx,
|
|
5227
|
+
y: 0,
|
|
5228
|
+
height: self.height,
|
|
5229
|
+
width: self.style.frozenMarkerWidth,
|
|
5230
|
+
// + self.style.frozenMarkerBorderWidth,
|
|
5231
|
+
style: 'frozen-column-marker'
|
|
5232
|
+
});
|
|
5233
|
+
}
|
|
5197
5234
|
}
|
|
5198
5235
|
|
|
5199
5236
|
if (self.attributes.allowFreezingRows) {
|
|
5200
|
-
self.
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5237
|
+
if (!self.freezeMarkerPosition || self.freezeMarkerPosition && self.dragMode === 'frozen-column-marker') {
|
|
5238
|
+
if (my > rowHeaderCellWidth) {
|
|
5239
|
+
self.ctx.fillStyle = self.style.frozenMarkerColor;
|
|
5240
|
+
self.ctx.strokeStyle = self.style.frozenMarkerBorderColor;
|
|
5241
|
+
fillRect(0, my, self.width, self.style.frozenMarkerWidth);
|
|
5242
|
+
strokeRect(0, my, self.width, self.style.frozenMarkerWidth);
|
|
5243
|
+
}
|
|
5244
|
+
|
|
5245
|
+
self.ctx.fillStyle = xHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerHeaderColor;
|
|
5246
|
+
self.ctx.strokeStyle = xHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerHeaderColor;
|
|
5247
|
+
fillRect(0, my, rowHeaderCellWidth, self.style.frozenMarkerWidth);
|
|
5248
|
+
strokeRect(0, my, rowHeaderCellWidth, self.style.frozenMarkerWidth);
|
|
5249
|
+
}
|
|
5250
|
+
|
|
5204
5251
|
var height = self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth;
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5252
|
+
|
|
5253
|
+
if (!self.dragStartObject || self.dragStartObject && self.dragStartObject.style !== 'columnHeaderCell') {
|
|
5254
|
+
self.visibleCells.unshift({
|
|
5255
|
+
x: 0,
|
|
5256
|
+
y: my,
|
|
5257
|
+
height: height,
|
|
5258
|
+
width: self.width,
|
|
5259
|
+
style: 'frozen-row-marker'
|
|
5260
|
+
});
|
|
5261
|
+
}
|
|
5262
|
+
|
|
5212
5263
|
rowGroupsFrozenInfo = {
|
|
5213
5264
|
y: my,
|
|
5214
5265
|
h: height
|
|
@@ -5220,11 +5271,59 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5220
5271
|
self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;
|
|
5221
5272
|
|
|
5222
5273
|
if (self.dragMode === 'frozen-column-marker') {
|
|
5223
|
-
|
|
5224
|
-
|
|
5274
|
+
var posX = self.freezeMarkerPosition.x;
|
|
5275
|
+
var nearCell = self.getCellAt(posX, 0);
|
|
5276
|
+
if (self.freezeMarkerPosition.isGrab) posX = mx;
|
|
5277
|
+
|
|
5278
|
+
if (posX > rowHeaderCellWidth) {
|
|
5279
|
+
var _x = nearCell.x - self.style.frozenMarkerWidth - self.style.frozenMarkerBorderWidth;
|
|
5280
|
+
|
|
5281
|
+
if (posX > _x + nearCell.width / 2) _x = _x + nearCell.width;
|
|
5282
|
+
self.ctx.fillStyle = self.style.frozenMarkerColor;
|
|
5283
|
+
self.ctx.strokeStyle = self.style.frozenMarkerBorderColor;
|
|
5284
|
+
fillRect(_x, 0, self.style.frozenMarkerWidth, self.height);
|
|
5285
|
+
strokeRect(_x, 0, self.style.frozenMarkerWidth, self.height);
|
|
5286
|
+
self.ctx.fillStyle = self.style.frozenMarkerHeaderColor;
|
|
5287
|
+
self.ctx.strokeStyle = self.style.frozenMarkerHeaderColor;
|
|
5288
|
+
fillRect(_x, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
|
|
5289
|
+
strokeRect(_x, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
|
|
5290
|
+
}
|
|
5291
|
+
|
|
5292
|
+
self.ctx.fillStyle = self.style.frozenMarkerActiveHeaderColor;
|
|
5293
|
+
self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;
|
|
5294
|
+
fillRect(posX, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
|
|
5295
|
+
strokeRect(posX, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
|
|
5296
|
+
self.ctx.fillStyle = self.style.frozenMarkerActiveColor;
|
|
5297
|
+
fillRect(posX, 0, self.style.frozenMarkerWidth, self.height);
|
|
5298
|
+
strokeRect(posX, 0, self.style.frozenMarkerWidth, self.height);
|
|
5225
5299
|
} else {
|
|
5226
|
-
|
|
5227
|
-
|
|
5300
|
+
var posY = self.freezeMarkerPosition.y;
|
|
5301
|
+
|
|
5302
|
+
var _nearCell = self.getCellAt(0, posY);
|
|
5303
|
+
|
|
5304
|
+
if (self.freezeMarkerPosition.isGrab) posY = my;
|
|
5305
|
+
|
|
5306
|
+
if (posY > self.style.columnHeaderCellHeight) {
|
|
5307
|
+
var _y = _nearCell.y - self.style.frozenMarkerWidth - self.style.frozenMarkerBorderWidth;
|
|
5308
|
+
|
|
5309
|
+
if (posY > _y + _nearCell.height / 2) _y = _y + _nearCell.height;
|
|
5310
|
+
self.ctx.fillStyle = self.style.frozenMarkerColor;
|
|
5311
|
+
self.ctx.strokeStyle = self.style.frozenMarkerBorderColor;
|
|
5312
|
+
fillRect(0, _y, self.width, self.style.frozenMarkerWidth);
|
|
5313
|
+
strokeRect(0, _y, self.width, self.style.frozenMarkerWidth);
|
|
5314
|
+
self.ctx.fillStyle = self.style.frozenMarkerHeaderColor;
|
|
5315
|
+
self.ctx.strokeStyle = self.style.frozenMarkerHeaderColor;
|
|
5316
|
+
fillRect(0, _y, rowHeaderCellWidth, self.style.frozenMarkerWidth);
|
|
5317
|
+
strokeRect(0, _y, rowHeaderCellWidth, self.style.frozenMarkerWidth);
|
|
5318
|
+
}
|
|
5319
|
+
|
|
5320
|
+
self.ctx.fillStyle = self.style.frozenMarkerActiveHeaderColor;
|
|
5321
|
+
self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;
|
|
5322
|
+
fillRect(0, posY, rowHeaderCellWidth, self.style.frozenMarkerWidth);
|
|
5323
|
+
strokeRect(0, posY, rowHeaderCellWidth, self.style.frozenMarkerWidth);
|
|
5324
|
+
self.ctx.fillStyle = self.style.frozenMarkerActiveColor;
|
|
5325
|
+
fillRect(0, posY, self.width, self.style.frozenMarkerWidth);
|
|
5326
|
+
strokeRect(0, posY, self.width, self.style.frozenMarkerWidth);
|
|
5228
5327
|
}
|
|
5229
5328
|
}
|
|
5230
5329
|
}
|
|
@@ -5771,9 +5870,17 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5771
5870
|
self.page = Math.max(1, self.visibleRows.length - 3 - self.attributes.pageUpDownOverlap); // set canvas drawing related items
|
|
5772
5871
|
|
|
5773
5872
|
if (!self.isChildGrid) {
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5873
|
+
var newWidth = self.width * ratio;
|
|
5874
|
+
var newHeight = self.height * ratio; // We need to check is settings size to canvas necessary,
|
|
5875
|
+
// because settings the canvas'size will cause the canvas and its state be cleared
|
|
5876
|
+
// even if the size is the same.
|
|
5877
|
+
// Notes: Please don't call `self.resize()` without a subsequent call to `self.draw()`
|
|
5878
|
+
|
|
5879
|
+
if (self.canvas.width !== newWidth || self.canvas.height !== newHeight) {
|
|
5880
|
+
self.canvas.width = newWidth;
|
|
5881
|
+
self.canvas.height = newHeight;
|
|
5882
|
+
self.ctx.scale(ratio, ratio);
|
|
5883
|
+
}
|
|
5777
5884
|
} // resize any open dom elements (input/textarea)
|
|
5778
5885
|
|
|
5779
5886
|
|
|
@@ -5983,6 +6090,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5983
6090
|
dragBounds.top = -1;
|
|
5984
6091
|
dragBounds.bottom = self.viewData.length - 1;
|
|
5985
6092
|
if (dragBounds.left < 0) dragBounds.left = 0;
|
|
6093
|
+
if (dragBounds.left != dragBounds.right) self.isMultiColumnsSelected = true;else self.isMultiRowsSelected = false;
|
|
5986
6094
|
}
|
|
5987
6095
|
|
|
5988
6096
|
if (self.dragStartObject.rowIndex !== cell.rowIndex || self.dragStartObject.columnIndex !== cell.columnIndex) {
|
|
@@ -6065,6 +6173,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6065
6173
|
if ((!self.selectionBounds || dragBounds.top !== self.selectionBounds.top || dragBounds.left !== self.selectionBounds.left || dragBounds.bottom !== self.selectionBounds.bottom || dragBounds.right !== self.selectionBounds.right) && !ctrl) {
|
|
6066
6174
|
if (!(cell.hovered && self.hovers.onFilterButton)) {
|
|
6067
6175
|
self.selections = [];
|
|
6176
|
+
self.selectedRows = [];
|
|
6177
|
+
self.selectedColumns = [];
|
|
6068
6178
|
}
|
|
6069
6179
|
|
|
6070
6180
|
if (dragBounds.top === -1) {
|
|
@@ -6079,7 +6189,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6079
6189
|
}
|
|
6080
6190
|
} else {
|
|
6081
6191
|
self.selectArea(sBounds, true);
|
|
6082
|
-
|
|
6192
|
+
self.activeCell.rowIndex = sBounds.top;
|
|
6193
|
+
self.activeCell.columnIndex = sBounds.left;
|
|
6194
|
+
|
|
6195
|
+
if (sBounds.left == -1 && sBounds.top !== sBounds.bottom) {
|
|
6196
|
+
self.activeCell.columnIndex = 0;
|
|
6197
|
+
self.isMultiRowsSelected = true;
|
|
6198
|
+
self.isMultiColumnsSelected = false;
|
|
6199
|
+
}
|
|
6083
6200
|
}
|
|
6084
6201
|
}
|
|
6085
6202
|
|
|
@@ -6302,8 +6419,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6302
6419
|
}
|
|
6303
6420
|
|
|
6304
6421
|
self.resize();
|
|
6305
|
-
|
|
6306
|
-
|
|
6422
|
+
window.removeEventListener('mousemove', self.dragResizeColumn, false);
|
|
6423
|
+
window.removeEventListener('mouseup', self.stopDragResize, false);
|
|
6307
6424
|
self.setStorageData();
|
|
6308
6425
|
self.draw(true);
|
|
6309
6426
|
self.ignoreNextClick = true;
|
|
@@ -6380,7 +6497,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6380
6497
|
document.exitPointerLock();
|
|
6381
6498
|
}
|
|
6382
6499
|
|
|
6383
|
-
|
|
6500
|
+
window.removeEventListener('mousemove', self.scrollGrid, false);
|
|
6384
6501
|
};
|
|
6385
6502
|
|
|
6386
6503
|
self.dragReorder = function (e) {
|
|
@@ -6402,7 +6519,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6402
6519
|
}
|
|
6403
6520
|
|
|
6404
6521
|
if ((e.ctrlKey || e.metaKey || e.shiftKey) && self.reorderObject) {
|
|
6405
|
-
if (self.dragMode === 'column-reorder' && !self.isMultiColumnsSelected
|
|
6522
|
+
if (self.dragMode === 'column-reorder' && !self.isMultiColumnsSelected) {
|
|
6406
6523
|
self.selectColumn(self.draggingItem.header.index, false, false);
|
|
6407
6524
|
}
|
|
6408
6525
|
}
|
|
@@ -6419,6 +6536,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6419
6536
|
if (Math.abs(x) > self.attributes.reorderDeadZone || Math.abs(y) > self.attributes.reorderDeadZone) {
|
|
6420
6537
|
self.reorderObject = self.draggingItem;
|
|
6421
6538
|
if (self.isMultiRowsSelected) self.reorderObject = self.getVisibleCellByIndex(-1, self.activeCell.rowIndex);
|
|
6539
|
+
if (self.isMultiColumnsSelected) self.reorderObject = self.getVisibleCellByIndex(self.activeCell.columnIndex, -1);
|
|
6422
6540
|
if (!self.reorderObject) return;
|
|
6423
6541
|
self.reorderTarget = self.currentCell;
|
|
6424
6542
|
self.reorderObject.dragOffset = {
|
|
@@ -6441,8 +6559,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6441
6559
|
'row-reorder': 'rowIndex',
|
|
6442
6560
|
'column-reorder': 'sortColumnIndex'
|
|
6443
6561
|
}[self.dragMode];
|
|
6444
|
-
|
|
6445
|
-
|
|
6562
|
+
window.removeEventListener('mousemove', self.dragReorder, false);
|
|
6563
|
+
window.removeEventListener('mouseup', self.stopDragReorder, false);
|
|
6446
6564
|
|
|
6447
6565
|
if (self.reorderObject && self.reorderTarget && (self.dragMode === 'column-reorder' && self.reorderTarget.sortColumnIndex > -1 && self.reorderTarget.sortColumnIndex < self.getSchema().length || self.dragMode === 'row-reorder' && self.reorderTarget.rowIndex > -1 && self.reorderTarget.rowIndex < self.viewData.length) && self.reorderObject[i] !== self.reorderTarget[i] && !self.dispatchEvent('reorder', {
|
|
6448
6566
|
NativeEvent: e,
|
|
@@ -6456,27 +6574,34 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6456
6574
|
|
|
6457
6575
|
if (self.dragMode === 'column-reorder') {
|
|
6458
6576
|
var sortColumnIndices = [];
|
|
6459
|
-
var
|
|
6577
|
+
var selectedColumnIndices = [];
|
|
6460
6578
|
|
|
6461
6579
|
if (self.selections[0]) {
|
|
6580
|
+
oIndex = self.selections[0][0];
|
|
6462
6581
|
self.selections[0].forEach(function (value) {
|
|
6463
6582
|
sortColumnIndices.push(self.orders.columns[value]);
|
|
6464
6583
|
});
|
|
6465
6584
|
}
|
|
6466
6585
|
|
|
6467
6586
|
var deleteCount = sortColumnIndices.length;
|
|
6468
|
-
cr[self.dragMode].splice(oIndex, deleteCount);
|
|
6469
|
-
if (tIndex > oIndex) tIndex = tIndex - (deleteCount - 1);
|
|
6470
6587
|
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6588
|
+
if (tIndex < oIndex || tIndex > oIndex && Math.abs(tIndex - oIndex) >= deleteCount) {
|
|
6589
|
+
cr[self.dragMode].splice(oIndex, deleteCount);
|
|
6590
|
+
if (tIndex > oIndex) tIndex = tIndex - (deleteCount - 1);
|
|
6591
|
+
self.selectedColumns = [];
|
|
6475
6592
|
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6593
|
+
for (var i = 0; i < sortColumnIndices.length; i++) {
|
|
6594
|
+
if (i === 0) self.activeCell.columnIndex = tIndex;
|
|
6595
|
+
selectedColumnIndices.push(tIndex + i);
|
|
6596
|
+
self.selectedColumns.push(sortColumnIndices[i]);
|
|
6597
|
+
cr[self.dragMode].splice(tIndex + i, 0, sortColumnIndices[i]);
|
|
6598
|
+
}
|
|
6599
|
+
|
|
6600
|
+
self.orders.columns = cr[self.dragMode];
|
|
6601
|
+
self.viewData.forEach(function (row, rowIndex) {
|
|
6602
|
+
self.selections[rowIndex] = selectedColumnIndices;
|
|
6603
|
+
});
|
|
6604
|
+
}
|
|
6480
6605
|
} else {
|
|
6481
6606
|
var selectedRows = [];
|
|
6482
6607
|
self.selections.forEach(function (row, rowIndex) {
|
|
@@ -6485,14 +6610,19 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6485
6610
|
odata.push(self.viewData[rowIndex]);
|
|
6486
6611
|
}
|
|
6487
6612
|
});
|
|
6488
|
-
self.viewData.splice(oIndex, odata.length);
|
|
6489
|
-
self.selections = [];
|
|
6490
|
-
if (tIndex > oIndex) tIndex = tIndex - (odata.length - 1);
|
|
6491
|
-
self.activeCell.rowIndex = tIndex;
|
|
6492
6613
|
|
|
6493
|
-
|
|
6494
|
-
self.viewData.splice(
|
|
6495
|
-
self.selections
|
|
6614
|
+
if (tIndex < oIndex || tIndex > oIndex && Math.abs(tIndex - oIndex) >= odata.length) {
|
|
6615
|
+
self.viewData.splice(oIndex, odata.length);
|
|
6616
|
+
self.selections = [];
|
|
6617
|
+
self.selectedRows = [];
|
|
6618
|
+
if (tIndex > oIndex) tIndex = tIndex - (odata.length - 1);
|
|
6619
|
+
self.activeCell.rowIndex = tIndex;
|
|
6620
|
+
|
|
6621
|
+
for (var i = 0; i < odata.length; i++) {
|
|
6622
|
+
self.viewData.splice(tIndex + i, 0, odata[i]);
|
|
6623
|
+
self.selections[tIndex + i] = selectedRows[i];
|
|
6624
|
+
self.selectedRows.push(tIndex + i);
|
|
6625
|
+
}
|
|
6496
6626
|
}
|
|
6497
6627
|
}
|
|
6498
6628
|
|
|
@@ -6527,8 +6657,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6527
6657
|
};
|
|
6528
6658
|
|
|
6529
6659
|
self.stopDragMove = function (e) {
|
|
6530
|
-
|
|
6531
|
-
|
|
6660
|
+
window.removeEventListener('mousemove', self.dragMove, false);
|
|
6661
|
+
window.removeEventListener('mouseup', self.stopDragMove, false);
|
|
6532
6662
|
var b = self.getSelectionBounds();
|
|
6533
6663
|
|
|
6534
6664
|
if (self.dispatchEvent('endmove', {
|
|
@@ -6559,13 +6689,25 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6559
6689
|
return;
|
|
6560
6690
|
}
|
|
6561
6691
|
|
|
6692
|
+
var pos = self.getLayerPos(e);
|
|
6693
|
+
self.ignoreNextClick = true;
|
|
6694
|
+
self.freezeMarkerPosition = pos;
|
|
6695
|
+
pos.x -= self.getRowGroupAreaWidth();
|
|
6696
|
+
pos.y -= self.getColumnGroupAreaHeight();
|
|
6697
|
+
|
|
6698
|
+
if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {
|
|
6699
|
+
setTimeout(function () {
|
|
6700
|
+
self.autoScrollZone(e, pos.x, pos.y, false);
|
|
6701
|
+
}, 1);
|
|
6702
|
+
}
|
|
6703
|
+
};
|
|
6704
|
+
|
|
6705
|
+
self.stopFreezeMove = function (e) {
|
|
6562
6706
|
var pos = self.getLayerPos(e),
|
|
6563
6707
|
bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,
|
|
6564
6708
|
columnHeaderCellBorder = self.style.columnHeaderCellBorderWidth * bm,
|
|
6565
6709
|
columnHeaderCellHeight = self.getColumnHeaderCellHeight(),
|
|
6566
6710
|
rowHeaderCellWidth = self.getRowHeaderCellWidth();
|
|
6567
|
-
self.ignoreNextClick = true;
|
|
6568
|
-
self.freezeMarkerPosition = pos;
|
|
6569
6711
|
pos.x -= self.getRowGroupAreaWidth();
|
|
6570
6712
|
pos.y -= self.getColumnGroupAreaHeight();
|
|
6571
6713
|
|
|
@@ -6584,11 +6726,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6584
6726
|
if (self.currentCell && self.currentCell.columnIndex !== undefined && self.dragMode === 'frozen-column-marker') {
|
|
6585
6727
|
var dataWidth = self.refreshScrollCacheX();
|
|
6586
6728
|
self.scrollBox.scrollLeft = 0;
|
|
6587
|
-
|
|
6588
|
-
self.
|
|
6589
|
-
self.scrollBox.
|
|
6590
|
-
|
|
6591
|
-
self.scrollBox.widthBoxRatio = (self.scrollBox.width - self.scrollCache.x[self.frozenColumn - 1]) / dataWidth;
|
|
6729
|
+
var x = self.currentCell.x - self.style.frozenMarkerWidth - self.style.frozenMarkerBorderWidth;
|
|
6730
|
+
if (pos.x > x + self.currentCell.width / 2) self.frozenColumn = self.currentCell.columnIndex + 1;else if (self.currentCell.columnIndex >= 0) self.frozenColumn = self.currentCell.columnIndex;
|
|
6731
|
+
self.scrollBox.bar.h.x = rowHeaderCellWidth + self.scrollCache.x[self.frozenColumn];
|
|
6732
|
+
self.scrollBox.widthBoxRatio = (self.scrollBox.width - self.scrollCache.x[self.frozenColumn]) / dataWidth;
|
|
6592
6733
|
self.scrollBox.scrollBoxWidth = self.scrollBox.width * self.scrollBox.widthBoxRatio - self.style.scrollBarWidth;
|
|
6593
6734
|
self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);
|
|
6594
6735
|
self.scrollBox.box.h.width = self.scrollBox.scrollBoxWidth;
|
|
@@ -6599,11 +6740,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6599
6740
|
self.autoScrollZone(e, pos.x, pos.y, false);
|
|
6600
6741
|
}, 1);
|
|
6601
6742
|
}
|
|
6602
|
-
};
|
|
6603
6743
|
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
document.body.removeEventListener('mouseup', self.stopFreezeMove, false);
|
|
6744
|
+
window.removeEventListener('mousemove', self.freezeMove, false);
|
|
6745
|
+
window.removeEventListener('mouseup', self.stopFreezeMove, false);
|
|
6607
6746
|
self.freezeMarkerPosition = undefined;
|
|
6608
6747
|
|
|
6609
6748
|
if (self.dispatchEvent('endfreezemove', {
|
|
@@ -6617,6 +6756,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6617
6756
|
}
|
|
6618
6757
|
|
|
6619
6758
|
self.draw(true);
|
|
6759
|
+
self.resize();
|
|
6620
6760
|
};
|
|
6621
6761
|
|
|
6622
6762
|
self.mousedown = function (e, overridePos) {
|
|
@@ -6653,6 +6793,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6653
6793
|
if (!ctrl && !e.shiftKey && !/(vertical|horizontal)-scroll-(bar|box)/.test(self.dragStartObject.context) && self.currentCell && !self.currentCell.isColumnHeader && !move && !freeze && !resize) {
|
|
6654
6794
|
if (!(self.dragMode == 'row-reorder' && self.isMultiRowsSelected) && !(self.currentCell.hovered && self.hovers.onFilterButton)) {
|
|
6655
6795
|
self.selections = [];
|
|
6796
|
+
self.selectedRows = [];
|
|
6797
|
+
self.selectedColumns = [];
|
|
6656
6798
|
}
|
|
6657
6799
|
}
|
|
6658
6800
|
|
|
@@ -6673,8 +6815,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6673
6815
|
self.canvas.requestPointerLock();
|
|
6674
6816
|
}
|
|
6675
6817
|
|
|
6676
|
-
|
|
6677
|
-
|
|
6818
|
+
window.addEventListener('mousemove', self.scrollGrid, false);
|
|
6819
|
+
window.addEventListener('mouseup', self.stopScrollGrid, false);
|
|
6678
6820
|
self.ignoreNextClick = true;
|
|
6679
6821
|
return;
|
|
6680
6822
|
}
|
|
@@ -6686,7 +6828,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6686
6828
|
self.selectRow(self.dragStartObject.rowIndex, ctrl, null);
|
|
6687
6829
|
} else if ((self.attributes.selectionMode === 'column' || self.dragStartObject.rowIndex === -1) && self.dragStartObject.columnIndex > -1) {
|
|
6688
6830
|
self.selectColumn(self.currentCell.header.index, ctrl, e.shiftKey);
|
|
6689
|
-
|
|
6831
|
+
return;
|
|
6832
|
+
}
|
|
6833
|
+
|
|
6834
|
+
if (self.attributes.selectionMode !== 'row') {
|
|
6690
6835
|
self.mousemove(e);
|
|
6691
6836
|
}
|
|
6692
6837
|
|
|
@@ -6705,8 +6850,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6705
6850
|
return;
|
|
6706
6851
|
}
|
|
6707
6852
|
|
|
6708
|
-
|
|
6709
|
-
|
|
6853
|
+
window.addEventListener('mousemove', self.dragMove, false);
|
|
6854
|
+
window.addEventListener('mouseup', self.stopDragMove, false);
|
|
6710
6855
|
return self.mousemove(e);
|
|
6711
6856
|
}
|
|
6712
6857
|
|
|
@@ -6723,8 +6868,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6723
6868
|
return;
|
|
6724
6869
|
}
|
|
6725
6870
|
|
|
6726
|
-
|
|
6727
|
-
|
|
6871
|
+
self.freezeMarkerPosition = self.getLayerPos(e);
|
|
6872
|
+
self.freezeMarkerPosition.isGrab = true;
|
|
6873
|
+
window.addEventListener('mousemove', self.freezeMove, false);
|
|
6874
|
+
window.addEventListener('mouseup', self.stopFreezeMove, false);
|
|
6728
6875
|
return self.mousemove(e);
|
|
6729
6876
|
}
|
|
6730
6877
|
|
|
@@ -6738,22 +6885,22 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6738
6885
|
}
|
|
6739
6886
|
|
|
6740
6887
|
self.resizingStartingWidth = self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell' ? 'cornerCell' : self.draggingItem.sortColumnIndex] || self.draggingItem.width;
|
|
6741
|
-
|
|
6742
|
-
|
|
6888
|
+
window.addEventListener('mousemove', self.dragResizeColumn, false);
|
|
6889
|
+
window.addEventListener('mouseup', self.stopDragResize, false);
|
|
6743
6890
|
return;
|
|
6744
6891
|
}
|
|
6745
6892
|
|
|
6746
6893
|
if (['row-reorder', 'column-reorder'].indexOf(self.dragMode) !== -1) {
|
|
6747
6894
|
self.draggingItem = self.dragStartObject;
|
|
6748
6895
|
|
|
6749
|
-
if (self.dragMode === 'column-reorder' && !self.isMultiColumnsSelected
|
|
6896
|
+
if (self.dragMode === 'column-reorder' && !self.isMultiColumnsSelected) {
|
|
6750
6897
|
self.selectColumn(self.currentCell.header.index, ctrl, e.shiftKey);
|
|
6751
6898
|
} else if (self.dragMode === 'row-reorder' && !self.isMultiRowsSelected) {
|
|
6752
6899
|
self.selectRow(self.dragStartObject.rowIndex, ctrl, null);
|
|
6753
6900
|
}
|
|
6754
6901
|
|
|
6755
|
-
|
|
6756
|
-
|
|
6902
|
+
window.addEventListener('mousemove', self.dragReorder, false);
|
|
6903
|
+
window.addEventListener('mouseup', self.stopDragReorder, false);
|
|
6757
6904
|
return;
|
|
6758
6905
|
}
|
|
6759
6906
|
};
|
|
@@ -6998,6 +7145,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6998
7145
|
if (!e.shiftKey && self.attributes.selectionFollowsActiveCell) {
|
|
6999
7146
|
if (!ctrl) {
|
|
7000
7147
|
self.selections = [];
|
|
7148
|
+
self.selectedRows = [];
|
|
7149
|
+
self.selectedColumns = [];
|
|
7001
7150
|
}
|
|
7002
7151
|
|
|
7003
7152
|
self.selections[y] = self.selections[y] || [];
|
|
@@ -7143,6 +7292,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7143
7292
|
});
|
|
7144
7293
|
} else {
|
|
7145
7294
|
var selections = [];
|
|
7295
|
+
self.selectedRows = [];
|
|
7296
|
+
self.selectedColumns = [];
|
|
7146
7297
|
|
|
7147
7298
|
for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {
|
|
7148
7299
|
// Rows may have been moved by user, so get the actual row index
|
|
@@ -7152,6 +7303,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7152
7303
|
var existingRowData = self.viewData[realRowIndex];
|
|
7153
7304
|
var newRowData = Object.assign({}, existingRowData);
|
|
7154
7305
|
selections[realRowIndex] = [];
|
|
7306
|
+
self.selectedRows.push(realRowIndex);
|
|
7155
7307
|
|
|
7156
7308
|
for (var colIndex = 0; colIndex < cells.length; colIndex++) {
|
|
7157
7309
|
var column = schema[startColIndex + colIndex];
|
|
@@ -7173,6 +7325,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7173
7325
|
|
|
7174
7326
|
selections[realRowIndex].push(startColIndex + colIndex);
|
|
7175
7327
|
newRowData[columnName] = cellData;
|
|
7328
|
+
if (self.selectedColumns.indexOf(startColIndex + colIndex) === -1) self.selectedColumns.push(startColIndex + colIndex);
|
|
7176
7329
|
}
|
|
7177
7330
|
|
|
7178
7331
|
self.originalData[self.boundRowIndexMap.get(realRowIndex)] = newRowData; // Update view date here to avoid a full refresh of `viewData`.
|
|
@@ -7730,6 +7883,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7730
7883
|
trees: {}
|
|
7731
7884
|
};
|
|
7732
7885
|
self.selections = [];
|
|
7886
|
+
self.selectedRows = [];
|
|
7887
|
+
self.selectedColumns = [];
|
|
7733
7888
|
self.filterable = {
|
|
7734
7889
|
rows: [],
|
|
7735
7890
|
columns: []
|
|
@@ -7789,7 +7944,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7789
7944
|
self.groupedRows = [];
|
|
7790
7945
|
self.scrollModes = ['vertical-scroll-box', 'vertical-scroll-top', 'vertical-scroll-bottom', 'horizontal-scroll-box', 'horizontal-scroll-right', 'horizontal-scroll-left'];
|
|
7791
7946
|
self.componentL1Events = {};
|
|
7792
|
-
self.eventNames = ['afterdraw', 'afterrendercell', 'afterrenderfilterbutton', 'aftercreategroup', 'attributechanged', 'beforebeginedit', 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid', 'beforerenderfilterbutton', 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'contextmenu', 'copy', 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress', 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid', 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize', 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged', 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];
|
|
7947
|
+
self.eventNames = ['afterdraw', 'afterrendercell', 'afterrenderfilterbutton', 'aftercreategroup', 'attributechanged', 'beforebeginedit', 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid', 'beforerenderfilterbutton', 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'columnhide', 'columnunhide', 'contextmenu', 'copy', 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress', 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid', 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize', 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged', 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];
|
|
7793
7948
|
self.mouse = {
|
|
7794
7949
|
x: 0,
|
|
7795
7950
|
y: 0
|
|
@@ -8007,7 +8162,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
8007
8162
|
if (columnIndex < 0) continue;
|
|
8008
8163
|
var boundColumnIndex = self.getBoundColumnIndexFromViewColumnIndex(columnIndex);
|
|
8009
8164
|
var columnName = schema[boundColumnIndex].name;
|
|
8010
|
-
self.
|
|
8165
|
+
self.viewData[boundRowIndex][columnName] = '';
|
|
8011
8166
|
affectedCells.push([rowIndex, columnIndex, boundRowIndex, boundColumnIndex]);
|
|
8012
8167
|
}
|
|
8013
8168
|
} catch (err) {
|
|
@@ -8653,7 +8808,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
8653
8808
|
document.body.removeChild(self.controlInput);
|
|
8654
8809
|
}
|
|
8655
8810
|
|
|
8656
|
-
self.eventParent.removeEventListener('mouseup', self.mouseup, false);
|
|
8657
8811
|
self.eventParent.removeEventListener('mousedown', self.mousedown, false);
|
|
8658
8812
|
self.eventParent.removeEventListener('dblclick', self.dblclick, false);
|
|
8659
8813
|
self.eventParent.removeEventListener('click', self.click, false);
|
|
@@ -8667,7 +8821,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
8667
8821
|
self.controlInput.removeEventListener('keypress', self.keypress, false);
|
|
8668
8822
|
self.controlInput.removeEventListener('keyup', self.keyup, false);
|
|
8669
8823
|
self.controlInput.removeEventListener('keydown', self.keydown, false);
|
|
8670
|
-
|
|
8824
|
+
window.removeEventListener('mouseup', self.mouseup, false);
|
|
8825
|
+
window.removeEventListener('mousemove', self.mousemove);
|
|
8671
8826
|
window.removeEventListener('resize', self.resize);
|
|
8672
8827
|
|
|
8673
8828
|
if (self.observer && self.observer.disconnect) {
|
|
@@ -9022,19 +9177,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
9022
9177
|
};
|
|
9023
9178
|
};
|
|
9024
9179
|
|
|
9025
|
-
self.unhideColumns = function (orderIndex0, orderIndex1) {
|
|
9026
|
-
var orders = self.orders.columns;
|
|
9027
|
-
var schema = self.getSchema();
|
|
9028
|
-
|
|
9029
|
-
for (var i = orderIndex0; i <= orderIndex1; i++) {
|
|
9030
|
-
var columnIndex = orders[i];
|
|
9031
|
-
var s = schema[columnIndex];
|
|
9032
|
-
if (s && s.hidden) s.hidden = false;
|
|
9033
|
-
}
|
|
9034
|
-
|
|
9035
|
-
self.refresh();
|
|
9036
|
-
};
|
|
9037
|
-
|
|
9038
9180
|
self.getDomRoot = function () {
|
|
9039
9181
|
return self.shadowRoot ? self.shadowRoot.host : self.parentNode;
|
|
9040
9182
|
};
|
|
@@ -9275,6 +9417,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
9275
9417
|
self.intf.paste = self.paste;
|
|
9276
9418
|
self.intf.setStyleProperty = self.setStyleProperty;
|
|
9277
9419
|
self.intf.hideColumns = self.hideColumns;
|
|
9420
|
+
self.intf.unhideColumns = self.unhideColumns;
|
|
9278
9421
|
self.intf.hideRows = self.hideRows;
|
|
9279
9422
|
self.intf.unhideRows = self.unhideRows;
|
|
9280
9423
|
Object.defineProperty(self.intf, 'defaults', {
|
|
@@ -10800,6 +10943,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
10800
10943
|
|
|
10801
10944
|
|
|
10802
10945
|
self.setActiveCell = function (x, y) {
|
|
10946
|
+
if (typeof x === 'undefined') return;
|
|
10947
|
+
|
|
10803
10948
|
if (x < 0) {
|
|
10804
10949
|
x = 0;
|
|
10805
10950
|
}
|
|
@@ -10824,6 +10969,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
10824
10969
|
|
|
10825
10970
|
self.selectNone = function (dontDraw) {
|
|
10826
10971
|
self.selections = [];
|
|
10972
|
+
self.selectedRows = [];
|
|
10973
|
+
self.selectedColumns = [];
|
|
10827
10974
|
self.dispatchEvent('selectionchanged', {
|
|
10828
10975
|
selectedData: self.getSelectedData(),
|
|
10829
10976
|
selections: self.selections,
|
|
@@ -10861,51 +11008,42 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
10861
11008
|
self.draw();
|
|
10862
11009
|
};
|
|
10863
11010
|
/**
|
|
10864
|
-
* Returns true if
|
|
11011
|
+
* Returns true if the selected columnIndex is selected on every row.
|
|
10865
11012
|
* @memberof canvasDatagrid
|
|
10866
|
-
* @name
|
|
11013
|
+
* @name isColumnSelected
|
|
10867
11014
|
* @method
|
|
10868
11015
|
* @param {number} columnIndex The column index to check.
|
|
10869
11016
|
*/
|
|
10870
11017
|
|
|
10871
11018
|
|
|
10872
|
-
self.
|
|
10873
|
-
var
|
|
11019
|
+
self.isColumnSelected = function (columnIndex) {
|
|
11020
|
+
var colIsSelected = true;
|
|
10874
11021
|
self.viewData.forEach(function (row, rowIndex) {
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
if (!columnIndices || columnIndices.length <= 1 || columnIndices.indexOf(columnIndex) === -1) {
|
|
10878
|
-
multiColIsSelected = false;
|
|
10879
|
-
} else if (columnIndices.length > 1) {
|
|
10880
|
-
if (columnIndices[0] != columnIndex) multiColIsSelected = false;else {
|
|
10881
|
-
for (var i = 0; i < columnIndices.length - 1; i++) {
|
|
10882
|
-
if (columnIndices[i] + 1 != columnIndices[i + 1]) {
|
|
10883
|
-
multiColIsSelected = false;
|
|
10884
|
-
break;
|
|
10885
|
-
}
|
|
10886
|
-
}
|
|
10887
|
-
}
|
|
11022
|
+
if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(columnIndex) === -1) {
|
|
11023
|
+
colIsSelected = false;
|
|
10888
11024
|
}
|
|
10889
11025
|
});
|
|
10890
|
-
return
|
|
11026
|
+
return colIsSelected;
|
|
10891
11027
|
};
|
|
10892
11028
|
/**
|
|
10893
|
-
* Returns true if the selected
|
|
11029
|
+
* Returns true if the selected rowIndex is selected on every column.
|
|
10894
11030
|
* @memberof canvasDatagrid
|
|
10895
|
-
* @name
|
|
11031
|
+
* @name isRowSelected
|
|
10896
11032
|
* @method
|
|
10897
|
-
* @param {number}
|
|
11033
|
+
* @param {number} rowIndex The row index to check.
|
|
10898
11034
|
*/
|
|
10899
11035
|
|
|
10900
11036
|
|
|
10901
|
-
self.
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
11037
|
+
self.isRowSelected = function (rowIndex) {
|
|
11038
|
+
if (!self.selections[rowIndex]) return false;
|
|
11039
|
+
var rowIsSelected = true;
|
|
11040
|
+
var schema = self.getVisibleSchema();
|
|
11041
|
+
schema.forEach(function (col, index) {
|
|
11042
|
+
if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(index) === -1) {
|
|
11043
|
+
rowIsSelected = false;
|
|
10906
11044
|
}
|
|
10907
11045
|
});
|
|
10908
|
-
return
|
|
11046
|
+
return rowIsSelected;
|
|
10909
11047
|
};
|
|
10910
11048
|
/**
|
|
10911
11049
|
* Runs the defined method on each selected cell.
|
|
@@ -10955,6 +11093,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
10955
11093
|
|
|
10956
11094
|
self.selectColumn = function (columnIndex, ctrl, shift, supressEvent) {
|
|
10957
11095
|
var s, e, x;
|
|
11096
|
+
self.isMultiRowsSelected = false;
|
|
11097
|
+
self.isMultiColumnsSelected = false;
|
|
10958
11098
|
|
|
10959
11099
|
function addCol(i) {
|
|
10960
11100
|
self.viewData.forEach(function (row, rowIndex) {
|
|
@@ -10986,19 +11126,25 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
10986
11126
|
|
|
10987
11127
|
for (x = s; e > x; x += 1) {
|
|
10988
11128
|
addCol(x);
|
|
11129
|
+
if (self.selectedColumns.indexOf(x) === -1) self.selectedColumns.push(x);
|
|
10989
11130
|
}
|
|
11131
|
+
|
|
11132
|
+
if (s != e) self.isMultiColumnsSelected = true;
|
|
10990
11133
|
}
|
|
10991
11134
|
|
|
10992
11135
|
if (!ctrl && !shift) {
|
|
10993
11136
|
self.selections = [];
|
|
11137
|
+
self.selectedColumns = [];
|
|
10994
11138
|
self.activeCell.columnIndex = columnIndex;
|
|
10995
11139
|
self.activeCell.rowIndex = self.scrollIndexTop;
|
|
10996
11140
|
}
|
|
10997
11141
|
|
|
10998
11142
|
if (ctrl && self.isColumnSelected(columnIndex)) {
|
|
10999
11143
|
removeCol(columnIndex);
|
|
11144
|
+
self.selectedColumns.splice(columnIndex, 1);
|
|
11000
11145
|
} else {
|
|
11001
11146
|
addCol(columnIndex);
|
|
11147
|
+
self.selectedColumns.push(columnIndex);
|
|
11002
11148
|
}
|
|
11003
11149
|
|
|
11004
11150
|
if (supressEvent) {
|
|
@@ -11049,6 +11195,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11049
11195
|
self.selections[ri].push(-1);
|
|
11050
11196
|
s.forEach(function (col, index) {
|
|
11051
11197
|
self.selections[ri].push(self.orders.columns.indexOf(col.index));
|
|
11198
|
+
if (col.index !== -1 && self.selectedColumns.indexOf(self.orders.columns.indexOf(col.index)) === -1) self.selectedColumns.push(self.orders.columns.indexOf(col.index));
|
|
11052
11199
|
});
|
|
11053
11200
|
}
|
|
11054
11201
|
|
|
@@ -11073,9 +11220,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11073
11220
|
|
|
11074
11221
|
for (x = st; en >= x; x += 1) {
|
|
11075
11222
|
addRow(x);
|
|
11223
|
+
self.selectedRows.push(x);
|
|
11076
11224
|
}
|
|
11077
11225
|
} else {
|
|
11078
11226
|
addRow(rowIndex);
|
|
11227
|
+
self.selectedRows = [];
|
|
11228
|
+
self.selectedRows.push(rowIndex);
|
|
11079
11229
|
}
|
|
11080
11230
|
}
|
|
11081
11231
|
|
|
@@ -11203,6 +11353,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11203
11353
|
* Hide column/columns
|
|
11204
11354
|
* @memberof canvasDatagrid
|
|
11205
11355
|
* @name hideColumns
|
|
11356
|
+
* @method
|
|
11206
11357
|
* @param {number} beginColumnOrderIndex
|
|
11207
11358
|
* @param {number} [endColumnOrderIndex]
|
|
11208
11359
|
*/
|
|
@@ -11211,29 +11362,65 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11211
11362
|
self.hideColumns = function (beginColumnOrderIndex, endColumnOrderIndex) {
|
|
11212
11363
|
var schema = self.getSchema();
|
|
11213
11364
|
var orders = self.orders.columns;
|
|
11214
|
-
var
|
|
11365
|
+
var hiddenColumns = [];
|
|
11215
11366
|
if (typeof endColumnOrderIndex !== 'number') endColumnOrderIndex = beginColumnOrderIndex;
|
|
11216
11367
|
|
|
11217
11368
|
for (var orderIndex = beginColumnOrderIndex; orderIndex <= endColumnOrderIndex; orderIndex++) {
|
|
11218
11369
|
var columnIndex = orders[orderIndex];
|
|
11219
11370
|
|
|
11220
11371
|
if (columnIndex >= 0 && !schema[columnIndex].hidden) {
|
|
11221
|
-
|
|
11372
|
+
hiddenColumns.push(columnIndex);
|
|
11222
11373
|
schema[columnIndex].hidden = true;
|
|
11374
|
+
self.dispatchEvent('columnhide', {
|
|
11375
|
+
columnIndex: columnIndex
|
|
11376
|
+
});
|
|
11223
11377
|
}
|
|
11224
11378
|
}
|
|
11225
11379
|
|
|
11226
|
-
if (
|
|
11380
|
+
if (hiddenColumns.length > 0) {
|
|
11227
11381
|
self.setStorageData();
|
|
11228
11382
|
setTimeout(function () {
|
|
11229
11383
|
self.resize(true);
|
|
11230
11384
|
}, 10);
|
|
11231
11385
|
}
|
|
11386
|
+
|
|
11387
|
+
self.dispatchEvent('hidecolumns', {
|
|
11388
|
+
hiddenColumns: hiddenColumns
|
|
11389
|
+
});
|
|
11390
|
+
};
|
|
11391
|
+
/**
|
|
11392
|
+
* Unihde column/columns
|
|
11393
|
+
* @memberof canvasDatagrid
|
|
11394
|
+
* @name unhideColumns
|
|
11395
|
+
* @method
|
|
11396
|
+
* @param {number} beginColumnOrderIndex
|
|
11397
|
+
* @param {number} [endColumnOrderIndex]
|
|
11398
|
+
*/
|
|
11399
|
+
|
|
11400
|
+
|
|
11401
|
+
self.unhideColumns = function (beginColumnOrderIndex, endColumnOrderIndex) {
|
|
11402
|
+
var orders = self.orders.columns;
|
|
11403
|
+
var schema = self.getSchema();
|
|
11404
|
+
|
|
11405
|
+
for (var i = beginColumnOrderIndex; i <= endColumnOrderIndex; i++) {
|
|
11406
|
+
var columnIndex = orders[i];
|
|
11407
|
+
var s = schema[columnIndex];
|
|
11408
|
+
|
|
11409
|
+
if (s && s.hidden) {
|
|
11410
|
+
s.hidden = false;
|
|
11411
|
+
self.dispatchEvent('columnunhide', {
|
|
11412
|
+
columnIndex: columnIndex
|
|
11413
|
+
});
|
|
11414
|
+
}
|
|
11415
|
+
}
|
|
11416
|
+
|
|
11417
|
+
self.refresh();
|
|
11232
11418
|
};
|
|
11233
11419
|
/**
|
|
11234
11420
|
* Hide rows
|
|
11235
11421
|
* @memberof canvasDatagrid
|
|
11236
11422
|
* @name hideRows
|
|
11423
|
+
* @method
|
|
11237
11424
|
* @param {number} beginRowIndex
|
|
11238
11425
|
* @param {number} endRowIndex
|
|
11239
11426
|
*/
|
|
@@ -11246,6 +11433,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11246
11433
|
* Unhide rows
|
|
11247
11434
|
* @memberof canvasDatagrid
|
|
11248
11435
|
* @name unhideRows
|
|
11436
|
+
* @method
|
|
11249
11437
|
* @param {number} beginRowIndex
|
|
11250
11438
|
* @param {number} endRowIndex
|
|
11251
11439
|
*/
|
|
@@ -11375,6 +11563,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11375
11563
|
/**
|
|
11376
11564
|
* Add grouping
|
|
11377
11565
|
* @param {'columns'|'rows'} groupFor
|
|
11566
|
+
* @method
|
|
11378
11567
|
* @param {number} from
|
|
11379
11568
|
* @param {number} to
|
|
11380
11569
|
*/
|
|
@@ -11466,6 +11655,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11466
11655
|
/**
|
|
11467
11656
|
* Remove grouping
|
|
11468
11657
|
* @param {Array<Array<{from:number,to:number,collapsed:boolean}>>} allGroups
|
|
11658
|
+
* @method
|
|
11469
11659
|
* @param {number} from
|
|
11470
11660
|
* @param {number} to
|
|
11471
11661
|
*/
|
|
@@ -11701,10 +11891,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11701
11891
|
|
|
11702
11892
|
self.moveSelection = function (offsetX, offsetY) {
|
|
11703
11893
|
var sel = [];
|
|
11894
|
+
self.selectedRows = [];
|
|
11895
|
+
self.selectedColumns = [];
|
|
11704
11896
|
self.selections.forEach(function (row, rowIndex) {
|
|
11705
11897
|
sel[rowIndex + offsetY] = [];
|
|
11898
|
+
self.selectedRows.push(rowIndex + offsetY);
|
|
11706
11899
|
row.forEach(function (colIndex) {
|
|
11707
11900
|
sel[rowIndex + offsetY].push(colIndex + offsetX);
|
|
11901
|
+
if (self.selectedColumns.indexOf(colIndex + offsetX) === -1) self.selectedColumns.push(colIndex + offsetX);
|
|
11708
11902
|
});
|
|
11709
11903
|
});
|
|
11710
11904
|
self.selections = sel;
|
|
@@ -12016,6 +12210,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12016
12210
|
|
|
12017
12211
|
x -= self.getRowGroupAreaWidth();
|
|
12018
12212
|
y -= self.getColumnGroupAreaHeight();
|
|
12213
|
+
|
|
12214
|
+
if (self.dragStartObject !== undefined) {
|
|
12215
|
+
if (x <= 0) x = 1;
|
|
12216
|
+
if (x >= self.width) x = self.width - 1;
|
|
12217
|
+
if (y <= 0) y = 1;
|
|
12218
|
+
if (y >= self.height) y = self.height - 1;
|
|
12219
|
+
}
|
|
12220
|
+
|
|
12019
12221
|
var border,
|
|
12020
12222
|
tsz = useTouchScrollZones ? self.attributes.touchScrollZone : 0,
|
|
12021
12223
|
moveMode = self.attributes.borderDragBehavior === 'move',
|
|
@@ -12060,14 +12262,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12060
12262
|
|
|
12061
12263
|
if (entitiy.x - self.style.cellBorderWidth < x && entitiy.x + entitiy.width + self.style.cellBorderWidth > x && entitiy.y - self.style.cellBorderWidth < y && entitiy.y + entitiy.height + self.style.cellBorderWidth > y) {
|
|
12062
12264
|
if (/frozen-row-marker/.test(cell.style)) {
|
|
12265
|
+
if (self.dragMode === 'frozen-column-marker') continue;
|
|
12063
12266
|
cell.dragContext = cell.style;
|
|
12064
|
-
cell.context = '
|
|
12267
|
+
cell.context = 'grab';
|
|
12065
12268
|
return cell;
|
|
12066
12269
|
}
|
|
12067
12270
|
|
|
12068
12271
|
if (/frozen-column-marker/.test(cell.style)) {
|
|
12272
|
+
if (self.dragMode === 'frozen-row-marker') continue;
|
|
12069
12273
|
cell.dragContext = cell.style;
|
|
12070
|
-
cell.context = '
|
|
12274
|
+
cell.context = 'grab';
|
|
12071
12275
|
return cell;
|
|
12072
12276
|
}
|
|
12073
12277
|
|
|
@@ -12146,7 +12350,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12146
12350
|
}
|
|
12147
12351
|
|
|
12148
12352
|
if (cell.style === 'columnHeaderCell') {
|
|
12149
|
-
if (cell.x + cell.width - self.attributes.columnGrabZoneSize - self.style.cellBorderWidth > x || !self.attributes.allowRowReordering) {
|
|
12353
|
+
if (!self.isColumnSelected(cell.columnIndex) && cell.x + cell.width - self.attributes.columnGrabZoneSize - self.style.cellBorderWidth > x || !self.attributes.allowRowReordering) {
|
|
12150
12354
|
cell.dragContext = 'cell';
|
|
12151
12355
|
cell.context = 'cell';
|
|
12152
12356
|
} else {
|
|
@@ -12158,7 +12362,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12158
12362
|
}
|
|
12159
12363
|
|
|
12160
12364
|
if (cell.style === 'rowHeaderCell') {
|
|
12161
|
-
if (self.attributes.rowGrabZoneSize + (cell.y - self.style.cellBorderWidth) < y || !self.attributes.allowRowReordering) {
|
|
12365
|
+
if (!self.isRowSelected(cell.rowIndex) && self.attributes.rowGrabZoneSize + (cell.y - self.style.cellBorderWidth) < y || !self.attributes.allowRowReordering) {
|
|
12162
12366
|
cell.dragContext = 'cell';
|
|
12163
12367
|
cell.context = 'cell';
|
|
12164
12368
|
} else {
|
|
@@ -12295,6 +12499,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12295
12499
|
|
|
12296
12500
|
if (!ctrl) {
|
|
12297
12501
|
self.selections = [];
|
|
12502
|
+
self.selectedRows = [];
|
|
12503
|
+
self.selectedColumns = [];
|
|
12298
12504
|
}
|
|
12299
12505
|
|
|
12300
12506
|
if (self.selectionBounds.top < -1 || self.selectionBounds.bottom > self.viewData.length || self.selectionBounds.left < -1 || self.selectionBounds.right > s.length) {
|
|
@@ -12303,11 +12509,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12303
12509
|
|
|
12304
12510
|
for (x = self.selectionBounds.top; x <= self.selectionBounds.bottom; x += 1) {
|
|
12305
12511
|
self.selections[x] = [];
|
|
12512
|
+
self.selectedRows.push(x);
|
|
12306
12513
|
|
|
12307
12514
|
for (y = self.selectionBounds.left; y <= self.selectionBounds.right; y += 1) {
|
|
12308
12515
|
if (self.selections[x].indexOf(y) === -1) {
|
|
12309
12516
|
self.selections[x].push(y);
|
|
12310
12517
|
}
|
|
12518
|
+
|
|
12519
|
+
if (y !== -1 && self.selectedColumns.indexOf(y) === -1) {
|
|
12520
|
+
self.selectedColumns.push(y);
|
|
12521
|
+
}
|
|
12311
12522
|
}
|
|
12312
12523
|
}
|
|
12313
12524
|
|