hrm_ui_lib 1.6.6 → 1.6.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/components/DatePicker/RangeDatePicker/RangeDatePicker.js +1 -1
- package/components/DatePicker/RangeDatePicker/RangeDatePickerDesktop.js +3 -4
- package/components/DatePicker/RangeDatePicker/RangeDatePickerMobile.js +3 -5
- package/components/DatePicker/RangeDatePicker/index.js +1 -1
- package/components/DatePicker/SimpleDatePicker/SimpleDatePicker.js +1 -0
- package/components/DatePicker/SimpleDatePicker/SimpleDatePickerDesktop.js +3 -4
- package/components/DatePicker/SimpleDatePicker/SimpleDatePickerMobile.js +3 -4
- package/components/DatePicker/SimpleDatePicker/index.js +1 -0
- package/components/DatePicker/TimePicker/TimePicker.js +1 -0
- package/components/DatePicker/TimePicker/TimePickerDesktop.js +3 -4
- package/components/DatePicker/TimePicker/index.js +1 -0
- package/components/DatePicker/hooks.js +2 -1
- package/components/DatePicker/index.js +1 -1
- package/components/DatePicker/types.d.ts +0 -3
- package/components/Empty/Empty.js +2 -2
- package/components/Empty/types.d.ts +1 -1
- package/components/Modal/Modal.d.ts +2 -14
- package/components/Select/FilterSelect/FilterSelect.js +7 -11
- package/components/Select/MultiSelect/MultiBase/MultiBase.d.ts +2 -2
- package/components/Select/MultiSelect/MultiBase/MultiBase.js +6 -5
- package/components/Select/MultiSelect/MultiSelect.js +11 -16
- package/components/Select/MultiSelect/OptionsWrapper.js +4 -7
- package/components/Select/Select/Select.js +14 -5
- package/components/Select/Select/SelectDesktop/index.js +2 -2
- package/components/Select/Select/SelectMobile/index.js +2 -2
- package/components/Select/SharedComponents/Footer.js +14 -4
- package/components/Select/SharedComponents/index.js +3 -2
- package/components/Select/constants.d.ts +0 -4
- package/components/Select/constants.js +1 -5
- package/components/Select/index.js +3 -2
- package/components/Select/localization.d.ts +4 -0
- package/components/Select/localization.js +31 -0
- package/components/Select/types.d.ts +10 -7
- package/helpers/locale.js +2 -1
- package/index.js +2 -1
- package/package.json +1 -1
- package/stories/DatePicker.stories.d.ts +0 -4
- package/stories/Select.stories.d.ts +4 -0
- package/type/locale.d.ts +3 -3
- package/type/locale.js +3 -3
|
@@ -46,10 +46,10 @@ import '../../Button/consts.js';
|
|
|
46
46
|
import '../../SVGIcons/IconCheckmarkCircleFilled.js';
|
|
47
47
|
import '../types.js';
|
|
48
48
|
import '../hooks.js';
|
|
49
|
+
import '../../../type/locale.js';
|
|
49
50
|
import '../../SVGIcons/IconCalendarRight.js';
|
|
50
51
|
import '../../../helpers/format-date.js';
|
|
51
52
|
import '../../../helpers/locale.js';
|
|
52
|
-
import '../../../type/locale.js';
|
|
53
53
|
import '../../../helpers/storage.js';
|
|
54
54
|
import '../CustomHeader/CustomHeader.js';
|
|
55
55
|
import 'react-window';
|
|
@@ -45,8 +45,9 @@ import '../../Link/Link.js';
|
|
|
45
45
|
import '../../Popover/PopoverDesktop.js';
|
|
46
46
|
import '../../SVGIcons/IconInfo.js';
|
|
47
47
|
import '../../Button/consts.js';
|
|
48
|
+
import '../../../type/locale.js';
|
|
48
49
|
|
|
49
|
-
var _excluded = ["value", "currentDates", "setFieldValue", "name", "changeHandler", "dataId", "format", "maxDate", "minDate", "locale", "
|
|
50
|
+
var _excluded = ["value", "currentDates", "setFieldValue", "name", "changeHandler", "dataId", "format", "maxDate", "minDate", "locale", "disabled", "placeholderText", "label", "hasError", "required"];
|
|
50
51
|
var RangeDatePickerDesktop = /*#__PURE__*/forwardRef(function (props) {
|
|
51
52
|
var value = props.value,
|
|
52
53
|
_props$currentDates = props.currentDates,
|
|
@@ -61,15 +62,13 @@ var RangeDatePickerDesktop = /*#__PURE__*/forwardRef(function (props) {
|
|
|
61
62
|
minDate = props.minDate,
|
|
62
63
|
_props$locale = props.locale,
|
|
63
64
|
locale = _props$locale === void 0 ? 'hy' : _props$locale,
|
|
64
|
-
_props$dayjsLocale = props.dayjsLocale,
|
|
65
|
-
dayjsLocale = _props$dayjsLocale === void 0 ? 'hy-am' : _props$dayjsLocale,
|
|
66
65
|
disabled = props.disabled,
|
|
67
66
|
placeholderText = props.placeholderText,
|
|
68
67
|
label = props.label,
|
|
69
68
|
hasError = props.hasError,
|
|
70
69
|
required = props.required,
|
|
71
70
|
rest = _objectWithoutProperties(props, _excluded);
|
|
72
|
-
useImportFilesDynamically(
|
|
71
|
+
useImportFilesDynamically(locale);
|
|
73
72
|
var dateInitialValue = value !== undefined && Array.isArray(value) ? value : currentDates;
|
|
74
73
|
var _useState = useState(dateInitialValue),
|
|
75
74
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -47,8 +47,8 @@ import '../../Link/Link.js';
|
|
|
47
47
|
import '../../Popover/PopoverDesktop.js';
|
|
48
48
|
import '../../SVGIcons/IconInfo.js';
|
|
49
49
|
import '../../Button/consts.js';
|
|
50
|
-
import '../../../helpers/locale.js';
|
|
51
50
|
import '../../../type/locale.js';
|
|
51
|
+
import '../../../helpers/locale.js';
|
|
52
52
|
import '../../../helpers/storage.js';
|
|
53
53
|
import 'react-window';
|
|
54
54
|
import 'react-dom';
|
|
@@ -91,7 +91,7 @@ import '../../Select/MultiSelect/DesktopWrapper.js';
|
|
|
91
91
|
import '../CustomHeader/helpers.js';
|
|
92
92
|
import '../localization.js';
|
|
93
93
|
|
|
94
|
-
var _excluded = ["value", "currentDates", "setFieldValue", "name", "changeHandler", "dataId", "format", "maxDate", "minDate", "locale", "
|
|
94
|
+
var _excluded = ["value", "currentDates", "setFieldValue", "name", "changeHandler", "dataId", "format", "maxDate", "minDate", "locale", "disabled", "placeholderText", "dataIdPrefix", "modalOptions"];
|
|
95
95
|
var RangeDatePickerMobile = /*#__PURE__*/forwardRef(function (props) {
|
|
96
96
|
var value = props.value,
|
|
97
97
|
_props$currentDates = props.currentDates,
|
|
@@ -106,14 +106,12 @@ var RangeDatePickerMobile = /*#__PURE__*/forwardRef(function (props) {
|
|
|
106
106
|
minDate = props.minDate,
|
|
107
107
|
_props$locale = props.locale,
|
|
108
108
|
locale = _props$locale === void 0 ? 'hy' : _props$locale,
|
|
109
|
-
_props$dayjsLocale = props.dayjsLocale,
|
|
110
|
-
dayjsLocale = _props$dayjsLocale === void 0 ? 'hy-am' : _props$dayjsLocale,
|
|
111
109
|
disabled = props.disabled,
|
|
112
110
|
placeholderText = props.placeholderText,
|
|
113
111
|
dataIdPrefix = props.dataIdPrefix,
|
|
114
112
|
modalOptions = props.modalOptions,
|
|
115
113
|
rest = _objectWithoutProperties(props, _excluded);
|
|
116
|
-
useImportFilesDynamically(
|
|
114
|
+
useImportFilesDynamically(locale);
|
|
117
115
|
var startYear = minDate ? minDate.getFullYear() : 1900;
|
|
118
116
|
var endYear = maxDate ? maxDate.getFullYear() : new Date().getFullYear() + 5;
|
|
119
117
|
var dateInitialValue = value !== undefined && Array.isArray(value) ? value : currentDates;
|
|
@@ -46,11 +46,11 @@ import '../../Button/consts.js';
|
|
|
46
46
|
import '../../SVGIcons/IconCheckmarkCircleFilled.js';
|
|
47
47
|
import '../types.js';
|
|
48
48
|
import '../hooks.js';
|
|
49
|
+
import '../../../type/locale.js';
|
|
49
50
|
import '../../SVGIcons/IconCalendarRight.js';
|
|
50
51
|
import './RangeDatePickerMobile.js';
|
|
51
52
|
import '../../../helpers/format-date.js';
|
|
52
53
|
import '../../../helpers/locale.js';
|
|
53
|
-
import '../../../type/locale.js';
|
|
54
54
|
import '../../../helpers/storage.js';
|
|
55
55
|
import '../CustomHeader/CustomHeader.js';
|
|
56
56
|
import 'react-window';
|
|
@@ -86,6 +86,7 @@ import '../../Select/MultiSelect/DesktopWrapper.js';
|
|
|
86
86
|
import '../CustomHeader/helpers.js';
|
|
87
87
|
import '../localization.js';
|
|
88
88
|
import '../hooks.js';
|
|
89
|
+
import '../../../type/locale.js';
|
|
89
90
|
import '../../SVGIcons/IconCalendarRight.js';
|
|
90
91
|
|
|
91
92
|
var SimpleDatePicker = function SimpleDatePicker(props) {
|
|
@@ -85,8 +85,9 @@ import '../../Select/MultiSelect/MobileWrapper.js';
|
|
|
85
85
|
import '../../Select/MultiSelect/DesktopWrapper.js';
|
|
86
86
|
import '../CustomHeader/helpers.js';
|
|
87
87
|
import '../localization.js';
|
|
88
|
+
import '../../../type/locale.js';
|
|
88
89
|
|
|
89
|
-
var _excluded = ["value", "currentDate", "setFieldValue", "name", "label", "size", "locale", "changeHandler", "format", "
|
|
90
|
+
var _excluded = ["value", "currentDate", "setFieldValue", "name", "label", "size", "locale", "changeHandler", "format", "required", "dataId", "hasError", "placeholderText", "minDate", "maxDate", "dataIdPrefix", "helperText", "inline"];
|
|
90
91
|
var SimpleDatePickerDesktop = function SimpleDatePickerDesktop(props) {
|
|
91
92
|
var value = props.value,
|
|
92
93
|
currentDate = props.currentDate,
|
|
@@ -99,8 +100,6 @@ var SimpleDatePickerDesktop = function SimpleDatePickerDesktop(props) {
|
|
|
99
100
|
changeHandler = props.changeHandler,
|
|
100
101
|
_props$format = props.format,
|
|
101
102
|
format = _props$format === void 0 ? 'M/D/YYYY' : _props$format,
|
|
102
|
-
_props$dayjsLocale = props.dayjsLocale,
|
|
103
|
-
dayjsLocale = _props$dayjsLocale === void 0 ? 'hy-am' : _props$dayjsLocale,
|
|
104
103
|
_props$required = props.required,
|
|
105
104
|
required = _props$required === void 0 ? false : _props$required,
|
|
106
105
|
dataId = props.dataId,
|
|
@@ -115,7 +114,7 @@ var SimpleDatePickerDesktop = function SimpleDatePickerDesktop(props) {
|
|
|
115
114
|
var startYear = minDate ? minDate.getFullYear() : 1900;
|
|
116
115
|
var endYear = maxDate ? maxDate.getFullYear() : new Date().getFullYear() + 5;
|
|
117
116
|
var calendarRef = useRef(null);
|
|
118
|
-
useImportFilesDynamically(
|
|
117
|
+
useImportFilesDynamically(locale);
|
|
119
118
|
var selectedDate = value !== undefined && Object.prototype.toString.call(value) === '[object Date]' ? value : currentDate;
|
|
120
119
|
var openDatepicker = function openDatepicker() {
|
|
121
120
|
if (calendarRef.current) {
|
|
@@ -45,6 +45,7 @@ import '../../Link/Link.js';
|
|
|
45
45
|
import '../../Popover/PopoverDesktop.js';
|
|
46
46
|
import '../../SVGIcons/IconInfo.js';
|
|
47
47
|
import '../../Button/consts.js';
|
|
48
|
+
import '../../../type/locale.js';
|
|
48
49
|
import 'react-window';
|
|
49
50
|
import 'react-dom';
|
|
50
51
|
import '../../SVGIcons/IconChevronRight.js';
|
|
@@ -86,7 +87,7 @@ import '../../Select/MultiSelect/DesktopWrapper.js';
|
|
|
86
87
|
import '../CustomHeader/helpers.js';
|
|
87
88
|
import '../localization.js';
|
|
88
89
|
|
|
89
|
-
var _excluded = ["size", "dataId", "helperText", "label", "placeholderText", "format", "
|
|
90
|
+
var _excluded = ["size", "dataId", "helperText", "label", "placeholderText", "format", "value", "currentDate", "minDate", "maxDate", "locale", "dataIdPrefix", "modalOptions", "name", "changeHandler", "setFieldValue", "required", "hasError"];
|
|
90
91
|
var SimpleDatePickerMobile = function SimpleDatePickerMobile(props) {
|
|
91
92
|
var size = props.size,
|
|
92
93
|
dataId = props.dataId,
|
|
@@ -95,8 +96,6 @@ var SimpleDatePickerMobile = function SimpleDatePickerMobile(props) {
|
|
|
95
96
|
placeholderText = props.placeholderText,
|
|
96
97
|
_props$format = props.format,
|
|
97
98
|
format = _props$format === void 0 ? 'M/D/YYYY' : _props$format,
|
|
98
|
-
_props$dayjsLocale = props.dayjsLocale,
|
|
99
|
-
dayjsLocale = _props$dayjsLocale === void 0 ? 'hy-am' : _props$dayjsLocale,
|
|
100
99
|
value = props.value,
|
|
101
100
|
currentDate = props.currentDate,
|
|
102
101
|
minDate = props.minDate,
|
|
@@ -117,7 +116,7 @@ var SimpleDatePickerMobile = function SimpleDatePickerMobile(props) {
|
|
|
117
116
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
118
117
|
isCalendarOpen = _React$useState2[0],
|
|
119
118
|
setIsCalendarOpen = _React$useState2[1];
|
|
120
|
-
useImportFilesDynamically(
|
|
119
|
+
useImportFilesDynamically(locale);
|
|
121
120
|
var selectedDate = value !== undefined && Object.prototype.toString.call(value) === '[object Date]' ? value : currentDate;
|
|
122
121
|
var openDatepicker = function openDatepicker() {
|
|
123
122
|
setIsCalendarOpen(true);
|
|
@@ -86,5 +86,6 @@ import '../../Select/MultiSelect/DesktopWrapper.js';
|
|
|
86
86
|
import '../CustomHeader/helpers.js';
|
|
87
87
|
import '../localization.js';
|
|
88
88
|
import '../hooks.js';
|
|
89
|
+
import '../../../type/locale.js';
|
|
89
90
|
import '../../SVGIcons/IconCalendarRight.js';
|
|
90
91
|
import './SimpleDatePickerMobile.js';
|
|
@@ -44,8 +44,9 @@ import '../../Link/Link.js';
|
|
|
44
44
|
import '../../Popover/PopoverDesktop.js';
|
|
45
45
|
import '../../SVGIcons/IconInfo.js';
|
|
46
46
|
import '../../Button/consts.js';
|
|
47
|
+
import '../../../type/locale.js';
|
|
47
48
|
|
|
48
|
-
var _excluded = ["value", "currentTime", "name", "setFieldValue", "label", "size", "dataId", "changeHandler", "required", "format", "locale", "
|
|
49
|
+
var _excluded = ["value", "currentTime", "name", "setFieldValue", "label", "size", "dataId", "changeHandler", "required", "format", "locale", "placeholderText", "hasError"];
|
|
49
50
|
var TimePickerDesktop = function TimePickerDesktop(props) {
|
|
50
51
|
var value = props.value,
|
|
51
52
|
currentTime = props.currentTime,
|
|
@@ -60,14 +61,12 @@ var TimePickerDesktop = function TimePickerDesktop(props) {
|
|
|
60
61
|
format = _props$format === void 0 ? 'HH:mm' : _props$format,
|
|
61
62
|
_props$locale = props.locale,
|
|
62
63
|
locale = _props$locale === void 0 ? 'hy' : _props$locale,
|
|
63
|
-
_props$dayjsLocale = props.dayjsLocale,
|
|
64
|
-
dayjsLocale = _props$dayjsLocale === void 0 ? 'hy-am' : _props$dayjsLocale,
|
|
65
64
|
placeholderText = props.placeholderText,
|
|
66
65
|
hasError = props.hasError,
|
|
67
66
|
rest = _objectWithoutProperties(props, _excluded);
|
|
68
67
|
var dateInitialValue = value !== undefined && Object.prototype.toString.call(value) === '[object Date]' ? value : currentTime;
|
|
69
68
|
var calendarRef = useRef(null);
|
|
70
|
-
useImportFilesDynamically(
|
|
69
|
+
useImportFilesDynamically(locale);
|
|
71
70
|
var onChange = function onChange(date) {
|
|
72
71
|
if (changeHandler) {
|
|
73
72
|
changeHandler(date);
|
|
@@ -3,6 +3,7 @@ import { useState, useEffect } from 'react';
|
|
|
3
3
|
import { registerLocale } from 'react-datepicker';
|
|
4
4
|
import dayjs, { locale as locale$3 } from 'dayjs';
|
|
5
5
|
import { _ as _typeof$1 } from '../../typeof-4c44bd25.js';
|
|
6
|
+
import { DayJSLocale } from '../../type/locale.js';
|
|
6
7
|
|
|
7
8
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
8
9
|
try {
|
|
@@ -1937,7 +1938,7 @@ function useImportFilesDynamically(dayjsLocale) {
|
|
|
1937
1938
|
while (1) switch (_context.prev = _context.next) {
|
|
1938
1939
|
case 0:
|
|
1939
1940
|
setIsFilesLoaded(false);
|
|
1940
|
-
locale$3(dayjsLocale);
|
|
1941
|
+
locale$3(DayJSLocale[dayjsLocale]);
|
|
1941
1942
|
setTimeout(function () {
|
|
1942
1943
|
setIsFilesLoaded(true);
|
|
1943
1944
|
}, 0);
|
|
@@ -53,6 +53,7 @@ import './TimePicker/helpers.js';
|
|
|
53
53
|
import './TimePicker/TimePickerDesktop.js';
|
|
54
54
|
import 'react-datepicker';
|
|
55
55
|
import './hooks.js';
|
|
56
|
+
import '../../type/locale.js';
|
|
56
57
|
import '../SVGIcons/IconClock.js';
|
|
57
58
|
import './SimpleDatePicker/SimpleDatePickerDesktop.js';
|
|
58
59
|
import './CustomHeader/CustomHeader.js';
|
|
@@ -101,5 +102,4 @@ import './types.js';
|
|
|
101
102
|
import './RangeDatePicker/RangeDatePickerMobile.js';
|
|
102
103
|
import '../../helpers/format-date.js';
|
|
103
104
|
import '../../helpers/locale.js';
|
|
104
|
-
import '../../type/locale.js';
|
|
105
105
|
import '../../helpers/storage.js';
|
|
@@ -22,7 +22,6 @@ export interface ISimpleDatePickerProps extends TDatepickerBaseProps {
|
|
|
22
22
|
minDate?: Date | null;
|
|
23
23
|
maxDate?: Date | null;
|
|
24
24
|
required?: boolean;
|
|
25
|
-
dayjsLocale?: string;
|
|
26
25
|
value?: Date;
|
|
27
26
|
size?: 'large' | 'small';
|
|
28
27
|
}
|
|
@@ -31,7 +30,6 @@ export interface ITimePickerProps extends TDatepickerBaseProps {
|
|
|
31
30
|
changeHandler?: (date: Date) => void;
|
|
32
31
|
required?: boolean;
|
|
33
32
|
filterTime?: (date: Date) => boolean;
|
|
34
|
-
dayjsLocale?: string;
|
|
35
33
|
value?: Date;
|
|
36
34
|
size?: 'large' | 'small';
|
|
37
35
|
modalApplyButtonText?: string;
|
|
@@ -40,7 +38,6 @@ export interface IRangeDatePickerProps extends TDatepickerBaseProps {
|
|
|
40
38
|
currentDates?: TRangePickerValues;
|
|
41
39
|
changeHandler: (date: TRangePickerValues) => void;
|
|
42
40
|
maxDate?: Date | undefined;
|
|
43
|
-
dayjsLocale?: string;
|
|
44
41
|
value?: [Date, Date];
|
|
45
42
|
}
|
|
46
43
|
export type TRangePickerValues = [Date | null, Date | null];
|
|
@@ -56,10 +56,10 @@ var Empty = function Empty(props) {
|
|
|
56
56
|
imagePath: illustration
|
|
57
57
|
})), /*#__PURE__*/React.createElement("div", {
|
|
58
58
|
className: "no-result__content"
|
|
59
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
59
|
+
}, mainMessage ? /*#__PURE__*/React.createElement(Text, {
|
|
60
60
|
size: size == 'large' ? 'large' : 'small',
|
|
61
61
|
weight: "bold"
|
|
62
|
-
}, mainMessage), paragraphMessage ? /*#__PURE__*/React.createElement(Text, {
|
|
62
|
+
}, mainMessage) : null, paragraphMessage ? /*#__PURE__*/React.createElement(Text, {
|
|
63
63
|
size: size == 'large' ? 'small' : 'xsmall'
|
|
64
64
|
}, paragraphMessage) : null, buttonProps ? /*#__PURE__*/React.createElement(Button, _extends({}, buttonProps, {
|
|
65
65
|
size: "medium",
|
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { TModalPropTypes } from './types';
|
|
3
3
|
export declare const MOBILE_ANIMATION: (isFullScreen?: boolean) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
bottom: number;
|
|
7
|
-
};
|
|
8
|
-
animate: {
|
|
9
|
-
height: string;
|
|
10
|
-
bottom: number;
|
|
11
|
-
};
|
|
12
|
-
exit: {
|
|
13
|
-
height: number;
|
|
14
|
-
bottom: number;
|
|
15
|
-
};
|
|
16
|
-
transition: {
|
|
17
|
-
duration: number;
|
|
4
|
+
[key: string]: {
|
|
5
|
+
[key: string]: string | number;
|
|
18
6
|
};
|
|
19
7
|
};
|
|
20
8
|
export declare const Modal: (props: TModalPropTypes) => ReactElement;
|
|
@@ -60,6 +60,7 @@ import '../../SVGIcons/IconEditFilled.js';
|
|
|
60
60
|
import '../../SVGIcons/IconEdit.js';
|
|
61
61
|
import '../../SVGIcons/IconAttach.js';
|
|
62
62
|
import '../../SVGIcons/IconCheckmark.js';
|
|
63
|
+
import '../localization.js';
|
|
63
64
|
import '../../Collapse/CollapseItem/CollapseItem.js';
|
|
64
65
|
import '../../SVGIcons/IconChevronRight.js';
|
|
65
66
|
import '../../Divider/Divider.js';
|
|
@@ -73,7 +74,7 @@ import 'react-input-mask';
|
|
|
73
74
|
import 'react-number-format';
|
|
74
75
|
import '../../SVGIcons/IconCheckmarkCircleFilled.js';
|
|
75
76
|
|
|
76
|
-
var _excluded = ["isLoading", "isGrouped", "options", "isOpen", "setFieldValue", "name", "footerButtonProps", "selectedItems", "setSelectedItems", "closeHandler", "parentRef"];
|
|
77
|
+
var _excluded = ["isLoading", "isGrouped", "options", "isOpen", "setFieldValue", "name", "footerButtonProps", "selectedItems", "setSelectedItems", "closeHandler", "parentRef", "language"];
|
|
77
78
|
var FilterSelect = function FilterSelect(props) {
|
|
78
79
|
var isLoading = props.isLoading,
|
|
79
80
|
isGrouped = props.isGrouped,
|
|
@@ -81,19 +82,13 @@ var FilterSelect = function FilterSelect(props) {
|
|
|
81
82
|
isOpen = props.isOpen,
|
|
82
83
|
setFieldValue = props.setFieldValue,
|
|
83
84
|
name = props.name,
|
|
84
|
-
|
|
85
|
-
footerButtonProps = _props$footerButtonPr === void 0 ? {
|
|
86
|
-
confirm: {
|
|
87
|
-
buttonText: 'Apply'
|
|
88
|
-
},
|
|
89
|
-
cancel: {
|
|
90
|
-
buttonText: 'Cancel'
|
|
91
|
-
}
|
|
92
|
-
} : _props$footerButtonPr,
|
|
85
|
+
footerButtonProps = props.footerButtonProps,
|
|
93
86
|
selectedItems = props.selectedItems,
|
|
94
87
|
setSelectedItems = props.setSelectedItems,
|
|
95
88
|
closeHandler = props.closeHandler,
|
|
96
89
|
parentRef = props.parentRef,
|
|
90
|
+
_props$language = props.language,
|
|
91
|
+
language = _props$language === void 0 ? 'en' : _props$language,
|
|
97
92
|
rest = _objectWithoutProperties(props, _excluded);
|
|
98
93
|
var _useState = useState(null),
|
|
99
94
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -188,7 +183,8 @@ var FilterSelect = function FilterSelect(props) {
|
|
|
188
183
|
}, rest))), isLoading ? null : /*#__PURE__*/React.createElement(Footer, {
|
|
189
184
|
buttonProps: footerButtonProps,
|
|
190
185
|
onCancel: cancelSelectedItems,
|
|
191
|
-
onApply: applySelectedItems
|
|
186
|
+
onApply: applySelectedItems,
|
|
187
|
+
language: language
|
|
192
188
|
}))), parentRef));
|
|
193
189
|
};
|
|
194
190
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export declare const MultiBase: (props:
|
|
2
|
+
import { TMultiSingleTabPropTypes } from '../../types';
|
|
3
|
+
export declare const MultiBase: (props: TMultiSingleTabPropTypes) => ReactElement | null;
|
|
@@ -93,8 +93,9 @@ var MultiBase = function MultiBase(props) {
|
|
|
93
93
|
menuOptions = props.menuOptions,
|
|
94
94
|
dataIdPrefix = props.dataIdPrefix,
|
|
95
95
|
dropdownWidth = props.dropdownWidth;
|
|
96
|
-
var
|
|
97
|
-
|
|
96
|
+
var _ref = translations || {},
|
|
97
|
+
emptyListMainMessage = _ref.emptyListMainMessage,
|
|
98
|
+
emptyListSecondaryMessage = _ref.emptyListSecondaryMessage;
|
|
98
99
|
var _useState = useState(''),
|
|
99
100
|
_useState2 = _slicedToArray(_useState, 2),
|
|
100
101
|
searchValue = _useState2[0],
|
|
@@ -180,9 +181,9 @@ var MultiBase = function MultiBase(props) {
|
|
|
180
181
|
style: {
|
|
181
182
|
width: dropdownWidth || '100%'
|
|
182
183
|
}
|
|
183
|
-
}, function (
|
|
184
|
-
var index =
|
|
185
|
-
style =
|
|
184
|
+
}, function (_ref2) {
|
|
185
|
+
var index = _ref2.index,
|
|
186
|
+
style = _ref2.style;
|
|
186
187
|
var item = filteredData[index];
|
|
187
188
|
var isSelected = checkIsSelected(item.value);
|
|
188
189
|
return /*#__PURE__*/React.createElement(OptionItem, _extends({
|
|
@@ -20,8 +20,8 @@ import '../../Collapse/CollapseGroup/CollapseGroup.js';
|
|
|
20
20
|
import '../SharedComponents/ContentTop.js';
|
|
21
21
|
import { InputSelectWrapper } from '../SharedComponents/InputSelectWrapper/InputSelectWrapper.js';
|
|
22
22
|
import { ButtonSelectWrapper } from '../SharedComponents/ButtonSelectWrapper/ButtonSelectWrapper.js';
|
|
23
|
-
import { TRANSLATIONS_DEFAULT_VALUES } from '../constants.js';
|
|
24
23
|
import { useIsMobile } from '../../../hooks/useGetIsMobile.js';
|
|
24
|
+
import { SELECT_TRANSLATIONS } from '../localization.js';
|
|
25
25
|
import '../../../typeof-4c44bd25.js';
|
|
26
26
|
import '../../../toConsumableArray-b2fe694a.js';
|
|
27
27
|
import '../../../utils/helpers.js';
|
|
@@ -70,6 +70,7 @@ import '../../SVGIcons/IconAttach.js';
|
|
|
70
70
|
import '../../SVGIcons/IconCheckmark.js';
|
|
71
71
|
import '../../SVGIcons/IconCaretDownFilled.js';
|
|
72
72
|
import '../../SVGIcons/IconCaretUpFilled.js';
|
|
73
|
+
import '../constants.js';
|
|
73
74
|
import './MultiBase/MultiBase.js';
|
|
74
75
|
import 'react-window';
|
|
75
76
|
import '../../Collapse/CollapseItem/CollapseItem.js';
|
|
@@ -91,22 +92,14 @@ import './MobileWrapper.js';
|
|
|
91
92
|
import './DesktopWrapper.js';
|
|
92
93
|
import '../SharedComponents/ButtonSelectWrapper/Button/Button.js';
|
|
93
94
|
|
|
94
|
-
var _excluded = ["isMobileFullScreen", "options", "footerButtonProps", "selectedItems", "setSelectedItems", "name", "setFieldValue", "value", "label", "placeHolder", "isRequiredField", "labelAddons", "className", "disabled", "dropdownWidth", "align", "size", "isButtonSelect", "checkboxInfo", "translations", "hasError"];
|
|
95
|
+
var _excluded = ["isMobileFullScreen", "options", "footerButtonProps", "selectedItems", "setSelectedItems", "name", "setFieldValue", "value", "label", "placeHolder", "isRequiredField", "labelAddons", "className", "disabled", "dropdownWidth", "align", "size", "isButtonSelect", "checkboxInfo", "translations", "hasError", "language"];
|
|
95
96
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
96
97
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
97
98
|
var MultiSelect = function MultiSelect(props) {
|
|
98
99
|
var _props$isMobileFullSc = props.isMobileFullScreen,
|
|
99
100
|
isMobileFullScreen = _props$isMobileFullSc === void 0 ? true : _props$isMobileFullSc,
|
|
100
101
|
options = props.options,
|
|
101
|
-
|
|
102
|
-
footerButtonProps = _props$footerButtonPr === void 0 ? {
|
|
103
|
-
confirm: {
|
|
104
|
-
buttonText: 'Apply'
|
|
105
|
-
},
|
|
106
|
-
cancel: {
|
|
107
|
-
buttonText: 'Cancel'
|
|
108
|
-
}
|
|
109
|
-
} : _props$footerButtonPr,
|
|
102
|
+
footerButtonProps = props.footerButtonProps,
|
|
110
103
|
selectedItems = props.selectedItems,
|
|
111
104
|
setSelectedItems = props.setSelectedItems,
|
|
112
105
|
name = props.name,
|
|
@@ -127,6 +120,8 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
127
120
|
checkboxInfo = props.checkboxInfo,
|
|
128
121
|
translations = props.translations,
|
|
129
122
|
hasError = props.hasError,
|
|
123
|
+
_props$language = props.language,
|
|
124
|
+
language = _props$language === void 0 ? 'en' : _props$language,
|
|
130
125
|
rest = _objectWithoutProperties(props, _excluded);
|
|
131
126
|
var _useState = useState(null),
|
|
132
127
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -188,8 +183,7 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
188
183
|
submitSelectedValue(selectedValues, isChecked);
|
|
189
184
|
};
|
|
190
185
|
var WrapperComponent = isButtonSelect ? ButtonSelectWrapper : InputSelectWrapper;
|
|
191
|
-
var localizations = _objectSpread(_objectSpread({},
|
|
192
|
-
var overflowText = localizations.overflowText;
|
|
186
|
+
var localizations = _objectSpread(_objectSpread({}, SELECT_TRANSLATIONS[language]), translations);
|
|
193
187
|
var isMobile = useIsMobile();
|
|
194
188
|
return /*#__PURE__*/React.createElement(WrapperComponent, {
|
|
195
189
|
dropdownRef: dropdownRef,
|
|
@@ -208,7 +202,7 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
208
202
|
placeHolder: placeHolder,
|
|
209
203
|
selectedValues: selectedValues,
|
|
210
204
|
isRequiredField: isRequiredField,
|
|
211
|
-
overflowText: overflowText,
|
|
205
|
+
overflowText: localizations.overflowText,
|
|
212
206
|
hasError: hasError,
|
|
213
207
|
applySelectedItems: applySelectedItems,
|
|
214
208
|
isMobile: isMobile && isMobileFullScreen
|
|
@@ -218,7 +212,7 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
218
212
|
, _extends({
|
|
219
213
|
options: options,
|
|
220
214
|
isOpen: isOpen,
|
|
221
|
-
translations:
|
|
215
|
+
translations: localizations,
|
|
222
216
|
setIsOpen: setIsOpen,
|
|
223
217
|
dropdownRef: dropdownRef,
|
|
224
218
|
openDropdown: openDropdown,
|
|
@@ -232,7 +226,8 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
232
226
|
hasChange: hasChange,
|
|
233
227
|
buttonProps: footerButtonProps,
|
|
234
228
|
onCancel: cancelSelectedItems,
|
|
235
|
-
onApply: applySelectedItems
|
|
229
|
+
onApply: applySelectedItems,
|
|
230
|
+
language: language
|
|
236
231
|
}) : null));
|
|
237
232
|
};
|
|
238
233
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as _extends } from '../../../extends-546b8e32.js';
|
|
2
|
-
import { _ as _toConsumableArray } from '../../../toConsumableArray-b2fe694a.js';
|
|
3
2
|
import { _ as _defineProperty } from '../../../defineProperty-df65a40d.js';
|
|
3
|
+
import { _ as _toConsumableArray } from '../../../toConsumableArray-b2fe694a.js';
|
|
4
4
|
import { _ as _objectWithoutProperties } from '../../../objectWithoutProperties-47b9cf01.js';
|
|
5
5
|
import React, { useRef, useCallback, useMemo } from 'react';
|
|
6
6
|
import 'classnames';
|
|
@@ -24,9 +24,9 @@ import { useIsMobile } from '../../../hooks/useGetIsMobile.js';
|
|
|
24
24
|
import { MultiSelectGrouped } from './MultiSelectGrouped/MultiSelectGrouped.js';
|
|
25
25
|
import { MultiBase } from './MultiBase/MultiBase.js';
|
|
26
26
|
import { MultiSelectWithTabs } from './MultiSelectWithTabs/MultiSelectWithTabs.js';
|
|
27
|
-
import {
|
|
28
|
-
import '../../../slicedToArray-3f25ed87.js';
|
|
27
|
+
import { SELECTED_VISIBLE_MIN_COUNT } from '../constants.js';
|
|
29
28
|
import '../../../typeof-4c44bd25.js';
|
|
29
|
+
import '../../../slicedToArray-3f25ed87.js';
|
|
30
30
|
import '../../../type/file-upload.js';
|
|
31
31
|
import '../../../hooks/useGetElemPositions.js';
|
|
32
32
|
import '../../../helperComponents/Loader/Loader.js';
|
|
@@ -83,7 +83,7 @@ import '../../Tab/Tab.js';
|
|
|
83
83
|
import '../../Tab/TabItem.js';
|
|
84
84
|
import '../../Badge/Badge.js';
|
|
85
85
|
|
|
86
|
-
var _excluded = ["isLoading", "withTabs", "isGrouped", "isOpen", "
|
|
86
|
+
var _excluded = ["isLoading", "withTabs", "isGrouped", "isOpen", "containerRef", "options", "selectedValues", "setSelectedValues", "setIsOpen", "dropdownRef", "isMobileFullScreen"];
|
|
87
87
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
88
88
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
89
89
|
var OptionsWrapper = function OptionsWrapper(props) {
|
|
@@ -91,7 +91,6 @@ var OptionsWrapper = function OptionsWrapper(props) {
|
|
|
91
91
|
withTabs = props.withTabs,
|
|
92
92
|
isGrouped = props.isGrouped,
|
|
93
93
|
isOpen = props.isOpen,
|
|
94
|
-
translations = props.translations,
|
|
95
94
|
containerRef = props.containerRef,
|
|
96
95
|
options = props.options,
|
|
97
96
|
selectedValues = props.selectedValues,
|
|
@@ -102,7 +101,6 @@ var OptionsWrapper = function OptionsWrapper(props) {
|
|
|
102
101
|
rest = _objectWithoutProperties(props, _excluded);
|
|
103
102
|
var _useGetElemSizes = useGetElemSizes(containerRef),
|
|
104
103
|
width = _useGetElemSizes.width;
|
|
105
|
-
var localizations = _objectSpread(_objectSpread({}, TRANSLATIONS_DEFAULT_VALUES), translations);
|
|
106
104
|
var inputRef = useRef(null);
|
|
107
105
|
var SelectComp = withTabs ? MultiSelectWithTabs : isGrouped ? MultiSelectGrouped : MultiBase;
|
|
108
106
|
var checkIsValueOverflowed = useCallback(function (value) {
|
|
@@ -152,7 +150,6 @@ var OptionsWrapper = function OptionsWrapper(props) {
|
|
|
152
150
|
isOpen: isOpen,
|
|
153
151
|
isMobile: isMobile,
|
|
154
152
|
hasBottomSpace: hasBottomSpace,
|
|
155
|
-
translations: localizations,
|
|
156
153
|
selectedValues: selectedValues,
|
|
157
154
|
onItemSelect: onItemSelect,
|
|
158
155
|
onItemDeselect: onItemDeselect,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _ as _extends } from '../../../extends-546b8e32.js';
|
|
2
|
+
import { _ as _defineProperty } from '../../../defineProperty-df65a40d.js';
|
|
2
3
|
import { _ as _slicedToArray } from '../../../slicedToArray-3f25ed87.js';
|
|
3
4
|
import { _ as _objectWithoutProperties } from '../../../objectWithoutProperties-47b9cf01.js';
|
|
4
5
|
import React, { useRef, useState } from 'react';
|
|
@@ -11,9 +12,9 @@ import { SELECTED_VISIBLE_MIN_COUNT } from '../constants.js';
|
|
|
11
12
|
import { SelectMobile } from './SelectMobile/index.js';
|
|
12
13
|
import { IconCaretUpFilled } from '../../SVGIcons/IconCaretUpFilled.js';
|
|
13
14
|
import { IconCaretDownFilled } from '../../SVGIcons/IconCaretDownFilled.js';
|
|
14
|
-
import '
|
|
15
|
-
import '../../../defineProperty-df65a40d.js';
|
|
15
|
+
import { SELECT_TRANSLATIONS } from '../localization.js';
|
|
16
16
|
import '../../../typeof-4c44bd25.js';
|
|
17
|
+
import '../../../consts/index.js';
|
|
17
18
|
import '../../../type/file-upload.js';
|
|
18
19
|
import 'react-window';
|
|
19
20
|
import '../../Text/Text.js';
|
|
@@ -82,7 +83,9 @@ import '../SharedComponents/Loading.js';
|
|
|
82
83
|
import './helpers.js';
|
|
83
84
|
import './SelectMobile/MobileTopContent.js';
|
|
84
85
|
|
|
85
|
-
var _excluded = ["labelAddons", "dataId", "className", "size", "label", "hasError", "isValid", "disabled", "outerHelperText", "isRequiredField", "placeHolder", "selectRightIconProps", "selectRightIconOpenedProps", "options", "withSearch", "setSelectedItem", "setFieldValue", "name", "selectedItem", "value", "isMobileFullScreen"];
|
|
86
|
+
var _excluded = ["labelAddons", "dataId", "className", "size", "label", "hasError", "isValid", "disabled", "outerHelperText", "isRequiredField", "placeHolder", "selectRightIconProps", "selectRightIconOpenedProps", "options", "withSearch", "setSelectedItem", "setFieldValue", "name", "selectedItem", "value", "isMobileFullScreen", "language", "translations"];
|
|
87
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
88
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
86
89
|
var Select = function Select(props) {
|
|
87
90
|
var _selectedOption$optio, _selectedOption$optio2;
|
|
88
91
|
var labelAddons = props.labelAddons,
|
|
@@ -115,6 +118,9 @@ var Select = function Select(props) {
|
|
|
115
118
|
value = props.value,
|
|
116
119
|
_props$isMobileFullSc = props.isMobileFullScreen,
|
|
117
120
|
isMobileFullScreen = _props$isMobileFullSc === void 0 ? true : _props$isMobileFullSc,
|
|
121
|
+
_props$language = props.language,
|
|
122
|
+
language = _props$language === void 0 ? 'en' : _props$language,
|
|
123
|
+
translations = props.translations,
|
|
118
124
|
rest = _objectWithoutProperties(props, _excluded);
|
|
119
125
|
var isMobile = useIsMobile();
|
|
120
126
|
var containerRef = useRef(null);
|
|
@@ -172,6 +178,7 @@ var Select = function Select(props) {
|
|
|
172
178
|
return onItemSelect(null);
|
|
173
179
|
};
|
|
174
180
|
var currentSelection = value || selectedItem;
|
|
181
|
+
var localizations = _objectSpread(_objectSpread({}, SELECT_TRANSLATIONS[language]), translations);
|
|
175
182
|
return /*#__PURE__*/React.createElement("div", {
|
|
176
183
|
"data-id": "".concat(dataId, "-content"),
|
|
177
184
|
className: classNames("select select--".concat(size), className, {
|
|
@@ -205,7 +212,8 @@ var Select = function Select(props) {
|
|
|
205
212
|
currentSelection: currentSelection,
|
|
206
213
|
isRequiredField: isRequiredField,
|
|
207
214
|
onItemDeselect: onItemDeselect,
|
|
208
|
-
onItemSelect: onItemSelect
|
|
215
|
+
onItemSelect: onItemSelect,
|
|
216
|
+
translations: localizations
|
|
209
217
|
})) : /*#__PURE__*/React.createElement(SelectDesktop, _extends({}, rest, {
|
|
210
218
|
onItemDeselect: onItemDeselect,
|
|
211
219
|
onItemSelect: onItemSelect,
|
|
@@ -218,7 +226,8 @@ var Select = function Select(props) {
|
|
|
218
226
|
closeDropdown: closeDropdown,
|
|
219
227
|
setSelectedOption: setSelectedOption,
|
|
220
228
|
searchValue: searchValue,
|
|
221
|
-
setSearchValue: setSearchValue
|
|
229
|
+
setSearchValue: setSearchValue,
|
|
230
|
+
translations: localizations
|
|
222
231
|
})));
|
|
223
232
|
};
|
|
224
233
|
|
|
@@ -23,7 +23,7 @@ import '../../../Collapse/CollapseGroup/CollapseGroup.js';
|
|
|
23
23
|
import '../../SharedComponents/ContentTop.js';
|
|
24
24
|
import { Loading } from '../../SharedComponents/Loading.js';
|
|
25
25
|
import '../../../Input/Input.js';
|
|
26
|
-
import { ITEM_SIZE, DROPDOWN_HEIGHT, DROPDOWN_WIDTH
|
|
26
|
+
import { ITEM_SIZE, DROPDOWN_HEIGHT, DROPDOWN_WIDTH } from '../../constants.js';
|
|
27
27
|
import { filterOptions } from '../helpers.js';
|
|
28
28
|
import '../../../../typeof-4c44bd25.js';
|
|
29
29
|
import '../../../../type/file-upload.js';
|
|
@@ -207,7 +207,7 @@ var SelectDesktop = function SelectDesktop(props) {
|
|
|
207
207
|
});
|
|
208
208
|
}), filteredData.length === 0 ? /*#__PURE__*/React.createElement(Empty, {
|
|
209
209
|
size: "small",
|
|
210
|
-
mainMessage:
|
|
210
|
+
mainMessage: translations === null || translations === void 0 ? void 0 : translations.emptyListMainMessage
|
|
211
211
|
}) : null))));
|
|
212
212
|
};
|
|
213
213
|
|
|
@@ -11,7 +11,7 @@ import 'framer-motion';
|
|
|
11
11
|
import '../../../../consts/index.js';
|
|
12
12
|
import '../../../../hooks/useScreenSize.js';
|
|
13
13
|
import 'react-hook-form';
|
|
14
|
-
import { ITEM_SIZE_MOBILE
|
|
14
|
+
import { ITEM_SIZE_MOBILE } from '../../constants.js';
|
|
15
15
|
import 'react-dom';
|
|
16
16
|
import '../../../Collapse/CollapseGroup/CollapseGroup.js';
|
|
17
17
|
import '../../SharedComponents/ContentTop.js';
|
|
@@ -168,7 +168,7 @@ var SelectMobile = function SelectMobile(props) {
|
|
|
168
168
|
});
|
|
169
169
|
}), filteredData.length === 0 ? /*#__PURE__*/React.createElement(Empty, {
|
|
170
170
|
size: "small",
|
|
171
|
-
mainMessage:
|
|
171
|
+
mainMessage: translations === null || translations === void 0 ? void 0 : translations.emptyListMainMessage
|
|
172
172
|
}) : null)));
|
|
173
173
|
};
|
|
174
174
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { _ as _extends } from '../../../extends-546b8e32.js';
|
|
2
|
+
import { _ as _defineProperty } from '../../../defineProperty-df65a40d.js';
|
|
2
3
|
import { _ as _slicedToArray } from '../../../slicedToArray-3f25ed87.js';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { C as Checkbox, B as Button } from '../../../Button-988c1dcc.js';
|
|
5
|
-
import '
|
|
6
|
+
import { SELECT_TRANSLATIONS } from '../localization.js';
|
|
6
7
|
import '../../../typeof-4c44bd25.js';
|
|
7
8
|
import '../../../objectWithoutProperties-47b9cf01.js';
|
|
8
9
|
import 'classnames';
|
|
@@ -36,8 +37,11 @@ import '../../../helperComponents/IconDynamicComponent/IconDynamicComponent.js';
|
|
|
36
37
|
import '../../../helperComponents/IconDynamicComponent/constants.js';
|
|
37
38
|
import '../../Button/consts.js';
|
|
38
39
|
|
|
40
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
41
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39
42
|
var Footer = function Footer(props) {
|
|
40
|
-
var
|
|
43
|
+
var language = props.language,
|
|
44
|
+
buttonProps = props.buttonProps,
|
|
41
45
|
onApply = props.onApply,
|
|
42
46
|
onCancel = props.onCancel,
|
|
43
47
|
_props$hasChange = props.hasChange,
|
|
@@ -47,6 +51,12 @@ var Footer = function Footer(props) {
|
|
|
47
51
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
48
52
|
isSelected = _React$useState2[0],
|
|
49
53
|
setIsSelected = _React$useState2[1];
|
|
54
|
+
var confirmButtonProps = _objectSpread({
|
|
55
|
+
buttonText: SELECT_TRANSLATIONS[language].confirmButtonText
|
|
56
|
+
}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.confirm) || {});
|
|
57
|
+
var cancelButtonProps = _objectSpread({
|
|
58
|
+
buttonText: SELECT_TRANSLATIONS[language].cancelButtonText
|
|
59
|
+
}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.cancel) || {});
|
|
50
60
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
61
|
className: "select__footer"
|
|
52
62
|
}, /*#__PURE__*/React.createElement("div", null, checkboxInfo ? /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -55,14 +65,14 @@ var Footer = function Footer(props) {
|
|
|
55
65
|
onClick: setIsSelected
|
|
56
66
|
}) : null), /*#__PURE__*/React.createElement("div", {
|
|
57
67
|
className: 'select__footer__right flexbox'
|
|
58
|
-
}, /*#__PURE__*/React.createElement(Button, _extends({},
|
|
68
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({}, cancelButtonProps, {
|
|
59
69
|
type: "tertiary",
|
|
60
70
|
size: "medium",
|
|
61
71
|
className: "mr-12",
|
|
62
72
|
onClick: onCancel
|
|
63
73
|
})), /*#__PURE__*/React.createElement(Button, _extends({
|
|
64
74
|
disabled: !hasChange && isSelected === !!(checkboxInfo !== null && checkboxInfo !== void 0 && checkboxInfo.isChecked)
|
|
65
|
-
},
|
|
75
|
+
}, confirmButtonProps, {
|
|
66
76
|
type: "primary",
|
|
67
77
|
size: "medium",
|
|
68
78
|
onClick: function onClick() {
|
|
@@ -5,11 +5,11 @@ export { Loading } from './Loading.js';
|
|
|
5
5
|
export { InputSelectWrapper } from './InputSelectWrapper/InputSelectWrapper.js';
|
|
6
6
|
export { ButtonSelectWrapper } from './ButtonSelectWrapper/ButtonSelectWrapper.js';
|
|
7
7
|
import '../../../extends-546b8e32.js';
|
|
8
|
+
import '../../../defineProperty-df65a40d.js';
|
|
9
|
+
import '../../../typeof-4c44bd25.js';
|
|
8
10
|
import '../../../slicedToArray-3f25ed87.js';
|
|
9
11
|
import 'react';
|
|
10
12
|
import '../../../Button-988c1dcc.js';
|
|
11
|
-
import '../../../defineProperty-df65a40d.js';
|
|
12
|
-
import '../../../typeof-4c44bd25.js';
|
|
13
13
|
import '../../../objectWithoutProperties-47b9cf01.js';
|
|
14
14
|
import 'classnames';
|
|
15
15
|
import 'dayjs';
|
|
@@ -41,6 +41,7 @@ import '../../SVGIcons/IconInfo.js';
|
|
|
41
41
|
import '../../../helperComponents/IconDynamicComponent/IconDynamicComponent.js';
|
|
42
42
|
import '../../../helperComponents/IconDynamicComponent/constants.js';
|
|
43
43
|
import '../../Button/consts.js';
|
|
44
|
+
import '../localization.js';
|
|
44
45
|
import '../../Menu/Menu.js';
|
|
45
46
|
import 'react-dom';
|
|
46
47
|
import '../../../helperComponents/OptionItem/OptionItem.js';
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export declare const TRANSLATIONS_DEFAULT_VALUES: {
|
|
2
|
-
emptyListMainMessage: string;
|
|
3
|
-
overflowText: string;
|
|
4
|
-
};
|
|
5
1
|
export declare const SELECTED_VISIBLE_MIN_COUNT = 7;
|
|
6
2
|
export declare const DROPDOWN_MAX_HEIGHT = 260;
|
|
7
3
|
export declare const DROPDOWN_MAX_HEIGHT_PART = 106;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
var TRANSLATIONS_DEFAULT_VALUES = {
|
|
2
|
-
emptyListMainMessage: "Sorry, we couldn't find any results",
|
|
3
|
-
overflowText: '%s selected'
|
|
4
|
-
};
|
|
5
1
|
var SELECTED_VISIBLE_MIN_COUNT = 7;
|
|
6
2
|
var DROPDOWN_MAX_HEIGHT = 260;
|
|
7
3
|
var DROPDOWN_MAX_HEIGHT_PART = 106;
|
|
@@ -10,4 +6,4 @@ var ITEM_SIZE_MOBILE = 56; // with margin
|
|
|
10
6
|
var DROPDOWN_HEIGHT = 300;
|
|
11
7
|
var DROPDOWN_WIDTH = 400;
|
|
12
8
|
|
|
13
|
-
export { DROPDOWN_HEIGHT, DROPDOWN_MAX_HEIGHT, DROPDOWN_MAX_HEIGHT_PART, DROPDOWN_WIDTH, ITEM_SIZE, ITEM_SIZE_MOBILE, SELECTED_VISIBLE_MIN_COUNT
|
|
9
|
+
export { DROPDOWN_HEIGHT, DROPDOWN_MAX_HEIGHT, DROPDOWN_MAX_HEIGHT_PART, DROPDOWN_WIDTH, ITEM_SIZE, ITEM_SIZE_MOBILE, SELECTED_VISIBLE_MIN_COUNT };
|
|
@@ -4,13 +4,13 @@ export { NestedSelect } from './NestedSelect/NestedSelect.js';
|
|
|
4
4
|
export { ButtonSelect } from './ButtonSelect/ButtonSelect.js';
|
|
5
5
|
export { ProfileDropdown } from './ProfileDropdown/index.js';
|
|
6
6
|
import '../../extends-546b8e32.js';
|
|
7
|
+
import '../../defineProperty-df65a40d.js';
|
|
8
|
+
import '../../typeof-4c44bd25.js';
|
|
7
9
|
import '../../slicedToArray-3f25ed87.js';
|
|
8
10
|
import '../../objectWithoutProperties-47b9cf01.js';
|
|
9
11
|
import 'react';
|
|
10
12
|
import '../../hooks/useGetIsMobile.js';
|
|
11
13
|
import '../../consts/index.js';
|
|
12
|
-
import '../../defineProperty-df65a40d.js';
|
|
13
|
-
import '../../typeof-4c44bd25.js';
|
|
14
14
|
import '../../type/file-upload.js';
|
|
15
15
|
import './Select/SelectDesktop/index.js';
|
|
16
16
|
import 'classnames';
|
|
@@ -86,6 +86,7 @@ import './Select/SelectMobile/index.js';
|
|
|
86
86
|
import './Select/SelectMobile/MobileTopContent.js';
|
|
87
87
|
import '../SVGIcons/IconCaretUpFilled.js';
|
|
88
88
|
import '../SVGIcons/IconCaretDownFilled.js';
|
|
89
|
+
import './localization.js';
|
|
89
90
|
import './MultiSelect/OptionsWrapper.js';
|
|
90
91
|
import './MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js';
|
|
91
92
|
import './MultiSelect/MultiBase/MultiBase.js';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var SELECT_TRANSLATIONS = {
|
|
2
|
+
en: {
|
|
3
|
+
emptyListMainMessage: "Sorry, we couldn't find any results",
|
|
4
|
+
clearAllLabel: 'Clear all',
|
|
5
|
+
selectAllLabel: 'Select all',
|
|
6
|
+
overflowText: '%s selected',
|
|
7
|
+
innerLabel: ' ',
|
|
8
|
+
confirmButtonText: 'Apply',
|
|
9
|
+
cancelButtonText: 'Cancel'
|
|
10
|
+
},
|
|
11
|
+
ru: {
|
|
12
|
+
emptyListMainMessage: 'К сожалению, результаты не найдены',
|
|
13
|
+
clearAllLabel: 'Очистить все',
|
|
14
|
+
selectAllLabel: 'Выбрать все',
|
|
15
|
+
overflowText: '%s Выбрано',
|
|
16
|
+
innerLabel: ' ',
|
|
17
|
+
confirmButtonText: 'Применить',
|
|
18
|
+
cancelButtonText: 'Отменить'
|
|
19
|
+
},
|
|
20
|
+
hy: {
|
|
21
|
+
emptyListMainMessage: 'Որևէ արդյունք չի գտնվել',
|
|
22
|
+
clearAllLabel: 'Մաքրել բոլորը',
|
|
23
|
+
selectAllLabel: 'Ընտրել բոլորը',
|
|
24
|
+
overflowText: '%s Ընտրված',
|
|
25
|
+
innerLabel: ' ',
|
|
26
|
+
confirmButtonText: 'Կիրառել',
|
|
27
|
+
cancelButtonText: 'Չեղարկել'
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { SELECT_TRANSLATIONS };
|
|
@@ -24,6 +24,7 @@ interface TSelectBaseProps {
|
|
|
24
24
|
size?: 'small' | 'large' | 'medium';
|
|
25
25
|
className?: string;
|
|
26
26
|
dropdownWidth?: number;
|
|
27
|
+
language?: string;
|
|
27
28
|
}
|
|
28
29
|
export interface TNestedSelectProps {
|
|
29
30
|
options: TSelectOptions;
|
|
@@ -39,13 +40,15 @@ export interface TNestedSelectProps {
|
|
|
39
40
|
labelAddons?: ReactElement;
|
|
40
41
|
}
|
|
41
42
|
export type TSelectTranslations = {
|
|
42
|
-
emptyListMainMessage
|
|
43
|
+
emptyListMainMessage?: string;
|
|
43
44
|
overflowText?: string;
|
|
44
45
|
searchInputPlaceHolder?: string;
|
|
45
46
|
emptyListSecondaryMessage?: string;
|
|
46
47
|
selectAllLabel?: string;
|
|
47
48
|
clearAllLabel?: string;
|
|
48
49
|
innerLabel?: string;
|
|
50
|
+
confirmButtonText?: string;
|
|
51
|
+
cancelButtonText?: string;
|
|
49
52
|
};
|
|
50
53
|
interface TMultiSelectCompProps extends IFormCompProps, TSelectBaseProps {
|
|
51
54
|
isMobile: boolean;
|
|
@@ -63,7 +66,7 @@ interface TMultiSelectCompProps extends IFormCompProps, TSelectBaseProps {
|
|
|
63
66
|
menuOptions?: TMenuItem[];
|
|
64
67
|
closeDropdown: () => void;
|
|
65
68
|
}
|
|
66
|
-
export interface
|
|
69
|
+
export interface TMultiSingleTabPropTypes extends TMultiSelectCompProps {
|
|
67
70
|
options: TSelectOptions;
|
|
68
71
|
}
|
|
69
72
|
export interface TMultiSelectGroupedProps extends TMultiSelectCompProps {
|
|
@@ -84,7 +87,7 @@ export interface TMultiSelectPropTypes extends IFormCompProps, TSelectBaseProps
|
|
|
84
87
|
isGrouped?: boolean;
|
|
85
88
|
checkboxInfo?: TCheckboxInfo;
|
|
86
89
|
selectedItems?: TSelectedValue[];
|
|
87
|
-
translations
|
|
90
|
+
translations?: TSelectTranslations;
|
|
88
91
|
options: TSelectOptions | TSelectGroupOptions;
|
|
89
92
|
setSelectedItems?: (items: TSelectedValue[], isChecked: boolean) => void;
|
|
90
93
|
footerButtonProps?: {
|
|
@@ -145,9 +148,8 @@ export interface ISingleSelectResponsiveProps {
|
|
|
145
148
|
avatar?: string;
|
|
146
149
|
currentSelection: TItemValue | undefined;
|
|
147
150
|
isRequiredField?: boolean;
|
|
148
|
-
translations?:
|
|
149
|
-
|
|
150
|
-
};
|
|
151
|
+
translations?: TSelectTranslations;
|
|
152
|
+
language?: string;
|
|
151
153
|
}
|
|
152
154
|
export type ISingleSelectMobileProps = ISingleSelectResponsiveProps;
|
|
153
155
|
export interface ISingleSelectDesktopProps extends ISingleSelectResponsiveProps {
|
|
@@ -162,12 +164,13 @@ export interface ISingleSelectDesktopProps extends ISingleSelectResponsiveProps
|
|
|
162
164
|
export type TSelectFooterPropTypes = {
|
|
163
165
|
checkboxInfo?: TCheckboxInfo;
|
|
164
166
|
hasChange?: boolean;
|
|
165
|
-
buttonProps
|
|
167
|
+
buttonProps?: {
|
|
166
168
|
cancel: TButtonPropTypes;
|
|
167
169
|
confirm: TButtonPropTypes;
|
|
168
170
|
};
|
|
169
171
|
onCancel: () => void;
|
|
170
172
|
onApply: (isChecked: boolean) => void;
|
|
173
|
+
language: string;
|
|
171
174
|
};
|
|
172
175
|
export interface TFilterProps extends IFormCompProps, TSelectBaseProps {
|
|
173
176
|
isLoading?: boolean;
|
package/helpers/locale.js
CHANGED
|
@@ -9,8 +9,9 @@ var getTranslationLocale = function getTranslationLocale() {
|
|
|
9
9
|
return TranslationLocale[activeLangCode] || 'en';
|
|
10
10
|
};
|
|
11
11
|
var getDayJSLocale = function getDayJSLocale() {
|
|
12
|
+
// Todo: need to check if it is works correctly when change language
|
|
12
13
|
var activeLangCode = getActiveLanguageCode();
|
|
13
|
-
return DayJSLocale[activeLangCode] || 'en';
|
|
14
|
+
return DayJSLocale[TranslationLocale[activeLangCode]] || 'en';
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export { getActiveLanguageCode, getDayJSLocale, getTranslationLocale };
|
package/index.js
CHANGED
|
@@ -394,6 +394,7 @@ import './components/DatePicker/TimePicker/helpers.js';
|
|
|
394
394
|
import './components/DatePicker/TimePicker/TimePickerDesktop.js';
|
|
395
395
|
import 'react-datepicker';
|
|
396
396
|
import './components/DatePicker/hooks.js';
|
|
397
|
+
import './type/locale.js';
|
|
397
398
|
import './components/DatePicker/SimpleDatePicker/SimpleDatePickerDesktop.js';
|
|
398
399
|
import './components/DatePicker/CustomHeader/CustomHeader.js';
|
|
399
400
|
import 'react-window';
|
|
@@ -415,7 +416,6 @@ import './components/DatePicker/types.js';
|
|
|
415
416
|
import './components/DatePicker/RangeDatePicker/RangeDatePickerMobile.js';
|
|
416
417
|
import './helpers/format-date.js';
|
|
417
418
|
import './helpers/locale.js';
|
|
418
|
-
import './type/locale.js';
|
|
419
419
|
import './helpers/storage.js';
|
|
420
420
|
import './components/FileUpload/DropzoneFileUpload/helpers.js';
|
|
421
421
|
import './components/FileUpload/DropzoneFileUpload/ErrorItem.js';
|
|
@@ -434,6 +434,7 @@ import './components/Select/constants.js';
|
|
|
434
434
|
import './components/Select/Select/helpers.js';
|
|
435
435
|
import './components/Select/Select/SelectMobile/index.js';
|
|
436
436
|
import './components/Select/Select/SelectMobile/MobileTopContent.js';
|
|
437
|
+
import './components/Select/localization.js';
|
|
437
438
|
import './components/Select/MultiSelect/OptionsWrapper.js';
|
|
438
439
|
import './components/Select/MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js';
|
|
439
440
|
import './components/Select/MultiSelect/MultiBase/MultiBase.js';
|
package/package.json
CHANGED
|
@@ -4,10 +4,6 @@ declare const _default: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
component: (props: IRangeDatePickerProps) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
6
6
|
argTypes: {
|
|
7
|
-
dayjsLocale: {
|
|
8
|
-
control: string;
|
|
9
|
-
options: string[];
|
|
10
|
-
};
|
|
11
7
|
locale: {
|
|
12
8
|
control: string;
|
|
13
9
|
options: string[];
|
package/type/locale.d.ts
CHANGED
package/type/locale.js
CHANGED
|
@@ -5,9 +5,9 @@ var TranslationLocale = /*#__PURE__*/function (TranslationLocale) {
|
|
|
5
5
|
return TranslationLocale;
|
|
6
6
|
}({});
|
|
7
7
|
var DayJSLocale = /*#__PURE__*/function (DayJSLocale) {
|
|
8
|
-
DayJSLocale["en
|
|
9
|
-
DayJSLocale["hy
|
|
10
|
-
DayJSLocale["ru
|
|
8
|
+
DayJSLocale["en"] = "en";
|
|
9
|
+
DayJSLocale["hy"] = "hy-am";
|
|
10
|
+
DayJSLocale["ru"] = "ru";
|
|
11
11
|
return DayJSLocale;
|
|
12
12
|
}({});
|
|
13
13
|
|