linear-react-components-ui 0.4.77-beta.22 → 0.4.77-beta.25
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 +97 -0
- package/.gitlab-ci.yml +19 -0
- package/.husky/pre-push +4 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +3 -0
- package/config/getHttpsConfig.js +56 -0
- package/config/paths.js +140 -0
- package/config/webpackDevServer.config.js +128 -0
- package/images.d.ts +3 -0
- package/jest.config.js +3 -3
- package/lib/@types/Align.js +5 -0
- package/lib/@types/ButtonTypes.js +5 -0
- package/lib/@types/ColorStyles.js +5 -0
- package/lib/@types/DataCombo.js +5 -0
- package/lib/@types/Icon.js +5 -0
- package/lib/@types/LabelStyles.js +5 -0
- package/lib/@types/Period.js +5 -0
- package/lib/@types/PermissionAttr.js +5 -0
- package/lib/@types/PointerEvents.js +5 -0
- package/lib/@types/Position.js +5 -0
- package/lib/@types/PositionAlert.js +5 -0
- package/lib/@types/Size.js +5 -0
- package/lib/@types/SizePixels.js +5 -0
- package/lib/@types/StorageMock.js +5 -0
- package/lib/alerts/AlertContainer.js +16 -21
- package/lib/alerts/AlertProvider.js +13 -18
- package/lib/alerts/BaseAlert.js +9 -12
- package/lib/alerts/Message.js +41 -50
- package/lib/alerts/alert.spec.js +10 -6
- package/lib/alerts/helpers.js +4 -7
- package/lib/alerts/index.js +5 -5
- package/lib/alerts/types.js +5 -0
- package/lib/alerts/withAlert.js +9 -11
- package/lib/assets/styles/commons.scss +0 -10
- package/lib/assets/styles/dropdown.scss +0 -1
- package/lib/assets/styles/list.scss +0 -8
- package/lib/assets/styles/table.scss +7 -2
- package/lib/assets/styles/treetable.scss +76 -131
- package/lib/avatar/avatar.spec.js +25 -23
- package/lib/avatar/index.js +21 -66
- package/lib/avatar/types.js +5 -0
- package/lib/badge/badge.spec.js +4 -4
- package/lib/badge/index.js +11 -27
- package/lib/badge/types.js +5 -0
- package/lib/buttons/ActivateButton.js +6 -6
- package/lib/buttons/AddButton.js +6 -6
- package/lib/buttons/Button.js +22 -14
- package/lib/buttons/ButtonGroups.js +4 -9
- package/lib/buttons/CancelButton.js +19 -6
- package/lib/buttons/DangerButton.js +16 -21
- package/lib/buttons/DefaultButton.js +75 -139
- package/lib/buttons/DestroyButton.js +16 -7
- package/lib/buttons/EditButton.js +6 -6
- package/lib/buttons/InactivateButton.js +6 -6
- package/lib/buttons/InfoButton.js +16 -21
- package/lib/buttons/PrimaryButton.js +16 -21
- package/lib/buttons/RestoreButton.js +6 -6
- package/lib/buttons/SaveButton.js +18 -5
- package/lib/buttons/SuccessButton.js +15 -20
- package/lib/buttons/WarningButton.js +15 -20
- package/lib/buttons/button_container/index.js +10 -23
- package/lib/buttons/buttons.spec.js +51 -51
- package/lib/buttons/index.js +32 -32
- package/lib/buttons/split_button/index.js +7 -44
- package/lib/buttons/types.js +5 -0
- package/lib/calendar/DangerCalendar.js +15 -6
- package/lib/calendar/InfoCalendar.js +15 -6
- package/lib/calendar/PrimaryCalendar.js +15 -6
- package/lib/calendar/SuccessCalendar.js +15 -6
- package/lib/calendar/WarningCalendar.js +15 -6
- package/lib/calendar/base/Day.js +8 -14
- package/lib/calendar/base/Month.js +5 -10
- package/lib/calendar/base/Week.js +5 -11
- package/lib/calendar/base/helpers.js +15 -15
- package/lib/calendar/base/index.js +45 -48
- package/lib/calendar/calendar.spec.js +22 -20
- package/lib/calendar/index.js +14 -14
- package/lib/calendar/types.js +5 -0
- package/lib/checkbox/Label.js +7 -17
- package/lib/checkbox/checkbox.spec.js +28 -27
- package/lib/checkbox/index.js +52 -89
- package/lib/checkbox/types.js +5 -0
- package/lib/dialog/Alert.js +9 -14
- package/lib/dialog/Custom.js +24 -32
- package/lib/dialog/Error.js +7 -12
- package/lib/dialog/Information.js +7 -12
- package/lib/dialog/Question.js +14 -25
- package/lib/dialog/Warning.js +7 -12
- package/lib/dialog/base/Content.js +4 -13
- package/lib/dialog/base/Footer.js +6 -12
- package/lib/dialog/base/Header.js +17 -31
- package/lib/dialog/base/index.js +13 -35
- package/lib/dialog/base/style.js +2 -2
- package/lib/dialog/dialog.spec.js +69 -72
- package/lib/dialog/form/index.js +34 -47
- package/lib/dialog/index.js +15 -15
- package/lib/dialog/types.js +5 -0
- package/lib/drawer/Content.js +7 -16
- package/lib/drawer/Drawer.js +37 -78
- package/lib/drawer/Drawer.spec.js +53 -78
- package/lib/drawer/Header.js +28 -47
- package/lib/drawer/helpers.js +4 -4
- package/lib/drawer/index.js +8 -8
- package/lib/drawer/types.js +5 -0
- package/lib/dropdown/Popup.js +34 -20
- package/lib/dropdown/dropdown.spec.js +35 -22
- package/lib/dropdown/helper.js +2 -2
- package/lib/dropdown/types.js +5 -0
- package/lib/dropdown/withDropdown.js +20 -47
- package/lib/fieldset/fieldset.spec.js +4 -4
- package/lib/fieldset/index.js +19 -50
- package/lib/fieldset/types.js +5 -0
- package/lib/form/Field.js +26 -26
- package/lib/form/FieldArray.js +27 -27
- package/lib/form/FieldNumber.js +16 -16
- package/lib/form/FieldPeriod.js +23 -23
- package/lib/form/form.spec.js +17 -15
- package/lib/form/helpers.js +6 -6
- package/lib/form/index.js +39 -39
- package/lib/form/withFieldHOC.js +20 -20
- package/lib/form/withFormSecurity.js +12 -12
- package/lib/gridlayout/GridCol.js +7 -22
- package/lib/gridlayout/GridRow.js +8 -28
- package/lib/gridlayout/gridLayout.spec.js +6 -6
- package/lib/gridlayout/index.js +5 -5
- package/lib/gridlayout/types.js +5 -0
- package/lib/icons/helper.js +560 -563
- package/lib/icons/icons.spec.js +10 -10
- package/lib/icons/index.js +28 -45
- package/lib/icons/types.js +5 -0
- package/lib/index.js +16 -16
- package/lib/inputs/base/InputTextBase.js +54 -163
- package/lib/inputs/base/base.spec.js +38 -37
- package/lib/inputs/base/helpers.js +9 -9
- package/lib/inputs/base/types.js +5 -0
- package/lib/inputs/color/color_input.spec.js +8 -8
- package/lib/inputs/color/index.js +41 -39
- package/lib/inputs/color/types.js +5 -0
- package/lib/inputs/date/Dialog.js +4 -11
- package/lib/inputs/date/Dropdown.js +21 -73
- package/lib/inputs/date/date.spec.js +11 -13
- package/lib/inputs/date/helpers.js +5 -5
- package/lib/inputs/date/index.js +259 -415
- package/lib/inputs/date/types.js +5 -0
- package/lib/inputs/inputHOC.js +48 -100
- package/lib/inputs/mask/BaseMask.js +6 -20
- package/lib/inputs/mask/Cnpj.js +19 -28
- package/lib/inputs/mask/Cpf.js +19 -30
- package/lib/inputs/mask/Phone.js +5 -13
- package/lib/inputs/mask/ZipCode.js +5 -5
- package/lib/inputs/mask/helpers.js +23 -38
- package/lib/inputs/mask/imaskHOC.js +189 -257
- package/lib/inputs/mask/index.js +10 -10
- package/lib/inputs/mask/input_mask.spec.js +98 -121
- package/lib/inputs/mask/types.js +5 -0
- package/lib/inputs/multiSelect/ActionButtons.js +9 -21
- package/lib/inputs/multiSelect/Dropdown.js +61 -88
- package/lib/inputs/multiSelect/helper.js +2 -2
- package/lib/inputs/multiSelect/index.js +68 -91
- package/lib/inputs/multiSelect/types.js +5 -0
- package/lib/inputs/number/BaseNumber.js +16 -28
- package/lib/inputs/number/Currency.js +8 -18
- package/lib/inputs/number/Decimal.js +4 -4
- package/lib/inputs/number/format_number.js +1 -1
- package/lib/inputs/number/index.js +14 -20
- package/lib/inputs/number/numberfield.spec.js +8 -7
- package/lib/inputs/number/types.js +5 -0
- package/lib/inputs/period/Dialog.js +4 -11
- package/lib/inputs/period/Dropdown.js +19 -73
- package/lib/inputs/period/PeriodList.js +12 -25
- package/lib/inputs/period/helper.js +33 -74
- package/lib/inputs/period/index.js +137 -189
- package/lib/inputs/period/types.js +5 -0
- package/lib/inputs/search/index.js +136 -265
- package/lib/inputs/search/search_input.spec.js +17 -11
- package/lib/inputs/select/ActionButtons.js +19 -25
- package/lib/inputs/select/Dropdown.js +43 -76
- package/lib/inputs/select/helper.js +19 -15
- package/lib/inputs/select/index.js +15 -16
- package/lib/inputs/select/multiple/Selecteds.js +9 -17
- package/lib/inputs/select/multiple/index.js +293 -418
- package/lib/inputs/select/select.spec.js +69 -52
- package/lib/inputs/select/simple/index.js +310 -463
- package/lib/inputs/select/types.js +5 -0
- package/lib/inputs/text/index.js +5 -4
- package/lib/inputs/text/textfield.spec.js +6 -6
- package/lib/inputs/text/types.js +5 -0
- package/lib/inputs/textarea/index.js +9 -19
- package/lib/inputs/textarea/textarea.spec.js +6 -6
- package/lib/inputs/textarea/types.js +5 -0
- package/lib/inputs/types.js +5 -0
- package/lib/internals/colorStyles.js +2 -2
- package/lib/internals/constants.js +1 -1
- package/lib/internals/types.js +5 -0
- package/lib/internals/withTooltip.js +33 -41
- package/lib/labelMessages/index.js +35 -53
- package/lib/labelMessages/labelMessages.spec.js +16 -16
- package/lib/labelMessages/types.js +5 -0
- package/lib/labels/DangerLabel.js +16 -7
- package/lib/labels/DefaultLabel.js +30 -62
- package/lib/labels/InfoLabel.js +16 -7
- package/lib/labels/PrimaryLabel.js +16 -7
- package/lib/labels/SuccessLabel.js +16 -7
- package/lib/labels/WarningLabel.js +16 -7
- package/lib/labels/index.js +15 -15
- package/lib/labels/label.spec.js +19 -19
- package/lib/labels/label_container/index.js +7 -17
- package/lib/labels/types.js +5 -0
- package/lib/list/Header.js +5 -18
- package/lib/list/Item.js +40 -80
- package/lib/list/Separator.js +4 -4
- package/lib/list/helpers.js +5 -10
- package/lib/list/index.js +31 -119
- package/lib/list/list.spec.js +100 -129
- package/lib/list/types.js +5 -0
- package/lib/menus/float/MenuItem.js +17 -37
- package/lib/menus/float/float-menu.spec.js +34 -28
- package/lib/menus/float/helpers.js +4 -4
- package/lib/menus/float/index.js +17 -37
- package/lib/menus/float/types.js +5 -0
- package/lib/menus/index.js +4 -4
- package/lib/menus/sidenav/ExpandMenu.js +6 -18
- package/lib/menus/sidenav/MenuLink.js +5 -19
- package/lib/menus/sidenav/NavMenuGroup.js +6 -17
- package/lib/menus/sidenav/NavMenuItem.js +30 -56
- package/lib/menus/sidenav/NavSubMenuItem.js +10 -21
- package/lib/menus/sidenav/helpers.js +5 -5
- package/lib/menus/sidenav/index.js +43 -73
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +9 -18
- package/lib/menus/sidenav/popup_menu_search/index.js +26 -23
- package/lib/menus/sidenav/sidenav.spec.js +24 -20
- package/lib/menus/sidenav/types.js +5 -0
- package/lib/noPermission/index.js +7 -7
- package/lib/panel/Content.js +14 -26
- package/lib/panel/DangerPanel.js +6 -6
- package/lib/panel/Default.js +25 -52
- package/lib/panel/Header.js +18 -40
- package/lib/panel/InfoPanel.js +6 -6
- package/lib/panel/PrimaryPanel.js +6 -6
- package/lib/panel/SuccessPanel.js +6 -6
- package/lib/panel/ToolBar.js +4 -9
- package/lib/panel/WarningPanel.js +6 -6
- package/lib/panel/helpers.js +9 -5
- package/lib/panel/index.js +18 -18
- package/lib/panel/panel.spec.js +28 -28
- package/lib/panel/types.js +5 -0
- package/lib/permissionValidations.js +2 -2
- package/lib/popover/PopoverText.js +4 -9
- package/lib/popover/PopoverTitle.js +4 -9
- package/lib/popover/index.js +35 -49
- package/lib/popover/popover.spec.js +16 -16
- package/lib/popover/types.js +5 -0
- package/lib/progress/Bar.js +42 -52
- package/lib/progress/index.js +14 -24
- package/lib/progress/progress.spec.js +24 -16
- package/lib/progress/types.js +5 -0
- package/lib/radio/index.js +28 -52
- package/lib/radio/radio.spec.js +16 -14
- package/lib/radio/types.js +5 -0
- package/lib/skeleton/SkeletonContainer.js +8 -8
- package/lib/skeleton/index.js +15 -15
- package/lib/spinner/SpinnerLoading.js +45 -53
- package/lib/spinner/index.js +29 -34
- package/lib/spinner/spinner.spec.js +9 -5
- package/lib/spinner/types.js +5 -0
- package/lib/split/Split.js +53 -70
- package/lib/split/SplitSide.js +7 -27
- package/lib/split/helpers.js +4 -4
- package/lib/split/index.js +5 -5
- package/lib/split/split.spec.js +51 -34
- package/lib/split/types.js +5 -0
- package/lib/table/Body.js +21 -28
- package/lib/table/Header.js +18 -25
- package/lib/table/HeaderColumn.js +13 -27
- package/lib/table/Row.js +21 -37
- package/lib/table/RowColumn.js +20 -38
- package/lib/table/helpers.js +5 -5
- package/lib/table/index.js +25 -63
- package/lib/table/table.spec.js +50 -49
- package/lib/table/types.js +5 -0
- package/lib/tabs/DropdownItems.js +20 -30
- package/lib/tabs/Menu.js +21 -25
- package/lib/tabs/MenuItems.js +32 -46
- package/lib/tabs/Panel.js +24 -57
- package/lib/tabs/index.js +90 -84
- package/lib/tabs/tabHelpers.js +12 -10
- package/lib/tabs/tabs.spec.js +70 -105
- package/lib/tabs/types.js +5 -0
- package/lib/toolbar/ButtonBar.js +51 -32
- package/lib/toolbar/LabelBar.js +42 -29
- package/lib/toolbar/Separator.js +4 -4
- package/lib/toolbar/ToolBarGroup.js +10 -16
- package/lib/toolbar/helpers.js +3 -3
- package/lib/toolbar/index.js +30 -37
- package/lib/toolbar/toolbar.spec.js +40 -40
- package/lib/toolbar/types.js +5 -0
- package/lib/tooltip/index.js +34 -43
- package/lib/tooltip/tooltip.spec.js +37 -18
- package/lib/tooltip/types.js +5 -0
- package/lib/treetable/Body.js +64 -0
- package/lib/treetable/Header.js +37 -0
- package/lib/treetable/Row.js +317 -0
- package/lib/treetable/helpers.js +41 -26
- package/lib/treetable/index.js +15 -277
- package/lib/treetable/types.d.js +5 -0
- package/lib/treeview/Header.js +5 -17
- package/lib/treeview/Node.js +253 -391
- package/lib/treeview/constants.js +2 -2
- package/lib/treeview/index.js +362 -554
- package/lib/treeview/treeview.spec.js +33 -23
- package/lib/treeview/types.js +5 -0
- package/lib/treeview_old/Header.js +7 -7
- package/lib/treeview_old/Node.js +19 -19
- package/lib/treeview_old/index.js +9 -9
- package/lib/uitour/helpers.js +1 -1
- package/lib/uitour/index.js +27 -27
- package/lib/uitour/uitour.spec.js +21 -21
- package/package.json +44 -15
- package/scripts/start.js +135 -0
- package/tsconfig.json +17 -0
- package/.eslintrc.js +0 -26
- package/.husky/pre-commit +0 -4
- package/lib/buttons/SpinnerLoading.js +0 -230
- package/lib/inputs/base/index.js +0 -1
- package/lib/menus/float/SubMenuContainer.js +0 -95
package/lib/split/Split.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
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
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
12
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
15
13
|
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
15
|
|
|
18
16
|
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
17
|
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return {
|
|
18
|
+
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
19
|
|
|
22
|
-
function _extends() { _extends = Object.assign
|
|
20
|
+
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); }
|
|
23
21
|
|
|
24
22
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
23
|
|
|
@@ -29,11 +27,31 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
29
27
|
|
|
30
28
|
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; }
|
|
31
29
|
|
|
32
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
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; }
|
|
33
31
|
|
|
34
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
33
|
|
|
36
|
-
var Split = function Split(
|
|
34
|
+
var Split = function Split(_ref) {
|
|
35
|
+
var hotKey = _ref.hotKey,
|
|
36
|
+
_ref$secondaryInitial = _ref.secondaryInitialSize,
|
|
37
|
+
secondaryInitialSize = _ref$secondaryInitial === void 0 ? 0 : _ref$secondaryInitial,
|
|
38
|
+
onSecondaryPaneSizeChange = _ref.onSecondaryPaneSizeChange,
|
|
39
|
+
vertical = _ref.vertical,
|
|
40
|
+
_ref$primaryIndex = _ref.primaryIndex,
|
|
41
|
+
primaryIndex = _ref$primaryIndex === void 0 ? 0 : _ref$primaryIndex,
|
|
42
|
+
percentage = _ref.percentage,
|
|
43
|
+
_ref$primaryMinSize = _ref.primaryMinSize,
|
|
44
|
+
primaryMinSize = _ref$primaryMinSize === void 0 ? 0 : _ref$primaryMinSize,
|
|
45
|
+
_ref$secondaryMinSize = _ref.secondaryMinSize,
|
|
46
|
+
secondaryMinSize = _ref$secondaryMinSize === void 0 ? 0 : _ref$secondaryMinSize,
|
|
47
|
+
customClass = _ref.customClass,
|
|
48
|
+
_ref$children = _ref.children,
|
|
49
|
+
children = _ref$children === void 0 ? [] : _ref$children,
|
|
50
|
+
_ref$hideSplitSideOnT = _ref.hideSplitSideOnToggleClick,
|
|
51
|
+
hideSplitSideOnToggleClick = _ref$hideSplitSideOnT === void 0 ? 'primary' : _ref$hideSplitSideOnT,
|
|
52
|
+
style = _ref.style,
|
|
53
|
+
nodeParameter = _ref.nodeParameter;
|
|
54
|
+
|
|
37
55
|
var _useState = (0, _react.useState)({
|
|
38
56
|
secondaryPaneSize: 0,
|
|
39
57
|
resizing: false,
|
|
@@ -46,18 +64,6 @@ var Split = function Split(props) {
|
|
|
46
64
|
|
|
47
65
|
var container = (0, _react.useRef)();
|
|
48
66
|
var splitter = (0, _react.useRef)();
|
|
49
|
-
var hotKey = props.hotKey,
|
|
50
|
-
secondaryInitialSize = props.secondaryInitialSize,
|
|
51
|
-
onSecondaryPaneSizeChange = props.onSecondaryPaneSizeChange,
|
|
52
|
-
vertical = props.vertical,
|
|
53
|
-
primaryIndex = props.primaryIndex,
|
|
54
|
-
percentage = props.percentage,
|
|
55
|
-
primaryMinSize = props.primaryMinSize,
|
|
56
|
-
secondaryMinSize = props.secondaryMinSize,
|
|
57
|
-
customClass = props.customClass,
|
|
58
|
-
children = props.children,
|
|
59
|
-
hideSplitSideOnToggleClick = props.hideSplitSideOnToggleClick,
|
|
60
|
-
style = props.style;
|
|
61
67
|
|
|
62
68
|
var getSecondaryPaneSize = function getSecondaryPaneSize(containerRect, splitterRect, clientPosition, offsetMouse) {
|
|
63
69
|
var totalSize = vertical ? containerRect.height : containerRect.width;
|
|
@@ -95,23 +101,27 @@ var Split = function Split(props) {
|
|
|
95
101
|
};
|
|
96
102
|
|
|
97
103
|
var clearSelection = function clearSelection() {
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
var docuemntSelection = Selection;
|
|
105
|
+
|
|
106
|
+
if (document.createRange() && nodeParameter) {
|
|
107
|
+
var range = document.createRange();
|
|
100
108
|
range.collapse();
|
|
101
|
-
range.
|
|
109
|
+
range.selectNode(nodeParameter);
|
|
102
110
|
} else if (window.getSelection) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
var selection = window.getSelection();
|
|
112
|
+
|
|
113
|
+
if (selection && selection.empty) {
|
|
114
|
+
selection.empty();
|
|
115
|
+
} else if (selection && selection.removeAllRanges) {
|
|
116
|
+
selection.removeAllRanges();
|
|
107
117
|
}
|
|
108
|
-
} else if (
|
|
109
|
-
|
|
118
|
+
} else if (docuemntSelection) {
|
|
119
|
+
docuemntSelection.empty();
|
|
110
120
|
}
|
|
111
121
|
};
|
|
112
122
|
|
|
113
123
|
var handleResize = function handleResize() {
|
|
114
|
-
if (splitter.current && !percentage) {
|
|
124
|
+
if (container.current && splitter.current && !percentage) {
|
|
115
125
|
var containerRect = container.current.getBoundingClientRect();
|
|
116
126
|
var splitterRect = splitter.current.getBoundingClientRect();
|
|
117
127
|
var secondaryPaneSize = getSecondaryPaneSize(containerRect, splitterRect, {
|
|
@@ -125,7 +135,7 @@ var Split = function Split(props) {
|
|
|
125
135
|
};
|
|
126
136
|
|
|
127
137
|
var handleMouseMove = function handleMouseMove(e) {
|
|
128
|
-
if (state.resizing) {
|
|
138
|
+
if (container.current && splitter.current && state.resizing) {
|
|
129
139
|
var containerRect = container.current.getBoundingClientRect();
|
|
130
140
|
var splitterRect = splitter.current.getBoundingClientRect();
|
|
131
141
|
var secondaryPaneSize = getSecondaryPaneSize(containerRect, splitterRect, {
|
|
@@ -171,7 +181,7 @@ var Split = function Split(props) {
|
|
|
171
181
|
secondaryPaneSize: 100,
|
|
172
182
|
isHidePane: false
|
|
173
183
|
}));
|
|
174
|
-
} else {
|
|
184
|
+
} else if (state.secondaryPaneSize) {
|
|
175
185
|
setState(_extends({}, state, {
|
|
176
186
|
visibleSplitSide: !visibleSplitSide,
|
|
177
187
|
secondaryPaneSize: secondaryPaneValue,
|
|
@@ -245,15 +255,16 @@ var Split = function Split(props) {
|
|
|
245
255
|
|
|
246
256
|
if (secondaryInitialSize) {
|
|
247
257
|
secondaryPaneSize = secondaryInitialSize;
|
|
248
|
-
} else {
|
|
258
|
+
} else if (container.current && splitter.current) {
|
|
249
259
|
var containerRect = container.current.getBoundingClientRect();
|
|
250
260
|
var splitterRect = splitter.current.getBoundingClientRect();
|
|
251
261
|
secondaryPaneSize = getSecondaryPaneSize(containerRect, splitterRect, {
|
|
252
262
|
left: containerRect.left + (containerRect.width - splitterRect.width) / 2,
|
|
253
263
|
top: containerRect.top + (containerRect.height - splitterRect.height) / 2
|
|
254
264
|
}, false);
|
|
255
|
-
}
|
|
265
|
+
}
|
|
256
266
|
|
|
267
|
+
secondaryPaneSize = secondaryPaneSize; // TODO: Ao revisar este componente, encontrar solução melhor
|
|
257
268
|
|
|
258
269
|
setState(_extends({}, state, {
|
|
259
270
|
secondaryPaneSize: secondaryPaneSize
|
|
@@ -301,17 +312,17 @@ var Split = function Split(props) {
|
|
|
301
312
|
containerClasses += ' layout-changing';
|
|
302
313
|
}
|
|
303
314
|
|
|
304
|
-
return /*#__PURE__*/_react
|
|
315
|
+
return /*#__PURE__*/_react.default.createElement(_helpers.default.Provider, {
|
|
305
316
|
value: getChildContext()
|
|
306
|
-
}, /*#__PURE__*/_react
|
|
317
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
307
318
|
className: containerClasses,
|
|
308
319
|
style: style,
|
|
309
320
|
ref: function ref(r) {
|
|
310
321
|
container.current = r;
|
|
311
322
|
}
|
|
312
|
-
}, hideSplitSideOnToggleClick === 'primary' ? visibleSplitSide && children[0] : children[0], /*#__PURE__*/_react
|
|
323
|
+
}, hideSplitSideOnToggleClick === 'primary' ? visibleSplitSide && children[0] : children[0], /*#__PURE__*/_react.default.createElement("div", {
|
|
313
324
|
role: "button",
|
|
314
|
-
onKeyPress:
|
|
325
|
+
onKeyPress: undefined,
|
|
315
326
|
tabIndex: -1,
|
|
316
327
|
className: "layout-splitter",
|
|
317
328
|
ref: function ref(r) {
|
|
@@ -325,9 +336,9 @@ var Split = function Split(props) {
|
|
|
325
336
|
onMouseDown: function onMouseDown() {
|
|
326
337
|
handleSplitterMouseDown();
|
|
327
338
|
}
|
|
328
|
-
}, /*#__PURE__*/_react
|
|
339
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
329
340
|
role: "button",
|
|
330
|
-
tabIndex:
|
|
341
|
+
tabIndex: -1,
|
|
331
342
|
onDoubleClick: function onDoubleClick() {
|
|
332
343
|
return state.secondaryPaneSize === 100 ? setState(_extends({}, state, {
|
|
333
344
|
secondaryPaneSize: 50,
|
|
@@ -341,33 +352,5 @@ var Split = function Split(props) {
|
|
|
341
352
|
})), hideSplitSideOnToggleClick === 'secondary' ? visibleSplitSide && children[1] : children[1]));
|
|
342
353
|
};
|
|
343
354
|
|
|
344
|
-
Split.propTypes = {
|
|
345
|
-
style: _propTypes["default"].object,
|
|
346
|
-
customClass: _propTypes["default"].string,
|
|
347
|
-
vertical: _propTypes["default"].bool,
|
|
348
|
-
percentage: _propTypes["default"].bool,
|
|
349
|
-
primaryIndex: _propTypes["default"].number,
|
|
350
|
-
primaryMinSize: _propTypes["default"].number,
|
|
351
|
-
hotKey: _propTypes["default"].bool,
|
|
352
|
-
secondaryInitialSize: _propTypes["default"].number,
|
|
353
|
-
secondaryMinSize: _propTypes["default"].number,
|
|
354
|
-
hideSplitSideOnToggleClick: _propTypes["default"].string,
|
|
355
|
-
onSecondaryPaneSizeChange: _propTypes["default"].func,
|
|
356
|
-
children: _propTypes["default"].arrayOf(_propTypes["default"].node)
|
|
357
|
-
};
|
|
358
|
-
Split.defaultProps = {
|
|
359
|
-
style: {},
|
|
360
|
-
customClass: '',
|
|
361
|
-
vertical: false,
|
|
362
|
-
percentage: false,
|
|
363
|
-
primaryIndex: 0,
|
|
364
|
-
primaryMinSize: 0,
|
|
365
|
-
secondaryInitialSize: undefined,
|
|
366
|
-
secondaryMinSize: 0,
|
|
367
|
-
hideSplitSideOnToggleClick: 'primary',
|
|
368
|
-
onSecondaryPaneSizeChange: null,
|
|
369
|
-
children: [],
|
|
370
|
-
hotKey: false
|
|
371
|
-
};
|
|
372
355
|
var _default = Split;
|
|
373
|
-
exports
|
|
356
|
+
exports.default = _default;
|
package/lib/split/SplitSide.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
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
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
12
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
15
13
|
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
15
|
|
|
18
16
|
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
17
|
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return {
|
|
18
|
+
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
19
|
|
|
22
20
|
var SplitSide = function SplitSide(_ref) {
|
|
23
21
|
var primary = _ref.primary,
|
|
@@ -25,7 +23,7 @@ var SplitSide = function SplitSide(_ref) {
|
|
|
25
23
|
customClass = _ref.customClass,
|
|
26
24
|
style = _ref.style;
|
|
27
25
|
|
|
28
|
-
var _useContext = (0, _react.useContext)(_helpers
|
|
26
|
+
var _useContext = (0, _react.useContext)(_helpers.default),
|
|
29
27
|
size = _useContext.size,
|
|
30
28
|
percentage = _useContext.percentage,
|
|
31
29
|
vertical = _useContext.vertical;
|
|
@@ -45,29 +43,11 @@ var SplitSide = function SplitSide(_ref) {
|
|
|
45
43
|
classes += ' layout-pane-primary';
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
return /*#__PURE__*/_react
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
47
|
className: "".concat(classes, " ").concat(customClass),
|
|
50
48
|
style: Object.assign({}, splitSideStyle, style)
|
|
51
49
|
}, children);
|
|
52
50
|
};
|
|
53
51
|
|
|
54
|
-
SplitSide.propTypes = {
|
|
55
|
-
style: _propTypes["default"].object,
|
|
56
|
-
customClass: _propTypes["default"].string,
|
|
57
|
-
vertical: _propTypes["default"].bool,
|
|
58
|
-
primary: _propTypes["default"].bool,
|
|
59
|
-
size: _propTypes["default"].number,
|
|
60
|
-
percentage: _propTypes["default"].bool,
|
|
61
|
-
children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node])
|
|
62
|
-
};
|
|
63
|
-
SplitSide.defaultProps = {
|
|
64
|
-
style: {},
|
|
65
|
-
customClass: '',
|
|
66
|
-
vertical: false,
|
|
67
|
-
primary: false,
|
|
68
|
-
size: 0,
|
|
69
|
-
percentage: false,
|
|
70
|
-
children: []
|
|
71
|
-
};
|
|
72
52
|
var _default = SplitSide;
|
|
73
|
-
exports
|
|
53
|
+
exports.default = _default;
|
package/lib/split/helpers.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
var SplitContext = /*#__PURE__*/_react
|
|
12
|
+
var SplitContext = /*#__PURE__*/_react.default.createContext({});
|
|
13
13
|
|
|
14
14
|
var _default = SplitContext;
|
|
15
|
-
exports
|
|
15
|
+
exports.default = _default;
|
package/lib/split/index.js
CHANGED
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "SplitSide", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return _SplitSide
|
|
9
|
+
return _SplitSide.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
exports
|
|
12
|
+
exports.default = void 0;
|
|
13
13
|
|
|
14
14
|
require("../assets/styles/split.scss");
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@ var _Split = _interopRequireDefault(require("./Split"));
|
|
|
17
17
|
|
|
18
18
|
var _SplitSide = _interopRequireDefault(require("./SplitSide"));
|
|
19
19
|
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
-
var _default = _Split
|
|
23
|
-
exports
|
|
22
|
+
var _default = _Split.default;
|
|
23
|
+
exports.default = _default;
|
package/lib/split/split.spec.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
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
4
|
|
|
5
|
-
var _react = require("
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
6
|
|
|
7
|
-
var _react2 =
|
|
7
|
+
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
9
|
require("babel-polyfill");
|
|
10
10
|
|
|
@@ -14,54 +14,56 @@ var _ = _interopRequireWildcard(require("."));
|
|
|
14
14
|
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
|
|
17
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return {
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
18
|
|
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
20
22
|
|
|
21
23
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
22
24
|
|
|
23
25
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
24
26
|
|
|
25
|
-
function _extends() { _extends = Object.assign
|
|
27
|
+
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); }
|
|
26
28
|
|
|
27
29
|
var splitMockRender = function splitMockRender(props, propsSplitSide) {
|
|
28
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
31
|
style: {
|
|
30
32
|
height: '600px',
|
|
31
33
|
width: '500px',
|
|
32
34
|
marginTop: '2px',
|
|
33
35
|
border: '1px solid #a8a8a8'
|
|
34
36
|
}
|
|
35
|
-
}, /*#__PURE__*/
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
36
38
|
percentage: true,
|
|
37
39
|
secondaryInitialSize: 50
|
|
38
|
-
}, props), /*#__PURE__*/
|
|
40
|
+
}, props), /*#__PURE__*/_react.default.createElement(_.SplitSide, _extends({
|
|
39
41
|
style: {
|
|
40
42
|
backgroundColor: '#5bcc65',
|
|
41
43
|
color: '#fff',
|
|
42
44
|
fontSize: '13px'
|
|
43
45
|
},
|
|
44
46
|
primary: true
|
|
45
|
-
}, propsSplitSide), /*#__PURE__*/
|
|
47
|
+
}, propsSplitSide), /*#__PURE__*/_react.default.createElement("p", null, "Aliquam at mauris porta libero mattis convallis et posuere leo. Vivamus vehicula libero lacus, ac molestie mi varius eu. Nam vel libero odio. Nulla sollicitudin dignissim pellentesque. Praesent eleifend tortor ac dapibus efficitur. Nunc eleifend augue vel laoreet rutrum.")), /*#__PURE__*/_react.default.createElement(_.SplitSide, {
|
|
46
48
|
style: {
|
|
47
49
|
backgroundColor: '#8a2c75',
|
|
48
50
|
color: '#fff',
|
|
49
51
|
fontSize: '13px'
|
|
50
52
|
}
|
|
51
|
-
}, /*#__PURE__*/
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, "Painel 01 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam a orci ac diam pharetra viverra sit amet eget arcu. Ut sit amet efficitur elit. Suspendisse pulvinar pulvinar lectus ac malesuada. Curabitur ac dictum elit. Nam lectus ex, suscipit nec aliquet vel, molestie. Nullam commodo dui viverra sem hendrerit, eget iaculis nisi commodo."))));
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
describe('Split', function () {
|
|
55
57
|
describe('Default', function () {
|
|
56
58
|
it('should apply secondaryInitialSize with 50%', function () {
|
|
57
|
-
var _render = (0,
|
|
59
|
+
var _render = (0, _react2.render)(splitMockRender({}, {})),
|
|
58
60
|
container = _render.container;
|
|
59
61
|
|
|
60
62
|
var secondSplit = container.querySelectorAll('.layout-pane')[1];
|
|
61
63
|
expect(secondSplit).toHaveStyle('width: 50%');
|
|
62
64
|
});
|
|
63
65
|
it('should apply SplitSide style from props', function () {
|
|
64
|
-
var _render2 = (0,
|
|
66
|
+
var _render2 = (0, _react2.render)(splitMockRender({}, {})),
|
|
65
67
|
container = _render2.container;
|
|
66
68
|
|
|
67
69
|
var secondSplit = container.querySelectorAll('.layout-pane')[1];
|
|
@@ -70,73 +72,88 @@ describe('Split', function () {
|
|
|
70
72
|
expect(secondSplit).toHaveStyle('fontSize: 13px');
|
|
71
73
|
});
|
|
72
74
|
it('should apply customClass', function () {
|
|
73
|
-
var _render3 = (0,
|
|
75
|
+
var _render3 = (0, _react2.render)(splitMockRender({
|
|
74
76
|
customClass: 'customClass'
|
|
75
|
-
})),
|
|
77
|
+
}, {})),
|
|
76
78
|
container = _render3.container;
|
|
77
79
|
|
|
78
80
|
var split = container.querySelector('.split-component');
|
|
79
81
|
expect(split).toHaveClass('customClass');
|
|
80
82
|
});
|
|
81
83
|
it('should apply style', function () {
|
|
82
|
-
var _render4 = (0,
|
|
84
|
+
var _render4 = (0, _react2.render)(splitMockRender({
|
|
83
85
|
style: {
|
|
84
86
|
color: '#8a2c75'
|
|
85
87
|
}
|
|
86
|
-
})),
|
|
88
|
+
}, {})),
|
|
87
89
|
container = _render4.container;
|
|
88
90
|
|
|
89
91
|
var split = container.querySelector('.split-component');
|
|
90
92
|
expect(split).toHaveStyle('color: #8a2c75');
|
|
91
93
|
});
|
|
92
94
|
it('should use pixels for width', function () {
|
|
93
|
-
var _render5 = (0,
|
|
95
|
+
var _render5 = (0, _react2.render)(splitMockRender({
|
|
94
96
|
percentage: false
|
|
95
|
-
})),
|
|
97
|
+
}, {})),
|
|
96
98
|
container = _render5.container;
|
|
97
99
|
|
|
98
100
|
var secondSplit = container.querySelectorAll('.layout-pane')[1];
|
|
99
101
|
expect(secondSplit).toHaveStyle('width: 50px');
|
|
100
102
|
});
|
|
101
103
|
it('should apply class for vertical', function () {
|
|
102
|
-
var _render6 = (0,
|
|
104
|
+
var _render6 = (0, _react2.render)(splitMockRender({
|
|
103
105
|
vertical: true
|
|
104
|
-
})),
|
|
106
|
+
}, {})),
|
|
105
107
|
container = _render6.container;
|
|
106
108
|
|
|
107
|
-
|
|
109
|
+
var firstChildSplit = container.firstChild;
|
|
110
|
+
expect(firstChildSplit.firstChild).toHaveClass('splitter-layout-vertical');
|
|
111
|
+
});
|
|
112
|
+
it('should show first panel', function () {
|
|
113
|
+
var _render7 = (0, _react2.render)(splitMockRender({}, {})),
|
|
114
|
+
container = _render7.container;
|
|
115
|
+
|
|
116
|
+
var layoutSpliter = container.querySelector('.toggler-horizontal');
|
|
117
|
+
|
|
118
|
+
_react2.fireEvent.doubleClick(layoutSpliter);
|
|
119
|
+
|
|
120
|
+
_react2.fireEvent.doubleClick(layoutSpliter);
|
|
121
|
+
|
|
122
|
+
var element = container.querySelectorAll('.layout-pane')[1];
|
|
123
|
+
expect(element.style.width).toBe('50%');
|
|
108
124
|
});
|
|
109
|
-
it('should hide first panel', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
110
|
-
var
|
|
125
|
+
it('should hide first panel', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
126
|
+
var _render8, container, layoutSpliter, element;
|
|
111
127
|
|
|
112
|
-
return
|
|
128
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
113
129
|
while (1) {
|
|
114
130
|
switch (_context.prev = _context.next) {
|
|
115
131
|
case 0:
|
|
116
|
-
|
|
132
|
+
_render8 = (0, _react2.render)(splitMockRender({}, {})), container = _render8.container;
|
|
117
133
|
layoutSpliter = container.querySelector('.toggler-horizontal');
|
|
118
134
|
|
|
119
|
-
|
|
135
|
+
_react2.fireEvent.doubleClick(layoutSpliter);
|
|
120
136
|
|
|
121
|
-
|
|
137
|
+
element = container.querySelectorAll('.layout-pane')[1];
|
|
138
|
+
expect(element.style.width).toBe('100%');
|
|
122
139
|
|
|
123
|
-
case
|
|
140
|
+
case 5:
|
|
124
141
|
case "end":
|
|
125
142
|
return _context.stop();
|
|
126
143
|
}
|
|
127
144
|
}
|
|
128
145
|
}, _callee);
|
|
129
146
|
})));
|
|
130
|
-
it('should apply splitSide customClass', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
131
|
-
var
|
|
147
|
+
it('should apply splitSide customClass', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
148
|
+
var _render9, container, secondSplit;
|
|
132
149
|
|
|
133
|
-
return
|
|
150
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
134
151
|
while (1) {
|
|
135
152
|
switch (_context2.prev = _context2.next) {
|
|
136
153
|
case 0:
|
|
137
|
-
|
|
154
|
+
_render9 = (0, _react2.render)(splitMockRender({}, {
|
|
138
155
|
customClass: 'customClass'
|
|
139
|
-
})), container =
|
|
156
|
+
})), container = _render9.container;
|
|
140
157
|
secondSplit = container.querySelectorAll('.layout-pane')[0];
|
|
141
158
|
expect(secondSplit).toHaveClass('customClass');
|
|
142
159
|
|