canvas-datagrid 0.3.10 → 0.3.14
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 +27 -0
- package/dist/canvas-datagrid.debug.js +328 -129
- 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 +6 -0
- package/lib/defaults.js +3 -0
- package/lib/docs.js +5 -0
- package/lib/draw.js +3 -1
- package/lib/{events.js → events/index.js} +39 -57
- package/lib/events/util.js +96 -0
- package/lib/intf.js +69 -5
- package/lib/publicMethods.js +4 -0
- package/lib/touch.js +2 -39
- package/package.json +1 -1
|
@@ -1016,7 +1016,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1016
1016
|
|
|
1017
1017
|
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(self) {
|
|
1018
1018
|
self.defaults = {
|
|
1019
|
-
attributes: [['allowColumnReordering', true], ['allowColumnResize', true], ['allowColumnResizeFromCell', false], ['allowFreezingRows', false], ['allowFreezingColumns', false], ['allowMovingSelection', true], ['allowRowHeaderResize', true], ['allowRowReordering', false], ['allowRowResize', true], ['allowRowResizeFromCell', false], ['allowSorting', true], ['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) '], ['globalRowResize', false], ['hideColumnText', 'Hide %s'], ['hoverMode', 'cell'], ['maxAutoCompleteItems', 200], ['multiLine', false], ['name', ''], ['pageUpDownOverlap', 1], ['pasteText', 'Paste'], ['persistantSelectionMode', false], ['removeFilterOptionText', 'Remove filter on %s'], ['reorderDeadZone', 3], ['resizeScrollZone', 20], ['rowGrabZoneSize', 5], ['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], ['showNewRow', false], ['showOrderByOption', true], ['showOrderByOptionTextAsc', 'Order by %s ascending'], ['showOrderByOptionTextDesc', 'Order by %s descending'], ['showPaste', false], ['showPerformance', false], ['showRowHeaders', true], ['showRowNumbers', true], ['showRowNumberGaps', true], ['singleSelectionMode', false], ['snapToRow', false], ['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]],
|
|
1019
|
+
attributes: [['allowColumnReordering', true], ['allowColumnResize', true], ['allowColumnResizeFromCell', false], ['allowFreezingRows', false], ['allowFreezingColumns', false], ['allowMovingSelection', true], ['allowRowHeaderResize', true], ['allowRowReordering', false], ['allowRowResize', true], ['allowRowResizeFromCell', false], ['allowSorting', true], ['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'], ['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], ['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], ['showNewRow', false], ['showOrderByOption', true], ['showOrderByOptionTextAsc', 'Order by %s ascending'], ['showOrderByOptionTextDesc', 'Order by %s descending'], ['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]],
|
|
1020
1020
|
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], ['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)'], ['cellVerticalAlignment', 'center'], ['cellWidth', 250], ['cellWidthWithChildGrid', 250], ['cellWhiteSpace', 'nowrap'], ['cellLineHeight', 1], ['cellLineSpacing', 3], ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['childContextMenuArrowHTML', '►'], ['childContextMenuMarginLeft', -11], ['childContextMenuMarginTop', -6], ['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], ['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], ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBorderCollapse', 'collapse'], ['gridBorderColor', 'rgba(202, 202, 202, 1)'], ['gridBorderWidth', 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], ['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], ['width', 'auto']]
|
|
1021
1021
|
};
|
|
1022
1022
|
}
|
|
@@ -2611,7 +2611,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
2611
2611
|
viewRowIndex: rowOrderIndex,
|
|
2612
2612
|
viewColumnIndex: columnOrderIndex,
|
|
2613
2613
|
boundRowIndex: self.getBoundRowIndexFromViewRowIndex(rowOrderIndex),
|
|
2614
|
-
boundColumnIndex: columnOrderIndex,
|
|
2614
|
+
boundColumnIndex: self.getBoundColumnIndexFromViewColumnIndex(columnOrderIndex),
|
|
2615
2615
|
sortColumnIndex: headerIndex,
|
|
2616
2616
|
sortRowIndex: rowIndex,
|
|
2617
2617
|
isGrid: isGrid,
|
|
@@ -3515,10 +3515,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
3515
3515
|
|
|
3516
3516
|
/***/ }),
|
|
3517
3517
|
|
|
3518
|
-
/***/ "./lib/events.js":
|
|
3519
|
-
|
|
3520
|
-
!*** ./lib/events.js ***!
|
|
3521
|
-
|
|
3518
|
+
/***/ "./lib/events/index.js":
|
|
3519
|
+
/*!*****************************!*\
|
|
3520
|
+
!*** ./lib/events/index.js ***!
|
|
3521
|
+
\*****************************/
|
|
3522
3522
|
/*! namespace exports */
|
|
3523
3523
|
/*! export default [provided] [no usage info] [missing usage info prevents renaming] */
|
|
3524
3524
|
/*! other exports [not provided] [no usage info] */
|
|
@@ -3532,18 +3532,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3532
3532
|
/* harmony export */ });
|
|
3533
3533
|
/* harmony import */ var is_printable_key_event__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-printable-key-event */ "./node_modules/is-printable-key-event/dist/index.js");
|
|
3534
3534
|
/* harmony import */ var is_printable_key_event__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(is_printable_key_event__WEBPACK_IMPORTED_MODULE_0__);
|
|
3535
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./lib/events/util.js");
|
|
3535
3536
|
/*jslint browser: true, unparam: true, todo: true, plusplus: true*/
|
|
3536
3537
|
|
|
3537
3538
|
/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
|
|
3538
3539
|
|
|
3539
3540
|
|
|
3540
|
-
function
|
|
3541
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3542
|
+
|
|
3543
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3544
|
+
|
|
3545
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
3546
|
+
|
|
3547
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3548
|
+
|
|
3549
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
3541
3550
|
|
|
3542
3551
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3543
3552
|
|
|
3544
3553
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
3545
3554
|
|
|
3546
3555
|
|
|
3556
|
+
|
|
3547
3557
|
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(self) {
|
|
3548
3558
|
var wheeling;
|
|
3549
3559
|
|
|
@@ -4031,6 +4041,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4031
4041
|
var event = {
|
|
4032
4042
|
selections: self.selections,
|
|
4033
4043
|
selectedData: self.getSelectedData(),
|
|
4044
|
+
selectedCells: self.getSelectedCells(),
|
|
4034
4045
|
selectionBounds: self.getSelectionBounds()
|
|
4035
4046
|
};
|
|
4036
4047
|
self.dispatchEvent('selectionchanged', event);
|
|
@@ -4089,7 +4100,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4089
4100
|
|
|
4090
4101
|
ev = {
|
|
4091
4102
|
selections: self.selections,
|
|
4092
|
-
selectionBounds: self.getSelectionBounds()
|
|
4103
|
+
selectionBounds: self.getSelectionBounds(),
|
|
4104
|
+
selectedCells: self.getSelectedCells()
|
|
4093
4105
|
};
|
|
4094
4106
|
Object.defineProperty(ev, 'selectedData', {
|
|
4095
4107
|
get: function get() {
|
|
@@ -4700,7 +4712,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4700
4712
|
return;
|
|
4701
4713
|
}
|
|
4702
4714
|
|
|
4703
|
-
if (!self.hasFocus) {
|
|
4715
|
+
if (!self.attributes.keepFocusOnMouseOut && !self.hasFocus) {
|
|
4704
4716
|
return;
|
|
4705
4717
|
} // If a user starts typing content, switch to "Enter" mode
|
|
4706
4718
|
|
|
@@ -4856,7 +4868,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4856
4868
|
ev = {
|
|
4857
4869
|
selectedData: self.getSelectedData(),
|
|
4858
4870
|
selections: self.selections,
|
|
4859
|
-
selectionBounds: self.getSelectionBounds()
|
|
4871
|
+
selectionBounds: self.getSelectionBounds(),
|
|
4872
|
+
selectedCells: self.getSelectedCells()
|
|
4860
4873
|
};
|
|
4861
4874
|
Object.defineProperty(ev, 'selectedData', {
|
|
4862
4875
|
get: function get() {
|
|
@@ -4961,64 +4974,17 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4961
4974
|
};
|
|
4962
4975
|
|
|
4963
4976
|
self.pasteData = function (pasteValue, mimeType, startRowIndex, startColIndex) {
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
var isSupportedHtmlTable = function isSupportedHtmlTable(htmlString) {
|
|
4967
|
-
return /(?:^(<meta[^>]+>)?<table.*?>)|(?:<!--StartFragment-->\s*<table.*?>)/.test(htmlString);
|
|
4968
|
-
}; // TODO: support pasting tables from Excel
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
if (mimeType === 'text/html' && isSupportedHtmlTable(pasteValue) === false) {
|
|
4977
|
+
if (mimeType === 'text/html' && !(0,_util__WEBPACK_IMPORTED_MODULE_1__.isSupportedHtml)(pasteValue)) {
|
|
4972
4978
|
console.warn('Unrecognized HTML format. HTML must be a simple table, e.g.: <table><tr><td>data</td></tr></table>.');
|
|
4973
4979
|
console.warn('Data with the mime type text/html not in this format will not be imported as row data.');
|
|
4974
4980
|
return;
|
|
4975
4981
|
}
|
|
4976
4982
|
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
if (mimeType === 'text/html') {
|
|
4980
|
-
var doc = new DOMParser().parseFromString(data, 'text/html');
|
|
4981
|
-
var trs = doc.querySelectorAll('table tr');
|
|
4982
|
-
var _rows = [];
|
|
4983
|
-
trs.forEach(function (tr) {
|
|
4984
|
-
var row = [];
|
|
4985
|
-
tr.childNodes.forEach(function (td) {
|
|
4986
|
-
if (td.nodeName === '#text') return;
|
|
4987
|
-
var col = {
|
|
4988
|
-
// style: {}, // keep style if need
|
|
4989
|
-
value: []
|
|
4990
|
-
};
|
|
4991
|
-
td.childNodes.forEach(function (ele) {
|
|
4992
|
-
col.value.push({
|
|
4993
|
-
// style: {}, // keep style if need
|
|
4994
|
-
value: ele.nodeType === 1 ? ele.innerText : ele.data
|
|
4995
|
-
});
|
|
4996
|
-
});
|
|
4997
|
-
row.push(col);
|
|
4998
|
-
});
|
|
4999
|
-
|
|
5000
|
-
_rows.push(row);
|
|
5001
|
-
});
|
|
5002
|
-
return _rows;
|
|
5003
|
-
} // Default data format is string, so split on new line,
|
|
5004
|
-
// and then enclose in an array (a row with one cell):
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
return data.split('\n').map(function (item) {
|
|
5008
|
-
return item.split('\t').map(function (value) {
|
|
5009
|
-
return {
|
|
5010
|
-
value: [{
|
|
5011
|
-
value: value
|
|
5012
|
-
}]
|
|
5013
|
-
};
|
|
5014
|
-
});
|
|
5015
|
-
});
|
|
5016
|
-
}
|
|
5017
|
-
|
|
5018
|
-
var rows = parseData(pasteValue, mimeType); // selected cell. This mimics Excel's paste functionality, and works
|
|
4983
|
+
var schema = self.getSchema();
|
|
4984
|
+
var rows = (0,_util__WEBPACK_IMPORTED_MODULE_1__.parseData)(pasteValue, mimeType); // selected cell. This mimics Excel's paste functionality, and works
|
|
5019
4985
|
// as a poor-man's fill-down.
|
|
5020
4986
|
|
|
5021
|
-
if (rows.length === 1) {
|
|
4987
|
+
if (rows.length === 1 && rows[0].length === 1) {
|
|
5022
4988
|
var cellData = rows[0][0].value.map(function (item) {
|
|
5023
4989
|
return item.value;
|
|
5024
4990
|
}).join();
|
|
@@ -5075,7 +5041,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5075
5041
|
self.selections.forEach(function (row, rowIndex) {
|
|
5076
5042
|
if (rowIndex === undefined) return;
|
|
5077
5043
|
row.forEach(function (columnIndex) {
|
|
5078
|
-
affectedCells.push([rowIndex, columnIndex, self.
|
|
5044
|
+
affectedCells.push([rowIndex, columnIndex, self.getBoundRowIndexFromViewRowIndex(rowIndex), self.getBoundColumnIndexFromViewColumnIndex(columnIndex)]);
|
|
5079
5045
|
});
|
|
5080
5046
|
});
|
|
5081
5047
|
self.dispatchEvent('afterpaste', {
|
|
@@ -5167,9 +5133,50 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5167
5133
|
|
|
5168
5134
|
self.cut = function (e) {
|
|
5169
5135
|
self.copy(e);
|
|
5170
|
-
self.
|
|
5171
|
-
|
|
5172
|
-
|
|
5136
|
+
var schema = self.getSchema();
|
|
5137
|
+
var affectedCells = [];
|
|
5138
|
+
|
|
5139
|
+
var _iterator2 = _createForOfIteratorHelper(self.selections.entries()),
|
|
5140
|
+
_step2;
|
|
5141
|
+
|
|
5142
|
+
try {
|
|
5143
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
5144
|
+
var _step2$value = _slicedToArray(_step2.value, 2),
|
|
5145
|
+
rowIndex = _step2$value[0],
|
|
5146
|
+
row = _step2$value[1];
|
|
5147
|
+
|
|
5148
|
+
if (!row) continue;
|
|
5149
|
+
var boundRowIndex = self.getBoundRowIndexFromViewRowIndex(rowIndex);
|
|
5150
|
+
|
|
5151
|
+
var _iterator3 = _createForOfIteratorHelper(row),
|
|
5152
|
+
_step3;
|
|
5153
|
+
|
|
5154
|
+
try {
|
|
5155
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
5156
|
+
var columnIndex = _step3.value;
|
|
5157
|
+
var boundColumnIndex = self.getBoundColumnIndexFromViewColumnIndex(columnIndex);
|
|
5158
|
+
var colName = schema[boundColumnIndex].name;
|
|
5159
|
+
self.viewData[rowIndex][colName] = '';
|
|
5160
|
+
affectedCells.push([rowIndex, columnIndex, boundRowIndex, boundColumnIndex]);
|
|
5161
|
+
}
|
|
5162
|
+
} catch (err) {
|
|
5163
|
+
_iterator3.e(err);
|
|
5164
|
+
} finally {
|
|
5165
|
+
_iterator3.f();
|
|
5166
|
+
}
|
|
5167
|
+
}
|
|
5168
|
+
} catch (err) {
|
|
5169
|
+
_iterator2.e(err);
|
|
5170
|
+
} finally {
|
|
5171
|
+
_iterator2.f();
|
|
5172
|
+
}
|
|
5173
|
+
|
|
5174
|
+
if (self.dispatchEvent('cut', {
|
|
5175
|
+
NativeEvent: e,
|
|
5176
|
+
cells: affectedCells
|
|
5177
|
+
})) {
|
|
5178
|
+
return;
|
|
5179
|
+
}
|
|
5173
5180
|
};
|
|
5174
5181
|
|
|
5175
5182
|
self.copy = function (e) {
|
|
@@ -5257,6 +5264,156 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5257
5264
|
return;
|
|
5258
5265
|
}
|
|
5259
5266
|
|
|
5267
|
+
/***/ }),
|
|
5268
|
+
|
|
5269
|
+
/***/ "./lib/events/util.js":
|
|
5270
|
+
/*!****************************!*\
|
|
5271
|
+
!*** ./lib/events/util.js ***!
|
|
5272
|
+
\****************************/
|
|
5273
|
+
/*! namespace exports */
|
|
5274
|
+
/*! export isSupportedHtml [provided] [no usage info] [missing usage info prevents renaming] */
|
|
5275
|
+
/*! export parseData [provided] [no usage info] [missing usage info prevents renaming] */
|
|
5276
|
+
/*! export parseHtmlTable [provided] [no usage info] [missing usage info prevents renaming] */
|
|
5277
|
+
/*! export parseHtmlText [provided] [no usage info] [missing usage info prevents renaming] */
|
|
5278
|
+
/*! export parseText [provided] [no usage info] [missing usage info prevents renaming] */
|
|
5279
|
+
/*! export sanitizeElementData [provided] [no usage info] [missing usage info prevents renaming] */
|
|
5280
|
+
/*! other exports [not provided] [no usage info] */
|
|
5281
|
+
/*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
|
|
5282
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5283
|
+
|
|
5284
|
+
"use strict";
|
|
5285
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5286
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5287
|
+
/* harmony export */ "isSupportedHtml": function() { return /* binding */ isSupportedHtml; },
|
|
5288
|
+
/* harmony export */ "sanitizeElementData": function() { return /* binding */ sanitizeElementData; },
|
|
5289
|
+
/* harmony export */ "parseData": function() { return /* binding */ parseData; },
|
|
5290
|
+
/* harmony export */ "parseHtmlTable": function() { return /* binding */ parseHtmlTable; },
|
|
5291
|
+
/* harmony export */ "parseHtmlText": function() { return /* binding */ parseHtmlText; },
|
|
5292
|
+
/* harmony export */ "parseText": function() { return /* binding */ parseText; }
|
|
5293
|
+
/* harmony export */ });
|
|
5294
|
+
|
|
5295
|
+
|
|
5296
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
5297
|
+
|
|
5298
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5299
|
+
|
|
5300
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
5301
|
+
|
|
5302
|
+
var isSupportedHtml = function isSupportedHtml(pasteValue) {
|
|
5303
|
+
// We need to match new lines in the HTML, .* won't match new line characters.
|
|
5304
|
+
// `s` regex modifier can't be used with `ecmaVersion === 2017`.
|
|
5305
|
+
// As a workaround using [\s\S]*. Fix when we upgrade `ecmaVersion`.
|
|
5306
|
+
var genericDiv = /(?:^(<meta[^>]*>)?[\s\S]*<div[^>]*>)/;
|
|
5307
|
+
var genericSpan = /(?:^(<meta[^>]*>)?[\s\S]*<span[^>]*>)/;
|
|
5308
|
+
var genericTable = /(?:^(<meta[^>]*>)?[\s\S]*<table[^>]*>)/; // Matches Google Sheets format clipboard data format too.
|
|
5309
|
+
|
|
5310
|
+
var excelTable = /(?:<!--StartFragment-->[\s\S]*<tr[^>]*>)/;
|
|
5311
|
+
var excelTableRow = /(?:<!--StartFragment-->[\s\S]*<td[^>]*>)/;
|
|
5312
|
+
return [genericDiv, genericTable, genericSpan, excelTable, excelTableRow].some(function (expression) {
|
|
5313
|
+
return expression.test(pasteValue);
|
|
5314
|
+
});
|
|
5315
|
+
}; // Explanation of nodeType here: https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
5316
|
+
|
|
5317
|
+
|
|
5318
|
+
var IGNORE_NODETYPES = [8, 3]; // '#text' and '#comment'
|
|
5319
|
+
|
|
5320
|
+
var isHtmlTable = function isHtmlTable(pasteValue) {
|
|
5321
|
+
return /(?:<table[^>]*>)|(?:<tr[^]*>)/.test(pasteValue);
|
|
5322
|
+
};
|
|
5323
|
+
|
|
5324
|
+
var sanitizeElementData = function sanitizeElementData(element) {
|
|
5325
|
+
// It is not entirely clear if this check on nodeType is required.
|
|
5326
|
+
var elementData = element.nodeType === 1 ? element.innerText : element.data;
|
|
5327
|
+
return String(elementData).replace(/\s+/g, ' ').trim();
|
|
5328
|
+
};
|
|
5329
|
+
|
|
5330
|
+
var parseHtmlText = function parseHtmlText(data) {
|
|
5331
|
+
var doc = new DOMParser().parseFromString(data, 'text/html');
|
|
5332
|
+
var element = doc.querySelector('div') || doc.querySelector('span');
|
|
5333
|
+
var elementData = sanitizeElementData(element);
|
|
5334
|
+
return elementData.split('\n').map(function (item) {
|
|
5335
|
+
return item.split('\t').map(function (value) {
|
|
5336
|
+
return {
|
|
5337
|
+
value: [{
|
|
5338
|
+
value: value
|
|
5339
|
+
}]
|
|
5340
|
+
};
|
|
5341
|
+
});
|
|
5342
|
+
});
|
|
5343
|
+
};
|
|
5344
|
+
|
|
5345
|
+
var parseHtmlTable = function parseHtmlTable(data) {
|
|
5346
|
+
var doc = new DOMParser().parseFromString(data, 'text/html');
|
|
5347
|
+
var trs = doc.querySelectorAll('table tr');
|
|
5348
|
+
var rows = [];
|
|
5349
|
+
|
|
5350
|
+
var _iterator = _createForOfIteratorHelper(trs),
|
|
5351
|
+
_step;
|
|
5352
|
+
|
|
5353
|
+
try {
|
|
5354
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
5355
|
+
var tr = _step.value;
|
|
5356
|
+
var row = [];
|
|
5357
|
+
|
|
5358
|
+
var _iterator2 = _createForOfIteratorHelper(tr.childNodes),
|
|
5359
|
+
_step2;
|
|
5360
|
+
|
|
5361
|
+
try {
|
|
5362
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
5363
|
+
var childNode = _step2.value;
|
|
5364
|
+
if (IGNORE_NODETYPES.includes(childNode.nodeType)) continue;
|
|
5365
|
+
var col = {
|
|
5366
|
+
value: []
|
|
5367
|
+
};
|
|
5368
|
+
var value = sanitizeElementData(childNode);
|
|
5369
|
+
if (value) col.value.push({
|
|
5370
|
+
value: value
|
|
5371
|
+
});
|
|
5372
|
+
row.push(col);
|
|
5373
|
+
}
|
|
5374
|
+
} catch (err) {
|
|
5375
|
+
_iterator2.e(err);
|
|
5376
|
+
} finally {
|
|
5377
|
+
_iterator2.f();
|
|
5378
|
+
}
|
|
5379
|
+
|
|
5380
|
+
rows.push(row);
|
|
5381
|
+
}
|
|
5382
|
+
} catch (err) {
|
|
5383
|
+
_iterator.e(err);
|
|
5384
|
+
} finally {
|
|
5385
|
+
_iterator.f();
|
|
5386
|
+
}
|
|
5387
|
+
|
|
5388
|
+
return rows;
|
|
5389
|
+
};
|
|
5390
|
+
|
|
5391
|
+
var parseText = function parseText(data) {
|
|
5392
|
+
return data.split('\n').map(function (item) {
|
|
5393
|
+
return item.split('\t').map(function (value) {
|
|
5394
|
+
return {
|
|
5395
|
+
value: [{
|
|
5396
|
+
value: value
|
|
5397
|
+
}]
|
|
5398
|
+
};
|
|
5399
|
+
});
|
|
5400
|
+
});
|
|
5401
|
+
};
|
|
5402
|
+
|
|
5403
|
+
var parseData = function parseData(data, mimeType) {
|
|
5404
|
+
if (mimeType === 'text/html' && isHtmlTable(data)) {
|
|
5405
|
+
return parseHtmlTable(data);
|
|
5406
|
+
} else if (mimeType === 'text/html') {
|
|
5407
|
+
return parseHtmlText(data);
|
|
5408
|
+
} // Default data format is string, so split on new line,
|
|
5409
|
+
// and then enclose in an array (a row with one cell):
|
|
5410
|
+
|
|
5411
|
+
|
|
5412
|
+
return parseText(data);
|
|
5413
|
+
};
|
|
5414
|
+
|
|
5415
|
+
|
|
5416
|
+
|
|
5260
5417
|
/***/ }),
|
|
5261
5418
|
|
|
5262
5419
|
/***/ "./lib/intf.js":
|
|
@@ -5281,20 +5438,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5281
5438
|
|
|
5282
5439
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
5283
5440
|
|
|
5284
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
5285
|
-
|
|
5286
5441
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5287
5442
|
|
|
5288
5443
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5289
5444
|
|
|
5290
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5291
|
-
|
|
5292
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
5293
|
-
|
|
5294
5445
|
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
5295
5446
|
|
|
5296
5447
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
5297
5448
|
|
|
5449
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
5450
|
+
|
|
5451
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5452
|
+
|
|
5453
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
5454
|
+
|
|
5298
5455
|
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(self, ctor) {
|
|
5299
5456
|
self.scale = 1;
|
|
5300
5457
|
self.orders = {
|
|
@@ -5423,6 +5580,74 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
5423
5580
|
return selectedData;
|
|
5424
5581
|
};
|
|
5425
5582
|
|
|
5583
|
+
self.getSelectedCells = function (expandToRow) {
|
|
5584
|
+
var selectedCells = [];
|
|
5585
|
+
var schema = self.getSchema();
|
|
5586
|
+
var viewDataLength = self.viewData.length;
|
|
5587
|
+
|
|
5588
|
+
if (viewDataLength === 0) {
|
|
5589
|
+
return [];
|
|
5590
|
+
}
|
|
5591
|
+
|
|
5592
|
+
var _iterator = _createForOfIteratorHelper(self.selections.entries()),
|
|
5593
|
+
_step;
|
|
5594
|
+
|
|
5595
|
+
try {
|
|
5596
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
5597
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
5598
|
+
viewRowIndex = _step$value[0],
|
|
5599
|
+
row = _step$value[1];
|
|
5600
|
+
|
|
5601
|
+
if (!row || row.length === 0) continue;
|
|
5602
|
+
|
|
5603
|
+
var _iterator2 = _createForOfIteratorHelper(row.entries()),
|
|
5604
|
+
_step2;
|
|
5605
|
+
|
|
5606
|
+
try {
|
|
5607
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
5608
|
+
var _step2$value = _slicedToArray(_step2.value, 2),
|
|
5609
|
+
viewColumnIndex = _step2$value[1];
|
|
5610
|
+
|
|
5611
|
+
if (viewColumnIndex === -1 || !schema[viewColumnIndex]) {
|
|
5612
|
+
continue;
|
|
5613
|
+
}
|
|
5614
|
+
|
|
5615
|
+
var boundColumnIndex = self.getBoundColumnIndexFromViewColumnIndex(viewColumnIndex);
|
|
5616
|
+
|
|
5617
|
+
if (!expandToRow && schema[boundColumnIndex].hidden) {
|
|
5618
|
+
continue;
|
|
5619
|
+
}
|
|
5620
|
+
|
|
5621
|
+
if (self.viewData[viewRowIndex]) {
|
|
5622
|
+
var header = schema[boundColumnIndex];
|
|
5623
|
+
var value = self.viewData[viewRowIndex][header.name];
|
|
5624
|
+
var boundRowIndex = self.getBoundRowIndexFromViewRowIndex(viewRowIndex);
|
|
5625
|
+
var cell = {
|
|
5626
|
+
value: value,
|
|
5627
|
+
header: header,
|
|
5628
|
+
boundRowIndex: boundRowIndex,
|
|
5629
|
+
boundColumnIndex: boundColumnIndex,
|
|
5630
|
+
viewRowIndex: viewRowIndex,
|
|
5631
|
+
viewColumnIndex: viewColumnIndex
|
|
5632
|
+
};
|
|
5633
|
+
selectedCells.push(cell);
|
|
5634
|
+
}
|
|
5635
|
+
}
|
|
5636
|
+
} catch (err) {
|
|
5637
|
+
_iterator2.e(err);
|
|
5638
|
+
} finally {
|
|
5639
|
+
_iterator2.f();
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
} catch (err) {
|
|
5643
|
+
_iterator.e(err);
|
|
5644
|
+
} finally {
|
|
5645
|
+
_iterator.f();
|
|
5646
|
+
}
|
|
5647
|
+
|
|
5648
|
+
return selectedCells;
|
|
5649
|
+
};
|
|
5650
|
+
|
|
5426
5651
|
self.getBoundRowIndexFromViewRowIndex = function (viewRowIndex) {
|
|
5427
5652
|
if (self.boundRowIndexMap && self.boundRowIndexMap.has(viewRowIndex)) {
|
|
5428
5653
|
return self.boundRowIndexMap.get(viewRowIndex);
|
|
@@ -5431,6 +5656,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
5431
5656
|
return undefined;
|
|
5432
5657
|
};
|
|
5433
5658
|
|
|
5659
|
+
self.getBoundColumnIndexFromViewColumnIndex = function (viewColumnIndex) {
|
|
5660
|
+
return self.orders.columns[viewColumnIndex];
|
|
5661
|
+
};
|
|
5662
|
+
|
|
5434
5663
|
self.getColumnHeaderCellHeight = function () {
|
|
5435
5664
|
if (!self.attributes.showColumnHeaders) {
|
|
5436
5665
|
return 0;
|
|
@@ -5561,7 +5790,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
5561
5790
|
}); // Apply filtering
|
|
5562
5791
|
|
|
5563
5792
|
var _loop = function _loop() {
|
|
5564
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[
|
|
5793
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2),
|
|
5565
5794
|
headerName = _Object$entries$_i[0],
|
|
5566
5795
|
filterText = _Object$entries$_i[1];
|
|
5567
5796
|
|
|
@@ -5573,47 +5802,49 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
5573
5802
|
|
|
5574
5803
|
var currentFilterFunction = header.filter || self.filter(header.type || 'string');
|
|
5575
5804
|
newViewData = newViewData.filter(function (_ref) {
|
|
5576
|
-
var _ref2 = _slicedToArray(_ref,
|
|
5577
|
-
row = _ref2[0]
|
|
5805
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
5806
|
+
row = _ref2[0],
|
|
5807
|
+
originalRowIndex = _ref2[1];
|
|
5578
5808
|
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
return shouldIncludeRow;
|
|
5809
|
+
if (self.attributes.allowFreezingRows && !self.attributes.filterFrozenRows && originalRowIndex < self.frozenRow) return true;
|
|
5810
|
+
return currentFilterFunction(row[headerName], filterText);
|
|
5582
5811
|
});
|
|
5583
5812
|
};
|
|
5584
5813
|
|
|
5585
|
-
for (var
|
|
5814
|
+
for (var _i2 = 0, _Object$entries = Object.entries(self.columnFilters); _i2 < _Object$entries.length; _i2++) {
|
|
5586
5815
|
var _ret = _loop();
|
|
5587
5816
|
|
|
5588
5817
|
if (_ret === "continue") continue;
|
|
5589
5818
|
} // Apply sorting
|
|
5590
5819
|
|
|
5591
5820
|
|
|
5592
|
-
var
|
|
5593
|
-
|
|
5821
|
+
var _iterator3 = _createForOfIteratorHelper(self.orderings.columns),
|
|
5822
|
+
_step3;
|
|
5594
5823
|
|
|
5595
5824
|
try {
|
|
5596
5825
|
var _loop2 = function _loop2() {
|
|
5597
|
-
var column =
|
|
5826
|
+
var column = _step3.value;
|
|
5598
5827
|
var sortFn = column.sortFunction(column.orderBy, column.orderDirection);
|
|
5599
5828
|
newViewData.sort(function (_ref7, _ref8) {
|
|
5600
5829
|
var _ref9 = _slicedToArray(_ref7, 1),
|
|
5601
5830
|
rowA = _ref9[0];
|
|
5602
5831
|
|
|
5603
|
-
var _ref10 = _slicedToArray(_ref8,
|
|
5604
|
-
rowB = _ref10[0]
|
|
5832
|
+
var _ref10 = _slicedToArray(_ref8, 2),
|
|
5833
|
+
rowB = _ref10[0],
|
|
5834
|
+
rowIndexB = _ref10[1];
|
|
5605
5835
|
|
|
5836
|
+
if (self.attributes.allowFreezingRows && !self.attributes.sortFrozenRows && rowIndexB < self.frozenRow) return 0;
|
|
5606
5837
|
return sortFn(rowA, rowB);
|
|
5607
5838
|
});
|
|
5608
5839
|
};
|
|
5609
5840
|
|
|
5610
|
-
for (
|
|
5841
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
5611
5842
|
_loop2();
|
|
5612
5843
|
}
|
|
5613
5844
|
} catch (err) {
|
|
5614
|
-
|
|
5845
|
+
_iterator3.e(err);
|
|
5615
5846
|
} finally {
|
|
5616
|
-
|
|
5847
|
+
_iterator3.f();
|
|
5617
5848
|
}
|
|
5618
5849
|
|
|
5619
5850
|
return {
|
|
@@ -6022,6 +6253,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
6022
6253
|
self.intf.clearPxColorAssertions = self.clearPxColorAssertions;
|
|
6023
6254
|
self.intf.integerToAlpha = self.integerToAlpha;
|
|
6024
6255
|
self.intf.copy = self.copy;
|
|
6256
|
+
self.intf.cut = self.cut;
|
|
6025
6257
|
self.intf.paste = self.paste;
|
|
6026
6258
|
self.intf.setStyleProperty = self.setStyleProperty;
|
|
6027
6259
|
Object.defineProperty(self.intf, 'defaults', {
|
|
@@ -6911,7 +7143,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6911
7143
|
/* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./component */ "./lib/component.js");
|
|
6912
7144
|
/* harmony import */ var _defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./defaults */ "./lib/defaults.js");
|
|
6913
7145
|
/* harmony import */ var _draw__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./draw */ "./lib/draw.js");
|
|
6914
|
-
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./events */ "./lib/events.js");
|
|
7146
|
+
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./events */ "./lib/events/index.js");
|
|
6915
7147
|
/* harmony import */ var _touch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./touch */ "./lib/touch.js");
|
|
6916
7148
|
/* harmony import */ var _intf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./intf */ "./lib/intf.js");
|
|
6917
7149
|
/* harmony import */ var _contextMenu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./contextMenu */ "./lib/contextMenu.js");
|
|
@@ -7452,7 +7684,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7452
7684
|
self.dispatchEvent('selectionchanged', {
|
|
7453
7685
|
selectedData: self.getSelectedData(),
|
|
7454
7686
|
selections: self.selections,
|
|
7455
|
-
selectionBounds: self.selectionBounds
|
|
7687
|
+
selectionBounds: self.selectionBounds,
|
|
7688
|
+
selectedCells: self.getSelectedCells()
|
|
7456
7689
|
});
|
|
7457
7690
|
|
|
7458
7691
|
if (dontDraw) {
|
|
@@ -7603,7 +7836,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7603
7836
|
self.dispatchEvent('selectionchanged', {
|
|
7604
7837
|
selectedData: self.getSelectedData(),
|
|
7605
7838
|
selections: self.selections,
|
|
7606
|
-
selectionBounds: self.getSelectionBounds()
|
|
7839
|
+
selectionBounds: self.getSelectionBounds(),
|
|
7840
|
+
selectedCells: self.getSelectedCells()
|
|
7607
7841
|
});
|
|
7608
7842
|
};
|
|
7609
7843
|
/**
|
|
@@ -7632,7 +7866,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7632
7866
|
self.dispatchEvent('selectionchanged', {
|
|
7633
7867
|
selectedData: self.getSelectedData(),
|
|
7634
7868
|
selections: self.selections,
|
|
7635
|
-
selectionBounds: self.selectionBounds
|
|
7869
|
+
selectionBounds: self.selectionBounds,
|
|
7870
|
+
selectedCells: self.getSelectedCells()
|
|
7636
7871
|
});
|
|
7637
7872
|
}
|
|
7638
7873
|
|
|
@@ -8375,7 +8610,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8375
8610
|
|
|
8376
8611
|
ev = {
|
|
8377
8612
|
selections: self.selections,
|
|
8378
|
-
selectionBounds: self.selectionBounds
|
|
8613
|
+
selectionBounds: self.selectionBounds,
|
|
8614
|
+
selectedCells: self.getSelectedCells()
|
|
8379
8615
|
};
|
|
8380
8616
|
Object.defineProperty(ev, 'selectedData', {
|
|
8381
8617
|
get: function get() {
|
|
@@ -8678,40 +8914,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8678
8914
|
self.beginEditAt(cell.columnIndex, cell.rowIndex);
|
|
8679
8915
|
};
|
|
8680
8916
|
|
|
8681
|
-
self.touchCell = function (e) {
|
|
8682
|
-
return function () {
|
|
8683
|
-
clearInterval(self.calculatePPSTimer);
|
|
8684
|
-
var i,
|
|
8685
|
-
pos = self.getTouchPos(e);
|
|
8686
|
-
|
|
8687
|
-
if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone) {
|
|
8688
|
-
i = self.getCellAt(pos.x, pos.y);
|
|
8689
|
-
|
|
8690
|
-
if (!i) {
|
|
8691
|
-
return;
|
|
8692
|
-
}
|
|
8693
|
-
|
|
8694
|
-
if (self.touchingCell && self.touchingCell.rowIndex === i.rowIndex && self.touchingCell.columnIndex === i.columnIndex) {
|
|
8695
|
-
self.touchEditCell(i);
|
|
8696
|
-
return;
|
|
8697
|
-
}
|
|
8698
|
-
|
|
8699
|
-
if (self.input && self.input.editCell) {
|
|
8700
|
-
self.endEdit();
|
|
8701
|
-
}
|
|
8702
|
-
|
|
8703
|
-
self.touchingCell = i;
|
|
8704
|
-
self.selectArea({
|
|
8705
|
-
top: i.rowIndex,
|
|
8706
|
-
bottom: i.rowIndex,
|
|
8707
|
-
left: i.columnIndex,
|
|
8708
|
-
right: i.columnIndex
|
|
8709
|
-
});
|
|
8710
|
-
self.draw(true);
|
|
8711
|
-
}
|
|
8712
|
-
};
|
|
8713
|
-
};
|
|
8714
|
-
|
|
8715
8917
|
self.touchstart = function (e) {
|
|
8716
8918
|
if (e.changedTouches[0]) {
|
|
8717
8919
|
self.touchStart = self.getTouchPos(e);
|
|
@@ -8732,7 +8934,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8732
8934
|
self.stopAnimation = true;
|
|
8733
8935
|
self.animationFrames = 0;
|
|
8734
8936
|
self.stopPropagation(e);
|
|
8735
|
-
e.preventDefault();
|
|
8736
8937
|
|
|
8737
8938
|
if (e.touches.length === 1 && e.changedTouches[0] && !self.zoomAltered) {
|
|
8738
8939
|
self.touchLength = 1;
|
|
@@ -9033,9 +9234,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9033
9234
|
self.touchAnimateTo.y = self.yPPS * self.attributes.touchReleaseAcceleration;
|
|
9034
9235
|
self.calculatePPSTimed();
|
|
9035
9236
|
|
|
9036
|
-
if (dz &&
|
|
9037
|
-
self.touchCell(self.touchStartEvent)();
|
|
9038
|
-
} else if (self.animationFrames === 0 && (Math.abs(self.xPPST) > self.attributes.scrollAnimationPPSThreshold || Math.abs(self.yPPST) > self.attributes.scrollAnimationPPSThreshold) && !/-scroll-/.test(self.startingCell.style) && !dz) {
|
|
9237
|
+
if (!dz && self.animationFrames === 0 && (Math.abs(self.xPPST) > self.attributes.scrollAnimationPPSThreshold || Math.abs(self.yPPST) > self.attributes.scrollAnimationPPSThreshold) && !/-scroll-/.test(self.startingCell.style) && !dz) {
|
|
9039
9238
|
self.stopAnimation = false;
|
|
9040
9239
|
self.touchEndAnimation();
|
|
9041
9240
|
}
|