hrm_ui_lib 1.4.12 → 1.5.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/components/DatePicker/RangeDatePicker/RangeDatePicker.js +3 -0
- package/components/DatePicker/RangeDatePicker/RangeDatePickerMobile.js +3 -0
- package/components/DatePicker/RangeDatePicker/index.js +3 -0
- package/components/DatePicker/index.js +3 -0
- package/components/Select/ButtonSelect/ButtonSelect.js +7 -3
- package/components/Select/MultiSelect/MultiBase/MultiBase.js +3 -3
- package/components/Select/MultiSelect/MultiSelect.js +9 -5
- package/components/Select/MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js +3 -3
- package/components/Select/MultiSelect/OptionsWrapper.d.ts +1 -0
- package/components/Select/MultiSelect/OptionsWrapper.js +6 -2
- package/components/Select/Select/Select.js +16 -4
- package/components/Select/SharedComponents/ButtonSelectWrapper/ButtonSelectWrapper.js +3 -3
- package/components/Select/SharedComponents/InputSelectWrapper/InputSelectWrapper.js +3 -3
- package/components/Select/index.js +2 -2
- package/components/Select/types.d.ts +5 -0
- package/helpers/format-date.d.ts +1 -1
- package/helpers/format-date.js +8 -3
- package/helpers/index.d.ts +2 -0
- package/helpers/index.js +3 -0
- package/helpers/locale.d.ts +3 -0
- package/helpers/locale.js +16 -0
- package/helpers/storage.d.ts +2 -0
- package/helpers/storage.js +20 -0
- package/index.js +3 -0
- package/package.json +1 -1
- package/type/index.d.ts +1 -0
- package/type/index.js +1 -0
- package/type/locale.d.ts +10 -0
- package/type/locale.js +14 -0
|
@@ -85,6 +85,9 @@ import '../../../hooks/useChangePositionsOnScroll.js';
|
|
|
85
85
|
import '../../Select/MultiSelect/MobileWrapper.js';
|
|
86
86
|
import '../../Select/MultiSelect/DesktopWrapper.js';
|
|
87
87
|
import '../../../helpers/format-date.js';
|
|
88
|
+
import '../../../helpers/locale.js';
|
|
89
|
+
import '../../../type/locale.js';
|
|
90
|
+
import '../../../helpers/storage.js';
|
|
88
91
|
|
|
89
92
|
var RangeDatePicker = function RangeDatePicker(props) {
|
|
90
93
|
var isMobile = useIsMobile();
|
|
@@ -83,6 +83,9 @@ import '../../../hooks/useGetHasBottomSpace.js';
|
|
|
83
83
|
import '../../../hooks/useChangePositionsOnScroll.js';
|
|
84
84
|
import '../../Select/MultiSelect/MobileWrapper.js';
|
|
85
85
|
import '../../Select/MultiSelect/DesktopWrapper.js';
|
|
86
|
+
import '../../../helpers/locale.js';
|
|
87
|
+
import '../../../type/locale.js';
|
|
88
|
+
import '../../../helpers/storage.js';
|
|
86
89
|
|
|
87
90
|
var _excluded = ["value", "currentDates", "setFieldValue", "name", "changeHandler", "dataId", "format", "maxDate", "minDate", "locale", "dayjsLocale", "disabled", "placeholderText", "months", "dataIdPrefix", "modalOptions"];
|
|
88
91
|
var RangeDatePickerMobile = /*#__PURE__*/forwardRef(function (props) {
|
|
@@ -86,3 +86,6 @@ import '../../../hooks/useChangePositionsOnScroll.js';
|
|
|
86
86
|
import '../../Select/MultiSelect/MobileWrapper.js';
|
|
87
87
|
import '../../Select/MultiSelect/DesktopWrapper.js';
|
|
88
88
|
import '../../../helpers/format-date.js';
|
|
89
|
+
import '../../../helpers/locale.js';
|
|
90
|
+
import '../../../type/locale.js';
|
|
91
|
+
import '../../../helpers/storage.js';
|
|
@@ -96,3 +96,6 @@ import './RangeDatePicker/RangeDatePickerDesktop.js';
|
|
|
96
96
|
import './types.js';
|
|
97
97
|
import './RangeDatePicker/RangeDatePickerMobile.js';
|
|
98
98
|
import '../../helpers/format-date.js';
|
|
99
|
+
import '../../helpers/locale.js';
|
|
100
|
+
import '../../type/locale.js';
|
|
101
|
+
import '../../helpers/storage.js';
|
|
@@ -16,6 +16,7 @@ import '../../Collapse/CollapseGroup/CollapseGroup.js';
|
|
|
16
16
|
import '../SharedComponents/ContentTop.js';
|
|
17
17
|
import { Loading } from '../SharedComponents/Loading.js';
|
|
18
18
|
import '../../Input/Input.js';
|
|
19
|
+
import { useIsMobile } from '../../../hooks/useGetIsMobile.js';
|
|
19
20
|
import { ButtonSelectWrapper } from '../SharedComponents/ButtonSelectWrapper/ButtonSelectWrapper.js';
|
|
20
21
|
import 'dayjs';
|
|
21
22
|
import '../../../extends-3c4962fa.js';
|
|
@@ -36,7 +37,6 @@ import '../../../defineProperty-0885e8cf.js';
|
|
|
36
37
|
import '../../../typeof-8ef57f3d.js';
|
|
37
38
|
import '../../../objectWithoutProperties-df371a0b.js';
|
|
38
39
|
import '../../../helperComponents/Loader/Loader.js';
|
|
39
|
-
import '../../../hooks/useGetIsMobile.js';
|
|
40
40
|
import '../../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
41
41
|
import '../../../hooks/useHideBodyScroll.js';
|
|
42
42
|
import '../../SVGIcons/IconDismiss.js';
|
|
@@ -98,7 +98,9 @@ var ButtonSelect = function ButtonSelect(props) {
|
|
|
98
98
|
placeHolder = props.placeHolder,
|
|
99
99
|
offsets = props.offsets,
|
|
100
100
|
dataId = props.dataId,
|
|
101
|
-
type = props.type
|
|
101
|
+
type = props.type,
|
|
102
|
+
_props$isMobileFullSc = props.isMobileFullScreen,
|
|
103
|
+
isMobileFullScreen = _props$isMobileFullSc === void 0 ? false : _props$isMobileFullSc;
|
|
102
104
|
var currentSelection = value || selectedItem;
|
|
103
105
|
var _useState = useState(false),
|
|
104
106
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -119,6 +121,7 @@ var ButtonSelect = function ButtonSelect(props) {
|
|
|
119
121
|
var onItemDeselect = function onItemDeselect() {
|
|
120
122
|
return onItemSelect(null);
|
|
121
123
|
};
|
|
124
|
+
var isMobile = useIsMobile();
|
|
122
125
|
var onItemSelect = function onItemSelect(value) {
|
|
123
126
|
if (setSelectedItem) {
|
|
124
127
|
setSelectedItem(value);
|
|
@@ -155,7 +158,8 @@ var ButtonSelect = function ButtonSelect(props) {
|
|
|
155
158
|
setDropdownRef: setDropdownRef,
|
|
156
159
|
placeHolder: placeHolder,
|
|
157
160
|
dataId: dataId,
|
|
158
|
-
type: type
|
|
161
|
+
type: type,
|
|
162
|
+
isMobile: isMobile && isMobileFullScreen
|
|
159
163
|
}, isLoading ? /*#__PURE__*/React.createElement(Loading, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
160
164
|
ref: scrollRef,
|
|
161
165
|
className: classNames('select__options__scroll', 'scrollbar', 'scrollbar--vertical', {
|
|
@@ -16,7 +16,6 @@ import 'framer-motion';
|
|
|
16
16
|
import '../../../Collapse/CollapseGroup/CollapseGroup.js';
|
|
17
17
|
import { ContentTop } from '../../SharedComponents/ContentTop.js';
|
|
18
18
|
import '../../../Input/Input.js';
|
|
19
|
-
import { useIsMobile } from '../../../../hooks/useGetIsMobile.js';
|
|
20
19
|
import { FixedSizeList } from 'react-window';
|
|
21
20
|
import { DROPDOWN_HEIGHT, ITEM_SIZE_MOBILE, ITEM_SIZE, DROPDOWN_WIDTH } from '../../constants.js';
|
|
22
21
|
import '../../../Text/Text.js';
|
|
@@ -26,6 +25,7 @@ import '../../../../defineProperty-0885e8cf.js';
|
|
|
26
25
|
import '../../../../typeof-8ef57f3d.js';
|
|
27
26
|
import '../../../../objectWithoutProperties-df371a0b.js';
|
|
28
27
|
import '../../../../helperComponents/Loader/Loader.js';
|
|
28
|
+
import '../../../../hooks/useGetIsMobile.js';
|
|
29
29
|
import '../../../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
30
30
|
import '../../../../hooks/useOnOutsideClick.js';
|
|
31
31
|
import '../../../../hooks/useHideBodyScroll.js';
|
|
@@ -72,7 +72,8 @@ import 'react-number-format';
|
|
|
72
72
|
import '../../../SVGIcons/IconCheckmarkCircleFilled.js';
|
|
73
73
|
|
|
74
74
|
var MultiBase = function MultiBase(props) {
|
|
75
|
-
var
|
|
75
|
+
var isMobile = props.isMobile,
|
|
76
|
+
closeDropdown = props.closeDropdown,
|
|
76
77
|
avatar = props.avatar,
|
|
77
78
|
scrollableContentStyle = props.scrollableContentStyle,
|
|
78
79
|
options = props.options,
|
|
@@ -150,7 +151,6 @@ var MultiBase = function MultiBase(props) {
|
|
|
150
151
|
labelRightIconComponent: labelRightIconComponent
|
|
151
152
|
};
|
|
152
153
|
}, [avatar, labelLeftIconProps, optionRightIconComponent, labelRightIconComponent]);
|
|
153
|
-
var isMobile = useIsMobile();
|
|
154
154
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ContentTop, {
|
|
155
155
|
closeDropdown: closeDropdown,
|
|
156
156
|
dataIdPrefix: dataIdPrefix,
|
|
@@ -89,11 +89,13 @@ import './MobileWrapper.js';
|
|
|
89
89
|
import './DesktopWrapper.js';
|
|
90
90
|
import '../SharedComponents/ButtonSelectWrapper/Button/Button.js';
|
|
91
91
|
|
|
92
|
-
var _excluded = ["options", "footerButtonProps", "selectedItems", "setSelectedItems", "name", "setFieldValue", "value", "label", "placeHolder", "isRequiredField", "labelAddons", "className", "disabled", "dropdownWidth", "align", "size", "isButtonSelect", "checkboxInfo", "translations", "hasError"];
|
|
92
|
+
var _excluded = ["isMobileFullScreen", "options", "footerButtonProps", "selectedItems", "setSelectedItems", "name", "setFieldValue", "value", "label", "placeHolder", "isRequiredField", "labelAddons", "className", "disabled", "dropdownWidth", "align", "size", "isButtonSelect", "checkboxInfo", "translations", "hasError"];
|
|
93
93
|
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; }
|
|
94
94
|
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; }
|
|
95
95
|
var MultiSelect = function MultiSelect(props) {
|
|
96
|
-
var
|
|
96
|
+
var _props$isMobileFullSc = props.isMobileFullScreen,
|
|
97
|
+
isMobileFullScreen = _props$isMobileFullSc === void 0 ? true : _props$isMobileFullSc,
|
|
98
|
+
options = props.options,
|
|
97
99
|
_props$footerButtonPr = props.footerButtonProps,
|
|
98
100
|
footerButtonProps = _props$footerButtonPr === void 0 ? {
|
|
99
101
|
confirm: {
|
|
@@ -203,7 +205,8 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
203
205
|
isRequiredField: isRequiredField,
|
|
204
206
|
overflowText: overflowText,
|
|
205
207
|
hasError: hasError,
|
|
206
|
-
applySelectedItems: applySelectedItems
|
|
208
|
+
applySelectedItems: applySelectedItems,
|
|
209
|
+
isMobile: isMobile && isMobileFullScreen
|
|
207
210
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(OptionsWrapper
|
|
208
211
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
209
212
|
// @ts-ignore
|
|
@@ -217,8 +220,9 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
217
220
|
selectedValues: selectedValues,
|
|
218
221
|
setSelectedValues: setSelectedValues,
|
|
219
222
|
containerRef: containerRef === null || containerRef === void 0 ? void 0 : containerRef.current,
|
|
220
|
-
dropdownWidth: dropdownWidth
|
|
221
|
-
|
|
223
|
+
dropdownWidth: dropdownWidth,
|
|
224
|
+
isMobileFullScreen: isMobileFullScreen
|
|
225
|
+
}, rest)), options.length && !(isMobile && isMobileFullScreen) ? /*#__PURE__*/React.createElement(Footer, {
|
|
222
226
|
checkboxInfo: checkboxInfo,
|
|
223
227
|
hasChange: hasChange,
|
|
224
228
|
buttonProps: footerButtonProps,
|
|
@@ -21,7 +21,6 @@ import { ContentTop } from '../../SharedComponents/ContentTop.js';
|
|
|
21
21
|
import '../../../Input/Input.js';
|
|
22
22
|
import { IconCaretDownFilled } from '../../../SVGIcons/IconCaretDownFilled.js';
|
|
23
23
|
import { IconCaretUpFilled } from '../../../SVGIcons/IconCaretUpFilled.js';
|
|
24
|
-
import { useIsMobile } from '../../../../hooks/useGetIsMobile.js';
|
|
25
24
|
import { DROPDOWN_MAX_HEIGHT } from '../../constants.js';
|
|
26
25
|
import '../../../../utils/helpers.js';
|
|
27
26
|
import '../../../Image/Image.js';
|
|
@@ -29,6 +28,7 @@ import '../../../../defineProperty-0885e8cf.js';
|
|
|
29
28
|
import '../../../../typeof-8ef57f3d.js';
|
|
30
29
|
import '../../../../objectWithoutProperties-df371a0b.js';
|
|
31
30
|
import '../../../../helperComponents/Loader/Loader.js';
|
|
31
|
+
import '../../../../hooks/useGetIsMobile.js';
|
|
32
32
|
import '../../../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
33
33
|
import '../../../../hooks/useOnOutsideClick.js';
|
|
34
34
|
import '../../../../hooks/useHideBodyScroll.js';
|
|
@@ -73,7 +73,8 @@ import 'react-number-format';
|
|
|
73
73
|
import '../../../SVGIcons/IconCheckmarkCircleFilled.js';
|
|
74
74
|
|
|
75
75
|
var MultiSelectGrouped = function MultiSelectGrouped(props) {
|
|
76
|
-
var
|
|
76
|
+
var isMobile = props.isMobile,
|
|
77
|
+
avatar = props.avatar,
|
|
77
78
|
options = props.options,
|
|
78
79
|
helperText = props.helperText,
|
|
79
80
|
translations = props.translations,
|
|
@@ -179,7 +180,6 @@ var MultiSelectGrouped = function MultiSelectGrouped(props) {
|
|
|
179
180
|
};
|
|
180
181
|
}, [avatar, labelLeftIconProps, optionRightIconComponent, labelRightIconComponent]);
|
|
181
182
|
var hasTopContent = isSearchAvailable || helperText;
|
|
182
|
-
var isMobile = useIsMobile();
|
|
183
183
|
return /*#__PURE__*/React.createElement(React.Fragment, null, hasTopContent ? /*#__PURE__*/React.createElement(ContentTop, {
|
|
184
184
|
closeDropdown: closeDropdown,
|
|
185
185
|
dataIdPrefix: dataIdPrefix,
|
|
@@ -13,6 +13,7 @@ type TProps = {
|
|
|
13
13
|
options: TSelectOptions;
|
|
14
14
|
selectedValues: TSelectedValue[];
|
|
15
15
|
setSelectedValues: (values: TSelectedValue[]) => void;
|
|
16
|
+
isMobileFullScreen: boolean;
|
|
16
17
|
};
|
|
17
18
|
export declare const OptionsWrapper: (props: TProps) => ReactElement;
|
|
18
19
|
export {};
|
|
@@ -18,6 +18,7 @@ import '../../Collapse/CollapseGroup/CollapseGroup.js';
|
|
|
18
18
|
import '../SharedComponents/ContentTop.js';
|
|
19
19
|
import { Loading } from '../SharedComponents/Loading.js';
|
|
20
20
|
import '../../Input/Input.js';
|
|
21
|
+
import { useIsMobile } from '../../../hooks/useGetIsMobile.js';
|
|
21
22
|
import { MultiSelectGrouped } from './MultiSelectGrouped/MultiSelectGrouped.js';
|
|
22
23
|
import { MultiBase } from './MultiBase/MultiBase.js';
|
|
23
24
|
import { MultiSelectWithTabs } from './MultiSelectWithTabs/MultiSelectWithTabs.js';
|
|
@@ -27,7 +28,6 @@ import '../../../typeof-8ef57f3d.js';
|
|
|
27
28
|
import 'dayjs';
|
|
28
29
|
import '../../../hooks/useGetElemPositions.js';
|
|
29
30
|
import '../../../helperComponents/Loader/Loader.js';
|
|
30
|
-
import '../../../hooks/useGetIsMobile.js';
|
|
31
31
|
import '../../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
32
32
|
import '../../../hooks/useOnOutsideClick.js';
|
|
33
33
|
import '../../../hooks/useHideBodyScroll.js';
|
|
@@ -81,7 +81,7 @@ import '../../Tab/Tab.js';
|
|
|
81
81
|
import '../../Tab/TabItem.js';
|
|
82
82
|
import '../../Badge/Badge.js';
|
|
83
83
|
|
|
84
|
-
var _excluded = ["isLoading", "withTabs", "isGrouped", "isOpen", "translations", "containerRef", "options", "selectedValues", "setSelectedValues", "setIsOpen", "dropdownRef"];
|
|
84
|
+
var _excluded = ["isLoading", "withTabs", "isGrouped", "isOpen", "translations", "containerRef", "options", "selectedValues", "setSelectedValues", "setIsOpen", "dropdownRef", "isMobileFullScreen"];
|
|
85
85
|
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; }
|
|
86
86
|
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; }
|
|
87
87
|
var OptionsWrapper = function OptionsWrapper(props) {
|
|
@@ -96,6 +96,7 @@ var OptionsWrapper = function OptionsWrapper(props) {
|
|
|
96
96
|
setSelectedValues = props.setSelectedValues,
|
|
97
97
|
setIsOpen = props.setIsOpen,
|
|
98
98
|
dropdownRef = props.dropdownRef,
|
|
99
|
+
isMobileFullScreen = props.isMobileFullScreen,
|
|
99
100
|
rest = _objectWithoutProperties(props, _excluded);
|
|
100
101
|
var _useGetElemSizes = useGetElemSizes(containerRef),
|
|
101
102
|
width = _useGetElemSizes.width;
|
|
@@ -136,6 +137,8 @@ var OptionsWrapper = function OptionsWrapper(props) {
|
|
|
136
137
|
element: dropdownRef,
|
|
137
138
|
input: inputRef.current
|
|
138
139
|
});
|
|
140
|
+
var _isMobile = useIsMobile();
|
|
141
|
+
var isMobile = _isMobile && isMobileFullScreen;
|
|
139
142
|
if (isLoading) {
|
|
140
143
|
return /*#__PURE__*/React.createElement(Loading, null);
|
|
141
144
|
}
|
|
@@ -145,6 +148,7 @@ var OptionsWrapper = function OptionsWrapper(props) {
|
|
|
145
148
|
, _extends({
|
|
146
149
|
options: options,
|
|
147
150
|
isOpen: isOpen,
|
|
151
|
+
isMobile: isMobile,
|
|
148
152
|
hasBottomSpace: hasBottomSpace,
|
|
149
153
|
translations: localizations,
|
|
150
154
|
selectedValues: selectedValues,
|
|
@@ -9,6 +9,8 @@ import { Input } from '../../Input/Input.js';
|
|
|
9
9
|
import { noop } from '../../../utils/helpers.js';
|
|
10
10
|
import { SELECTED_VISIBLE_MIN_COUNT } from '../constants.js';
|
|
11
11
|
import { SelectMobile } from './SelectMobile/index.js';
|
|
12
|
+
import { IconCaretUpFilled } from '../../SVGIcons/IconCaretUpFilled.js';
|
|
13
|
+
import { IconCaretDownFilled } from '../../SVGIcons/IconCaretDownFilled.js';
|
|
12
14
|
import '../../../consts/index.js';
|
|
13
15
|
import '../../../defineProperty-0885e8cf.js';
|
|
14
16
|
import '../../../typeof-8ef57f3d.js';
|
|
@@ -78,7 +80,7 @@ import '../SharedComponents/Loading.js';
|
|
|
78
80
|
import './helpers.js';
|
|
79
81
|
import './SelectMobile/MobileTopContent.js';
|
|
80
82
|
|
|
81
|
-
var _excluded = ["labelAddons", "dataId", "className", "size", "label", "hasError", "isValid", "disabled", "outerHelperText", "isRequiredField", "placeHolder", "selectRightIconProps", "selectRightIconOpenedProps", "options", "withSearch", "setSelectedItem", "setFieldValue", "name", "selectedItem", "value"];
|
|
83
|
+
var _excluded = ["labelAddons", "dataId", "className", "size", "label", "hasError", "isValid", "disabled", "outerHelperText", "isRequiredField", "placeHolder", "selectRightIconProps", "selectRightIconOpenedProps", "options", "withSearch", "setSelectedItem", "setFieldValue", "name", "selectedItem", "value", "isMobileFullScreen"];
|
|
82
84
|
var Select = function Select(props) {
|
|
83
85
|
var _selectedOption$optio, _selectedOption$optio2;
|
|
84
86
|
var labelAddons = props.labelAddons,
|
|
@@ -92,8 +94,16 @@ var Select = function Select(props) {
|
|
|
92
94
|
outerHelperText = props.outerHelperText,
|
|
93
95
|
isRequiredField = props.isRequiredField,
|
|
94
96
|
placeHolder = props.placeHolder,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
_props$selectRightIco = props.selectRightIconProps,
|
|
98
|
+
selectRightIconProps = _props$selectRightIco === void 0 ? {
|
|
99
|
+
Component: IconCaretDownFilled,
|
|
100
|
+
size: 'xsmall'
|
|
101
|
+
} : _props$selectRightIco,
|
|
102
|
+
_props$selectRightIco2 = props.selectRightIconOpenedProps,
|
|
103
|
+
selectRightIconOpenedProps = _props$selectRightIco2 === void 0 ? {
|
|
104
|
+
Component: IconCaretUpFilled,
|
|
105
|
+
size: 'xsmall'
|
|
106
|
+
} : _props$selectRightIco2,
|
|
97
107
|
options = props.options,
|
|
98
108
|
withSearch = props.withSearch,
|
|
99
109
|
setSelectedItem = props.setSelectedItem,
|
|
@@ -101,6 +111,8 @@ var Select = function Select(props) {
|
|
|
101
111
|
name = props.name,
|
|
102
112
|
selectedItem = props.selectedItem,
|
|
103
113
|
value = props.value,
|
|
114
|
+
_props$isMobileFullSc = props.isMobileFullScreen,
|
|
115
|
+
isMobileFullScreen = _props$isMobileFullSc === void 0 ? true : _props$isMobileFullSc,
|
|
104
116
|
rest = _objectWithoutProperties(props, _excluded);
|
|
105
117
|
var isMobile = useIsMobile();
|
|
106
118
|
var containerRef = useRef(null);
|
|
@@ -184,7 +196,7 @@ var Select = function Select(props) {
|
|
|
184
196
|
ref: inputRef,
|
|
185
197
|
labelAddons: labelAddons,
|
|
186
198
|
autoComplete: "false"
|
|
187
|
-
}), isMobile ? /*#__PURE__*/React.createElement(SelectMobile, _extends({}, rest, {
|
|
199
|
+
}), isMobile && isMobileFullScreen ? /*#__PURE__*/React.createElement(SelectMobile, _extends({}, rest, {
|
|
188
200
|
options: options,
|
|
189
201
|
isOpen: isOpen,
|
|
190
202
|
closeDropdown: closeDropdown,
|
|
@@ -9,7 +9,6 @@ import 'react-hook-form';
|
|
|
9
9
|
import { useChangePositionsOnScroll } from '../../../../hooks/useChangePositionsOnScroll.js';
|
|
10
10
|
import { MobileWrapper } from '../../MultiSelect/MobileWrapper.js';
|
|
11
11
|
import { DesktopWrapper } from '../../MultiSelect/DesktopWrapper.js';
|
|
12
|
-
import { useIsMobile } from '../../../../hooks/useGetIsMobile.js';
|
|
13
12
|
import '../../../Text/Text.js';
|
|
14
13
|
import 'dayjs';
|
|
15
14
|
import '../../../SVGIcons/IconCaretDownFilled.js';
|
|
@@ -23,6 +22,7 @@ import '../../../../Button-b1ed9ff6.js';
|
|
|
23
22
|
import '../../../../extends-3c4962fa.js';
|
|
24
23
|
import '../../../../objectWithoutProperties-df371a0b.js';
|
|
25
24
|
import '../../../../helperComponents/Loader/Loader.js';
|
|
25
|
+
import '../../../../hooks/useGetIsMobile.js';
|
|
26
26
|
import 'framer-motion';
|
|
27
27
|
import '../../../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
28
28
|
import '../../../../hooks/useOnOutsideClick.js';
|
|
@@ -61,7 +61,8 @@ var ButtonSelectWrapper = function ButtonSelectWrapper(props) {
|
|
|
61
61
|
modalApplyButtonText = props.modalApplyButtonText,
|
|
62
62
|
_props$type = props.type,
|
|
63
63
|
type = _props$type === void 0 ? 'secondary' : _props$type,
|
|
64
|
-
applySelectedItems = props.applySelectedItems
|
|
64
|
+
applySelectedItems = props.applySelectedItems,
|
|
65
|
+
isMobile = props.isMobile;
|
|
65
66
|
var buttonRef = useRef(null);
|
|
66
67
|
var openDropdown = function openDropdown() {
|
|
67
68
|
return setIsOpen(true);
|
|
@@ -78,7 +79,6 @@ var ButtonSelectWrapper = function ButtonSelectWrapper(props) {
|
|
|
78
79
|
return " ".concat(selectedValues[0].label, " +").concat(selectedValues.length - 1);
|
|
79
80
|
}, [selectedValues]);
|
|
80
81
|
useChangePositionsOnScroll(buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current, dropdownRef, hasBottomSpace);
|
|
81
|
-
var isMobile = useIsMobile();
|
|
82
82
|
return /*#__PURE__*/React.createElement("div", {
|
|
83
83
|
className: classNames("select select--".concat(size), className),
|
|
84
84
|
ref: setContainerRef
|
|
@@ -10,7 +10,6 @@ import 'react-hook-form';
|
|
|
10
10
|
import { useChangePositionsOnScroll } from '../../../../hooks/useChangePositionsOnScroll.js';
|
|
11
11
|
import { IconCaretDownFilled } from '../../../SVGIcons/IconCaretDownFilled.js';
|
|
12
12
|
import { IconCaretUpFilled } from '../../../SVGIcons/IconCaretUpFilled.js';
|
|
13
|
-
import { useIsMobile } from '../../../../hooks/useGetIsMobile.js';
|
|
14
13
|
import { MobileWrapper } from '../../MultiSelect/MobileWrapper.js';
|
|
15
14
|
import { DesktopWrapper } from '../../MultiSelect/DesktopWrapper.js';
|
|
16
15
|
import '../../../../defineProperty-0885e8cf.js';
|
|
@@ -28,6 +27,7 @@ import '../../../../helperComponents/IconDynamicComponent/constants.js';
|
|
|
28
27
|
import '../../../../Button-b1ed9ff6.js';
|
|
29
28
|
import '../../../../helperComponents/Loader/Loader.js';
|
|
30
29
|
import '../../../../slicedToArray-e4c84516.js';
|
|
30
|
+
import '../../../../hooks/useGetIsMobile.js';
|
|
31
31
|
import 'framer-motion';
|
|
32
32
|
import '../../../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
33
33
|
import '../../../../hooks/useOnOutsideClick.js';
|
|
@@ -47,7 +47,8 @@ import '../../../Button/consts.js';
|
|
|
47
47
|
import '../../../SVGIcons/IconCheckmarkCircleFilled.js';
|
|
48
48
|
|
|
49
49
|
var InputSelectWrapper = function InputSelectWrapper(props) {
|
|
50
|
-
var
|
|
50
|
+
var isMobile = props.isMobile,
|
|
51
|
+
children = props.children,
|
|
51
52
|
options = props.options,
|
|
52
53
|
label = props.label,
|
|
53
54
|
placeHolder = props.placeHolder,
|
|
@@ -104,7 +105,6 @@ var InputSelectWrapper = function InputSelectWrapper(props) {
|
|
|
104
105
|
}),
|
|
105
106
|
hasBottomSpace = _useGetHasBottomSpace.hasBottomSpace;
|
|
106
107
|
useChangePositionsOnScroll(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current, dropdownRef, hasBottomSpace);
|
|
107
|
-
var isMobile = useIsMobile();
|
|
108
108
|
return /*#__PURE__*/React.createElement("div", {
|
|
109
109
|
className: classNames('select select--multi', className),
|
|
110
110
|
ref: setContainerRef
|
|
@@ -82,10 +82,10 @@ import './constants.js';
|
|
|
82
82
|
import './Select/helpers.js';
|
|
83
83
|
import './Select/SelectMobile/index.js';
|
|
84
84
|
import './Select/SelectMobile/MobileTopContent.js';
|
|
85
|
+
import '../SVGIcons/IconCaretUpFilled.js';
|
|
86
|
+
import '../SVGIcons/IconCaretDownFilled.js';
|
|
85
87
|
import './MultiSelect/OptionsWrapper.js';
|
|
86
88
|
import './MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js';
|
|
87
|
-
import '../SVGIcons/IconCaretDownFilled.js';
|
|
88
|
-
import '../SVGIcons/IconCaretUpFilled.js';
|
|
89
89
|
import './MultiSelect/MultiBase/MultiBase.js';
|
|
90
90
|
import './MultiSelect/MultiSelectWithTabs/MultiSelectWithTabs.js';
|
|
91
91
|
import '../Tab/Tab.js';
|
|
@@ -48,6 +48,7 @@ export type TSelectTranslations = {
|
|
|
48
48
|
innerLabel?: string;
|
|
49
49
|
};
|
|
50
50
|
interface TMultiSelectCompProps extends IFormCompProps, TSelectBaseProps {
|
|
51
|
+
isMobile: boolean;
|
|
51
52
|
maxSelectCount: number;
|
|
52
53
|
isSearchAvailable: boolean;
|
|
53
54
|
helperText?: string;
|
|
@@ -73,6 +74,7 @@ export type TCheckboxInfo = {
|
|
|
73
74
|
isChecked: boolean;
|
|
74
75
|
};
|
|
75
76
|
export interface TMultiSelectPropTypes extends IFormCompProps, TSelectBaseProps {
|
|
77
|
+
isMobileFullScreen?: boolean;
|
|
76
78
|
dropdownWidth?: number;
|
|
77
79
|
align?: 'left' | 'right';
|
|
78
80
|
helperText?: string;
|
|
@@ -94,6 +96,7 @@ export interface TMultiSelectPropTypes extends IFormCompProps, TSelectBaseProps
|
|
|
94
96
|
isButtonSelect?: boolean;
|
|
95
97
|
}
|
|
96
98
|
export interface TButtonSelectPropTypes extends IFormCompProps, TSelectBaseProps {
|
|
99
|
+
isMobileFullScreen?: boolean;
|
|
97
100
|
dataId?: string;
|
|
98
101
|
options: TSelectOptions;
|
|
99
102
|
selectedItem?: TItemValue;
|
|
@@ -109,6 +112,7 @@ export interface TButtonSelectPropTypes extends IFormCompProps, TSelectBaseProps
|
|
|
109
112
|
type: 'secondary' | 'tertiary';
|
|
110
113
|
}
|
|
111
114
|
export interface TSingleSelectPropTypes extends IFormCompProps, TSelectBaseProps {
|
|
115
|
+
isMobileFullScreen?: boolean;
|
|
112
116
|
options: TSelectOptions;
|
|
113
117
|
selectedItem?: TItemValue;
|
|
114
118
|
setSelectedItem?: (items: TItemValue | undefined) => void;
|
|
@@ -219,6 +223,7 @@ export interface TFilterGroupDropdownContentProps extends IFormCompProps {
|
|
|
219
223
|
checkIsSelected: (item: TItemValue) => boolean;
|
|
220
224
|
}
|
|
221
225
|
export type TSelectWrapperProps = {
|
|
226
|
+
isMobile: boolean;
|
|
222
227
|
applySelectedItems: (isChecked: boolean) => void;
|
|
223
228
|
hasError?: boolean;
|
|
224
229
|
children: ReactElement;
|
package/helpers/format-date.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const formatDate: (value: string | Date | null | undefined, format: string) => string;
|
|
1
|
+
export declare const formatDate: (value: string | Date | null | undefined, format: string, defaultValue?: string) => string;
|
package/helpers/format-date.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
|
+
import { getDayJSLocale } from './locale.js';
|
|
3
|
+
import '../type/locale.js';
|
|
4
|
+
import './storage.js';
|
|
2
5
|
|
|
3
6
|
var formatDate = function formatDate(value, format) {
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
8
|
+
var isValid = dayjs(value).isValid();
|
|
9
|
+
if (!isValid) {
|
|
10
|
+
return defaultValue;
|
|
6
11
|
}
|
|
7
|
-
return dayjs(value).format(format);
|
|
12
|
+
return dayjs(value).locale(getDayJSLocale()).format(format);
|
|
8
13
|
};
|
|
9
14
|
|
|
10
15
|
export { formatDate };
|
package/helpers/index.d.ts
CHANGED
package/helpers/index.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TranslationLocale, DayJSLocale } from '../type/locale.js';
|
|
2
|
+
import { getLocalStorageItem } from './storage.js';
|
|
3
|
+
|
|
4
|
+
var getActiveLanguageCode = function getActiveLanguageCode() {
|
|
5
|
+
return getLocalStorageItem('selectedLanguage') || 'en-US';
|
|
6
|
+
};
|
|
7
|
+
var getTranslationLocale = function getTranslationLocale() {
|
|
8
|
+
var activeLangCode = getActiveLanguageCode();
|
|
9
|
+
return TranslationLocale[activeLangCode] || 'en';
|
|
10
|
+
};
|
|
11
|
+
var getDayJSLocale = function getDayJSLocale() {
|
|
12
|
+
var activeLangCode = getActiveLanguageCode();
|
|
13
|
+
return DayJSLocale[activeLangCode] || 'en';
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { getActiveLanguageCode, getDayJSLocale, getTranslationLocale };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var getLocalStorageItem = function getLocalStorageItem(key) {
|
|
2
|
+
var storedValue = localStorage.getItem(key);
|
|
3
|
+
if (!storedValue) {
|
|
4
|
+
return storedValue;
|
|
5
|
+
}
|
|
6
|
+
try {
|
|
7
|
+
return JSON.parse(storedValue);
|
|
8
|
+
} catch (e) {
|
|
9
|
+
return storedValue;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var setLocalStorageItem = function setLocalStorageItem(key, value) {
|
|
13
|
+
if (typeof value === 'string') {
|
|
14
|
+
localStorage.setItem(key, value);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { getLocalStorageItem, setLocalStorageItem };
|
package/index.js
CHANGED
|
@@ -408,6 +408,9 @@ import './components/DatePicker/RangeDatePicker/RangeDatePickerDesktop.js';
|
|
|
408
408
|
import './components/DatePicker/types.js';
|
|
409
409
|
import './components/DatePicker/RangeDatePicker/RangeDatePickerMobile.js';
|
|
410
410
|
import './helpers/format-date.js';
|
|
411
|
+
import './helpers/locale.js';
|
|
412
|
+
import './type/locale.js';
|
|
413
|
+
import './helpers/storage.js';
|
|
411
414
|
import '@hookform/resolvers';
|
|
412
415
|
import '@hookform/error-message';
|
|
413
416
|
import 'react-paginate';
|
package/package.json
CHANGED
package/type/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './locale';
|
package/type/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DayJSLocale, TranslationLocale } from './locale.js';
|
package/type/locale.d.ts
ADDED
package/type/locale.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var TranslationLocale = /*#__PURE__*/function (TranslationLocale) {
|
|
2
|
+
TranslationLocale["en-US"] = "en";
|
|
3
|
+
TranslationLocale["hy-AM"] = "hy";
|
|
4
|
+
TranslationLocale["ru-RU"] = "ru";
|
|
5
|
+
return TranslationLocale;
|
|
6
|
+
}({});
|
|
7
|
+
var DayJSLocale = /*#__PURE__*/function (DayJSLocale) {
|
|
8
|
+
DayJSLocale["en-US"] = "en";
|
|
9
|
+
DayJSLocale["hy-AM"] = "hy-am";
|
|
10
|
+
DayJSLocale["ru-RU"] = "ru";
|
|
11
|
+
return DayJSLocale;
|
|
12
|
+
}({});
|
|
13
|
+
|
|
14
|
+
export { DayJSLocale, TranslationLocale };
|