@scm-manager/ui-components 2.44.2-20230522-081529 → 2.44.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scm-manager/ui-components",
|
|
3
|
-
"version": "2.44.2
|
|
3
|
+
"version": "2.44.2",
|
|
4
4
|
"description": "UI Components for SCM-Manager and its plugins",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"update-storyshots": "jest --testPathPattern=\"storyshots.test.ts\" --collectCoverage=false -u"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@scm-manager/ui-syntaxhighlighting": "2.44.2
|
|
24
|
-
"@scm-manager/ui-shortcuts": "2.44.2
|
|
25
|
-
"@scm-manager/ui-text": "2.44.2
|
|
23
|
+
"@scm-manager/ui-syntaxhighlighting": "2.44.2",
|
|
24
|
+
"@scm-manager/ui-shortcuts": "2.44.2",
|
|
25
|
+
"@scm-manager/ui-text": "2.44.2",
|
|
26
26
|
"@scm-manager/babel-preset": "^2.13.1",
|
|
27
27
|
"@scm-manager/eslint-config": "^2.17.0",
|
|
28
28
|
"@scm-manager/jest-preset": "^2.13.0",
|
|
29
29
|
"@scm-manager/prettier-config": "^2.10.1",
|
|
30
30
|
"@scm-manager/tsconfig": "^2.13.0",
|
|
31
|
-
"@scm-manager/ui-tests": "2.44.2
|
|
31
|
+
"@scm-manager/ui-tests": "2.44.2",
|
|
32
32
|
"@storybook/addon-actions": "^6.4.20",
|
|
33
33
|
"@storybook/addon-essentials": "^6.4.20",
|
|
34
34
|
"@storybook/addon-interactions": "^6.4.20",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@headlessui/react": "^1.4.3",
|
|
70
|
-
"@scm-manager/ui-api": "2.44.2
|
|
71
|
-
"@scm-manager/ui-extensions": "2.44.2
|
|
72
|
-
"@scm-manager/ui-types": "2.44.2
|
|
70
|
+
"@scm-manager/ui-api": "2.44.2",
|
|
71
|
+
"@scm-manager/ui-extensions": "2.44.2",
|
|
72
|
+
"@scm-manager/ui-types": "2.44.2",
|
|
73
73
|
"classnames": "^2.2.6",
|
|
74
74
|
"date-fns": "^2.4.1",
|
|
75
75
|
"deepmerge": "^4.2.2",
|
package/src/Autocomplete.tsx
CHANGED
|
@@ -46,17 +46,11 @@ type Props = {
|
|
|
46
46
|
|
|
47
47
|
type State = {};
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* @deprecated
|
|
51
|
-
* @since 2.45.0
|
|
52
|
-
*
|
|
53
|
-
* Use {@link Combobox} instead
|
|
54
|
-
*/
|
|
55
49
|
class Autocomplete extends React.Component<Props, State> {
|
|
56
50
|
static defaultProps = {
|
|
57
51
|
placeholder: "Type here",
|
|
58
52
|
loadingMessage: "Loading...",
|
|
59
|
-
noOptionsMessage: "No suggestion available"
|
|
53
|
+
noOptionsMessage: "No suggestion available"
|
|
60
54
|
};
|
|
61
55
|
|
|
62
56
|
handleInputChange = (newValue: ValueType<SelectValue>, action: ActionMeta) => {
|
|
@@ -73,7 +67,7 @@ class Autocomplete extends React.Component<Props, State> {
|
|
|
73
67
|
selectValue: ValueType<SelectValue>,
|
|
74
68
|
selectOptions: readonly SelectValue[]
|
|
75
69
|
): boolean => {
|
|
76
|
-
const isNotDuplicated = !selectOptions.map(
|
|
70
|
+
const isNotDuplicated = !selectOptions.map(option => option.label).includes(inputValue);
|
|
77
71
|
const isNotEmpty = inputValue !== "";
|
|
78
72
|
return isNotEmpty && isNotDuplicated;
|
|
79
73
|
};
|
|
@@ -91,7 +85,7 @@ class Autocomplete extends React.Component<Props, State> {
|
|
|
91
85
|
informationMessage,
|
|
92
86
|
creatable,
|
|
93
87
|
className,
|
|
94
|
-
disabled
|
|
88
|
+
disabled
|
|
95
89
|
} = this.props;
|
|
96
90
|
|
|
97
91
|
const asyncProps = {
|
|
@@ -105,7 +99,7 @@ class Autocomplete extends React.Component<Props, State> {
|
|
|
105
99
|
loadingMessage: () => loadingMessage,
|
|
106
100
|
noOptionsMessage: () => noOptionsMessage,
|
|
107
101
|
isDisabled: disabled,
|
|
108
|
-
"aria-label": helpText || label
|
|
102
|
+
"aria-label": helpText || label
|
|
109
103
|
};
|
|
110
104
|
|
|
111
105
|
return (
|
|
@@ -116,13 +110,13 @@ class Autocomplete extends React.Component<Props, State> {
|
|
|
116
110
|
<AsyncCreatable
|
|
117
111
|
{...asyncProps}
|
|
118
112
|
isValidNewOption={this.isValidNewOption}
|
|
119
|
-
onCreateOption={
|
|
113
|
+
onCreateOption={newValue => {
|
|
120
114
|
this.selectValue({
|
|
121
115
|
label: newValue,
|
|
122
116
|
value: {
|
|
123
117
|
id: newValue,
|
|
124
|
-
displayName: newValue
|
|
125
|
-
}
|
|
118
|
+
displayName: newValue
|
|
119
|
+
}
|
|
126
120
|
});
|
|
127
121
|
}}
|
|
128
122
|
/>
|
|
@@ -25,12 +25,6 @@ import React, { FC } from "react";
|
|
|
25
25
|
import UserGroupAutocomplete, { AutocompleteProps } from "./UserGroupAutocomplete";
|
|
26
26
|
import { useTranslation } from "react-i18next";
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated
|
|
30
|
-
* @since 2.45.0
|
|
31
|
-
*
|
|
32
|
-
* Use {@link Combobox} instead
|
|
33
|
-
*/
|
|
34
28
|
const GroupAutocomplete: FC<AutocompleteProps> = (props) => {
|
|
35
29
|
const [t] = useTranslation("commons");
|
|
36
30
|
return (
|
package/src/UserAutocomplete.tsx
CHANGED
|
@@ -25,12 +25,6 @@ import React, { FC } from "react";
|
|
|
25
25
|
import { useTranslation } from "react-i18next";
|
|
26
26
|
import UserGroupAutocomplete, { AutocompleteProps } from "./UserGroupAutocomplete";
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated
|
|
30
|
-
* @since 2.45.0
|
|
31
|
-
*
|
|
32
|
-
* Use {@link Combobox} instead
|
|
33
|
-
*/
|
|
34
28
|
const UserAutocomplete: FC<AutocompleteProps> = (props) => {
|
|
35
29
|
const [t] = useTranslation("commons");
|
|
36
30
|
return (
|
|
@@ -39,12 +39,6 @@ type Props = AutocompleteProps & {
|
|
|
39
39
|
placeholder: string;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated
|
|
44
|
-
* @since 2.45.0
|
|
45
|
-
*
|
|
46
|
-
* Use {@link Combobox} instead
|
|
47
|
-
*/
|
|
48
42
|
const UserGroupAutocomplete: FC<Props> = ({ autocompleteLink, valueSelected, ...props }) => {
|
|
49
43
|
const loadSuggestions = useSuggestions(autocompleteLink);
|
|
50
44
|
|
package/src/useDateFormatter.ts
CHANGED
|
@@ -43,7 +43,7 @@ type Options = {
|
|
|
43
43
|
timeZone?: string;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
export const chooseLocale = (language: string, languages?:
|
|
46
|
+
export const chooseLocale = (language: string, languages?: string[]) => {
|
|
47
47
|
for (const lng of languages || []) {
|
|
48
48
|
const locale = supportedLocales[lng];
|
|
49
49
|
if (locale) {
|