Skip to content

Commit 5f2b01e

Browse files
authored
Merge branch 'master' into skrastev/localization-intl
2 parents ea78764 + 16fb192 commit 5f2b01e

File tree

7 files changed

+33
-14
lines changed

7 files changed

+33
-14
lines changed

src/components/chat/chat-input.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import type {
2424
ChatTemplateRenderer,
2525
IgcChatMessageAttachment,
2626
} from './types.js';
27-
import { getChatAcceptedFiles, getIconName } from './utils.js';
27+
import { adoptPageStyles, getChatAcceptedFiles, getIconName } from './utils.js';
2828

2929
type DefaultInputRenderers = {
3030
input: ChatTemplateRenderer<ChatInputRenderContext>;
@@ -119,6 +119,12 @@ export default class IgcChatInputComponent extends LitElement {
119119
addThemingController(this, all);
120120
}
121121

122+
protected override firstUpdated(): void {
123+
if (this._state.options?.adoptRootStyles) {
124+
adoptPageStyles(this);
125+
}
126+
}
127+
122128
/** @internal */
123129
public focusInput(): void {
124130
this._textInputElement.focus();

src/components/chat/chat-message.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type {
1919
ChatTemplateRenderer,
2020
IgcChatMessage,
2121
} from './types.js';
22-
import { chatMessageAdoptPageStyles } from './utils.js';
22+
import { adoptPageStyles } from './utils.js';
2323

2424
const LIKE_INACTIVE = 'thumb_up_inactive';
2525
const LIKE_ACTIVE = 'thumb_up_active';
@@ -89,7 +89,7 @@ export default class IgcChatMessageComponent extends LitElement {
8989

9090
protected override firstUpdated(): void {
9191
if (this._state.options?.adoptRootStyles) {
92-
chatMessageAdoptPageStyles(this);
92+
adoptPageStyles(this);
9393
}
9494
}
9595

src/components/chat/chat.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ const Slots = setSlots(
105105
'suggestions',
106106
'suggestions-actions',
107107
'suggestion',
108-
'empty-state'
108+
'empty-state',
109+
'typing-indicator'
109110
);
110111

111112
/**
@@ -133,6 +134,7 @@ const Slots = setSlots(
133134
* @slot suggestions-actions - Slot for rendering additional actions.
134135
* @slot suggestion - Slot for rendering a single suggestion item.
135136
* @slot empty-state - Slot shown when there are no messages.
137+
* @slot typing-indicator - Slot for the "is typing" indicator.
136138
*
137139
* @csspart chat-container - Styles the main chat container.
138140
* @csspart header - Styles the chat header container.
@@ -413,7 +415,9 @@ export default class IgcChatComponent extends EventEmitterMixin<
413415
${this._state.options?.isTyping
414416
? html`
415417
<div part="typing-indicator">
416-
${this._getRenderer('typingIndicator')(ctx)}
418+
<slot name="typing-indicator"
419+
>${this._getRenderer('typingIndicator')(ctx)}</slot
420+
>
417421
</div>
418422
`
419423
: nothing}

src/components/chat/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ export interface ChatRenderers {
234234
messageHeader?: ChatTemplateRenderer<ChatMessageRenderContext>;
235235
/**
236236
* Custom renderer for the "is typing" indicator.
237+
*
238+
* @deprecated since 6.4.0. Use the `typing-indicator` slot.
237239
*/
238240
typingIndicator?: ChatTemplateRenderer<ChatRenderContext>;
239241
/**

src/components/chat/utils.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { adoptStyles, type LitElement } from 'lit';
22
import { last } from '../common/util.js';
3-
import type IgcChatMessageComponent from './chat-message.js';
43
import type { IgcChatMessageAttachment } from './types.js';
54

65
export type ChatAcceptedFileTypes = {
@@ -110,9 +109,7 @@ export function isImageAttachment(
110109
);
111110
}
112111

113-
export function chatMessageAdoptPageStyles(
114-
message: IgcChatMessageComponent
115-
): void {
112+
export function adoptPageStyles(element: LitElement): void {
116113
const sheets: CSSStyleSheet[] = [];
117114

118115
for (const sheet of document.styleSheets) {
@@ -129,6 +126,6 @@ export function chatMessageAdoptPageStyles(
129126
} catch {}
130127
}
131128

132-
const ctor = message.constructor as typeof LitElement;
133-
adoptStyles(message.shadowRoot!, [...ctor.elementStyles, ...sheets]);
129+
const ctor = element.constructor as typeof LitElement;
130+
adoptStyles(element.shadowRoot!, [...ctor.elementStyles, ...sheets]);
134131
}

src/components/date-range-picker/date-range-picker.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ export default class IgcDateRangePickerComponent extends FormAssociatedRequiredM
306306

307307
// #region General properties
308308

309+
/* @tsTwoWayProperty(true, "igcChange", "detail", false) */
310+
/**
311+
* The value of the picker
312+
* @attr
313+
*/
309314
@property({ converter: convertToDateRange })
310315
public set value(value: DateRangeValue | string | null | undefined) {
311316
this._formValue.setValueAndFormState(convertToDateRange(value));

src/components/dialog/themes/dialog.base.scss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
@use 'styles/utilities' as *;
33

44
:host {
5+
--transition-duration: 350ms;
6+
7+
display: contents;
58
border-style: none;
69
padding: unset;
710
}
@@ -80,9 +83,11 @@ dialog::backdrop {
8083
z-index: 10005;
8184
pointer-events: none;
8285
opacity: 0;
83-
transition: opacity 350ms ease-out;
86+
transition: opacity var(--transition-duration) ease-out;
8487
}
8588

86-
:host([open]) [part='backdrop'] {
87-
opacity: 1;
89+
:host([open]) {
90+
[part='backdrop'] {
91+
opacity: 1;
92+
}
8893
}

0 commit comments

Comments
 (0)