linear-react-components-ui 1.1.22 → 1.1.24-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/@types/ColorStyles.d.ts +2 -1
- package/lib/@types/Position.d.ts +2 -1
- package/lib/BaseMask-3d5d581d.d.ts +24 -0
- package/lib/BaseNumber-797088d7.d.ts +23 -0
- package/lib/Cnpj-1602be21.d.ts +18 -0
- package/lib/Cpf-4d6b9079.d.ts +18 -0
- package/lib/Currency-b33d3a22.d.ts +18 -0
- package/lib/Decimal-55e836d5.d.ts +13 -0
- package/lib/Number-9c6aceff.d.ts +20 -0
- package/lib/Phone-79e5e3b4.d.ts +18 -0
- package/lib/ZipCode-8c2e9d8b.d.ts +13 -0
- package/lib/assets/styles/checkbox2.scss +199 -0
- package/lib/assets/styles/colorpicker.scss +1 -6
- package/lib/assets/styles/colors.scss +48 -12
- package/lib/assets/styles/datepicker2.scss +338 -0
- package/lib/assets/styles/label.scss +4 -2
- package/lib/assets/styles/select.scss +19 -15
- package/lib/assets/styles/selectfield.scss +409 -0
- package/lib/assets/styles/slot.scss +34 -0
- package/lib/assets/styles/textfield.scss +148 -0
- package/lib/buttons/ActivateButton.d.ts +1 -0
- package/lib/buttons/AddButton.d.ts +1 -0
- package/lib/buttons/Button.d.ts +1 -0
- package/lib/buttons/CancelButton.d.ts +1 -0
- package/lib/buttons/DangerButton.d.ts +1 -0
- package/lib/buttons/DefaultButton.d.ts +1 -0
- package/lib/buttons/DefaultButton.js +20 -12
- package/lib/buttons/DestroyButton.d.ts +1 -0
- package/lib/buttons/EditButton.d.ts +1 -0
- package/lib/buttons/InactivateButton.d.ts +1 -0
- package/lib/buttons/InfoButton.d.ts +1 -0
- package/lib/buttons/PrimaryButton.d.ts +1 -0
- package/lib/buttons/RestoreButton.d.ts +1 -0
- package/lib/buttons/SaveButton.d.ts +1 -0
- package/lib/buttons/SuccessButton.d.ts +1 -0
- package/lib/buttons/WarningButton.d.ts +1 -0
- package/lib/buttons/index.d.ts +1 -0
- package/lib/buttons/split_button/index.d.ts +1 -0
- package/lib/buttons/types.d.ts +2 -5
- package/lib/drawer/Drawer.js +10 -6
- 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/form2/helpers.d.ts +8 -0
- package/lib/form2/helpers.js +41 -0
- package/lib/form2/index.d.ts +9 -0
- package/lib/form2/index.js +36 -0
- package/lib/form2/types.d.ts +125 -0
- package/lib/form2/types.js +5 -0
- package/lib/form2/useForm/index.d.ts +5 -0
- package/lib/form2/useForm/index.js +203 -0
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +4 -0
- package/lib/icons/index.d.ts +4 -6
- package/lib/icons/index.js +14 -9
- package/lib/icons/types.d.ts +3 -6
- package/lib/index-18a64236.d.ts +23 -0
- package/lib/index-368f781f.d.ts +15 -0
- package/lib/index-43ad8140.d.ts +41 -0
- package/lib/index-772f9f1a.d.ts +44 -0
- package/lib/index-8a59cf4b.d.ts +23 -0
- package/lib/index-c9247c1f.d.ts +15 -0
- package/lib/index.d.ts +1 -0
- package/lib/inputs/base/InputTextBase.d.ts +1 -1
- package/lib/inputs/base/InputTextBase.js +18 -8
- package/lib/inputs/base/helpers.d.ts +1 -1
- package/lib/inputs/base/types.d.ts +5 -16
- 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 +1 -1
- package/lib/inputs/file/DragDropFile.d.ts +1 -1
- package/lib/inputs/file/File.d.ts +1 -1
- package/lib/inputs/file/FileButtonSettings.d.ts +1 -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/BaseMask.js +9 -6
- 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/helpers.js +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/BaseNumber.js +3 -2
- package/lib/inputs/number/Currency.d.ts +1 -1
- package/lib/inputs/number/Decimal.d.ts +1 -1
- package/lib/inputs/number/format_number.d.ts +1 -1
- package/lib/inputs/number/format_number.js +4 -2
- package/lib/inputs/number/index.d.ts +1 -1
- package/lib/inputs/number/types.d.ts +4 -4
- 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 +8 -10
- package/lib/inputs/period/types.d.ts +2 -5
- package/lib/inputs/search/index.d.ts +1 -1
- 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 +2 -2
- package/lib/inputs/select/multiple/Selecteds.js +3 -1
- package/lib/inputs/select/multiple/index.d.ts +1 -1
- package/lib/inputs/select/multiple/index.js +3 -2
- package/lib/inputs/select/simple/index.d.ts +1 -1
- package/lib/inputs/select/simple/index.js +3 -3
- package/lib/inputs/select/types.d.ts +2 -1
- package/lib/inputs/text/index.d.ts +1 -1
- package/lib/inputs/text/types.d.ts +2 -3
- 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 -2
- package/lib/inputs2/checkboxfield/index.d.ts +7 -0
- package/lib/inputs2/checkboxfield/index.js +146 -0
- package/lib/inputs2/colorfield/index.d.ts +9 -0
- package/lib/inputs2/colorfield/index.js +119 -0
- package/lib/inputs2/date/base/constants.d.ts +7 -0
- package/lib/inputs2/date/base/constants.js +43 -0
- package/lib/inputs2/date/base/index.d.ts +12 -0
- package/lib/inputs2/date/base/index.js +179 -0
- package/lib/inputs2/date/datefield/calendarbox.d.ts +7 -0
- package/lib/inputs2/date/datefield/calendarbox.js +115 -0
- package/lib/inputs2/date/datefield/context.d.ts +13 -0
- package/lib/inputs2/date/datefield/context.js +15 -0
- package/lib/inputs2/date/datefield/index.d.ts +9 -0
- package/lib/inputs2/date/datefield/index.js +334 -0
- package/lib/inputs2/date/datefield/triggers.d.ts +8 -0
- package/lib/inputs2/date/datefield/triggers.js +47 -0
- package/lib/inputs2/date/datefield/types.d.ts +61 -0
- package/lib/inputs2/date/datefield/types.js +5 -0
- package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +7 -0
- package/lib/inputs2/date/dateperiodfield/calendarbox.js +136 -0
- package/lib/inputs2/date/dateperiodfield/context.d.ts +13 -0
- package/lib/inputs2/date/dateperiodfield/context.js +17 -0
- package/lib/inputs2/date/dateperiodfield/index.d.ts +9 -0
- package/lib/inputs2/date/dateperiodfield/index.js +592 -0
- package/lib/inputs2/date/dateperiodfield/triggers.d.ts +6 -0
- package/lib/inputs2/date/dateperiodfield/triggers.js +120 -0
- package/lib/inputs2/date/dateperiodfield/types.d.ts +99 -0
- package/lib/inputs2/date/dateperiodfield/types.js +19 -0
- package/lib/inputs2/date/helpers.d.ts +20 -0
- package/lib/inputs2/date/helpers.js +62 -0
- package/lib/inputs2/date/types.d.ts +59 -0
- package/lib/inputs2/date/types.js +19 -0
- package/lib/inputs2/index.d.ts +29 -0
- package/lib/inputs2/index.js +38 -0
- package/lib/inputs2/mask/BaseMask.d.ts +10 -0
- package/lib/inputs2/mask/BaseMask.js +95 -0
- package/lib/inputs2/mask/Cnpj.d.ts +11 -0
- package/lib/inputs2/mask/Cnpj.js +57 -0
- package/lib/inputs2/mask/Cpf.d.ts +11 -0
- package/lib/inputs2/mask/Cpf.js +53 -0
- package/lib/inputs2/mask/Phone.d.ts +11 -0
- package/lib/inputs2/mask/Phone.js +26 -0
- package/lib/inputs2/mask/ZipCode.d.ts +11 -0
- package/lib/inputs2/mask/ZipCode.js +23 -0
- package/lib/inputs2/mask/helpers.d.ts +4 -0
- package/lib/inputs2/mask/helpers.js +57 -0
- package/lib/inputs2/number/BaseNumber.d.ts +10 -0
- package/lib/inputs2/number/BaseNumber.js +86 -0
- package/lib/inputs2/number/Currency.d.ts +11 -0
- package/lib/inputs2/number/Currency.js +47 -0
- package/lib/inputs2/number/Decimal.d.ts +11 -0
- package/lib/inputs2/number/Decimal.js +36 -0
- package/lib/inputs2/number/Number.d.ts +9 -0
- package/lib/inputs2/number/Number.js +49 -0
- package/lib/inputs2/number/format_number.d.ts +5 -0
- package/lib/inputs2/number/format_number.js +29 -0
- package/lib/inputs2/selectfield/context.d.ts +38 -0
- package/lib/inputs2/selectfield/context.js +15 -0
- package/lib/inputs2/selectfield/helpers.d.ts +6 -0
- package/lib/inputs2/selectfield/helpers.js +25 -0
- package/lib/inputs2/selectfield/index.d.ts +10 -0
- package/lib/inputs2/selectfield/index.js +491 -0
- package/lib/inputs2/selectfield/item.d.ts +11 -0
- package/lib/inputs2/selectfield/item.js +85 -0
- package/lib/inputs2/selectfield/listbox.d.ts +7 -0
- package/lib/inputs2/selectfield/listbox.js +103 -0
- package/lib/inputs2/selectfield/search.d.ts +7 -0
- package/lib/inputs2/selectfield/search.js +71 -0
- package/lib/inputs2/selectfield/selections.d.ts +10 -0
- package/lib/inputs2/selectfield/selections.js +86 -0
- package/lib/inputs2/selectfield/triggers.d.ts +8 -0
- package/lib/inputs2/selectfield/triggers.js +100 -0
- package/lib/inputs2/selectfield/types.d.ts +55 -0
- package/lib/inputs2/selectfield/types.js +21 -0
- package/lib/inputs2/slot/index.d.ts +14 -0
- package/lib/inputs2/slot/index.js +47 -0
- package/lib/inputs2/textfield/index.d.ts +8 -0
- package/lib/inputs2/textfield/index.js +159 -0
- package/lib/internals/types.d.ts +1 -17
- package/lib/labels/DangerLabel.d.ts +1 -0
- package/lib/labels/DefaultLabel.d.ts +3 -5
- package/lib/labels/DefaultLabel.js +15 -7
- package/lib/labels/InfoLabel.d.ts +1 -0
- package/lib/labels/PrimaryLabel.d.ts +1 -0
- package/lib/labels/SuccessLabel.d.ts +1 -0
- package/lib/labels/WarningLabel.d.ts +1 -0
- package/lib/labels/index.d.ts +3 -2
- package/lib/labels/types.d.ts +2 -5
- package/lib/list/Header.d.ts +1 -0
- package/lib/list/Item.d.ts +3 -5
- package/lib/list/Item.js +17 -12
- package/lib/list/helpers.d.ts +1 -0
- package/lib/list/index.d.ts +1 -0
- package/lib/list/types.d.ts +4 -6
- package/lib/menus/sidenav/ExpandMenu.d.ts +2 -2
- package/lib/menus/sidenav/MenuLink.d.ts +4 -7
- package/lib/menus/sidenav/MenuLink.js +20 -11
- package/lib/menus/sidenav/NavMenuGroup.d.ts +2 -2
- package/lib/menus/sidenav/NavMenuItem.d.ts +4 -7
- package/lib/menus/sidenav/NavMenuItem.js +16 -12
- 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 +11 -2
- package/lib/popover/types.d.ts +1 -0
- package/lib/textContent/index.d.ts +6 -11
- package/lib/textContent/index.js +20 -11
- package/lib/tooltip/TooltipContent.d.ts +7 -0
- package/lib/tooltip/TooltipContent.js +65 -0
- package/lib/tooltip/index.d.ts +4 -3
- package/lib/tooltip/index.js +36 -53
- package/lib/tooltip/types.d.ts +25 -3
- package/lib/tooltip/useTooltip.d.ts +30 -0
- package/lib/tooltip/useTooltip.js +128 -0
- package/package.json +4 -3
- package/lib/inputs/base/Label.d.ts +0 -14
- package/lib/inputs/base/Label.js +0 -35
- package/lib/internals/withTooltip.d.ts +0 -12
- package/lib/internals/withTooltip.js +0 -172
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Input = void 0;
|
|
7
|
+
Object.defineProperty(exports, "LeftSlot", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _slot.LeftSlot;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "RightSlot", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _slot.RightSlot;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
require("../../assets/styles/textfield.scss");
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
22
|
+
var _gridlayout = _interopRequireDefault(require("../../gridlayout"));
|
|
23
|
+
var _popover = _interopRequireWildcard(require("../../popover"));
|
|
24
|
+
var _permissionValidations = require("../../permissionValidations");
|
|
25
|
+
var _hint = _interopRequireDefault(require("../../hint"));
|
|
26
|
+
var _slot = require("../slot");
|
|
27
|
+
var _tooltip = require("../../tooltip");
|
|
28
|
+
const _excluded = ["type", "name", "label", "errors", "children", "onDeniedActions", "permissionAttr", "customClass", "customClassLabel", "customClassWrapper", "customClassInputContainer", "textAlign", "labelUppercase", "skeletonize", "hintPosition", "gridLayout", "themePopover", "popoverAlign", "tooltip", "tooltipPosition", "tooltipWidth", "hint"];
|
|
29
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
|
+
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); }
|
|
31
|
+
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; }
|
|
32
|
+
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); }
|
|
33
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
34
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
35
|
+
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
|
|
36
|
+
const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
37
|
+
const {
|
|
38
|
+
type = 'text',
|
|
39
|
+
name,
|
|
40
|
+
label,
|
|
41
|
+
errors,
|
|
42
|
+
children,
|
|
43
|
+
onDeniedActions = undefined,
|
|
44
|
+
permissionAttr = undefined,
|
|
45
|
+
customClass = '',
|
|
46
|
+
customClassLabel = '',
|
|
47
|
+
customClassWrapper = '',
|
|
48
|
+
customClassInputContainer = '',
|
|
49
|
+
textAlign = 'left',
|
|
50
|
+
labelUppercase = false,
|
|
51
|
+
skeletonize = false,
|
|
52
|
+
hintPosition = 'below',
|
|
53
|
+
gridLayout = undefined,
|
|
54
|
+
themePopover = 'light',
|
|
55
|
+
popoverAlign = 'left',
|
|
56
|
+
tooltip,
|
|
57
|
+
tooltipPosition,
|
|
58
|
+
tooltipWidth,
|
|
59
|
+
hint
|
|
60
|
+
} = props,
|
|
61
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
62
|
+
const onDenied = _react.default.useMemo(() => {
|
|
63
|
+
return onDeniedActions || (0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr);
|
|
64
|
+
}, [onDeniedActions, permissionAttr]);
|
|
65
|
+
const {
|
|
66
|
+
hideContent,
|
|
67
|
+
unvisible
|
|
68
|
+
} = onDenied;
|
|
69
|
+
const inputRef = (0, _react.useRef)(null);
|
|
70
|
+
const hasLabel = !_lodash.default.isEmpty(props?.label);
|
|
71
|
+
const isReadOnly = Boolean(props.readOnly || onDenied.readOnly);
|
|
72
|
+
const isDisabled = Boolean(props.disabled || onDenied.disabled);
|
|
73
|
+
const hasHintMessages = Boolean(props.hint?.length);
|
|
74
|
+
const hasValidationErrors = Boolean(errors?.length);
|
|
75
|
+
const {
|
|
76
|
+
leftSlotElements,
|
|
77
|
+
rightSlotElements
|
|
78
|
+
} = _react.default.useMemo(() => {
|
|
79
|
+
const left = [];
|
|
80
|
+
const right = [];
|
|
81
|
+
_react.default.Children.map(children, (childElement, index) => {
|
|
82
|
+
if (/*#__PURE__*/_react.default.isValidElement(childElement)) {
|
|
83
|
+
const clonedChild = /*#__PURE__*/_react.default.cloneElement(childElement, {
|
|
84
|
+
key: childElement.key ?? `slot-${index}`,
|
|
85
|
+
disabled: isDisabled || isReadOnly,
|
|
86
|
+
'aria-disabled': isDisabled || isReadOnly
|
|
87
|
+
});
|
|
88
|
+
if (childElement.type === _slot.LeftSlot) left.push(clonedChild);
|
|
89
|
+
if (childElement.type === _slot.RightSlot) right.push(clonedChild);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
leftSlotElements: left,
|
|
94
|
+
rightSlotElements: right
|
|
95
|
+
};
|
|
96
|
+
}, [children, isDisabled, isReadOnly]);
|
|
97
|
+
const hasLeftSlotElements = Boolean(leftSlotElements?.length);
|
|
98
|
+
const hasRightSlotElements = Boolean(rightSlotElements?.length);
|
|
99
|
+
if (unvisible || hideContent) return null;
|
|
100
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
|
|
101
|
+
cols: gridLayout
|
|
102
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
103
|
+
ref: inputRef,
|
|
104
|
+
className: `text-field-root ${customClassWrapper}`,
|
|
105
|
+
"data-state-error": hasValidationErrors
|
|
106
|
+
}, hasLabel && /*#__PURE__*/_react.default.createElement("span", {
|
|
107
|
+
className: `root-label ${customClassLabel}`,
|
|
108
|
+
"data-state-skeletonize": skeletonize
|
|
109
|
+
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
110
|
+
className: "label",
|
|
111
|
+
title: label,
|
|
112
|
+
htmlFor: name,
|
|
113
|
+
"data-state-disabled": isDisabled,
|
|
114
|
+
"data-state-read-only": isReadOnly,
|
|
115
|
+
"data-state-input-required": props.required,
|
|
116
|
+
"data-state-label-uppercase": labelUppercase
|
|
117
|
+
}, label), hint && hintPosition === 'onLabelRight' && !skeletonize && /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
118
|
+
customClass: "label-popover",
|
|
119
|
+
theme: themePopover,
|
|
120
|
+
align: popoverAlign,
|
|
121
|
+
iconColor: "#03bde2"
|
|
122
|
+
}, /*#__PURE__*/_react.default.createElement(_popover.PopoverText, {
|
|
123
|
+
text: hint
|
|
124
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
+
"data-state-skeletonize": skeletonize,
|
|
126
|
+
className: `container ${customClassInputContainer}`
|
|
127
|
+
}, hasLeftSlotElements && !skeletonize && leftSlotElements, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
128
|
+
ref: ref,
|
|
129
|
+
id: name,
|
|
130
|
+
type: type,
|
|
131
|
+
readOnly: isReadOnly,
|
|
132
|
+
disabled: isDisabled,
|
|
133
|
+
className: `input ${customClass}`,
|
|
134
|
+
tabIndex: !isReadOnly ? 0 : -1,
|
|
135
|
+
placeholder: rest.placeholder,
|
|
136
|
+
"data-state-error": hasValidationErrors,
|
|
137
|
+
"data-state-read-only": isReadOnly,
|
|
138
|
+
"data-state-text-align": textAlign,
|
|
139
|
+
"data-state-skeletonize": skeletonize
|
|
140
|
+
}, rest)), hasRightSlotElements && !skeletonize && rightSlotElements), hintPosition === 'below' && /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
141
|
+
customClass: "hint",
|
|
142
|
+
description: hint,
|
|
143
|
+
disabled: isDisabled,
|
|
144
|
+
skeletonize: skeletonize,
|
|
145
|
+
visible: hasHintMessages
|
|
146
|
+
}), hasValidationErrors && /*#__PURE__*/_react.default.createElement("span", {
|
|
147
|
+
className: "error",
|
|
148
|
+
"data-state-skeletonize": skeletonize,
|
|
149
|
+
"aria-describedby": String(name).concat('-errors')
|
|
150
|
+
}, errors?.map((error, index) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
151
|
+
key: `${index + 1}-${error}`
|
|
152
|
+
}, error, "\xA0"))))), /*#__PURE__*/_react.default.createElement(_tooltip.Tooltip, {
|
|
153
|
+
targetRef: inputRef,
|
|
154
|
+
text: tooltip,
|
|
155
|
+
width: tooltipWidth,
|
|
156
|
+
position: tooltipPosition
|
|
157
|
+
}));
|
|
158
|
+
});
|
|
159
|
+
Input.displayName = 'TextFieldInput';
|
package/lib/internals/types.d.ts
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
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
|
-
}
|
|
17
1
|
interface GetDisplayNameParams {
|
|
18
2
|
displayName?: string;
|
|
19
3
|
name?: string;
|
|
@@ -22,4 +6,4 @@ interface HasToolTipParams {
|
|
|
22
6
|
tooltip?: string;
|
|
23
7
|
}
|
|
24
8
|
|
|
25
|
-
export { GetDisplayNameParams, HasToolTipParams
|
|
9
|
+
export { GetDisplayNameParams, HasToolTipParams };
|
|
@@ -5,10 +5,8 @@ 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';
|
|
8
9
|
|
|
9
|
-
declare const
|
|
10
|
-
(props: ILabelProps): JSX.Element;
|
|
11
|
-
displayName: string;
|
|
12
|
-
};
|
|
10
|
+
declare const DefaultLabel: ({ style, iconName, icon, children, visible, customClass, className, disabled, size, iconAlign, bordered, permissionAttr, skeletonize, tooltip, tooltipPosition, tooltipWidth, }: ILabelProps) => JSX.Element | null;
|
|
13
11
|
|
|
14
|
-
export {
|
|
12
|
+
export { DefaultLabel as default };
|
|
@@ -6,15 +6,14 @@ 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"));
|
|
10
9
|
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,
|
|
18
17
|
iconName,
|
|
19
18
|
icon,
|
|
20
19
|
children,
|
|
@@ -26,10 +25,14 @@ const DefaultLabel = _ref => {
|
|
|
26
25
|
iconAlign = 'left',
|
|
27
26
|
bordered,
|
|
28
27
|
permissionAttr,
|
|
29
|
-
skeletonize
|
|
28
|
+
skeletonize,
|
|
29
|
+
tooltip,
|
|
30
|
+
tooltipPosition,
|
|
31
|
+
tooltipWidth
|
|
30
32
|
} = _ref;
|
|
31
33
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
|
|
32
34
|
const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
|
|
35
|
+
const labelRef = (0, _react.useRef)(null);
|
|
33
36
|
const getClass = () => `label-component ${className} ${customClass} ${bordered ? '-bordered' : ''} ${disabled ? '-disabled' : ''}
|
|
34
37
|
${skeletonize ? '-skeletonized' : ''}
|
|
35
38
|
${size ? `-${size}` : ''}
|
|
@@ -46,10 +49,15 @@ const DefaultLabel = _ref => {
|
|
|
46
49
|
return null;
|
|
47
50
|
};
|
|
48
51
|
if (!visible || onDenied.unvisible) return null;
|
|
49
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
50
53
|
style: style,
|
|
51
54
|
className: getClass(),
|
|
52
|
-
ref:
|
|
53
|
-
}, getIcon(), children)
|
|
55
|
+
ref: labelRef
|
|
56
|
+
}, getIcon(), children), /*#__PURE__*/_react.default.createElement(_tooltip.Tooltip, {
|
|
57
|
+
targetRef: labelRef,
|
|
58
|
+
text: tooltip,
|
|
59
|
+
width: tooltipWidth,
|
|
60
|
+
position: tooltipPosition
|
|
61
|
+
}));
|
|
54
62
|
};
|
|
55
|
-
var _default = exports.default =
|
|
63
|
+
var _default = exports.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 DefaultLabel 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,7 +12,8 @@ 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';
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
18
|
-
export {
|
|
19
|
+
export { DefaultLabel as default };
|
package/lib/labels/types.d.ts
CHANGED
|
@@ -3,19 +3,16 @@ 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';
|
|
6
7
|
import '../icons/helper.js';
|
|
7
8
|
|
|
8
|
-
interface ILabelProps extends React.HTMLAttributes<HTMLDivElement
|
|
9
|
+
interface ILabelProps extends React.HTMLAttributes<HTMLDivElement>, ITooltipCommonProps {
|
|
9
10
|
customClass?: string;
|
|
10
11
|
size?: Size;
|
|
11
12
|
iconName?: IconNames;
|
|
12
13
|
iconAlign?: Position;
|
|
13
14
|
icon?: ReactElement;
|
|
14
|
-
targetRef?: (ref: HTMLDivElement | null) => void;
|
|
15
15
|
bordered?: boolean;
|
|
16
|
-
tooltipPosition?: Exclude<Position, 'center'>;
|
|
17
|
-
tooltipWidth?: string | number;
|
|
18
|
-
tooltip?: string;
|
|
19
16
|
visible?: boolean;
|
|
20
17
|
disabled?: boolean;
|
|
21
18
|
permissionAttr?: PermissionAttr | PermissionAttr[];
|
package/lib/list/Header.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ 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';
|
|
6
7
|
import '../@types/Position.js';
|
|
7
8
|
|
|
8
9
|
declare const Header: ({ title, children, style, customClass }: IListHeaderProps) => JSX.Element;
|
package/lib/list/Item.d.ts
CHANGED
|
@@ -3,11 +3,9 @@ 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';
|
|
6
7
|
import '../@types/Position.js';
|
|
7
8
|
|
|
8
|
-
declare const
|
|
9
|
-
(props: IListItemProps): JSX.Element;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
9
|
+
declare const Item: (props: IListItemProps) => JSX.Element | null;
|
|
12
10
|
|
|
13
|
-
export {
|
|
11
|
+
export { Item 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"));
|
|
15
14
|
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,8 +40,11 @@ const Item = props => {
|
|
|
40
40
|
visible = true,
|
|
41
41
|
permissionAttr,
|
|
42
42
|
skeletonize,
|
|
43
|
-
targetRef,
|
|
44
43
|
target,
|
|
44
|
+
tooltip,
|
|
45
|
+
tooltipPosition,
|
|
46
|
+
tooltipWidth,
|
|
47
|
+
onMouseDown,
|
|
45
48
|
onDeniedText = 'Permissão Negada! Consulte o Administrador do sistema.'
|
|
46
49
|
} = props;
|
|
47
50
|
const {
|
|
@@ -52,11 +55,9 @@ const Item = props => {
|
|
|
52
55
|
selectOnEnter
|
|
53
56
|
} = (0, _react.useContext)(_helpers.ListContext);
|
|
54
57
|
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);
|
|
60
61
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
61
62
|
const disabledByPermission = onDenied.disabled;
|
|
62
63
|
const shouldDisable = () => disabled || onDenied.disabled;
|
|
@@ -117,9 +118,6 @@ const Item = props => {
|
|
|
117
118
|
document.removeEventListener('keydown', onKeyDown);
|
|
118
119
|
};
|
|
119
120
|
}, [url, selectedItemId, itemId]);
|
|
120
|
-
(0, _react.useEffect)(() => {
|
|
121
|
-
if (disabledByPermission) handlerSetOnDeniedText(onDeniedText);
|
|
122
|
-
}, [disabledByPermission]);
|
|
123
121
|
const renderCheckBox = (0, _react.useMemo)(() => {
|
|
124
122
|
if (!disabledByPermission && displayCheckbox) {
|
|
125
123
|
return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
@@ -133,11 +131,12 @@ const Item = props => {
|
|
|
133
131
|
return null;
|
|
134
132
|
}, [disabledByPermission && displayCheckbox]);
|
|
135
133
|
if (!visible || onDenied.unvisible) return null;
|
|
136
|
-
return /*#__PURE__*/_react.default.createElement("li", _extends({
|
|
134
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("li", _extends({
|
|
137
135
|
ref: ref => {
|
|
138
|
-
|
|
136
|
+
itemRef.current = ref;
|
|
139
137
|
return itemId && selectedItemId === itemId ? selectedItemRef : null;
|
|
140
138
|
},
|
|
139
|
+
onMouseDown: onMouseDown,
|
|
141
140
|
style: style,
|
|
142
141
|
className: `item-container ${hovered && 'hovered'}
|
|
143
142
|
${itemId && selectedItemId === itemId ? '-activedlist' : ''}`
|
|
@@ -157,6 +156,12 @@ const Item = props => {
|
|
|
157
156
|
className: `${subText && 'subtext'}`
|
|
158
157
|
}, subText), children), (rightIconName || rightIcon || rightElement || disabledByPermission) && /*#__PURE__*/_react.default.createElement("div", {
|
|
159
158
|
className: `${getClass()} -icon-right`
|
|
160
|
-
}, getIcon(rightIconName, rightIcon), rightElement))
|
|
159
|
+
}, getIcon(rightIconName, rightIcon), rightElement)), /*#__PURE__*/_react.default.createElement(_tooltip.Tooltip, {
|
|
160
|
+
targetRef: itemRef,
|
|
161
|
+
text: tooltip,
|
|
162
|
+
width: tooltipWidth,
|
|
163
|
+
position: tooltipPosition,
|
|
164
|
+
onDeniedText: disabledByPermission ? onDeniedText : undefined
|
|
165
|
+
}));
|
|
161
166
|
};
|
|
162
|
-
var _default = exports.default =
|
|
167
|
+
var _default = exports.default = Item;
|
package/lib/list/helpers.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ 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';
|
|
6
7
|
import '../@types/Position.js';
|
|
7
8
|
|
|
8
9
|
declare const ListContext: React__default.Context<IListContext>;
|
package/lib/list/index.d.ts
CHANGED
package/lib/list/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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 { ITooltipCommonProps } from '../tooltip/types.js';
|
|
5
5
|
import '../icons/helper.js';
|
|
6
|
+
import '../@types/Position.js';
|
|
6
7
|
|
|
7
8
|
type ItemId = string;
|
|
8
9
|
interface KeyboardEvent {
|
|
@@ -30,7 +31,7 @@ interface IListProps {
|
|
|
30
31
|
skeletonItens?: number;
|
|
31
32
|
selectOnEnter?: boolean;
|
|
32
33
|
}
|
|
33
|
-
interface IListItemProps {
|
|
34
|
+
interface IListItemProps extends ITooltipCommonProps {
|
|
34
35
|
text?: string;
|
|
35
36
|
style?: object;
|
|
36
37
|
separator?: boolean;
|
|
@@ -54,11 +55,8 @@ interface IListItemProps {
|
|
|
54
55
|
permissionAttr?: PermissionAttr | PermissionAttr[];
|
|
55
56
|
selectOnEnter?: boolean;
|
|
56
57
|
skeletonize?: boolean;
|
|
57
|
-
targetRef?: (ref: HTMLLIElement) => void;
|
|
58
|
-
tooltipPosition?: Exclude<Position, 'center'>;
|
|
59
|
-
tooltipWidth?: string | number;
|
|
60
|
-
tooltip?: string;
|
|
61
58
|
onDeniedText?: string;
|
|
59
|
+
onMouseDown?: (event?: React.MouseEvent<HTMLLIElement>) => void;
|
|
62
60
|
}
|
|
63
61
|
interface IListContext {
|
|
64
62
|
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';
|
|
7
5
|
import '../../@types/Icon.js';
|
|
8
6
|
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,14 +2,11 @@ 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';
|
|
7
5
|
import '../../@types/Icon.js';
|
|
8
6
|
import '../../icons/helper.js';
|
|
7
|
+
import '../../tooltip/types.js';
|
|
8
|
+
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
|
-
declare const
|
|
11
|
-
(props: IMenuLinkProps): JSX.Element;
|
|
12
|
-
displayName: string;
|
|
13
|
-
};
|
|
10
|
+
declare const MenuLink: ({ url, children, disabled, tooltip, tooltipPosition, errorMessage, tooltipWidth, }: IMenuLinkProps) => JSX.Element;
|
|
14
11
|
|
|
15
|
-
export {
|
|
12
|
+
export { MenuLink as default };
|
|
@@ -4,26 +4,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactRouterDom = require("react-router-dom");
|
|
9
|
-
var
|
|
10
|
-
function
|
|
9
|
+
var _tooltip = require("../../tooltip");
|
|
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; }
|
|
11
12
|
const MenuLink = _ref => {
|
|
12
13
|
let {
|
|
13
14
|
url,
|
|
14
15
|
children,
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
disabled,
|
|
17
|
+
tooltip,
|
|
18
|
+
tooltipPosition,
|
|
19
|
+
errorMessage,
|
|
20
|
+
tooltipWidth
|
|
17
21
|
} = _ref;
|
|
22
|
+
const linkRef = (0, _react.useRef)(null);
|
|
18
23
|
if (url && !disabled) {
|
|
19
|
-
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
|
|
20
25
|
to: url,
|
|
21
26
|
className: "menulink",
|
|
22
|
-
ref:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
ref: linkRef
|
|
28
|
+
}, children), /*#__PURE__*/_react.default.createElement(_tooltip.Tooltip, {
|
|
29
|
+
targetRef: linkRef,
|
|
30
|
+
text: tooltip,
|
|
31
|
+
position: tooltipPosition,
|
|
32
|
+
width: tooltipWidth,
|
|
33
|
+
textError: errorMessage
|
|
34
|
+
}));
|
|
26
35
|
}
|
|
27
36
|
return children;
|
|
28
37
|
};
|
|
29
|
-
var _default = exports.default =
|
|
38
|
+
var _default = exports.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';
|
|
7
5
|
import '../../@types/Icon.js';
|
|
8
6
|
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,14 +2,11 @@ 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';
|
|
7
5
|
import '../../@types/Icon.js';
|
|
8
6
|
import '../../icons/helper.js';
|
|
7
|
+
import '../../tooltip/types.js';
|
|
8
|
+
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
|
-
declare const
|
|
11
|
-
(props: INavMenuItemProps): JSX.Element;
|
|
12
|
-
displayName: string;
|
|
13
|
-
};
|
|
10
|
+
declare const NavMenuItem: (props: INavMenuItemProps) => JSX.Element | null;
|
|
14
11
|
|
|
15
|
-
export {
|
|
12
|
+
export { NavMenuItem as default };
|