@ni/nimble-components 34.2.0 → 34.3.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.
@@ -6781,20 +6781,6 @@
6781
6781
  ], BreadcrumbItem$1.prototype, "separator", void 0);
6782
6782
  applyMixins(BreadcrumbItem$1, StartEnd, DelegatesARIALink);
6783
6783
 
6784
- /**
6785
- * The template for the {@link @ni/fast-foundation#Breadcrumb} component.
6786
- * @public
6787
- */
6788
- const breadcrumbTemplate = (context, definition) => html `
6789
- <template role="navigation">
6790
- <div role="list" class="list" part="list">
6791
- <slot
6792
- ${slotted({ property: "slottedBreadcrumbItems", filter: elements() })}
6793
- ></slot>
6794
- </div>
6795
- </template>
6796
- `;
6797
-
6798
6784
  /**
6799
6785
  * A Breadcrumb Custom HTML Element.
6800
6786
  * @slot - The default slot for the breadcrumb items
@@ -18359,6 +18345,14 @@
18359
18345
  name: 'pot_with_lid_16_x_16',
18360
18346
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M11 4V2H5v2H2v1h12V4ZM6 4V3h4v1Zm-4 9h1v1h10v-1h1V6H2Z" class="cls-1"/></svg>`,
18361
18347
  };
18348
+ const print = {
18349
+ name: 'print',
18350
+ data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M10.55 10.6H8V10h2.25zm-5.3.4-.5 1h6.5l-.5-1zM14 11h-1l1 2v1H2v-1l1-2H2V6l1-2h1V2h8v2h1l1 2zM5 5h6V3H5zm8 8-2-4H5l-2 4zm0-6h-1v1h1z" class="cls-1"/></svg>`,
18351
+ };
18352
+ const qrcodeRead = {
18353
+ name: 'qrcode_read',
18354
+ data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M6 4v2H4V4zm6 0h-2v2h2zm-8 8h2v-2H4zM3 3h2V2H2v3h1zm10-1h-2v1h2v2h1V2zm0 11h-2v1h3v-3h-1zM3 11H2v3h3v-1H3zm7-3H9v1h1zM8 9V7H7v1H6v1h1v1h2V9zm4 3v-1h-1v1zm-1-2h1V7h-2v1h1v1h-1v1H9v1h2zm-4 2h2v-1H7zM5 7H4v2h1V8h1V7zm2-1H6v1h1zm1-2H7v1h1v1h1V4zm1 2v1h1V6z" class="cls-1"/></svg>`,
18355
+ };
18362
18356
  const question16X16 = {
18363
18357
  name: 'question_16_x_16',
18364
18358
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M11.303 5.594a3.3 3.3 0 0 1-.195 1.176 2.6 2.6 0 0 1-.549.885 4 4 0 0 1-.852.672 7.5 7.5 0 0 1-1.121.54v1.501H6.27V8.15q.467-.125.845-.256a3.2 3.2 0 0 0 .793-.429 2.1 2.1 0 0 0 .608-.612 1.45 1.45 0 0 0 .22-.791 1.04 1.04 0 0 0-.423-.939 2.16 2.16 0 0 0-1.195-.28 3.3 3.3 0 0 0-1.068.204 4.9 4.9 0 0 0-1.09.526h-.263V3.566a8 8 0 0 1 1.296-.372A8.2 8.2 0 0 1 7.77 3a4.2 4.2 0 0 1 2.579.718 2.24 2.24 0 0 1 .954 1.876M8.77 13H6.112v-1.737H8.77Z" class="cls-1"/></svg>`,
@@ -19741,12 +19735,71 @@
19741
19735
  });
19742
19736
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
19743
19737
 
19738
+ /**
19739
+ * The template for the {@link @ni/fast-foundation#Breadcrumb} component.
19740
+ * @public
19741
+ */
19742
+ // prettier-ignore
19743
+ const breadcrumbTemplate = (_context, _definition) => html `
19744
+ <template role="navigation">
19745
+ ${when(x => x.showScrollButtons, html `
19746
+ <${buttonTag}
19747
+ content-hidden
19748
+ class="scroll-button left"
19749
+ appearance="${ButtonAppearance.ghost}"
19750
+ @click="${x => x.onScrollLeftClick()}"
19751
+ ${ref('leftScrollButton')}
19752
+ >
19753
+ ${x => scrollForwardLabel.getValueFor(x)}
19754
+ <${iconArrowExpanderLeftTag} slot="start"></${iconArrowExpanderLeftTag}>
19755
+ </${buttonTag}>
19756
+ `)}
19757
+ <div ${ref('list')} role="list" class="list" part="list" tabindex="-1">
19758
+ <slot
19759
+ ${slotted({ property: 'slottedBreadcrumbItems', filter: elements() })}
19760
+ ></slot>
19761
+ </div>
19762
+ ${when(x => x.showScrollButtons, html `
19763
+ <${buttonTag}
19764
+ content-hidden
19765
+ class="scroll-button right"
19766
+ appearance="${ButtonAppearance.ghost}"
19767
+ @click="${x => x.onScrollRightClick()}"
19768
+ >
19769
+ ${x => scrollBackwardLabel.getValueFor(x)}
19770
+ <${iconArrowExpanderRightTag} slot="start"></${iconArrowExpanderRightTag}>
19771
+ </${buttonTag}>
19772
+ `)}
19773
+ </template>
19774
+ `;
19775
+
19744
19776
  const styles$R = css `
19745
- ${display('inline-block')}
19777
+ ${display('inline-flex')}
19778
+
19779
+ :host {
19780
+ flex-direction: row;
19781
+ }
19782
+
19783
+ .scroll-button.left {
19784
+ margin-right: ${smallPadding};
19785
+ }
19746
19786
 
19747
19787
  .list {
19748
- display: flex;
19749
- flex-wrap: wrap;
19788
+ display: inline-flex;
19789
+ max-width: 100%;
19790
+ width: max-content;
19791
+ align-self: end;
19792
+ overflow-x: scroll;
19793
+ scrollbar-width: none;
19794
+ }
19795
+
19796
+ .scroll-button.right {
19797
+ margin-left: ${smallPadding};
19798
+ }
19799
+
19800
+ ::slotted(*) {
19801
+ flex-shrink: 0;
19802
+ white-space: nowrap;
19750
19803
  }
19751
19804
 
19752
19805
  ::slotted(:last-child) {
@@ -19763,10 +19816,63 @@
19763
19816
  * A nimble-styled breadcrumb
19764
19817
  */
19765
19818
  class Breadcrumb extends Breadcrumb$1 {
19819
+ constructor() {
19820
+ super();
19821
+ /**
19822
+ * @internal
19823
+ */
19824
+ this.showScrollButtons = false;
19825
+ this.listResizeObserver = new ResizeObserver(entries => {
19826
+ let listVisibleWidth = entries[0]?.contentRect.width;
19827
+ if (listVisibleWidth !== undefined) {
19828
+ const buttonWidth = this.leftScrollButton?.clientWidth ?? 0;
19829
+ listVisibleWidth = Math.ceil(listVisibleWidth);
19830
+ if (this.showScrollButtons) {
19831
+ listVisibleWidth += buttonWidth * 2;
19832
+ }
19833
+ this.showScrollButtons = listVisibleWidth < this.list.scrollWidth;
19834
+ }
19835
+ });
19836
+ }
19837
+ /**
19838
+ * @internal
19839
+ */
19840
+ onScrollLeftClick() {
19841
+ this.list.scrollBy({
19842
+ left: -this.list.clientWidth,
19843
+ behavior: 'smooth'
19844
+ });
19845
+ }
19846
+ /**
19847
+ * @internal
19848
+ */
19849
+ onScrollRightClick() {
19850
+ this.list.scrollBy({
19851
+ left: this.list.clientWidth,
19852
+ behavior: 'smooth'
19853
+ });
19854
+ }
19855
+ /**
19856
+ * @internal
19857
+ */
19858
+ connectedCallback() {
19859
+ super.connectedCallback();
19860
+ this.listResizeObserver.observe(this.list);
19861
+ }
19862
+ /**
19863
+ * @internal
19864
+ */
19865
+ disconnectedCallback() {
19866
+ super.disconnectedCallback();
19867
+ this.listResizeObserver.disconnect();
19868
+ }
19766
19869
  }
19767
19870
  __decorate([
19768
19871
  attr
19769
19872
  ], Breadcrumb.prototype, "appearance", void 0);
19873
+ __decorate([
19874
+ observable
19875
+ ], Breadcrumb.prototype, "showScrollButtons", void 0);
19770
19876
  const nimbleBreadcrumb = Breadcrumb.compose({
19771
19877
  baseName: 'breadcrumb',
19772
19878
  baseClass: Breadcrumb$1,
@@ -24331,6 +24437,30 @@ so this becomes the fallback color for the slot */ ''}
24331
24437
  }
24332
24438
  registerIcon('icon-pot-with-lid', IconPotWithLid);
24333
24439
 
24440
+ // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
24441
+ // See generation source in nimble-components/build/generate-icons
24442
+ /**
24443
+ * The icon component for the 'print' icon
24444
+ */
24445
+ class IconPrint extends Icon {
24446
+ constructor() {
24447
+ super(print);
24448
+ }
24449
+ }
24450
+ registerIcon('icon-print', IconPrint);
24451
+
24452
+ // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
24453
+ // See generation source in nimble-components/build/generate-icons
24454
+ /**
24455
+ * The icon component for the 'qrcodeRead' icon
24456
+ */
24457
+ class IconQrcodeRead extends Icon {
24458
+ constructor() {
24459
+ super(qrcodeRead);
24460
+ }
24461
+ }
24462
+ registerIcon('icon-qrcode-read', IconQrcodeRead);
24463
+
24334
24464
  // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
24335
24465
  // See generation source in nimble-components/build/generate-icons
24336
24466
  /**