@aws/mynah-ui 4.23.0-beta.6 → 4.23.0-beta.8
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/dist/components/chat-item/prompt-input/prompt-text-input.d.ts +4 -0
- package/dist/components/form-items/radio-group.d.ts +1 -0
- package/dist/components/form-items/select.d.ts +1 -0
- package/dist/components/form-items/stars.d.ts +1 -0
- package/dist/components/form-items/text-area.d.ts +3 -0
- package/dist/components/form-items/text-input.d.ts +3 -0
- package/dist/helper/test-ids.d.ts +2 -0
- package/dist/helper/validator.d.ts +6 -1
- package/dist/main.d.ts +3 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +5 -1
- package/docs/DATAMODEL.md +3 -0
- package/docs/PROPERTIES.md +47 -0
- package/docs/STARTUP.md +1 -0
- package/package.json +1 -1
|
@@ -16,11 +16,15 @@ export declare class PromptTextInput {
|
|
|
16
16
|
private promptInputOverlay;
|
|
17
17
|
private keydownSupport;
|
|
18
18
|
private readonly selectedContext;
|
|
19
|
+
private contextTooltip;
|
|
20
|
+
private contextTooltipTimeout;
|
|
19
21
|
constructor(props: PromptTextInputProps);
|
|
20
22
|
private readonly checkIsEmpty;
|
|
21
23
|
private readonly removeContextPlaceholderOverlay;
|
|
22
24
|
private readonly insertElementToGivenPosition;
|
|
23
25
|
private readonly moveCursorToEnd;
|
|
26
|
+
private readonly showContextTooltip;
|
|
27
|
+
private readonly hideContextTooltip;
|
|
24
28
|
readonly insertContextItem: (contextItem: QuickActionCommand, position: number) => void;
|
|
25
29
|
readonly getCursorPos: () => number;
|
|
26
30
|
readonly clear: () => void;
|
|
@@ -12,6 +12,7 @@ export interface RadioGroupProps {
|
|
|
12
12
|
classNames?: string[];
|
|
13
13
|
attributes?: Record<string, string>;
|
|
14
14
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
15
|
+
description?: ExtendedHTMLElement;
|
|
15
16
|
value?: string;
|
|
16
17
|
optional?: boolean;
|
|
17
18
|
options?: SelectOption[];
|
|
@@ -9,6 +9,7 @@ export interface StarsProps {
|
|
|
9
9
|
classNames?: string[];
|
|
10
10
|
attributes?: Record<string, string>;
|
|
11
11
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
12
|
+
description?: ExtendedHTMLElement;
|
|
12
13
|
value?: string;
|
|
13
14
|
onChange?: (value: string) => void;
|
|
14
15
|
initStar?: StarValues;
|
|
@@ -9,6 +9,9 @@ export interface TextAreaProps {
|
|
|
9
9
|
classNames?: string[];
|
|
10
10
|
attributes?: Record<string, string>;
|
|
11
11
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
12
|
+
description?: ExtendedHTMLElement;
|
|
13
|
+
mandatory?: boolean;
|
|
14
|
+
fireModifierAndEnterKeyPress?: () => void;
|
|
12
15
|
placeholder?: string;
|
|
13
16
|
validationPatterns?: {
|
|
14
17
|
operator?: 'and' | 'or';
|
|
@@ -9,6 +9,9 @@ export interface TextInputProps {
|
|
|
9
9
|
classNames?: string[];
|
|
10
10
|
attributes?: Record<string, string>;
|
|
11
11
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
12
|
+
description?: ExtendedHTMLElement;
|
|
13
|
+
mandatory?: boolean;
|
|
14
|
+
fireModifierAndEnterKeyPress?: () => void;
|
|
12
15
|
placeholder?: string;
|
|
13
16
|
type?: 'text' | 'number' | 'email';
|
|
14
17
|
validationPatterns?: {
|
|
@@ -9,6 +9,7 @@ declare const _default: {
|
|
|
9
9
|
input: string;
|
|
10
10
|
inputWrapper: string;
|
|
11
11
|
remainingCharsIndicator: string;
|
|
12
|
+
contextTooltip: string;
|
|
12
13
|
selectedCommand: string;
|
|
13
14
|
quickPicksWrapper: string;
|
|
14
15
|
quickPicksGroup: string;
|
|
@@ -59,6 +60,7 @@ declare const _default: {
|
|
|
59
60
|
chatItemForm: {
|
|
60
61
|
wrapper: string;
|
|
61
62
|
title: string;
|
|
63
|
+
description: string;
|
|
62
64
|
itemSelectWrapper: string;
|
|
63
65
|
itemSelect: string;
|
|
64
66
|
itemRadioWrapper: string;
|
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
+
import { ExtendedHTMLElement } from '../main';
|
|
5
6
|
import { ValidationPattern } from '../static';
|
|
6
7
|
export declare const isTextualFormItemValid: (value: string, validationPatterns: {
|
|
7
8
|
operator?: 'and' | 'or';
|
|
8
9
|
genericValidationErrorMessage?: string;
|
|
9
10
|
patterns: ValidationPattern[];
|
|
10
|
-
}) => {
|
|
11
|
+
}, mandatory?: boolean) => {
|
|
11
12
|
isValid: boolean;
|
|
12
13
|
validationErrors: string[];
|
|
13
14
|
};
|
|
14
15
|
export declare const isMandatoryItemValid: (value: string) => boolean;
|
|
16
|
+
export declare const checkTextElementValidation: (inputElement: ExtendedHTMLElement, validationPatterns: {
|
|
17
|
+
operator?: 'and' | 'or';
|
|
18
|
+
patterns: ValidationPattern[];
|
|
19
|
+
} | undefined, validationErrorBlock: ExtendedHTMLElement, readyToValidate: boolean, mandatory?: boolean) => void;
|
package/dist/main.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemAction, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation, CodeSelectionType, Engagement, ChatItemFormItem, ChatItemButton, CardRenderDetails, PromptAttachmentType } from './static';
|
|
5
|
+
import { RelevancyVoteType, FeedbackPayload, MynahUIDataModel, NotificationType, ChatItem, ChatItemAction, ChatPrompt, MynahUITabStoreModel, MynahUITabStoreTab, ConfigModel, ReferenceTrackerInformation, CodeSelectionType, Engagement, ChatItemFormItem, ChatItemButton, CardRenderDetails, PromptAttachmentType, QuickActionCommand } from './static';
|
|
6
6
|
import './styles/styles.scss';
|
|
7
7
|
export { generateUID } from './helper/guid';
|
|
8
8
|
export { ChatItemBodyRenderer, } from './helper/dom';
|
|
@@ -47,6 +47,7 @@ export interface MynahUIProps {
|
|
|
47
47
|
onTabbedContentTabChange?: (tabId: string, messageId: string, contentTabId: string, eventId?: string) => void;
|
|
48
48
|
onTabChange?: (tabId: string, eventId?: string) => void;
|
|
49
49
|
onTabAdd?: (tabId: string, eventId?: string) => void;
|
|
50
|
+
onContextSelected?: (contextItem: QuickActionCommand, tabId: string, eventId?: string) => boolean;
|
|
50
51
|
onTabRemove?: (tabId: string, eventId?: string) => void;
|
|
51
52
|
/**
|
|
52
53
|
* @param tabId tabId which the close button triggered
|
|
@@ -68,6 +69,7 @@ export interface MynahUIProps {
|
|
|
68
69
|
onInfoLinkClick?: (tabId: string, link: string, mouseEvent?: MouseEvent, eventId?: string) => void;
|
|
69
70
|
onFormLinkClick?: (link: string, mouseEvent?: MouseEvent, eventId?: string) => void;
|
|
70
71
|
onSendFeedback?: (tabId: string, feedbackPayload: FeedbackPayload, eventId?: string) => void;
|
|
72
|
+
onFormModifierEnterPress?: (formData: Record<string, string>, tabId: string, eventId?: string) => void;
|
|
71
73
|
onCustomFormAction?: (tabId: string, action: {
|
|
72
74
|
id: string;
|
|
73
75
|
text?: string;
|