@fluentui/web-components 3.0.0-beta.44 → 3.0.0-beta.46
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 +20 -2
- package/dist/dts/anchor-button/anchor-button.d.ts +6 -0
- package/dist/dts/button/button.d.ts +65 -57
- package/dist/esm/anchor-button/anchor-button.js +6 -0
- package/dist/esm/anchor-button/anchor-button.js.map +1 -1
- package/dist/esm/button/button.js +90 -79
- package/dist/esm/button/button.js.map +1 -1
- package/dist/esm/field/field.styles.js +1 -2
- package/dist/esm/field/field.styles.js.map +1 -1
- package/dist/esm/radio-group/radio-group.styles.js +2 -1
- package/dist/esm/radio-group/radio-group.styles.js.map +1 -1
- package/dist/web-components.d.ts +256 -241
- package/dist/web-components.js +74 -69
- package/dist/web-components.min.js +225 -225
- package/package.json +1 -1
package/dist/web-components.js
CHANGED
|
@@ -5151,7 +5151,7 @@ var __decorateClass$o = (decorators, target, key, kind) => {
|
|
|
5151
5151
|
if (kind && result) __defProp$o(target, key, result);
|
|
5152
5152
|
return result;
|
|
5153
5153
|
};
|
|
5154
|
-
class
|
|
5154
|
+
class BaseButton extends FASTElement {
|
|
5155
5155
|
constructor() {
|
|
5156
5156
|
super();
|
|
5157
5157
|
this.disabledFocusable = false;
|
|
@@ -5162,22 +5162,8 @@ class Button extends FASTElement {
|
|
|
5162
5162
|
* @internal
|
|
5163
5163
|
*/
|
|
5164
5164
|
this.elementInternals = this.attachInternals();
|
|
5165
|
-
this.iconOnly = false;
|
|
5166
5165
|
this.elementInternals.role = "button";
|
|
5167
5166
|
}
|
|
5168
|
-
/**
|
|
5169
|
-
* Handles changes to appearance attribute custom states
|
|
5170
|
-
* @param prev - the previous state
|
|
5171
|
-
* @param next - the next state
|
|
5172
|
-
*/
|
|
5173
|
-
appearanceChanged(prev, next) {
|
|
5174
|
-
if (prev) {
|
|
5175
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5176
|
-
}
|
|
5177
|
-
if (next) {
|
|
5178
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
5179
|
-
}
|
|
5180
|
-
}
|
|
5181
5167
|
/**
|
|
5182
5168
|
* Sets the element's internal disabled state when the element is focusable while disabled.
|
|
5183
5169
|
*
|
|
@@ -5198,14 +5184,6 @@ class Button extends FASTElement {
|
|
|
5198
5184
|
get form() {
|
|
5199
5185
|
return this.elementInternals.form;
|
|
5200
5186
|
}
|
|
5201
|
-
/**
|
|
5202
|
-
* Handles changes to icon only custom states
|
|
5203
|
-
* @param prev - the previous state
|
|
5204
|
-
* @param next - the next state
|
|
5205
|
-
*/
|
|
5206
|
-
iconOnlyChanged(prev, next) {
|
|
5207
|
-
toggleState(this.elementInternals, "icon", next);
|
|
5208
|
-
}
|
|
5209
5187
|
/**
|
|
5210
5188
|
* A reference to all associated label elements.
|
|
5211
5189
|
*
|
|
@@ -5214,32 +5192,6 @@ class Button extends FASTElement {
|
|
|
5214
5192
|
get labels() {
|
|
5215
5193
|
return Object.freeze(Array.from(this.elementInternals.labels));
|
|
5216
5194
|
}
|
|
5217
|
-
/**
|
|
5218
|
-
* Handles changes to shape attribute custom states
|
|
5219
|
-
* @param prev - the previous state
|
|
5220
|
-
* @param next - the next state
|
|
5221
|
-
*/
|
|
5222
|
-
shapeChanged(prev, next) {
|
|
5223
|
-
if (prev) {
|
|
5224
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5225
|
-
}
|
|
5226
|
-
if (next) {
|
|
5227
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
5228
|
-
}
|
|
5229
|
-
}
|
|
5230
|
-
/**
|
|
5231
|
-
* Handles changes to size attribute custom states
|
|
5232
|
-
* @param prev - the previous state
|
|
5233
|
-
* @param next - the next state
|
|
5234
|
-
*/
|
|
5235
|
-
sizeChanged(prev, next) {
|
|
5236
|
-
if (prev) {
|
|
5237
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5238
|
-
}
|
|
5239
|
-
if (next) {
|
|
5240
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
5241
|
-
}
|
|
5242
|
-
}
|
|
5243
5195
|
/**
|
|
5244
5196
|
* Removes the form submission fallback control when the type changes.
|
|
5245
5197
|
*
|
|
@@ -5399,52 +5351,105 @@ class Button extends FASTElement {
|
|
|
5399
5351
|
*
|
|
5400
5352
|
* @public
|
|
5401
5353
|
*/
|
|
5402
|
-
|
|
5403
|
-
__decorateClass$o([attr], Button.prototype, "appearance", 2);
|
|
5354
|
+
BaseButton.formAssociated = true;
|
|
5404
5355
|
__decorateClass$o([attr({
|
|
5405
5356
|
mode: "boolean"
|
|
5406
|
-
})],
|
|
5407
|
-
__decorateClass$o([observable],
|
|
5357
|
+
})], BaseButton.prototype, "autofocus", 2);
|
|
5358
|
+
__decorateClass$o([observable], BaseButton.prototype, "defaultSlottedContent", 2);
|
|
5408
5359
|
__decorateClass$o([attr({
|
|
5409
5360
|
mode: "boolean"
|
|
5410
|
-
})],
|
|
5361
|
+
})], BaseButton.prototype, "disabled", 2);
|
|
5411
5362
|
__decorateClass$o([attr({
|
|
5412
5363
|
attribute: "disabled-focusable",
|
|
5413
5364
|
mode: "boolean"
|
|
5414
|
-
})],
|
|
5365
|
+
})], BaseButton.prototype, "disabledFocusable", 2);
|
|
5415
5366
|
__decorateClass$o([attr({
|
|
5416
5367
|
attribute: "tabindex",
|
|
5417
5368
|
mode: "fromView",
|
|
5418
5369
|
converter: nullableNumberConverter
|
|
5419
|
-
})],
|
|
5370
|
+
})], BaseButton.prototype, "tabIndex", 2);
|
|
5420
5371
|
__decorateClass$o([attr({
|
|
5421
5372
|
attribute: "formaction"
|
|
5422
|
-
})],
|
|
5373
|
+
})], BaseButton.prototype, "formAction", 2);
|
|
5423
5374
|
__decorateClass$o([attr({
|
|
5424
5375
|
attribute: "form"
|
|
5425
|
-
})],
|
|
5376
|
+
})], BaseButton.prototype, "formAttribute", 2);
|
|
5426
5377
|
__decorateClass$o([attr({
|
|
5427
5378
|
attribute: "formenctype"
|
|
5428
|
-
})],
|
|
5379
|
+
})], BaseButton.prototype, "formEnctype", 2);
|
|
5429
5380
|
__decorateClass$o([attr({
|
|
5430
5381
|
attribute: "formmethod"
|
|
5431
|
-
})],
|
|
5382
|
+
})], BaseButton.prototype, "formMethod", 2);
|
|
5432
5383
|
__decorateClass$o([attr({
|
|
5433
5384
|
attribute: "formnovalidate",
|
|
5434
5385
|
mode: "boolean"
|
|
5435
|
-
})],
|
|
5386
|
+
})], BaseButton.prototype, "formNoValidate", 2);
|
|
5436
5387
|
__decorateClass$o([attr({
|
|
5437
5388
|
attribute: "formtarget"
|
|
5438
|
-
})],
|
|
5389
|
+
})], BaseButton.prototype, "formTarget", 2);
|
|
5390
|
+
__decorateClass$o([attr], BaseButton.prototype, "name", 2);
|
|
5391
|
+
__decorateClass$o([attr], BaseButton.prototype, "type", 2);
|
|
5392
|
+
__decorateClass$o([attr], BaseButton.prototype, "value", 2);
|
|
5393
|
+
class Button extends BaseButton {
|
|
5394
|
+
constructor() {
|
|
5395
|
+
super(...arguments);
|
|
5396
|
+
this.iconOnly = false;
|
|
5397
|
+
}
|
|
5398
|
+
/**
|
|
5399
|
+
* Handles changes to appearance attribute custom states
|
|
5400
|
+
* @param prev - the previous state
|
|
5401
|
+
* @param next - the next state
|
|
5402
|
+
*/
|
|
5403
|
+
appearanceChanged(prev, next) {
|
|
5404
|
+
if (prev) {
|
|
5405
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
5406
|
+
}
|
|
5407
|
+
if (next) {
|
|
5408
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
5409
|
+
}
|
|
5410
|
+
}
|
|
5411
|
+
/**
|
|
5412
|
+
* Handles changes to shape attribute custom states
|
|
5413
|
+
* @param prev - the previous state
|
|
5414
|
+
* @param next - the next state
|
|
5415
|
+
*/
|
|
5416
|
+
shapeChanged(prev, next) {
|
|
5417
|
+
if (prev) {
|
|
5418
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
5419
|
+
}
|
|
5420
|
+
if (next) {
|
|
5421
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
5422
|
+
}
|
|
5423
|
+
}
|
|
5424
|
+
/**
|
|
5425
|
+
* Handles changes to size attribute custom states
|
|
5426
|
+
* @param prev - the previous state
|
|
5427
|
+
* @param next - the next state
|
|
5428
|
+
*/
|
|
5429
|
+
sizeChanged(prev, next) {
|
|
5430
|
+
if (prev) {
|
|
5431
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
5432
|
+
}
|
|
5433
|
+
if (next) {
|
|
5434
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
5435
|
+
}
|
|
5436
|
+
}
|
|
5437
|
+
/**
|
|
5438
|
+
* Handles changes to icon only custom states
|
|
5439
|
+
* @param prev - the previous state
|
|
5440
|
+
* @param next - the next state
|
|
5441
|
+
*/
|
|
5442
|
+
iconOnlyChanged(prev, next) {
|
|
5443
|
+
toggleState(this.elementInternals, "icon", next);
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5446
|
+
__decorateClass$o([attr], Button.prototype, "appearance", 2);
|
|
5447
|
+
__decorateClass$o([attr], Button.prototype, "shape", 2);
|
|
5448
|
+
__decorateClass$o([attr], Button.prototype, "size", 2);
|
|
5439
5449
|
__decorateClass$o([attr({
|
|
5440
5450
|
attribute: "icon-only",
|
|
5441
5451
|
mode: "boolean"
|
|
5442
5452
|
})], Button.prototype, "iconOnly", 2);
|
|
5443
|
-
__decorateClass$o([attr], Button.prototype, "name", 2);
|
|
5444
|
-
__decorateClass$o([attr], Button.prototype, "shape", 2);
|
|
5445
|
-
__decorateClass$o([attr], Button.prototype, "size", 2);
|
|
5446
|
-
__decorateClass$o([attr], Button.prototype, "type", 2);
|
|
5447
|
-
__decorateClass$o([attr], Button.prototype, "value", 2);
|
|
5448
5453
|
applyMixins(Button, StartEnd);
|
|
5449
5454
|
|
|
5450
5455
|
function buttonTemplate$1(options = {}) {
|
|
@@ -6744,7 +6749,7 @@ const hasMessageState = css.partial`:is([state--has-message], :state(has-message
|
|
|
6744
6749
|
const styles$k = css`
|
|
6745
6750
|
${display("inline-grid")}
|
|
6746
6751
|
|
|
6747
|
-
:host{color:${colorNeutralForeground1};align-items:center;gap:0 ${spacingHorizontalM};justify-items:start;
|
|
6752
|
+
: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}`;
|
|
6748
6753
|
|
|
6749
6754
|
const template$l = 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({
|
|
6750
6755
|
property: "slottedInputs",
|
|
@@ -8605,7 +8610,7 @@ __decorateClass$8([attr({
|
|
|
8605
8610
|
const styles$b = css`
|
|
8606
8611
|
${display("flex")}
|
|
8607
8612
|
|
|
8608
|
-
:host{-webkit-tap-highlight-color:transparent;cursor:pointer}:host(${disabledState}),:host([orientation='vertical']){flex-direction:column;justify-content:flex-start}:host([orientation='horizontal']){flex-direction:row}::slotted(*){color:${colorNeutralForeground3}}::slotted(:hover){color:${colorNeutralForeground2}}::slotted(:active){color:${colorNeutralForeground1}}::slotted(${disabledState}){color:${colorNeutralForegroundDisabled}}::slotted(${checkedState}){color:${colorNeutralForeground1}}`;
|
|
8613
|
+
:host{-webkit-tap-highlight-color:transparent;cursor:pointer;gap:${spacingVerticalL}}:host(${disabledState}),:host([orientation='vertical']){flex-direction:column;justify-content:flex-start}:host([orientation='horizontal']){flex-direction:row}::slotted(*){color:${colorNeutralForeground3}}::slotted(:hover){color:${colorNeutralForeground2}}::slotted(:active){color:${colorNeutralForeground1}}::slotted(${disabledState}){color:${colorNeutralForegroundDisabled}}::slotted(${checkedState}){color:${colorNeutralForeground1}}`;
|
|
8609
8614
|
|
|
8610
8615
|
function radioGroupTemplate() {
|
|
8611
8616
|
return html`<template @disabled="${(x, c) => x.disabledRadioHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot @slotchange="${(x, c) => x.slotchangeHandler(c.event)}"></slot></template>`;
|