@ni/nimble-components 19.2.2 → 19.3.0

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.
@@ -3214,7 +3214,7 @@ const tg=ro.tagFor(eg),ig="above",og="underline",ng="outline",sg="block",rg=fe`
3214
3214
  padding-bottom: 0;
3215
3215
  }
3216
3216
  `))
3217
- class cg extends Hi{constructor(){super(...arguments),this.appearance=og,this.errorVisible=!1,this.valueUpdatedByInput=!1}get value(){return super.value}set value(e){super.value=e,this.valueUpdatedByInput||(this.filter="",this.filterOptions(),this.selectedIndex=this.options.map((e=>e.text)).indexOf(this.value))}setPositioning(){this.$fastController.isConnected&&super.setPositioning()}slottedOptionsChanged(e,t){const i=this.value
3217
+ class cg extends Hi{constructor(){super(...arguments),this.appearance=og,this.errorVisible=!1,this.valueUpdatedByInput=!1}get value(){return super.value}set value(e){super.value=e,this.filter=e,this.filterOptions(),this.selectedIndex=this.options.map((e=>e.text)).indexOf(this.value)}setPositioning(){this.$fastController.isConnected&&super.setPositioning()}slottedOptionsChanged(e,t){const i=this.value
3218
3218
  super.slottedOptionsChanged(e,t),i&&(this.value=i)}connectedCallback(){super.connectedCallback(),this.setPositioning(),this.updateInputAriaLabel()}toggleButtonClickHandler(e){e.stopImmediatePropagation()}toggleButtonChangeHandler(e){this.open=this.dropdownButton.checked,e.stopImmediatePropagation()}toggleButtonKeyDownHandler(e){switch(e.key){case Ar:case Rr:case" ":case Er:return this.open=!0,this.stopPropagation(e),!1
3219
3219
  default:return!0}}filterOptions(){super.filterOptions()
3220
3220
  const e=this.filteredOptions.filter((e=>!e.disabled))
@@ -5422,7 +5422,7 @@ try{t=document.createElement(e)}catch(e){}if(!(t instanceof rw))throw new Error(
5422
5422
  </${e}>
5423
5423
  `)
5424
5424
  class lw{constructor(e){this.uniqueId=Hr("table-column-slot"),this.validConfiguration=!0,this.sortOperation=iw,this.dataRecordFieldNames=[],this.groupingDisabled=!1,this.fractionalWidth=1,this.minPixelWidth=117,this.currentFractionalWidth=1,this.currentSortDirection=Yb.none,this.cellRecordFieldNames=e.cellRecordFieldNames,this.cellViewTemplate=aw(e.cellViewTag),this.groupHeaderViewTemplate=sw(e.groupHeaderViewTag),this.delegatedEvents=e.delegatedEvents,this.sortOperation=e.sortOperation??iw}fractionalWidthChanged(){this.currentFractionalWidth=this.fractionalWidth}pixelWidthChanged(){this.currentPixelWidth=this.pixelWidth}}e([m],lw.prototype,"columnConfig",void 0),e([m],lw.prototype,"validConfiguration",void 0),e([m],lw.prototype,"operandDataRecordFieldName",void 0),e([m],lw.prototype,"sortOperation",void 0),e([m],lw.prototype,"dataRecordFieldNames",void 0),e([m],lw.prototype,"groupingDisabled",void 0),e([m],lw.prototype,"groupIndex",void 0),e([m],lw.prototype,"pixelWidth",void 0),e([m],lw.prototype,"fractionalWidth",void 0),e([m],lw.prototype,"minPixelWidth",void 0),e([m],lw.prototype,"currentFractionalWidth",void 0),e([m],lw.prototype,"currentPixelWidth",void 0),e([m],lw.prototype,"currentSortIndex",void 0),e([m],lw.prototype,"currentSortDirection",void 0)
5425
- class cw extends Rt{constructor(){super(...arguments),this.columnInternals=new lw(this.getColumnInternalsOptions()),this.columnHidden=!1,this.sortDirection=Yb.none,this.sortingDisabled=!1}checkValidity(){return this.columnInternals.validConfiguration}get validity(){return{}}sortDirectionChanged(){this.sortingDisabled||(this.columnInternals.currentSortDirection=this.sortDirection)}sortIndexChanged(){this.sortingDisabled||(this.columnInternals.currentSortIndex=this.sortIndex)}sortingDisabledChanged(){this.sortingDisabled?(this.columnInternals.currentSortDirection=Yb.none,this.columnInternals.currentSortIndex=void 0):(this.columnInternals.currentSortDirection=this.sortDirection,this.columnInternals.currentSortIndex=this.sortIndex)}}e([ne({attribute:"column-id"})],cw.prototype,"columnId",void 0),e([ne({attribute:"action-menu-slot"})],cw.prototype,"actionMenuSlot",void 0),e([ne({attribute:"action-menu-label"})],cw.prototype,"actionMenuLabel",void 0),e([ne({attribute:"column-hidden",mode:"boolean"})],cw.prototype,"columnHidden",void 0),e([ne({attribute:"sort-index",converter:ie})],cw.prototype,"sortIndex",void 0),e([ne({attribute:"sort-direction"})],cw.prototype,"sortDirection",void 0),e([ne({attribute:"sorting-disabled",mode:"boolean"})],cw.prototype,"sortingDisabled",void 0)
5425
+ class cw extends Rt{constructor(){super(...arguments),this.columnInternals=new lw(this.getColumnInternalsOptions()),this.columnHidden=!1,this.sortDirection=Yb.none,this.sortingDisabled=!1,this.isValidContentAndHasOverflow=!1}checkValidity(){return this.columnInternals.validConfiguration}get validity(){return{}}get headerTextContent(){return this.contentSlot.assignedNodes().map((e=>e.textContent?.trim())).join(" ")}sortDirectionChanged(){this.sortingDisabled||(this.columnInternals.currentSortDirection=this.sortDirection)}sortIndexChanged(){this.sortingDisabled||(this.columnInternals.currentSortIndex=this.sortIndex)}sortingDisabledChanged(){this.sortingDisabled?(this.columnInternals.currentSortDirection=Yb.none,this.columnInternals.currentSortIndex=void 0):(this.columnInternals.currentSortDirection=this.sortDirection,this.columnInternals.currentSortIndex=this.sortIndex)}}e([ne({attribute:"column-id"})],cw.prototype,"columnId",void 0),e([ne({attribute:"action-menu-slot"})],cw.prototype,"actionMenuSlot",void 0),e([ne({attribute:"action-menu-label"})],cw.prototype,"actionMenuLabel",void 0),e([ne({attribute:"column-hidden",mode:"boolean"})],cw.prototype,"columnHidden",void 0),e([ne({attribute:"sort-index",converter:ie})],cw.prototype,"sortIndex",void 0),e([ne({attribute:"sort-direction"})],cw.prototype,"sortDirection",void 0),e([ne({attribute:"sorting-disabled",mode:"boolean"})],cw.prototype,"sortingDisabled",void 0),e([m],cw.prototype,"isValidContentAndHasOverflow",void 0)
5426
5426
  class dw{constructor(){this.duplicateRecordId=!1,this.missingRecordId=!1,this.invalidRecordId=!1,this.duplicateColumnId=!1,this.missingColumnId=!1,this.duplicateSortIndex=!1,this.duplicateGroupIndex=!1,this.idFieldNameNotConfigured=!1,this.invalidColumnConfiguration=!1,this.recordIds=new Set}getValidity(){return{duplicateRecordId:this.duplicateRecordId,missingRecordId:this.missingRecordId,invalidRecordId:this.invalidRecordId,duplicateColumnId:this.duplicateColumnId,missingColumnId:this.missingColumnId,duplicateSortIndex:this.duplicateSortIndex,duplicateGroupIndex:this.duplicateGroupIndex,idFieldNameNotConfigured:this.idFieldNameNotConfigured,invalidColumnConfiguration:this.invalidColumnConfiguration}}isValid(){return Object.values(this.getValidity()).every((e=>!1===e))}areRecordIdsValid(){const e=this.getValidity()
5427
5427
  return!e.duplicateRecordId&&!e.missingRecordId&&!e.invalidRecordId}validateSelectionMode(e,t){return this.idFieldNameNotConfigured=e!==Qb.none&&"string"!=typeof t,!this.idFieldNameNotConfigured}validateRecordIds(e,t){if(this.duplicateRecordId=!1,this.missingRecordId=!1,this.invalidRecordId=!1,this.recordIds.clear(),"string"!=typeof t)return!0
5428
5428
  for(const i of e){if(!Object.prototype.hasOwnProperty.call(i,t)){this.missingRecordId=!0
@@ -6243,8 +6243,14 @@ const ax=fe`
6243
6243
  }
6244
6244
  `,lx=G`
6245
6245
  <template slot="${e=>e.columnInternals.uniqueId}">
6246
- <span class="header-content">
6247
- <slot></slot>
6246
+ <span
6247
+ ${Re("headerSpan")}
6248
+ class="header-content"
6249
+ @mouseover="${e=>{e.isValidContentAndHasOverflow=!!e.headerTextContent&&e.headerSpan.offsetWidth<e.headerSpan.scrollWidth}}"
6250
+ @mouseout="${e=>{e.isValidContentAndHasOverflow=!1}}"
6251
+ title=${e=>e.isValidContentAndHasOverflow?e.headerTextContent:null}
6252
+ >
6253
+ <slot ${Re("contentSlot")}></slot>
6248
6254
  </span>
6249
6255
  </template>
6250
6256
  `