@ni/nimble-components 32.8.2 → 32.9.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.
Files changed (43) hide show
  1. package/dist/all-components-bundle.js +112 -139
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +3753 -3747
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/checkbox/index.d.ts +12 -4
  6. package/dist/esm/checkbox/index.js +2 -11
  7. package/dist/esm/checkbox/index.js.map +1 -1
  8. package/dist/esm/combobox/index.d.ts +12 -7
  9. package/dist/esm/combobox/index.js +2 -8
  10. package/dist/esm/combobox/index.js.map +1 -1
  11. package/dist/esm/icons/all-icons.d.ts +1 -0
  12. package/dist/esm/icons/all-icons.js +1 -0
  13. package/dist/esm/icons/all-icons.js.map +1 -1
  14. package/dist/esm/icons/asterisk.d.ts +13 -0
  15. package/dist/esm/icons/asterisk.js +15 -0
  16. package/dist/esm/icons/asterisk.js.map +1 -0
  17. package/dist/esm/number-field/index.d.ts +12 -11
  18. package/dist/esm/number-field/index.js +2 -8
  19. package/dist/esm/number-field/index.js.map +1 -1
  20. package/dist/esm/patterns/error/template.js +7 -1
  21. package/dist/esm/patterns/error/template.js.map +1 -1
  22. package/dist/esm/patterns/error/testing/error-pattern.pageobject.d.ts +14 -0
  23. package/dist/esm/patterns/error/testing/error-pattern.pageobject.js +46 -0
  24. package/dist/esm/patterns/error/testing/error-pattern.pageobject.js.map +1 -0
  25. package/dist/esm/patterns/error/types.d.ts +16 -5
  26. package/dist/esm/patterns/error/types.js +27 -1
  27. package/dist/esm/patterns/error/types.js.map +1 -1
  28. package/dist/esm/radio-group/index.d.ts +11 -4
  29. package/dist/esm/radio-group/index.js +2 -13
  30. package/dist/esm/radio-group/index.js.map +1 -1
  31. package/dist/esm/rich-text/editor/index.d.ts +12 -16
  32. package/dist/esm/rich-text/editor/index.js +2 -14
  33. package/dist/esm/rich-text/editor/index.js.map +1 -1
  34. package/dist/esm/select/index.d.ts +11 -11
  35. package/dist/esm/select/index.js +2 -8
  36. package/dist/esm/select/index.js.map +1 -1
  37. package/dist/esm/text-area/index.d.ts +12 -18
  38. package/dist/esm/text-area/index.js +2 -15
  39. package/dist/esm/text-area/index.js.map +1 -1
  40. package/dist/esm/text-field/index.d.ts +12 -11
  41. package/dist/esm/text-field/index.js +2 -8
  42. package/dist/esm/text-field/index.js.map +1 -1
  43. package/package.json +2 -2
@@ -18127,6 +18127,10 @@
18127
18127
  name: 'arrows_repeat_16_x_16',
18128
18128
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8.75 11.75 10 14l-6-3 6-3-1.25 2.25ZM8 11h1a4 4 0 0 0 4-4M7.25 5.75 6 8l6-3-6-3 1.25 2.25ZM8 5H7a4 4 0 0 0-4 4" class="cls-1"/></svg>`,
18129
18129
  };
18130
+ const asterisk5X5 = {
18131
+ name: 'asterisk_5_x_5',
18132
+ data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5 5"><path d="m.721 4.076.813-1.372-1.429-.63.266-.84 1.527.349L2.05 0h.883l.154 1.583 1.541-.35.266.84-1.442.631.812 1.372-.715.519L2.5 3.376 1.435 4.595z" class="cls-1"/></svg>`,
18133
+ };
18130
18134
  const at16X16 = {
18131
18135
  name: 'at_16_x_16',
18132
18136
  data: `<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path d="M12.139 3.621a5.5 5.5 0 0 1 1.206 1.845q.435 1.074.436 2.407 0 .961-.275 1.954t-.687 1.646H9.343l-.11-.536a4.6 4.6 0 0 1-.756.415q-.364.155-1.051.155-1.12 0-1.813-.924t-.694-2.49q0-.837.234-1.467.234-.628.639-1.095.377-.44.914-.687a2.5 2.5 0 0 1 1.064-.248q.453 0 .804.169.35.168.543.353v-.425h1.594v5.605h1.168q.248-.543.368-1.178.12-.636.12-1.22 0-1.161-.323-2.036-.322-.877-.892-1.453a3.7 3.7 0 0 0-1.366-.879 4.9 4.9 0 0 0-1.697-.289q-.871 0-1.657.343a4.6 4.6 0 0 0-1.383.928q-.61.598-.992 1.497c-.382.899-.381 1.257-.381 1.972q0 1.167.36 2.068.36.9.958 1.497.596.59 1.386.9a4.5 4.5 0 0 0 1.668.309q.583 0 1.328-.106a9 9 0 0 0 1.321-.279v1.333q-.64.144-1.271.22-.633.074-1.381.075a6.1 6.1 0 0 1-2.325-.433 5.4 5.4 0 0 1-1.852-1.23 5.6 5.6 0 0 1-1.212-1.91 6.7 6.7 0 0 1-.436-2.444q0-1.278.453-2.366a5.9 5.9 0 0 1 1.25-1.9A5.7 5.7 0 0 1 5.781 2.46 5.8 5.8 0 0 1 8.079 2q1.209 0 2.257.426a5.3 5.3 0 0 1 1.803 1.195M9.082 9.652V6.19a3 3 0 0 0-.522-.21 2 2 0 0 0-.543-.065q-.66 0-1.017.577c-.357.577-.357.912-.357 1.58q0 1.085.295 1.607.296.522.975.522.357 0 .625-.141.269-.14.544-.408"/></svg>`,
@@ -20500,8 +20504,68 @@ so this becomes the fallback color for the slot */ ''}
20500
20504
  }
20501
20505
  `;
20502
20506
 
20507
+ /**
20508
+ * The runtime behavior for template overflow detection.
20509
+ * @public
20510
+ */
20511
+ class OverflowBehavior {
20512
+ /**
20513
+ * Creates an instance of OverflowBehavior.
20514
+ * @param target - The element to check for overflow.
20515
+ * @param propertyName - The name of the property to assign the overflow state to.
20516
+ */
20517
+ constructor(target, propertyName) {
20518
+ this.target = target;
20519
+ this.propertyName = propertyName;
20520
+ }
20521
+ /**
20522
+ * Bind this behavior to the source.
20523
+ * @param source - The source to bind to.
20524
+ * @param context - The execution context that the binding is operating within.
20525
+ */
20526
+ bind(source) {
20527
+ this.source = source;
20528
+ this.setSourceValue(false);
20529
+ this.mouseOverHandler = () => {
20530
+ const hasOverflow = this.target.offsetWidth < this.target.scrollWidth;
20531
+ this.setSourceValue(hasOverflow);
20532
+ };
20533
+ this.mouseOutHandler = () => {
20534
+ this.setSourceValue(false);
20535
+ };
20536
+ this.target.addEventListener('mouseover', this.mouseOverHandler);
20537
+ this.target.addEventListener('mouseout', this.mouseOutHandler);
20538
+ }
20539
+ /**
20540
+ * Unbinds this behavior from the source.
20541
+ * @param source - The source to unbind from.
20542
+ */
20543
+ unbind() {
20544
+ this.source = undefined;
20545
+ this.target.removeEventListener('mouseover', this.mouseOverHandler);
20546
+ this.target.removeEventListener('mouseout', this.mouseOutHandler);
20547
+ }
20548
+ setSourceValue(value) {
20549
+ // @ts-expect-error set property on source
20550
+ this.source[this.propertyName] = value;
20551
+ }
20552
+ }
20553
+ /**
20554
+ * A directive that observes if an element has overflow and sets a flag.
20555
+ * @param propertyName - The name of the property to assign the overflow flag.
20556
+ * @public
20557
+ */
20558
+ function overflow(propertyName) {
20559
+ return new AttachedBehaviorHTMLDirective('nimble-overflow', OverflowBehavior, propertyName);
20560
+ }
20561
+
20503
20562
  const errorTextTemplate = html `
20504
- <div class="error-text" title="${x => x.errorText}" aria-live="polite">
20563
+ <div
20564
+ class="error-text"
20565
+ ${overflow('errorHasOverflow')}
20566
+ title="${x => (x.errorHasOverflow && x.errorText ? x.errorText : null)}"
20567
+ aria-live="polite"
20568
+ >
20505
20569
  ${x => x.errorText}
20506
20570
  </div>
20507
20571
  `;
@@ -20546,14 +20610,37 @@ so this becomes the fallback color for the slot */ ''}
20546
20610
  </template>
20547
20611
  `;
20548
20612
 
20613
+ // As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference
20614
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
20615
+ function mixinErrorPattern(base) {
20616
+ /**
20617
+ * The Mixin that provides a concrete column with the API to support being resized
20618
+ * proportionally within a Table.
20619
+ */
20620
+ class ErrorPatternElement extends base {
20621
+ constructor() {
20622
+ super(...arguments);
20623
+ /*
20624
+ * Show the error appearance of the control
20625
+ */
20626
+ this.errorVisible = false;
20627
+ /* @internal
20628
+ * Indicates if the error text has overflowed its container. The value should not be
20629
+ * set directly. Instead, it is used with the `overflow` directive.
20630
+ */
20631
+ this.errorHasOverflow = false;
20632
+ }
20633
+ }
20634
+ attr({ attribute: 'error-text' })(ErrorPatternElement.prototype, 'errorText');
20635
+ attr({ attribute: 'error-visible', mode: 'boolean' })(ErrorPatternElement.prototype, 'errorVisible');
20636
+ observable(ErrorPatternElement.prototype, 'errorHasOverflow');
20637
+ return ErrorPatternElement;
20638
+ }
20639
+
20549
20640
  /**
20550
20641
  * A nimble-styled checkbox control.
20551
20642
  */
20552
- class Checkbox extends Checkbox$1 {
20553
- constructor() {
20554
- super(...arguments);
20555
- this.errorVisible = false;
20556
- }
20643
+ class Checkbox extends mixinErrorPattern(Checkbox$1) {
20557
20644
  /**
20558
20645
  * @internal
20559
20646
  */
@@ -20565,12 +20652,6 @@ so this becomes the fallback color for the slot */ ''}
20565
20652
  __decorate$1([
20566
20653
  attr({ attribute: 'tabindex', converter: nullableNumberConverter })
20567
20654
  ], Checkbox.prototype, "tabIndex", void 0);
20568
- __decorate$1([
20569
- attr({ attribute: 'error-text' })
20570
- ], Checkbox.prototype, "errorText", void 0);
20571
- __decorate$1([
20572
- attr({ attribute: 'error-visible', mode: 'boolean' })
20573
- ], Checkbox.prototype, "errorVisible", void 0);
20574
20655
  const nimbleCheckbox = Checkbox.compose({
20575
20656
  baseName: 'checkbox',
20576
20657
  baseClass: Checkbox$1,
@@ -21122,61 +21203,6 @@ so this becomes the fallback color for the slot */ ''}
21122
21203
  }
21123
21204
  `));
21124
21205
 
21125
- /**
21126
- * The runtime behavior for template overflow detection.
21127
- * @public
21128
- */
21129
- class OverflowBehavior {
21130
- /**
21131
- * Creates an instance of OverflowBehavior.
21132
- * @param target - The element to check for overflow.
21133
- * @param propertyName - The name of the property to assign the overflow state to.
21134
- */
21135
- constructor(target, propertyName) {
21136
- this.target = target;
21137
- this.propertyName = propertyName;
21138
- }
21139
- /**
21140
- * Bind this behavior to the source.
21141
- * @param source - The source to bind to.
21142
- * @param context - The execution context that the binding is operating within.
21143
- */
21144
- bind(source) {
21145
- this.source = source;
21146
- this.setSourceValue(false);
21147
- this.mouseOverHandler = () => {
21148
- const hasOverflow = this.target.offsetWidth < this.target.scrollWidth;
21149
- this.setSourceValue(hasOverflow);
21150
- };
21151
- this.mouseOutHandler = () => {
21152
- this.setSourceValue(false);
21153
- };
21154
- this.target.addEventListener('mouseover', this.mouseOverHandler);
21155
- this.target.addEventListener('mouseout', this.mouseOutHandler);
21156
- }
21157
- /**
21158
- * Unbinds this behavior from the source.
21159
- * @param source - The source to unbind from.
21160
- */
21161
- unbind() {
21162
- this.source = undefined;
21163
- this.target.removeEventListener('mouseover', this.mouseOverHandler);
21164
- this.target.removeEventListener('mouseout', this.mouseOutHandler);
21165
- }
21166
- setSourceValue(value) {
21167
- // @ts-expect-error set property on source
21168
- this.source[this.propertyName] = value;
21169
- }
21170
- }
21171
- /**
21172
- * A directive that observes if an element has overflow and sets a flag.
21173
- * @param propertyName - The name of the property to assign the overflow flag.
21174
- * @public
21175
- */
21176
- function overflow(propertyName) {
21177
- return new AttachedBehaviorHTMLDirective('nimble-overflow', OverflowBehavior, propertyName);
21178
- }
21179
-
21180
21206
  /* eslint-disable @typescript-eslint/indent */
21181
21207
  // prettier-ignore
21182
21208
  const template$z = (context, definition) => html `
@@ -21286,11 +21312,10 @@ so this becomes the fallback color for the slot */ ''}
21286
21312
  /**
21287
21313
  * A nimble-styed HTML combobox
21288
21314
  */
21289
- class Combobox extends FormAssociatedCombobox {
21315
+ class Combobox extends mixinErrorPattern(FormAssociatedCombobox) {
21290
21316
  constructor() {
21291
21317
  super(...arguments);
21292
21318
  this.appearance = DropdownAppearance.underline;
21293
- this.errorVisible = false;
21294
21319
  /**
21295
21320
  * The open attribute.
21296
21321
  */
@@ -21886,12 +21911,6 @@ so this becomes the fallback color for the slot */ ''}
21886
21911
  __decorate$1([
21887
21912
  attr
21888
21913
  ], Combobox.prototype, "appearance", void 0);
21889
- __decorate$1([
21890
- attr({ attribute: 'error-text' })
21891
- ], Combobox.prototype, "errorText", void 0);
21892
- __decorate$1([
21893
- attr({ attribute: 'error-visible', mode: 'boolean' })
21894
- ], Combobox.prototype, "errorVisible", void 0);
21895
21914
  __decorate$1([
21896
21915
  attr({ attribute: 'autocomplete', mode: 'fromView' })
21897
21916
  ], Combobox.prototype, "autocomplete", void 0);
@@ -22796,6 +22815,18 @@ so this becomes the fallback color for the slot */ ''}
22796
22815
  }
22797
22816
  registerIcon('icon-arrows-repeat', IconArrowsRepeat);
22798
22817
 
22818
+ // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
22819
+ // See generation source in nimble-components/build/generate-icons
22820
+ /**
22821
+ * The icon component for the 'asterisk' icon
22822
+ */
22823
+ class IconAsterisk extends Icon {
22824
+ constructor() {
22825
+ super(asterisk5X5);
22826
+ }
22827
+ }
22828
+ registerIcon('icon-asterisk', IconAsterisk);
22829
+
22799
22830
  // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
22800
22831
  // See generation source in nimble-components/build/generate-icons
22801
22832
  /**
@@ -26746,11 +26777,10 @@ so this becomes the fallback color for the slot */ ''}
26746
26777
  /**
26747
26778
  * A nimble-styled HTML number input
26748
26779
  */
26749
- class NumberField extends NumberField$1 {
26780
+ class NumberField extends mixinErrorPattern(NumberField$1) {
26750
26781
  constructor() {
26751
26782
  super(...arguments);
26752
26783
  this.appearance = NumberFieldAppearance.underline;
26753
- this.errorVisible = false;
26754
26784
  }
26755
26785
  connectedCallback() {
26756
26786
  super.connectedCallback();
@@ -26761,12 +26791,6 @@ so this becomes the fallback color for the slot */ ''}
26761
26791
  __decorate$1([
26762
26792
  attr
26763
26793
  ], NumberField.prototype, "appearance", void 0);
26764
- __decorate$1([
26765
- attr({ attribute: 'error-text' })
26766
- ], NumberField.prototype, "errorText", void 0);
26767
- __decorate$1([
26768
- attr({ attribute: 'error-visible', mode: 'boolean' })
26769
- ], NumberField.prototype, "errorVisible", void 0);
26770
26794
  /**
26771
26795
  * A function that returns a number-field registration for configuring the component with a DesignSystem.
26772
26796
  *
@@ -27002,18 +27026,8 @@ so this becomes the fallback color for the slot */ ''}
27002
27026
  /**
27003
27027
  * A nimble-styled grouping element for radio buttons
27004
27028
  */
27005
- class RadioGroup extends RadioGroup$1 {
27006
- constructor() {
27007
- super(...arguments);
27008
- this.errorVisible = false;
27009
- }
27029
+ class RadioGroup extends mixinErrorPattern(RadioGroup$1) {
27010
27030
  }
27011
- __decorate$1([
27012
- attr({ attribute: 'error-text' })
27013
- ], RadioGroup.prototype, "errorText", void 0);
27014
- __decorate$1([
27015
- attr({ attribute: 'error-visible', mode: 'boolean' })
27016
- ], RadioGroup.prototype, "errorVisible", void 0);
27017
27031
  const nimbleRadioGroup = RadioGroup.compose({
27018
27032
  baseName: 'radio-group',
27019
27033
  baseClass: RadioGroup$1,
@@ -59848,7 +59862,7 @@ img.ProseMirror-separator {
59848
59862
  /**
59849
59863
  * A nimble styled rich text editor
59850
59864
  */
59851
- class RichTextEditor extends RichText {
59865
+ class RichTextEditor extends mixinErrorPattern(RichText) {
59852
59866
  constructor() {
59853
59867
  super(...arguments);
59854
59868
  /**
@@ -59881,13 +59895,6 @@ img.ProseMirror-separator {
59881
59895
  * HTML Attribute: footer-hidden
59882
59896
  */
59883
59897
  this.footerHidden = false;
59884
- /**
59885
- * Whether to display the error state.
59886
- *
59887
- * @public
59888
- * HTML Attribute: error-visible
59889
- */
59890
- this.errorVisible = false;
59891
59898
  /**
59892
59899
  * The width of the vertical scrollbar, if displayed.
59893
59900
  * @internal
@@ -60358,12 +60365,6 @@ img.ProseMirror-separator {
60358
60365
  __decorate$1([
60359
60366
  attr({ attribute: 'footer-hidden', mode: 'boolean' })
60360
60367
  ], RichTextEditor.prototype, "footerHidden", void 0);
60361
- __decorate$1([
60362
- attr({ attribute: 'error-visible', mode: 'boolean' })
60363
- ], RichTextEditor.prototype, "errorVisible", void 0);
60364
- __decorate$1([
60365
- attr({ attribute: 'error-text' })
60366
- ], RichTextEditor.prototype, "errorText", void 0);
60367
60368
  __decorate$1([
60368
60369
  attr
60369
60370
  ], RichTextEditor.prototype, "placeholder", void 0);
@@ -61078,11 +61079,10 @@ img.ProseMirror-separator {
61078
61079
  /**
61079
61080
  * A nimble-styled HTML select.
61080
61081
  */
61081
- class Select extends FormAssociatedSelect {
61082
+ class Select extends mixinErrorPattern(FormAssociatedSelect) {
61082
61083
  constructor() {
61083
61084
  super(...arguments);
61084
61085
  this.appearance = DropdownAppearance.underline;
61085
- this.errorVisible = false;
61086
61086
  this.filterMode = FilterMode.none;
61087
61087
  this.clearable = false;
61088
61088
  this.loadingVisible = false;
@@ -62071,12 +62071,6 @@ img.ProseMirror-separator {
62071
62071
  __decorate$1([
62072
62072
  attr({ attribute: 'position' })
62073
62073
  ], Select.prototype, "positionAttribute", void 0);
62074
- __decorate$1([
62075
- attr({ attribute: 'error-text' })
62076
- ], Select.prototype, "errorText", void 0);
62077
- __decorate$1([
62078
- attr({ attribute: 'error-visible', mode: 'boolean' })
62079
- ], Select.prototype, "errorVisible", void 0);
62080
62074
  __decorate$1([
62081
62075
  attr({ attribute: 'filter-mode' })
62082
62076
  ], Select.prototype, "filterMode", void 0);
@@ -74589,7 +74583,7 @@ focus outline in that case.
74589
74583
  /**
74590
74584
  * A nimble-styed HTML text area
74591
74585
  */
74592
- class TextArea extends TextArea$1 {
74586
+ class TextArea extends mixinErrorPattern(TextArea$1) {
74593
74587
  constructor() {
74594
74588
  super(...arguments);
74595
74589
  /**
@@ -74600,14 +74594,6 @@ focus outline in that case.
74600
74594
  * HTML Attribute: appearance
74601
74595
  */
74602
74596
  this.appearance = TextAreaAppearance.outline;
74603
- /**
74604
- * Whether to display the error state.
74605
- *
74606
- * @public
74607
- * @remarks
74608
- * HTML Attribute: error-visible
74609
- */
74610
- this.errorVisible = false;
74611
74597
  /**
74612
74598
  * The width of the vertical scrollbar, if displayed.
74613
74599
  * @internal
@@ -74678,12 +74664,6 @@ focus outline in that case.
74678
74664
  __decorate$1([
74679
74665
  attr
74680
74666
  ], TextArea.prototype, "appearance", void 0);
74681
- __decorate$1([
74682
- attr({ attribute: 'error-text' })
74683
- ], TextArea.prototype, "errorText", void 0);
74684
- __decorate$1([
74685
- attr({ attribute: 'error-visible', mode: 'boolean' })
74686
- ], TextArea.prototype, "errorVisible", void 0);
74687
74667
  __decorate$1([
74688
74668
  observable
74689
74669
  ], TextArea.prototype, "scrollbarWidth", void 0);
@@ -74950,7 +74930,7 @@ focus outline in that case.
74950
74930
  /**
74951
74931
  * A nimble-styed HTML text input
74952
74932
  */
74953
- class TextField extends TextField$1 {
74933
+ class TextField extends mixinErrorPattern(TextField$1) {
74954
74934
  constructor() {
74955
74935
  super(...arguments);
74956
74936
  /**
@@ -74961,19 +74941,12 @@ focus outline in that case.
74961
74941
  * HTML Attribute: appearance
74962
74942
  */
74963
74943
  this.appearance = TextFieldAppearance.underline;
74964
- this.errorVisible = false;
74965
74944
  this.fullBleed = false;
74966
74945
  }
74967
74946
  }
74968
74947
  __decorate$1([
74969
74948
  attr
74970
74949
  ], TextField.prototype, "appearance", void 0);
74971
- __decorate$1([
74972
- attr({ attribute: 'error-text' })
74973
- ], TextField.prototype, "errorText", void 0);
74974
- __decorate$1([
74975
- attr({ attribute: 'error-visible', mode: 'boolean' })
74976
- ], TextField.prototype, "errorVisible", void 0);
74977
74950
  __decorate$1([
74978
74951
  attr({ attribute: 'full-bleed', mode: 'boolean' })
74979
74952
  ], TextField.prototype, "fullBleed", void 0);