@ni/nimble-components 11.12.1 → 11.14.0
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 +811 -67
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1396 -1190
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/all-components.d.ts +2 -0
- package/dist/esm/all-components.js +2 -0
- package/dist/esm/all-components.js.map +1 -1
- package/dist/esm/card-button/styles.js +7 -7
- package/dist/esm/card-button/styles.js.map +1 -1
- package/dist/esm/checkbox/styles.js +1 -1
- package/dist/esm/dialog/styles.js +21 -1
- package/dist/esm/dialog/styles.js.map +1 -1
- package/dist/esm/drawer/styles.js +2 -2
- package/dist/esm/drawer/styles.js.map +1 -1
- package/dist/esm/radio-button/index.d.ts +11 -0
- package/dist/esm/radio-button/index.js +17 -0
- package/dist/esm/radio-button/index.js.map +1 -0
- package/dist/esm/radio-button/styles.d.ts +1 -0
- package/dist/esm/radio-button/styles.js +95 -0
- package/dist/esm/radio-button/styles.js.map +1 -0
- package/dist/esm/radio-group/index.d.ts +13 -0
- package/dist/esm/radio-group/index.js +18 -0
- package/dist/esm/radio-group/index.js.map +1 -0
- package/dist/esm/radio-group/styles.d.ts +1 -0
- package/dist/esm/radio-group/styles.js +29 -0
- package/dist/esm/radio-group/styles.js.map +1 -0
- package/dist/esm/switch/styles.js +0 -2
- package/dist/esm/switch/styles.js.map +1 -1
- package/dist/esm/theme-provider/design-token-comments.js +1 -0
- package/dist/esm/theme-provider/design-token-comments.js.map +1 -1
- package/dist/esm/theme-provider/design-token-names.js +1 -0
- package/dist/esm/theme-provider/design-token-names.js.map +1 -1
- package/dist/esm/theme-provider/design-tokens-static.d.ts +3 -0
- package/dist/esm/theme-provider/design-tokens-static.js +6 -0
- package/dist/esm/theme-provider/design-tokens-static.js.map +1 -0
- package/dist/esm/theme-provider/design-tokens.d.ts +1 -0
- package/dist/esm/theme-provider/design-tokens.js +14 -0
- package/dist/esm/theme-provider/design-tokens.js.map +1 -1
- package/dist/tokens-internal.scss +6 -0
- package/dist/tokens.scss +3 -0
- package/package.json +12 -12
|
@@ -11483,6 +11483,570 @@
|
|
|
11483
11483
|
], NumberField$1.prototype, "defaultSlottedNodes", void 0);
|
|
11484
11484
|
applyMixins(NumberField$1, StartEnd, DelegatesARIATextbox);
|
|
11485
11485
|
|
|
11486
|
+
/**
|
|
11487
|
+
* The template for the {@link @microsoft/fast-foundation#RadioGroup} component.
|
|
11488
|
+
* @public
|
|
11489
|
+
*/
|
|
11490
|
+
const radioGroupTemplate = (context, definition) => html `
|
|
11491
|
+
<template
|
|
11492
|
+
role="radiogroup"
|
|
11493
|
+
aria-disabled="${x => x.disabled}"
|
|
11494
|
+
aria-readonly="${x => x.readOnly}"
|
|
11495
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
11496
|
+
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
11497
|
+
@focusout="${(x, c) => x.focusOutHandler(c.event)}"
|
|
11498
|
+
>
|
|
11499
|
+
<slot name="label"></slot>
|
|
11500
|
+
<div
|
|
11501
|
+
class="positioning-region ${x => x.orientation === Orientation.horizontal ? "horizontal" : "vertical"}"
|
|
11502
|
+
part="positioning-region"
|
|
11503
|
+
>
|
|
11504
|
+
<slot
|
|
11505
|
+
${slotted({
|
|
11506
|
+
property: "slottedRadioButtons",
|
|
11507
|
+
filter: elements("[role=radio]"),
|
|
11508
|
+
})}
|
|
11509
|
+
></slot>
|
|
11510
|
+
</div>
|
|
11511
|
+
</template>
|
|
11512
|
+
`;
|
|
11513
|
+
|
|
11514
|
+
/**
|
|
11515
|
+
* An Radio Group Custom HTML Element.
|
|
11516
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radiogroup | ARIA radiogroup }.
|
|
11517
|
+
*
|
|
11518
|
+
* @slot label - The slot for the label
|
|
11519
|
+
* @slot - The default slot for radio buttons
|
|
11520
|
+
* @csspart positioning-region - The positioning region for laying out the radios
|
|
11521
|
+
* @fires change - Fires a custom 'change' event when the value changes
|
|
11522
|
+
*
|
|
11523
|
+
* @public
|
|
11524
|
+
*/
|
|
11525
|
+
class RadioGroup$1 extends FoundationElement {
|
|
11526
|
+
constructor() {
|
|
11527
|
+
super(...arguments);
|
|
11528
|
+
/**
|
|
11529
|
+
* The orientation of the group
|
|
11530
|
+
*
|
|
11531
|
+
* @public
|
|
11532
|
+
* @remarks
|
|
11533
|
+
* HTML Attribute: orientation
|
|
11534
|
+
*/
|
|
11535
|
+
this.orientation = Orientation.horizontal;
|
|
11536
|
+
this.radioChangeHandler = (e) => {
|
|
11537
|
+
const changedRadio = e.target;
|
|
11538
|
+
if (changedRadio.checked) {
|
|
11539
|
+
this.slottedRadioButtons.forEach((radio) => {
|
|
11540
|
+
if (radio !== changedRadio) {
|
|
11541
|
+
radio.checked = false;
|
|
11542
|
+
if (!this.isInsideFoundationToolbar) {
|
|
11543
|
+
radio.setAttribute("tabindex", "-1");
|
|
11544
|
+
}
|
|
11545
|
+
}
|
|
11546
|
+
});
|
|
11547
|
+
this.selectedRadio = changedRadio;
|
|
11548
|
+
this.value = changedRadio.value;
|
|
11549
|
+
changedRadio.setAttribute("tabindex", "0");
|
|
11550
|
+
this.focusedRadio = changedRadio;
|
|
11551
|
+
}
|
|
11552
|
+
e.stopPropagation();
|
|
11553
|
+
};
|
|
11554
|
+
this.moveToRadioByIndex = (group, index) => {
|
|
11555
|
+
const radio = group[index];
|
|
11556
|
+
if (!this.isInsideToolbar) {
|
|
11557
|
+
radio.setAttribute("tabindex", "0");
|
|
11558
|
+
if (radio.readOnly) {
|
|
11559
|
+
this.slottedRadioButtons.forEach((nextRadio) => {
|
|
11560
|
+
if (nextRadio !== radio) {
|
|
11561
|
+
nextRadio.setAttribute("tabindex", "-1");
|
|
11562
|
+
}
|
|
11563
|
+
});
|
|
11564
|
+
}
|
|
11565
|
+
else {
|
|
11566
|
+
radio.checked = true;
|
|
11567
|
+
this.selectedRadio = radio;
|
|
11568
|
+
}
|
|
11569
|
+
}
|
|
11570
|
+
this.focusedRadio = radio;
|
|
11571
|
+
radio.focus();
|
|
11572
|
+
};
|
|
11573
|
+
this.moveRightOffGroup = () => {
|
|
11574
|
+
var _a;
|
|
11575
|
+
(_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
|
|
11576
|
+
};
|
|
11577
|
+
this.moveLeftOffGroup = () => {
|
|
11578
|
+
var _a;
|
|
11579
|
+
(_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
|
|
11580
|
+
};
|
|
11581
|
+
/**
|
|
11582
|
+
* @internal
|
|
11583
|
+
*/
|
|
11584
|
+
this.focusOutHandler = (e) => {
|
|
11585
|
+
const group = this.slottedRadioButtons;
|
|
11586
|
+
const radio = e.target;
|
|
11587
|
+
const index = radio !== null ? group.indexOf(radio) : 0;
|
|
11588
|
+
const focusedIndex = this.focusedRadio
|
|
11589
|
+
? group.indexOf(this.focusedRadio)
|
|
11590
|
+
: -1;
|
|
11591
|
+
if ((focusedIndex === 0 && index === focusedIndex) ||
|
|
11592
|
+
(focusedIndex === group.length - 1 && focusedIndex === index)) {
|
|
11593
|
+
if (!this.selectedRadio) {
|
|
11594
|
+
this.focusedRadio = group[0];
|
|
11595
|
+
this.focusedRadio.setAttribute("tabindex", "0");
|
|
11596
|
+
group.forEach((nextRadio) => {
|
|
11597
|
+
if (nextRadio !== this.focusedRadio) {
|
|
11598
|
+
nextRadio.setAttribute("tabindex", "-1");
|
|
11599
|
+
}
|
|
11600
|
+
});
|
|
11601
|
+
}
|
|
11602
|
+
else {
|
|
11603
|
+
this.focusedRadio = this.selectedRadio;
|
|
11604
|
+
if (!this.isInsideFoundationToolbar) {
|
|
11605
|
+
this.selectedRadio.setAttribute("tabindex", "0");
|
|
11606
|
+
group.forEach((nextRadio) => {
|
|
11607
|
+
if (nextRadio !== this.selectedRadio) {
|
|
11608
|
+
nextRadio.setAttribute("tabindex", "-1");
|
|
11609
|
+
}
|
|
11610
|
+
});
|
|
11611
|
+
}
|
|
11612
|
+
}
|
|
11613
|
+
}
|
|
11614
|
+
return true;
|
|
11615
|
+
};
|
|
11616
|
+
/**
|
|
11617
|
+
* @internal
|
|
11618
|
+
*/
|
|
11619
|
+
this.clickHandler = (e) => {
|
|
11620
|
+
const radio = e.target;
|
|
11621
|
+
if (radio) {
|
|
11622
|
+
const group = this.slottedRadioButtons;
|
|
11623
|
+
if (radio.checked || group.indexOf(radio) === 0) {
|
|
11624
|
+
radio.setAttribute("tabindex", "0");
|
|
11625
|
+
this.selectedRadio = radio;
|
|
11626
|
+
}
|
|
11627
|
+
else {
|
|
11628
|
+
radio.setAttribute("tabindex", "-1");
|
|
11629
|
+
this.selectedRadio = null;
|
|
11630
|
+
}
|
|
11631
|
+
this.focusedRadio = radio;
|
|
11632
|
+
}
|
|
11633
|
+
e.preventDefault();
|
|
11634
|
+
};
|
|
11635
|
+
this.shouldMoveOffGroupToTheRight = (index, group, key) => {
|
|
11636
|
+
return index === group.length && this.isInsideToolbar && key === keyArrowRight;
|
|
11637
|
+
};
|
|
11638
|
+
this.shouldMoveOffGroupToTheLeft = (group, key) => {
|
|
11639
|
+
const index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0;
|
|
11640
|
+
return index < 0 && this.isInsideToolbar && key === keyArrowLeft;
|
|
11641
|
+
};
|
|
11642
|
+
this.checkFocusedRadio = () => {
|
|
11643
|
+
if (this.focusedRadio !== null &&
|
|
11644
|
+
!this.focusedRadio.readOnly &&
|
|
11645
|
+
!this.focusedRadio.checked) {
|
|
11646
|
+
this.focusedRadio.checked = true;
|
|
11647
|
+
this.focusedRadio.setAttribute("tabindex", "0");
|
|
11648
|
+
this.focusedRadio.focus();
|
|
11649
|
+
this.selectedRadio = this.focusedRadio;
|
|
11650
|
+
}
|
|
11651
|
+
};
|
|
11652
|
+
this.moveRight = (e) => {
|
|
11653
|
+
const group = this.slottedRadioButtons;
|
|
11654
|
+
let index = 0;
|
|
11655
|
+
index = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1;
|
|
11656
|
+
if (this.shouldMoveOffGroupToTheRight(index, group, e.key)) {
|
|
11657
|
+
this.moveRightOffGroup();
|
|
11658
|
+
return;
|
|
11659
|
+
}
|
|
11660
|
+
else if (index === group.length) {
|
|
11661
|
+
index = 0;
|
|
11662
|
+
}
|
|
11663
|
+
/* looping to get to next radio that is not disabled */
|
|
11664
|
+
/* matching native radio/radiogroup which does not select an item if there is only 1 in the group */
|
|
11665
|
+
while (index < group.length && group.length > 1) {
|
|
11666
|
+
if (!group[index].disabled) {
|
|
11667
|
+
this.moveToRadioByIndex(group, index);
|
|
11668
|
+
break;
|
|
11669
|
+
}
|
|
11670
|
+
else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) {
|
|
11671
|
+
break;
|
|
11672
|
+
}
|
|
11673
|
+
else if (index + 1 >= group.length) {
|
|
11674
|
+
if (this.isInsideToolbar) {
|
|
11675
|
+
break;
|
|
11676
|
+
}
|
|
11677
|
+
else {
|
|
11678
|
+
index = 0;
|
|
11679
|
+
}
|
|
11680
|
+
}
|
|
11681
|
+
else {
|
|
11682
|
+
index += 1;
|
|
11683
|
+
}
|
|
11684
|
+
}
|
|
11685
|
+
};
|
|
11686
|
+
this.moveLeft = (e) => {
|
|
11687
|
+
const group = this.slottedRadioButtons;
|
|
11688
|
+
let index = 0;
|
|
11689
|
+
index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0;
|
|
11690
|
+
index = index < 0 ? group.length - 1 : index;
|
|
11691
|
+
if (this.shouldMoveOffGroupToTheLeft(group, e.key)) {
|
|
11692
|
+
this.moveLeftOffGroup();
|
|
11693
|
+
return;
|
|
11694
|
+
}
|
|
11695
|
+
/* looping to get to next radio that is not disabled */
|
|
11696
|
+
while (index >= 0 && group.length > 1) {
|
|
11697
|
+
if (!group[index].disabled) {
|
|
11698
|
+
this.moveToRadioByIndex(group, index);
|
|
11699
|
+
break;
|
|
11700
|
+
}
|
|
11701
|
+
else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) {
|
|
11702
|
+
break;
|
|
11703
|
+
}
|
|
11704
|
+
else if (index - 1 < 0) {
|
|
11705
|
+
index = group.length - 1;
|
|
11706
|
+
}
|
|
11707
|
+
else {
|
|
11708
|
+
index -= 1;
|
|
11709
|
+
}
|
|
11710
|
+
}
|
|
11711
|
+
};
|
|
11712
|
+
/**
|
|
11713
|
+
* keyboard handling per https://w3c.github.io/aria-practices/#for-radio-groups-not-contained-in-a-toolbar
|
|
11714
|
+
* navigation is different when there is an ancestor with role='toolbar'
|
|
11715
|
+
*
|
|
11716
|
+
* @internal
|
|
11717
|
+
*/
|
|
11718
|
+
this.keydownHandler = (e) => {
|
|
11719
|
+
const key = e.key;
|
|
11720
|
+
if (key in ArrowKeys && this.isInsideFoundationToolbar) {
|
|
11721
|
+
return true;
|
|
11722
|
+
}
|
|
11723
|
+
switch (key) {
|
|
11724
|
+
case keyEnter: {
|
|
11725
|
+
this.checkFocusedRadio();
|
|
11726
|
+
break;
|
|
11727
|
+
}
|
|
11728
|
+
case keyArrowRight:
|
|
11729
|
+
case keyArrowDown: {
|
|
11730
|
+
if (this.direction === Direction.ltr) {
|
|
11731
|
+
this.moveRight(e);
|
|
11732
|
+
}
|
|
11733
|
+
else {
|
|
11734
|
+
this.moveLeft(e);
|
|
11735
|
+
}
|
|
11736
|
+
break;
|
|
11737
|
+
}
|
|
11738
|
+
case keyArrowLeft:
|
|
11739
|
+
case keyArrowUp: {
|
|
11740
|
+
if (this.direction === Direction.ltr) {
|
|
11741
|
+
this.moveLeft(e);
|
|
11742
|
+
}
|
|
11743
|
+
else {
|
|
11744
|
+
this.moveRight(e);
|
|
11745
|
+
}
|
|
11746
|
+
break;
|
|
11747
|
+
}
|
|
11748
|
+
default: {
|
|
11749
|
+
return true;
|
|
11750
|
+
}
|
|
11751
|
+
}
|
|
11752
|
+
};
|
|
11753
|
+
}
|
|
11754
|
+
readOnlyChanged() {
|
|
11755
|
+
if (this.slottedRadioButtons !== undefined) {
|
|
11756
|
+
this.slottedRadioButtons.forEach((radio) => {
|
|
11757
|
+
if (this.readOnly) {
|
|
11758
|
+
radio.readOnly = true;
|
|
11759
|
+
}
|
|
11760
|
+
else {
|
|
11761
|
+
radio.readOnly = false;
|
|
11762
|
+
}
|
|
11763
|
+
});
|
|
11764
|
+
}
|
|
11765
|
+
}
|
|
11766
|
+
disabledChanged() {
|
|
11767
|
+
if (this.slottedRadioButtons !== undefined) {
|
|
11768
|
+
this.slottedRadioButtons.forEach((radio) => {
|
|
11769
|
+
if (this.disabled) {
|
|
11770
|
+
radio.disabled = true;
|
|
11771
|
+
}
|
|
11772
|
+
else {
|
|
11773
|
+
radio.disabled = false;
|
|
11774
|
+
}
|
|
11775
|
+
});
|
|
11776
|
+
}
|
|
11777
|
+
}
|
|
11778
|
+
nameChanged() {
|
|
11779
|
+
if (this.slottedRadioButtons) {
|
|
11780
|
+
this.slottedRadioButtons.forEach((radio) => {
|
|
11781
|
+
radio.setAttribute("name", this.name);
|
|
11782
|
+
});
|
|
11783
|
+
}
|
|
11784
|
+
}
|
|
11785
|
+
valueChanged() {
|
|
11786
|
+
if (this.slottedRadioButtons) {
|
|
11787
|
+
this.slottedRadioButtons.forEach((radio) => {
|
|
11788
|
+
if (radio.value === this.value) {
|
|
11789
|
+
radio.checked = true;
|
|
11790
|
+
this.selectedRadio = radio;
|
|
11791
|
+
}
|
|
11792
|
+
});
|
|
11793
|
+
}
|
|
11794
|
+
this.$emit("change");
|
|
11795
|
+
}
|
|
11796
|
+
slottedRadioButtonsChanged(oldValue, newValue) {
|
|
11797
|
+
if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) {
|
|
11798
|
+
this.setupRadioButtons();
|
|
11799
|
+
}
|
|
11800
|
+
}
|
|
11801
|
+
get parentToolbar() {
|
|
11802
|
+
return this.closest('[role="toolbar"]');
|
|
11803
|
+
}
|
|
11804
|
+
get isInsideToolbar() {
|
|
11805
|
+
var _a;
|
|
11806
|
+
return ((_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false);
|
|
11807
|
+
}
|
|
11808
|
+
get isInsideFoundationToolbar() {
|
|
11809
|
+
var _a;
|
|
11810
|
+
return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a["$fastController"]);
|
|
11811
|
+
}
|
|
11812
|
+
/**
|
|
11813
|
+
* @internal
|
|
11814
|
+
*/
|
|
11815
|
+
connectedCallback() {
|
|
11816
|
+
super.connectedCallback();
|
|
11817
|
+
this.direction = getDirection(this);
|
|
11818
|
+
this.setupRadioButtons();
|
|
11819
|
+
}
|
|
11820
|
+
disconnectedCallback() {
|
|
11821
|
+
this.slottedRadioButtons.forEach((radio) => {
|
|
11822
|
+
radio.removeEventListener("change", this.radioChangeHandler);
|
|
11823
|
+
});
|
|
11824
|
+
}
|
|
11825
|
+
setupRadioButtons() {
|
|
11826
|
+
const checkedRadios = this.slottedRadioButtons.filter((radio) => {
|
|
11827
|
+
return radio.hasAttribute("checked");
|
|
11828
|
+
});
|
|
11829
|
+
const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0;
|
|
11830
|
+
if (numberOfCheckedRadios > 1) {
|
|
11831
|
+
const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1];
|
|
11832
|
+
lastCheckedRadio.checked = true;
|
|
11833
|
+
}
|
|
11834
|
+
let foundMatchingVal = false;
|
|
11835
|
+
this.slottedRadioButtons.forEach((radio) => {
|
|
11836
|
+
if (this.name !== undefined) {
|
|
11837
|
+
radio.setAttribute("name", this.name);
|
|
11838
|
+
}
|
|
11839
|
+
if (this.disabled) {
|
|
11840
|
+
radio.disabled = true;
|
|
11841
|
+
}
|
|
11842
|
+
if (this.readOnly) {
|
|
11843
|
+
radio.readOnly = true;
|
|
11844
|
+
}
|
|
11845
|
+
if (this.value && this.value === radio.value) {
|
|
11846
|
+
this.selectedRadio = radio;
|
|
11847
|
+
this.focusedRadio = radio;
|
|
11848
|
+
radio.checked = true;
|
|
11849
|
+
radio.setAttribute("tabindex", "0");
|
|
11850
|
+
foundMatchingVal = true;
|
|
11851
|
+
}
|
|
11852
|
+
else {
|
|
11853
|
+
if (!this.isInsideFoundationToolbar) {
|
|
11854
|
+
radio.setAttribute("tabindex", "-1");
|
|
11855
|
+
}
|
|
11856
|
+
radio.checked = false;
|
|
11857
|
+
}
|
|
11858
|
+
radio.addEventListener("change", this.radioChangeHandler);
|
|
11859
|
+
});
|
|
11860
|
+
if (this.value === undefined && this.slottedRadioButtons.length > 0) {
|
|
11861
|
+
const checkedRadios = this.slottedRadioButtons.filter((radio) => {
|
|
11862
|
+
return radio.hasAttribute("checked");
|
|
11863
|
+
});
|
|
11864
|
+
const numberOfCheckedRadios = checkedRadios !== null ? checkedRadios.length : 0;
|
|
11865
|
+
if (numberOfCheckedRadios > 0 && !foundMatchingVal) {
|
|
11866
|
+
const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1];
|
|
11867
|
+
lastCheckedRadio.checked = true;
|
|
11868
|
+
this.focusedRadio = lastCheckedRadio;
|
|
11869
|
+
lastCheckedRadio.setAttribute("tabindex", "0");
|
|
11870
|
+
}
|
|
11871
|
+
else {
|
|
11872
|
+
this.slottedRadioButtons[0].setAttribute("tabindex", "0");
|
|
11873
|
+
this.focusedRadio = this.slottedRadioButtons[0];
|
|
11874
|
+
}
|
|
11875
|
+
}
|
|
11876
|
+
}
|
|
11877
|
+
}
|
|
11878
|
+
__decorate$1([
|
|
11879
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
11880
|
+
], RadioGroup$1.prototype, "readOnly", void 0);
|
|
11881
|
+
__decorate$1([
|
|
11882
|
+
attr({ attribute: "disabled", mode: "boolean" })
|
|
11883
|
+
], RadioGroup$1.prototype, "disabled", void 0);
|
|
11884
|
+
__decorate$1([
|
|
11885
|
+
attr
|
|
11886
|
+
], RadioGroup$1.prototype, "name", void 0);
|
|
11887
|
+
__decorate$1([
|
|
11888
|
+
attr
|
|
11889
|
+
], RadioGroup$1.prototype, "value", void 0);
|
|
11890
|
+
__decorate$1([
|
|
11891
|
+
attr
|
|
11892
|
+
], RadioGroup$1.prototype, "orientation", void 0);
|
|
11893
|
+
__decorate$1([
|
|
11894
|
+
observable
|
|
11895
|
+
], RadioGroup$1.prototype, "childItems", void 0);
|
|
11896
|
+
__decorate$1([
|
|
11897
|
+
observable
|
|
11898
|
+
], RadioGroup$1.prototype, "slottedRadioButtons", void 0);
|
|
11899
|
+
|
|
11900
|
+
/**
|
|
11901
|
+
* The template for the {@link @microsoft/fast-foundation#(Radio:class)} component.
|
|
11902
|
+
* @public
|
|
11903
|
+
*/
|
|
11904
|
+
const radioTemplate = (context, definition) => html `
|
|
11905
|
+
<template
|
|
11906
|
+
role="radio"
|
|
11907
|
+
class="${x => (x.checked ? "checked" : "")} ${x => x.readOnly ? "readonly" : ""}"
|
|
11908
|
+
aria-checked="${x => x.checked}"
|
|
11909
|
+
aria-required="${x => x.required}"
|
|
11910
|
+
aria-disabled="${x => x.disabled}"
|
|
11911
|
+
aria-readonly="${x => x.readOnly}"
|
|
11912
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
11913
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
11914
|
+
>
|
|
11915
|
+
<div part="control" class="control">
|
|
11916
|
+
<slot name="checked-indicator">
|
|
11917
|
+
${definition.checkedIndicator || ""}
|
|
11918
|
+
</slot>
|
|
11919
|
+
</div>
|
|
11920
|
+
<label
|
|
11921
|
+
part="label"
|
|
11922
|
+
class="${x => x.defaultSlottedNodes && x.defaultSlottedNodes.length
|
|
11923
|
+
? "label"
|
|
11924
|
+
: "label label__hidden"}"
|
|
11925
|
+
>
|
|
11926
|
+
<slot ${slotted("defaultSlottedNodes")}></slot>
|
|
11927
|
+
</label>
|
|
11928
|
+
</template>
|
|
11929
|
+
`;
|
|
11930
|
+
|
|
11931
|
+
class _Radio extends FoundationElement {
|
|
11932
|
+
}
|
|
11933
|
+
/**
|
|
11934
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(Radio:class)} component.
|
|
11935
|
+
*
|
|
11936
|
+
* @internal
|
|
11937
|
+
*/
|
|
11938
|
+
class FormAssociatedRadio extends CheckableFormAssociated(_Radio) {
|
|
11939
|
+
constructor() {
|
|
11940
|
+
super(...arguments);
|
|
11941
|
+
this.proxy = document.createElement("input");
|
|
11942
|
+
}
|
|
11943
|
+
}
|
|
11944
|
+
|
|
11945
|
+
/**
|
|
11946
|
+
* A Radio Custom HTML Element.
|
|
11947
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radio | ARIA radio }.
|
|
11948
|
+
*
|
|
11949
|
+
* @slot checked-indicator - The checked indicator
|
|
11950
|
+
* @slot - The default slot for the label
|
|
11951
|
+
* @csspart control - The element representing the visual radio control
|
|
11952
|
+
* @csspart label - The label
|
|
11953
|
+
* @fires change - Emits a custom change event when the checked state changes
|
|
11954
|
+
*
|
|
11955
|
+
* @public
|
|
11956
|
+
*/
|
|
11957
|
+
class Radio extends FormAssociatedRadio {
|
|
11958
|
+
constructor() {
|
|
11959
|
+
super();
|
|
11960
|
+
/**
|
|
11961
|
+
* The element's value to be included in form submission when checked.
|
|
11962
|
+
* Default to "on" to reach parity with input[type="radio"]
|
|
11963
|
+
*
|
|
11964
|
+
* @internal
|
|
11965
|
+
*/
|
|
11966
|
+
this.initialValue = "on";
|
|
11967
|
+
/**
|
|
11968
|
+
* @internal
|
|
11969
|
+
*/
|
|
11970
|
+
this.keypressHandler = (e) => {
|
|
11971
|
+
switch (e.key) {
|
|
11972
|
+
case keySpace:
|
|
11973
|
+
if (!this.checked && !this.readOnly) {
|
|
11974
|
+
this.checked = true;
|
|
11975
|
+
}
|
|
11976
|
+
return;
|
|
11977
|
+
}
|
|
11978
|
+
return true;
|
|
11979
|
+
};
|
|
11980
|
+
this.proxy.setAttribute("type", "radio");
|
|
11981
|
+
}
|
|
11982
|
+
readOnlyChanged() {
|
|
11983
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
11984
|
+
this.proxy.readOnly = this.readOnly;
|
|
11985
|
+
}
|
|
11986
|
+
}
|
|
11987
|
+
/**
|
|
11988
|
+
* @internal
|
|
11989
|
+
*/
|
|
11990
|
+
defaultCheckedChanged() {
|
|
11991
|
+
var _a;
|
|
11992
|
+
if (this.$fastController.isConnected && !this.dirtyChecked) {
|
|
11993
|
+
// Setting this.checked will cause us to enter a dirty state,
|
|
11994
|
+
// but if we are clean when defaultChecked is changed, we want to stay
|
|
11995
|
+
// in a clean state, so reset this.dirtyChecked
|
|
11996
|
+
if (!this.isInsideRadioGroup()) {
|
|
11997
|
+
this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false;
|
|
11998
|
+
this.dirtyChecked = false;
|
|
11999
|
+
}
|
|
12000
|
+
}
|
|
12001
|
+
}
|
|
12002
|
+
/**
|
|
12003
|
+
* @internal
|
|
12004
|
+
*/
|
|
12005
|
+
connectedCallback() {
|
|
12006
|
+
var _a, _b;
|
|
12007
|
+
super.connectedCallback();
|
|
12008
|
+
this.validate();
|
|
12009
|
+
if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" &&
|
|
12010
|
+
this.getAttribute("tabindex") === null) {
|
|
12011
|
+
if (!this.disabled) {
|
|
12012
|
+
this.setAttribute("tabindex", "0");
|
|
12013
|
+
}
|
|
12014
|
+
}
|
|
12015
|
+
if (this.checkedAttribute) {
|
|
12016
|
+
if (!this.dirtyChecked) {
|
|
12017
|
+
// Setting this.checked will cause us to enter a dirty state,
|
|
12018
|
+
// but if we are clean when defaultChecked is changed, we want to stay
|
|
12019
|
+
// in a clean state, so reset this.dirtyChecked
|
|
12020
|
+
if (!this.isInsideRadioGroup()) {
|
|
12021
|
+
this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false;
|
|
12022
|
+
this.dirtyChecked = false;
|
|
12023
|
+
}
|
|
12024
|
+
}
|
|
12025
|
+
}
|
|
12026
|
+
}
|
|
12027
|
+
isInsideRadioGroup() {
|
|
12028
|
+
const parent = this.closest("[role=radiogroup]");
|
|
12029
|
+
return parent !== null;
|
|
12030
|
+
}
|
|
12031
|
+
/**
|
|
12032
|
+
* @internal
|
|
12033
|
+
*/
|
|
12034
|
+
clickHandler(e) {
|
|
12035
|
+
if (!this.disabled && !this.readOnly && !this.checked) {
|
|
12036
|
+
this.checked = true;
|
|
12037
|
+
}
|
|
12038
|
+
}
|
|
12039
|
+
}
|
|
12040
|
+
__decorate$1([
|
|
12041
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
12042
|
+
], Radio.prototype, "readOnly", void 0);
|
|
12043
|
+
__decorate$1([
|
|
12044
|
+
observable
|
|
12045
|
+
], Radio.prototype, "name", void 0);
|
|
12046
|
+
__decorate$1([
|
|
12047
|
+
observable
|
|
12048
|
+
], Radio.prototype, "defaultSlottedNodes", void 0);
|
|
12049
|
+
|
|
11486
12050
|
/**
|
|
11487
12051
|
* a method to filter out any whitespace _only_ nodes, to be used inside a template
|
|
11488
12052
|
* @param value - The Node that is being inspected
|
|
@@ -14250,7 +14814,7 @@
|
|
|
14250
14814
|
*/
|
|
14251
14815
|
const focusVisible$1 = canUseFocusVisible() ? "focus-visible" : "focus";
|
|
14252
14816
|
|
|
14253
|
-
const styles$
|
|
14817
|
+
const styles$x = css `
|
|
14254
14818
|
:host {
|
|
14255
14819
|
contain: layout;
|
|
14256
14820
|
display: block;
|
|
@@ -14274,7 +14838,7 @@
|
|
|
14274
14838
|
baseName: 'anchored-region',
|
|
14275
14839
|
baseClass: AnchoredRegion$1,
|
|
14276
14840
|
template: anchoredRegionTemplate,
|
|
14277
|
-
styles: styles$
|
|
14841
|
+
styles: styles$x
|
|
14278
14842
|
});
|
|
14279
14843
|
DesignSystem.getOrCreate()
|
|
14280
14844
|
.withPrefix('nimble')
|
|
@@ -14419,6 +14983,22 @@
|
|
|
14419
14983
|
return {red, green, blue, alpha};
|
|
14420
14984
|
}
|
|
14421
14985
|
|
|
14986
|
+
/**
|
|
14987
|
+
* Convert a hexadecimal color string to an RGBA CSS color string
|
|
14988
|
+
* Example: 'ff0102' or '#ff0102' to 'rgba(255, 1, 2, 1)'
|
|
14989
|
+
* @param hexValue Hex color (with or without a starting '#')
|
|
14990
|
+
* @param alpha CSS alpha value between 0 (transparent) and 1 (opaque)
|
|
14991
|
+
* @returns An rgba()-formatted CSS color string
|
|
14992
|
+
*/
|
|
14993
|
+
function hexToRgbaCssColor(hexValue, alpha) {
|
|
14994
|
+
const { red, green, blue } = hexRgb(hexValue);
|
|
14995
|
+
return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
|
|
14996
|
+
}
|
|
14997
|
+
|
|
14998
|
+
const modalBackdropColorThemeLight = hexToRgbaCssColor(Black, 0.3);
|
|
14999
|
+
const modalBackdropColorThemeDark = hexToRgbaCssColor(Black, 0.6);
|
|
15000
|
+
const modalBackdropColorThemeColor = hexToRgbaCssColor(Black, 0.6);
|
|
15001
|
+
|
|
14422
15002
|
const Theme = {
|
|
14423
15003
|
light: 'light',
|
|
14424
15004
|
dark: 'dark',
|
|
@@ -14448,6 +15028,7 @@
|
|
|
14448
15028
|
informationColor: 'information-color',
|
|
14449
15029
|
borderHoverColor: 'border-hover-color',
|
|
14450
15030
|
iconColor: 'icon-color',
|
|
15031
|
+
modalBackdropColor: 'modal-backdrop-color',
|
|
14451
15032
|
popupBoxShadowColor: 'popup-box-shadow-color',
|
|
14452
15033
|
popupBorderColor: 'popup-border-color',
|
|
14453
15034
|
controlHeight: 'control-height',
|
|
@@ -14618,7 +15199,7 @@
|
|
|
14618
15199
|
|
|
14619
15200
|
const template$7 = html `<slot></slot>`;
|
|
14620
15201
|
|
|
14621
|
-
const styles$
|
|
15202
|
+
const styles$w = css `
|
|
14622
15203
|
:host {
|
|
14623
15204
|
display: contents;
|
|
14624
15205
|
}
|
|
@@ -14674,25 +15255,13 @@
|
|
|
14674
15255
|
], ThemeProvider.prototype, "theme", void 0);
|
|
14675
15256
|
const nimbleDesignSystemProvider = ThemeProvider.compose({
|
|
14676
15257
|
baseName: 'theme-provider',
|
|
14677
|
-
styles: styles$
|
|
15258
|
+
styles: styles$w,
|
|
14678
15259
|
template: template$7
|
|
14679
15260
|
});
|
|
14680
15261
|
DesignSystem.getOrCreate()
|
|
14681
15262
|
.withPrefix('nimble')
|
|
14682
15263
|
.register(nimbleDesignSystemProvider());
|
|
14683
15264
|
|
|
14684
|
-
/**
|
|
14685
|
-
* Convert a hexadecimal color string to an RGBA CSS color string
|
|
14686
|
-
* Example: 'ff0102' or '#ff0102' to 'rgba(255, 1, 2, 1)'
|
|
14687
|
-
* @param hexValue Hex color (with or without a starting '#')
|
|
14688
|
-
* @param alpha CSS alpha value between 0 (transparent) and 1 (opaque)
|
|
14689
|
-
* @returns An rgba()-formatted CSS color string
|
|
14690
|
-
*/
|
|
14691
|
-
function hexToRgbaCssColor(hexValue, alpha) {
|
|
14692
|
-
const { red, green, blue } = hexRgb(hexValue);
|
|
14693
|
-
return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
|
|
14694
|
-
}
|
|
14695
|
-
|
|
14696
15265
|
// Color Tokens
|
|
14697
15266
|
const actionRgbPartialColor = DesignToken.create(styleNameFromTokenName(tokenNames.actionRgbPartialColor)).withDefault((element) => hexToRgbPartial(getColorForTheme(element, Black91, Black15, White)));
|
|
14698
15267
|
const applicationBackgroundColor = DesignToken.create(styleNameFromTokenName(tokenNames.applicationBackgroundColor)).withDefault((element) => getColorForTheme(element, White, Black85, ForestGreen));
|
|
@@ -14713,6 +15282,7 @@
|
|
|
14713
15282
|
const borderHoverColor = DesignToken.create(styleNameFromTokenName(tokenNames.borderHoverColor)).withDefault((element) => getColorForTheme(element, DigitalGreenLight, DigitalGreenLight, White));
|
|
14714
15283
|
// Component Color Tokens
|
|
14715
15284
|
const iconColor = DesignToken.create(styleNameFromTokenName(tokenNames.iconColor)).withDefault((element) => getColorForTheme(element, Black91, Black15, White));
|
|
15285
|
+
const modalBackdropColor = DesignToken.create(styleNameFromTokenName(tokenNames.modalBackdropColor)).withDefault((element) => getModalBackdropForTheme(element));
|
|
14716
15286
|
const popupBoxShadowColor = DesignToken.create(styleNameFromTokenName(tokenNames.popupBoxShadowColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black75, Black85, Black85), 0.3));
|
|
14717
15287
|
const popupBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.popupBorderColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black91, Black15, White), 0.3));
|
|
14718
15288
|
DesignToken.create(styleNameFromTokenName(tokenNames.tooltipBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black85, ForestGreen));
|
|
@@ -14824,6 +15394,18 @@
|
|
|
14824
15394
|
function getFillDownColorForTheme(element) {
|
|
14825
15395
|
return getColorForTheme(element, Black91, Black15, White);
|
|
14826
15396
|
}
|
|
15397
|
+
function getModalBackdropForTheme(element) {
|
|
15398
|
+
switch (theme.getValueFor(element)) {
|
|
15399
|
+
case Theme.light:
|
|
15400
|
+
return modalBackdropColorThemeLight;
|
|
15401
|
+
case Theme.dark:
|
|
15402
|
+
return modalBackdropColorThemeDark;
|
|
15403
|
+
case Theme.color:
|
|
15404
|
+
return modalBackdropColorThemeColor;
|
|
15405
|
+
default:
|
|
15406
|
+
return modalBackdropColorThemeLight;
|
|
15407
|
+
}
|
|
15408
|
+
}
|
|
14827
15409
|
|
|
14828
15410
|
/**
|
|
14829
15411
|
* Subscription for {@link ThemeStyleSheetBehavior}
|
|
@@ -14898,7 +15480,7 @@
|
|
|
14898
15480
|
*/
|
|
14899
15481
|
const themeBehavior = (theme, styles) => new ThemeStyleSheetBehavior(theme, styles);
|
|
14900
15482
|
|
|
14901
|
-
const styles$
|
|
15483
|
+
const styles$v = css `
|
|
14902
15484
|
${display('inline-block')}
|
|
14903
15485
|
|
|
14904
15486
|
:host {
|
|
@@ -14958,7 +15540,7 @@
|
|
|
14958
15540
|
baseName: 'breadcrumb',
|
|
14959
15541
|
baseClass: Breadcrumb$1,
|
|
14960
15542
|
template: breadcrumbTemplate,
|
|
14961
|
-
styles: styles$
|
|
15543
|
+
styles: styles$v
|
|
14962
15544
|
});
|
|
14963
15545
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBreadcrumb());
|
|
14964
15546
|
|
|
@@ -15564,7 +16146,7 @@
|
|
|
15564
16146
|
*/
|
|
15565
16147
|
const focusVisible = `:${focusVisible$1}`;
|
|
15566
16148
|
|
|
15567
|
-
const styles$
|
|
16149
|
+
const styles$u = css `
|
|
15568
16150
|
${display('inline-flex')}
|
|
15569
16151
|
|
|
15570
16152
|
:host {
|
|
@@ -15644,7 +16226,7 @@
|
|
|
15644
16226
|
baseName: 'breadcrumb-item',
|
|
15645
16227
|
baseClass: BreadcrumbItem$1,
|
|
15646
16228
|
template: breadcrumbItemTemplate,
|
|
15647
|
-
styles: styles$
|
|
16229
|
+
styles: styles$u,
|
|
15648
16230
|
separator: forwardSlash16X16.data
|
|
15649
16231
|
});
|
|
15650
16232
|
DesignSystem.getOrCreate()
|
|
@@ -15729,7 +16311,7 @@
|
|
|
15729
16311
|
block: 'block'
|
|
15730
16312
|
};
|
|
15731
16313
|
|
|
15732
|
-
const styles$
|
|
16314
|
+
const styles$t = css `
|
|
15733
16315
|
${display('inline-flex')}
|
|
15734
16316
|
|
|
15735
16317
|
:host {
|
|
@@ -15936,7 +16518,7 @@
|
|
|
15936
16518
|
`));
|
|
15937
16519
|
|
|
15938
16520
|
// prettier-ignore
|
|
15939
|
-
const styles$
|
|
16521
|
+
const styles$s = styles$t
|
|
15940
16522
|
.withBehaviors(appearanceBehavior(ButtonAppearance.outline, css `
|
|
15941
16523
|
:host(.primary) .control {
|
|
15942
16524
|
box-shadow: 0px 0px 0px ${borderWidth} rgba(${actionRgbPartialColor}, 0.3) inset;
|
|
@@ -16050,7 +16632,7 @@
|
|
|
16050
16632
|
baseName: 'button',
|
|
16051
16633
|
baseClass: Button$1,
|
|
16052
16634
|
template: buttonTemplate,
|
|
16053
|
-
styles: styles$
|
|
16635
|
+
styles: styles$s,
|
|
16054
16636
|
shadowOptions: {
|
|
16055
16637
|
delegatesFocus: true
|
|
16056
16638
|
}
|
|
@@ -16058,7 +16640,7 @@
|
|
|
16058
16640
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleButton());
|
|
16059
16641
|
|
|
16060
16642
|
// prettier-ignore
|
|
16061
|
-
const styles$
|
|
16643
|
+
const styles$r = css `
|
|
16062
16644
|
${display('inline-flex')}
|
|
16063
16645
|
|
|
16064
16646
|
:host {
|
|
@@ -16069,6 +16651,13 @@
|
|
|
16069
16651
|
outline: none;
|
|
16070
16652
|
border: none;
|
|
16071
16653
|
box-sizing: border-box;
|
|
16654
|
+
transition: box-shadow ${smallDelay};
|
|
16655
|
+
}
|
|
16656
|
+
|
|
16657
|
+
@media (prefers-reduced-motion) {
|
|
16658
|
+
:host {
|
|
16659
|
+
transition-duration: 0s;
|
|
16660
|
+
}
|
|
16072
16661
|
}
|
|
16073
16662
|
|
|
16074
16663
|
:host(:hover) {
|
|
@@ -16095,7 +16684,6 @@
|
|
|
16095
16684
|
cursor: inherit;
|
|
16096
16685
|
font: inherit;
|
|
16097
16686
|
outline: none;
|
|
16098
|
-
transition: box-shadow ${smallDelay};
|
|
16099
16687
|
padding: 0px;
|
|
16100
16688
|
}
|
|
16101
16689
|
|
|
@@ -16159,12 +16747,6 @@
|
|
|
16159
16747
|
slot[name='end'] {
|
|
16160
16748
|
display: none;
|
|
16161
16749
|
}
|
|
16162
|
-
|
|
16163
|
-
@media (prefers-reduced-motion) {
|
|
16164
|
-
.control {
|
|
16165
|
-
transition-duration: 0s;
|
|
16166
|
-
}
|
|
16167
|
-
}
|
|
16168
16750
|
`.withBehaviors(themeBehavior(Theme.light, css `
|
|
16169
16751
|
:host {
|
|
16170
16752
|
--ni-private-card-button-background-hover-color: ${hexToRgbaCssColor(White, 0.3)};
|
|
@@ -16217,14 +16799,14 @@
|
|
|
16217
16799
|
const nimbleCardButton = CardButton.compose({
|
|
16218
16800
|
baseName: 'card-button',
|
|
16219
16801
|
template: buttonTemplate,
|
|
16220
|
-
styles: styles$
|
|
16802
|
+
styles: styles$r,
|
|
16221
16803
|
shadowOptions: {
|
|
16222
16804
|
delegatesFocus: true
|
|
16223
16805
|
}
|
|
16224
16806
|
});
|
|
16225
16807
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCardButton());
|
|
16226
16808
|
|
|
16227
|
-
const styles$
|
|
16809
|
+
const styles$q = css `
|
|
16228
16810
|
${display('inline-flex')}
|
|
16229
16811
|
|
|
16230
16812
|
:host {
|
|
@@ -16277,7 +16859,7 @@
|
|
|
16277
16859
|
:host(${focusVisible}) .control {
|
|
16278
16860
|
border-color: ${borderHoverColor};
|
|
16279
16861
|
outline: 2px solid ${borderHoverColor};
|
|
16280
|
-
outline-offset:
|
|
16862
|
+
outline-offset: 1px;
|
|
16281
16863
|
}
|
|
16282
16864
|
|
|
16283
16865
|
.label {
|
|
@@ -16342,7 +16924,7 @@
|
|
|
16342
16924
|
baseName: 'checkbox',
|
|
16343
16925
|
baseClass: Checkbox$1,
|
|
16344
16926
|
template: checkboxTemplate,
|
|
16345
|
-
styles: styles$
|
|
16927
|
+
styles: styles$q,
|
|
16346
16928
|
checkedIndicator: check16X16.data,
|
|
16347
16929
|
indeterminateIndicator: minus16X16.data
|
|
16348
16930
|
});
|
|
@@ -16360,7 +16942,7 @@
|
|
|
16360
16942
|
</template
|
|
16361
16943
|
`;
|
|
16362
16944
|
|
|
16363
|
-
const styles$
|
|
16945
|
+
const styles$p = css `
|
|
16364
16946
|
${display('inline-flex')}
|
|
16365
16947
|
|
|
16366
16948
|
:host {
|
|
@@ -16411,7 +16993,7 @@
|
|
|
16411
16993
|
const composedIcon = iconClass.compose({
|
|
16412
16994
|
baseName,
|
|
16413
16995
|
template: template$6,
|
|
16414
|
-
styles: styles$
|
|
16996
|
+
styles: styles$p,
|
|
16415
16997
|
baseClass: iconClass
|
|
16416
16998
|
});
|
|
16417
16999
|
DesignSystem.getOrCreate().withPrefix('nimble').register(composedIcon());
|
|
@@ -16449,7 +17031,7 @@
|
|
|
16449
17031
|
block: 'block'
|
|
16450
17032
|
};
|
|
16451
17033
|
|
|
16452
|
-
const styles$
|
|
17034
|
+
const styles$o = css `
|
|
16453
17035
|
${display('inline-flex')}
|
|
16454
17036
|
|
|
16455
17037
|
:host {
|
|
@@ -16663,7 +17245,7 @@
|
|
|
16663
17245
|
}
|
|
16664
17246
|
`));
|
|
16665
17247
|
|
|
16666
|
-
const styles$
|
|
17248
|
+
const styles$n = css `
|
|
16667
17249
|
.error-icon {
|
|
16668
17250
|
display: none;
|
|
16669
17251
|
}
|
|
@@ -16701,9 +17283,9 @@
|
|
|
16701
17283
|
}
|
|
16702
17284
|
`;
|
|
16703
17285
|
|
|
16704
|
-
const styles$
|
|
16705
|
-
${styles$
|
|
16706
|
-
${styles$
|
|
17286
|
+
const styles$m = css `
|
|
17287
|
+
${styles$o}
|
|
17288
|
+
${styles$n}
|
|
16707
17289
|
|
|
16708
17290
|
:host {
|
|
16709
17291
|
--ni-private-hover-bottom-border-width: 2px;
|
|
@@ -16952,7 +17534,7 @@
|
|
|
16952
17534
|
baseName: 'combobox',
|
|
16953
17535
|
baseClass: Combobox$1,
|
|
16954
17536
|
template: comboboxTemplate,
|
|
16955
|
-
styles: styles$
|
|
17537
|
+
styles: styles$m,
|
|
16956
17538
|
shadowOptions: {
|
|
16957
17539
|
delegatesFocus: true
|
|
16958
17540
|
},
|
|
@@ -16989,7 +17571,7 @@
|
|
|
16989
17571
|
});
|
|
16990
17572
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCombobox());
|
|
16991
17573
|
|
|
16992
|
-
const styles$
|
|
17574
|
+
const styles$l = css `
|
|
16993
17575
|
${display('grid')}
|
|
16994
17576
|
|
|
16995
17577
|
dialog {
|
|
@@ -16998,7 +17580,24 @@
|
|
|
16998
17580
|
box-shadow: 0px 2px 3px ${popupBoxShadowColor};
|
|
16999
17581
|
max-width: 50%;
|
|
17000
17582
|
}
|
|
17001
|
-
|
|
17583
|
+
`.withBehaviors(
|
|
17584
|
+
/*
|
|
17585
|
+
* We cannot use the modalBackdropColor token directly because the backdrop
|
|
17586
|
+
* element is not a descendant of the nimble-theme-provider element.
|
|
17587
|
+
*/
|
|
17588
|
+
themeBehavior(Theme.light, css `
|
|
17589
|
+
dialog::backdrop {
|
|
17590
|
+
background: ${modalBackdropColorThemeLight};
|
|
17591
|
+
}
|
|
17592
|
+
`), themeBehavior(Theme.dark, css `
|
|
17593
|
+
dialog::backdrop {
|
|
17594
|
+
background: ${modalBackdropColorThemeDark};
|
|
17595
|
+
}
|
|
17596
|
+
`), themeBehavior(Theme.color, css `
|
|
17597
|
+
dialog::backdrop {
|
|
17598
|
+
background: ${modalBackdropColorThemeColor};
|
|
17599
|
+
}
|
|
17600
|
+
`));
|
|
17002
17601
|
|
|
17003
17602
|
const template$5 = html `
|
|
17004
17603
|
<template>
|
|
@@ -17087,7 +17686,7 @@
|
|
|
17087
17686
|
const nimbleDialog = Dialog.compose({
|
|
17088
17687
|
baseName: 'dialog',
|
|
17089
17688
|
template: template$5,
|
|
17090
|
-
styles: styles$
|
|
17689
|
+
styles: styles$l,
|
|
17091
17690
|
baseClass: Dialog
|
|
17092
17691
|
});
|
|
17093
17692
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDialog());
|
|
@@ -18181,7 +18780,7 @@
|
|
|
18181
18780
|
slideOutOptions
|
|
18182
18781
|
};
|
|
18183
18782
|
|
|
18184
|
-
const styles$
|
|
18783
|
+
const styles$k = css `
|
|
18185
18784
|
${display('block')}
|
|
18186
18785
|
|
|
18187
18786
|
:host {
|
|
@@ -18228,7 +18827,7 @@
|
|
|
18228
18827
|
.overlay {
|
|
18229
18828
|
position: fixed;
|
|
18230
18829
|
inset: 0px;
|
|
18231
|
-
background: ${
|
|
18830
|
+
background: ${modalBackdropColor};
|
|
18232
18831
|
touch-action: none;
|
|
18233
18832
|
}
|
|
18234
18833
|
|
|
@@ -18493,7 +19092,7 @@
|
|
|
18493
19092
|
const nimbleDrawer = Drawer.compose({
|
|
18494
19093
|
baseName: 'drawer',
|
|
18495
19094
|
template: dialogTemplate,
|
|
18496
|
-
styles: styles$
|
|
19095
|
+
styles: styles$k
|
|
18497
19096
|
});
|
|
18498
19097
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDrawer());
|
|
18499
19098
|
|
|
@@ -20092,7 +20691,7 @@
|
|
|
20092
20691
|
}
|
|
20093
20692
|
registerIcon('icon-xmark-check', IconXmarkCheck);
|
|
20094
20693
|
|
|
20095
|
-
const styles$
|
|
20694
|
+
const styles$j = css `
|
|
20096
20695
|
${display('flex')}
|
|
20097
20696
|
|
|
20098
20697
|
:host {
|
|
@@ -20172,11 +20771,11 @@
|
|
|
20172
20771
|
baseName: 'list-option',
|
|
20173
20772
|
baseClass: ListboxOption,
|
|
20174
20773
|
template: listboxOptionTemplate,
|
|
20175
|
-
styles: styles$
|
|
20774
|
+
styles: styles$j
|
|
20176
20775
|
});
|
|
20177
20776
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleListOption());
|
|
20178
20777
|
|
|
20179
|
-
const styles$
|
|
20778
|
+
const styles$i = css `
|
|
20180
20779
|
${display('grid')}
|
|
20181
20780
|
|
|
20182
20781
|
:host {
|
|
@@ -20231,11 +20830,11 @@
|
|
|
20231
20830
|
baseName: 'menu',
|
|
20232
20831
|
baseClass: Menu$1,
|
|
20233
20832
|
template: menuTemplate,
|
|
20234
|
-
styles: styles$
|
|
20833
|
+
styles: styles$i
|
|
20235
20834
|
});
|
|
20236
20835
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenu());
|
|
20237
20836
|
|
|
20238
|
-
const styles$
|
|
20837
|
+
const styles$h = css `
|
|
20239
20838
|
${display('inline-block')}
|
|
20240
20839
|
|
|
20241
20840
|
:host {
|
|
@@ -20253,8 +20852,8 @@
|
|
|
20253
20852
|
}
|
|
20254
20853
|
`;
|
|
20255
20854
|
|
|
20256
|
-
const styles$
|
|
20257
|
-
${styles$
|
|
20855
|
+
const styles$g = css `
|
|
20856
|
+
${styles$t}
|
|
20258
20857
|
|
|
20259
20858
|
.control[aria-pressed='true'] {
|
|
20260
20859
|
background-color: ${fillSelectedColor};
|
|
@@ -20356,7 +20955,7 @@
|
|
|
20356
20955
|
const nimbleToggleButton = ToggleButton.compose({
|
|
20357
20956
|
baseName: 'toggle-button',
|
|
20358
20957
|
template: template$4,
|
|
20359
|
-
styles: styles$
|
|
20958
|
+
styles: styles$g,
|
|
20360
20959
|
shadowOptions: {
|
|
20361
20960
|
delegatesFocus: true
|
|
20362
20961
|
}
|
|
@@ -20573,14 +21172,14 @@
|
|
|
20573
21172
|
const nimbleMenuButton = MenuButton.compose({
|
|
20574
21173
|
baseName: 'menu-button',
|
|
20575
21174
|
template: template$3,
|
|
20576
|
-
styles: styles$
|
|
21175
|
+
styles: styles$h,
|
|
20577
21176
|
shadowOptions: {
|
|
20578
21177
|
delegatesFocus: true
|
|
20579
21178
|
}
|
|
20580
21179
|
});
|
|
20581
21180
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenuButton());
|
|
20582
21181
|
|
|
20583
|
-
const styles$
|
|
21182
|
+
const styles$f = css `
|
|
20584
21183
|
${display('grid')}
|
|
20585
21184
|
|
|
20586
21185
|
:host {
|
|
@@ -20678,7 +21277,7 @@
|
|
|
20678
21277
|
baseName: 'menu-item',
|
|
20679
21278
|
baseClass: MenuItem$1,
|
|
20680
21279
|
template: menuItemTemplate,
|
|
20681
|
-
styles: styles$
|
|
21280
|
+
styles: styles$f,
|
|
20682
21281
|
expandCollapseGlyph: arrowExpanderRight16X16.data
|
|
20683
21282
|
});
|
|
20684
21283
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenuItem());
|
|
@@ -20692,9 +21291,9 @@
|
|
|
20692
21291
|
block: 'block'
|
|
20693
21292
|
};
|
|
20694
21293
|
|
|
20695
|
-
const styles$
|
|
21294
|
+
const styles$e = css `
|
|
20696
21295
|
${display('inline-block')}
|
|
20697
|
-
${styles$
|
|
21296
|
+
${styles$n}
|
|
20698
21297
|
|
|
20699
21298
|
:host {
|
|
20700
21299
|
font: ${bodyFont};
|
|
@@ -20904,7 +21503,7 @@
|
|
|
20904
21503
|
baseName: 'number-field',
|
|
20905
21504
|
baseClass: NumberField$1,
|
|
20906
21505
|
template: numberFieldTemplate,
|
|
20907
|
-
styles: styles$
|
|
21506
|
+
styles: styles$e,
|
|
20908
21507
|
shadowOptions: {
|
|
20909
21508
|
delegatesFocus: true
|
|
20910
21509
|
},
|
|
@@ -20939,8 +21538,155 @@
|
|
|
20939
21538
|
});
|
|
20940
21539
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleNumberField());
|
|
20941
21540
|
|
|
21541
|
+
const styles$d = css `
|
|
21542
|
+
${display('inline-flex')}
|
|
21543
|
+
|
|
21544
|
+
:host {
|
|
21545
|
+
font: ${buttonLabelFont};
|
|
21546
|
+
align-items: center;
|
|
21547
|
+
outline: none;
|
|
21548
|
+
width: fit-content;
|
|
21549
|
+
cursor: pointer;
|
|
21550
|
+
}
|
|
21551
|
+
|
|
21552
|
+
:host([disabled]) {
|
|
21553
|
+
cursor: default;
|
|
21554
|
+
}
|
|
21555
|
+
|
|
21556
|
+
.control {
|
|
21557
|
+
width: calc(${controlHeight} / 2);
|
|
21558
|
+
height: calc(${controlHeight} / 2);
|
|
21559
|
+
box-sizing: border-box;
|
|
21560
|
+
flex-shrink: 0;
|
|
21561
|
+
border: ${borderWidth} solid ${borderColor};
|
|
21562
|
+
border-radius: 100%;
|
|
21563
|
+
display: inline-flex;
|
|
21564
|
+
align-items: center;
|
|
21565
|
+
justify-content: center;
|
|
21566
|
+
transition: box-shadow ${smallDelay};
|
|
21567
|
+
${
|
|
21568
|
+
/*
|
|
21569
|
+
* Firefox includes the line height in the outline height calculation (not sure if intended or accidental).
|
|
21570
|
+
* Set it to 0 to ensure the outline is just as high as the control.
|
|
21571
|
+
*/ ''}
|
|
21572
|
+
line-height: 0;
|
|
21573
|
+
}
|
|
21574
|
+
|
|
21575
|
+
:host([disabled]) .control {
|
|
21576
|
+
background-color: rgba(${borderRgbPartialColor}, 0.1);
|
|
21577
|
+
border-color: rgba(${borderRgbPartialColor}, 0.2);
|
|
21578
|
+
}
|
|
21579
|
+
|
|
21580
|
+
:host(:not([disabled]):not(:active):hover) .control {
|
|
21581
|
+
border-color: ${borderHoverColor};
|
|
21582
|
+
box-shadow: 0px 0px 0px ${borderWidth} ${borderHoverColor} inset;
|
|
21583
|
+
}
|
|
21584
|
+
|
|
21585
|
+
:host(${focusVisible}) .control {
|
|
21586
|
+
border-color: ${borderHoverColor};
|
|
21587
|
+
}
|
|
21588
|
+
|
|
21589
|
+
:host(${focusVisible}) .control::after {
|
|
21590
|
+
content: '';
|
|
21591
|
+
position: absolute;
|
|
21592
|
+
width: calc(2px + ${controlHeight} / 2);
|
|
21593
|
+
height: calc(2px + ${controlHeight} / 2);
|
|
21594
|
+
border: 2px solid ${borderHoverColor};
|
|
21595
|
+
border-radius: 100%;
|
|
21596
|
+
}
|
|
21597
|
+
|
|
21598
|
+
.label {
|
|
21599
|
+
font: inherit;
|
|
21600
|
+
color: ${bodyFontColor};
|
|
21601
|
+
padding-left: 1ch;
|
|
21602
|
+
cursor: inherit;
|
|
21603
|
+
}
|
|
21604
|
+
|
|
21605
|
+
:host([disabled]) .label {
|
|
21606
|
+
color: ${bodyDisabledFontColor};
|
|
21607
|
+
}
|
|
21608
|
+
|
|
21609
|
+
slot[name='checked-indicator'] {
|
|
21610
|
+
display: none;
|
|
21611
|
+
}
|
|
21612
|
+
|
|
21613
|
+
slot[name='checked-indicator'] svg {
|
|
21614
|
+
height: ${iconSize};
|
|
21615
|
+
width: ${iconSize};
|
|
21616
|
+
overflow: visible;
|
|
21617
|
+
}
|
|
21618
|
+
|
|
21619
|
+
:host(.checked) slot[name='checked-indicator'] {
|
|
21620
|
+
display: contents;
|
|
21621
|
+
}
|
|
21622
|
+
|
|
21623
|
+
slot[name='checked-indicator'] circle {
|
|
21624
|
+
fill: ${borderColor};
|
|
21625
|
+
}
|
|
21626
|
+
|
|
21627
|
+
:host([disabled]) slot[name='checked-indicator'] circle {
|
|
21628
|
+
fill: rgba(${borderRgbPartialColor}, 0.3);
|
|
21629
|
+
}
|
|
21630
|
+
`;
|
|
21631
|
+
|
|
21632
|
+
/**
|
|
21633
|
+
* A nimble-styled radio button
|
|
21634
|
+
*/
|
|
21635
|
+
class RadioButton extends Radio {
|
|
21636
|
+
}
|
|
21637
|
+
const nimbleRadioButton = RadioButton.compose({
|
|
21638
|
+
baseName: 'radio-button',
|
|
21639
|
+
baseClass: Radio,
|
|
21640
|
+
template: radioTemplate,
|
|
21641
|
+
styles: styles$d,
|
|
21642
|
+
checkedIndicator: circleFilled16X16.data
|
|
21643
|
+
});
|
|
21644
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleRadioButton());
|
|
21645
|
+
|
|
21646
|
+
const styles$c = css `
|
|
21647
|
+
${display('inline-block')}
|
|
21648
|
+
|
|
21649
|
+
.positioning-region {
|
|
21650
|
+
display: flex;
|
|
21651
|
+
gap: ${standardPadding};
|
|
21652
|
+
}
|
|
21653
|
+
|
|
21654
|
+
:host([orientation='vertical']) .positioning-region {
|
|
21655
|
+
flex-direction: column;
|
|
21656
|
+
}
|
|
21657
|
+
|
|
21658
|
+
:host([orientation='horizontal']) .positioning-region {
|
|
21659
|
+
flex-direction: row;
|
|
21660
|
+
}
|
|
21661
|
+
|
|
21662
|
+
slot[name='label'] {
|
|
21663
|
+
font: ${controlLabelFont};
|
|
21664
|
+
color: ${controlLabelFontColor};
|
|
21665
|
+
}
|
|
21666
|
+
|
|
21667
|
+
:host([disabled]) slot[name='label'] {
|
|
21668
|
+
color: ${controlLabelDisabledFontColor};
|
|
21669
|
+
}
|
|
21670
|
+
`;
|
|
21671
|
+
|
|
21672
|
+
/**
|
|
21673
|
+
* A nimble-styled grouping element for radio buttons
|
|
21674
|
+
*/
|
|
21675
|
+
class RadioGroup extends RadioGroup$1 {
|
|
21676
|
+
}
|
|
21677
|
+
const nimbleRadioGroup = RadioGroup.compose({
|
|
21678
|
+
baseName: 'radio-group',
|
|
21679
|
+
baseClass: RadioGroup$1,
|
|
21680
|
+
template: radioGroupTemplate,
|
|
21681
|
+
styles: styles$c,
|
|
21682
|
+
shadowOptions: {
|
|
21683
|
+
delegatesFocus: true
|
|
21684
|
+
}
|
|
21685
|
+
});
|
|
21686
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleRadioGroup());
|
|
21687
|
+
|
|
20942
21688
|
const styles$b = css `
|
|
20943
|
-
${styles$
|
|
21689
|
+
${styles$o}
|
|
20944
21690
|
`;
|
|
20945
21691
|
|
|
20946
21692
|
/**
|
|
@@ -21060,7 +21806,6 @@
|
|
|
21060
21806
|
|
|
21061
21807
|
:host([aria-checked='true']) .checked-indicator-spacer {
|
|
21062
21808
|
flex-grow: 1;
|
|
21063
|
-
transition: flex-grow ${smallDelay} ease-in-out;
|
|
21064
21809
|
}
|
|
21065
21810
|
|
|
21066
21811
|
.checked-indicator {
|
|
@@ -21115,7 +21860,6 @@
|
|
|
21115
21860
|
|
|
21116
21861
|
:host([aria-checked='true']) .checked-indicator-inner {
|
|
21117
21862
|
opacity: 1;
|
|
21118
|
-
transition: opacity ${smallDelay} ease-in-out;
|
|
21119
21863
|
}
|
|
21120
21864
|
|
|
21121
21865
|
slot[name='checked-message']::slotted(*) {
|
|
@@ -21579,7 +22323,7 @@
|
|
|
21579
22323
|
/* eslint-disable @typescript-eslint/indent */
|
|
21580
22324
|
const styles$4 = css `
|
|
21581
22325
|
${display('inline-block')}
|
|
21582
|
-
${styles$
|
|
22326
|
+
${styles$n}
|
|
21583
22327
|
|
|
21584
22328
|
:host {
|
|
21585
22329
|
font: ${bodyFont};
|