linear-react-components-ui 1.1.20-beta.2 → 1.1.20-beta.21
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/alerts/BaseAlert.js +1 -1
- package/lib/alerts/Message.js +1 -1
- package/lib/assets/styles/input.scss +2 -2
- package/lib/assets/styles/popover.scss +3 -0
- package/lib/assets/styles/select.scss +2 -1
- package/lib/assets/styles/wizard.scss +125 -0
- package/lib/avatar/index.js +9 -8
- package/lib/badge/index.js +4 -4
- package/lib/buttons/DangerButton.js +1 -1
- package/lib/buttons/DefaultButton.js +13 -3
- package/lib/buttons/InfoButton.js +1 -1
- package/lib/buttons/PrimaryButton.js +1 -1
- package/lib/buttons/SuccessButton.js +1 -1
- package/lib/buttons/WarningButton.js +1 -1
- package/lib/buttons/button_container/index.js +1 -1
- package/lib/buttons/split_button/index.js +1 -1
- package/lib/calendar/base/Day.js +1 -1
- package/lib/calendar/base/Month.js +1 -1
- package/lib/calendar/base/helpers.js +2 -2
- package/lib/calendar/base/index.js +1 -1
- package/lib/checkbox/index.js +46 -19
- package/lib/checkbox/types.d.ts +4 -0
- package/lib/dialog/Custom.js +4 -2
- package/lib/dialog/Question.js +18 -2
- package/lib/dialog/base/Content.d.ts +1 -1
- package/lib/dialog/base/Content.js +3 -2
- package/lib/dialog/base/Header.js +2 -2
- package/lib/dialog/base/index.js +8 -9
- package/lib/dialog/form/index.js +8 -3
- package/lib/dialog/types.d.ts +38 -4
- package/lib/dialog/wizard/index.d.ts +13 -0
- package/lib/dialog/wizard/index.js +74 -0
- package/lib/dialog/wizard/progressbar.d.ts +13 -0
- package/lib/dialog/wizard/progressbar.js +36 -0
- package/lib/dialog/wizard/step.d.ts +9 -0
- package/lib/dialog/wizard/step.js +22 -0
- package/lib/dialog/wizard/useWizard.d.ts +9 -0
- package/lib/dialog/wizard/useWizard.js +48 -0
- package/lib/drawer/Drawer.js +3 -3
- package/lib/drawer/Header.js +1 -1
- package/lib/dropdown/Popup.js +6 -6
- package/lib/dropdown/helper.js +1 -1
- package/lib/dropdown/withDropdown.js +2 -2
- package/lib/fieldset/index.js +7 -7
- package/lib/form/FieldArray.js +1 -1
- package/lib/form/FieldNumber.js +4 -4
- package/lib/form/FieldPeriod.js +2 -2
- package/lib/form/index.js +2 -2
- package/lib/form/types.d.ts +14 -1
- package/lib/gridlayout/GridCol.js +5 -5
- package/lib/gridlayout/GridRow.js +4 -1
- package/lib/hint/index.js +7 -1
- package/lib/icons/helper.d.ts +8 -0
- package/lib/icons/helper.js +8 -0
- package/lib/icons/index.js +24 -27
- package/lib/inputs/base/InputTextBase.js +41 -16
- package/lib/inputs/base/Label.js +1 -1
- package/lib/inputs/base/helpers.js +7 -3
- package/lib/inputs/base/types.d.ts +3 -0
- package/lib/inputs/color/types.d.ts +5 -0
- package/lib/inputs/date/helpers.js +4 -1
- package/lib/inputs/date/index.js +9 -15
- package/lib/inputs/date/types.d.ts +4 -0
- package/lib/inputs/errorMessage/index.js +1 -1
- package/lib/inputs/file/DefaultFile.js +5 -6
- package/lib/inputs/file/DragDropFile.js +17 -18
- package/lib/inputs/file/File.js +3 -4
- package/lib/inputs/file/types.d.ts +3 -0
- package/lib/inputs/mask/BaseMask.js +1 -1
- package/lib/inputs/mask/helpers.d.ts +4 -0
- package/lib/inputs/mask/types.d.ts +4 -0
- package/lib/inputs/multiSelect/Dropdown.js +9 -10
- package/lib/inputs/multiSelect/helper.js +1 -2
- package/lib/inputs/multiSelect/index.js +7 -9
- package/lib/inputs/multiSelect/types.d.ts +4 -0
- 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/index.js +7 -3
- package/lib/inputs/number/types.d.ts +14 -2
- package/lib/inputs/period/PeriodList.js +1 -1
- package/lib/inputs/period/helper.js +3 -1
- package/lib/inputs/period/index.js +40 -18
- package/lib/inputs/period/types.d.ts +3 -0
- package/lib/inputs/search/index.js +1 -1
- package/lib/inputs/select/Dropdown.js +1 -1
- package/lib/inputs/select/helper.js +10 -13
- package/lib/inputs/select/multiple/Selecteds.js +1 -1
- package/lib/inputs/select/multiple/index.js +22 -18
- package/lib/inputs/select/simple/index.js +15 -20
- package/lib/inputs/select/types.d.ts +7 -0
- package/lib/inputs/textarea/index.js +1 -1
- package/lib/internals/withTooltip.js +9 -9
- package/lib/labelMessages/index.js +4 -3
- package/lib/labels/DefaultLabel.js +4 -1
- package/lib/labels/label_container/index.js +1 -1
- package/lib/list/Header.d.ts +1 -0
- package/lib/list/Header.js +1 -1
- package/lib/list/Item.d.ts +6 -2
- package/lib/list/Item.js +24 -10
- package/lib/list/helpers.d.ts +1 -0
- package/lib/list/index.d.ts +1 -0
- package/lib/list/index.js +3 -2
- package/lib/list/types.d.ts +6 -0
- package/lib/menus/float/MenuItem.js +2 -2
- package/lib/menus/float/SubMenuContainer.js +1 -1
- package/lib/menus/float/index.js +1 -1
- package/lib/menus/sidenav/ExpandMenu.js +1 -1
- package/lib/menus/sidenav/NavMenuGroup.js +1 -1
- package/lib/menus/sidenav/NavMenuItem.js +7 -9
- package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
- package/lib/menus/sidenav/helpers.js +1 -1
- package/lib/menus/sidenav/index.js +5 -5
- package/lib/panel/Content.js +5 -7
- package/lib/panel/Default.js +2 -2
- package/lib/panel/Header.js +3 -3
- package/lib/permissionValidations.js +1 -1
- package/lib/popover/index.js +4 -6
- package/lib/popover/types.d.ts +2 -1
- package/lib/progress/Bar.js +6 -6
- package/lib/radio/index.d.ts +1 -1
- package/lib/radio/index.js +36 -5
- package/lib/radio/types.d.ts +8 -1
- package/lib/shortcuts/index.js +1 -1
- package/lib/skeleton/SkeletonContainer.js +2 -1
- package/lib/skeleton/index.js +4 -1
- package/lib/spinner/index.js +2 -2
- package/lib/split/Split.js +1 -1
- package/lib/split/SplitSide.js +3 -3
- package/lib/table/Body.js +3 -3
- package/lib/table/Header.js +8 -11
- package/lib/table/HeaderColumn.js +7 -7
- package/lib/table/Row.js +3 -3
- package/lib/table/RowColumn.js +1 -1
- package/lib/table/index.js +6 -1
- package/lib/table/types.d.ts +0 -2
- package/lib/tabs/DropdownTabs.js +1 -1
- package/lib/tabs/Menu.js +1 -1
- package/lib/tabs/MenuTabs.js +2 -2
- package/lib/tabs/Panel.js +5 -7
- package/lib/tabs/context.js +3 -6
- package/lib/textContent/index.d.ts +18 -4
- package/lib/textContent/index.js +15 -5
- package/lib/toolbar/ButtonBar.js +1 -1
- package/lib/toolbar/index.js +1 -1
- package/lib/tooltip/index.js +7 -7
- package/lib/treetable/Body.js +1 -1
- package/lib/treetable/Header.js +2 -2
- package/lib/treetable/Row.js +10 -13
- package/lib/treeview/Header.js +1 -1
- package/lib/treeview/Node.js +5 -5
- package/lib/treeview/index.js +4 -4
- package/lib/uitour/index.js +6 -8
- package/package.json +1 -1
- package/lib/checkbox/Label.d.ts +0 -11
- package/lib/checkbox/Label.js +0 -31
package/lib/list/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode, ReactElement, CSSProperties, Ref } from 'react';
|
|
2
2
|
import { PermissionAttr } from '../@types/PermissionAttr.js';
|
|
3
3
|
import { IconNames } from '../@types/Icon.js';
|
|
4
|
+
import { Position } from '../@types/Position.js';
|
|
4
5
|
import '../icons/helper.js';
|
|
5
6
|
|
|
6
7
|
type ItemId = string;
|
|
@@ -52,6 +53,11 @@ interface IListItemProps {
|
|
|
52
53
|
permissionAttr?: PermissionAttr | PermissionAttr[];
|
|
53
54
|
selectOnEnter?: boolean;
|
|
54
55
|
skeletonize?: boolean;
|
|
56
|
+
targetRef?: (ref: HTMLLIElement) => void;
|
|
57
|
+
tooltipPosition?: Exclude<Position, 'center'>;
|
|
58
|
+
tooltipWidth?: string | number;
|
|
59
|
+
tooltip?: string;
|
|
60
|
+
onDeniedText?: string;
|
|
55
61
|
}
|
|
56
62
|
interface IListContext {
|
|
57
63
|
selectable: boolean;
|
|
@@ -29,7 +29,7 @@ const MenuItem = _ref => {
|
|
|
29
29
|
const dropdownContext = (0, _react.useContext)(_withDropdown.WithDropdownContext);
|
|
30
30
|
const handleOnClick = () => {
|
|
31
31
|
if (onClick) {
|
|
32
|
-
onClick(dropdownContext
|
|
32
|
+
onClick(dropdownContext?.handleDropdownClose);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
if (dropdownContext) dropdownContext.handleDropdownClose();
|
|
@@ -37,7 +37,7 @@ const MenuItem = _ref => {
|
|
|
37
37
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
38
38
|
className: "floatmenuitem"
|
|
39
39
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
-
className:
|
|
40
|
+
className: `${customClassMenuItem} -items`
|
|
41
41
|
}, !_lodash.default.isEmpty(dropdownMenu) && !onClick && /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
42
42
|
customClass: "floatmenudropdown",
|
|
43
43
|
iconName: "more1",
|
|
@@ -46,7 +46,7 @@ const SubMenuContainer = _ref => {
|
|
|
46
46
|
handlerGoBack();
|
|
47
47
|
}, []);
|
|
48
48
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
-
className:
|
|
49
|
+
className: `floatsubmenu ${customClass}`
|
|
50
50
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
51
51
|
className: "submenuheader"
|
|
52
52
|
}, /*#__PURE__*/_react.default.createElement(_icons.default, {
|
package/lib/menus/float/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const FloatMenu = props => {
|
|
|
47
47
|
return /*#__PURE__*/_react.default.createElement(_helpers.default.Provider, {
|
|
48
48
|
value: contextValues
|
|
49
49
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
50
|
-
className:
|
|
50
|
+
className: `floatmenu-component ${customClass}`
|
|
51
51
|
}, /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
52
52
|
transparent: true,
|
|
53
53
|
key: "button-",
|
|
@@ -14,7 +14,7 @@ const ExpandMenu = _ref => {
|
|
|
14
14
|
iconName
|
|
15
15
|
} = _ref;
|
|
16
16
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
|
-
className:
|
|
17
|
+
className: `openclosemenu ${expandMenuCustomClass}`,
|
|
18
18
|
role: "button",
|
|
19
19
|
tabIndex: 0,
|
|
20
20
|
onClick: onExpandMenu,
|
|
@@ -20,7 +20,7 @@ const NavMenuGroup = _ref => {
|
|
|
20
20
|
} = (0, _react.useContext)(_helpers.SideNavContext);
|
|
21
21
|
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
22
22
|
style: style,
|
|
23
|
-
className:
|
|
23
|
+
className: `${scrollable && 'customscroll'} ${(0, _helpers.default)(isExpanded, menuSize)}`
|
|
24
24
|
}, children);
|
|
25
25
|
};
|
|
26
26
|
var _default = exports.default = NavMenuGroup;
|
|
@@ -76,19 +76,17 @@ const NavMenuItem = props => {
|
|
|
76
76
|
(0, _react.useEffect)(() => {
|
|
77
77
|
if (showSubMenu && showDropdownOnClick) {
|
|
78
78
|
document.addEventListener('click', e => {
|
|
79
|
-
var _menuItemRef$current;
|
|
80
79
|
const target = e.target;
|
|
81
|
-
const insideMenu =
|
|
80
|
+
const insideMenu = menuItemRef.current?.contains(target);
|
|
82
81
|
if (!insideMenu) setShowSubMenu(false);
|
|
83
82
|
});
|
|
84
83
|
}
|
|
85
84
|
}, [showSubMenu, showDropdownOnClick]);
|
|
86
85
|
(0, _react.useEffect)(() => {
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
const heigthSubmenuContent = ((_submenuContentRef$cu = submenuContentRef.current) === null || _submenuContentRef$cu === void 0 ? void 0 : _submenuContentRef$cu.clientHeight) || 0;
|
|
86
|
+
const heigthSubmenuContainer = submenuContainerRef.current?.clientHeight || 0;
|
|
87
|
+
const heigthSubmenuContent = submenuContentRef.current?.clientHeight || 0;
|
|
90
88
|
const maxHeigthSubMenu = isOnEndWindow ? '100%' : (window.innerHeight - targetDimensions.top - (heigthSubmenuContainer - heigthSubmenuContent) - 1).toString().concat('px') || '0px';
|
|
91
|
-
|
|
89
|
+
submenuContentRef.current?.style.setProperty('max-height', maxHeigthSubMenu);
|
|
92
90
|
}, [showSubMenu]);
|
|
93
91
|
if (unvisible) return null;
|
|
94
92
|
return /*#__PURE__*/_react.default.createElement(_helpers.SubMenuContext.Provider, {
|
|
@@ -99,7 +97,7 @@ const NavMenuItem = props => {
|
|
|
99
97
|
menuItemRef.current = r;
|
|
100
98
|
if (targetRef) targetRef(r);
|
|
101
99
|
},
|
|
102
|
-
className:
|
|
100
|
+
className: `item ${url && !disabled && '-withlink'} ${customClass} ${disabled && '-disabled'}`,
|
|
103
101
|
onMouseEnter: onMouseEnter,
|
|
104
102
|
onMouseLeave: () => {
|
|
105
103
|
if (showDropdownOnClick) return;
|
|
@@ -123,7 +121,7 @@ const NavMenuItem = props => {
|
|
|
123
121
|
className: "title"
|
|
124
122
|
}, title), !childrenIsSubMenu && children)), showSubMenu && children && childrenIsSubMenu && !disabled && !openSearchMenuPopup && /*#__PURE__*/_react.default.createElement("div", {
|
|
125
123
|
ref: submenuContainerRef,
|
|
126
|
-
className:
|
|
124
|
+
className: `${customClassForDropdown} ${disableDefaultStyle ? '' : 'submenu-container'}`,
|
|
127
125
|
style: isOnEndWindow ? {
|
|
128
126
|
marginLeft: targetDimensions.width,
|
|
129
127
|
bottom: '0',
|
|
@@ -141,7 +139,7 @@ const NavMenuItem = props => {
|
|
|
141
139
|
ref: submenuContentRef,
|
|
142
140
|
className: "submenu",
|
|
143
141
|
style: {
|
|
144
|
-
gridTemplateColumns:
|
|
142
|
+
gridTemplateColumns: `repeat(${columnsQtty}, 1fr)`
|
|
145
143
|
}
|
|
146
144
|
}, children))));
|
|
147
145
|
};
|
|
@@ -28,7 +28,7 @@ const NavSubMenuItem = _ref => {
|
|
|
28
28
|
} = onDenied;
|
|
29
29
|
if (unvisible) return null;
|
|
30
30
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
31
|
-
className:
|
|
31
|
+
className: `item hvr-forward ${disabled && '-disabled'}`,
|
|
32
32
|
onKeyDown: () => {},
|
|
33
33
|
role: "button",
|
|
34
34
|
tabIndex: -1,
|
|
@@ -9,7 +9,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
9
9
|
const getCssClassMenu = (isExpanded, size) => {
|
|
10
10
|
let cssClass = 'expandedmenu';
|
|
11
11
|
if (!isExpanded) {
|
|
12
|
-
cssClass =
|
|
12
|
+
cssClass = `collapsedmenu -${size}`;
|
|
13
13
|
}
|
|
14
14
|
return cssClass;
|
|
15
15
|
};
|
|
@@ -70,7 +70,7 @@ const SideNav = props => {
|
|
|
70
70
|
width,
|
|
71
71
|
height
|
|
72
72
|
} = sideNavDimensions;
|
|
73
|
-
const style =
|
|
73
|
+
const style = `left: ${left + width + 5}px; top: ${top + 1}px; height: ${height - 8}px;`;
|
|
74
74
|
return style;
|
|
75
75
|
};
|
|
76
76
|
const closeSearchMenuPopup = () => {
|
|
@@ -82,7 +82,7 @@ const SideNav = props => {
|
|
|
82
82
|
} = child;
|
|
83
83
|
if ((type === _NavMenuItem.default || type === _NavSubMenuItem.default) && !child.props.children) {
|
|
84
84
|
setMenuItemsContent(prevState => [...prevState, {
|
|
85
|
-
id:
|
|
85
|
+
id: `${child.props.title}-${uuid.v1()}`,
|
|
86
86
|
content: child.props.title,
|
|
87
87
|
url: child.props.url
|
|
88
88
|
}]);
|
|
@@ -127,7 +127,7 @@ const SideNav = props => {
|
|
|
127
127
|
}, [expanded]);
|
|
128
128
|
const returnMenuItems = () => menuItemsContent.filter(item => item.content !== '');
|
|
129
129
|
const getPopupMenuSearch = () => /*#__PURE__*/_react.default.createElement(_NavMenuGroup.default, {
|
|
130
|
-
key:
|
|
130
|
+
key: `popup-menusearch-${uuid.v1()}`
|
|
131
131
|
}, /*#__PURE__*/_react.default.createElement(_NavMenuItem.default, {
|
|
132
132
|
childrenIsSubMenu: false,
|
|
133
133
|
customClass: "-customsidenavitem",
|
|
@@ -165,10 +165,10 @@ const SideNav = props => {
|
|
|
165
165
|
return /*#__PURE__*/_react.default.createElement(_helpers.SideNavContext.Provider, {
|
|
166
166
|
value: contextValues
|
|
167
167
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
-
className:
|
|
168
|
+
className: `sidenav-component ${isExpanded ? '-expanded' : ''} ${openSearchMenuPopup ? '-blocked' : ''} ${customClass}`,
|
|
169
169
|
ref: sideNavRef
|
|
170
170
|
}, showExpandMenu && /*#__PURE__*/_react.default.createElement(_ExpandMenu.default, {
|
|
171
|
-
expandMenuCustomClass:
|
|
171
|
+
expandMenuCustomClass: `${isExpanded && 'closefromexpanded'} ${expandMenuCustomClass}`,
|
|
172
172
|
onExpandMenu: onHeaderClick,
|
|
173
173
|
iconName: isExpanded ? 'arrow_left' : 'arrow_right'
|
|
174
174
|
}), getSideNavContent()));
|
package/lib/panel/Content.js
CHANGED
|
@@ -56,9 +56,8 @@ const PanelContent = _ref => {
|
|
|
56
56
|
scrollHeight
|
|
57
57
|
} = rootElementRef.current;
|
|
58
58
|
if (scrollHeight !== lastScrollHeight.current) {
|
|
59
|
-
var _observer;
|
|
60
59
|
enableOnEndReached.current = true;
|
|
61
|
-
|
|
60
|
+
observer?.disconnect();
|
|
62
61
|
}
|
|
63
62
|
});
|
|
64
63
|
observer.observe(rootElementRef.current);
|
|
@@ -66,16 +65,15 @@ const PanelContent = _ref => {
|
|
|
66
65
|
rootElementRef.current.addEventListener('resize', onScrollEndReached);
|
|
67
66
|
}
|
|
68
67
|
return () => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
(
|
|
72
|
-
(_observer2 = observer) === null || _observer2 === void 0 ? void 0 : _observer2.disconnect();
|
|
68
|
+
rootElementRef.current?.removeEventListener('scroll', onScrollEndReached);
|
|
69
|
+
rootElementRef.current?.removeEventListener('resize', onScrollEndReached);
|
|
70
|
+
observer?.disconnect();
|
|
73
71
|
};
|
|
74
72
|
}, [onScrollEndReached]);
|
|
75
73
|
if (!opened) return null;
|
|
76
74
|
return hideContent ? /*#__PURE__*/_react.default.createElement(_noPermission.default, null) : /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
77
75
|
ref: rootElementRef,
|
|
78
|
-
className:
|
|
76
|
+
className: `panel-content ${customClass ?? ''}`
|
|
79
77
|
}, rest), opened && children);
|
|
80
78
|
};
|
|
81
79
|
var _default = exports.default = PanelContent;
|
package/lib/panel/Default.js
CHANGED
|
@@ -37,8 +37,8 @@ const DefaultPanel = _ref => {
|
|
|
37
37
|
} = _permissionValidations.OPTIONS_ON_DENIED;
|
|
38
38
|
const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)([hideContent, unvisible], permissionAttr));
|
|
39
39
|
const getCssClass = () => {
|
|
40
|
-
let cssClass =
|
|
41
|
-
cssClass += colorStyle !== '' ?
|
|
40
|
+
let cssClass = `panel-component ${customClass}`;
|
|
41
|
+
cssClass += colorStyle !== '' ? ` -${colorStyle}` : '';
|
|
42
42
|
return cssClass;
|
|
43
43
|
};
|
|
44
44
|
const renderContent = () => /*#__PURE__*/_react.default.createElement("div", _extends({
|
package/lib/panel/Header.js
CHANGED
|
@@ -32,7 +32,7 @@ const getClassName = _ref => {
|
|
|
32
32
|
customClass,
|
|
33
33
|
headerColored = true
|
|
34
34
|
} = _ref;
|
|
35
|
-
let className =
|
|
35
|
+
let className = `panel-header ${customClass ?? ''}`;
|
|
36
36
|
if (!headerColored) className += ' -uncolored';
|
|
37
37
|
return className;
|
|
38
38
|
};
|
|
@@ -56,9 +56,9 @@ const PanelHeader = props => {
|
|
|
56
56
|
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
57
57
|
className: getClassName(props)
|
|
58
58
|
}, rest), (icon || titleIcon) && /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
-
className:
|
|
59
|
+
className: `${icon !== null || titleIcon !== null ? 'icon-left-panel' : ''}`
|
|
60
60
|
}, getIcon(titleIcon, icon)), title && /*#__PURE__*/_react.default.createElement("h1", {
|
|
61
|
-
className:
|
|
61
|
+
className: `title ${customClassForTitle ?? ''}`,
|
|
62
62
|
style: styleForTitle
|
|
63
63
|
}, title), toggleable && /*#__PURE__*/_react.default.createElement(_buttons.ButtonContainer, {
|
|
64
64
|
position: "right"
|
|
@@ -45,7 +45,7 @@ const actionsOnPermissionDenied = (options, permissionAttr) => {
|
|
|
45
45
|
}
|
|
46
46
|
const result = {};
|
|
47
47
|
options.forEach(option => {
|
|
48
|
-
result[option] = hasPermission ? false : option ===
|
|
48
|
+
result[option] = hasPermission ? false : option === permissionsAttr?.[0].onDenied;
|
|
49
49
|
});
|
|
50
50
|
return result;
|
|
51
51
|
};
|
package/lib/popover/index.js
CHANGED
|
@@ -32,7 +32,8 @@ const Popover = _ref => {
|
|
|
32
32
|
iconName,
|
|
33
33
|
iconSize = 16,
|
|
34
34
|
iconColor = '',
|
|
35
|
-
customClass = ''
|
|
35
|
+
customClass = '',
|
|
36
|
+
style
|
|
36
37
|
} = _ref;
|
|
37
38
|
return /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
38
39
|
round: true,
|
|
@@ -44,10 +45,7 @@ const Popover = _ref => {
|
|
|
44
45
|
dropdownAlign: align,
|
|
45
46
|
showIconDropdown: false,
|
|
46
47
|
customClass: "popover-component",
|
|
47
|
-
style:
|
|
48
|
-
height: '100%',
|
|
49
|
-
width: '100%'
|
|
50
|
-
},
|
|
48
|
+
style: style,
|
|
51
49
|
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
52
50
|
customClass: "buttonicon",
|
|
53
51
|
name: iconName || 'information',
|
|
@@ -58,7 +56,7 @@ const Popover = _ref => {
|
|
|
58
56
|
e.preventDefault();
|
|
59
57
|
}
|
|
60
58
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
-
className:
|
|
59
|
+
className: `${customClass} popovercontainer -${theme}`,
|
|
62
60
|
"data-testid": "popover-container"
|
|
63
61
|
}, children));
|
|
64
62
|
};
|
package/lib/popover/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import { Position } from '../@types/Position.js';
|
|
3
3
|
import { SizePixels } from '../@types/SizePixels.js';
|
|
4
4
|
import { IconNames } from '../@types/Icon.js';
|
|
@@ -18,6 +18,7 @@ interface IPopoverProps {
|
|
|
18
18
|
theme?: 'light' | 'dark';
|
|
19
19
|
align?: Extract<Position, 'left' | 'right'>;
|
|
20
20
|
iconSize?: Extract<SizePixels, 10 | 16 | 24 | 32 | 40 | 64>;
|
|
21
|
+
style?: CSSProperties;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export { IPopoverProps, PopoverTextProps, PopoverTitleProps };
|
package/lib/progress/Bar.js
CHANGED
|
@@ -18,8 +18,8 @@ const getPercentage = _ref => {
|
|
|
18
18
|
};
|
|
19
19
|
const getClass = props => {
|
|
20
20
|
let style = 'bar';
|
|
21
|
-
if (props.customClass) style +=
|
|
22
|
-
if (props.type) style +=
|
|
21
|
+
if (props.customClass) style += `${props.customClass}`;
|
|
22
|
+
if (props.type) style += ` -${props.type}`;
|
|
23
23
|
if (props.effect) style += ' -effect';
|
|
24
24
|
if (props.animated) style += ' -animated';
|
|
25
25
|
if (props.indeterminate) style += ' -indeterminate';
|
|
@@ -28,7 +28,7 @@ const getClass = props => {
|
|
|
28
28
|
const getLabel = progress => {
|
|
29
29
|
let value = progress.label;
|
|
30
30
|
if (!progress.label) {
|
|
31
|
-
value =
|
|
31
|
+
value = `${getPercentage(progress)}%`;
|
|
32
32
|
}
|
|
33
33
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
34
34
|
className: "progressbar-label "
|
|
@@ -46,12 +46,12 @@ const getStyle = props => {
|
|
|
46
46
|
return {
|
|
47
47
|
width: progressWidth,
|
|
48
48
|
height,
|
|
49
|
-
animationDuration:
|
|
50
|
-
animationDelay:
|
|
49
|
+
animationDuration: `${indeterminateDuration}s`,
|
|
50
|
+
animationDelay: `${indeterminateDelay}s`
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
return {
|
|
54
|
-
width:
|
|
54
|
+
width: `${getPercentage(props)}%`,
|
|
55
55
|
height
|
|
56
56
|
};
|
|
57
57
|
};
|
package/lib/radio/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ import '../@types/Size.js';
|
|
|
8
8
|
* o componente Field dentro do componente Form, pois o mesmo leva em consideração o tipo do
|
|
9
9
|
* componente para gerar propriedades customizadas.
|
|
10
10
|
*/
|
|
11
|
-
declare const Radio: ({ id, label, value, checked, onChange, name, disabled, required, skeletonize, defaultChecked,
|
|
11
|
+
declare const Radio: ({ id, label, value, checked, onChange, name, disabled, required, skeletonize, defaultChecked, inputRef, size, customClassForLabel, labelUppercase, hint, hintPosition, themePopover, popoverAlign, permissionAttr, }: IRadioProps) => JSX.Element | null;
|
|
12
12
|
|
|
13
13
|
export { Radio as default };
|
package/lib/radio/index.js
CHANGED
|
@@ -7,6 +7,9 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
require("../assets/styles/radio.scss");
|
|
9
9
|
var _permissionValidations = require("../permissionValidations");
|
|
10
|
+
var _popover = _interopRequireDefault(require("../popover"));
|
|
11
|
+
var _textContent = _interopRequireDefault(require("../textContent"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
13
|
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
14
|
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
15
|
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,8 +36,14 @@ const Radio = _ref => {
|
|
|
33
36
|
required = false,
|
|
34
37
|
skeletonize = false,
|
|
35
38
|
defaultChecked = false,
|
|
36
|
-
|
|
39
|
+
inputRef,
|
|
37
40
|
size = 'medium',
|
|
41
|
+
customClassForLabel,
|
|
42
|
+
labelUppercase,
|
|
43
|
+
hint,
|
|
44
|
+
hintPosition = 'onLabelRight',
|
|
45
|
+
themePopover = 'light',
|
|
46
|
+
popoverAlign = 'left',
|
|
38
47
|
permissionAttr
|
|
39
48
|
} = _ref;
|
|
40
49
|
const [isChecked, setIsChecked] = (0, _react.useState)(checked);
|
|
@@ -64,9 +73,15 @@ const Radio = _ref => {
|
|
|
64
73
|
};
|
|
65
74
|
if (onDenied.unvisible) return null;
|
|
66
75
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
67
|
-
className: "radio-
|
|
76
|
+
className: "radio-input",
|
|
77
|
+
style: {
|
|
78
|
+
display: 'flex',
|
|
79
|
+
alignItems: 'center'
|
|
80
|
+
}
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
82
|
+
className: `radio-button ${disabled ? 'disabled' : ''} ${skeletonize ? '-skeletonized' : ''}`
|
|
68
83
|
}, /*#__PURE__*/_react.default.createElement("input", _extends({}, getCustomProps(), {
|
|
69
|
-
ref:
|
|
84
|
+
ref: inputRef,
|
|
70
85
|
className: "radio-component",
|
|
71
86
|
type: "radio",
|
|
72
87
|
value: value,
|
|
@@ -75,8 +90,24 @@ const Radio = _ref => {
|
|
|
75
90
|
required: required,
|
|
76
91
|
disabled: shouldDisable()
|
|
77
92
|
})), /*#__PURE__*/_react.default.createElement("label", {
|
|
78
|
-
className:
|
|
93
|
+
className: `description ${size && `-${size}`}`,
|
|
79
94
|
htmlFor: id
|
|
80
|
-
}, /*#__PURE__*/_react.default.createElement("span", null,
|
|
95
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_textContent.default, {
|
|
96
|
+
required: required,
|
|
97
|
+
disabled: shouldDisable(),
|
|
98
|
+
className: customClassForLabel,
|
|
99
|
+
labelUppercase: labelUppercase
|
|
100
|
+
}), label, /*#__PURE__*/_react.default.createElement(_textContent.default, null)))), !!hint && hintPosition === 'onLabelRight' && /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
101
|
+
theme: themePopover,
|
|
102
|
+
align: popoverAlign,
|
|
103
|
+
customClass: "-hint",
|
|
104
|
+
iconColor: "#03bde2",
|
|
105
|
+
iconSize: 16,
|
|
106
|
+
style: {
|
|
107
|
+
margin: '0px 5px',
|
|
108
|
+
height: 'auto',
|
|
109
|
+
width: 20
|
|
110
|
+
}
|
|
111
|
+
}, hint));
|
|
81
112
|
};
|
|
82
113
|
var _default = exports.default = Radio;
|
package/lib/radio/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeEvent, Ref } from 'react';
|
|
1
|
+
import { ChangeEvent, Ref, RefObject } from 'react';
|
|
2
2
|
import { PermissionAttr } from '../@types/PermissionAttr.js';
|
|
3
3
|
import { Size } from '../@types/Size.js';
|
|
4
4
|
|
|
@@ -16,6 +16,13 @@ interface IRadioProps {
|
|
|
16
16
|
permissionAttr?: PermissionAttr | PermissionAttr;
|
|
17
17
|
skeletonize?: boolean;
|
|
18
18
|
forwardedRef?: Ref<HTMLInputElement>;
|
|
19
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
20
|
+
customClassForLabel?: string;
|
|
21
|
+
labelUppercase?: boolean;
|
|
22
|
+
hint?: string;
|
|
23
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
24
|
+
themePopover?: 'light' | 'dark';
|
|
25
|
+
popoverAlign?: 'right' | 'left';
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
export { IRadioProps };
|
package/lib/shortcuts/index.js
CHANGED
|
@@ -21,7 +21,7 @@ const Shortcuts = _ref => {
|
|
|
21
21
|
style: style
|
|
22
22
|
}, /*#__PURE__*/_react.default.createElement("kbd", {
|
|
23
23
|
"data-testid": "shortcut",
|
|
24
|
-
className:
|
|
24
|
+
className: `shortcut-component ${type && `-${type}`}`,
|
|
25
25
|
style: styleShortcut
|
|
26
26
|
}, shortcut), ":\xA0", description);
|
|
27
27
|
};
|
|
@@ -13,7 +13,8 @@ const SkeletonContainer = _ref => {
|
|
|
13
13
|
customClass,
|
|
14
14
|
style
|
|
15
15
|
} = _ref;
|
|
16
|
-
const getClass = () =>
|
|
16
|
+
const getClass = () => `skeletoncontainer-component ${customClass}
|
|
17
|
+
${row && '-row'}`;
|
|
17
18
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
18
19
|
className: getClass(),
|
|
19
20
|
style: style
|
package/lib/skeleton/index.js
CHANGED
|
@@ -35,7 +35,10 @@ const Skeleton = props => {
|
|
|
35
35
|
width,
|
|
36
36
|
height
|
|
37
37
|
};
|
|
38
|
-
const getClass = () =>
|
|
38
|
+
const getClass = () => `skeleton-component ${customClass}
|
|
39
|
+
${color && `-${color}`}
|
|
40
|
+
${round && '-round'}
|
|
41
|
+
${round && size && `-${size}`}`;
|
|
39
42
|
const renderContent = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
40
43
|
className: getClass(),
|
|
41
44
|
style: _objectSpread(_objectSpread({}, customStyles), style)
|
package/lib/spinner/index.js
CHANGED
|
@@ -37,8 +37,8 @@ const Spinner = props => {
|
|
|
37
37
|
};
|
|
38
38
|
}, []);
|
|
39
39
|
const getCssClass = () => {
|
|
40
|
-
let css =
|
|
41
|
-
if (heightAuto) css =
|
|
40
|
+
let css = `spinner-component -${align} ${customClass} `;
|
|
41
|
+
if (heightAuto) css = `${css} -heightauto`;
|
|
42
42
|
return css;
|
|
43
43
|
};
|
|
44
44
|
if (delay) return null;
|
package/lib/split/Split.js
CHANGED
|
@@ -246,7 +246,7 @@ const Split = _ref => {
|
|
|
246
246
|
} = state;
|
|
247
247
|
let containerClasses = 'split-component';
|
|
248
248
|
if (customClass) {
|
|
249
|
-
containerClasses +=
|
|
249
|
+
containerClasses += ` ${customClass}`;
|
|
250
250
|
}
|
|
251
251
|
if (vertical) {
|
|
252
252
|
containerClasses += ' splitter-layout-vertical';
|
package/lib/split/SplitSide.js
CHANGED
|
@@ -27,15 +27,15 @@ const SplitSide = _ref => {
|
|
|
27
27
|
const splitSideStyle = {};
|
|
28
28
|
if (!primary) {
|
|
29
29
|
if (vertical) {
|
|
30
|
-
splitSideStyle.height =
|
|
30
|
+
splitSideStyle.height = `${sizeSplitSide}${unit}`;
|
|
31
31
|
} else {
|
|
32
|
-
splitSideStyle.width =
|
|
32
|
+
splitSideStyle.width = `${sizeSplitSide}${unit}`;
|
|
33
33
|
}
|
|
34
34
|
} else {
|
|
35
35
|
classes += ' layout-pane-primary';
|
|
36
36
|
}
|
|
37
37
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
38
|
-
className:
|
|
38
|
+
className: `${classes} ${customClass}`,
|
|
39
39
|
style: Object.assign({}, splitSideStyle, style)
|
|
40
40
|
}, children);
|
|
41
41
|
};
|
package/lib/table/Body.js
CHANGED
|
@@ -28,7 +28,7 @@ const renderChildren = (children, _ref) => {
|
|
|
28
28
|
key: index
|
|
29
29
|
}, columns.map(id => /*#__PURE__*/_react.default.createElement(_index.Td, {
|
|
30
30
|
style: {
|
|
31
|
-
width: columnsWidth
|
|
31
|
+
width: columnsWidth?.[id - 1]
|
|
32
32
|
},
|
|
33
33
|
key: id
|
|
34
34
|
}, /*#__PURE__*/_react.default.createElement(_skeleton.default, {
|
|
@@ -63,9 +63,9 @@ const TableBody = _ref2 => {
|
|
|
63
63
|
contain: strict ? 'strict' : 'size layout style'
|
|
64
64
|
}
|
|
65
65
|
}, /*#__PURE__*/_react.default.createElement("tbody", {
|
|
66
|
-
className:
|
|
66
|
+
className: `tbody ${isSkeletonized ? 'skeleton-transparency' : ''} ${customClass}`
|
|
67
67
|
}, renderChildren(children, context)))) : /*#__PURE__*/_react.default.createElement("tbody", {
|
|
68
|
-
className:
|
|
68
|
+
className: `tbody ${isSkeletonized ? 'skeleton-transparency' : ''} ${customClass}`
|
|
69
69
|
}, renderChildren(children, context));
|
|
70
70
|
};
|
|
71
71
|
var _default = exports.default = TableBody;
|
package/lib/table/Header.js
CHANGED
|
@@ -12,7 +12,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
12
12
|
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; }
|
|
13
13
|
const getColumnsWidth = children => {
|
|
14
14
|
const columnsWidth = [];
|
|
15
|
-
if (
|
|
15
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(children) && children.props) {
|
|
16
16
|
let columns = children.props.children;
|
|
17
17
|
if (!_lodash.default.isArray(columns)) columns = [columns];
|
|
18
18
|
columns.forEach(element => {
|
|
@@ -20,14 +20,12 @@ const getColumnsWidth = children => {
|
|
|
20
20
|
if (_lodash.default.isArray(element)) {
|
|
21
21
|
element.forEach(elementArray => {
|
|
22
22
|
if (elementArray && elementArray.props) {
|
|
23
|
-
|
|
24
|
-
colWidth = (_elementArray$props = elementArray.props) === null || _elementArray$props === void 0 ? void 0 : (_elementArray$props$s = _elementArray$props.style) === null || _elementArray$props$s === void 0 ? void 0 : _elementArray$props$s.width;
|
|
23
|
+
colWidth = elementArray.props?.style?.width;
|
|
25
24
|
}
|
|
26
25
|
columnsWidth.push(colWidth);
|
|
27
26
|
});
|
|
28
27
|
} else if (element && element.props) {
|
|
29
|
-
|
|
30
|
-
colWidth = (_element$props = element.props) === null || _element$props === void 0 ? void 0 : (_element$props$style = _element$props.style) === null || _element$props$style === void 0 ? void 0 : _element$props$style.width;
|
|
28
|
+
colWidth = element.props?.style?.width;
|
|
31
29
|
columnsWidth.push(colWidth);
|
|
32
30
|
}
|
|
33
31
|
});
|
|
@@ -36,9 +34,8 @@ const getColumnsWidth = children => {
|
|
|
36
34
|
};
|
|
37
35
|
const countColumnsFromChildren = (element, columnsCount) => {
|
|
38
36
|
const count = columnsCount;
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
if (_lodash.default.isArray(element === null || element === void 0 ? void 0 : (_element$props2 = element.props) === null || _element$props2 === void 0 ? void 0 : _element$props2.children)) {
|
|
37
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(element)) {
|
|
38
|
+
if (_lodash.default.isArray(element?.props?.children)) {
|
|
42
39
|
const currentElement = element.props;
|
|
43
40
|
currentElement.children.forEach(child => countColumnsFromChildren(child, count));
|
|
44
41
|
} else if (element) {
|
|
@@ -51,7 +48,7 @@ const countColumnsFromChildren = (element, columnsCount) => {
|
|
|
51
48
|
const getColumnsCount = (children, columnsCount) => {
|
|
52
49
|
if (_lodash.default.isArray(children) && children.length > 0 && children[0].props) {
|
|
53
50
|
countColumnsFromChildren(children[0].props.children, columnsCount);
|
|
54
|
-
} else if (
|
|
51
|
+
} else if (/*#__PURE__*/(0, _react.isValidElement)(children) && children.props && children.props.children) {
|
|
55
52
|
countColumnsFromChildren(children.props.children, columnsCount);
|
|
56
53
|
}
|
|
57
54
|
return columnsCount.current;
|
|
@@ -85,9 +82,9 @@ const Header = _ref => {
|
|
|
85
82
|
tableLayout: 'fixed'
|
|
86
83
|
}
|
|
87
84
|
}, /*#__PURE__*/_react.default.createElement("thead", {
|
|
88
|
-
className:
|
|
85
|
+
className: `theader ${customClass}`
|
|
89
86
|
}, children))) : /*#__PURE__*/_react.default.createElement("thead", {
|
|
90
|
-
className:
|
|
87
|
+
className: `theader ${customClass}`
|
|
91
88
|
}, children);
|
|
92
89
|
};
|
|
93
90
|
var _default = exports.default = Header;
|