linear-react-components-ui 1.0.10-beta.12 → 1.0.10-beta.14
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/README.md +19 -12
- package/lib/@types/Align.d.ts +2 -2
- package/lib/@types/ButtonTypes.d.ts +1 -1
- package/lib/@types/ColorStyles.d.ts +1 -1
- package/lib/@types/DataCombo.d.ts +1 -1
- package/lib/@types/Icon.d.ts +1 -1
- package/lib/@types/LabelStyles.d.ts +1 -1
- package/lib/@types/Period.d.ts +1 -1
- package/lib/@types/PermissionAttr.d.ts +2 -2
- package/lib/@types/PointerEvents.d.ts +1 -1
- package/lib/@types/Position.d.ts +1 -1
- package/lib/@types/PositionAlert.d.ts +1 -1
- package/lib/@types/Size.d.ts +1 -1
- package/lib/@types/SizePixels.d.ts +1 -1
- package/lib/alerts/AlertContainer.d.ts +2 -0
- package/lib/alerts/AlertContainer.js +5 -21
- package/lib/alerts/AlertProvider.d.ts +2 -0
- package/lib/alerts/AlertProvider.js +15 -45
- package/lib/alerts/BaseAlert.d.ts +2 -0
- package/lib/alerts/BaseAlert.js +4 -20
- package/lib/alerts/Message.d.ts +2 -0
- package/lib/alerts/Message.js +21 -32
- package/lib/alerts/helpers.d.ts +2 -0
- package/lib/alerts/helpers.js +0 -2
- package/lib/alerts/index.d.ts +6 -1
- package/lib/alerts/index.js +0 -4
- package/lib/alerts/types.d.ts +7 -5
- package/lib/alerts/withAlert.d.ts +2 -0
- package/lib/alerts/withAlert.js +1 -12
- 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/index.js +20 -35
- package/lib/badge/index.js +9 -14
- package/lib/buttons/ActivateButton.d.ts +2 -0
- package/lib/buttons/ActivateButton.js +0 -6
- package/lib/buttons/AddButton.d.ts +2 -0
- package/lib/buttons/AddButton.js +0 -7
- package/lib/buttons/Button.d.ts +2 -0
- package/lib/buttons/Button.js +2 -15
- package/lib/buttons/ButtonGroups.js +0 -4
- package/lib/buttons/CancelButton.d.ts +2 -0
- package/lib/buttons/CancelButton.js +1 -11
- package/lib/buttons/DangerButton.d.ts +2 -0
- package/lib/buttons/DangerButton.js +1 -11
- package/lib/buttons/DefaultButton.d.ts +2 -0
- package/lib/buttons/DefaultButton.js +59 -85
- package/lib/buttons/DestroyButton.d.ts +2 -0
- package/lib/buttons/DestroyButton.js +1 -12
- package/lib/buttons/EditButton.d.ts +2 -0
- package/lib/buttons/EditButton.js +0 -6
- package/lib/buttons/InactivateButton.d.ts +2 -0
- package/lib/buttons/InactivateButton.js +0 -6
- package/lib/buttons/InfoButton.d.ts +2 -0
- package/lib/buttons/InfoButton.js +1 -11
- package/lib/buttons/PrimaryButton.d.ts +2 -0
- package/lib/buttons/PrimaryButton.js +1 -11
- package/lib/buttons/RestoreButton.d.ts +2 -0
- package/lib/buttons/RestoreButton.js +0 -6
- package/lib/buttons/SaveButton.d.ts +2 -0
- package/lib/buttons/SaveButton.js +1 -11
- package/lib/buttons/SuccessButton.d.ts +2 -0
- package/lib/buttons/SuccessButton.js +1 -11
- package/lib/buttons/WarningButton.d.ts +2 -0
- package/lib/buttons/WarningButton.js +1 -11
- package/lib/buttons/button_container/index.js +5 -11
- package/lib/buttons/index.d.ts +6 -1
- package/lib/buttons/index.js +0 -18
- package/lib/buttons/split_button/index.d.ts +2 -0
- package/lib/buttons/split_button/index.js +11 -17
- package/lib/buttons/types.d.ts +6 -2
- package/lib/calendar/DangerCalendar.js +1 -11
- package/lib/calendar/InfoCalendar.js +1 -11
- package/lib/calendar/PrimaryCalendar.js +1 -11
- package/lib/calendar/SuccessCalendar.js +1 -11
- package/lib/calendar/WarningCalendar.js +1 -11
- package/lib/calendar/base/Day.js +2 -13
- package/lib/calendar/base/Month.js +1 -18
- package/lib/calendar/base/Week.js +2 -18
- package/lib/calendar/base/helpers.js +8 -24
- package/lib/calendar/base/index.js +13 -37
- package/lib/calendar/index.d.ts +4 -1
- package/lib/calendar/index.js +0 -8
- package/lib/checkbox/Label.js +1 -7
- package/lib/checkbox/index.js +28 -54
- package/lib/checkbox/types.d.ts +2 -2
- package/lib/dialog/Alert.d.ts +2 -0
- package/lib/dialog/Alert.js +0 -8
- package/lib/dialog/Custom.d.ts +2 -0
- package/lib/dialog/Custom.js +5 -17
- package/lib/dialog/Error.d.ts +2 -0
- package/lib/dialog/Error.js +0 -8
- package/lib/dialog/Information.d.ts +2 -0
- package/lib/dialog/Information.js +0 -8
- package/lib/dialog/Question.d.ts +2 -0
- package/lib/dialog/Question.js +4 -15
- package/lib/dialog/Warning.d.ts +2 -0
- package/lib/dialog/Warning.js +0 -8
- package/lib/dialog/base/Content.d.ts +2 -0
- package/lib/dialog/base/Content.js +1 -6
- package/lib/dialog/base/Footer.d.ts +2 -0
- package/lib/dialog/base/Footer.js +0 -4
- package/lib/dialog/base/Header.d.ts +2 -0
- package/lib/dialog/base/Header.js +17 -14
- package/lib/dialog/base/index.d.ts +2 -0
- package/lib/dialog/base/index.js +85 -44
- package/lib/dialog/base/style.js +0 -2
- package/lib/dialog/form/index.d.ts +6 -3
- package/lib/dialog/form/index.js +20 -33
- package/lib/dialog/index.d.ts +6 -1
- package/lib/dialog/index.js +0 -9
- package/lib/dialog/types.d.ts +8 -3
- package/lib/drawer/Content.d.ts +2 -0
- package/lib/drawer/Content.js +2 -13
- package/lib/drawer/Drawer.d.ts +3 -1
- package/lib/drawer/Drawer.js +44 -60
- package/lib/drawer/Header.d.ts +2 -0
- package/lib/drawer/Header.js +10 -27
- package/lib/drawer/helpers.d.ts +2 -0
- package/lib/drawer/helpers.js +0 -4
- package/lib/drawer/index.d.ts +2 -0
- package/lib/drawer/index.js +0 -8
- package/lib/drawer/types.d.ts +4 -1
- package/lib/dropdown/Popup.js +24 -32
- package/lib/dropdown/helper.js +0 -4
- package/lib/dropdown/withDropdown.js +18 -47
- package/lib/fieldset/index.js +21 -46
- package/lib/form/Field.js +20 -46
- package/lib/form/FieldArray.js +15 -32
- package/lib/form/FieldNumber.d.ts +2 -2
- package/lib/form/FieldNumber.js +6 -20
- package/lib/form/FieldPeriod.js +9 -21
- package/lib/form/helpers.js +5 -30
- package/lib/form/index.d.ts +2 -1
- package/lib/form/index.js +45 -92
- package/lib/form/types.d.ts +8 -11
- package/lib/form/withFieldHOC.js +15 -34
- package/lib/form/withFormSecurity.js +7 -29
- package/lib/gridlayout/GridCol.js +5 -11
- package/lib/gridlayout/GridRow.js +3 -9
- package/lib/gridlayout/index.d.ts +4 -1
- package/lib/gridlayout/index.js +0 -4
- package/lib/hint/index.js +6 -11
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +4 -0
- package/lib/icons/index.d.ts +2 -0
- package/lib/icons/index.js +16 -26
- package/lib/icons/types.d.ts +4 -2
- package/lib/index.d.ts +3 -1
- package/lib/index.js +0 -10
- package/lib/inputs/base/InputTextBase.js +55 -75
- package/lib/inputs/base/helpers.js +6 -19
- package/lib/inputs/color/index.js +11 -38
- package/lib/inputs/date/Dialog.js +2 -7
- package/lib/inputs/date/Dropdown.js +1 -8
- package/lib/inputs/date/helpers.d.ts +1 -1
- package/lib/inputs/date/helpers.js +4 -12
- package/lib/inputs/date/index.js +65 -104
- package/lib/inputs/date/types.d.ts +2 -1
- package/lib/inputs/file/DefaultFile.js +13 -42
- package/lib/inputs/file/DragDropFile.js +37 -90
- package/lib/inputs/file/File.js +4 -25
- package/lib/inputs/file/FileButtonSettings.js +5 -11
- package/lib/inputs/file/helpers.js +0 -5
- package/lib/inputs/file/index.d.ts +4 -1
- package/lib/inputs/file/index.js +0 -6
- package/lib/inputs/file/types.d.ts +1 -1
- package/lib/inputs/inputHOC.d.ts +2 -0
- package/lib/inputs/inputHOC.js +10 -34
- package/lib/inputs/mask/BaseMask.js +21 -21
- package/lib/inputs/mask/Cnpj.js +12 -37
- package/lib/inputs/mask/Cpf.js +10 -33
- package/lib/inputs/mask/Phone.js +0 -6
- package/lib/inputs/mask/ZipCode.js +0 -6
- package/lib/inputs/mask/helpers.d.ts +2 -0
- package/lib/inputs/mask/helpers.js +9 -21
- package/lib/inputs/mask/imaskHOC.d.ts +2 -0
- package/lib/inputs/mask/imaskHOC.js +54 -85
- package/lib/inputs/mask/index.d.ts +4 -1
- package/lib/inputs/mask/index.js +0 -7
- package/lib/inputs/mask/types.d.ts +1 -1
- package/lib/inputs/multiSelect/ActionButtons.d.ts +1 -1
- package/lib/inputs/multiSelect/ActionButtons.js +7 -13
- package/lib/inputs/multiSelect/Dropdown.js +26 -49
- package/lib/inputs/multiSelect/helper.d.ts +8 -6
- package/lib/inputs/multiSelect/helper.js +7 -5
- package/lib/inputs/multiSelect/index.js +54 -114
- package/lib/inputs/multiSelect/types.d.ts +15 -6
- package/lib/inputs/number/BaseNumber.d.ts +2 -0
- package/lib/inputs/number/BaseNumber.js +3 -16
- package/lib/inputs/number/Currency.d.ts +2 -0
- package/lib/inputs/number/Currency.js +1 -7
- package/lib/inputs/number/Decimal.d.ts +2 -0
- package/lib/inputs/number/Decimal.js +0 -5
- package/lib/inputs/number/format_number.d.ts +2 -1
- package/lib/inputs/number/format_number.js +6 -9
- package/lib/inputs/number/index.d.ts +2 -0
- package/lib/inputs/number/index.js +3 -13
- package/lib/inputs/number/types.d.ts +4 -2
- package/lib/inputs/period/Dialog.js +2 -7
- package/lib/inputs/period/Dropdown.js +0 -7
- package/lib/inputs/period/PeriodList.js +1 -7
- package/lib/inputs/period/helper.js +2 -12
- package/lib/inputs/period/index.js +49 -120
- package/lib/inputs/period/types.d.ts +3 -3
- package/lib/inputs/search/index.d.ts +2 -0
- package/lib/inputs/search/index.js +18 -63
- package/lib/inputs/select/ActionButtons.d.ts +2 -0
- package/lib/inputs/select/ActionButtons.js +4 -12
- package/lib/inputs/select/Dropdown.d.ts +2 -0
- package/lib/inputs/select/Dropdown.js +29 -49
- package/lib/inputs/select/helper.d.ts +6 -9
- package/lib/inputs/select/helper.js +20 -27
- package/lib/inputs/select/index.js +9 -23
- package/lib/inputs/select/multiple/Selecteds.js +4 -8
- package/lib/inputs/select/multiple/index.js +50 -106
- package/lib/inputs/select/simple/index.js +87 -130
- package/lib/inputs/select/types.d.ts +21 -7
- package/lib/inputs/text/index.js +1 -5
- package/lib/inputs/text/types.d.ts +1 -1
- package/lib/inputs/textarea/index.js +5 -11
- package/lib/inputs/types.d.ts +5 -2
- package/lib/internals/types.d.ts +1 -0
- package/lib/internals/withTooltip.js +37 -75
- package/lib/labelMessages/index.d.ts +2 -0
- package/lib/labelMessages/index.js +26 -47
- package/lib/labelMessages/types.d.ts +3 -1
- package/lib/labels/DangerLabel.d.ts +2 -0
- package/lib/labels/DangerLabel.js +1 -11
- package/lib/labels/DefaultLabel.d.ts +2 -0
- package/lib/labels/DefaultLabel.js +19 -41
- package/lib/labels/InfoLabel.d.ts +2 -0
- package/lib/labels/InfoLabel.js +1 -11
- package/lib/labels/PrimaryLabel.d.ts +2 -0
- package/lib/labels/PrimaryLabel.js +1 -11
- package/lib/labels/SuccessLabel.d.ts +2 -0
- package/lib/labels/SuccessLabel.js +1 -11
- package/lib/labels/WarningLabel.d.ts +2 -0
- package/lib/labels/WarningLabel.js +1 -11
- package/lib/labels/index.d.ts +6 -1
- package/lib/labels/index.js +0 -10
- package/lib/labels/label_container/index.js +3 -7
- package/lib/labels/types.d.ts +3 -1
- package/lib/list/Header.d.ts +2 -0
- package/lib/list/Header.js +3 -7
- package/lib/list/Item.d.ts +2 -0
- package/lib/list/Item.js +33 -68
- package/lib/list/Separator.js +0 -4
- package/lib/list/helpers.d.ts +2 -0
- package/lib/list/helpers.js +0 -4
- package/lib/list/index.d.ts +2 -0
- package/lib/list/index.js +25 -60
- package/lib/list/types.d.ts +5 -3
- package/lib/menus/float/MenuItem.d.ts +2 -0
- package/lib/menus/float/MenuItem.js +9 -26
- package/lib/menus/float/SubMenuContainer.js +5 -17
- package/lib/menus/float/helpers.d.ts +2 -0
- package/lib/menus/float/helpers.js +0 -4
- package/lib/menus/float/index.d.ts +2 -0
- package/lib/menus/float/index.js +8 -21
- package/lib/menus/float/types.d.ts +3 -1
- package/lib/menus/index.d.ts +6 -1
- package/lib/menus/index.js +0 -3
- package/lib/menus/sidenav/ExpandMenu.d.ts +2 -0
- package/lib/menus/sidenav/ExpandMenu.js +2 -7
- package/lib/menus/sidenav/MenuLink.d.ts +2 -0
- package/lib/menus/sidenav/MenuLink.js +3 -12
- package/lib/menus/sidenav/NavMenuGroup.d.ts +2 -0
- package/lib/menus/sidenav/NavMenuGroup.js +3 -12
- package/lib/menus/sidenav/NavMenuItem.d.ts +2 -0
- package/lib/menus/sidenav/NavMenuItem.js +27 -56
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +2 -0
- package/lib/menus/sidenav/NavSubMenuItem.js +8 -27
- package/lib/menus/sidenav/helpers.d.ts +2 -0
- package/lib/menus/sidenav/helpers.js +0 -9
- package/lib/menus/sidenav/index.d.ts +2 -0
- package/lib/menus/sidenav/index.js +26 -75
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +2 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +2 -7
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +2 -0
- package/lib/menus/sidenav/popup_menu_search/index.js +15 -45
- package/lib/menus/sidenav/types.d.ts +5 -3
- package/lib/noPermission/index.js +0 -6
- package/lib/panel/Content.d.ts +3 -1
- package/lib/panel/Content.js +7 -22
- package/lib/panel/DangerPanel.d.ts +3 -1
- package/lib/panel/DangerPanel.js +0 -7
- package/lib/panel/Default.d.ts +3 -1
- package/lib/panel/Default.js +20 -44
- package/lib/panel/Header.d.ts +3 -1
- package/lib/panel/Header.js +14 -30
- package/lib/panel/InfoPanel.d.ts +3 -1
- package/lib/panel/InfoPanel.js +0 -7
- package/lib/panel/PrimaryPanel.d.ts +3 -1
- package/lib/panel/PrimaryPanel.js +0 -7
- package/lib/panel/SuccessPanel.d.ts +3 -1
- package/lib/panel/SuccessPanel.js +0 -7
- package/lib/panel/ToolBar.d.ts +3 -1
- package/lib/panel/ToolBar.js +0 -5
- package/lib/panel/WarningPanel.d.ts +3 -1
- package/lib/panel/WarningPanel.js +0 -7
- package/lib/panel/helpers.d.ts +3 -1
- package/lib/panel/helpers.js +2 -10
- package/lib/panel/index.d.ts +7 -2
- package/lib/panel/index.js +0 -11
- package/lib/panel/types.d.ts +3 -1
- package/lib/permissionValidations.js +3 -15
- package/lib/popover/PopoverText.d.ts +2 -0
- package/lib/popover/PopoverText.js +0 -4
- package/lib/popover/PopoverTitle.d.ts +2 -0
- package/lib/popover/PopoverTitle.js +0 -4
- package/lib/popover/index.d.ts +2 -0
- package/lib/popover/index.js +11 -23
- package/lib/popover/types.d.ts +3 -1
- package/lib/progress/Bar.js +20 -33
- package/lib/progress/index.js +5 -14
- package/lib/radio/index.d.ts +2 -1
- package/lib/radio/index.js +26 -47
- package/lib/radio/types.d.ts +2 -0
- package/lib/skeleton/SkeletonContainer.js +3 -9
- package/lib/skeleton/index.js +10 -22
- package/lib/spinner/SpinnerLoading.js +3 -7
- package/lib/spinner/index.js +18 -40
- package/lib/split/Split.js +32 -83
- package/lib/split/SplitSide.js +6 -18
- package/lib/split/helpers.d.ts +1 -1
- package/lib/split/helpers.js +0 -4
- package/lib/split/index.d.ts +4 -1
- package/lib/split/index.js +0 -5
- package/lib/table/Body.js +22 -39
- package/lib/table/Header.js +24 -42
- package/lib/table/HeaderColumn.js +10 -21
- package/lib/table/Row.js +37 -30
- package/lib/table/RowColumn.js +12 -29
- package/lib/table/helpers.js +0 -7
- package/lib/table/index.js +33 -62
- package/lib/table/types.d.ts +8 -1
- package/lib/tabs/DropdownItems.d.ts +2 -0
- package/lib/tabs/DropdownItems.js +12 -21
- package/lib/tabs/Menu.d.ts +2 -0
- package/lib/tabs/Menu.js +5 -15
- package/lib/tabs/MenuItems.d.ts +2 -0
- package/lib/tabs/MenuItems.js +23 -33
- package/lib/tabs/Panel.d.ts +2 -0
- package/lib/tabs/Panel.js +14 -39
- package/lib/tabs/index.d.ts +2 -0
- package/lib/tabs/index.js +46 -113
- package/lib/tabs/tabHelpers.d.ts +2 -0
- package/lib/tabs/tabHelpers.js +3 -16
- package/lib/tabs/types.d.ts +3 -1
- package/lib/toolbar/ButtonBar.d.ts +2 -0
- package/lib/toolbar/ButtonBar.js +13 -29
- package/lib/toolbar/LabelBar.d.ts +2 -0
- package/lib/toolbar/LabelBar.js +11 -28
- package/lib/toolbar/Separator.js +0 -4
- package/lib/toolbar/ToolBarGroup.d.ts +2 -0
- package/lib/toolbar/ToolBarGroup.js +2 -6
- package/lib/toolbar/helpers.d.ts +2 -0
- package/lib/toolbar/helpers.js +0 -2
- package/lib/toolbar/index.d.ts +2 -0
- package/lib/toolbar/index.js +7 -23
- package/lib/toolbar/types.d.ts +4 -2
- package/lib/tooltip/index.d.ts +1 -1
- package/lib/tooltip/index.js +15 -26
- package/lib/tooltip/types.d.ts +2 -1
- package/lib/treetable/Body.js +9 -27
- package/lib/treetable/Header.js +1 -11
- package/lib/treetable/Row.js +58 -113
- package/lib/treetable/helpers.js +0 -10
- package/lib/treetable/index.js +0 -11
- package/lib/treeview/Header.js +2 -6
- package/lib/treeview/Node.js +47 -111
- package/lib/treeview/constants.js +0 -4
- package/lib/treeview/index.js +55 -134
- package/lib/treeview/types.d.ts +2 -2
- package/lib/treeview_old/Header.js +1 -6
- package/lib/treeview_old/Node.js +5 -32
- package/lib/treeview_old/index.js +1 -9
- package/lib/{types-3c6f1c20.d.ts → types-c1e2d0c9.d.ts} +3 -2
- package/lib/uitour/index.js +33 -73
- package/lib/uitour/types.d.ts +1 -1
- package/package.json +6 -3
|
@@ -1,124 +1,101 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
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); }
|
|
17
|
-
|
|
18
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; }
|
|
19
|
-
|
|
20
13
|
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); }
|
|
21
|
-
|
|
22
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
-
|
|
24
15
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
-
|
|
26
16
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
31
|
-
|
|
17
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
32
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
-
|
|
34
20
|
var TOOLTIP_INITIAL_HEIGHT = 40;
|
|
35
|
-
|
|
36
21
|
var hasTooltip = function hasTooltip(_ref) {
|
|
37
22
|
var tooltip = _ref.tooltip;
|
|
38
23
|
return tooltip;
|
|
39
24
|
};
|
|
40
|
-
|
|
41
25
|
var getDisplayName = function getDisplayName(_ref2) {
|
|
42
26
|
var displayName = _ref2.displayName,
|
|
43
|
-
|
|
27
|
+
name = _ref2.name;
|
|
44
28
|
return displayName || name || 'Component';
|
|
45
29
|
};
|
|
46
|
-
|
|
47
30
|
var withTooltip = function withTooltip(WrappedComponent) {
|
|
48
31
|
var EnhancedComponent = function EnhancedComponent(props) {
|
|
49
32
|
var tooltip = props.tooltip,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
33
|
+
_props$tooltipWidth = props.tooltipWidth,
|
|
34
|
+
tooltipWidth = _props$tooltipWidth === void 0 ? 'auto' : _props$tooltipWidth,
|
|
35
|
+
_props$space = props.space,
|
|
36
|
+
space = _props$space === void 0 ? 20 : _props$space,
|
|
37
|
+
_props$tooltipPositio = props.tooltipPosition,
|
|
38
|
+
tooltipPosition = _props$tooltipPositio === void 0 ? 'bottom' : _props$tooltipPositio,
|
|
39
|
+
errorMessage = props.errorMessage;
|
|
57
40
|
var _useState = (0, _react.useState)(tooltipPosition),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
+
stateTooltipPosition = _useState2[0],
|
|
43
|
+
setStateTooltipPosition = _useState2[1];
|
|
62
44
|
var _useState3 = (0, _react.useState)(''),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
45
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
46
|
+
tooltipStyle = _useState4[0],
|
|
47
|
+
setTooltipStyle = _useState4[1];
|
|
67
48
|
var _useState5 = (0, _react.useState)(false),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
49
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
50
|
+
showTooltip = _useState6[0],
|
|
51
|
+
setShowTooltip = _useState6[1];
|
|
72
52
|
var _useState7 = (0, _react.useState)({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
53
|
+
width: tooltipWidth,
|
|
54
|
+
height: TOOLTIP_INITIAL_HEIGHT
|
|
55
|
+
}),
|
|
56
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
57
|
+
tooltipDimensions = _useState8[0],
|
|
58
|
+
setTooltipDimensions = _useState8[1];
|
|
80
59
|
var targetElement = (0, _react.useRef)(null);
|
|
81
60
|
var tooltipElement = (0, _react.useRef)(null);
|
|
82
|
-
|
|
83
61
|
var onMouseOver = function onMouseOver(e) {
|
|
84
62
|
if (targetElement.current && targetElement.current.contains(e.target)) {
|
|
85
63
|
setShowTooltip(true);
|
|
86
64
|
} else setShowTooltip(false);
|
|
87
65
|
};
|
|
88
|
-
|
|
89
66
|
var onMouseOut = function onMouseOut() {
|
|
90
67
|
setShowTooltip(false);
|
|
91
68
|
};
|
|
92
|
-
|
|
93
69
|
var onAnyScroll = function onAnyScroll() {
|
|
94
70
|
setShowTooltip(false);
|
|
95
71
|
};
|
|
96
|
-
|
|
97
72
|
(0, _react.useEffect)(function () {
|
|
98
73
|
if (hasTooltip(props)) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
74
|
+
if (errorMessage) {
|
|
75
|
+
setShowTooltip(true);
|
|
76
|
+
} else {
|
|
77
|
+
setShowTooltip(false);
|
|
78
|
+
document.addEventListener('mouseover', onMouseOver);
|
|
79
|
+
document.addEventListener('scroll', onAnyScroll, true);
|
|
80
|
+
if (targetElement && targetElement.current) {
|
|
81
|
+
targetElement.current.addEventListener('mouseout', onMouseOut);
|
|
82
|
+
}
|
|
104
83
|
}
|
|
105
84
|
}
|
|
106
|
-
|
|
107
85
|
return function () {
|
|
108
86
|
if (hasTooltip(props)) {
|
|
109
87
|
document.removeEventListener('mouseover', onMouseOver);
|
|
110
88
|
document.removeEventListener('scroll', onAnyScroll, true);
|
|
111
|
-
|
|
112
89
|
if (targetElement && targetElement.current) {
|
|
113
90
|
targetElement.current.removeEventListener('mouseout', onMouseOut);
|
|
114
91
|
}
|
|
115
92
|
}
|
|
116
93
|
};
|
|
117
|
-
}, []);
|
|
94
|
+
}, [errorMessage]);
|
|
118
95
|
(0, _react.useEffect)(function () {
|
|
119
96
|
if (targetElement.current && tooltipElement.current) {
|
|
120
97
|
var width = tooltipDimensions.width,
|
|
121
|
-
|
|
98
|
+
height = tooltipDimensions.height;
|
|
122
99
|
var targetDimensions = targetElement.current.getBoundingClientRect();
|
|
123
100
|
var targetVerticalCenter = (targetDimensions.top + targetDimensions.bottom) / 2;
|
|
124
101
|
var tooltipClientWidth = tooltipElement.current.clientWidth;
|
|
@@ -126,7 +103,6 @@ var withTooltip = function withTooltip(WrappedComponent) {
|
|
|
126
103
|
var left = targetDimensions.left + targetDimensions.width / 2 - tooltipClientWidth / 2;
|
|
127
104
|
left = Math.min(left, document.body.clientWidth - tooltipClientWidth - space);
|
|
128
105
|
style += "; left: ".concat(Math.max(space, left), "px");
|
|
129
|
-
|
|
130
106
|
switch (stateTooltipPosition) {
|
|
131
107
|
case 'top':
|
|
132
108
|
if (targetDimensions.top < height) {
|
|
@@ -134,18 +110,14 @@ var withTooltip = function withTooltip(WrappedComponent) {
|
|
|
134
110
|
} else {
|
|
135
111
|
style += "; top: ".concat(targetDimensions.top + window.scrollY - height - 5, "px");
|
|
136
112
|
}
|
|
137
|
-
|
|
138
113
|
break;
|
|
139
|
-
|
|
140
114
|
case 'bottom':
|
|
141
115
|
if (window.innerHeight - targetDimensions.bottom < height) {
|
|
142
116
|
setStateTooltipPosition('top');
|
|
143
117
|
} else {
|
|
144
118
|
style += "; top: ".concat(targetDimensions.top + window.scrollY + targetDimensions.height + 5, "px");
|
|
145
119
|
}
|
|
146
|
-
|
|
147
120
|
break;
|
|
148
|
-
|
|
149
121
|
case 'left':
|
|
150
122
|
if (targetDimensions.left < tooltipClientWidth) {
|
|
151
123
|
setStateTooltipPosition('right');
|
|
@@ -153,9 +125,7 @@ var withTooltip = function withTooltip(WrappedComponent) {
|
|
|
153
125
|
style += "; top: ".concat(targetVerticalCenter + window.scrollY - height / 2, "px");
|
|
154
126
|
style += "; left: ".concat(targetDimensions.left - tooltipClientWidth - 6, "px");
|
|
155
127
|
}
|
|
156
|
-
|
|
157
128
|
break;
|
|
158
|
-
|
|
159
129
|
case 'right':
|
|
160
130
|
if (window.innerWidth - targetDimensions.right < tooltipClientWidth) {
|
|
161
131
|
setStateTooltipPosition('left');
|
|
@@ -163,24 +133,21 @@ var withTooltip = function withTooltip(WrappedComponent) {
|
|
|
163
133
|
style += "; top: ".concat(targetVerticalCenter + window.scrollY - height / 2, "px");
|
|
164
134
|
style += "; left: ".concat(targetDimensions.left + targetDimensions.width + 5, "px");
|
|
165
135
|
}
|
|
166
|
-
|
|
167
136
|
break;
|
|
168
|
-
|
|
169
137
|
default:
|
|
170
138
|
style += '';
|
|
171
139
|
}
|
|
172
|
-
|
|
173
140
|
setTooltipStyle(style);
|
|
174
141
|
}
|
|
175
142
|
}, [tooltipDimensions, tooltipElement.current, targetElement.current, stateTooltipPosition]);
|
|
176
143
|
(0, _react.useEffect)(function () {
|
|
177
144
|
setStateTooltipPosition(tooltipPosition);
|
|
178
145
|
}, [window.scrollY, window.scrollX, window.innerWidth]);
|
|
179
|
-
|
|
180
146
|
var getTooltip = function getTooltip() {
|
|
181
147
|
if (tooltip) {
|
|
182
148
|
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
183
149
|
text: tooltip,
|
|
150
|
+
textError: errorMessage,
|
|
184
151
|
tooltipRef: tooltipElement,
|
|
185
152
|
style: tooltipStyle,
|
|
186
153
|
className: stateTooltipPosition,
|
|
@@ -188,23 +155,18 @@ var withTooltip = function withTooltip(WrappedComponent) {
|
|
|
188
155
|
handlerSetDimensions: setTooltipDimensions
|
|
189
156
|
});
|
|
190
157
|
}
|
|
191
|
-
|
|
192
158
|
return null;
|
|
193
159
|
};
|
|
194
|
-
|
|
195
160
|
var getTarget = function getTarget(targetEl) {
|
|
196
161
|
if (!targetElement.current) targetElement.current = targetEl;
|
|
197
162
|
};
|
|
198
|
-
|
|
199
163
|
if (!hasTooltip(props)) return /*#__PURE__*/_react.default.createElement(WrappedComponent, props);
|
|
200
164
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(WrappedComponent, _extends({}, props, {
|
|
201
165
|
targetRef: getTarget
|
|
202
166
|
})), showTooltip && getTooltip());
|
|
203
167
|
};
|
|
204
|
-
|
|
205
168
|
EnhancedComponent.displayName = "withTooltip(".concat(getDisplayName(WrappedComponent), ")");
|
|
206
169
|
return EnhancedComponent;
|
|
207
170
|
};
|
|
208
|
-
|
|
209
171
|
var _default = withTooltip;
|
|
210
172
|
exports.default = _default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ILabelMessagesProps } from './types.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../@types/LabelStyles.js';
|
|
4
|
+
import '../@types/Icon.js';
|
|
5
|
+
import '../icons/helper.js';
|
|
4
6
|
|
|
5
7
|
declare const LabelMessages: ({ style, icon, flat, iconName, handlerClosed, square, visible, children, customClass, type, showCloseButton }: ILabelMessagesProps) => JSX.Element | null;
|
|
6
8
|
|
|
@@ -1,72 +1,54 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _icons = _interopRequireDefault(require("../icons"));
|
|
13
|
-
|
|
14
10
|
require("../assets/styles/labelMessages.scss");
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
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); }
|
|
19
|
-
|
|
20
13
|
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; }
|
|
21
|
-
|
|
22
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
-
|
|
24
15
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
-
|
|
26
16
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
31
|
-
|
|
17
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
32
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
-
|
|
34
20
|
var LabelMessages = function LabelMessages(_ref) {
|
|
35
21
|
var _ref$style = _ref.style,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
showCloseButton = _ref$showCloseButton === void 0 ? false : _ref$showCloseButton;
|
|
56
|
-
|
|
22
|
+
style = _ref$style === void 0 ? {} : _ref$style,
|
|
23
|
+
_ref$icon = _ref.icon,
|
|
24
|
+
icon = _ref$icon === void 0 ? null : _ref$icon,
|
|
25
|
+
_ref$flat = _ref.flat,
|
|
26
|
+
flat = _ref$flat === void 0 ? false : _ref$flat,
|
|
27
|
+
iconName = _ref.iconName,
|
|
28
|
+
handlerClosed = _ref.handlerClosed,
|
|
29
|
+
_ref$square = _ref.square,
|
|
30
|
+
square = _ref$square === void 0 ? true : _ref$square,
|
|
31
|
+
_ref$visible = _ref.visible,
|
|
32
|
+
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
33
|
+
_ref$children = _ref.children,
|
|
34
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
35
|
+
_ref$customClass = _ref.customClass,
|
|
36
|
+
customClass = _ref$customClass === void 0 ? '' : _ref$customClass,
|
|
37
|
+
_ref$type = _ref.type,
|
|
38
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
39
|
+
_ref$showCloseButton = _ref.showCloseButton,
|
|
40
|
+
showCloseButton = _ref$showCloseButton === void 0 ? false : _ref$showCloseButton;
|
|
57
41
|
var _useState = (0, _react.useState)(false),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
closed = _useState2[0],
|
|
44
|
+
setClosed = _useState2[1];
|
|
62
45
|
var getClass = function getClass() {
|
|
63
46
|
return "labelmessages-component -".concat(type, " ").concat(customClass, "\n ").concat(square && '-square', " ").concat(flat && '-flat');
|
|
64
47
|
};
|
|
65
|
-
|
|
66
48
|
var getIcon = function getIcon() {
|
|
67
|
-
if (icon
|
|
49
|
+
if (icon) {
|
|
68
50
|
return icon;
|
|
69
|
-
} else if (iconName
|
|
51
|
+
} else if (iconName) {
|
|
70
52
|
return /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
71
53
|
name: iconName,
|
|
72
54
|
size: 16,
|
|
@@ -74,10 +56,8 @@ var LabelMessages = function LabelMessages(_ref) {
|
|
|
74
56
|
customClass: "-".concat(type, "svg")
|
|
75
57
|
});
|
|
76
58
|
}
|
|
77
|
-
|
|
78
59
|
return null;
|
|
79
60
|
};
|
|
80
|
-
|
|
81
61
|
if (closed || !visible) return null;
|
|
82
62
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
83
63
|
className: "".concat(getClass(), " ").concat(customClass),
|
|
@@ -95,6 +75,5 @@ var LabelMessages = function LabelMessages(_ref) {
|
|
|
95
75
|
}
|
|
96
76
|
}, "x")));
|
|
97
77
|
};
|
|
98
|
-
|
|
99
78
|
var _default = LabelMessages;
|
|
100
79
|
exports.default = _default;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { LabelStyles } from '../@types/LabelStyles.js';
|
|
3
|
+
import { IconNames } from '../@types/Icon.js';
|
|
4
|
+
import '../icons/helper.js';
|
|
3
5
|
|
|
4
6
|
interface ILabelMessagesProps {
|
|
5
7
|
style?: CSSProperties;
|
|
6
8
|
type?: LabelStyles;
|
|
7
|
-
iconName?:
|
|
9
|
+
iconName?: IconNames;
|
|
8
10
|
icon?: ReactNode | null;
|
|
9
11
|
children?: ReactNode;
|
|
10
12
|
customClass?: string;
|
|
@@ -3,6 +3,8 @@ import 'react';
|
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Position.js';
|
|
5
5
|
import '../@types/Size.js';
|
|
6
|
+
import '../@types/Icon.js';
|
|
7
|
+
import '../icons/helper.js';
|
|
6
8
|
|
|
7
9
|
declare const DangerLabel: ({ className, ...rest }: ILabelProps) => JSX.Element;
|
|
8
10
|
|
|
@@ -4,29 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _DefaultLabel = _interopRequireDefault(require("./DefaultLabel"));
|
|
11
|
-
|
|
12
9
|
var _excluded = ["className"];
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
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); }
|
|
17
|
-
|
|
18
12
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
|
-
|
|
20
13
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
|
-
|
|
22
14
|
var DangerLabel = function DangerLabel(_ref) {
|
|
23
15
|
var className = _ref.className,
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
17
|
return /*#__PURE__*/_react.default.createElement(_DefaultLabel.default, _extends({
|
|
27
18
|
className: "-danger"
|
|
28
19
|
}, rest));
|
|
29
20
|
};
|
|
30
|
-
|
|
31
21
|
var _default = DangerLabel;
|
|
32
22
|
exports.default = _default;
|
|
@@ -1,65 +1,47 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _icons = _interopRequireDefault(require("../icons"));
|
|
13
|
-
|
|
14
10
|
var _withTooltip = _interopRequireDefault(require("../internals/withTooltip"));
|
|
15
|
-
|
|
16
11
|
var _permissionValidations = require("../permissionValidations");
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
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); }
|
|
21
|
-
|
|
22
14
|
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; }
|
|
23
|
-
|
|
24
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
-
|
|
26
16
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
|
-
|
|
28
17
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
33
|
-
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
19
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
34
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
|
-
|
|
36
21
|
var DefaultLabel = function DefaultLabel(_ref) {
|
|
37
22
|
var style = _ref.style,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
23
|
+
targetRef = _ref.targetRef,
|
|
24
|
+
iconName = _ref.iconName,
|
|
25
|
+
icon = _ref.icon,
|
|
26
|
+
children = _ref.children,
|
|
27
|
+
_ref$visible = _ref.visible,
|
|
28
|
+
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
29
|
+
customClass = _ref.customClass,
|
|
30
|
+
className = _ref.className,
|
|
31
|
+
disabled = _ref.disabled,
|
|
32
|
+
size = _ref.size,
|
|
33
|
+
_ref$iconAlign = _ref.iconAlign,
|
|
34
|
+
iconAlign = _ref$iconAlign === void 0 ? 'left' : _ref$iconAlign,
|
|
35
|
+
bordered = _ref.bordered,
|
|
36
|
+
permissionAttr = _ref.permissionAttr,
|
|
37
|
+
skeletonize = _ref.skeletonize;
|
|
53
38
|
var options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
|
|
54
|
-
|
|
55
39
|
var _useState = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr)),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
41
|
+
onDenied = _useState2[0];
|
|
59
42
|
var getClass = function getClass() {
|
|
60
43
|
return "label-component ".concat(className, " ").concat(customClass, " ").concat(bordered ? '-bordered' : '', " ").concat(disabled ? '-disabled' : '', "\n ").concat(skeletonize ? '-skeletonized' : '', "\n ").concat(size ? "-".concat(size) : '', "\n ").concat(iconAlign ? "icon-".concat(iconAlign) : '');
|
|
61
44
|
};
|
|
62
|
-
|
|
63
45
|
var getIcon = function getIcon() {
|
|
64
46
|
if (icon) {
|
|
65
47
|
return icon;
|
|
@@ -69,10 +51,8 @@ var DefaultLabel = function DefaultLabel(_ref) {
|
|
|
69
51
|
size: 16
|
|
70
52
|
});
|
|
71
53
|
}
|
|
72
|
-
|
|
73
54
|
return null;
|
|
74
55
|
};
|
|
75
|
-
|
|
76
56
|
if (!visible || onDenied.unvisible) return null;
|
|
77
57
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
78
58
|
style: style,
|
|
@@ -82,7 +62,5 @@ var DefaultLabel = function DefaultLabel(_ref) {
|
|
|
82
62
|
}
|
|
83
63
|
}, getIcon(), children);
|
|
84
64
|
};
|
|
85
|
-
|
|
86
65
|
var _default = (0, _withTooltip.default)(DefaultLabel);
|
|
87
|
-
|
|
88
66
|
exports.default = _default;
|
package/lib/labels/InfoLabel.js
CHANGED
|
@@ -4,29 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _DefaultLabel = _interopRequireDefault(require("./DefaultLabel"));
|
|
11
|
-
|
|
12
9
|
var _excluded = ["className"];
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
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); }
|
|
17
|
-
|
|
18
12
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
|
-
|
|
20
13
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
|
-
|
|
22
14
|
var InfoLabel = function InfoLabel(_ref) {
|
|
23
15
|
var className = _ref.className,
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
17
|
return /*#__PURE__*/_react.default.createElement(_DefaultLabel.default, _extends({
|
|
27
18
|
className: "-info"
|
|
28
19
|
}, rest));
|
|
29
20
|
};
|
|
30
|
-
|
|
31
21
|
var _default = InfoLabel;
|
|
32
22
|
exports.default = _default;
|
|
@@ -3,6 +3,8 @@ import 'react';
|
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Position.js';
|
|
5
5
|
import '../@types/Size.js';
|
|
6
|
+
import '../@types/Icon.js';
|
|
7
|
+
import '../icons/helper.js';
|
|
6
8
|
|
|
7
9
|
declare const PrimaryLabel: ({ className, ...rest }: ILabelProps) => JSX.Element;
|
|
8
10
|
|
|
@@ -4,29 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _DefaultLabel = _interopRequireDefault(require("./DefaultLabel"));
|
|
11
|
-
|
|
12
9
|
var _excluded = ["className"];
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
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); }
|
|
17
|
-
|
|
18
12
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
|
-
|
|
20
13
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
|
-
|
|
22
14
|
var PrimaryLabel = function PrimaryLabel(_ref) {
|
|
23
15
|
var className = _ref.className,
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
17
|
return /*#__PURE__*/_react.default.createElement(_DefaultLabel.default, _extends({
|
|
27
18
|
className: "-primary"
|
|
28
19
|
}, rest));
|
|
29
20
|
};
|
|
30
|
-
|
|
31
21
|
var _default = PrimaryLabel;
|
|
32
22
|
exports.default = _default;
|