slick-table 1.1.42 → 1.1.43

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/dist/index.cjs.js CHANGED
@@ -348,7 +348,7 @@ return o.version="2.30.1",r(Mt),o.fn=ye,o.min=Jw,o.max=eC,o.now=tC,o.utc=b,o.uni
348
348
  Expecting `+ce.join(", ")+", got '"+(this.terminals_[B]||B)+"'":le="Parse error on line "+($+1)+": Unexpected "+(B==q?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(le,{text:H.match,token:this.terminals_[B]||B,line:H.yylineno,loc:A,expected:ce})}if(oe[0]instanceof Array&&oe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ne+", token: "+B);switch(oe[0]){case 1:O.push(B),N.push(H.yytext),F.push(H.yylloc),O.push(oe[1]),B=null,K=H.yyleng,R=H.yytext,$=H.yylineno,A=H.yylloc;break;case 2:if(J=this.productions_[oe[1]][1],j.$=N[N.length-J],j._$={first_line:F[F.length-(J||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(J||1)].first_column,last_column:F[F.length-1].last_column},M&&(j._$.range=[F[F.length-(J||1)].range[0],F[F.length-1].range[1]]),se=this.performAction.apply(j,[R,K,$,ae.yy,oe[1],N,F].concat(Y)),typeof se<"u")return se;J&&(O=O.slice(0,-1*J*2),N=N.slice(0,-1*J),F=F.slice(0,-1*J)),O.push(this.productions_[oe[1]][0]),N.push(j.$),F.push(j._$),te=z[O[O.length-2]][O[O.length-1]],O.push(te);break;case 3:return!0}}return!0}},P=function(){return{EOF:1,parseError:function(C,O){if(this.yy.parser)this.yy.parser.parseError(C,O);else throw new Error(C)},setInput:function(S,C){return this.yy=C||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){const S=this._input[0];return this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S,S.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},unput:function(S){const C=S.length,O=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;const N=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),O.length-1&&(this.yylineno-=O.length-1);const F=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:O?(O.length===N.length?this.yylloc.first_column:0)+N[N.length-O.length].length-O[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
349
349
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(S){this.unput(this.match.slice(S))},pastInput:function(){const S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},upcomingInput:function(){let S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){const S=this.pastInput(),C=new Array(S.length+1).join("-");return S+this.upcomingInput()+`
350
350
  `+C+"^"},test_match:function(S,C){let O,N,F;if(this.options.backtrack_lexer&&(F={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(F.yylloc.range=this.yylloc.range.slice(0))),N=S[0].match(/(?:\r\n?|\n).*/g),N&&(this.yylineno+=N.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:N?N[N.length-1].length-N[N.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(S[0].length),this.matched+=S[0],O=this.performAction.call(this,this.yy,this,C,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),O)return O;if(this._backtrack){for(let z in F)this[z]=F[z];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);let S,C,O,N;this._more||(this.yytext="",this.match="");const F=this._currentRules();for(let z=0;z<F.length;z++)if(O=this._input.match(this.rules[F[z]]),O&&(!C||O[0].length>C[0].length)){if(C=O,N=z,this.options.backtrack_lexer){if(S=this.test_match(O,F[z]),S!==!1)return S;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(S=this.test_match(C,F[N]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
351
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){const C=this.next();return C||this.lex()},begin:function(C){this.conditionStack.push(C)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},pushState:function(C){this.begin(C)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(C,O,N,F){switch(N){case 0:break;case 1:return 15;case 2:return 8;case 3:return 9;case 4:return 7;case 5:return 6;case 6:return 10;case 7:return 11;case 8:return 12;case 9:return 13;case 10:return 14;case 11:return 17;case 12:return 16;case 13:return 5;case 14:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:[0-9]+(\.[0-9]+)?\b)/,/^(?:\*)/,/^(?:\/)/,/^(?:-)/,/^(?:\+)/,/^(?:\^)/,/^(?:!)/,/^(?:%)/,/^(?:\()/,/^(?:\))/,/^(?:PI\b)/,/^(?:E\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],inclusive:!0}}}}();v.lexer=P;function k(){this.yy={},this.parse=this.parse.bind(this)}return k.prototype=v,v.Parser=k,new k}();typeof require<"u"&&typeof exports<"u"&&(exports.parser=$r,exports.Parser=$r.Parser,exports.parse=function(){return $r.parse.apply($r,arguments)});const Gv=2;class TF extends Rm{isValueChanged(){const t=RF(this.defaultValue);let n=0;try{n=$r.parse(this.input.value||"0")}catch{return!0}return!n&&!t?!1:n!==t}loadValue(t){const n=Number(t[this.args.column.field]||"0");this.defaultValue=n.toFixed(Gv),this.input.value=this.defaultValue,this.input.defaultValue=this.input.value,this.input.select()}serializeValue(){let t=$r.parse(this.input.value||"0");Rm.AllowEmptyValue?!t&&t!==0&&(t=void 0):t=t||0;const n=this.getDecimalPlaces();return n!==null&&(t||t===0)&&t.toFixed&&(t=parseFloat(t.toFixed(n))),t}validate(){let t=0;try{if(t=$r.parse(`${this.input.value}`),t===1/0)throw new Error}catch{return{valid:!1,msg:"Please enter a valid number"}}if(this.args.column.validator){const n=this.args.column.validator(t,this.args);if(!n.valid)return n}return{valid:!0,msg:null}}}TF.DefaultDecimalPlaces=Gv;class kF{constructor(){this.currentFocus=-1,this.defaultValue="",this.id="slick-table-autocomplete",this.input=document.createElement("input"),this.keyCaptureList=[Br.UP,Br.DOWN,Br.ENTER]}applyValue(t,n){t[this.args.column.field]=n}closeAllList(){this.list?.remove(),this.list=void 0,this.currentFocus=-1}createList(){this.list=document.createElement("div");const t=document.getElementById("root");if(!t)return;t.appendChild(this.list),this.list.setAttribute("id",this.id);const{top:n,left:o,right:r}=this.args.position,i=this.args.grid.getOptions().rowHeight||25;this.list.style.top=`${n+i}px`,this.list.style.left=`${o}px`,this.list.style.minWidth=`${r-o}px`}destroy(){this.input.removeEventListener("input",this.onInput.bind(this)),this.input.removeEventListener("keydown",this.onKeydown.bind(this)),this.closeAllList(),this.input.remove()}focus(){this.input.focus()}init(){this.navOnLR=this.args.grid.getOptions().editorCellNavOnLRKeys,this.input.setAttribute("type","text"),this.input.classList.add("editor-text"),this.args.container.append(this.input),this.input.addEventListener("input",this.onInput.bind(this)),this.input.addEventListener("keydown",this.onKeydown.bind(this)),this.input.focus(),this.input.select()}isValueChanged(){return!(this.input.value==""&&this.defaultValue==null)&&this.input.value!=this.defaultValue}loadValue(t){this.defaultValue=t[this.args.column.field]||"",this.input.value=this.defaultValue,this.input.defaultValue=this.defaultValue,this.input.focus(),this.input.select()}makeVisible(){if(!this.list)return;const t=this.args.container.closest(".slick-viewport");if(!t)return;const{bottom:n,left:o,right:r,top:i}=this.list.getBoundingClientRect(),{bottom:a,right:l}=t.getBoundingClientRect();if(n>=a){const d=this.args.grid.getOptions().rowHeight||25,u=n-i;this.list.style.top=`${i-u-d}px`}if(r>=l){const{right:d}=this.args.container.getBoundingClientRect(),u=r-d;this.list.style.left=`${o-u}px`}}onKeydown(t){if(t.key===Ar.ArrowLeft){this.navOnLR&&this.args.grid.navigatePrev(),t.stopImmediatePropagation();return}else if(t.key===Ar.ArrowRight){this.navOnLR&&this.args.grid.navigateNext(),t.stopImmediatePropagation();return}if(!this.list)return;const n=this.list.getElementsByTagName("div");t.key===Ar.ArrowDown?(this.currentFocus++,this.setActive(n)):t.key===Ar.ArrowUp?(this.currentFocus--,this.setActive(n)):(t.key===Ar.Enter||t.key===Ar.Tab)&&(t.preventDefault(),n.length===1&&(this.currentFocus=0),this.currentFocus>-1&&n&&n[this.currentFocus].click())}removeActive(t){for(let n=0;n<t.length;n++)t[n].classList.remove("active")}scrollToElement(t){const n=t.parentElement;if(!n)return;const{clientHeight:o,offsetTop:r}=t,{clientHeight:i,scrollTop:a}=n;r>=a+i?n.scrollTop=r-o*1.5:r-o<=a&&(n.scrollTop=r-i)}serializeValue(){return this.input.value}setActive(t){if(!t.length)return;this.removeActive(t),this.currentFocus>=t.length&&(this.currentFocus=0),this.currentFocus<0&&(this.currentFocus=t.length-1);const n=t[this.currentFocus];n.classList.add("active"),this.scrollToElement(n)}validate(){if(this.args.column.validator){const t=this.args.column.validator(this.input.value,this.args);if(!t.valid)return t}return{valid:!0,msg:null}}}var yl={exports:{}};const EF=f0(VN);/*!
351
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){const C=this.next();return C||this.lex()},begin:function(C){this.conditionStack.push(C)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},pushState:function(C){this.begin(C)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(C,O,N,F){switch(N){case 0:break;case 1:return 15;case 2:return 8;case 3:return 9;case 4:return 7;case 5:return 6;case 6:return 10;case 7:return 11;case 8:return 12;case 9:return 13;case 10:return 14;case 11:return 17;case 12:return 16;case 13:return 5;case 14:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:[0-9]+(\.[0-9]+)?\b)/,/^(?:\*)/,/^(?:\/)/,/^(?:-)/,/^(?:\+)/,/^(?:\^)/,/^(?:!)/,/^(?:%)/,/^(?:\()/,/^(?:\))/,/^(?:PI\b)/,/^(?:E\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],inclusive:!0}}}}();v.lexer=P;function k(){this.yy={},this.parse=this.parse.bind(this)}return k.prototype=v,v.Parser=k,new k}();typeof require<"u"&&typeof exports<"u"&&(exports.parser=$r,exports.Parser=$r.Parser,exports.parse=function(){return $r.parse.apply($r,arguments)});const Gv=2;class TF extends Rm{isValueChanged(){const t=RF(this.defaultValue);let n=0;try{n=$r.parse(this.input.value||"0")}catch{return!0}return!n&&!t?!1:n!==t}loadValue(t){const n=Number(t[this.args.column.field]||"0");this.defaultValue=n.toFixed(Gv),this.input.value=this.defaultValue,this.input.defaultValue=this.input.value,this.input.select()}serializeValue(){let t=$r.parse(this.input.value||"0");Rm.AllowEmptyValue?!t&&t!==0&&(t=void 0):t=t||0;const n=this.getDecimalPlaces();return n!==null&&(t||t===0)&&t.toFixed&&(t=parseFloat(t.toFixed(n))),t}validate(){let t=0;try{if(t=$r.parse(`${this.input.value}`),t===1/0)throw new Error}catch{return{valid:!1,msg:"Please enter a valid number"}}if(this.args.column.validator){const n=this.args.column.validator(t,this.args);if(!n.valid)return n}return{valid:!0,msg:null}}}TF.DefaultDecimalPlaces=Gv;class kF{constructor(){this.currentFocus=-1,this.defaultValue="",this.id="slick-table-autocomplete",this.input=document.createElement("input"),this.keyCaptureList=[Br.UP,Br.DOWN,Br.ENTER]}applyValue(t,n){t[this.args.column.field]=n}closeAllList(){this.list?.remove(),this.list=void 0,this.currentFocus=-1}createList(){this.list=document.createElement("div");const t=document.getElementById("root");if(!t)return;t.appendChild(this.list),this.list.setAttribute("tabIndex","0"),this.list.setAttribute("id",this.id);const{top:n,left:o,right:r}=this.args.position,i=this.args.grid.getOptions().rowHeight||25;this.list.style.top=`${n+i}px`,this.list.style.left=`${o}px`,this.list.style.minWidth=`${r-o}px`}destroy(){this.input.removeEventListener("input",this.onInput.bind(this)),this.input.removeEventListener("keydown",this.onKeydown.bind(this)),this.closeAllList(),this.input.remove()}focus(){this.input.focus()}init(){this.navOnLR=this.args.grid.getOptions().editorCellNavOnLRKeys,this.input.setAttribute("type","text"),this.input.classList.add("editor-text"),this.args.container.append(this.input),this.input.addEventListener("input",this.onInput.bind(this)),this.input.addEventListener("keydown",this.onKeydown.bind(this)),this.input.addEventListener("blur",({relatedTarget:t})=>{t?.id===this.id?this.focus():this.closeAllList()}),this.input.focus(),this.input.select()}isValueChanged(){return!(this.input.value==""&&this.defaultValue==null)&&this.input.value!=this.defaultValue}loadValue(t){this.defaultValue=t[this.args.column.field]||"",this.input.value=this.defaultValue,this.input.defaultValue=this.defaultValue,this.input.focus(),this.input.select()}makeVisible(){if(!this.list)return;const{bottom:t,left:n,right:o,top:r}=this.list.getBoundingClientRect(),{bottom:i,right:a}=document.body.getBoundingClientRect();if(t>=i){const l=this.args.grid.getOptions().rowHeight||25,d=t-r;this.list.style.top=`${r-d-l}px`}if(o>=a){const{right:l}=this.args.container.getBoundingClientRect(),d=o-l;this.list.style.left=`${n-d}px`}}onKeydown(t){if(t.key===Ar.ArrowLeft){this.navOnLR&&this.args.grid.navigatePrev(),t.stopImmediatePropagation();return}else if(t.key===Ar.ArrowRight){this.navOnLR&&this.args.grid.navigateNext(),t.stopImmediatePropagation();return}if(!this.list)return;const n=this.list.getElementsByTagName("div");t.key===Ar.ArrowDown?(this.currentFocus++,this.setActive(n)):t.key===Ar.ArrowUp?(this.currentFocus--,this.setActive(n)):(t.key===Ar.Enter||t.key===Ar.Tab)&&(t.preventDefault(),n.length===1&&(this.currentFocus=0),this.currentFocus>-1&&n&&n[this.currentFocus].click())}removeActive(t){for(let n=0;n<t.length;n++)t[n].classList.remove("active")}scrollToElement(t){const n=t.parentElement;if(!n)return;const{clientHeight:o,offsetTop:r}=t,{clientHeight:i,scrollTop:a}=n;r>=a+i?n.scrollTop=r-o*1.5:r-o<=a&&(n.scrollTop=r-i)}serializeValue(){return this.input.value}setActive(t){if(!t.length)return;this.removeActive(t),this.currentFocus>=t.length&&(this.currentFocus=0),this.currentFocus<0&&(this.currentFocus=t.length-1);const n=t[this.currentFocus];n.classList.add("active"),this.scrollToElement(n)}validate(){if(this.args.column.validator){const t=this.args.column.validator(this.input.value,this.args);if(!t.valid)return t}return{valid:!0,msg:null}}}var yl={exports:{}};const EF=f0(VN);/*!
352
352
  * Pikaday
353
353
  *
354
354
  * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
package/dist/index.es.js CHANGED
@@ -34513,7 +34513,7 @@ class OW {
34513
34513
  this.list = document.createElement("div");
34514
34514
  const t = document.getElementById("root");
34515
34515
  if (!t) return;
34516
- t.appendChild(this.list), this.list.setAttribute("id", this.id);
34516
+ t.appendChild(this.list), this.list.setAttribute("tabIndex", "0"), this.list.setAttribute("id", this.id);
34517
34517
  const { top: n, left: o, right: r } = this.args.position, i = this.args.grid.getOptions().rowHeight || 25;
34518
34518
  this.list.style.top = `${n + i}px`, this.list.style.left = `${o}px`, this.list.style.minWidth = `${r - o}px`;
34519
34519
  }
@@ -34524,7 +34524,9 @@ class OW {
34524
34524
  this.input.focus();
34525
34525
  }
34526
34526
  init() {
34527
- this.navOnLR = this.args.grid.getOptions().editorCellNavOnLRKeys, this.input.setAttribute("type", "text"), this.input.classList.add("editor-text"), this.args.container.append(this.input), this.input.addEventListener("input", this.onInput.bind(this)), this.input.addEventListener("keydown", this.onKeydown.bind(this)), this.input.focus(), this.input.select();
34527
+ this.navOnLR = this.args.grid.getOptions().editorCellNavOnLRKeys, this.input.setAttribute("type", "text"), this.input.classList.add("editor-text"), this.args.container.append(this.input), this.input.addEventListener("input", this.onInput.bind(this)), this.input.addEventListener("keydown", this.onKeydown.bind(this)), this.input.addEventListener("blur", ({ relatedTarget: t }) => {
34528
+ t?.id === this.id ? this.focus() : this.closeAllList();
34529
+ }), this.input.focus(), this.input.select();
34528
34530
  }
34529
34531
  isValueChanged() {
34530
34532
  return !(this.input.value == "" && this.defaultValue == null) && this.input.value != this.defaultValue;
@@ -34534,21 +34536,19 @@ class OW {
34534
34536
  }
34535
34537
  makeVisible() {
34536
34538
  if (!this.list) return;
34537
- const t = this.args.container.closest(".slick-viewport");
34538
- if (!t) return;
34539
34539
  const {
34540
- bottom: n,
34541
- left: o,
34542
- right: r,
34543
- top: i
34544
- } = this.list.getBoundingClientRect(), { bottom: a, right: l } = t.getBoundingClientRect();
34545
- if (n >= a) {
34546
- const d = this.args.grid.getOptions().rowHeight || 25, u = n - i;
34547
- this.list.style.top = `${i - u - d}px`;
34548
- }
34549
- if (r >= l) {
34550
- const { right: d } = this.args.container.getBoundingClientRect(), u = r - d;
34551
- this.list.style.left = `${o - u}px`;
34540
+ bottom: t,
34541
+ left: n,
34542
+ right: o,
34543
+ top: r
34544
+ } = this.list.getBoundingClientRect(), { bottom: i, right: a } = document.body.getBoundingClientRect();
34545
+ if (t >= i) {
34546
+ const l = this.args.grid.getOptions().rowHeight || 25, d = t - r;
34547
+ this.list.style.top = `${r - d - l}px`;
34548
+ }
34549
+ if (o >= a) {
34550
+ const { right: l } = this.args.container.getBoundingClientRect(), d = o - l;
34551
+ this.list.style.left = `${n - d}px`;
34552
34552
  }
34553
34553
  }
34554
34554
  onKeydown(t) {
@@ -3,8 +3,9 @@
3
3
  z-index: 1;
4
4
  position: absolute;
5
5
  color: #1E456F;
6
- box-shadow: gray 0px 0px 5px 1px;
6
+ box-shadow: gray 0 0 5px 1px;
7
7
  font-size: 0.75rem;
8
+ max-height: 20em;
8
9
 
9
10
  strong {
10
11
  color: rgb(0, 123, 255)
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/lib/editors/Autocomplete/Autocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,eAAe,EACf,sBAAsB,EAGtB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAA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AAC,GAAG,IAAI;IASvD,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAC1C,QAAQ,IAAI,sBAAsB;CAelC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slick-table",
3
- "version": "1.1.42",
3
+ "version": "1.1.43",
4
4
  "description": "Enhanced version of SlickGrid library",
5
5
  "private": false,
6
6
  "type": "module",
@@ -3,8 +3,9 @@
3
3
  z-index: 1;
4
4
  position: absolute;
5
5
  color: #1E456F;
6
- box-shadow: gray 0px 0px 5px 1px;
6
+ box-shadow: gray 0 0 5px 1px;
7
7
  font-size: 0.75rem;
8
+ max-height: 20em;
8
9
 
9
10
  strong {
10
11
  color: rgb(0, 123, 255)
@@ -32,6 +32,7 @@ export abstract class Autocomplete implements Editor {
32
32
  const container = document.getElementById("root");
33
33
  if (!container) return;
34
34
  container.appendChild(this.list);
35
+ this.list.setAttribute("tabIndex", "0"); // this.input.addEventListener("blur", ...) doesn't work without it
35
36
  this.list.setAttribute("id", this.id);
36
37
  const { top, left, right } = this.args.position as ElementPosition;
37
38
  const rowHeight = this.args.grid.getOptions().rowHeight || 25;
@@ -56,6 +57,13 @@ export abstract class Autocomplete implements Editor {
56
57
 
57
58
  this.input.addEventListener("input", this.onInput.bind(this));
58
59
  this.input.addEventListener("keydown", this.onKeydown.bind(this));
60
+ this.input.addEventListener("blur", ({ relatedTarget }) => {
61
+ if ((relatedTarget as HTMLDivElement | null)?.id === this.id) {
62
+ this.focus();
63
+ } else {
64
+ this.closeAllList();
65
+ }
66
+ });
59
67
  this.input.focus();
60
68
  this.input.select();
61
69
  }
@@ -74,22 +82,20 @@ export abstract class Autocomplete implements Editor {
74
82
  }
75
83
  makeVisible(): void {
76
84
  if (!this.list) return;
77
- const canvas = this.args.container.closest(".slick-viewport");
78
- if (!canvas) return;
79
85
  const {
80
86
  bottom: listBottom,
81
87
  left: listLeft,
82
88
  right: listRight,
83
89
  top: listTop,
84
90
  } = this.list.getBoundingClientRect();
85
- const { bottom: canvasBottom, right: canvasRight } =
86
- canvas.getBoundingClientRect();
87
- if (listBottom >= canvasBottom) {
91
+ const { bottom: bodyBottom, right: bodyRight } =
92
+ document.body.getBoundingClientRect();
93
+ if (listBottom >= bodyBottom) {
88
94
  const rowHeight = this.args.grid.getOptions().rowHeight || 25;
89
95
  const listHeight = listBottom - listTop;
90
96
  this.list.style.top = `${listTop - listHeight - rowHeight}px`;
91
97
  }
92
- if (listRight >= canvasRight) {
98
+ if (listRight >= bodyRight) {
93
99
  const { right: cellRight } = this.args.container.getBoundingClientRect();
94
100
  const exceeding = listRight - cellRight;
95
101
  this.list.style.left = `${listLeft - exceeding}px`;