@scm-manager/ui-components 2.44.2 → 2.44.3-20230523-110923

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.3-20230523-110923",
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.3-20230523-110923",
24
+ "@scm-manager/ui-shortcuts": "2.44.3-20230523-110923",
25
+ "@scm-manager/ui-text": "2.44.3-20230523-110923",
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.3-20230523-110923",
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.3-20230523-110923",
71
+ "@scm-manager/ui-extensions": "2.44.3-20230523-110923",
72
+ "@scm-manager/ui-types": "2.44.3-20230523-110923",
73
73
  "classnames": "^2.2.6",
74
74
  "date-fns": "^2.4.1",
75
75
  "deepmerge": "^4.2.2",
@@ -46,11 +46,17 @@ 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
+ */
49
55
  class Autocomplete extends React.Component<Props, State> {
50
56
  static defaultProps = {
51
57
  placeholder: "Type here",
52
58
  loadingMessage: "Loading...",
53
- noOptionsMessage: "No suggestion available"
59
+ noOptionsMessage: "No suggestion available",
54
60
  };
55
61
 
56
62
  handleInputChange = (newValue: ValueType<SelectValue>, action: ActionMeta) => {
@@ -67,7 +73,7 @@ class Autocomplete extends React.Component<Props, State> {
67
73
  selectValue: ValueType<SelectValue>,
68
74
  selectOptions: readonly SelectValue[]
69
75
  ): boolean => {
70
- const isNotDuplicated = !selectOptions.map(option => option.label).includes(inputValue);
76
+ const isNotDuplicated = !selectOptions.map((option) => option.label).includes(inputValue);
71
77
  const isNotEmpty = inputValue !== "";
72
78
  return isNotEmpty && isNotDuplicated;
73
79
  };
@@ -85,7 +91,7 @@ class Autocomplete extends React.Component<Props, State> {
85
91
  informationMessage,
86
92
  creatable,
87
93
  className,
88
- disabled
94
+ disabled,
89
95
  } = this.props;
90
96
 
91
97
  const asyncProps = {
@@ -99,7 +105,7 @@ class Autocomplete extends React.Component<Props, State> {
99
105
  loadingMessage: () => loadingMessage,
100
106
  noOptionsMessage: () => noOptionsMessage,
101
107
  isDisabled: disabled,
102
- "aria-label": helpText || label
108
+ "aria-label": helpText || label,
103
109
  };
104
110
 
105
111
  return (
@@ -110,13 +116,13 @@ class Autocomplete extends React.Component<Props, State> {
110
116
  <AsyncCreatable
111
117
  {...asyncProps}
112
118
  isValidNewOption={this.isValidNewOption}
113
- onCreateOption={newValue => {
119
+ onCreateOption={(newValue) => {
114
120
  this.selectValue({
115
121
  label: newValue,
116
122
  value: {
117
123
  id: newValue,
118
- displayName: newValue
119
- }
124
+ displayName: newValue,
125
+ },
120
126
  });
121
127
  }}
122
128
  />
@@ -25,6 +25,12 @@ 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
+ */
28
34
  const GroupAutocomplete: FC<AutocompleteProps> = (props) => {
29
35
  const [t] = useTranslation("commons");
30
36
  return (
@@ -25,6 +25,12 @@ 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
+ */
28
34
  const UserAutocomplete: FC<AutocompleteProps> = (props) => {
29
35
  const [t] = useTranslation("commons");
30
36
  return (
@@ -39,6 +39,12 @@ 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
+ */
42
48
  const UserGroupAutocomplete: FC<Props> = ({ autocompleteLink, valueSelected, ...props }) => {
43
49
  const loadSuggestions = useSuggestions(autocompleteLink);
44
50
 
@@ -43,7 +43,7 @@ type Options = {
43
43
  timeZone?: string;
44
44
  };
45
45
 
46
- export const chooseLocale = (language: string, languages?: string[]) => {
46
+ export const chooseLocale = (language: string, languages?: readonly string[]) => {
47
47
  for (const lng of languages || []) {
48
48
  const locale = supportedLocales[lng];
49
49
  if (locale) {