linear-react-components-ui 0.4.77-beta.25 → 0.4.77-beta.26
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 +2 -0
- package/.vscode/settings.json +2 -2
- package/babel.config.json +11 -0
- package/dist/main.js +14 -0
- package/lib/@types/Align.d.ts +3 -0
- package/lib/@types/ButtonTypes.d.ts +3 -0
- package/lib/@types/ColorStyles.d.ts +3 -0
- package/lib/@types/DataCombo.d.ts +3 -0
- package/lib/@types/Icon.d.ts +5 -0
- package/lib/@types/LabelStyles.d.ts +3 -0
- package/lib/@types/Period.d.ts +6 -0
- package/lib/@types/PermissionAttr.d.ts +14 -0
- package/lib/@types/PointerEvents.d.ts +3 -0
- package/lib/@types/Position.d.ts +3 -0
- package/lib/@types/PositionAlert.d.ts +3 -0
- package/lib/@types/Size.d.ts +3 -0
- package/lib/@types/SizePixels.d.ts +3 -0
- package/lib/@types/StorageMock.d.ts +5 -0
- package/lib/alerts/AlertContainer.d.ts +16 -0
- package/lib/alerts/AlertProvider.d.ts +7 -0
- package/lib/alerts/AlertProvider.js +1 -1
- package/lib/alerts/BaseAlert.d.ts +7 -0
- package/lib/alerts/Message.d.ts +7 -0
- package/lib/alerts/alert.spec.js +27 -54
- package/lib/alerts/helpers.d.ts +7 -0
- package/lib/alerts/index.d.ts +6 -0
- package/lib/alerts/types.d.ts +48 -0
- package/lib/alerts/withAlert.d.ts +7 -0
- package/lib/alerts/withAlert.js +5 -3
- package/lib/avatar/avatar.spec.js +38 -72
- package/lib/avatar/index.d.ts +12 -0
- package/lib/avatar/types.d.ts +31 -0
- package/lib/badge/badge.spec.js +29 -51
- package/lib/badge/index.d.ts +6 -0
- package/lib/badge/types.d.ts +13 -0
- package/lib/buttons/ActivateButton.d.ts +9 -0
- package/lib/buttons/AddButton.d.ts +9 -0
- package/lib/buttons/Button.d.ts +12 -0
- package/lib/buttons/ButtonGroups.d.ts +8 -0
- package/lib/buttons/CancelButton.d.ts +9 -0
- package/lib/buttons/DangerButton.d.ts +9 -0
- package/lib/buttons/DefaultButton.d.ts +12 -0
- package/lib/buttons/DefaultButton.js +5 -3
- package/lib/buttons/DestroyButton.d.ts +9 -0
- package/lib/buttons/EditButton.d.ts +9 -0
- package/lib/buttons/InactivateButton.d.ts +9 -0
- package/lib/buttons/InfoButton.d.ts +9 -0
- package/lib/buttons/PrimaryButton.d.ts +9 -0
- package/lib/buttons/RestoreButton.d.ts +9 -0
- package/lib/buttons/SaveButton.d.ts +9 -0
- package/lib/buttons/SpinnerLoading.js +230 -0
- package/lib/buttons/SuccessButton.d.ts +9 -0
- package/lib/buttons/WarningButton.d.ts +9 -0
- package/lib/buttons/button_container/index.d.ts +12 -0
- package/lib/buttons/buttons.spec.js +135 -209
- package/lib/buttons/index.d.ts +21 -0
- package/lib/buttons/split_button/index.d.ts +9 -0
- package/lib/buttons/split_button/index.js +22 -2
- package/lib/buttons/types.d.ts +44 -0
- package/lib/calendar/DangerCalendar.d.ts +7 -0
- package/lib/calendar/InfoCalendar.d.ts +7 -0
- package/lib/calendar/PrimaryCalendar.d.ts +7 -0
- package/lib/calendar/SuccessCalendar.d.ts +7 -0
- package/lib/calendar/WarningCalendar.d.ts +7 -0
- package/lib/calendar/base/Day.d.ts +7 -0
- package/lib/calendar/base/Month.d.ts +7 -0
- package/lib/calendar/base/Week.d.ts +7 -0
- package/lib/calendar/base/helpers.d.ts +62 -0
- package/lib/calendar/base/helpers.js +1 -1
- package/lib/calendar/base/index.d.ts +7 -0
- package/lib/calendar/calendar.spec.js +27 -60
- package/lib/calendar/index.d.ts +10 -0
- package/lib/calendar/types.d.ts +25 -0
- package/lib/checkbox/Label.d.ts +11 -0
- package/lib/checkbox/checkbox.spec.js +14 -56
- package/lib/checkbox/index.d.ts +13 -0
- package/lib/checkbox/index.js +1 -1
- package/lib/checkbox/types.d.ts +42 -0
- package/lib/dialog/Alert.d.ts +6 -0
- package/lib/dialog/Custom.d.ts +6 -0
- package/lib/dialog/Custom.js +4 -4
- package/lib/dialog/Error.d.ts +6 -0
- package/lib/dialog/Information.d.ts +6 -0
- package/lib/dialog/Question.d.ts +6 -0
- package/lib/dialog/Warning.d.ts +6 -0
- package/lib/dialog/base/Content.d.ts +6 -0
- package/lib/dialog/base/Footer.d.ts +6 -0
- package/lib/dialog/base/Header.d.ts +6 -0
- package/lib/dialog/base/index.d.ts +6 -0
- package/lib/dialog/dialog.spec.js +60 -138
- package/lib/dialog/form/index.d.ts +6 -0
- package/lib/dialog/index.d.ts +10 -0
- package/lib/dialog/types.d.ts +68 -0
- package/lib/drawer/Content.d.ts +7 -0
- package/lib/drawer/Drawer.d.ts +7 -0
- package/lib/drawer/Drawer.js +1 -1
- package/lib/drawer/Drawer.spec.js +35 -81
- package/lib/drawer/Header.d.ts +7 -0
- package/lib/drawer/helpers.d.ts +7 -0
- package/lib/drawer/index.d.ts +9 -0
- package/lib/drawer/types.d.ts +34 -0
- package/lib/dropdown/Popup.d.ts +6 -0
- package/lib/dropdown/Popup.js +4 -2
- package/lib/dropdown/dropdown.spec.js +11 -47
- package/lib/dropdown/helper.d.ts +4 -0
- package/lib/dropdown/types.d.ts +43 -0
- package/lib/dropdown/withDropdown.d.ts +10 -0
- package/lib/dropdown/withDropdown.js +3 -1
- package/lib/fieldset/fieldset.spec.js +77 -123
- package/lib/fieldset/index.d.ts +8 -0
- package/lib/fieldset/index.js +1 -1
- package/lib/fieldset/types.d.ts +28 -0
- package/lib/form/Field.d.ts +6 -0
- package/lib/form/Field.js +11 -38
- package/lib/form/FieldArray.d.ts +6 -0
- package/lib/form/FieldArray.js +18 -48
- package/lib/form/FieldNumber.d.ts +6 -0
- package/lib/form/FieldNumber.js +2 -26
- package/lib/form/FieldPeriod.d.ts +6 -0
- package/lib/form/FieldPeriod.js +18 -40
- package/lib/form/form.spec.js +43 -87
- package/lib/form/helpers.d.ts +11 -0
- package/lib/form/helpers.js +10 -16
- package/lib/form/index.d.ts +9 -0
- package/lib/form/index.js +50 -85
- package/lib/form/types.d.ts +168 -0
- package/lib/form/types.js +5 -0
- package/lib/form/withFieldHOC.d.ts +6 -0
- package/lib/form/withFieldHOC.js +38 -118
- package/lib/form/withFormSecurity.d.ts +7 -0
- package/lib/form/withFormSecurity.js +13 -34
- package/lib/gridlayout/GridCol.d.ts +6 -0
- package/lib/gridlayout/GridRow.d.ts +6 -0
- package/lib/gridlayout/gridLayout.spec.js +41 -68
- package/lib/gridlayout/index.d.ts +5 -0
- package/lib/gridlayout/types.d.ts +20 -0
- package/lib/icons/helper.d.ts +560 -0
- package/lib/icons/icons.spec.js +19 -35
- package/lib/icons/index.d.ts +8 -0
- package/lib/icons/types.d.ts +28 -0
- package/lib/index.d.ts +35 -0
- package/lib/inputs/base/InputTextBase.d.ts +8 -0
- package/lib/inputs/base/InputTextBase.js +2 -2
- package/lib/inputs/base/base.spec.js +154 -270
- package/lib/inputs/base/helpers.d.ts +14 -0
- package/lib/inputs/base/helpers.js +1 -1
- package/lib/inputs/base/index.js +1 -0
- package/lib/inputs/base/types.d.ts +68 -0
- package/lib/inputs/color/color_input.spec.js +29 -63
- package/lib/inputs/color/index.d.ts +7 -0
- package/lib/inputs/color/types.d.ts +14 -0
- package/lib/inputs/date/Dialog.d.ts +10 -0
- package/lib/inputs/date/Dropdown.d.ts +10 -0
- package/lib/inputs/date/date.spec.js +70 -149
- package/lib/inputs/date/helpers.d.ts +14 -0
- package/lib/inputs/date/index.d.ts +10 -0
- package/lib/inputs/date/types.d.ts +53 -0
- package/lib/inputs/inputHOC.d.ts +11 -0
- package/lib/inputs/mask/BaseMask.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.js +3 -1
- package/lib/inputs/mask/Cpf.d.ts +12 -0
- package/lib/inputs/mask/Cpf.js +5 -2
- package/lib/inputs/mask/Phone.d.ts +9 -0
- package/lib/inputs/mask/ZipCode.d.ts +9 -0
- package/lib/inputs/mask/helpers.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.js +9 -10
- package/lib/inputs/mask/index.d.ts +11 -0
- package/lib/inputs/mask/input_mask.spec.js +128 -218
- package/lib/inputs/mask/types.d.ts +66 -0
- package/lib/inputs/multiSelect/ActionButtons.d.ts +10 -0
- package/lib/inputs/multiSelect/Dropdown.d.ts +10 -0
- package/lib/inputs/multiSelect/helper.d.ts +9 -0
- package/lib/inputs/multiSelect/index.d.ts +10 -0
- package/lib/inputs/multiSelect/index.js +13 -6
- package/lib/inputs/multiSelect/types.d.ts +49 -0
- package/lib/inputs/number/BaseNumber.d.ts +12 -0
- package/lib/inputs/number/BaseNumber.js +1 -1
- package/lib/inputs/number/Currency.d.ts +12 -0
- package/lib/inputs/number/Decimal.d.ts +12 -0
- package/lib/inputs/number/format_number.d.ts +4 -0
- package/lib/inputs/number/index.d.ts +14 -0
- package/lib/inputs/number/numberfield.spec.js +40 -82
- package/lib/inputs/number/types.d.ts +30 -0
- package/lib/inputs/period/Dialog.d.ts +11 -0
- package/lib/inputs/period/Dropdown.d.ts +11 -0
- package/lib/inputs/period/PeriodList.d.ts +11 -0
- package/lib/inputs/period/helper.d.ts +19 -0
- package/lib/inputs/period/index.d.ts +11 -0
- package/lib/inputs/period/index.js +7 -5
- package/lib/inputs/period/types.d.ts +58 -0
- package/lib/inputs/search/index.d.ts +11 -0
- package/lib/inputs/search/index.js +0 -3
- package/lib/inputs/search/search_input.spec.js +36 -82
- package/lib/inputs/select/ActionButtons.d.ts +11 -0
- package/lib/inputs/select/Dropdown.d.ts +11 -0
- package/lib/inputs/select/helper.d.ts +25 -0
- package/lib/inputs/select/index.d.ts +10 -0
- package/lib/inputs/select/index.js +3 -1
- package/lib/inputs/select/multiple/Selecteds.d.ts +10 -0
- package/lib/inputs/select/multiple/index.d.ts +10 -0
- package/lib/inputs/select/select.spec.js +74 -142
- package/lib/inputs/select/simple/index.d.ts +10 -0
- package/lib/inputs/select/types.d.ts +94 -0
- package/lib/inputs/text/index.d.ts +11 -0
- package/lib/inputs/text/textfield.spec.js +40 -81
- package/lib/inputs/text/types.d.ts +25 -0
- package/lib/inputs/textarea/index.d.ts +9 -0
- package/lib/inputs/textarea/textarea.spec.js +10 -23
- package/lib/inputs/textarea/types.d.ts +13 -0
- package/lib/inputs/types.d.ts +146 -0
- package/lib/internals/colorStyles.d.ts +9 -0
- package/lib/internals/constants.d.ts +11 -0
- package/lib/internals/types.d.ts +21 -0
- package/lib/internals/withTooltip.d.ts +11 -0
- package/lib/labelMessages/index.d.ts +7 -0
- package/lib/labelMessages/labelMessages.spec.js +28 -61
- package/lib/labelMessages/types.d.ts +18 -0
- package/lib/labels/DangerLabel.d.ts +9 -0
- package/lib/labels/DefaultLabel.d.ts +12 -0
- package/lib/labels/DefaultLabel.js +1 -1
- package/lib/labels/InfoLabel.d.ts +9 -0
- package/lib/labels/PrimaryLabel.d.ts +9 -0
- package/lib/labels/SuccessLabel.d.ts +9 -0
- package/lib/labels/WarningLabel.d.ts +9 -0
- package/lib/labels/index.d.ts +13 -0
- package/lib/labels/label.spec.js +40 -67
- package/lib/labels/label_container/index.d.ts +12 -0
- package/lib/labels/types.d.ts +24 -0
- package/lib/list/Header.d.ts +7 -0
- package/lib/list/Item.d.ts +7 -0
- package/lib/list/Item.js +8 -6
- package/lib/list/Separator.d.ts +3 -0
- package/lib/list/helpers.d.ts +12 -0
- package/lib/list/helpers.js +8 -3
- package/lib/list/index.d.ts +10 -0
- package/lib/list/index.js +87 -18
- package/lib/list/list.spec.js +167 -284
- package/lib/list/types.d.ts +64 -0
- package/lib/menus/float/MenuItem.d.ts +7 -0
- package/lib/menus/float/float-menu.spec.js +4 -44
- package/lib/menus/float/helpers.d.ts +7 -0
- package/lib/menus/float/index.d.ts +8 -0
- package/lib/menus/float/types.d.ts +27 -0
- package/lib/menus/index.d.ts +6 -0
- package/lib/menus/sidenav/ExpandMenu.d.ts +10 -0
- package/lib/menus/sidenav/MenuLink.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuGroup.d.ts +10 -0
- package/lib/menus/sidenav/NavMenuItem.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuItem.js +1 -1
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +10 -0
- package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
- package/lib/menus/sidenav/helpers.d.ts +12 -0
- package/lib/menus/sidenav/index.d.ts +14 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +10 -0
- package/lib/menus/sidenav/sidenav.spec.js +16 -69
- package/lib/menus/sidenav/types.d.ts +82 -0
- package/lib/noPermission/index.d.ts +3 -0
- package/lib/panel/Content.d.ts +8 -0
- package/lib/panel/DangerPanel.d.ts +8 -0
- package/lib/panel/Default.d.ts +8 -0
- package/lib/panel/Default.js +1 -1
- package/lib/panel/Header.d.ts +8 -0
- package/lib/panel/InfoPanel.d.ts +8 -0
- package/lib/panel/PrimaryPanel.d.ts +8 -0
- package/lib/panel/SuccessPanel.d.ts +8 -0
- package/lib/panel/ToolBar.d.ts +8 -0
- package/lib/panel/WarningPanel.d.ts +8 -0
- package/lib/panel/helpers.d.ts +4 -0
- package/lib/panel/index.d.ts +13 -0
- package/lib/panel/panel.spec.js +63 -100
- package/lib/panel/types.d.ts +4 -0
- package/lib/permissionValidations.d.ts +14 -0
- package/lib/permissionValidations.js +14 -12
- package/lib/popover/PopoverText.d.ts +8 -0
- package/lib/popover/PopoverTitle.d.ts +8 -0
- package/lib/popover/index.d.ts +13 -0
- package/lib/popover/popover.spec.js +29 -59
- package/lib/popover/types.d.ts +21 -0
- package/lib/progress/Bar.d.ts +6 -0
- package/lib/progress/index.d.ts +7 -0
- package/lib/progress/progress.spec.js +18 -34
- package/lib/progress/types.d.ts +37 -0
- package/lib/radio/index.d.ts +12 -0
- package/lib/radio/index.js +1 -1
- package/lib/radio/radio.spec.js +34 -63
- package/lib/radio/types.d.ts +18 -0
- package/lib/skeleton/SkeletonContainer.d.ts +7 -0
- package/lib/skeleton/SkeletonContainer.js +0 -13
- package/lib/skeleton/index.d.ts +8 -0
- package/lib/skeleton/index.js +6 -25
- package/lib/skeleton/types.d.ts +21 -0
- package/lib/skeleton/types.js +5 -0
- package/lib/spinner/SpinnerLoading.d.ts +7 -0
- package/lib/spinner/index.d.ts +7 -0
- package/lib/spinner/spinner.spec.js +38 -64
- package/lib/spinner/types.d.ts +20 -0
- package/lib/split/Split.d.ts +6 -0
- package/lib/split/SplitSide.d.ts +6 -0
- package/lib/split/helpers.d.ts +10 -0
- package/lib/split/index.d.ts +5 -0
- package/lib/split/split.spec.js +17 -47
- package/lib/split/types.d.ts +34 -0
- package/lib/table/Body.d.ts +6 -0
- package/lib/table/Header.d.ts +6 -0
- package/lib/table/Header.js +34 -6
- package/lib/table/HeaderColumn.d.ts +6 -0
- package/lib/table/HeaderColumn.js +1 -1
- package/lib/table/Row.d.ts +6 -0
- package/lib/table/Row.js +4 -9
- package/lib/table/RowColumn.d.ts +6 -0
- package/lib/table/RowColumn.js +2 -2
- package/lib/table/helpers.d.ts +8 -0
- package/lib/table/index.d.ts +11 -0
- package/lib/table/table.spec.js +72 -128
- package/lib/table/types.d.ts +84 -0
- package/lib/tabs/DropdownItems.d.ts +9 -0
- package/lib/tabs/Menu.d.ts +9 -0
- package/lib/tabs/MenuItems.d.ts +9 -0
- package/lib/tabs/MenuItems.js +1 -1
- package/lib/tabs/Panel.d.ts +9 -0
- package/lib/tabs/Panel.js +1 -1
- package/lib/tabs/index.d.ts +10 -0
- package/lib/tabs/tabHelpers.d.ts +21 -0
- package/lib/tabs/tabs.spec.js +81 -137
- package/lib/tabs/types.d.ts +63 -0
- package/lib/toolbar/ButtonBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.js +1 -1
- package/lib/toolbar/Separator.d.ts +3 -0
- package/lib/toolbar/ToolBarGroup.d.ts +10 -0
- package/lib/toolbar/helpers.d.ts +10 -0
- package/lib/toolbar/index.d.ts +14 -0
- package/lib/toolbar/index.js +2 -3
- package/lib/toolbar/toolbar.spec.js +123 -171
- package/lib/toolbar/types.d.ts +43 -0
- package/lib/tooltip/index.d.ts +6 -0
- package/lib/tooltip/tooltip.spec.js +3 -37
- package/lib/tooltip/types.d.ts +16 -0
- package/lib/treetable/Body.js +7 -25
- package/lib/treetable/Header.js +1 -11
- package/lib/treetable/Row.js +47 -103
- package/lib/treetable/helpers.js +0 -10
- package/lib/treetable/index.js +0 -11
- package/lib/treeview/Header.d.ts +7 -0
- package/lib/treeview/Node.d.ts +7 -0
- package/lib/treeview/Node.js +30 -18
- package/lib/treeview/constants.d.ts +7 -0
- package/lib/treeview/constants.js +0 -1
- package/lib/treeview/index.d.ts +9 -0
- package/lib/treeview/index.js +28 -21
- package/lib/treeview/treeview.spec.js +34 -81
- package/lib/treeview/types.d.ts +104 -0
- package/lib/types-3c6f1c20.d.ts +46 -0
- package/lib/uitour/helpers.d.ts +8 -0
- package/lib/uitour/index.d.ts +6 -0
- package/lib/uitour/index.js +11 -28
- package/lib/uitour/types.d.ts +30 -0
- package/lib/uitour/types.js +5 -0
- package/lib/uitour/uitour.spec.js +54 -76
- package/package.json +15 -5
- package/tsconfig.json +24 -9
- package/tsup.config.ts +10 -0
- package/images.d.ts +0 -3
|
@@ -1,96 +1,75 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
5
|
require("babel-polyfill");
|
|
8
|
-
|
|
9
6
|
require("@testing-library/jest-dom/extend-expect");
|
|
10
|
-
|
|
11
7
|
var _react2 = require("@testing-library/react");
|
|
12
|
-
|
|
13
8
|
var _ = _interopRequireDefault(require("."));
|
|
14
|
-
|
|
15
9
|
var _icons = _interopRequireDefault(require("../icons"));
|
|
16
|
-
|
|
17
10
|
var _list = _interopRequireWildcard(require("../list"));
|
|
18
|
-
|
|
19
11
|
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); }
|
|
20
|
-
|
|
21
12
|
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; }
|
|
22
|
-
|
|
23
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
|
|
25
14
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
26
|
-
|
|
27
15
|
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); } }
|
|
28
|
-
|
|
29
16
|
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); }); }; }
|
|
30
|
-
|
|
31
17
|
describe('Avatar', function () {
|
|
32
18
|
it('should render correctly', function () {
|
|
33
19
|
var _render = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.default, {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
label: "B"
|
|
21
|
+
})),
|
|
22
|
+
container = _render.container;
|
|
38
23
|
expect(container.firstChild).toHaveClass('avatar-component -default');
|
|
39
24
|
expect(container.firstChild).toHaveTextContent('B');
|
|
40
25
|
expect(_react2.screen.getByRole('button')).toBeInTheDocument();
|
|
41
26
|
});
|
|
42
27
|
it('should apply customClass', function () {
|
|
43
28
|
var _render2 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.default, {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
label: "B",
|
|
30
|
+
customClass: "avatarteste"
|
|
31
|
+
})),
|
|
32
|
+
container = _render2.container;
|
|
49
33
|
expect(container.firstChild).toHaveClass('avatarteste');
|
|
50
34
|
});
|
|
51
35
|
it('should change color', function () {
|
|
52
36
|
var _render3 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.default, {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
37
|
+
label: "B",
|
|
38
|
+
color: "#333"
|
|
39
|
+
})),
|
|
40
|
+
container = _render3.container;
|
|
58
41
|
expect(container.firstChild).toHaveStyle('background-color: #333');
|
|
59
42
|
});
|
|
60
43
|
it('should change to square', function () {
|
|
61
44
|
var _render4 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.default, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
45
|
+
label: "B",
|
|
46
|
+
square: true
|
|
47
|
+
})),
|
|
48
|
+
container = _render4.container;
|
|
67
49
|
expect(container.firstChild).toHaveClass('-square');
|
|
68
50
|
});
|
|
69
51
|
it('should change to mini', function () {
|
|
70
52
|
var _render5 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.default, {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
label: "B",
|
|
54
|
+
size: "mini"
|
|
55
|
+
})),
|
|
56
|
+
container = _render5.container;
|
|
76
57
|
expect(container.firstChild).toHaveClass('-mini');
|
|
77
58
|
});
|
|
78
59
|
it('should render icon with iconName', function () {
|
|
79
60
|
var _render6 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.default, {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
61
|
+
iconName: "calc"
|
|
62
|
+
})),
|
|
63
|
+
container = _render6.container;
|
|
84
64
|
expect(container.firstChild).toContainElement(_react2.screen.getByTestId('icon'));
|
|
85
65
|
});
|
|
86
66
|
it('should render Icon with icon', function () {
|
|
87
67
|
var _render7 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.default, {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
68
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
69
|
+
name: "user"
|
|
70
|
+
})
|
|
71
|
+
})),
|
|
72
|
+
container = _render7.container;
|
|
94
73
|
expect(container.firstChild).toContainElement(_react2.screen.getByTestId('icon'));
|
|
95
74
|
});
|
|
96
75
|
it('should render with image', function () {
|
|
@@ -98,10 +77,8 @@ describe('Avatar', function () {
|
|
|
98
77
|
src: "https://yt3.ggpht.com/a-/AAuE7mDGQh9L3n_EULfeZEO9rs_JR4BY376CSrlxdw=s900-mo-c-c0xffffffff-rj-k-no",
|
|
99
78
|
srcAlt: "Avatar Teste"
|
|
100
79
|
});
|
|
101
|
-
|
|
102
80
|
var _render8 = (0, _react2.render)(mockAvatar),
|
|
103
|
-
|
|
104
|
-
|
|
81
|
+
container = _render8.container;
|
|
105
82
|
expect(container.firstChild).toContainElement(_react2.screen.getByAltText('Avatar Teste'));
|
|
106
83
|
expect(_react2.screen.getByAltText('Avatar Teste')).toHaveClass('imgavatar');
|
|
107
84
|
});
|
|
@@ -110,25 +87,21 @@ describe('Avatar', function () {
|
|
|
110
87
|
src: "https://yt3.ggpht.com/a-/AAuE7mDGQh9L3n_EULfeZEO9rs_JR4BY376CSrlxdw=s900-mo-c-c0xffffffff-rj-k-no",
|
|
111
88
|
srcAlt: "Avatar Teste"
|
|
112
89
|
});
|
|
113
|
-
|
|
114
90
|
var _render9 = (0, _react2.render)(mockAvatar),
|
|
115
|
-
|
|
116
|
-
|
|
91
|
+
container = _render9.container;
|
|
117
92
|
expect(container.firstChild).not.toContainElement(document.querySelector('.icon-component'));
|
|
118
93
|
});
|
|
119
94
|
it('should change size', function () {
|
|
120
95
|
var _render10 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.default, {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
96
|
+
label: "B",
|
|
97
|
+
width: "56px",
|
|
98
|
+
height: "56px"
|
|
99
|
+
})),
|
|
100
|
+
container = _render10.container;
|
|
127
101
|
expect(container.firstChild).toHaveStyle('width: 56px; height:56px');
|
|
128
102
|
});
|
|
129
103
|
it('should open dropdown and render chilren', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
130
104
|
var mockAvatar, _render11, container;
|
|
131
|
-
|
|
132
105
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
133
106
|
while (1) {
|
|
134
107
|
switch (_context.prev = _context.next) {
|
|
@@ -149,18 +122,14 @@ describe('Avatar', function () {
|
|
|
149
122
|
disabled: true
|
|
150
123
|
})));
|
|
151
124
|
_render11 = (0, _react2.render)(mockAvatar), container = _render11.container;
|
|
152
|
-
|
|
153
125
|
_react2.fireEvent.click(container.firstChild);
|
|
154
|
-
|
|
155
126
|
_context.next = 5;
|
|
156
127
|
return (0, _react2.waitFor)(function () {
|
|
157
128
|
return _react2.screen.getByTestId('dropdown-component');
|
|
158
129
|
});
|
|
159
|
-
|
|
160
130
|
case 5:
|
|
161
131
|
expect(container.firstChild).toHaveTextContent('B');
|
|
162
132
|
expect(_react2.screen.getByTestId('dropdown-component')).toBeInTheDocument();
|
|
163
|
-
|
|
164
133
|
case 7:
|
|
165
134
|
case "end":
|
|
166
135
|
return _context.stop();
|
|
@@ -170,15 +139,12 @@ describe('Avatar', function () {
|
|
|
170
139
|
})));
|
|
171
140
|
it('should callback function onClick', function () {
|
|
172
141
|
var mockOnClick = jest.fn();
|
|
173
|
-
|
|
174
142
|
var _render12 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.default, {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
143
|
+
label: "B",
|
|
144
|
+
onClick: mockOnClick
|
|
145
|
+
})),
|
|
146
|
+
container = _render12.container;
|
|
180
147
|
_react2.fireEvent.click(container.firstChild);
|
|
181
|
-
|
|
182
148
|
expect(mockOnClick).toBeCalledTimes(1);
|
|
183
149
|
});
|
|
184
150
|
it('should use targetRef', function () {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IAvatarProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/Icon.js';
|
|
4
|
+
import '../icons/helper.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const _default: {
|
|
8
|
+
(props: IAvatarProps): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { _default as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MouseEvent, ReactElement, ReactNode, CSSProperties } from 'react';
|
|
2
|
+
import { IconNames } from '../@types/Icon.js';
|
|
3
|
+
import { Size } from '../@types/Size.js';
|
|
4
|
+
import '../icons/helper.js';
|
|
5
|
+
|
|
6
|
+
interface IAvatarProps {
|
|
7
|
+
onClick?: (event: MouseEvent) => void;
|
|
8
|
+
size?: Size;
|
|
9
|
+
width?: string;
|
|
10
|
+
height?: string;
|
|
11
|
+
color?: string;
|
|
12
|
+
iconName?: IconNames;
|
|
13
|
+
icon?: ReactElement;
|
|
14
|
+
src?: string;
|
|
15
|
+
srcAlt?: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
square?: boolean;
|
|
18
|
+
customClass?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
targetRef?: (ref: HTMLDivElement | null) => void;
|
|
21
|
+
dropdown?: boolean;
|
|
22
|
+
dropdownOnHover?: boolean;
|
|
23
|
+
showDropdown?: () => void;
|
|
24
|
+
getDropdownPopup?: (ref: HTMLDivElement | null) => ReactNode;
|
|
25
|
+
label?: string;
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
id?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { IAvatarProps };
|
package/lib/badge/badge.spec.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
|
|
5
4
|
var _react2 = require("@testing-library/react");
|
|
6
|
-
|
|
7
5
|
require("@testing-library/jest-dom/extend-expect");
|
|
8
|
-
|
|
9
6
|
var _ = _interopRequireDefault(require("."));
|
|
10
|
-
|
|
11
7
|
var _icons = _interopRequireDefault(require("../icons"));
|
|
12
|
-
|
|
13
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
9
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
16
|
-
|
|
17
10
|
var mockBadge = function mockBadge(props) {
|
|
18
11
|
return /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
19
12
|
customClass: "mockBadge",
|
|
@@ -23,105 +16,90 @@ var mockBadge = function mockBadge(props) {
|
|
|
23
16
|
name: "bell_alert"
|
|
24
17
|
}));
|
|
25
18
|
};
|
|
26
|
-
|
|
27
19
|
describe('Badges', function () {
|
|
28
20
|
it('should render correctly', function () {
|
|
29
21
|
var _render = (0, _react2.render)(mockBadge()),
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
container = _render.container;
|
|
32
23
|
expect(container.firstChild).toBeTruthy();
|
|
33
24
|
});
|
|
34
25
|
it('should render children', function () {
|
|
35
26
|
var _render2 = (0, _react2.render)(mockBadge()),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
container = _render2.container,
|
|
28
|
+
getByTestId = _render2.getByTestId;
|
|
39
29
|
expect(container.firstChild).toContainElement(getByTestId('icon'));
|
|
40
30
|
});
|
|
41
31
|
it('should render content', function () {
|
|
42
32
|
var _render3 = (0, _react2.render)(mockBadge()),
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
container = _render3.container;
|
|
45
34
|
expect(container.firstChild).toHaveTextContent('10');
|
|
46
35
|
});
|
|
47
36
|
it('should apply custom class', function () {
|
|
48
37
|
var _render4 = (0, _react2.render)(mockBadge()),
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
container = _render4.container;
|
|
51
39
|
expect(container.firstChild).toHaveClass('mockBadge');
|
|
52
40
|
});
|
|
53
41
|
it('should apply custom class', function () {
|
|
54
42
|
var _render5 = (0, _react2.render)(mockBadge()),
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
container = _render5.container;
|
|
57
44
|
expect(container.firstChild).toHaveClass('mockBadge');
|
|
58
45
|
});
|
|
59
46
|
it('should apply custom class for badge', function () {
|
|
60
47
|
var _render6 = (0, _react2.render)(mockBadge()),
|
|
61
|
-
|
|
62
|
-
|
|
48
|
+
container = _render6.container;
|
|
63
49
|
expect(container.querySelector('.badge')).toHaveClass('classforbadge');
|
|
64
50
|
});
|
|
65
51
|
it('should apply custom top', function () {
|
|
66
52
|
var _render7 = (0, _react2.render)(mockBadge({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
53
|
+
top: '10px'
|
|
54
|
+
})),
|
|
55
|
+
container = _render7.container;
|
|
71
56
|
expect(container.querySelector('.badge')).toHaveStyle('top: 10px;');
|
|
72
57
|
});
|
|
73
58
|
it('should apply custom right', function () {
|
|
74
59
|
var _render8 = (0, _react2.render)(mockBadge({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
60
|
+
right: '10px'
|
|
61
|
+
})),
|
|
62
|
+
container = _render8.container;
|
|
79
63
|
expect(container.querySelector('.badge')).toHaveStyle('right: 10px;');
|
|
80
64
|
});
|
|
81
65
|
it('should apply default color', function () {
|
|
82
66
|
var _render9 = (0, _react2.render)(mockBadge()),
|
|
83
|
-
|
|
84
|
-
|
|
67
|
+
container = _render9.container;
|
|
85
68
|
expect(container.querySelector('.badge')).toHaveClass('-default');
|
|
86
69
|
});
|
|
87
70
|
it('should apply primary color', function () {
|
|
88
71
|
var _render10 = (0, _react2.render)(mockBadge({
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
72
|
+
color: 'primary'
|
|
73
|
+
})),
|
|
74
|
+
container = _render10.container;
|
|
93
75
|
expect(container.querySelector('.badge')).toHaveClass('-primary');
|
|
94
76
|
});
|
|
95
77
|
it('should apply danger color', function () {
|
|
96
78
|
var _render11 = (0, _react2.render)(mockBadge({
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
79
|
+
color: 'danger'
|
|
80
|
+
})),
|
|
81
|
+
container = _render11.container;
|
|
101
82
|
expect(container.querySelector('.badge')).toHaveClass('-danger');
|
|
102
83
|
});
|
|
103
84
|
it('should apply warning color', function () {
|
|
104
85
|
var _render12 = (0, _react2.render)(mockBadge({
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
86
|
+
color: 'warning'
|
|
87
|
+
})),
|
|
88
|
+
container = _render12.container;
|
|
109
89
|
expect(container.querySelector('.badge')).toHaveClass('-warning');
|
|
110
90
|
});
|
|
111
91
|
it('should apply success color', function () {
|
|
112
92
|
var _render13 = (0, _react2.render)(mockBadge({
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
93
|
+
color: 'success'
|
|
94
|
+
})),
|
|
95
|
+
container = _render13.container;
|
|
117
96
|
expect(container.querySelector('.badge')).toHaveClass('-success');
|
|
118
97
|
});
|
|
119
98
|
it('should apply info color', function () {
|
|
120
99
|
var _render14 = (0, _react2.render)(mockBadge({
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
100
|
+
color: 'info'
|
|
101
|
+
})),
|
|
102
|
+
container = _render14.container;
|
|
125
103
|
expect(container.querySelector('.badge')).toHaveClass('-info');
|
|
126
104
|
});
|
|
127
105
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface IBadgeProps {
|
|
4
|
+
color?: 'default' | 'primary' | 'danger' | 'warning' | 'success' | 'info';
|
|
5
|
+
top?: string;
|
|
6
|
+
right?: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
customClass?: string;
|
|
9
|
+
customClassForBadge?: string;
|
|
10
|
+
content?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { IBadgeProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const ActivateButton: (props: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { ActivateButton as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const AddButton: (props: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { AddButton as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
interface ButtonProps extends IButtonProps {
|
|
8
|
+
split?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Button: ({ split, ...rest }: ButtonProps) => JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { Button as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const CancelButton: ({ customClass, ...rest }: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { CancelButton as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const DangerButton: ({ customClass, ...rest }: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { DangerButton as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const _default: {
|
|
8
|
+
(props: Omit<IButtonProps, "split">): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { _default as default };
|
|
@@ -93,12 +93,12 @@ var DefaultButton = function DefaultButton(_ref) {
|
|
|
93
93
|
activeButton = _useState2[0],
|
|
94
94
|
setActiveButton = _useState2[1];
|
|
95
95
|
|
|
96
|
-
var _useState3 = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(
|
|
96
|
+
var _useState3 = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr)),
|
|
97
97
|
_useState4 = _slicedToArray(_useState3, 1),
|
|
98
98
|
onDenied = _useState4[0];
|
|
99
99
|
|
|
100
|
-
var disabledIconColor = 'rgb(193, 193, 193)';
|
|
101
100
|
var buttonRef = (0, _react.useRef)(null);
|
|
101
|
+
var disabledIconColor = 'rgb(193, 193, 193)';
|
|
102
102
|
|
|
103
103
|
var shouldDisable = function shouldDisable() {
|
|
104
104
|
return !!onDenied.disabled || disabled;
|
|
@@ -150,6 +150,7 @@ var DefaultButton = function DefaultButton(_ref) {
|
|
|
150
150
|
|
|
151
151
|
if (!visible || onDenied.unvisible) return null;
|
|
152
152
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("button", _extends({}, rest, {
|
|
153
|
+
style: style,
|
|
153
154
|
onClick: function onClick(e) {
|
|
154
155
|
if (shouldDisable()) return;
|
|
155
156
|
if (_onClick) _onClick(e);
|
|
@@ -161,7 +162,8 @@ var DefaultButton = function DefaultButton(_ref) {
|
|
|
161
162
|
ref: function ref(r) {
|
|
162
163
|
if (targetRef) targetRef(r);
|
|
163
164
|
buttonRef.current = r;
|
|
164
|
-
}
|
|
165
|
+
},
|
|
166
|
+
tabIndex: tabIndex
|
|
165
167
|
}), content, getIcon(), label || '', isLoading && /*#__PURE__*/_react.default.createElement("div", {
|
|
166
168
|
className: "spinnercontainer"
|
|
167
169
|
}, /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const DestroyButton: ({ icon, ...rest }: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { DestroyButton as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const EditButton: (props: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { EditButton as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const InactivateButton: (props: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { InactivateButton as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const InfoButton: ({ customClass, ...rest }: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { InfoButton as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const PrimaryButton: ({ customClass, ...rest }: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { PrimaryButton as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const RestoreButton: (props: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { RestoreButton as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IButtonProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../@types/PermissionAttr.js';
|
|
4
|
+
import '../@types/Position.js';
|
|
5
|
+
import '../@types/Size.js';
|
|
6
|
+
|
|
7
|
+
declare const SaveButton: ({ customClass, ...rest }: IButtonProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { SaveButton as default };
|