@ni/nimble-components 33.11.1 → 33.12.1

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.
@@ -11476,7 +11476,7 @@
11476
11476
  return;
11477
11477
  }
11478
11478
  if (this.control && !this.isUserInput) {
11479
- this.control.value = this.value;
11479
+ this.syncValueToInnerControl();
11480
11480
  }
11481
11481
  super.valueChanged(previous, this.value);
11482
11482
  if (previous !== undefined && !this.isUserInput) {
@@ -11551,7 +11551,7 @@
11551
11551
  super.connectedCallback();
11552
11552
  this.proxy.setAttribute("type", "number");
11553
11553
  this.validate();
11554
- this.control.value = this.value;
11554
+ this.syncValueToInnerControl();
11555
11555
  if (this.autofocus) {
11556
11556
  DOM.queueUpdate(() => {
11557
11557
  this.focus();
@@ -11578,9 +11578,9 @@
11578
11578
  * @internal
11579
11579
  */
11580
11580
  handleTextInput() {
11581
- this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, "");
11581
+ this.control.value = this.sanitizeInput(this.control.value);
11582
11582
  this.isUserInput = true;
11583
- this.value = this.control.value;
11583
+ this.syncValueFromInnerControl();
11584
11584
  }
11585
11585
  /**
11586
11586
  * Change event handler for inner control.
@@ -11616,6 +11616,26 @@
11616
11616
  * @internal
11617
11617
  */
11618
11618
  handleBlur() {
11619
+ this.syncValueToInnerControl();
11620
+ }
11621
+ /**
11622
+ * Sanitizes the text input by the user.
11623
+ * @param inputText The user-input text to sanitize
11624
+ * @returns The sanitized text, containing only valid characters for a number field
11625
+ */
11626
+ sanitizeInput(inputText) {
11627
+ return inputText.replace(/[^0-9\-+e.]/g, "");
11628
+ }
11629
+ /**
11630
+ * Synchronizes the value from the input control in the shadow DOM to the host component.
11631
+ */
11632
+ syncValueFromInnerControl() {
11633
+ this.value = this.control.value;
11634
+ }
11635
+ /**
11636
+ * Synchronizes the value from the host component to the input control in the shadow DOM.
11637
+ */
11638
+ syncValueToInnerControl() {
11619
11639
  this.control.value = this.value;
11620
11640
  }
11621
11641
  };
@@ -16000,6 +16020,7 @@
16000
16020
  dividerBackgroundColor: 'divider-background-color',
16001
16021
  headerBackgroundColor: 'header-background-color',
16002
16022
  sectionBackgroundColor: 'section-background-color',
16023
+ sectionBackgroundImage: 'section-background-image',
16003
16024
  buttonFillPrimaryColor: 'button-fill-primary-color',
16004
16025
  buttonPrimaryFontColor: 'button-primary-font-color',
16005
16026
  buttonFillAccentColor: 'button-fill-accent-color',
@@ -16032,6 +16053,7 @@
16032
16053
  largePadding: 'large-padding',
16033
16054
  labelHeight: 'label-height',
16034
16055
  borderWidth: 'border-width',
16056
+ dividerWidth: 'divider-width',
16035
16057
  iconSize: 'icon-size',
16036
16058
  groupHeaderTextTransform: 'group-header-text-transform',
16037
16059
  drawerWidth: 'drawer-width',
@@ -16250,6 +16272,11 @@
16250
16272
  const applicationBackgroundColor = DesignToken.create(styleNameFromTokenName(tokenNames.applicationBackgroundColor)).withDefault((element) => getColorForTheme(element, White, Black85, ForestGreen));
16251
16273
  DesignToken.create(styleNameFromTokenName(tokenNames.headerBackgroundColor)).withDefault((element) => getColorForTheme(element, Black7, Black88, ForestGreen));
16252
16274
  DesignToken.create(styleNameFromTokenName(tokenNames.sectionBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
16275
+ DesignToken.create(styleNameFromTokenName(tokenNames.sectionBackgroundImage)).withDefault((element) => {
16276
+ const start = getColorForTheme(element, Black15, Black82, ForestGreen);
16277
+ const end = getColorForTheme(element, hexToRgbaCssColor(Black15, 0), hexToRgbaCssColor(Black82, 0), hexToRgbaCssColor(ForestGreen, 0));
16278
+ return `linear-gradient(${start}, ${end})`;
16279
+ });
16253
16280
  DesignToken.create(styleNameFromTokenName(tokenNames.dividerBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
16254
16281
  const fillSelectedColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillSelectedColor)).withDefault((element) => hexToRgbaCssColor(getFillSelectedColorForTheme(element), 0.2));
16255
16282
  const fillSelectedRgbPartialColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillSelectedRgbPartialColor)).withDefault((element) => hexToRgbPartial(getFillSelectedColorForTheme(element)));
@@ -16313,6 +16340,7 @@
16313
16340
  const largePadding = DesignToken.create(styleNameFromTokenName(tokenNames.largePadding)).withDefault('24px');
16314
16341
  DesignToken.create(styleNameFromTokenName(tokenNames.labelHeight)).withDefault('16px');
16315
16342
  const borderWidth = DesignToken.create(styleNameFromTokenName(tokenNames.borderWidth)).withDefault('1px');
16343
+ DesignToken.create(styleNameFromTokenName(tokenNames.dividerWidth)).withDefault('2px');
16316
16344
  const iconSize = DesignToken.create(styleNameFromTokenName(tokenNames.iconSize)).withDefault('16px');
16317
16345
  const drawerWidth = DesignToken.create(styleNameFromTokenName(tokenNames.drawerWidth)).withDefault('784px');
16318
16346
  const dialogSmallWidth = DesignToken.create(styleNameFromTokenName(tokenNames.dialogSmallWidth)).withDefault('400px');