@fluentui/web-components 3.0.0-beta.48 → 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 +12 -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 +2 -2
- package/dist/dts/text-input/index.d.ts +1 -1
- package/dist/dts/text-input/text-input.d.ts +37 -29
- 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 +2 -2
- package/dist/esm/index.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/web-components.d.ts +1169 -1151
- package/dist/web-components.js +67 -65
- package/dist/web-components.min.js +164 -164
- 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--) {
|
|
@@ -9955,7 +9955,7 @@ var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
|
9955
9955
|
if (kind && result) __defProp$2(target, key, result);
|
|
9956
9956
|
return result;
|
|
9957
9957
|
};
|
|
9958
|
-
class
|
|
9958
|
+
class BaseTextInput extends FASTElement {
|
|
9959
9959
|
constructor() {
|
|
9960
9960
|
super(...arguments);
|
|
9961
9961
|
this.type = TextInputType.text;
|
|
@@ -9978,32 +9978,6 @@ class TextInput extends FASTElement {
|
|
|
9978
9978
|
*/
|
|
9979
9979
|
this.elementInternals = this.attachInternals();
|
|
9980
9980
|
}
|
|
9981
|
-
/**
|
|
9982
|
-
* Handles changes to appearance attribute custom states
|
|
9983
|
-
* @param prev - the previous state
|
|
9984
|
-
* @param next - the next state
|
|
9985
|
-
*/
|
|
9986
|
-
appearanceChanged(prev, next) {
|
|
9987
|
-
if (prev) {
|
|
9988
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
9989
|
-
}
|
|
9990
|
-
if (next) {
|
|
9991
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
9992
|
-
}
|
|
9993
|
-
}
|
|
9994
|
-
/**
|
|
9995
|
-
* Handles changes to `control-size` attribute custom states
|
|
9996
|
-
* @param prev - the previous state
|
|
9997
|
-
* @param next - the next state
|
|
9998
|
-
*/
|
|
9999
|
-
controlSizeChanged(prev, next) {
|
|
10000
|
-
if (prev) {
|
|
10001
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
10002
|
-
}
|
|
10003
|
-
if (next) {
|
|
10004
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
10005
|
-
}
|
|
10006
|
-
}
|
|
10007
9981
|
/**
|
|
10008
9982
|
* Updates the control label visibility based on the presence of default slotted content.
|
|
10009
9983
|
*
|
|
@@ -10293,58 +10267,86 @@ class TextInput extends FASTElement {
|
|
|
10293
10267
|
*
|
|
10294
10268
|
* @public
|
|
10295
10269
|
*/
|
|
10296
|
-
|
|
10297
|
-
__decorateClass$2([attr],
|
|
10298
|
-
__decorateClass$2([attr], TextInput.prototype, "autocomplete", 2);
|
|
10270
|
+
BaseTextInput.formAssociated = true;
|
|
10271
|
+
__decorateClass$2([attr], BaseTextInput.prototype, "autocomplete", 2);
|
|
10299
10272
|
__decorateClass$2([attr({
|
|
10300
10273
|
mode: "boolean"
|
|
10301
|
-
})],
|
|
10302
|
-
__decorateClass$2([
|
|
10303
|
-
|
|
10304
|
-
})], TextInput.prototype, "controlSize", 2);
|
|
10305
|
-
__decorateClass$2([observable], TextInput.prototype, "defaultSlottedNodes", 2);
|
|
10306
|
-
__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);
|
|
10307
10277
|
__decorateClass$2([attr({
|
|
10308
10278
|
mode: "boolean"
|
|
10309
|
-
})],
|
|
10279
|
+
})], BaseTextInput.prototype, "disabled", 2);
|
|
10310
10280
|
__decorateClass$2([attr({
|
|
10311
10281
|
attribute: "form"
|
|
10312
|
-
})],
|
|
10282
|
+
})], BaseTextInput.prototype, "formAttribute", 2);
|
|
10313
10283
|
__decorateClass$2([attr({
|
|
10314
10284
|
attribute: "value",
|
|
10315
10285
|
mode: "fromView"
|
|
10316
|
-
})],
|
|
10317
|
-
__decorateClass$2([attr],
|
|
10286
|
+
})], BaseTextInput.prototype, "initialValue", 2);
|
|
10287
|
+
__decorateClass$2([attr], BaseTextInput.prototype, "list", 2);
|
|
10318
10288
|
__decorateClass$2([attr({
|
|
10319
10289
|
converter: nullableNumberConverter
|
|
10320
|
-
})],
|
|
10290
|
+
})], BaseTextInput.prototype, "maxlength", 2);
|
|
10321
10291
|
__decorateClass$2([attr({
|
|
10322
10292
|
converter: nullableNumberConverter
|
|
10323
|
-
})],
|
|
10293
|
+
})], BaseTextInput.prototype, "minlength", 2);
|
|
10324
10294
|
__decorateClass$2([attr({
|
|
10325
10295
|
mode: "boolean"
|
|
10326
|
-
})],
|
|
10327
|
-
__decorateClass$2([attr],
|
|
10328
|
-
__decorateClass$2([attr],
|
|
10329
|
-
__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);
|
|
10330
10300
|
__decorateClass$2([attr({
|
|
10331
10301
|
attribute: "readonly",
|
|
10332
10302
|
mode: "boolean"
|
|
10333
|
-
})],
|
|
10303
|
+
})], BaseTextInput.prototype, "readOnly", 2);
|
|
10334
10304
|
__decorateClass$2([attr({
|
|
10335
10305
|
mode: "boolean"
|
|
10336
|
-
})],
|
|
10306
|
+
})], BaseTextInput.prototype, "required", 2);
|
|
10337
10307
|
__decorateClass$2([attr({
|
|
10338
10308
|
converter: nullableNumberConverter
|
|
10339
|
-
})],
|
|
10309
|
+
})], BaseTextInput.prototype, "size", 2);
|
|
10340
10310
|
__decorateClass$2([attr({
|
|
10341
10311
|
converter: {
|
|
10342
10312
|
fromView: value => typeof value === "string" ? ["true", ""].includes(value.trim().toLowerCase()) : null,
|
|
10343
10313
|
toView: value => value.toString()
|
|
10344
10314
|
}
|
|
10345
|
-
})],
|
|
10346
|
-
__decorateClass$2([attr],
|
|
10347
|
-
__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);
|
|
10348
10350
|
applyMixins(TextInput, StartEnd);
|
|
10349
10351
|
|
|
10350
10352
|
const styles$2 = css`
|