@ni/nimble-components 20.10.1 → 20.10.2

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.
@@ -8943,7 +8943,7 @@ const n=e.getColumn(t)
8943
8943
  return null!=n&&n.accessorFn?(a._valuesCache[t]=n.accessorFn(a.original,i),a._valuesCache[t]):void 0},getUniqueValues:t=>{if(a._uniqueValuesCache.hasOwnProperty(t))return a._uniqueValuesCache[t]
8944
8944
  const n=e.getColumn(t)
8945
8945
  return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(a._uniqueValuesCache[t]=n.columnDef.getUniqueValues(a.original,i),a._uniqueValuesCache[t]):(a._uniqueValuesCache[t]=[a.getValue(t)],a._uniqueValuesCache[t]):void 0},renderValue:t=>{var n
8946
- return null!=(n=a.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=r?r:[],getLeafRows:()=>MD(a.subRows,(e=>e.subRows)),getParentRow:()=>a.parentId?e.getRow(a.parentId):void 0,getParentRows:()=>{let e=[],t=a
8946
+ return null!=(n=a.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=r?r:[],getLeafRows:()=>MD(a.subRows,(e=>e.subRows)),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let e=[],t=a
8947
8947
  for(;;){const n=t.getParentRow()
8948
8948
  if(!n)break
8949
8949
  e.push(n),t=n}return e.reverse()},getAllCells:_D((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>function(e,t,n,i){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(i),renderValue:()=>{var t
@@ -9772,24 +9772,22 @@ this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeo
9772
9772
  return{disconnect:function(){var e
9773
9773
  return null==(e=n())?void 0:e.disconnect()},observe:function(e){var t
9774
9774
  return null==(t=n())?void 0:t.observe(e,{box:"border-box"})},unobserve:function(e){var t
9775
- return null==(t=n())?void 0:t.unobserve(e)}}}(),this.range={startIndex:0,endIndex:0},this.setOptions=function(e){Object.entries(e).forEach((function(t){var n=t[0]
9776
- void 0===t[1]&&delete e[n]})),t.options=QF({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:nN,rangeExtractor:iN,onChange:function(){},measureElement:sN,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},e)},this.notify=function(){null==t.options.onChange||t.options.onChange(t)},this.cleanup=function(){t.unsubs.filter(Boolean).forEach((function(e){return e()})),t.unsubs=[],t.scrollElement=null},this._didMount=function(){return t.measureElementCache.forEach(t.observer.observe),function(){t.observer.disconnect(),t.cleanup()}},this._willUpdate=function(){var e=t.options.getScrollElement()
9777
- t.scrollElement!==e&&(t.cleanup(),t.scrollElement=e,t._scrollToOffset(t.scrollOffset,{adjustments:void 0,behavior:void 0}),t.unsubs.push(t.options.observeElementRect(t,(function(e){var n=t.scrollRect
9778
- t.scrollRect=e,(t.options.horizontal?e.width!==n.width:e.height!==n.height)&&t.maybeNotify()}))),t.unsubs.push(t.options.observeElementOffset(t,(function(e){t.scrollAdjustments=0,t.scrollOffset!==e&&(null!==t.isScrollingTimeoutId&&(clearTimeout(t.isScrollingTimeoutId),t.isScrollingTimeoutId=null),t.isScrolling=!0,t.scrollDirection=t.scrollOffset<e?"forward":"backward",t.scrollOffset=e,t.maybeNotify(),t.isScrollingTimeoutId=setTimeout((function(){t.isScrollingTimeoutId=null,t.isScrolling=!1,t.scrollDirection=null,t.maybeNotify()}),t.options.scrollingDelay))}))))},this.getSize=function(){return t.scrollRect[t.options.horizontal?"width":"height"]},this.memoOptions=eN((function(){return[t.options.count,t.options.paddingStart,t.options.scrollMargin,t.options.getItemKey]}),(function(e,n,i,o){return t.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:i,getItemKey:o}}),{key:!1}),this.getFurthestMeasurement=function(e,n){for(var i=new Map,o=new Map,r=n-1;r>=0;r--){var s=e[r]
9775
+ return null==(t=n())?void 0:t.unobserve(e)}}}(),this.range=null,this.setOptions=function(e){Object.entries(e).forEach((function(t){var n=t[0]
9776
+ void 0===t[1]&&delete e[n]})),t.options=QF({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:nN,rangeExtractor:iN,onChange:function(){},measureElement:sN,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},e)},this.notify=function(e){null==t.options.onChange||t.options.onChange(t,e)},this.maybeNotify=eN((function(){return t.calculateRange(),[t.isScrolling,t.range?t.range.startIndex:null,t.range?t.range.endIndex:null]}),(function(e){t.notify(e)}),{key:!1,debug:function(){return t.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){t.unsubs.filter(Boolean).forEach((function(e){return e()})),t.unsubs=[],t.scrollElement=null},this._didMount=function(){return t.measureElementCache.forEach(t.observer.observe),function(){t.observer.disconnect(),t.cleanup()}},this._willUpdate=function(){var e=t.options.getScrollElement()
9777
+ t.scrollElement!==e&&(t.cleanup(),t.scrollElement=e,t._scrollToOffset(t.scrollOffset,{adjustments:void 0,behavior:void 0}),t.unsubs.push(t.options.observeElementRect(t,(function(e){t.scrollRect=e,t.maybeNotify()}))),t.unsubs.push(t.options.observeElementOffset(t,(function(e){t.scrollAdjustments=0,t.scrollOffset!==e&&(null!==t.isScrollingTimeoutId&&(clearTimeout(t.isScrollingTimeoutId),t.isScrollingTimeoutId=null),t.isScrolling=!0,t.scrollDirection=t.scrollOffset<e?"forward":"backward",t.scrollOffset=e,t.maybeNotify(),t.isScrollingTimeoutId=setTimeout((function(){t.isScrollingTimeoutId=null,t.isScrolling=!1,t.scrollDirection=null,t.maybeNotify()}),t.options.scrollingDelay))}))))},this.getSize=function(){return t.scrollRect[t.options.horizontal?"width":"height"]},this.memoOptions=eN((function(){return[t.options.count,t.options.paddingStart,t.options.scrollMargin,t.options.getItemKey]}),(function(e,n,i,o){return t.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:i,getItemKey:o}}),{key:!1}),this.getFurthestMeasurement=function(e,n){for(var i=new Map,o=new Map,r=n-1;r>=0;r--){var s=e[r]
9779
9778
  if(!i.has(s.lane)){var a=o.get(s.lane)
9780
9779
  if(null==a||s.end>a.end?o.set(s.lane,s):s.end<a.end&&i.set(s.lane,!0),i.size===t.options.lanes)break}}return o.size===t.options.lanes?Array.from(o.values()).sort((function(e,t){return e.end-t.end}))[0]:void 0},this.getMeasurements=eN((function(){return[t.memoOptions(),t.itemSizeCache]}),(function(e,n){var i=e.count,o=e.paddingStart,r=e.scrollMargin,s=e.getItemKey,a=t.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,t.pendingMeasuredCacheIndexes):0
9781
9780
  t.pendingMeasuredCacheIndexes=[]
9782
9781
  for(var l=t.measurementsCache.slice(0,a),c=a;c<i;c++){var d=s(c),h=1===t.options.lanes?l[c-1]:t.getFurthestMeasurement(l,c),u=h?h.end:o+r,p=n.get(d),f="number"==typeof p?p:t.options.estimateSize(c),g=u+f,m=h?h.lane:c%t.options.lanes
9783
- l[c]={index:c,start:u,size:f,end:g,key:d,lane:m}}return t.measurementsCache=l,l}),{key:!1,debug:function(){return t.options.debug}}),this.calculateRange=eN((function(){return[t.getMeasurements(),t.getSize(),t.scrollOffset]}),(function(e,n,i){return t.range=function(e){var t=e.measurements,n=e.outerSize,i=e.scrollOffset,o=t.length-1,r=function(e){return t[e].start},s=cN(0,o,r,i),a=s
9782
+ l[c]={index:c,start:u,size:f,end:g,key:d,lane:m}}return t.measurementsCache=l,l}),{key:!1,debug:function(){return t.options.debug}}),this.calculateRange=eN((function(){return[t.getMeasurements(),t.getSize(),t.scrollOffset]}),(function(e,n,i){return t.range=e.length>0&&n>0?function(e){var t=e.measurements,n=e.outerSize,i=e.scrollOffset,o=t.length-1,r=function(e){return t[e].start},s=cN(0,o,r,i),a=s
9784
9783
  for(;a<o&&t[a].end<i+n;)a++
9785
- return{startIndex:s,endIndex:a}}({measurements:e,outerSize:n,scrollOffset:i})}),{key:!1,debug:function(){return t.options.debug}}),this.maybeNotify=eN((function(){var e=t.calculateRange()
9786
- return[e.startIndex,e.endIndex,t.isScrolling]}),(function(){t.notify()}),{key:!1,debug:function(){return t.options.debug},initialDeps:[this.range.startIndex,this.range.endIndex,this.isScrolling]}),this.getIndexes=eN((function(){return[t.options.rangeExtractor,t.calculateRange(),t.options.overscan,t.options.count]}),(function(e,t,n,i){return e(QF({},t,{overscan:n,count:i}))}),{key:!1,debug:function(){return t.options.debug}}),this.indexFromElement=function(e){var n=t.options.indexAttribute,i=e.getAttribute(n)
9784
+ return{startIndex:s,endIndex:a}}({measurements:e,outerSize:n,scrollOffset:i}):null}),{key:!1,debug:function(){return t.options.debug}}),this.getIndexes=eN((function(){return[t.options.rangeExtractor,t.calculateRange(),t.options.overscan,t.options.count]}),(function(e,t,n,i){return null===t?[]:e(QF({},t,{overscan:n,count:i}))}),{key:!1,debug:function(){return t.options.debug}}),this.indexFromElement=function(e){var n=t.options.indexAttribute,i=e.getAttribute(n)
9787
9785
  return i?parseInt(i,10):(console.warn("Missing attribute name '"+n+"={index}' on measured element."),-1)},this._measureElement=function(e,n){var i=t.measurementsCache[t.indexFromElement(e)]
9788
- if(i){var o=t.measureElementCache.get(i.key)
9789
- if(e.isConnected){o!==e&&(o&&t.observer.unobserve(o),t.observer.observe(e),t.measureElementCache.set(i.key,e))
9786
+ if(i&&e.isConnected){var o=t.measureElementCache.get(i.key)
9787
+ o!==e&&(o&&t.observer.unobserve(o),t.observer.observe(e),t.measureElementCache.set(i.key,e))
9790
9788
  var r=t.options.measureElement(e,n,t)
9791
- t.resizeItem(i,r)}else o&&(t.observer.unobserve(o),t.measureElementCache.delete(i.key))}else t.measureElementCache.forEach((function(n,i){n===e&&(t.observer.unobserve(e),t.measureElementCache.delete(i))}))},this.resizeItem=function(e,n){var i,o=n-(null!=(i=t.itemSizeCache.get(e.key))?i:e.size)
9792
- 0!==o&&(e.start<t.scrollOffset&&t._scrollToOffset(t.scrollOffset,{adjustments:t.scrollAdjustments+=o,behavior:void 0}),t.pendingMeasuredCacheIndexes.push(e.index),t.itemSizeCache=new Map(t.itemSizeCache.set(e.key,n)),t.notify())},this.measureElement=function(e){e&&t._measureElement(e,void 0)},this.getVirtualItems=eN((function(){return[t.getIndexes(),t.getMeasurements()]}),(function(e,t){for(var n=[],i=0,o=e.length;i<o;i++){var r=t[e[i]]
9789
+ t.resizeItem(i,r)}else t.measureElementCache.forEach((function(n,i){n===e&&(t.observer.unobserve(e),t.measureElementCache.delete(i))}))},this.resizeItem=function(e,n){var i,o=n-(null!=(i=t.itemSizeCache.get(e.key))?i:e.size)
9790
+ 0!==o&&(e.start<t.scrollOffset&&t._scrollToOffset(t.scrollOffset,{adjustments:t.scrollAdjustments+=o,behavior:void 0}),t.pendingMeasuredCacheIndexes.push(e.index),t.itemSizeCache=new Map(t.itemSizeCache.set(e.key,n)),t.notify(!1))},this.measureElement=function(e){e&&t._measureElement(e,void 0)},this.getVirtualItems=eN((function(){return[t.getIndexes(),t.getMeasurements()]}),(function(e,t){for(var n=[],i=0,o=e.length;i<o;i++){var r=t[e[i]]
9793
9791
  n.push(r)}return n}),{key:!1,debug:function(){return t.options.debug}}),this.getVirtualItemForOffset=function(e){var n=t.getMeasurements()
9794
9792
  return tN(n[cN(0,n.length-1,(function(e){return tN(n[e]).start}),e)])},this.getOffsetForAlignment=function(e,n){var i=t.getSize()
9795
9793
  "auto"===n&&(n=e<=t.scrollOffset?"start":e>=t.scrollOffset+i?"end":"start"),"start"===n||("end"===n?e-=i:"center"===n&&(e-=i/2))
@@ -9808,7 +9806,7 @@ if(t.scrollToIndexTimeoutId=null,t.measureElementCache.has(t.options.getItemKey(
9808
9806
  n=o,i=t.scrollOffset,Math.abs(n-i)<1||t.scrollToIndex(e,{align:c,behavior:s})}else t.scrollToIndex(e,{align:c,behavior:s})})))},this.scrollBy=function(e,n){var i=(void 0===n?{}:n).behavior
9809
9807
  t.cancelScrollToIndex(),"smooth"===i&&t.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t._scrollToOffset(t.scrollOffset+e,{adjustments:void 0,behavior:i})},this.getTotalSize=function(){var e
9810
9808
  return((null==(e=t.getMeasurements()[t.options.count-1])?void 0:e.end)||t.options.paddingStart)-t.options.scrollMargin+t.options.paddingEnd},this._scrollToOffset=function(e,n){var i=n.adjustments,o=n.behavior
9811
- t.options.scrollToFn(e,{behavior:o,adjustments:i},t)},this.measure=function(){t.itemSizeCache=new Map,t.notify()},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((function(e){t.itemSizeCache.set(e.key,e.size)})),this.maybeNotify()},cN=function(e,t,n,i){for(;e<=t;){var o=(e+t)/2|0,r=n(o)
9809
+ t.options.scrollToFn(e,{behavior:o,adjustments:i},t)},this.measure=function(){t.itemSizeCache=new Map,t.notify(!1)},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((function(e){t.itemSizeCache.set(e.key,e.size)})),this.maybeNotify()},cN=function(e,t,n,i){for(;e<=t;){var o=(e+t)/2|0,r=n(o)
9812
9810
  if(r<i)e=o+1
9813
9811
  else{if(!(r>i))return o
9814
9812
  t=o-1}}return e>0?e-1:0}
@@ -9903,7 +9901,7 @@ const i=e.getState().sorting,o=[],r=i.filter((t=>{var n
9903
9901
  return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),s={}
9904
9902
  r.forEach((t=>{const n=e.getColumn(t.id)
9905
9903
  n&&(s[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}))
9906
- const a=e=>{const t=[...e]
9904
+ const a=e=>{const t=e.map((e=>({...e})))
9907
9905
  return t.sort(((e,t)=>{for(let i=0;i<r.length;i+=1){var n
9908
9906
  const o=r[i],a=s[o.id],l=null!=(n=null==o?void 0:o.desc)&&n
9909
9907
  let c=0