@ni/spright-components 4.1.15 → 4.1.17
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.
|
@@ -12875,31 +12875,6 @@
|
|
|
12875
12875
|
attr({ mode: "boolean" })
|
|
12876
12876
|
], Tab$1.prototype, "disabled", void 0);
|
|
12877
12877
|
|
|
12878
|
-
/**
|
|
12879
|
-
* The template for the {@link @microsoft/fast-foundation#(Tabs:class)} component.
|
|
12880
|
-
* @public
|
|
12881
|
-
*/
|
|
12882
|
-
const tabsTemplate = (context, definition) => html `
|
|
12883
|
-
<template class="${x => x.orientation}">
|
|
12884
|
-
${startSlotTemplate(context, definition)}
|
|
12885
|
-
<div class="tablist" part="tablist" role="tablist">
|
|
12886
|
-
<slot class="tab" name="tab" part="tab" ${slotted("tabs")}></slot>
|
|
12887
|
-
|
|
12888
|
-
${when(x => x.showActiveIndicator, html `
|
|
12889
|
-
<div
|
|
12890
|
-
${ref("activeIndicatorRef")}
|
|
12891
|
-
class="activeIndicator"
|
|
12892
|
-
part="activeIndicator"
|
|
12893
|
-
></div>
|
|
12894
|
-
`)}
|
|
12895
|
-
</div>
|
|
12896
|
-
${endSlotTemplate(context, definition)}
|
|
12897
|
-
<div class="tabpanel" part="tabpanel">
|
|
12898
|
-
<slot name="tabpanel" ${slotted("tabpanels")}></slot>
|
|
12899
|
-
</div>
|
|
12900
|
-
</template>
|
|
12901
|
-
`;
|
|
12902
|
-
|
|
12903
12878
|
/**
|
|
12904
12879
|
* The orientation of the {@link @microsoft/fast-foundation#(Tabs:class)} component
|
|
12905
12880
|
* @public
|
|
@@ -17714,6 +17689,7 @@
|
|
|
17714
17689
|
align-items: center;
|
|
17715
17690
|
justify-content: center;
|
|
17716
17691
|
cursor: pointer;
|
|
17692
|
+
text-wrap: nowrap;
|
|
17717
17693
|
--ni-private-active-indicator-width: 2px;
|
|
17718
17694
|
--ni-private-focus-indicator-width: 1px;
|
|
17719
17695
|
--ni-private-indicator-lines-gap: 1px;
|
|
@@ -17880,810 +17856,116 @@
|
|
|
17880
17856
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorTab());
|
|
17881
17857
|
|
|
17882
17858
|
const styles$X = css `
|
|
17883
|
-
${display$1('
|
|
17884
|
-
|
|
17885
|
-
:host {
|
|
17886
|
-
grid-template-columns: auto 1fr;
|
|
17887
|
-
grid-template-rows: auto 1fr;
|
|
17888
|
-
}
|
|
17889
|
-
|
|
17890
|
-
[part='start'] {
|
|
17891
|
-
display: none;
|
|
17892
|
-
}
|
|
17893
|
-
|
|
17894
|
-
.tablist {
|
|
17895
|
-
display: grid;
|
|
17896
|
-
grid-template-rows: auto auto;
|
|
17897
|
-
grid-template-columns: auto;
|
|
17898
|
-
width: max-content;
|
|
17899
|
-
align-self: end;
|
|
17900
|
-
}
|
|
17901
|
-
`;
|
|
17902
|
-
|
|
17903
|
-
const template$I = (context, definition) => html `
|
|
17904
|
-
${startSlotTemplate(context, definition)}
|
|
17905
|
-
<div ${ref('tablist')} class="tablist" part="tablist" role="tablist">
|
|
17906
|
-
<slot name="anchortab" ${slotted('tabs')}></slot>
|
|
17907
|
-
</div>
|
|
17908
|
-
${endSlotTemplate(context, definition)}
|
|
17909
|
-
`;
|
|
17910
|
-
|
|
17911
|
-
/**
|
|
17912
|
-
* A nimble-styled set of anchor tabs
|
|
17913
|
-
*/
|
|
17914
|
-
class AnchorTabs extends FoundationElement {
|
|
17915
|
-
constructor() {
|
|
17916
|
-
super(...arguments);
|
|
17917
|
-
this.tabIds = [];
|
|
17918
|
-
this.isDisabledElement = (el) => {
|
|
17919
|
-
return el.getAttribute('aria-disabled') === 'true';
|
|
17920
|
-
};
|
|
17921
|
-
this.isHiddenElement = (el) => {
|
|
17922
|
-
return el.hasAttribute('hidden');
|
|
17923
|
-
};
|
|
17924
|
-
this.isFocusableElement = (el) => {
|
|
17925
|
-
return !this.isDisabledElement(el) && !this.isHiddenElement(el);
|
|
17926
|
-
};
|
|
17927
|
-
this.setTabs = () => {
|
|
17928
|
-
const gridHorizontalProperty = 'gridColumn';
|
|
17929
|
-
const gridVerticalProperty = 'gridRow';
|
|
17930
|
-
this.activetab = undefined;
|
|
17931
|
-
let firstFocusableTab;
|
|
17932
|
-
this.tabs.forEach((tab, index) => {
|
|
17933
|
-
const tabId = this.tabIds[index];
|
|
17934
|
-
const isActiveTab = this.activeid === tabId;
|
|
17935
|
-
if (!firstFocusableTab && this.isFocusableElement(tab)) {
|
|
17936
|
-
firstFocusableTab = tab;
|
|
17937
|
-
}
|
|
17938
|
-
const isTabStop = this.activeid === tabId && this.isFocusableElement(tab);
|
|
17939
|
-
tab.setAttribute('id', tabId);
|
|
17940
|
-
if (isActiveTab) {
|
|
17941
|
-
tab.setAttribute('aria-current', 'page');
|
|
17942
|
-
}
|
|
17943
|
-
else {
|
|
17944
|
-
tab.removeAttribute('aria-current');
|
|
17945
|
-
}
|
|
17946
|
-
tab.removeEventListener('click', this.handleTabClick);
|
|
17947
|
-
tab.addEventListener('click', this.handleTabClick);
|
|
17948
|
-
tab.removeEventListener('keydown', this.handleTabKeyDown);
|
|
17949
|
-
tab.addEventListener('keydown', this.handleTabKeyDown);
|
|
17950
|
-
tab.setAttribute('tabindex', isTabStop ? '0' : '-1');
|
|
17951
|
-
if (isActiveTab) {
|
|
17952
|
-
this.activetab = tab;
|
|
17953
|
-
}
|
|
17954
|
-
tab.style[gridVerticalProperty] = '';
|
|
17955
|
-
tab.style[gridHorizontalProperty] = `${index + 1}`;
|
|
17956
|
-
});
|
|
17957
|
-
if (firstFocusableTab
|
|
17958
|
-
&& (!this.activetab || !this.isFocusableElement(this.activetab))) {
|
|
17959
|
-
firstFocusableTab.setAttribute('tabindex', '0');
|
|
17960
|
-
}
|
|
17961
|
-
};
|
|
17962
|
-
this.handleTabClick = (event) => {
|
|
17963
|
-
const selectedTab = event.currentTarget;
|
|
17964
|
-
if (selectedTab.nodeType === 1
|
|
17965
|
-
&& this.isFocusableElement(selectedTab)) {
|
|
17966
|
-
this.tabs.forEach((tab) => {
|
|
17967
|
-
tab.setAttribute('tabindex', tab === selectedTab ? '0' : '-1');
|
|
17968
|
-
});
|
|
17969
|
-
}
|
|
17970
|
-
};
|
|
17971
|
-
this.handleTabKeyDown = (event) => {
|
|
17972
|
-
let anchor;
|
|
17973
|
-
switch (event.key) {
|
|
17974
|
-
case keyArrowLeft:
|
|
17975
|
-
event.preventDefault();
|
|
17976
|
-
this.adjustBackward();
|
|
17977
|
-
break;
|
|
17978
|
-
case keyArrowRight:
|
|
17979
|
-
event.preventDefault();
|
|
17980
|
-
this.adjustForward();
|
|
17981
|
-
break;
|
|
17982
|
-
case keyHome:
|
|
17983
|
-
event.preventDefault();
|
|
17984
|
-
this.focusFirstOrLast(false);
|
|
17985
|
-
break;
|
|
17986
|
-
case keyEnd:
|
|
17987
|
-
event.preventDefault();
|
|
17988
|
-
this.focusFirstOrLast(true);
|
|
17989
|
-
break;
|
|
17990
|
-
case keySpace:
|
|
17991
|
-
case keyEnter:
|
|
17992
|
-
event.preventDefault();
|
|
17993
|
-
this.getTabAnchor(event.target).click();
|
|
17994
|
-
break;
|
|
17995
|
-
case 'ContextMenu':
|
|
17996
|
-
event.preventDefault();
|
|
17997
|
-
anchor = this.getTabAnchor(event.target);
|
|
17998
|
-
anchor.focus();
|
|
17999
|
-
anchor.dispatchEvent(new KeyboardEvent('keydown', {
|
|
18000
|
-
key: event.key,
|
|
18001
|
-
bubbles: false
|
|
18002
|
-
}));
|
|
18003
|
-
break;
|
|
18004
|
-
// do nothing
|
|
18005
|
-
}
|
|
18006
|
-
};
|
|
18007
|
-
this.adjustForward = () => {
|
|
18008
|
-
const group = this.tabs;
|
|
18009
|
-
let index = 0;
|
|
18010
|
-
const focusedTab = group.find(x => x === document.activeElement);
|
|
18011
|
-
index = focusedTab ? group.indexOf(focusedTab) + 1 : 1;
|
|
18012
|
-
if (index === group.length) {
|
|
18013
|
-
index = 0;
|
|
18014
|
-
}
|
|
18015
|
-
while (index < group.length && group.length > 1) {
|
|
18016
|
-
if (this.isFocusableElement(group[index])) {
|
|
18017
|
-
this.focusTabByIndex(group, index);
|
|
18018
|
-
break;
|
|
18019
|
-
}
|
|
18020
|
-
else if (focusedTab && index === group.indexOf(focusedTab)) {
|
|
18021
|
-
break;
|
|
18022
|
-
}
|
|
18023
|
-
else if (index + 1 >= group.length) {
|
|
18024
|
-
index = 0;
|
|
18025
|
-
}
|
|
18026
|
-
else {
|
|
18027
|
-
index += 1;
|
|
18028
|
-
}
|
|
18029
|
-
}
|
|
18030
|
-
};
|
|
18031
|
-
this.adjustBackward = () => {
|
|
18032
|
-
const group = this.tabs;
|
|
18033
|
-
let index = 0;
|
|
18034
|
-
const focusedTab = group.find(x => x === document.activeElement);
|
|
18035
|
-
index = focusedTab ? group.indexOf(focusedTab) - 1 : 0;
|
|
18036
|
-
index = index < 0 ? group.length - 1 : index;
|
|
18037
|
-
while (index >= 0 && group.length > 1) {
|
|
18038
|
-
if (this.isFocusableElement(group[index])) {
|
|
18039
|
-
this.focusTabByIndex(group, index);
|
|
18040
|
-
break;
|
|
18041
|
-
}
|
|
18042
|
-
else if (index - 1 < 0) {
|
|
18043
|
-
index = group.length - 1;
|
|
18044
|
-
}
|
|
18045
|
-
else {
|
|
18046
|
-
index -= 1;
|
|
18047
|
-
}
|
|
18048
|
-
}
|
|
18049
|
-
};
|
|
18050
|
-
this.focusTabByIndex = (group, index) => {
|
|
18051
|
-
const focusedTab = group[index];
|
|
18052
|
-
focusedTab.focus();
|
|
18053
|
-
this.tabs.forEach((tab) => {
|
|
18054
|
-
tab.setAttribute('tabindex', tab === focusedTab ? '0' : '-1');
|
|
18055
|
-
tab.setAttribute('aria-selected', tab === focusedTab ? 'true' : 'false');
|
|
18056
|
-
});
|
|
18057
|
-
};
|
|
18058
|
-
}
|
|
18059
|
-
/**
|
|
18060
|
-
* @internal
|
|
18061
|
-
*/
|
|
18062
|
-
activeidChanged(_oldValue, _newValue) {
|
|
18063
|
-
if (this.$fastController.isConnected) {
|
|
18064
|
-
this.setTabs();
|
|
18065
|
-
}
|
|
18066
|
-
}
|
|
18067
|
-
/**
|
|
18068
|
-
* @internal
|
|
18069
|
-
*/
|
|
18070
|
-
tabsChanged() {
|
|
18071
|
-
if (this.$fastController.isConnected) {
|
|
18072
|
-
this.tabIds = this.getTabIds();
|
|
18073
|
-
this.setTabs();
|
|
18074
|
-
}
|
|
18075
|
-
}
|
|
18076
|
-
/**
|
|
18077
|
-
* @internal
|
|
18078
|
-
*/
|
|
18079
|
-
connectedCallback() {
|
|
18080
|
-
super.connectedCallback();
|
|
18081
|
-
this.tabIds = this.getTabIds();
|
|
18082
|
-
}
|
|
18083
|
-
getTabIds() {
|
|
18084
|
-
return this.tabs.map((tab) => {
|
|
18085
|
-
return tab.getAttribute('id') ?? `tab-${uniqueId()}`;
|
|
18086
|
-
});
|
|
18087
|
-
}
|
|
18088
|
-
focusFirstOrLast(focusLast) {
|
|
18089
|
-
const focusableTabs = this.tabs.filter(t => this.isFocusableElement(t));
|
|
18090
|
-
const focusableIndex = focusLast ? focusableTabs.length - 1 : 0;
|
|
18091
|
-
const index = this.tabs.indexOf(focusableTabs[focusableIndex]);
|
|
18092
|
-
if (index > -1) {
|
|
18093
|
-
this.focusTabByIndex(this.tabs, index);
|
|
18094
|
-
}
|
|
18095
|
-
}
|
|
18096
|
-
getTabAnchor(tab) {
|
|
18097
|
-
return tab.shadowRoot.querySelector('a');
|
|
18098
|
-
}
|
|
18099
|
-
}
|
|
18100
|
-
__decorate$1([
|
|
18101
|
-
attr
|
|
18102
|
-
], AnchorTabs.prototype, "activeid", void 0);
|
|
18103
|
-
__decorate$1([
|
|
18104
|
-
observable
|
|
18105
|
-
], AnchorTabs.prototype, "tabs", void 0);
|
|
18106
|
-
applyMixins(AnchorTabs, StartEnd);
|
|
18107
|
-
const nimbleAnchorTabs = AnchorTabs.compose({
|
|
18108
|
-
baseName: 'anchor-tabs',
|
|
18109
|
-
template: template$I,
|
|
18110
|
-
styles: styles$X,
|
|
18111
|
-
shadowOptions: {
|
|
18112
|
-
delegatesFocus: false
|
|
18113
|
-
}
|
|
18114
|
-
});
|
|
18115
|
-
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorTabs());
|
|
18116
|
-
|
|
18117
|
-
/**
|
|
18118
|
-
* Set user-select: none in a way that works across all supported browsers.
|
|
18119
|
-
* https://developer.mozilla.org/en-US/docs/Web/CSS/user-select#browser_compatibility
|
|
18120
|
-
*/
|
|
18121
|
-
const userSelectNone = cssPartial `
|
|
18122
|
-
user-select: none;
|
|
18123
|
-
-webkit-user-select: none;
|
|
18124
|
-
`;
|
|
18125
|
-
|
|
18126
|
-
const styles$W = css `
|
|
18127
|
-
${display$1('block')}
|
|
17859
|
+
${display$1('flex')}
|
|
18128
17860
|
|
|
18129
17861
|
:host {
|
|
18130
|
-
|
|
18131
|
-
/* don't set font-size here or else it overrides what we set on .items */ ''}
|
|
18132
|
-
font-family: ${bodyFontFamily};
|
|
18133
|
-
font-weight: ${bodyFontWeight};
|
|
18134
|
-
contain: content;
|
|
18135
|
-
position: relative;
|
|
18136
|
-
outline: none;
|
|
18137
|
-
color: ${bodyFontColor};
|
|
18138
|
-
cursor: pointer;
|
|
18139
|
-
--ni-private-tree-item-nested-width: 0;
|
|
18140
|
-
}
|
|
18141
|
-
|
|
18142
|
-
:host([disabled]) {
|
|
18143
|
-
color: ${bodyDisabledFontColor};
|
|
18144
|
-
cursor: default;
|
|
18145
|
-
}
|
|
18146
|
-
|
|
18147
|
-
.control {
|
|
18148
|
-
display: flex;
|
|
18149
|
-
text-decoration: none;
|
|
18150
|
-
color: inherit;
|
|
18151
|
-
}
|
|
18152
|
-
|
|
18153
|
-
.control${focusVisible} {
|
|
18154
|
-
box-shadow: 0px 0px 0px ${borderWidth} ${borderHoverColor} inset;
|
|
18155
|
-
outline: ${borderWidth} solid ${borderHoverColor};
|
|
18156
|
-
outline-offset: -2px;
|
|
17862
|
+
flex-direction: column;
|
|
18157
17863
|
}
|
|
18158
17864
|
|
|
18159
|
-
.
|
|
17865
|
+
.tab-bar {
|
|
18160
17866
|
display: flex;
|
|
18161
|
-
position: relative;
|
|
18162
|
-
height: calc(${iconSize} * 2);
|
|
18163
|
-
width: 100%;
|
|
18164
|
-
}
|
|
18165
|
-
|
|
18166
|
-
.positioning-region:hover {
|
|
18167
|
-
background: ${fillHoverColor};
|
|
18168
|
-
}
|
|
18169
|
-
|
|
18170
|
-
:host([disabled]) .positioning-region:hover {
|
|
18171
|
-
background: transparent;
|
|
18172
|
-
}
|
|
18173
|
-
|
|
18174
|
-
:host([selected]) .positioning-region {
|
|
18175
|
-
background: ${fillSelectedColor};
|
|
18176
|
-
}
|
|
18177
|
-
|
|
18178
|
-
:host([selected]) .positioning-region:hover {
|
|
18179
|
-
background: ${fillHoverSelectedColor};
|
|
18180
|
-
}
|
|
18181
|
-
|
|
18182
|
-
.positioning-region::before {
|
|
18183
|
-
content: '';
|
|
18184
|
-
display: block;
|
|
18185
|
-
width: var(--ni-private-tree-item-nested-width);
|
|
18186
|
-
flex-shrink: 0;
|
|
18187
17867
|
}
|
|
18188
17868
|
|
|
18189
|
-
|
|
18190
|
-
display:
|
|
18191
|
-
align-items: center;
|
|
18192
|
-
white-space: nowrap;
|
|
18193
|
-
width: 100%;
|
|
18194
|
-
padding-left: 10px;
|
|
18195
|
-
font: inherit;
|
|
18196
|
-
font-size: ${bodyFontSize};
|
|
18197
|
-
${userSelectNone}
|
|
18198
|
-
position: relative;
|
|
18199
|
-
margin-inline-start: ${iconSize};
|
|
17869
|
+
[part='start'] {
|
|
17870
|
+
display: none;
|
|
18200
17871
|
}
|
|
18201
17872
|
|
|
18202
|
-
|
|
18203
|
-
|
|
18204
|
-
[part="start"] {
|
|
18205
|
-
width: ${iconSize};
|
|
18206
|
-
pointer-events: none;
|
|
17873
|
+
.scroll-button.left {
|
|
17874
|
+
margin-right: ${smallPadding};
|
|
18207
17875
|
}
|
|
18208
17876
|
|
|
18209
|
-
|
|
18210
|
-
.start {
|
|
17877
|
+
.tablist {
|
|
18211
17878
|
display: flex;
|
|
18212
|
-
|
|
18213
|
-
|
|
18214
|
-
|
|
18215
|
-
|
|
18216
|
-
slot[name='start']::slotted(*) {
|
|
18217
|
-
${iconColor.cssCustomProperty}: currentcolor;
|
|
18218
|
-
width: ${iconSize};
|
|
18219
|
-
height: ${iconSize};
|
|
17879
|
+
width: max-content;
|
|
17880
|
+
align-self: end;
|
|
17881
|
+
overflow-x: scroll;
|
|
17882
|
+
scrollbar-width: none;
|
|
18220
17883
|
}
|
|
18221
17884
|
|
|
18222
|
-
.
|
|
18223
|
-
|
|
17885
|
+
.scroll-button.right {
|
|
17886
|
+
margin-left: ${smallPadding};
|
|
18224
17887
|
}
|
|
18225
17888
|
|
|
18226
17889
|
[part='end'] {
|
|
18227
|
-
|
|
17890
|
+
flex: 1;
|
|
18228
17891
|
}
|
|
18229
17892
|
`;
|
|
18230
17893
|
|
|
18231
|
-
const
|
|
18232
|
-
|
|
18233
|
-
|
|
18234
|
-
|
|
18235
|
-
|
|
18236
|
-
|
|
18237
|
-
|
|
18238
|
-
|
|
18239
|
-
|
|
18240
|
-
|
|
18241
|
-
|
|
17894
|
+
const styles$W = css `
|
|
17895
|
+
${styles$$}
|
|
17896
|
+
${buttonAppearanceVariantStyles}
|
|
17897
|
+
`;
|
|
17898
|
+
|
|
17899
|
+
const template$I = (context, definition) => html `
|
|
17900
|
+
<button
|
|
17901
|
+
class="control"
|
|
17902
|
+
part="control"
|
|
17903
|
+
?autofocus="${x => x.autofocus}"
|
|
17904
|
+
?disabled="${x => x.disabled}"
|
|
17905
|
+
form="${x => x.formId}"
|
|
17906
|
+
formaction="${x => x.formaction}"
|
|
17907
|
+
formenctype="${x => x.formenctype}"
|
|
17908
|
+
formmethod="${x => x.formmethod}"
|
|
17909
|
+
formnovalidate="${x => x.formnovalidate}"
|
|
17910
|
+
formtarget="${x => x.formtarget}"
|
|
17911
|
+
name="${x => x.name}"
|
|
17912
|
+
type="${x => x.type}"
|
|
17913
|
+
value="${x => x.value}"
|
|
17914
|
+
tabindex="${x => x.tabIndex}"
|
|
17915
|
+
aria-atomic="${x => x.ariaAtomic}"
|
|
17916
|
+
aria-busy="${x => x.ariaBusy}"
|
|
17917
|
+
aria-controls="${x => x.ariaControls}"
|
|
17918
|
+
aria-current="${x => x.ariaCurrent}"
|
|
17919
|
+
aria-describedby="${x => x.ariaDescribedby}"
|
|
17920
|
+
aria-details="${x => x.ariaDetails}"
|
|
17921
|
+
aria-disabled="${x => x.ariaDisabled}"
|
|
17922
|
+
aria-errormessage="${x => x.ariaErrormessage}"
|
|
17923
|
+
aria-expanded="${x => x.ariaExpanded}"
|
|
17924
|
+
aria-flowto="${x => x.ariaFlowto}"
|
|
17925
|
+
aria-haspopup="${x => x.ariaHaspopup}"
|
|
17926
|
+
aria-hidden="${x => x.ariaHidden}"
|
|
17927
|
+
aria-invalid="${x => x.ariaInvalid}"
|
|
17928
|
+
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
17929
|
+
aria-label="${x => x.ariaLabel}"
|
|
17930
|
+
aria-labelledby="${x => x.ariaLabelledby}"
|
|
17931
|
+
aria-live="${x => x.ariaLive}"
|
|
17932
|
+
aria-owns="${x => x.ariaOwns}"
|
|
17933
|
+
aria-pressed="${x => x.ariaPressed}"
|
|
17934
|
+
aria-relevant="${x => x.ariaRelevant}"
|
|
17935
|
+
aria-roledescription="${x => x.ariaRoledescription}"
|
|
17936
|
+
${ref('control')}
|
|
18242
17937
|
>
|
|
18243
|
-
|
|
18244
|
-
|
|
18245
|
-
|
|
18246
|
-
|
|
18247
|
-
|
|
18248
|
-
|
|
18249
|
-
hreflang="${x => x.hreflang}"
|
|
18250
|
-
ping="${x => x.ping}"
|
|
18251
|
-
referrerpolicy="${x => x.referrerpolicy}"
|
|
18252
|
-
rel="${x => x.rel}"
|
|
18253
|
-
target="${x => x.target}"
|
|
18254
|
-
type="${x => x.type}"
|
|
18255
|
-
${ref('control')}
|
|
18256
|
-
>
|
|
18257
|
-
<div class="positioning-region" part="positioning-region">
|
|
18258
|
-
<div class="content-region" part="content-region">
|
|
18259
|
-
${startSlotTemplate(context, definition)}
|
|
18260
|
-
<span class="content" part="content">
|
|
18261
|
-
<slot></slot>
|
|
18262
|
-
</span>
|
|
18263
|
-
${endSlotTemplate(context, definition)}
|
|
18264
|
-
</div>
|
|
18265
|
-
</div>
|
|
18266
|
-
</a>
|
|
18267
|
-
</template>
|
|
17938
|
+
${startSlotTemplate(context, definition)}
|
|
17939
|
+
<span class="content" part="content">
|
|
17940
|
+
<slot ${slotted('defaultSlottedContent')}></slot>
|
|
17941
|
+
</span>
|
|
17942
|
+
${endSlotTemplate(context, definition)}
|
|
17943
|
+
</button>
|
|
18268
17944
|
`;
|
|
18269
17945
|
|
|
18270
17946
|
/**
|
|
18271
|
-
* A nimble-styled
|
|
17947
|
+
* A nimble-styled HTML button
|
|
18272
17948
|
*/
|
|
18273
|
-
class
|
|
17949
|
+
class Button extends Button$1 {
|
|
18274
17950
|
constructor() {
|
|
18275
17951
|
super(...arguments);
|
|
18276
17952
|
/**
|
|
18277
|
-
* When true, the control will appear selected by user interaction.
|
|
18278
17953
|
* @public
|
|
18279
17954
|
* @remarks
|
|
18280
|
-
* HTML Attribute:
|
|
17955
|
+
* HTML Attribute: appearance
|
|
18281
17956
|
*/
|
|
18282
|
-
this.
|
|
17957
|
+
this.appearance = ButtonAppearance.outline;
|
|
18283
17958
|
/**
|
|
18284
|
-
* When true, the control will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled | disabled HTML attribute} for more information.
|
|
18285
17959
|
* @public
|
|
18286
17960
|
* @remarks
|
|
18287
|
-
* HTML Attribute:
|
|
17961
|
+
* HTML Attribute: content-hidden
|
|
18288
17962
|
*/
|
|
18289
|
-
this.
|
|
18290
|
-
}
|
|
18291
|
-
/**
|
|
18292
|
-
* Whether the tree is nested
|
|
18293
|
-
*
|
|
18294
|
-
* @public
|
|
18295
|
-
*/
|
|
18296
|
-
isNestedItem() {
|
|
18297
|
-
return isTreeItemElement(this.parentElement);
|
|
18298
|
-
}
|
|
18299
|
-
/**
|
|
18300
|
-
* Handle focus events
|
|
18301
|
-
*
|
|
18302
|
-
* @internal
|
|
18303
|
-
*/
|
|
18304
|
-
handleFocus(_e) {
|
|
18305
|
-
this.setAttribute('tabindex', '0');
|
|
18306
|
-
}
|
|
18307
|
-
/**
|
|
18308
|
-
* Handle blur events
|
|
18309
|
-
*
|
|
18310
|
-
* @internal
|
|
18311
|
-
*/
|
|
18312
|
-
handleBlur(_e) {
|
|
18313
|
-
this.setAttribute('tabindex', '-1');
|
|
18314
|
-
}
|
|
18315
|
-
/**
|
|
18316
|
-
* @internal
|
|
18317
|
-
*/
|
|
18318
|
-
keydownHandler(e) {
|
|
18319
|
-
if (e.defaultPrevented) {
|
|
18320
|
-
return false;
|
|
18321
|
-
}
|
|
18322
|
-
switch (e.key) {
|
|
18323
|
-
case keyEnter:
|
|
18324
|
-
// Do not let the event bubble up to the FAST tree, or it will
|
|
18325
|
-
// prevent the default action.
|
|
18326
|
-
e.stopPropagation();
|
|
18327
|
-
break;
|
|
18328
|
-
case keyArrowLeft:
|
|
18329
|
-
// For FAST tree items, the FAST tree view handles this navigation,
|
|
18330
|
-
// but since our anchor tree item is not "instanceof FASTTreeItem",
|
|
18331
|
-
// the FAST tree view won't do this for us. We do it ourselves.
|
|
18332
|
-
if (this.parentElement && this.isNestedItem()) {
|
|
18333
|
-
TreeItem$1.focusItem(this.parentElement);
|
|
18334
|
-
}
|
|
18335
|
-
break;
|
|
18336
|
-
}
|
|
18337
|
-
return true;
|
|
18338
|
-
}
|
|
18339
|
-
/**
|
|
18340
|
-
* Activating the anchor by pressing the Enter key results in a click event.
|
|
18341
|
-
* This bubbles up to the Nimble tree-view's click handler, causing the tree item
|
|
18342
|
-
* to be selected. We don't want that for anchor tree items. We'll stop propagation
|
|
18343
|
-
* of the event to prevent that.
|
|
18344
|
-
* @internal
|
|
18345
|
-
*/
|
|
18346
|
-
clickHandler(e) {
|
|
18347
|
-
if (e.defaultPrevented) {
|
|
18348
|
-
return false;
|
|
18349
|
-
}
|
|
18350
|
-
e.stopPropagation();
|
|
18351
|
-
return true;
|
|
18352
|
-
}
|
|
18353
|
-
selectedChanged(_prev, _next) {
|
|
18354
|
-
if (this.$fastController.isConnected) {
|
|
18355
|
-
this.$emit('selected-change', this);
|
|
18356
|
-
}
|
|
17963
|
+
this.contentHidden = false;
|
|
18357
17964
|
}
|
|
18358
17965
|
}
|
|
18359
17966
|
__decorate$1([
|
|
18360
|
-
attr
|
|
18361
|
-
],
|
|
18362
|
-
__decorate$1([
|
|
18363
|
-
attr({ mode: 'boolean' })
|
|
18364
|
-
], AnchorTreeItem.prototype, "disabled", void 0);
|
|
18365
|
-
// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
|
|
18366
|
-
const nimbleAnchorTreeItem = AnchorTreeItem.compose({
|
|
18367
|
-
baseName: 'anchor-tree-item',
|
|
18368
|
-
template: template$H,
|
|
18369
|
-
styles: styles$W,
|
|
18370
|
-
shadowOptions: {
|
|
18371
|
-
delegatesFocus: true
|
|
18372
|
-
}
|
|
18373
|
-
});
|
|
18374
|
-
DesignSystem.getOrCreate()
|
|
18375
|
-
.withPrefix('nimble')
|
|
18376
|
-
.register(nimbleAnchorTreeItem());
|
|
18377
|
-
|
|
18378
|
-
const ZIndexLevels = {
|
|
18379
|
-
zIndex1: '1',
|
|
18380
|
-
// Original usages of 1000 were to compete with jqx grid usage of z-index 200 for table headers
|
|
18381
|
-
// See: https://github.com/ni/nimble/pull/530#discussion_r863076750
|
|
18382
|
-
zIndex1000: '1000'
|
|
18383
|
-
};
|
|
18384
|
-
|
|
18385
|
-
const styles$V = css `
|
|
18386
|
-
${display$1('block')}
|
|
18387
|
-
|
|
18388
|
-
:host {
|
|
18389
|
-
contain: layout;
|
|
18390
|
-
z-index: ${ZIndexLevels.zIndex1000};
|
|
18391
|
-
}
|
|
18392
|
-
|
|
18393
|
-
${'' /* Override 'display' helper hidden behavior */}
|
|
18394
|
-
:host([hidden]) {
|
|
18395
|
-
display: block;
|
|
18396
|
-
visibility: hidden;
|
|
18397
|
-
}
|
|
18398
|
-
`;
|
|
18399
|
-
|
|
18400
|
-
// When the anchor element changes position on the page, it is the client's responsibility to update the position
|
|
18401
|
-
// of the anchored region by calling update() on the anchored region.
|
|
18402
|
-
//
|
|
18403
|
-
// When the anchor element is recreated on the page, it is the client's responsibility to reset the reference the
|
|
18404
|
-
// anchored region has to the anchor element. This can be done by either recreating the anchor element with a new
|
|
18405
|
-
// ID that is also set as the \`anchor\` attribute on the anchored region or by explicitly setting the value of
|
|
18406
|
-
// anchorElement on the anchored region to the new anchor element.
|
|
18407
|
-
/**
|
|
18408
|
-
* A nimble-styled anchored region control.
|
|
18409
|
-
*/
|
|
18410
|
-
class AnchoredRegion extends AnchoredRegion$1 {
|
|
18411
|
-
}
|
|
18412
|
-
const nimbleAnchoredRegion = AnchoredRegion.compose({
|
|
18413
|
-
baseName: 'anchored-region',
|
|
18414
|
-
baseClass: AnchoredRegion$1,
|
|
18415
|
-
template: anchoredRegionTemplate,
|
|
18416
|
-
styles: styles$V
|
|
18417
|
-
});
|
|
18418
|
-
DesignSystem.getOrCreate()
|
|
18419
|
-
.withPrefix('nimble')
|
|
18420
|
-
.register(nimbleAnchoredRegion());
|
|
18421
|
-
const anchoredRegionTag = 'nimble-anchored-region';
|
|
18422
|
-
|
|
18423
|
-
/**
|
|
18424
|
-
* Subscription for {@link ThemeStyleSheetBehavior}
|
|
18425
|
-
*/
|
|
18426
|
-
class ThemeStyleSheetBehaviorSubscription {
|
|
18427
|
-
constructor(value, styles, source) {
|
|
18428
|
-
this.value = value;
|
|
18429
|
-
this.styles = styles;
|
|
18430
|
-
this.source = source;
|
|
18431
|
-
}
|
|
18432
|
-
handleChange() {
|
|
18433
|
-
const theme$1 = theme.getValueFor(this.source);
|
|
18434
|
-
if (Array.isArray(this.value)
|
|
18435
|
-
? this.value.includes(theme$1)
|
|
18436
|
-
: this.value === theme$1) {
|
|
18437
|
-
this.source.$fastController.addStyles(this.styles);
|
|
18438
|
-
}
|
|
18439
|
-
else {
|
|
18440
|
-
this.source.$fastController.removeStyles(this.styles);
|
|
18441
|
-
}
|
|
18442
|
-
}
|
|
18443
|
-
}
|
|
18444
|
-
/**
|
|
18445
|
-
* Behavior to conditionally apply theme-based stylesheets.
|
|
18446
|
-
*/
|
|
18447
|
-
class ThemeStyleSheetBehavior {
|
|
18448
|
-
constructor(theme, styles) {
|
|
18449
|
-
this.theme = theme;
|
|
18450
|
-
this.styles = styles;
|
|
18451
|
-
this.cache = new WeakMap();
|
|
18452
|
-
}
|
|
18453
|
-
/**
|
|
18454
|
-
* @internal
|
|
18455
|
-
*/
|
|
18456
|
-
bind(source) {
|
|
18457
|
-
const subscriber = this.cache.get(source)
|
|
18458
|
-
|| new ThemeStyleSheetBehaviorSubscription(this.theme, this.styles, source);
|
|
18459
|
-
// Currently subscriber from cache may have gone through unbind
|
|
18460
|
-
// but still be in cache so always resubscribe
|
|
18461
|
-
// See: https://github.com/microsoft/fast/issues/3246#issuecomment-1030424876
|
|
18462
|
-
theme.subscribe(subscriber, source);
|
|
18463
|
-
subscriber.handleChange();
|
|
18464
|
-
this.cache.set(source, subscriber);
|
|
18465
|
-
}
|
|
18466
|
-
/**
|
|
18467
|
-
* @internal
|
|
18468
|
-
*/
|
|
18469
|
-
unbind(source) {
|
|
18470
|
-
const subscriber = this.cache.get(source);
|
|
18471
|
-
if (subscriber) {
|
|
18472
|
-
theme.unsubscribe(subscriber);
|
|
18473
|
-
}
|
|
18474
|
-
// Currently does not evict subscriber from cache
|
|
18475
|
-
// See: https://github.com/microsoft/fast/issues/3246#issuecomment-1030424876
|
|
18476
|
-
}
|
|
18477
|
-
}
|
|
18478
|
-
/**
|
|
18479
|
-
* Behavior to conditionally apply theme-based stylesheets. To determine which to apply,
|
|
18480
|
-
* the behavior will use the nearest ThemeProvider's 'theme' design system value.
|
|
18481
|
-
*
|
|
18482
|
-
* @public
|
|
18483
|
-
* @example
|
|
18484
|
-
* ```ts
|
|
18485
|
-
* css`
|
|
18486
|
-
* // ...
|
|
18487
|
-
* `.withBehaviors(
|
|
18488
|
-
* themeBehavior(Theme.light, css` ... `),
|
|
18489
|
-
* // Apply style for both dark and color theme
|
|
18490
|
-
* themeBehavior([Theme.dark, Theme.color], css` ... `)
|
|
18491
|
-
* )
|
|
18492
|
-
* ```
|
|
18493
|
-
*/
|
|
18494
|
-
const themeBehavior = (theme, styles) => new ThemeStyleSheetBehavior(theme, styles);
|
|
18495
|
-
/* eslint-enable max-classes-per-file */
|
|
18496
|
-
|
|
18497
|
-
const styles$U = css `
|
|
18498
|
-
${display$1('flex')}
|
|
18499
|
-
|
|
18500
|
-
:host {
|
|
18501
|
-
font: ${bodyFont};
|
|
18502
|
-
font-size: 12.8px;
|
|
18503
|
-
align-items: top;
|
|
18504
|
-
overflow: hidden;
|
|
18505
|
-
overflow-wrap: anywhere;
|
|
18506
|
-
}
|
|
18507
|
-
|
|
18508
|
-
:host(:not([open])) {
|
|
18509
|
-
display: none;
|
|
18510
|
-
}
|
|
18511
|
-
|
|
18512
|
-
.container {
|
|
18513
|
-
color: ${bodyFontColor};
|
|
18514
|
-
display: flex;
|
|
18515
|
-
width: 100%;
|
|
18516
|
-
}
|
|
18517
|
-
|
|
18518
|
-
.icon {
|
|
18519
|
-
width: 48px;
|
|
18520
|
-
display: flex;
|
|
18521
|
-
justify-content: center;
|
|
18522
|
-
margin-top: 8px;
|
|
18523
|
-
flex: 0 0 auto;
|
|
18524
|
-
opacity: 0.6;
|
|
18525
|
-
}
|
|
18526
|
-
|
|
18527
|
-
.text {
|
|
18528
|
-
display: inline;
|
|
18529
|
-
margin-top: 7px;
|
|
18530
|
-
margin-bottom: 7px;
|
|
18531
|
-
}
|
|
18532
|
-
|
|
18533
|
-
slot[name='title'] {
|
|
18534
|
-
display: inline;
|
|
18535
|
-
font-weight: bold;
|
|
18536
|
-
padding-right: 8px;
|
|
18537
|
-
}
|
|
18538
|
-
|
|
18539
|
-
:host([title-hidden]) slot[name='title'] {
|
|
18540
|
-
${accessiblyHidden}
|
|
18541
|
-
}
|
|
18542
|
-
|
|
18543
|
-
.controls {
|
|
18544
|
-
height: ${controlHeight};
|
|
18545
|
-
margin-left: auto;
|
|
18546
|
-
display: flex;
|
|
18547
|
-
align-items: center;
|
|
18548
|
-
justify-content: center;
|
|
18549
|
-
align-self: flex-start;
|
|
18550
|
-
margin-top: ${smallPadding};
|
|
18551
|
-
${controlHeight.cssCustomProperty}: ${controlSlimHeight};
|
|
18552
|
-
}
|
|
18553
|
-
|
|
18554
|
-
slot[name='action'] {
|
|
18555
|
-
display: flex;
|
|
18556
|
-
align-content: center;
|
|
18557
|
-
margin-left: ${standardPadding};
|
|
18558
|
-
white-space: nowrap;
|
|
18559
|
-
}
|
|
18560
|
-
|
|
18561
|
-
slot[name='action']::slotted(nimble-anchor) {
|
|
18562
|
-
font-size: 12.8px;
|
|
18563
|
-
}
|
|
18564
|
-
|
|
18565
|
-
.dismiss {
|
|
18566
|
-
width: 48px;
|
|
18567
|
-
display: flex;
|
|
18568
|
-
justify-content: center;
|
|
18569
|
-
}
|
|
18570
|
-
`.withBehaviors(themeBehavior(Theme.light, css `
|
|
18571
|
-
:host {
|
|
18572
|
-
background: ${Black75};
|
|
18573
|
-
}
|
|
18574
|
-
|
|
18575
|
-
:host([severity='error']) {
|
|
18576
|
-
background: ${Fail100LightUi};
|
|
18577
|
-
}
|
|
18578
|
-
|
|
18579
|
-
:host([severity='warning']) {
|
|
18580
|
-
background: ${Warning100LightUi};
|
|
18581
|
-
}
|
|
18582
|
-
|
|
18583
|
-
:host([severity='information']) {
|
|
18584
|
-
background: ${Information100LightUi};
|
|
18585
|
-
}
|
|
18586
|
-
`), themeBehavior(Theme.dark, css `
|
|
18587
|
-
:host {
|
|
18588
|
-
background: ${Black75};
|
|
18589
|
-
}
|
|
18590
|
-
|
|
18591
|
-
:host([severity='error']) {
|
|
18592
|
-
background: ${BannerFail100DarkUi};
|
|
18593
|
-
}
|
|
18594
|
-
|
|
18595
|
-
:host([severity='warning']) {
|
|
18596
|
-
background: ${Warning100DarkUi};
|
|
18597
|
-
}
|
|
18598
|
-
|
|
18599
|
-
:host([severity='information']) {
|
|
18600
|
-
background: ${Information100DarkUi};
|
|
18601
|
-
}
|
|
18602
|
-
`), themeBehavior(Theme.color, css `
|
|
18603
|
-
:host {
|
|
18604
|
-
background: ${applicationBackgroundColor};
|
|
18605
|
-
}
|
|
18606
|
-
|
|
18607
|
-
.container {
|
|
18608
|
-
background: ${hexToRgbaCssColor(White, 0.3)};
|
|
18609
|
-
}
|
|
18610
|
-
`));
|
|
18611
|
-
|
|
18612
|
-
const styles$T = css `
|
|
18613
|
-
${styles$$}
|
|
18614
|
-
${buttonAppearanceVariantStyles}
|
|
18615
|
-
`;
|
|
18616
|
-
|
|
18617
|
-
const template$G = (context, definition) => html `
|
|
18618
|
-
<button
|
|
18619
|
-
class="control"
|
|
18620
|
-
part="control"
|
|
18621
|
-
?autofocus="${x => x.autofocus}"
|
|
18622
|
-
?disabled="${x => x.disabled}"
|
|
18623
|
-
form="${x => x.formId}"
|
|
18624
|
-
formaction="${x => x.formaction}"
|
|
18625
|
-
formenctype="${x => x.formenctype}"
|
|
18626
|
-
formmethod="${x => x.formmethod}"
|
|
18627
|
-
formnovalidate="${x => x.formnovalidate}"
|
|
18628
|
-
formtarget="${x => x.formtarget}"
|
|
18629
|
-
name="${x => x.name}"
|
|
18630
|
-
type="${x => x.type}"
|
|
18631
|
-
value="${x => x.value}"
|
|
18632
|
-
tabindex="${x => x.tabIndex}"
|
|
18633
|
-
aria-atomic="${x => x.ariaAtomic}"
|
|
18634
|
-
aria-busy="${x => x.ariaBusy}"
|
|
18635
|
-
aria-controls="${x => x.ariaControls}"
|
|
18636
|
-
aria-current="${x => x.ariaCurrent}"
|
|
18637
|
-
aria-describedby="${x => x.ariaDescribedby}"
|
|
18638
|
-
aria-details="${x => x.ariaDetails}"
|
|
18639
|
-
aria-disabled="${x => x.ariaDisabled}"
|
|
18640
|
-
aria-errormessage="${x => x.ariaErrormessage}"
|
|
18641
|
-
aria-expanded="${x => x.ariaExpanded}"
|
|
18642
|
-
aria-flowto="${x => x.ariaFlowto}"
|
|
18643
|
-
aria-haspopup="${x => x.ariaHaspopup}"
|
|
18644
|
-
aria-hidden="${x => x.ariaHidden}"
|
|
18645
|
-
aria-invalid="${x => x.ariaInvalid}"
|
|
18646
|
-
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
18647
|
-
aria-label="${x => x.ariaLabel}"
|
|
18648
|
-
aria-labelledby="${x => x.ariaLabelledby}"
|
|
18649
|
-
aria-live="${x => x.ariaLive}"
|
|
18650
|
-
aria-owns="${x => x.ariaOwns}"
|
|
18651
|
-
aria-pressed="${x => x.ariaPressed}"
|
|
18652
|
-
aria-relevant="${x => x.ariaRelevant}"
|
|
18653
|
-
aria-roledescription="${x => x.ariaRoledescription}"
|
|
18654
|
-
${ref('control')}
|
|
18655
|
-
>
|
|
18656
|
-
${startSlotTemplate(context, definition)}
|
|
18657
|
-
<span class="content" part="content">
|
|
18658
|
-
<slot ${slotted('defaultSlottedContent')}></slot>
|
|
18659
|
-
</span>
|
|
18660
|
-
${endSlotTemplate(context, definition)}
|
|
18661
|
-
</button>
|
|
18662
|
-
`;
|
|
18663
|
-
|
|
18664
|
-
/**
|
|
18665
|
-
* A nimble-styled HTML button
|
|
18666
|
-
*/
|
|
18667
|
-
class Button extends Button$1 {
|
|
18668
|
-
constructor() {
|
|
18669
|
-
super(...arguments);
|
|
18670
|
-
/**
|
|
18671
|
-
* @public
|
|
18672
|
-
* @remarks
|
|
18673
|
-
* HTML Attribute: appearance
|
|
18674
|
-
*/
|
|
18675
|
-
this.appearance = ButtonAppearance.outline;
|
|
18676
|
-
/**
|
|
18677
|
-
* @public
|
|
18678
|
-
* @remarks
|
|
18679
|
-
* HTML Attribute: content-hidden
|
|
18680
|
-
*/
|
|
18681
|
-
this.contentHidden = false;
|
|
18682
|
-
}
|
|
18683
|
-
}
|
|
18684
|
-
__decorate$1([
|
|
18685
|
-
attr
|
|
18686
|
-
], Button.prototype, "appearance", void 0);
|
|
17967
|
+
attr
|
|
17968
|
+
], Button.prototype, "appearance", void 0);
|
|
18687
17969
|
__decorate$1([
|
|
18688
17970
|
attr({ attribute: 'appearance-variant' })
|
|
18689
17971
|
], Button.prototype, "appearanceVariant", void 0);
|
|
@@ -18705,8 +17987,8 @@
|
|
|
18705
17987
|
const nimbleButton = Button.compose({
|
|
18706
17988
|
baseName: 'button',
|
|
18707
17989
|
baseClass: Button$1,
|
|
18708
|
-
template: template$
|
|
18709
|
-
styles: styles$
|
|
17990
|
+
template: template$I,
|
|
17991
|
+
styles: styles$W,
|
|
18710
17992
|
shadowOptions: {
|
|
18711
17993
|
delegatesFocus: true
|
|
18712
17994
|
}
|
|
@@ -19512,71 +18794,959 @@
|
|
|
19512
18794
|
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8.033 14.026 4.9 10.866 6.277 9.53l1.744 1.81 4.562-4.507 1.307 1.363Zm1.155-10.68-1.321-1.32-2.312 2.311-2.311-2.311-1.321 1.32 2.311 2.312L1.923 7.97l1.32 1.32 2.312-2.31 2.312 2.31 1.32-1.32-2.31-2.312Z" class="cls-1"/></svg>`,
|
|
19513
18795
|
};
|
|
19514
18796
|
|
|
19515
|
-
// Avoiding any whitespace in the template because this is an inline element
|
|
19516
|
-
const template$
|
|
19517
|
-
class="icon"
|
|
19518
|
-
aria-hidden="true"
|
|
19519
|
-
:innerHTML=${x => x.icon.data}
|
|
19520
|
-
></div>`;
|
|
18797
|
+
// Avoiding any whitespace in the template because this is an inline element
|
|
18798
|
+
const template$H = html `<div
|
|
18799
|
+
class="icon"
|
|
18800
|
+
aria-hidden="true"
|
|
18801
|
+
:innerHTML=${x => x.icon.data}
|
|
18802
|
+
></div>`;
|
|
18803
|
+
|
|
18804
|
+
/**
|
|
18805
|
+
* Set user-select: none in a way that works across all supported browsers.
|
|
18806
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/user-select#browser_compatibility
|
|
18807
|
+
*/
|
|
18808
|
+
const userSelectNone = cssPartial `
|
|
18809
|
+
user-select: none;
|
|
18810
|
+
-webkit-user-select: none;
|
|
18811
|
+
`;
|
|
18812
|
+
|
|
18813
|
+
const styles$V = css `
|
|
18814
|
+
${display$1('inline-flex')}
|
|
18815
|
+
|
|
18816
|
+
:host {
|
|
18817
|
+
align-items: center;
|
|
18818
|
+
${userSelectNone}
|
|
18819
|
+
width: ${iconSize};
|
|
18820
|
+
height: ${iconSize};
|
|
18821
|
+
}
|
|
18822
|
+
|
|
18823
|
+
.icon {
|
|
18824
|
+
width: 100%;
|
|
18825
|
+
height: 100%;
|
|
18826
|
+
}
|
|
18827
|
+
|
|
18828
|
+
:host([severity='error']) {
|
|
18829
|
+
${iconColor.cssCustomProperty}: ${failColor};
|
|
18830
|
+
}
|
|
18831
|
+
|
|
18832
|
+
:host([severity='warning']) {
|
|
18833
|
+
${iconColor.cssCustomProperty}: ${warningColor};
|
|
18834
|
+
}
|
|
18835
|
+
|
|
18836
|
+
:host([severity='success']) {
|
|
18837
|
+
${iconColor.cssCustomProperty}: ${passColor};
|
|
18838
|
+
}
|
|
18839
|
+
|
|
18840
|
+
:host([severity='information']) {
|
|
18841
|
+
${iconColor.cssCustomProperty}: ${informationColor};
|
|
18842
|
+
}
|
|
18843
|
+
|
|
18844
|
+
.icon svg {
|
|
18845
|
+
fill: ${iconColor};
|
|
18846
|
+
width: 100%;
|
|
18847
|
+
height: 100%;
|
|
18848
|
+
}
|
|
18849
|
+
`;
|
|
18850
|
+
|
|
18851
|
+
/**
|
|
18852
|
+
* The base class for icon components
|
|
18853
|
+
*/
|
|
18854
|
+
class Icon extends FoundationElement {
|
|
18855
|
+
constructor(/** @internal */ icon) {
|
|
18856
|
+
super();
|
|
18857
|
+
this.icon = icon;
|
|
18858
|
+
}
|
|
18859
|
+
}
|
|
18860
|
+
__decorate$1([
|
|
18861
|
+
attr
|
|
18862
|
+
], Icon.prototype, "severity", void 0);
|
|
18863
|
+
const registerIcon = (baseName, iconClass) => {
|
|
18864
|
+
const composedIcon = iconClass.compose({
|
|
18865
|
+
baseName,
|
|
18866
|
+
template: template$H,
|
|
18867
|
+
styles: styles$V
|
|
18868
|
+
});
|
|
18869
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(composedIcon());
|
|
18870
|
+
};
|
|
18871
|
+
|
|
18872
|
+
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
18873
|
+
// See generation source in nimble-components/build/generate-icons
|
|
18874
|
+
/**
|
|
18875
|
+
* The icon component for the 'arrowExpanderLeft' icon
|
|
18876
|
+
*/
|
|
18877
|
+
class IconArrowExpanderLeft extends Icon {
|
|
18878
|
+
constructor() {
|
|
18879
|
+
super(arrowExpanderLeft16X16);
|
|
18880
|
+
}
|
|
18881
|
+
}
|
|
18882
|
+
registerIcon('icon-arrow-expander-left', IconArrowExpanderLeft);
|
|
18883
|
+
const iconArrowExpanderLeftTag = 'nimble-icon-arrow-expander-left';
|
|
18884
|
+
|
|
18885
|
+
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
18886
|
+
// See generation source in nimble-components/build/generate-icons
|
|
18887
|
+
/**
|
|
18888
|
+
* The icon component for the 'arrowExpanderRight' icon
|
|
18889
|
+
*/
|
|
18890
|
+
class IconArrowExpanderRight extends Icon {
|
|
18891
|
+
constructor() {
|
|
18892
|
+
super(arrowExpanderRight16X16);
|
|
18893
|
+
}
|
|
18894
|
+
}
|
|
18895
|
+
registerIcon('icon-arrow-expander-right', IconArrowExpanderRight);
|
|
18896
|
+
const iconArrowExpanderRightTag = 'nimble-icon-arrow-expander-right';
|
|
18897
|
+
|
|
18898
|
+
const coreLabelDefaults = {
|
|
18899
|
+
popupDismissLabel: 'Close',
|
|
18900
|
+
numericIncrementLabel: 'Increment',
|
|
18901
|
+
numericDecrementLabel: 'Decrement',
|
|
18902
|
+
popupIconErrorLabel: 'Error',
|
|
18903
|
+
popupIconWarningLabel: 'Warning',
|
|
18904
|
+
popupIconInformationLabel: 'Information',
|
|
18905
|
+
filterSearchLabel: 'Search',
|
|
18906
|
+
filterNoResultsLabel: 'No items found',
|
|
18907
|
+
loadingLabel: 'Loading…',
|
|
18908
|
+
scrollBackwardLabel: 'Scroll backward',
|
|
18909
|
+
scrollForwardLabel: 'Scroll forward'
|
|
18910
|
+
};
|
|
18911
|
+
|
|
18912
|
+
const popupDismissLabel = DesignToken.create({
|
|
18913
|
+
name: 'popup-dismiss-label',
|
|
18914
|
+
cssCustomPropertyName: null
|
|
18915
|
+
}).withDefault(coreLabelDefaults.popupDismissLabel);
|
|
18916
|
+
const numericDecrementLabel = DesignToken.create({
|
|
18917
|
+
name: 'numeric-decrement-label',
|
|
18918
|
+
cssCustomPropertyName: null
|
|
18919
|
+
}).withDefault(coreLabelDefaults.numericDecrementLabel);
|
|
18920
|
+
const numericIncrementLabel = DesignToken.create({
|
|
18921
|
+
name: 'numeric-increment-label',
|
|
18922
|
+
cssCustomPropertyName: null
|
|
18923
|
+
}).withDefault(coreLabelDefaults.numericIncrementLabel);
|
|
18924
|
+
const popupIconErrorLabel = DesignToken.create({
|
|
18925
|
+
name: 'popup-icon-error-label',
|
|
18926
|
+
cssCustomPropertyName: null
|
|
18927
|
+
}).withDefault(coreLabelDefaults.popupIconErrorLabel);
|
|
18928
|
+
const popupIconWarningLabel = DesignToken.create({
|
|
18929
|
+
name: 'popup-icon-warning-label',
|
|
18930
|
+
cssCustomPropertyName: null
|
|
18931
|
+
}).withDefault(coreLabelDefaults.popupIconWarningLabel);
|
|
18932
|
+
const popupIconInformationLabel = DesignToken.create({
|
|
18933
|
+
name: 'popup-icon-information-label',
|
|
18934
|
+
cssCustomPropertyName: null
|
|
18935
|
+
}).withDefault(coreLabelDefaults.popupIconInformationLabel);
|
|
18936
|
+
const filterSearchLabel = DesignToken.create({
|
|
18937
|
+
name: 'filter-search-label',
|
|
18938
|
+
cssCustomPropertyName: null
|
|
18939
|
+
}).withDefault(coreLabelDefaults.filterSearchLabel);
|
|
18940
|
+
const filterNoResultsLabel = DesignToken.create({
|
|
18941
|
+
name: 'filter-no-results-label',
|
|
18942
|
+
cssCustomPropertyName: null
|
|
18943
|
+
}).withDefault(coreLabelDefaults.filterNoResultsLabel);
|
|
18944
|
+
const loadingLabel = DesignToken.create({
|
|
18945
|
+
name: 'loading-label',
|
|
18946
|
+
cssCustomPropertyName: null
|
|
18947
|
+
}).withDefault(coreLabelDefaults.loadingLabel);
|
|
18948
|
+
const scrollBackwardLabel = DesignToken.create({
|
|
18949
|
+
name: 'scroll-backward-label',
|
|
18950
|
+
cssCustomPropertyName: null
|
|
18951
|
+
}).withDefault(coreLabelDefaults.scrollBackwardLabel);
|
|
18952
|
+
const scrollForwardLabel = DesignToken.create({
|
|
18953
|
+
name: 'scroll-forward-label',
|
|
18954
|
+
cssCustomPropertyName: null
|
|
18955
|
+
}).withDefault(coreLabelDefaults.scrollForwardLabel);
|
|
18956
|
+
|
|
18957
|
+
// prettier-ignore
|
|
18958
|
+
const template$G = (context, definition) => html `
|
|
18959
|
+
<div
|
|
18960
|
+
class="tab-bar"
|
|
18961
|
+
>
|
|
18962
|
+
${startSlotTemplate(context, definition)}
|
|
18963
|
+
${when(x => x.showScrollButtons, html `
|
|
18964
|
+
<${buttonTag}
|
|
18965
|
+
content-hidden
|
|
18966
|
+
class="scroll-button left"
|
|
18967
|
+
appearance="${ButtonAppearance.ghost}"
|
|
18968
|
+
tabindex="-1"
|
|
18969
|
+
@click="${x => x.onScrollLeftClick()}"
|
|
18970
|
+
${ref('leftScrollButton')}
|
|
18971
|
+
>
|
|
18972
|
+
${x => scrollForwardLabel.getValueFor(x)}
|
|
18973
|
+
<${iconArrowExpanderLeftTag} slot="start"></${iconArrowExpanderLeftTag}>
|
|
18974
|
+
</${buttonTag}>
|
|
18975
|
+
`)}
|
|
18976
|
+
<div
|
|
18977
|
+
class="tablist"
|
|
18978
|
+
part="tablist"
|
|
18979
|
+
role="tablist"
|
|
18980
|
+
${ref('tablist')}
|
|
18981
|
+
>
|
|
18982
|
+
<slot class="tab" name="${x => x.tabSlotName}" part="tab" ${slotted('tabs')}>
|
|
18983
|
+
</slot>
|
|
18984
|
+
</div>
|
|
18985
|
+
${when(x => x.showScrollButtons, html `
|
|
18986
|
+
<${buttonTag}
|
|
18987
|
+
content-hidden
|
|
18988
|
+
class="scroll-button right"
|
|
18989
|
+
appearance="${ButtonAppearance.ghost}"
|
|
18990
|
+
tabindex="-1"
|
|
18991
|
+
@click="${x => x.onScrollRightClick()}"
|
|
18992
|
+
>
|
|
18993
|
+
${x => scrollBackwardLabel.getValueFor(x)}
|
|
18994
|
+
<${iconArrowExpanderRightTag} slot="start"></${iconArrowExpanderRightTag}>
|
|
18995
|
+
</${buttonTag}>
|
|
18996
|
+
`)}
|
|
18997
|
+
${endSlotTemplate(context, definition)}
|
|
18998
|
+
</div>
|
|
18999
|
+
${when(x => 'tabpanels' in x, html `
|
|
19000
|
+
<div class="tabpanel" part="tabpanel">
|
|
19001
|
+
<slot name="tabpanel" ${slotted('tabpanels')}></slot>
|
|
19002
|
+
</div>
|
|
19003
|
+
`)}
|
|
19004
|
+
`;
|
|
19005
|
+
|
|
19006
|
+
/**
|
|
19007
|
+
* A nimble-styled set of anchor tabs
|
|
19008
|
+
*/
|
|
19009
|
+
class AnchorTabs extends FoundationElement {
|
|
19010
|
+
constructor() {
|
|
19011
|
+
super();
|
|
19012
|
+
/**
|
|
19013
|
+
* @internal
|
|
19014
|
+
*/
|
|
19015
|
+
this.showScrollButtons = false;
|
|
19016
|
+
/**
|
|
19017
|
+
* @internal
|
|
19018
|
+
*/
|
|
19019
|
+
this.tabSlotName = 'anchortab';
|
|
19020
|
+
this.tabIds = [];
|
|
19021
|
+
this.isDisabledElement = (el) => {
|
|
19022
|
+
return el.getAttribute('aria-disabled') === 'true';
|
|
19023
|
+
};
|
|
19024
|
+
this.isHiddenElement = (el) => {
|
|
19025
|
+
return el.hasAttribute('hidden');
|
|
19026
|
+
};
|
|
19027
|
+
this.isFocusableElement = (el) => {
|
|
19028
|
+
return !this.isDisabledElement(el) && !this.isHiddenElement(el);
|
|
19029
|
+
};
|
|
19030
|
+
this.setTabs = () => {
|
|
19031
|
+
const gridHorizontalProperty = 'gridColumn';
|
|
19032
|
+
const gridVerticalProperty = 'gridRow';
|
|
19033
|
+
this.activetab = undefined;
|
|
19034
|
+
let firstFocusableTab;
|
|
19035
|
+
this.tabs.forEach((tab, index) => {
|
|
19036
|
+
const tabId = this.tabIds[index];
|
|
19037
|
+
const isActiveTab = this.activeid === tabId;
|
|
19038
|
+
if (!firstFocusableTab && this.isFocusableElement(tab)) {
|
|
19039
|
+
firstFocusableTab = tab;
|
|
19040
|
+
}
|
|
19041
|
+
const isTabStop = this.activeid === tabId && this.isFocusableElement(tab);
|
|
19042
|
+
tab.setAttribute('id', tabId);
|
|
19043
|
+
if (isActiveTab) {
|
|
19044
|
+
tab.setAttribute('aria-current', 'page');
|
|
19045
|
+
}
|
|
19046
|
+
else {
|
|
19047
|
+
tab.removeAttribute('aria-current');
|
|
19048
|
+
}
|
|
19049
|
+
tab.removeEventListener('click', this.handleTabClick);
|
|
19050
|
+
tab.addEventListener('click', this.handleTabClick);
|
|
19051
|
+
tab.removeEventListener('keydown', this.handleTabKeyDown);
|
|
19052
|
+
tab.addEventListener('keydown', this.handleTabKeyDown);
|
|
19053
|
+
tab.setAttribute('tabindex', isTabStop ? '0' : '-1');
|
|
19054
|
+
if (isActiveTab) {
|
|
19055
|
+
this.activetab = tab;
|
|
19056
|
+
}
|
|
19057
|
+
tab.style[gridVerticalProperty] = '';
|
|
19058
|
+
tab.style[gridHorizontalProperty] = `${index + 1}`;
|
|
19059
|
+
});
|
|
19060
|
+
if (firstFocusableTab
|
|
19061
|
+
&& (!this.activetab || !this.isFocusableElement(this.activetab))) {
|
|
19062
|
+
firstFocusableTab.setAttribute('tabindex', '0');
|
|
19063
|
+
}
|
|
19064
|
+
};
|
|
19065
|
+
this.handleTabClick = (event) => {
|
|
19066
|
+
const selectedTab = event.currentTarget;
|
|
19067
|
+
if (selectedTab.nodeType === 1
|
|
19068
|
+
&& this.isFocusableElement(selectedTab)) {
|
|
19069
|
+
this.tabs.forEach((tab) => {
|
|
19070
|
+
tab.setAttribute('tabindex', tab === selectedTab ? '0' : '-1');
|
|
19071
|
+
});
|
|
19072
|
+
}
|
|
19073
|
+
};
|
|
19074
|
+
this.handleTabKeyDown = (event) => {
|
|
19075
|
+
let anchor;
|
|
19076
|
+
switch (event.key) {
|
|
19077
|
+
case keyArrowLeft:
|
|
19078
|
+
event.preventDefault();
|
|
19079
|
+
this.adjustBackward();
|
|
19080
|
+
break;
|
|
19081
|
+
case keyArrowRight:
|
|
19082
|
+
event.preventDefault();
|
|
19083
|
+
this.adjustForward();
|
|
19084
|
+
break;
|
|
19085
|
+
case keyHome:
|
|
19086
|
+
event.preventDefault();
|
|
19087
|
+
this.focusFirstOrLast(false);
|
|
19088
|
+
break;
|
|
19089
|
+
case keyEnd:
|
|
19090
|
+
event.preventDefault();
|
|
19091
|
+
this.focusFirstOrLast(true);
|
|
19092
|
+
break;
|
|
19093
|
+
case keySpace:
|
|
19094
|
+
case keyEnter:
|
|
19095
|
+
event.preventDefault();
|
|
19096
|
+
this.getTabAnchor(event.target).click();
|
|
19097
|
+
break;
|
|
19098
|
+
case 'ContextMenu':
|
|
19099
|
+
event.preventDefault();
|
|
19100
|
+
anchor = this.getTabAnchor(event.target);
|
|
19101
|
+
anchor.focus();
|
|
19102
|
+
anchor.dispatchEvent(new KeyboardEvent('keydown', {
|
|
19103
|
+
key: event.key,
|
|
19104
|
+
bubbles: false
|
|
19105
|
+
}));
|
|
19106
|
+
break;
|
|
19107
|
+
// do nothing
|
|
19108
|
+
}
|
|
19109
|
+
};
|
|
19110
|
+
this.adjustForward = () => {
|
|
19111
|
+
const group = this.tabs;
|
|
19112
|
+
let index = 0;
|
|
19113
|
+
const focusedTab = group.find(x => x === document.activeElement);
|
|
19114
|
+
index = focusedTab ? group.indexOf(focusedTab) + 1 : 1;
|
|
19115
|
+
if (index === group.length) {
|
|
19116
|
+
index = 0;
|
|
19117
|
+
}
|
|
19118
|
+
while (index < group.length && group.length > 1) {
|
|
19119
|
+
if (this.isFocusableElement(group[index])) {
|
|
19120
|
+
this.focusTabByIndex(group, index);
|
|
19121
|
+
break;
|
|
19122
|
+
}
|
|
19123
|
+
else if (focusedTab && index === group.indexOf(focusedTab)) {
|
|
19124
|
+
break;
|
|
19125
|
+
}
|
|
19126
|
+
else if (index + 1 >= group.length) {
|
|
19127
|
+
index = 0;
|
|
19128
|
+
}
|
|
19129
|
+
else {
|
|
19130
|
+
index += 1;
|
|
19131
|
+
}
|
|
19132
|
+
}
|
|
19133
|
+
};
|
|
19134
|
+
this.adjustBackward = () => {
|
|
19135
|
+
const group = this.tabs;
|
|
19136
|
+
let index = 0;
|
|
19137
|
+
const focusedTab = group.find(x => x === document.activeElement);
|
|
19138
|
+
index = focusedTab ? group.indexOf(focusedTab) - 1 : 0;
|
|
19139
|
+
index = index < 0 ? group.length - 1 : index;
|
|
19140
|
+
while (index >= 0 && group.length > 1) {
|
|
19141
|
+
if (this.isFocusableElement(group[index])) {
|
|
19142
|
+
this.focusTabByIndex(group, index);
|
|
19143
|
+
break;
|
|
19144
|
+
}
|
|
19145
|
+
else if (index - 1 < 0) {
|
|
19146
|
+
index = group.length - 1;
|
|
19147
|
+
}
|
|
19148
|
+
else {
|
|
19149
|
+
index -= 1;
|
|
19150
|
+
}
|
|
19151
|
+
}
|
|
19152
|
+
};
|
|
19153
|
+
this.focusTabByIndex = (group, index) => {
|
|
19154
|
+
const focusedTab = group[index];
|
|
19155
|
+
focusedTab.focus();
|
|
19156
|
+
this.tabs.forEach((tab) => {
|
|
19157
|
+
tab.setAttribute('tabindex', tab === focusedTab ? '0' : '-1');
|
|
19158
|
+
tab.setAttribute('aria-selected', tab === focusedTab ? 'true' : 'false');
|
|
19159
|
+
});
|
|
19160
|
+
focusedTab.scrollIntoView({ block: 'nearest', inline: 'start' });
|
|
19161
|
+
};
|
|
19162
|
+
this.tabListResizeObserver = new ResizeObserver(entries => {
|
|
19163
|
+
let tabListVisibleWidth = entries[0]?.contentRect.width;
|
|
19164
|
+
if (tabListVisibleWidth !== undefined) {
|
|
19165
|
+
const buttonWidth = this.leftScrollButton?.clientWidth ?? 0;
|
|
19166
|
+
tabListVisibleWidth = Math.ceil(tabListVisibleWidth);
|
|
19167
|
+
if (this.showScrollButtons) {
|
|
19168
|
+
tabListVisibleWidth += buttonWidth * 2;
|
|
19169
|
+
}
|
|
19170
|
+
this.showScrollButtons = tabListVisibleWidth < this.tablist.scrollWidth;
|
|
19171
|
+
}
|
|
19172
|
+
});
|
|
19173
|
+
}
|
|
19174
|
+
/**
|
|
19175
|
+
* @internal
|
|
19176
|
+
*/
|
|
19177
|
+
activeidChanged(_oldValue, _newValue) {
|
|
19178
|
+
if (this.$fastController.isConnected) {
|
|
19179
|
+
this.setTabs();
|
|
19180
|
+
this.activetab?.scrollIntoView({
|
|
19181
|
+
block: 'nearest',
|
|
19182
|
+
inline: 'start'
|
|
19183
|
+
});
|
|
19184
|
+
}
|
|
19185
|
+
}
|
|
19186
|
+
/**
|
|
19187
|
+
* @internal
|
|
19188
|
+
*/
|
|
19189
|
+
tabsChanged() {
|
|
19190
|
+
if (this.$fastController.isConnected) {
|
|
19191
|
+
this.tabIds = this.getTabIds();
|
|
19192
|
+
this.setTabs();
|
|
19193
|
+
}
|
|
19194
|
+
}
|
|
19195
|
+
/**
|
|
19196
|
+
* @internal
|
|
19197
|
+
*/
|
|
19198
|
+
onScrollLeftClick() {
|
|
19199
|
+
this.tablist.scrollBy({
|
|
19200
|
+
left: -this.tablist.clientWidth,
|
|
19201
|
+
behavior: 'smooth'
|
|
19202
|
+
});
|
|
19203
|
+
}
|
|
19204
|
+
/**
|
|
19205
|
+
* @internal
|
|
19206
|
+
*/
|
|
19207
|
+
onScrollRightClick() {
|
|
19208
|
+
this.tablist.scrollBy({
|
|
19209
|
+
left: this.tablist.clientWidth,
|
|
19210
|
+
behavior: 'smooth'
|
|
19211
|
+
});
|
|
19212
|
+
}
|
|
19213
|
+
/**
|
|
19214
|
+
* @internal
|
|
19215
|
+
*/
|
|
19216
|
+
connectedCallback() {
|
|
19217
|
+
super.connectedCallback();
|
|
19218
|
+
this.tabListResizeObserver.observe(this.tablist);
|
|
19219
|
+
this.tabIds = this.getTabIds();
|
|
19220
|
+
}
|
|
19221
|
+
/**
|
|
19222
|
+
* @internal
|
|
19223
|
+
*/
|
|
19224
|
+
disconnectedCallback() {
|
|
19225
|
+
super.disconnectedCallback();
|
|
19226
|
+
this.tabListResizeObserver.disconnect();
|
|
19227
|
+
}
|
|
19228
|
+
getTabIds() {
|
|
19229
|
+
return this.tabs.map((tab) => {
|
|
19230
|
+
return tab.getAttribute('id') ?? `tab-${uniqueId()}`;
|
|
19231
|
+
});
|
|
19232
|
+
}
|
|
19233
|
+
focusFirstOrLast(focusLast) {
|
|
19234
|
+
const focusableTabs = this.tabs.filter(t => this.isFocusableElement(t));
|
|
19235
|
+
const focusableIndex = focusLast ? focusableTabs.length - 1 : 0;
|
|
19236
|
+
const index = this.tabs.indexOf(focusableTabs[focusableIndex]);
|
|
19237
|
+
if (index > -1) {
|
|
19238
|
+
this.focusTabByIndex(this.tabs, index);
|
|
19239
|
+
}
|
|
19240
|
+
}
|
|
19241
|
+
getTabAnchor(tab) {
|
|
19242
|
+
return tab.shadowRoot.querySelector('a');
|
|
19243
|
+
}
|
|
19244
|
+
}
|
|
19245
|
+
__decorate$1([
|
|
19246
|
+
attr
|
|
19247
|
+
], AnchorTabs.prototype, "activeid", void 0);
|
|
19248
|
+
__decorate$1([
|
|
19249
|
+
observable
|
|
19250
|
+
], AnchorTabs.prototype, "tabs", void 0);
|
|
19251
|
+
__decorate$1([
|
|
19252
|
+
observable
|
|
19253
|
+
], AnchorTabs.prototype, "showScrollButtons", void 0);
|
|
19254
|
+
applyMixins(AnchorTabs, StartEnd);
|
|
19255
|
+
const nimbleAnchorTabs = AnchorTabs.compose({
|
|
19256
|
+
baseName: 'anchor-tabs',
|
|
19257
|
+
template: template$G,
|
|
19258
|
+
styles: styles$X,
|
|
19259
|
+
shadowOptions: {
|
|
19260
|
+
delegatesFocus: false
|
|
19261
|
+
}
|
|
19262
|
+
});
|
|
19263
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorTabs());
|
|
19264
|
+
|
|
19265
|
+
const styles$U = css `
|
|
19266
|
+
${display$1('block')}
|
|
19267
|
+
|
|
19268
|
+
:host {
|
|
19269
|
+
${
|
|
19270
|
+
/* don't set font-size here or else it overrides what we set on .items */ ''}
|
|
19271
|
+
font-family: ${bodyFontFamily};
|
|
19272
|
+
font-weight: ${bodyFontWeight};
|
|
19273
|
+
contain: content;
|
|
19274
|
+
position: relative;
|
|
19275
|
+
outline: none;
|
|
19276
|
+
color: ${bodyFontColor};
|
|
19277
|
+
cursor: pointer;
|
|
19278
|
+
--ni-private-tree-item-nested-width: 0;
|
|
19279
|
+
}
|
|
19280
|
+
|
|
19281
|
+
:host([disabled]) {
|
|
19282
|
+
color: ${bodyDisabledFontColor};
|
|
19283
|
+
cursor: default;
|
|
19284
|
+
}
|
|
19285
|
+
|
|
19286
|
+
.control {
|
|
19287
|
+
display: flex;
|
|
19288
|
+
text-decoration: none;
|
|
19289
|
+
color: inherit;
|
|
19290
|
+
}
|
|
19291
|
+
|
|
19292
|
+
.control${focusVisible} {
|
|
19293
|
+
box-shadow: 0px 0px 0px ${borderWidth} ${borderHoverColor} inset;
|
|
19294
|
+
outline: ${borderWidth} solid ${borderHoverColor};
|
|
19295
|
+
outline-offset: -2px;
|
|
19296
|
+
}
|
|
19297
|
+
|
|
19298
|
+
.positioning-region {
|
|
19299
|
+
display: flex;
|
|
19300
|
+
position: relative;
|
|
19301
|
+
height: calc(${iconSize} * 2);
|
|
19302
|
+
width: 100%;
|
|
19303
|
+
}
|
|
19304
|
+
|
|
19305
|
+
.positioning-region:hover {
|
|
19306
|
+
background: ${fillHoverColor};
|
|
19307
|
+
}
|
|
19308
|
+
|
|
19309
|
+
:host([disabled]) .positioning-region:hover {
|
|
19310
|
+
background: transparent;
|
|
19311
|
+
}
|
|
19312
|
+
|
|
19313
|
+
:host([selected]) .positioning-region {
|
|
19314
|
+
background: ${fillSelectedColor};
|
|
19315
|
+
}
|
|
19316
|
+
|
|
19317
|
+
:host([selected]) .positioning-region:hover {
|
|
19318
|
+
background: ${fillHoverSelectedColor};
|
|
19319
|
+
}
|
|
19320
|
+
|
|
19321
|
+
.positioning-region::before {
|
|
19322
|
+
content: '';
|
|
19323
|
+
display: block;
|
|
19324
|
+
width: var(--ni-private-tree-item-nested-width);
|
|
19325
|
+
flex-shrink: 0;
|
|
19326
|
+
}
|
|
19327
|
+
|
|
19328
|
+
.content-region {
|
|
19329
|
+
display: inline-flex;
|
|
19330
|
+
align-items: center;
|
|
19331
|
+
white-space: nowrap;
|
|
19332
|
+
width: 100%;
|
|
19333
|
+
padding-left: 10px;
|
|
19334
|
+
font: inherit;
|
|
19335
|
+
font-size: ${bodyFontSize};
|
|
19336
|
+
${userSelectNone}
|
|
19337
|
+
position: relative;
|
|
19338
|
+
margin-inline-start: ${iconSize};
|
|
19339
|
+
}
|
|
19340
|
+
|
|
19341
|
+
${
|
|
19342
|
+
/* this rule keeps children without an icon text aligned with parents */ ''}
|
|
19343
|
+
[part="start"] {
|
|
19344
|
+
width: ${iconSize};
|
|
19345
|
+
pointer-events: none;
|
|
19346
|
+
}
|
|
19347
|
+
|
|
19348
|
+
${ /* the start class is applied when the corresponding slot is filled */''}
|
|
19349
|
+
.start {
|
|
19350
|
+
display: flex;
|
|
19351
|
+
margin-inline-start: ${iconSize};
|
|
19352
|
+
margin-inline-end: ${iconSize};
|
|
19353
|
+
}
|
|
19354
|
+
|
|
19355
|
+
slot[name='start']::slotted(*) {
|
|
19356
|
+
${iconColor.cssCustomProperty}: currentcolor;
|
|
19357
|
+
width: ${iconSize};
|
|
19358
|
+
height: ${iconSize};
|
|
19359
|
+
}
|
|
19360
|
+
|
|
19361
|
+
.content {
|
|
19362
|
+
pointer-events: none;
|
|
19363
|
+
}
|
|
19364
|
+
|
|
19365
|
+
[part='end'] {
|
|
19366
|
+
display: none;
|
|
19367
|
+
}
|
|
19368
|
+
`;
|
|
19369
|
+
|
|
19370
|
+
const template$F = (context, definition) => html `
|
|
19371
|
+
<template
|
|
19372
|
+
role="treeitem"
|
|
19373
|
+
slot="${x => (x.isNestedItem() ? 'item' : null)}"
|
|
19374
|
+
tabindex="-1"
|
|
19375
|
+
aria-disabled="${x => x.disabled}"
|
|
19376
|
+
aria-selected="${x => x.selected}"
|
|
19377
|
+
@focusin="${(x, c) => x.handleFocus(c.event)}"
|
|
19378
|
+
@focusout="${(x, c) => x.handleBlur(c.event)}"
|
|
19379
|
+
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
19380
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
19381
|
+
>
|
|
19382
|
+
<a
|
|
19383
|
+
class="control"
|
|
19384
|
+
part="control"
|
|
19385
|
+
tabindex="0"
|
|
19386
|
+
download="${x => x.download}"
|
|
19387
|
+
href=${x => (x.disabled ? null : x.href)}
|
|
19388
|
+
hreflang="${x => x.hreflang}"
|
|
19389
|
+
ping="${x => x.ping}"
|
|
19390
|
+
referrerpolicy="${x => x.referrerpolicy}"
|
|
19391
|
+
rel="${x => x.rel}"
|
|
19392
|
+
target="${x => x.target}"
|
|
19393
|
+
type="${x => x.type}"
|
|
19394
|
+
${ref('control')}
|
|
19395
|
+
>
|
|
19396
|
+
<div class="positioning-region" part="positioning-region">
|
|
19397
|
+
<div class="content-region" part="content-region">
|
|
19398
|
+
${startSlotTemplate(context, definition)}
|
|
19399
|
+
<span class="content" part="content">
|
|
19400
|
+
<slot></slot>
|
|
19401
|
+
</span>
|
|
19402
|
+
${endSlotTemplate(context, definition)}
|
|
19403
|
+
</div>
|
|
19404
|
+
</div>
|
|
19405
|
+
</a>
|
|
19406
|
+
</template>
|
|
19407
|
+
`;
|
|
19408
|
+
|
|
19409
|
+
/**
|
|
19410
|
+
* A nimble-styled anchor tree item
|
|
19411
|
+
*/
|
|
19412
|
+
class AnchorTreeItem extends AnchorBase {
|
|
19413
|
+
constructor() {
|
|
19414
|
+
super(...arguments);
|
|
19415
|
+
/**
|
|
19416
|
+
* When true, the control will appear selected by user interaction.
|
|
19417
|
+
* @public
|
|
19418
|
+
* @remarks
|
|
19419
|
+
* HTML Attribute: selected
|
|
19420
|
+
*/
|
|
19421
|
+
this.selected = false;
|
|
19422
|
+
/**
|
|
19423
|
+
* When true, the control will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled | disabled HTML attribute} for more information.
|
|
19424
|
+
* @public
|
|
19425
|
+
* @remarks
|
|
19426
|
+
* HTML Attribute: disabled
|
|
19427
|
+
*/
|
|
19428
|
+
this.disabled = false;
|
|
19429
|
+
}
|
|
19430
|
+
/**
|
|
19431
|
+
* Whether the tree is nested
|
|
19432
|
+
*
|
|
19433
|
+
* @public
|
|
19434
|
+
*/
|
|
19435
|
+
isNestedItem() {
|
|
19436
|
+
return isTreeItemElement(this.parentElement);
|
|
19437
|
+
}
|
|
19438
|
+
/**
|
|
19439
|
+
* Handle focus events
|
|
19440
|
+
*
|
|
19441
|
+
* @internal
|
|
19442
|
+
*/
|
|
19443
|
+
handleFocus(_e) {
|
|
19444
|
+
this.setAttribute('tabindex', '0');
|
|
19445
|
+
}
|
|
19446
|
+
/**
|
|
19447
|
+
* Handle blur events
|
|
19448
|
+
*
|
|
19449
|
+
* @internal
|
|
19450
|
+
*/
|
|
19451
|
+
handleBlur(_e) {
|
|
19452
|
+
this.setAttribute('tabindex', '-1');
|
|
19453
|
+
}
|
|
19454
|
+
/**
|
|
19455
|
+
* @internal
|
|
19456
|
+
*/
|
|
19457
|
+
keydownHandler(e) {
|
|
19458
|
+
if (e.defaultPrevented) {
|
|
19459
|
+
return false;
|
|
19460
|
+
}
|
|
19461
|
+
switch (e.key) {
|
|
19462
|
+
case keyEnter:
|
|
19463
|
+
// Do not let the event bubble up to the FAST tree, or it will
|
|
19464
|
+
// prevent the default action.
|
|
19465
|
+
e.stopPropagation();
|
|
19466
|
+
break;
|
|
19467
|
+
case keyArrowLeft:
|
|
19468
|
+
// For FAST tree items, the FAST tree view handles this navigation,
|
|
19469
|
+
// but since our anchor tree item is not "instanceof FASTTreeItem",
|
|
19470
|
+
// the FAST tree view won't do this for us. We do it ourselves.
|
|
19471
|
+
if (this.parentElement && this.isNestedItem()) {
|
|
19472
|
+
TreeItem$1.focusItem(this.parentElement);
|
|
19473
|
+
}
|
|
19474
|
+
break;
|
|
19475
|
+
}
|
|
19476
|
+
return true;
|
|
19477
|
+
}
|
|
19478
|
+
/**
|
|
19479
|
+
* Activating the anchor by pressing the Enter key results in a click event.
|
|
19480
|
+
* This bubbles up to the Nimble tree-view's click handler, causing the tree item
|
|
19481
|
+
* to be selected. We don't want that for anchor tree items. We'll stop propagation
|
|
19482
|
+
* of the event to prevent that.
|
|
19483
|
+
* @internal
|
|
19484
|
+
*/
|
|
19485
|
+
clickHandler(e) {
|
|
19486
|
+
if (e.defaultPrevented) {
|
|
19487
|
+
return false;
|
|
19488
|
+
}
|
|
19489
|
+
e.stopPropagation();
|
|
19490
|
+
return true;
|
|
19491
|
+
}
|
|
19492
|
+
selectedChanged(_prev, _next) {
|
|
19493
|
+
if (this.$fastController.isConnected) {
|
|
19494
|
+
this.$emit('selected-change', this);
|
|
19495
|
+
}
|
|
19496
|
+
}
|
|
19497
|
+
}
|
|
19498
|
+
__decorate$1([
|
|
19499
|
+
attr({ mode: 'boolean' })
|
|
19500
|
+
], AnchorTreeItem.prototype, "selected", void 0);
|
|
19501
|
+
__decorate$1([
|
|
19502
|
+
attr({ mode: 'boolean' })
|
|
19503
|
+
], AnchorTreeItem.prototype, "disabled", void 0);
|
|
19504
|
+
// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
|
|
19505
|
+
const nimbleAnchorTreeItem = AnchorTreeItem.compose({
|
|
19506
|
+
baseName: 'anchor-tree-item',
|
|
19507
|
+
template: template$F,
|
|
19508
|
+
styles: styles$U,
|
|
19509
|
+
shadowOptions: {
|
|
19510
|
+
delegatesFocus: true
|
|
19511
|
+
}
|
|
19512
|
+
});
|
|
19513
|
+
DesignSystem.getOrCreate()
|
|
19514
|
+
.withPrefix('nimble')
|
|
19515
|
+
.register(nimbleAnchorTreeItem());
|
|
19516
|
+
|
|
19517
|
+
const ZIndexLevels = {
|
|
19518
|
+
zIndex1: '1',
|
|
19519
|
+
// Original usages of 1000 were to compete with jqx grid usage of z-index 200 for table headers
|
|
19520
|
+
// See: https://github.com/ni/nimble/pull/530#discussion_r863076750
|
|
19521
|
+
zIndex1000: '1000'
|
|
19522
|
+
};
|
|
19523
|
+
|
|
19524
|
+
const styles$T = css `
|
|
19525
|
+
${display$1('block')}
|
|
19526
|
+
|
|
19527
|
+
:host {
|
|
19528
|
+
contain: layout;
|
|
19529
|
+
z-index: ${ZIndexLevels.zIndex1000};
|
|
19530
|
+
}
|
|
19531
|
+
|
|
19532
|
+
${'' /* Override 'display' helper hidden behavior */}
|
|
19533
|
+
:host([hidden]) {
|
|
19534
|
+
display: block;
|
|
19535
|
+
visibility: hidden;
|
|
19536
|
+
}
|
|
19537
|
+
`;
|
|
19538
|
+
|
|
19539
|
+
// When the anchor element changes position on the page, it is the client's responsibility to update the position
|
|
19540
|
+
// of the anchored region by calling update() on the anchored region.
|
|
19541
|
+
//
|
|
19542
|
+
// When the anchor element is recreated on the page, it is the client's responsibility to reset the reference the
|
|
19543
|
+
// anchored region has to the anchor element. This can be done by either recreating the anchor element with a new
|
|
19544
|
+
// ID that is also set as the \`anchor\` attribute on the anchored region or by explicitly setting the value of
|
|
19545
|
+
// anchorElement on the anchored region to the new anchor element.
|
|
19546
|
+
/**
|
|
19547
|
+
* A nimble-styled anchored region control.
|
|
19548
|
+
*/
|
|
19549
|
+
class AnchoredRegion extends AnchoredRegion$1 {
|
|
19550
|
+
}
|
|
19551
|
+
const nimbleAnchoredRegion = AnchoredRegion.compose({
|
|
19552
|
+
baseName: 'anchored-region',
|
|
19553
|
+
baseClass: AnchoredRegion$1,
|
|
19554
|
+
template: anchoredRegionTemplate,
|
|
19555
|
+
styles: styles$T
|
|
19556
|
+
});
|
|
19557
|
+
DesignSystem.getOrCreate()
|
|
19558
|
+
.withPrefix('nimble')
|
|
19559
|
+
.register(nimbleAnchoredRegion());
|
|
19560
|
+
const anchoredRegionTag = 'nimble-anchored-region';
|
|
19561
|
+
|
|
19562
|
+
/**
|
|
19563
|
+
* Subscription for {@link ThemeStyleSheetBehavior}
|
|
19564
|
+
*/
|
|
19565
|
+
class ThemeStyleSheetBehaviorSubscription {
|
|
19566
|
+
constructor(value, styles, source) {
|
|
19567
|
+
this.value = value;
|
|
19568
|
+
this.styles = styles;
|
|
19569
|
+
this.source = source;
|
|
19570
|
+
}
|
|
19571
|
+
handleChange() {
|
|
19572
|
+
const theme$1 = theme.getValueFor(this.source);
|
|
19573
|
+
if (Array.isArray(this.value)
|
|
19574
|
+
? this.value.includes(theme$1)
|
|
19575
|
+
: this.value === theme$1) {
|
|
19576
|
+
this.source.$fastController.addStyles(this.styles);
|
|
19577
|
+
}
|
|
19578
|
+
else {
|
|
19579
|
+
this.source.$fastController.removeStyles(this.styles);
|
|
19580
|
+
}
|
|
19581
|
+
}
|
|
19582
|
+
}
|
|
19583
|
+
/**
|
|
19584
|
+
* Behavior to conditionally apply theme-based stylesheets.
|
|
19585
|
+
*/
|
|
19586
|
+
class ThemeStyleSheetBehavior {
|
|
19587
|
+
constructor(theme, styles) {
|
|
19588
|
+
this.theme = theme;
|
|
19589
|
+
this.styles = styles;
|
|
19590
|
+
this.cache = new WeakMap();
|
|
19591
|
+
}
|
|
19592
|
+
/**
|
|
19593
|
+
* @internal
|
|
19594
|
+
*/
|
|
19595
|
+
bind(source) {
|
|
19596
|
+
const subscriber = this.cache.get(source)
|
|
19597
|
+
|| new ThemeStyleSheetBehaviorSubscription(this.theme, this.styles, source);
|
|
19598
|
+
// Currently subscriber from cache may have gone through unbind
|
|
19599
|
+
// but still be in cache so always resubscribe
|
|
19600
|
+
// See: https://github.com/microsoft/fast/issues/3246#issuecomment-1030424876
|
|
19601
|
+
theme.subscribe(subscriber, source);
|
|
19602
|
+
subscriber.handleChange();
|
|
19603
|
+
this.cache.set(source, subscriber);
|
|
19604
|
+
}
|
|
19605
|
+
/**
|
|
19606
|
+
* @internal
|
|
19607
|
+
*/
|
|
19608
|
+
unbind(source) {
|
|
19609
|
+
const subscriber = this.cache.get(source);
|
|
19610
|
+
if (subscriber) {
|
|
19611
|
+
theme.unsubscribe(subscriber);
|
|
19612
|
+
}
|
|
19613
|
+
// Currently does not evict subscriber from cache
|
|
19614
|
+
// See: https://github.com/microsoft/fast/issues/3246#issuecomment-1030424876
|
|
19615
|
+
}
|
|
19616
|
+
}
|
|
19617
|
+
/**
|
|
19618
|
+
* Behavior to conditionally apply theme-based stylesheets. To determine which to apply,
|
|
19619
|
+
* the behavior will use the nearest ThemeProvider's 'theme' design system value.
|
|
19620
|
+
*
|
|
19621
|
+
* @public
|
|
19622
|
+
* @example
|
|
19623
|
+
* ```ts
|
|
19624
|
+
* css`
|
|
19625
|
+
* // ...
|
|
19626
|
+
* `.withBehaviors(
|
|
19627
|
+
* themeBehavior(Theme.light, css` ... `),
|
|
19628
|
+
* // Apply style for both dark and color theme
|
|
19629
|
+
* themeBehavior([Theme.dark, Theme.color], css` ... `)
|
|
19630
|
+
* )
|
|
19631
|
+
* ```
|
|
19632
|
+
*/
|
|
19633
|
+
const themeBehavior = (theme, styles) => new ThemeStyleSheetBehavior(theme, styles);
|
|
19634
|
+
/* eslint-enable max-classes-per-file */
|
|
19521
19635
|
|
|
19522
19636
|
const styles$S = css `
|
|
19523
|
-
${display$1('
|
|
19637
|
+
${display$1('flex')}
|
|
19524
19638
|
|
|
19525
19639
|
:host {
|
|
19526
|
-
|
|
19527
|
-
|
|
19528
|
-
|
|
19529
|
-
|
|
19640
|
+
font: ${bodyFont};
|
|
19641
|
+
font-size: 12.8px;
|
|
19642
|
+
align-items: top;
|
|
19643
|
+
overflow: hidden;
|
|
19644
|
+
overflow-wrap: anywhere;
|
|
19530
19645
|
}
|
|
19531
19646
|
|
|
19532
|
-
|
|
19647
|
+
:host(:not([open])) {
|
|
19648
|
+
display: none;
|
|
19649
|
+
}
|
|
19650
|
+
|
|
19651
|
+
.container {
|
|
19652
|
+
color: ${bodyFontColor};
|
|
19653
|
+
display: flex;
|
|
19533
19654
|
width: 100%;
|
|
19534
|
-
height: 100%;
|
|
19535
19655
|
}
|
|
19536
19656
|
|
|
19537
|
-
|
|
19538
|
-
|
|
19657
|
+
.icon {
|
|
19658
|
+
width: 48px;
|
|
19659
|
+
display: flex;
|
|
19660
|
+
justify-content: center;
|
|
19661
|
+
margin-top: 8px;
|
|
19662
|
+
flex: 0 0 auto;
|
|
19663
|
+
opacity: 0.6;
|
|
19539
19664
|
}
|
|
19540
19665
|
|
|
19541
|
-
|
|
19542
|
-
|
|
19666
|
+
.text {
|
|
19667
|
+
display: inline;
|
|
19668
|
+
margin-top: 7px;
|
|
19669
|
+
margin-bottom: 7px;
|
|
19543
19670
|
}
|
|
19544
19671
|
|
|
19545
|
-
|
|
19546
|
-
|
|
19672
|
+
slot[name='title'] {
|
|
19673
|
+
display: inline;
|
|
19674
|
+
font-weight: bold;
|
|
19675
|
+
padding-right: 8px;
|
|
19547
19676
|
}
|
|
19548
19677
|
|
|
19549
|
-
:host([
|
|
19550
|
-
${
|
|
19678
|
+
:host([title-hidden]) slot[name='title'] {
|
|
19679
|
+
${accessiblyHidden}
|
|
19551
19680
|
}
|
|
19552
19681
|
|
|
19553
|
-
.
|
|
19554
|
-
|
|
19555
|
-
|
|
19556
|
-
|
|
19682
|
+
.controls {
|
|
19683
|
+
height: ${controlHeight};
|
|
19684
|
+
margin-left: auto;
|
|
19685
|
+
display: flex;
|
|
19686
|
+
align-items: center;
|
|
19687
|
+
justify-content: center;
|
|
19688
|
+
align-self: flex-start;
|
|
19689
|
+
margin-top: ${smallPadding};
|
|
19690
|
+
${controlHeight.cssCustomProperty}: ${controlSlimHeight};
|
|
19557
19691
|
}
|
|
19558
|
-
`;
|
|
19559
19692
|
|
|
19560
|
-
|
|
19561
|
-
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
|
|
19575
|
-
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19693
|
+
slot[name='action'] {
|
|
19694
|
+
display: flex;
|
|
19695
|
+
align-content: center;
|
|
19696
|
+
margin-left: ${standardPadding};
|
|
19697
|
+
white-space: nowrap;
|
|
19698
|
+
}
|
|
19699
|
+
|
|
19700
|
+
slot[name='action']::slotted(nimble-anchor) {
|
|
19701
|
+
font-size: 12.8px;
|
|
19702
|
+
}
|
|
19703
|
+
|
|
19704
|
+
.dismiss {
|
|
19705
|
+
width: 48px;
|
|
19706
|
+
display: flex;
|
|
19707
|
+
justify-content: center;
|
|
19708
|
+
}
|
|
19709
|
+
`.withBehaviors(themeBehavior(Theme.light, css `
|
|
19710
|
+
:host {
|
|
19711
|
+
background: ${Black75};
|
|
19712
|
+
}
|
|
19713
|
+
|
|
19714
|
+
:host([severity='error']) {
|
|
19715
|
+
background: ${Fail100LightUi};
|
|
19716
|
+
}
|
|
19717
|
+
|
|
19718
|
+
:host([severity='warning']) {
|
|
19719
|
+
background: ${Warning100LightUi};
|
|
19720
|
+
}
|
|
19721
|
+
|
|
19722
|
+
:host([severity='information']) {
|
|
19723
|
+
background: ${Information100LightUi};
|
|
19724
|
+
}
|
|
19725
|
+
`), themeBehavior(Theme.dark, css `
|
|
19726
|
+
:host {
|
|
19727
|
+
background: ${Black75};
|
|
19728
|
+
}
|
|
19729
|
+
|
|
19730
|
+
:host([severity='error']) {
|
|
19731
|
+
background: ${BannerFail100DarkUi};
|
|
19732
|
+
}
|
|
19733
|
+
|
|
19734
|
+
:host([severity='warning']) {
|
|
19735
|
+
background: ${Warning100DarkUi};
|
|
19736
|
+
}
|
|
19737
|
+
|
|
19738
|
+
:host([severity='information']) {
|
|
19739
|
+
background: ${Information100DarkUi};
|
|
19740
|
+
}
|
|
19741
|
+
`), themeBehavior(Theme.color, css `
|
|
19742
|
+
:host {
|
|
19743
|
+
background: ${applicationBackgroundColor};
|
|
19744
|
+
}
|
|
19745
|
+
|
|
19746
|
+
.container {
|
|
19747
|
+
background: ${hexToRgbaCssColor(White, 0.3)};
|
|
19748
|
+
}
|
|
19749
|
+
`));
|
|
19580
19750
|
|
|
19581
19751
|
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
19582
19752
|
// See generation source in nimble-components/build/generate-icons
|
|
@@ -19641,55 +19811,6 @@
|
|
|
19641
19811
|
information: 'information'
|
|
19642
19812
|
};
|
|
19643
19813
|
|
|
19644
|
-
const coreLabelDefaults = {
|
|
19645
|
-
popupDismissLabel: 'Close',
|
|
19646
|
-
numericIncrementLabel: 'Increment',
|
|
19647
|
-
numericDecrementLabel: 'Decrement',
|
|
19648
|
-
popupIconErrorLabel: 'Error',
|
|
19649
|
-
popupIconWarningLabel: 'Warning',
|
|
19650
|
-
popupIconInformationLabel: 'Information',
|
|
19651
|
-
filterSearchLabel: 'Search',
|
|
19652
|
-
filterNoResultsLabel: 'No items found',
|
|
19653
|
-
loadingLabel: 'Loading…'
|
|
19654
|
-
};
|
|
19655
|
-
|
|
19656
|
-
const popupDismissLabel = DesignToken.create({
|
|
19657
|
-
name: 'popup-dismiss-label',
|
|
19658
|
-
cssCustomPropertyName: null
|
|
19659
|
-
}).withDefault(coreLabelDefaults.popupDismissLabel);
|
|
19660
|
-
const numericDecrementLabel = DesignToken.create({
|
|
19661
|
-
name: 'numeric-decrement-label',
|
|
19662
|
-
cssCustomPropertyName: null
|
|
19663
|
-
}).withDefault(coreLabelDefaults.numericDecrementLabel);
|
|
19664
|
-
const numericIncrementLabel = DesignToken.create({
|
|
19665
|
-
name: 'numeric-increment-label',
|
|
19666
|
-
cssCustomPropertyName: null
|
|
19667
|
-
}).withDefault(coreLabelDefaults.numericIncrementLabel);
|
|
19668
|
-
const popupIconErrorLabel = DesignToken.create({
|
|
19669
|
-
name: 'popup-icon-error-label',
|
|
19670
|
-
cssCustomPropertyName: null
|
|
19671
|
-
}).withDefault(coreLabelDefaults.popupIconErrorLabel);
|
|
19672
|
-
const popupIconWarningLabel = DesignToken.create({
|
|
19673
|
-
name: 'popup-icon-warning-label',
|
|
19674
|
-
cssCustomPropertyName: null
|
|
19675
|
-
}).withDefault(coreLabelDefaults.popupIconWarningLabel);
|
|
19676
|
-
const popupIconInformationLabel = DesignToken.create({
|
|
19677
|
-
name: 'popup-icon-information-label',
|
|
19678
|
-
cssCustomPropertyName: null
|
|
19679
|
-
}).withDefault(coreLabelDefaults.popupIconInformationLabel);
|
|
19680
|
-
const filterSearchLabel = DesignToken.create({
|
|
19681
|
-
name: 'filter-search-label',
|
|
19682
|
-
cssCustomPropertyName: null
|
|
19683
|
-
}).withDefault(coreLabelDefaults.filterSearchLabel);
|
|
19684
|
-
const filterNoResultsLabel = DesignToken.create({
|
|
19685
|
-
name: 'filter-no-results-label',
|
|
19686
|
-
cssCustomPropertyName: null
|
|
19687
|
-
}).withDefault(coreLabelDefaults.filterNoResultsLabel);
|
|
19688
|
-
const loadingLabel = DesignToken.create({
|
|
19689
|
-
name: 'loading-label',
|
|
19690
|
-
cssCustomPropertyName: null
|
|
19691
|
-
}).withDefault(coreLabelDefaults.loadingLabel);
|
|
19692
|
-
|
|
19693
19814
|
// prettier-ignore
|
|
19694
19815
|
const template$E = html `
|
|
19695
19816
|
<${themeProviderTag} theme="${Theme.color}">
|
|
@@ -19810,7 +19931,7 @@
|
|
|
19810
19931
|
const nimbleBanner = Banner.compose({
|
|
19811
19932
|
baseName: 'banner',
|
|
19812
19933
|
template: template$E,
|
|
19813
|
-
styles: styles$
|
|
19934
|
+
styles: styles$S
|
|
19814
19935
|
});
|
|
19815
19936
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
|
|
19816
19937
|
|
|
@@ -22363,31 +22484,6 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
22363
22484
|
}
|
|
22364
22485
|
registerIcon('icon-arrow-down-right-and-arrow-up-left', IconArrowDownRightAndArrowUpLeft);
|
|
22365
22486
|
|
|
22366
|
-
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
22367
|
-
// See generation source in nimble-components/build/generate-icons
|
|
22368
|
-
/**
|
|
22369
|
-
* The icon component for the 'arrowExpanderLeft' icon
|
|
22370
|
-
*/
|
|
22371
|
-
class IconArrowExpanderLeft extends Icon {
|
|
22372
|
-
constructor() {
|
|
22373
|
-
super(arrowExpanderLeft16X16);
|
|
22374
|
-
}
|
|
22375
|
-
}
|
|
22376
|
-
registerIcon('icon-arrow-expander-left', IconArrowExpanderLeft);
|
|
22377
|
-
|
|
22378
|
-
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
22379
|
-
// See generation source in nimble-components/build/generate-icons
|
|
22380
|
-
/**
|
|
22381
|
-
* The icon component for the 'arrowExpanderRight' icon
|
|
22382
|
-
*/
|
|
22383
|
-
class IconArrowExpanderRight extends Icon {
|
|
22384
|
-
constructor() {
|
|
22385
|
-
super(arrowExpanderRight16X16);
|
|
22386
|
-
}
|
|
22387
|
-
}
|
|
22388
|
-
registerIcon('icon-arrow-expander-right', IconArrowExpanderRight);
|
|
22389
|
-
const iconArrowExpanderRightTag = 'nimble-icon-arrow-expander-right';
|
|
22390
|
-
|
|
22391
22487
|
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
22392
22488
|
// See generation source in nimble-components/build/generate-icons
|
|
22393
22489
|
/**
|
|
@@ -24708,7 +24804,9 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
24708
24804
|
popupIconInformation: popupIconInformationLabel,
|
|
24709
24805
|
filterSearch: filterSearchLabel,
|
|
24710
24806
|
filterNoResults: filterNoResultsLabel,
|
|
24711
|
-
loading: loadingLabel
|
|
24807
|
+
loading: loadingLabel,
|
|
24808
|
+
scrollBackward: scrollBackwardLabel,
|
|
24809
|
+
scrollForward: scrollForwardLabel
|
|
24712
24810
|
};
|
|
24713
24811
|
/**
|
|
24714
24812
|
* Core label provider for Nimble
|
|
@@ -24746,6 +24844,12 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
24746
24844
|
__decorate$1([
|
|
24747
24845
|
attr({ attribute: 'loading' })
|
|
24748
24846
|
], LabelProviderCore.prototype, "loading", void 0);
|
|
24847
|
+
__decorate$1([
|
|
24848
|
+
attr({ attribute: 'scroll-backward' })
|
|
24849
|
+
], LabelProviderCore.prototype, "scrollBackward", void 0);
|
|
24850
|
+
__decorate$1([
|
|
24851
|
+
attr({ attribute: 'scroll-forward' })
|
|
24852
|
+
], LabelProviderCore.prototype, "scrollForward", void 0);
|
|
24749
24853
|
const nimbleLabelProviderCore = LabelProviderCore.compose({
|
|
24750
24854
|
baseName: 'label-provider-core',
|
|
24751
24855
|
styles: styles$G
|
|
@@ -61936,6 +62040,7 @@ img.ProseMirror-separator {
|
|
|
61936
62040
|
align-items: center;
|
|
61937
62041
|
justify-content: center;
|
|
61938
62042
|
cursor: pointer;
|
|
62043
|
+
text-wrap: nowrap;
|
|
61939
62044
|
--ni-private-active-indicator-width: 2px;
|
|
61940
62045
|
--ni-private-focus-indicator-width: 1px;
|
|
61941
62046
|
--ni-private-indicator-lines-gap: 1px;
|
|
@@ -73794,29 +73899,9 @@ focus outline in that case.
|
|
|
73794
73899
|
.register(nimbleTableColumnText());
|
|
73795
73900
|
|
|
73796
73901
|
const styles$9 = css `
|
|
73797
|
-
${
|
|
73798
|
-
|
|
73799
|
-
:host {
|
|
73800
|
-
grid-template-columns: auto 1fr;
|
|
73801
|
-
grid-template-rows: auto 1fr;
|
|
73802
|
-
}
|
|
73803
|
-
|
|
73804
|
-
[part='start'] {
|
|
73805
|
-
display: none;
|
|
73806
|
-
}
|
|
73807
|
-
|
|
73808
|
-
.tablist {
|
|
73809
|
-
display: grid;
|
|
73810
|
-
grid-template-rows: auto auto;
|
|
73811
|
-
grid-template-columns: auto;
|
|
73812
|
-
width: max-content;
|
|
73813
|
-
align-self: end;
|
|
73814
|
-
}
|
|
73902
|
+
${styles$X}
|
|
73815
73903
|
|
|
73816
73904
|
.tabpanel {
|
|
73817
|
-
grid-row: 2;
|
|
73818
|
-
grid-column-start: 1;
|
|
73819
|
-
grid-column-end: 4;
|
|
73820
73905
|
overflow: auto;
|
|
73821
73906
|
}
|
|
73822
73907
|
`;
|
|
@@ -73827,14 +73912,75 @@ focus outline in that case.
|
|
|
73827
73912
|
class Tabs extends Tabs$1 {
|
|
73828
73913
|
constructor() {
|
|
73829
73914
|
super();
|
|
73915
|
+
/**
|
|
73916
|
+
* @internal
|
|
73917
|
+
*/
|
|
73918
|
+
this.showScrollButtons = false;
|
|
73919
|
+
/**
|
|
73920
|
+
* @internal
|
|
73921
|
+
*/
|
|
73922
|
+
this.tabSlotName = 'tab';
|
|
73830
73923
|
// We disable the built-in active indicator so that we can implement our own
|
|
73831
73924
|
this.activeindicator = false;
|
|
73925
|
+
this.tabListResizeObserver = new ResizeObserver(entries => {
|
|
73926
|
+
let tabListVisibleWidth = entries[0]?.contentRect.width;
|
|
73927
|
+
if (tabListVisibleWidth !== undefined) {
|
|
73928
|
+
const buttonWidth = this.leftScrollButton?.clientWidth ?? 0;
|
|
73929
|
+
tabListVisibleWidth = Math.ceil(tabListVisibleWidth);
|
|
73930
|
+
if (this.showScrollButtons) {
|
|
73931
|
+
tabListVisibleWidth += buttonWidth * 2;
|
|
73932
|
+
}
|
|
73933
|
+
this.showScrollButtons = tabListVisibleWidth < this.tablist.scrollWidth;
|
|
73934
|
+
}
|
|
73935
|
+
});
|
|
73936
|
+
}
|
|
73937
|
+
/**
|
|
73938
|
+
* @internal
|
|
73939
|
+
*/
|
|
73940
|
+
connectedCallback() {
|
|
73941
|
+
super.connectedCallback();
|
|
73942
|
+
this.tabListResizeObserver.observe(this.tablist);
|
|
73943
|
+
}
|
|
73944
|
+
/**
|
|
73945
|
+
* @internal
|
|
73946
|
+
*/
|
|
73947
|
+
disconnectedCallback() {
|
|
73948
|
+
super.disconnectedCallback();
|
|
73949
|
+
this.tabListResizeObserver.disconnect();
|
|
73950
|
+
}
|
|
73951
|
+
/**
|
|
73952
|
+
* @internal
|
|
73953
|
+
*/
|
|
73954
|
+
activeidChanged(oldValue, newValue) {
|
|
73955
|
+
super.activeidChanged(oldValue, newValue);
|
|
73956
|
+
this.activetab?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
73957
|
+
}
|
|
73958
|
+
/**
|
|
73959
|
+
* @internal
|
|
73960
|
+
*/
|
|
73961
|
+
onScrollLeftClick() {
|
|
73962
|
+
this.tablist.scrollBy({
|
|
73963
|
+
left: -this.tablist.clientWidth,
|
|
73964
|
+
behavior: 'smooth'
|
|
73965
|
+
});
|
|
73966
|
+
}
|
|
73967
|
+
/**
|
|
73968
|
+
* @internal
|
|
73969
|
+
*/
|
|
73970
|
+
onScrollRightClick() {
|
|
73971
|
+
this.tablist.scrollBy({
|
|
73972
|
+
left: this.tablist.clientWidth,
|
|
73973
|
+
behavior: 'smooth'
|
|
73974
|
+
});
|
|
73832
73975
|
}
|
|
73833
73976
|
}
|
|
73977
|
+
__decorate$1([
|
|
73978
|
+
observable
|
|
73979
|
+
], Tabs.prototype, "showScrollButtons", void 0);
|
|
73834
73980
|
const nimbleTabs = Tabs.compose({
|
|
73835
73981
|
baseName: 'tabs',
|
|
73836
73982
|
baseClass: Tabs$1,
|
|
73837
|
-
template:
|
|
73983
|
+
template: template$G,
|
|
73838
73984
|
styles: styles$9
|
|
73839
73985
|
});
|
|
73840
73986
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTabs());
|