@commercetools-uikit/localized-multiline-text-input 13.0.2 → 13.0.3
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/README.md +74 -22
- package/dist/commercetools-uikit-localized-multiline-text-input.cjs.d.ts +2 -0
- package/dist/commercetools-uikit-localized-multiline-text-input.cjs.dev.js +90 -183
- package/dist/commercetools-uikit-localized-multiline-text-input.cjs.prod.js +25 -19
- package/dist/commercetools-uikit-localized-multiline-text-input.esm.js +90 -181
- package/dist/declarations/src/index.d.ts +2 -0
- package/dist/declarations/src/localized-multiline-text-input.d.ts +60 -0
- package/dist/declarations/src/required-value-error-message.d.ts +5 -0
- package/dist/declarations/src/translation-input.d.ts +41 -0
- package/dist/declarations/src/translation-input.styles.d.ts +12 -0
- package/dist/declarations/src/version.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
declare type TLocalizedMultilineTextInputProps = {
|
|
2
|
+
id?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
autoComplete?: string;
|
|
5
|
+
value: {
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
};
|
|
8
|
+
onChange?: () => void;
|
|
9
|
+
selectedLanguage: string;
|
|
10
|
+
onBlur?: () => void;
|
|
11
|
+
onFocus?: () => void;
|
|
12
|
+
defaultExpandMultilineText?: boolean;
|
|
13
|
+
hideLanguageExpansionControls?: boolean;
|
|
14
|
+
defaultExpandLanguages?: boolean;
|
|
15
|
+
isAutofocussed?: boolean;
|
|
16
|
+
isDisabled?: boolean;
|
|
17
|
+
isReadOnly?: boolean;
|
|
18
|
+
placeholder?: {
|
|
19
|
+
[key: string]: string;
|
|
20
|
+
};
|
|
21
|
+
horizontalConstraint?: 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
22
|
+
hasError?: boolean;
|
|
23
|
+
hasWarning?: boolean;
|
|
24
|
+
errors?: {
|
|
25
|
+
[key: string]: string;
|
|
26
|
+
};
|
|
27
|
+
warnings?: {
|
|
28
|
+
[key: string]: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
declare const LocalizedMultilineTextInput: {
|
|
32
|
+
(props: TLocalizedMultilineTextInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
RequiredValueErrorMessage: {
|
|
35
|
+
(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
38
|
+
getId: (idPrefix?: string | undefined, language?: string | undefined) => string | undefined;
|
|
39
|
+
getName: (namePrefix?: string | undefined, language?: string | undefined) => string | undefined;
|
|
40
|
+
defaultProps: {
|
|
41
|
+
horizontalConstraint: string;
|
|
42
|
+
};
|
|
43
|
+
createLocalizedString: (languages: string[], existingTranslations?: {
|
|
44
|
+
[locale: string]: string;
|
|
45
|
+
}) => {
|
|
46
|
+
[locale: string]: string;
|
|
47
|
+
};
|
|
48
|
+
isEmpty: (localizedString?: {
|
|
49
|
+
[locale: string]: string;
|
|
50
|
+
} | undefined) => boolean;
|
|
51
|
+
omitEmptyTranslations: <TTranslations extends {
|
|
52
|
+
[locale: string]: string;
|
|
53
|
+
}>(localizedString: TTranslations) => {
|
|
54
|
+
[locale: string]: string;
|
|
55
|
+
};
|
|
56
|
+
isTouched: (touched?: {
|
|
57
|
+
[locale: string]: boolean;
|
|
58
|
+
} | undefined) => boolean;
|
|
59
|
+
};
|
|
60
|
+
export default LocalizedMultilineTextInput;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ChangeEventHandler, type ReactNode } from 'react';
|
|
2
|
+
declare type TEvent = {
|
|
3
|
+
target: {
|
|
4
|
+
language: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
declare type TranslationInputProps = {
|
|
8
|
+
onChange?: (event: TEvent) => void;
|
|
9
|
+
language: string;
|
|
10
|
+
onFocus?: () => void;
|
|
11
|
+
onToggle?: () => void;
|
|
12
|
+
isCollapsed?: boolean;
|
|
13
|
+
hasLanguagesControl?: boolean;
|
|
14
|
+
warning?: ReactNode;
|
|
15
|
+
error?: ReactNode;
|
|
16
|
+
id?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
autoComplete?: string;
|
|
19
|
+
value: string;
|
|
20
|
+
onBlur?: ChangeEventHandler<Element>;
|
|
21
|
+
isDisabled?: boolean;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
hasWarning?: boolean;
|
|
24
|
+
hasError?: boolean;
|
|
25
|
+
isReadOnly?: boolean;
|
|
26
|
+
isAutofocussed?: boolean;
|
|
27
|
+
intl: {
|
|
28
|
+
formatMessage: (messageObject: TMessagesMultilineInput) => string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
declare type TMessagesMultilineInput = {
|
|
32
|
+
id: string;
|
|
33
|
+
description: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
};
|
|
36
|
+
declare const TranslationInput: {
|
|
37
|
+
(props: TranslationInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
MIN_ROW_COUNT: number;
|
|
40
|
+
};
|
|
41
|
+
export default TranslationInput;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type Theme } from '@emotion/react';
|
|
3
|
+
declare type TTranslationInputStylesProps = {
|
|
4
|
+
isCollapsed?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const getTextareaStyles: (props: TTranslationInputStylesProps) => (false | import("@emotion/utils").SerializedStyles | undefined)[];
|
|
7
|
+
declare const getLanguageLabelStyles: (_props: TTranslationInputStylesProps, theme: Theme) => import("@emotion/utils").SerializedStyles;
|
|
8
|
+
declare const ToggleButtonWrapper: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
theme?: Theme | undefined;
|
|
10
|
+
as?: import("react").ElementType<any> | undefined;
|
|
11
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export { getTextareaStyles, getLanguageLabelStyles, ToggleButtonWrapper };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/localized-multiline-text-input",
|
|
3
3
|
"description": "A controlled text input component for localized multi-line strings with validation states.",
|
|
4
|
-
"version": "13.0.
|
|
4
|
+
"version": "13.0.3",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|