linear-react-components-ui 1.1.24-beta.4 → 1.1.25-rc.1
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/lib/@types/ColorStyles.d.ts +1 -2
- package/lib/@types/Position.d.ts +1 -2
- package/lib/assets/styles/calendar.scss +137 -32
- package/lib/assets/styles/colorpicker.scss +6 -1
- package/lib/assets/styles/colors.scss +12 -48
- package/lib/assets/styles/file.scss +8 -0
- package/lib/assets/styles/table.scss +6 -0
- package/lib/buttons/ActivateButton.d.ts +0 -1
- package/lib/buttons/AddButton.d.ts +0 -1
- package/lib/buttons/Button.d.ts +0 -1
- package/lib/buttons/CancelButton.d.ts +0 -1
- package/lib/buttons/DangerButton.d.ts +0 -1
- package/lib/buttons/DefaultButton.d.ts +0 -1
- package/lib/buttons/DefaultButton.js +17 -32
- package/lib/buttons/DestroyButton.d.ts +0 -1
- package/lib/buttons/EditButton.d.ts +0 -1
- package/lib/buttons/InactivateButton.d.ts +0 -1
- package/lib/buttons/InfoButton.d.ts +0 -1
- package/lib/buttons/PrimaryButton.d.ts +0 -1
- package/lib/buttons/RestoreButton.d.ts +0 -1
- package/lib/buttons/SaveButton.d.ts +0 -1
- package/lib/buttons/SuccessButton.d.ts +0 -1
- package/lib/buttons/WarningButton.d.ts +0 -1
- package/lib/buttons/index.d.ts +0 -1
- package/lib/buttons/split_button/index.d.ts +0 -1
- package/lib/buttons/types.d.ts +5 -2
- package/lib/calendar/base/index.js +113 -40
- package/lib/dialog/base/index.js +2 -2
- package/lib/form/Field.d.ts +1 -1
- package/lib/form/FieldArray.d.ts +1 -1
- package/lib/form/FieldNumber.d.ts +1 -1
- package/lib/form/FieldPeriod.d.ts +1 -1
- package/lib/form/helpers.d.ts +1 -1
- package/lib/form/index.d.ts +1 -1
- package/lib/form/types.d.ts +1 -1
- package/lib/form/withFieldHOC.d.ts +1 -1
- package/lib/form/withFormSecurity.d.ts +1 -1
- package/lib/icons/helper.d.ts +0 -20
- package/lib/icons/helper.js +0 -20
- package/lib/icons/index.d.ts +6 -4
- package/lib/icons/index.js +9 -14
- package/lib/icons/types.d.ts +6 -3
- package/lib/index.d.ts +0 -1
- package/lib/inputs/base/InputTextBase.d.ts +1 -1
- package/lib/inputs/base/InputTextBase.js +8 -18
- package/lib/inputs/base/Label.d.ts +14 -0
- package/lib/inputs/base/Label.js +35 -0
- package/lib/inputs/base/helpers.d.ts +1 -1
- package/lib/inputs/base/types.d.ts +17 -6
- package/lib/inputs/color/index.js +1 -1
- package/lib/inputs/color/types.d.ts +1 -1
- package/lib/inputs/date/Dialog.d.ts +1 -1
- package/lib/inputs/date/Dropdown.d.ts +1 -1
- package/lib/inputs/date/index.d.ts +1 -1
- package/lib/inputs/date/types.d.ts +2 -2
- package/lib/inputs/errorMessage/index.d.ts +1 -1
- package/lib/inputs/file/DefaultFile.d.ts +1 -1
- package/lib/inputs/file/DefaultFile.js +27 -27
- package/lib/inputs/file/DragDropFile.d.ts +1 -1
- package/lib/inputs/file/File.d.ts +1 -1
- package/lib/inputs/file/File.js +1 -0
- package/lib/inputs/file/FileButtonSettings.d.ts +1 -1
- package/lib/inputs/file/FileButtonSettings.js +0 -1
- package/lib/inputs/file/helpers.d.ts +1 -1
- package/lib/inputs/file/index.d.ts +1 -1
- package/lib/inputs/file/types.d.ts +1 -1
- package/lib/inputs/inputHOC.d.ts +1 -1
- package/lib/inputs/mask/BaseMask.d.ts +1 -1
- package/lib/inputs/mask/Cnpj.d.ts +1 -1
- package/lib/inputs/mask/Cpf.d.ts +1 -1
- package/lib/inputs/mask/Phone.d.ts +1 -1
- package/lib/inputs/mask/ZipCode.d.ts +1 -1
- package/lib/inputs/mask/helpers.d.ts +1 -1
- package/lib/inputs/mask/index.d.ts +1 -1
- package/lib/inputs/mask/types.d.ts +2 -2
- package/lib/inputs/multiSelect/ActionButtons.d.ts +1 -1
- package/lib/inputs/multiSelect/Dropdown.d.ts +1 -1
- package/lib/inputs/multiSelect/helper.d.ts +1 -1
- package/lib/inputs/multiSelect/index.d.ts +1 -1
- package/lib/inputs/multiSelect/types.d.ts +2 -2
- package/lib/inputs/number/BaseNumber.d.ts +1 -1
- package/lib/inputs/number/Currency.d.ts +1 -1
- package/lib/inputs/number/Decimal.d.ts +1 -1
- package/lib/inputs/number/index.d.ts +1 -1
- package/lib/inputs/number/types.d.ts +3 -3
- package/lib/inputs/period/Dialog.d.ts +1 -1
- package/lib/inputs/period/Dropdown.d.ts +1 -1
- package/lib/inputs/period/PeriodList.d.ts +1 -1
- package/lib/inputs/period/helper.d.ts +1 -1
- package/lib/inputs/period/index.d.ts +1 -1
- package/lib/inputs/period/index.js +10 -8
- package/lib/inputs/period/types.d.ts +5 -2
- package/lib/inputs/search/index.d.ts +1 -1
- package/lib/inputs/search/index.js +6 -2
- package/lib/inputs/select/ActionButtons.d.ts +1 -1
- package/lib/inputs/select/Dropdown.d.ts +1 -1
- package/lib/inputs/select/helper.d.ts +1 -1
- package/lib/inputs/select/index.d.ts +1 -1
- package/lib/inputs/select/multiple/Selecteds.d.ts +1 -1
- package/lib/inputs/select/multiple/index.d.ts +1 -1
- package/lib/inputs/select/simple/index.d.ts +1 -1
- package/lib/inputs/select/types.d.ts +1 -1
- package/lib/inputs/text/index.d.ts +1 -1
- package/lib/inputs/text/types.d.ts +3 -2
- package/lib/inputs/textarea/index.d.ts +1 -1
- package/lib/inputs/textarea/types.d.ts +1 -1
- package/lib/inputs/types.d.ts +2 -1
- package/lib/internals/types.d.ts +17 -1
- package/lib/internals/withTooltip.d.ts +12 -0
- package/lib/internals/withTooltip.js +172 -0
- package/lib/labels/DangerLabel.d.ts +0 -1
- package/lib/labels/DefaultLabel.d.ts +5 -3
- package/lib/labels/DefaultLabel.js +7 -15
- package/lib/labels/InfoLabel.d.ts +0 -1
- package/lib/labels/PrimaryLabel.d.ts +0 -1
- package/lib/labels/SuccessLabel.d.ts +0 -1
- package/lib/labels/WarningLabel.d.ts +0 -1
- package/lib/labels/index.d.ts +2 -3
- package/lib/labels/types.d.ts +5 -2
- package/lib/list/Header.d.ts +0 -1
- package/lib/list/Item.d.ts +5 -3
- package/lib/list/Item.js +12 -17
- package/lib/list/helpers.d.ts +0 -1
- package/lib/list/index.d.ts +0 -1
- package/lib/list/types.d.ts +6 -4
- package/lib/menus/sidenav/ExpandMenu.d.ts +2 -2
- package/lib/menus/sidenav/MenuLink.d.ts +7 -4
- package/lib/menus/sidenav/MenuLink.js +11 -20
- package/lib/menus/sidenav/NavMenuGroup.d.ts +2 -2
- package/lib/menus/sidenav/NavMenuItem.d.ts +7 -4
- package/lib/menus/sidenav/NavMenuItem.js +12 -16
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +2 -2
- package/lib/menus/sidenav/helpers.d.ts +2 -2
- package/lib/menus/sidenav/index.d.ts +2 -2
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +2 -2
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +2 -2
- package/lib/menus/sidenav/types.d.ts +6 -6
- package/lib/popover/PopoverText.js +2 -11
- package/lib/popover/index.js +0 -1
- package/lib/popover/types.d.ts +0 -1
- package/lib/table/index.js +18 -8
- package/lib/table/types.d.ts +1 -0
- package/lib/textContent/index.d.ts +11 -6
- package/lib/textContent/index.js +11 -20
- package/lib/tooltip/index.d.ts +3 -4
- package/lib/tooltip/index.js +53 -36
- package/lib/tooltip/types.d.ts +3 -25
- package/package.json +2 -3
- package/lib/BaseMask-0c14ef51.d.ts +0 -24
- package/lib/Cnpj-bde01dd0.d.ts +0 -18
- package/lib/Cpf-3fa496ad.d.ts +0 -18
- package/lib/Phone-2bb0b397.d.ts +0 -18
- package/lib/ZipCode-09460e18.d.ts +0 -13
- package/lib/assets/styles/checkbox2.scss +0 -199
- package/lib/assets/styles/datepicker2.scss +0 -338
- package/lib/assets/styles/numberfield.scss +0 -18
- package/lib/assets/styles/radiofield.scss +0 -185
- package/lib/assets/styles/selectfield.scss +0 -409
- package/lib/assets/styles/slot.scss +0 -34
- package/lib/assets/styles/textfield.scss +0 -147
- package/lib/calendar/base/Day.d.ts +0 -8
- package/lib/calendar/base/Day.js +0 -36
- package/lib/calendar/base/Month.d.ts +0 -8
- package/lib/calendar/base/Month.js +0 -39
- package/lib/calendar/base/Week.d.ts +0 -8
- package/lib/calendar/base/Week.js +0 -35
- package/lib/form2/helpers.d.ts +0 -8
- package/lib/form2/helpers.js +0 -41
- package/lib/form2/index.d.ts +0 -9
- package/lib/form2/index.js +0 -36
- package/lib/form2/types.d.ts +0 -125
- package/lib/form2/types.js +0 -5
- package/lib/form2/useForm/index.d.ts +0 -5
- package/lib/form2/useForm/index.js +0 -202
- package/lib/index-368f781f.d.ts +0 -15
- package/lib/index-3b70931d.d.ts +0 -44
- package/lib/index-789dd9a5.d.ts +0 -41
- package/lib/index-7ad68789.d.ts +0 -15
- package/lib/index-9e576346.d.ts +0 -23
- package/lib/index-c512803d.d.ts +0 -23
- package/lib/index-c9247c1f.d.ts +0 -15
- package/lib/index-ecafc8c6.d.ts +0 -30
- package/lib/inputs2/checkboxfield/index.d.ts +0 -7
- package/lib/inputs2/checkboxfield/index.js +0 -146
- package/lib/inputs2/colorfield/index.d.ts +0 -9
- package/lib/inputs2/colorfield/index.js +0 -119
- package/lib/inputs2/date/base/constants.d.ts +0 -7
- package/lib/inputs2/date/base/constants.js +0 -43
- package/lib/inputs2/date/base/index.d.ts +0 -12
- package/lib/inputs2/date/base/index.js +0 -179
- package/lib/inputs2/date/datefield/calendarbox.d.ts +0 -7
- package/lib/inputs2/date/datefield/calendarbox.js +0 -115
- package/lib/inputs2/date/datefield/context.d.ts +0 -14
- package/lib/inputs2/date/datefield/context.js +0 -15
- package/lib/inputs2/date/datefield/index.d.ts +0 -10
- package/lib/inputs2/date/datefield/index.js +0 -336
- package/lib/inputs2/date/datefield/triggers.d.ts +0 -8
- package/lib/inputs2/date/datefield/triggers.js +0 -47
- package/lib/inputs2/date/datefield/types.d.ts +0 -63
- package/lib/inputs2/date/datefield/types.js +0 -5
- package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +0 -7
- package/lib/inputs2/date/dateperiodfield/calendarbox.js +0 -136
- package/lib/inputs2/date/dateperiodfield/context.d.ts +0 -14
- package/lib/inputs2/date/dateperiodfield/context.js +0 -17
- package/lib/inputs2/date/dateperiodfield/index.d.ts +0 -10
- package/lib/inputs2/date/dateperiodfield/index.js +0 -593
- package/lib/inputs2/date/dateperiodfield/triggers.d.ts +0 -6
- package/lib/inputs2/date/dateperiodfield/triggers.js +0 -120
- package/lib/inputs2/date/dateperiodfield/types.d.ts +0 -101
- package/lib/inputs2/date/dateperiodfield/types.js +0 -19
- package/lib/inputs2/date/helpers.d.ts +0 -21
- package/lib/inputs2/date/helpers.js +0 -62
- package/lib/inputs2/date/types.d.ts +0 -60
- package/lib/inputs2/date/types.js +0 -19
- package/lib/inputs2/index.d.ts +0 -32
- package/lib/inputs2/index.js +0 -34
- package/lib/inputs2/mask/BaseMask.d.ts +0 -10
- package/lib/inputs2/mask/BaseMask.js +0 -95
- package/lib/inputs2/mask/Cnpj.d.ts +0 -11
- package/lib/inputs2/mask/Cnpj.js +0 -57
- package/lib/inputs2/mask/Cpf.d.ts +0 -11
- package/lib/inputs2/mask/Cpf.js +0 -53
- package/lib/inputs2/mask/Phone.d.ts +0 -11
- package/lib/inputs2/mask/Phone.js +0 -26
- package/lib/inputs2/mask/ZipCode.d.ts +0 -11
- package/lib/inputs2/mask/ZipCode.js +0 -23
- package/lib/inputs2/mask/helpers.d.ts +0 -4
- package/lib/inputs2/mask/helpers.js +0 -57
- package/lib/inputs2/numberfield/currency.d.ts +0 -13
- package/lib/inputs2/numberfield/currency.js +0 -91
- package/lib/inputs2/numberfield/decimal.d.ts +0 -13
- package/lib/inputs2/numberfield/decimal.js +0 -85
- package/lib/inputs2/numberfield/helpers.d.ts +0 -30
- package/lib/inputs2/numberfield/helpers.js +0 -53
- package/lib/inputs2/numberfield/index.d.ts +0 -12
- package/lib/inputs2/numberfield/index.js +0 -104
- package/lib/inputs2/numberfield/types.d.ts +0 -36
- package/lib/inputs2/numberfield/types.js +0 -5
- package/lib/inputs2/radiofield/index.d.ts +0 -9
- package/lib/inputs2/radiofield/index.js +0 -143
- package/lib/inputs2/radiofield/types.d.ts +0 -33
- package/lib/inputs2/radiofield/types.js +0 -5
- package/lib/inputs2/selectfield/context.d.ts +0 -38
- package/lib/inputs2/selectfield/context.js +0 -15
- package/lib/inputs2/selectfield/helpers.d.ts +0 -6
- package/lib/inputs2/selectfield/helpers.js +0 -25
- package/lib/inputs2/selectfield/index.d.ts +0 -10
- package/lib/inputs2/selectfield/index.js +0 -491
- package/lib/inputs2/selectfield/item.d.ts +0 -11
- package/lib/inputs2/selectfield/item.js +0 -85
- package/lib/inputs2/selectfield/listbox.d.ts +0 -7
- package/lib/inputs2/selectfield/listbox.js +0 -103
- package/lib/inputs2/selectfield/search.d.ts +0 -7
- package/lib/inputs2/selectfield/search.js +0 -71
- package/lib/inputs2/selectfield/selections.d.ts +0 -10
- package/lib/inputs2/selectfield/selections.js +0 -86
- package/lib/inputs2/selectfield/triggers.d.ts +0 -8
- package/lib/inputs2/selectfield/triggers.js +0 -100
- package/lib/inputs2/selectfield/types.d.ts +0 -54
- package/lib/inputs2/selectfield/types.js +0 -21
- package/lib/inputs2/slot/index.d.ts +0 -14
- package/lib/inputs2/slot/index.js +0 -47
- package/lib/inputs2/textfield/index.d.ts +0 -8
- package/lib/inputs2/textfield/index.js +0 -159
- package/lib/tooltip/TooltipContent.d.ts +0 -7
- package/lib/tooltip/TooltipContent.js +0 -65
- package/lib/tooltip/useTooltip.d.ts +0 -30
- package/lib/tooltip/useTooltip.js +0 -128
|
@@ -4,7 +4,7 @@ import '../base/types.js';
|
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../../@types/Align.js';
|
|
6
6
|
import '../../@types/Period.js';
|
|
7
|
-
import '../../
|
|
7
|
+
import '../../internals/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
import '../types.js';
|
|
10
10
|
import '../../@types/DataCombo.js';
|
|
@@ -6,7 +6,7 @@ import '../base/types.js';
|
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../@types/Align.js';
|
|
8
8
|
import '../../@types/Period.js';
|
|
9
|
-
import '../../
|
|
9
|
+
import '../../internals/types.js';
|
|
10
10
|
import '../../@types/Position.js';
|
|
11
11
|
import '../types.js';
|
|
12
12
|
import '../../@types/DataCombo.js';
|
|
@@ -4,7 +4,7 @@ import { IMaskHOCProps } from '../types.js';
|
|
|
4
4
|
import { TextAlign } from '../../@types/Align.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../@types/Period.js';
|
|
7
|
-
import '../../
|
|
7
|
+
import '../../internals/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
import '../../@types/DataCombo.js';
|
|
10
10
|
import '../../drawer/types.js';
|
|
@@ -15,7 +15,7 @@ interface INumberFieldProps extends IMaskHOCProps {
|
|
|
15
15
|
value?: string | number;
|
|
16
16
|
permissionAttr?: PermissionAttr;
|
|
17
17
|
disabled?: boolean;
|
|
18
|
-
hint?: string;
|
|
18
|
+
hint?: string | string[];
|
|
19
19
|
hintPosition?: 'below' | 'onLabelRight';
|
|
20
20
|
themePopover?: 'light' | 'dark';
|
|
21
21
|
popoverAlign?: 'right' | 'left';
|
|
@@ -30,7 +30,7 @@ interface IBaseNumberProps extends IMaskHOCProps {
|
|
|
30
30
|
interface ICurrencyProps extends IMaskHOCProps {
|
|
31
31
|
currencySymbol?: string;
|
|
32
32
|
displayCurrencySymbol?: boolean;
|
|
33
|
-
hint?: string;
|
|
33
|
+
hint?: string | string[];
|
|
34
34
|
hintPosition?: 'below' | 'onLabelRight';
|
|
35
35
|
themePopover?: 'light' | 'dark';
|
|
36
36
|
popoverAlign?: 'right' | 'left';
|
|
@@ -6,7 +6,7 @@ import '../../@types/Period.js';
|
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
8
|
import '../../@types/Align.js';
|
|
9
|
-
import '../../
|
|
9
|
+
import '../../internals/types.js';
|
|
10
10
|
import '../../@types/Position.js';
|
|
11
11
|
|
|
12
12
|
declare const Dialog: ({ onOpenChange, handlerClose, children, dialogSize }: IDialogProps) => JSX.Element;
|
|
@@ -6,7 +6,7 @@ import '../../@types/Period.js';
|
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
8
|
import '../../@types/Align.js';
|
|
9
|
-
import '../../
|
|
9
|
+
import '../../internals/types.js';
|
|
10
10
|
import '../../@types/Position.js';
|
|
11
11
|
|
|
12
12
|
declare const Dropdown: (props: IPeriodDropdownProps) => React.ReactPortal;
|
|
@@ -6,7 +6,7 @@ import '../../@types/Period.js';
|
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
8
|
import '../../@types/Align.js';
|
|
9
|
-
import '../../
|
|
9
|
+
import '../../internals/types.js';
|
|
10
10
|
import '../../@types/Position.js';
|
|
11
11
|
|
|
12
12
|
declare const PeriodList: ({ selected, handleOnSelect }: IPeriodListProps) => JSX.Element;
|
|
@@ -6,7 +6,7 @@ import '../../@types/Period.js';
|
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
8
|
import '../../@types/Align.js';
|
|
9
|
-
import '../../
|
|
9
|
+
import '../../internals/types.js';
|
|
10
10
|
import '../../@types/Position.js';
|
|
11
11
|
|
|
12
12
|
declare const getCalendarDropdownStyle: ({ topPosition, leftPosition, width }: {
|
|
@@ -6,7 +6,7 @@ import '../../@types/Period.js';
|
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
8
|
import '../../@types/Align.js';
|
|
9
|
-
import '../../
|
|
9
|
+
import '../../internals/types.js';
|
|
10
10
|
import '../../@types/Position.js';
|
|
11
11
|
|
|
12
12
|
declare const PeriodPicker: (props: IPeriodPickerProps) => JSX.Element | null;
|
|
@@ -43,7 +43,9 @@ const PeriodPicker = props => {
|
|
|
43
43
|
hintPosition = 'below',
|
|
44
44
|
themePopover = 'light',
|
|
45
45
|
popoverAlign = 'left',
|
|
46
|
-
gridLayout
|
|
46
|
+
gridLayout,
|
|
47
|
+
nameDateInitial = 'valueInitial',
|
|
48
|
+
nameDateFinal = 'valueFinal'
|
|
47
49
|
} = props;
|
|
48
50
|
const idValueInitial = (0, _react.useId)();
|
|
49
51
|
const idValueFinal = (0, _react.useId)();
|
|
@@ -244,7 +246,7 @@ const PeriodPicker = props => {
|
|
|
244
246
|
name: changingAux
|
|
245
247
|
} = event.target;
|
|
246
248
|
if (value && value.replace(/\D/g, '').trim().length !== 0) {
|
|
247
|
-
if (changingAux ===
|
|
249
|
+
if (changingAux === nameDateInitial) {
|
|
248
250
|
setValueInitial(undefined);
|
|
249
251
|
} else {
|
|
250
252
|
setValueFinal(undefined);
|
|
@@ -268,21 +270,21 @@ const PeriodPicker = props => {
|
|
|
268
270
|
const dateObj = (0, _moment.default)(value, 'DD/MM/YYYY');
|
|
269
271
|
if (showCalendarValueInitial) inputInitialRef.current?.focus();
|
|
270
272
|
if (showCalendarValueFinal) inputFinalRef.current?.focus();
|
|
271
|
-
if (valueDateName ===
|
|
273
|
+
if (valueDateName === nameDateFinal && valueInitial && dateObj.isBefore(valueInitial)) {
|
|
272
274
|
setValueInitial(dateObj);
|
|
273
275
|
setValueFinal(valueInitial);
|
|
274
276
|
onDateChange({
|
|
275
277
|
initial: dateObj,
|
|
276
278
|
final: valueInitial
|
|
277
279
|
});
|
|
278
|
-
} else if (valueDateName ===
|
|
280
|
+
} else if (valueDateName === nameDateInitial && valueFinal && dateObj.isAfter(valueFinal)) {
|
|
279
281
|
setValueInitial(valueFinal);
|
|
280
282
|
setValueFinal(dateObj);
|
|
281
283
|
onDateChange({
|
|
282
284
|
initial: valueFinal,
|
|
283
285
|
final: dateObj
|
|
284
286
|
});
|
|
285
|
-
} else if (valueDateName ===
|
|
287
|
+
} else if (valueDateName === nameDateInitial) {
|
|
286
288
|
setValueInitial(dateObj);
|
|
287
289
|
onDateChange({
|
|
288
290
|
initial: dateObj,
|
|
@@ -295,7 +297,7 @@ const PeriodPicker = props => {
|
|
|
295
297
|
final: dateObj
|
|
296
298
|
});
|
|
297
299
|
}
|
|
298
|
-
if (valueDateName ===
|
|
300
|
+
if (valueDateName === nameDateInitial && !valueFinal && shouldOpenDropdown) {
|
|
299
301
|
inputFinalRef.current?.focus();
|
|
300
302
|
setTimeout(() => setShowCalendarValueFinal(true), 100);
|
|
301
303
|
}
|
|
@@ -405,7 +407,7 @@ const PeriodPicker = props => {
|
|
|
405
407
|
handlerClose: () => onCloseDateDialog('valueInitial'),
|
|
406
408
|
dialogSize: dialogSize,
|
|
407
409
|
onOpenChange: setShowCalendarValueInitial
|
|
408
|
-
}, getCalendar(valueInitial, calendarColorStyle,
|
|
410
|
+
}, getCalendar(valueInitial, calendarColorStyle, nameDateInitial));
|
|
409
411
|
}
|
|
410
412
|
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
|
|
411
413
|
containerRef: wrapperBaseInputPeriodRef,
|
|
@@ -424,7 +426,7 @@ const PeriodPicker = props => {
|
|
|
424
426
|
handlerClose: () => onCloseDateDialog('valueFinal'),
|
|
425
427
|
dialogSize: dialogSize,
|
|
426
428
|
onOpenChange: setShowCalendarValueFinal
|
|
427
|
-
}, getCalendar(valueFinal, calendarColorStyle,
|
|
429
|
+
}, getCalendar(valueFinal, calendarColorStyle, nameDateFinal));
|
|
428
430
|
}
|
|
429
431
|
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
|
|
430
432
|
containerRef: wrapperBaseInputPeriodRef,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Moment } from 'moment';
|
|
2
|
-
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { ReactNode, RefObject, MouseEvent } from 'react';
|
|
3
3
|
import { ColorStyles } from '../../@types/ColorStyles.js';
|
|
4
4
|
import { Period } from '../../@types/Period.js';
|
|
5
5
|
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
6
6
|
import { CustomInputEvent } from '../base/types.js';
|
|
7
7
|
import '../../@types/Align.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../internals/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
10
|
|
|
11
11
|
type DateTypes = 'today' | 'week' | 'lastweek' | 'last15' | 'month' | 'lastmonth';
|
|
@@ -55,11 +55,14 @@ interface IPeriodPickerProps {
|
|
|
55
55
|
calendarColorStyle?: ColorStyles;
|
|
56
56
|
required?: boolean;
|
|
57
57
|
onChange?: (event?: CustomInputEvent, maskValue?: string, date?: Period) => void;
|
|
58
|
+
onClick?: (event?: MouseEvent) => void;
|
|
58
59
|
disabled?: boolean;
|
|
59
60
|
permissionAttr?: PermissionAttr;
|
|
60
61
|
errorMessages?: string[];
|
|
61
62
|
name?: string;
|
|
62
63
|
hint?: string;
|
|
64
|
+
nameDateInitial?: string;
|
|
65
|
+
nameDateFinal?: string;
|
|
63
66
|
hintPosition?: 'below' | 'onLabelRight';
|
|
64
67
|
onBlur?: (e: CustomInputEvent) => void;
|
|
65
68
|
onFocus?: (e: CustomInputEvent) => void;
|
|
@@ -5,7 +5,7 @@ import '../../@types/DataCombo.js';
|
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import '../../@types/Align.js';
|
|
7
7
|
import '../../@types/Period.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../internals/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
10
|
import '../../drawer/types.js';
|
|
11
11
|
import '../../@types/Icon.js';
|
|
@@ -26,9 +26,10 @@ const SearchField = props => {
|
|
|
26
26
|
const {
|
|
27
27
|
resetButton = true,
|
|
28
28
|
advancedFilterProps = {},
|
|
29
|
-
value
|
|
29
|
+
value,
|
|
30
|
+
drawerFilterIsOpened = false
|
|
30
31
|
} = props;
|
|
31
|
-
const [advancedFilterOpened, setAdvancedFilterOpened] = (0, _react.useState)(
|
|
32
|
+
const [advancedFilterOpened, setAdvancedFilterOpened] = (0, _react.useState)(drawerFilterIsOpened);
|
|
32
33
|
const [valorCampo, setValorCampo] = (0, _react.useState)('');
|
|
33
34
|
const [onDenied, setOnDenied] = (0, _react.useState)();
|
|
34
35
|
const {
|
|
@@ -107,6 +108,9 @@ const SearchField = props => {
|
|
|
107
108
|
setValorCampo(value);
|
|
108
109
|
}
|
|
109
110
|
}, [value]);
|
|
111
|
+
(0, _react.useEffect)(() => {
|
|
112
|
+
setAdvancedFilterOpened(drawerFilterIsOpened);
|
|
113
|
+
}, [drawerFilterIsOpened]);
|
|
110
114
|
if (onDenied && onDenied.unvisible) {
|
|
111
115
|
return null;
|
|
112
116
|
}
|
|
@@ -5,7 +5,7 @@ import '../../@types/DataCombo.js';
|
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import '../../@types/Align.js';
|
|
7
7
|
import '../../@types/Period.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../internals/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
10
|
import '../../drawer/types.js';
|
|
11
11
|
import '../../@types/Icon.js';
|
|
@@ -5,7 +5,7 @@ import '../../@types/DataCombo.js';
|
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import '../../@types/Align.js';
|
|
7
7
|
import '../../@types/Period.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../internals/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
10
|
import '../../drawer/types.js';
|
|
11
11
|
import '../../@types/Icon.js';
|
|
@@ -6,7 +6,7 @@ import '../../@types/DataCombo.js';
|
|
|
6
6
|
import '../base/types.js';
|
|
7
7
|
import '../../@types/Align.js';
|
|
8
8
|
import '../../@types/Period.js';
|
|
9
|
-
import '../../
|
|
9
|
+
import '../../internals/types.js';
|
|
10
10
|
import '../../@types/Position.js';
|
|
11
11
|
import '../../drawer/types.js';
|
|
12
12
|
import '../../@types/Icon.js';
|
|
@@ -5,7 +5,7 @@ import '../../@types/PermissionAttr.js';
|
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../@types/Period.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../internals/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
10
|
|
|
11
11
|
declare const SelectField: (props: ISelectFieldProps) => JSX.Element;
|
|
@@ -5,7 +5,7 @@ import '../../../@types/PermissionAttr.js';
|
|
|
5
5
|
import '../../base/types.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../../@types/Period.js';
|
|
8
|
-
import '../../../
|
|
8
|
+
import '../../../internals/types.js';
|
|
9
9
|
import '../../../@types/Position.js';
|
|
10
10
|
|
|
11
11
|
declare const Selecteds: ({ currents, descriptionKey, idKey, disabled, handlerOnUnselect, }: ISelectedsMultipleProps) => JSX.Element;
|
|
@@ -5,7 +5,7 @@ import '../../../@types/PermissionAttr.js';
|
|
|
5
5
|
import '../../base/types.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../../@types/Period.js';
|
|
8
|
-
import '../../../
|
|
8
|
+
import '../../../internals/types.js';
|
|
9
9
|
import '../../../@types/Position.js';
|
|
10
10
|
|
|
11
11
|
declare const MultipleSelect: (props: IMultipleSelectProps) => JSX.Element;
|
|
@@ -5,7 +5,7 @@ import '../../../@types/PermissionAttr.js';
|
|
|
5
5
|
import '../../base/types.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../../@types/Period.js';
|
|
8
|
-
import '../../../
|
|
8
|
+
import '../../../internals/types.js';
|
|
9
9
|
import '../../../@types/Position.js';
|
|
10
10
|
|
|
11
11
|
declare const SimpleSelect: (props: ISimpleSelectProps) => JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
|
4
4
|
import { CustomInputEvent } from '../base/types.js';
|
|
5
5
|
import { MutableRefObject } from 'react';
|
|
6
6
|
import '../../@types/Period.js';
|
|
7
|
-
import '../../
|
|
7
|
+
import '../../internals/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
type AllOptions = {
|
|
@@ -4,7 +4,7 @@ import '../../@types/PermissionAttr.js';
|
|
|
4
4
|
import '../base/types.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../@types/Align.js';
|
|
7
|
-
import '../../
|
|
7
|
+
import '../../internals/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
declare const TextField: (props: ITextField) => JSX.Element;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Period } from '../../@types/Period.js';
|
|
2
2
|
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
3
3
|
import { IBaseProps, CustomInputEvent } from '../base/types.js';
|
|
4
|
+
import { WithTooltipProps } from '../../internals/types.js';
|
|
4
5
|
import 'react';
|
|
5
6
|
import '../../@types/Align.js';
|
|
6
|
-
import '../../tooltip/types.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type CommonProperties = Pick<WithTooltipProps, 'tooltip' | 'tooltipPosition' | 'tooltipWidth'>;
|
|
10
|
+
interface ITextField extends IBaseProps, CommonProperties {
|
|
10
11
|
value?: string | string[];
|
|
11
12
|
required?: boolean;
|
|
12
13
|
name?: string;
|
|
@@ -4,7 +4,7 @@ import 'react';
|
|
|
4
4
|
import '../../@types/Align.js';
|
|
5
5
|
import '../../@types/Period.js';
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
|
-
import '../../
|
|
7
|
+
import '../../internals/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
declare const TextArea: (props: ITextAreaProps) => JSX.Element;
|
|
@@ -3,7 +3,7 @@ import 'react';
|
|
|
3
3
|
import '../../@types/Align.js';
|
|
4
4
|
import '../../@types/Period.js';
|
|
5
5
|
import '../../@types/PermissionAttr.js';
|
|
6
|
-
import '../../
|
|
6
|
+
import '../../internals/types.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
8
8
|
|
|
9
9
|
interface ITextAreaProps extends IBaseProps {
|
package/lib/inputs/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { IBaseProps, CustomInputEvent } from './base/types.js';
|
|
|
5
5
|
import { IDrawerProps } from '../drawer/types.js';
|
|
6
6
|
import { TextAlign } from '../@types/Align.js';
|
|
7
7
|
import '../@types/Period.js';
|
|
8
|
-
import '../
|
|
8
|
+
import '../internals/types.js';
|
|
9
9
|
import '../@types/Position.js';
|
|
10
10
|
import '../@types/Icon.js';
|
|
11
11
|
import '../icons/helper.js';
|
|
@@ -31,6 +31,7 @@ interface ISearchProps extends IBaseProps {
|
|
|
31
31
|
rounded?: boolean;
|
|
32
32
|
inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null>;
|
|
33
33
|
style?: CSSProperties;
|
|
34
|
+
drawerFilterIsOpened?: boolean;
|
|
34
35
|
}
|
|
35
36
|
interface IDropdownProps {
|
|
36
37
|
children: ReactNode | ReactNode[];
|
package/lib/internals/types.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { OnDenied } from '../@types/PermissionAttr.js';
|
|
3
|
+
import { Position } from '../@types/Position.js';
|
|
4
|
+
|
|
5
|
+
interface WithTooltipProps {
|
|
6
|
+
tooltipWidth?: string | number;
|
|
7
|
+
space?: number;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
tooltipPosition?: Exclude<Position, 'center'>;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
handlerSetOnDeniedText?: (onDeniedValue: OnDenied) => void;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ITooltipContext {
|
|
15
|
+
handlerSetOnDeniedText: (text: string) => void;
|
|
16
|
+
}
|
|
1
17
|
interface GetDisplayNameParams {
|
|
2
18
|
displayName?: string;
|
|
3
19
|
name?: string;
|
|
@@ -6,4 +22,4 @@ interface HasToolTipParams {
|
|
|
6
22
|
tooltip?: string;
|
|
7
23
|
}
|
|
8
24
|
|
|
9
|
-
export { GetDisplayNameParams, HasToolTipParams };
|
|
25
|
+
export { GetDisplayNameParams, HasToolTipParams, ITooltipContext, WithTooltipProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { ITooltipContext, WithTooltipProps } from './types.js';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
|
|
6
|
+
declare const TooltipContext: React__default.Context<ITooltipContext>;
|
|
7
|
+
declare const withTooltip: <ComponentProps extends WithTooltipProps>(WrappedComponent: React__default.ComponentType<ComponentProps>) => {
|
|
8
|
+
(props: ComponentProps): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { TooltipContext, withTooltip as default };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.TooltipContext = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
+
const TOOLTIP_INITIAL_HEIGHT = 40;
|
|
14
|
+
const hasTooltip = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
tooltip
|
|
17
|
+
} = _ref;
|
|
18
|
+
return tooltip;
|
|
19
|
+
};
|
|
20
|
+
const TooltipContext = exports.TooltipContext = /*#__PURE__*/_react.default.createContext({});
|
|
21
|
+
const getDisplayName = _ref2 => {
|
|
22
|
+
let {
|
|
23
|
+
displayName,
|
|
24
|
+
name
|
|
25
|
+
} = _ref2;
|
|
26
|
+
return displayName || name || 'Component';
|
|
27
|
+
};
|
|
28
|
+
const withTooltip = WrappedComponent => {
|
|
29
|
+
const EnhancedComponent = props => {
|
|
30
|
+
const {
|
|
31
|
+
tooltip,
|
|
32
|
+
tooltipWidth = 'auto',
|
|
33
|
+
space = 20,
|
|
34
|
+
tooltipPosition = 'bottom',
|
|
35
|
+
errorMessage
|
|
36
|
+
} = props;
|
|
37
|
+
const [stateTooltipPosition, setStateTooltipPosition] = (0, _react.useState)(tooltipPosition);
|
|
38
|
+
const [onDeniedText, setOnDeniedText] = (0, _react.useState)('');
|
|
39
|
+
const [tooltipStyle, setTooltipStyle] = (0, _react.useState)('');
|
|
40
|
+
const [showTooltip, setShowTooltip] = (0, _react.useState)(false);
|
|
41
|
+
const [tooltipDimensions, setTooltipDimensions] = (0, _react.useState)({
|
|
42
|
+
width: tooltipWidth,
|
|
43
|
+
height: TOOLTIP_INITIAL_HEIGHT
|
|
44
|
+
});
|
|
45
|
+
const targetElement = (0, _react.useRef)(null);
|
|
46
|
+
const tooltipElement = (0, _react.useRef)(null);
|
|
47
|
+
const onMouseOver = e => {
|
|
48
|
+
if (targetElement.current && targetElement.current.contains(e.target)) {
|
|
49
|
+
setShowTooltip(true);
|
|
50
|
+
} else setShowTooltip(false);
|
|
51
|
+
};
|
|
52
|
+
const onMouseOut = () => {
|
|
53
|
+
setShowTooltip(false);
|
|
54
|
+
};
|
|
55
|
+
const onAnyScroll = () => {
|
|
56
|
+
setShowTooltip(false);
|
|
57
|
+
};
|
|
58
|
+
(0, _react.useEffect)(() => {
|
|
59
|
+
if (hasTooltip(props) || onDeniedText) {
|
|
60
|
+
if (errorMessage) {
|
|
61
|
+
setShowTooltip(true);
|
|
62
|
+
} else {
|
|
63
|
+
setShowTooltip(false);
|
|
64
|
+
document.addEventListener('mouseover', onMouseOver);
|
|
65
|
+
document.addEventListener('scroll', onAnyScroll, true);
|
|
66
|
+
if (targetElement && targetElement.current) {
|
|
67
|
+
targetElement.current.addEventListener('mouseout', onMouseOut);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return () => {
|
|
72
|
+
if (hasTooltip(props) || onDeniedText) {
|
|
73
|
+
document.removeEventListener('mouseover', onMouseOver);
|
|
74
|
+
document.removeEventListener('scroll', onAnyScroll, true);
|
|
75
|
+
if (targetElement && targetElement.current) {
|
|
76
|
+
targetElement.current.removeEventListener('mouseout', onMouseOut);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}, [errorMessage, tooltip, onDeniedText]);
|
|
81
|
+
(0, _react.useEffect)(() => {
|
|
82
|
+
if (targetElement.current && tooltipElement.current) {
|
|
83
|
+
const {
|
|
84
|
+
width,
|
|
85
|
+
height
|
|
86
|
+
} = tooltipDimensions;
|
|
87
|
+
const targetDimensions = targetElement.current.getBoundingClientRect();
|
|
88
|
+
const targetVerticalCenter = (targetDimensions.top + targetDimensions.bottom) / 2;
|
|
89
|
+
const tooltipClientWidth = tooltipElement.current.clientWidth;
|
|
90
|
+
let style = `width: ${typeof width === 'string' ? width : `${width}px`}`;
|
|
91
|
+
let left = targetDimensions.left + targetDimensions.width / 2 - tooltipClientWidth / 2;
|
|
92
|
+
left = Math.min(left, document.body.clientWidth - tooltipClientWidth - space);
|
|
93
|
+
style += `; left: ${Math.max(space, left)}px`;
|
|
94
|
+
switch (stateTooltipPosition) {
|
|
95
|
+
case 'top':
|
|
96
|
+
if (targetDimensions.top < height) {
|
|
97
|
+
setStateTooltipPosition('bottom');
|
|
98
|
+
} else {
|
|
99
|
+
style += `; top: ${targetDimensions.top + window.scrollY - height - 5}px`;
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
case 'bottom':
|
|
103
|
+
if (window.innerHeight - targetDimensions.bottom < height) {
|
|
104
|
+
setStateTooltipPosition('top');
|
|
105
|
+
} else {
|
|
106
|
+
style += `; top: ${targetDimensions.top + window.scrollY + targetDimensions.height + 5}px`;
|
|
107
|
+
}
|
|
108
|
+
break;
|
|
109
|
+
case 'left':
|
|
110
|
+
if (targetDimensions.left < tooltipClientWidth) {
|
|
111
|
+
if (window.innerWidth - targetDimensions.right < tooltipClientWidth) {
|
|
112
|
+
setStateTooltipPosition('bottom');
|
|
113
|
+
} else {
|
|
114
|
+
setStateTooltipPosition('right');
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
style += `; top: ${targetVerticalCenter + window.scrollY - height / 2}px`;
|
|
118
|
+
style += `; left: ${targetDimensions.left - tooltipClientWidth - 6}px`;
|
|
119
|
+
}
|
|
120
|
+
break;
|
|
121
|
+
case 'right':
|
|
122
|
+
if (window.innerWidth - targetDimensions.right < tooltipClientWidth) {
|
|
123
|
+
setStateTooltipPosition('left');
|
|
124
|
+
} else {
|
|
125
|
+
style += `; top: ${targetVerticalCenter + window.scrollY - height / 2}px`;
|
|
126
|
+
style += `; left: ${targetDimensions.left + targetDimensions.width + 5}px`;
|
|
127
|
+
}
|
|
128
|
+
break;
|
|
129
|
+
default:
|
|
130
|
+
style += '';
|
|
131
|
+
}
|
|
132
|
+
setTooltipStyle(style);
|
|
133
|
+
}
|
|
134
|
+
}, [tooltipDimensions, stateTooltipPosition]);
|
|
135
|
+
(0, _react.useEffect)(() => {
|
|
136
|
+
setStateTooltipPosition(tooltipPosition);
|
|
137
|
+
}, [window.scrollY, window.scrollX, window.innerWidth]);
|
|
138
|
+
const getTooltip = () => {
|
|
139
|
+
if (tooltip || onDeniedText) {
|
|
140
|
+
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
141
|
+
text: onDeniedText || tooltip,
|
|
142
|
+
textError: errorMessage,
|
|
143
|
+
tooltipRef: tooltipElement,
|
|
144
|
+
style: tooltipStyle,
|
|
145
|
+
className: stateTooltipPosition,
|
|
146
|
+
tooltipDimensions: tooltipDimensions,
|
|
147
|
+
handlerSetDimensions: setTooltipDimensions
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return null;
|
|
151
|
+
};
|
|
152
|
+
const getTarget = targetEl => {
|
|
153
|
+
if (!targetElement.current) targetElement.current = targetEl;
|
|
154
|
+
};
|
|
155
|
+
const contextValues = {
|
|
156
|
+
handlerSetOnDeniedText: setOnDeniedText
|
|
157
|
+
};
|
|
158
|
+
if (!hasTooltip(props) && !onDeniedText) {
|
|
159
|
+
return /*#__PURE__*/_react.default.createElement(TooltipContext.Provider, {
|
|
160
|
+
value: contextValues
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement(WrappedComponent, props));
|
|
162
|
+
}
|
|
163
|
+
return /*#__PURE__*/_react.default.createElement(TooltipContext.Provider, {
|
|
164
|
+
value: contextValues
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement(WrappedComponent, _extends({}, props, {
|
|
166
|
+
targetRef: getTarget
|
|
167
|
+
})), showTooltip && getTooltip());
|
|
168
|
+
};
|
|
169
|
+
EnhancedComponent.displayName = `withTooltip(${getDisplayName(WrappedComponent)})`;
|
|
170
|
+
return EnhancedComponent;
|
|
171
|
+
};
|
|
172
|
+
var _default = exports.default = withTooltip;
|
|
@@ -5,8 +5,10 @@ import '../@types/Position.js';
|
|
|
5
5
|
import '../@types/Size.js';
|
|
6
6
|
import '../@types/Icon.js';
|
|
7
7
|
import '../icons/helper.js';
|
|
8
|
-
import '../tooltip/types.js';
|
|
9
8
|
|
|
10
|
-
declare const
|
|
9
|
+
declare const _default: {
|
|
10
|
+
(props: ILabelProps): JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
11
13
|
|
|
12
|
-
export {
|
|
14
|
+
export { _default as default };
|