Socket
Socket
Sign inDemoInstall

@ag-grid-enterprise/rich-select

Package Overview
Dependencies
2
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 26.0.0 to 26.1.0

1

dist/cjs/richSelect/richSelectCellEditor.d.ts

@@ -17,2 +17,3 @@ import { ICellEditor, IRichCellEditorParams, PopupComponent } from "@ag-grid-community/core";

private onKeyDown;
private confirmSelection;
private onEnterKeyDown;

@@ -19,0 +20,0 @@ private onNavigationKeyPressed;

@@ -73,2 +73,5 @@ "use strict";

break;
case core_1.KeyCode.TAB:
this.confirmSelection();
break;
case core_1.KeyCode.DOWN:

@@ -82,4 +85,7 @@ case core_1.KeyCode.UP:

};
RichSelectCellEditor.prototype.confirmSelection = function () {
this.selectionConfirmed = true;
};
RichSelectCellEditor.prototype.onEnterKeyDown = function () {
this.selectionConfirmed = true;
this.confirmSelection();
this.params.stopEditing();

@@ -116,2 +122,3 @@ };

RichSelectCellEditor.prototype.runSearch = function () {
var _this = this;
var values = this.params.values;

@@ -123,3 +130,15 @@ var searchStrings;

if (typeof values[0] === 'object' && this.params.colDef.keyCreator) {
searchStrings = values.map(this.params.colDef.keyCreator);
searchStrings = values.map(function (value) {
var keyParams = {
value: value,
colDef: _this.params.colDef,
column: _this.params.column,
node: _this.params.node,
data: _this.params.data,
api: _this.gridOptionsWrapper.getApi(),
columnApi: _this.gridOptionsWrapper.getColumnApi(),
context: _this.gridOptionsWrapper.getContext()
};
return _this.params.colDef.keyCreator(keyParams);
});
}

@@ -196,3 +215,3 @@ if (!searchStrings) {

RichSelectCellEditor.prototype.onClick = function () {
this.selectionConfirmed = true;
this.confirmSelection();
this.params.stopEditing();

@@ -199,0 +218,0 @@ };

@@ -17,2 +17,3 @@ import { ICellEditor, IRichCellEditorParams, PopupComponent } from "@ag-grid-community/core";

private onKeyDown;
private confirmSelection;
private onEnterKeyDown;

@@ -19,0 +20,0 @@ private onNavigationKeyPressed;

@@ -71,2 +71,5 @@ var __extends = (this && this.__extends) || (function () {

break;
case KeyCode.TAB:
this.confirmSelection();
break;
case KeyCode.DOWN:

@@ -80,4 +83,7 @@ case KeyCode.UP:

};
RichSelectCellEditor.prototype.confirmSelection = function () {
this.selectionConfirmed = true;
};
RichSelectCellEditor.prototype.onEnterKeyDown = function () {
this.selectionConfirmed = true;
this.confirmSelection();
this.params.stopEditing();

@@ -114,2 +120,3 @@ };

RichSelectCellEditor.prototype.runSearch = function () {
var _this = this;
var values = this.params.values;

@@ -121,3 +128,15 @@ var searchStrings;

if (typeof values[0] === 'object' && this.params.colDef.keyCreator) {
searchStrings = values.map(this.params.colDef.keyCreator);
searchStrings = values.map(function (value) {
var keyParams = {
value: value,
colDef: _this.params.colDef,
column: _this.params.column,
node: _this.params.node,
data: _this.params.data,
api: _this.gridOptionsWrapper.getApi(),
columnApi: _this.gridOptionsWrapper.getColumnApi(),
context: _this.gridOptionsWrapper.getContext()
};
return _this.params.colDef.keyCreator(keyParams);
});
}

@@ -194,3 +213,3 @@ if (!searchStrings) {

RichSelectCellEditor.prototype.onClick = function () {
this.selectionConfirmed = true;
this.confirmSelection();
this.params.stopEditing();

@@ -197,0 +216,0 @@ };

/**
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0
* @link http://www.ag-grid.com/

@@ -159,2 +159,5 @@ ' * @license Commercial

break;
case core.KeyCode.TAB:
this.confirmSelection();
break;
case core.KeyCode.DOWN:

@@ -168,4 +171,7 @@ case core.KeyCode.UP:

};
RichSelectCellEditor.prototype.confirmSelection = function () {
this.selectionConfirmed = true;
};
RichSelectCellEditor.prototype.onEnterKeyDown = function () {
this.selectionConfirmed = true;
this.confirmSelection();
this.params.stopEditing();

@@ -202,2 +208,3 @@ };

RichSelectCellEditor.prototype.runSearch = function () {
var _this = this;
var values = this.params.values;

@@ -209,3 +216,15 @@ var searchStrings;

if (typeof values[0] === 'object' && this.params.colDef.keyCreator) {
searchStrings = values.map(this.params.colDef.keyCreator);
searchStrings = values.map(function (value) {
var keyParams = {
value: value,
colDef: _this.params.colDef,
column: _this.params.column,
node: _this.params.node,
data: _this.params.data,
api: _this.gridOptionsWrapper.getApi(),
columnApi: _this.gridOptionsWrapper.getColumnApi(),
context: _this.gridOptionsWrapper.getContext()
};
return _this.params.colDef.keyCreator(keyParams);
});
}

@@ -282,3 +301,3 @@ if (!searchStrings) {

RichSelectCellEditor.prototype.onClick = function () {
this.selectionConfirmed = true;
this.confirmSelection();
this.params.stopEditing();

@@ -285,0 +304,0 @@ };

6

dist/rich-select.cjs.min.js
/**
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0
* @link http://www.ag-grid.com/

@@ -8,6 +8,6 @@ ' * @license Commercial

/**
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0
* @link http://www.ag-grid.com/
' * @license Commercial
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@ag-grid-community/core"),i=require("@ag-grid-enterprise/core"),r=(e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)},function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}),o=function(e,t,i,r){var o,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(s<3?o(n):s>3?o(t,i,n):o(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n},s=function(e){function i(t){var i=e.call(this,'<div class="ag-rich-select-row"></div>')||this;return i.params=t,i}return r(i,e),i.prototype.setState=function(e,i,r){this.populateWithRenderer(e,i)||this.populateWithoutRenderer(e,i),t._.addOrRemoveCssClass(this.getGui(),"ag-rich-select-row-selected",r)},i.prototype.populateWithoutRenderer=function(e,i){var r=null!=i?i:e;t._.exists(r)&&""!==r?this.getGui().textContent=r.toString():this.getGui().innerHTML="&nbsp;"},i.prototype.populateWithRenderer=function(e,i){var r=this,o={value:e,valueFormatted:i,api:this.gridOptionsWrapper.getApi()},s=this.userComponentFactory.newCellRenderer(this.params,o);return null!=s?t._.bindCellRendererToHtmlElement(s,this.getGui()):this.getGui().innerText=null!=o.valueFormatted?o.valueFormatted:o.value,!!s&&(s.then((function(e){r.addDestroyFunc((function(){r.getContext().destroyBean(e)}))})),!0)},o([t.Autowired("userComponentFactory")],i.prototype,"userComponentFactory",void 0),i}(t.Component),n=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),a=function(e,t,i,r){var o,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(s<3?o(n):s>3?o(t,i,n):o(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n},l=function(e){function i(){var t=e.call(this,i.TEMPLATE)||this;return t.selectionConfirmed=!1,t.searchString="",t}return n(i,e),i.prototype.init=function(e){this.params=e,this.selectedValue=e.value,this.originalSelectedValue=e.value,this.focusAfterAttached=e.cellStartedEdit;var i=t._.createIconNoSpan("smallDown",this.gridOptionsWrapper);if(t._.addCssClass(i,"ag-rich-select-value-icon"),this.eValue.appendChild(i),this.virtualList=this.getContext().createBean(new t.VirtualList("rich-select")),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),t._.exists(this.params.cellHeight)&&this.virtualList.setRowHeight(this.params.cellHeight),this.renderSelectedValue(),t._.missing(e.values))console.warn("AG Grid: richSelectCellEditor requires values for it to work");else{var r=e.values;this.virtualList.setModel({getRowCount:function(){return r.length},getRow:function(e){return r[e]}}),this.addGuiEventListener("keydown",this.onKeyDown.bind(this));var o=this.virtualList.getGui();this.addManagedListener(o,"click",this.onClick.bind(this)),this.addManagedListener(o,"mousemove",this.onMouseMove.bind(this));var s=t._.exists(e.searchDebounceDelay)?e.searchDebounceDelay:300;this.clearSearchString=t._.debounce(this.clearSearchString,s),t._.exists(e.charPress)&&this.searchText(e.charPress)}},i.prototype.onKeyDown=function(e){var i=e.keyCode;switch(e.preventDefault(),i){case t.KeyCode.ENTER:this.onEnterKeyDown();break;case t.KeyCode.DOWN:case t.KeyCode.UP:this.onNavigationKeyPressed(e,i);break;default:this.searchText(e)}},i.prototype.onEnterKeyDown=function(){this.selectionConfirmed=!0,this.params.stopEditing()},i.prototype.onNavigationKeyPressed=function(e,i){e.preventDefault();var r=this.params.values.indexOf(this.selectedValue),o=i===t.KeyCode.UP?r-1:r+1;if(o>=0&&o<this.params.values.length){var s=this.params.values[o];this.setSelectedValue(s)}},i.prototype.searchText=function(e){if("string"==typeof e)this.searchString+=e,this.runSearch(),this.clearSearchString();else{var i=e.keyCode,r=e.key;if(i===t.KeyCode.BACKSPACE)this.searchString=this.searchString.slice(0,-1),r="";else if(!t._.isEventFromPrintableCharacter(e))return;this.searchText(r)}},i.prototype.runSearch=function(){var e,i=this.params.values;if("number"!=typeof i[0]&&"string"!=typeof i[0]||(e=i.map(String)),"object"==typeof i[0]&&this.params.colDef.keyCreator&&(e=i.map(this.params.colDef.keyCreator)),e){var r=t._.fuzzySuggestions(this.searchString,e,!0,!0)[0];if(r){var o=i[e.indexOf(r)];this.setSelectedValue(o)}}},i.prototype.clearSearchString=function(){this.searchString=""},i.prototype.renderSelectedValue=function(){var e=this,i=this.params.formatValue(this.selectedValue),r=this.eValue,o={value:this.selectedValue,valueFormatted:i,api:this.gridOptionsWrapper.getApi()},s=this.userComponentFactory.newCellRenderer(this.params,o);t._.exists(s)?(t._.bindCellRendererToHtmlElement(s,r),s.then((function(t){e.addDestroyFunc((function(){return e.getContext().destroyBean(t)}))}))):t._.exists(this.selectedValue)?r.innerHTML=i:t._.clearElement(r)},i.prototype.setSelectedValue=function(e){if(this.selectedValue!==e){var t=this.params.values.indexOf(e);-1!==t&&(this.selectedValue=e,this.virtualList.ensureIndexVisible(t),this.virtualList.refresh())}},i.prototype.createRowComponent=function(e){var t=this.params.formatValue(e),i=new s(this.params);return this.getContext().createBean(i),i.setState(e,t,e===this.selectedValue),i},i.prototype.onMouseMove=function(e){var t=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),r=e.clientY-t.top+i,o=Math.floor(r/this.virtualList.getRowHeight()),s=this.params.values[o];void 0!==s&&this.setSelectedValue(s)},i.prototype.onClick=function(){this.selectionConfirmed=!0,this.params.stopEditing()},i.prototype.afterGuiAttached=function(){var e=this.params.values.indexOf(this.selectedValue);this.virtualList.refresh(),e>=0&&this.virtualList.ensureIndexVisible(e),this.virtualList.refresh(),this.focusAfterAttached&&this.getGui().focus()},i.prototype.getValue=function(){return this.selectionConfirmed?this.selectedValue:this.originalSelectedValue},i.TEMPLATE='<div class="ag-rich-select" tabindex="-1">\n <div ref="eValue" class="ag-rich-select-value"></div>\n <div ref="eList" class="ag-rich-select-list"></div>\n </div>',a([t.Autowired("userComponentFactory")],i.prototype,"userComponentFactory",void 0),a([t.RefSelector("eValue")],i.prototype,"eValue",void 0),a([t.RefSelector("eList")],i.prototype,"eList",void 0),i}(t.PopupComponent),c={moduleName:t.ModuleNames.RichSelectModule,beans:[],userComponents:[{componentName:"agRichSelect",componentClass:l},{componentName:"agRichSelectCellEditor",componentClass:l}],dependantModules:[i.EnterpriseCoreModule]};exports.RichSelectModule=c;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@ag-grid-community/core"),r=require("@ag-grid-enterprise/core"),i=(e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)},function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}),o=function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},n=function(e){function r(t){var r=e.call(this,'<div class="ag-rich-select-row"></div>')||this;return r.params=t,r}return i(r,e),r.prototype.setState=function(e,r,i){this.populateWithRenderer(e,r)||this.populateWithoutRenderer(e,r),t._.addOrRemoveCssClass(this.getGui(),"ag-rich-select-row-selected",i)},r.prototype.populateWithoutRenderer=function(e,r){var i=null!=r?r:e;t._.exists(i)&&""!==i?this.getGui().textContent=i.toString():this.getGui().innerHTML="&nbsp;"},r.prototype.populateWithRenderer=function(e,r){var i=this,o={value:e,valueFormatted:r,api:this.gridOptionsWrapper.getApi()},n=this.userComponentFactory.newCellRenderer(this.params,o);return null!=n?t._.bindCellRendererToHtmlElement(n,this.getGui()):this.getGui().innerText=null!=o.valueFormatted?o.valueFormatted:o.value,!!n&&(n.then((function(e){i.addDestroyFunc((function(){i.getContext().destroyBean(e)}))})),!0)},o([t.Autowired("userComponentFactory")],r.prototype,"userComponentFactory",void 0),r}(t.Component),s=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),a=function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},c=function(e){function r(){var t=e.call(this,r.TEMPLATE)||this;return t.selectionConfirmed=!1,t.searchString="",t}return s(r,e),r.prototype.init=function(e){this.params=e,this.selectedValue=e.value,this.originalSelectedValue=e.value,this.focusAfterAttached=e.cellStartedEdit;var r=t._.createIconNoSpan("smallDown",this.gridOptionsWrapper);if(t._.addCssClass(r,"ag-rich-select-value-icon"),this.eValue.appendChild(r),this.virtualList=this.getContext().createBean(new t.VirtualList("rich-select")),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),t._.exists(this.params.cellHeight)&&this.virtualList.setRowHeight(this.params.cellHeight),this.renderSelectedValue(),t._.missing(e.values))console.warn("AG Grid: richSelectCellEditor requires values for it to work");else{var i=e.values;this.virtualList.setModel({getRowCount:function(){return i.length},getRow:function(e){return i[e]}}),this.addGuiEventListener("keydown",this.onKeyDown.bind(this));var o=this.virtualList.getGui();this.addManagedListener(o,"click",this.onClick.bind(this)),this.addManagedListener(o,"mousemove",this.onMouseMove.bind(this));var n=t._.exists(e.searchDebounceDelay)?e.searchDebounceDelay:300;this.clearSearchString=t._.debounce(this.clearSearchString,n),t._.exists(e.charPress)&&this.searchText(e.charPress)}},r.prototype.onKeyDown=function(e){var r=e.keyCode;switch(e.preventDefault(),r){case t.KeyCode.ENTER:this.onEnterKeyDown();break;case t.KeyCode.TAB:this.confirmSelection();break;case t.KeyCode.DOWN:case t.KeyCode.UP:this.onNavigationKeyPressed(e,r);break;default:this.searchText(e)}},r.prototype.confirmSelection=function(){this.selectionConfirmed=!0},r.prototype.onEnterKeyDown=function(){this.confirmSelection(),this.params.stopEditing()},r.prototype.onNavigationKeyPressed=function(e,r){e.preventDefault();var i=this.params.values.indexOf(this.selectedValue),o=r===t.KeyCode.UP?i-1:i+1;if(o>=0&&o<this.params.values.length){var n=this.params.values[o];this.setSelectedValue(n)}},r.prototype.searchText=function(e){if("string"==typeof e)this.searchString+=e,this.runSearch(),this.clearSearchString();else{var r=e.keyCode,i=e.key;if(r===t.KeyCode.BACKSPACE)this.searchString=this.searchString.slice(0,-1),i="";else if(!t._.isEventFromPrintableCharacter(e))return;this.searchText(i)}},r.prototype.runSearch=function(){var e,r=this,i=this.params.values;if("number"!=typeof i[0]&&"string"!=typeof i[0]||(e=i.map(String)),"object"==typeof i[0]&&this.params.colDef.keyCreator&&(e=i.map((function(e){var t={value:e,colDef:r.params.colDef,column:r.params.column,node:r.params.node,data:r.params.data,api:r.gridOptionsWrapper.getApi(),columnApi:r.gridOptionsWrapper.getColumnApi(),context:r.gridOptionsWrapper.getContext()};return r.params.colDef.keyCreator(t)}))),e){var o=t._.fuzzySuggestions(this.searchString,e,!0,!0)[0];if(o){var n=i[e.indexOf(o)];this.setSelectedValue(n)}}},r.prototype.clearSearchString=function(){this.searchString=""},r.prototype.renderSelectedValue=function(){var e=this,r=this.params.formatValue(this.selectedValue),i=this.eValue,o={value:this.selectedValue,valueFormatted:r,api:this.gridOptionsWrapper.getApi()},n=this.userComponentFactory.newCellRenderer(this.params,o);t._.exists(n)?(t._.bindCellRendererToHtmlElement(n,i),n.then((function(t){e.addDestroyFunc((function(){return e.getContext().destroyBean(t)}))}))):t._.exists(this.selectedValue)?i.innerHTML=r:t._.clearElement(i)},r.prototype.setSelectedValue=function(e){if(this.selectedValue!==e){var t=this.params.values.indexOf(e);-1!==t&&(this.selectedValue=e,this.virtualList.ensureIndexVisible(t),this.virtualList.refresh())}},r.prototype.createRowComponent=function(e){var t=this.params.formatValue(e),r=new n(this.params);return this.getContext().createBean(r),r.setState(e,t,e===this.selectedValue),r},r.prototype.onMouseMove=function(e){var t=this.virtualList.getGui().getBoundingClientRect(),r=this.virtualList.getScrollTop(),i=e.clientY-t.top+r,o=Math.floor(i/this.virtualList.getRowHeight()),n=this.params.values[o];void 0!==n&&this.setSelectedValue(n)},r.prototype.onClick=function(){this.confirmSelection(),this.params.stopEditing()},r.prototype.afterGuiAttached=function(){var e=this.params.values.indexOf(this.selectedValue);this.virtualList.refresh(),e>=0&&this.virtualList.ensureIndexVisible(e),this.virtualList.refresh(),this.focusAfterAttached&&this.getGui().focus()},r.prototype.getValue=function(){return this.selectionConfirmed?this.selectedValue:this.originalSelectedValue},r.TEMPLATE='<div class="ag-rich-select" tabindex="-1">\n <div ref="eValue" class="ag-rich-select-value"></div>\n <div ref="eList" class="ag-rich-select-list"></div>\n </div>',a([t.Autowired("userComponentFactory")],r.prototype,"userComponentFactory",void 0),a([t.RefSelector("eValue")],r.prototype,"eValue",void 0),a([t.RefSelector("eList")],r.prototype,"eList",void 0),r}(t.PopupComponent),l={moduleName:t.ModuleNames.RichSelectModule,beans:[],userComponents:[{componentName:"agRichSelect",componentClass:c},{componentName:"agRichSelectCellEditor",componentClass:c}],dependantModules:[r.EnterpriseCoreModule]};exports.RichSelectModule=l;
/**
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0
* @link http://www.ag-grid.com/

@@ -155,2 +155,5 @@ ' * @license Commercial

break;
case KeyCode.TAB:
this.confirmSelection();
break;
case KeyCode.DOWN:

@@ -164,4 +167,7 @@ case KeyCode.UP:

};
RichSelectCellEditor.prototype.confirmSelection = function () {
this.selectionConfirmed = true;
};
RichSelectCellEditor.prototype.onEnterKeyDown = function () {
this.selectionConfirmed = true;
this.confirmSelection();
this.params.stopEditing();

@@ -198,2 +204,3 @@ };

RichSelectCellEditor.prototype.runSearch = function () {
var _this = this;
var values = this.params.values;

@@ -205,3 +212,15 @@ var searchStrings;

if (typeof values[0] === 'object' && this.params.colDef.keyCreator) {
searchStrings = values.map(this.params.colDef.keyCreator);
searchStrings = values.map(function (value) {
var keyParams = {
value: value,
colDef: _this.params.colDef,
column: _this.params.column,
node: _this.params.node,
data: _this.params.data,
api: _this.gridOptionsWrapper.getApi(),
columnApi: _this.gridOptionsWrapper.getColumnApi(),
context: _this.gridOptionsWrapper.getContext()
};
return _this.params.colDef.keyCreator(keyParams);
});
}

@@ -278,3 +297,3 @@ if (!searchStrings) {

RichSelectCellEditor.prototype.onClick = function () {
this.selectionConfirmed = true;
this.confirmSelection();
this.params.stopEditing();

@@ -281,0 +300,0 @@ };

/**
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0
* @link http://www.ag-grid.com/

@@ -8,6 +8,6 @@ ' * @license Commercial

/**
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0
* @ag-grid-enterprise/rich-select - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0
* @link http://www.ag-grid.com/
' * @license Commercial
*/
import{_ as e,Autowired as t,Component as i,VirtualList as r,KeyCode as s,RefSelector as n,PopupComponent as o,ModuleNames as a}from"@ag-grid-community/core";import{EnterpriseCoreModule as l}from"@ag-grid-enterprise/core";var c,u=(c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),h=function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},p=function(i){function r(e){var t=i.call(this,'<div class="ag-rich-select-row"></div>')||this;return t.params=e,t}return u(r,i),r.prototype.setState=function(t,i,r){this.populateWithRenderer(t,i)||this.populateWithoutRenderer(t,i),e.addOrRemoveCssClass(this.getGui(),"ag-rich-select-row-selected",r)},r.prototype.populateWithoutRenderer=function(t,i){var r=null!=i?i:t;e.exists(r)&&""!==r?this.getGui().textContent=r.toString():this.getGui().innerHTML="&nbsp;"},r.prototype.populateWithRenderer=function(t,i){var r=this,s={value:t,valueFormatted:i,api:this.gridOptionsWrapper.getApi()},n=this.userComponentFactory.newCellRenderer(this.params,s);return null!=n?e.bindCellRendererToHtmlElement(n,this.getGui()):this.getGui().innerText=null!=s.valueFormatted?s.valueFormatted:s.value,!!n&&(n.then((function(e){r.addDestroyFunc((function(){r.getContext().destroyBean(e)}))})),!0)},h([t("userComponentFactory")],r.prototype,"userComponentFactory",void 0),r}(i),d=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),f=function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},v=function(i){function o(){var e=i.call(this,o.TEMPLATE)||this;return e.selectionConfirmed=!1,e.searchString="",e}return d(o,i),o.prototype.init=function(t){this.params=t,this.selectedValue=t.value,this.originalSelectedValue=t.value,this.focusAfterAttached=t.cellStartedEdit;var i=e.createIconNoSpan("smallDown",this.gridOptionsWrapper);if(e.addCssClass(i,"ag-rich-select-value-icon"),this.eValue.appendChild(i),this.virtualList=this.getContext().createBean(new r("rich-select")),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),e.exists(this.params.cellHeight)&&this.virtualList.setRowHeight(this.params.cellHeight),this.renderSelectedValue(),e.missing(t.values))console.warn("AG Grid: richSelectCellEditor requires values for it to work");else{var s=t.values;this.virtualList.setModel({getRowCount:function(){return s.length},getRow:function(e){return s[e]}}),this.addGuiEventListener("keydown",this.onKeyDown.bind(this));var n=this.virtualList.getGui();this.addManagedListener(n,"click",this.onClick.bind(this)),this.addManagedListener(n,"mousemove",this.onMouseMove.bind(this));var o=e.exists(t.searchDebounceDelay)?t.searchDebounceDelay:300;this.clearSearchString=e.debounce(this.clearSearchString,o),e.exists(t.charPress)&&this.searchText(t.charPress)}},o.prototype.onKeyDown=function(e){var t=e.keyCode;switch(e.preventDefault(),t){case s.ENTER:this.onEnterKeyDown();break;case s.DOWN:case s.UP:this.onNavigationKeyPressed(e,t);break;default:this.searchText(e)}},o.prototype.onEnterKeyDown=function(){this.selectionConfirmed=!0,this.params.stopEditing()},o.prototype.onNavigationKeyPressed=function(e,t){e.preventDefault();var i=this.params.values.indexOf(this.selectedValue),r=t===s.UP?i-1:i+1;if(r>=0&&r<this.params.values.length){var n=this.params.values[r];this.setSelectedValue(n)}},o.prototype.searchText=function(t){if("string"==typeof t)this.searchString+=t,this.runSearch(),this.clearSearchString();else{var i=t.keyCode,r=t.key;if(i===s.BACKSPACE)this.searchString=this.searchString.slice(0,-1),r="";else if(!e.isEventFromPrintableCharacter(t))return;this.searchText(r)}},o.prototype.runSearch=function(){var t,i=this.params.values;if("number"!=typeof i[0]&&"string"!=typeof i[0]||(t=i.map(String)),"object"==typeof i[0]&&this.params.colDef.keyCreator&&(t=i.map(this.params.colDef.keyCreator)),t){var r=e.fuzzySuggestions(this.searchString,t,!0,!0)[0];if(r){var s=i[t.indexOf(r)];this.setSelectedValue(s)}}},o.prototype.clearSearchString=function(){this.searchString=""},o.prototype.renderSelectedValue=function(){var t=this,i=this.params.formatValue(this.selectedValue),r=this.eValue,s={value:this.selectedValue,valueFormatted:i,api:this.gridOptionsWrapper.getApi()},n=this.userComponentFactory.newCellRenderer(this.params,s);e.exists(n)?(e.bindCellRendererToHtmlElement(n,r),n.then((function(e){t.addDestroyFunc((function(){return t.getContext().destroyBean(e)}))}))):e.exists(this.selectedValue)?r.innerHTML=i:e.clearElement(r)},o.prototype.setSelectedValue=function(e){if(this.selectedValue!==e){var t=this.params.values.indexOf(e);-1!==t&&(this.selectedValue=e,this.virtualList.ensureIndexVisible(t),this.virtualList.refresh())}},o.prototype.createRowComponent=function(e){var t=this.params.formatValue(e),i=new p(this.params);return this.getContext().createBean(i),i.setState(e,t,e===this.selectedValue),i},o.prototype.onMouseMove=function(e){var t=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),r=e.clientY-t.top+i,s=Math.floor(r/this.virtualList.getRowHeight()),n=this.params.values[s];void 0!==n&&this.setSelectedValue(n)},o.prototype.onClick=function(){this.selectionConfirmed=!0,this.params.stopEditing()},o.prototype.afterGuiAttached=function(){var e=this.params.values.indexOf(this.selectedValue);this.virtualList.refresh(),e>=0&&this.virtualList.ensureIndexVisible(e),this.virtualList.refresh(),this.focusAfterAttached&&this.getGui().focus()},o.prototype.getValue=function(){return this.selectionConfirmed?this.selectedValue:this.originalSelectedValue},o.TEMPLATE='<div class="ag-rich-select" tabindex="-1">\n <div ref="eValue" class="ag-rich-select-value"></div>\n <div ref="eList" class="ag-rich-select-list"></div>\n </div>',f([t("userComponentFactory")],o.prototype,"userComponentFactory",void 0),f([n("eValue")],o.prototype,"eValue",void 0),f([n("eList")],o.prototype,"eList",void 0),o}(o),g={moduleName:a.RichSelectModule,beans:[],userComponents:[{componentName:"agRichSelect",componentClass:v},{componentName:"agRichSelectCellEditor",componentClass:v}],dependantModules:[l]};export{g as RichSelectModule};
import{_ as e,Autowired as t,Component as i,VirtualList as r,KeyCode as n,RefSelector as o,PopupComponent as s,ModuleNames as a}from"@ag-grid-community/core";import{EnterpriseCoreModule as c}from"@ag-grid-enterprise/core";var l,u=(l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),p=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},h=function(i){function r(e){var t=i.call(this,'<div class="ag-rich-select-row"></div>')||this;return t.params=e,t}return u(r,i),r.prototype.setState=function(t,i,r){this.populateWithRenderer(t,i)||this.populateWithoutRenderer(t,i),e.addOrRemoveCssClass(this.getGui(),"ag-rich-select-row-selected",r)},r.prototype.populateWithoutRenderer=function(t,i){var r=null!=i?i:t;e.exists(r)&&""!==r?this.getGui().textContent=r.toString():this.getGui().innerHTML="&nbsp;"},r.prototype.populateWithRenderer=function(t,i){var r=this,n={value:t,valueFormatted:i,api:this.gridOptionsWrapper.getApi()},o=this.userComponentFactory.newCellRenderer(this.params,n);return null!=o?e.bindCellRendererToHtmlElement(o,this.getGui()):this.getGui().innerText=null!=n.valueFormatted?n.valueFormatted:n.value,!!o&&(o.then((function(e){r.addDestroyFunc((function(){r.getContext().destroyBean(e)}))})),!0)},p([t("userComponentFactory")],r.prototype,"userComponentFactory",void 0),r}(i),d=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),f=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},v=function(i){function s(){var e=i.call(this,s.TEMPLATE)||this;return e.selectionConfirmed=!1,e.searchString="",e}return d(s,i),s.prototype.init=function(t){this.params=t,this.selectedValue=t.value,this.originalSelectedValue=t.value,this.focusAfterAttached=t.cellStartedEdit;var i=e.createIconNoSpan("smallDown",this.gridOptionsWrapper);if(e.addCssClass(i,"ag-rich-select-value-icon"),this.eValue.appendChild(i),this.virtualList=this.getContext().createBean(new r("rich-select")),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),e.exists(this.params.cellHeight)&&this.virtualList.setRowHeight(this.params.cellHeight),this.renderSelectedValue(),e.missing(t.values))console.warn("AG Grid: richSelectCellEditor requires values for it to work");else{var n=t.values;this.virtualList.setModel({getRowCount:function(){return n.length},getRow:function(e){return n[e]}}),this.addGuiEventListener("keydown",this.onKeyDown.bind(this));var o=this.virtualList.getGui();this.addManagedListener(o,"click",this.onClick.bind(this)),this.addManagedListener(o,"mousemove",this.onMouseMove.bind(this));var s=e.exists(t.searchDebounceDelay)?t.searchDebounceDelay:300;this.clearSearchString=e.debounce(this.clearSearchString,s),e.exists(t.charPress)&&this.searchText(t.charPress)}},s.prototype.onKeyDown=function(e){var t=e.keyCode;switch(e.preventDefault(),t){case n.ENTER:this.onEnterKeyDown();break;case n.TAB:this.confirmSelection();break;case n.DOWN:case n.UP:this.onNavigationKeyPressed(e,t);break;default:this.searchText(e)}},s.prototype.confirmSelection=function(){this.selectionConfirmed=!0},s.prototype.onEnterKeyDown=function(){this.confirmSelection(),this.params.stopEditing()},s.prototype.onNavigationKeyPressed=function(e,t){e.preventDefault();var i=this.params.values.indexOf(this.selectedValue),r=t===n.UP?i-1:i+1;if(r>=0&&r<this.params.values.length){var o=this.params.values[r];this.setSelectedValue(o)}},s.prototype.searchText=function(t){if("string"==typeof t)this.searchString+=t,this.runSearch(),this.clearSearchString();else{var i=t.keyCode,r=t.key;if(i===n.BACKSPACE)this.searchString=this.searchString.slice(0,-1),r="";else if(!e.isEventFromPrintableCharacter(t))return;this.searchText(r)}},s.prototype.runSearch=function(){var t,i=this,r=this.params.values;if("number"!=typeof r[0]&&"string"!=typeof r[0]||(t=r.map(String)),"object"==typeof r[0]&&this.params.colDef.keyCreator&&(t=r.map((function(e){var t={value:e,colDef:i.params.colDef,column:i.params.column,node:i.params.node,data:i.params.data,api:i.gridOptionsWrapper.getApi(),columnApi:i.gridOptionsWrapper.getColumnApi(),context:i.gridOptionsWrapper.getContext()};return i.params.colDef.keyCreator(t)}))),t){var n=e.fuzzySuggestions(this.searchString,t,!0,!0)[0];if(n){var o=r[t.indexOf(n)];this.setSelectedValue(o)}}},s.prototype.clearSearchString=function(){this.searchString=""},s.prototype.renderSelectedValue=function(){var t=this,i=this.params.formatValue(this.selectedValue),r=this.eValue,n={value:this.selectedValue,valueFormatted:i,api:this.gridOptionsWrapper.getApi()},o=this.userComponentFactory.newCellRenderer(this.params,n);e.exists(o)?(e.bindCellRendererToHtmlElement(o,r),o.then((function(e){t.addDestroyFunc((function(){return t.getContext().destroyBean(e)}))}))):e.exists(this.selectedValue)?r.innerHTML=i:e.clearElement(r)},s.prototype.setSelectedValue=function(e){if(this.selectedValue!==e){var t=this.params.values.indexOf(e);-1!==t&&(this.selectedValue=e,this.virtualList.ensureIndexVisible(t),this.virtualList.refresh())}},s.prototype.createRowComponent=function(e){var t=this.params.formatValue(e),i=new h(this.params);return this.getContext().createBean(i),i.setState(e,t,e===this.selectedValue),i},s.prototype.onMouseMove=function(e){var t=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),r=e.clientY-t.top+i,n=Math.floor(r/this.virtualList.getRowHeight()),o=this.params.values[n];void 0!==o&&this.setSelectedValue(o)},s.prototype.onClick=function(){this.confirmSelection(),this.params.stopEditing()},s.prototype.afterGuiAttached=function(){var e=this.params.values.indexOf(this.selectedValue);this.virtualList.refresh(),e>=0&&this.virtualList.ensureIndexVisible(e),this.virtualList.refresh(),this.focusAfterAttached&&this.getGui().focus()},s.prototype.getValue=function(){return this.selectionConfirmed?this.selectedValue:this.originalSelectedValue},s.TEMPLATE='<div class="ag-rich-select" tabindex="-1">\n <div ref="eValue" class="ag-rich-select-value"></div>\n <div ref="eList" class="ag-rich-select-list"></div>\n </div>',f([t("userComponentFactory")],s.prototype,"userComponentFactory",void 0),f([o("eValue")],s.prototype,"eValue",void 0),f([o("eList")],s.prototype,"eList",void 0),s}(s),g={moduleName:a.RichSelectModule,beans:[],userComponents:[{componentName:"agRichSelect",componentClass:v},{componentName:"agRichSelectCellEditor",componentClass:v}],dependantModules:[c]};export{g as RichSelectModule};
{
"name": "@ag-grid-enterprise/rich-select",
"version": "26.0.0",
"version": "26.1.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components",

@@ -45,4 +45,4 @@ "main": "./dist/cjs/main.js",

"dependencies": {
"@ag-grid-community/core": "~26.0.0",
"@ag-grid-enterprise/core": "~26.0.0"
"@ag-grid-community/core": "~26.1.0",
"@ag-grid-enterprise/core": "~26.1.0"
},

@@ -49,0 +49,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc