diff --git a/resources/elf-halo-dark.js b/resources/elf-halo-dark.js index 11bbeb4d..94461ca0 100644 --- a/resources/elf-halo-dark.js +++ b/resources/elf-halo-dark.js @@ -37008,23 +37008,26 @@ Recommended fix: }; /** @private - * @return {number} 0 does not allow dragging, 1 allows single dragging, and 2 allows multiple dragging. + * @return {number} 0 does not allow dragging, 1 allows single dragging, and 2 allows multiple dragging with row selection =. */ ColumnDraggingPlugin.prototype._getDraggingStyle = function () { let colSelExt = this._getPlugin("ColumnSelectionPlugin"); - let cgp = this._getPlugin("ColumnGroupingPlugin"); - if (!cgp) { + if (!colSelExt) { return 1; } + let cgp = this._getPlugin("ColumnGroupingPlugin"); let selectedCols = colSelExt.getSelectedColumns(); let dragOutSel = selectedCols.indexOf(this._startColumn) === -1; if (dragOutSel) { - // no column grouping, allow to drag + // drag outside selected col, drag only 1 row return 1; } let selectedColCount = selectedCols.length; if (selectedColCount > 1) { // Multiple column drag + if (!cgp) { + return 2; + } let currentGroup, prevGroup; for (let i = 0; i < selectedColCount; i++) { let colIndex = selectedCols[i]; @@ -43627,6 +43630,9 @@ Recommended fix: cell.setContent(chkbox); let sectionType = sectionSettings.getType(); + if (sectionType === "title") { + chkbox.setAttribute("aria-label", "all rows"); + } if (!this._coralCheckboxVer) { // Workaround for UIFR theme styling let lbl = document.createElement("label"); @@ -44548,6 +44554,7 @@ Recommended fix: if (!chkbox) { chkbox = checkboxes[i] = this._createCheckbox(sectionSettings, this._displayColumn, rowIndex); } + chkbox.setAttribute("aria-label", "row " + rowIndex); let rowId = dv.getRowId(rowIndex); // Slow rowData = this._getRowFromId(dv, rowId); if (hasBinding && chkbox) { @@ -59463,6 +59470,7 @@ Recommended fix: elem.className = "filter-input"; elem.style.width = "100%"; elem.style.margin = "0"; + elem.setAttribute("aria-label", "column filtering"); var placeholder = colOpt["placeholder"]; if (placeholder) { elem.setAttribute("placeholder", placeholder); @@ -126934,7 +126942,7 @@ Recommended fix: * @property {boolean=} hidden=true When this row is hidden * @property {boolean=} realTime=true Realtime row, able to request for JET/RTK * @property {Object=} info=null For storing any additional information to the row - * @property {string=} rowId Row identifier used for referencing the row + * @property {string=} rowId Row identifier used for referencing the row. The value cannot be in "_x_" format. */ /** @typedef {Object} RowDefinition~RowTypes @@ -126965,6 +126973,12 @@ Recommended fix: GROUP_MEMBER: "GROUP_MEMBER" }; + /** @type {RegExp} + * @private + * @const + */ + const ROW_ID_PATTERN = /^_[^_]+_$/; + /** @constructor * @param {RowDefinition~Options=} rowOptions */ @@ -127150,8 +127164,12 @@ Recommended fix: if (!this._autoGenerated) { let userRowId = rowOptions["rowId"]; if (userRowId && typeof userRowId === "string") { - this._rowId = this._dataId = userRowId; - this._userId = true; + if (userRowId.match(ROW_ID_PATTERN)) { + console.warn("Please change the rowId format to avoid duplicated rows' id causing unexpected behavior."); + } else { + this._rowId = this._dataId = userRowId; + this._userId = true; + } } } let extractedOptions = RowDefinition.extractRowOptions(rowOptions); @@ -127870,13 +127888,18 @@ Recommended fix: /** @public * @param {DataView} view - * @param {string=} rowId + * @param {string=} destRowId Destination position where the row will be placed BEFORE the specified position. */ - RowDefinition.prototype.registerToView = function (view, rowId) { + RowDefinition.prototype.registerToView = function (view, destRowId) { if (!view || this._view === view) { return; // Already in the view } this._view = view; + let rowId = this.getRowId(); + if (view.getRowData(rowId)) { + console.warn("Duplicated rows' id."); + return; + } let rowData = null; if (this._subSegment) { rowData = this._view.getRowData(this.getRowId()); @@ -127889,31 +127912,27 @@ Recommended fix: rowData[ROW_DEF] = this; let parentRowId = ""; let isSegment = this._isChain || this._asSegment; - if (rowId) { - parentRowId = view.getSegmentParentRowId(rowId); + if (destRowId) { + parentRowId = view.getSegmentParentRowId(destRowId); if (parentRowId) { if (isSegment) { // A chain or a segment cannot be put inside another segment - rowId = _getEndOfSegmentRowId(view, rowId); + destRowId = _getEndOfSegmentRowId(view, destRowId); } // else { // Normal row is inserted into a segment } } let stalledSorting = _stallSorting(view, isSegment, false); - let newRowId = view.insertRow(rowId, rowData, this.getRowId()); - if (newRowId !== this._rowId) { - this._rowId = newRowId; // In case there is some duplicate row id - this._userId = false; - } + view.insertRow(destRowId, rowData, rowId); if (isSegment) { - view.setSegmentSeparator(newRowId); + view.setSegmentSeparator(rowId); _stallSorting(view, false, stalledSorting); if (this._collapsed != null) { - view.collapseSegment(newRowId, this._collapsed); + view.collapseSegment(rowId, this._collapsed); this._collapsed = null; } } else if (!this._parent && parentRowId) { // Constituent cannot be added to another segment - view.addSegmentChild(parentRowId, newRowId, this._dataId); + view.addSegmentChild(parentRowId, rowId, this._dataId); } }; /** @private @@ -140373,7 +140392,8 @@ Recommended fix: column = /** @type{Column} */section.getColumn(c); column.setScrollState(paneElem, null, false); } - pane.setParent(section.getColumnHost()); + let scrollHost = section.getColumnHost(); + pane.setParent(scrollHost); let columns = []; let content = []; for (c = startColIndex; c < endColIndex; ++c) { @@ -140388,9 +140408,11 @@ Recommended fix: } let rs = section.getReservedSpace(); if (rs) { - if (!this._pinnedRightColumnCount) { + if (this.isActive() && !this._pinnedRightColumnCount) { paneSlider.addContent(rs); content.push(rs); + } else { + scrollHost.appendChild(rs); } section._updateRightSpaceStyle(); } @@ -152245,7 +152267,7 @@ Recommended fix: * @return {string} */ Core.getVersion = function () { - return "5.1.121"; + return "5.1.123"; }; /** {@link ElementWrapper#dispose} * @override @@ -155283,7 +155305,7 @@ Recommended fix: } else { if (rowIndex < firstFullRow) { // Scroll up - scrollIndex = rowIndex - 3; // Have some spaces at the top for more appealing visual + scrollIndex = rowIndex - 2; // Have some spaces at the top for more appealing visual if (scrollIndex < 0) { scrollIndex = 0; } @@ -155292,7 +155314,7 @@ Recommended fix: let lastFullRow = viewInfo.lastFullRow; if (rowIndex > lastFullRow) { let viewIndexSize = lastFullRow - firstFullRow; - scrollIndex = rowIndex - viewIndexSize + 3; + scrollIndex = rowIndex - viewIndexSize + 2; if (scrollIndex < 0) { scrollIndex = 0; } @@ -160595,11 +160617,11 @@ Recommended fix: }; /** Compare the difference in the 'id' property. - * @private - * @param {Object} obj1 - * @param {Object} obj2 - * @returns {boolean} If the id property of two objects is equal, the return will be true, otherwise it will be false. - */ + * @private + * @param {Object} obj1 + * @param {Object} obj2 + * @returns {boolean} If the id property of two objects is equal, the return will be true, otherwise it will be false. + */ let _hasMatchingId = function (obj1, obj2) { if (!obj1 || !obj2 || !obj1.id || !obj2.id) { // Handle nullable, if the object or id have null, it's means difference value @@ -160608,6 +160630,25 @@ Recommended fix: return obj1.id === obj2.id; }; + /** @private + * @param {Object} e + */ + let _preventDefault = function (e) { + if (e) { + e.preventDefault(); + } + }; + /** @private + * @param {number=} id + * @returns {number} Always return 0 + */ + let _clearTimeout = function (id) { + if (id) { + clearTimeout(id); + } + return 0; + }; + /** @constructor * @extends {EventDispatcher} * @param {(Element|null)=} placeholder @@ -160902,10 +160943,6 @@ Recommended fix: * @private */ Grid_Grid.prototype._focusingArgs = null; - /** @type {number} - * @private - */ - Grid_Grid.prototype._scrolledRow = -1; /** @type {boolean} * @private */ @@ -160919,10 +160956,7 @@ Recommended fix: clearInterval(this._autoLayoutTimer); this._autoLayoutTimer = 0; } - if (this._pollingTimerId) { - clearTimeout(this._pollingTimerId); - this._pollingTimerId = 0; - } + this._pollingTimerId = _clearTimeout(this._pollingTimerId); this.removeAllColumns(); // Some conflators are reset this.removeAllRows(); // Some conflators are reset this._sorter.dispose(); @@ -160943,9 +160977,8 @@ Recommended fix: this._subs = null; } if (this._focusingArgs) { - if (this._focusingArgs.id) { - clearTimeout(this._focusingArgs.id); - } + _clearTimeout(this._focusingArgs.id); + _clearTimeout(this._focusingArgs.timeoutId); this._focusingArgs = null; } }; @@ -161229,6 +161262,7 @@ Recommended fix: this.addListener(gridOption, "beforeContentBinding"); this.addListener(gridOption, "firstRendered"); this.addListener(gridOption, "afterContentBinding"); + this.addListener(gridOption, "tabNavigation"); if (gridOption["autoDateConversion"]) { t._autoDateConversion = true; } @@ -164273,6 +164307,8 @@ Recommended fix: /** @public * @description Replace existing row by a new row. Row Id is always changed, after the row is replaced. + * If the rowId of the new row is identical to that of the replacing row. Grid will do nothing because + * similar rowIds indicate that they are the same row. * @param {Grid~RowReference} rowRef Reference (i.e. row index, row id, or row definition) of the insert position * @param {(RowDefinition~Options|string)=} rowOption * @returns {RowDefinition} Returns null, if the row is not replaced. Otherwise, a newly created row is returned @@ -164389,38 +164425,48 @@ Recommended fix: return this._grid.getVScrollView(); }; - /** @private - * @param {Element} el - * @return {boolean} - */ - function isFocusableContent(el) { - if (el) { - return el.tagName !== "SPAN" && !el.disabled; - } - return false; - } /** @private * @param {Object} cell + * @param {Object} args * @return {boolean} */ - function focusCell(cell) { + Grid_Grid.prototype._focusCell = function (cell, args) { if (cell) { let cellContent = cell.getContent(); - if (cellContent && isFocusableContent(cellContent)) { - cellContent.focus(); - return true; + if (cellContent) { + let nfe = null; + if (this.hasListener("tabNavigation")) { + let tabNavArg = { + "shiftKey": args.shiftKey, + "activeElement": args.activeElement, + "cellContent": cellContent, + "cell": cell, + "colIndex": args.colIndex, + "rowIndex": args.rowIndex, + "field": args.fields ? args.fields[args.colIndex] : "" + }; + this._dispatch("tabNavigation", tabNavArg); + nfe = tabNavArg.nextFocusableElement; + } else if (cellContent.tagName !== "SPAN") { + nfe = cellContent; + } + if (nfe && nfe !== args.activeElement && !nfe.disabled) { + nfe.focus(); + return true; + } } } return false; - } + }; /** @private */ Grid_Grid.prototype._onVScroll = function () { let args = this._focusingArgs; if (args) { + args.timeoutId = _clearTimeout(args.timeoutId); this._focusingArgs = null; let cell = this._grid.getCell("content", args.colIndex, args.rowIndex); - if (!focusCell(cell)) { + if (!this._focusCell(cell, args)) { if (args.shiftKey) { this._focusPrevCellContent(args); } else { @@ -164431,6 +164477,11 @@ Recommended fix: }; /** @private */ + Grid_Grid.prototype._onScrollTimeout = function () { + this._focusingArgs = null; + }; + /** @private + */ Grid_Grid.prototype._selfScrollToRow = function () { let args = this._focusingArgs; if (args) { @@ -164440,19 +164491,14 @@ Recommended fix: }; /** @private * @param {Object} args - * @param {number} colIndex - * @param {number} rowIndex */ - Grid_Grid.prototype._requestScroll = function (args, colIndex, rowIndex) { - if (this._focusingArgs || this._scrolledRow === args.rowIndex) { - return; // Avoid infinite loop + Grid_Grid.prototype._requestScroll = function (args) { + if (!this._focusingArgs) { + this._focusingArgs = args; + args.event = null; // The event is invalid after the scroll + args.id = setTimeout(this._selfScrollToRow, 0); // Avoid event loop protection + args.timeoutId = setTimeout(this._onScrollTimeout, 100); // To avoid a fail case where scroll cannot be performed } - this._scrolledRow = args.rowIndex; - this._focusingArgs = args; - args.colIndex = colIndex; - args.rowIndex = rowIndex; - args.event = null; // The event is invalid after the scroll - args.id = setTimeout(this._selfScrollToRow); // Avoid event loop protection }; /** @private * @param {Object} args @@ -164475,37 +164521,34 @@ Recommended fix: startIdx = i; } } - // If the current focus is on a valid content, starts on the next cell - if (args.event && args.validContent) { - startIdx++; - } let grid = this._grid; let section = grid.getSection("content"); let viewInfo = grid.getVerticalViewInfo(); let lastFullRow = viewInfo.lastFullRow; let rowCount = this.getRowCount(); + args.fields = grid.getColumnFields(); for (let r = rowIndex; r < rowCount; r++) { + args.rowIndex = r; for (i = startIdx; i < len; i++) { let c = focusableColIndices[i]; + args.colIndex = c; if (r > lastFullRow) { - this._requestScroll(args, c, r); + _preventDefault(args.event); + this._requestScroll(args); return; } else { let cell = section.getCell(c, r); - if (focusCell(cell)) { - if (args.event) { - args.event.preventDefault(); - } + if (this._focusCell(cell, args)) { + _preventDefault(args.event); return; } } } startIdx = 0; } - if (args.validContent) { - // The current focus on the last focusable content - this._grid.getHiddenInput().focus(); - } + + // The current focus on the last focusable content + this._grid.getHiddenInput().focus(); }; /** @private * @param {Object} args @@ -164528,42 +164571,42 @@ Recommended fix: startIdx = i; } } - // If the current focus is on a valid content, starts on the next cell - if (args.event && args.validContent) { - --startIdx; - } let grid = this._grid; let section = grid.getSection("content"); let viewInfo = grid.getVerticalViewInfo(); let firstFullRow = viewInfo.firstFullRow; + args.fields = this.getColumnFields(); for (let r = rowIndex; r >= 0; r--) { + args.rowIndex = r; for (i = startIdx; i >= 0; i--) { let c = focusableColIndices[i]; + args.colIndex = c; if (r < firstFullRow) { - this._requestScroll(args, c, r); + _preventDefault(args.event); + this._requestScroll(args); return; } else { let cell = section.getCell(c, r); - if (focusCell(cell)) { - if (args.event) { - args.event.preventDefault(); - } + if (this._focusCell(cell, args)) { + _preventDefault(args.event); return; } } } startIdx = len - 1; } - if (args.validContent) { - // The current focus on the last focusable content - this._grid.getHiddenInput(true).focus(); - } + + // The current focus on the last focusable content + this._grid.getHiddenInput(true).focus(); }; /** @private * @param {Object} e */ Grid_Grid.prototype._onTabNavigation = function (e) { + if (this._focusingArgs) { + return; // Cannot do another tab navigation while waiting for scrolling + } let colDefs = this.getColumnDefinitions(); let colCount = colDefs.length; let focusableColIndices = []; @@ -164575,18 +164618,8 @@ Recommended fix: if (!focusableColIndices.length) { return; } - this._scrolledRow = -1; // Reset the scroll loop protector let keyEvt = e.event; let pos = this.getRelativePosition(keyEvt); - let validContent = true; - let activeElement = e.activeElement; - if (activeElement) { - validContent = !activeElement.classList.contains("valigner"); - } - if (validContent) { - let content = pos["cell"] ? pos["cell"].getContent() : null; - validContent = isFocusableContent(content); - } let startingRowIndex = pos["rowIndex"]; if (e.onTheEdge) { let viewInfo = this._grid.getVerticalViewInfo(); @@ -164598,7 +164631,7 @@ Recommended fix: colIndex: pos["colIndex"], rowIndex: startingRowIndex, focusableColIndices: focusableColIndices, - validContent: validContent + activeElement: e.activeElement }; if (keyEvt.shiftKey) { this._focusPrevCellContent(args); @@ -164607,6 +164640,16 @@ Recommended fix: } }; + /** @public + * @ignore + * @return {!Object} + */ + Grid_Grid.prototype._getEventHandlers = function () { + return { + "tabNavigation": this._onTabNavigation + }; + }; + /* harmony default export */ const Grid = /* unused pure expression or super */null && Grid_Grid; ; // CONCATENATED MODULE: ./public/lib/rt-grid/es6/FieldDefinition.js @@ -166787,7 +166830,7 @@ Recommended fix: ; // CONCATENATED MODULE: ./public/lib/grid/index.js window.EFX_GRID = { - version: "6.0.120" + version: "6.0.121" }; ; // CONCATENATED MODULE: ./public/lib/grid/themes/halo/dark/efx-grid.js @@ -174582,7 +174625,7 @@ Recommended fix: dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'filter-dialog', - styles: ':host{display:block}:host *{margin-bottom:0;margin-top:0}:host .compact{padding-top:8px;padding-bottom:8px}:host .compact #filterAdvancedUI,:host .compact #filterValueUI{margin-top:5px}:host .compact #filterValueUI>*+*{margin-top:4px}:host .compact .input-group ef-combo-box+ef-combo-box,:host .compact .input-group ef-combo-box+ef-datetime-picker{margin-top:10px}:host .compact .input-group ef-combo-box+div.radio-group,:host .compact .input-group ef-datetime-picker+div.radio-group{margin-top:6px}:host .compact .input-group div.radio-group+ef-combo-box{margin-top:8px}:host .compact .cancel-ok{margin-top:4px}:host .compact #separator,:host .compact .group-label{display:none}:host ef-panel{box-shadow:0 0 10px rgba(0,0,0,.5);padding-top:17px;padding-bottom:31px;display:block}:host label{line-height:18px;font-size:12px}:host hr{border-top:1px solid;margin-top:9px;margin-bottom:6px;width:100%}:host ef-radio-button{height:18px}:host #filterCoralSplitBtn,:host ef-combo-box,:host ef-input,:host ef-search-field,:host ef-datetime-picker{width:100%}:host ef-radio-group{text-align:center}:host #root_panel{display:flex;flex-direction:column}:host #filterUI{display:flex;flex-direction:column;overflow-y:hidden;flex:1}:host #dataSelector{overflow:hidden;display:flex;flex-direction:column}:host #filterAdvancedUI,:host #filterValueUI{margin-top:19px;display:flex;flex-direction:column;flex:1;overflow:auto}:host #filterValueUI>*+*{margin-top:19px}:host #filterDialogContent{width:243px;display:flex;flex-direction:column;overflow:hidden;flex:1}:host #dataFilter{flex:0 0 auto}:host .group-block>*+*{margin-top:4px}:host .group-block label{display:block}:host .group-filter{overflow:hidden;display:flex;flex-direction:column;flex:1}:host .input-group ef-combo-box+ef-combo-box,:host .input-group ef-combo-box+ef-datetime-picker{margin-top:19px}:host .input-group ef-radio-button+ef-radio-button{margin-left:6px}:host .input-group ef-combo-box+div.radio-group,:host .input-group ef-datetime-picker+div.radio-group{margin-top:13px}:host .input-group div.radio-group+ef-combo-box{margin-top:16px}:host .cancel-ok{text-align:right;margin-top:31px}:host .cancel-ok #cancel_btn{margin-left:12px}:host .cancel-ok #clear_btn{float:left}:host .hide{display:none!important}ef-button-bar ef-button{width:50%}#filterDialogContent.no-filter-ui{width:134px}' + styles: ':host{display:block}:host *{margin-bottom:0;margin-top:0}:host .compact{padding-top:8px;padding-bottom:8px}:host .compact #filterAdvancedUI,:host .compact #filterValueUI{margin-top:5px}:host .compact #filterValueUI>*+*{margin-top:4px}:host .compact .input-group ef-combo-box+ef-combo-box,:host .compact .input-group ef-combo-box+ef-datetime-picker{margin-top:10px}:host .compact .input-group ef-combo-box+div.radio-group,:host .compact .input-group ef-datetime-picker+div.radio-group{margin-top:6px}:host .compact .input-group div.radio-group+ef-combo-box{margin-top:8px}:host .compact .cancel-ok{margin-top:4px}:host .compact #separator,:host .compact .group-label{display:none}:host ef-panel{box-shadow:0 0 10px rgba(0,0,0,.5);padding-top:17px;padding-bottom:31px;display:block}:host label{line-height:18px;font-size:12px}:host hr{border-top:1px solid;margin-top:9px;margin-bottom:6px;width:100%}:host ef-radio-button{height:18px}:host #filterCoralSplitBtn,:host ef-input,:host ef-search-field,:host ef-datetime-picker{width:100%}:host ef-combo-box{width:calc(100% - 1px)}:host ef-radio-group{text-align:center}:host #root_panel{display:flex;flex-direction:column}:host #filterUI{display:flex;flex-direction:column;overflow-y:hidden;flex:1}:host #dataSelector{overflow:hidden;display:flex;flex-direction:column}:host #filterAdvancedUI,:host #filterValueUI{margin-top:18px;padding-top:1px;padding-bottom:1px;display:flex;flex-direction:column;flex:1;overflow:auto}:host #filterValueUI>*+*{margin-top:19px}:host #filterDialogContent{width:243px;display:flex;flex-direction:column;overflow:hidden;flex:1}:host #dataFilter{flex:0 0 auto}:host .group-block>*+*{margin-top:4px}:host .group-block label{display:block}:host .group-filter{overflow:hidden;display:flex;flex-direction:column;flex:1}:host .input-group ef-combo-box+ef-combo-box,:host .input-group ef-combo-box+ef-datetime-picker{margin-top:19px}:host .input-group ef-radio-button+ef-radio-button{margin-left:6px}:host .input-group ef-combo-box+div.radio-group,:host .input-group ef-datetime-picker+div.radio-group{margin-top:13px}:host .input-group div.radio-group+ef-combo-box{margin-top:16px}:host .cancel-ok{text-align:right;margin-top:30px}:host .cancel-ok #cancel_btn{margin-left:12px}:host .cancel-ok #clear_btn{float:left}:host .hide{display:none!important}ef-button-bar ef-button{width:50%}#filterDialogContent.no-filter-ui{width:134px}' } })); // CONCATENATED MODULE: ./public/lib/filter-dialog/themes/halo/dark.js diff --git a/resources/elf-halo-light.js b/resources/elf-halo-light.js index 03b0ba97..e92c4307 100644 --- a/resources/elf-halo-light.js +++ b/resources/elf-halo-light.js @@ -37008,23 +37008,26 @@ Recommended fix: }; /** @private - * @return {number} 0 does not allow dragging, 1 allows single dragging, and 2 allows multiple dragging. + * @return {number} 0 does not allow dragging, 1 allows single dragging, and 2 allows multiple dragging with row selection =. */ ColumnDraggingPlugin.prototype._getDraggingStyle = function () { let colSelExt = this._getPlugin("ColumnSelectionPlugin"); - let cgp = this._getPlugin("ColumnGroupingPlugin"); - if (!cgp) { + if (!colSelExt) { return 1; } + let cgp = this._getPlugin("ColumnGroupingPlugin"); let selectedCols = colSelExt.getSelectedColumns(); let dragOutSel = selectedCols.indexOf(this._startColumn) === -1; if (dragOutSel) { - // no column grouping, allow to drag + // drag outside selected col, drag only 1 row return 1; } let selectedColCount = selectedCols.length; if (selectedColCount > 1) { // Multiple column drag + if (!cgp) { + return 2; + } let currentGroup, prevGroup; for (let i = 0; i < selectedColCount; i++) { let colIndex = selectedCols[i]; @@ -43627,6 +43630,9 @@ Recommended fix: cell.setContent(chkbox); let sectionType = sectionSettings.getType(); + if (sectionType === "title") { + chkbox.setAttribute("aria-label", "all rows"); + } if (!this._coralCheckboxVer) { // Workaround for UIFR theme styling let lbl = document.createElement("label"); @@ -44548,6 +44554,7 @@ Recommended fix: if (!chkbox) { chkbox = checkboxes[i] = this._createCheckbox(sectionSettings, this._displayColumn, rowIndex); } + chkbox.setAttribute("aria-label", "row " + rowIndex); let rowId = dv.getRowId(rowIndex); // Slow rowData = this._getRowFromId(dv, rowId); if (hasBinding && chkbox) { @@ -59463,6 +59470,7 @@ Recommended fix: elem.className = "filter-input"; elem.style.width = "100%"; elem.style.margin = "0"; + elem.setAttribute("aria-label", "column filtering"); var placeholder = colOpt["placeholder"]; if (placeholder) { elem.setAttribute("placeholder", placeholder); @@ -126934,7 +126942,7 @@ Recommended fix: * @property {boolean=} hidden=true When this row is hidden * @property {boolean=} realTime=true Realtime row, able to request for JET/RTK * @property {Object=} info=null For storing any additional information to the row - * @property {string=} rowId Row identifier used for referencing the row + * @property {string=} rowId Row identifier used for referencing the row. The value cannot be in "_x_" format. */ /** @typedef {Object} RowDefinition~RowTypes @@ -126965,6 +126973,12 @@ Recommended fix: GROUP_MEMBER: "GROUP_MEMBER" }; + /** @type {RegExp} + * @private + * @const + */ + const ROW_ID_PATTERN = /^_[^_]+_$/; + /** @constructor * @param {RowDefinition~Options=} rowOptions */ @@ -127150,8 +127164,12 @@ Recommended fix: if (!this._autoGenerated) { let userRowId = rowOptions["rowId"]; if (userRowId && typeof userRowId === "string") { - this._rowId = this._dataId = userRowId; - this._userId = true; + if (userRowId.match(ROW_ID_PATTERN)) { + console.warn("Please change the rowId format to avoid duplicated rows' id causing unexpected behavior."); + } else { + this._rowId = this._dataId = userRowId; + this._userId = true; + } } } let extractedOptions = RowDefinition.extractRowOptions(rowOptions); @@ -127870,13 +127888,18 @@ Recommended fix: /** @public * @param {DataView} view - * @param {string=} rowId + * @param {string=} destRowId Destination position where the row will be placed BEFORE the specified position. */ - RowDefinition.prototype.registerToView = function (view, rowId) { + RowDefinition.prototype.registerToView = function (view, destRowId) { if (!view || this._view === view) { return; // Already in the view } this._view = view; + let rowId = this.getRowId(); + if (view.getRowData(rowId)) { + console.warn("Duplicated rows' id."); + return; + } let rowData = null; if (this._subSegment) { rowData = this._view.getRowData(this.getRowId()); @@ -127889,31 +127912,27 @@ Recommended fix: rowData[ROW_DEF] = this; let parentRowId = ""; let isSegment = this._isChain || this._asSegment; - if (rowId) { - parentRowId = view.getSegmentParentRowId(rowId); + if (destRowId) { + parentRowId = view.getSegmentParentRowId(destRowId); if (parentRowId) { if (isSegment) { // A chain or a segment cannot be put inside another segment - rowId = _getEndOfSegmentRowId(view, rowId); + destRowId = _getEndOfSegmentRowId(view, destRowId); } // else { // Normal row is inserted into a segment } } let stalledSorting = _stallSorting(view, isSegment, false); - let newRowId = view.insertRow(rowId, rowData, this.getRowId()); - if (newRowId !== this._rowId) { - this._rowId = newRowId; // In case there is some duplicate row id - this._userId = false; - } + view.insertRow(destRowId, rowData, rowId); if (isSegment) { - view.setSegmentSeparator(newRowId); + view.setSegmentSeparator(rowId); _stallSorting(view, false, stalledSorting); if (this._collapsed != null) { - view.collapseSegment(newRowId, this._collapsed); + view.collapseSegment(rowId, this._collapsed); this._collapsed = null; } } else if (!this._parent && parentRowId) { // Constituent cannot be added to another segment - view.addSegmentChild(parentRowId, newRowId, this._dataId); + view.addSegmentChild(parentRowId, rowId, this._dataId); } }; /** @private @@ -140373,7 +140392,8 @@ Recommended fix: column = /** @type{Column} */section.getColumn(c); column.setScrollState(paneElem, null, false); } - pane.setParent(section.getColumnHost()); + let scrollHost = section.getColumnHost(); + pane.setParent(scrollHost); let columns = []; let content = []; for (c = startColIndex; c < endColIndex; ++c) { @@ -140388,9 +140408,11 @@ Recommended fix: } let rs = section.getReservedSpace(); if (rs) { - if (!this._pinnedRightColumnCount) { + if (this.isActive() && !this._pinnedRightColumnCount) { paneSlider.addContent(rs); content.push(rs); + } else { + scrollHost.appendChild(rs); } section._updateRightSpaceStyle(); } @@ -152245,7 +152267,7 @@ Recommended fix: * @return {string} */ Core.getVersion = function () { - return "5.1.121"; + return "5.1.123"; }; /** {@link ElementWrapper#dispose} * @override @@ -155283,7 +155305,7 @@ Recommended fix: } else { if (rowIndex < firstFullRow) { // Scroll up - scrollIndex = rowIndex - 3; // Have some spaces at the top for more appealing visual + scrollIndex = rowIndex - 2; // Have some spaces at the top for more appealing visual if (scrollIndex < 0) { scrollIndex = 0; } @@ -155292,7 +155314,7 @@ Recommended fix: let lastFullRow = viewInfo.lastFullRow; if (rowIndex > lastFullRow) { let viewIndexSize = lastFullRow - firstFullRow; - scrollIndex = rowIndex - viewIndexSize + 3; + scrollIndex = rowIndex - viewIndexSize + 2; if (scrollIndex < 0) { scrollIndex = 0; } @@ -160595,11 +160617,11 @@ Recommended fix: }; /** Compare the difference in the 'id' property. - * @private - * @param {Object} obj1 - * @param {Object} obj2 - * @returns {boolean} If the id property of two objects is equal, the return will be true, otherwise it will be false. - */ + * @private + * @param {Object} obj1 + * @param {Object} obj2 + * @returns {boolean} If the id property of two objects is equal, the return will be true, otherwise it will be false. + */ let _hasMatchingId = function (obj1, obj2) { if (!obj1 || !obj2 || !obj1.id || !obj2.id) { // Handle nullable, if the object or id have null, it's means difference value @@ -160608,6 +160630,25 @@ Recommended fix: return obj1.id === obj2.id; }; + /** @private + * @param {Object} e + */ + let _preventDefault = function (e) { + if (e) { + e.preventDefault(); + } + }; + /** @private + * @param {number=} id + * @returns {number} Always return 0 + */ + let _clearTimeout = function (id) { + if (id) { + clearTimeout(id); + } + return 0; + }; + /** @constructor * @extends {EventDispatcher} * @param {(Element|null)=} placeholder @@ -160902,10 +160943,6 @@ Recommended fix: * @private */ Grid_Grid.prototype._focusingArgs = null; - /** @type {number} - * @private - */ - Grid_Grid.prototype._scrolledRow = -1; /** @type {boolean} * @private */ @@ -160919,10 +160956,7 @@ Recommended fix: clearInterval(this._autoLayoutTimer); this._autoLayoutTimer = 0; } - if (this._pollingTimerId) { - clearTimeout(this._pollingTimerId); - this._pollingTimerId = 0; - } + this._pollingTimerId = _clearTimeout(this._pollingTimerId); this.removeAllColumns(); // Some conflators are reset this.removeAllRows(); // Some conflators are reset this._sorter.dispose(); @@ -160943,9 +160977,8 @@ Recommended fix: this._subs = null; } if (this._focusingArgs) { - if (this._focusingArgs.id) { - clearTimeout(this._focusingArgs.id); - } + _clearTimeout(this._focusingArgs.id); + _clearTimeout(this._focusingArgs.timeoutId); this._focusingArgs = null; } }; @@ -161229,6 +161262,7 @@ Recommended fix: this.addListener(gridOption, "beforeContentBinding"); this.addListener(gridOption, "firstRendered"); this.addListener(gridOption, "afterContentBinding"); + this.addListener(gridOption, "tabNavigation"); if (gridOption["autoDateConversion"]) { t._autoDateConversion = true; } @@ -164273,6 +164307,8 @@ Recommended fix: /** @public * @description Replace existing row by a new row. Row Id is always changed, after the row is replaced. + * If the rowId of the new row is identical to that of the replacing row. Grid will do nothing because + * similar rowIds indicate that they are the same row. * @param {Grid~RowReference} rowRef Reference (i.e. row index, row id, or row definition) of the insert position * @param {(RowDefinition~Options|string)=} rowOption * @returns {RowDefinition} Returns null, if the row is not replaced. Otherwise, a newly created row is returned @@ -164389,38 +164425,48 @@ Recommended fix: return this._grid.getVScrollView(); }; - /** @private - * @param {Element} el - * @return {boolean} - */ - function isFocusableContent(el) { - if (el) { - return el.tagName !== "SPAN" && !el.disabled; - } - return false; - } /** @private * @param {Object} cell + * @param {Object} args * @return {boolean} */ - function focusCell(cell) { + Grid_Grid.prototype._focusCell = function (cell, args) { if (cell) { let cellContent = cell.getContent(); - if (cellContent && isFocusableContent(cellContent)) { - cellContent.focus(); - return true; + if (cellContent) { + let nfe = null; + if (this.hasListener("tabNavigation")) { + let tabNavArg = { + "shiftKey": args.shiftKey, + "activeElement": args.activeElement, + "cellContent": cellContent, + "cell": cell, + "colIndex": args.colIndex, + "rowIndex": args.rowIndex, + "field": args.fields ? args.fields[args.colIndex] : "" + }; + this._dispatch("tabNavigation", tabNavArg); + nfe = tabNavArg.nextFocusableElement; + } else if (cellContent.tagName !== "SPAN") { + nfe = cellContent; + } + if (nfe && nfe !== args.activeElement && !nfe.disabled) { + nfe.focus(); + return true; + } } } return false; - } + }; /** @private */ Grid_Grid.prototype._onVScroll = function () { let args = this._focusingArgs; if (args) { + args.timeoutId = _clearTimeout(args.timeoutId); this._focusingArgs = null; let cell = this._grid.getCell("content", args.colIndex, args.rowIndex); - if (!focusCell(cell)) { + if (!this._focusCell(cell, args)) { if (args.shiftKey) { this._focusPrevCellContent(args); } else { @@ -164431,6 +164477,11 @@ Recommended fix: }; /** @private */ + Grid_Grid.prototype._onScrollTimeout = function () { + this._focusingArgs = null; + }; + /** @private + */ Grid_Grid.prototype._selfScrollToRow = function () { let args = this._focusingArgs; if (args) { @@ -164440,19 +164491,14 @@ Recommended fix: }; /** @private * @param {Object} args - * @param {number} colIndex - * @param {number} rowIndex */ - Grid_Grid.prototype._requestScroll = function (args, colIndex, rowIndex) { - if (this._focusingArgs || this._scrolledRow === args.rowIndex) { - return; // Avoid infinite loop + Grid_Grid.prototype._requestScroll = function (args) { + if (!this._focusingArgs) { + this._focusingArgs = args; + args.event = null; // The event is invalid after the scroll + args.id = setTimeout(this._selfScrollToRow, 0); // Avoid event loop protection + args.timeoutId = setTimeout(this._onScrollTimeout, 100); // To avoid a fail case where scroll cannot be performed } - this._scrolledRow = args.rowIndex; - this._focusingArgs = args; - args.colIndex = colIndex; - args.rowIndex = rowIndex; - args.event = null; // The event is invalid after the scroll - args.id = setTimeout(this._selfScrollToRow); // Avoid event loop protection }; /** @private * @param {Object} args @@ -164475,37 +164521,34 @@ Recommended fix: startIdx = i; } } - // If the current focus is on a valid content, starts on the next cell - if (args.event && args.validContent) { - startIdx++; - } let grid = this._grid; let section = grid.getSection("content"); let viewInfo = grid.getVerticalViewInfo(); let lastFullRow = viewInfo.lastFullRow; let rowCount = this.getRowCount(); + args.fields = grid.getColumnFields(); for (let r = rowIndex; r < rowCount; r++) { + args.rowIndex = r; for (i = startIdx; i < len; i++) { let c = focusableColIndices[i]; + args.colIndex = c; if (r > lastFullRow) { - this._requestScroll(args, c, r); + _preventDefault(args.event); + this._requestScroll(args); return; } else { let cell = section.getCell(c, r); - if (focusCell(cell)) { - if (args.event) { - args.event.preventDefault(); - } + if (this._focusCell(cell, args)) { + _preventDefault(args.event); return; } } } startIdx = 0; } - if (args.validContent) { - // The current focus on the last focusable content - this._grid.getHiddenInput().focus(); - } + + // The current focus on the last focusable content + this._grid.getHiddenInput().focus(); }; /** @private * @param {Object} args @@ -164528,42 +164571,42 @@ Recommended fix: startIdx = i; } } - // If the current focus is on a valid content, starts on the next cell - if (args.event && args.validContent) { - --startIdx; - } let grid = this._grid; let section = grid.getSection("content"); let viewInfo = grid.getVerticalViewInfo(); let firstFullRow = viewInfo.firstFullRow; + args.fields = this.getColumnFields(); for (let r = rowIndex; r >= 0; r--) { + args.rowIndex = r; for (i = startIdx; i >= 0; i--) { let c = focusableColIndices[i]; + args.colIndex = c; if (r < firstFullRow) { - this._requestScroll(args, c, r); + _preventDefault(args.event); + this._requestScroll(args); return; } else { let cell = section.getCell(c, r); - if (focusCell(cell)) { - if (args.event) { - args.event.preventDefault(); - } + if (this._focusCell(cell, args)) { + _preventDefault(args.event); return; } } } startIdx = len - 1; } - if (args.validContent) { - // The current focus on the last focusable content - this._grid.getHiddenInput(true).focus(); - } + + // The current focus on the last focusable content + this._grid.getHiddenInput(true).focus(); }; /** @private * @param {Object} e */ Grid_Grid.prototype._onTabNavigation = function (e) { + if (this._focusingArgs) { + return; // Cannot do another tab navigation while waiting for scrolling + } let colDefs = this.getColumnDefinitions(); let colCount = colDefs.length; let focusableColIndices = []; @@ -164575,18 +164618,8 @@ Recommended fix: if (!focusableColIndices.length) { return; } - this._scrolledRow = -1; // Reset the scroll loop protector let keyEvt = e.event; let pos = this.getRelativePosition(keyEvt); - let validContent = true; - let activeElement = e.activeElement; - if (activeElement) { - validContent = !activeElement.classList.contains("valigner"); - } - if (validContent) { - let content = pos["cell"] ? pos["cell"].getContent() : null; - validContent = isFocusableContent(content); - } let startingRowIndex = pos["rowIndex"]; if (e.onTheEdge) { let viewInfo = this._grid.getVerticalViewInfo(); @@ -164598,7 +164631,7 @@ Recommended fix: colIndex: pos["colIndex"], rowIndex: startingRowIndex, focusableColIndices: focusableColIndices, - validContent: validContent + activeElement: e.activeElement }; if (keyEvt.shiftKey) { this._focusPrevCellContent(args); @@ -164607,6 +164640,16 @@ Recommended fix: } }; + /** @public + * @ignore + * @return {!Object} + */ + Grid_Grid.prototype._getEventHandlers = function () { + return { + "tabNavigation": this._onTabNavigation + }; + }; + /* harmony default export */ const Grid = /* unused pure expression or super */null && Grid_Grid; ; // CONCATENATED MODULE: ./public/lib/rt-grid/es6/FieldDefinition.js @@ -166787,7 +166830,7 @@ Recommended fix: ; // CONCATENATED MODULE: ./public/lib/grid/index.js window.EFX_GRID = { - version: "6.0.120" + version: "6.0.121" }; ; // CONCATENATED MODULE: ./public/lib/grid/themes/halo/light/efx-grid.js @@ -174582,7 +174625,7 @@ Recommended fix: dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'filter-dialog', - styles: ':host{display:block}:host *{margin-bottom:0;margin-top:0}:host .compact{padding-top:8px;padding-bottom:8px}:host .compact #filterAdvancedUI,:host .compact #filterValueUI{margin-top:5px}:host .compact #filterValueUI>*+*{margin-top:4px}:host .compact .input-group ef-combo-box+ef-combo-box,:host .compact .input-group ef-combo-box+ef-datetime-picker{margin-top:10px}:host .compact .input-group ef-combo-box+div.radio-group,:host .compact .input-group ef-datetime-picker+div.radio-group{margin-top:6px}:host .compact .input-group div.radio-group+ef-combo-box{margin-top:8px}:host .compact .cancel-ok{margin-top:4px}:host .compact #separator,:host .compact .group-label{display:none}:host ef-panel{box-shadow:0 0 10px rgba(0,0,0,.5);padding-top:17px;padding-bottom:31px;display:block}:host label{line-height:18px;font-size:12px}:host hr{border-top:1px solid;margin-top:9px;margin-bottom:6px;width:100%}:host ef-radio-button{height:18px}:host #filterCoralSplitBtn,:host ef-combo-box,:host ef-input,:host ef-search-field,:host ef-datetime-picker{width:100%}:host ef-radio-group{text-align:center}:host #root_panel{display:flex;flex-direction:column}:host #filterUI{display:flex;flex-direction:column;overflow-y:hidden;flex:1}:host #dataSelector{overflow:hidden;display:flex;flex-direction:column}:host #filterAdvancedUI,:host #filterValueUI{margin-top:19px;display:flex;flex-direction:column;flex:1;overflow:auto}:host #filterValueUI>*+*{margin-top:19px}:host #filterDialogContent{width:243px;display:flex;flex-direction:column;overflow:hidden;flex:1}:host #dataFilter{flex:0 0 auto}:host .group-block>*+*{margin-top:4px}:host .group-block label{display:block}:host .group-filter{overflow:hidden;display:flex;flex-direction:column;flex:1}:host .input-group ef-combo-box+ef-combo-box,:host .input-group ef-combo-box+ef-datetime-picker{margin-top:19px}:host .input-group ef-radio-button+ef-radio-button{margin-left:6px}:host .input-group ef-combo-box+div.radio-group,:host .input-group ef-datetime-picker+div.radio-group{margin-top:13px}:host .input-group div.radio-group+ef-combo-box{margin-top:16px}:host .cancel-ok{text-align:right;margin-top:31px}:host .cancel-ok #cancel_btn{margin-left:12px}:host .cancel-ok #clear_btn{float:left}:host .hide{display:none!important}ef-button-bar ef-button{width:50%}#filterDialogContent.no-filter-ui{width:134px}' + styles: ':host{display:block}:host *{margin-bottom:0;margin-top:0}:host .compact{padding-top:8px;padding-bottom:8px}:host .compact #filterAdvancedUI,:host .compact #filterValueUI{margin-top:5px}:host .compact #filterValueUI>*+*{margin-top:4px}:host .compact .input-group ef-combo-box+ef-combo-box,:host .compact .input-group ef-combo-box+ef-datetime-picker{margin-top:10px}:host .compact .input-group ef-combo-box+div.radio-group,:host .compact .input-group ef-datetime-picker+div.radio-group{margin-top:6px}:host .compact .input-group div.radio-group+ef-combo-box{margin-top:8px}:host .compact .cancel-ok{margin-top:4px}:host .compact #separator,:host .compact .group-label{display:none}:host ef-panel{box-shadow:0 0 10px rgba(0,0,0,.5);padding-top:17px;padding-bottom:31px;display:block}:host label{line-height:18px;font-size:12px}:host hr{border-top:1px solid;margin-top:9px;margin-bottom:6px;width:100%}:host ef-radio-button{height:18px}:host #filterCoralSplitBtn,:host ef-input,:host ef-search-field,:host ef-datetime-picker{width:100%}:host ef-combo-box{width:calc(100% - 1px)}:host ef-radio-group{text-align:center}:host #root_panel{display:flex;flex-direction:column}:host #filterUI{display:flex;flex-direction:column;overflow-y:hidden;flex:1}:host #dataSelector{overflow:hidden;display:flex;flex-direction:column}:host #filterAdvancedUI,:host #filterValueUI{margin-top:18px;padding-top:1px;padding-bottom:1px;display:flex;flex-direction:column;flex:1;overflow:auto}:host #filterValueUI>*+*{margin-top:19px}:host #filterDialogContent{width:243px;display:flex;flex-direction:column;overflow:hidden;flex:1}:host #dataFilter{flex:0 0 auto}:host .group-block>*+*{margin-top:4px}:host .group-block label{display:block}:host .group-filter{overflow:hidden;display:flex;flex-direction:column;flex:1}:host .input-group ef-combo-box+ef-combo-box,:host .input-group ef-combo-box+ef-datetime-picker{margin-top:19px}:host .input-group ef-radio-button+ef-radio-button{margin-left:6px}:host .input-group ef-combo-box+div.radio-group,:host .input-group ef-datetime-picker+div.radio-group{margin-top:13px}:host .input-group div.radio-group+ef-combo-box{margin-top:16px}:host .cancel-ok{text-align:right;margin-top:30px}:host .cancel-ok #cancel_btn{margin-left:12px}:host .cancel-ok #clear_btn{float:left}:host .hide{display:none!important}ef-button-bar ef-button{width:50%}#filterDialogContent.no-filter-ui{width:134px}' } })); // CONCATENATED MODULE: ./public/lib/filter-dialog/themes/halo/light.js