igniteui-webcomponents 1.0.0-rc.0 → 1.0.0
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.
|
@@ -10,6 +10,7 @@ export default class IgcAvatarComponent extends IgcAvatarComponent_base {
|
|
|
10
10
|
shape: 'circle' | 'rounded' | 'square';
|
|
11
11
|
private get classes();
|
|
12
12
|
constructor();
|
|
13
|
+
protected handleErrorState(): void;
|
|
13
14
|
protected render(): import("lit").TemplateResult<1>;
|
|
14
15
|
}
|
|
15
16
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/avatar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;;
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/avatar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;;AAqBvC,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,uBAAwB;IAEtE,OAAc,OAAO,SAAgB;IAGrC,OAAc,MAAM,4BAAY;IAIzB,GAAG,EAAG,MAAM,CAAC;IAGpB,OAAO,CAAC,QAAQ,CAAS;IAIlB,GAAG,EAAG,MAAM,CAAC;IAIb,QAAQ,EAAG,MAAM,CAAC;IAIlB,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAY;IAEzD,OAAO,KAAK,OAAO,GAWlB;;IAQD,SAAS,CAAC,gBAAgB;IAI1B,SAAS,CAAC,MAAM;CAyBjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,kBAAkB,CAAC;KAClC;CACF"}
|
|
@@ -8,6 +8,7 @@ import { html, LitElement } from 'lit';
|
|
|
8
8
|
import { property, state } from 'lit/decorators.js';
|
|
9
9
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
|
+
import { watch } from '../common/decorators/watch.js';
|
|
11
12
|
import { SizableMixin } from '../common/mixins/sizable.js';
|
|
12
13
|
import { styles } from './avatar.material.css';
|
|
13
14
|
export default class IgcAvatarComponent extends SizableMixin(LitElement) {
|
|
@@ -28,6 +29,9 @@ export default class IgcAvatarComponent extends SizableMixin(LitElement) {
|
|
|
28
29
|
large: size === 'large',
|
|
29
30
|
};
|
|
30
31
|
}
|
|
32
|
+
handleErrorState() {
|
|
33
|
+
this.hasError = false;
|
|
34
|
+
}
|
|
31
35
|
render() {
|
|
32
36
|
return html `
|
|
33
37
|
<div
|
|
@@ -71,4 +75,7 @@ __decorate([
|
|
|
71
75
|
__decorate([
|
|
72
76
|
property({ reflect: true })
|
|
73
77
|
], IgcAvatarComponent.prototype, "shape", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
watch('src')
|
|
80
|
+
], IgcAvatarComponent.prototype, "handleErrorState", null);
|
|
74
81
|
//# sourceMappingURL=avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/components/avatar/avatar.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAe/C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY,CAAC,UAAU,CAAC;IAuCtE;QACE,KAAK,EAAE,CAAC;QA5BF,aAAQ,G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 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { SizableMixin } from '../common/mixins/sizable.js';\nimport { styles } from './avatar.material.css';\n\n/**\n * An avatar component is used as a representation of a user identity\n * typically in a user profile.\n *\n * @element igc-avatar\n *\n * @slot - Renders an icon inside the default slot.\n *\n * @csspart base - The base wrapper of the avatar.\n * @csspart initials - The initials wrapper of the avatar.\n * @csspart image - The image wrapper of the avatar.\n * @csspart icon - The icon wrapper of the avatar.\n */\nexport default class IgcAvatarComponent extends SizableMixin(LitElement) {\n /** @private */\n public static tagName = 'igc-avatar';\n\n /** @private */\n public static styles = [styles];\n\n /** The image source to use. */\n @property()\n public src!: string;\n\n @state()\n private hasError = false;\n\n /** Alternative text for the image. */\n @property()\n public alt!: string;\n\n /** Initials to use as a fallback when no image is available. */\n @property()\n public initials!: string;\n\n /** The shape of the avatar. */\n @property({ reflect: true })\n public shape: 'circle' | 'rounded' | 'square' = 'square';\n\n private get classes() {\n const { size, shape } = this;\n\n return {\n circle: shape === 'circle',\n rounded: shape === 'rounded',\n square: shape === 'square',\n small: size === 'small',\n medium: size === 'medium',\n large: size === 'large',\n };\n }\n\n constructor() {\n super();\n this.size = 'small';\n }\n\n @watch('src')\n protected handleErrorState() {\n this.hasError = false;\n }\n\n protected render() {\n return html`\n <div\n part=\"base\"\n role=\"img\"\n aria-label=\"avatar\"\n aria-roledescription=${this.size + ' ' + this.shape}\n class=${classMap(this.classes)}\n >\n ${this.initials\n ? html`<span part=\"initials\">${this.initials}</span>`\n : html` <slot></slot> `}\n ${this.src && !this.hasError\n ? html`\n <img\n part=\"image\"\n alt=${ifDefined(this.alt)}\n src=${ifDefined(this.src)}\n @error=\"${() => (this.hasError = true)}\"\n />\n `\n : ''}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-avatar': IgcAvatarComponent;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-webcomponents",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.",
|
|
5
5
|
"author": "Infragistics",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|