@fluentui/web-components 2.2.1 → 2.2.2
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/CHANGELOG.json +31 -1
- package/CHANGELOG.md +11 -2
- package/dist/web-components.js +304 -246
- package/dist/web-components.min.js +156 -156
- package/package.json +2 -2
package/dist/web-components.js
CHANGED
|
@@ -3634,7 +3634,8 @@ function when(binding, templateOrTemplateBinding) {
|
|
|
3634
3634
|
}
|
|
3635
3635
|
|
|
3636
3636
|
const defaultRepeatOptions = Object.freeze({
|
|
3637
|
-
positioning: false
|
|
3637
|
+
positioning: false,
|
|
3638
|
+
recycle: true
|
|
3638
3639
|
});
|
|
3639
3640
|
|
|
3640
3641
|
function bindWithoutPositioning(view, items, index, context) {
|
|
@@ -3778,7 +3779,7 @@ class RepeatBehavior {
|
|
|
3778
3779
|
for (; addIndex < end; ++addIndex) {
|
|
3779
3780
|
const neighbor = views[addIndex];
|
|
3780
3781
|
const location = neighbor ? neighbor.firstChild : this.location;
|
|
3781
|
-
const view = totalRemoved.length > 0 ? totalRemoved.shift() : template.create();
|
|
3782
|
+
const view = this.options.recycle && totalRemoved.length > 0 ? totalRemoved.shift() : template.create();
|
|
3782
3783
|
views.splice(addIndex, 0, view);
|
|
3783
3784
|
bindView(view, items, addIndex, childContext);
|
|
3784
3785
|
view.insertBefore(location);
|
|
@@ -4176,7 +4177,7 @@ const startTemplate = html`<span part="start" ${ref("startContainer")}><slot nam
|
|
|
4176
4177
|
* @public
|
|
4177
4178
|
*/
|
|
4178
4179
|
|
|
4179
|
-
const accordionItemTemplate = (context, definition) => html`<template class="${x => x.expanded ? "expanded" : ""}"
|
|
4180
|
+
const accordionItemTemplate = (context, definition) => html`<template class="${x => x.expanded ? "expanded" : ""}"><div class="heading" part="heading" role="heading" aria-level="${x => x.headinglevel}"><button class="button" part="button" ${ref("expandbutton")} aria-expanded="${x => x.expanded}" aria-controls="${x => x.id}-panel" id="${x => x.id}" @click="${(x, c) => x.clickHandler(c.event)}"><span class="heading"><slot name="heading" part="heading"></slot></span></button>${startSlotTemplate(context, definition)} ${endSlotTemplate(context, definition)}<span class="icon" part="icon" aria-hidden="true"><slot name="expanded-icon" part="expanded-icon">${definition.expandedIcon || ""}</slot><slot name="collapsed-icon" part="collapsed-icon">${definition.collapsedIcon || ""}</slot><span></div><div class="region" part="region" id="${x => x.id}-panel" role="region" aria-labelledby="${x => x.id}"><slot></slot></div></template>`;
|
|
4180
4181
|
|
|
4181
4182
|
/*! *****************************************************************************
|
|
4182
4183
|
Copyright (c) Microsoft Corporation.
|
|
@@ -5904,7 +5905,12 @@ applyMixins(AccordionItem, StartEnd);
|
|
|
5904
5905
|
* @public
|
|
5905
5906
|
*/
|
|
5906
5907
|
|
|
5907
|
-
const accordionTemplate = (context, definition) =>
|
|
5908
|
+
const accordionTemplate = (context, definition) =>
|
|
5909
|
+
/* TODO: deprecate slot name `item` to only support default slot https://github.com/microsoft/fast/issues/5515 */
|
|
5910
|
+
html`<template><slot ${slotted({
|
|
5911
|
+
property: "accordionItems",
|
|
5912
|
+
filter: elements()
|
|
5913
|
+
})}></slot><slot name="item" part="item" ${slotted("accordionItems")}></slot></template>`;
|
|
5908
5914
|
|
|
5909
5915
|
var Orientation;
|
|
5910
5916
|
|
|
@@ -6112,12 +6118,12 @@ const ArrowKeys = {
|
|
|
6112
6118
|
/**
|
|
6113
6119
|
* Expose ltr and rtl strings
|
|
6114
6120
|
*/
|
|
6115
|
-
var Direction
|
|
6121
|
+
var Direction;
|
|
6116
6122
|
|
|
6117
6123
|
(function (Direction) {
|
|
6118
6124
|
Direction["ltr"] = "ltr";
|
|
6119
6125
|
Direction["rtl"] = "rtl";
|
|
6120
|
-
})(Direction
|
|
6126
|
+
})(Direction || (Direction = {}));
|
|
6121
6127
|
|
|
6122
6128
|
/**
|
|
6123
6129
|
* This method keeps a given value within the bounds of a min and max value. If the value
|
|
@@ -6151,6 +6157,28 @@ function uniqueId(prefix = "") {
|
|
|
6151
6157
|
return `${prefix}${uniqueIdCounter++}`;
|
|
6152
6158
|
}
|
|
6153
6159
|
|
|
6160
|
+
/**
|
|
6161
|
+
* Define system colors for use in CSS stylesheets.
|
|
6162
|
+
*
|
|
6163
|
+
* https://drafts.csswg.org/css-color/#css-system-colors
|
|
6164
|
+
*/
|
|
6165
|
+
var SystemColors;
|
|
6166
|
+
|
|
6167
|
+
(function (SystemColors) {
|
|
6168
|
+
SystemColors["Canvas"] = "Canvas";
|
|
6169
|
+
SystemColors["CanvasText"] = "CanvasText";
|
|
6170
|
+
SystemColors["LinkText"] = "LinkText";
|
|
6171
|
+
SystemColors["VisitedText"] = "VisitedText";
|
|
6172
|
+
SystemColors["ActiveText"] = "ActiveText";
|
|
6173
|
+
SystemColors["ButtonFace"] = "ButtonFace";
|
|
6174
|
+
SystemColors["ButtonText"] = "ButtonText";
|
|
6175
|
+
SystemColors["Field"] = "Field";
|
|
6176
|
+
SystemColors["FieldText"] = "FieldText";
|
|
6177
|
+
SystemColors["Highlight"] = "Highlight";
|
|
6178
|
+
SystemColors["HighlightText"] = "HighlightText";
|
|
6179
|
+
SystemColors["GrayText"] = "GrayText";
|
|
6180
|
+
})(SystemColors || (SystemColors = {}));
|
|
6181
|
+
|
|
6154
6182
|
/**
|
|
6155
6183
|
* Expand mode for {@link Accordion}
|
|
6156
6184
|
* @public
|
|
@@ -6562,7 +6590,7 @@ const anchoredRegionTemplate = (context, definition) => html`<template class="${
|
|
|
6562
6590
|
|
|
6563
6591
|
const getDirection = rootNode => {
|
|
6564
6592
|
const dirNode = rootNode.closest("[dir]");
|
|
6565
|
-
return dirNode !== null && dirNode.dir === "rtl" ? Direction
|
|
6593
|
+
return dirNode !== null && dirNode.dir === "rtl" ? Direction.rtl : Direction.ltr;
|
|
6566
6594
|
};
|
|
6567
6595
|
|
|
6568
6596
|
/**
|
|
@@ -6850,7 +6878,7 @@ class AnchoredRegion extends FoundationElement {
|
|
|
6850
6878
|
this.baseVerticalOffset = 0;
|
|
6851
6879
|
this.pendingPositioningUpdate = false;
|
|
6852
6880
|
this.pendingReset = false;
|
|
6853
|
-
this.currentDirection = Direction
|
|
6881
|
+
this.currentDirection = Direction.ltr;
|
|
6854
6882
|
this.regionVisible = false; // indicates that a layout update should occur even if geometry has not changed
|
|
6855
6883
|
// used to ensure some attribute changes are applied
|
|
6856
6884
|
|
|
@@ -7079,7 +7107,7 @@ class AnchoredRegion extends FoundationElement {
|
|
|
7079
7107
|
return;
|
|
7080
7108
|
}
|
|
7081
7109
|
|
|
7082
|
-
if (this.currentDirection === Direction
|
|
7110
|
+
if (this.currentDirection === Direction.ltr) {
|
|
7083
7111
|
dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "left" : "right";
|
|
7084
7112
|
} else {
|
|
7085
7113
|
dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "right" : "left";
|
|
@@ -8480,10 +8508,23 @@ class FormAssociatedButton extends FormAssociated(_Button) {
|
|
|
8480
8508
|
class Button$1 extends FormAssociatedButton {
|
|
8481
8509
|
constructor() {
|
|
8482
8510
|
super(...arguments);
|
|
8511
|
+
/**
|
|
8512
|
+
* Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements
|
|
8513
|
+
* @internal
|
|
8514
|
+
*/
|
|
8515
|
+
|
|
8516
|
+
this.handleClick = e => {
|
|
8517
|
+
var _a;
|
|
8518
|
+
|
|
8519
|
+
if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {
|
|
8520
|
+
e.stopPropagation();
|
|
8521
|
+
}
|
|
8522
|
+
};
|
|
8483
8523
|
/**
|
|
8484
8524
|
* Submits the parent form
|
|
8485
8525
|
*/
|
|
8486
8526
|
|
|
8527
|
+
|
|
8487
8528
|
this.handleSubmission = () => {
|
|
8488
8529
|
if (!this.form) {
|
|
8489
8530
|
return;
|
|
@@ -8578,9 +8619,35 @@ class Button$1 extends FormAssociatedButton {
|
|
|
8578
8619
|
|
|
8579
8620
|
|
|
8580
8621
|
connectedCallback() {
|
|
8622
|
+
var _a;
|
|
8623
|
+
|
|
8581
8624
|
super.connectedCallback();
|
|
8582
8625
|
this.proxy.setAttribute("type", this.type);
|
|
8583
8626
|
this.handleUnsupportedDelegatesFocus();
|
|
8627
|
+
const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
|
|
8628
|
+
|
|
8629
|
+
if (elements) {
|
|
8630
|
+
elements.forEach(span => {
|
|
8631
|
+
span.addEventListener("click", this.handleClick);
|
|
8632
|
+
});
|
|
8633
|
+
}
|
|
8634
|
+
}
|
|
8635
|
+
/**
|
|
8636
|
+
* @internal
|
|
8637
|
+
*/
|
|
8638
|
+
|
|
8639
|
+
|
|
8640
|
+
disconnectedCallback() {
|
|
8641
|
+
var _a;
|
|
8642
|
+
|
|
8643
|
+
super.disconnectedCallback();
|
|
8644
|
+
const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
|
|
8645
|
+
|
|
8646
|
+
if (elements) {
|
|
8647
|
+
elements.forEach(span => {
|
|
8648
|
+
span.removeEventListener("click", this.handleClick);
|
|
8649
|
+
});
|
|
8650
|
+
}
|
|
8584
8651
|
}
|
|
8585
8652
|
|
|
8586
8653
|
}
|
|
@@ -10341,28 +10408,6 @@ __decorate$1([observable], Checkbox.prototype, "defaultSlottedNodes", void 0);
|
|
|
10341
10408
|
|
|
10342
10409
|
__decorate$1([observable], Checkbox.prototype, "indeterminate", void 0);
|
|
10343
10410
|
|
|
10344
|
-
/**
|
|
10345
|
-
* Positioning directions for the listbox when a select is open.
|
|
10346
|
-
* @public
|
|
10347
|
-
*/
|
|
10348
|
-
var SelectPosition;
|
|
10349
|
-
|
|
10350
|
-
(function (SelectPosition) {
|
|
10351
|
-
SelectPosition["above"] = "above";
|
|
10352
|
-
SelectPosition["below"] = "below";
|
|
10353
|
-
})(SelectPosition || (SelectPosition = {}));
|
|
10354
|
-
/**
|
|
10355
|
-
* Select role.
|
|
10356
|
-
* @public
|
|
10357
|
-
*/
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
var SelectRole;
|
|
10361
|
-
|
|
10362
|
-
(function (SelectRole) {
|
|
10363
|
-
SelectRole["combobox"] = "combobox";
|
|
10364
|
-
})(SelectRole || (SelectRole = {}));
|
|
10365
|
-
|
|
10366
10411
|
/**
|
|
10367
10412
|
* Determines if the element is a {@link (ListboxOption:class)}
|
|
10368
10413
|
*
|
|
@@ -10428,6 +10473,24 @@ class ListboxOption extends FoundationElement {
|
|
|
10428
10473
|
this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected);
|
|
10429
10474
|
this.proxy.disabled = this.disabled;
|
|
10430
10475
|
}
|
|
10476
|
+
/**
|
|
10477
|
+
* Updates the ariaChecked property when the checked property changes.
|
|
10478
|
+
*
|
|
10479
|
+
* @param prev - the previous checked value
|
|
10480
|
+
* @param next - the current checked value
|
|
10481
|
+
*
|
|
10482
|
+
* @public
|
|
10483
|
+
*/
|
|
10484
|
+
|
|
10485
|
+
|
|
10486
|
+
checkedChanged(prev, next) {
|
|
10487
|
+
if (typeof next === "boolean") {
|
|
10488
|
+
this.ariaChecked = next ? "true" : "false";
|
|
10489
|
+
return;
|
|
10490
|
+
}
|
|
10491
|
+
|
|
10492
|
+
this.ariaChecked = undefined;
|
|
10493
|
+
}
|
|
10431
10494
|
|
|
10432
10495
|
defaultSelectedChanged() {
|
|
10433
10496
|
if (!this.dirtySelected) {
|
|
@@ -10440,6 +10503,8 @@ class ListboxOption extends FoundationElement {
|
|
|
10440
10503
|
}
|
|
10441
10504
|
|
|
10442
10505
|
disabledChanged(prev, next) {
|
|
10506
|
+
this.ariaDisabled = this.disabled ? "true" : "false";
|
|
10507
|
+
|
|
10443
10508
|
if (this.proxy instanceof HTMLOptionElement) {
|
|
10444
10509
|
this.proxy.disabled = this.disabled;
|
|
10445
10510
|
}
|
|
@@ -10454,14 +10519,14 @@ class ListboxOption extends FoundationElement {
|
|
|
10454
10519
|
}
|
|
10455
10520
|
|
|
10456
10521
|
selectedChanged() {
|
|
10457
|
-
|
|
10458
|
-
if (!this.dirtySelected) {
|
|
10459
|
-
this.dirtySelected = true;
|
|
10460
|
-
}
|
|
10522
|
+
this.ariaSelected = this.selected ? "true" : "false";
|
|
10461
10523
|
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10524
|
+
if (!this.dirtySelected) {
|
|
10525
|
+
this.dirtySelected = true;
|
|
10526
|
+
}
|
|
10527
|
+
|
|
10528
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
10529
|
+
this.proxy.selected = this.selected;
|
|
10465
10530
|
}
|
|
10466
10531
|
}
|
|
10467
10532
|
|
|
@@ -10504,6 +10569,8 @@ class ListboxOption extends FoundationElement {
|
|
|
10504
10569
|
|
|
10505
10570
|
}
|
|
10506
10571
|
|
|
10572
|
+
__decorate$1([observable], ListboxOption.prototype, "checked", void 0);
|
|
10573
|
+
|
|
10507
10574
|
__decorate$1([observable], ListboxOption.prototype, "defaultSelected", void 0);
|
|
10508
10575
|
|
|
10509
10576
|
__decorate$1([attr({
|
|
@@ -10521,18 +10588,25 @@ __decorate$1([attr({
|
|
|
10521
10588
|
attribute: "value",
|
|
10522
10589
|
mode: "fromView"
|
|
10523
10590
|
})], ListboxOption.prototype, "initialValue", void 0);
|
|
10524
|
-
|
|
10525
|
-
applyMixins(ListboxOption, StartEnd);
|
|
10526
|
-
|
|
10527
10591
|
/**
|
|
10528
|
-
*
|
|
10592
|
+
* States and properties relating to the ARIA `option` role.
|
|
10593
|
+
*
|
|
10529
10594
|
* @public
|
|
10530
10595
|
*/
|
|
10531
|
-
var ListboxRole;
|
|
10532
10596
|
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10597
|
+
|
|
10598
|
+
class DelegatesARIAListboxOption {}
|
|
10599
|
+
|
|
10600
|
+
__decorate$1([observable], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0);
|
|
10601
|
+
|
|
10602
|
+
__decorate$1([observable], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0);
|
|
10603
|
+
|
|
10604
|
+
__decorate$1([observable], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0);
|
|
10605
|
+
|
|
10606
|
+
__decorate$1([observable], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0);
|
|
10607
|
+
|
|
10608
|
+
applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties);
|
|
10609
|
+
applyMixins(ListboxOption, StartEnd, DelegatesARIAListboxOption);
|
|
10536
10610
|
|
|
10537
10611
|
/**
|
|
10538
10612
|
* A Listbox Custom HTML Element.
|
|
@@ -10551,15 +10625,6 @@ class Listbox$1 extends FoundationElement {
|
|
|
10551
10625
|
*/
|
|
10552
10626
|
|
|
10553
10627
|
this._options = [];
|
|
10554
|
-
/**
|
|
10555
|
-
* The role of the element.
|
|
10556
|
-
*
|
|
10557
|
-
* @public
|
|
10558
|
-
* @remarks
|
|
10559
|
-
* HTML Attribute: `role`
|
|
10560
|
-
*/
|
|
10561
|
-
|
|
10562
|
-
this.role = ListboxRole.listbox;
|
|
10563
10628
|
/**
|
|
10564
10629
|
* The index of the selected option.
|
|
10565
10630
|
*
|
|
@@ -10957,17 +11022,24 @@ class Listbox$1 extends FoundationElement {
|
|
|
10957
11022
|
|
|
10958
11023
|
|
|
10959
11024
|
slottedOptionsChanged(prev, next) {
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
}
|
|
11025
|
+
this.options = next.reduce((options, item) => {
|
|
11026
|
+
if (isListboxOption(item)) {
|
|
11027
|
+
options.push(item);
|
|
11028
|
+
}
|
|
10965
11029
|
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
11030
|
+
return options;
|
|
11031
|
+
}, []);
|
|
11032
|
+
const setSize = `${this.options.length}`;
|
|
11033
|
+
this.options.forEach((option, index) => {
|
|
11034
|
+
if (!option.id) {
|
|
11035
|
+
option.id = uniqueId("option-");
|
|
11036
|
+
}
|
|
11037
|
+
|
|
11038
|
+
option.ariaPosInSet = `${index + 1}`;
|
|
11039
|
+
option.ariaSetSize = setSize;
|
|
11040
|
+
});
|
|
11041
|
+
|
|
11042
|
+
if (this.$fastController.isConnected) {
|
|
10971
11043
|
this.setSelectedOptions();
|
|
10972
11044
|
this.setDefaultSelectedOption();
|
|
10973
11045
|
}
|
|
@@ -11022,8 +11094,6 @@ __decorate$1([attr({
|
|
|
11022
11094
|
mode: "boolean"
|
|
11023
11095
|
})], Listbox$1.prototype, "disabled", void 0);
|
|
11024
11096
|
|
|
11025
|
-
__decorate$1([attr], Listbox$1.prototype, "role", void 0);
|
|
11026
|
-
|
|
11027
11097
|
__decorate$1([observable], Listbox$1.prototype, "selectedIndex", void 0);
|
|
11028
11098
|
|
|
11029
11099
|
__decorate$1([observable], Listbox$1.prototype, "selectedOptions", void 0);
|
|
@@ -11038,18 +11108,7 @@ __decorate$1([observable], Listbox$1.prototype, "typeaheadBuffer", void 0);
|
|
|
11038
11108
|
*/
|
|
11039
11109
|
|
|
11040
11110
|
|
|
11041
|
-
class DelegatesARIAListbox {
|
|
11042
|
-
constructor() {
|
|
11043
|
-
/**
|
|
11044
|
-
* See {@link https://www.w3.org/WAI/PF/aria/roles#listbox} for more information
|
|
11045
|
-
* @public
|
|
11046
|
-
* @remarks
|
|
11047
|
-
* HTML Attribute: aria-activedescendant
|
|
11048
|
-
*/
|
|
11049
|
-
this.ariaActiveDescendant = "";
|
|
11050
|
-
}
|
|
11051
|
-
|
|
11052
|
-
}
|
|
11111
|
+
class DelegatesARIAListbox {}
|
|
11053
11112
|
|
|
11054
11113
|
__decorate$1([observable], DelegatesARIAListbox.prototype, "ariaActiveDescendant", void 0);
|
|
11055
11114
|
|
|
@@ -11060,6 +11119,74 @@ __decorate$1([observable], DelegatesARIAListbox.prototype, "ariaExpanded", void
|
|
|
11060
11119
|
applyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties);
|
|
11061
11120
|
applyMixins(Listbox$1, DelegatesARIAListbox);
|
|
11062
11121
|
|
|
11122
|
+
/**
|
|
11123
|
+
* A Listbox Custom HTML Element.
|
|
11124
|
+
* Implements the {@link https://w3c.github.io/aria/#listbox | ARIA listbox }.
|
|
11125
|
+
*
|
|
11126
|
+
* @public
|
|
11127
|
+
*/
|
|
11128
|
+
|
|
11129
|
+
class ListboxElement extends Listbox$1 {
|
|
11130
|
+
/**
|
|
11131
|
+
* Prevents `focusin` events from firing before `click` events when the
|
|
11132
|
+
* element is unfocused.
|
|
11133
|
+
*
|
|
11134
|
+
* @override
|
|
11135
|
+
* @internal
|
|
11136
|
+
*/
|
|
11137
|
+
mousedownHandler(e) {
|
|
11138
|
+
if (e.offsetX >= 0 && e.offsetX <= this.scrollWidth) {
|
|
11139
|
+
return super.mousedownHandler(e);
|
|
11140
|
+
}
|
|
11141
|
+
}
|
|
11142
|
+
/**
|
|
11143
|
+
* Ensures the size is a positive integer when the property is updated.
|
|
11144
|
+
*
|
|
11145
|
+
* @param prev - the previous size value
|
|
11146
|
+
* @param next - the current size value
|
|
11147
|
+
*
|
|
11148
|
+
* @internal
|
|
11149
|
+
*/
|
|
11150
|
+
|
|
11151
|
+
|
|
11152
|
+
sizeChanged(prev, next) {
|
|
11153
|
+
const size = Math.max(0, parseInt(next.toFixed(), 10));
|
|
11154
|
+
|
|
11155
|
+
if (size !== next) {
|
|
11156
|
+
DOM.queueUpdate(() => {
|
|
11157
|
+
this.size = size;
|
|
11158
|
+
});
|
|
11159
|
+
}
|
|
11160
|
+
}
|
|
11161
|
+
|
|
11162
|
+
}
|
|
11163
|
+
|
|
11164
|
+
__decorate$1([attr({
|
|
11165
|
+
converter: nullableNumberConverter
|
|
11166
|
+
})], ListboxElement.prototype, "size", void 0);
|
|
11167
|
+
|
|
11168
|
+
/**
|
|
11169
|
+
* The template for the {@link @microsoft/fast-foundation#(Listbox:class)} component.
|
|
11170
|
+
* @public
|
|
11171
|
+
*/
|
|
11172
|
+
|
|
11173
|
+
const listboxTemplate = (context, definition) => html`<template aria-activedescendant="${x => x.ariaActiveDescendant}" class="listbox" role="listbox" tabindex="${x => !x.disabled ? "0" : null}" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @mousedown="${(x, c) => x.mousedownHandler(c.event)}"><slot ${slotted({
|
|
11174
|
+
filter: ListboxElement.slottedOptionFilter,
|
|
11175
|
+
flatten: true,
|
|
11176
|
+
property: "slottedOptions"
|
|
11177
|
+
})}></slot></template>`;
|
|
11178
|
+
|
|
11179
|
+
/**
|
|
11180
|
+
* Positioning directions for the listbox when a select is open.
|
|
11181
|
+
* @public
|
|
11182
|
+
*/
|
|
11183
|
+
var SelectPosition;
|
|
11184
|
+
|
|
11185
|
+
(function (SelectPosition) {
|
|
11186
|
+
SelectPosition["above"] = "above";
|
|
11187
|
+
SelectPosition["below"] = "below";
|
|
11188
|
+
})(SelectPosition || (SelectPosition = {}));
|
|
11189
|
+
|
|
11063
11190
|
class _Combobox extends Listbox$1 {}
|
|
11064
11191
|
/**
|
|
11065
11192
|
* A form-associated base class for the {@link (Combobox:class)} component.
|
|
@@ -11157,15 +11284,6 @@ class Combobox$1 extends FormAssociatedCombobox {
|
|
|
11157
11284
|
*/
|
|
11158
11285
|
|
|
11159
11286
|
this.position = SelectPosition.below;
|
|
11160
|
-
/**
|
|
11161
|
-
* The role of the element.
|
|
11162
|
-
*
|
|
11163
|
-
* @public
|
|
11164
|
-
* @remarks
|
|
11165
|
-
* HTML Attribute: role
|
|
11166
|
-
*/
|
|
11167
|
-
|
|
11168
|
-
this.role = SelectRole.combobox;
|
|
11169
11287
|
}
|
|
11170
11288
|
/**
|
|
11171
11289
|
* Reset the element to its first selectable option when its parent form is reset.
|
|
@@ -11199,12 +11317,16 @@ class Combobox$1 extends FormAssociatedCombobox {
|
|
|
11199
11317
|
}
|
|
11200
11318
|
|
|
11201
11319
|
openChanged() {
|
|
11202
|
-
this.ariaExpanded = this.open ? "true" : "false";
|
|
11203
|
-
|
|
11204
11320
|
if (this.open) {
|
|
11321
|
+
this.ariaControls = this.listbox.id;
|
|
11322
|
+
this.ariaExpanded = "true";
|
|
11205
11323
|
this.setPositioning();
|
|
11206
11324
|
this.focusAndScrollOptionIntoView();
|
|
11325
|
+
return;
|
|
11207
11326
|
}
|
|
11327
|
+
|
|
11328
|
+
this.ariaControls = "";
|
|
11329
|
+
this.ariaExpanded = "false";
|
|
11208
11330
|
}
|
|
11209
11331
|
/**
|
|
11210
11332
|
* The list of options.
|
|
@@ -11307,6 +11429,10 @@ class Combobox$1 extends FormAssociatedCombobox {
|
|
|
11307
11429
|
if (this.value) {
|
|
11308
11430
|
this.initialValue = this.value;
|
|
11309
11431
|
}
|
|
11432
|
+
|
|
11433
|
+
if (!this.listbox.id) {
|
|
11434
|
+
this.listbox.id = uniqueId("listbox-");
|
|
11435
|
+
}
|
|
11310
11436
|
}
|
|
11311
11437
|
/**
|
|
11312
11438
|
* Synchronize the `aria-disabled` property when the `disabled` property changes.
|
|
@@ -11705,12 +11831,11 @@ __decorate$1([observable], Combobox$1.prototype, "position", void 0);
|
|
|
11705
11831
|
|
|
11706
11832
|
class DelegatesARIACombobox {}
|
|
11707
11833
|
|
|
11708
|
-
__decorate$1([
|
|
11709
|
-
attribute: "aria-autocomplete",
|
|
11710
|
-
mode: "fromView"
|
|
11711
|
-
})], DelegatesARIACombobox.prototype, "ariaAutocomplete", void 0);
|
|
11834
|
+
__decorate$1([observable], DelegatesARIACombobox.prototype, "ariaAutoComplete", void 0);
|
|
11712
11835
|
|
|
11713
|
-
|
|
11836
|
+
__decorate$1([observable], DelegatesARIACombobox.prototype, "ariaControls", void 0);
|
|
11837
|
+
|
|
11838
|
+
applyMixins(DelegatesARIACombobox, DelegatesARIAListbox);
|
|
11714
11839
|
applyMixins(Combobox$1, StartEnd, DelegatesARIACombobox);
|
|
11715
11840
|
|
|
11716
11841
|
/**
|
|
@@ -11718,7 +11843,7 @@ applyMixins(Combobox$1, StartEnd, DelegatesARIACombobox);
|
|
|
11718
11843
|
* @public
|
|
11719
11844
|
*/
|
|
11720
11845
|
|
|
11721
|
-
const comboboxTemplate = (context, definition) => html`<template autocomplete="${x => x.autocomplete}" class="${x => x.disabled ? "disabled" : ""} ${x => x.position}" tabindex="${x => !x.disabled ? "0" : null}"
|
|
11846
|
+
const comboboxTemplate = (context, definition) => html`<template aria-disabled="${x => x.ariaDisabled}" autocomplete="${x => x.autocomplete}" class="${x => x.open ? "open" : ""} ${x => x.disabled ? "disabled" : ""} ${x => x.position}" tabindex="${x => !x.disabled ? "0" : null}" @click="${(x, c) => x.clickHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><div class="control" part="control">${startSlotTemplate(context, definition)}<slot name="control"><input aria-activedescendant="${x => x.open ? x.ariaActiveDescendant : null}" aria-autocomplete="${x => x.ariaAutoComplete}" aria-controls="${x => x.ariaControls}" aria-disabled="${x => x.ariaDisabled}" aria-expanded="${x => x.ariaExpanded}" aria-haspopup="listbox" class="selected-value" part="selected-value" placeholder="${x => x.placeholder}" role="combobox" type="text" ?disabled="${x => x.disabled}" :value="${x => x.value}" @input="${(x, c) => x.inputHandler(c.event)}" @keyup="${(x, c) => x.keyupHandler(c.event)}" ${ref("control")} /><div class="indicator" part="indicator" aria-hidden="true"><slot name="indicator">${definition.indicator || ""}</slot></div></slot>${endSlotTemplate(context, definition)}</div><div class="listbox" part="listbox" role="listbox" ?disabled="${x => x.disabled}" ?hidden="${x => !x.open}" ${ref("listbox")}><slot ${slotted({
|
|
11722
11847
|
filter: Listbox$1.slottedOptionFilter,
|
|
11723
11848
|
flatten: true,
|
|
11724
11849
|
property: "slottedOptions"
|
|
@@ -13822,7 +13947,7 @@ __decorate$1([attr({
|
|
|
13822
13947
|
* @public
|
|
13823
13948
|
*/
|
|
13824
13949
|
|
|
13825
|
-
const dividerTemplate = (context, definition) => html`<template role="${x => x.role}"></template>`;
|
|
13950
|
+
const dividerTemplate = (context, definition) => html`<template role="${x => x.role}" aria-orientation="${x => x.orientation}"></template>`;
|
|
13826
13951
|
|
|
13827
13952
|
/**
|
|
13828
13953
|
* Divider roles
|
|
@@ -13862,12 +13987,23 @@ class Divider extends FoundationElement {
|
|
|
13862
13987
|
*/
|
|
13863
13988
|
|
|
13864
13989
|
this.role = DividerRole.separator;
|
|
13990
|
+
/**
|
|
13991
|
+
* The orientation of the divider.
|
|
13992
|
+
*
|
|
13993
|
+
* @public
|
|
13994
|
+
* @remarks
|
|
13995
|
+
* HTML Attribute: orientation
|
|
13996
|
+
*/
|
|
13997
|
+
|
|
13998
|
+
this.orientation = Orientation.horizontal;
|
|
13865
13999
|
}
|
|
13866
14000
|
|
|
13867
14001
|
}
|
|
13868
14002
|
|
|
13869
14003
|
__decorate$1([attr], Divider.prototype, "role", void 0);
|
|
13870
14004
|
|
|
14005
|
+
__decorate$1([attr], Divider.prototype, "orientation", void 0);
|
|
14006
|
+
|
|
13871
14007
|
/**
|
|
13872
14008
|
* The direction options for flipper.
|
|
13873
14009
|
* @public
|
|
@@ -13956,64 +14092,7 @@ __decorate$1([attr], Flipper.prototype, "direction", void 0);
|
|
|
13956
14092
|
* @public
|
|
13957
14093
|
*/
|
|
13958
14094
|
|
|
13959
|
-
const listboxOptionTemplate = (context, definition) => html`<template aria-
|
|
13960
|
-
|
|
13961
|
-
/**
|
|
13962
|
-
* A Listbox Custom HTML Element.
|
|
13963
|
-
* Implements the {@link https://w3c.github.io/aria/#listbox | ARIA listbox }.
|
|
13964
|
-
*
|
|
13965
|
-
* @public
|
|
13966
|
-
*/
|
|
13967
|
-
|
|
13968
|
-
class ListboxElement extends Listbox$1 {
|
|
13969
|
-
/**
|
|
13970
|
-
* Prevents `focusin` events from firing before `click` events when the
|
|
13971
|
-
* element is unfocused.
|
|
13972
|
-
*
|
|
13973
|
-
* @override
|
|
13974
|
-
* @internal
|
|
13975
|
-
*/
|
|
13976
|
-
mousedownHandler(e) {
|
|
13977
|
-
if (e.offsetX >= 0 && e.offsetX <= this.scrollWidth) {
|
|
13978
|
-
return super.mousedownHandler(e);
|
|
13979
|
-
}
|
|
13980
|
-
}
|
|
13981
|
-
/**
|
|
13982
|
-
* Ensures the size is a positive integer when the property is updated.
|
|
13983
|
-
*
|
|
13984
|
-
* @param prev - the previous size value
|
|
13985
|
-
* @param next - the current size value
|
|
13986
|
-
*
|
|
13987
|
-
* @internal
|
|
13988
|
-
*/
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
sizeChanged(prev, next) {
|
|
13992
|
-
const size = Math.max(0, parseInt(next.toFixed(), 10));
|
|
13993
|
-
|
|
13994
|
-
if (size !== next) {
|
|
13995
|
-
DOM.queueUpdate(() => {
|
|
13996
|
-
this.size = size;
|
|
13997
|
-
});
|
|
13998
|
-
}
|
|
13999
|
-
}
|
|
14000
|
-
|
|
14001
|
-
}
|
|
14002
|
-
|
|
14003
|
-
__decorate$1([attr({
|
|
14004
|
-
converter: nullableNumberConverter
|
|
14005
|
-
})], ListboxElement.prototype, "size", void 0);
|
|
14006
|
-
|
|
14007
|
-
/**
|
|
14008
|
-
* The template for the {@link @microsoft/fast-foundation#(Listbox:class)} component.
|
|
14009
|
-
* @public
|
|
14010
|
-
*/
|
|
14011
|
-
|
|
14012
|
-
const listboxTemplate = (context, definition) => html`<template aria-activedescendant="${x => x.ariaActiveDescendant}" class="listbox" role="${x => x.role}" tabindex="${x => !x.disabled ? "0" : null}" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @mousedown="${(x, c) => x.mousedownHandler(c.event)}"><slot ${slotted({
|
|
14013
|
-
filter: ListboxElement.slottedOptionFilter,
|
|
14014
|
-
flatten: true,
|
|
14015
|
-
property: "slottedOptions"
|
|
14016
|
-
})}></slot></template>`;
|
|
14095
|
+
const listboxOptionTemplate = (context, definition) => html`<template aria-checked="${x => x.ariaChecked}" aria-disabled="${x => x.ariaDisabled}" aria-posinset="${x => x.ariaPosInSet}" aria-selected="${x => x.ariaSelected}" aria-setsize="${x => x.ariaSetSize}" class="${x => [x.checked && "checked", x.selected && "selected", x.disabled && "disabled"].filter(Boolean).join(" ")}" role="option">${startSlotTemplate(context, definition)}<span class="content" part="content"><slot></slot></span>${endSlotTemplate(context, definition)}</template>`;
|
|
14017
14096
|
|
|
14018
14097
|
/**
|
|
14019
14098
|
* Menu items roles.
|
|
@@ -14078,7 +14157,7 @@ class MenuItem extends FoundationElement {
|
|
|
14078
14157
|
* @internal
|
|
14079
14158
|
*/
|
|
14080
14159
|
|
|
14081
|
-
this.currentDirection = Direction
|
|
14160
|
+
this.currentDirection = Direction.ltr;
|
|
14082
14161
|
this.focusSubmenuOnLoad = false;
|
|
14083
14162
|
/**
|
|
14084
14163
|
* @internal
|
|
@@ -14981,6 +15060,20 @@ class NumberField$1 extends FormAssociatedNumberField {
|
|
|
14981
15060
|
|
|
14982
15061
|
this.value = this.getValidValue(this.value);
|
|
14983
15062
|
}
|
|
15063
|
+
/**
|
|
15064
|
+
* The value property, typed as a number.
|
|
15065
|
+
*
|
|
15066
|
+
* @public
|
|
15067
|
+
*/
|
|
15068
|
+
|
|
15069
|
+
|
|
15070
|
+
get valueAsNumber() {
|
|
15071
|
+
return parseFloat(super.value);
|
|
15072
|
+
}
|
|
15073
|
+
|
|
15074
|
+
set valueAsNumber(next) {
|
|
15075
|
+
this.value = next.toString();
|
|
15076
|
+
}
|
|
14984
15077
|
/**
|
|
14985
15078
|
* Validates that the value is a number between the min and max
|
|
14986
15079
|
* @param previous - previous stored value
|
|
@@ -15013,7 +15106,6 @@ class NumberField$1 extends FormAssociatedNumberField {
|
|
|
15013
15106
|
/**
|
|
15014
15107
|
* Sets the internal value to a valid number between the min and max properties
|
|
15015
15108
|
* @param value - user input
|
|
15016
|
-
* @param updateControl - should the text field update to the valid value
|
|
15017
15109
|
*
|
|
15018
15110
|
* @internal
|
|
15019
15111
|
*/
|
|
@@ -15517,7 +15609,7 @@ class RadioGroup extends FoundationElement {
|
|
|
15517
15609
|
case keyArrowRight:
|
|
15518
15610
|
case keyArrowDown:
|
|
15519
15611
|
{
|
|
15520
|
-
if (this.direction === Direction
|
|
15612
|
+
if (this.direction === Direction.ltr) {
|
|
15521
15613
|
this.moveRight(e);
|
|
15522
15614
|
} else {
|
|
15523
15615
|
this.moveLeft(e);
|
|
@@ -15529,7 +15621,7 @@ class RadioGroup extends FoundationElement {
|
|
|
15529
15621
|
case keyArrowLeft:
|
|
15530
15622
|
case keyArrowUp:
|
|
15531
15623
|
{
|
|
15532
|
-
if (this.direction === Direction
|
|
15624
|
+
if (this.direction === Direction.ltr) {
|
|
15533
15625
|
this.moveLeft(e);
|
|
15534
15626
|
} else {
|
|
15535
15627
|
this.moveRight(e);
|
|
@@ -16455,15 +16547,6 @@ class Select$1 extends FormAssociatedSelect {
|
|
|
16455
16547
|
*/
|
|
16456
16548
|
|
|
16457
16549
|
this.forcedPosition = false;
|
|
16458
|
-
/**
|
|
16459
|
-
* The role of the element.
|
|
16460
|
-
*
|
|
16461
|
-
* @public
|
|
16462
|
-
* @remarks
|
|
16463
|
-
* HTML Attribute: role
|
|
16464
|
-
*/
|
|
16465
|
-
|
|
16466
|
-
this.role = SelectRole.combobox;
|
|
16467
16550
|
/**
|
|
16468
16551
|
* Holds the current state for the calculated position of the listbox.
|
|
16469
16552
|
*
|
|
@@ -16488,13 +16571,17 @@ class Select$1 extends FormAssociatedSelect {
|
|
|
16488
16571
|
}
|
|
16489
16572
|
|
|
16490
16573
|
openChanged() {
|
|
16491
|
-
this.ariaExpanded = this.open ? "true" : "false";
|
|
16492
|
-
|
|
16493
16574
|
if (this.open) {
|
|
16575
|
+
this.ariaControls = this.listbox.id;
|
|
16576
|
+
this.ariaExpanded = "true";
|
|
16494
16577
|
this.setPositioning();
|
|
16495
16578
|
this.focusAndScrollOptionIntoView();
|
|
16496
16579
|
this.indexWhenOpened = this.selectedIndex;
|
|
16580
|
+
return;
|
|
16497
16581
|
}
|
|
16582
|
+
|
|
16583
|
+
this.ariaControls = "";
|
|
16584
|
+
this.ariaExpanded = "false";
|
|
16498
16585
|
}
|
|
16499
16586
|
/**
|
|
16500
16587
|
* The value property.
|
|
@@ -16771,6 +16858,10 @@ class Select$1 extends FormAssociatedSelect {
|
|
|
16771
16858
|
connectedCallback() {
|
|
16772
16859
|
super.connectedCallback();
|
|
16773
16860
|
this.forcedPosition = !!this.positionAttribute;
|
|
16861
|
+
|
|
16862
|
+
if (!this.listbox.id) {
|
|
16863
|
+
this.listbox.id = uniqueId("listbox-");
|
|
16864
|
+
}
|
|
16774
16865
|
}
|
|
16775
16866
|
|
|
16776
16867
|
}
|
|
@@ -16798,14 +16889,9 @@ __decorate$1([observable], Select$1.prototype, "displayValue", void 0);
|
|
|
16798
16889
|
|
|
16799
16890
|
class DelegatesARIASelect {}
|
|
16800
16891
|
|
|
16801
|
-
__decorate$1([observable], DelegatesARIASelect.prototype, "
|
|
16892
|
+
__decorate$1([observable], DelegatesARIASelect.prototype, "ariaControls", void 0);
|
|
16802
16893
|
|
|
16803
|
-
|
|
16804
|
-
attribute: "aria-pressed",
|
|
16805
|
-
mode: "fromView"
|
|
16806
|
-
})], DelegatesARIASelect.prototype, "ariaPressed", void 0);
|
|
16807
|
-
|
|
16808
|
-
applyMixins(DelegatesARIASelect, ARIAGlobalStatesAndProperties);
|
|
16894
|
+
applyMixins(DelegatesARIASelect, DelegatesARIAListbox);
|
|
16809
16895
|
applyMixins(Select$1, StartEnd, DelegatesARIASelect);
|
|
16810
16896
|
|
|
16811
16897
|
/**
|
|
@@ -16813,7 +16899,7 @@ applyMixins(Select$1, StartEnd, DelegatesARIASelect);
|
|
|
16813
16899
|
* @public
|
|
16814
16900
|
*/
|
|
16815
16901
|
|
|
16816
|
-
const selectTemplate = (context, definition) => html`<template class="${x => x.open ? "open" : ""} ${x => x.disabled ? "disabled" : ""} ${x => x.position}"
|
|
16902
|
+
const selectTemplate = (context, definition) => html`<template class="${x => x.open ? "open" : ""} ${x => x.disabled ? "disabled" : ""} ${x => x.position}" aria-activedescendant="${x => x.ariaActiveDescendant}" aria-controls="${x => x.ariaControls}" aria-disabled="${x => x.ariaDisabled}" aria-expanded="${x => x.ariaExpanded}" aria-haspopup="listbox" role="combobox" tabindex="${x => !x.disabled ? "0" : null}" @click="${(x, c) => x.clickHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><div class="control" part="control" ?disabled="${x => x.disabled}">${startSlotTemplate(context, definition)}<slot name="button-container"><div class="selected-value" part="selected-value"><slot name="selected-value">${x => x.displayValue}</slot></div><div aria-hidden="true" class="indicator" part="indicator"><slot name="indicator">${definition.indicator || ""}</slot></div></slot>${endSlotTemplate(context, definition)}</div><div class="listbox" part="listbox" role="listbox" ?disabled="${x => x.disabled}" ?hidden="${x => !x.open}" ${ref("listbox")}><slot ${slotted({
|
|
16817
16903
|
filter: Listbox$1.slottedOptionFilter,
|
|
16818
16904
|
flatten: true,
|
|
16819
16905
|
property: "slottedOptions"
|
|
@@ -16872,7 +16958,7 @@ const sliderLabelTemplate = (context, definition) => html`<template aria-disable
|
|
|
16872
16958
|
function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
|
|
16873
16959
|
let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition));
|
|
16874
16960
|
|
|
16875
|
-
if (direction === Direction
|
|
16961
|
+
if (direction === Direction.rtl) {
|
|
16876
16962
|
pct = 1 - pct;
|
|
16877
16963
|
}
|
|
16878
16964
|
|
|
@@ -16882,7 +16968,7 @@ function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
|
|
|
16882
16968
|
const defaultConfig = {
|
|
16883
16969
|
min: 0,
|
|
16884
16970
|
max: 0,
|
|
16885
|
-
direction: Direction
|
|
16971
|
+
direction: Direction.ltr,
|
|
16886
16972
|
orientation: Orientation.horizontal,
|
|
16887
16973
|
disabled: false
|
|
16888
16974
|
};
|
|
@@ -16908,11 +16994,11 @@ class SliderLabel extends FoundationElement {
|
|
|
16908
16994
|
* @internal
|
|
16909
16995
|
*/
|
|
16910
16996
|
|
|
16911
|
-
this.sliderDirection = Direction
|
|
16997
|
+
this.sliderDirection = Direction.ltr;
|
|
16912
16998
|
|
|
16913
16999
|
this.getSliderConfiguration = () => {
|
|
16914
17000
|
if (!this.isSliderConfig(this.parentNode)) {
|
|
16915
|
-
this.sliderDirection = defaultConfig.direction || Direction
|
|
17001
|
+
this.sliderDirection = defaultConfig.direction || Direction.ltr;
|
|
16916
17002
|
this.sliderOrientation = defaultConfig.orientation || Orientation.horizontal;
|
|
16917
17003
|
this.sliderMaxPosition = defaultConfig.max;
|
|
16918
17004
|
this.sliderMinPosition = defaultConfig.min;
|
|
@@ -16930,7 +17016,7 @@ class SliderLabel extends FoundationElement {
|
|
|
16930
17016
|
this.disabled = disabled;
|
|
16931
17017
|
}
|
|
16932
17018
|
|
|
16933
|
-
this.sliderDirection = direction || Direction
|
|
17019
|
+
this.sliderDirection = direction || Direction.ltr;
|
|
16934
17020
|
this.sliderOrientation = orientation || Orientation.horizontal;
|
|
16935
17021
|
this.sliderMaxPosition = max;
|
|
16936
17022
|
this.sliderMinPosition = min;
|
|
@@ -16938,7 +17024,7 @@ class SliderLabel extends FoundationElement {
|
|
|
16938
17024
|
};
|
|
16939
17025
|
|
|
16940
17026
|
this.positionAsStyle = () => {
|
|
16941
|
-
const direction = this.sliderDirection ? this.sliderDirection : Direction
|
|
17027
|
+
const direction = this.sliderDirection ? this.sliderDirection : Direction.ltr;
|
|
16942
17028
|
const pct = convertPixelToPercent(Number(this.position), Number(this.sliderMinPosition), Number(this.sliderMaxPosition));
|
|
16943
17029
|
let rightNum = Math.round((1 - pct) * 100);
|
|
16944
17030
|
let leftNum = Math.round(pct * 100);
|
|
@@ -16949,7 +17035,7 @@ class SliderLabel extends FoundationElement {
|
|
|
16949
17035
|
}
|
|
16950
17036
|
|
|
16951
17037
|
if (this.sliderOrientation === Orientation.horizontal) {
|
|
16952
|
-
return direction === Direction
|
|
17038
|
+
return direction === Direction.rtl ? `right: ${leftNum}%; left: ${rightNum}%;` : `left: ${leftNum}%; right: ${rightNum}%;`;
|
|
16953
17039
|
} else {
|
|
16954
17040
|
return `top: ${leftNum}%; bottom: ${rightNum}%;`;
|
|
16955
17041
|
}
|
|
@@ -17096,7 +17182,7 @@ class Slider extends FormAssociatedSlider {
|
|
|
17096
17182
|
* @internal
|
|
17097
17183
|
*/
|
|
17098
17184
|
|
|
17099
|
-
this.direction = Direction
|
|
17185
|
+
this.direction = Direction.ltr;
|
|
17100
17186
|
/**
|
|
17101
17187
|
* @internal
|
|
17102
17188
|
*/
|
|
@@ -17348,6 +17434,20 @@ class Slider extends FormAssociatedSlider {
|
|
|
17348
17434
|
this.proxy.readOnly = this.readOnly;
|
|
17349
17435
|
}
|
|
17350
17436
|
}
|
|
17437
|
+
/**
|
|
17438
|
+
* The value property, typed as a number.
|
|
17439
|
+
*
|
|
17440
|
+
* @public
|
|
17441
|
+
*/
|
|
17442
|
+
|
|
17443
|
+
|
|
17444
|
+
get valueAsNumber() {
|
|
17445
|
+
return parseFloat(super.value);
|
|
17446
|
+
}
|
|
17447
|
+
|
|
17448
|
+
set valueAsNumber(next) {
|
|
17449
|
+
this.value = next.toString();
|
|
17450
|
+
}
|
|
17351
17451
|
/**
|
|
17352
17452
|
* @internal
|
|
17353
17453
|
*/
|
|
@@ -17424,7 +17524,7 @@ class Slider extends FormAssociatedSlider {
|
|
|
17424
17524
|
|
|
17425
17525
|
|
|
17426
17526
|
increment() {
|
|
17427
|
-
const newVal = this.direction !== Direction
|
|
17527
|
+
const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) + Number(this.step) : Number(this.value) - Number(this.step);
|
|
17428
17528
|
const incrementedVal = this.convertToConstrainedValue(newVal);
|
|
17429
17529
|
const incrementedValString = incrementedVal < Number(this.max) ? `${incrementedVal}` : `${this.max}`;
|
|
17430
17530
|
this.value = incrementedValString;
|
|
@@ -17437,7 +17537,7 @@ class Slider extends FormAssociatedSlider {
|
|
|
17437
17537
|
|
|
17438
17538
|
|
|
17439
17539
|
decrement() {
|
|
17440
|
-
const newVal = this.direction !== Direction
|
|
17540
|
+
const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) - Number(this.step) : Number(this.value) + Number(this.step);
|
|
17441
17541
|
const decrementedVal = this.convertToConstrainedValue(newVal);
|
|
17442
17542
|
const decrementedValString = decrementedVal > Number(this.min) ? `${decrementedVal}` : `${this.min}`;
|
|
17443
17543
|
this.value = decrementedValString;
|
|
@@ -18251,14 +18351,14 @@ const ToolbarArrowKeyMap = Object.freeze({
|
|
|
18251
18351
|
},
|
|
18252
18352
|
[ArrowKeys.ArrowLeft]: {
|
|
18253
18353
|
[Orientation.horizontal]: {
|
|
18254
|
-
[Direction
|
|
18255
|
-
[Direction
|
|
18354
|
+
[Direction.ltr]: -1,
|
|
18355
|
+
[Direction.rtl]: 1
|
|
18256
18356
|
}
|
|
18257
18357
|
},
|
|
18258
18358
|
[ArrowKeys.ArrowRight]: {
|
|
18259
18359
|
[Orientation.horizontal]: {
|
|
18260
|
-
[Direction
|
|
18261
|
-
[Direction
|
|
18360
|
+
[Direction.ltr]: 1,
|
|
18361
|
+
[Direction.rtl]: -1
|
|
18262
18362
|
}
|
|
18263
18363
|
}
|
|
18264
18364
|
});
|
|
@@ -18285,7 +18385,7 @@ class Toolbar$1 extends FoundationElement {
|
|
|
18285
18385
|
* @internal
|
|
18286
18386
|
*/
|
|
18287
18387
|
|
|
18288
|
-
this.direction = Direction
|
|
18388
|
+
this.direction = Direction.ltr;
|
|
18289
18389
|
/**
|
|
18290
18390
|
* The orientation of the toolbar.
|
|
18291
18391
|
*
|
|
@@ -18625,7 +18725,7 @@ class Tooltip$1 extends FoundationElement {
|
|
|
18625
18725
|
* @internal
|
|
18626
18726
|
*/
|
|
18627
18727
|
|
|
18628
|
-
this.horizontalInset = "
|
|
18728
|
+
this.horizontalInset = "false";
|
|
18629
18729
|
/**
|
|
18630
18730
|
* @internal
|
|
18631
18731
|
*/
|
|
@@ -18635,7 +18735,7 @@ class Tooltip$1 extends FoundationElement {
|
|
|
18635
18735
|
* @internal
|
|
18636
18736
|
*/
|
|
18637
18737
|
|
|
18638
|
-
this.horizontalScaling = "
|
|
18738
|
+
this.horizontalScaling = "content";
|
|
18639
18739
|
/**
|
|
18640
18740
|
* @internal
|
|
18641
18741
|
*/
|
|
@@ -18663,7 +18763,7 @@ class Tooltip$1 extends FoundationElement {
|
|
|
18663
18763
|
* @internal
|
|
18664
18764
|
*/
|
|
18665
18765
|
|
|
18666
|
-
this.currentDirection = Direction
|
|
18766
|
+
this.currentDirection = Direction.ltr;
|
|
18667
18767
|
/**
|
|
18668
18768
|
* The timer that tracks delay time before the tooltip is shown on hover
|
|
18669
18769
|
*/
|
|
@@ -18685,10 +18785,12 @@ class Tooltip$1 extends FoundationElement {
|
|
|
18685
18785
|
this.classList.toggle("bottom", this.region.verticalPosition === "end");
|
|
18686
18786
|
this.classList.toggle("inset-top", this.region.verticalPosition === "insetStart");
|
|
18687
18787
|
this.classList.toggle("inset-bottom", this.region.verticalPosition === "insetEnd");
|
|
18788
|
+
this.classList.toggle("center-vertical", this.region.verticalPosition === "center");
|
|
18688
18789
|
this.classList.toggle("left", this.region.horizontalPosition === "start");
|
|
18689
18790
|
this.classList.toggle("right", this.region.horizontalPosition === "end");
|
|
18690
18791
|
this.classList.toggle("inset-left", this.region.horizontalPosition === "insetStart");
|
|
18691
18792
|
this.classList.toggle("inset-right", this.region.horizontalPosition === "insetEnd");
|
|
18793
|
+
this.classList.toggle("center-horizontal", this.region.horizontalPosition === "center");
|
|
18692
18794
|
};
|
|
18693
18795
|
/**
|
|
18694
18796
|
* mouse enters anchor
|
|
@@ -18948,38 +19050,26 @@ class Tooltip$1 extends FoundationElement {
|
|
|
18948
19050
|
case TooltipPosition.top:
|
|
18949
19051
|
case TooltipPosition.bottom:
|
|
18950
19052
|
this.verticalPositioningMode = "locktodefault";
|
|
18951
|
-
this.horizontalPositioningMode = "
|
|
19053
|
+
this.horizontalPositioningMode = "locktodefault";
|
|
18952
19054
|
this.verticalDefaultPosition = this.position;
|
|
18953
|
-
this.horizontalDefaultPosition =
|
|
18954
|
-
this.horizontalInset = "true";
|
|
18955
|
-
this.verticalInset = "false";
|
|
18956
|
-
this.horizontalScaling = "anchor";
|
|
18957
|
-
this.verticalScaling = "content";
|
|
19055
|
+
this.horizontalDefaultPosition = "center";
|
|
18958
19056
|
break;
|
|
18959
19057
|
|
|
18960
19058
|
case TooltipPosition.right:
|
|
18961
19059
|
case TooltipPosition.left:
|
|
18962
19060
|
case TooltipPosition.start:
|
|
18963
19061
|
case TooltipPosition.end:
|
|
18964
|
-
this.verticalPositioningMode = "
|
|
19062
|
+
this.verticalPositioningMode = "locktodefault";
|
|
18965
19063
|
this.horizontalPositioningMode = "locktodefault";
|
|
18966
|
-
this.verticalDefaultPosition =
|
|
19064
|
+
this.verticalDefaultPosition = "center";
|
|
18967
19065
|
this.horizontalDefaultPosition = this.position;
|
|
18968
|
-
this.horizontalInset = "false";
|
|
18969
|
-
this.verticalInset = "true";
|
|
18970
|
-
this.horizontalScaling = "content";
|
|
18971
|
-
this.verticalScaling = "anchor";
|
|
18972
19066
|
break;
|
|
18973
19067
|
|
|
18974
19068
|
default:
|
|
18975
19069
|
this.verticalPositioningMode = "dynamic";
|
|
18976
19070
|
this.horizontalPositioningMode = "dynamic";
|
|
18977
|
-
this.verticalDefaultPosition =
|
|
18978
|
-
this.horizontalDefaultPosition =
|
|
18979
|
-
this.horizontalInset = "true";
|
|
18980
|
-
this.verticalInset = "false";
|
|
18981
|
-
this.horizontalScaling = "anchor";
|
|
18982
|
-
this.verticalScaling = "content";
|
|
19071
|
+
this.verticalDefaultPosition = void 0;
|
|
19072
|
+
this.horizontalDefaultPosition = "center";
|
|
18983
19073
|
break;
|
|
18984
19074
|
}
|
|
18985
19075
|
}
|
|
@@ -19435,38 +19525,6 @@ __decorate$1([observable], TreeView.prototype, "nested", void 0);
|
|
|
19435
19525
|
|
|
19436
19526
|
__decorate$1([observable], TreeView.prototype, "slottedTreeItems", void 0);
|
|
19437
19527
|
|
|
19438
|
-
/**
|
|
19439
|
-
* Expose ltr and rtl strings
|
|
19440
|
-
*/
|
|
19441
|
-
var Direction;
|
|
19442
|
-
|
|
19443
|
-
(function (Direction) {
|
|
19444
|
-
Direction["ltr"] = "ltr";
|
|
19445
|
-
Direction["rtl"] = "rtl";
|
|
19446
|
-
})(Direction || (Direction = {}));
|
|
19447
|
-
|
|
19448
|
-
/**
|
|
19449
|
-
* Define system colors for use in CSS stylesheets.
|
|
19450
|
-
*
|
|
19451
|
-
* https://drafts.csswg.org/css-color/#css-system-colors
|
|
19452
|
-
*/
|
|
19453
|
-
var SystemColors;
|
|
19454
|
-
|
|
19455
|
-
(function (SystemColors) {
|
|
19456
|
-
SystemColors["Canvas"] = "Canvas";
|
|
19457
|
-
SystemColors["CanvasText"] = "CanvasText";
|
|
19458
|
-
SystemColors["LinkText"] = "LinkText";
|
|
19459
|
-
SystemColors["VisitedText"] = "VisitedText";
|
|
19460
|
-
SystemColors["ActiveText"] = "ActiveText";
|
|
19461
|
-
SystemColors["ButtonFace"] = "ButtonFace";
|
|
19462
|
-
SystemColors["ButtonText"] = "ButtonText";
|
|
19463
|
-
SystemColors["Field"] = "Field";
|
|
19464
|
-
SystemColors["FieldText"] = "FieldText";
|
|
19465
|
-
SystemColors["Highlight"] = "Highlight";
|
|
19466
|
-
SystemColors["HighlightText"] = "HighlightText";
|
|
19467
|
-
SystemColors["GrayText"] = "GrayText";
|
|
19468
|
-
})(SystemColors || (SystemColors = {}));
|
|
19469
|
-
|
|
19470
19528
|
/**
|
|
19471
19529
|
* Ensures that an input number does not exceed a max value and is not less than a min value.
|
|
19472
19530
|
* @param i - the number to clamp
|