@fluentui/web-components 3.0.0-beta.47 → 3.0.0-beta.49
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 +23 -2
- package/dist/dts/avatar/avatar.d.ts +25 -17
- package/dist/dts/avatar/index.d.ts +1 -1
- package/dist/dts/index.d.ts +5 -5
- package/dist/dts/progress-bar/index.d.ts +1 -1
- package/dist/dts/progress-bar/progress-bar.d.ts +35 -27
- package/dist/dts/spinner/index.d.ts +1 -1
- package/dist/dts/spinner/spinner.d.ts +10 -2
- package/dist/dts/text-input/index.d.ts +1 -1
- package/dist/dts/text-input/text-input.d.ts +37 -29
- package/dist/dts/theme/index.d.ts +1 -1
- package/dist/dts/theme/set-theme.d.ts +6 -1
- package/dist/esm/avatar/avatar.js +21 -13
- package/dist/esm/avatar/avatar.js.map +1 -1
- package/dist/esm/avatar/index.js +1 -1
- package/dist/esm/avatar/index.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/progress-bar/index.js +1 -1
- package/dist/esm/progress-bar/index.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.js +47 -39
- package/dist/esm/progress-bar/progress-bar.js.map +1 -1
- package/dist/esm/spinner/index.js +1 -1
- package/dist/esm/spinner/index.js.map +1 -1
- package/dist/esm/spinner/spinner.js +19 -11
- package/dist/esm/spinner/spinner.js.map +1 -1
- package/dist/esm/text-input/index.js +1 -1
- package/dist/esm/text-input/index.js.map +1 -1
- package/dist/esm/text-input/text-input.js +63 -55
- package/dist/esm/text-input/text-input.js.map +1 -1
- package/dist/esm/theme/index.js.map +1 -1
- package/dist/esm/theme/set-theme.js.map +1 -1
- package/dist/web-components.d.ts +1179 -1137
- package/dist/web-components.js +106 -100
- package/dist/web-components.min.js +183 -183
- package/package.json +1 -1
package/dist/web-components.js
CHANGED
|
@@ -4559,7 +4559,7 @@ var __decorateClass$q = (decorators, target, key, kind) => {
|
|
|
4559
4559
|
if (kind && result) __defProp$q(target, key, result);
|
|
4560
4560
|
return result;
|
|
4561
4561
|
};
|
|
4562
|
-
|
|
4562
|
+
class BaseAvatar extends FASTElement {
|
|
4563
4563
|
constructor() {
|
|
4564
4564
|
super();
|
|
4565
4565
|
/**
|
|
@@ -4601,7 +4601,7 @@ const _Avatar = class _Avatar extends FASTElement {
|
|
|
4601
4601
|
const colorful = this.color === AvatarColor.colorful;
|
|
4602
4602
|
const prev = this.currentColor;
|
|
4603
4603
|
toggleState(this.elementInternals, `${prev}`, false);
|
|
4604
|
-
this.currentColor = colorful && this.colorId ? this.colorId : colorful ?
|
|
4604
|
+
this.currentColor = colorful && this.colorId ? this.colorId : colorful ? Avatar.colors[getHashCode(this.name ?? "") % Avatar.colors.length] : this.color ?? AvatarColor.neutral;
|
|
4605
4605
|
toggleState(this.elementInternals, `${this.currentColor}`, true);
|
|
4606
4606
|
}
|
|
4607
4607
|
/**
|
|
@@ -4617,24 +4617,24 @@ const _Avatar = class _Avatar extends FASTElement {
|
|
|
4617
4617
|
firstInitialOnly: size <= 16
|
|
4618
4618
|
});
|
|
4619
4619
|
}
|
|
4620
|
-
}
|
|
4620
|
+
}
|
|
4621
4621
|
/**
|
|
4622
4622
|
* An array of the available Avatar named colors
|
|
4623
4623
|
*/
|
|
4624
|
-
|
|
4625
|
-
__decorateClass$q([attr],
|
|
4626
|
-
__decorateClass$q([attr],
|
|
4624
|
+
BaseAvatar.colors = Object.values(AvatarNamedColor);
|
|
4625
|
+
__decorateClass$q([attr], BaseAvatar.prototype, "name", 2);
|
|
4626
|
+
__decorateClass$q([attr], BaseAvatar.prototype, "initials", 2);
|
|
4627
4627
|
__decorateClass$q([attr({
|
|
4628
4628
|
converter: nullableNumberConverter
|
|
4629
|
-
})],
|
|
4630
|
-
__decorateClass$q([attr],
|
|
4631
|
-
__decorateClass$q([attr],
|
|
4632
|
-
__decorateClass$q([attr], _Avatar.prototype, "appearance", 2);
|
|
4633
|
-
__decorateClass$q([attr], _Avatar.prototype, "color", 2);
|
|
4629
|
+
})], BaseAvatar.prototype, "size", 2);
|
|
4630
|
+
__decorateClass$q([attr], BaseAvatar.prototype, "active", 2);
|
|
4631
|
+
__decorateClass$q([attr], BaseAvatar.prototype, "color", 2);
|
|
4634
4632
|
__decorateClass$q([attr({
|
|
4635
4633
|
attribute: "color-id"
|
|
4636
|
-
})],
|
|
4637
|
-
|
|
4634
|
+
})], BaseAvatar.prototype, "colorId", 2);
|
|
4635
|
+
class Avatar extends BaseAvatar {}
|
|
4636
|
+
__decorateClass$q([attr], Avatar.prototype, "shape", 2);
|
|
4637
|
+
__decorateClass$q([attr], Avatar.prototype, "appearance", 2);
|
|
4638
4638
|
const getHashCode = str => {
|
|
4639
4639
|
let hashCode = 0;
|
|
4640
4640
|
for (let len = str.length - 1; len >= 0; len--) {
|
|
@@ -7961,7 +7961,7 @@ var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
|
7961
7961
|
if (kind && result) __defProp$9(target, key, result);
|
|
7962
7962
|
return result;
|
|
7963
7963
|
};
|
|
7964
|
-
class
|
|
7964
|
+
class BaseProgressBar extends FASTElement {
|
|
7965
7965
|
constructor() {
|
|
7966
7966
|
super();
|
|
7967
7967
|
/**
|
|
@@ -7973,32 +7973,6 @@ class ProgressBar extends FASTElement {
|
|
|
7973
7973
|
this.validationState = null;
|
|
7974
7974
|
this.elementInternals.role = "progressbar";
|
|
7975
7975
|
}
|
|
7976
|
-
/**
|
|
7977
|
-
* Handles changes to thickness attribute custom states
|
|
7978
|
-
* @param prev - the previous state
|
|
7979
|
-
* @param next - the next state
|
|
7980
|
-
*/
|
|
7981
|
-
thicknessChanged(prev, next) {
|
|
7982
|
-
if (prev) {
|
|
7983
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
7984
|
-
}
|
|
7985
|
-
if (next) {
|
|
7986
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
7987
|
-
}
|
|
7988
|
-
}
|
|
7989
|
-
/**
|
|
7990
|
-
* Handles changes to shape attribute custom states
|
|
7991
|
-
* @param prev - the previous state
|
|
7992
|
-
* @param next - the next state
|
|
7993
|
-
*/
|
|
7994
|
-
shapeChanged(prev, next) {
|
|
7995
|
-
if (prev) {
|
|
7996
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
7997
|
-
}
|
|
7998
|
-
if (next) {
|
|
7999
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
8000
|
-
}
|
|
8001
|
-
}
|
|
8002
7976
|
/**
|
|
8003
7977
|
* Handles changes to validation-state attribute custom states
|
|
8004
7978
|
* @param prev - the previous state
|
|
@@ -8047,21 +8021,49 @@ class ProgressBar extends FASTElement {
|
|
|
8047
8021
|
return range === 0 ? 0 : Math.fround((value - min) / range * 100);
|
|
8048
8022
|
}
|
|
8049
8023
|
}
|
|
8050
|
-
__decorateClass$9([attr], ProgressBar.prototype, "thickness", 2);
|
|
8051
|
-
__decorateClass$9([attr], ProgressBar.prototype, "shape", 2);
|
|
8052
8024
|
__decorateClass$9([attr({
|
|
8053
8025
|
attribute: "validation-state"
|
|
8054
|
-
})],
|
|
8026
|
+
})], BaseProgressBar.prototype, "validationState", 2);
|
|
8055
8027
|
__decorateClass$9([attr({
|
|
8056
8028
|
converter: nullableNumberConverter
|
|
8057
|
-
})],
|
|
8029
|
+
})], BaseProgressBar.prototype, "value", 2);
|
|
8058
8030
|
__decorateClass$9([attr({
|
|
8059
8031
|
converter: nullableNumberConverter
|
|
8060
|
-
})],
|
|
8032
|
+
})], BaseProgressBar.prototype, "min", 2);
|
|
8061
8033
|
__decorateClass$9([attr({
|
|
8062
8034
|
converter: nullableNumberConverter
|
|
8063
|
-
})],
|
|
8064
|
-
__decorateClass$9([volatile],
|
|
8035
|
+
})], BaseProgressBar.prototype, "max", 2);
|
|
8036
|
+
__decorateClass$9([volatile], BaseProgressBar.prototype, "percentComplete", 1);
|
|
8037
|
+
class ProgressBar extends BaseProgressBar {
|
|
8038
|
+
/**
|
|
8039
|
+
* Handles changes to thickness attribute custom states
|
|
8040
|
+
* @param prev - the previous state
|
|
8041
|
+
* @param next - the next state
|
|
8042
|
+
*/
|
|
8043
|
+
thicknessChanged(prev, next) {
|
|
8044
|
+
if (prev) {
|
|
8045
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
8046
|
+
}
|
|
8047
|
+
if (next) {
|
|
8048
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
8049
|
+
}
|
|
8050
|
+
}
|
|
8051
|
+
/**
|
|
8052
|
+
* Handles changes to shape attribute custom states
|
|
8053
|
+
* @param prev - the previous state
|
|
8054
|
+
* @param next - the next state
|
|
8055
|
+
*/
|
|
8056
|
+
shapeChanged(prev, next) {
|
|
8057
|
+
if (prev) {
|
|
8058
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
8059
|
+
}
|
|
8060
|
+
if (next) {
|
|
8061
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
8062
|
+
}
|
|
8063
|
+
}
|
|
8064
|
+
}
|
|
8065
|
+
__decorateClass$9([attr], ProgressBar.prototype, "thickness", 2);
|
|
8066
|
+
__decorateClass$9([attr], ProgressBar.prototype, "shape", 2);
|
|
8065
8067
|
|
|
8066
8068
|
const styles$c = css`
|
|
8067
8069
|
${display("block")}
|
|
@@ -9371,7 +9373,7 @@ var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
|
9371
9373
|
if (kind && result) __defProp$5(target, key, result);
|
|
9372
9374
|
return result;
|
|
9373
9375
|
};
|
|
9374
|
-
class
|
|
9376
|
+
class BaseSpinner extends FASTElement {
|
|
9375
9377
|
constructor() {
|
|
9376
9378
|
super();
|
|
9377
9379
|
/**
|
|
@@ -9382,6 +9384,8 @@ class Spinner extends FASTElement {
|
|
|
9382
9384
|
this.elementInternals = this.attachInternals();
|
|
9383
9385
|
this.elementInternals.role = "progressbar";
|
|
9384
9386
|
}
|
|
9387
|
+
}
|
|
9388
|
+
class Spinner extends BaseSpinner {
|
|
9385
9389
|
/**
|
|
9386
9390
|
* Handles changes to size attribute custom states
|
|
9387
9391
|
* @param prev - the previous state
|
|
@@ -9951,7 +9955,7 @@ var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
|
9951
9955
|
if (kind && result) __defProp$2(target, key, result);
|
|
9952
9956
|
return result;
|
|
9953
9957
|
};
|
|
9954
|
-
class
|
|
9958
|
+
class BaseTextInput extends FASTElement {
|
|
9955
9959
|
constructor() {
|
|
9956
9960
|
super(...arguments);
|
|
9957
9961
|
this.type = TextInputType.text;
|
|
@@ -9974,32 +9978,6 @@ class TextInput extends FASTElement {
|
|
|
9974
9978
|
*/
|
|
9975
9979
|
this.elementInternals = this.attachInternals();
|
|
9976
9980
|
}
|
|
9977
|
-
/**
|
|
9978
|
-
* Handles changes to appearance attribute custom states
|
|
9979
|
-
* @param prev - the previous state
|
|
9980
|
-
* @param next - the next state
|
|
9981
|
-
*/
|
|
9982
|
-
appearanceChanged(prev, next) {
|
|
9983
|
-
if (prev) {
|
|
9984
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
9985
|
-
}
|
|
9986
|
-
if (next) {
|
|
9987
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
9988
|
-
}
|
|
9989
|
-
}
|
|
9990
|
-
/**
|
|
9991
|
-
* Handles changes to `control-size` attribute custom states
|
|
9992
|
-
* @param prev - the previous state
|
|
9993
|
-
* @param next - the next state
|
|
9994
|
-
*/
|
|
9995
|
-
controlSizeChanged(prev, next) {
|
|
9996
|
-
if (prev) {
|
|
9997
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
9998
|
-
}
|
|
9999
|
-
if (next) {
|
|
10000
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
10001
|
-
}
|
|
10002
|
-
}
|
|
10003
9981
|
/**
|
|
10004
9982
|
* Updates the control label visibility based on the presence of default slotted content.
|
|
10005
9983
|
*
|
|
@@ -10289,58 +10267,86 @@ class TextInput extends FASTElement {
|
|
|
10289
10267
|
*
|
|
10290
10268
|
* @public
|
|
10291
10269
|
*/
|
|
10292
|
-
|
|
10293
|
-
__decorateClass$2([attr],
|
|
10294
|
-
__decorateClass$2([attr], TextInput.prototype, "autocomplete", 2);
|
|
10270
|
+
BaseTextInput.formAssociated = true;
|
|
10271
|
+
__decorateClass$2([attr], BaseTextInput.prototype, "autocomplete", 2);
|
|
10295
10272
|
__decorateClass$2([attr({
|
|
10296
10273
|
mode: "boolean"
|
|
10297
|
-
})],
|
|
10298
|
-
__decorateClass$2([
|
|
10299
|
-
|
|
10300
|
-
})], TextInput.prototype, "controlSize", 2);
|
|
10301
|
-
__decorateClass$2([observable], TextInput.prototype, "defaultSlottedNodes", 2);
|
|
10302
|
-
__decorateClass$2([attr], TextInput.prototype, "dirname", 2);
|
|
10274
|
+
})], BaseTextInput.prototype, "autofocus", 2);
|
|
10275
|
+
__decorateClass$2([observable], BaseTextInput.prototype, "defaultSlottedNodes", 2);
|
|
10276
|
+
__decorateClass$2([attr], BaseTextInput.prototype, "dirname", 2);
|
|
10303
10277
|
__decorateClass$2([attr({
|
|
10304
10278
|
mode: "boolean"
|
|
10305
|
-
})],
|
|
10279
|
+
})], BaseTextInput.prototype, "disabled", 2);
|
|
10306
10280
|
__decorateClass$2([attr({
|
|
10307
10281
|
attribute: "form"
|
|
10308
|
-
})],
|
|
10282
|
+
})], BaseTextInput.prototype, "formAttribute", 2);
|
|
10309
10283
|
__decorateClass$2([attr({
|
|
10310
10284
|
attribute: "value",
|
|
10311
10285
|
mode: "fromView"
|
|
10312
|
-
})],
|
|
10313
|
-
__decorateClass$2([attr],
|
|
10286
|
+
})], BaseTextInput.prototype, "initialValue", 2);
|
|
10287
|
+
__decorateClass$2([attr], BaseTextInput.prototype, "list", 2);
|
|
10314
10288
|
__decorateClass$2([attr({
|
|
10315
10289
|
converter: nullableNumberConverter
|
|
10316
|
-
})],
|
|
10290
|
+
})], BaseTextInput.prototype, "maxlength", 2);
|
|
10317
10291
|
__decorateClass$2([attr({
|
|
10318
10292
|
converter: nullableNumberConverter
|
|
10319
|
-
})],
|
|
10293
|
+
})], BaseTextInput.prototype, "minlength", 2);
|
|
10320
10294
|
__decorateClass$2([attr({
|
|
10321
10295
|
mode: "boolean"
|
|
10322
|
-
})],
|
|
10323
|
-
__decorateClass$2([attr],
|
|
10324
|
-
__decorateClass$2([attr],
|
|
10325
|
-
__decorateClass$2([attr],
|
|
10296
|
+
})], BaseTextInput.prototype, "multiple", 2);
|
|
10297
|
+
__decorateClass$2([attr], BaseTextInput.prototype, "name", 2);
|
|
10298
|
+
__decorateClass$2([attr], BaseTextInput.prototype, "pattern", 2);
|
|
10299
|
+
__decorateClass$2([attr], BaseTextInput.prototype, "placeholder", 2);
|
|
10326
10300
|
__decorateClass$2([attr({
|
|
10327
10301
|
attribute: "readonly",
|
|
10328
10302
|
mode: "boolean"
|
|
10329
|
-
})],
|
|
10303
|
+
})], BaseTextInput.prototype, "readOnly", 2);
|
|
10330
10304
|
__decorateClass$2([attr({
|
|
10331
10305
|
mode: "boolean"
|
|
10332
|
-
})],
|
|
10306
|
+
})], BaseTextInput.prototype, "required", 2);
|
|
10333
10307
|
__decorateClass$2([attr({
|
|
10334
10308
|
converter: nullableNumberConverter
|
|
10335
|
-
})],
|
|
10309
|
+
})], BaseTextInput.prototype, "size", 2);
|
|
10336
10310
|
__decorateClass$2([attr({
|
|
10337
10311
|
converter: {
|
|
10338
10312
|
fromView: value => typeof value === "string" ? ["true", ""].includes(value.trim().toLowerCase()) : null,
|
|
10339
10313
|
toView: value => value.toString()
|
|
10340
10314
|
}
|
|
10341
|
-
})],
|
|
10342
|
-
__decorateClass$2([attr],
|
|
10343
|
-
__decorateClass$2([observable],
|
|
10315
|
+
})], BaseTextInput.prototype, "spellcheck", 2);
|
|
10316
|
+
__decorateClass$2([attr], BaseTextInput.prototype, "type", 2);
|
|
10317
|
+
__decorateClass$2([observable], BaseTextInput.prototype, "controlLabel", 2);
|
|
10318
|
+
class TextInput extends BaseTextInput {
|
|
10319
|
+
/**
|
|
10320
|
+
* Handles changes to appearance attribute custom states
|
|
10321
|
+
* @param prev - the previous state
|
|
10322
|
+
* @param next - the next state
|
|
10323
|
+
*/
|
|
10324
|
+
appearanceChanged(prev, next) {
|
|
10325
|
+
if (prev) {
|
|
10326
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
10327
|
+
}
|
|
10328
|
+
if (next) {
|
|
10329
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
10330
|
+
}
|
|
10331
|
+
}
|
|
10332
|
+
/**
|
|
10333
|
+
* Handles changes to `control-size` attribute custom states
|
|
10334
|
+
* @param prev - the previous state
|
|
10335
|
+
* @param next - the next state
|
|
10336
|
+
*/
|
|
10337
|
+
controlSizeChanged(prev, next) {
|
|
10338
|
+
if (prev) {
|
|
10339
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
10340
|
+
}
|
|
10341
|
+
if (next) {
|
|
10342
|
+
toggleState(this.elementInternals, `${next}`, true);
|
|
10343
|
+
}
|
|
10344
|
+
}
|
|
10345
|
+
}
|
|
10346
|
+
__decorateClass$2([attr], TextInput.prototype, "appearance", 2);
|
|
10347
|
+
__decorateClass$2([attr({
|
|
10348
|
+
attribute: "control-size"
|
|
10349
|
+
})], TextInput.prototype, "controlSize", 2);
|
|
10344
10350
|
applyMixins(TextInput, StartEnd);
|
|
10345
10351
|
|
|
10346
10352
|
const styles$2 = css`
|