@dreamcommerce/aurora 2.4.2 → 2.4.3-10
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/build/cjs/packages/aurora/src/components/controls/hoc/control_cell_selector/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_checkbox/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_checkbox_switch/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_color_picker/index.js +3 -3
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_date_picker/index.js +4 -4
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_file_picker/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_input/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_multi_select/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_radio/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_radio_group/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_range/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_select/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_tags_selector/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_textarea/index.js +2 -2
- package/build/cjs/packages/aurora/src/components/date_picker/components/common_ranges.js +1 -1
- package/build/cjs/packages/aurora/src/components/date_picker/components/days_grid.js +1 -1
- package/build/cjs/packages/aurora/src/components/date_picker/components/label.js +2 -2
- package/build/cjs/packages/aurora/src/components/date_picker/components/month_controller.js +3 -3
- package/build/cjs/packages/aurora/src/components/date_picker/components/month_year_picker/components/month_view.js +2 -2
- package/build/cjs/packages/aurora/src/components/date_picker/components/month_year_picker/components/month_year_controller.js +1 -1
- package/build/cjs/packages/aurora/src/components/date_picker/components/month_year_picker/components/month_year_picker_context_manager.js +1 -1
- package/build/cjs/packages/aurora/src/components/date_picker/components/month_year_picker/components/years_view.js +2 -2
- package/build/cjs/packages/aurora/src/components/date_picker/components/pure_date_picker.js +2 -2
- package/build/cjs/packages/aurora/src/components/date_picker/components/single_day.js +2 -2
- package/build/cjs/packages/aurora/src/components/date_picker/hoc/range_picker.js +2 -2
- package/build/cjs/packages/aurora/src/components/date_picker/hoc/single_date_picker.js +1 -1
- package/build/cjs/packages/aurora/src/components/date_picker/index.js +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/components/content.js +70 -26
- package/build/cjs/packages/aurora/src/components/dropdown/components/content.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/components/option_multiple.js +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/components/select.js +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/css_classes.js +6 -2
- package/build/cjs/packages/aurora/src/components/dropdown/css_classes.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/utilities.js +5 -1
- package/build/cjs/packages/aurora/src/components/dropdown/utilities.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/hint/index.js +19 -15
- package/build/cjs/packages/aurora/src/components/hint/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/tooltip/css_classes.js +10 -0
- package/build/cjs/packages/aurora/src/components/tooltip/css_classes.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/tooltip/index.js +18 -14
- package/build/cjs/packages/aurora/src/components/tooltip/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/css/date_picker/main.module.less.js +2 -2
- package/build/cjs/packages/aurora/src/css/dropdown/main.module.less.js +2 -2
- package/build/cjs/packages/aurora/src/css/hint/main.module.less.js +3 -3
- package/build/cjs/packages/aurora/src/css/tooltip/main.module.less.js +2 -2
- package/build/cjs/packages/aurora/src/index.js +10 -10
- package/build/esm/packages/aurora/src/components/controls/hoc/control_cell_selector/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_checkbox/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_checkbox_switch/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_color_picker/index.js +3 -3
- package/build/esm/packages/aurora/src/components/controls/hoc/control_date_picker/index.js +4 -4
- package/build/esm/packages/aurora/src/components/controls/hoc/control_file_picker/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_input/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_multi_select/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_radio/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_radio_group/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_range/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_select/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_tags_selector/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_textarea/index.js +2 -2
- package/build/esm/packages/aurora/src/components/controls/types.d.ts +1 -5
- package/build/esm/packages/aurora/src/components/controls/types.js +1 -1
- package/build/esm/packages/aurora/src/components/controls/types.js.map +1 -1
- package/build/esm/packages/aurora/src/components/date_picker/components/common_ranges.js +2 -2
- package/build/esm/packages/aurora/src/components/date_picker/components/days_grid.js +4 -4
- package/build/esm/packages/aurora/src/components/date_picker/components/label.js +3 -3
- package/build/esm/packages/aurora/src/components/date_picker/components/month_controller.js +7 -7
- package/build/esm/packages/aurora/src/components/date_picker/components/month_year_picker/components/month_view.js +3 -3
- package/build/esm/packages/aurora/src/components/date_picker/components/month_year_picker/components/month_year_controller.js +5 -5
- package/build/esm/packages/aurora/src/components/date_picker/components/month_year_picker/components/month_year_picker_context_manager.js +1 -1
- package/build/esm/packages/aurora/src/components/date_picker/components/month_year_picker/components/years_view.js +3 -3
- package/build/esm/packages/aurora/src/components/date_picker/components/pure_date_picker.js +4 -4
- package/build/esm/packages/aurora/src/components/date_picker/components/single_day.js +4 -4
- package/build/esm/packages/aurora/src/components/date_picker/hoc/range_picker.js +4 -4
- package/build/esm/packages/aurora/src/components/date_picker/hoc/single_date_picker.js +2 -2
- package/build/esm/packages/aurora/src/components/date_picker/index.js +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/content.js +71 -28
- package/build/esm/packages/aurora/src/components/dropdown/components/content.js.map +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/option_multiple.js +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/select.js +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/css_classes.d.ts +2 -0
- package/build/esm/packages/aurora/src/components/dropdown/css_classes.js +5 -3
- package/build/esm/packages/aurora/src/components/dropdown/css_classes.js.map +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/types.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/dropdown/utilities.d.ts +2 -1
- package/build/esm/packages/aurora/src/components/dropdown/utilities.js +5 -2
- package/build/esm/packages/aurora/src/components/dropdown/utilities.js.map +1 -1
- package/build/esm/packages/aurora/src/components/hint/index.d.ts +3 -3
- package/build/esm/packages/aurora/src/components/hint/index.js +21 -17
- package/build/esm/packages/aurora/src/components/hint/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/tooltip/css_classes.d.ts +2 -0
- package/build/esm/packages/aurora/src/components/tooltip/css_classes.js +5 -0
- package/build/esm/packages/aurora/src/components/tooltip/css_classes.js.map +1 -0
- package/build/esm/packages/aurora/src/components/tooltip/index.js +18 -14
- package/build/esm/packages/aurora/src/components/tooltip/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/tooltip/tooltip_types.d.ts +3 -3
- package/build/esm/packages/aurora/src/components/tooltip/tooltip_types.js +1 -0
- package/build/esm/packages/aurora/src/components/tooltip/tooltip_types.js.map +1 -1
- package/build/esm/packages/aurora/src/css/date_picker/main.module.less.js +2 -2
- package/build/esm/packages/aurora/src/css/dropdown/main.module.less.js +2 -2
- package/build/esm/packages/aurora/src/css/hint/main.module.less.js +3 -3
- package/build/esm/packages/aurora/src/css/tooltip/main.module.less.js +2 -2
- package/build/esm/packages/aurora/src/hooks/use_fixed_child_position.js +31 -34
- package/build/esm/packages/aurora/src/hooks/use_fixed_child_position.js.map +1 -1
- package/build/esm/packages/aurora/src/index.js +5 -5
- package/package.json +1 -1
- package/build/cjs/packages/aurora/src/hooks/use_fixed_child_position.js +0 -40
- package/build/cjs/packages/aurora/src/hooks/use_fixed_child_position.js.map +0 -1
|
@@ -18,11 +18,11 @@ import Select from '../../../dropdown/hoc/select/index.js';
|
|
|
18
18
|
* />
|
|
19
19
|
* )
|
|
20
20
|
*/
|
|
21
|
-
const ControlSelect = ({ label, isRequired, id, name, defaultValues, options, isWithGroups, isWithSearch, defaultIsOpen, defaultCloseOnClick, isReadonly, isDisabled, onChange, onToggle, errors, hint,
|
|
21
|
+
const ControlSelect = ({ label, isRequired, id, name, defaultValues, options, isWithGroups, isWithSearch, defaultIsOpen, defaultCloseOnClick, isReadonly, isDisabled, onChange, onToggle, errors, hint, placeholder, additionalInfo, onScroll, innerAdditionalContent, hasCloseIcon, labelAdditionalInfo }) => {
|
|
22
22
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
23
23
|
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
24
24
|
label,
|
|
25
|
-
hint && React.createElement(Hint, {
|
|
25
|
+
hint && React.createElement(Hint, { hint: hint, spacingLeft: true }))),
|
|
26
26
|
React.createElement(Control.Content, null,
|
|
27
27
|
React.createElement(Control.Element, null,
|
|
28
28
|
React.createElement(Select, { key: name, name: name, options: options, defaultValues: defaultValues, isWithGroups: isWithGroups, isWithSearch: isWithSearch, defaultIsOpen: defaultIsOpen, defaultCloseOnClick: defaultCloseOnClick, isReadonly: isReadonly, isDisabled: isDisabled, placeholder: placeholder, onChange: onChange, onToggle: onToggle, onScroll: onScroll, innerAdditionalContent: innerAdditionalContent, hasCloseIcon: hasCloseIcon }))),
|
package/build/esm/packages/aurora/src/components/controls/hoc/control_tags_selector/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import Control from '../../index.js';
|
|
|
3
3
|
import Hint from '../../../hint/index.js';
|
|
4
4
|
import TagsSelector from '../../../tags_selector/index.js';
|
|
5
5
|
|
|
6
|
-
const ControlTagsSelector = ({ id, name, label, isRequired, placeholder, minTagLength, withList, defaultTags, defaultListTags, onChange, onListItemClick, errors, hint,
|
|
6
|
+
const ControlTagsSelector = ({ id, name, label, isRequired, placeholder, minTagLength, withList, defaultTags, defaultListTags, onChange, onListItemClick, errors, hint, labelAdditionalInfo }) => {
|
|
7
7
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
8
8
|
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
9
9
|
label,
|
|
10
|
-
hint && React.createElement(Hint, {
|
|
10
|
+
hint && React.createElement(Hint, { hint: hint, spacingLeft: true }))),
|
|
11
11
|
React.createElement(Control.Content, null,
|
|
12
12
|
React.createElement(Control.Element, null,
|
|
13
13
|
React.createElement(TagsSelector, { id: id, name: name, placeholder: placeholder, minTagLength: minTagLength, withList: withList, defaultTags: defaultTags, tagsListValue: defaultListTags, onChange: onChange, onListItemClick: onListItemClick }))),
|
|
@@ -17,11 +17,11 @@ import Hint from '../../../hint/index.js';
|
|
|
17
17
|
* />
|
|
18
18
|
* )
|
|
19
19
|
*/
|
|
20
|
-
const ControlTextarea = React.forwardRef(({ label, isRequired, id, name, value, defaultValue, placeholder, disabled, readOnly, onChange, onFocus, onBlur, onKeyPress, errors, hint,
|
|
20
|
+
const ControlTextarea = React.forwardRef(({ label, isRequired, id, name, value, defaultValue, placeholder, disabled, readOnly, onChange, onFocus, onBlur, onKeyPress, errors, hint, labelAdditionalInfo }, ref) => {
|
|
21
21
|
return (React.createElement(Control, { errors: errors, name: name, id: id },
|
|
22
22
|
(label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
|
|
23
23
|
label,
|
|
24
|
-
hint && React.createElement(Hint, {
|
|
24
|
+
hint && React.createElement(Hint, { hint: hint, spacingLeft: true }))),
|
|
25
25
|
React.createElement(Control.Content, null,
|
|
26
26
|
React.createElement(Control.Element, null,
|
|
27
27
|
React.createElement(Control.Textarea, { id: id, name: name, value: value, defaultValue: defaultValue, placeholder: placeholder, disabled: disabled, readOnly: readOnly, onChange: onChange, onFocus: onFocus, onBlur: onBlur, onKeyPress: onKeyPress, ref: ref }))),
|
|
@@ -3,8 +3,8 @@ import { IMultiSelectProps, ISelectProps } from "../dropdown/types";
|
|
|
3
3
|
import { IColorPickerProps } from "../color_picker/types";
|
|
4
4
|
import { IFilePicker } from "../file_picker/types";
|
|
5
5
|
import { IRange } from "../range/types";
|
|
6
|
-
import { TVerticalPosition } from "../../typings/general";
|
|
7
6
|
import React from 'react';
|
|
7
|
+
import { TVerticalPosition } from "../../typings/general";
|
|
8
8
|
export declare type TControlErrors = string[] | null | undefined;
|
|
9
9
|
export interface IControlContext {
|
|
10
10
|
errors?: TControlErrors;
|
|
@@ -33,13 +33,9 @@ export interface IControlProps {
|
|
|
33
33
|
interface IControlCommonProps {
|
|
34
34
|
errors?: TControlErrors;
|
|
35
35
|
hint?: string;
|
|
36
|
-
hintOptions?: TControlHintOptions;
|
|
37
36
|
isRequired?: boolean;
|
|
38
37
|
additionalInfo?: string | ReactNode;
|
|
39
38
|
}
|
|
40
|
-
interface TControlHintOptions {
|
|
41
|
-
isFixed: boolean;
|
|
42
|
-
}
|
|
43
39
|
export interface IContentProps {
|
|
44
40
|
children: ReactNode;
|
|
45
41
|
}
|
|
@@ -3,6 +3,6 @@ import '@auroraComponents/dropdown/types';
|
|
|
3
3
|
import '@auroraComponents/color_picker/types';
|
|
4
4
|
import '@auroraComponents/file_picker/types';
|
|
5
5
|
import '@auroraComponents/range/types';
|
|
6
|
-
import '@auroraTypings/general';
|
|
7
6
|
import 'react';
|
|
7
|
+
import '@auroraTypings/general';
|
|
8
8
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/controls/types.ts"],"names":[],"mappings":"AAAA,OAA4F,OAAO,CAAC;AACpG,OAAgD,kCAAkC,CAAC;AAEnF,OAAkC,sCAAsC,CAAC;AACzE,OAA4B,qCAAqC,CAAC;AAClE,OAAuB,+BAA+B,CAAC;AACvD,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/controls/types.ts"],"names":[],"mappings":"AAAA,OAA4F,OAAO,CAAC;AACpG,OAAgD,kCAAkC,CAAC;AAEnF,OAAkC,sCAAsC,CAAC;AACzE,OAA4B,qCAAqC,CAAC;AAClE,OAAuB,+BAA+B,CAAC;AACvD,OAAkB,OAAO,CAAC;AAC1B,OAAkC,wBAAwB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useContext, useRef } from 'react';
|
|
2
2
|
import { useTranslation } from '../../../../../../external/react-i18next/dist/es/useTranslation.js';
|
|
3
3
|
import DatepickerContext from '../context/value_controller_context.js';
|
|
4
|
+
import styles from '../../../css/date_picker/main.module.less.js';
|
|
4
5
|
import { cssDatePickerCommonRanges } from '../css_classes.js';
|
|
5
|
-
import cssClasses from '../../../css/date_picker/main.module.less.js';
|
|
6
6
|
import Select from '../../dropdown/hoc/select/index.js';
|
|
7
7
|
import { getRanges } from '../utilities.js';
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ const CommonRanges = () => {
|
|
|
15
15
|
const onChange = ({ value }) => {
|
|
16
16
|
setValue(dateRanges[value]);
|
|
17
17
|
};
|
|
18
|
-
return (React.createElement("div", { className:
|
|
18
|
+
return (React.createElement("div", { className: styles[cssDatePickerCommonRanges], ref: ref },
|
|
19
19
|
React.createElement(Select, { name: "common-ranges", options: availableOptions, onChange: onChange, portalContainer: ref })));
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import DatepickerContext from '../context/value_controller_context.js';
|
|
3
3
|
import MonthYearNavigationContext from '../context/month_year_navigation_context.js';
|
|
4
|
+
import styles from '../../../css/date_picker/main.module.less.js';
|
|
4
5
|
import { cssDatePickerDaysGrid, cssDatePickerDaysGridRow, cssDatePickerDaysGridWeekName } from '../css_classes.js';
|
|
5
|
-
import cssClasses from '../../../css/date_picker/main.module.less.js';
|
|
6
6
|
import SingleDay from './single_day.js';
|
|
7
7
|
import useDateNames from '../hooks/use_date_names.js';
|
|
8
8
|
|
|
@@ -12,9 +12,9 @@ const DaysGrid = () => {
|
|
|
12
12
|
const firstWeekDay = (new Date(year, month, 1).getDay() + 6) % 7;
|
|
13
13
|
const { updateDate } = useContext(DatepickerContext);
|
|
14
14
|
const { weekNameShortcuts } = useDateNames();
|
|
15
|
-
return (React.createElement("div", { className:
|
|
16
|
-
React.createElement("div", { className:
|
|
17
|
-
React.createElement("div", { className: `${
|
|
15
|
+
return (React.createElement("div", { className: styles[cssDatePickerDaysGrid] },
|
|
16
|
+
React.createElement("div", { className: styles[cssDatePickerDaysGridRow] }, weekNameShortcuts.map((weekName, index) => (React.createElement("div", { className: styles[cssDatePickerDaysGridWeekName], key: `week-name-${index}` }, weekName)))),
|
|
17
|
+
React.createElement("div", { className: `${styles[cssDatePickerDaysGridRow]} ${animationClassName}` },
|
|
18
18
|
Array.from(Array(firstWeekDay).keys()).map((_, index) => (React.createElement("div", { key: `empty-day-${index}` }))),
|
|
19
19
|
Array.from(Array(daysInMonth).keys()).map((_, index) => (React.createElement(SingleDay, { date: index + 1, month: month, year: year, updateDate: updateDate, key: `day-${index}` }))))));
|
|
20
20
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import InputWrapper from '../../controls/components/input_wrapper.js';
|
|
3
3
|
import DatepickerContext from '../context/value_controller_context.js';
|
|
4
|
-
import
|
|
4
|
+
import styles from '../../../css/date_picker/main.module.less.js';
|
|
5
5
|
import { cssDatePickerLabelIcon } from '../css_classes.js';
|
|
6
|
-
import
|
|
6
|
+
import IconCalendar from '../../../assets/icon_calendar.js';
|
|
7
7
|
|
|
8
8
|
const DatepickerLabel = ({ name }) => {
|
|
9
9
|
const { readable, inputValue } = useContext(DatepickerContext);
|
|
10
10
|
return (React.createElement(React.Fragment, null,
|
|
11
|
-
React.createElement(InputWrapper, { value: readable, preElements: React.createElement(IconCalendar, { className:
|
|
11
|
+
React.createElement(InputWrapper, { value: readable, preElements: React.createElement(IconCalendar, { className: styles[cssDatePickerLabelIcon] }) }),
|
|
12
12
|
React.createElement("input", { type: "hidden", name: name, value: inputValue })));
|
|
13
13
|
};
|
|
14
14
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useContext, useRef } from 'react';
|
|
2
2
|
import Dropdown from '../../dropdown/index.js';
|
|
3
|
-
import MonthYearNavigationContext from '../context/month_year_navigation_context.js';
|
|
4
|
-
import { cssDatePickerController, cssDatePickerControllerArrow, cssDatePickerControllerArrowLeft, cssDatePickerControllerTitle, cssDatePickerControllerArrowRight } from '../css_classes.js';
|
|
5
|
-
import cssClasses from '../../../css/date_picker/main.module.less.js';
|
|
6
3
|
import { DATE_PICKER_TEST_ID } from '../constants.js';
|
|
4
|
+
import MonthYearNavigationContext from '../context/month_year_navigation_context.js';
|
|
7
5
|
import { useKeyboardNavigation } from '../hooks/use_keyboard_navigation.js';
|
|
6
|
+
import styles from '../../../css/date_picker/main.module.less.js';
|
|
7
|
+
import { cssDatePickerController, cssDatePickerControllerArrow, cssDatePickerControllerArrowLeft, cssDatePickerControllerTitle, cssDatePickerControllerArrowRight } from '../css_classes.js';
|
|
8
8
|
import useDateNames from '../hooks/use_date_names.js';
|
|
9
9
|
import MonthYearPicker from './month_year_picker/index.js';
|
|
10
10
|
|
|
@@ -13,14 +13,14 @@ const MonthController = ({ month, year }) => {
|
|
|
13
13
|
const { monthNames } = useDateNames();
|
|
14
14
|
const controllerRef = useRef(null);
|
|
15
15
|
useKeyboardNavigation();
|
|
16
|
-
return (React.createElement("div", { className: `${
|
|
17
|
-
React.createElement("div", { onClick: previousMonth, className: `${
|
|
18
|
-
React.createElement("div", { className:
|
|
16
|
+
return (React.createElement("div", { className: `${styles[cssDatePickerController]}`, ref: controllerRef, "data-test-id": DATE_PICKER_TEST_ID.controller },
|
|
17
|
+
React.createElement("div", { onClick: previousMonth, className: `${styles[cssDatePickerControllerArrow]} ${styles[cssDatePickerControllerArrowLeft]}`, "data-test-id": DATE_PICKER_TEST_ID.arrowLeft }),
|
|
18
|
+
React.createElement("div", { className: styles[cssDatePickerControllerTitle] },
|
|
19
19
|
React.createElement(Dropdown, null,
|
|
20
20
|
React.createElement(Dropdown.Label, { cssClass: animationClassName, label: `${monthNames[month]} ${year}` }),
|
|
21
21
|
React.createElement(Dropdown.Content, { portalContainer: controllerRef },
|
|
22
22
|
React.createElement(MonthYearPicker, { month: month, year: year })))),
|
|
23
|
-
React.createElement("div", { onClick: nextMonth, className: `${
|
|
23
|
+
React.createElement("div", { onClick: nextMonth, className: `${styles[cssDatePickerControllerArrow]} ${styles[cssDatePickerControllerArrowRight]}`, "data-test-id": DATE_PICKER_TEST_ID.arrowRight })));
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export default MonthController;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { DropdownContext } from '../../../../dropdown/context/index.js';
|
|
3
|
+
import { MONTHS_IN_YEAR } from '../../../constants.js';
|
|
3
4
|
import MonthYearNavigationContext from '../../../context/month_year_navigation_context.js';
|
|
5
|
+
import styles from '../../../../../css/date_picker/main.module.less.js';
|
|
4
6
|
import { cssDatePickerMonthTable, cssDatePickerMonthTableItem, cssDatePickerMonthTableItemSelected } from '../../../css_classes.js';
|
|
5
|
-
import cssClasses from '../../../../../css/date_picker/main.module.less.js';
|
|
6
|
-
import { MONTHS_IN_YEAR } from '../../../constants.js';
|
|
7
7
|
import useDateNames from '../../../hooks/use_date_names.js';
|
|
8
8
|
|
|
9
9
|
const MonthView = () => {
|
|
@@ -14,7 +14,7 @@ const MonthView = () => {
|
|
|
14
14
|
setMonth(monthIndex);
|
|
15
15
|
toggleDropdown === null || toggleDropdown === void 0 ? void 0 : toggleDropdown();
|
|
16
16
|
};
|
|
17
|
-
return (React.createElement("div", { className:
|
|
17
|
+
return (React.createElement("div", { className: styles[cssDatePickerMonthTable] }, Array.from(Array(MONTHS_IN_YEAR).keys()).map((index) => (React.createElement("span", { key: `month-picker-month-${index}`, onClick: onMonthClick(index), className: `${styles[cssDatePickerMonthTableItem]} ${index === month ? styles[cssDatePickerMonthTableItemSelected] : ''}` }, monthNameShortcuts[index])))));
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export default MonthView;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
+
import styles from '../../../../../css/date_picker/main.module.less.js';
|
|
2
3
|
import { cssDatePickerController, cssDatePickerControllerArrow, cssDatePickerControllerArrowLeft, cssDatePickerControllerTitle, cssDatePickerControllerArrowRight } from '../../../css_classes.js';
|
|
3
|
-
import cssClasses from '../../../../../css/date_picker/main.module.less.js';
|
|
4
4
|
import { MonthYearPickerContext } from '../context.js';
|
|
5
5
|
|
|
6
6
|
const MonthYearPickerController = () => {
|
|
7
7
|
const { onArrowLeft, onArrowRight, monthPickerTitle, toggleView } = useContext(MonthYearPickerContext);
|
|
8
|
-
return (React.createElement("div", { className:
|
|
9
|
-
React.createElement("div", { "data-test-id": "month-year-left-arrow", onClick: onArrowLeft, className: `${
|
|
10
|
-
React.createElement("div", { onClick: toggleView, className:
|
|
11
|
-
React.createElement("div", { "data-test-id": "month-year-right-arrow", onClick: onArrowRight, className: `${
|
|
8
|
+
return (React.createElement("div", { className: styles[cssDatePickerController] },
|
|
9
|
+
React.createElement("div", { "data-test-id": "month-year-left-arrow", onClick: onArrowLeft, className: `${styles[cssDatePickerControllerArrow]} ${styles[cssDatePickerControllerArrowLeft]}` }),
|
|
10
|
+
React.createElement("div", { onClick: toggleView, className: styles[cssDatePickerControllerTitle] }, monthPickerTitle),
|
|
11
|
+
React.createElement("div", { "data-test-id": "month-year-right-arrow", onClick: onArrowRight, className: `${styles[cssDatePickerControllerArrow]} ${styles[cssDatePickerControllerArrowRight]}` })));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default MonthYearPickerController;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useState } from 'react';
|
|
2
|
-
import MonthYearNavigationContext from '../../../context/month_year_navigation_context.js';
|
|
3
2
|
import { YEARS_IN_VIEW } from '../../../constants.js';
|
|
3
|
+
import MonthYearNavigationContext from '../../../context/month_year_navigation_context.js';
|
|
4
4
|
import { MonthYearPickerContext } from '../context.js';
|
|
5
5
|
import { MONTH_VIEW, YEARS_VIEW } from '../constants.js';
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
+
import { YEARS_IN_VIEW } from '../../../constants.js';
|
|
2
3
|
import MonthYearNavigationContext from '../../../context/month_year_navigation_context.js';
|
|
4
|
+
import styles from '../../../../../css/date_picker/main.module.less.js';
|
|
3
5
|
import { cssDatePickerMonthTable, cssDatePickerMonthTableItem, cssDatePickerMonthTableItemSelected } from '../../../css_classes.js';
|
|
4
|
-
import cssClasses from '../../../../../css/date_picker/main.module.less.js';
|
|
5
|
-
import { YEARS_IN_VIEW } from '../../../constants.js';
|
|
6
6
|
import { MonthYearPickerContext } from '../context.js';
|
|
7
7
|
import { MONTH_VIEW } from '../constants.js';
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ const YearView = () => {
|
|
|
13
13
|
setYear(yearRange + yearIndex);
|
|
14
14
|
setView(MONTH_VIEW);
|
|
15
15
|
};
|
|
16
|
-
return (React.createElement("div", { className:
|
|
16
|
+
return (React.createElement("div", { className: styles[cssDatePickerMonthTable] }, Array.from(Array(YEARS_IN_VIEW).keys()).map((index) => (React.createElement("span", { key: `month-picker-month-${index}`, onClick: onYearClick(index), className: `${styles[cssDatePickerMonthTableItem]} ${yearRange + index === year ? styles[cssDatePickerMonthTableItemSelected] : ''}` }, yearRange + index)))));
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export default YearView;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import MonthYearNavigationContext from '../context/month_year_navigation_context.js';
|
|
3
|
-
import { cssDatePickerContainer } from '../css_classes.js';
|
|
4
|
-
import cssClasses from '../../../css/date_picker/main.module.less.js';
|
|
5
2
|
import { MAX_MONTH, MIN_MONTH } from '../constants.js';
|
|
3
|
+
import MonthYearNavigationContext from '../context/month_year_navigation_context.js';
|
|
4
|
+
import styles from '../../../css/date_picker/main.module.less.js';
|
|
6
5
|
import useAnimation from '../hooks/use_animation.js';
|
|
6
|
+
import { cssDatePickerContainer } from '../css_classes.js';
|
|
7
7
|
import DaysGrid from './days_grid.js';
|
|
8
8
|
import MonthController from './month_controller.js';
|
|
9
9
|
|
|
@@ -38,7 +38,7 @@ const PureDatepicker = ({ className = '', setMonthYear, month, year }) => {
|
|
|
38
38
|
setMonthYearWithDelay(({ year }) => ({ month, year }));
|
|
39
39
|
};
|
|
40
40
|
const setYear = (year) => setMonthYearWithDelay(({ month }) => ({ month, year }));
|
|
41
|
-
return (React.createElement("div", { className: `${className} ${
|
|
41
|
+
return (React.createElement("div", { className: `${className} ${styles[cssDatePickerContainer]}` },
|
|
42
42
|
React.createElement(MonthYearNavigationContext.Provider, { value: {
|
|
43
43
|
previousMonth: prevMonthWithAnimation,
|
|
44
44
|
nextMonth: nextMonthWithAnimation,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
2
|
import { classNames } from '../../../utilities/styles/classNames.js';
|
|
3
|
+
import { DATE_PICKER_TEST_ID } from '../constants.js';
|
|
3
4
|
import DatepickerContext from '../context/value_controller_context.js';
|
|
5
|
+
import styles from '../../../css/date_picker/main.module.less.js';
|
|
4
6
|
import { cssDatePickerDay, cssDatePickerDayNavigation, cssDatePickerDaySelected, cssDatePickerDayBlocked, cssDatePickerDayProposed, cssDatePickerDayRangeEndLeft, cssDatePickerDayRangeEndLeftProposed, cssDatePickerDayRangeEndRight, cssDatePickerDayRangeEndRightProposed, cssDatePickerDayInRange, cssDatePickerDayText, cssDatePickerDayTextRoundedBorders, cssDatePickerDayTextNavigation, cssDatePickerDayTextToday, cssDatePickerDayTextSelected } from '../css_classes.js';
|
|
5
|
-
import cssClasses from '../../../css/date_picker/main.module.less.js';
|
|
6
|
-
import { DATE_PICKER_TEST_ID } from '../constants.js';
|
|
7
7
|
|
|
8
8
|
const SingleDay = ({ date, month, year }) => {
|
|
9
9
|
const { updateDate, isSelected, isInRange, isNavigation, isBlocked, isToday, setHoverDate, isProposed } = useContext(DatepickerContext);
|
|
@@ -32,7 +32,7 @@ const SingleDay = ({ date, month, year }) => {
|
|
|
32
32
|
lastRangeDay && proposed && cssDatePickerDayRangeEndRightProposed,
|
|
33
33
|
oneDayRange && cssDatePickerDaySelected,
|
|
34
34
|
inRange && cssDatePickerDayInRange
|
|
35
|
-
],
|
|
35
|
+
], styles), [navigation, selected, blocked, proposed, inRange, firstRangeDay, lastRangeDay, oneDayRange]);
|
|
36
36
|
const dayTextClassName = useMemo(() => classNames([
|
|
37
37
|
cssDatePickerDayText,
|
|
38
38
|
roundedBorders && cssDatePickerDayTextRoundedBorders,
|
|
@@ -40,7 +40,7 @@ const SingleDay = ({ date, month, year }) => {
|
|
|
40
40
|
today && navigation && cssDatePickerDayTextNavigation,
|
|
41
41
|
today && cssDatePickerDayTextToday,
|
|
42
42
|
selected && cssDatePickerDayTextSelected
|
|
43
|
-
],
|
|
43
|
+
], styles), [roundedBorders, selected, navigation, today]);
|
|
44
44
|
return (React.createElement("div", { className: dayClassName, onClick: () => updateDate(new Date(year, month, date)), onMouseOver: () => {
|
|
45
45
|
setHoverDate(new Date(year, month, date));
|
|
46
46
|
} },
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useContext, useState, useEffect } from 'react';
|
|
2
2
|
import DatepickerContext from '../context/value_controller_context.js';
|
|
3
|
-
import { cssRangePicker, cssRangePickerContainer } from '../css_classes.js';
|
|
4
|
-
import cssClasses from '../../../css/date_picker/main.module.less.js';
|
|
5
3
|
import { useKeyboardNavigation } from '../hooks/use_keyboard_navigation.js';
|
|
4
|
+
import styles from '../../../css/date_picker/main.module.less.js';
|
|
5
|
+
import { cssRangePicker, cssRangePickerContainer } from '../css_classes.js';
|
|
6
6
|
import { PureDatepicker } from '../components/pure_date_picker.js';
|
|
7
7
|
import CommonRanges from '../components/common_ranges.js';
|
|
8
8
|
import Buttons from '../components/buttons.js';
|
|
@@ -36,9 +36,9 @@ const RangePicker = ({ className = '', showButtons, showDefaultRanges }) => {
|
|
|
36
36
|
//eslint-disable-next-line
|
|
37
37
|
}, [setEarlierMonthYear, laterMonthYear.year, laterMonthYear.month]);
|
|
38
38
|
useKeyboardNavigation();
|
|
39
|
-
return (React.createElement("div", { className:
|
|
39
|
+
return (React.createElement("div", { className: styles[cssRangePicker] },
|
|
40
40
|
showDefaultRanges && React.createElement(CommonRanges, null),
|
|
41
|
-
React.createElement("div", { className:
|
|
41
|
+
React.createElement("div", { className: styles[cssRangePickerContainer] },
|
|
42
42
|
React.createElement(PureDatepicker, { setMonthYear: setEarlierMonthYear, ...earlierMonthYear, className: className }),
|
|
43
43
|
React.createElement(PureDatepicker, { setMonthYear: setLaterMonthYear, ...laterMonthYear, className: className })),
|
|
44
44
|
showButtons && React.createElement(Buttons, null)));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext, useState } from 'react';
|
|
2
2
|
import DatepickerContext from '../context/value_controller_context.js';
|
|
3
|
+
import styles from '../../../css/date_picker/main.module.less.js';
|
|
3
4
|
import { cssDatePicker } from '../css_classes.js';
|
|
4
|
-
import cssClasses from '../../../css/date_picker/main.module.less.js';
|
|
5
5
|
import { PureDatepicker } from '../components/pure_date_picker.js';
|
|
6
6
|
import Buttons from '../components/buttons.js';
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ const SingleDatepicker = ({ className, showButtons }) => {
|
|
|
13
13
|
year: currentDate.getFullYear()
|
|
14
14
|
});
|
|
15
15
|
return (React.createElement(React.Fragment, null,
|
|
16
|
-
React.createElement("div", { className:
|
|
16
|
+
React.createElement("div", { className: styles[cssDatePicker] },
|
|
17
17
|
React.createElement(PureDatepicker, { setMonthYear: setMonthYear, month: month, year: year, className: className }),
|
|
18
18
|
showButtons && React.createElement(Buttons, null))));
|
|
19
19
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import DatepickerContext from './context/value_controller_context.js';
|
|
3
2
|
import useValueController from './hooks/use_value_controller.js';
|
|
3
|
+
import DatepickerContext from './context/value_controller_context.js';
|
|
4
4
|
import { RangePicker } from './hoc/range_picker.js';
|
|
5
5
|
export { RangePicker } from './hoc/range_picker.js';
|
|
6
6
|
import { SingleDatepicker } from './hoc/single_date_picker.js';
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import React, { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import { useTranslation } from '../../../../../../external/react-i18next/dist/es/useTranslation.js';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
-
import cssClasses$
|
|
4
|
+
import cssClasses$2 from '../../../css/icons/main.module.less.js';
|
|
5
|
+
import classnames from 'classnames';
|
|
5
6
|
import { useDropdownContext } from '../context/index.js';
|
|
6
7
|
import { SCREEN_XS } from '../../../constants/responsive_breakpoints.js';
|
|
7
8
|
import { useScreenDetect } from '../../../hooks/use_screen_detect.js';
|
|
8
9
|
import withTranslation from '../../../utilities/translation/with_translation.js';
|
|
9
|
-
import { classNames } from '../../../utilities/styles/classNames.js';
|
|
10
10
|
import { TransitionGroup, CSSTransition } from 'react-transition-group';
|
|
11
11
|
import { DROPDOWN_Z_INDEX, DROPDOWN_ON_MODAL_Z_INDEX } from '../constants.js';
|
|
12
|
-
import { cssDropdownContent, cssDropdownArrowHorizontalDirectionRight, cssDropdownArrowVerticalDirectionBottom, cssDropdownHeader, cssDropdownHeaderContent, cssDropdownHeaderTitle } from '../css_classes.js';
|
|
12
|
+
import { cssDropdownContent, cssDropdownContentOnTop, cssDropdownContentOnBottom, cssDropdownArrowHorizontalDirectionRight, cssDropdownArrowVerticalDirectionBottom, cssDropdownHeader, cssDropdownHeaderContent, cssDropdownHeaderTitle } from '../css_classes.js';
|
|
13
13
|
import cssClasses from '../../../css/dropdown/main.module.less.js';
|
|
14
|
-
import { getXYModifiersForNestedDropdowns, isChildOfModal } from '../utilities.js';
|
|
14
|
+
import { getBounding, getXYModifiersForNestedDropdowns, isChildOfModal } from '../utilities.js';
|
|
15
15
|
import { useClickOutside } from '../../../hooks/use_click_outside.js';
|
|
16
16
|
import IconArrow from '../../../assets/icon_arrow.js';
|
|
17
17
|
import { UiDomUtils } from '@dreamcommerce/utilities';
|
|
18
|
+
import cssClasses$1 from '../../../css/hint/main.module.less.js';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Dropdown.Content component. This togglable part of dropdown.
|
|
@@ -22,27 +23,36 @@ import { UiDomUtils } from '@dreamcommerce/utilities';
|
|
|
22
23
|
* @example
|
|
23
24
|
* <Dropdown.Content> ... </Dropdown.Content>
|
|
24
25
|
*/
|
|
25
|
-
const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children, arrowSide = 'left', portalContainer }) => {
|
|
26
|
+
const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children, arrowSide = 'left', horizontalPosition = 'left', verticalPosition = 'bottom', cssClass, portalContainer }) => {
|
|
26
27
|
const [t] = useTranslation();
|
|
27
28
|
const contentRef = useRef(null);
|
|
28
29
|
const { wrapperRef, toggleDropdown, isOpen, closeDropdown } = useDropdownContext();
|
|
29
30
|
const [styles, setStyles] = useState({
|
|
30
|
-
left: '0px',
|
|
31
31
|
top: '0px',
|
|
32
32
|
bottom: '0px',
|
|
33
|
+
left: '0px',
|
|
33
34
|
zIndex: DROPDOWN_Z_INDEX
|
|
34
35
|
});
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const windowYScroll = window.scrollY;
|
|
37
|
+
const windowHeightMinusYOffset = window.innerHeight - windowYScroll;
|
|
38
|
+
const checkIfIsOutsideTopViewport = () => {
|
|
39
|
+
if (!contentRef.current)
|
|
40
|
+
return;
|
|
41
|
+
const bounding = getBounding(contentRef.current);
|
|
42
|
+
return bounding.top <= 0;
|
|
43
|
+
};
|
|
44
|
+
const checkIfIsOutsideBottomViewport = () => {
|
|
45
|
+
if (!contentRef.current)
|
|
46
|
+
return;
|
|
47
|
+
const element = contentRef.current;
|
|
48
|
+
const elementHeight = getBounding(element).height;
|
|
49
|
+
return elementHeight + element.offsetTop > window.innerHeight + windowYScroll;
|
|
39
50
|
};
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
], cssClasses);
|
|
51
|
+
const dropdownIsOutsideTopViewport = checkIfIsOutsideTopViewport();
|
|
52
|
+
const dropdownIsOutsideBottomViewport = checkIfIsOutsideBottomViewport();
|
|
53
|
+
const contentShouldAppearOnTop = dropdownIsOutsideBottomViewport || (verticalPosition === 'top' && !dropdownIsOutsideTopViewport);
|
|
54
|
+
const contentShouldAppearOnBottom = dropdownIsOutsideTopViewport || (verticalPosition === 'bottom' && !dropdownIsOutsideBottomViewport);
|
|
55
|
+
const contentClassName = classnames(cssClass, cssClasses[cssDropdownContent], contentShouldAppearOnTop && cssClasses$1[cssDropdownContentOnTop], contentShouldAppearOnBottom && cssClasses$1[cssDropdownContentOnBottom], arrowSide === 'right' && cssClasses[cssDropdownArrowHorizontalDirectionRight], contentShouldAppearOnTop && cssClasses[cssDropdownArrowVerticalDirectionBottom]);
|
|
46
56
|
const screenWidthName = useScreenDetect();
|
|
47
57
|
const refs = [contentRef];
|
|
48
58
|
if (wrapperRef) {
|
|
@@ -54,22 +64,55 @@ const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children
|
|
|
54
64
|
}
|
|
55
65
|
});
|
|
56
66
|
useEffect(() => {
|
|
57
|
-
if (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current) {
|
|
58
|
-
const { x, y, height } = wrapperRef.current
|
|
59
|
-
const
|
|
67
|
+
if ((wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current) && contentRef.current) {
|
|
68
|
+
const { x: wrapperXPosition, y: wrapperYPosition, width: wrapperWidth, height: wrapperHeight } = getBounding(wrapperRef.current);
|
|
69
|
+
const { width: contentWidth } = getBounding(contentRef.current);
|
|
60
70
|
const { xModifier, yModifier } = getXYModifiersForNestedDropdowns(portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.current);
|
|
61
|
-
const
|
|
62
|
-
const positionBottom = windowHeightMinusYOffset - y + yOffset;
|
|
63
|
-
const positionLeft = x - xModifier;
|
|
71
|
+
const yOffset = 10;
|
|
64
72
|
const isInModal = isChildOfModal(wrapperRef);
|
|
65
73
|
const zIndex = isInModal ? DROPDOWN_ON_MODAL_Z_INDEX : DROPDOWN_Z_INDEX;
|
|
66
|
-
const
|
|
67
|
-
const
|
|
74
|
+
const positionTop = wrapperHeight + wrapperYPosition + windowYScroll + yOffset - yModifier;
|
|
75
|
+
const positionBottom = windowHeightMinusYOffset - wrapperYPosition + yOffset;
|
|
76
|
+
const positionLeft = wrapperXPosition - xModifier;
|
|
77
|
+
let topPositionValue = '';
|
|
78
|
+
let bottomPositionValue = '';
|
|
79
|
+
let leftPositionValue = '';
|
|
80
|
+
const leftPositionStickedToRightBorderValue = wrapperXPosition + wrapperWidth - contentWidth;
|
|
81
|
+
const setTopPosition = () => {
|
|
82
|
+
topPositionValue = 'auto';
|
|
83
|
+
bottomPositionValue = `${positionBottom}px`;
|
|
84
|
+
};
|
|
85
|
+
const setBottomPosition = () => {
|
|
86
|
+
topPositionValue = `${positionTop}px`;
|
|
87
|
+
bottomPositionValue = 'auto';
|
|
88
|
+
};
|
|
89
|
+
horizontalPosition === 'left'
|
|
90
|
+
? (leftPositionValue = `${positionLeft}px`)
|
|
91
|
+
: (leftPositionValue = `${leftPositionStickedToRightBorderValue}px`);
|
|
92
|
+
if (verticalPosition === 'top') {
|
|
93
|
+
setTopPosition();
|
|
94
|
+
if (dropdownIsOutsideTopViewport)
|
|
95
|
+
setBottomPosition();
|
|
96
|
+
}
|
|
97
|
+
if (verticalPosition === 'bottom') {
|
|
98
|
+
setBottomPosition();
|
|
99
|
+
if (dropdownIsOutsideBottomViewport)
|
|
100
|
+
setTopPosition();
|
|
101
|
+
}
|
|
68
102
|
screenWidthName === SCREEN_XS
|
|
69
|
-
? setStyles({
|
|
70
|
-
: setStyles({
|
|
103
|
+
? setStyles({ top: `0px`, bottom: 'auto', left: `0px`, zIndex })
|
|
104
|
+
: setStyles({ top: topPositionValue, bottom: bottomPositionValue, left: leftPositionValue, zIndex });
|
|
71
105
|
}
|
|
72
|
-
}, [
|
|
106
|
+
}, [
|
|
107
|
+
portalContainer,
|
|
108
|
+
screenWidthName,
|
|
109
|
+
wrapperRef,
|
|
110
|
+
isOpen,
|
|
111
|
+
dropdownIsOutsideTopViewport,
|
|
112
|
+
dropdownIsOutsideBottomViewport,
|
|
113
|
+
windowYScroll,
|
|
114
|
+
windowHeightMinusYOffset
|
|
115
|
+
]);
|
|
73
116
|
useEffect(() => {
|
|
74
117
|
var _a;
|
|
75
118
|
if (!(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current) || !isOpen)
|
|
@@ -91,7 +134,7 @@ const Content = ({ headerComponent, headerGoBackText, headerGoBackIcon, children
|
|
|
91
134
|
React.createElement("div", { ref: contentRef, style: styles, className: contentClassName },
|
|
92
135
|
React.createElement("div", { className: cssClasses[cssDropdownHeader] },
|
|
93
136
|
React.createElement("div", { onClick: () => typeof toggleDropdown === 'function' && toggleDropdown() }, headerComponent !== null && headerComponent !== void 0 ? headerComponent : (React.createElement("div", { className: cssClasses[cssDropdownHeaderContent] },
|
|
94
|
-
headerGoBackIcon || React.createElement(IconArrow, { className: cssClasses$
|
|
137
|
+
headerGoBackIcon || React.createElement(IconArrow, { className: cssClasses$2['icon_rotate-180'] }),
|
|
95
138
|
React.createElement("span", { className: cssClasses[cssDropdownHeaderTitle] }, headerGoBackText !== null && headerGoBackText !== void 0 ? headerGoBackText : t('Go back')))))),
|
|
96
139
|
children))) : null), (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.current) || document.body);
|
|
97
140
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,+BAA+B,oEAAwE;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,+BAA+B,oEAAwE;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import ControlCheckbox from '../../controls/hoc/control_checkbox/index.js';
|
|
4
3
|
import { cssDropdownListItem, cssDropdownListItemSelected, cssDropdownListItemDisabled, cssDropdownListItemReadonly } from '../css_classes.js';
|
|
5
4
|
import cssClasses from '../../../css/dropdown/main.module.less.js';
|
|
6
5
|
import Item from './item.js';
|
|
6
|
+
import ControlCheckbox from '../../controls/hoc/control_checkbox/index.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Dropdown.OptionMultiple component. Should be only used within Dropdown.List
|
|
@@ -2,10 +2,10 @@ import React, { useRef } from 'react';
|
|
|
2
2
|
import { useDropdownContext } from '../context/index.js';
|
|
3
3
|
import { cssControlInputRemoveButton } from '../../controls/css_classes.js';
|
|
4
4
|
import inputCssClasses from '../../../css/input/main.module.less.js';
|
|
5
|
-
import InputWrapper from '../../controls/components/input_wrapper.js';
|
|
6
5
|
import cssClasses from '../../../css/dropdown/main.module.less.js';
|
|
7
6
|
import { useKeyboardOpenClose } from '../hooks/use_keyboard_open_close.js';
|
|
8
7
|
import IconClose from '../../../assets/icon_close.js';
|
|
8
|
+
import InputWrapper from '../../controls/components/input_wrapper.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Dropdown.Select component. Displays select like control. Use it only if you have selectable values.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const cssDropdown = "dropdown";
|
|
2
2
|
export declare const cssDropdownContent: string;
|
|
3
|
+
export declare const cssDropdownContentOnTop: string;
|
|
4
|
+
export declare const cssDropdownContentOnBottom: string;
|
|
3
5
|
export declare const cssDropdownArrowHorizontalDirectionRight: string;
|
|
4
6
|
export declare const cssDropdownArrowVerticalDirectionBottom: string;
|
|
5
7
|
export declare const cssDropdownHeader: string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const cssDropdown = 'dropdown';
|
|
2
2
|
const cssDropdownContent = `${cssDropdown}__content`;
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const cssDropdownContentOnTop = `${cssDropdownContent}_top`;
|
|
4
|
+
const cssDropdownContentOnBottom = `${cssDropdownContent}_bottom`;
|
|
5
|
+
const cssDropdownArrowHorizontalDirectionRight = `${cssDropdownContent}_arrow-right`;
|
|
6
|
+
const cssDropdownArrowVerticalDirectionBottom = `${cssDropdownContent}_arrow-bottom`;
|
|
5
7
|
const cssDropdownHeader = `${cssDropdown}__header`;
|
|
6
8
|
const cssDropdownHeaderTitle = `${cssDropdown}__header-title`;
|
|
7
9
|
const cssDropdownHeaderContent = `${cssDropdown}__header-content`;
|
|
@@ -16,5 +18,5 @@ const cssDropdownListItemSelected = `${cssDropdown}__list-item_selected`;
|
|
|
16
18
|
const cssDropdownListItemDisabled = `${cssDropdown}__list-item_disabled`;
|
|
17
19
|
const cssDropdownListItemReadonly = `${cssDropdown}__list-item_readonly`;
|
|
18
20
|
|
|
19
|
-
export { cssDropdown, cssDropdownArrowHorizontalDirectionRight, cssDropdownArrowVerticalDirectionBottom, cssDropdownContent, cssDropdownHeader, cssDropdownHeaderContent, cssDropdownHeaderTitle, cssDropdownItemWithHover, cssDropdownList, cssDropdownListHead, cssDropdownListItem, cssDropdownListItemDisabled, cssDropdownListItemReadonly, cssDropdownListItemSelected, cssDropdownListWithGroup, cssDropdownSearch, cssDropdownWithScroll };
|
|
21
|
+
export { cssDropdown, cssDropdownArrowHorizontalDirectionRight, cssDropdownArrowVerticalDirectionBottom, cssDropdownContent, cssDropdownContentOnBottom, cssDropdownContentOnTop, cssDropdownHeader, cssDropdownHeaderContent, cssDropdownHeaderTitle, cssDropdownItemWithHover, cssDropdownList, cssDropdownListHead, cssDropdownListItem, cssDropdownListItemDisabled, cssDropdownListItemReadonly, cssDropdownListItemSelected, cssDropdownListWithGroup, cssDropdownSearch, cssDropdownWithScroll };
|
|
20
22
|
//# sourceMappingURL=css_classes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -44,6 +44,9 @@ export interface IDropdownContentProps {
|
|
|
44
44
|
headerGoBackIcon?: JSX.Element;
|
|
45
45
|
portalContainer?: RefObject<HTMLElement>;
|
|
46
46
|
arrowSide?: 'left' | 'right';
|
|
47
|
+
horizontalPosition?: 'left' | 'right';
|
|
48
|
+
verticalPosition?: 'top' | 'bottom';
|
|
49
|
+
cssClass?: string;
|
|
47
50
|
}
|
|
48
51
|
export interface IDropdownItemWithHover {
|
|
49
52
|
children?: ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
1
|
import { ISelectOption } from './types';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* checks if the given option is selected within array of selectedValues array
|
|
5
5
|
* @param {ISelectOption} option select/multiselect option
|
|
@@ -30,3 +30,4 @@ export declare const getXYModifiersForNestedDropdowns: (portalContainer: HTMLEle
|
|
|
30
30
|
yModifier: number;
|
|
31
31
|
};
|
|
32
32
|
export declare const isChildOfModal: (ref: RefObject<HTMLElement>) => boolean;
|
|
33
|
+
export declare const getBounding: (element: HTMLElement) => DOMRect;
|