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/.eslintrc.json
CHANGED
package/.vscode/settings.json
CHANGED
package/README.md
CHANGED
|
@@ -69,22 +69,29 @@ ficando da seguinte maneira:
|
|
|
69
69
|
`npm version 0.4.75`
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
### Publicar versão de demonstração
|
|
73
|
-
|
|
72
|
+
### Publicar versão de demonstração na VERCEL
|
|
74
73
|
Pré-requesistos
|
|
75
|
-
- Ter
|
|
76
|
-
- Ser um colaborador do projeto no Heroku
|
|
77
|
-
- Ter o heroku cli instalado: https://devcenter.heroku.com/articles/heroku-cli#install-the-heroku-cli
|
|
74
|
+
- Ter a CLI da Vercel instalada
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
Instalação da CLI Vercel caso ainda não tenha
|
|
77
|
+
|
|
78
|
+
`npm i -g vercel` ou `yarn global add vercel`
|
|
79
|
+
|
|
80
|
+
**Obs: Verifique se a instalação da CLI ocorreu bem, faça o teste com o seguinte comando no seu terminal, `vercel --version`, caso não seja retornado a versão instalada, será necessário configurar o comando `vercel` no seu terminal, segue um link de apoio: https://www.google.com/search?q=command+not+found%3A+vercel**
|
|
81
|
+
|
|
82
|
+
Login na Vercel após já possuir a CLI instalada
|
|
83
|
+
|
|
84
|
+
`vercel login desenvweb.linear@gmail.com`
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
`heroku git:clone -a linear-react-comp-demo demo`
|
|
86
|
+
**Após executar o comando de login, será necessário clicar no link de confirmação enviado no e-mail informado no comando, assim a Vercel gera um token de acesso local, permitindo então acesso a conta da hospedagem. Esse e-mail foi definido por Deivisson e somente ele possui acesso, portanto solicite a ele o link de confirmação.**
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
Publicar versão do pacote na Vercel
|
|
89
|
+
|
|
90
|
+
`npm run deploy:vercel` ou `yarn deploy:vercel`
|
|
91
|
+
|
|
92
|
+
Obs: Ocorrendo tudo OK no processo de build e publicação no seu terminal, a Vercel atualiza o link https://linear-components-ui.vercel.app/#/ com a versão enviada já em produção. A documentação da CLI é bem completa e fácil de entender, qualquer dúvida basta consultar o seguinte link:
|
|
93
|
+
|
|
94
|
+
CLI Documentação - https://vercel.com/docs/cli
|
|
87
95
|
|
|
88
|
-
Obs: Para publicar a versão, é necessario fazer o clone do projeto no heroku.
|
|
89
96
|
|
|
90
97
|
|
package/lib/@types/Align.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { IMessageProps, DefaultMessageConfigType } from './types.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../@types/PositionAlert.js';
|
|
4
|
+
import '../@types/Icon.js';
|
|
5
|
+
import '../icons/helper.js';
|
|
4
6
|
|
|
5
7
|
declare class AlertContainer {
|
|
6
8
|
pushAlert: (params: IMessageProps) => void;
|
package/lib/alerts/Message.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { IMessageProps } from './types.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../@types/PositionAlert.js';
|
|
4
|
+
import '../@types/Icon.js';
|
|
5
|
+
import '../icons/helper.js';
|
|
4
6
|
|
|
5
7
|
declare const Message: ({ handleClose, message, id, color, icon, iconName, timeout, customClass, closeButton, className, position, }: IMessageProps) => JSX.Element;
|
|
6
8
|
|
package/lib/alerts/Message.js
CHANGED
|
@@ -38,7 +38,7 @@ var Message = function Message(_ref2) {
|
|
|
38
38
|
_ref2$icon = _ref2.icon,
|
|
39
39
|
icon = _ref2$icon === void 0 ? null : _ref2$icon,
|
|
40
40
|
_ref2$iconName = _ref2.iconName,
|
|
41
|
-
iconName = _ref2$iconName === void 0 ?
|
|
41
|
+
iconName = _ref2$iconName === void 0 ? null : _ref2$iconName,
|
|
42
42
|
_ref2$timeout = _ref2.timeout,
|
|
43
43
|
timeout = _ref2$timeout === void 0 ? 3000 : _ref2$timeout,
|
|
44
44
|
_ref2$customClass = _ref2.customClass,
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
require("babel-polyfill");
|
|
6
|
+
|
|
7
|
+
require("@testing-library/jest-dom");
|
|
8
|
+
|
|
9
|
+
var _react2 = require("@testing-library/react");
|
|
10
|
+
|
|
11
|
+
var _Message = _interopRequireDefault(require("./Message"));
|
|
12
|
+
|
|
13
|
+
var _icons = _interopRequireDefault(require("../icons"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
|
|
17
|
+
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); } }
|
|
18
|
+
|
|
19
|
+
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); }); }; }
|
|
20
|
+
|
|
21
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
22
|
+
|
|
23
|
+
var mockAlert = function mockAlert(props) {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_Message.default, _extends({
|
|
25
|
+
id: 3,
|
|
26
|
+
message: "Alerta",
|
|
27
|
+
position: "rightTop",
|
|
28
|
+
closeButton: true,
|
|
29
|
+
customClass: "mock-alert",
|
|
30
|
+
timeout: 500
|
|
31
|
+
}, props));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
describe('Alert', function () {
|
|
35
|
+
describe('Message', function () {
|
|
36
|
+
it('should render correctly', function () {
|
|
37
|
+
var mockHandleClose = jest.fn();
|
|
38
|
+
|
|
39
|
+
var _render = (0, _react2.render)(mockAlert({
|
|
40
|
+
handleClose: mockHandleClose
|
|
41
|
+
})),
|
|
42
|
+
container = _render.container;
|
|
43
|
+
|
|
44
|
+
expect(container.firstChild).toBeTruthy();
|
|
45
|
+
expect(container.firstChild).toHaveTextContent('Alerta');
|
|
46
|
+
});
|
|
47
|
+
it('should close with timeout 500ms', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
48
|
+
var mockHandleClose;
|
|
49
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
50
|
+
while (1) {
|
|
51
|
+
switch (_context.prev = _context.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
mockHandleClose = jest.fn();
|
|
54
|
+
(0, _react2.render)(mockAlert({
|
|
55
|
+
handleClose: mockHandleClose
|
|
56
|
+
}));
|
|
57
|
+
_context.next = 4;
|
|
58
|
+
return (0, _react2.waitFor)(function () {
|
|
59
|
+
return expect(mockHandleClose).toBeCalledTimes(1);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
case 4:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context.stop();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, _callee);
|
|
68
|
+
})));
|
|
69
|
+
it('should apply custom class', function () {
|
|
70
|
+
var mockHandleClose = jest.fn();
|
|
71
|
+
|
|
72
|
+
var _render2 = (0, _react2.render)(mockAlert({
|
|
73
|
+
handleClose: mockHandleClose
|
|
74
|
+
})),
|
|
75
|
+
container = _render2.container;
|
|
76
|
+
|
|
77
|
+
expect(container.firstChild).toHaveClass('mock-alert');
|
|
78
|
+
});
|
|
79
|
+
it('should render icon', function () {
|
|
80
|
+
var mockHandleClose = jest.fn();
|
|
81
|
+
|
|
82
|
+
var _render3 = (0, _react2.render)(mockAlert({
|
|
83
|
+
handleClose: mockHandleClose,
|
|
84
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
85
|
+
name: "user"
|
|
86
|
+
})
|
|
87
|
+
})),
|
|
88
|
+
container = _render3.container,
|
|
89
|
+
getByTestId = _render3.getByTestId;
|
|
90
|
+
|
|
91
|
+
expect(container.querySelector('.-icon')).toContainElement(getByTestId('icon'));
|
|
92
|
+
});
|
|
93
|
+
it('should render icon by iconName', function () {
|
|
94
|
+
var mockHandleClose = jest.fn();
|
|
95
|
+
|
|
96
|
+
var _render4 = (0, _react2.render)(mockAlert({
|
|
97
|
+
handleClose: mockHandleClose,
|
|
98
|
+
iconName: 'user'
|
|
99
|
+
})),
|
|
100
|
+
container = _render4.container,
|
|
101
|
+
getByTestId = _render4.getByTestId;
|
|
102
|
+
|
|
103
|
+
expect(container.querySelector('.-icon')).toContainElement(getByTestId('icon'));
|
|
104
|
+
});
|
|
105
|
+
it('should change icon color', function () {
|
|
106
|
+
var mockHandleClose = jest.fn();
|
|
107
|
+
|
|
108
|
+
var _render5 = (0, _react2.render)(mockAlert({
|
|
109
|
+
handleClose: mockHandleClose,
|
|
110
|
+
iconName: 'user',
|
|
111
|
+
color: 'red'
|
|
112
|
+
})),
|
|
113
|
+
getByTestId = _render5.getByTestId;
|
|
114
|
+
|
|
115
|
+
expect(getByTestId('icon')).toHaveAttribute('fill', 'red');
|
|
116
|
+
});
|
|
117
|
+
it('should fire event on click', function () {
|
|
118
|
+
var mockHandleClose = jest.fn();
|
|
119
|
+
|
|
120
|
+
var _render6 = (0, _react2.render)(mockAlert({
|
|
121
|
+
handleClose: mockHandleClose
|
|
122
|
+
})),
|
|
123
|
+
container = _render6.container,
|
|
124
|
+
getByRole = _render6.getByRole;
|
|
125
|
+
|
|
126
|
+
_react2.fireEvent.click(getByRole('button'));
|
|
127
|
+
|
|
128
|
+
expect(container.querySelector('.close')).toBeInTheDocument();
|
|
129
|
+
expect(container.querySelector('.close-button')).toBeInTheDocument();
|
|
130
|
+
expect(mockHandleClose).toBeCalledTimes(1);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
});
|
package/lib/alerts/helpers.d.ts
CHANGED
package/lib/alerts/index.d.ts
CHANGED
package/lib/alerts/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { PositionAlert } from '../@types/PositionAlert.js';
|
|
3
|
+
import { IconNames } from '../@types/Icon.js';
|
|
4
|
+
import '../icons/helper.js';
|
|
3
5
|
|
|
4
6
|
type AlertContainerMethods = {
|
|
5
7
|
default: (messageConfig: DefaultMessageConfigType) => void;
|
|
@@ -25,7 +27,7 @@ interface IMessageProps {
|
|
|
25
27
|
color?: string;
|
|
26
28
|
customClass?: string;
|
|
27
29
|
icon?: ReactNode | null;
|
|
28
|
-
iconName?:
|
|
30
|
+
iconName?: IconNames | null;
|
|
29
31
|
timeout?: number;
|
|
30
32
|
}
|
|
31
33
|
interface IBaseAlertProps {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { WithAlertContextProps } from './types.js';
|
|
3
3
|
import '../@types/PositionAlert.js';
|
|
4
|
+
import '../@types/Icon.js';
|
|
5
|
+
import '../icons/helper.js';
|
|
4
6
|
|
|
5
7
|
declare const withAlert: <ComponentProps extends WithAlertContextProps>(WrapperComponent: React__default.ComponentType<ComponentProps>) => (props: ComponentProps) => JSX.Element;
|
|
6
8
|
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
font-family: 'Roboto', sans-serif;
|
|
6
6
|
line-height: 22px;
|
|
7
7
|
font-size: 14px;
|
|
8
|
-
z-index: 99999;
|
|
9
8
|
position: fixed;
|
|
10
9
|
top: 0;
|
|
11
10
|
bottom: 0;
|
|
@@ -29,7 +28,7 @@
|
|
|
29
28
|
background: $default-color;
|
|
30
29
|
padding: 2px;
|
|
31
30
|
border-radius: 6px;
|
|
32
|
-
animation:
|
|
31
|
+
animation: 0.3s ease-out 0s 1 slideInFromTop;
|
|
33
32
|
> .dialog-content {
|
|
34
33
|
height: 100%;
|
|
35
34
|
text-align: left;
|
|
@@ -56,12 +55,18 @@
|
|
|
56
55
|
padding-left: 10px;
|
|
57
56
|
padding-right: 10px;
|
|
58
57
|
padding-top: 3px;
|
|
58
|
+
cursor: grab;
|
|
59
|
+
&:active {
|
|
60
|
+
cursor: grabbing;
|
|
61
|
+
}
|
|
59
62
|
> .left > .icon-component {
|
|
60
63
|
margin-right: 10px;
|
|
61
64
|
}
|
|
62
65
|
> .right {
|
|
63
|
-
|
|
66
|
+
width: 100%;
|
|
64
67
|
margin-left: 2px;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
65
70
|
&.modal-title {
|
|
66
71
|
color: #4e4c4c;
|
|
67
72
|
font-weight: 600;
|
|
@@ -70,10 +75,9 @@
|
|
|
70
75
|
.close-button {
|
|
71
76
|
color: #777;
|
|
72
77
|
cursor: pointer;
|
|
73
|
-
float: right;
|
|
74
78
|
font-size: 16px;
|
|
75
79
|
text-shadow: 0 1px 0 $default-color;
|
|
76
|
-
margin-
|
|
80
|
+
margin-left: auto;
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
.footer {
|
|
@@ -176,5 +180,4 @@
|
|
|
176
180
|
width: 100%;
|
|
177
181
|
top: 0;
|
|
178
182
|
left: 0;
|
|
179
|
-
z-index: 99998;
|
|
180
183
|
}
|
|
@@ -37,14 +37,26 @@ $radio-button-ripple-size: 15px;
|
|
|
37
37
|
left: -9999px;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
.radio-component:focus + label:before {
|
|
41
|
+
box-shadow: 0 0 2px 1px $radio-button-checked-color;
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
.radio-component:checked + .description,
|
|
41
45
|
.radio-component:not(:checked) + .description {
|
|
42
46
|
position: relative;
|
|
43
|
-
padding-left:
|
|
47
|
+
padding-left: 1.35rem;
|
|
44
48
|
cursor: pointer;
|
|
45
49
|
line-height: 20px;
|
|
46
50
|
display: inline-block;
|
|
47
|
-
color: $font-color-soft;
|
|
51
|
+
color: $font-color-soft;
|
|
52
|
+
&.-medium {
|
|
53
|
+
padding-left: 1.6rem;
|
|
54
|
+
padding-top: 0.1rem;
|
|
55
|
+
}
|
|
56
|
+
&.-large {
|
|
57
|
+
padding-left: 1.875rem;
|
|
58
|
+
padding-top: 0.2rem;
|
|
59
|
+
}
|
|
48
60
|
}
|
|
49
61
|
|
|
50
62
|
.disabled + .description {
|
|
@@ -57,22 +69,54 @@ $radio-button-ripple-size: 15px;
|
|
|
57
69
|
position: absolute;
|
|
58
70
|
left: 0;
|
|
59
71
|
top: 0;
|
|
60
|
-
width: 20px;
|
|
61
|
-
height: 20px;
|
|
62
72
|
border: 1px solid $component-border-color;
|
|
63
73
|
border-radius: 100%;
|
|
64
74
|
background: $default-color;
|
|
65
75
|
}
|
|
66
76
|
|
|
77
|
+
.-small:before{
|
|
78
|
+
width: 16px;
|
|
79
|
+
height: 16px;
|
|
80
|
+
top: 0.225rem;
|
|
81
|
+
left: 0.265rem;
|
|
82
|
+
}
|
|
83
|
+
.-medium:before{
|
|
84
|
+
width: 20px;
|
|
85
|
+
height: 20px;
|
|
86
|
+
top: 0.245rem;
|
|
87
|
+
left: 0.285rem;
|
|
88
|
+
}
|
|
89
|
+
.-large:before{
|
|
90
|
+
width: 24px;
|
|
91
|
+
height: 24px;
|
|
92
|
+
top: 0.245rem;
|
|
93
|
+
left: 0.285rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.-small:after{
|
|
97
|
+
width: 8px;
|
|
98
|
+
height: 8px;
|
|
99
|
+
top: 0.23rem;
|
|
100
|
+
left: 0.27rem;
|
|
101
|
+
}
|
|
102
|
+
.-medium:after{
|
|
103
|
+
width: 12px;
|
|
104
|
+
height: 12px;
|
|
105
|
+
top: 0.24rem;
|
|
106
|
+
left: 0.26rem;
|
|
107
|
+
}
|
|
108
|
+
.-large:after{
|
|
109
|
+
width: 16px;
|
|
110
|
+
height: 16px;
|
|
111
|
+
top: 0.245rem;
|
|
112
|
+
left: 0.285rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
67
115
|
.radio-component:checked + .description:after,
|
|
68
116
|
.radio-component:not(:checked) + .description:after {
|
|
69
117
|
content: '';
|
|
70
|
-
width: 12px;
|
|
71
|
-
height: 12px;
|
|
72
118
|
background: $radio-button-checked-color;
|
|
73
119
|
position: absolute;
|
|
74
|
-
top: 4px;
|
|
75
|
-
left: 4px;
|
|
76
120
|
border-radius: 100%;
|
|
77
121
|
-webkit-transition: all 0.2s ease;
|
|
78
122
|
transition: all 0.2s ease;
|
|
@@ -26,12 +26,18 @@
|
|
|
26
26
|
&.skeleton-transparency::before {
|
|
27
27
|
@extend %skeleton-transparency;
|
|
28
28
|
}
|
|
29
|
+
&.-disabled{
|
|
30
|
+
@extend %component-disabled;
|
|
31
|
+
}
|
|
29
32
|
}
|
|
30
33
|
> .headercontainer > .innertable > .theader > .trow,
|
|
31
34
|
> .bodycontainer > .innertable > .tbody > .trow,
|
|
32
35
|
> .theader > .trow,
|
|
33
36
|
> .tbody > .trow {
|
|
34
37
|
height: 45px;
|
|
38
|
+
}
|
|
39
|
+
> .tbody > .trow-divider {
|
|
40
|
+
height: 45px;
|
|
35
41
|
}
|
|
36
42
|
> .headercontainer > .innertable > .theader > .trow > .headercolumn,
|
|
37
43
|
> .bodycontainer > .innertable > .tbody > .trow > .rowcolumn,
|
|
@@ -60,6 +66,30 @@
|
|
|
60
66
|
background-color: $component-bg-selected-color !important;
|
|
61
67
|
color: $font-selected-color;
|
|
62
68
|
}
|
|
69
|
+
.-divider {
|
|
70
|
+
color: $font-color-second;
|
|
71
|
+
font-family: 'Titillium Web';
|
|
72
|
+
font-weight: 700;
|
|
73
|
+
font-size: 16px;
|
|
74
|
+
text-align: center;
|
|
75
|
+
padding: .35rem;
|
|
76
|
+
&.-primary {
|
|
77
|
+
background-color: $primary-color;
|
|
78
|
+
}
|
|
79
|
+
&.-warning {
|
|
80
|
+
background-color: $warning-color;
|
|
81
|
+
}
|
|
82
|
+
&.-danger {
|
|
83
|
+
background-color: $danger-color;
|
|
84
|
+
}
|
|
85
|
+
&.-success {
|
|
86
|
+
background-color: $success-color;
|
|
87
|
+
}
|
|
88
|
+
&.-info {
|
|
89
|
+
background-color: $info-color;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
63
93
|
&:hover {
|
|
64
94
|
> .rowcolumn > .rowhover {
|
|
65
95
|
display: table;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import "colors.scss";
|
|
2
|
+
|
|
1
3
|
.tooltip-component {
|
|
2
4
|
font-family: 'Roboto', sans-serif;
|
|
3
5
|
position: absolute;
|
|
@@ -5,7 +7,7 @@
|
|
|
5
7
|
background: rgba(black, 0.85);
|
|
6
8
|
border-radius: 5px;
|
|
7
9
|
color: white;
|
|
8
|
-
box-shadow: 2px 2px 3px rgba(0
|
|
10
|
+
box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.3);
|
|
9
11
|
text-align: center;
|
|
10
12
|
font-size: 13px;
|
|
11
13
|
z-index: 999999;
|
|
@@ -45,11 +47,49 @@
|
|
|
45
47
|
&.bottom::after {
|
|
46
48
|
content: " ";
|
|
47
49
|
position: absolute;
|
|
48
|
-
bottom: 100%;
|
|
50
|
+
bottom: 100%;
|
|
49
51
|
left: 50%;
|
|
50
52
|
margin-left: -5px;
|
|
51
53
|
border-width: 5px;
|
|
52
54
|
border-style: solid;
|
|
53
55
|
border-color: transparent transparent rgba(black, 0.85) transparent;
|
|
54
56
|
}
|
|
57
|
+
&.tooltip-error {
|
|
58
|
+
background: $danger-hover-color;
|
|
59
|
+
color: $default-color;
|
|
60
|
+
z-index: 99999;
|
|
61
|
+
&::before {
|
|
62
|
+
content: '';
|
|
63
|
+
position: absolute;
|
|
64
|
+
left: 0;
|
|
65
|
+
top: 0;
|
|
66
|
+
right: 0;
|
|
67
|
+
bottom: 0;
|
|
68
|
+
height: 100%;
|
|
69
|
+
width: 100%;
|
|
70
|
+
background: inherit;
|
|
71
|
+
border-radius: inherit;
|
|
72
|
+
z-index: -1;
|
|
73
|
+
opacity: 0.7;
|
|
74
|
+
animation: tooltip-component 2s ease-out infinite;
|
|
75
|
+
}
|
|
76
|
+
@keyframes tooltip-component {
|
|
77
|
+
100% {
|
|
78
|
+
transform: scale(1.05, 1.25);
|
|
79
|
+
opacity: 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
&.left::after {
|
|
83
|
+
border-left-color: $danger-hover-color;
|
|
84
|
+
}
|
|
85
|
+
&.right::after {
|
|
86
|
+
border-right-color: $danger-hover-color;
|
|
87
|
+
}
|
|
88
|
+
&.top::after {
|
|
89
|
+
border-top-color: $danger-hover-color;
|
|
90
|
+
}
|
|
91
|
+
&.bottom::after {
|
|
92
|
+
border-bottom-color: $danger-hover-color;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
55
95
|
}
|