@fluentui/web-components 3.0.0-beta.76 → 3.0.0-beta.78
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.md +22 -2
- package/dist/dts/dropdown/define.d.ts +1 -0
- package/dist/dts/dropdown/dropdown.d.ts +492 -0
- package/dist/dts/dropdown/dropdown.definition.d.ts +9 -0
- package/dist/dts/dropdown/dropdown.options.d.ts +53 -0
- package/dist/dts/dropdown/dropdown.styles.d.ts +6 -0
- package/dist/dts/dropdown/dropdown.template.d.ts +38 -0
- package/dist/dts/dropdown/index.d.ts +5 -0
- package/dist/dts/index-rollup.d.ts +3 -0
- package/dist/dts/index.d.ts +3 -0
- package/dist/dts/listbox/define.d.ts +1 -0
- package/dist/dts/listbox/index.d.ts +5 -0
- package/dist/dts/listbox/listbox.d.ts +116 -0
- package/dist/dts/listbox/listbox.definition.d.ts +9 -0
- package/dist/dts/listbox/listbox.options.d.ts +10 -0
- package/dist/dts/listbox/listbox.styles.d.ts +6 -0
- package/dist/dts/listbox/listbox.template.d.ts +17 -0
- package/dist/dts/option/define.d.ts +1 -0
- package/dist/dts/option/index.d.ts +5 -0
- package/dist/dts/option/option.d.ts +260 -0
- package/dist/dts/option/option.definition.d.ts +9 -0
- package/dist/dts/option/option.options.d.ts +20 -0
- package/dist/dts/option/option.styles.d.ts +6 -0
- package/dist/dts/option/option.template.d.ts +16 -0
- package/dist/dts/patterns/start-end.d.ts +16 -2
- package/dist/dts/styles/states/index.d.ts +34 -0
- package/dist/dts/utils/element-internals.d.ts +3 -6
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/language.d.ts +9 -0
- package/dist/dts/utils/support.d.ts +15 -0
- package/dist/dts/utils/unique-id.d.ts +9 -0
- package/dist/esm/accordion/accordion.js +2 -3
- package/dist/esm/accordion/accordion.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.js +2 -4
- package/dist/esm/anchor-button/anchor-button.js.map +1 -1
- package/dist/esm/avatar/avatar.js +11 -12
- package/dist/esm/avatar/avatar.js.map +1 -1
- package/dist/esm/button/button.js +19 -23
- package/dist/esm/button/button.js.map +1 -1
- package/dist/esm/button/button.template.js +1 -1
- package/dist/esm/button/button.template.js.map +1 -1
- package/dist/esm/checkbox/checkbox.js +10 -11
- package/dist/esm/checkbox/checkbox.js.map +1 -1
- package/dist/esm/compound-button/compound-button.template.js +1 -1
- package/dist/esm/compound-button/compound-button.template.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.js +1 -2
- package/dist/esm/counter-badge/counter-badge.js.map +1 -1
- package/dist/esm/dialog-body/dialog-body.template.js +2 -2
- package/dist/esm/dialog-body/dialog-body.template.js.map +1 -1
- package/dist/esm/divider/divider.js +4 -5
- package/dist/esm/divider/divider.js.map +1 -1
- package/dist/esm/dropdown/define.js +4 -0
- package/dist/esm/dropdown/define.js.map +1 -0
- package/dist/esm/dropdown/dropdown.definition.js +20 -0
- package/dist/esm/dropdown/dropdown.definition.js.map +1 -0
- package/dist/esm/dropdown/dropdown.js +779 -0
- package/dist/esm/dropdown/dropdown.js.map +1 -0
- package/dist/esm/dropdown/dropdown.options.js +43 -0
- package/dist/esm/dropdown/dropdown.options.js.map +1 -0
- package/dist/esm/dropdown/dropdown.styles.js +213 -0
- package/dist/esm/dropdown/dropdown.styles.js.map +1 -0
- package/dist/esm/dropdown/dropdown.template.js +92 -0
- package/dist/esm/dropdown/dropdown.template.js.map +1 -0
- package/dist/esm/dropdown/index.js +6 -0
- package/dist/esm/dropdown/index.js.map +1 -0
- package/dist/esm/field/field.js +3 -4
- package/dist/esm/field/field.js.map +1 -1
- package/dist/esm/form-associated/form-associated.js +3 -5
- package/dist/esm/form-associated/form-associated.js.map +1 -1
- package/dist/esm/index-rollup.js +3 -0
- package/dist/esm/index-rollup.js.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/listbox/define.js +4 -0
- package/dist/esm/listbox/define.js.map +1 -0
- package/dist/esm/listbox/index.js +6 -0
- package/dist/esm/listbox/index.js.map +1 -0
- package/dist/esm/listbox/listbox.definition.js +17 -0
- package/dist/esm/listbox/listbox.definition.js.map +1 -0
- package/dist/esm/listbox/listbox.js +175 -0
- package/dist/esm/listbox/listbox.js.map +1 -0
- package/dist/esm/listbox/listbox.options.js +15 -0
- package/dist/esm/listbox/listbox.options.js.map +1 -0
- package/dist/esm/listbox/listbox.styles.js +26 -0
- package/dist/esm/listbox/listbox.styles.js.map +1 -0
- package/dist/esm/listbox/listbox.template.js +33 -0
- package/dist/esm/listbox/listbox.template.js.map +1 -0
- package/dist/esm/menu/menu.js +23 -32
- package/dist/esm/menu/menu.js.map +1 -1
- package/dist/esm/menu-item/menu-item.js +9 -14
- package/dist/esm/menu-item/menu-item.js.map +1 -1
- package/dist/esm/menu-list/menu-list.js +4 -5
- package/dist/esm/menu-list/menu-list.js.map +1 -1
- package/dist/esm/option/define.js +4 -0
- package/dist/esm/option/define.js.map +1 -0
- package/dist/esm/option/index.js +6 -0
- package/dist/esm/option/index.js.map +1 -0
- package/dist/esm/option/option.definition.js +17 -0
- package/dist/esm/option/option.definition.js.map +1 -0
- package/dist/esm/option/option.js +296 -0
- package/dist/esm/option/option.js.map +1 -0
- package/dist/esm/option/option.options.js +15 -0
- package/dist/esm/option/option.options.js.map +1 -0
- package/dist/esm/option/option.styles.js +127 -0
- package/dist/esm/option/option.styles.js.map +1 -0
- package/dist/esm/option/option.template.js +42 -0
- package/dist/esm/option/option.template.js.map +1 -0
- package/dist/esm/patterns/start-end.js +12 -0
- package/dist/esm/patterns/start-end.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.js +3 -4
- package/dist/esm/progress-bar/progress-bar.js.map +1 -1
- package/dist/esm/radio-group/radio-group.js +27 -38
- package/dist/esm/radio-group/radio-group.js.map +1 -1
- package/dist/esm/rating-display/rating-display.js +7 -13
- package/dist/esm/rating-display/rating-display.js.map +1 -1
- package/dist/esm/slider/slider.js +13 -16
- package/dist/esm/slider/slider.js.map +1 -1
- package/dist/esm/spinner/spinner.styles.js +4 -4
- package/dist/esm/styles/states/index.js +34 -0
- package/dist/esm/styles/states/index.js.map +1 -1
- package/dist/esm/switch/switch.styles.js +4 -0
- package/dist/esm/switch/switch.styles.js.map +1 -1
- package/dist/esm/tablist/tablist.js +5 -7
- package/dist/esm/tablist/tablist.js.map +1 -1
- package/dist/esm/tabs/tabs.js +5 -8
- package/dist/esm/tabs/tabs.js.map +1 -1
- package/dist/esm/text-input/text-input.js +13 -15
- package/dist/esm/text-input/text-input.js.map +1 -1
- package/dist/esm/textarea/textarea.js +20 -29
- package/dist/esm/textarea/textarea.js.map +1 -1
- package/dist/esm/theme/set-theme.js +1 -2
- package/dist/esm/theme/set-theme.js.map +1 -1
- package/dist/esm/tooltip/tooltip.js +13 -18
- package/dist/esm/tooltip/tooltip.js.map +1 -1
- package/dist/esm/utils/direction.js +1 -2
- package/dist/esm/utils/direction.js.map +1 -1
- package/dist/esm/utils/element-internals.js +8 -11
- package/dist/esm/utils/element-internals.js.map +1 -1
- package/dist/esm/utils/get-initials.js +2 -2
- package/dist/esm/utils/get-initials.js.map +1 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/language.js +12 -0
- package/dist/esm/utils/language.js.map +1 -0
- package/dist/esm/utils/support.js +16 -0
- package/dist/esm/utils/support.js.map +1 -0
- package/dist/esm/utils/unique-id.js +14 -0
- package/dist/esm/utils/unique-id.js.map +1 -0
- package/dist/esm/utils/whitespace-filter.js +1 -1
- package/dist/esm/utils/whitespace-filter.js.map +1 -1
- package/dist/web-components.d.ts +1928 -862
- package/dist/web-components.js +1668 -448
- package/dist/web-components.min.js +344 -322
- package/package.json +1 -1
package/dist/web-components.js
CHANGED
|
@@ -4086,78 +4086,78 @@ function limit(min, max, value) {
|
|
|
4086
4086
|
return Math.min(Math.max(value, min), max);
|
|
4087
4087
|
}
|
|
4088
4088
|
|
|
4089
|
-
let uniqueIdCounter = 0;
|
|
4089
|
+
let uniqueIdCounter$1 = 0;
|
|
4090
4090
|
/**
|
|
4091
4091
|
* Generates a unique ID based on incrementing a counter.
|
|
4092
4092
|
*/
|
|
4093
|
-
function uniqueId(prefix = "") {
|
|
4094
|
-
return `${prefix}${uniqueIdCounter++}`;
|
|
4093
|
+
function uniqueId$1(prefix = "") {
|
|
4094
|
+
return `${prefix}${uniqueIdCounter$1++}`;
|
|
4095
4095
|
}
|
|
4096
4096
|
|
|
4097
|
-
var __defProp$
|
|
4098
|
-
var __getOwnPropDesc$
|
|
4099
|
-
var __decorateClass$
|
|
4100
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4097
|
+
var __defProp$A = Object.defineProperty;
|
|
4098
|
+
var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
|
|
4099
|
+
var __decorateClass$A = (decorators, target, key, kind) => {
|
|
4100
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
|
|
4101
4101
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4102
|
-
if (kind && result) __defProp$
|
|
4102
|
+
if (kind && result) __defProp$A(target, key, result);
|
|
4103
4103
|
return result;
|
|
4104
4104
|
};
|
|
4105
4105
|
class ARIAGlobalStatesAndProperties {}
|
|
4106
|
-
__decorateClass$
|
|
4106
|
+
__decorateClass$A([attr({
|
|
4107
4107
|
attribute: "aria-atomic"
|
|
4108
4108
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", 2);
|
|
4109
|
-
__decorateClass$
|
|
4109
|
+
__decorateClass$A([attr({
|
|
4110
4110
|
attribute: "aria-busy"
|
|
4111
4111
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", 2);
|
|
4112
|
-
__decorateClass$
|
|
4112
|
+
__decorateClass$A([attr({
|
|
4113
4113
|
attribute: "aria-controls"
|
|
4114
4114
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaControls", 2);
|
|
4115
|
-
__decorateClass$
|
|
4115
|
+
__decorateClass$A([attr({
|
|
4116
4116
|
attribute: "aria-current"
|
|
4117
4117
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", 2);
|
|
4118
|
-
__decorateClass$
|
|
4118
|
+
__decorateClass$A([attr({
|
|
4119
4119
|
attribute: "aria-describedby"
|
|
4120
4120
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", 2);
|
|
4121
|
-
__decorateClass$
|
|
4121
|
+
__decorateClass$A([attr({
|
|
4122
4122
|
attribute: "aria-details"
|
|
4123
4123
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", 2);
|
|
4124
|
-
__decorateClass$
|
|
4124
|
+
__decorateClass$A([attr({
|
|
4125
4125
|
attribute: "aria-disabled"
|
|
4126
4126
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", 2);
|
|
4127
|
-
__decorateClass$
|
|
4127
|
+
__decorateClass$A([attr({
|
|
4128
4128
|
attribute: "aria-errormessage"
|
|
4129
4129
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", 2);
|
|
4130
|
-
__decorateClass$
|
|
4130
|
+
__decorateClass$A([attr({
|
|
4131
4131
|
attribute: "aria-flowto"
|
|
4132
4132
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", 2);
|
|
4133
|
-
__decorateClass$
|
|
4133
|
+
__decorateClass$A([attr({
|
|
4134
4134
|
attribute: "aria-haspopup"
|
|
4135
4135
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", 2);
|
|
4136
|
-
__decorateClass$
|
|
4136
|
+
__decorateClass$A([attr({
|
|
4137
4137
|
attribute: "aria-hidden"
|
|
4138
4138
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", 2);
|
|
4139
|
-
__decorateClass$
|
|
4139
|
+
__decorateClass$A([attr({
|
|
4140
4140
|
attribute: "aria-invalid"
|
|
4141
4141
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", 2);
|
|
4142
|
-
__decorateClass$
|
|
4142
|
+
__decorateClass$A([attr({
|
|
4143
4143
|
attribute: "aria-keyshortcuts"
|
|
4144
4144
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", 2);
|
|
4145
|
-
__decorateClass$
|
|
4145
|
+
__decorateClass$A([attr({
|
|
4146
4146
|
attribute: "aria-label"
|
|
4147
4147
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", 2);
|
|
4148
|
-
__decorateClass$
|
|
4148
|
+
__decorateClass$A([attr({
|
|
4149
4149
|
attribute: "aria-labelledby"
|
|
4150
4150
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", 2);
|
|
4151
|
-
__decorateClass$
|
|
4151
|
+
__decorateClass$A([attr({
|
|
4152
4152
|
attribute: "aria-live"
|
|
4153
4153
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaLive", 2);
|
|
4154
|
-
__decorateClass$
|
|
4154
|
+
__decorateClass$A([attr({
|
|
4155
4155
|
attribute: "aria-owns"
|
|
4156
4156
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", 2);
|
|
4157
|
-
__decorateClass$
|
|
4157
|
+
__decorateClass$A([attr({
|
|
4158
4158
|
attribute: "aria-relevant"
|
|
4159
4159
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", 2);
|
|
4160
|
-
__decorateClass$
|
|
4160
|
+
__decorateClass$A([attr({
|
|
4161
4161
|
attribute: "aria-roledescription"
|
|
4162
4162
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", 2);
|
|
4163
4163
|
|
|
@@ -4315,6 +4315,10 @@ const forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.
|
|
|
4315
4315
|
MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: dark)"));
|
|
4316
4316
|
MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: light)"));
|
|
4317
4317
|
|
|
4318
|
+
const AnchorPositioningCSSSupported = CSS.supports("anchor-name: --a");
|
|
4319
|
+
const AnchorPositioningHTMLSupported = "anchor" in HTMLElement.prototype;
|
|
4320
|
+
const CustomStatesSetSupported = CSS.supports("selector(:state(g))");
|
|
4321
|
+
|
|
4318
4322
|
class StartEnd {}
|
|
4319
4323
|
function endSlotTemplate(options) {
|
|
4320
4324
|
return html`<slot name="end" ${ref("end")}>${staticallyCompose(options.end)}</slot>`.inline();
|
|
@@ -4337,13 +4341,12 @@ function applyMixins(derivedCtor, ...baseCtors) {
|
|
|
4337
4341
|
});
|
|
4338
4342
|
}
|
|
4339
4343
|
|
|
4340
|
-
const CustomStatesSetSupported = CSS.supports("selector(:state(g))");
|
|
4341
4344
|
const statesMap = /* @__PURE__ */new Map();
|
|
4342
4345
|
function stateSelector(state) {
|
|
4343
4346
|
return statesMap.get(state) ?? statesMap.set(state, CustomStatesSetSupported ? `:state(${state})` : `[state--${state}]`).get(state);
|
|
4344
4347
|
}
|
|
4345
4348
|
function toggleState(elementInternals, state, force) {
|
|
4346
|
-
if (!state) {
|
|
4349
|
+
if (!state || !elementInternals) {
|
|
4347
4350
|
return;
|
|
4348
4351
|
}
|
|
4349
4352
|
if (!CustomStatesSetSupported) {
|
|
@@ -4386,12 +4389,12 @@ const AccordionItemMarkerPosition = {
|
|
|
4386
4389
|
end: "end"
|
|
4387
4390
|
};
|
|
4388
4391
|
|
|
4389
|
-
var __defProp$
|
|
4390
|
-
var __getOwnPropDesc$
|
|
4391
|
-
var __decorateClass$
|
|
4392
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4392
|
+
var __defProp$z = Object.defineProperty;
|
|
4393
|
+
var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
|
|
4394
|
+
var __decorateClass$z = (decorators, target, key, kind) => {
|
|
4395
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
|
|
4393
4396
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4394
|
-
if (kind && result) __defProp$
|
|
4397
|
+
if (kind && result) __defProp$z(target, key, result);
|
|
4395
4398
|
return result;
|
|
4396
4399
|
};
|
|
4397
4400
|
class BaseAccordionItem extends FASTElement {
|
|
@@ -4406,7 +4409,7 @@ class BaseAccordionItem extends FASTElement {
|
|
|
4406
4409
|
this.headinglevel = 2;
|
|
4407
4410
|
this.expanded = false;
|
|
4408
4411
|
this.disabled = false;
|
|
4409
|
-
this.id = uniqueId("accordion-");
|
|
4412
|
+
this.id = uniqueId$1("accordion-");
|
|
4410
4413
|
}
|
|
4411
4414
|
/**
|
|
4412
4415
|
* Handles expanded changes
|
|
@@ -4425,18 +4428,18 @@ class BaseAccordionItem extends FASTElement {
|
|
|
4425
4428
|
toggleState(this.elementInternals, "disabled", next);
|
|
4426
4429
|
}
|
|
4427
4430
|
}
|
|
4428
|
-
__decorateClass$
|
|
4431
|
+
__decorateClass$z([attr({
|
|
4429
4432
|
attribute: "heading-level",
|
|
4430
4433
|
mode: "fromView",
|
|
4431
4434
|
converter: nullableNumberConverter
|
|
4432
4435
|
})], BaseAccordionItem.prototype, "headinglevel", 2);
|
|
4433
|
-
__decorateClass$
|
|
4436
|
+
__decorateClass$z([attr({
|
|
4434
4437
|
mode: "boolean"
|
|
4435
4438
|
})], BaseAccordionItem.prototype, "expanded", 2);
|
|
4436
|
-
__decorateClass$
|
|
4439
|
+
__decorateClass$z([attr({
|
|
4437
4440
|
mode: "boolean"
|
|
4438
4441
|
})], BaseAccordionItem.prototype, "disabled", 2);
|
|
4439
|
-
__decorateClass$
|
|
4442
|
+
__decorateClass$z([attr], BaseAccordionItem.prototype, "id", 2);
|
|
4440
4443
|
class AccordionItem extends BaseAccordionItem {
|
|
4441
4444
|
constructor() {
|
|
4442
4445
|
super(...arguments);
|
|
@@ -4467,15 +4470,16 @@ class AccordionItem extends BaseAccordionItem {
|
|
|
4467
4470
|
toggleState(this.elementInternals, "block", next);
|
|
4468
4471
|
}
|
|
4469
4472
|
}
|
|
4470
|
-
__decorateClass$
|
|
4471
|
-
__decorateClass$
|
|
4473
|
+
__decorateClass$z([attr], AccordionItem.prototype, "size", 2);
|
|
4474
|
+
__decorateClass$z([attr({
|
|
4472
4475
|
attribute: "marker-position"
|
|
4473
4476
|
})], AccordionItem.prototype, "markerPosition", 2);
|
|
4474
|
-
__decorateClass$
|
|
4477
|
+
__decorateClass$z([attr({
|
|
4475
4478
|
mode: "boolean"
|
|
4476
4479
|
})], AccordionItem.prototype, "block", 2);
|
|
4477
4480
|
applyMixins(AccordionItem, StartEnd);
|
|
4478
4481
|
|
|
4482
|
+
const activeState = stateSelector("active");
|
|
4479
4483
|
const alignEndState = stateSelector("align-end");
|
|
4480
4484
|
const alignStartState = stateSelector("align-start");
|
|
4481
4485
|
const anchorState = stateSelector("anchor");
|
|
@@ -4498,6 +4502,7 @@ const customErrorState = stateSelector("custom-error");
|
|
|
4498
4502
|
const dangerState = stateSelector("danger");
|
|
4499
4503
|
const darkGreenState = stateSelector("dark-green");
|
|
4500
4504
|
const darkRedState = stateSelector("dark-red");
|
|
4505
|
+
const descriptionState = stateSelector("description");
|
|
4501
4506
|
const disabledState = stateSelector("disabled");
|
|
4502
4507
|
const displayShadowState = stateSelector("display-shadow");
|
|
4503
4508
|
const dotState = stateSelector("dot");
|
|
@@ -4512,6 +4517,7 @@ const fitCenterState = stateSelector("fit-center");
|
|
|
4512
4517
|
const fitContainState = stateSelector("fit-contain");
|
|
4513
4518
|
const fitCoverState = stateSelector("fit-cover");
|
|
4514
4519
|
const fitNoneState = stateSelector("fit-none");
|
|
4520
|
+
const flipBlockState = stateSelector("flip-block");
|
|
4515
4521
|
const focusVisibleState = stateSelector("focus-visible");
|
|
4516
4522
|
const forestState = stateSelector("forest");
|
|
4517
4523
|
const ghostState = stateSelector("ghost");
|
|
@@ -4538,14 +4544,17 @@ const mediumState = stateSelector("medium");
|
|
|
4538
4544
|
const minkState = stateSelector("mink");
|
|
4539
4545
|
const monospaceState = stateSelector("monospace");
|
|
4540
4546
|
const multiLineState = stateSelector("multiline");
|
|
4547
|
+
const multipleState = stateSelector("multiple");
|
|
4541
4548
|
const navyState = stateSelector("navy");
|
|
4542
4549
|
const neutralState = stateSelector("neutral");
|
|
4543
4550
|
const nowrapState = stateSelector("nowrap");
|
|
4544
4551
|
const numericState = stateSelector("numeric");
|
|
4552
|
+
const openState = stateSelector("open");
|
|
4545
4553
|
const outlineState = stateSelector("outline");
|
|
4546
4554
|
const patternMismatchState = stateSelector("pattern-mismatch");
|
|
4547
4555
|
const peachState = stateSelector("peach");
|
|
4548
4556
|
const pinkState = stateSelector("pink");
|
|
4557
|
+
const placeholderShownState = stateSelector("placeholder-shown");
|
|
4549
4558
|
const platinumState = stateSelector("platinum");
|
|
4550
4559
|
const plumState = stateSelector("plum");
|
|
4551
4560
|
const pressedState = stateSelector("pressed");
|
|
@@ -4561,6 +4570,7 @@ const resizeVerticalState = stateSelector("resize-vertical");
|
|
|
4561
4570
|
const roundedState = stateSelector("rounded");
|
|
4562
4571
|
const royalBlueState = stateSelector("royal-blue");
|
|
4563
4572
|
const seafoamState = stateSelector("seafoam");
|
|
4573
|
+
const selectedState = stateSelector("selected");
|
|
4564
4574
|
const semiboldState = stateSelector("semibold");
|
|
4565
4575
|
const severeState = stateSelector("severe");
|
|
4566
4576
|
const shadowState = stateSelector("shadow");
|
|
@@ -4837,7 +4847,7 @@ const curveEasyEaseMax = "var(--curveEasyEaseMax)";
|
|
|
4837
4847
|
const curveEasyEase = "var(--curveEasyEase)";
|
|
4838
4848
|
const curveLinear = "var(--curveLinear)";
|
|
4839
4849
|
|
|
4840
|
-
const styles$
|
|
4850
|
+
const styles$E = css`
|
|
4841
4851
|
${display("block")}
|
|
4842
4852
|
|
|
4843
4853
|
:host{max-width:fit-content;contain:content}.heading{height:44px;display:grid;position:relative;padding-inline:${spacingHorizontalM} ${spacingHorizontalMNudge};border-radius:${borderRadiusMedium};font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};grid-template-columns:auto auto 1fr auto}.button{appearance:none;background:${colorTransparentBackground};border:none;box-sizing:border-box;color:${colorNeutralForeground1};cursor:pointer;font:inherit;grid-column:auto / span 2;grid-row:1;height:44px;outline:none;padding:0;text-align:start}.button::before{content:'';position:absolute;inset:0px;cursor:pointer;border-radius:${borderRadiusSmall}}:where(.default-marker-collapsed,.default-marker-expanded),::slotted(:is([slot='marker-collapsed'],[slot='marker-expanded'])){display:flex;align-items:center;justify-content:center;pointer-events:none;position:relative;height:100%;padding-inline-end:${spacingHorizontalS};grid-column:1 / span 1;grid-row:1}.content{margin:0 ${spacingHorizontalM}}::slotted([slot='start']){display:flex;justify-content:center;align-items:center;padding-right:${spacingHorizontalS};grid-column:2 / span 1;grid-row:1}button:focus-visible::after{content:'';position:absolute;inset:0px;cursor:pointer;border-radius:${borderRadiusSmall};outline:none;border:2px solid ${colorStrokeFocus1};box-shadow:inset 0 0 0 1px ${colorStrokeFocus2}}:host(${disabledState}) .button{color:${colorNeutralForegroundDisabled}}:host(${disabledState}) svg{filter:invert(89%) sepia(0%) saturate(569%) hue-rotate(155deg) brightness(88%) contrast(87%)}:host(${expandedState}) .content{display:block}:host(${expandedState}) .default-marker-collapsed,:host(${expandedState}) ::slotted([slot='marker-collapsed']),:host(:not(${expandedState})) :is(.default-marker-expanded,.content),:host(:not(${expandedState})) ::slotted([slot='marker-expanded']){display:none}:host(${expandedState}) ::slotted([slot='marker-expanded']),:host(:not(${expandedState})) ::slotted([slot='marker-collapsed']){display:flex}.heading{font-size:${fontSizeBase300};line-height:${lineHeightBase300}}:host(${smallState}) .heading{font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host(${largeState}) .heading{font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host(${extraLargeState}) .heading{font-size:${fontSizeBase500};line-height:${lineHeightBase500}}:host(${alignEndState}) :slotted([slot='start']){grid-column:1 / span 1}:host(${alignEndState}) :is(.default-marker-collapsed,.default-marker-expanded){grid-column:4 / span 1;padding-inline-start:${spacingHorizontalS};padding-inline-end:0}:host(${alignEndState}) .button{grid-column:2 / span 3}:host([block]){max-width:100%}:host(${alignEndState}) .heading{grid-template-columns:auto auto 28px;padding-inline:${spacingHorizontalM}}:host(${alignEndState}:has([slot='start'])) .heading{padding-inline:${spacingHorizontalMNudge} ${spacingHorizontalM}}:host(${blockState}${alignEndState}) .heading{grid-template-columns:auto 1fr}:host(${alignEndState}) :is(.default-marker-collapsed,.default-marker-expanded){grid-column:5 / span 1}`;
|
|
@@ -4873,30 +4883,30 @@ const chevronDown20Filled = html.partial(`<svg
|
|
|
4873
4883
|
function accordionItemTemplate(options = {}) {
|
|
4874
4884
|
return html`<div class="heading" part="heading" role="heading" aria-level="${x => x.headinglevel}"><button class="button" part="button" ${ref("expandbutton")} ?disabled="${x => x.disabled ? "true" : void 0}" aria-expanded="${x => x.expanded}" aria-controls="${x => x.id}-panel" id="${x => x.id}"><slot name="heading"></slot></button>${startSlotTemplate(options)}<slot name="marker-expanded">${staticallyCompose(options.expandedIcon)}</slot><slot name="marker-collapsed">${staticallyCompose(options.collapsedIcon)}</slot></div><div class="content" part="content" id="${x => x.id}-panel" role="region" aria-labelledby="${x => x.id}"><slot></slot></div>`;
|
|
4875
4885
|
}
|
|
4876
|
-
const template$
|
|
4886
|
+
const template$F = accordionItemTemplate({
|
|
4877
4887
|
collapsedIcon: chevronRight20Filled,
|
|
4878
4888
|
expandedIcon: chevronDown20Filled
|
|
4879
4889
|
});
|
|
4880
4890
|
|
|
4881
|
-
const definition$
|
|
4891
|
+
const definition$F = AccordionItem.compose({
|
|
4882
4892
|
name: `${FluentDesignSystem.prefix}-accordion-item`,
|
|
4883
|
-
template: template$
|
|
4884
|
-
styles: styles$
|
|
4893
|
+
template: template$F,
|
|
4894
|
+
styles: styles$E
|
|
4885
4895
|
});
|
|
4886
4896
|
|
|
4887
|
-
definition$
|
|
4897
|
+
definition$F.define(FluentDesignSystem.registry);
|
|
4888
4898
|
|
|
4889
4899
|
const AccordionExpandMode = {
|
|
4890
4900
|
single: "single",
|
|
4891
4901
|
multi: "multi"
|
|
4892
4902
|
};
|
|
4893
4903
|
|
|
4894
|
-
var __defProp$
|
|
4895
|
-
var __getOwnPropDesc$
|
|
4896
|
-
var __decorateClass$
|
|
4897
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4904
|
+
var __defProp$y = Object.defineProperty;
|
|
4905
|
+
var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
|
|
4906
|
+
var __decorateClass$y = (decorators, target, key, kind) => {
|
|
4907
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
|
|
4898
4908
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4899
|
-
if (kind && result) __defProp$
|
|
4909
|
+
if (kind && result) __defProp$y(target, key, result);
|
|
4900
4910
|
return result;
|
|
4901
4911
|
};
|
|
4902
4912
|
class Accordion extends FASTElement {
|
|
@@ -5035,12 +5045,12 @@ class Accordion extends FASTElement {
|
|
|
5035
5045
|
});
|
|
5036
5046
|
}
|
|
5037
5047
|
}
|
|
5038
|
-
__decorateClass$
|
|
5048
|
+
__decorateClass$y([attr({
|
|
5039
5049
|
attribute: "expand-mode"
|
|
5040
5050
|
})], Accordion.prototype, "expandmode", 2);
|
|
5041
|
-
__decorateClass$
|
|
5051
|
+
__decorateClass$y([observable], Accordion.prototype, "slottedAccordionItems", 2);
|
|
5042
5052
|
|
|
5043
|
-
const styles$
|
|
5053
|
+
const styles$D = css`
|
|
5044
5054
|
${display("flex")}
|
|
5045
5055
|
|
|
5046
5056
|
:host{flex-direction:column;width:100%;contain:content}`;
|
|
@@ -5051,15 +5061,15 @@ function accordionTemplate() {
|
|
|
5051
5061
|
filter: elements()
|
|
5052
5062
|
})}></slot></template>`;
|
|
5053
5063
|
}
|
|
5054
|
-
const template$
|
|
5064
|
+
const template$E = accordionTemplate();
|
|
5055
5065
|
|
|
5056
|
-
const definition$
|
|
5066
|
+
const definition$E = Accordion.compose({
|
|
5057
5067
|
name: `${FluentDesignSystem.prefix}-accordion`,
|
|
5058
|
-
template: template$
|
|
5059
|
-
styles: styles$
|
|
5068
|
+
template: template$E,
|
|
5069
|
+
styles: styles$D
|
|
5060
5070
|
});
|
|
5061
5071
|
|
|
5062
|
-
definition$
|
|
5072
|
+
definition$E.define(FluentDesignSystem.registry);
|
|
5063
5073
|
|
|
5064
5074
|
const ButtonAppearance = {
|
|
5065
5075
|
primary: "primary",
|
|
@@ -5097,12 +5107,12 @@ const AnchorAttributes = {
|
|
|
5097
5107
|
type: "type"
|
|
5098
5108
|
};
|
|
5099
5109
|
|
|
5100
|
-
var __defProp$
|
|
5101
|
-
var __getOwnPropDesc$
|
|
5102
|
-
var __decorateClass$
|
|
5103
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5110
|
+
var __defProp$x = Object.defineProperty;
|
|
5111
|
+
var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
|
|
5112
|
+
var __decorateClass$x = (decorators, target, key, kind) => {
|
|
5113
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
|
|
5104
5114
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5105
|
-
if (kind && result) __defProp$
|
|
5115
|
+
if (kind && result) __defProp$x(target, key, result);
|
|
5106
5116
|
return result;
|
|
5107
5117
|
};
|
|
5108
5118
|
class BaseAnchor extends FASTElement {
|
|
@@ -5210,14 +5220,14 @@ class BaseAnchor extends FASTElement {
|
|
|
5210
5220
|
return proxy;
|
|
5211
5221
|
}
|
|
5212
5222
|
}
|
|
5213
|
-
__decorateClass$
|
|
5214
|
-
__decorateClass$
|
|
5215
|
-
__decorateClass$
|
|
5216
|
-
__decorateClass$
|
|
5217
|
-
__decorateClass$
|
|
5218
|
-
__decorateClass$
|
|
5219
|
-
__decorateClass$
|
|
5220
|
-
__decorateClass$
|
|
5223
|
+
__decorateClass$x([attr], BaseAnchor.prototype, "download", 2);
|
|
5224
|
+
__decorateClass$x([attr], BaseAnchor.prototype, "href", 2);
|
|
5225
|
+
__decorateClass$x([attr], BaseAnchor.prototype, "hreflang", 2);
|
|
5226
|
+
__decorateClass$x([attr], BaseAnchor.prototype, "ping", 2);
|
|
5227
|
+
__decorateClass$x([attr], BaseAnchor.prototype, "referrerpolicy", 2);
|
|
5228
|
+
__decorateClass$x([attr], BaseAnchor.prototype, "rel", 2);
|
|
5229
|
+
__decorateClass$x([attr], BaseAnchor.prototype, "target", 2);
|
|
5230
|
+
__decorateClass$x([attr], BaseAnchor.prototype, "type", 2);
|
|
5221
5231
|
class AnchorButton extends BaseAnchor {
|
|
5222
5232
|
constructor() {
|
|
5223
5233
|
super(...arguments);
|
|
@@ -5256,10 +5266,10 @@ class AnchorButton extends BaseAnchor {
|
|
|
5256
5266
|
toggleState(this.elementInternals, "icon", !!next);
|
|
5257
5267
|
}
|
|
5258
5268
|
}
|
|
5259
|
-
__decorateClass$
|
|
5260
|
-
__decorateClass$
|
|
5261
|
-
__decorateClass$
|
|
5262
|
-
__decorateClass$
|
|
5269
|
+
__decorateClass$x([attr], AnchorButton.prototype, "appearance", 2);
|
|
5270
|
+
__decorateClass$x([attr], AnchorButton.prototype, "shape", 2);
|
|
5271
|
+
__decorateClass$x([attr], AnchorButton.prototype, "size", 2);
|
|
5272
|
+
__decorateClass$x([attr({
|
|
5263
5273
|
attribute: "icon-only",
|
|
5264
5274
|
mode: "boolean"
|
|
5265
5275
|
})], AnchorButton.prototype, "iconOnly", 2);
|
|
@@ -5269,13 +5279,13 @@ const baseButtonStyles = css`
|
|
|
5269
5279
|
${display("inline-flex")}
|
|
5270
5280
|
|
|
5271
5281
|
:host{--icon-spacing:${spacingHorizontalSNudge};position:relative;contain:layout style;vertical-align:middle;align-items:center;box-sizing:border-box;justify-content:center;text-align:center;text-decoration-line:none;margin:0;min-height:32px;outline-style:none;background-color:${colorNeutralBackground1};color:${colorNeutralForeground1};border:${strokeWidthThin} solid ${colorNeutralStroke1};padding:0 ${spacingHorizontalM};min-width:96px;border-radius:${borderRadiusMedium};font-size:${fontSizeBase300};font-family:${fontFamilyBase};font-weight:${fontWeightSemibold};line-height:${lineHeightBase300};transition-duration:${durationFaster};transition-property:background,border,color;transition-timing-function:${curveEasyEase};cursor:pointer;user-select:none}.content{display:inherit}:host(:hover){background-color:${colorNeutralBackground1Hover};color:${colorNeutralForeground1Hover};border-color:${colorNeutralStroke1Hover}}:host(:hover:active){background-color:${colorNeutralBackground1Pressed};border-color:${colorNeutralStroke1Pressed};color:${colorNeutralForeground1Pressed};outline-style:none}:host(:focus-visible){border-color:${colorTransparentStroke};outline:${strokeWidthThick} solid ${colorTransparentStroke};box-shadow:${shadow4},0 0 0 2px ${colorStrokeFocus2}}@media screen and (prefers-reduced-motion:reduce){:host{transition-duration:0.01ms}}::slotted(svg){font-size:20px;height:20px;width:20px;fill:currentColor}:is([slot='start'],::slotted([slot='start'])){margin-inline-end:var(--icon-spacing)}:is([slot='end'],::slotted([slot='end'])){flex-shrink:0}:host(:not(${iconOnlyState})) :is([slot='end'],:host(:not(${iconOnlyState}))::slotted([slot='end'])){margin-inline-start:var(--icon-spacing)}:host(${iconOnlyState}){min-width:32px;max-width:32px}:host(${smallState}){--icon-spacing:${spacingHorizontalXS};min-height:24px;min-width:64px;padding:0 ${spacingHorizontalS};border-radius:${borderRadiusSmall};font-size:${fontSizeBase200};line-height:${lineHeightBase200};font-weight:${fontWeightRegular}}:host(${smallState}${iconOnlyState}){min-width:24px;max-width:24px}:host(${largeState}){min-height:40px;border-radius:${borderRadiusLarge};padding:0 ${spacingHorizontalL};font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host(${largeState}${iconOnlyState}){min-width:40px;max-width:40px}:host(${largeState}) ::slotted(svg){font-size:24px;height:24px;width:24px}:host(:is(${circularState},${circularState}:focus-visible)){border-radius:${borderRadiusCircular}}:host(:is(${squareState},${squareState}:focus-visible)){border-radius:${borderRadiusNone}}:host(${primaryState}){background-color:${colorBrandBackground};color:${colorNeutralForegroundOnBrand};border-color:transparent}:host(${primaryState}:hover){background-color:${colorBrandBackgroundHover}}:host(${primaryState}:is(:hover,:hover:active)){border-color:transparent;color:${colorNeutralForegroundOnBrand}}:host(${primaryState}:hover:active){background-color:${colorBrandBackgroundPressed}}:host(${primaryState}:focus-visible){border-color:${colorNeutralForegroundOnBrand};box-shadow:${shadow2},0 0 0 2px ${colorStrokeFocus2}}:host(${outlineState}){background-color:${colorTransparentBackground}}:host(${outlineState}:hover){background-color:${colorTransparentBackgroundHover}}:host(${outlineState}:hover:active){background-color:${colorTransparentBackgroundPressed}}:host(${subtleState}){background-color:${colorSubtleBackground};color:${colorNeutralForeground2};border-color:transparent}:host(${subtleState}:hover){background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground2Hover};border-color:transparent}:host(${subtleState}:hover:active){background-color:${colorSubtleBackgroundPressed};color:${colorNeutralForeground2Pressed};border-color:transparent}:host(${subtleState}:hover) ::slotted(svg){fill:${colorNeutralForeground2BrandHover}}:host(${subtleState}:hover:active) ::slotted(svg){fill:${colorNeutralForeground2BrandPressed}}:host(${transparentState}){background-color:${colorTransparentBackground};color:${colorNeutralForeground2}}:host(${transparentState}:hover){background-color:${colorTransparentBackgroundHover};color:${colorNeutralForeground2BrandHover}}:host(${transparentState}:hover:active){background-color:${colorTransparentBackgroundPressed};color:${colorNeutralForeground2BrandPressed}}:host(:is(${transparentState},${transparentState}:is(:hover,:active))){border-color:transparent}`;
|
|
5272
|
-
const styles$
|
|
5282
|
+
const styles$C = css`
|
|
5273
5283
|
${baseButtonStyles}
|
|
5274
5284
|
|
|
5275
5285
|
:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable])),:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable]):hover),:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable]):hover:active){background-color:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled};color:${colorNeutralForegroundDisabled};cursor:not-allowed}:host(${primaryState}:is(:disabled,[disabled-focusable])),:host(${primaryState}:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){border-color:transparent}:host(${outlineState}:is(:disabled,[disabled-focusable])),:host(${outlineState}:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){background-color:${colorTransparentBackground}}:host(${subtleState}:is(:disabled,[disabled-focusable])),:host(${subtleState}:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){background-color:${colorTransparentBackground};border-color:transparent}:host(${transparentState}:is(:disabled,[disabled-focusable])),:host(${transparentState}:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){border-color:transparent;background-color:${colorTransparentBackground}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
5276
5286
|
:host{background-color:ButtonFace;color:ButtonText}:host(:is(:hover,:focus-visible)){border-color:Highlight !important}:host(${primaryState}:not(:is(:hover,:focus-visible))){background-color:Highlight;color:HighlightText;forced-color-adjust:none}:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable])){background-color:ButtonFace;color:GrayText;border-color:ButtonText}`));
|
|
5277
5287
|
|
|
5278
|
-
const styles$
|
|
5288
|
+
const styles$B = css`
|
|
5279
5289
|
${baseButtonStyles}
|
|
5280
5290
|
|
|
5281
5291
|
::slotted(a){position:absolute;inset:0}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
@@ -5284,15 +5294,15 @@ const styles$y = css`
|
|
|
5284
5294
|
function anchorTemplate$1(options = {}) {
|
|
5285
5295
|
return html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}">${startSlotTemplate(options)}<span class="content" part="content"><slot></slot></span>${endSlotTemplate(options)}</template>`;
|
|
5286
5296
|
}
|
|
5287
|
-
const template$
|
|
5297
|
+
const template$D = anchorTemplate$1();
|
|
5288
5298
|
|
|
5289
|
-
const definition$
|
|
5299
|
+
const definition$D = AnchorButton.compose({
|
|
5290
5300
|
name: `${FluentDesignSystem.prefix}-anchor-button`,
|
|
5291
|
-
template: template$
|
|
5292
|
-
styles: styles$
|
|
5301
|
+
template: template$D,
|
|
5302
|
+
styles: styles$B
|
|
5293
5303
|
});
|
|
5294
5304
|
|
|
5295
|
-
definition$
|
|
5305
|
+
definition$D.define(FluentDesignSystem.registry);
|
|
5296
5306
|
|
|
5297
5307
|
const UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
|
|
5298
5308
|
const UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
|
|
@@ -5374,12 +5384,12 @@ const AvatarColor = {
|
|
|
5374
5384
|
...AvatarNamedColor
|
|
5375
5385
|
};
|
|
5376
5386
|
|
|
5377
|
-
var __defProp$
|
|
5378
|
-
var __getOwnPropDesc$
|
|
5379
|
-
var __decorateClass$
|
|
5380
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5387
|
+
var __defProp$w = Object.defineProperty;
|
|
5388
|
+
var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
|
|
5389
|
+
var __decorateClass$w = (decorators, target, key, kind) => {
|
|
5390
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
|
|
5381
5391
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5382
|
-
if (kind && result) __defProp$
|
|
5392
|
+
if (kind && result) __defProp$w(target, key, result);
|
|
5383
5393
|
return result;
|
|
5384
5394
|
};
|
|
5385
5395
|
class BaseAvatar extends FASTElement {
|
|
@@ -5394,9 +5404,9 @@ class BaseAvatar extends FASTElement {
|
|
|
5394
5404
|
this.elementInternals.role = "img";
|
|
5395
5405
|
}
|
|
5396
5406
|
}
|
|
5397
|
-
__decorateClass$
|
|
5398
|
-
__decorateClass$
|
|
5399
|
-
__decorateClass$
|
|
5407
|
+
__decorateClass$w([attr], BaseAvatar.prototype, "name", 2);
|
|
5408
|
+
__decorateClass$w([attr], BaseAvatar.prototype, "initials", 2);
|
|
5409
|
+
__decorateClass$w([attr], BaseAvatar.prototype, "active", 2);
|
|
5400
5410
|
const _Avatar = class _Avatar extends BaseAvatar {
|
|
5401
5411
|
/**
|
|
5402
5412
|
* Handles changes to observable properties
|
|
@@ -5449,13 +5459,13 @@ const _Avatar = class _Avatar extends BaseAvatar {
|
|
|
5449
5459
|
* An array of the available Avatar named colors
|
|
5450
5460
|
*/
|
|
5451
5461
|
_Avatar.colors = Object.values(AvatarNamedColor);
|
|
5452
|
-
__decorateClass$
|
|
5453
|
-
__decorateClass$
|
|
5454
|
-
__decorateClass$
|
|
5462
|
+
__decorateClass$w([attr], _Avatar.prototype, "shape", 2);
|
|
5463
|
+
__decorateClass$w([attr], _Avatar.prototype, "appearance", 2);
|
|
5464
|
+
__decorateClass$w([attr({
|
|
5455
5465
|
converter: nullableNumberConverter
|
|
5456
5466
|
})], _Avatar.prototype, "size", 2);
|
|
5457
|
-
__decorateClass$
|
|
5458
|
-
__decorateClass$
|
|
5467
|
+
__decorateClass$w([attr], _Avatar.prototype, "color", 2);
|
|
5468
|
+
__decorateClass$w([attr({
|
|
5459
5469
|
attribute: "color-id"
|
|
5460
5470
|
})], _Avatar.prototype, "colorId", 2);
|
|
5461
5471
|
let Avatar = _Avatar;
|
|
@@ -5480,22 +5490,22 @@ const animations = {
|
|
|
5480
5490
|
normalEase: curveEasyEase,
|
|
5481
5491
|
nullEasing: curveLinear
|
|
5482
5492
|
};
|
|
5483
|
-
const styles$
|
|
5493
|
+
const styles$A = css`
|
|
5484
5494
|
${display("inline-flex")} :host{position:relative;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;font-family:${fontFamilyBase};font-weight:${fontWeightSemibold};font-size:${fontSizeBase300};border-radius:${borderRadiusCircular};color:${colorNeutralForeground3};background-color:${colorNeutralBackground6};contain:layout style}.default-icon,::slotted(svg){width:20px;height:20px;font-size:20px}::slotted(img){box-sizing:border-box;width:100%;height:100%;border-radius:${borderRadiusCircular}}::slotted([slot='badge']){position:absolute;bottom:0;right:0;box-shadow:0 0 0 ${strokeWidthThin}) ${colorNeutralBackground1}}:host([size='64']) ::slotted([slot='badge']),:host([size='72']) ::slotted([slot='badge']),:host([size='96']) ::slotted([slot='badge']),:host([size='120']) ::slotted([slot='badge']),:host([size='128']) ::slotted([slot='badge']){box-shadow:0 0 0 ${strokeWidthThick}) ${colorNeutralBackground1}}:host([size='16']),:host([size='20']),:host([size='24']){font-size:${fontSizeBase100};font-weight:${fontWeightRegular}}:host([size='16']){width:16px;height:16px}:host([size='20']){width:20px;height:20px}:host([size='24']){width:24px;height:24px}:host([size='16']) .default-icon,:host([size='16']) ::slotted(svg){width:12px;height:12px;font-size:12px}:host([size='20']) .default-icon,:host([size='24']) .default-icon,:host([size='20']) ::slotted(svg),:host([size='24']) ::slotted(svg){width:16px;height:16px;font-size:16px}:host([size='28']){width:28px;height:28px;font-size:${fontSizeBase200}}:host([size='36']){width:36px;height:36px}:host([size='40']){width:40px;height:40px}:host([size='48']),:host([size='56']){font-size:${fontSizeBase400}}:host([size='48']){width:48px;height:48px}:host([size='48']) .default-icon,:host([size='48']) ::slotted(svg){width:24px;height:24px;font-size:24px}:host([size='56']){width:56px;height:56px}:host([size='56']) .default-icon,:host([size='56']) ::slotted(svg){width:28px;height:28px;font-size:28px}:host([size='64']),:host([size='72']),:host([size='96']){font-size:${fontSizeBase500}}:host([size='64']) .default-icon,:host([size='72']) .default-icon,:host([size='64']) ::slotted(svg),:host([size='72']) ::slotted(svg){width:32px;height:32px;font-size:32px}:host([size='64']){width:64px;height:64px}:host([size='72']){width:72px;height:72px}:host([size='96']){width:96px;height:96px}:host([size='96']) .default-icon,:host([size='120']) .default-icon,:host([size='128']) .default-icon,:host([size='96']) ::slotted(svg),:host([size='120']) ::slotted(svg),:host([size='128']) ::slotted(svg){width:48px;height:48px;font-size:48px}:host([size='120']),:host([size='128']){font-size:${fontSizeBase600}}:host([size='120']){width:120px;height:120px}:host([size='128']){width:128px;height:128px}:host([shape='square']){border-radius:${borderRadiusMedium}}:host([shape='square'][size='20']),:host([shape='square'][size='24']){border-radius:${borderRadiusSmall}}:host([shape='square'][size='56']),:host([shape='square'][size='64']),:host([shape='square'][size='72']){border-radius:${borderRadiusLarge}}:host([shape='square'][size='96']),:host([shape='square'][size='120']),:host([shape='square'][size='128']){border-radius:${borderRadiusXLarge}}:host(${brandState}){color:${colorNeutralForegroundStaticInverted};background-color:${colorBrandBackgroundStatic}}:host(${darkRedState}){color:${colorPaletteDarkRedForeground2};background-color:${colorPaletteDarkRedBackground2}}:host(${cranberryState}){color:${colorPaletteCranberryForeground2};background-color:${colorPaletteCranberryBackground2}}:host(${redState}){color:${colorPaletteRedForeground2};background-color:${colorPaletteRedBackground2}}:host(${pumpkinState}){color:${colorPalettePumpkinForeground2};background-color:${colorPalettePumpkinBackground2}}:host(${peachState}){color:${colorPalettePeachForeground2};background-color:${colorPalettePeachBackground2}}:host(${marigoldState}){color:${colorPaletteMarigoldForeground2};background-color:${colorPaletteMarigoldBackground2}}:host(${goldState}){color:${colorPaletteGoldForeground2};background-color:${colorPaletteGoldBackground2}}:host(${brassState}){color:${colorPaletteBrassForeground2};background-color:${colorPaletteBrassBackground2}}:host(${brownState}){color:${colorPaletteBrownForeground2};background-color:${colorPaletteBrownBackground2}}:host(${forestState}){color:${colorPaletteForestForeground2};background-color:${colorPaletteForestBackground2}}:host(${seafoamState}){color:${colorPaletteSeafoamForeground2};background-color:${colorPaletteSeafoamBackground2}}:host(${darkGreenState}){color:${colorPaletteDarkGreenForeground2};background-color:${colorPaletteDarkGreenBackground2}}:host(${lightTealState}){color:${colorPaletteLightTealForeground2};background-color:${colorPaletteLightTealBackground2}}:host(${tealState}){color:${colorPaletteTealForeground2};background-color:${colorPaletteTealBackground2}}:host(${steelState}){color:${colorPaletteSteelForeground2};background-color:${colorPaletteSteelBackground2}}:host(${blueState}){color:${colorPaletteBlueForeground2};background-color:${colorPaletteBlueBackground2}}:host(${royalBlueState}){color:${colorPaletteRoyalBlueForeground2};background-color:${colorPaletteRoyalBlueBackground2}}:host(${cornflowerState}){color:${colorPaletteCornflowerForeground2};background-color:${colorPaletteCornflowerBackground2}}:host(${navyState}){color:${colorPaletteNavyForeground2};background-color:${colorPaletteNavyBackground2}}:host(${lavenderState}){color:${colorPaletteLavenderForeground2};background-color:${colorPaletteLavenderBackground2}}:host(${purpleState}){color:${colorPalettePurpleForeground2};background-color:${colorPalettePurpleBackground2}}:host(${grapeState}){color:${colorPaletteGrapeForeground2};background-color:${colorPaletteGrapeBackground2}}:host(${lilacState}){color:${colorPaletteLilacForeground2};background-color:${colorPaletteLilacBackground2}}:host(${pinkState}){color:${colorPalettePinkForeground2};background-color:${colorPalettePinkBackground2}}:host(${magentaState}){color:${colorPaletteMagentaForeground2};background-color:${colorPaletteMagentaBackground2}}:host(${plumState}){color:${colorPalettePlumForeground2};background-color:${colorPalettePlumBackground2}}:host(${beigeState}){color:${colorPaletteBeigeForeground2};background-color:${colorPaletteBeigeBackground2}}:host(${minkState}){color:${colorPaletteMinkForeground2};background-color:${colorPaletteMinkBackground2}}:host(${platinumState}){color:${colorPalettePlatinumForeground2};background-color:${colorPalettePlatinumBackground2}}:host(${anchorState}){color:${colorPaletteAnchorForeground2};background-color:${colorPaletteAnchorBackground2}}:host([active]){transform:perspective(1px);transition-property:transform,opacity;transition-duration:${durationUltraSlow},${durationFaster};transition-delay:${animations.fastEase},${animations.nullEasing}}:host([active])::before{content:'';position:absolute;top:0;left:0;bottom:0;right:0;border-radius:inherit;transition-property:margin,opacity;transition-duration:${durationUltraSlow}),${durationSlower};transition-delay:${animations.fastEase}),${animations.nullEasing})}:host([active])::before{box-shadow:${shadow8};border-style:solid;border-color:${colorBrandBackgroundStatic}}:host([active][appearance='shadow'])::before{border-style:none;border-color:none}:host([active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThick});border-width:${strokeWidthThick}}:host([size='56'][active]:not([appearance='shadow']))::before,:host([size='64'][active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThicker});border-width:${strokeWidthThicker}}:host([size='72'][active]:not([appearance='shadow']))::before,:host([size='96'][active]:not([appearance='shadow']))::before,:host([size='120'][active]:not([appearance='shadow']))::before,:host([size='128'][active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThickest});border-width:${strokeWidthThickest}}:host([size='20'][active][appearance])::before,:host([size='24'][active][appearance])::before,:host([size='28'][active][appearance])::before{box-shadow:${shadow4}}:host([size='56'][active][appearance])::before,:host([size='64'][active][appearance])::before{box-shadow:${shadow16}}:host([size='72'][active][appearance])::before,:host([size='96'][active][appearance])::before,:host([size='120'][active][appearance])::before,:host([size='128'][active][appearance])::before{box-shadow:${shadow28}}:host([active][appearance='ring'])::before{box-shadow:none}:host([active='inactive']){opacity:0.8;transform:scale(0.875);transition-property:transform,opacity;transition-duration:${durationUltraSlow},${durationFaster};transition-delay:${animations.fastOutSlowInMin},${animations.nullEasing}}:host([active='inactive'])::before{margin:0;opacity:0;transition-property:margin,opacity;transition-duration:${durationUltraSlow},${durationSlower};transition-delay:${animations.fastOutSlowInMin},${animations.nullEasing}}@media screen and (prefers-reduced-motion:reduce){:host([active]){transition-duration:0.01ms}:host([active])::before{transition-duration:0.01ms;transition-delay:0.01ms}}`;
|
|
5485
5495
|
|
|
5486
5496
|
const defaultIconTemplate = html`<svg width="1em" height="1em" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" class="default-icon" fill="currentcolor" aria-hidden="true"><path d="M10 2a4 4 0 100 8 4 4 0 000-8zM7 6a3 3 0 116 0 3 3 0 01-6 0zm-2 5a2 2 0 00-2 2c0 1.7.83 2.97 2.13 3.8A9.14 9.14 0 0010 18c1.85 0 3.58-.39 4.87-1.2A4.35 4.35 0 0017 13a2 2 0 00-2-2H5zm-1 2a1 1 0 011-1h10a1 1 0 011 1c0 1.3-.62 2.28-1.67 2.95A8.16 8.16 0 0110 17a8.16 8.16 0 01-4.33-1.05A3.36 3.36 0 014 13z"></path></svg>`;
|
|
5487
5497
|
function avatarTemplate() {
|
|
5488
5498
|
return html`<slot>${x => x.name || x.initials ? x.generateInitials() : defaultIconTemplate}</slot><slot name="badge"></slot>`;
|
|
5489
5499
|
}
|
|
5490
|
-
const template$
|
|
5500
|
+
const template$C = avatarTemplate();
|
|
5491
5501
|
|
|
5492
|
-
const definition$
|
|
5502
|
+
const definition$C = Avatar.compose({
|
|
5493
5503
|
name: `${FluentDesignSystem.prefix}-avatar`,
|
|
5494
|
-
template: template$
|
|
5495
|
-
styles: styles$
|
|
5504
|
+
template: template$C,
|
|
5505
|
+
styles: styles$A
|
|
5496
5506
|
});
|
|
5497
5507
|
|
|
5498
|
-
definition$
|
|
5508
|
+
definition$C.define(FluentDesignSystem.registry);
|
|
5499
5509
|
|
|
5500
5510
|
const BadgeAppearance = {
|
|
5501
5511
|
filled: "filled",
|
|
@@ -5527,12 +5537,12 @@ const BadgeSize = {
|
|
|
5527
5537
|
extraLarge: "extra-large"
|
|
5528
5538
|
};
|
|
5529
5539
|
|
|
5530
|
-
var __defProp$
|
|
5531
|
-
var __getOwnPropDesc$
|
|
5532
|
-
var __decorateClass$
|
|
5533
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5540
|
+
var __defProp$v = Object.defineProperty;
|
|
5541
|
+
var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
|
|
5542
|
+
var __decorateClass$v = (decorators, target, key, kind) => {
|
|
5543
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
|
|
5534
5544
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5535
|
-
if (kind && result) __defProp$
|
|
5545
|
+
if (kind && result) __defProp$v(target, key, result);
|
|
5536
5546
|
return result;
|
|
5537
5547
|
};
|
|
5538
5548
|
class Badge extends FASTElement {
|
|
@@ -5580,10 +5590,10 @@ class Badge extends FASTElement {
|
|
|
5580
5590
|
swapStates(this.elementInternals, prev, next, BadgeSize);
|
|
5581
5591
|
}
|
|
5582
5592
|
}
|
|
5583
|
-
__decorateClass$
|
|
5584
|
-
__decorateClass$
|
|
5585
|
-
__decorateClass$
|
|
5586
|
-
__decorateClass$
|
|
5593
|
+
__decorateClass$v([attr], Badge.prototype, "appearance", 2);
|
|
5594
|
+
__decorateClass$v([attr], Badge.prototype, "color", 2);
|
|
5595
|
+
__decorateClass$v([attr], Badge.prototype, "shape", 2);
|
|
5596
|
+
__decorateClass$v([attr], Badge.prototype, "size", 2);
|
|
5587
5597
|
applyMixins(Badge, StartEnd);
|
|
5588
5598
|
|
|
5589
5599
|
const badgeBaseStyles = css.partial`
|
|
@@ -5834,7 +5844,7 @@ const badgeTintStyles = css.partial`
|
|
|
5834
5844
|
}
|
|
5835
5845
|
`;
|
|
5836
5846
|
|
|
5837
|
-
css.partial`
|
|
5847
|
+
const typographyBody1Styles = css.partial`
|
|
5838
5848
|
font-family: ${fontFamilyBase};
|
|
5839
5849
|
font-size: ${fontSizeBase300};
|
|
5840
5850
|
line-height: ${lineHeightBase300};
|
|
@@ -5852,13 +5862,13 @@ css.partial`
|
|
|
5852
5862
|
line-height: ${lineHeightBase300};
|
|
5853
5863
|
font-weight: ${fontWeightBold};
|
|
5854
5864
|
`;
|
|
5855
|
-
css.partial`
|
|
5865
|
+
const typographyBody2Styles = css.partial`
|
|
5856
5866
|
font-family: ${fontFamilyBase};
|
|
5857
5867
|
font-size: ${fontSizeBase400};
|
|
5858
5868
|
line-height: ${lineHeightBase400};
|
|
5859
5869
|
font-weight: ${fontWeightRegular};
|
|
5860
5870
|
`;
|
|
5861
|
-
css.partial`
|
|
5871
|
+
const typographyCaption1Styles = css.partial`
|
|
5862
5872
|
font-family: ${fontFamilyBase};
|
|
5863
5873
|
font-size: ${fontSizeBase200};
|
|
5864
5874
|
line-height: ${lineHeightBase200};
|
|
@@ -5937,7 +5947,7 @@ css.partial`
|
|
|
5937
5947
|
font-weight: ${fontWeightSemibold};
|
|
5938
5948
|
`;
|
|
5939
5949
|
|
|
5940
|
-
const styles$
|
|
5950
|
+
const styles$z = css`
|
|
5941
5951
|
:host(${squareState}){border-radius:${borderRadiusNone}}:host(${roundedState}){border-radius:${borderRadiusMedium}}:host(${roundedState}${tinyState}),:host(${roundedState}${extraSmallState}),:host(${roundedState}${smallState}){border-radius:${borderRadiusSmall}}${badgeSizeStyles}
|
|
5942
5952
|
${badgeFilledStyles}
|
|
5943
5953
|
${badgeGhostStyles}
|
|
@@ -5950,22 +5960,22 @@ const styles$w = css`
|
|
|
5950
5960
|
function badgeTemplate(options = {}) {
|
|
5951
5961
|
return html` ${startSlotTemplate(options)}<slot>${staticallyCompose(options.defaultContent)}</slot>${endSlotTemplate(options)} `;
|
|
5952
5962
|
}
|
|
5953
|
-
const template$
|
|
5963
|
+
const template$B = badgeTemplate();
|
|
5954
5964
|
|
|
5955
|
-
const definition$
|
|
5965
|
+
const definition$B = Badge.compose({
|
|
5956
5966
|
name: `${FluentDesignSystem.prefix}-badge`,
|
|
5957
|
-
template: template$
|
|
5958
|
-
styles: styles$
|
|
5967
|
+
template: template$B,
|
|
5968
|
+
styles: styles$z
|
|
5959
5969
|
});
|
|
5960
5970
|
|
|
5961
|
-
definition$
|
|
5971
|
+
definition$B.define(FluentDesignSystem.registry);
|
|
5962
5972
|
|
|
5963
|
-
var __defProp$
|
|
5964
|
-
var __getOwnPropDesc$
|
|
5965
|
-
var __decorateClass$
|
|
5966
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5973
|
+
var __defProp$u = Object.defineProperty;
|
|
5974
|
+
var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
|
|
5975
|
+
var __decorateClass$u = (decorators, target, key, kind) => {
|
|
5976
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
|
|
5967
5977
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5968
|
-
if (kind && result) __defProp$
|
|
5978
|
+
if (kind && result) __defProp$u(target, key, result);
|
|
5969
5979
|
return result;
|
|
5970
5980
|
};
|
|
5971
5981
|
class BaseButton extends FASTElement {
|
|
@@ -6169,44 +6179,44 @@ class BaseButton extends FASTElement {
|
|
|
6169
6179
|
* @public
|
|
6170
6180
|
*/
|
|
6171
6181
|
BaseButton.formAssociated = true;
|
|
6172
|
-
__decorateClass$
|
|
6182
|
+
__decorateClass$u([attr({
|
|
6173
6183
|
mode: "boolean"
|
|
6174
6184
|
})], BaseButton.prototype, "autofocus", 2);
|
|
6175
|
-
__decorateClass$
|
|
6176
|
-
__decorateClass$
|
|
6185
|
+
__decorateClass$u([observable], BaseButton.prototype, "defaultSlottedContent", 2);
|
|
6186
|
+
__decorateClass$u([attr({
|
|
6177
6187
|
mode: "boolean"
|
|
6178
6188
|
})], BaseButton.prototype, "disabled", 2);
|
|
6179
|
-
__decorateClass$
|
|
6189
|
+
__decorateClass$u([attr({
|
|
6180
6190
|
attribute: "disabled-focusable",
|
|
6181
6191
|
mode: "boolean"
|
|
6182
6192
|
})], BaseButton.prototype, "disabledFocusable", 2);
|
|
6183
|
-
__decorateClass$
|
|
6193
|
+
__decorateClass$u([attr({
|
|
6184
6194
|
attribute: "tabindex",
|
|
6185
6195
|
mode: "fromView",
|
|
6186
6196
|
converter: nullableNumberConverter
|
|
6187
6197
|
})], BaseButton.prototype, "tabIndex", 2);
|
|
6188
|
-
__decorateClass$
|
|
6198
|
+
__decorateClass$u([attr({
|
|
6189
6199
|
attribute: "formaction"
|
|
6190
6200
|
})], BaseButton.prototype, "formAction", 2);
|
|
6191
|
-
__decorateClass$
|
|
6201
|
+
__decorateClass$u([attr({
|
|
6192
6202
|
attribute: "form"
|
|
6193
6203
|
})], BaseButton.prototype, "formAttribute", 2);
|
|
6194
|
-
__decorateClass$
|
|
6204
|
+
__decorateClass$u([attr({
|
|
6195
6205
|
attribute: "formenctype"
|
|
6196
6206
|
})], BaseButton.prototype, "formEnctype", 2);
|
|
6197
|
-
__decorateClass$
|
|
6207
|
+
__decorateClass$u([attr({
|
|
6198
6208
|
attribute: "formmethod"
|
|
6199
6209
|
})], BaseButton.prototype, "formMethod", 2);
|
|
6200
|
-
__decorateClass$
|
|
6210
|
+
__decorateClass$u([attr({
|
|
6201
6211
|
attribute: "formnovalidate",
|
|
6202
6212
|
mode: "boolean"
|
|
6203
6213
|
})], BaseButton.prototype, "formNoValidate", 2);
|
|
6204
|
-
__decorateClass$
|
|
6214
|
+
__decorateClass$u([attr({
|
|
6205
6215
|
attribute: "formtarget"
|
|
6206
6216
|
})], BaseButton.prototype, "formTarget", 2);
|
|
6207
|
-
__decorateClass$
|
|
6208
|
-
__decorateClass$
|
|
6209
|
-
__decorateClass$
|
|
6217
|
+
__decorateClass$u([attr], BaseButton.prototype, "name", 2);
|
|
6218
|
+
__decorateClass$u([attr], BaseButton.prototype, "type", 2);
|
|
6219
|
+
__decorateClass$u([attr], BaseButton.prototype, "value", 2);
|
|
6210
6220
|
class Button extends BaseButton {
|
|
6211
6221
|
constructor() {
|
|
6212
6222
|
super(...arguments);
|
|
@@ -6245,10 +6255,10 @@ class Button extends BaseButton {
|
|
|
6245
6255
|
toggleState(this.elementInternals, "icon", next);
|
|
6246
6256
|
}
|
|
6247
6257
|
}
|
|
6248
|
-
__decorateClass$
|
|
6249
|
-
__decorateClass$
|
|
6250
|
-
__decorateClass$
|
|
6251
|
-
__decorateClass$
|
|
6258
|
+
__decorateClass$u([attr], Button.prototype, "appearance", 2);
|
|
6259
|
+
__decorateClass$u([attr], Button.prototype, "shape", 2);
|
|
6260
|
+
__decorateClass$u([attr], Button.prototype, "size", 2);
|
|
6261
|
+
__decorateClass$u([attr({
|
|
6252
6262
|
attribute: "icon-only",
|
|
6253
6263
|
mode: "boolean"
|
|
6254
6264
|
})], Button.prototype, "iconOnly", 2);
|
|
@@ -6257,15 +6267,15 @@ applyMixins(Button, StartEnd);
|
|
|
6257
6267
|
function buttonTemplate$1(options = {}) {
|
|
6258
6268
|
return html`<template tabindex="${x => x.disabled ? null : x.tabIndex ?? 0}" @click="${(x, c) => x.clickHandler(c.event)}" @keypress="${(x, c) => x.keypressHandler(c.event)}">${startSlotTemplate(options)}<span class="content" part="content"><slot ${slotted("defaultSlottedContent")}></slot></span>${endSlotTemplate(options)}</template>`;
|
|
6259
6269
|
}
|
|
6260
|
-
const template$
|
|
6270
|
+
const template$A = buttonTemplate$1();
|
|
6261
6271
|
|
|
6262
|
-
const definition$
|
|
6272
|
+
const definition$A = Button.compose({
|
|
6263
6273
|
name: `${FluentDesignSystem.prefix}-button`,
|
|
6264
|
-
template: template$
|
|
6265
|
-
styles: styles$
|
|
6274
|
+
template: template$A,
|
|
6275
|
+
styles: styles$C
|
|
6266
6276
|
});
|
|
6267
6277
|
|
|
6268
|
-
definition$
|
|
6278
|
+
definition$A.define(FluentDesignSystem.registry);
|
|
6269
6279
|
|
|
6270
6280
|
const CheckboxShape = {
|
|
6271
6281
|
circular: "circular",
|
|
@@ -6276,12 +6286,12 @@ const CheckboxSize = {
|
|
|
6276
6286
|
large: "large"
|
|
6277
6287
|
};
|
|
6278
6288
|
|
|
6279
|
-
var __defProp$
|
|
6280
|
-
var __getOwnPropDesc$
|
|
6281
|
-
var __decorateClass$
|
|
6282
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6289
|
+
var __defProp$t = Object.defineProperty;
|
|
6290
|
+
var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
|
|
6291
|
+
var __decorateClass$t = (decorators, target, key, kind) => {
|
|
6292
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
|
|
6283
6293
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6284
|
-
if (kind && result) __defProp$
|
|
6294
|
+
if (kind && result) __defProp$t(target, key, result);
|
|
6285
6295
|
return result;
|
|
6286
6296
|
};
|
|
6287
6297
|
class BaseCheckbox extends FASTElement {
|
|
@@ -6615,27 +6625,27 @@ class BaseCheckbox extends FASTElement {
|
|
|
6615
6625
|
* @public
|
|
6616
6626
|
*/
|
|
6617
6627
|
BaseCheckbox.formAssociated = true;
|
|
6618
|
-
__decorateClass$
|
|
6628
|
+
__decorateClass$t([attr({
|
|
6619
6629
|
mode: "boolean"
|
|
6620
6630
|
})], BaseCheckbox.prototype, "autofocus", 2);
|
|
6621
|
-
__decorateClass$
|
|
6622
|
-
__decorateClass$
|
|
6631
|
+
__decorateClass$t([observable], BaseCheckbox.prototype, "disabled", 2);
|
|
6632
|
+
__decorateClass$t([attr({
|
|
6623
6633
|
attribute: "disabled",
|
|
6624
6634
|
mode: "boolean"
|
|
6625
6635
|
})], BaseCheckbox.prototype, "disabledAttribute", 2);
|
|
6626
|
-
__decorateClass$
|
|
6636
|
+
__decorateClass$t([attr({
|
|
6627
6637
|
attribute: "form"
|
|
6628
6638
|
})], BaseCheckbox.prototype, "formAttribute", 2);
|
|
6629
|
-
__decorateClass$
|
|
6639
|
+
__decorateClass$t([attr({
|
|
6630
6640
|
attribute: "checked",
|
|
6631
6641
|
mode: "boolean"
|
|
6632
6642
|
})], BaseCheckbox.prototype, "initialChecked", 2);
|
|
6633
|
-
__decorateClass$
|
|
6643
|
+
__decorateClass$t([attr({
|
|
6634
6644
|
attribute: "value",
|
|
6635
6645
|
mode: "fromView"
|
|
6636
6646
|
})], BaseCheckbox.prototype, "initialValue", 2);
|
|
6637
|
-
__decorateClass$
|
|
6638
|
-
__decorateClass$
|
|
6647
|
+
__decorateClass$t([attr], BaseCheckbox.prototype, "name", 2);
|
|
6648
|
+
__decorateClass$t([attr({
|
|
6639
6649
|
mode: "boolean"
|
|
6640
6650
|
})], BaseCheckbox.prototype, "required", 2);
|
|
6641
6651
|
class Checkbox extends BaseCheckbox {
|
|
@@ -6698,17 +6708,17 @@ class Checkbox extends BaseCheckbox {
|
|
|
6698
6708
|
super.toggleChecked(force);
|
|
6699
6709
|
}
|
|
6700
6710
|
}
|
|
6701
|
-
__decorateClass$
|
|
6702
|
-
__decorateClass$
|
|
6703
|
-
__decorateClass$
|
|
6711
|
+
__decorateClass$t([observable], Checkbox.prototype, "indeterminate", 2);
|
|
6712
|
+
__decorateClass$t([attr], Checkbox.prototype, "shape", 2);
|
|
6713
|
+
__decorateClass$t([attr], Checkbox.prototype, "size", 2);
|
|
6704
6714
|
|
|
6705
|
-
const styles$
|
|
6715
|
+
const styles$y = css`
|
|
6706
6716
|
${display("inline-flex")}
|
|
6707
6717
|
|
|
6708
6718
|
:host{--size:16px;background-color:${colorNeutralBackground1};border-radius:${borderRadiusSmall};border:${strokeWidthThin} solid ${colorNeutralStrokeAccessible};box-sizing:border-box;cursor:pointer;position:relative;width:var(--size)}:host,.indeterminate-indicator,.checked-indicator{aspect-ratio:1}:host(:hover){border-color:${colorNeutralStrokeAccessibleHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(${checkedState}:hover){background-color:${colorCompoundBrandBackgroundHover};border-color:${colorCompoundBrandStrokeHover}}:host(${checkedState}:active){background-color:${colorCompoundBrandBackgroundPressed};border-color:${colorCompoundBrandStrokePressed}}:host(:focus-visible){outline:none}:host(:not([slot='input']))::after{content:'';position:absolute;inset:-8px;box-sizing:border-box;outline:none;border:${strokeWidthThick} solid ${colorTransparentStroke};border-radius:${borderRadiusMedium}}:host(:not([slot='input']):focus-visible)::after{border-color:${colorStrokeFocus2}}.indeterminate-indicator,.checked-indicator{color:${colorNeutralForegroundInverted};inset:0;margin:auto;position:absolute}::slotted([slot='checked-indicator']),.checked-indicator{fill:currentColor;display:inline-flex;flex:1 0 auto;width:12px}:host(:not(${checkedState})) *:is(::slotted([slot='checked-indicator']),.checked-indicator){display:none}:host(${checkedState}),:host(${indeterminateState}){border-color:${colorCompoundBrandStroke}}:host(${checkedState}),:host(${indeterminateState}) .indeterminate-indicator{background-color:${colorCompoundBrandBackground}}:host(${indeterminateState}) .indeterminate-indicator{border-radius:${borderRadiusSmall};position:absolute;width:calc(var(--size) / 2);inset:0}:host(${largeState}){--size:20px}:host(${largeState}) ::slotted([slot='checked-indicator']),:host(${largeState}) .checked-indicator{width:16px}:host(${circularState}),:host(${circularState}) .indeterminate-indicator{border-radius:${borderRadiusCircular}}:host([disabled]),:host([disabled]${checkedState}){background-color:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}:host([disabled]){cursor:unset}:host([disabled]${indeterminateState}) .indeterminate-indicator{background-color:${colorNeutralStrokeDisabled}}:host([disabled]${checkedState}) .checked-indicator{color:${colorNeutralStrokeDisabled}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
6709
6719
|
:host{border-color:FieldText}:host(:not([slot='input']:focus-visible))::after{border-color:Canvas}:host(:not([disabled]):hover),:host(${checkedState}:not([disabled]):hover),:host(:not([slot='input']):focus-visible)::after{border-color:Highlight}.indeterminate-indicator,.checked-indicator{color:HighlightText}:host(${checkedState}),:host(${indeterminateState}) .indeterminate-indicator{background-color:FieldText}:host(${checkedState}:not([disabled]):hover),:host(${indeterminateState}:not([disabled]):hover) .indeterminate-indicator{background-color:Highlight}:host([disabled]){border-color:GrayText}:host([disabled]${indeterminateState}) .indeterminate-indicator{background-color:GrayText}:host([disabled]),:host([disabled]${checkedState}) .checked-indicator{color:GrayText}`));
|
|
6710
6720
|
|
|
6711
|
-
const checkedIndicator$
|
|
6721
|
+
const checkedIndicator$2 = html.partial( /* html */
|
|
6712
6722
|
`
|
|
6713
6723
|
<svg
|
|
6714
6724
|
fill="currentColor"
|
|
@@ -6728,23 +6738,23 @@ const indeterminateIndicator = html.partial( /* html */
|
|
|
6728
6738
|
function checkboxTemplate(options = {}) {
|
|
6729
6739
|
return html`<template tabindex="${x => !x.disabled ? 0 : void 0}" @click="${(x, c) => x.clickHandler(c.event)}" @input="${(x, c) => x.inputHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @keyup="${(x, c) => x.keyupHandler(c.event)}"><slot name="checked-indicator">${staticallyCompose(options.checkedIndicator)}</slot><slot name="indeterminate-indicator">${staticallyCompose(options.indeterminateIndicator)}</slot></template>`;
|
|
6730
6740
|
}
|
|
6731
|
-
const template$
|
|
6732
|
-
checkedIndicator: checkedIndicator$
|
|
6741
|
+
const template$z = checkboxTemplate({
|
|
6742
|
+
checkedIndicator: checkedIndicator$2,
|
|
6733
6743
|
indeterminateIndicator
|
|
6734
6744
|
});
|
|
6735
6745
|
|
|
6736
|
-
const definition$
|
|
6746
|
+
const definition$z = Checkbox.compose({
|
|
6737
6747
|
name: `${FluentDesignSystem.prefix}-checkbox`,
|
|
6738
|
-
template: template$
|
|
6739
|
-
styles: styles$
|
|
6748
|
+
template: template$z,
|
|
6749
|
+
styles: styles$y
|
|
6740
6750
|
});
|
|
6741
6751
|
|
|
6742
|
-
definition$
|
|
6752
|
+
definition$z.define(FluentDesignSystem.registry);
|
|
6743
6753
|
|
|
6744
6754
|
class CompoundButton extends Button {}
|
|
6745
6755
|
|
|
6746
|
-
const styles$
|
|
6747
|
-
${styles$
|
|
6756
|
+
const styles$x = css`
|
|
6757
|
+
${styles$C}
|
|
6748
6758
|
|
|
6749
6759
|
:host,:host(:is([size])){gap:12px;height:auto;padding-top:14px;padding-inline:12px;padding-bottom:16px;font-size:${fontSizeBase300};line-height:${lineHeightBase300}}.content{display:flex;flex-direction:column;text-align:start}::slotted([slot='description']){color:${colorNeutralForeground2};line-height:100%;font-size:${fontSizeBase200};font-weight:${fontWeightRegular}}::slotted(svg),:host(${largeState}) ::slotted(svg){font-size:40px;height:40px;width:40px}:host(:hover) ::slotted([slot='description']){color:${colorNeutralForeground2Hover}}:host(:active) ::slotted([slot='description']){color:${colorNeutralForeground2Pressed}}:host(:is(${primaryState},${primaryState}:hover,${primaryState}:active)) ::slotted([slot='description']){color:${colorNeutralForegroundOnBrand}}:host(:is(${subtleState},${subtleState}:hover,${subtleState}:active)) ::slotted([slot='description']),:host(${transparentState}) ::slotted([slot='description']){color:${colorNeutralForeground2}}:host(${transparentState}:hover) ::slotted([slot='description']){color:${colorNeutralForeground2BrandHover}}:host(${transparentState}:active) ::slotted([slot='description']){color:${colorNeutralForeground2BrandPressed}}:host(:is(:disabled,:disabled[appearance],[disabled-focusable],[disabled-focusable][appearance]))
|
|
6750
6760
|
::slotted([slot='description']){color:${colorNeutralForegroundDisabled}}:host(${smallState}){padding:8px;padding-bottom:10px}:host(${iconOnlyState}){min-width:52px;max-width:52px;padding:${spacingHorizontalSNudge}}:host(${iconOnlyState}${smallState}){min-width:48px;max-width:48px;padding:${spacingHorizontalXS}}:host(${iconOnlyState}${largeState}){min-width:56px;max-width:56px;padding:${spacingHorizontalS}}:host(${largeState}){padding-top:18px;padding-inline:16px;padding-bottom:20px;font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host(${largeState}) ::slotted([slot='description']){font-size:${fontSizeBase300}}`;
|
|
@@ -6752,15 +6762,15 @@ const styles$u = css`
|
|
|
6752
6762
|
function buttonTemplate(options = {}) {
|
|
6753
6763
|
return html`<template ?disabled="${x => x.disabled}" tabindex="${x => x.disabled ? null : x.tabIndex ?? 0}">${startSlotTemplate(options)}<span class="content" part="content"><slot ${slotted("defaultSlottedContent")}></slot><slot name="description"></slot></span>${endSlotTemplate(options)}</template>`;
|
|
6754
6764
|
}
|
|
6755
|
-
const template$
|
|
6765
|
+
const template$y = buttonTemplate();
|
|
6756
6766
|
|
|
6757
|
-
const definition$
|
|
6767
|
+
const definition$y = CompoundButton.compose({
|
|
6758
6768
|
name: `${FluentDesignSystem.prefix}-compound-button`,
|
|
6759
|
-
template: template$
|
|
6760
|
-
styles: styles$
|
|
6769
|
+
template: template$y,
|
|
6770
|
+
styles: styles$x
|
|
6761
6771
|
});
|
|
6762
6772
|
|
|
6763
|
-
definition$
|
|
6773
|
+
definition$y.define(FluentDesignSystem.registry);
|
|
6764
6774
|
|
|
6765
6775
|
const CounterBadgeAppearance = {
|
|
6766
6776
|
filled: "filled",
|
|
@@ -6789,12 +6799,12 @@ const CounterBadgeSize = {
|
|
|
6789
6799
|
extraLarge: "extra-large"
|
|
6790
6800
|
};
|
|
6791
6801
|
|
|
6792
|
-
var __defProp$
|
|
6793
|
-
var __getOwnPropDesc$
|
|
6794
|
-
var __decorateClass$
|
|
6795
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6802
|
+
var __defProp$s = Object.defineProperty;
|
|
6803
|
+
var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
|
|
6804
|
+
var __decorateClass$s = (decorators, target, key, kind) => {
|
|
6805
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
|
|
6796
6806
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6797
|
-
if (kind && result) __defProp$
|
|
6807
|
+
if (kind && result) __defProp$s(target, key, result);
|
|
6798
6808
|
return result;
|
|
6799
6809
|
};
|
|
6800
6810
|
class CounterBadge extends FASTElement {
|
|
@@ -6871,27 +6881,27 @@ class CounterBadge extends FASTElement {
|
|
|
6871
6881
|
return;
|
|
6872
6882
|
}
|
|
6873
6883
|
}
|
|
6874
|
-
__decorateClass$
|
|
6875
|
-
__decorateClass$
|
|
6876
|
-
__decorateClass$
|
|
6877
|
-
__decorateClass$
|
|
6878
|
-
__decorateClass$
|
|
6884
|
+
__decorateClass$s([attr], CounterBadge.prototype, "appearance", 2);
|
|
6885
|
+
__decorateClass$s([attr], CounterBadge.prototype, "color", 2);
|
|
6886
|
+
__decorateClass$s([attr], CounterBadge.prototype, "shape", 2);
|
|
6887
|
+
__decorateClass$s([attr], CounterBadge.prototype, "size", 2);
|
|
6888
|
+
__decorateClass$s([attr({
|
|
6879
6889
|
converter: nullableNumberConverter
|
|
6880
6890
|
})], CounterBadge.prototype, "count", 2);
|
|
6881
|
-
__decorateClass$
|
|
6891
|
+
__decorateClass$s([attr({
|
|
6882
6892
|
attribute: "overflow-count",
|
|
6883
6893
|
converter: nullableNumberConverter
|
|
6884
6894
|
})], CounterBadge.prototype, "overflowCount", 2);
|
|
6885
|
-
__decorateClass$
|
|
6895
|
+
__decorateClass$s([attr({
|
|
6886
6896
|
attribute: "show-zero",
|
|
6887
6897
|
mode: "boolean"
|
|
6888
6898
|
})], CounterBadge.prototype, "showZero", 2);
|
|
6889
|
-
__decorateClass$
|
|
6899
|
+
__decorateClass$s([attr({
|
|
6890
6900
|
mode: "boolean"
|
|
6891
6901
|
})], CounterBadge.prototype, "dot", 2);
|
|
6892
6902
|
applyMixins(CounterBadge, StartEnd);
|
|
6893
6903
|
|
|
6894
|
-
const styles$
|
|
6904
|
+
const styles$w = css`
|
|
6895
6905
|
:host(${roundedState}){border-radius:${borderRadiusMedium}}:host(${roundedState}${tinyState}),:host(${roundedState}${extraSmallState}),:host(${roundedState}${smallState}){border-radius:${borderRadiusSmall}}${badgeSizeStyles}
|
|
6896
6906
|
${badgeFilledStyles}
|
|
6897
6907
|
${badgeGhostStyles}
|
|
@@ -6904,15 +6914,15 @@ function composeTemplate(options = {}) {
|
|
|
6904
6914
|
defaultContent: html`${x => x.setCount()}`
|
|
6905
6915
|
});
|
|
6906
6916
|
}
|
|
6907
|
-
const template$
|
|
6917
|
+
const template$x = composeTemplate();
|
|
6908
6918
|
|
|
6909
|
-
const definition$
|
|
6919
|
+
const definition$x = CounterBadge.compose({
|
|
6910
6920
|
name: `${FluentDesignSystem.prefix}-counter-badge`,
|
|
6911
|
-
template: template$
|
|
6912
|
-
styles: styles$
|
|
6921
|
+
template: template$x,
|
|
6922
|
+
styles: styles$w
|
|
6913
6923
|
});
|
|
6914
6924
|
|
|
6915
|
-
definition$
|
|
6925
|
+
definition$x.define(FluentDesignSystem.registry);
|
|
6916
6926
|
|
|
6917
6927
|
const DialogType = {
|
|
6918
6928
|
modal: "modal",
|
|
@@ -6920,12 +6930,12 @@ const DialogType = {
|
|
|
6920
6930
|
alert: "alert"
|
|
6921
6931
|
};
|
|
6922
6932
|
|
|
6923
|
-
var __defProp$
|
|
6924
|
-
var __getOwnPropDesc$
|
|
6925
|
-
var __decorateClass$
|
|
6926
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6933
|
+
var __defProp$r = Object.defineProperty;
|
|
6934
|
+
var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
|
|
6935
|
+
var __decorateClass$r = (decorators, target, key, kind) => {
|
|
6936
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
|
|
6927
6937
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6928
|
-
if (kind && result) __defProp$
|
|
6938
|
+
if (kind && result) __defProp$r(target, key, result);
|
|
6929
6939
|
return result;
|
|
6930
6940
|
};
|
|
6931
6941
|
class Dialog extends FASTElement {
|
|
@@ -6993,35 +7003,35 @@ class Dialog extends FASTElement {
|
|
|
6993
7003
|
return true;
|
|
6994
7004
|
}
|
|
6995
7005
|
}
|
|
6996
|
-
__decorateClass$
|
|
6997
|
-
__decorateClass$
|
|
7006
|
+
__decorateClass$r([observable], Dialog.prototype, "dialog", 2);
|
|
7007
|
+
__decorateClass$r([attr({
|
|
6998
7008
|
attribute: "aria-describedby"
|
|
6999
7009
|
})], Dialog.prototype, "ariaDescribedby", 2);
|
|
7000
|
-
__decorateClass$
|
|
7010
|
+
__decorateClass$r([attr({
|
|
7001
7011
|
attribute: "aria-labelledby"
|
|
7002
7012
|
})], Dialog.prototype, "ariaLabelledby", 2);
|
|
7003
|
-
__decorateClass$
|
|
7013
|
+
__decorateClass$r([attr], Dialog.prototype, "type", 2);
|
|
7004
7014
|
|
|
7005
|
-
const template$
|
|
7015
|
+
const template$w = html`<dialog role="${x => x.type === DialogType.alert ? "alertdialog" : "dialog"}" type="${x => x.type}" class="dialog" part="dialog" aria-modal="${x => x.type === DialogType.modal || x.type === DialogType.alert ? "true" : void 0}" aria-describedby="${x => x.ariaDescribedby}" aria-labelledby="${x => x.ariaLabelledby}" aria-label="${x => x.ariaLabel}" @click="${(x, c) => x.clickHandler(c.event)}" @cancel="${(x, c) => x.type === DialogType.alert ? c.event.preventDefault() : x.hide()}" ${ref("dialog")}><slot></slot></dialog>`;
|
|
7006
7016
|
|
|
7007
|
-
const styles$
|
|
7017
|
+
const styles$v = css`
|
|
7008
7018
|
@layer base{:host{--dialog-backdrop:${colorBackgroundOverlay};--dialog-starting-scale:0.85}::backdrop{background:var(--dialog-backdrop,rgba(0,0,0,0.4))}dialog{background:${colorNeutralBackground1};border-radius:${borderRadiusXLarge};border:none;box-shadow:${shadow64};color:${colorNeutralForeground1};max-height:calc(-48px + 100vh);padding:0;width:100%;max-width:600px}:host([type='non-modal']) dialog{inset:0;position:fixed;z-index:2;overflow:auto}}@layer animations{@media (prefers-reduced-motion:no-preference){dialog,::backdrop{transition:display allow-discrete,opacity,overlay allow-discrete,scale;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid};opacity:0}::backdrop{transition-timing-function:${curveLinear}}[open],[open]::backdrop{opacity:1}dialog:not([open]){scale:var(--dialog-starting-scale);transition-timing-function:${curveAccelerateMid}}}@starting-style{[open],[open]::backdrop{opacity:0}dialog{scale:var(--dialog-starting-scale)}}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
7009
7019
|
@layer base{dialog{border:${strokeWidthThin} solid ${colorTransparentStroke}}}`));
|
|
7010
7020
|
|
|
7011
|
-
const definition$
|
|
7021
|
+
const definition$w = Dialog.compose({
|
|
7012
7022
|
name: `${FluentDesignSystem.prefix}-dialog`,
|
|
7013
|
-
template: template$
|
|
7014
|
-
styles: styles$
|
|
7023
|
+
template: template$w,
|
|
7024
|
+
styles: styles$v
|
|
7015
7025
|
});
|
|
7016
7026
|
|
|
7017
|
-
definition$
|
|
7027
|
+
definition$w.define(FluentDesignSystem.registry);
|
|
7018
7028
|
|
|
7019
|
-
var __defProp$
|
|
7020
|
-
var __getOwnPropDesc$
|
|
7021
|
-
var __decorateClass$
|
|
7022
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7029
|
+
var __defProp$q = Object.defineProperty;
|
|
7030
|
+
var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
|
|
7031
|
+
var __decorateClass$q = (decorators, target, key, kind) => {
|
|
7032
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
|
|
7023
7033
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7024
|
-
if (kind && result) __defProp$
|
|
7034
|
+
if (kind && result) __defProp$q(target, key, result);
|
|
7025
7035
|
return result;
|
|
7026
7036
|
};
|
|
7027
7037
|
class DialogBody extends FASTElement {
|
|
@@ -7030,7 +7040,7 @@ class DialogBody extends FASTElement {
|
|
|
7030
7040
|
this.noTitleAction = false;
|
|
7031
7041
|
}
|
|
7032
7042
|
}
|
|
7033
|
-
__decorateClass$
|
|
7043
|
+
__decorateClass$q([attr({
|
|
7034
7044
|
mode: "boolean",
|
|
7035
7045
|
attribute: "no-title-action"
|
|
7036
7046
|
})], DialogBody.prototype, "noTitleAction", 2);
|
|
@@ -7049,20 +7059,20 @@ const dismissed16Regular = html.partial(`
|
|
|
7049
7059
|
fill="currentColor"
|
|
7050
7060
|
></path>
|
|
7051
7061
|
</svg>`);
|
|
7052
|
-
const template$
|
|
7062
|
+
const template$v = html`<div class="title" part="title"><slot name="title"></slot><slot name="title-action"><fluent-button ?hidden=${x => x.noTitleAction || x.parentNode?.type === DialogType.alert} tabindex="0" part="title-action" class="title-action" appearance="transparent" icon-only @click=${x => x.parentNode?.hide()} ${ref("defaultTitleAction")}>${dismissed16Regular}</fluent-button></slot></div><div class="content" part="content"><slot></slot></div><div class="actions" part="actions"><slot name="action"></slot></div>`;
|
|
7053
7063
|
|
|
7054
|
-
const styles$
|
|
7064
|
+
const styles$u = css`
|
|
7055
7065
|
${display("grid")}
|
|
7056
7066
|
|
|
7057
7067
|
:host{background:${colorNeutralBackground1};box-sizing:border-box;gap:${spacingVerticalS};padding:${spacingVerticalXXL} ${spacingHorizontalXXL};container:dialog-body / inline-size}.title{box-sizing:border-box;align-items:flex-start;background:${colorNeutralBackground1};color:${colorNeutralForeground1};column-gap:8px;display:flex;font-family:${fontFamilyBase};font-size:${fontSizeBase500};font-weight:${fontWeightSemibold};inset-block-start:0;justify-content:space-between;line-height:${lineHeightBase500};margin-block-end:calc(${spacingVerticalS} * -1);margin-block-start:calc(${spacingVerticalXXL} * -1);padding-block-end:${spacingVerticalS};padding-block-start:${spacingVerticalXXL};position:sticky;z-index:1}.content{box-sizing:border-box;color:${colorNeutralForeground1};font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};min-height:32px}.actions{box-sizing:border-box;background:${colorNeutralBackground1};display:flex;flex-direction:column;gap:${spacingVerticalS};inset-block-end:0;margin-block-end:calc(${spacingVerticalXXL} * -1);padding-block-end:${spacingVerticalXXL};padding-block-start:${spacingVerticalL};position:sticky;z-index:2}:not(:has(:is([slot='title'],[slot='title-action']))) .title:not(:has(.title-action)),:not(:has([slot='action'])) .actions{display:none}@container (min-width:480px){.actions{align-items:center;flex-direction:row;justify-content:flex-end;margin-block-start:calc(${spacingVerticalS} * -1);padding-block-start:${spacingVerticalS}}}`;
|
|
7058
7068
|
|
|
7059
|
-
const definition$
|
|
7069
|
+
const definition$v = DialogBody.compose({
|
|
7060
7070
|
name: `${FluentDesignSystem.prefix}-dialog-body`,
|
|
7061
|
-
template: template$
|
|
7062
|
-
styles: styles$
|
|
7071
|
+
template: template$v,
|
|
7072
|
+
styles: styles$u
|
|
7063
7073
|
});
|
|
7064
7074
|
|
|
7065
|
-
definition$
|
|
7075
|
+
definition$v.define(FluentDesignSystem.registry);
|
|
7066
7076
|
|
|
7067
7077
|
const DividerRole = {
|
|
7068
7078
|
/**
|
|
@@ -7086,12 +7096,12 @@ const DividerAppearance = {
|
|
|
7086
7096
|
subtle: "subtle"
|
|
7087
7097
|
};
|
|
7088
7098
|
|
|
7089
|
-
var __defProp$
|
|
7090
|
-
var __getOwnPropDesc$
|
|
7091
|
-
var __decorateClass$
|
|
7092
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7099
|
+
var __defProp$p = Object.defineProperty;
|
|
7100
|
+
var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
|
|
7101
|
+
var __decorateClass$p = (decorators, target, key, kind) => {
|
|
7102
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
|
|
7093
7103
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7094
|
-
if (kind && result) __defProp$
|
|
7104
|
+
if (kind && result) __defProp$p(target, key, result);
|
|
7095
7105
|
return result;
|
|
7096
7106
|
};
|
|
7097
7107
|
class BaseDivider extends FASTElement {
|
|
@@ -7138,8 +7148,8 @@ class BaseDivider extends FASTElement {
|
|
|
7138
7148
|
swapStates(this.elementInternals, previous, next, DividerOrientation);
|
|
7139
7149
|
}
|
|
7140
7150
|
}
|
|
7141
|
-
__decorateClass$
|
|
7142
|
-
__decorateClass$
|
|
7151
|
+
__decorateClass$p([attr], BaseDivider.prototype, "role", 2);
|
|
7152
|
+
__decorateClass$p([attr], BaseDivider.prototype, "orientation", 2);
|
|
7143
7153
|
class Divider extends BaseDivider {
|
|
7144
7154
|
/**
|
|
7145
7155
|
* Handles changes to align-content attribute custom states
|
|
@@ -7166,32 +7176,32 @@ class Divider extends BaseDivider {
|
|
|
7166
7176
|
toggleState(this.elementInternals, "inset", next);
|
|
7167
7177
|
}
|
|
7168
7178
|
}
|
|
7169
|
-
__decorateClass$
|
|
7179
|
+
__decorateClass$p([attr({
|
|
7170
7180
|
attribute: "align-content"
|
|
7171
7181
|
})], Divider.prototype, "alignContent", 2);
|
|
7172
|
-
__decorateClass$
|
|
7173
|
-
__decorateClass$
|
|
7182
|
+
__decorateClass$p([attr], Divider.prototype, "appearance", 2);
|
|
7183
|
+
__decorateClass$p([attr({
|
|
7174
7184
|
mode: "boolean"
|
|
7175
7185
|
})], Divider.prototype, "inset", 2);
|
|
7176
7186
|
|
|
7177
7187
|
function dividerTemplate() {
|
|
7178
7188
|
return html`<slot></slot>`;
|
|
7179
7189
|
}
|
|
7180
|
-
const template$
|
|
7190
|
+
const template$u = dividerTemplate();
|
|
7181
7191
|
|
|
7182
|
-
const styles$
|
|
7192
|
+
const styles$t = css`
|
|
7183
7193
|
${display("flex")}
|
|
7184
7194
|
|
|
7185
7195
|
:host{contain:content}:host::after,:host::before{align-self:center;background:${colorNeutralStroke2};box-sizing:border-box;content:'';display:flex;flex-grow:1;height:${strokeWidthThin}}:host(${insetState}){padding:0 12px}:host ::slotted(*){color:${colorNeutralForeground2};font-family:${fontFamilyBase};font-size:${fontSizeBase200};font-weight:${fontWeightRegular};margin:0;padding:0 12px}:host(${alignStartState})::before,:host(${alignEndState})::after{flex-basis:12px;flex-grow:0;flex-shrink:0}:host(${verticalState}){height:100%;min-height:84px}:host(${verticalState}):empty{min-height:20px}:host(${verticalState}){flex-direction:column;align-items:center}:host(${verticalState}${insetState})::before{margin-top:12px}:host(${verticalState}${insetState})::after{margin-bottom:12px}:host(${verticalState}):empty::before,:host(${verticalState}):empty::after{height:10px;min-height:10px;flex-grow:0}:host(${verticalState})::before,:host(${verticalState})::after{width:${strokeWidthThin};min-height:20px;height:100%}:host(${verticalState}) ::slotted(*){display:flex;flex-direction:column;padding:12px 0;line-height:20px}:host(${verticalState}${alignStartState})::before{min-height:8px}:host(${verticalState}${alignEndState})::after{min-height:8px}:host(${strongState})::before,:host(${strongState})::after{background:${colorNeutralStroke1}}:host(${strongState}) ::slotted(*){color:${colorNeutralForeground1}}:host(${brandState})::before,:host(${brandState})::after{background:${colorBrandStroke1}}:host(${brandState}) ::slotted(*){color:${colorBrandForeground1}}:host(${subtleState})::before,:host(${subtleState})::after{background:${colorNeutralStroke3}}:host(${subtleState}) ::slotted(*){color:${colorNeutralForeground3}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
7186
7196
|
:host(${strongState})::before,:host(${strongState})::after,:host(${brandState})::before,:host(${brandState})::after,:host(${subtleState})::before,:host(${subtleState})::after,:host::after,:host::before{background:WindowText;color:WindowText}`));
|
|
7187
7197
|
|
|
7188
|
-
const definition$
|
|
7198
|
+
const definition$u = Divider.compose({
|
|
7189
7199
|
name: `${FluentDesignSystem.prefix}-divider`,
|
|
7190
|
-
template: template$
|
|
7191
|
-
styles: styles$
|
|
7200
|
+
template: template$u,
|
|
7201
|
+
styles: styles$t
|
|
7192
7202
|
});
|
|
7193
7203
|
|
|
7194
|
-
definition$
|
|
7204
|
+
definition$u.define(FluentDesignSystem.registry);
|
|
7195
7205
|
|
|
7196
7206
|
const DrawerPosition = {
|
|
7197
7207
|
start: "start",
|
|
@@ -7209,12 +7219,12 @@ const DrawerType = {
|
|
|
7209
7219
|
inline: "inline"
|
|
7210
7220
|
};
|
|
7211
7221
|
|
|
7212
|
-
var __defProp$
|
|
7213
|
-
var __getOwnPropDesc$
|
|
7214
|
-
var __decorateClass$
|
|
7215
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7222
|
+
var __defProp$o = Object.defineProperty;
|
|
7223
|
+
var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
|
|
7224
|
+
var __decorateClass$o = (decorators, target, key, kind) => {
|
|
7225
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
|
|
7216
7226
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7217
|
-
if (kind && result) __defProp$
|
|
7227
|
+
if (kind && result) __defProp$o(target, key, result);
|
|
7218
7228
|
return result;
|
|
7219
7229
|
};
|
|
7220
7230
|
class Drawer extends FASTElement {
|
|
@@ -7262,77 +7272,830 @@ class Drawer extends FASTElement {
|
|
|
7262
7272
|
});
|
|
7263
7273
|
}
|
|
7264
7274
|
/**
|
|
7265
|
-
* @public
|
|
7266
|
-
* Method to hide the drawer
|
|
7275
|
+
* @public
|
|
7276
|
+
* Method to hide the drawer
|
|
7277
|
+
*/
|
|
7278
|
+
hide() {
|
|
7279
|
+
this.emitBeforeToggle();
|
|
7280
|
+
this.dialog.close();
|
|
7281
|
+
this.emitToggle();
|
|
7282
|
+
}
|
|
7283
|
+
/**
|
|
7284
|
+
* @public
|
|
7285
|
+
* @param event - The click event
|
|
7286
|
+
* @returns boolean - Always returns true
|
|
7287
|
+
* Handles click events on the drawer.
|
|
7288
|
+
*/
|
|
7289
|
+
clickHandler(event) {
|
|
7290
|
+
event.preventDefault();
|
|
7291
|
+
if (this.dialog.open && event.target === this.dialog) {
|
|
7292
|
+
this.hide();
|
|
7293
|
+
}
|
|
7294
|
+
return true;
|
|
7295
|
+
}
|
|
7296
|
+
}
|
|
7297
|
+
__decorateClass$o([attr], Drawer.prototype, "type", 2);
|
|
7298
|
+
__decorateClass$o([attr({
|
|
7299
|
+
attribute: "aria-labelledby"
|
|
7300
|
+
})], Drawer.prototype, "ariaLabelledby", 2);
|
|
7301
|
+
__decorateClass$o([attr({
|
|
7302
|
+
attribute: "aria-describedby"
|
|
7303
|
+
})], Drawer.prototype, "ariaDescribedby", 2);
|
|
7304
|
+
__decorateClass$o([attr], Drawer.prototype, "position", 2);
|
|
7305
|
+
__decorateClass$o([attr({
|
|
7306
|
+
attribute: "size"
|
|
7307
|
+
})], Drawer.prototype, "size", 2);
|
|
7308
|
+
__decorateClass$o([observable], Drawer.prototype, "dialog", 2);
|
|
7309
|
+
|
|
7310
|
+
const styles$s = css`
|
|
7311
|
+
${display("block")}
|
|
7312
|
+
|
|
7313
|
+
:host{--dialog-backdrop:${colorBackgroundOverlay}}:host([type='non-modal']) dialog[open]::backdrop{display:none}:host([type='non-modal']) dialog{position:fixed;top:0;bottom:0}:host([type='inline']){height:100%;width:fit-content}:host([type='inline']) dialog[open]{box-shadow:none;position:relative}:host([size='small']) dialog{width:320px;max-width:320px}:host([size='large']) dialog{width:940px;max-width:940px}:host([size='full']) dialog{width:100%;max-width:100%}:host([position='end']) dialog{margin-inline-start:auto;margin-inline-end:0}dialog{box-sizing:border-box;z-index:var(--drawer-elevation,1000);font-size:${fontSizeBase300};line-height:${lineHeightBase300};font-family:${fontFamilyBase};font-weight:${fontWeightRegular};color:${colorNeutralForeground1};max-width:var(--drawer-width,592px);max-height:100vh;height:100%;margin-inline-start:0;margin-inline-end:auto;border-inline-end-color:${colorTransparentStroke};border-inline-start-color:var(--drawer-separator,${colorTransparentStroke});outline:none;top:0;bottom:0;width:var(--drawer-width,592px);border-radius:0;padding:0;max-width:var(--drawer-width,592px);box-shadow:${shadow64};border:${strokeWidthThin} solid ${colorTransparentStroke};background:${colorNeutralBackground1}}dialog::backdrop{background:var(--dialog-backdrop)}@layer animations{@media (prefers-reduced-motion:no-preference){dialog{transition:display allow-discrete,opacity,overlay allow-discrete,transform;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid}}:host dialog:not([open]){transform:translateX(-100%);transition-timing-function:${curveAccelerateMid}}:host([position='end']) dialog:not([open]){transform:translateX(100%);transition-timing-function:${curveAccelerateMid}}dialog[open]{transform:translateX(0)}dialog::backdrop{transition:display allow-discrete,opacity,overlay allow-discrete,scale;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid};background:var(--dialog-backdrop,${colorBackgroundOverlay});opacity:0}dialog[open]::backdrop{opacity:1}dialog::backdrop{transition-timing-function:${curveLinear}}}@starting-style{dialog[open]{transform:translateX(-100%)}:host([position='end']) dialog[open]{transform:translateX(100%)}dialog[open]::backdrop{opacity:0}}}`;
|
|
7314
|
+
|
|
7315
|
+
function drawerTemplate() {
|
|
7316
|
+
return html`<dialog class="dialog" part="dialog" role="${x => x.type === "modal" ? "dialog" : x.role}" aria-modal="${x => x.type === "modal" ? "true" : void 0}" aria-describedby="${x => x.ariaDescribedby}" aria-labelledby="${x => x.ariaLabelledby}" aria-label="${x => x.ariaLabel}" size="${x => x.size}" position="${x => x.position}" type="${x => x.type}" @click="${(x, c) => x.clickHandler(c.event)}" @cancel="${(x, c) => x.hide()}" ${ref("dialog")}><slot></slot></dialog>`;
|
|
7317
|
+
}
|
|
7318
|
+
const template$t = drawerTemplate();
|
|
7319
|
+
|
|
7320
|
+
const definition$t = Drawer.compose({
|
|
7321
|
+
name: `${FluentDesignSystem.prefix}-drawer`,
|
|
7322
|
+
template: template$t,
|
|
7323
|
+
styles: styles$s
|
|
7324
|
+
});
|
|
7325
|
+
|
|
7326
|
+
definition$t.define(FluentDesignSystem.registry);
|
|
7327
|
+
|
|
7328
|
+
class DrawerBody extends FASTElement {}
|
|
7329
|
+
|
|
7330
|
+
const styles$r = css`
|
|
7331
|
+
${display("grid")}
|
|
7332
|
+
:host{box-sizing:border-box;grid-template-rows:min-content auto min-content;position:relative;height:100%;padding:${spacingHorizontalXL};max-height:100svh}.header{display:flex;justify-content:space-between;align-items:center;${typographySubtitle1Styles}}.footer{display:flex;justify-content:flex-start;gap:${spacingHorizontalM}}`;
|
|
7333
|
+
|
|
7334
|
+
function drawerBodyTemplate() {
|
|
7335
|
+
return html`<div class="header" part="header"><slot name="title"></slot><slot name="close"></slot></div><div class="content" part="content"><slot></slot></div><div class="footer" part="footer"><slot name="footer"></slot></div>`;
|
|
7336
|
+
}
|
|
7337
|
+
const template$s = drawerBodyTemplate();
|
|
7338
|
+
|
|
7339
|
+
const definition$s = DrawerBody.compose({
|
|
7340
|
+
name: `${FluentDesignSystem.prefix}-drawer-body`,
|
|
7341
|
+
template: template$s,
|
|
7342
|
+
styles: styles$r
|
|
7343
|
+
});
|
|
7344
|
+
|
|
7345
|
+
definition$s.define(FluentDesignSystem.registry);
|
|
7346
|
+
|
|
7347
|
+
function isListbox(element, tagName = "-listbox") {
|
|
7348
|
+
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
7349
|
+
return false;
|
|
7350
|
+
}
|
|
7351
|
+
return element.tagName.toLowerCase().endsWith(tagName);
|
|
7352
|
+
}
|
|
7353
|
+
|
|
7354
|
+
function isDropdownOption(value, tagName = "-option") {
|
|
7355
|
+
if (value?.nodeType !== Node.ELEMENT_NODE) {
|
|
7356
|
+
return false;
|
|
7357
|
+
}
|
|
7358
|
+
return value.tagName.toLowerCase().endsWith(tagName);
|
|
7359
|
+
}
|
|
7360
|
+
|
|
7361
|
+
function getLanguage(rootNode) {
|
|
7362
|
+
return rootNode.closest("[lang]")?.lang ?? "en";
|
|
7363
|
+
}
|
|
7364
|
+
|
|
7365
|
+
let uniqueIdCounter = 0;
|
|
7366
|
+
function uniqueId(prefix = "id-") {
|
|
7367
|
+
const str = `${prefix}${uniqueIdCounter++}`;
|
|
7368
|
+
return document.getElementById(str) ? uniqueId(prefix) : str;
|
|
7369
|
+
}
|
|
7370
|
+
|
|
7371
|
+
const DropdownAppearance = {
|
|
7372
|
+
filledDarker: "filled-darker",
|
|
7373
|
+
filledLighter: "filled-lighter",
|
|
7374
|
+
outline: "outline",
|
|
7375
|
+
transparent: "transparent"
|
|
7376
|
+
};
|
|
7377
|
+
const DropdownSize = {
|
|
7378
|
+
small: "small",
|
|
7379
|
+
medium: "medium",
|
|
7380
|
+
large: "large"
|
|
7381
|
+
};
|
|
7382
|
+
const DropdownType = {
|
|
7383
|
+
combobox: "combobox",
|
|
7384
|
+
dropdown: "dropdown",
|
|
7385
|
+
select: "select"
|
|
7386
|
+
};
|
|
7387
|
+
|
|
7388
|
+
const dropdownIndicatorTemplate = html`<svg class="chevron-down-20-regular" role="button" slot="indicator" viewBox="0 0 20 20" ${ref("indicator")}><path d="M15.85 7.65a.5.5 0 0 1 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 8.35a.5.5 0 1 1 .7-.7L10 12.8l5.15-5.16a.5.5 0 0 1 .7 0" fill="currentColor" /></svg>`;
|
|
7389
|
+
const dropdownInputTemplate = html`<input @input="${(x, c) => x.inputHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" aria-activedescendant="${x => x.activeDescendant}" aria-controls="${x => x.listbox?.id ?? null}" aria-labelledby="${x => x.ariaLabelledBy}" aria-expanded="${x => x.open}" aria-haspopup="listbox" placeholder="${x => x.placeholder}" role="combobox" ?disabled="${x => x.disabled}" type="${x => x.type}" value="${x => x.valueAttribute}" ${ref("control")} />`;
|
|
7390
|
+
const dropdownButtonTemplate = html`<button aria-activedescendant="${x => x.activeDescendant}" aria-controls="${x => x.listbox?.id ?? null}" aria-expanded="${x => x.open}" aria-haspopup="listbox" role="combobox" ?disabled="${x => x.disabled}" type="button" ${ref("control")}>${x => x.displayValue}</button>`;
|
|
7391
|
+
function dropdownTemplate(options = {}) {
|
|
7392
|
+
return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @mousedown="${(x, c) => x.mousedownHandler(c.event)}"><div class="control"><slot name="control" ${ref("controlSlot")}></slot><slot name="indicator" ${ref("indicatorSlot")}>${staticallyCompose(options.indicator)}</slot></div><slot ${ref("listboxSlot")}></slot></template>`;
|
|
7393
|
+
}
|
|
7394
|
+
const template$r = dropdownTemplate({
|
|
7395
|
+
indicator: dropdownIndicatorTemplate
|
|
7396
|
+
});
|
|
7397
|
+
|
|
7398
|
+
var __defProp$n = Object.defineProperty;
|
|
7399
|
+
var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
|
|
7400
|
+
var __decorateClass$n = (decorators, target, key, kind) => {
|
|
7401
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
|
|
7402
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7403
|
+
if (kind && result) __defProp$n(target, key, result);
|
|
7404
|
+
return result;
|
|
7405
|
+
};
|
|
7406
|
+
class BaseDropdown extends FASTElement {
|
|
7407
|
+
constructor() {
|
|
7408
|
+
super();
|
|
7409
|
+
this.activeIndex = 0;
|
|
7410
|
+
this.id = uniqueId("dropdown-");
|
|
7411
|
+
this.required = false;
|
|
7412
|
+
this.type = DropdownType.dropdown;
|
|
7413
|
+
this.valueAttribute = "";
|
|
7414
|
+
/**
|
|
7415
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
7416
|
+
*
|
|
7417
|
+
* @internal
|
|
7418
|
+
*/
|
|
7419
|
+
this.elementInternals = this.attachInternals();
|
|
7420
|
+
this.elementInternals.role = "presentation";
|
|
7421
|
+
Updates.enqueue(() => {
|
|
7422
|
+
this.insertControl();
|
|
7423
|
+
});
|
|
7424
|
+
}
|
|
7425
|
+
get activeDescendant() {
|
|
7426
|
+
if (this.open) {
|
|
7427
|
+
return this.enabledOptions[this.activeIndex]?.id;
|
|
7428
|
+
}
|
|
7429
|
+
return void 0;
|
|
7430
|
+
}
|
|
7431
|
+
/**
|
|
7432
|
+
* Sets the active index when the active index property changes.
|
|
7433
|
+
*
|
|
7434
|
+
* @param prev - the previous active index
|
|
7435
|
+
* @param next - the current active index
|
|
7436
|
+
* @internal
|
|
7437
|
+
*/
|
|
7438
|
+
activeIndexChanged(prev, next) {
|
|
7439
|
+
if (typeof next === "number") {
|
|
7440
|
+
const optionIndex = this.matches(":has(:focus-visible)") ? next : -1;
|
|
7441
|
+
this.enabledOptions.forEach((option, index) => {
|
|
7442
|
+
option.active = index === optionIndex;
|
|
7443
|
+
});
|
|
7444
|
+
if (this.open) {
|
|
7445
|
+
this.enabledOptions[optionIndex]?.scrollIntoView({
|
|
7446
|
+
block: "nearest"
|
|
7447
|
+
});
|
|
7448
|
+
}
|
|
7449
|
+
}
|
|
7450
|
+
}
|
|
7451
|
+
/**
|
|
7452
|
+
* Updates properties on the control element when the control slot changes.
|
|
7453
|
+
*
|
|
7454
|
+
* @param prev - the previous control element
|
|
7455
|
+
* @param next - the current control element
|
|
7456
|
+
* @internal
|
|
7457
|
+
* @remarks
|
|
7458
|
+
* The control element is assigned to the dropdown via the control slot with manual slot assignment.
|
|
7459
|
+
*/
|
|
7460
|
+
controlChanged(prev, next) {
|
|
7461
|
+
if (next) {
|
|
7462
|
+
next.id = next.id || uniqueId("input-");
|
|
7463
|
+
this.controlSlot?.assign(next);
|
|
7464
|
+
}
|
|
7465
|
+
}
|
|
7466
|
+
/**
|
|
7467
|
+
* Updates the disabled state of the options when the disabled property changes.
|
|
7468
|
+
*
|
|
7469
|
+
* @param prev - the previous disabled state
|
|
7470
|
+
* @param next - the current disabled state
|
|
7471
|
+
*/
|
|
7472
|
+
disabledChanged(prev, next) {
|
|
7473
|
+
Updates.enqueue(() => {
|
|
7474
|
+
this.options.forEach(option => {
|
|
7475
|
+
option.disabled = option.disabledAttribute || this.disabled;
|
|
7476
|
+
});
|
|
7477
|
+
});
|
|
7478
|
+
}
|
|
7479
|
+
get displayValue() {
|
|
7480
|
+
if (!this.$fastController.isConnected || !this.control || this.isCombobox && this.multiple) {
|
|
7481
|
+
toggleState(this.elementInternals, "placeholder-shown", false);
|
|
7482
|
+
return "";
|
|
7483
|
+
}
|
|
7484
|
+
this.listFormatter = this.listFormatter ?? new Intl.ListFormat(getLanguage(this), {
|
|
7485
|
+
type: "conjunction",
|
|
7486
|
+
style: "narrow"
|
|
7487
|
+
});
|
|
7488
|
+
const displayValue = this.listFormatter.format(this.selectedOptions.map(x => x.text));
|
|
7489
|
+
toggleState(this.elementInternals, "placeholder-shown", !displayValue);
|
|
7490
|
+
if (this.isCombobox) {
|
|
7491
|
+
return displayValue;
|
|
7492
|
+
}
|
|
7493
|
+
return displayValue || this.placeholder;
|
|
7494
|
+
}
|
|
7495
|
+
/**
|
|
7496
|
+
* Updates properties on the listbox element when the listbox reference changes.
|
|
7497
|
+
*
|
|
7498
|
+
* @param prev - the previous listbox element
|
|
7499
|
+
* @param next - the current listbox element
|
|
7500
|
+
* @internal
|
|
7501
|
+
*
|
|
7502
|
+
* @remarks
|
|
7503
|
+
* The listbox element is assigned to the dropdown via the default slot with manual slot assignment.
|
|
7504
|
+
*/
|
|
7505
|
+
listboxChanged(prev, next) {
|
|
7506
|
+
if (prev) {
|
|
7507
|
+
Observable.getNotifier(this).unsubscribe(prev);
|
|
7508
|
+
}
|
|
7509
|
+
if (next) {
|
|
7510
|
+
next.dropdown = this;
|
|
7511
|
+
next.popover = "manual";
|
|
7512
|
+
this.listboxSlot.assign(next);
|
|
7513
|
+
const notifier = Observable.getNotifier(this);
|
|
7514
|
+
notifier.subscribe(next);
|
|
7515
|
+
for (const key of ["disabled", "multiple"]) {
|
|
7516
|
+
notifier.notify(key);
|
|
7517
|
+
}
|
|
7518
|
+
Updates.enqueue(() => {
|
|
7519
|
+
this.enabledOptions.filter(x => x.defaultSelected).forEach((x, i) => {
|
|
7520
|
+
x.selected = this.multiple || i === 0;
|
|
7521
|
+
});
|
|
7522
|
+
});
|
|
7523
|
+
}
|
|
7524
|
+
}
|
|
7525
|
+
/**
|
|
7526
|
+
* Toggles between single and multiple selection modes when the `multiple` property changes.
|
|
7527
|
+
*
|
|
7528
|
+
* @param prev - the previous multiple state
|
|
7529
|
+
* @param next - the next multiple state
|
|
7530
|
+
* @internal
|
|
7531
|
+
*/
|
|
7532
|
+
multipleChanged(prev, next) {
|
|
7533
|
+
this.elementInternals.ariaMultiSelectable = next ? "true" : "false";
|
|
7534
|
+
toggleState(this.elementInternals, "multiple", next);
|
|
7535
|
+
this.value = null;
|
|
7536
|
+
}
|
|
7537
|
+
/**
|
|
7538
|
+
* Updates the name of the options when the name property changes.
|
|
7539
|
+
*
|
|
7540
|
+
* @param prev - the previous name
|
|
7541
|
+
* @param next - the current name
|
|
7542
|
+
*/
|
|
7543
|
+
nameChanged(prev, next) {
|
|
7544
|
+
Updates.enqueue(() => {
|
|
7545
|
+
this.options.forEach(option => {
|
|
7546
|
+
option.name = next;
|
|
7547
|
+
});
|
|
7548
|
+
});
|
|
7549
|
+
}
|
|
7550
|
+
/**
|
|
7551
|
+
* Handles the open state of the dropdown.
|
|
7552
|
+
*
|
|
7553
|
+
* @param prev - the previous open state
|
|
7554
|
+
* @param next - the current open state
|
|
7555
|
+
*
|
|
7556
|
+
* @internal
|
|
7557
|
+
*/
|
|
7558
|
+
openChanged(prev, next) {
|
|
7559
|
+
toggleState(this.elementInternals, "open", next);
|
|
7560
|
+
this.elementInternals.ariaExpanded = next ? "true" : "false";
|
|
7561
|
+
this.activeIndex = this.selectedIndex ?? -1;
|
|
7562
|
+
}
|
|
7563
|
+
/**
|
|
7564
|
+
* Changes the slotted control element based on the dropdown type.
|
|
7565
|
+
*
|
|
7566
|
+
* @param prev - the previous dropdown type
|
|
7567
|
+
* @param next - the current dropdown type
|
|
7568
|
+
* @internal
|
|
7569
|
+
*/
|
|
7570
|
+
typeChanged(prev, next) {
|
|
7571
|
+
if (this.$fastController.isConnected) {
|
|
7572
|
+
this.insertControl();
|
|
7573
|
+
}
|
|
7574
|
+
}
|
|
7575
|
+
/**
|
|
7576
|
+
* The collection of enabled options.
|
|
7577
|
+
* @public
|
|
7578
|
+
*/
|
|
7579
|
+
get enabledOptions() {
|
|
7580
|
+
return this.listbox?.enabledOptions ?? [];
|
|
7581
|
+
}
|
|
7582
|
+
/**
|
|
7583
|
+
* Resets the form value to its initial value when the form is reset.
|
|
7584
|
+
*
|
|
7585
|
+
* @internal
|
|
7586
|
+
*/
|
|
7587
|
+
formResetCallback() {
|
|
7588
|
+
this.enabledOptions.forEach((x, i) => {
|
|
7589
|
+
if (this.multiple) {
|
|
7590
|
+
x.selected = !!x.defaultSelected;
|
|
7591
|
+
return;
|
|
7592
|
+
}
|
|
7593
|
+
if (!x.defaultSelected) {
|
|
7594
|
+
x.selected = false;
|
|
7595
|
+
return;
|
|
7596
|
+
}
|
|
7597
|
+
this.selectOption(i);
|
|
7598
|
+
});
|
|
7599
|
+
}
|
|
7600
|
+
/**
|
|
7601
|
+
* A reference to the first freeform option, if present.
|
|
7602
|
+
*
|
|
7603
|
+
* @internal
|
|
7604
|
+
*/
|
|
7605
|
+
get freeformOption() {
|
|
7606
|
+
return this.enabledOptions.find(x => x.freeform);
|
|
7607
|
+
}
|
|
7608
|
+
/**
|
|
7609
|
+
* Indicates whether the dropdown is a combobox.
|
|
7610
|
+
*
|
|
7611
|
+
* @internal
|
|
7612
|
+
*/
|
|
7613
|
+
get isCombobox() {
|
|
7614
|
+
return this.type === DropdownType.combobox;
|
|
7615
|
+
}
|
|
7616
|
+
/**
|
|
7617
|
+
* The collection of all child options.
|
|
7618
|
+
*
|
|
7619
|
+
* @public
|
|
7620
|
+
*/
|
|
7621
|
+
get options() {
|
|
7622
|
+
return this.listbox?.options ?? [];
|
|
7623
|
+
}
|
|
7624
|
+
/**
|
|
7625
|
+
* The index of the first selected option, scoped to the enabled options.
|
|
7626
|
+
*
|
|
7627
|
+
* @internal
|
|
7628
|
+
* @remarks
|
|
7629
|
+
* This property is a reflection of {@link Listbox.selectedIndex}.
|
|
7630
|
+
*/
|
|
7631
|
+
get selectedIndex() {
|
|
7632
|
+
return this.enabledOptions.findIndex(x => x.selected) ?? -1;
|
|
7633
|
+
}
|
|
7634
|
+
/**
|
|
7635
|
+
* The collection of selected options.
|
|
7636
|
+
*
|
|
7637
|
+
* @public
|
|
7638
|
+
* @remarks
|
|
7639
|
+
* This property is a reflection of {@link Listbox.selectedOptions}.
|
|
7640
|
+
*/
|
|
7641
|
+
get selectedOptions() {
|
|
7642
|
+
return this.listbox?.selectedOptions ?? [];
|
|
7643
|
+
}
|
|
7644
|
+
/**
|
|
7645
|
+
* The validation message. Uses the browser's default validation message for native checkboxes if not otherwise
|
|
7646
|
+
* specified (e.g., via `setCustomValidity`).
|
|
7647
|
+
*
|
|
7648
|
+
* @internal
|
|
7649
|
+
*/
|
|
7650
|
+
get validationMessage() {
|
|
7651
|
+
if (this.elementInternals.validationMessage) {
|
|
7652
|
+
return this.elementInternals.validationMessage;
|
|
7653
|
+
}
|
|
7654
|
+
if (!this.validationFallbackMessage) {
|
|
7655
|
+
const validationMessageFallbackControl = document.createElement("input");
|
|
7656
|
+
validationMessageFallbackControl.type = "radio";
|
|
7657
|
+
validationMessageFallbackControl.required = true;
|
|
7658
|
+
validationMessageFallbackControl.checked = false;
|
|
7659
|
+
this.validationFallbackMessage = validationMessageFallbackControl.validationMessage;
|
|
7660
|
+
}
|
|
7661
|
+
return this.validationFallbackMessage;
|
|
7662
|
+
}
|
|
7663
|
+
/**
|
|
7664
|
+
* The current value of the selected option.
|
|
7665
|
+
*
|
|
7666
|
+
* @public
|
|
7667
|
+
*/
|
|
7668
|
+
get value() {
|
|
7669
|
+
Observable.notify(this, "value");
|
|
7670
|
+
return this.enabledOptions.find(x => x.selected)?.value ?? null;
|
|
7671
|
+
}
|
|
7672
|
+
set value(next) {
|
|
7673
|
+
if (this.multiple) {
|
|
7674
|
+
return;
|
|
7675
|
+
}
|
|
7676
|
+
this.selectOption(this.enabledOptions.findIndex(x => x.value === next));
|
|
7677
|
+
Observable.track(this, "value");
|
|
7678
|
+
}
|
|
7679
|
+
/**
|
|
7680
|
+
* Handles the change events for the dropdown.
|
|
7681
|
+
*
|
|
7682
|
+
* @param e - the event object
|
|
7683
|
+
*
|
|
7684
|
+
* @public
|
|
7685
|
+
*/
|
|
7686
|
+
changeHandler(e) {
|
|
7687
|
+
if (this === e.target) {
|
|
7688
|
+
return true;
|
|
7689
|
+
}
|
|
7690
|
+
const optionIndex = this.isCombobox ? this.enabledOptions.findIndex(x => x.text === this.control.value) : this.enabledOptions.indexOf(e.target);
|
|
7691
|
+
this.selectOption(optionIndex);
|
|
7692
|
+
return true;
|
|
7693
|
+
}
|
|
7694
|
+
/**
|
|
7695
|
+
* Handles the click events for the dropdown.
|
|
7696
|
+
*
|
|
7697
|
+
* @param e - the event object
|
|
7698
|
+
*
|
|
7699
|
+
* @public
|
|
7700
|
+
*/
|
|
7701
|
+
clickHandler(e) {
|
|
7702
|
+
if (this.disabled) {
|
|
7703
|
+
return;
|
|
7704
|
+
}
|
|
7705
|
+
const target = e.target;
|
|
7706
|
+
this.focus();
|
|
7707
|
+
if (target === this.control && !this.isCombobox) {
|
|
7708
|
+
this.listbox.togglePopover();
|
|
7709
|
+
return true;
|
|
7710
|
+
}
|
|
7711
|
+
if (!this.open) {
|
|
7712
|
+
this.listbox.showPopover();
|
|
7713
|
+
return true;
|
|
7714
|
+
}
|
|
7715
|
+
if (isDropdownOption(target) && !this.multiple) {
|
|
7716
|
+
if (target.disabled) {
|
|
7717
|
+
return;
|
|
7718
|
+
}
|
|
7719
|
+
if (this.isCombobox) {
|
|
7720
|
+
this.control.value = target.text;
|
|
7721
|
+
this.updateFreeformOption();
|
|
7722
|
+
}
|
|
7723
|
+
this.listbox.hidePopover();
|
|
7724
|
+
}
|
|
7725
|
+
return true;
|
|
7726
|
+
}
|
|
7727
|
+
/**
|
|
7728
|
+
* Filters the options based on the input value.
|
|
7729
|
+
*
|
|
7730
|
+
* @param value - the input value to filter the options by
|
|
7731
|
+
* @param collection - the collection of options to filter
|
|
7732
|
+
* @returns the filtered options
|
|
7733
|
+
* @internal
|
|
7734
|
+
*/
|
|
7735
|
+
filterOptions(value, collection = this.enabledOptions) {
|
|
7736
|
+
if (!this.listCollator) {
|
|
7737
|
+
this.listCollator = new Intl.Collator(getLanguage(this), {
|
|
7738
|
+
usage: "search",
|
|
7739
|
+
sensitivity: "base"
|
|
7740
|
+
});
|
|
7741
|
+
}
|
|
7742
|
+
return collection.filter(x => {
|
|
7743
|
+
return this.listCollator.compare(x.text.substring(0, Math.min(x.text.length, value.length)), value) === 0;
|
|
7744
|
+
});
|
|
7745
|
+
}
|
|
7746
|
+
/**
|
|
7747
|
+
* Focuses the control when the dropdown receives focus.
|
|
7748
|
+
*
|
|
7749
|
+
* @internal
|
|
7750
|
+
*/
|
|
7751
|
+
focus(options) {
|
|
7752
|
+
if (this.disabled) {
|
|
7753
|
+
return;
|
|
7754
|
+
}
|
|
7755
|
+
this.control.focus(options);
|
|
7756
|
+
}
|
|
7757
|
+
/**
|
|
7758
|
+
* Toggles the listbox when the control element loses focus.
|
|
7759
|
+
*
|
|
7760
|
+
* @param e - the focus event
|
|
7761
|
+
* @internal
|
|
7762
|
+
*/
|
|
7763
|
+
focusoutHandler(e) {
|
|
7764
|
+
const relatedTarget = e.relatedTarget;
|
|
7765
|
+
if (this.open && !this.contains(relatedTarget)) {
|
|
7766
|
+
this.listbox.togglePopover();
|
|
7767
|
+
}
|
|
7768
|
+
return true;
|
|
7769
|
+
}
|
|
7770
|
+
/**
|
|
7771
|
+
* Ensures the active index is within bounds of the enabled options. Out-of-bounds indices are wrapped to the opposite
|
|
7772
|
+
* end of the range.
|
|
7773
|
+
*
|
|
7774
|
+
* @param index - the desired index
|
|
7775
|
+
* @param upperBound - the upper bound of the range
|
|
7776
|
+
* @returns the index in bounds
|
|
7777
|
+
* @internal
|
|
7778
|
+
*/
|
|
7779
|
+
getEnabledIndexInBounds(index, upperBound = this.enabledOptions.length || 0) {
|
|
7780
|
+
if (upperBound === 0) {
|
|
7781
|
+
return -1;
|
|
7782
|
+
}
|
|
7783
|
+
return (index + upperBound) % upperBound;
|
|
7784
|
+
}
|
|
7785
|
+
/**
|
|
7786
|
+
* Handles the input events for the dropdown from the control element.
|
|
7787
|
+
*
|
|
7788
|
+
* @param e - the input event
|
|
7789
|
+
* @public
|
|
7790
|
+
*/
|
|
7791
|
+
inputHandler(e) {
|
|
7792
|
+
if (!this.open) {
|
|
7793
|
+
this.listbox.showPopover();
|
|
7794
|
+
}
|
|
7795
|
+
this.updateFreeformOption();
|
|
7796
|
+
const controlValue = this.control.value;
|
|
7797
|
+
const index = this.enabledOptions.indexOf(this.filterOptions(controlValue)[0] ?? null);
|
|
7798
|
+
this.activeIndex = index;
|
|
7799
|
+
return true;
|
|
7800
|
+
}
|
|
7801
|
+
/**
|
|
7802
|
+
* Inserts the control element based on the dropdown type.
|
|
7803
|
+
*
|
|
7804
|
+
* @public
|
|
7805
|
+
* @remarks
|
|
7806
|
+
* This method can be overridden in derived classes to provide custom control elements, though this is not recommended.
|
|
7807
|
+
*/
|
|
7808
|
+
insertControl() {
|
|
7809
|
+
this.controlSlot?.assignedNodes().forEach(x => this.removeChild(x));
|
|
7810
|
+
if (this.type === DropdownType.combobox) {
|
|
7811
|
+
dropdownInputTemplate.render(this, this);
|
|
7812
|
+
return;
|
|
7813
|
+
}
|
|
7814
|
+
dropdownButtonTemplate.render(this, this);
|
|
7815
|
+
}
|
|
7816
|
+
/**
|
|
7817
|
+
* Handles the keydown events for the dropdown.
|
|
7818
|
+
*
|
|
7819
|
+
* @param e - the keyboard event
|
|
7820
|
+
* @public
|
|
7821
|
+
*/
|
|
7822
|
+
keydownHandler(e) {
|
|
7823
|
+
let increment = 0;
|
|
7824
|
+
switch (e.key) {
|
|
7825
|
+
case "ArrowUp":
|
|
7826
|
+
{
|
|
7827
|
+
e.preventDefault();
|
|
7828
|
+
increment = -1;
|
|
7829
|
+
break;
|
|
7830
|
+
}
|
|
7831
|
+
case "ArrowDown":
|
|
7832
|
+
{
|
|
7833
|
+
e.preventDefault();
|
|
7834
|
+
increment = 1;
|
|
7835
|
+
break;
|
|
7836
|
+
}
|
|
7837
|
+
case " ":
|
|
7838
|
+
{
|
|
7839
|
+
if (this.isCombobox) {
|
|
7840
|
+
break;
|
|
7841
|
+
}
|
|
7842
|
+
e.preventDefault();
|
|
7843
|
+
}
|
|
7844
|
+
case "Enter":
|
|
7845
|
+
case "Tab":
|
|
7846
|
+
{
|
|
7847
|
+
if (this.open) {
|
|
7848
|
+
this.selectOption(this.activeIndex);
|
|
7849
|
+
if (this.multiple) {
|
|
7850
|
+
break;
|
|
7851
|
+
}
|
|
7852
|
+
this.listbox.hidePopover();
|
|
7853
|
+
return e.key === "Tab";
|
|
7854
|
+
}
|
|
7855
|
+
this.listbox.showPopover();
|
|
7856
|
+
break;
|
|
7857
|
+
}
|
|
7858
|
+
case "Escape":
|
|
7859
|
+
{
|
|
7860
|
+
this.activeIndex = this.multiple ? 0 : this.selectedIndex;
|
|
7861
|
+
this.listbox.hidePopover();
|
|
7862
|
+
break;
|
|
7863
|
+
}
|
|
7864
|
+
}
|
|
7865
|
+
if (!increment) {
|
|
7866
|
+
return true;
|
|
7867
|
+
}
|
|
7868
|
+
if (!this.open) {
|
|
7869
|
+
this.listbox.showPopover();
|
|
7870
|
+
return;
|
|
7871
|
+
}
|
|
7872
|
+
let nextIndex = this.activeIndex;
|
|
7873
|
+
nextIndex += increment;
|
|
7874
|
+
let indexInBounds = this.getEnabledIndexInBounds(nextIndex);
|
|
7875
|
+
if (indexInBounds === 0 && this.freeformOption?.hidden) {
|
|
7876
|
+
indexInBounds = this.getEnabledIndexInBounds(nextIndex + increment);
|
|
7877
|
+
}
|
|
7878
|
+
this.activeIndex = indexInBounds;
|
|
7879
|
+
return true;
|
|
7880
|
+
}
|
|
7881
|
+
/**
|
|
7882
|
+
* Prevents the default behavior of the mousedown event. This is necessary to prevent the input from losing focus
|
|
7883
|
+
* when the dropdown is open.
|
|
7884
|
+
*
|
|
7885
|
+
* @param e - the mouse event
|
|
7886
|
+
*
|
|
7887
|
+
* @internal
|
|
7888
|
+
*/
|
|
7889
|
+
mousedownHandler(e) {
|
|
7890
|
+
if (this.disabled || e.target === this.control && !this.isCombobox) {
|
|
7891
|
+
return;
|
|
7892
|
+
}
|
|
7893
|
+
return !isDropdownOption(e.target);
|
|
7894
|
+
}
|
|
7895
|
+
/**
|
|
7896
|
+
* Selects an option by index.
|
|
7897
|
+
*
|
|
7898
|
+
* @param index - The index of the option to select.
|
|
7899
|
+
* @public
|
|
7900
|
+
*/
|
|
7901
|
+
selectOption(index = this.selectedIndex) {
|
|
7902
|
+
this.listbox.selectOption(index);
|
|
7903
|
+
this.control.value = this.displayValue;
|
|
7904
|
+
this.setValidity();
|
|
7905
|
+
this.updateFreeformOption();
|
|
7906
|
+
}
|
|
7907
|
+
/**
|
|
7908
|
+
* Sets the validity of the element.
|
|
7909
|
+
*
|
|
7910
|
+
* @param flags - Validity flags to set.
|
|
7911
|
+
* @param message - Optional message to supply. If not provided, the element's `validationMessage` will be used.
|
|
7912
|
+
* @param anchor - Optional anchor to use for the validation message.
|
|
7913
|
+
*
|
|
7914
|
+
* @internal
|
|
7915
|
+
*/
|
|
7916
|
+
setValidity(flags, message, anchor) {
|
|
7917
|
+
if (this.$fastController.isConnected) {
|
|
7918
|
+
if (this.disabled || !this.required) {
|
|
7919
|
+
this.elementInternals.setValidity({});
|
|
7920
|
+
return;
|
|
7921
|
+
}
|
|
7922
|
+
const valueMissing = this.required && this.listbox.selectedOptions.length === 0;
|
|
7923
|
+
this.elementInternals.setValidity({
|
|
7924
|
+
valueMissing,
|
|
7925
|
+
...flags
|
|
7926
|
+
}, message ?? this.validationMessage, anchor ?? this.listbox.enabledOptions[0]);
|
|
7927
|
+
}
|
|
7928
|
+
}
|
|
7929
|
+
/**
|
|
7930
|
+
* Updates the freeform option with the provided value.
|
|
7931
|
+
*
|
|
7932
|
+
* @param value - the value to update the freeform option with
|
|
7933
|
+
* @internal
|
|
7934
|
+
*/
|
|
7935
|
+
updateFreeformOption(value = this.control.value) {
|
|
7936
|
+
if (!this.freeformOption) {
|
|
7937
|
+
return;
|
|
7938
|
+
}
|
|
7939
|
+
if (value === "" || this.filterOptions(value, this.enabledOptions.filter(x => !x.freeform)).length) {
|
|
7940
|
+
this.freeformOption.value = "";
|
|
7941
|
+
this.freeformOption.selected = false;
|
|
7942
|
+
this.freeformOption.hidden = true;
|
|
7943
|
+
return;
|
|
7944
|
+
}
|
|
7945
|
+
this.freeformOption.value = value;
|
|
7946
|
+
this.freeformOption.hidden = false;
|
|
7947
|
+
}
|
|
7948
|
+
}
|
|
7949
|
+
/**
|
|
7950
|
+
* The form-associated flag.
|
|
7951
|
+
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
|
|
7952
|
+
*
|
|
7953
|
+
* @public
|
|
7954
|
+
*/
|
|
7955
|
+
BaseDropdown.formAssociated = true;
|
|
7956
|
+
__decorateClass$n([volatile], BaseDropdown.prototype, "activeDescendant", 1);
|
|
7957
|
+
__decorateClass$n([observable], BaseDropdown.prototype, "activeIndex", 2);
|
|
7958
|
+
__decorateClass$n([attr({
|
|
7959
|
+
attribute: "aria-labelledby",
|
|
7960
|
+
mode: "fromView"
|
|
7961
|
+
})], BaseDropdown.prototype, "ariaLabelledBy", 2);
|
|
7962
|
+
__decorateClass$n([observable], BaseDropdown.prototype, "control", 2);
|
|
7963
|
+
__decorateClass$n([attr({
|
|
7964
|
+
mode: "boolean"
|
|
7965
|
+
})], BaseDropdown.prototype, "disabled", 2);
|
|
7966
|
+
__decorateClass$n([volatile], BaseDropdown.prototype, "displayValue", 1);
|
|
7967
|
+
__decorateClass$n([attr({
|
|
7968
|
+
attribute: "id"
|
|
7969
|
+
})], BaseDropdown.prototype, "id", 2);
|
|
7970
|
+
__decorateClass$n([observable], BaseDropdown.prototype, "indicator", 2);
|
|
7971
|
+
__decorateClass$n([observable], BaseDropdown.prototype, "indicatorSlot", 2);
|
|
7972
|
+
__decorateClass$n([attr({
|
|
7973
|
+
attribute: "value",
|
|
7974
|
+
mode: "fromView"
|
|
7975
|
+
})], BaseDropdown.prototype, "initialValue", 2);
|
|
7976
|
+
__decorateClass$n([observable], BaseDropdown.prototype, "listbox", 2);
|
|
7977
|
+
__decorateClass$n([observable], BaseDropdown.prototype, "listboxSlot", 2);
|
|
7978
|
+
__decorateClass$n([attr({
|
|
7979
|
+
mode: "boolean"
|
|
7980
|
+
})], BaseDropdown.prototype, "multiple", 2);
|
|
7981
|
+
__decorateClass$n([attr], BaseDropdown.prototype, "name", 2);
|
|
7982
|
+
__decorateClass$n([observable], BaseDropdown.prototype, "open", 2);
|
|
7983
|
+
__decorateClass$n([attr], BaseDropdown.prototype, "placeholder", 2);
|
|
7984
|
+
__decorateClass$n([attr({
|
|
7985
|
+
mode: "boolean"
|
|
7986
|
+
})], BaseDropdown.prototype, "required", 2);
|
|
7987
|
+
__decorateClass$n([attr], BaseDropdown.prototype, "type", 2);
|
|
7988
|
+
__decorateClass$n([attr({
|
|
7989
|
+
attribute: "value"
|
|
7990
|
+
})], BaseDropdown.prototype, "valueAttribute", 2);
|
|
7991
|
+
const _Dropdown = class _Dropdown extends BaseDropdown {
|
|
7992
|
+
constructor() {
|
|
7993
|
+
super();
|
|
7994
|
+
this.appearance = DropdownAppearance.outline;
|
|
7995
|
+
this.addEventListener("connected", this.listboxConnectedHandler);
|
|
7996
|
+
}
|
|
7997
|
+
/**
|
|
7998
|
+
* Swaps appearance states when the appearance property changes.
|
|
7999
|
+
*
|
|
8000
|
+
* @param prev - the previous appearance state
|
|
8001
|
+
* @param next - the current appearance state
|
|
8002
|
+
* @internal
|
|
8003
|
+
*/
|
|
8004
|
+
appearanceChanged(prev, next) {
|
|
8005
|
+
swapStates(this.elementInternals, prev, next, DropdownAppearance);
|
|
8006
|
+
}
|
|
8007
|
+
/**
|
|
8008
|
+
* Swaps size states when the size property changes.
|
|
8009
|
+
*
|
|
8010
|
+
* @param prev - the previous size state
|
|
8011
|
+
* @param next - the current size state
|
|
8012
|
+
* @internal
|
|
8013
|
+
*/
|
|
8014
|
+
sizeChanged(prev, next) {
|
|
8015
|
+
swapStates(this.elementInternals, prev, next, DropdownSize);
|
|
8016
|
+
}
|
|
8017
|
+
connectedCallback() {
|
|
8018
|
+
super.connectedCallback();
|
|
8019
|
+
this.anchorPositionFallback();
|
|
8020
|
+
}
|
|
8021
|
+
disconnectedCallback() {
|
|
8022
|
+
_Dropdown.AnchorPositionFallbackObserver?.unobserve(this.listbox);
|
|
8023
|
+
super.disconnectedCallback();
|
|
8024
|
+
}
|
|
8025
|
+
/**
|
|
8026
|
+
* Handles the connected event for the listbox.
|
|
8027
|
+
*
|
|
8028
|
+
* @param e - the event object
|
|
8029
|
+
* @internal
|
|
7267
8030
|
*/
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
8031
|
+
listboxConnectedHandler(e) {
|
|
8032
|
+
const target = e.target;
|
|
8033
|
+
if (isListbox(target)) {
|
|
8034
|
+
this.listbox = target;
|
|
8035
|
+
}
|
|
7272
8036
|
}
|
|
7273
8037
|
/**
|
|
7274
|
-
*
|
|
7275
|
-
*
|
|
7276
|
-
* @
|
|
7277
|
-
*
|
|
8038
|
+
* Adds or removes the window event listener based on the open state.
|
|
8039
|
+
*
|
|
8040
|
+
* @param prev - the previous open state
|
|
8041
|
+
* @param next - the current open state
|
|
8042
|
+
* @internal
|
|
7278
8043
|
*/
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
if (
|
|
7282
|
-
this.
|
|
8044
|
+
openChanged(prev, next) {
|
|
8045
|
+
super.openChanged(prev, next);
|
|
8046
|
+
if (next) {
|
|
8047
|
+
_Dropdown.AnchorPositionFallbackObserver?.observe(this.listbox);
|
|
8048
|
+
return;
|
|
7283
8049
|
}
|
|
7284
|
-
|
|
8050
|
+
_Dropdown.AnchorPositionFallbackObserver?.unobserve(this.listbox);
|
|
7285
8051
|
}
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
}
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
class DrawerBody extends FASTElement {}
|
|
8052
|
+
/**
|
|
8053
|
+
* When anchor positioning isn't supported, an intersection observer is used to flip the listbox when it hits the
|
|
8054
|
+
* viewport bounds. One static observer is used for all dropdowns.
|
|
8055
|
+
*
|
|
8056
|
+
* @internal
|
|
8057
|
+
*/
|
|
8058
|
+
anchorPositionFallback() {
|
|
8059
|
+
_Dropdown.AnchorPositionFallbackObserver = _Dropdown.AnchorPositionFallbackObserver ?? new IntersectionObserver(entries => {
|
|
8060
|
+
entries.forEach(({
|
|
8061
|
+
boundingClientRect,
|
|
8062
|
+
isIntersecting,
|
|
8063
|
+
target
|
|
8064
|
+
}) => {
|
|
8065
|
+
if (isListbox(target) && !isIntersecting) {
|
|
8066
|
+
if (boundingClientRect.bottom > window.innerHeight) {
|
|
8067
|
+
toggleState(target.dropdown.elementInternals, "flip-block", true);
|
|
8068
|
+
return;
|
|
8069
|
+
}
|
|
8070
|
+
if (boundingClientRect.top < 0) {
|
|
8071
|
+
toggleState(target.dropdown.elementInternals, "flip-block", false);
|
|
8072
|
+
}
|
|
8073
|
+
}
|
|
8074
|
+
});
|
|
8075
|
+
}, {
|
|
8076
|
+
threshold: 1
|
|
8077
|
+
});
|
|
8078
|
+
}
|
|
8079
|
+
};
|
|
8080
|
+
__decorateClass$n([attr], _Dropdown.prototype, "appearance", 2);
|
|
8081
|
+
__decorateClass$n([attr], _Dropdown.prototype, "size", 2);
|
|
8082
|
+
let Dropdown = _Dropdown;
|
|
7319
8083
|
|
|
7320
|
-
const styles$
|
|
7321
|
-
${display("
|
|
7322
|
-
:host{box-sizing:border-box;grid-template-rows:min-content auto min-content;position:relative;height:100%;padding:${spacingHorizontalXL};max-height:100svh}.header{display:flex;justify-content:space-between;align-items:center;${typographySubtitle1Styles}}.footer{display:flex;justify-content:flex-start;gap:${spacingHorizontalM}}`;
|
|
8084
|
+
const styles$q = css`
|
|
8085
|
+
${display("inline-flex")}
|
|
7323
8086
|
|
|
7324
|
-
function
|
|
7325
|
-
return html`<div class="header" part="header"><slot name="title"></slot><slot name="close"></slot></div><div class="content" part="content"><slot></slot></div><div class="footer" part="footer"><slot name="footer"></slot></div>`;
|
|
7326
|
-
}
|
|
7327
|
-
const template$p = drawerBodyTemplate();
|
|
8087
|
+
:host{anchor-name:--dropdown-trigger;box-sizing:border-box;color:${colorNeutralForeground1};cursor:pointer}:host(${placeholderShownState}){color:${colorNeutralForeground4}}.control{appearance:none;background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border:none;box-shadow:inset 0 0 0 ${strokeWidthThin} var(--control-border-color);box-sizing:border-box;color:inherit;column-gap:${spacingHorizontalXXS};display:inline-flex;justify-content:space-between;min-width:160px;overflow:hidden;padding:${spacingVerticalSNudge} ${spacingHorizontalMNudge};position:relative;text-align:start;width:100%;z-index:1;${typographyBody1Styles}}:host(${smallState}) .control{column-gap:${spacingHorizontalXXS};padding:${spacingVerticalXS} ${spacingHorizontalSNudge};${typographyCaption1Styles}}:host(${largeState}) .control{column-gap:${spacingHorizontalS};padding:${spacingVerticalS} ${spacingHorizontalM};${typographyBody2Styles}}::slotted(:is(input,button)){all:unset;flex:1 1 auto}::slotted(button){cursor:pointer}::slotted(input){cursor:text}:where(slot[name='indicator'] > *,::slotted([slot='indicator'])){all:unset;align-items:center;appearance:none;aspect-ratio:1;color:${colorNeutralForeground3};display:inline-flex;justify-content:center;width:20px}:host(${smallState}) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){width:16px}:host(${largeState}) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){width:24px}.control::after,.control::before{content:'' / '';inset:auto 0 0;pointer-events:none;position:absolute}.control::before{height:${strokeWidthThin}}.control::after{background-color:${colorCompoundBrandStroke};height:${strokeWidthThick};scale:0 1;transition:scale ${durationUltraFast} ${curveDecelerateMid}}:host(:where(${openState},:focus-within)) .control::after{scale:1 1;transition-duration:${durationNormal};transition-timing-function:${curveAccelerateMid}}:host(:where(${outlineState},${transparentState})) .control::before{background-color:${colorNeutralStrokeAccessible}}:host(${transparentState}) .control{--control-border-color:${colorTransparentStrokeInteractive};background-color:${colorTransparentBackground};border-radius:${borderRadiusNone}}:host(${outlineState}) .control{--control-border-color:${colorNeutralStroke1}}:host(${outlineState}) .control:hover{--control-border-color:${colorNeutralStroke1Hover}}:host(:where(${outlineState},${transparentState})) .control:hover::before{background-color:${colorNeutralStrokeAccessibleHover}}:host(${outlineState}) .control:hover::after{background-color:${colorCompoundBrandBackgroundHover}}:host(${outlineState}) .control:active{--control-border-color:${colorNeutralStroke1Pressed}}:host(:where(${outlineState},${transparentState})) .control:active::before{background-color:${colorNeutralStrokeAccessiblePressed}}:host(:where(${outlineState},${transparentState})) .control:active::after{background-color:${colorCompoundBrandBackgroundPressed}}:host(${filledDarkerState}) .control{background-color:${colorNeutralBackground3}}:host(:where(${filledLighterState},${filledDarkerState})) .control{--control-border-color:${colorTransparentStroke}}:host(:disabled),:host(:disabled) ::slotted(:where(button,input)){cursor:not-allowed}:host(:disabled) .control::before,:host(:disabled) .control::after{content:none}:host(:disabled) .control:is(*,:active,:hover),:host(:disabled) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){--control-border-color:${colorNeutralStrokeDisabled};background-color:${colorNeutralBackgroundDisabled};color:${colorNeutralForegroundDisabled}}::slotted([popover]){inset:unset;position:absolute;position-anchor:--dropdown-trigger;position-area:block-end span-inline-end;position-try-fallbacks:flip-inline,flip-block,block-start;max-height:var(--listbox-max-height,calc(50vh - anchor-size(self-block)));min-width:anchor-size(width);overflow:auto}::slotted([popover]:not(:popover-open)){display:none}@supports not (anchor-name:--anchor){::slotted([popover]){margin-block-start:calc(${lineHeightBase300} + (${spacingVerticalSNudge} * 2) + ${strokeWidthThin});max-height:50vh}:host(${smallState}) ::slotted([popover]){margin-block-start:calc(${lineHeightBase200} + (${spacingVerticalXS} * 2) + ${strokeWidthThin})}:host(${largeState}) ::slotted([popover]){margin-block-start:calc(${lineHeightBase400} + (${spacingVerticalS} * 2) + ${strokeWidthThin})}:host(${flipBlockState}) ::slotted([popover]){margin-block-start:revert;transform:translate(0,-100%)}}`;
|
|
7328
8088
|
|
|
7329
|
-
const definition$
|
|
7330
|
-
name: `${FluentDesignSystem.prefix}-
|
|
7331
|
-
template: template$
|
|
7332
|
-
styles: styles$
|
|
8089
|
+
const definition$r = Dropdown.compose({
|
|
8090
|
+
name: `${FluentDesignSystem.prefix}-dropdown`,
|
|
8091
|
+
template: template$r,
|
|
8092
|
+
styles: styles$q,
|
|
8093
|
+
shadowOptions: {
|
|
8094
|
+
slotAssignment: "manual"
|
|
8095
|
+
}
|
|
7333
8096
|
});
|
|
7334
8097
|
|
|
7335
|
-
definition$
|
|
8098
|
+
definition$r.define(FluentDesignSystem.registry);
|
|
7336
8099
|
|
|
7337
8100
|
const LabelPosition = {
|
|
7338
8101
|
above: "above",
|
|
@@ -7353,12 +8116,12 @@ const ValidationFlags = {
|
|
|
7353
8116
|
valid: "valid"
|
|
7354
8117
|
};
|
|
7355
8118
|
|
|
7356
|
-
var __defProp$
|
|
7357
|
-
var __getOwnPropDesc$
|
|
7358
|
-
var __decorateClass$
|
|
7359
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8119
|
+
var __defProp$m = Object.defineProperty;
|
|
8120
|
+
var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
|
|
8121
|
+
var __decorateClass$m = (decorators, target, key, kind) => {
|
|
8122
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
|
|
7360
8123
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7361
|
-
if (kind && result) __defProp$
|
|
8124
|
+
if (kind && result) __defProp$m(target, key, result);
|
|
7362
8125
|
return result;
|
|
7363
8126
|
};
|
|
7364
8127
|
class BaseField extends FASTElement {
|
|
@@ -7493,7 +8256,7 @@ class BaseField extends FASTElement {
|
|
|
7493
8256
|
*/
|
|
7494
8257
|
setLabelProperties() {
|
|
7495
8258
|
if (this.$fastController.isConnected) {
|
|
7496
|
-
this.input.id = this.input.id || uniqueId("input");
|
|
8259
|
+
this.input.id = this.input.id || uniqueId$1("input");
|
|
7497
8260
|
this.labelSlot?.forEach(label => {
|
|
7498
8261
|
if (label instanceof HTMLLabelElement) {
|
|
7499
8262
|
label.htmlFor = label.htmlFor || this.input.id;
|
|
@@ -7526,26 +8289,26 @@ class BaseField extends FASTElement {
|
|
|
7526
8289
|
}
|
|
7527
8290
|
}
|
|
7528
8291
|
}
|
|
7529
|
-
__decorateClass$
|
|
7530
|
-
__decorateClass$
|
|
7531
|
-
__decorateClass$
|
|
7532
|
-
__decorateClass$
|
|
8292
|
+
__decorateClass$m([observable], BaseField.prototype, "labelSlot", 2);
|
|
8293
|
+
__decorateClass$m([observable], BaseField.prototype, "messageSlot", 2);
|
|
8294
|
+
__decorateClass$m([observable], BaseField.prototype, "slottedInputs", 2);
|
|
8295
|
+
__decorateClass$m([observable], BaseField.prototype, "input", 2);
|
|
7533
8296
|
class Field extends BaseField {
|
|
7534
8297
|
constructor() {
|
|
7535
8298
|
super(...arguments);
|
|
7536
8299
|
this.labelPosition = LabelPosition.above;
|
|
7537
8300
|
}
|
|
7538
8301
|
}
|
|
7539
|
-
__decorateClass$
|
|
8302
|
+
__decorateClass$m([attr({
|
|
7540
8303
|
attribute: "label-position"
|
|
7541
8304
|
})], Field.prototype, "labelPosition", 2);
|
|
7542
8305
|
|
|
7543
|
-
const styles$
|
|
8306
|
+
const styles$p = css`
|
|
7544
8307
|
${display("inline-grid")}
|
|
7545
8308
|
|
|
7546
8309
|
:host{color:${colorNeutralForeground1};align-items:center;gap:0 ${spacingHorizontalM};justify-items:start;position:relative}:has([slot='message']){color:${colorNeutralForeground1};row-gap:${spacingVerticalS}}:not(::slotted([slot='label'])){gap:0}:host([label-position='before']){grid-template-areas:'label input' 'label message'}:host([label-position='after']){gap:0;grid-template-areas:'input label' 'message message';grid-template-columns:auto 1fr}:host([label-position='after']) ::slotted([slot='input']){margin-inline-end:${spacingHorizontalM}}:host([label-position='above']){grid-template-areas:'label' 'input' 'message';row-gap:${spacingVerticalXXS}}:host([label-position='below']){grid-template-areas:'input' 'label' 'message';justify-items:center}:host([label-position='below']) ::slotted([slot='label']){margin-block-start:${spacingVerticalM}}:host([label-position='below']:not(${hasMessageState})){grid-template-areas:'input' 'label'}::slotted([slot='label'])::after{content:'';display:block;position:absolute;inset:0}::slotted([slot='input']){grid-area:input;position:relative;z-index:1}::slotted([slot='message']){margin-block-start:${spacingVerticalXXS};grid-area:message}:host(${focusVisibleState}:focus-within){border-radius:${borderRadiusMedium};outline:${strokeWidthThick} solid ${colorStrokeFocus2}}::slotted(label),::slotted([slot='label']){cursor:inherit;display:inline-flex;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};grid-area:label;line-height:${lineHeightBase300};user-select:none}:host([size='small']) ::slotted(label){font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host([size='large']) ::slotted(label){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='large']) ::slotted(label),:host([weight='semibold']) ::slotted(label){font-weight:${fontWeightSemibold}}:host(${disabledState}){cursor:default}::slotted([flag]){display:none}:host(${badInputState}) ::slotted([flag='${ValidationFlags.badInput}']),:host(${customErrorState}) ::slotted([flag='${ValidationFlags.customError}']),:host(${patternMismatchState}) ::slotted([flag='${ValidationFlags.patternMismatch}']),:host(${rangeOverflowState}) ::slotted([flag='${ValidationFlags.rangeOverflow}']),:host(${rangeUnderflowState}) ::slotted([flag='${ValidationFlags.rangeUnderflow}']),:host(${stepMismatchState}) ::slotted([flag='${ValidationFlags.stepMismatch}']),:host(${tooLongState}) ::slotted([flag='${ValidationFlags.tooLong}']),:host(${tooShortState}) ::slotted([flag='${ValidationFlags.tooShort}']),:host(${typeMismatchState}) ::slotted([flag='${ValidationFlags.typeMismatch}']),:host(${valueMissingState}) ::slotted([flag='${ValidationFlags.valueMissing}']),:host(${validState}) ::slotted([flag='${ValidationFlags.valid}']){display:block}`;
|
|
7547
8310
|
|
|
7548
|
-
const template$
|
|
8311
|
+
const template$q = html`<template @click="${(x, c) => x.clickHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" ${children({
|
|
7549
8312
|
property: "slottedInputs",
|
|
7550
8313
|
attributes: true,
|
|
7551
8314
|
attributeFilter: ["disabled", "required", "readonly"],
|
|
@@ -7557,16 +8320,16 @@ const template$o = html`<template @click="${(x, c) => x.clickHandler(c.event)}"
|
|
|
7557
8320
|
filter: elements("[flag]")
|
|
7558
8321
|
})}></slot></template>`;
|
|
7559
8322
|
|
|
7560
|
-
const definition$
|
|
8323
|
+
const definition$q = Field.compose({
|
|
7561
8324
|
name: `${FluentDesignSystem.prefix}-field`,
|
|
7562
|
-
template: template$
|
|
7563
|
-
styles: styles$
|
|
8325
|
+
template: template$q,
|
|
8326
|
+
styles: styles$p,
|
|
7564
8327
|
shadowOptions: {
|
|
7565
8328
|
delegatesFocus: true
|
|
7566
8329
|
}
|
|
7567
8330
|
});
|
|
7568
8331
|
|
|
7569
|
-
definition$
|
|
8332
|
+
definition$q.define(FluentDesignSystem.registry);
|
|
7570
8333
|
|
|
7571
8334
|
const ImageFit = {
|
|
7572
8335
|
none: "none",
|
|
@@ -7580,12 +8343,12 @@ const ImageShape = {
|
|
|
7580
8343
|
square: "square"
|
|
7581
8344
|
};
|
|
7582
8345
|
|
|
7583
|
-
var __defProp$
|
|
7584
|
-
var __getOwnPropDesc$
|
|
7585
|
-
var __decorateClass$
|
|
7586
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8346
|
+
var __defProp$l = Object.defineProperty;
|
|
8347
|
+
var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
|
|
8348
|
+
var __decorateClass$l = (decorators, target, key, kind) => {
|
|
8349
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
|
|
7587
8350
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7588
|
-
if (kind && result) __defProp$
|
|
8351
|
+
if (kind && result) __defProp$l(target, key, result);
|
|
7589
8352
|
return result;
|
|
7590
8353
|
};
|
|
7591
8354
|
class Image extends FASTElement {
|
|
@@ -7639,30 +8402,30 @@ class Image extends FASTElement {
|
|
|
7639
8402
|
swapStates(this.elementInternals, prev, next, ImageShape);
|
|
7640
8403
|
}
|
|
7641
8404
|
}
|
|
7642
|
-
__decorateClass$
|
|
8405
|
+
__decorateClass$l([attr({
|
|
7643
8406
|
mode: "boolean"
|
|
7644
8407
|
})], Image.prototype, "block", 2);
|
|
7645
|
-
__decorateClass$
|
|
8408
|
+
__decorateClass$l([attr({
|
|
7646
8409
|
mode: "boolean"
|
|
7647
8410
|
})], Image.prototype, "bordered", 2);
|
|
7648
|
-
__decorateClass$
|
|
8411
|
+
__decorateClass$l([attr({
|
|
7649
8412
|
mode: "boolean"
|
|
7650
8413
|
})], Image.prototype, "shadow", 2);
|
|
7651
|
-
__decorateClass$
|
|
7652
|
-
__decorateClass$
|
|
8414
|
+
__decorateClass$l([attr], Image.prototype, "fit", 2);
|
|
8415
|
+
__decorateClass$l([attr], Image.prototype, "shape", 2);
|
|
7653
8416
|
|
|
7654
|
-
const template$
|
|
8417
|
+
const template$p = html`<slot></slot>`;
|
|
7655
8418
|
|
|
7656
|
-
const styles$
|
|
8419
|
+
const styles$o = css`
|
|
7657
8420
|
:host{contain:content}:host ::slotted(img){box-sizing:border-box;min-height:8px;min-width:8px;display:inline-block}:host(${blockState}) ::slotted(img){width:100%;height:auto}:host(${borderedState}) ::slotted(img){border:${strokeWidthThin} solid ${colorNeutralStroke2}}:host(${fitNoneState}) ::slotted(img){object-fit:none;object-position:top left;height:100%;width:100%}:host(${fitCenterState}) ::slotted(img){object-fit:none;object-position:center;height:100%;width:100%}:host(${fitContainState}) ::slotted(img){object-fit:contain;object-position:center;height:100%;width:100%}:host(${fitCoverState}) ::slotted(img){object-fit:cover;object-position:center;height:100%;width:100%}:host(${shadowState}) ::slotted(img){box-shadow:${shadow4}}:host(${circularState}) ::slotted(img){border-radius:${borderRadiusCircular}}:host(${roundedState}) ::slotted(img){border-radius:${borderRadiusMedium}}`;
|
|
7658
8421
|
|
|
7659
|
-
const definition$
|
|
8422
|
+
const definition$p = Image.compose({
|
|
7660
8423
|
name: `${FluentDesignSystem.prefix}-image`,
|
|
7661
|
-
template: template$
|
|
7662
|
-
styles: styles$
|
|
8424
|
+
template: template$p,
|
|
8425
|
+
styles: styles$o
|
|
7663
8426
|
});
|
|
7664
8427
|
|
|
7665
|
-
definition$
|
|
8428
|
+
definition$p.define(FluentDesignSystem.registry);
|
|
7666
8429
|
|
|
7667
8430
|
const LabelSize = {
|
|
7668
8431
|
small: "small",
|
|
@@ -7674,12 +8437,12 @@ const LabelWeight = {
|
|
|
7674
8437
|
semibold: "semibold"
|
|
7675
8438
|
};
|
|
7676
8439
|
|
|
7677
|
-
var __defProp$
|
|
7678
|
-
var __getOwnPropDesc$
|
|
7679
|
-
var __decorateClass$
|
|
7680
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8440
|
+
var __defProp$k = Object.defineProperty;
|
|
8441
|
+
var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
|
|
8442
|
+
var __decorateClass$k = (decorators, target, key, kind) => {
|
|
8443
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
|
|
7681
8444
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7682
|
-
if (kind && result) __defProp$
|
|
8445
|
+
if (kind && result) __defProp$k(target, key, result);
|
|
7683
8446
|
return result;
|
|
7684
8447
|
};
|
|
7685
8448
|
class Label extends FASTElement {
|
|
@@ -7719,16 +8482,16 @@ class Label extends FASTElement {
|
|
|
7719
8482
|
toggleState(this.elementInternals, "disabled", next);
|
|
7720
8483
|
}
|
|
7721
8484
|
}
|
|
7722
|
-
__decorateClass$
|
|
7723
|
-
__decorateClass$
|
|
7724
|
-
__decorateClass$
|
|
8485
|
+
__decorateClass$k([attr], Label.prototype, "size", 2);
|
|
8486
|
+
__decorateClass$k([attr], Label.prototype, "weight", 2);
|
|
8487
|
+
__decorateClass$k([attr({
|
|
7725
8488
|
mode: "boolean"
|
|
7726
8489
|
})], Label.prototype, "disabled", 2);
|
|
7727
|
-
__decorateClass$
|
|
8490
|
+
__decorateClass$k([attr({
|
|
7728
8491
|
mode: "boolean"
|
|
7729
8492
|
})], Label.prototype, "required", 2);
|
|
7730
8493
|
|
|
7731
|
-
const styles$
|
|
8494
|
+
const styles$n = css`
|
|
7732
8495
|
${display("inline-flex")}
|
|
7733
8496
|
|
|
7734
8497
|
:host{color:${colorNeutralForeground1};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};user-select:none}.asterisk{color:${colorPaletteRedForeground1};margin-inline-start:${spacingHorizontalXS}}:host(${smallState}){font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host(${largeState}){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host(:is(${largeState},${semiboldState})){font-weight:${fontWeightSemibold}}:host(${disabledState}),:host(${disabledState}) .asterisk{color:${colorNeutralForegroundDisabled}}`;
|
|
@@ -7736,26 +8499,26 @@ const styles$l = css`
|
|
|
7736
8499
|
function labelTemplate() {
|
|
7737
8500
|
return html`<slot></slot><span part="asterisk" class="asterisk" ?hidden="${x => !x.required}">*</span>`;
|
|
7738
8501
|
}
|
|
7739
|
-
const template$
|
|
8502
|
+
const template$o = labelTemplate();
|
|
7740
8503
|
|
|
7741
|
-
const definition$
|
|
8504
|
+
const definition$o = Label.compose({
|
|
7742
8505
|
name: `${FluentDesignSystem.prefix}-label`,
|
|
7743
|
-
template: template$
|
|
7744
|
-
styles: styles$
|
|
8506
|
+
template: template$o,
|
|
8507
|
+
styles: styles$n
|
|
7745
8508
|
});
|
|
7746
8509
|
|
|
7747
|
-
definition$
|
|
8510
|
+
definition$o.define(FluentDesignSystem.registry);
|
|
7748
8511
|
|
|
7749
8512
|
const LinkAppearance = {
|
|
7750
8513
|
subtle: "subtle"
|
|
7751
8514
|
};
|
|
7752
8515
|
|
|
7753
|
-
var __defProp$
|
|
7754
|
-
var __getOwnPropDesc$
|
|
7755
|
-
var __decorateClass$
|
|
7756
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8516
|
+
var __defProp$j = Object.defineProperty;
|
|
8517
|
+
var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
|
|
8518
|
+
var __decorateClass$j = (decorators, target, key, kind) => {
|
|
8519
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
|
|
7757
8520
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7758
|
-
if (kind && result) __defProp$
|
|
8521
|
+
if (kind && result) __defProp$j(target, key, result);
|
|
7759
8522
|
return result;
|
|
7760
8523
|
};
|
|
7761
8524
|
class Link extends BaseAnchor {
|
|
@@ -7780,12 +8543,12 @@ class Link extends BaseAnchor {
|
|
|
7780
8543
|
toggleState(this.elementInternals, "inline", next);
|
|
7781
8544
|
}
|
|
7782
8545
|
}
|
|
7783
|
-
__decorateClass$
|
|
7784
|
-
__decorateClass$
|
|
8546
|
+
__decorateClass$j([attr], Link.prototype, "appearance", 2);
|
|
8547
|
+
__decorateClass$j([attr({
|
|
7785
8548
|
mode: "boolean"
|
|
7786
8549
|
})], Link.prototype, "inline", 2);
|
|
7787
8550
|
|
|
7788
|
-
const styles$
|
|
8551
|
+
const styles$m = css`
|
|
7789
8552
|
${display("inline")}
|
|
7790
8553
|
|
|
7791
8554
|
:host{position:relative;box-sizing:border-box;background-color:transparent;color:${colorBrandForegroundLink};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};overflow:inherit;text-align:start;text-decoration:none;text-decoration-thickness:${strokeWidthThin};text-overflow:inherit;user-select:text}:host(:is(:hover,:focus-visible)){outline:none;text-decoration-line:underline}@media (hover:hover){:host(:hover){color:${colorBrandForegroundLinkHover}}:host(:active){color:${colorBrandForegroundLinkPressed}}:host(${subtleState}:hover){color:${colorNeutralForeground2LinkHover}}:host(${subtleState}:active){color:${colorNeutralForeground2LinkPressed}}}:host(${subtleState}){color:${colorNeutralForeground2Link}}:host-context(:is(h1,h2,h3,h4,h5,h6,p,fluent-text)),:host(${inlineState}){font:inherit;text-decoration:underline}:host(:not([href])){color:inherit;text-decoration:none}::slotted(a){position:absolute;inset:0}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
@@ -7794,19 +8557,189 @@ const styles$k = css`
|
|
|
7794
8557
|
function anchorTemplate() {
|
|
7795
8558
|
return html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot></slot></template>`;
|
|
7796
8559
|
}
|
|
7797
|
-
const template$
|
|
8560
|
+
const template$n = anchorTemplate();
|
|
7798
8561
|
|
|
7799
|
-
const definition$
|
|
8562
|
+
const definition$n = Link.compose({
|
|
7800
8563
|
name: `${FluentDesignSystem.prefix}-link`,
|
|
7801
|
-
template: template$
|
|
7802
|
-
styles: styles$
|
|
8564
|
+
template: template$n,
|
|
8565
|
+
styles: styles$m
|
|
8566
|
+
});
|
|
8567
|
+
|
|
8568
|
+
definition$n.define(FluentDesignSystem.registry);
|
|
8569
|
+
|
|
8570
|
+
var __defProp$i = Object.defineProperty;
|
|
8571
|
+
var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
|
|
8572
|
+
var __decorateClass$i = (decorators, target, key, kind) => {
|
|
8573
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
|
|
8574
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8575
|
+
if (kind && result) __defProp$i(target, key, result);
|
|
8576
|
+
return result;
|
|
8577
|
+
};
|
|
8578
|
+
class Listbox extends FASTElement {
|
|
8579
|
+
constructor() {
|
|
8580
|
+
super();
|
|
8581
|
+
this.id = uniqueId("listbox-");
|
|
8582
|
+
/**
|
|
8583
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
8584
|
+
*
|
|
8585
|
+
* @internal
|
|
8586
|
+
*/
|
|
8587
|
+
this.elementInternals = this.attachInternals();
|
|
8588
|
+
this.elementInternals.role = "listbox";
|
|
8589
|
+
}
|
|
8590
|
+
/**
|
|
8591
|
+
* Updates the multiple selection state of the listbox and its options.
|
|
8592
|
+
*
|
|
8593
|
+
* @param prev - the previous multiple value
|
|
8594
|
+
* @param next - the current multiple value
|
|
8595
|
+
*/
|
|
8596
|
+
multipleChanged(prev, next) {
|
|
8597
|
+
this.elementInternals.ariaMultiSelectable = next ? "true" : "false";
|
|
8598
|
+
toggleState(this.elementInternals, "multiple", next);
|
|
8599
|
+
Updates.enqueue(() => {
|
|
8600
|
+
this.options.forEach(x => {
|
|
8601
|
+
x.multiple = !!next;
|
|
8602
|
+
});
|
|
8603
|
+
});
|
|
8604
|
+
}
|
|
8605
|
+
/**
|
|
8606
|
+
* Updates the enabled options collection when properties on the child options change.
|
|
8607
|
+
*
|
|
8608
|
+
* @param prev - the previous options
|
|
8609
|
+
* @param next - the current options
|
|
8610
|
+
*
|
|
8611
|
+
* @internal
|
|
8612
|
+
*/
|
|
8613
|
+
optionsChanged(prev, next) {
|
|
8614
|
+
next?.forEach((option, index) => {
|
|
8615
|
+
option.elementInternals.ariaPosInSet = `${index + 1}`;
|
|
8616
|
+
option.elementInternals.ariaSetSize = `${next.length}`;
|
|
8617
|
+
});
|
|
8618
|
+
}
|
|
8619
|
+
/**
|
|
8620
|
+
* Handles the `beforetoggle` event on the listbox.
|
|
8621
|
+
*
|
|
8622
|
+
* @param e - the toggle event
|
|
8623
|
+
* @returns true to allow the default popover behavior, undefined to prevent it
|
|
8624
|
+
* @internal
|
|
8625
|
+
*/
|
|
8626
|
+
beforetoggleHandler(e) {
|
|
8627
|
+
if (!this.dropdown) {
|
|
8628
|
+
return true;
|
|
8629
|
+
}
|
|
8630
|
+
if (this.dropdown.disabled) {
|
|
8631
|
+
this.dropdown.open = false;
|
|
8632
|
+
return;
|
|
8633
|
+
}
|
|
8634
|
+
this.dropdown.open = e.newState === "open";
|
|
8635
|
+
return true;
|
|
8636
|
+
}
|
|
8637
|
+
/**
|
|
8638
|
+
* The collection of child options that are not disabled.
|
|
8639
|
+
*
|
|
8640
|
+
* @internal
|
|
8641
|
+
*/
|
|
8642
|
+
get enabledOptions() {
|
|
8643
|
+
return this.options?.filter(x => !x.disabled) ?? [];
|
|
8644
|
+
}
|
|
8645
|
+
/**
|
|
8646
|
+
* The collection of child options that are selected.
|
|
8647
|
+
*
|
|
8648
|
+
* @public
|
|
8649
|
+
*/
|
|
8650
|
+
get selectedOptions() {
|
|
8651
|
+
return this.options?.filter(x => x.selected) ?? [];
|
|
8652
|
+
}
|
|
8653
|
+
/**
|
|
8654
|
+
* Sets the `selected` state on a target option when clicked.
|
|
8655
|
+
*
|
|
8656
|
+
* @param e - The pointer event
|
|
8657
|
+
* @public
|
|
8658
|
+
*/
|
|
8659
|
+
clickHandler(e) {
|
|
8660
|
+
const target = e.target;
|
|
8661
|
+
if (isDropdownOption(target)) {
|
|
8662
|
+
this.selectOption(this.enabledOptions.indexOf(target));
|
|
8663
|
+
}
|
|
8664
|
+
return true;
|
|
8665
|
+
}
|
|
8666
|
+
connectedCallback() {
|
|
8667
|
+
super.connectedCallback();
|
|
8668
|
+
this.$emit("connected");
|
|
8669
|
+
}
|
|
8670
|
+
/**
|
|
8671
|
+
* Handles observable subscriptions for the listbox.
|
|
8672
|
+
*
|
|
8673
|
+
* @param source - The source of the observed change
|
|
8674
|
+
* @param propertyName - The name of the property that changed
|
|
8675
|
+
*
|
|
8676
|
+
* @internal
|
|
8677
|
+
*/
|
|
8678
|
+
handleChange(source, propertyName) {
|
|
8679
|
+
if (propertyName === "multiple") {
|
|
8680
|
+
this.multiple = source.multiple;
|
|
8681
|
+
return;
|
|
8682
|
+
}
|
|
8683
|
+
}
|
|
8684
|
+
/**
|
|
8685
|
+
* Selects an option by index.
|
|
8686
|
+
*
|
|
8687
|
+
* @param index - The index of the option to select.
|
|
8688
|
+
* @public
|
|
8689
|
+
*/
|
|
8690
|
+
selectOption(index = this.selectedIndex) {
|
|
8691
|
+
let selectedIndex = this.selectedIndex;
|
|
8692
|
+
if (!this.multiple) {
|
|
8693
|
+
this.enabledOptions.forEach((item, i) => {
|
|
8694
|
+
const shouldCheck = i === index;
|
|
8695
|
+
item.selected = shouldCheck;
|
|
8696
|
+
if (shouldCheck) {
|
|
8697
|
+
selectedIndex = i;
|
|
8698
|
+
}
|
|
8699
|
+
});
|
|
8700
|
+
} else {
|
|
8701
|
+
const option = this.enabledOptions[index];
|
|
8702
|
+
if (option) {
|
|
8703
|
+
option.selected = !option.selected;
|
|
8704
|
+
}
|
|
8705
|
+
selectedIndex = index;
|
|
8706
|
+
}
|
|
8707
|
+
this.selectedIndex = selectedIndex;
|
|
8708
|
+
}
|
|
8709
|
+
}
|
|
8710
|
+
__decorateClass$i([attr({
|
|
8711
|
+
attribute: "id",
|
|
8712
|
+
mode: "fromView"
|
|
8713
|
+
})], Listbox.prototype, "id", 2);
|
|
8714
|
+
__decorateClass$i([observable], Listbox.prototype, "multiple", 2);
|
|
8715
|
+
__decorateClass$i([observable], Listbox.prototype, "options", 2);
|
|
8716
|
+
__decorateClass$i([observable], Listbox.prototype, "selectedIndex", 2);
|
|
8717
|
+
__decorateClass$i([observable], Listbox.prototype, "dropdown", 2);
|
|
8718
|
+
|
|
8719
|
+
const styles$l = css`
|
|
8720
|
+
${display("inline-flex")}
|
|
8721
|
+
|
|
8722
|
+
:host{background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border:none;box-shadow:${shadow16};box-sizing:border-box;flex-direction:column;margin:0;min-width:160px;padding:${spacingHorizontalXS};row-gap:${spacingHorizontalXXS};width:auto}`;
|
|
8723
|
+
|
|
8724
|
+
function listboxTemplate() {
|
|
8725
|
+
return html`<template id="${x => x.id}" @beforetoggle="${(x, c) => x.beforetoggleHandler(c.event)}" @click="${(x, c) => x.clickHandler(c.event)}"><slot ${slotted({
|
|
8726
|
+
property: "options",
|
|
8727
|
+
filter: node => isDropdownOption(node)
|
|
8728
|
+
})}></slot></template>`;
|
|
8729
|
+
}
|
|
8730
|
+
const template$m = listboxTemplate();
|
|
8731
|
+
|
|
8732
|
+
const definition$m = Listbox.compose({
|
|
8733
|
+
name: `${FluentDesignSystem.prefix}-listbox`,
|
|
8734
|
+
template: template$m,
|
|
8735
|
+
styles: styles$l
|
|
7803
8736
|
});
|
|
7804
8737
|
|
|
7805
|
-
definition$
|
|
8738
|
+
definition$m.define(FluentDesignSystem.registry);
|
|
7806
8739
|
|
|
7807
8740
|
class MenuButton extends Button {}
|
|
7808
8741
|
|
|
7809
|
-
const template$
|
|
8742
|
+
const template$l = buttonTemplate$1({
|
|
7810
8743
|
end: html.partial( /* html */
|
|
7811
8744
|
`
|
|
7812
8745
|
<svg slot="end" fill="currentColor" aria-hidden="true" width="1em" height="1em" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -7815,13 +8748,13 @@ const template$k = buttonTemplate$1({
|
|
|
7815
8748
|
`)
|
|
7816
8749
|
});
|
|
7817
8750
|
|
|
7818
|
-
const definition$
|
|
8751
|
+
const definition$l = MenuButton.compose({
|
|
7819
8752
|
name: `${FluentDesignSystem.prefix}-menu-button`,
|
|
7820
|
-
template: template$
|
|
7821
|
-
styles: styles$
|
|
8753
|
+
template: template$l,
|
|
8754
|
+
styles: styles$C
|
|
7822
8755
|
});
|
|
7823
8756
|
|
|
7824
|
-
definition$
|
|
8757
|
+
definition$l.define(FluentDesignSystem.registry);
|
|
7825
8758
|
|
|
7826
8759
|
const MenuItemRole = {
|
|
7827
8760
|
/**
|
|
@@ -7843,12 +8776,12 @@ const MenuItemRole = {
|
|
|
7843
8776
|
[MenuItemRole.menuitemradio]: "menuitemradio"
|
|
7844
8777
|
});
|
|
7845
8778
|
|
|
7846
|
-
var __defProp$
|
|
7847
|
-
var __getOwnPropDesc$
|
|
7848
|
-
var __decorateClass$
|
|
7849
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8779
|
+
var __defProp$h = Object.defineProperty;
|
|
8780
|
+
var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
|
|
8781
|
+
var __decorateClass$h = (decorators, target, key, kind) => {
|
|
8782
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
|
|
7850
8783
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7851
|
-
if (kind && result) __defProp$
|
|
8784
|
+
if (kind && result) __defProp$h(target, key, result);
|
|
7852
8785
|
return result;
|
|
7853
8786
|
};
|
|
7854
8787
|
const menuFilter = () => value => value.nodeType === 1 && value.elementInternals.role === "menu";
|
|
@@ -8038,21 +8971,21 @@ class MenuItem extends FASTElement {
|
|
|
8038
8971
|
this.elementInternals.ariaChecked = this.role !== MenuItemRole.menuitem ? `${!!this.checked}` : null;
|
|
8039
8972
|
}
|
|
8040
8973
|
}
|
|
8041
|
-
__decorateClass$
|
|
8974
|
+
__decorateClass$h([attr({
|
|
8042
8975
|
mode: "boolean"
|
|
8043
8976
|
})], MenuItem.prototype, "disabled", 2);
|
|
8044
|
-
__decorateClass$
|
|
8045
|
-
__decorateClass$
|
|
8977
|
+
__decorateClass$h([attr], MenuItem.prototype, "role", 2);
|
|
8978
|
+
__decorateClass$h([attr({
|
|
8046
8979
|
mode: "boolean"
|
|
8047
8980
|
})], MenuItem.prototype, "checked", 2);
|
|
8048
|
-
__decorateClass$
|
|
8981
|
+
__decorateClass$h([attr({
|
|
8049
8982
|
mode: "boolean"
|
|
8050
8983
|
})], MenuItem.prototype, "hidden", 2);
|
|
8051
|
-
__decorateClass$
|
|
8052
|
-
__decorateClass$
|
|
8984
|
+
__decorateClass$h([observable], MenuItem.prototype, "slottedSubmenu", 2);
|
|
8985
|
+
__decorateClass$h([observable], MenuItem.prototype, "submenu", 2);
|
|
8053
8986
|
applyMixins(MenuItem, StartEnd);
|
|
8054
8987
|
|
|
8055
|
-
const styles$
|
|
8988
|
+
const styles$k = css`
|
|
8056
8989
|
${display("grid")}
|
|
8057
8990
|
|
|
8058
8991
|
:host{--indent:0;align-items:center;background:${colorNeutralBackground1};border-radius:${borderRadiusMedium};color:${colorNeutralForeground2};contain:layout;cursor:pointer;flex-shrink:0;font:${fontWeightRegular} ${fontSizeBase300} / ${lineHeightBase300} ${fontFamilyBase};grid-gap:4px;grid-template-columns:20px 20px auto 20px;height:32px;overflow:visible;padding:0 10px}:host(:hover){background:${colorNeutralBackground1Hover};color:${colorNeutralForeground2Hover}}:host(:active){background-color:${colorNeutralBackground1Selected};color:${colorNeutralForeground2Pressed}}:host(:active) ::slotted([slot='start']){color:${colorCompoundBrandForeground1Pressed}}:host(${disabledState}){background-color:${colorNeutralBackgroundDisabled};color:${colorNeutralForegroundDisabled}}:host(${disabledState}) ::slotted([slot='start']),:host(${disabledState}) ::slotted([slot='end']){color:${colorNeutralForegroundDisabled}}:host(:focus-visible){border-radius:${borderRadiusMedium};outline:2px solid ${colorStrokeFocus2}}.content{white-space:nowrap;flex-grow:1;grid-column:auto / span 2;padding:0 2px}:host(:not(${checkedState})) .indicator,:host(:not(${checkedState})) ::slotted([slot='indicator']),:host(:not(${submenuState})) .submenu-glyph,:host(:not(${submenuState})) ::slotted([slot='submenu-glyph']){display:none}::slotted([slot='end']){color:${colorNeutralForeground3};font:${fontWeightRegular} ${fontSizeBase200} / ${lineHeightBase200} ${fontFamilyBase};white-space:nowrap}:host([data-indent='1']){--indent:1}:host([data-indent='2']){--indent:2;grid-template-columns:20px 20px auto auto}:host(${submenuState}){grid-template-columns:20px auto auto 20px}:host([data-indent='2']${submenuState}){grid-template-columns:20px 20px auto auto 20px}.indicator,::slotted([slot='indicator']){grid-column:1 / span 1;width:20px}::slotted([slot='start']){display:inline-flex;grid-column:calc(var(--indent)) / span 1}.content{grid-column:calc(var(--indent) + 1) / span 1}::slotted([slot='end']){grid-column:calc(var(--indent) + 2) / span 1;justify-self:end}.submenu-glyph,::slotted([slot='submenu-glyph']){grid-column:-2 / span 1;justify-self:end}@layer popover{:host{anchor-name:--menu-trigger;position:relative}::slotted([popover]){margin:0;max-height:var(--menu-max-height,auto);position:absolute;position-anchor:--menu-trigger;position-area:inline-end span-block-end;position-try-fallbacks:flip-inline;z-index:1}::slotted([popover]:not(:popover-open)){display:none}::slotted([popover]:popover-open){inset:unset}@supports not (anchor-name:--menu-trigger){::slotted([popover]){align-self:start}}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
@@ -8066,25 +8999,25 @@ function menuItemTemplate(options = {}) {
|
|
|
8066
8999
|
filter: menuFilter()
|
|
8067
9000
|
})}></slot></template>`;
|
|
8068
9001
|
}
|
|
8069
|
-
const template$
|
|
9002
|
+
const template$k = menuItemTemplate({
|
|
8070
9003
|
indicator: Checkmark16Filled,
|
|
8071
9004
|
submenuGlyph: chevronRight16Filled
|
|
8072
9005
|
});
|
|
8073
9006
|
|
|
8074
|
-
const definition$
|
|
9007
|
+
const definition$k = MenuItem.compose({
|
|
8075
9008
|
name: `${FluentDesignSystem.prefix}-menu-item`,
|
|
8076
|
-
template: template$
|
|
8077
|
-
styles: styles$
|
|
9009
|
+
template: template$k,
|
|
9010
|
+
styles: styles$k
|
|
8078
9011
|
});
|
|
8079
9012
|
|
|
8080
|
-
definition$
|
|
9013
|
+
definition$k.define(FluentDesignSystem.registry);
|
|
8081
9014
|
|
|
8082
|
-
var __defProp$
|
|
8083
|
-
var __getOwnPropDesc$
|
|
8084
|
-
var __decorateClass$
|
|
8085
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
9015
|
+
var __defProp$g = Object.defineProperty;
|
|
9016
|
+
var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
|
|
9017
|
+
var __decorateClass$g = (decorators, target, key, kind) => {
|
|
9018
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
|
|
8086
9019
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8087
|
-
if (kind && result) __defProp$
|
|
9020
|
+
if (kind && result) __defProp$g(target, key, result);
|
|
8088
9021
|
return result;
|
|
8089
9022
|
};
|
|
8090
9023
|
const _MenuList = class _MenuList extends FASTElement {
|
|
@@ -8300,10 +9233,10 @@ const _MenuList = class _MenuList extends FASTElement {
|
|
|
8300
9233
|
}
|
|
8301
9234
|
};
|
|
8302
9235
|
_MenuList.focusableElementRoles = MenuItemRole;
|
|
8303
|
-
__decorateClass$
|
|
9236
|
+
__decorateClass$g([observable], _MenuList.prototype, "items", 2);
|
|
8304
9237
|
let MenuList = _MenuList;
|
|
8305
9238
|
|
|
8306
|
-
const styles$
|
|
9239
|
+
const styles$j = css`
|
|
8307
9240
|
${display("flex")}
|
|
8308
9241
|
|
|
8309
9242
|
:host{flex-direction:column;height:fit-content;max-width:300px;min-width:160px;width:auto;background-color:${colorNeutralBackground1};border:1px solid ${colorTransparentStroke};border-radius:${borderRadiusMedium};box-shadow:${shadow16};padding:4px;row-gap:2px}`;
|
|
@@ -8311,22 +9244,22 @@ const styles$i = css`
|
|
|
8311
9244
|
function menuTemplate$1() {
|
|
8312
9245
|
return html`<template slot="${x => x.slot ? x.slot : x.isNestedMenu() ? "submenu" : void 0}" @keydown="${(x, c) => x.handleMenuKeyDown(c.event)}" @focusout="${(x, c) => x.handleFocusOut(c.event)}"><slot ${slotted("items")}></slot></template>`;
|
|
8313
9246
|
}
|
|
8314
|
-
const template$
|
|
9247
|
+
const template$j = menuTemplate$1();
|
|
8315
9248
|
|
|
8316
|
-
const definition$
|
|
9249
|
+
const definition$j = MenuList.compose({
|
|
8317
9250
|
name: `${FluentDesignSystem.prefix}-menu-list`,
|
|
8318
|
-
template: template$
|
|
8319
|
-
styles: styles$
|
|
9251
|
+
template: template$j,
|
|
9252
|
+
styles: styles$j
|
|
8320
9253
|
});
|
|
8321
9254
|
|
|
8322
|
-
definition$
|
|
9255
|
+
definition$j.define(FluentDesignSystem.registry);
|
|
8323
9256
|
|
|
8324
|
-
var __defProp$
|
|
8325
|
-
var __getOwnPropDesc$
|
|
8326
|
-
var __decorateClass$
|
|
8327
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
9257
|
+
var __defProp$f = Object.defineProperty;
|
|
9258
|
+
var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
|
|
9259
|
+
var __decorateClass$f = (decorators, target, key, kind) => {
|
|
9260
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
|
|
8328
9261
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8329
|
-
if (kind && result) __defProp$
|
|
9262
|
+
if (kind && result) __defProp$f(target, key, result);
|
|
8330
9263
|
return result;
|
|
8331
9264
|
};
|
|
8332
9265
|
class Menu extends FASTElement {
|
|
@@ -8606,30 +9539,30 @@ class Menu extends FASTElement {
|
|
|
8606
9539
|
}
|
|
8607
9540
|
}
|
|
8608
9541
|
}
|
|
8609
|
-
__decorateClass$
|
|
9542
|
+
__decorateClass$f([attr({
|
|
8610
9543
|
attribute: "open-on-hover",
|
|
8611
9544
|
mode: "boolean"
|
|
8612
9545
|
})], Menu.prototype, "openOnHover", 2);
|
|
8613
|
-
__decorateClass$
|
|
9546
|
+
__decorateClass$f([attr({
|
|
8614
9547
|
attribute: "open-on-context",
|
|
8615
9548
|
mode: "boolean"
|
|
8616
9549
|
})], Menu.prototype, "openOnContext", 2);
|
|
8617
|
-
__decorateClass$
|
|
9550
|
+
__decorateClass$f([attr({
|
|
8618
9551
|
attribute: "close-on-scroll",
|
|
8619
9552
|
mode: "boolean"
|
|
8620
9553
|
})], Menu.prototype, "closeOnScroll", 2);
|
|
8621
|
-
__decorateClass$
|
|
9554
|
+
__decorateClass$f([attr({
|
|
8622
9555
|
attribute: "persist-on-item-click",
|
|
8623
9556
|
mode: "boolean"
|
|
8624
9557
|
})], Menu.prototype, "persistOnItemClick", 2);
|
|
8625
|
-
__decorateClass$
|
|
9558
|
+
__decorateClass$f([attr({
|
|
8626
9559
|
mode: "boolean"
|
|
8627
9560
|
})], Menu.prototype, "split", 2);
|
|
8628
|
-
__decorateClass$
|
|
8629
|
-
__decorateClass$
|
|
8630
|
-
__decorateClass$
|
|
9561
|
+
__decorateClass$f([observable], Menu.prototype, "slottedMenuList", 2);
|
|
9562
|
+
__decorateClass$f([observable], Menu.prototype, "slottedTriggers", 2);
|
|
9563
|
+
__decorateClass$f([observable], Menu.prototype, "primaryAction", 2);
|
|
8631
9564
|
|
|
8632
|
-
const styles$
|
|
9565
|
+
const styles$i = css`
|
|
8633
9566
|
${display("inline-block")}
|
|
8634
9567
|
|
|
8635
9568
|
::slotted([slot='trigger']){anchor-name:--menu-trigger}::slotted([popover]){margin:0;max-height:var(--menu-max-height,auto);position-anchor:--menu-trigger;position-area:block-end span-inline-end;position-try-fallbacks:flip-block;position:absolute;z-index:1}:host([split]) ::slotted([popover]){position-area:block-end span-inline-start}::slotted([popover]:popover-open){inset:unset}::slotted([popover]:not(:popover-open)){display:none}:host([split]){display:inline-flex}:host([split]) ::slotted([slot='primary-action']){border-inline-end:${strokeWidthThin} solid ${colorNeutralStroke1};border-start-end-radius:0;border-end-end-radius:0}:host([split]) ::slotted([slot='primary-action']:focus-visible){z-index:1}:host([split]) ::slotted([slot='primary-action'][appearance='primary']){border-inline-end:${strokeWidthThin} solid white}:host([split]) ::slotted([slot='trigger']){border-inline-start:0;border-start-start-radius:0;border-end-start-radius:0}`;
|
|
@@ -8643,15 +9576,15 @@ function menuTemplate() {
|
|
|
8643
9576
|
filter: elements()
|
|
8644
9577
|
})}></slot></template>`;
|
|
8645
9578
|
}
|
|
8646
|
-
const template$
|
|
9579
|
+
const template$i = menuTemplate();
|
|
8647
9580
|
|
|
8648
|
-
const definition$
|
|
9581
|
+
const definition$i = Menu.compose({
|
|
8649
9582
|
name: `${FluentDesignSystem.prefix}-menu`,
|
|
8650
|
-
template: template$
|
|
8651
|
-
styles: styles$
|
|
9583
|
+
template: template$i,
|
|
9584
|
+
styles: styles$i
|
|
8652
9585
|
});
|
|
8653
9586
|
|
|
8654
|
-
definition$
|
|
9587
|
+
definition$i.define(FluentDesignSystem.registry);
|
|
8655
9588
|
|
|
8656
9589
|
const MessageBarLayout = {
|
|
8657
9590
|
multiline: "multiline",
|
|
@@ -8668,12 +9601,12 @@ const MessageBarIntent = {
|
|
|
8668
9601
|
info: "info"
|
|
8669
9602
|
};
|
|
8670
9603
|
|
|
8671
|
-
var __defProp$
|
|
8672
|
-
var __getOwnPropDesc$
|
|
8673
|
-
var __decorateClass$
|
|
8674
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
9604
|
+
var __defProp$e = Object.defineProperty;
|
|
9605
|
+
var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
|
|
9606
|
+
var __decorateClass$e = (decorators, target, key, kind) => {
|
|
9607
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
|
|
8675
9608
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8676
|
-
if (kind && result) __defProp$
|
|
9609
|
+
if (kind && result) __defProp$e(target, key, result);
|
|
8677
9610
|
return result;
|
|
8678
9611
|
};
|
|
8679
9612
|
class MessageBar extends FASTElement {
|
|
@@ -8719,28 +9652,317 @@ class MessageBar extends FASTElement {
|
|
|
8719
9652
|
swapStates(this.elementInternals, prev, next, MessageBarIntent);
|
|
8720
9653
|
}
|
|
8721
9654
|
}
|
|
8722
|
-
__decorateClass$
|
|
8723
|
-
__decorateClass$
|
|
8724
|
-
__decorateClass$
|
|
9655
|
+
__decorateClass$e([attr], MessageBar.prototype, "shape", 2);
|
|
9656
|
+
__decorateClass$e([attr], MessageBar.prototype, "layout", 2);
|
|
9657
|
+
__decorateClass$e([attr], MessageBar.prototype, "intent", 2);
|
|
8725
9658
|
|
|
8726
|
-
const styles$
|
|
9659
|
+
const styles$h = css`
|
|
8727
9660
|
:host{display:grid;box-sizing:border-box;font-family:${fontFamilyBase};font-size:${fontSizeBase200};line-height:${lineHeightBase200};width:100%;background:${colorNeutralBackground3};border:1px solid ${colorNeutralStroke1};padding-inline:${spacingHorizontalM};border-radius:${borderRadiusMedium};min-height:36px;align-items:center;grid-template:'icon body actions dismiss' / auto 1fr auto auto;contain:layout style paint}:host(${squareState}){border-radius:0}:host(${successState}){background-color:${colorPaletteGreenBackground1};border-color:${colorPaletteGreenBorder1}}:host(${warningState}){background-color:${colorPaletteDarkOrangeBackground1};border-color:${colorPaletteDarkOrangeBorder1}}:host(${errorState}){background-color:${colorPaletteRedBackground1};border-color:${colorPaletteRedBorder1}}:host(${multiLineState}){grid-template-areas:'icon body dismiss'
|
|
8728
9661
|
'actions actions actions';grid-template-columns:auto 1fr auto;grid-template-rows:auto auto 1fr;padding-block:${spacingVerticalMNudge};padding-inline:${spacingHorizontalM}}.content{grid-area:body;max-width:520px;padding-block:${spacingVerticalMNudge};padding-inline:0}:host(${multiLineState}) .content{padding:0}::slotted([slot='icon']){display:flex;grid-area:icon;flex-direction:column;align-items:center;color:${colorNeutralForeground3};margin-inline-end:${spacingHorizontalS}}:host(${multiLineState}) ::slotted([slot='icon']){align-items:start;height:100%}::slotted([slot='dismiss']){grid-area:dismiss}.actions{grid-area:actions;display:flex;justify-self:end;margin-inline-end:${spacingHorizontalS};gap:${spacingHorizontalS}}:host(${multiLineState}) .actions{margin-block-start:${spacingVerticalMNudge};margin-inline-end:0}:host(${multiLineState}) ::slotted([slot='dismiss']){align-items:start;height:100%;padding-block-start:${spacingVerticalS}}::slotted(*){font-size:inherit}`;
|
|
8729
9662
|
|
|
8730
9663
|
function messageBarTemplate() {
|
|
8731
9664
|
return html`<slot name="icon"></slot><div class="content"><slot></slot></div><div class="actions"><slot name="actions"></slot></div><slot name="dismiss"></slot>`;
|
|
8732
9665
|
}
|
|
8733
|
-
const template$
|
|
9666
|
+
const template$h = messageBarTemplate();
|
|
8734
9667
|
|
|
8735
|
-
const definition$
|
|
9668
|
+
const definition$h = MessageBar.compose({
|
|
8736
9669
|
name: `${FluentDesignSystem.prefix}-message-bar`,
|
|
8737
|
-
template: template$
|
|
8738
|
-
styles: styles$
|
|
9670
|
+
template: template$h,
|
|
9671
|
+
styles: styles$h,
|
|
8739
9672
|
shadowOptions: {
|
|
8740
9673
|
mode: FluentDesignSystem.shadowRootMode
|
|
8741
9674
|
}
|
|
8742
9675
|
});
|
|
8743
9676
|
|
|
9677
|
+
definition$h.define(FluentDesignSystem.registry);
|
|
9678
|
+
|
|
9679
|
+
var __defProp$d = Object.defineProperty;
|
|
9680
|
+
var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
|
|
9681
|
+
var __decorateClass$d = (decorators, target, key, kind) => {
|
|
9682
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
|
|
9683
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9684
|
+
if (kind && result) __defProp$d(target, key, result);
|
|
9685
|
+
return result;
|
|
9686
|
+
};
|
|
9687
|
+
class DropdownOption extends FASTElement {
|
|
9688
|
+
constructor() {
|
|
9689
|
+
super();
|
|
9690
|
+
this.active = false;
|
|
9691
|
+
this.id = uniqueId("option-");
|
|
9692
|
+
this.initialValue = "";
|
|
9693
|
+
this.multiple = false;
|
|
9694
|
+
/**
|
|
9695
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
9696
|
+
*
|
|
9697
|
+
* @internal
|
|
9698
|
+
*/
|
|
9699
|
+
this.elementInternals = this.attachInternals();
|
|
9700
|
+
/**
|
|
9701
|
+
* The internal value of the option.
|
|
9702
|
+
*
|
|
9703
|
+
* @internal
|
|
9704
|
+
*/
|
|
9705
|
+
this._value = this.initialValue;
|
|
9706
|
+
this.elementInternals.role = "option";
|
|
9707
|
+
}
|
|
9708
|
+
/**
|
|
9709
|
+
* Changes the active state of the option when the active property changes.
|
|
9710
|
+
*
|
|
9711
|
+
* @param prev - the previous active state
|
|
9712
|
+
* @param next - the current active state
|
|
9713
|
+
* @internal
|
|
9714
|
+
*/
|
|
9715
|
+
activeChanged(prev, next) {
|
|
9716
|
+
toggleState(this.elementInternals, "active", next);
|
|
9717
|
+
}
|
|
9718
|
+
/**
|
|
9719
|
+
* Sets the selected property to match the currentSelected state.
|
|
9720
|
+
*
|
|
9721
|
+
* @param prev - the previous selected state
|
|
9722
|
+
* @param next - the current selected state
|
|
9723
|
+
* @internal
|
|
9724
|
+
*/
|
|
9725
|
+
currentSelectedChanged(prev, next) {
|
|
9726
|
+
this.selected = !!next;
|
|
9727
|
+
}
|
|
9728
|
+
/**
|
|
9729
|
+
* Updates the selected state when the `selected` attribute is changed, unless the selected state has been changed by the user.
|
|
9730
|
+
*
|
|
9731
|
+
* @param prev - The previous initial selected state
|
|
9732
|
+
* @param next - The current initial selected state
|
|
9733
|
+
* @internal
|
|
9734
|
+
*/
|
|
9735
|
+
defaultSelectedChanged(prev, next) {
|
|
9736
|
+
this.selected = !!next;
|
|
9737
|
+
}
|
|
9738
|
+
/**
|
|
9739
|
+
* Changes the description state of the option when the description slot changes.
|
|
9740
|
+
*
|
|
9741
|
+
* @param prev - the previous collection of description elements
|
|
9742
|
+
* @param next - the current collection of description elements
|
|
9743
|
+
* @internal
|
|
9744
|
+
*/
|
|
9745
|
+
descriptionSlotChanged(prev, next) {
|
|
9746
|
+
toggleState(this.elementInternals, "description", !!next?.length);
|
|
9747
|
+
}
|
|
9748
|
+
/**
|
|
9749
|
+
* Toggles the disabled state when the user changes the `disabled` property.
|
|
9750
|
+
*
|
|
9751
|
+
* @internal
|
|
9752
|
+
*/
|
|
9753
|
+
disabledChanged(prev, next) {
|
|
9754
|
+
this.elementInternals.ariaDisabled = this.disabled ? "true" : "false";
|
|
9755
|
+
toggleState(this.elementInternals, "disabled", this.disabled);
|
|
9756
|
+
}
|
|
9757
|
+
/**
|
|
9758
|
+
* Sets the disabled state when the `disabled` attribute changes.
|
|
9759
|
+
*
|
|
9760
|
+
* @param prev - the previous value
|
|
9761
|
+
* @param next - the current value
|
|
9762
|
+
* @internal
|
|
9763
|
+
*/
|
|
9764
|
+
disabledAttributeChanged(prev, next) {
|
|
9765
|
+
this.disabled = !!next;
|
|
9766
|
+
}
|
|
9767
|
+
/**
|
|
9768
|
+
* Sets the value of the option when the `value` attribute changes.
|
|
9769
|
+
*
|
|
9770
|
+
* @param prev - The previous initial value
|
|
9771
|
+
* @param next - The current initial value
|
|
9772
|
+
* @internal
|
|
9773
|
+
*/
|
|
9774
|
+
initialValueChanged(prev, next) {
|
|
9775
|
+
this._value = next;
|
|
9776
|
+
}
|
|
9777
|
+
/**
|
|
9778
|
+
* Updates the multiple state of the option when the multiple property changes.
|
|
9779
|
+
*
|
|
9780
|
+
* @param prev - the previous multiple state
|
|
9781
|
+
* @param next - the current multiple state
|
|
9782
|
+
*/
|
|
9783
|
+
multipleChanged(prev, next) {
|
|
9784
|
+
toggleState(this.elementInternals, "multiple", next);
|
|
9785
|
+
this.selected = false;
|
|
9786
|
+
}
|
|
9787
|
+
/**
|
|
9788
|
+
* The associated `<form>` element.
|
|
9789
|
+
*
|
|
9790
|
+
* @public
|
|
9791
|
+
* @remarks
|
|
9792
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/form | `ElementInternals.form`} property.
|
|
9793
|
+
*/
|
|
9794
|
+
get form() {
|
|
9795
|
+
return this.elementInternals.form;
|
|
9796
|
+
}
|
|
9797
|
+
/**
|
|
9798
|
+
* A reference to all associated `<label>` elements.
|
|
9799
|
+
*
|
|
9800
|
+
* @public
|
|
9801
|
+
*/
|
|
9802
|
+
get labels() {
|
|
9803
|
+
return Object.freeze(Array.from(this.elementInternals.labels));
|
|
9804
|
+
}
|
|
9805
|
+
/**
|
|
9806
|
+
* The option's current selected state.
|
|
9807
|
+
*
|
|
9808
|
+
* @public
|
|
9809
|
+
*/
|
|
9810
|
+
get selected() {
|
|
9811
|
+
Observable.track(this, "selected");
|
|
9812
|
+
return !!this.currentSelected;
|
|
9813
|
+
}
|
|
9814
|
+
set selected(next) {
|
|
9815
|
+
this.currentSelected = next;
|
|
9816
|
+
Updates.enqueue(() => {
|
|
9817
|
+
if (this.$fastController.isConnected) {
|
|
9818
|
+
this.setFormValue(next ? this.value : null);
|
|
9819
|
+
this.elementInternals.ariaSelected = next ? "true" : "false";
|
|
9820
|
+
toggleState(this.elementInternals, "selected", next);
|
|
9821
|
+
}
|
|
9822
|
+
});
|
|
9823
|
+
Observable.notify(this, "selected");
|
|
9824
|
+
}
|
|
9825
|
+
/**
|
|
9826
|
+
* The display text of the option.
|
|
9827
|
+
*
|
|
9828
|
+
* @public
|
|
9829
|
+
* @remarks
|
|
9830
|
+
* When the option is freeform, the text is the value of the option.
|
|
9831
|
+
*/
|
|
9832
|
+
get text() {
|
|
9833
|
+
if (this.freeform) {
|
|
9834
|
+
return this.value.replace(/\s+/g, " ").trim();
|
|
9835
|
+
}
|
|
9836
|
+
return (this.textAttribute ?? this.textContent)?.replace(/\s+/g, " ").trim() ?? "";
|
|
9837
|
+
}
|
|
9838
|
+
/**
|
|
9839
|
+
* The current value of the option.
|
|
9840
|
+
*
|
|
9841
|
+
* @public
|
|
9842
|
+
*/
|
|
9843
|
+
get value() {
|
|
9844
|
+
Observable.track(this, "value");
|
|
9845
|
+
return this._value ?? this.text;
|
|
9846
|
+
}
|
|
9847
|
+
set value(value) {
|
|
9848
|
+
this._value = value;
|
|
9849
|
+
if (this.$fastController.isConnected) {
|
|
9850
|
+
this.setFormValue(this.selected ? value : null);
|
|
9851
|
+
this.freeformOutputs?.forEach(output => {
|
|
9852
|
+
output.value = value;
|
|
9853
|
+
});
|
|
9854
|
+
Observable.notify(this, "value");
|
|
9855
|
+
}
|
|
9856
|
+
}
|
|
9857
|
+
connectedCallback() {
|
|
9858
|
+
super.connectedCallback();
|
|
9859
|
+
if (this.freeform) {
|
|
9860
|
+
this.value = "";
|
|
9861
|
+
this.hidden = true;
|
|
9862
|
+
this.selected = false;
|
|
9863
|
+
}
|
|
9864
|
+
}
|
|
9865
|
+
/**
|
|
9866
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
|
|
9867
|
+
*
|
|
9868
|
+
* @internal
|
|
9869
|
+
*/
|
|
9870
|
+
setFormValue(value, state) {
|
|
9871
|
+
if (this.disabled) {
|
|
9872
|
+
this.elementInternals.setFormValue(null);
|
|
9873
|
+
return;
|
|
9874
|
+
}
|
|
9875
|
+
this.elementInternals.setFormValue(value, value ?? state);
|
|
9876
|
+
}
|
|
9877
|
+
/**
|
|
9878
|
+
* Toggles the selected state of the control.
|
|
9879
|
+
*
|
|
9880
|
+
* @param force - Forces the element to be checked or unchecked
|
|
9881
|
+
* @public
|
|
9882
|
+
*/
|
|
9883
|
+
toggleSelected(force = !this.selected) {
|
|
9884
|
+
this.selected = force;
|
|
9885
|
+
}
|
|
9886
|
+
}
|
|
9887
|
+
/**
|
|
9888
|
+
* The form-associated flag.
|
|
9889
|
+
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
|
|
9890
|
+
*
|
|
9891
|
+
* @public
|
|
9892
|
+
*/
|
|
9893
|
+
DropdownOption.formAssociated = true;
|
|
9894
|
+
__decorateClass$d([observable], DropdownOption.prototype, "active", 2);
|
|
9895
|
+
__decorateClass$d([attr({
|
|
9896
|
+
attribute: "current-selected",
|
|
9897
|
+
mode: "boolean"
|
|
9898
|
+
})], DropdownOption.prototype, "currentSelected", 2);
|
|
9899
|
+
__decorateClass$d([attr({
|
|
9900
|
+
attribute: "selected",
|
|
9901
|
+
mode: "boolean"
|
|
9902
|
+
})], DropdownOption.prototype, "defaultSelected", 2);
|
|
9903
|
+
__decorateClass$d([observable], DropdownOption.prototype, "descriptionSlot", 2);
|
|
9904
|
+
__decorateClass$d([observable], DropdownOption.prototype, "disabled", 2);
|
|
9905
|
+
__decorateClass$d([attr({
|
|
9906
|
+
attribute: "disabled",
|
|
9907
|
+
mode: "boolean"
|
|
9908
|
+
})], DropdownOption.prototype, "disabledAttribute", 2);
|
|
9909
|
+
__decorateClass$d([attr({
|
|
9910
|
+
attribute: "form"
|
|
9911
|
+
})], DropdownOption.prototype, "formAttribute", 2);
|
|
9912
|
+
__decorateClass$d([attr({
|
|
9913
|
+
mode: "boolean"
|
|
9914
|
+
})], DropdownOption.prototype, "freeform", 2);
|
|
9915
|
+
__decorateClass$d([attr({
|
|
9916
|
+
attribute: "id"
|
|
9917
|
+
})], DropdownOption.prototype, "id", 2);
|
|
9918
|
+
__decorateClass$d([attr({
|
|
9919
|
+
attribute: "value",
|
|
9920
|
+
mode: "fromView"
|
|
9921
|
+
})], DropdownOption.prototype, "initialValue", 2);
|
|
9922
|
+
__decorateClass$d([observable], DropdownOption.prototype, "multiple", 2);
|
|
9923
|
+
__decorateClass$d([attr], DropdownOption.prototype, "name", 2);
|
|
9924
|
+
__decorateClass$d([observable], DropdownOption.prototype, "start", 2);
|
|
9925
|
+
__decorateClass$d([attr({
|
|
9926
|
+
attribute: "text",
|
|
9927
|
+
mode: "fromView"
|
|
9928
|
+
})], DropdownOption.prototype, "textAttribute", 2);
|
|
9929
|
+
|
|
9930
|
+
const styles$g = css`
|
|
9931
|
+
${display("inline-grid")}
|
|
9932
|
+
|
|
9933
|
+
:host{-webkit-tap-highlight-color:transparent;${typographyBody1Styles}
|
|
9934
|
+
align-items:center;background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border:${strokeWidthThick} solid ${colorTransparentStroke};box-sizing:border-box;color:${colorNeutralForeground2};column-gap:${spacingHorizontalXS};cursor:pointer;grid-template-areas:'indicator start content';grid-template-columns:auto auto 1fr;min-height:32px;padding:${spacingHorizontalSNudge}}.content{grid-area:content;line-height:1}::slotted([slot='start']){grid-area:start}:host(:hover){background-color:${colorNeutralBackground1Hover};color:${colorNeutralForeground2Hover}}:host(:active){background-color:${colorNeutralBackground1Pressed};color:${colorNeutralForeground2Pressed}}:host(:disabled){background-color:${colorNeutralBackground1};color:${colorNeutralForegroundDisabled};cursor:default}.checkmark-16-filled{fill:currentColor;width:16px}slot[name='checked-indicator'] > *,::slotted([slot='checked-indicator']){aspect-ratio:1;flex:0 0 auto;grid-area:indicator;visibility:hidden}:host(${selectedState}) :is(slot[name='checked-indicator'] > *,::slotted([slot='checked-indicator'])){visibility:visible}:host(${multipleState}) .checkmark-16-filled,:host(:not(${multipleState})) .checkmark-12-regular{display:none}:host(${multipleState}) .checkmark-12-regular{background-color:${colorNeutralBackground1};border-radius:${borderRadiusSmall};border:${strokeWidthThin} solid ${colorNeutralStrokeAccessible};box-sizing:border-box;cursor:pointer;fill:transparent;position:relative;visibility:visible;width:16px}:host(${multipleState}${selectedState}) .checkmark-12-regular{background-color:${colorCompoundBrandBackground};border-color:${colorCompoundBrandStroke};fill:${colorNeutralForegroundInverted}}:host(:disabled${multipleState}) .checkmark-12-regular{border-color:${colorNeutralStrokeDisabled}}:host(:disabled${multipleState}${selectedState}) .checkmark-12-regular{background-color:${colorNeutralBackgroundDisabled}}:host(${activeState}){border:${strokeWidthThick} solid ${colorStrokeFocus2}}@supports (selector(:host(:has(*)))){:host(:has([slot='start']:not([size='16']))){column-gap:${spacingHorizontalSNudge}}}:host(${descriptionState}){column-gap:${spacingHorizontalSNudge};grid-template-areas:'indicator start content'
|
|
9935
|
+
'indicator start description'}::slotted([slot='description']){color:${colorNeutralForeground3};grid-area:description;${typographyCaption1Styles}}`;
|
|
9936
|
+
|
|
9937
|
+
const checkedIndicator$1 = html.partial( /* html */
|
|
9938
|
+
`
|
|
9939
|
+
<svg aria-hidden="true" class="checkmark-16-filled" viewBox="0 0 16 16">
|
|
9940
|
+
<path
|
|
9941
|
+
d="M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032"
|
|
9942
|
+
/>
|
|
9943
|
+
</svg>
|
|
9944
|
+
<svg aria-hidden="true" class="checkmark-12-regular" viewBox="0 0 12 12">
|
|
9945
|
+
<path
|
|
9946
|
+
d="M9.854 3.146a.5.5 0 0 1 0 .708l-4.5 4.5a.5.5 0 0 1-.708 0l-2-2a.5.5 0 1 1 .708-.708L5 7.293l4.146-4.147a.5.5 0 0 1 .708 0"
|
|
9947
|
+
/>
|
|
9948
|
+
</svg>
|
|
9949
|
+
`);
|
|
9950
|
+
function dropdownOptionTemplate(options = {}) {
|
|
9951
|
+
return html`<slot name="checked-indicator">${staticallyCompose(options.checkedIndicator)}</slot>${startSlotTemplate(options)}<div class="content" part="content"><slot ${slotted({
|
|
9952
|
+
property: "freeformOutputs",
|
|
9953
|
+
filter: elements("output")
|
|
9954
|
+
})}></slot></div><div class="description" part="description"><slot name="description" ${slotted("descriptionSlot")}></slot></div>`;
|
|
9955
|
+
}
|
|
9956
|
+
const template$g = dropdownOptionTemplate({
|
|
9957
|
+
checkedIndicator: checkedIndicator$1
|
|
9958
|
+
});
|
|
9959
|
+
|
|
9960
|
+
const definition$g = DropdownOption.compose({
|
|
9961
|
+
name: `${FluentDesignSystem.prefix}-option`,
|
|
9962
|
+
template: template$g,
|
|
9963
|
+
styles: styles$g
|
|
9964
|
+
});
|
|
9965
|
+
|
|
8744
9966
|
definition$g.define(FluentDesignSystem.registry);
|
|
8745
9967
|
|
|
8746
9968
|
const ProgressBarThickness = {
|
|
@@ -10279,8 +11501,8 @@ __decorateClass$8([attr], Spinner.prototype, "appearance", 2);
|
|
|
10279
11501
|
const styles$a = css`
|
|
10280
11502
|
${display("inline-flex")}
|
|
10281
11503
|
|
|
10282
|
-
:host{--duration:1.5s;--indicatorSize:${strokeWidthThicker};--size:32px;height:var(--size);width:var(--size);contain:strict;content-visibility:auto}:host(${tinyState}){--indicatorSize:${strokeWidthThick};--size:20px}:host(${extraSmallState}){--indicatorSize:${strokeWidthThick};--size:24px}:host(${smallState}){--indicatorSize:${strokeWidthThick};--size:28px}:host(${largeState}){--indicatorSize:${strokeWidthThicker};--size:36px}:host(${extraLargeState}){--indicatorSize:${strokeWidthThicker};--size:40px}:host(${hugeState}){--indicatorSize:${strokeWidthThickest};--size:44px}.progress,.background,.spinner,.start,.end,.indicator{position:absolute;inset:0}.progress,.spinner,.indicator{animation:none var(--duration) infinite ${curveEasyEase}}.progress{animation-timing-function:linear;animation-name:spin-linear}.background{border:var(--indicatorSize) solid ${colorBrandStroke2};border-radius:50%}:host(${invertedState}) .background{border-color:rgba(255,255,255,0.2)}.spinner{animation-name:spin-swing}.start{overflow:hidden;
|
|
10283
|
-
.background{display:none}.indicator{border-color:Canvas;border-block-start-color:Highlight;border-
|
|
11504
|
+
:host{--duration:1.5s;--indicatorSize:${strokeWidthThicker};--size:32px;height:var(--size);width:var(--size);contain:strict;content-visibility:auto}:host(${tinyState}){--indicatorSize:${strokeWidthThick};--size:20px}:host(${extraSmallState}){--indicatorSize:${strokeWidthThick};--size:24px}:host(${smallState}){--indicatorSize:${strokeWidthThick};--size:28px}:host(${largeState}){--indicatorSize:${strokeWidthThicker};--size:36px}:host(${extraLargeState}){--indicatorSize:${strokeWidthThicker};--size:40px}:host(${hugeState}){--indicatorSize:${strokeWidthThickest};--size:44px}.progress,.background,.spinner,.start,.end,.indicator{position:absolute;inset:0}.progress,.spinner,.indicator{animation:none var(--duration) infinite ${curveEasyEase}}.progress{animation-timing-function:linear;animation-name:spin-linear}.background{border:var(--indicatorSize) solid ${colorBrandStroke2};border-radius:50%}:host(${invertedState}) .background{border-color:rgba(255,255,255,0.2)}.spinner{animation-name:spin-swing}.start{overflow:hidden;right:50%}.end{overflow:hidden;left:50%}.indicator{color:${colorBrandStroke1};box-sizing:border-box;border-radius:50%;border:var(--indicatorSize) solid transparent;border-block-start-color:currentcolor;border-right-color:currentcolor}:host(${invertedState}) .indicator{color:${colorNeutralStrokeOnBrand2}}.start .indicator{rotate:135deg;inset:0 -100% 0 0;animation-name:spin-start}.end .indicator{rotate:135deg;inset:0 0 0 -100%;animation-name:spin-end}@keyframes spin-linear{100%{transform:rotate(360deg)}}@keyframes spin-swing{0%{transform:rotate(-135deg)}50%{transform:rotate(0deg)}100%{transform:rotate(225deg)}}@keyframes spin-start{0%,100%{transform:rotate(0deg)}50%{transform:rotate(-80deg)}}@keyframes spin-end{0%,100%{transform:rotate(0deg)}50%{transform:rotate(70deg)}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
11505
|
+
.background{display:none}.indicator{border-color:Canvas;border-block-start-color:Highlight;border-right-color:Highlight}`));
|
|
10284
11506
|
|
|
10285
11507
|
const template$a = html`<slot name="indicator"><div class="background"></div><div class="progress"><div class="spinner"><div class="start"><div class="indicator"></div></div><div class="end"><div class="indicator"></div></div></div></div></slot>`;
|
|
10286
11508
|
|
|
@@ -10310,7 +11532,7 @@ const styles$9 = css`
|
|
|
10310
11532
|
${display("inline-flex")}
|
|
10311
11533
|
|
|
10312
11534
|
:host{box-sizing:border-box;align-items:center;flex-direction:row;outline:none;user-select:none;contain:content;padding:0 ${spacingHorizontalXXS};width:40px;height:20px;background-color:${colorTransparentBackground};border:1px solid ${colorNeutralStrokeAccessible};border-radius:${borderRadiusCircular};cursor:pointer}:host(:hover){background:none;border-color:${colorNeutralStrokeAccessibleHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(:disabled),:host([readonly]){border:1px solid ${colorNeutralStrokeDisabled};background-color:none;pointer:default}:host(${checkedState}){background:${colorCompoundBrandBackground};border-color:${colorCompoundBrandBackground}}:host(${checkedState}:hover){background:${colorCompoundBrandBackgroundHover};border-color:${colorCompoundBrandBackgroundHover}}:host(${checkedState}:active){background:${colorCompoundBrandBackgroundPressed};border-color:${colorCompoundBrandBackgroundPressed}}:host(${checkedState}:disabled){background:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}.checked-indicator{height:14px;width:14px;border-radius:50%;margin-inline-start:0;background-color:${colorNeutralForeground3};transition-duration:${durationNormal};transition-timing-function:${curveEasyEase};transition-property:margin-inline-start}:host(${checkedState}) .checked-indicator{background-color:${colorNeutralForegroundInverted};margin-inline-start:calc(100% - 14px)}:host(${checkedState}:hover) .checked-indicator{background:${colorNeutralForegroundInvertedHover}}:host(${checkedState}:active) .checked-indicator{background:${colorNeutralForegroundInvertedPressed}}:host(:hover) .checked-indicator{background-color:${colorNeutralForeground3Hover}}:host(:active) .checked-indicator{background-color:${colorNeutralForeground3Pressed}}:host(:disabled) .checked-indicator,:host([readonly]) .checked-indicator{background:${colorNeutralForegroundDisabled}}:host(${checkedState}:disabled) .checked-indicator{background:${colorNeutralForegroundDisabled}}:host(:focus-visible){outline:none}:host(:not([slot='input']):focus-visible){border-color:${colorTransparentStroke};outline:${strokeWidthThick} solid ${colorTransparentStroke};box-shadow:${shadow4},0 0 0 2px ${colorStrokeFocus2}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
10313
|
-
:host{border-color:InactiveBorder}:host(${checkedState}),:host(${checkedState}:active),:host(${checkedState}:hover){background:Highlight;border-color:Highlight}.checked-indicator,:host(:hover) .checked-indicator,:host(:active) .checked-indicator{background-color:ActiveCaption}:host(${checkedState}) .checked-indicator,:host(${checkedState}:hover) .checked-indicator,:host(${checkedState}:active) .checked-indicator{background-color:ButtonFace}`));
|
|
11535
|
+
:host{border-color:InactiveBorder}:host(${checkedState}),:host(${checkedState}:active),:host(${checkedState}:hover){background:Highlight;border-color:Highlight}.checked-indicator,:host(:hover) .checked-indicator,:host(:active) .checked-indicator{background-color:ActiveCaption}:host(${checkedState}) .checked-indicator,:host(${checkedState}:hover) .checked-indicator,:host(${checkedState}:active) .checked-indicator{background-color:ButtonFace}:host(:disabled) .checked-indicator,:host(${checkedState}:disabled) .checked-indicator{background-color:GrayText}`));
|
|
10314
11536
|
|
|
10315
11537
|
const definition$9 = Switch.compose({
|
|
10316
11538
|
name: `${FluentDesignSystem.prefix}-switch`,
|
|
@@ -10548,12 +11770,12 @@ class BaseTabs extends FASTElement {
|
|
|
10548
11770
|
}
|
|
10549
11771
|
getTabIds() {
|
|
10550
11772
|
return this.tabs.map(tab => {
|
|
10551
|
-
return tab.getAttribute("id") ?? `tab-${uniqueId()}`;
|
|
11773
|
+
return tab.getAttribute("id") ?? `tab-${uniqueId$1()}`;
|
|
10552
11774
|
});
|
|
10553
11775
|
}
|
|
10554
11776
|
getTabPanelIds() {
|
|
10555
11777
|
return this.tabpanels.map(tabPanel => {
|
|
10556
|
-
return tabPanel.getAttribute("id") ?? `panel-${uniqueId()}`;
|
|
11778
|
+
return tabPanel.getAttribute("id") ?? `panel-${uniqueId$1()}`;
|
|
10557
11779
|
});
|
|
10558
11780
|
}
|
|
10559
11781
|
setComponent() {
|
|
@@ -10965,7 +12187,7 @@ class BaseTablist extends FASTElement {
|
|
|
10965
12187
|
}
|
|
10966
12188
|
getTabIds() {
|
|
10967
12189
|
return this.tabs.map(tab => {
|
|
10968
|
-
return tab.getAttribute("id") ?? `tab-${uniqueId()}`;
|
|
12190
|
+
return tab.getAttribute("id") ?? `tab-${uniqueId$1()}`;
|
|
10969
12191
|
});
|
|
10970
12192
|
}
|
|
10971
12193
|
setComponent() {
|
|
@@ -12382,7 +13604,7 @@ __decorateClass$1([attr({
|
|
|
12382
13604
|
})], ToggleButton.prototype, "mixed", 2);
|
|
12383
13605
|
|
|
12384
13606
|
const styles$1 = css`
|
|
12385
|
-
${styles$
|
|
13607
|
+
${styles$C}
|
|
12386
13608
|
|
|
12387
13609
|
:host(${pressedState}){border-color:${colorNeutralStroke1};background-color:${colorNeutralBackground1Selected};color:${colorNeutralForeground1};border-width:${strokeWidthThin}}:host(${pressedState}:hover){border-color:${colorNeutralStroke1Hover};background-color:${colorNeutralBackground1Hover}}:host(${pressedState}:active){border-color:${colorNeutralStroke1Pressed};background-color:${colorNeutralBackground1Pressed}}:host(${pressedState}${primaryState}){border-color:transparent;background-color:${colorBrandBackgroundSelected};color:${colorNeutralForegroundOnBrand}}:host(${pressedState}${primaryState}:hover){background-color:${colorBrandBackgroundHover}}:host(${pressedState}${primaryState}:active){background-color:${colorBrandBackgroundPressed}}:host(${pressedState}${subtleState}){border-color:transparent;background-color:${colorSubtleBackgroundSelected};color:${colorNeutralForeground2Selected}}:host(${pressedState}${subtleState}:hover){background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground2Hover}}:host(${pressedState}${subtleState}:active){background-color:${colorSubtleBackgroundPressed};color:${colorNeutralForeground2Pressed}}:host(${pressedState}${outlineState}),:host(${pressedState}${transparentState}){background-color:${colorTransparentBackgroundSelected}}:host(${pressedState}${outlineState}:hover),:host(${pressedState}${transparentState}:hover){background-color:${colorTransparentBackgroundHover}}:host(${pressedState}${outlineState}:active),:host(${pressedState}${transparentState}:active){background-color:${colorTransparentBackgroundPressed}}:host(${pressedState}${transparentState}){border-color:transparent;color:${colorNeutralForeground2BrandSelected}}:host(${pressedState}${transparentState}:hover){color:${colorNeutralForeground2BrandHover}}:host(${pressedState}${transparentState}:active){color:${colorNeutralForeground2BrandPressed}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
12388
13610
|
:host(${pressedState}),:host(${pressedState}${primaryState}),:host(${pressedState}${subtleState}),:host(${pressedState}${outlineState}),:host(${pressedState}${transparentState}){background:SelectedItem;color:SelectedItemText}`));
|
|
@@ -12405,8 +13627,6 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
12405
13627
|
if (kind && result) __defProp(target, key, result);
|
|
12406
13628
|
return result;
|
|
12407
13629
|
};
|
|
12408
|
-
const SUPPORTS_CSS_ANCHOR_POSITIONING = CSS.supports("anchor-name: --a");
|
|
12409
|
-
const SUPPORTS_HTML_ANCHOR_POSITIONING = "anchor" in HTMLElement.prototype;
|
|
12410
13630
|
class Tooltip extends FASTElement {
|
|
12411
13631
|
constructor() {
|
|
12412
13632
|
super();
|
|
@@ -12414,7 +13634,7 @@ class Tooltip extends FASTElement {
|
|
|
12414
13634
|
* The attached element internals
|
|
12415
13635
|
*/
|
|
12416
13636
|
this.elementInternals = this.attachInternals();
|
|
12417
|
-
this.id = uniqueId("tooltip-");
|
|
13637
|
+
this.id = uniqueId$1("tooltip-");
|
|
12418
13638
|
/**
|
|
12419
13639
|
* The default delay for the tooltip
|
|
12420
13640
|
* @internal
|
|
@@ -12450,7 +13670,7 @@ class Tooltip extends FASTElement {
|
|
|
12450
13670
|
* @internal
|
|
12451
13671
|
*/
|
|
12452
13672
|
positioningChanged() {
|
|
12453
|
-
if (!
|
|
13673
|
+
if (!AnchorPositioningCSSSupported) {
|
|
12454
13674
|
this.setFallbackStyles();
|
|
12455
13675
|
}
|
|
12456
13676
|
}
|
|
@@ -12474,8 +13694,8 @@ class Tooltip extends FASTElement {
|
|
|
12474
13694
|
this.anchorElement.addEventListener("blur", this.blurAnchorHandler);
|
|
12475
13695
|
this.anchorElement.addEventListener("mouseenter", this.mouseenterAnchorHandler);
|
|
12476
13696
|
this.anchorElement.addEventListener("mouseleave", this.mouseleaveAnchorHandler);
|
|
12477
|
-
if (
|
|
12478
|
-
if (!
|
|
13697
|
+
if (AnchorPositioningCSSSupported) {
|
|
13698
|
+
if (!AnchorPositioningHTMLSupported) {
|
|
12479
13699
|
this.anchorElement.style.anchorName = anchorName;
|
|
12480
13700
|
this.style.positionAnchor = anchorName;
|
|
12481
13701
|
}
|