linear-react-components-ui 1.0.10-beta.2 → 1.0.10-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/.eslintrc.json +1 -0
- package/.vscode/settings.json +1 -1
- package/README.md +19 -12
- package/lib/@types/Align.d.ts +2 -1
- package/lib/alerts/AlertContainer.d.ts +2 -0
- package/lib/alerts/AlertProvider.d.ts +2 -0
- package/lib/alerts/BaseAlert.d.ts +2 -0
- package/lib/alerts/Message.d.ts +2 -0
- package/lib/alerts/Message.js +1 -1
- package/lib/alerts/alert.spec.js +133 -0
- package/lib/alerts/helpers.d.ts +2 -0
- package/lib/alerts/index.d.ts +2 -0
- package/lib/alerts/types.d.ts +3 -1
- package/lib/alerts/withAlert.d.ts +2 -0
- package/lib/assets/styles/dialog.scss +9 -6
- package/lib/assets/styles/drawers.scss +9 -0
- package/lib/assets/styles/effects.scss +2 -2
- package/lib/assets/styles/radio.scss +52 -8
- package/lib/assets/styles/table.scss +30 -0
- package/lib/assets/styles/tooltip.scss +42 -2
- package/lib/avatar/avatar.spec.js +190 -0
- package/lib/badge/badge.spec.js +127 -0
- package/lib/buttons/ActivateButton.d.ts +2 -0
- package/lib/buttons/AddButton.d.ts +2 -0
- package/lib/buttons/Button.d.ts +2 -0
- package/lib/buttons/CancelButton.d.ts +2 -0
- package/lib/buttons/DangerButton.d.ts +2 -0
- package/lib/buttons/DefaultButton.d.ts +2 -0
- package/lib/buttons/DefaultButton.js +14 -4
- package/lib/buttons/DestroyButton.d.ts +2 -0
- package/lib/buttons/EditButton.d.ts +2 -0
- package/lib/buttons/InactivateButton.d.ts +2 -0
- package/lib/buttons/InfoButton.d.ts +2 -0
- package/lib/buttons/PrimaryButton.d.ts +2 -0
- package/lib/buttons/RestoreButton.d.ts +2 -0
- package/lib/buttons/SaveButton.d.ts +2 -0
- package/lib/buttons/SpinnerLoading.js +230 -0
- package/lib/buttons/SuccessButton.d.ts +2 -0
- package/lib/buttons/WarningButton.d.ts +2 -0
- package/lib/buttons/buttons.spec.js +504 -0
- package/lib/buttons/index.d.ts +2 -0
- package/lib/buttons/split_button/index.d.ts +2 -0
- package/lib/buttons/types.d.ts +6 -2
- package/lib/calendar/calendar.spec.js +171 -0
- package/lib/checkbox/checkbox.spec.js +215 -0
- package/lib/dialog/Alert.d.ts +3 -0
- package/lib/dialog/Custom.d.ts +3 -0
- package/lib/dialog/Custom.js +1 -1
- package/lib/dialog/Error.d.ts +3 -0
- package/lib/dialog/Information.d.ts +3 -0
- package/lib/dialog/Question.d.ts +3 -0
- package/lib/dialog/Warning.d.ts +3 -0
- package/lib/dialog/base/Content.d.ts +3 -0
- package/lib/dialog/base/Footer.d.ts +3 -0
- package/lib/dialog/base/Header.d.ts +3 -0
- package/lib/dialog/base/Header.js +12 -1
- package/lib/dialog/base/index.d.ts +3 -0
- package/lib/dialog/base/index.js +78 -16
- package/lib/dialog/dialog.spec.js +488 -0
- package/lib/dialog/form/index.d.ts +7 -3
- package/lib/dialog/form/index.js +11 -4
- package/lib/dialog/index.d.ts +3 -0
- package/lib/dialog/types.d.ts +10 -4
- package/lib/drawer/Content.d.ts +2 -0
- package/lib/drawer/Drawer.d.ts +3 -1
- package/lib/drawer/Drawer.js +22 -2
- package/lib/drawer/Drawer.spec.js +258 -0
- package/lib/drawer/Header.d.ts +2 -0
- package/lib/drawer/helpers.d.ts +2 -0
- package/lib/drawer/index.d.ts +2 -0
- package/lib/drawer/types.d.ts +4 -1
- package/lib/dropdown/Popup.js +5 -0
- package/lib/dropdown/dropdown.spec.js +169 -0
- package/lib/fieldset/fieldset.spec.js +329 -0
- package/lib/form/Field.d.ts +2 -1
- package/lib/form/Field.js +33 -24
- package/lib/form/FieldArray.d.ts +1 -0
- package/lib/form/FieldArray.js +41 -4
- package/lib/form/FieldNumber.d.ts +1 -0
- package/lib/form/FieldNumber.js +24 -5
- package/lib/form/FieldPeriod.d.ts +1 -0
- package/lib/form/FieldPeriod.js +16 -2
- package/lib/form/form.spec.js +293 -0
- package/lib/form/helpers.d.ts +2 -1
- package/lib/form/helpers.js +2 -2
- package/lib/form/index.d.ts +4 -2
- package/lib/form/index.js +72 -35
- package/lib/form/types.d.ts +25 -6
- package/lib/form/withFieldHOC.d.ts +1 -0
- package/lib/form/withFieldHOC.js +1 -0
- package/lib/form/withFormSecurity.d.ts +1 -0
- package/lib/form/withFormSecurity.js +2 -1
- package/lib/gridlayout/gridLayout.spec.js +169 -0
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +4 -0
- package/lib/icons/icons.spec.js +86 -0
- package/lib/icons/index.d.ts +2 -0
- package/lib/icons/types.d.ts +3 -1
- package/lib/index.d.ts +4 -1
- package/lib/inputs/base/InputTextBase.d.ts +1 -0
- package/lib/inputs/base/InputTextBase.js +10 -2
- package/lib/inputs/base/base.spec.js +690 -0
- package/lib/inputs/base/helpers.d.ts +2 -1
- package/lib/inputs/base/index.js +1 -0
- package/lib/inputs/base/types.d.ts +2 -1
- package/lib/inputs/color/color_input.spec.js +174 -0
- package/lib/inputs/date/Dialog.d.ts +1 -0
- package/lib/inputs/date/Dropdown.d.ts +1 -0
- package/lib/inputs/date/date.spec.js +354 -0
- package/lib/inputs/date/helpers.d.ts +2 -1
- package/lib/inputs/date/helpers.js +3 -2
- package/lib/inputs/date/index.d.ts +1 -0
- package/lib/inputs/date/index.js +24 -9
- package/lib/inputs/date/types.d.ts +3 -1
- package/lib/inputs/file/DefaultFile.d.ts +1 -0
- package/lib/inputs/file/DragDropFile.d.ts +1 -0
- package/lib/inputs/file/File.d.ts +1 -0
- package/lib/inputs/file/FileButtonSettings.d.ts +1 -0
- package/lib/inputs/file/helpers.d.ts +1 -0
- package/lib/inputs/file/index.d.ts +1 -0
- package/lib/inputs/file/types.d.ts +1 -0
- package/lib/inputs/inputHOC.d.ts +3 -0
- package/lib/inputs/mask/BaseMask.d.ts +1 -0
- package/lib/inputs/mask/BaseMask.js +20 -5
- package/lib/inputs/mask/Cnpj.d.ts +1 -0
- package/lib/inputs/mask/Cpf.d.ts +1 -0
- package/lib/inputs/mask/Cpf.js +4 -4
- package/lib/inputs/mask/Phone.d.ts +1 -0
- package/lib/inputs/mask/ZipCode.d.ts +1 -0
- package/lib/inputs/mask/helpers.d.ts +3 -0
- package/lib/inputs/mask/helpers.js +1 -1
- package/lib/inputs/mask/imaskHOC.d.ts +3 -0
- package/lib/inputs/mask/imaskHOC.js +16 -12
- package/lib/inputs/mask/index.d.ts +1 -0
- package/lib/inputs/mask/input_mask.spec.js +607 -0
- package/lib/inputs/mask/types.d.ts +2 -1
- package/lib/inputs/multiSelect/ActionButtons.d.ts +2 -1
- package/lib/inputs/multiSelect/ActionButtons.js +4 -1
- package/lib/inputs/multiSelect/Dropdown.d.ts +1 -0
- package/lib/inputs/multiSelect/Dropdown.js +4 -4
- package/lib/inputs/multiSelect/helper.d.ts +8 -6
- package/lib/inputs/multiSelect/helper.js +5 -1
- package/lib/inputs/multiSelect/index.d.ts +1 -0
- package/lib/inputs/multiSelect/index.js +15 -11
- package/lib/inputs/multiSelect/types.d.ts +16 -6
- package/lib/inputs/number/BaseNumber.d.ts +3 -0
- package/lib/inputs/number/BaseNumber.js +1 -2
- package/lib/inputs/number/Currency.d.ts +3 -0
- package/lib/inputs/number/Decimal.d.ts +3 -0
- package/lib/inputs/number/format_number.d.ts +2 -1
- package/lib/inputs/number/format_number.js +8 -3
- package/lib/inputs/number/index.d.ts +3 -0
- package/lib/inputs/number/numberfield.spec.js +215 -0
- package/lib/inputs/number/types.d.ts +3 -1
- package/lib/inputs/period/Dialog.d.ts +1 -0
- package/lib/inputs/period/Dropdown.d.ts +1 -0
- package/lib/inputs/period/PeriodList.d.ts +1 -0
- package/lib/inputs/period/helper.d.ts +1 -0
- package/lib/inputs/period/index.d.ts +1 -0
- package/lib/inputs/period/index.js +8 -9
- package/lib/inputs/period/types.d.ts +3 -2
- package/lib/inputs/search/index.d.ts +3 -0
- package/lib/inputs/search/search_input.spec.js +209 -0
- package/lib/inputs/select/ActionButtons.d.ts +3 -0
- package/lib/inputs/select/Dropdown.d.ts +3 -0
- package/lib/inputs/select/Dropdown.js +1 -1
- package/lib/inputs/select/helper.d.ts +7 -9
- package/lib/inputs/select/helper.js +11 -2
- package/lib/inputs/select/index.d.ts +1 -0
- package/lib/inputs/select/index.js +6 -5
- package/lib/inputs/select/multiple/Selecteds.d.ts +1 -0
- package/lib/inputs/select/multiple/Selecteds.js +1 -1
- package/lib/inputs/select/multiple/index.d.ts +1 -0
- package/lib/inputs/select/multiple/index.js +13 -10
- package/lib/inputs/select/select.spec.js +395 -0
- package/lib/inputs/select/simple/index.d.ts +1 -0
- package/lib/inputs/select/simple/index.js +35 -18
- package/lib/inputs/select/types.d.ts +22 -7
- package/lib/inputs/text/index.d.ts +1 -0
- package/lib/inputs/text/textfield.spec.js +215 -0
- package/lib/inputs/text/types.d.ts +1 -1
- package/lib/inputs/textarea/index.d.ts +1 -0
- package/lib/inputs/textarea/index.js +1 -1
- package/lib/inputs/textarea/textarea.spec.js +59 -0
- package/lib/inputs/textarea/types.d.ts +1 -0
- package/lib/inputs/types.d.ts +7 -3
- package/lib/internals/types.d.ts +1 -0
- package/lib/internals/withTooltip.js +13 -6
- package/lib/labelMessages/index.d.ts +2 -0
- package/lib/labelMessages/index.js +3 -4
- package/lib/labelMessages/labelMessages.spec.js +176 -0
- package/lib/labelMessages/types.d.ts +3 -1
- package/lib/labels/DangerLabel.d.ts +2 -0
- package/lib/labels/DefaultLabel.d.ts +2 -0
- package/lib/labels/InfoLabel.d.ts +2 -0
- package/lib/labels/PrimaryLabel.d.ts +2 -0
- package/lib/labels/SuccessLabel.d.ts +2 -0
- package/lib/labels/WarningLabel.d.ts +2 -0
- package/lib/labels/index.d.ts +2 -0
- package/lib/labels/label.spec.js +162 -0
- package/lib/labels/types.d.ts +3 -1
- package/lib/list/Header.d.ts +2 -0
- package/lib/list/Item.d.ts +2 -0
- package/lib/list/helpers.d.ts +2 -0
- package/lib/list/index.d.ts +2 -0
- package/lib/list/list.spec.js +769 -0
- package/lib/list/types.d.ts +4 -2
- package/lib/menus/float/MenuItem.d.ts +2 -0
- package/lib/menus/float/float-menu.spec.js +221 -0
- package/lib/menus/float/helpers.d.ts +2 -0
- package/lib/menus/float/index.d.ts +2 -0
- package/lib/menus/float/types.d.ts +3 -1
- package/lib/menus/index.d.ts +2 -0
- package/lib/menus/sidenav/ExpandMenu.d.ts +2 -0
- package/lib/menus/sidenav/MenuLink.d.ts +2 -0
- package/lib/menus/sidenav/NavMenuGroup.d.ts +2 -0
- package/lib/menus/sidenav/NavMenuItem.d.ts +2 -0
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +2 -0
- package/lib/menus/sidenav/helpers.d.ts +2 -0
- package/lib/menus/sidenav/index.d.ts +2 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +2 -0
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +2 -0
- package/lib/menus/sidenav/sidenav.spec.js +379 -0
- package/lib/menus/sidenav/types.d.ts +4 -2
- package/lib/panel/Content.d.ts +3 -1
- package/lib/panel/DangerPanel.d.ts +3 -1
- package/lib/panel/Default.d.ts +3 -1
- package/lib/panel/Header.d.ts +3 -1
- package/lib/panel/Header.js +3 -4
- package/lib/panel/InfoPanel.d.ts +3 -1
- package/lib/panel/PrimaryPanel.d.ts +3 -1
- package/lib/panel/SuccessPanel.d.ts +3 -1
- package/lib/panel/ToolBar.d.ts +3 -1
- package/lib/panel/WarningPanel.d.ts +3 -1
- package/lib/panel/helpers.d.ts +3 -1
- package/lib/panel/index.d.ts +3 -1
- package/lib/panel/panel.spec.js +216 -0
- package/lib/panel/types.d.ts +3 -1
- package/lib/popover/PopoverText.d.ts +2 -0
- package/lib/popover/PopoverTitle.d.ts +2 -0
- package/lib/popover/index.d.ts +2 -0
- package/lib/popover/index.js +1 -2
- package/lib/popover/popover.spec.js +146 -0
- package/lib/popover/types.d.ts +3 -1
- package/lib/progress/progress.spec.js +94 -0
- package/lib/radio/index.d.ts +2 -1
- package/lib/radio/index.js +5 -1
- package/lib/radio/radio.spec.js +189 -0
- package/lib/radio/types.d.ts +4 -1
- package/lib/spinner/spinner.spec.js +152 -0
- package/lib/split/split.spec.js +163 -0
- package/lib/table/Body.js +9 -12
- package/lib/table/Header.js +19 -16
- package/lib/table/Row.js +20 -3
- package/lib/table/index.js +1 -0
- package/lib/table/table.spec.js +352 -0
- package/lib/table/types.d.ts +7 -0
- package/lib/tabs/DropdownItems.d.ts +2 -0
- package/lib/tabs/Menu.d.ts +2 -0
- package/lib/tabs/MenuItems.d.ts +2 -0
- package/lib/tabs/Panel.d.ts +2 -0
- package/lib/tabs/index.d.ts +2 -0
- package/lib/tabs/tabHelpers.d.ts +2 -0
- package/lib/tabs/tabs.spec.js +321 -0
- package/lib/tabs/types.d.ts +3 -1
- package/lib/toolbar/ButtonBar.d.ts +2 -0
- package/lib/toolbar/LabelBar.d.ts +2 -0
- package/lib/toolbar/ToolBarGroup.d.ts +2 -0
- package/lib/toolbar/helpers.d.ts +2 -0
- package/lib/toolbar/index.d.ts +2 -0
- package/lib/toolbar/toolbar.spec.js +394 -0
- package/lib/toolbar/types.d.ts +4 -2
- package/lib/tooltip/index.d.ts +1 -1
- package/lib/tooltip/index.js +5 -1
- package/lib/tooltip/tooltip.spec.js +215 -0
- package/lib/tooltip/types.d.ts +1 -0
- package/lib/treeview/index.js +1 -0
- package/lib/treeview/treeview.spec.js +279 -0
- package/lib/{types-90c43ae1.d.ts → types-c1e2d0c9.d.ts} +2 -1
- package/lib/uitour/uitour.spec.js +176 -0
- package/package.json +67 -64
package/lib/list/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ReactNode, ReactElement, CSSProperties, Ref } from 'react';
|
|
2
2
|
import { PermissionAttr } from '../@types/PermissionAttr.js';
|
|
3
|
+
import { IconNames } from '../@types/Icon.js';
|
|
4
|
+
import '../icons/helper.js';
|
|
3
5
|
|
|
4
6
|
type ItemId = string;
|
|
5
7
|
interface KeyboardEvent {
|
|
@@ -40,8 +42,8 @@ interface IListItemProps {
|
|
|
40
42
|
leftIcon?: ReactElement;
|
|
41
43
|
rightIcon?: ReactElement;
|
|
42
44
|
onClick?: (event?: React.MouseEvent<HTMLLIElement, MouseEvent> | KeyboardEvent, itemId?: string) => void;
|
|
43
|
-
leftIconName?:
|
|
44
|
-
rightIconName?:
|
|
45
|
+
leftIconName?: IconNames;
|
|
46
|
+
rightIconName?: IconNames;
|
|
45
47
|
customClass?: string;
|
|
46
48
|
url?: string;
|
|
47
49
|
visible?: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { IFloatMenuItemProps } from './types.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../@types/SizePixels.js';
|
|
4
|
+
import '../../@types/Icon.js';
|
|
5
|
+
import '../../icons/helper.js';
|
|
4
6
|
|
|
5
7
|
declare const MenuItem: ({ title, url, iconName, iconColor, iconSize, dropdownMenu, onClick, }: IFloatMenuItemProps) => JSX.Element;
|
|
6
8
|
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
require("babel-polyfill");
|
|
8
|
+
|
|
9
|
+
var _react2 = require("@testing-library/react");
|
|
10
|
+
|
|
11
|
+
require("@testing-library/jest-dom");
|
|
12
|
+
|
|
13
|
+
var _ = _interopRequireWildcard(require("."));
|
|
14
|
+
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
|
|
21
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
22
|
+
|
|
23
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
24
|
+
|
|
25
|
+
var menuData = [{
|
|
26
|
+
title: 'Fiscal',
|
|
27
|
+
key: 'FISCAL',
|
|
28
|
+
url: '/teste',
|
|
29
|
+
iconName: 'code',
|
|
30
|
+
iconColor: 'gray',
|
|
31
|
+
iconSize: 24
|
|
32
|
+
}, {
|
|
33
|
+
title: 'Financeiro',
|
|
34
|
+
key: 'FINANCEIRO',
|
|
35
|
+
url: '/teste1',
|
|
36
|
+
iconName: 'folder_close',
|
|
37
|
+
iconColor: 'red',
|
|
38
|
+
iconSize: 24
|
|
39
|
+
}];
|
|
40
|
+
|
|
41
|
+
var floatMenuMockRender = function floatMenuMockRender(props) {
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_.default, props, menuData.map(function (p) {
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_.MenuItem, p);
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
describe('SideNav Menu', function () {
|
|
48
|
+
describe('Default', function () {
|
|
49
|
+
it('should render', function () {
|
|
50
|
+
var _render = (0, _react2.render)(floatMenuMockRender()),
|
|
51
|
+
container = _render.container;
|
|
52
|
+
|
|
53
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
it('should apply customClass prop', function () {
|
|
56
|
+
var _render2 = (0, _react2.render)(floatMenuMockRender({
|
|
57
|
+
customClass: 'customClass'
|
|
58
|
+
})),
|
|
59
|
+
container = _render2.container;
|
|
60
|
+
|
|
61
|
+
expect(container.firstChild).toHaveClass('customClass');
|
|
62
|
+
});
|
|
63
|
+
it('should apply iconSize prop', function () {
|
|
64
|
+
(0, _react2.render)(floatMenuMockRender({
|
|
65
|
+
iconSize: 18,
|
|
66
|
+
iconColor: 'red'
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
var svg = _react2.screen.getByTestId('icon');
|
|
70
|
+
|
|
71
|
+
expect(svg).toHaveAttribute('fill', 'red');
|
|
72
|
+
expect(svg).toHaveAttribute('width', '18px');
|
|
73
|
+
});
|
|
74
|
+
it('should open float menu', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
75
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
76
|
+
while (1) {
|
|
77
|
+
switch (_context.prev = _context.next) {
|
|
78
|
+
case 0:
|
|
79
|
+
(0, _react2.render)(floatMenuMockRender());
|
|
80
|
+
|
|
81
|
+
_react2.fireEvent.click(_react2.screen.getByRole('button'));
|
|
82
|
+
|
|
83
|
+
_context.next = 4;
|
|
84
|
+
return (0, _react2.waitFor)(function () {
|
|
85
|
+
return _react2.screen.getByTestId('dropdown-component');
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
case 4:
|
|
89
|
+
expect(_react2.screen.getByTestId('dropdown-component')).toBeInTheDocument();
|
|
90
|
+
|
|
91
|
+
case 5:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context.stop();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}, _callee);
|
|
97
|
+
})));
|
|
98
|
+
it('should menu have 2 children', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
99
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
100
|
+
while (1) {
|
|
101
|
+
switch (_context2.prev = _context2.next) {
|
|
102
|
+
case 0:
|
|
103
|
+
(0, _react2.render)(floatMenuMockRender());
|
|
104
|
+
|
|
105
|
+
_react2.fireEvent.click(_react2.screen.getByRole('button'));
|
|
106
|
+
|
|
107
|
+
_context2.next = 4;
|
|
108
|
+
return (0, _react2.waitFor)(function () {
|
|
109
|
+
return _react2.screen.getByTestId('dropdown-component');
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
case 4:
|
|
113
|
+
expect(_react2.screen.getByTestId('dropdown-component').firstChild.childNodes.length).toBe(2);
|
|
114
|
+
|
|
115
|
+
case 5:
|
|
116
|
+
case "end":
|
|
117
|
+
return _context2.stop();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, _callee2);
|
|
121
|
+
})));
|
|
122
|
+
it('should href match with prop', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
123
|
+
var as;
|
|
124
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
125
|
+
while (1) {
|
|
126
|
+
switch (_context3.prev = _context3.next) {
|
|
127
|
+
case 0:
|
|
128
|
+
(0, _react2.render)(floatMenuMockRender());
|
|
129
|
+
|
|
130
|
+
_react2.fireEvent.click(_react2.screen.getByRole('button'));
|
|
131
|
+
|
|
132
|
+
_context3.next = 4;
|
|
133
|
+
return (0, _react2.waitFor)(function () {
|
|
134
|
+
return _react2.screen.getByTestId('dropdown-component');
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
case 4:
|
|
138
|
+
as = _react2.screen.getAllByRole('link');
|
|
139
|
+
expect(as[0].href).toBe('http://localhost/teste');
|
|
140
|
+
expect(as[1].href).toBe('http://localhost/teste1');
|
|
141
|
+
|
|
142
|
+
case 7:
|
|
143
|
+
case "end":
|
|
144
|
+
return _context3.stop();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}, _callee3);
|
|
148
|
+
})));
|
|
149
|
+
it('should link have a icon and label', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
150
|
+
var as;
|
|
151
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
152
|
+
while (1) {
|
|
153
|
+
switch (_context4.prev = _context4.next) {
|
|
154
|
+
case 0:
|
|
155
|
+
(0, _react2.render)(floatMenuMockRender());
|
|
156
|
+
|
|
157
|
+
_react2.fireEvent.click(_react2.screen.getByRole('button'));
|
|
158
|
+
|
|
159
|
+
_context4.next = 4;
|
|
160
|
+
return (0, _react2.waitFor)(function () {
|
|
161
|
+
return _react2.screen.getByTestId('dropdown-component');
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
case 4:
|
|
165
|
+
as = document.querySelectorAll('.dropdown-component .items .floatmenuitem');
|
|
166
|
+
expect(as[0].firstChild).toHaveClass('-items');
|
|
167
|
+
expect(as[0].querySelector('.iconcontainer')).toBeInTheDocument();
|
|
168
|
+
expect(as[0].querySelector('.icon-component')).toBeInTheDocument();
|
|
169
|
+
expect(as[0].querySelector('.nameitem')).toBeInTheDocument();
|
|
170
|
+
expect(as[0]).toHaveTextContent(menuData[0].title);
|
|
171
|
+
expect(as[1].firstChild).toHaveClass('-items');
|
|
172
|
+
expect(as[1].querySelector('.iconcontainer')).toBeInTheDocument();
|
|
173
|
+
expect(as[1].querySelector('.icon-component')).toBeInTheDocument();
|
|
174
|
+
expect(as[1].querySelector('.nameitem')).toBeInTheDocument();
|
|
175
|
+
expect(as[1]).toHaveTextContent(menuData[1].title);
|
|
176
|
+
|
|
177
|
+
case 15:
|
|
178
|
+
case "end":
|
|
179
|
+
return _context4.stop();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}, _callee4);
|
|
183
|
+
})));
|
|
184
|
+
});
|
|
185
|
+
describe('IsLoading', function () {
|
|
186
|
+
it('should open float menu', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
187
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
188
|
+
while (1) {
|
|
189
|
+
switch (_context5.prev = _context5.next) {
|
|
190
|
+
case 0:
|
|
191
|
+
(0, _react2.render)(floatMenuMockRender({
|
|
192
|
+
isLoading: true
|
|
193
|
+
}));
|
|
194
|
+
|
|
195
|
+
_react2.fireEvent.click(_react2.screen.getByRole('button'));
|
|
196
|
+
|
|
197
|
+
_context5.next = 4;
|
|
198
|
+
return (0, _react2.waitFor)(function () {
|
|
199
|
+
return _react2.screen.getByTestId('dropdown-component');
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
case 4:
|
|
203
|
+
_context5.next = 6;
|
|
204
|
+
return (0, _react2.waitFor)(function () {
|
|
205
|
+
return _react2.screen.getByTestId('spinner');
|
|
206
|
+
}, {
|
|
207
|
+
timeout: 3000
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
case 6:
|
|
211
|
+
expect(_react2.screen.getByTestId('spinner')).toBeTruthy();
|
|
212
|
+
|
|
213
|
+
case 7:
|
|
214
|
+
case "end":
|
|
215
|
+
return _context5.stop();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}, _callee5);
|
|
219
|
+
})));
|
|
220
|
+
});
|
|
221
|
+
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { IFloatMenuContext } from './types.js';
|
|
3
3
|
import '../../@types/SizePixels.js';
|
|
4
|
+
import '../../@types/Icon.js';
|
|
5
|
+
import '../../icons/helper.js';
|
|
4
6
|
|
|
5
7
|
declare const FloatMenuContext: React__default.Context<IFloatMenuContext>;
|
|
6
8
|
|
|
@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { IFloatMenuProps } from './types.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../../@types/SizePixels.js';
|
|
6
|
+
import '../../@types/Icon.js';
|
|
7
|
+
import '../../icons/helper.js';
|
|
6
8
|
|
|
7
9
|
declare function SubMenuContainer({ title, customClass, handlerGoBack, skeletonize, skeletonQtty, children, }: {
|
|
8
10
|
title: any;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SizePixels } from '../../@types/SizePixels.js';
|
|
3
|
+
import { IconNames } from '../../@types/Icon.js';
|
|
4
|
+
import '../../icons/helper.js';
|
|
3
5
|
|
|
4
6
|
interface IFloatMenuContext {
|
|
5
7
|
customClassMenuItem?: string;
|
|
@@ -17,7 +19,7 @@ interface IFloatMenuItemProps {
|
|
|
17
19
|
title?: string;
|
|
18
20
|
url?: string;
|
|
19
21
|
urlHref?: string;
|
|
20
|
-
iconName?:
|
|
22
|
+
iconName?: IconNames;
|
|
21
23
|
iconColor?: string;
|
|
22
24
|
iconSize?: SizePixels;
|
|
23
25
|
customClass?: string;
|
package/lib/menus/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import '../../@types/PermissionAttr.js';
|
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
5
|
import '../../internals/types.js';
|
|
6
6
|
import '../../@types/Position.js';
|
|
7
|
+
import '../../@types/Icon.js';
|
|
8
|
+
import '../../icons/helper.js';
|
|
7
9
|
|
|
8
10
|
declare const ExpandMenu: ({ onExpandMenu, expandMenuCustomClass, iconName }: IExpandMenuProps) => JSX.Element;
|
|
9
11
|
|
|
@@ -4,6 +4,8 @@ import '../../@types/PermissionAttr.js';
|
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
5
|
import '../../internals/types.js';
|
|
6
6
|
import '../../@types/Position.js';
|
|
7
|
+
import '../../@types/Icon.js';
|
|
8
|
+
import '../../icons/helper.js';
|
|
7
9
|
|
|
8
10
|
declare const _default: {
|
|
9
11
|
(props: IMenuLinkProps): JSX.Element;
|
|
@@ -4,6 +4,8 @@ import '../../@types/PermissionAttr.js';
|
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
5
|
import '../../internals/types.js';
|
|
6
6
|
import '../../@types/Position.js';
|
|
7
|
+
import '../../@types/Icon.js';
|
|
8
|
+
import '../../icons/helper.js';
|
|
7
9
|
|
|
8
10
|
declare const NavMenuGroup: ({ children, scrollable }: INavMenuGroupProps) => JSX.Element;
|
|
9
11
|
|
|
@@ -4,6 +4,8 @@ import '../../@types/PermissionAttr.js';
|
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
5
|
import '../../internals/types.js';
|
|
6
6
|
import '../../@types/Position.js';
|
|
7
|
+
import '../../@types/Icon.js';
|
|
8
|
+
import '../../icons/helper.js';
|
|
7
9
|
|
|
8
10
|
declare const _default: {
|
|
9
11
|
(props: INavMenuItemProps): JSX.Element;
|
|
@@ -4,6 +4,8 @@ import '../../@types/PermissionAttr.js';
|
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
5
|
import '../../internals/types.js';
|
|
6
6
|
import '../../@types/Position.js';
|
|
7
|
+
import '../../@types/Icon.js';
|
|
8
|
+
import '../../icons/helper.js';
|
|
7
9
|
|
|
8
10
|
declare const NavSubMenuItem: ({ title, url, permissionAttr }: INavSubMenuItemProps) => JSX.Element | null;
|
|
9
11
|
|
|
@@ -4,6 +4,8 @@ import '../../@types/PermissionAttr.js';
|
|
|
4
4
|
import '../../@types/Size.js';
|
|
5
5
|
import '../../internals/types.js';
|
|
6
6
|
import '../../@types/Position.js';
|
|
7
|
+
import '../../@types/Icon.js';
|
|
8
|
+
import '../../icons/helper.js';
|
|
7
9
|
|
|
8
10
|
declare const getCssClassMenu: (isExpanded?: boolean, size?: string) => string;
|
|
9
11
|
declare const SubMenuContext: React__default.Context<ISubMenuContext>;
|
|
@@ -8,6 +8,8 @@ import '../../@types/PermissionAttr.js';
|
|
|
8
8
|
import '../../@types/Size.js';
|
|
9
9
|
import '../../internals/types.js';
|
|
10
10
|
import '../../@types/Position.js';
|
|
11
|
+
import '../../@types/Icon.js';
|
|
12
|
+
import '../../icons/helper.js';
|
|
11
13
|
|
|
12
14
|
declare const SideNav: (props: ISideNavProps) => JSX.Element;
|
|
13
15
|
|
|
@@ -4,6 +4,8 @@ import '../../../@types/PermissionAttr.js';
|
|
|
4
4
|
import '../../../@types/Size.js';
|
|
5
5
|
import '../../../internals/types.js';
|
|
6
6
|
import '../../../@types/Position.js';
|
|
7
|
+
import '../../../@types/Icon.js';
|
|
8
|
+
import '../../../icons/helper.js';
|
|
7
9
|
|
|
8
10
|
declare const EmptyList: ({ info, visible, }: IEmptyListProps) => JSX.Element;
|
|
9
11
|
|
|
@@ -4,6 +4,8 @@ import '../../../@types/PermissionAttr.js';
|
|
|
4
4
|
import '../../../@types/Size.js';
|
|
5
5
|
import '../../../internals/types.js';
|
|
6
6
|
import '../../../@types/Position.js';
|
|
7
|
+
import '../../../@types/Icon.js';
|
|
8
|
+
import '../../../icons/helper.js';
|
|
7
9
|
|
|
8
10
|
declare const PopupMenuSearch: (props: IPopupMenuSearchProps) => React__default.ReactPortal;
|
|
9
11
|
|