@ni/spright-components
Version:
NI Spright Components
45 lines • 1.53 kB
JavaScript
import { __decorate } from "tslib";
import { attr, observable } from '@ni/fast-element';
import { applyMixins, DesignSystem, FoundationElement, StartEnd } from '@ni/fast-foundation';
import { styles } from './styles';
import { template } from './template';
import { ChatMessageType } from './types';
/**
* A Spright component for displaying a chat message
* @deprecated Use specific message component types instead
*/
export class ChatMessage extends FoundationElement {
constructor() {
super(...arguments);
/**
* @public
* The message type of this message in the chat conversation
* @remarks
* HTML Attribute: message-type
*/
this.messageType = ChatMessageType.system;
/** @internal */
this.footerActionsIsEmpty = true;
}
slottedFooterActionsElementsChanged(_prev, next) {
this.footerActionsIsEmpty = !next?.length;
}
}
__decorate([
attr({ attribute: 'message-type' })
], ChatMessage.prototype, "messageType", void 0);
__decorate([
observable
], ChatMessage.prototype, "footerActionsIsEmpty", void 0);
__decorate([
observable
], ChatMessage.prototype, "slottedFooterActionsElements", void 0);
applyMixins(ChatMessage, StartEnd);
const sprightChatMessage = ChatMessage.compose({
baseName: 'chat-message',
template,
styles
});
DesignSystem.getOrCreate().withPrefix('spright').register(sprightChatMessage());
export const chatMessageTag = 'spright-chat-message';
//# sourceMappingURL=index.js.map