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
|
@@ -6,14 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _icons = _interopRequireDefault(require("../icons"));
|
|
9
|
+
var _withTooltip = _interopRequireDefault(require("../internals/withTooltip"));
|
|
9
10
|
var _permissionValidations = require("../permissionValidations");
|
|
10
|
-
var _tooltip = require("../tooltip");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
14
14
|
const DefaultLabel = _ref => {
|
|
15
15
|
let {
|
|
16
16
|
style,
|
|
17
|
+
targetRef,
|
|
17
18
|
iconName,
|
|
18
19
|
icon,
|
|
19
20
|
children,
|
|
@@ -25,14 +26,10 @@ const DefaultLabel = _ref => {
|
|
|
25
26
|
iconAlign = 'left',
|
|
26
27
|
bordered,
|
|
27
28
|
permissionAttr,
|
|
28
|
-
skeletonize
|
|
29
|
-
tooltip,
|
|
30
|
-
tooltipPosition,
|
|
31
|
-
tooltipWidth
|
|
29
|
+
skeletonize
|
|
32
30
|
} = _ref;
|
|
33
31
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
|
|
34
32
|
const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
|
|
35
|
-
const labelRef = (0, _react.useRef)(null);
|
|
36
33
|
const getClass = () => `label-component ${className} ${customClass} ${bordered ? '-bordered' : ''} ${disabled ? '-disabled' : ''}
|
|
37
34
|
${skeletonize ? '-skeletonized' : ''}
|
|
38
35
|
${size ? `-${size}` : ''}
|
|
@@ -49,15 +46,10 @@ const DefaultLabel = _ref => {
|
|
|
49
46
|
return null;
|
|
50
47
|
};
|
|
51
48
|
if (!visible || onDenied.unvisible) return null;
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
50
|
style: style,
|
|
54
51
|
className: getClass(),
|
|
55
|
-
ref:
|
|
56
|
-
}, getIcon(), children)
|
|
57
|
-
targetRef: labelRef,
|
|
58
|
-
text: tooltip,
|
|
59
|
-
width: tooltipWidth,
|
|
60
|
-
position: tooltipPosition
|
|
61
|
-
}));
|
|
52
|
+
ref: r => targetRef && targetRef(r)
|
|
53
|
+
}, getIcon(), children);
|
|
62
54
|
};
|
|
63
|
-
var _default = exports.default = DefaultLabel;
|
|
55
|
+
var _default = exports.default = (0, _withTooltip.default)(DefaultLabel);
|
package/lib/labels/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as LabelContainer } from './label_container/index.js';
|
|
2
|
-
import
|
|
2
|
+
import _default from './DefaultLabel.js';
|
|
3
3
|
export { default as DangerLabel } from './DangerLabel.js';
|
|
4
4
|
export { default as PrimaryLabel } from './PrimaryLabel.js';
|
|
5
5
|
export { default as WarningLabel } from './WarningLabel.js';
|
|
@@ -12,8 +12,7 @@ import '../@types/PermissionAttr.js';
|
|
|
12
12
|
import '../@types/Size.js';
|
|
13
13
|
import '../@types/Icon.js';
|
|
14
14
|
import '../icons/helper.js';
|
|
15
|
-
import '../tooltip/types.js';
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
|
|
19
|
-
export {
|
|
18
|
+
export { _default as default };
|
package/lib/labels/types.d.ts
CHANGED
|
@@ -3,16 +3,19 @@ import { PermissionAttr } from '../@types/PermissionAttr.js';
|
|
|
3
3
|
import { Position } from '../@types/Position.js';
|
|
4
4
|
import { Size } from '../@types/Size.js';
|
|
5
5
|
import { IconNames } from '../@types/Icon.js';
|
|
6
|
-
import { ITooltipCommonProps } from '../tooltip/types.js';
|
|
7
6
|
import '../icons/helper.js';
|
|
8
7
|
|
|
9
|
-
interface ILabelProps extends React.HTMLAttributes<HTMLDivElement
|
|
8
|
+
interface ILabelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
9
|
customClass?: string;
|
|
11
10
|
size?: Size;
|
|
12
11
|
iconName?: IconNames;
|
|
13
12
|
iconAlign?: Position;
|
|
14
13
|
icon?: ReactElement;
|
|
14
|
+
targetRef?: (ref: HTMLDivElement | null) => void;
|
|
15
15
|
bordered?: boolean;
|
|
16
|
+
tooltipPosition?: Exclude<Position, 'center'>;
|
|
17
|
+
tooltipWidth?: string | number;
|
|
18
|
+
tooltip?: string;
|
|
16
19
|
visible?: boolean;
|
|
17
20
|
disabled?: boolean;
|
|
18
21
|
permissionAttr?: PermissionAttr | PermissionAttr[];
|
package/lib/list/Header.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import 'react';
|
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Icon.js';
|
|
5
5
|
import '../icons/helper.js';
|
|
6
|
-
import '../tooltip/types.js';
|
|
7
6
|
import '../@types/Position.js';
|
|
8
7
|
|
|
9
8
|
declare const Header: ({ title, children, style, customClass }: IListHeaderProps) => JSX.Element;
|
package/lib/list/Item.d.ts
CHANGED
|
@@ -3,9 +3,11 @@ import 'react';
|
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Icon.js';
|
|
5
5
|
import '../icons/helper.js';
|
|
6
|
-
import '../tooltip/types.js';
|
|
7
6
|
import '../@types/Position.js';
|
|
8
7
|
|
|
9
|
-
declare const
|
|
8
|
+
declare const _default: {
|
|
9
|
+
(props: IListItemProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
10
12
|
|
|
11
|
-
export {
|
|
13
|
+
export { _default as default };
|
package/lib/list/Item.js
CHANGED
|
@@ -11,8 +11,8 @@ var _checkbox = _interopRequireDefault(require("../checkbox"));
|
|
|
11
11
|
var _helpers = require("./helpers");
|
|
12
12
|
var _withDropdown = require("../dropdown/withDropdown");
|
|
13
13
|
var constants = _interopRequireWildcard(require("../internals/constants"));
|
|
14
|
+
var _withTooltip = _interopRequireWildcard(require("../internals/withTooltip"));
|
|
14
15
|
var _permissionValidations = require("../permissionValidations");
|
|
15
|
-
var _tooltip = require("../tooltip");
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
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); }
|
|
18
18
|
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; }
|
|
@@ -40,11 +40,8 @@ const Item = props => {
|
|
|
40
40
|
visible = true,
|
|
41
41
|
permissionAttr,
|
|
42
42
|
skeletonize,
|
|
43
|
+
targetRef,
|
|
43
44
|
target,
|
|
44
|
-
tooltip,
|
|
45
|
-
tooltipPosition,
|
|
46
|
-
tooltipWidth,
|
|
47
|
-
onMouseDown,
|
|
48
45
|
onDeniedText = 'Permissão Negada! Consulte o Administrador do sistema.'
|
|
49
46
|
} = props;
|
|
50
47
|
const {
|
|
@@ -55,9 +52,11 @@ const Item = props => {
|
|
|
55
52
|
selectOnEnter
|
|
56
53
|
} = (0, _react.useContext)(_helpers.ListContext);
|
|
57
54
|
const dropdownContext = (0, _react.useContext)(_withDropdown.WithDropdownContext);
|
|
55
|
+
const {
|
|
56
|
+
handlerSetOnDeniedText
|
|
57
|
+
} = (0, _react.useContext)(_withTooltip.TooltipContext);
|
|
58
58
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
|
|
59
59
|
const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
|
|
60
|
-
const itemRef = (0, _react.useRef)(null);
|
|
61
60
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
62
61
|
const disabledByPermission = onDenied.disabled;
|
|
63
62
|
const shouldDisable = () => disabled || onDenied.disabled;
|
|
@@ -118,6 +117,9 @@ const Item = props => {
|
|
|
118
117
|
document.removeEventListener('keydown', onKeyDown);
|
|
119
118
|
};
|
|
120
119
|
}, [url, selectedItemId, itemId]);
|
|
120
|
+
(0, _react.useEffect)(() => {
|
|
121
|
+
if (disabledByPermission) handlerSetOnDeniedText(onDeniedText);
|
|
122
|
+
}, [disabledByPermission]);
|
|
121
123
|
const renderCheckBox = (0, _react.useMemo)(() => {
|
|
122
124
|
if (!disabledByPermission && displayCheckbox) {
|
|
123
125
|
return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
@@ -131,12 +133,11 @@ const Item = props => {
|
|
|
131
133
|
return null;
|
|
132
134
|
}, [disabledByPermission && displayCheckbox]);
|
|
133
135
|
if (!visible || onDenied.unvisible) return null;
|
|
134
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
136
|
+
return /*#__PURE__*/_react.default.createElement("li", _extends({
|
|
135
137
|
ref: ref => {
|
|
136
|
-
|
|
138
|
+
if (targetRef) targetRef(ref);
|
|
137
139
|
return itemId && selectedItemId === itemId ? selectedItemRef : null;
|
|
138
140
|
},
|
|
139
|
-
onMouseDown: onMouseDown,
|
|
140
141
|
style: style,
|
|
141
142
|
className: `item-container ${hovered && 'hovered'}
|
|
142
143
|
${itemId && selectedItemId === itemId ? '-activedlist' : ''}`
|
|
@@ -156,12 +157,6 @@ const Item = props => {
|
|
|
156
157
|
className: `${subText && 'subtext'}`
|
|
157
158
|
}, subText), children), (rightIconName || rightIcon || rightElement || disabledByPermission) && /*#__PURE__*/_react.default.createElement("div", {
|
|
158
159
|
className: `${getClass()} -icon-right`
|
|
159
|
-
}, getIcon(rightIconName, rightIcon), rightElement))
|
|
160
|
-
targetRef: itemRef,
|
|
161
|
-
text: tooltip,
|
|
162
|
-
width: tooltipWidth,
|
|
163
|
-
position: tooltipPosition,
|
|
164
|
-
onDeniedText: disabledByPermission ? onDeniedText : undefined
|
|
165
|
-
}));
|
|
160
|
+
}, getIcon(rightIconName, rightIcon), rightElement));
|
|
166
161
|
};
|
|
167
|
-
var _default = exports.default = Item;
|
|
162
|
+
var _default = exports.default = (0, _withTooltip.default)(Item);
|
package/lib/list/helpers.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { IListContext } from './types.js';
|
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Icon.js';
|
|
5
5
|
import '../icons/helper.js';
|
|
6
|
-
import '../tooltip/types.js';
|
|
7
6
|
import '../@types/Position.js';
|
|
8
7
|
|
|
9
8
|
declare const ListContext: React__default.Context<IListContext>;
|
package/lib/list/index.d.ts
CHANGED
package/lib/list/types.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ReactNode, ReactElement, CSSProperties, ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
2
|
import { PermissionAttr } from '../@types/PermissionAttr.js';
|
|
3
3
|
import { IconNames } from '../@types/Icon.js';
|
|
4
|
-
import {
|
|
4
|
+
import { Position } from '../@types/Position.js';
|
|
5
5
|
import '../icons/helper.js';
|
|
6
|
-
import '../@types/Position.js';
|
|
7
6
|
|
|
8
7
|
type ItemId = string;
|
|
9
8
|
interface KeyboardEvent {
|
|
@@ -31,7 +30,7 @@ interface IListProps {
|
|
|
31
30
|
skeletonItens?: number;
|
|
32
31
|
selectOnEnter?: boolean;
|
|
33
32
|
}
|
|
34
|
-
interface IListItemProps
|
|
33
|
+
interface IListItemProps {
|
|
35
34
|
text?: string;
|
|
36
35
|
style?: object;
|
|
37
36
|
separator?: boolean;
|
|
@@ -55,8 +54,11 @@ interface IListItemProps extends ITooltipCommonProps {
|
|
|
55
54
|
permissionAttr?: PermissionAttr | PermissionAttr[];
|
|
56
55
|
selectOnEnter?: boolean;
|
|
57
56
|
skeletonize?: boolean;
|
|
57
|
+
targetRef?: (ref: HTMLLIElement) => void;
|
|
58
|
+
tooltipPosition?: Exclude<Position, 'center'>;
|
|
59
|
+
tooltipWidth?: string | number;
|
|
60
|
+
tooltip?: string;
|
|
58
61
|
onDeniedText?: string;
|
|
59
|
-
onMouseDown?: (event?: React.MouseEvent<HTMLLIElement>) => void;
|
|
60
62
|
}
|
|
61
63
|
interface IListContext {
|
|
62
64
|
selectable: boolean;
|
|
@@ -2,10 +2,10 @@ import { IExpandMenuProps } from './types.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../@types/PermissionAttr.js';
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
|
+
import '../../internals/types.js';
|
|
6
|
+
import '../../@types/Position.js';
|
|
5
7
|
import '../../@types/Icon.js';
|
|
6
8
|
import '../../icons/helper.js';
|
|
7
|
-
import '../../tooltip/types.js';
|
|
8
|
-
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
declare const ExpandMenu: ({ onExpandMenu, expandMenuCustomClass, iconName }: IExpandMenuProps) => JSX.Element;
|
|
11
11
|
|
|
@@ -2,11 +2,14 @@ import { IMenuLinkProps } from './types.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../@types/PermissionAttr.js';
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
|
+
import '../../internals/types.js';
|
|
6
|
+
import '../../@types/Position.js';
|
|
5
7
|
import '../../@types/Icon.js';
|
|
6
8
|
import '../../icons/helper.js';
|
|
7
|
-
import '../../tooltip/types.js';
|
|
8
|
-
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
|
-
declare const
|
|
10
|
+
declare const _default: {
|
|
11
|
+
(props: IMenuLinkProps): JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
11
14
|
|
|
12
|
-
export {
|
|
15
|
+
export { _default as default };
|
|
@@ -4,35 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactRouterDom = require("react-router-dom");
|
|
9
|
-
var
|
|
10
|
-
function
|
|
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; }
|
|
9
|
+
var _withTooltip = _interopRequireDefault(require("../../internals/withTooltip"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
const MenuLink = _ref => {
|
|
13
12
|
let {
|
|
14
13
|
url,
|
|
15
14
|
children,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
tooltipPosition,
|
|
19
|
-
errorMessage,
|
|
20
|
-
tooltipWidth
|
|
15
|
+
targetRef,
|
|
16
|
+
disabled
|
|
21
17
|
} = _ref;
|
|
22
|
-
const linkRef = (0, _react.useRef)(null);
|
|
23
18
|
if (url && !disabled) {
|
|
24
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
|
|
25
20
|
to: url,
|
|
26
21
|
className: "menulink",
|
|
27
|
-
ref:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
position: tooltipPosition,
|
|
32
|
-
width: tooltipWidth,
|
|
33
|
-
textError: errorMessage
|
|
34
|
-
}));
|
|
22
|
+
ref: r => {
|
|
23
|
+
if (targetRef) targetRef(r);
|
|
24
|
+
}
|
|
25
|
+
}, children);
|
|
35
26
|
}
|
|
36
27
|
return children;
|
|
37
28
|
};
|
|
38
|
-
var _default = exports.default = MenuLink;
|
|
29
|
+
var _default = exports.default = (0, _withTooltip.default)(MenuLink);
|
|
@@ -2,10 +2,10 @@ import { INavMenuGroupProps } from './types.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../@types/PermissionAttr.js';
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
|
+
import '../../internals/types.js';
|
|
6
|
+
import '../../@types/Position.js';
|
|
5
7
|
import '../../@types/Icon.js';
|
|
6
8
|
import '../../icons/helper.js';
|
|
7
|
-
import '../../tooltip/types.js';
|
|
8
|
-
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
declare const NavMenuGroup: ({ children, scrollable, style }: INavMenuGroupProps) => JSX.Element;
|
|
11
11
|
|
|
@@ -2,11 +2,14 @@ import { INavMenuItemProps } from './types.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../@types/PermissionAttr.js';
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
|
+
import '../../internals/types.js';
|
|
6
|
+
import '../../@types/Position.js';
|
|
5
7
|
import '../../@types/Icon.js';
|
|
6
8
|
import '../../icons/helper.js';
|
|
7
|
-
import '../../tooltip/types.js';
|
|
8
|
-
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
|
-
declare const
|
|
10
|
+
declare const _default: {
|
|
11
|
+
(props: INavMenuItemProps): JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
11
14
|
|
|
12
|
-
export {
|
|
15
|
+
export { _default as default };
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _withTooltip = _interopRequireDefault(require("../../internals/withTooltip"));
|
|
8
9
|
var _icons = _interopRequireDefault(require("../../icons"));
|
|
9
|
-
var _tooltip = require("../../tooltip");
|
|
10
10
|
var _MenuLink = _interopRequireDefault(require("./MenuLink"));
|
|
11
11
|
var _helpers = require("./helpers");
|
|
12
12
|
var _permissionValidations = require("../../permissionValidations");
|
|
@@ -26,14 +26,11 @@ const NavMenuItem = props => {
|
|
|
26
26
|
maxWidth = '90%',
|
|
27
27
|
minWidth = 500,
|
|
28
28
|
columnsQtty,
|
|
29
|
+
targetRef,
|
|
29
30
|
disableDefaultStyle = false,
|
|
30
31
|
showDropdownOnClick = false,
|
|
31
32
|
style,
|
|
32
|
-
customClassForDropdown
|
|
33
|
-
tooltip,
|
|
34
|
-
tooltipPosition,
|
|
35
|
-
tooltipWidth,
|
|
36
|
-
errorMessage
|
|
33
|
+
customClassForDropdown
|
|
37
34
|
} = props;
|
|
38
35
|
const [showSubMenu, setShowSubMenu] = (0, _react.useState)(false);
|
|
39
36
|
const [targetDimensions, setTargetDimensions] = (0, _react.useState)({});
|
|
@@ -96,7 +93,10 @@ const NavMenuItem = props => {
|
|
|
96
93
|
value: contextValues
|
|
97
94
|
}, /*#__PURE__*/_react.default.createElement("li", {
|
|
98
95
|
style: style,
|
|
99
|
-
ref:
|
|
96
|
+
ref: r => {
|
|
97
|
+
menuItemRef.current = r;
|
|
98
|
+
if (targetRef) targetRef(r);
|
|
99
|
+
},
|
|
100
100
|
className: `item ${url && !disabled && '-withlink'} ${customClass} ${disabled && '-disabled'}`,
|
|
101
101
|
onMouseEnter: onMouseEnter,
|
|
102
102
|
onMouseLeave: () => {
|
|
@@ -110,7 +110,9 @@ const NavMenuItem = props => {
|
|
|
110
110
|
}
|
|
111
111
|
}, /*#__PURE__*/_react.default.createElement(_MenuLink.default, _extends({
|
|
112
112
|
disabled: disabled
|
|
113
|
-
}, props
|
|
113
|
+
}, props, {
|
|
114
|
+
targetRef: null
|
|
115
|
+
}), /*#__PURE__*/_react.default.createElement(_react.Fragment, null, iconName && /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
114
116
|
name: iconName,
|
|
115
117
|
size: menuSize === 'small' && 16 || menuSize === 'medium' && 24 || menuSize === 'large' && 32 || 16,
|
|
116
118
|
customClassForContainer: "menuicon-container",
|
|
@@ -139,12 +141,6 @@ const NavMenuItem = props => {
|
|
|
139
141
|
style: {
|
|
140
142
|
gridTemplateColumns: `repeat(${columnsQtty}, 1fr)`
|
|
141
143
|
}
|
|
142
|
-
}, children)))
|
|
143
|
-
targetRef: menuItemRef,
|
|
144
|
-
text: tooltip,
|
|
145
|
-
position: tooltipPosition,
|
|
146
|
-
width: tooltipWidth,
|
|
147
|
-
textError: errorMessage
|
|
148
|
-
}));
|
|
144
|
+
}, children))));
|
|
149
145
|
};
|
|
150
|
-
var _default = exports.default = NavMenuItem;
|
|
146
|
+
var _default = exports.default = (0, _withTooltip.default)(NavMenuItem);
|
|
@@ -2,10 +2,10 @@ import { INavSubMenuItemProps } from './types.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../@types/PermissionAttr.js';
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
|
+
import '../../internals/types.js';
|
|
6
|
+
import '../../@types/Position.js';
|
|
5
7
|
import '../../@types/Icon.js';
|
|
6
8
|
import '../../icons/helper.js';
|
|
7
|
-
import '../../tooltip/types.js';
|
|
8
|
-
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
declare const NavSubMenuItem: ({ title, url, permissionAttr }: INavSubMenuItemProps) => JSX.Element | null;
|
|
11
11
|
|
|
@@ -2,10 +2,10 @@ import React__default from 'react';
|
|
|
2
2
|
import { ISubMenuContext, ISideNavContext } from './types.js';
|
|
3
3
|
import '../../@types/PermissionAttr.js';
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
|
+
import '../../internals/types.js';
|
|
6
|
+
import '../../@types/Position.js';
|
|
5
7
|
import '../../@types/Icon.js';
|
|
6
8
|
import '../../icons/helper.js';
|
|
7
|
-
import '../../tooltip/types.js';
|
|
8
|
-
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
declare const getCssClassMenu: (isExpanded?: boolean, size?: string) => string;
|
|
11
11
|
declare const SubMenuContext: React__default.Context<ISubMenuContext>;
|
|
@@ -6,10 +6,10 @@ import { ISideNavProps } from './types.js';
|
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../@types/PermissionAttr.js';
|
|
8
8
|
import '../../@types/Size.js';
|
|
9
|
+
import '../../internals/types.js';
|
|
10
|
+
import '../../@types/Position.js';
|
|
9
11
|
import '../../@types/Icon.js';
|
|
10
12
|
import '../../icons/helper.js';
|
|
11
|
-
import '../../tooltip/types.js';
|
|
12
|
-
import '../../@types/Position.js';
|
|
13
13
|
|
|
14
14
|
declare const SideNav: (props: ISideNavProps) => JSX.Element;
|
|
15
15
|
|
|
@@ -2,10 +2,10 @@ import { IEmptyListProps } from '../types.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../../@types/PermissionAttr.js';
|
|
4
4
|
import '../../../@types/Size.js';
|
|
5
|
+
import '../../../internals/types.js';
|
|
6
|
+
import '../../../@types/Position.js';
|
|
5
7
|
import '../../../@types/Icon.js';
|
|
6
8
|
import '../../../icons/helper.js';
|
|
7
|
-
import '../../../tooltip/types.js';
|
|
8
|
-
import '../../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
declare const EmptyList: ({ info, visible, }: IEmptyListProps) => JSX.Element;
|
|
11
11
|
|
|
@@ -2,10 +2,10 @@ import React__default from 'react';
|
|
|
2
2
|
import { IPopupMenuSearchProps } from '../types.js';
|
|
3
3
|
import '../../../@types/PermissionAttr.js';
|
|
4
4
|
import '../../../@types/Size.js';
|
|
5
|
+
import '../../../internals/types.js';
|
|
6
|
+
import '../../../@types/Position.js';
|
|
5
7
|
import '../../../@types/Icon.js';
|
|
6
8
|
import '../../../icons/helper.js';
|
|
7
|
-
import '../../../tooltip/types.js';
|
|
8
|
-
import '../../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
declare const PopupMenuSearch: (props: IPopupMenuSearchProps) => React__default.ReactPortal;
|
|
11
11
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactNode, ReactElement, CSSProperties } from 'react';
|
|
2
2
|
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
3
3
|
import { Size } from '../../@types/Size.js';
|
|
4
|
+
import { WithTooltipProps } from '../../internals/types.js';
|
|
4
5
|
import { IconNames } from '../../@types/Icon.js';
|
|
5
|
-
import { ITooltipCommonProps } from '../../tooltip/types.js';
|
|
6
|
-
import '../../icons/helper.js';
|
|
7
6
|
import '../../@types/Position.js';
|
|
7
|
+
import '../../icons/helper.js';
|
|
8
8
|
|
|
9
9
|
interface ISideNavProps {
|
|
10
10
|
children: ReactNode;
|
|
@@ -30,18 +30,18 @@ interface IMenuItemContent {
|
|
|
30
30
|
content: string;
|
|
31
31
|
url: string;
|
|
32
32
|
}
|
|
33
|
-
interface IMenuLinkProps extends
|
|
33
|
+
interface IMenuLinkProps extends WithTooltipProps {
|
|
34
34
|
children: ReactElement;
|
|
35
35
|
url?: string;
|
|
36
|
+
targetRef?: ((ref: HTMLAnchorElement | null) => void) | null;
|
|
36
37
|
disabled?: boolean;
|
|
37
|
-
errorMessage?: string;
|
|
38
38
|
}
|
|
39
39
|
interface INavMenuGroupProps {
|
|
40
40
|
children: ReactNode;
|
|
41
41
|
scrollable?: boolean;
|
|
42
42
|
style?: CSSProperties;
|
|
43
43
|
}
|
|
44
|
-
interface INavMenuItemProps extends
|
|
44
|
+
interface INavMenuItemProps extends WithTooltipProps {
|
|
45
45
|
children?: ReactNode;
|
|
46
46
|
title?: string;
|
|
47
47
|
iconName?: IconNames;
|
|
@@ -52,11 +52,11 @@ interface INavMenuItemProps extends ITooltipCommonProps {
|
|
|
52
52
|
minWidth?: string | number;
|
|
53
53
|
maxWidth?: string | number;
|
|
54
54
|
columnsQtty?: number;
|
|
55
|
+
targetRef?: (ref: HTMLLIElement | null) => void;
|
|
55
56
|
disableDefaultStyle?: boolean;
|
|
56
57
|
showDropdownOnClick?: boolean;
|
|
57
58
|
style?: CSSProperties;
|
|
58
59
|
customClassForDropdown?: string;
|
|
59
|
-
errorMessage?: string;
|
|
60
60
|
}
|
|
61
61
|
interface INavSubMenuItemProps {
|
|
62
62
|
title: string;
|
|
@@ -9,20 +9,11 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
9
9
|
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; }
|
|
10
10
|
const PopoverText = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
11
11
|
let {
|
|
12
|
-
children
|
|
13
|
-
text
|
|
12
|
+
children
|
|
14
13
|
} = _ref;
|
|
15
|
-
const hintRef = (0, _react.useRef)(null);
|
|
16
|
-
(0, _react.useImperativeHandle)(ref, () => hintRef.current, [hintRef.current]);
|
|
17
|
-
(0, _react.useEffect)(() => {
|
|
18
|
-
if (hintRef.current && text !== undefined) {
|
|
19
|
-
hintRef.current.innerHTML = text;
|
|
20
|
-
}
|
|
21
|
-
}, [text, hintRef.current]);
|
|
22
14
|
return /*#__PURE__*/_react.default.createElement("p", {
|
|
23
15
|
className: "text",
|
|
24
|
-
ref:
|
|
25
|
-
"data-testid": "popover-text"
|
|
16
|
+
ref: ref
|
|
26
17
|
}, children);
|
|
27
18
|
});
|
|
28
19
|
PopoverText.displayName = 'PopoverText';
|
package/lib/popover/index.js
CHANGED