@widergy/energy-ui 3.168.0 → 3.169.0
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/CHANGELOG.md +7 -0
- package/dist/components/UTSelect/versions/V1/README.md +35 -0
- package/dist/components/UTSelect/versions/V1/UTSelectV1.mdx +13 -0
- package/dist/components/UTSelect/versions/V1/UTSelectV1.stories.js +741 -0
- package/dist/components/UTSelect/versions/V1/components/ListboxComponent/index.js +3 -0
- package/dist/components/UTSelect/versions/V1/index.js +4 -1
- package/dist/esm/components/UTSelect/versions/V1/README.md +35 -0
- package/dist/esm/components/UTSelect/versions/V1/UTSelectV1.mdx +13 -0
- package/dist/esm/components/UTSelect/versions/V1/UTSelectV1.stories.js +733 -0
- package/dist/esm/components/UTSelect/versions/V1/components/ListboxComponent/index.js +4 -1
- package/dist/esm/components/UTSelect/versions/V1/index.js +5 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import isEmpty from 'lodash/isEmpty';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import ScrollBar from 'react-perfect-scrollbar';
|
|
4
|
-
import { arrayOf, bool, func, oneOfType, shape, string, number } from 'prop-types';
|
|
4
|
+
import { arrayOf, bool, elementType, func, oneOfType, shape, string, number } from 'prop-types';
|
|
5
5
|
import isFinite from 'lodash/isFinite';
|
|
6
6
|
import UTLabel from '../../../../../UTLabel';
|
|
7
7
|
import UTCheckList from '../../../../../UTCheckList';
|
|
@@ -9,6 +9,7 @@ import styles from './styles.module.scss';
|
|
|
9
9
|
import { DEFAULT_MAX_HEIGHT } from './constants';
|
|
10
10
|
const ListboxComponent = _ref => {
|
|
11
11
|
let {
|
|
12
|
+
CustomRow,
|
|
12
13
|
dataTestId,
|
|
13
14
|
filteredOptions,
|
|
14
15
|
handleSelectionChange,
|
|
@@ -30,6 +31,7 @@ const ListboxComponent = _ref => {
|
|
|
30
31
|
maxHeight: maxHeightValid
|
|
31
32
|
}
|
|
32
33
|
}, /*#__PURE__*/React.createElement(UTCheckList, {
|
|
34
|
+
CustomRow: CustomRow,
|
|
33
35
|
dataTestId: dataTestId,
|
|
34
36
|
horizontalSpacing: horizontalSpacing,
|
|
35
37
|
isSimple: !multiple,
|
|
@@ -45,6 +47,7 @@ const ListboxComponent = _ref => {
|
|
|
45
47
|
}));
|
|
46
48
|
};
|
|
47
49
|
ListboxComponent.propTypes = {
|
|
50
|
+
CustomRow: elementType,
|
|
48
51
|
dataTestId: string,
|
|
49
52
|
filteredOptions: arrayOf(shape({
|
|
50
53
|
name: string,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import clone from 'lodash/clone';
|
|
3
3
|
import React, { useMemo, useState, useRef, useCallback, useEffect } from 'react';
|
|
4
|
-
import { arrayOf, bool, func, number, oneOfType, shape, string
|
|
4
|
+
import { arrayOf, bool, elementType, func, number, object, oneOfType, shape, string } from 'prop-types';
|
|
5
5
|
import { Autocomplete } from '@material-ui/lab';
|
|
6
6
|
import UTFieldLabel from '../../../UTFieldLabel';
|
|
7
7
|
import UTLabel from '../../../UTLabel';
|
|
@@ -22,6 +22,7 @@ const UTSelect = _ref => {
|
|
|
22
22
|
autocompleteProps = {},
|
|
23
23
|
className,
|
|
24
24
|
clearable = true,
|
|
25
|
+
CustomRow,
|
|
25
26
|
dataTestId,
|
|
26
27
|
disabled,
|
|
27
28
|
disableFilterOptions = false,
|
|
@@ -164,6 +165,7 @@ const UTSelect = _ref => {
|
|
|
164
165
|
variant: variant
|
|
165
166
|
}), [alwaysShowPlaceholder, disabled, error, handleInputBlur, handleInputFocus, leftAdornments, placeholder, rightAdornments, searchTerm]);
|
|
166
167
|
const listBoxProps = useMemo(() => ({
|
|
168
|
+
CustomRow,
|
|
167
169
|
dataTestId: listDataTestId,
|
|
168
170
|
filteredOptions,
|
|
169
171
|
handleSelectionChange,
|
|
@@ -172,7 +174,7 @@ const UTSelect = _ref => {
|
|
|
172
174
|
noMatchesText,
|
|
173
175
|
value,
|
|
174
176
|
...listProps
|
|
175
|
-
}), [filteredOptions, handleSelectionChange, multiple, noMatchesText, value, listProps]);
|
|
177
|
+
}), [CustomRow, filteredOptions, handleSelectionChange, multiple, noMatchesText, value, listProps]);
|
|
176
178
|
const noOptionsTextComponent = /*#__PURE__*/React.createElement(UTLabel, {
|
|
177
179
|
className: styles.noOptionsLabel,
|
|
178
180
|
colorTheme: "gray"
|
|
@@ -219,6 +221,7 @@ UTSelect.propTypes = {
|
|
|
219
221
|
autocompleteProps: object,
|
|
220
222
|
className: string,
|
|
221
223
|
clearable: bool,
|
|
224
|
+
CustomRow: elementType,
|
|
222
225
|
dataTestId: string,
|
|
223
226
|
disabled: bool,
|
|
224
227
|
disableFilterOptions: bool,
|