@aws/mynah-ui 4.23.0-beta.4 → 4.23.0-beta.5
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/chat-item-form-items.d.ts +1 -0
- package/dist/components/chat-item/chat-prompt-input.d.ts +2 -0
- package/dist/components/chat-item/prompt-input/prompt-input-quick-pick-item.d.ts +13 -0
- package/dist/components/chat-item/prompt-input/prompt-input-quick-pick-selector.d.ts +18 -0
- package/dist/components/chat-item/prompt-input/prompt-text-input.d.ts +2 -1
- package/dist/components/form-items/text-area.d.ts +11 -0
- package/dist/components/form-items/text-input.d.ts +11 -0
- package/dist/helper/quick-pick-data-handler.d.ts +2 -3
- package/dist/helper/validator.d.ts +14 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +27 -10
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ export declare class ChatItemFormItemsWrapper {
|
|
|
18
18
|
render: ExtendedHTMLElement;
|
|
19
19
|
constructor(props: ChatItemFormItemsWrapperProps);
|
|
20
20
|
private readonly getValidationHandler;
|
|
21
|
+
private readonly isItemValid;
|
|
21
22
|
isFormValid: () => boolean;
|
|
22
23
|
disableAll: () => void;
|
|
23
24
|
getAllValues: () => Record<string, string>;
|
|
@@ -20,12 +20,14 @@ export declare class ChatPromptInput {
|
|
|
20
20
|
private readonly progressIndicator;
|
|
21
21
|
private readonly promptAttachment;
|
|
22
22
|
private readonly chatPrompt;
|
|
23
|
+
private quickPickItemsSelectorContainer;
|
|
23
24
|
private promptTextInputLabel;
|
|
24
25
|
private remainingCharsOverlay;
|
|
25
26
|
private quickPickTriggerIndex;
|
|
26
27
|
private quickPickType;
|
|
27
28
|
private quickPickItemGroups;
|
|
28
29
|
private filteredQuickPickItemGroups;
|
|
30
|
+
private searchTerm;
|
|
29
31
|
private quickPick;
|
|
30
32
|
private quickPickOpen;
|
|
31
33
|
private selectedCommand;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExtendedHTMLElement } from '../../../helper/dom';
|
|
2
|
+
import { QuickActionCommand } from '../../../static';
|
|
3
|
+
export interface PromptInputQuickPickItemProps {
|
|
4
|
+
quickPickItem: QuickActionCommand;
|
|
5
|
+
onSelect: (quickPickItem: QuickActionCommand) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare class PromptInputQuickPickItem {
|
|
8
|
+
render: ExtendedHTMLElement;
|
|
9
|
+
private readonly props;
|
|
10
|
+
constructor(props: PromptInputQuickPickItemProps);
|
|
11
|
+
readonly setFocus: (isFocused: boolean) => void;
|
|
12
|
+
readonly getItem: () => QuickActionCommand;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExtendedHTMLElement } from '../../../helper/dom';
|
|
2
|
+
import { ChatItemButton, QuickActionCommandGroup, QuickActionCommand } from '../../../static';
|
|
3
|
+
export interface PromptInputQuickPickSelectorProps {
|
|
4
|
+
quickPickGroupList: QuickActionCommandGroup[];
|
|
5
|
+
onQuickPickGroupActionClick: (action: ChatItemButton) => void;
|
|
6
|
+
onQuickPickItemSelect: (quickPickItem: QuickActionCommand) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare class PromptInputQuickPickSelector {
|
|
9
|
+
render: ExtendedHTMLElement;
|
|
10
|
+
private readonly props;
|
|
11
|
+
private activeTargetElementIndex;
|
|
12
|
+
private allSelectableQuickPickElements;
|
|
13
|
+
constructor(props: PromptInputQuickPickSelectorProps);
|
|
14
|
+
private readonly getQuickPickGroups;
|
|
15
|
+
readonly changeTarget: (direction: 'up' | 'down') => void;
|
|
16
|
+
readonly getTargetElement: () => QuickActionCommand | null;
|
|
17
|
+
readonly updateList: (quickPickGroupList: QuickActionCommandGroup[]) => void;
|
|
18
|
+
}
|
|
@@ -15,6 +15,7 @@ export declare class PromptTextInput {
|
|
|
15
15
|
private readonly promptTextInput;
|
|
16
16
|
private promptInputOverlay;
|
|
17
17
|
private keydownSupport;
|
|
18
|
+
private readonly selectedContext;
|
|
18
19
|
constructor(props: PromptTextInputProps);
|
|
19
20
|
private readonly checkIsEmpty;
|
|
20
21
|
private readonly removeContextPlaceholderOverlay;
|
|
@@ -34,5 +35,5 @@ export declare class PromptTextInput {
|
|
|
34
35
|
cursorLine: number;
|
|
35
36
|
totalLines: number;
|
|
36
37
|
};
|
|
37
|
-
readonly getUsedContext: () =>
|
|
38
|
+
readonly getUsedContext: () => QuickActionCommand[];
|
|
38
39
|
}
|
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
|
+
import { ValidationPattern } from '../../static';
|
|
6
7
|
import '../../styles/components/_form-input.scss';
|
|
7
8
|
export interface TextAreaProps {
|
|
8
9
|
classNames?: string[];
|
|
9
10
|
attributes?: Record<string, string>;
|
|
10
11
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
11
12
|
placeholder?: string;
|
|
13
|
+
validationPatterns?: {
|
|
14
|
+
operator?: 'and' | 'or';
|
|
15
|
+
patterns: ValidationPattern[];
|
|
16
|
+
};
|
|
12
17
|
value?: string;
|
|
13
18
|
onChange?: (value: string) => void;
|
|
14
19
|
testId?: string;
|
|
@@ -18,14 +23,19 @@ export declare abstract class TextAreaAbstract {
|
|
|
18
23
|
setValue: (value: string) => void;
|
|
19
24
|
getValue: () => string;
|
|
20
25
|
setEnabled: (enabled: boolean) => void;
|
|
26
|
+
checkValidation: () => void;
|
|
21
27
|
}
|
|
22
28
|
export declare class TextAreaInternal extends TextAreaAbstract {
|
|
23
29
|
private readonly inputElement;
|
|
30
|
+
private readonly validationErrorBlock;
|
|
31
|
+
private readonly props;
|
|
32
|
+
private readyToValidate;
|
|
24
33
|
render: ExtendedHTMLElement;
|
|
25
34
|
constructor(props: TextAreaProps);
|
|
26
35
|
setValue: (value: string) => void;
|
|
27
36
|
getValue: () => string;
|
|
28
37
|
setEnabled: (enabled: boolean) => void;
|
|
38
|
+
checkValidation: () => void;
|
|
29
39
|
}
|
|
30
40
|
export declare class TextArea extends TextAreaAbstract {
|
|
31
41
|
render: ExtendedHTMLElement;
|
|
@@ -33,4 +43,5 @@ export declare class TextArea extends TextAreaAbstract {
|
|
|
33
43
|
setValue: (value: string) => void;
|
|
34
44
|
getValue: () => string;
|
|
35
45
|
setEnabled: (enabled: boolean) => void;
|
|
46
|
+
checkValidation: () => void;
|
|
36
47
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
|
+
import { ValidationPattern } from '../../static';
|
|
6
7
|
import '../../styles/components/_form-input.scss';
|
|
7
8
|
export interface TextInputProps {
|
|
8
9
|
classNames?: string[];
|
|
@@ -10,6 +11,10 @@ export interface TextInputProps {
|
|
|
10
11
|
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
11
12
|
placeholder?: string;
|
|
12
13
|
type?: 'text' | 'number' | 'email';
|
|
14
|
+
validationPatterns?: {
|
|
15
|
+
operator?: 'and' | 'or';
|
|
16
|
+
patterns: ValidationPattern[];
|
|
17
|
+
};
|
|
13
18
|
value?: string;
|
|
14
19
|
onChange?: (value: string) => void;
|
|
15
20
|
testId?: string;
|
|
@@ -19,14 +24,19 @@ export declare abstract class TextInputAbstract {
|
|
|
19
24
|
setValue: (value: string) => void;
|
|
20
25
|
getValue: () => string;
|
|
21
26
|
setEnabled: (enabled: boolean) => void;
|
|
27
|
+
checkValidation: () => void;
|
|
22
28
|
}
|
|
23
29
|
export declare class TextInputInternal extends TextInputAbstract {
|
|
24
30
|
private readonly inputElement;
|
|
31
|
+
private readonly validationErrorBlock;
|
|
32
|
+
private readonly props;
|
|
33
|
+
private readyToValidate;
|
|
25
34
|
render: ExtendedHTMLElement;
|
|
26
35
|
constructor(props: TextInputProps);
|
|
27
36
|
setValue: (value: string) => void;
|
|
28
37
|
getValue: () => string;
|
|
29
38
|
setEnabled: (enabled: boolean) => void;
|
|
39
|
+
checkValidation: () => void;
|
|
30
40
|
}
|
|
31
41
|
export declare class TextInput extends TextInputAbstract {
|
|
32
42
|
render: ExtendedHTMLElement;
|
|
@@ -34,4 +44,5 @@ export declare class TextInput extends TextInputAbstract {
|
|
|
34
44
|
setValue: (value: string) => void;
|
|
35
45
|
getValue: () => string;
|
|
36
46
|
setEnabled: (enabled: boolean) => void;
|
|
47
|
+
checkValidation: () => void;
|
|
37
48
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const filterQuickPickItems: (commands:
|
|
3
|
-
export declare const addRouteToCommandGroups: (commandGroups: QuickActionCommandGroupInternal[], parentRoute?: string[]) => QuickActionCommandGroupInternal[];
|
|
1
|
+
import { QuickActionCommandGroup } from '../static';
|
|
2
|
+
export declare const filterQuickPickItems: (commands: QuickActionCommandGroup[], searchTerm: string) => QuickActionCommandGroup[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { ValidationPattern } from '../static';
|
|
6
|
+
export declare const isTextualFormItemValid: (value: string, validationPatterns: {
|
|
7
|
+
operator?: 'and' | 'or';
|
|
8
|
+
genericValidationErrorMessage?: string;
|
|
9
|
+
patterns: ValidationPattern[];
|
|
10
|
+
}) => {
|
|
11
|
+
isValid: boolean;
|
|
12
|
+
validationErrors: string[];
|
|
13
|
+
};
|
|
14
|
+
export declare const isMandatoryItemValid: (value: string) => boolean;
|