@ni/nimble-components 18.7.0 → 18.8.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.
- package/dist/all-components-bundle.js +230 -25
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1168 -1062
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/all-components.d.ts +1 -0
- package/dist/esm/all-components.js +1 -0
- package/dist/esm/all-components.js.map +1 -1
- package/dist/esm/anchor-menu-item/index.d.ts +38 -0
- package/dist/esm/anchor-menu-item/index.js +109 -0
- package/dist/esm/anchor-menu-item/index.js.map +1 -0
- package/dist/esm/anchor-menu-item/styles.d.ts +1 -0
- package/dist/esm/anchor-menu-item/styles.js +80 -0
- package/dist/esm/anchor-menu-item/styles.js.map +1 -0
- package/dist/esm/anchor-menu-item/template.d.ts +4 -0
- package/dist/esm/anchor-menu-item/template.js +32 -0
- package/dist/esm/anchor-menu-item/template.js.map +1 -0
- package/dist/esm/table/components/header/styles.js +0 -1
- package/dist/esm/table/components/header/styles.js.map +1 -1
- package/dist/esm/table/components/header/template.js +6 -8
- package/dist/esm/table/components/header/template.js.map +1 -1
- package/package.json +1 -1
|
@@ -16807,9 +16807,9 @@
|
|
|
16807
16807
|
return `${prefix}${uniqueIdCounter++}`;
|
|
16808
16808
|
}
|
|
16809
16809
|
|
|
16810
|
-
const template$
|
|
16810
|
+
const template$l = html `<slot></slot>`;
|
|
16811
16811
|
|
|
16812
|
-
const styles$
|
|
16812
|
+
const styles$K = css `
|
|
16813
16813
|
:host {
|
|
16814
16814
|
display: contents;
|
|
16815
16815
|
}
|
|
@@ -16865,8 +16865,8 @@
|
|
|
16865
16865
|
], ThemeProvider.prototype, "theme", void 0);
|
|
16866
16866
|
const nimbleDesignSystemProvider = ThemeProvider.compose({
|
|
16867
16867
|
baseName: 'theme-provider',
|
|
16868
|
-
styles: styles$
|
|
16869
|
-
template: template$
|
|
16868
|
+
styles: styles$K,
|
|
16869
|
+
template: template$l
|
|
16870
16870
|
});
|
|
16871
16871
|
DesignSystem.getOrCreate()
|
|
16872
16872
|
.withPrefix('nimble')
|
|
@@ -17050,7 +17050,7 @@
|
|
|
17050
17050
|
}
|
|
17051
17051
|
}
|
|
17052
17052
|
|
|
17053
|
-
const styles$
|
|
17053
|
+
const styles$J = css `
|
|
17054
17054
|
${display('inline')}
|
|
17055
17055
|
|
|
17056
17056
|
:host {
|
|
@@ -17133,7 +17133,7 @@
|
|
|
17133
17133
|
`;
|
|
17134
17134
|
|
|
17135
17135
|
// prettier-ignore
|
|
17136
|
-
const template$
|
|
17136
|
+
const template$k = (context, definition) => html `
|
|
17137
17137
|
<a
|
|
17138
17138
|
class="control"
|
|
17139
17139
|
part="control"
|
|
@@ -17206,8 +17206,8 @@
|
|
|
17206
17206
|
const nimbleAnchor = Anchor.compose({
|
|
17207
17207
|
baseName: 'anchor',
|
|
17208
17208
|
baseClass: Anchor$1,
|
|
17209
|
-
template: template$
|
|
17210
|
-
styles: styles$
|
|
17209
|
+
template: template$k,
|
|
17210
|
+
styles: styles$J,
|
|
17211
17211
|
shadowOptions: {
|
|
17212
17212
|
delegatesFocus: true
|
|
17213
17213
|
}
|
|
@@ -17293,7 +17293,7 @@
|
|
|
17293
17293
|
return new MultivaluePropertyStyleSheetBehavior('appearance', value, styles);
|
|
17294
17294
|
}
|
|
17295
17295
|
|
|
17296
|
-
const styles$
|
|
17296
|
+
const styles$I = css `
|
|
17297
17297
|
${display('inline-flex')}
|
|
17298
17298
|
|
|
17299
17299
|
:host {
|
|
@@ -17574,8 +17574,8 @@
|
|
|
17574
17574
|
}
|
|
17575
17575
|
`));
|
|
17576
17576
|
|
|
17577
|
-
const styles$
|
|
17578
|
-
${styles$
|
|
17577
|
+
const styles$H = css `
|
|
17578
|
+
${styles$I}
|
|
17579
17579
|
${buttonAppearanceVariantStyles}
|
|
17580
17580
|
|
|
17581
17581
|
.control {
|
|
@@ -17583,7 +17583,7 @@
|
|
|
17583
17583
|
}
|
|
17584
17584
|
`;
|
|
17585
17585
|
|
|
17586
|
-
const template$
|
|
17586
|
+
const template$j = (context, definition) => html `
|
|
17587
17587
|
<a
|
|
17588
17588
|
class="control"
|
|
17589
17589
|
part="control"
|
|
@@ -17665,8 +17665,8 @@
|
|
|
17665
17665
|
], AnchorButton.prototype, "disabled", void 0);
|
|
17666
17666
|
const nimbleAnchorButton = AnchorButton.compose({
|
|
17667
17667
|
baseName: 'anchor-button',
|
|
17668
|
-
template: template$
|
|
17669
|
-
styles: styles$
|
|
17668
|
+
template: template$j,
|
|
17669
|
+
styles: styles$H,
|
|
17670
17670
|
shadowOptions: {
|
|
17671
17671
|
delegatesFocus: true
|
|
17672
17672
|
}
|
|
@@ -17674,6 +17674,214 @@
|
|
|
17674
17674
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorButton());
|
|
17675
17675
|
DesignSystem.tagFor(AnchorButton);
|
|
17676
17676
|
|
|
17677
|
+
const styles$G = css `
|
|
17678
|
+
${display('grid')}
|
|
17679
|
+
|
|
17680
|
+
:host {
|
|
17681
|
+
font: ${bodyFont};
|
|
17682
|
+
}
|
|
17683
|
+
|
|
17684
|
+
:host(:focus-within:not(:active)) {
|
|
17685
|
+
outline: 2px solid ${borderHoverColor};
|
|
17686
|
+
outline-offset: -2px;
|
|
17687
|
+
}
|
|
17688
|
+
|
|
17689
|
+
:host(:hover) {
|
|
17690
|
+
background: ${fillHoverColor};
|
|
17691
|
+
}
|
|
17692
|
+
|
|
17693
|
+
:host(:active) {
|
|
17694
|
+
background: ${fillSelectedColor};
|
|
17695
|
+
}
|
|
17696
|
+
|
|
17697
|
+
:host([disabled]) {
|
|
17698
|
+
background: transparent;
|
|
17699
|
+
}
|
|
17700
|
+
|
|
17701
|
+
a {
|
|
17702
|
+
display: grid;
|
|
17703
|
+
contain: layout;
|
|
17704
|
+
overflow: visible;
|
|
17705
|
+
box-sizing: border-box;
|
|
17706
|
+
height: ${controlHeight};
|
|
17707
|
+
grid-template-columns: 1fr;
|
|
17708
|
+
column-gap: 8px;
|
|
17709
|
+
grid-template-rows: 1fr;
|
|
17710
|
+
justify-items: start;
|
|
17711
|
+
align-items: center;
|
|
17712
|
+
margin: 0 0;
|
|
17713
|
+
white-space: nowrap;
|
|
17714
|
+
color: ${bodyFontColor};
|
|
17715
|
+
fill: currentcolor;
|
|
17716
|
+
cursor: pointer;
|
|
17717
|
+
text-decoration: none;
|
|
17718
|
+
outline: none;
|
|
17719
|
+
}
|
|
17720
|
+
|
|
17721
|
+
:host([disabled]) a {
|
|
17722
|
+
color: ${bodyDisabledFontColor};
|
|
17723
|
+
fill: currentcolor;
|
|
17724
|
+
cursor: default;
|
|
17725
|
+
}
|
|
17726
|
+
|
|
17727
|
+
:host(.indent-1) a {
|
|
17728
|
+
grid-template-columns: ${iconSize} 1fr;
|
|
17729
|
+
}
|
|
17730
|
+
|
|
17731
|
+
[part='start'] {
|
|
17732
|
+
display: contents;
|
|
17733
|
+
}
|
|
17734
|
+
|
|
17735
|
+
slot[name='start']::slotted(*) {
|
|
17736
|
+
fill: currentcolor;
|
|
17737
|
+
width: ${iconSize};
|
|
17738
|
+
height: ${iconSize};
|
|
17739
|
+
}
|
|
17740
|
+
|
|
17741
|
+
:host(.indent-1) .start {
|
|
17742
|
+
grid-column: 1;
|
|
17743
|
+
}
|
|
17744
|
+
|
|
17745
|
+
:host(.indent-1) .content {
|
|
17746
|
+
grid-column: 2;
|
|
17747
|
+
}
|
|
17748
|
+
|
|
17749
|
+
[part='end'] {
|
|
17750
|
+
display: none;
|
|
17751
|
+
}
|
|
17752
|
+
`;
|
|
17753
|
+
|
|
17754
|
+
const template$i = (context, definition) => html `
|
|
17755
|
+
<template
|
|
17756
|
+
role="menuitem"
|
|
17757
|
+
class="${x => (typeof x.startColumnCount === 'number'
|
|
17758
|
+
? `indent-${x.startColumnCount}`
|
|
17759
|
+
: '')}"
|
|
17760
|
+
aria-disabled="${x => x.disabled}"
|
|
17761
|
+
>
|
|
17762
|
+
<a
|
|
17763
|
+
${ref('anchor')}
|
|
17764
|
+
download="${x => x.download}"
|
|
17765
|
+
href=${x => (x.disabled ? null : x.href)}
|
|
17766
|
+
hreflang="${x => x.hreflang}"
|
|
17767
|
+
ping="${x => x.ping}"
|
|
17768
|
+
referrerpolicy="${x => x.referrerpolicy}"
|
|
17769
|
+
rel="${x => x.rel}"
|
|
17770
|
+
target="${x => x.target}"
|
|
17771
|
+
type="${x => x.type}"
|
|
17772
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
17773
|
+
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
17774
|
+
>
|
|
17775
|
+
${startSlotTemplate(context, definition)}
|
|
17776
|
+
<span class="content" part="content">
|
|
17777
|
+
<slot></slot>
|
|
17778
|
+
</span>
|
|
17779
|
+
${endSlotTemplate(context, definition)}
|
|
17780
|
+
</a>
|
|
17781
|
+
</template>
|
|
17782
|
+
`;
|
|
17783
|
+
|
|
17784
|
+
/**
|
|
17785
|
+
* A nimble-styled anchor menu-item
|
|
17786
|
+
*/
|
|
17787
|
+
class AnchorMenuItem extends AnchorBase {
|
|
17788
|
+
constructor() {
|
|
17789
|
+
super(...arguments);
|
|
17790
|
+
this.disabled = false;
|
|
17791
|
+
/**
|
|
17792
|
+
* There is an assumption that this component is styled using a grid display, and this property
|
|
17793
|
+
* controls which grid column contains the menu item text (i.e. the indentation of the text).
|
|
17794
|
+
* The parent menu sets this value on all its child menu items so their indentations align.
|
|
17795
|
+
* @internal
|
|
17796
|
+
*/
|
|
17797
|
+
this.startColumnCount = 0;
|
|
17798
|
+
}
|
|
17799
|
+
// The following two handlers are workarounds for issues with anchor menu items in submenus.
|
|
17800
|
+
// Events can bubble up the DOM and get handled by the menu item in the parent menu. When that happens,
|
|
17801
|
+
// the menu item's handlers (FAST) return false and prevent the default action, i.e. navigation.
|
|
17802
|
+
// FAST has this issue about supporting links in menus: https://github.com/microsoft/fast/issues/5415
|
|
17803
|
+
/**
|
|
17804
|
+
* @internal
|
|
17805
|
+
*/
|
|
17806
|
+
clickHandler(e) {
|
|
17807
|
+
e.stopImmediatePropagation();
|
|
17808
|
+
return true;
|
|
17809
|
+
}
|
|
17810
|
+
/**
|
|
17811
|
+
* @internal
|
|
17812
|
+
*/
|
|
17813
|
+
keydownHandler(e) {
|
|
17814
|
+
if (e.defaultPrevented) {
|
|
17815
|
+
return false;
|
|
17816
|
+
}
|
|
17817
|
+
switch (e.key) {
|
|
17818
|
+
case keyEnter:
|
|
17819
|
+
e.stopImmediatePropagation();
|
|
17820
|
+
break;
|
|
17821
|
+
}
|
|
17822
|
+
return true;
|
|
17823
|
+
}
|
|
17824
|
+
// The FAST Menu manages the `tabindex` of its menu items. Because of a bug in Chromium
|
|
17825
|
+
// (https://bugs.chromium.org/p/chromium/issues/detail?id=1346606), setting the tabindex on an element
|
|
17826
|
+
// with `delegatesFocus=true` causes the element to lose focus. This causes the menu to close, preventing
|
|
17827
|
+
// arrowing through the items or navigating to the url. As a workaround, we intercept attempts to
|
|
17828
|
+
// set the tabindex on the host and instead set it on the inner anchor.
|
|
17829
|
+
// The referenced Chromium bug is actually fixed, but it hasn't been pulled into Edge yet (it is in
|
|
17830
|
+
// Chrome). Issue https://github.com/ni/nimble/issues/1118 tracks removal of this workaround.
|
|
17831
|
+
setAttribute(qualifiedName, value) {
|
|
17832
|
+
if (qualifiedName === 'tabindex') {
|
|
17833
|
+
this.anchor.setAttribute(qualifiedName, value);
|
|
17834
|
+
}
|
|
17835
|
+
else {
|
|
17836
|
+
super.setAttribute(qualifiedName, value);
|
|
17837
|
+
}
|
|
17838
|
+
}
|
|
17839
|
+
// This is part of the bug workaround described above (in setAttribute)
|
|
17840
|
+
get tabIndex() {
|
|
17841
|
+
return this.anchor.tabIndex;
|
|
17842
|
+
}
|
|
17843
|
+
// This is part of the bug workaround described above (in setAttribute)
|
|
17844
|
+
set tabIndex(value) {
|
|
17845
|
+
this.anchor.tabIndex = value;
|
|
17846
|
+
}
|
|
17847
|
+
}
|
|
17848
|
+
__decorate$1([
|
|
17849
|
+
attr({ mode: 'boolean' })
|
|
17850
|
+
], AnchorMenuItem.prototype, "disabled", void 0);
|
|
17851
|
+
__decorate$1([
|
|
17852
|
+
observable
|
|
17853
|
+
], AnchorMenuItem.prototype, "anchor", void 0);
|
|
17854
|
+
__decorate$1([
|
|
17855
|
+
observable
|
|
17856
|
+
], AnchorMenuItem.prototype, "startColumnCount", void 0);
|
|
17857
|
+
const nimbleAnchorMenuItem = AnchorMenuItem.compose({
|
|
17858
|
+
baseName: 'anchor-menu-item',
|
|
17859
|
+
template: template$i,
|
|
17860
|
+
styles: styles$G,
|
|
17861
|
+
shadowOptions: {
|
|
17862
|
+
delegatesFocus: true
|
|
17863
|
+
}
|
|
17864
|
+
});
|
|
17865
|
+
applyMixins(AnchorMenuItem, StartEnd);
|
|
17866
|
+
DesignSystem.getOrCreate()
|
|
17867
|
+
.withPrefix('nimble')
|
|
17868
|
+
.register(nimbleAnchorMenuItem());
|
|
17869
|
+
DesignSystem.tagFor(AnchorMenuItem);
|
|
17870
|
+
// This is a workaround for the fact that FAST's menu uses `instanceof MenuItem`
|
|
17871
|
+
// in their logic for indenting menu items. Since our AnchorMenuItem derives from
|
|
17872
|
+
// AnchorBase and not FAST's MenuItem, we need to change their MenuItem's definition
|
|
17873
|
+
// of `hasInstance` so that it includes our AnchorMenuItem, too.
|
|
17874
|
+
//
|
|
17875
|
+
// If/when we change FAST to test for the presence of `startColumnCount` instead
|
|
17876
|
+
// of using `instanceof MenuItem`, we can remove this workaround. Here is the
|
|
17877
|
+
// PR into FAST: https://github.com/microsoft/fast/pull/6667
|
|
17878
|
+
const originalInstanceOf = MenuItem$1[Symbol.hasInstance].bind(MenuItem$1);
|
|
17879
|
+
Object.defineProperty(MenuItem$1, Symbol.hasInstance, {
|
|
17880
|
+
value(instance) {
|
|
17881
|
+
return (originalInstanceOf(instance) || instance instanceof AnchorMenuItem);
|
|
17882
|
+
}
|
|
17883
|
+
});
|
|
17884
|
+
|
|
17677
17885
|
const styles$F = css `
|
|
17678
17886
|
${display('inline-flex')}
|
|
17679
17887
|
|
|
@@ -18322,7 +18530,7 @@
|
|
|
18322
18530
|
`));
|
|
18323
18531
|
|
|
18324
18532
|
const styles$A = css `
|
|
18325
|
-
${styles$
|
|
18533
|
+
${styles$I}
|
|
18326
18534
|
${buttonAppearanceVariantStyles}
|
|
18327
18535
|
`;
|
|
18328
18536
|
|
|
@@ -19664,7 +19872,7 @@
|
|
|
19664
19872
|
DesignSystem.tagFor(Checkbox);
|
|
19665
19873
|
|
|
19666
19874
|
const styles$u = css `
|
|
19667
|
-
${styles$
|
|
19875
|
+
${styles$I}
|
|
19668
19876
|
|
|
19669
19877
|
.control[aria-pressed='true'] {
|
|
19670
19878
|
background-color: ${fillSelectedColor};
|
|
@@ -27476,7 +27684,6 @@
|
|
|
27476
27684
|
|
|
27477
27685
|
.sort-indicator {
|
|
27478
27686
|
padding: 0px calc(${standardPadding} / 2);
|
|
27479
|
-
width: ${standardPadding};
|
|
27480
27687
|
}
|
|
27481
27688
|
`;
|
|
27482
27689
|
|
|
@@ -27485,14 +27692,12 @@
|
|
|
27485
27692
|
<template role="columnheader" aria-sort="${x => x.ariaSort}">
|
|
27486
27693
|
<slot></slot>
|
|
27487
27694
|
|
|
27488
|
-
|
|
27489
|
-
|
|
27490
|
-
|
|
27491
|
-
|
|
27492
|
-
|
|
27493
|
-
|
|
27494
|
-
`)}
|
|
27495
|
-
</span>
|
|
27695
|
+
${when(x => x.sortDirection === TableColumnSortDirection.ascending, html `
|
|
27696
|
+
<${iconArrowUpTag} class="sort-indicator" aria-hidden="true"></${iconArrowUpTag}>
|
|
27697
|
+
`)}
|
|
27698
|
+
${when(x => x.sortDirection === TableColumnSortDirection.descending, html `
|
|
27699
|
+
<${iconArrowDownTag} class="sort-indicator" aria-hidden="true"></${iconArrowDownTag}>
|
|
27700
|
+
`)}
|
|
27496
27701
|
</template>
|
|
27497
27702
|
`;
|
|
27498
27703
|
|