@ni/nimble-components 21.7.1 → 21.8.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.
@@ -16301,7 +16301,7 @@
16301
16301
 
16302
16302
  /**
16303
16303
  * Do not edit directly
16304
- * Generated on Wed, 28 Feb 2024 21:07:23 GMT
16304
+ * Generated on Thu, 29 Feb 2024 16:05:27 GMT
16305
16305
  */
16306
16306
 
16307
16307
  const Information100DarkUi = "#a46eff";
@@ -68982,6 +68982,10 @@ img.ProseMirror-separator {
68982
68982
  static isSupportedMappingElement(mapping) {
68983
68983
  return (mapping instanceof MappingIcon || mapping instanceof MappingSpinner);
68984
68984
  }
68985
+ static hasUnresolvedIcon(mappingIcon) {
68986
+ return (typeof mappingIcon.icon === 'string'
68987
+ && mappingIcon.resolvedIcon === undefined);
68988
+ }
68985
68989
  validate(mappings, keyType) {
68986
68990
  super.validate(mappings, keyType);
68987
68991
  this.validateMappingTypes(mappings);
@@ -68991,7 +68995,7 @@ img.ProseMirror-separator {
68991
68995
  validateIconNames(mappings) {
68992
68996
  const invalid = mappings
68993
68997
  .filter(TableColumnIconValidator.isIconMappingElement)
68994
- .some(mappingIcon => mappingIcon.resolvedIcon === undefined);
68998
+ .some(TableColumnIconValidator.hasUnresolvedIcon);
68995
68999
  this.setConditionValue('invalidIconName', invalid);
68996
69000
  }
68997
69001
  validateNoMissingText(mappings) {
@@ -69049,15 +69053,25 @@ img.ProseMirror-separator {
69049
69053
  `)}
69050
69054
  `;
69051
69055
 
69052
- const createIconTemplate = (icon) => html `
69053
- <${icon}
69054
- title="${x => x.text}"
69055
- role="img"
69056
- aria-label="${x => x.text}"
69057
- severity="${x => x.severity}"
69058
- class="no-shrink"
69059
- >
69060
- </${icon}>`;
69056
+ // Create an empty template containing only a space because creating a ViewTemplate
69057
+ // with an empty string throws an exception at runtime.
69058
+ // prettier-ignore
69059
+ const emptyTemplate = html ` `;
69060
+ const createIconTemplate = (icon) => {
69061
+ if (icon === undefined) {
69062
+ return emptyTemplate;
69063
+ }
69064
+ return html `
69065
+ <${icon}
69066
+ title="${x => x.text}"
69067
+ role="img"
69068
+ aria-label="${x => x.text}"
69069
+ severity="${x => x.severity}"
69070
+ class="no-shrink"
69071
+ >
69072
+ </${icon}>
69073
+ `;
69074
+ };
69061
69075
  /**
69062
69076
  * Mapping configuration corresponding to a icon mapping
69063
69077
  */
@@ -69215,9 +69229,6 @@ img.ProseMirror-separator {
69215
69229
  }
69216
69230
  createMappingConfig(mapping) {
69217
69231
  if (mapping instanceof MappingIcon) {
69218
- if (!mapping.resolvedIcon) {
69219
- throw Error('Unresolved icon');
69220
- }
69221
69232
  return new MappingIconConfig(mapping.resolvedIcon, mapping.severity, mapping.text);
69222
69233
  }
69223
69234
  if (mapping instanceof MappingSpinner) {