@true-engineering/true-react-common-ui-kit 3.0.0-alpha.6 → 3.0.0-alpha.7
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/FiltersPane/components/FilterSelect/FilterSelect.d.ts +1 -5
- package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.d.ts +1 -3
- package/dist/components/MultiSelectList/MultiSelectList.d.ts +1 -2
- package/dist/helpers/phone.d.ts +1 -1
- package/dist/true-react-common-ui-kit.js +461 -196
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +461 -196
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/FiltersPane/FiltersPane.stories.tsx +0 -8
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.styles.ts +2 -1
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +3 -1
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.tsx +1 -6
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.ts +2 -1
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +1 -0
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.tsx +1 -4
- package/src/components/FiltersPane/types.ts +1 -1
- package/src/components/MultiSelectList/MultiSelectList.styles.ts +1 -0
- package/src/components/MultiSelectList/MultiSelectList.tsx +1 -3
- package/src/helpers/phone.ts +1 -1
package/package.json
CHANGED
|
@@ -72,7 +72,6 @@ type ConfigValues = {
|
|
|
72
72
|
|
|
73
73
|
interface IFiltersPaneWithCustomProps<Values, Content> extends IFiltersPaneProps<Values, Content> {
|
|
74
74
|
containerWidth: number;
|
|
75
|
-
multiselectWidth: number;
|
|
76
75
|
isSearchDisabled: boolean;
|
|
77
76
|
isSearchAutosizeable: boolean;
|
|
78
77
|
shouldShowSettingsButton: boolean;
|
|
@@ -83,7 +82,6 @@ interface IFiltersPaneWithCustomProps<Values, Content> extends IFiltersPaneProps
|
|
|
83
82
|
|
|
84
83
|
function FiltersPaneWithCustomProps<Values, Content>({
|
|
85
84
|
containerWidth,
|
|
86
|
-
multiselectWidth,
|
|
87
85
|
isSearchDisabled,
|
|
88
86
|
isSearchAutosizeable,
|
|
89
87
|
shouldShowSettingsButton,
|
|
@@ -141,7 +139,6 @@ function FiltersPaneWithCustomProps<Values, Content>({
|
|
|
141
139
|
multiSelect: {
|
|
142
140
|
name: 'multiSelect',
|
|
143
141
|
type: 'multiSelect',
|
|
144
|
-
width: multiselectWidth,
|
|
145
142
|
pageSize: 15,
|
|
146
143
|
checkboxPosition,
|
|
147
144
|
isGroupingEnabled,
|
|
@@ -163,7 +160,6 @@ function FiltersPaneWithCustomProps<Values, Content>({
|
|
|
163
160
|
isGroupingEnabled,
|
|
164
161
|
checkboxPosition,
|
|
165
162
|
searchMaxLength: 12,
|
|
166
|
-
width: multiselectWidth,
|
|
167
163
|
fetchOptions: (q?: string): Promise<Array<{ v: string }>> => {
|
|
168
164
|
if (q === '' || q === 'undefined' || q === '123') {
|
|
169
165
|
return new Promise((resolve) => setTimeout(() => resolve([])));
|
|
@@ -265,9 +261,6 @@ export default {
|
|
|
265
261
|
containerWidth: {
|
|
266
262
|
control: { type: 'range', min: 100, max: 1000, step: 100 },
|
|
267
263
|
},
|
|
268
|
-
multiselectWidth: {
|
|
269
|
-
control: { type: 'range', min: 100, max: 400, step: 50 },
|
|
270
|
-
},
|
|
271
264
|
checkboxPosition: {
|
|
272
265
|
control: 'inline-radio',
|
|
273
266
|
options: ['left', 'right'],
|
|
@@ -288,7 +281,6 @@ Default.args = {
|
|
|
288
281
|
hasClearButton: true,
|
|
289
282
|
isDisabled: false,
|
|
290
283
|
containerWidth: 400,
|
|
291
|
-
multiselectWidth: 200,
|
|
292
284
|
withFieldNameInLabel: true,
|
|
293
285
|
isGroupingEnabled: true,
|
|
294
286
|
checkboxPosition: 'left',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import cloneDeep from 'lodash-es/cloneDeep';
|
|
1
2
|
import { colors, createThemedStyles, ITweakStyles } from '../../../../theme';
|
|
2
3
|
import { IButtonStyles } from '../../../Button';
|
|
3
4
|
import { IInputStyles } from '../../../Input';
|
|
@@ -49,7 +50,7 @@ export const inputStyles: IInputStyles = {
|
|
|
49
50
|
},
|
|
50
51
|
};
|
|
51
52
|
|
|
52
|
-
export const clearButtonStyles = innerTextButtonStyles;
|
|
53
|
+
export const clearButtonStyles = cloneDeep(innerTextButtonStyles);
|
|
53
54
|
|
|
54
55
|
export type IFilterIntervalStyles = ITweakStyles<
|
|
55
56
|
typeof useStyles,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import cloneDeep from 'lodash-es/cloneDeep';
|
|
1
2
|
import { colors, createThemedStyles, helpers, ITweakStyles } from '../../../../theme';
|
|
2
3
|
import { IButtonStyles } from '../../../Button';
|
|
3
4
|
import { ISearchInputStyles } from '../../../SearchInput';
|
|
@@ -8,6 +9,7 @@ const LIST_GAP = 12;
|
|
|
8
9
|
|
|
9
10
|
export const useStyles = createThemedStyles('FilterSelect', {
|
|
10
11
|
root: {
|
|
12
|
+
width: 220,
|
|
11
13
|
background: colors.CLASSIC_WHITE,
|
|
12
14
|
},
|
|
13
15
|
|
|
@@ -127,7 +129,7 @@ export const searchInputStyles: ISearchInputStyles = {
|
|
|
127
129
|
},
|
|
128
130
|
};
|
|
129
131
|
|
|
130
|
-
export const clearButtonStyles = innerTextButtonStyles;
|
|
132
|
+
export const clearButtonStyles = cloneDeep(innerTextButtonStyles);
|
|
131
133
|
|
|
132
134
|
export type IFilterSelectStyles = ITweakStyles<
|
|
133
135
|
typeof useStyles,
|
|
@@ -30,10 +30,6 @@ export interface IFilterSelectProps<Value> extends ICommonProps<IFilterSelectSty
|
|
|
30
30
|
* @default false
|
|
31
31
|
*/
|
|
32
32
|
isGroupingEnabled?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* @default `220px`
|
|
35
|
-
*/
|
|
36
|
-
width?: string | number;
|
|
37
33
|
localeKey?: IFilterLocaleKey;
|
|
38
34
|
locale?: Partial<ISelectLocale>;
|
|
39
35
|
options?: Value[];
|
|
@@ -54,7 +50,6 @@ export function FilterSelect<Value>({
|
|
|
54
50
|
value,
|
|
55
51
|
isSearchEnabled = false,
|
|
56
52
|
isGroupingEnabled = false,
|
|
57
|
-
width = 220,
|
|
58
53
|
localeKey,
|
|
59
54
|
locale,
|
|
60
55
|
onChange,
|
|
@@ -225,7 +220,7 @@ export function FilterSelect<Value>({
|
|
|
225
220
|
}, []);
|
|
226
221
|
|
|
227
222
|
return (
|
|
228
|
-
<div className={classes.root}
|
|
223
|
+
<div className={classes.root} {...addDataAttributes(data)}>
|
|
229
224
|
{isSearchEnabled && (
|
|
230
225
|
<div className={classes.dropdownInput}>
|
|
231
226
|
<SearchInput
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import cloneDeep from 'lodash-es/cloneDeep';
|
|
1
2
|
import { colors, createThemedStyles, ITweakStyles } from '../../../../theme';
|
|
2
3
|
import { IButtonStyles } from '../../../Button';
|
|
3
4
|
import { IDatePickerStyles } from '../../../DatePicker';
|
|
@@ -31,7 +32,7 @@ export const useStyles = createThemedStyles('FilterWithDates', {
|
|
|
31
32
|
datepicker: {},
|
|
32
33
|
});
|
|
33
34
|
|
|
34
|
-
export const clearButtonStyles = innerTextButtonStyles;
|
|
35
|
+
export const clearButtonStyles = cloneDeep(innerTextButtonStyles);
|
|
35
36
|
|
|
36
37
|
export const backButtonStyles = innerTextButtonStyles;
|
|
37
38
|
|
|
@@ -7,7 +7,7 @@ import { Icon } from '../../../Icon';
|
|
|
7
7
|
import { SearchInput } from '../../../SearchInput';
|
|
8
8
|
import { getLocale } from '../../helpers';
|
|
9
9
|
import { IFilterLocaleKey, IFiltersPaneSearchPayload, IPartialFilterLocale } from '../../types';
|
|
10
|
-
import { FilterSelect
|
|
10
|
+
import { FilterSelect } from '../FilterSelect';
|
|
11
11
|
import {
|
|
12
12
|
useStyles,
|
|
13
13
|
IFiltersPaneSearchStyles,
|
|
@@ -26,7 +26,6 @@ export interface IFiltersPaneSearchProps<Value> extends ICommonProps<IFiltersPan
|
|
|
26
26
|
getValueView?: (value: Value) => ReactNode;
|
|
27
27
|
getValueId?: (value: Value) => string;
|
|
28
28
|
getValueString?: (value: Value) => string;
|
|
29
|
-
selectWidth?: IFilterSelectProps<Value>['width'];
|
|
30
29
|
hasClearSelectButton?: boolean;
|
|
31
30
|
isDisabled?: boolean;
|
|
32
31
|
isSelectSearchEnabled?: boolean;
|
|
@@ -43,7 +42,6 @@ export function FiltersPaneSearch<Value>({
|
|
|
43
42
|
getValueId,
|
|
44
43
|
getValueView,
|
|
45
44
|
getValueString,
|
|
46
|
-
selectWidth = '100%',
|
|
47
45
|
hasClearSelectButton,
|
|
48
46
|
isDisabled = false,
|
|
49
47
|
isSelectSearchEnabled = true,
|
|
@@ -155,7 +153,6 @@ export function FiltersPaneSearch<Value>({
|
|
|
155
153
|
localeKey={localeKey}
|
|
156
154
|
locale={translates}
|
|
157
155
|
onChange={handleFieldsChange}
|
|
158
|
-
width={selectWidth}
|
|
159
156
|
isSearchEnabled={isSelectSearchEnabled}
|
|
160
157
|
hasClearButton={hasClearSelectButton}
|
|
161
158
|
testId={testId !== undefined ? `${testId}-dropdown` : undefined}
|
|
@@ -152,5 +152,5 @@ export type ISelectLocaleKey = keyof typeof SelectLocales;
|
|
|
152
152
|
|
|
153
153
|
export type IFilterWithDateDatePickerProps = Omit<
|
|
154
154
|
IDatePickerProps,
|
|
155
|
-
'onChange' | 'value' | 'locale' | 'months' | 'selectedDate' | 'tweakStyles'
|
|
155
|
+
'onChange' | 'value' | 'locale' | 'months' | 'selectedDate' | 'tweakStyles'
|
|
156
156
|
>;
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
export interface IMultiSelectListProps<Value, Option> extends ICommonProps<IMultiSelectListStyles> {
|
|
23
23
|
value?: Value;
|
|
24
24
|
isSearchEnabled?: boolean;
|
|
25
|
-
width?: number | string;
|
|
26
25
|
localeKey?: IMultiSelectLocaleKey;
|
|
27
26
|
locale?: Partial<IMultiSelectLocale>;
|
|
28
27
|
onClose?: () => void;
|
|
@@ -43,7 +42,6 @@ export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Op
|
|
|
43
42
|
tweakStyles,
|
|
44
43
|
data,
|
|
45
44
|
isSearchEnabled = false,
|
|
46
|
-
width = 220,
|
|
47
45
|
localeKey = DEFAULT_LOCALE,
|
|
48
46
|
locale = MultiSelectLocales[localeKey],
|
|
49
47
|
onChange,
|
|
@@ -329,7 +327,7 @@ export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Op
|
|
|
329
327
|
const shouldShowOptionsList = !isLoading && allOptions.length !== 0;
|
|
330
328
|
|
|
331
329
|
return (
|
|
332
|
-
<div className={classes.root}
|
|
330
|
+
<div className={classes.root} {...addDataAttributes(data)}>
|
|
333
331
|
{isSearchEnabled && (
|
|
334
332
|
<div className={classes.dropdownInput}>
|
|
335
333
|
<SearchInput
|
package/src/helpers/phone.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const getCountryTextByLocale = (country: IPhoneInfo, locale: string): str
|
|
|
18
18
|
locale.toLowerCase() === 'ru' ? country.countryRu : country.countryEn;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Мутирует countriesList!
|
|
22
22
|
*/
|
|
23
23
|
export const sortCountriesByLocale = (countriesList: IPhoneInfo[], locale: string): IPhoneInfo[] =>
|
|
24
24
|
countriesList.sort((countryA, countryB) =>
|