@ni/nimble-components 10.0.3 → 10.0.6
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 +399 -159
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1098 -1027
- 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/menu-button/styles.js +0 -8
- package/dist/esm/menu-button/styles.js.map +1 -1
- package/dist/esm/menu-button/template.js +4 -6
- package/dist/esm/menu-button/template.js.map +1 -1
- package/dist/esm/patterns/button/styles.js +5 -1
- package/dist/esm/patterns/button/styles.js.map +1 -1
- package/package.json +2 -2
|
@@ -4422,6 +4422,7 @@
|
|
|
4422
4422
|
* This set of exported strings reference https://developer.mozilla.org/en-US/docs/Web/Events
|
|
4423
4423
|
* and should include all non-deprecated and non-experimental Standard events
|
|
4424
4424
|
*/
|
|
4425
|
+
const eventChange = "change";
|
|
4425
4426
|
const eventResize = "resize";
|
|
4426
4427
|
const eventScroll = "scroll";
|
|
4427
4428
|
|
|
@@ -13058,7 +13059,7 @@
|
|
|
13058
13059
|
*/
|
|
13059
13060
|
const focusVisible$1 = canUseFocusVisible() ? "focus-visible" : "focus";
|
|
13060
13061
|
|
|
13061
|
-
const styles$
|
|
13062
|
+
const styles$p = css `
|
|
13062
13063
|
:host {
|
|
13063
13064
|
contain: layout;
|
|
13064
13065
|
display: block;
|
|
@@ -13082,7 +13083,7 @@
|
|
|
13082
13083
|
baseName: 'anchored-region',
|
|
13083
13084
|
baseClass: AnchoredRegion$1,
|
|
13084
13085
|
template: anchoredRegionTemplate,
|
|
13085
|
-
styles: styles$
|
|
13086
|
+
styles: styles$p
|
|
13086
13087
|
});
|
|
13087
13088
|
DesignSystem.getOrCreate()
|
|
13088
13089
|
.withPrefix('nimble')
|
|
@@ -13417,9 +13418,9 @@
|
|
|
13417
13418
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13418
13419
|
}
|
|
13419
13420
|
|
|
13420
|
-
const template$
|
|
13421
|
+
const template$5 = html `<slot></slot>`;
|
|
13421
13422
|
|
|
13422
|
-
const styles$
|
|
13423
|
+
const styles$o = css `
|
|
13423
13424
|
:host {
|
|
13424
13425
|
display: contents;
|
|
13425
13426
|
}
|
|
@@ -13475,8 +13476,8 @@
|
|
|
13475
13476
|
], ThemeProvider.prototype, "theme", void 0);
|
|
13476
13477
|
const nimbleDesignSystemProvider = ThemeProvider.compose({
|
|
13477
13478
|
baseName: 'theme-provider',
|
|
13478
|
-
styles: styles$
|
|
13479
|
-
template: template$
|
|
13479
|
+
styles: styles$o,
|
|
13480
|
+
template: template$5
|
|
13480
13481
|
});
|
|
13481
13482
|
DesignSystem.getOrCreate()
|
|
13482
13483
|
.withPrefix('nimble')
|
|
@@ -13724,7 +13725,7 @@
|
|
|
13724
13725
|
*/
|
|
13725
13726
|
const themeBehavior = (lightStyle, darkStyleOrAlias, colorStyleOrAlias) => new ThemeStyleSheetBehavior(lightStyle, darkStyleOrAlias, colorStyleOrAlias);
|
|
13726
13727
|
|
|
13727
|
-
const styles$
|
|
13728
|
+
const styles$n = css `
|
|
13728
13729
|
${display('inline-block')}
|
|
13729
13730
|
|
|
13730
13731
|
:host {
|
|
@@ -13787,7 +13788,7 @@
|
|
|
13787
13788
|
baseName: 'breadcrumb',
|
|
13788
13789
|
baseClass: Breadcrumb$1,
|
|
13789
13790
|
template: breadcrumbTemplate,
|
|
13790
|
-
styles: styles$
|
|
13791
|
+
styles: styles$n
|
|
13791
13792
|
});
|
|
13792
13793
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBreadcrumb());
|
|
13793
13794
|
|
|
@@ -14373,7 +14374,7 @@
|
|
|
14373
14374
|
*/
|
|
14374
14375
|
const focusVisible = `:${focusVisible$1}`;
|
|
14375
14376
|
|
|
14376
|
-
const styles$
|
|
14377
|
+
const styles$m = css `
|
|
14377
14378
|
${display('inline-flex')}
|
|
14378
14379
|
|
|
14379
14380
|
:host {
|
|
@@ -14453,7 +14454,7 @@
|
|
|
14453
14454
|
baseName: 'breadcrumb-item',
|
|
14454
14455
|
baseClass: BreadcrumbItem$1,
|
|
14455
14456
|
template: breadcrumbItemTemplate,
|
|
14456
|
-
styles: styles$
|
|
14457
|
+
styles: styles$m,
|
|
14457
14458
|
separator: forwardSlash16X16.data
|
|
14458
14459
|
});
|
|
14459
14460
|
DesignSystem.getOrCreate()
|
|
@@ -14483,7 +14484,7 @@
|
|
|
14483
14484
|
block: 'block'
|
|
14484
14485
|
};
|
|
14485
14486
|
|
|
14486
|
-
const styles$
|
|
14487
|
+
const styles$l = css `
|
|
14487
14488
|
${display('inline-flex')}
|
|
14488
14489
|
|
|
14489
14490
|
:host {
|
|
@@ -14591,7 +14592,7 @@
|
|
|
14591
14592
|
}
|
|
14592
14593
|
|
|
14593
14594
|
:host([disabled]) slot[name='start']::slotted(*) {
|
|
14594
|
-
opacity: 0.
|
|
14595
|
+
opacity: 0.3;
|
|
14595
14596
|
}
|
|
14596
14597
|
|
|
14597
14598
|
[part='end'] {
|
|
@@ -14599,6 +14600,10 @@
|
|
|
14599
14600
|
${iconColor.cssCustomProperty}: ${buttonLabelFontColor};
|
|
14600
14601
|
}
|
|
14601
14602
|
|
|
14603
|
+
:host([disabled]) slot[name='end']::slotted(*) {
|
|
14604
|
+
opacity: 0.3;
|
|
14605
|
+
}
|
|
14606
|
+
|
|
14602
14607
|
:host([content-hidden]) [part='end'] {
|
|
14603
14608
|
display: none;
|
|
14604
14609
|
}
|
|
@@ -14686,7 +14691,7 @@
|
|
|
14686
14691
|
`));
|
|
14687
14692
|
|
|
14688
14693
|
// prettier-ignore
|
|
14689
|
-
const styles$
|
|
14694
|
+
const styles$k = styles$l
|
|
14690
14695
|
.withBehaviors(appearanceBehavior(ButtonAppearance.outline, css `
|
|
14691
14696
|
:host(.primary) .control {
|
|
14692
14697
|
box-shadow: 0px 0px 0px ${borderWidth} rgba(${actionRgbPartialColor}, 0.3) inset;
|
|
@@ -14800,14 +14805,14 @@
|
|
|
14800
14805
|
baseName: 'button',
|
|
14801
14806
|
baseClass: Button$1,
|
|
14802
14807
|
template: buttonTemplate,
|
|
14803
|
-
styles: styles$
|
|
14808
|
+
styles: styles$k,
|
|
14804
14809
|
shadowOptions: {
|
|
14805
14810
|
delegatesFocus: true
|
|
14806
14811
|
}
|
|
14807
14812
|
});
|
|
14808
14813
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleButton());
|
|
14809
14814
|
|
|
14810
|
-
const styles$
|
|
14815
|
+
const styles$j = css `
|
|
14811
14816
|
${display('inline-flex')}
|
|
14812
14817
|
|
|
14813
14818
|
:host {
|
|
@@ -14925,7 +14930,7 @@
|
|
|
14925
14930
|
baseName: 'checkbox',
|
|
14926
14931
|
baseClass: Checkbox$1,
|
|
14927
14932
|
template: checkboxTemplate,
|
|
14928
|
-
styles: styles$
|
|
14933
|
+
styles: styles$j,
|
|
14929
14934
|
checkedIndicator: check16X16.data,
|
|
14930
14935
|
indeterminateIndicator: minus16X16.data
|
|
14931
14936
|
});
|
|
@@ -16020,7 +16025,7 @@
|
|
|
16020
16025
|
slideOutOptions
|
|
16021
16026
|
};
|
|
16022
16027
|
|
|
16023
|
-
const styles$
|
|
16028
|
+
const styles$i = css `
|
|
16024
16029
|
${display('block')}
|
|
16025
16030
|
|
|
16026
16031
|
:host {
|
|
@@ -16332,17 +16337,17 @@
|
|
|
16332
16337
|
const nimbleDrawer = Drawer.compose({
|
|
16333
16338
|
baseName: 'drawer',
|
|
16334
16339
|
template: dialogTemplate,
|
|
16335
|
-
styles: styles$
|
|
16340
|
+
styles: styles$i
|
|
16336
16341
|
});
|
|
16337
16342
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDrawer());
|
|
16338
16343
|
|
|
16339
|
-
const template$
|
|
16344
|
+
const template$4 = html `
|
|
16340
16345
|
<template>
|
|
16341
16346
|
<div class="icon" :innerHTML=${x => x.icon.data}></div>
|
|
16342
16347
|
</template
|
|
16343
16348
|
`;
|
|
16344
16349
|
|
|
16345
|
-
const styles$
|
|
16350
|
+
const styles$h = css `
|
|
16346
16351
|
${display('inline-flex')}
|
|
16347
16352
|
|
|
16348
16353
|
:host {
|
|
@@ -16388,8 +16393,8 @@
|
|
|
16388
16393
|
const registerIcon = (baseName, iconClass) => {
|
|
16389
16394
|
const composedIcon = iconClass.compose({
|
|
16390
16395
|
baseName,
|
|
16391
|
-
template: template$
|
|
16392
|
-
styles: styles$
|
|
16396
|
+
template: template$4,
|
|
16397
|
+
styles: styles$h,
|
|
16393
16398
|
baseClass: iconClass
|
|
16394
16399
|
});
|
|
16395
16400
|
DesignSystem.getOrCreate().withPrefix('nimble').register(composedIcon());
|
|
@@ -17957,7 +17962,7 @@
|
|
|
17957
17962
|
}
|
|
17958
17963
|
registerIcon('xmark-check-icon', XmarkCheckIcon);
|
|
17959
17964
|
|
|
17960
|
-
const styles$
|
|
17965
|
+
const styles$g = css `
|
|
17961
17966
|
${display('flex')}
|
|
17962
17967
|
|
|
17963
17968
|
:host {
|
|
@@ -18036,11 +18041,11 @@
|
|
|
18036
18041
|
baseName: 'list-option',
|
|
18037
18042
|
baseClass: ListboxOption,
|
|
18038
18043
|
template: listboxOptionTemplate,
|
|
18039
|
-
styles: styles$
|
|
18044
|
+
styles: styles$g
|
|
18040
18045
|
});
|
|
18041
18046
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleListOption());
|
|
18042
18047
|
|
|
18043
|
-
const styles$
|
|
18048
|
+
const styles$f = css `
|
|
18044
18049
|
${display('grid')}
|
|
18045
18050
|
|
|
18046
18051
|
:host {
|
|
@@ -18095,11 +18100,356 @@
|
|
|
18095
18100
|
baseName: 'menu',
|
|
18096
18101
|
baseClass: Menu$1,
|
|
18097
18102
|
template: menuTemplate,
|
|
18098
|
-
styles: styles$
|
|
18103
|
+
styles: styles$f
|
|
18099
18104
|
});
|
|
18100
18105
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenu());
|
|
18101
18106
|
|
|
18107
|
+
const styles$e = css `
|
|
18108
|
+
${display('inline-block')}
|
|
18109
|
+
|
|
18110
|
+
:host {
|
|
18111
|
+
height: ${controlHeight};
|
|
18112
|
+
}
|
|
18113
|
+
|
|
18114
|
+
[part='button'] {
|
|
18115
|
+
width: 100%;
|
|
18116
|
+
height: 100%;
|
|
18117
|
+
}
|
|
18118
|
+
|
|
18119
|
+
slot[name='menu']::slotted(*) {
|
|
18120
|
+
margin-top: ${smallPadding};
|
|
18121
|
+
margin-bottom: ${smallPadding};
|
|
18122
|
+
}
|
|
18123
|
+
`;
|
|
18124
|
+
|
|
18102
18125
|
const styles$d = css `
|
|
18126
|
+
${styles$l}
|
|
18127
|
+
|
|
18128
|
+
.control[aria-pressed='true'] {
|
|
18129
|
+
background-color: ${fillSelectedColor};
|
|
18130
|
+
border-color: ${fillSelectedColor};
|
|
18131
|
+
}
|
|
18132
|
+
|
|
18133
|
+
.control[aria-pressed='true']:hover {
|
|
18134
|
+
background-color: ${fillSelectedColor};
|
|
18135
|
+
}
|
|
18136
|
+
|
|
18137
|
+
.control[aria-pressed='true']${focusVisible} {
|
|
18138
|
+
background-color: ${fillSelectedColor};
|
|
18139
|
+
}
|
|
18140
|
+
|
|
18141
|
+
.control[aria-pressed='true'][disabled] {
|
|
18142
|
+
background-color: ${fillSelectedColor};
|
|
18143
|
+
border-color: ${fillSelectedColor};
|
|
18144
|
+
}
|
|
18145
|
+
|
|
18146
|
+
.control[aria-pressed='true'][disabled]:hover {
|
|
18147
|
+
background-color: ${fillSelectedColor};
|
|
18148
|
+
border-color: ${fillSelectedColor};
|
|
18149
|
+
}
|
|
18150
|
+
`;
|
|
18151
|
+
|
|
18152
|
+
const template$3 = (context, definition) => html `
|
|
18153
|
+
<div
|
|
18154
|
+
role="button"
|
|
18155
|
+
part="control"
|
|
18156
|
+
tabindex="${x => (x.disabled ? null : 0)}"
|
|
18157
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
18158
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
18159
|
+
class="control ${x => (x.checked ? 'checked' : '')}"
|
|
18160
|
+
?disabled="${x => x.disabled}"
|
|
18161
|
+
${'' /* Configure aria-disabled, aria-readonly, and aria-pressed based on the
|
|
18162
|
+
toggle button's state to keep the ARIA attributes consistent with the component's
|
|
18163
|
+
state without a client having to configure ARIA attributes directly */}
|
|
18164
|
+
aria-disabled="${x => x.disabled}"
|
|
18165
|
+
aria-readonly="${x => x.readOnly}"
|
|
18166
|
+
aria-pressed="${x => x.checked}"
|
|
18167
|
+
${'' /* Configure all other ARIA attributes based on the aria attributes
|
|
18168
|
+
configured on the toggle button */}
|
|
18169
|
+
aria-atomic="${x => x.ariaAtomic}"
|
|
18170
|
+
aria-busy="${x => x.ariaBusy}"
|
|
18171
|
+
aria-controls="${x => x.ariaControls}"
|
|
18172
|
+
aria-current="${x => x.ariaCurrent}"
|
|
18173
|
+
aria-describedby="${x => x.ariaDescribedby}"
|
|
18174
|
+
aria-details="${x => x.ariaDetails}"
|
|
18175
|
+
aria-errormessage="${x => x.ariaErrormessage}"
|
|
18176
|
+
aria-expanded="${x => x.ariaExpanded}"
|
|
18177
|
+
aria-flowto="${x => x.ariaFlowto}"
|
|
18178
|
+
aria-haspopup="${x => x.ariaHaspopup}"
|
|
18179
|
+
aria-hidden="${x => x.ariaHidden}"
|
|
18180
|
+
aria-invalid="${x => x.ariaInvalid}"
|
|
18181
|
+
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
18182
|
+
aria-label="${x => x.ariaLabel}"
|
|
18183
|
+
aria-labelledby="${x => x.ariaLabelledby}"
|
|
18184
|
+
aria-live="${x => x.ariaLive}"
|
|
18185
|
+
aria-owns="${x => x.ariaOwns}"
|
|
18186
|
+
aria-relevant="${x => x.ariaRelevant}"
|
|
18187
|
+
aria-roledescription="${x => x.ariaRoledescription}"
|
|
18188
|
+
${ref('control')}
|
|
18189
|
+
>
|
|
18190
|
+
${startSlotTemplate(context, definition)}
|
|
18191
|
+
<span class="content" part="content">
|
|
18192
|
+
<slot></slot>
|
|
18193
|
+
</span>
|
|
18194
|
+
${endSlotTemplate(context, definition)}
|
|
18195
|
+
</div>
|
|
18196
|
+
`;
|
|
18197
|
+
|
|
18198
|
+
/**
|
|
18199
|
+
* A nimble-styled toggle button control.
|
|
18200
|
+
*/
|
|
18201
|
+
class ToggleButton extends Switch$1 {
|
|
18202
|
+
constructor() {
|
|
18203
|
+
super(...arguments);
|
|
18204
|
+
/**
|
|
18205
|
+
* @public
|
|
18206
|
+
* @remarks
|
|
18207
|
+
* HTML Attribute: appearance
|
|
18208
|
+
*/
|
|
18209
|
+
this.appearance = ButtonAppearance.outline;
|
|
18210
|
+
/**
|
|
18211
|
+
* @public
|
|
18212
|
+
* @remarks
|
|
18213
|
+
* HTML Attribute: content-hidden
|
|
18214
|
+
*/
|
|
18215
|
+
this.contentHidden = false;
|
|
18216
|
+
}
|
|
18217
|
+
}
|
|
18218
|
+
__decorate([
|
|
18219
|
+
attr
|
|
18220
|
+
], ToggleButton.prototype, "appearance", void 0);
|
|
18221
|
+
__decorate([
|
|
18222
|
+
attr({ attribute: 'content-hidden', mode: 'boolean' })
|
|
18223
|
+
], ToggleButton.prototype, "contentHidden", void 0);
|
|
18224
|
+
applyMixins(ToggleButton, StartEnd, DelegatesARIAButton);
|
|
18225
|
+
const nimbleToggleButton = ToggleButton.compose({
|
|
18226
|
+
baseName: 'toggle-button',
|
|
18227
|
+
template: template$3,
|
|
18228
|
+
styles: styles$d,
|
|
18229
|
+
shadowOptions: {
|
|
18230
|
+
delegatesFocus: true
|
|
18231
|
+
}
|
|
18232
|
+
});
|
|
18233
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleToggleButton());
|
|
18234
|
+
|
|
18235
|
+
// prettier-ignore
|
|
18236
|
+
const template$2 = context => html `
|
|
18237
|
+
<template
|
|
18238
|
+
?open="${x => x.open}"
|
|
18239
|
+
@focusout="${(x, c) => x.focusoutHandler(c.event)}"
|
|
18240
|
+
>
|
|
18241
|
+
<${context.tagFor(ToggleButton)}
|
|
18242
|
+
part="button"
|
|
18243
|
+
appearance="${x => x.appearance}"
|
|
18244
|
+
content-hidden="${x => x.contentHidden}"
|
|
18245
|
+
?checked="${x => x.open}"
|
|
18246
|
+
?disabled="${x => x.disabled}"
|
|
18247
|
+
aria-haspopup="true"
|
|
18248
|
+
aria-expanded="${x => x.open}"
|
|
18249
|
+
@change="${(x, c) => x.toggleButtonCheckedChangeHandler(c.event)}"
|
|
18250
|
+
@keydown="${(x, c) => x.toggleButtonKeyDownHandler(c.event)}"
|
|
18251
|
+
${ref('toggleButton')}
|
|
18252
|
+
exportparts="start,end"
|
|
18253
|
+
>
|
|
18254
|
+
${'' /* Forward the contents of the 'start', 'end', and default slots to the toggle button */}
|
|
18255
|
+
<slot slot="start" name="start"></slot>
|
|
18256
|
+
<slot></slot>
|
|
18257
|
+
<slot slot="end" name="end"></slot>
|
|
18258
|
+
</${context.tagFor(ToggleButton)}>
|
|
18259
|
+
${when(x => x.open, html `
|
|
18260
|
+
<${context.tagFor(AnchoredRegion)}
|
|
18261
|
+
fixed-placement="true"
|
|
18262
|
+
auto-update-mode="auto"
|
|
18263
|
+
horizontal-inset="true"
|
|
18264
|
+
horizontal-positioning-mode="dynamic"
|
|
18265
|
+
vertical-positioning-mode="${x => (x.position === 'auto' ? 'dynamic' : 'locktodefault')}"
|
|
18266
|
+
vertical-default-position="${x => (x.position === 'above' ? 'top' : 'bottom')}"
|
|
18267
|
+
@loaded="${x => x.regionLoadedHandler()}"
|
|
18268
|
+
@keydown="${(x, c) => x.menuKeyDownHandler(c.event)}"
|
|
18269
|
+
${ref('region')}
|
|
18270
|
+
>
|
|
18271
|
+
<span part="menu">
|
|
18272
|
+
<slot name="menu" ${slotted({ property: 'slottedMenus', filter: elements('[role=menu]') })}></slot>
|
|
18273
|
+
</span>
|
|
18274
|
+
</${context.tagFor(AnchoredRegion)}>
|
|
18275
|
+
`)}
|
|
18276
|
+
</template>
|
|
18277
|
+
`;
|
|
18278
|
+
|
|
18279
|
+
/**
|
|
18280
|
+
* Types of menu button appearance.
|
|
18281
|
+
* @public
|
|
18282
|
+
*/
|
|
18283
|
+
/**
|
|
18284
|
+
* The options of where to position the menu relative to the menu button.
|
|
18285
|
+
*/
|
|
18286
|
+
const MenuButtonPosition = {
|
|
18287
|
+
above: 'above',
|
|
18288
|
+
below: 'below',
|
|
18289
|
+
auto: 'auto'
|
|
18290
|
+
};
|
|
18291
|
+
|
|
18292
|
+
/**
|
|
18293
|
+
* A nimble-styled menu button control.
|
|
18294
|
+
*/
|
|
18295
|
+
class MenuButton extends FoundationElement {
|
|
18296
|
+
constructor() {
|
|
18297
|
+
super(...arguments);
|
|
18298
|
+
this.appearance = ButtonAppearance.outline;
|
|
18299
|
+
this.disabled = false;
|
|
18300
|
+
this.contentHidden = false;
|
|
18301
|
+
/**
|
|
18302
|
+
* Specifies whether or not the menu is open.
|
|
18303
|
+
*/
|
|
18304
|
+
this.open = false;
|
|
18305
|
+
/**
|
|
18306
|
+
* Configures where the menu should be placed relative to the button that opens the menu.
|
|
18307
|
+
*/
|
|
18308
|
+
this.position = MenuButtonPosition.auto;
|
|
18309
|
+
/**
|
|
18310
|
+
* Used to maintain the internal state of whether the last menu item should be focused instead
|
|
18311
|
+
* of the first menu item the next time the menu is opened.
|
|
18312
|
+
*/
|
|
18313
|
+
this.focusLastItemWhenOpened = false;
|
|
18314
|
+
this.menuChangeHandler = () => {
|
|
18315
|
+
this.open = false;
|
|
18316
|
+
this.toggleButton.focus();
|
|
18317
|
+
};
|
|
18318
|
+
}
|
|
18319
|
+
disconnectedCallback() {
|
|
18320
|
+
super.disconnectedCallback();
|
|
18321
|
+
if (this.region) {
|
|
18322
|
+
this.region.removeEventListener(eventChange, this.menuChangeHandler);
|
|
18323
|
+
}
|
|
18324
|
+
}
|
|
18325
|
+
toggleButtonChanged(_prev, _next) {
|
|
18326
|
+
if (this.region && this.toggleButton) {
|
|
18327
|
+
this.region.anchorElement = this.toggleButton;
|
|
18328
|
+
}
|
|
18329
|
+
}
|
|
18330
|
+
regionChanged(prev, _next) {
|
|
18331
|
+
if (prev) {
|
|
18332
|
+
prev.removeEventListener(eventChange, this.menuChangeHandler);
|
|
18333
|
+
}
|
|
18334
|
+
if (this.region) {
|
|
18335
|
+
if (this.toggleButton) {
|
|
18336
|
+
this.region.anchorElement = this.toggleButton;
|
|
18337
|
+
}
|
|
18338
|
+
this.region.addEventListener(eventChange, this.menuChangeHandler, {
|
|
18339
|
+
capture: true
|
|
18340
|
+
});
|
|
18341
|
+
}
|
|
18342
|
+
}
|
|
18343
|
+
openChanged(_prev, _next) {
|
|
18344
|
+
if (this.toggleButton) {
|
|
18345
|
+
this.toggleButton.checked = this.open;
|
|
18346
|
+
}
|
|
18347
|
+
if (!this.open) {
|
|
18348
|
+
// Only fire an event here if the menu is changing to being closed. Otherwise,
|
|
18349
|
+
// wait until the menu is actually opened before firing the event.
|
|
18350
|
+
this.$emit('open-change');
|
|
18351
|
+
}
|
|
18352
|
+
}
|
|
18353
|
+
regionLoadedHandler() {
|
|
18354
|
+
if (this.focusLastItemWhenOpened) {
|
|
18355
|
+
this.focusLastMenuItem();
|
|
18356
|
+
this.focusLastItemWhenOpened = false;
|
|
18357
|
+
}
|
|
18358
|
+
else {
|
|
18359
|
+
this.focusMenu();
|
|
18360
|
+
}
|
|
18361
|
+
this.$emit('open-change');
|
|
18362
|
+
}
|
|
18363
|
+
focusoutHandler(e) {
|
|
18364
|
+
if (!this.open) {
|
|
18365
|
+
return true;
|
|
18366
|
+
}
|
|
18367
|
+
const focusTarget = e.relatedTarget;
|
|
18368
|
+
if (!this.contains(focusTarget)) {
|
|
18369
|
+
this.open = false;
|
|
18370
|
+
return false;
|
|
18371
|
+
}
|
|
18372
|
+
return true;
|
|
18373
|
+
}
|
|
18374
|
+
toggleButtonCheckedChangeHandler(e) {
|
|
18375
|
+
this.open = this.toggleButton.checked;
|
|
18376
|
+
// Don't bubble the 'change' event from the toggle button because
|
|
18377
|
+
// the menu button has its own 'open-change' event.
|
|
18378
|
+
e.stopPropagation();
|
|
18379
|
+
return false;
|
|
18380
|
+
}
|
|
18381
|
+
toggleButtonKeyDownHandler(e) {
|
|
18382
|
+
switch (e.key) {
|
|
18383
|
+
case keyArrowUp:
|
|
18384
|
+
this.focusLastItemWhenOpened = true;
|
|
18385
|
+
this.open = true;
|
|
18386
|
+
return false;
|
|
18387
|
+
case keyArrowDown:
|
|
18388
|
+
this.open = true;
|
|
18389
|
+
return false;
|
|
18390
|
+
default:
|
|
18391
|
+
return true;
|
|
18392
|
+
}
|
|
18393
|
+
}
|
|
18394
|
+
menuKeyDownHandler(e) {
|
|
18395
|
+
switch (e.key) {
|
|
18396
|
+
case keyEscape:
|
|
18397
|
+
this.open = false;
|
|
18398
|
+
this.toggleButton.focus();
|
|
18399
|
+
return false;
|
|
18400
|
+
default:
|
|
18401
|
+
return true;
|
|
18402
|
+
}
|
|
18403
|
+
}
|
|
18404
|
+
get menu() {
|
|
18405
|
+
return this.slottedMenus?.length ? this.slottedMenus[0] : undefined;
|
|
18406
|
+
}
|
|
18407
|
+
focusMenu() {
|
|
18408
|
+
this.menu?.focus();
|
|
18409
|
+
}
|
|
18410
|
+
focusLastMenuItem() {
|
|
18411
|
+
const menuItems = this.menu?.querySelectorAll('[role=menuitem]');
|
|
18412
|
+
if (menuItems?.length) {
|
|
18413
|
+
const lastMenuItem = menuItems[menuItems.length - 1];
|
|
18414
|
+
lastMenuItem.focus();
|
|
18415
|
+
}
|
|
18416
|
+
}
|
|
18417
|
+
}
|
|
18418
|
+
__decorate([
|
|
18419
|
+
attr
|
|
18420
|
+
], MenuButton.prototype, "appearance", void 0);
|
|
18421
|
+
__decorate([
|
|
18422
|
+
attr({ mode: 'boolean' })
|
|
18423
|
+
], MenuButton.prototype, "disabled", void 0);
|
|
18424
|
+
__decorate([
|
|
18425
|
+
attr({ attribute: 'content-hidden', mode: 'boolean' })
|
|
18426
|
+
], MenuButton.prototype, "contentHidden", void 0);
|
|
18427
|
+
__decorate([
|
|
18428
|
+
attr({ mode: 'boolean' })
|
|
18429
|
+
], MenuButton.prototype, "open", void 0);
|
|
18430
|
+
__decorate([
|
|
18431
|
+
attr({ attribute: 'position' })
|
|
18432
|
+
], MenuButton.prototype, "position", void 0);
|
|
18433
|
+
__decorate([
|
|
18434
|
+
observable
|
|
18435
|
+
], MenuButton.prototype, "toggleButton", void 0);
|
|
18436
|
+
__decorate([
|
|
18437
|
+
observable
|
|
18438
|
+
], MenuButton.prototype, "region", void 0);
|
|
18439
|
+
__decorate([
|
|
18440
|
+
observable
|
|
18441
|
+
], MenuButton.prototype, "slottedMenus", void 0);
|
|
18442
|
+
const nimbleMenuButton = MenuButton.compose({
|
|
18443
|
+
baseName: 'menu-button',
|
|
18444
|
+
template: template$2,
|
|
18445
|
+
styles: styles$e,
|
|
18446
|
+
shadowOptions: {
|
|
18447
|
+
delegatesFocus: true
|
|
18448
|
+
}
|
|
18449
|
+
});
|
|
18450
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenuButton());
|
|
18451
|
+
|
|
18452
|
+
const styles$c = css `
|
|
18103
18453
|
${display('grid')}
|
|
18104
18454
|
|
|
18105
18455
|
:host {
|
|
@@ -18197,12 +18547,12 @@
|
|
|
18197
18547
|
baseName: 'menu-item',
|
|
18198
18548
|
baseClass: MenuItem$1,
|
|
18199
18549
|
template: menuItemTemplate,
|
|
18200
|
-
styles: styles$
|
|
18550
|
+
styles: styles$c,
|
|
18201
18551
|
expandCollapseGlyph: arrowExpanderRight16X16.data
|
|
18202
18552
|
});
|
|
18203
18553
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenuItem());
|
|
18204
18554
|
|
|
18205
|
-
const styles$
|
|
18555
|
+
const styles$b = css `
|
|
18206
18556
|
${display('inline-block')}
|
|
18207
18557
|
|
|
18208
18558
|
:host {
|
|
@@ -18328,7 +18678,7 @@
|
|
|
18328
18678
|
baseName: 'number-field',
|
|
18329
18679
|
baseClass: NumberField$1,
|
|
18330
18680
|
template: numberFieldTemplate,
|
|
18331
|
-
styles: styles$
|
|
18681
|
+
styles: styles$b,
|
|
18332
18682
|
shadowOptions: {
|
|
18333
18683
|
delegatesFocus: true
|
|
18334
18684
|
},
|
|
@@ -18337,7 +18687,7 @@
|
|
|
18337
18687
|
});
|
|
18338
18688
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleNumberField());
|
|
18339
18689
|
|
|
18340
|
-
const styles$
|
|
18690
|
+
const styles$a = css `
|
|
18341
18691
|
${display('inline-flex')}
|
|
18342
18692
|
|
|
18343
18693
|
:host {
|
|
@@ -18505,12 +18855,12 @@
|
|
|
18505
18855
|
baseName: 'select',
|
|
18506
18856
|
baseClass: Select$1,
|
|
18507
18857
|
template: selectTemplate,
|
|
18508
|
-
styles: styles$
|
|
18858
|
+
styles: styles$a,
|
|
18509
18859
|
indicator: arrowExpanderDown16X16.data
|
|
18510
18860
|
});
|
|
18511
18861
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSelect());
|
|
18512
18862
|
|
|
18513
|
-
const styles$
|
|
18863
|
+
const styles$9 = css `
|
|
18514
18864
|
${display('inline-flex')}
|
|
18515
18865
|
|
|
18516
18866
|
:host {
|
|
@@ -18678,7 +19028,7 @@
|
|
|
18678
19028
|
`));
|
|
18679
19029
|
|
|
18680
19030
|
// prettier-ignore
|
|
18681
|
-
const template$
|
|
19031
|
+
const template$1 = html `
|
|
18682
19032
|
<template
|
|
18683
19033
|
role="switch"
|
|
18684
19034
|
aria-checked="${x => x.checked}"
|
|
@@ -18722,12 +19072,12 @@
|
|
|
18722
19072
|
const nimbleSwitch = Switch.compose({
|
|
18723
19073
|
baseClass: Switch$1,
|
|
18724
19074
|
baseName: 'switch',
|
|
18725
|
-
template: template$
|
|
18726
|
-
styles: styles$
|
|
19075
|
+
template: template$1,
|
|
19076
|
+
styles: styles$9
|
|
18727
19077
|
});
|
|
18728
19078
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSwitch());
|
|
18729
19079
|
|
|
18730
|
-
const styles$
|
|
19080
|
+
const styles$8 = css `
|
|
18731
19081
|
${display('inline-flex')}
|
|
18732
19082
|
|
|
18733
19083
|
:host {
|
|
@@ -18831,11 +19181,11 @@
|
|
|
18831
19181
|
baseName: 'tab',
|
|
18832
19182
|
baseClass: Tab$1,
|
|
18833
19183
|
template: tabTemplate,
|
|
18834
|
-
styles: styles$
|
|
19184
|
+
styles: styles$8
|
|
18835
19185
|
});
|
|
18836
19186
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTab());
|
|
18837
19187
|
|
|
18838
|
-
const styles$
|
|
19188
|
+
const styles$7 = css `
|
|
18839
19189
|
${display('block')}
|
|
18840
19190
|
|
|
18841
19191
|
:host {
|
|
@@ -18855,11 +19205,11 @@
|
|
|
18855
19205
|
baseName: 'tab-panel',
|
|
18856
19206
|
baseClass: TabPanel$1,
|
|
18857
19207
|
template: tabPanelTemplate,
|
|
18858
|
-
styles: styles$
|
|
19208
|
+
styles: styles$7
|
|
18859
19209
|
});
|
|
18860
19210
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTabPanel());
|
|
18861
19211
|
|
|
18862
|
-
const styles$
|
|
19212
|
+
const styles$6 = css `
|
|
18863
19213
|
${display('grid')}
|
|
18864
19214
|
|
|
18865
19215
|
:host {
|
|
@@ -18897,11 +19247,11 @@
|
|
|
18897
19247
|
baseName: 'tabs',
|
|
18898
19248
|
baseClass: Tabs$1,
|
|
18899
19249
|
template: tabsTemplate,
|
|
18900
|
-
styles: styles$
|
|
19250
|
+
styles: styles$6
|
|
18901
19251
|
});
|
|
18902
19252
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTabs());
|
|
18903
19253
|
|
|
18904
|
-
const styles$
|
|
19254
|
+
const styles$5 = css `
|
|
18905
19255
|
${display('flex')}
|
|
18906
19256
|
|
|
18907
19257
|
:host {
|
|
@@ -18921,7 +19271,7 @@
|
|
|
18921
19271
|
}
|
|
18922
19272
|
`;
|
|
18923
19273
|
|
|
18924
|
-
const template
|
|
19274
|
+
const template = html `
|
|
18925
19275
|
<template slot="end">
|
|
18926
19276
|
<div class="separator"></div>
|
|
18927
19277
|
<slot></slot>
|
|
@@ -18935,8 +19285,8 @@
|
|
|
18935
19285
|
}
|
|
18936
19286
|
const nimbleTabsToolbar = TabsToolbar.compose({
|
|
18937
19287
|
baseName: 'tabs-toolbar',
|
|
18938
|
-
template
|
|
18939
|
-
styles: styles$
|
|
19288
|
+
template,
|
|
19289
|
+
styles: styles$5
|
|
18940
19290
|
});
|
|
18941
19291
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTabsToolbar());
|
|
18942
19292
|
|
|
@@ -18945,7 +19295,7 @@
|
|
|
18945
19295
|
block: 'block'
|
|
18946
19296
|
};
|
|
18947
19297
|
|
|
18948
|
-
const styles$
|
|
19298
|
+
const styles$4 = css `
|
|
18949
19299
|
${display('inline-flex')}
|
|
18950
19300
|
|
|
18951
19301
|
:host {
|
|
@@ -19087,7 +19437,7 @@
|
|
|
19087
19437
|
baseName: 'text-area',
|
|
19088
19438
|
baseClass: TextArea$1,
|
|
19089
19439
|
template: textAreaTemplate,
|
|
19090
|
-
styles: styles$
|
|
19440
|
+
styles: styles$4,
|
|
19091
19441
|
shadowOptions: {
|
|
19092
19442
|
delegatesFocus: true
|
|
19093
19443
|
}
|
|
@@ -19104,7 +19454,7 @@
|
|
|
19104
19454
|
frameless: 'frameless'
|
|
19105
19455
|
};
|
|
19106
19456
|
|
|
19107
|
-
const styles$
|
|
19457
|
+
const styles$3 = css `
|
|
19108
19458
|
${display('inline-block')}
|
|
19109
19459
|
|
|
19110
19460
|
:host {
|
|
@@ -19458,7 +19808,7 @@
|
|
|
19458
19808
|
baseName: 'text-field',
|
|
19459
19809
|
baseClass: TextField$1,
|
|
19460
19810
|
template: textFieldTemplate,
|
|
19461
|
-
styles: styles$
|
|
19811
|
+
styles: styles$3,
|
|
19462
19812
|
shadowOptions: {
|
|
19463
19813
|
delegatesFocus: true
|
|
19464
19814
|
},
|
|
@@ -19479,116 +19829,6 @@
|
|
|
19479
19829
|
});
|
|
19480
19830
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTextField());
|
|
19481
19831
|
|
|
19482
|
-
const styles$3 = css `
|
|
19483
|
-
${styles$k}
|
|
19484
|
-
|
|
19485
|
-
.control[aria-pressed='true'] {
|
|
19486
|
-
background-color: ${fillSelectedColor};
|
|
19487
|
-
border-color: ${fillSelectedColor};
|
|
19488
|
-
}
|
|
19489
|
-
|
|
19490
|
-
.control[aria-pressed='true']:hover {
|
|
19491
|
-
background-color: ${fillSelectedColor};
|
|
19492
|
-
}
|
|
19493
|
-
|
|
19494
|
-
.control[aria-pressed='true']${focusVisible} {
|
|
19495
|
-
background-color: ${fillSelectedColor};
|
|
19496
|
-
}
|
|
19497
|
-
|
|
19498
|
-
.control[aria-pressed='true'][disabled] {
|
|
19499
|
-
background-color: ${fillSelectedColor};
|
|
19500
|
-
border-color: ${fillSelectedColor};
|
|
19501
|
-
}
|
|
19502
|
-
|
|
19503
|
-
.control[aria-pressed='true'][disabled]:hover {
|
|
19504
|
-
background-color: ${fillSelectedColor};
|
|
19505
|
-
border-color: ${fillSelectedColor};
|
|
19506
|
-
}
|
|
19507
|
-
`;
|
|
19508
|
-
|
|
19509
|
-
const template = (context, definition) => html `
|
|
19510
|
-
<div
|
|
19511
|
-
role="button"
|
|
19512
|
-
part="control"
|
|
19513
|
-
tabindex="${x => (x.disabled ? null : 0)}"
|
|
19514
|
-
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
19515
|
-
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
19516
|
-
class="control ${x => (x.checked ? 'checked' : '')}"
|
|
19517
|
-
?disabled="${x => x.disabled}"
|
|
19518
|
-
${'' /* Configure aria-disabled, aria-readonly, and aria-pressed based on the
|
|
19519
|
-
toggle button's state to keep the ARIA attributes consistent with the component's
|
|
19520
|
-
state without a client having to configure ARIA attributes directly */}
|
|
19521
|
-
aria-disabled="${x => x.disabled}"
|
|
19522
|
-
aria-readonly="${x => x.readOnly}"
|
|
19523
|
-
aria-pressed="${x => x.checked}"
|
|
19524
|
-
${'' /* Configure all other ARIA attributes based on the aria attributes
|
|
19525
|
-
configured on the toggle button */}
|
|
19526
|
-
aria-atomic="${x => x.ariaAtomic}"
|
|
19527
|
-
aria-busy="${x => x.ariaBusy}"
|
|
19528
|
-
aria-controls="${x => x.ariaControls}"
|
|
19529
|
-
aria-current="${x => x.ariaCurrent}"
|
|
19530
|
-
aria-describedby="${x => x.ariaDescribedby}"
|
|
19531
|
-
aria-details="${x => x.ariaDetails}"
|
|
19532
|
-
aria-errormessage="${x => x.ariaErrormessage}"
|
|
19533
|
-
aria-expanded="${x => x.ariaExpanded}"
|
|
19534
|
-
aria-flowto="${x => x.ariaFlowto}"
|
|
19535
|
-
aria-haspopup="${x => x.ariaHaspopup}"
|
|
19536
|
-
aria-hidden="${x => x.ariaHidden}"
|
|
19537
|
-
aria-invalid="${x => x.ariaInvalid}"
|
|
19538
|
-
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
19539
|
-
aria-label="${x => x.ariaLabel}"
|
|
19540
|
-
aria-labelledby="${x => x.ariaLabelledby}"
|
|
19541
|
-
aria-live="${x => x.ariaLive}"
|
|
19542
|
-
aria-owns="${x => x.ariaOwns}"
|
|
19543
|
-
aria-relevant="${x => x.ariaRelevant}"
|
|
19544
|
-
aria-roledescription="${x => x.ariaRoledescription}"
|
|
19545
|
-
${ref('control')}
|
|
19546
|
-
>
|
|
19547
|
-
${startSlotTemplate(context, definition)}
|
|
19548
|
-
<span class="content" part="content">
|
|
19549
|
-
<slot></slot>
|
|
19550
|
-
</span>
|
|
19551
|
-
${endSlotTemplate(context, definition)}
|
|
19552
|
-
</div>
|
|
19553
|
-
`;
|
|
19554
|
-
|
|
19555
|
-
/**
|
|
19556
|
-
* A nimble-styled toggle button control.
|
|
19557
|
-
*/
|
|
19558
|
-
class ToggleButton extends Switch$1 {
|
|
19559
|
-
constructor() {
|
|
19560
|
-
super(...arguments);
|
|
19561
|
-
/**
|
|
19562
|
-
* @public
|
|
19563
|
-
* @remarks
|
|
19564
|
-
* HTML Attribute: appearance
|
|
19565
|
-
*/
|
|
19566
|
-
this.appearance = ButtonAppearance.outline;
|
|
19567
|
-
/**
|
|
19568
|
-
* @public
|
|
19569
|
-
* @remarks
|
|
19570
|
-
* HTML Attribute: content-hidden
|
|
19571
|
-
*/
|
|
19572
|
-
this.contentHidden = false;
|
|
19573
|
-
}
|
|
19574
|
-
}
|
|
19575
|
-
__decorate([
|
|
19576
|
-
attr
|
|
19577
|
-
], ToggleButton.prototype, "appearance", void 0);
|
|
19578
|
-
__decorate([
|
|
19579
|
-
attr({ attribute: 'content-hidden', mode: 'boolean' })
|
|
19580
|
-
], ToggleButton.prototype, "contentHidden", void 0);
|
|
19581
|
-
applyMixins(ToggleButton, StartEnd, DelegatesARIAButton);
|
|
19582
|
-
const nimbleToggleButton = ToggleButton.compose({
|
|
19583
|
-
baseName: 'toggle-button',
|
|
19584
|
-
template,
|
|
19585
|
-
styles: styles$3,
|
|
19586
|
-
shadowOptions: {
|
|
19587
|
-
delegatesFocus: true
|
|
19588
|
-
}
|
|
19589
|
-
});
|
|
19590
|
-
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleToggleButton());
|
|
19591
|
-
|
|
19592
19832
|
const styles$2 = css `
|
|
19593
19833
|
.positioning-region {
|
|
19594
19834
|
display: flex;
|