linear-react-components-ui 0.4.77-beta.23 → 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 +4 -2
- 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 +28 -26
- package/lib/alerts/AlertProvider.js +29 -24
- package/lib/alerts/BaseAlert.js +22 -15
- package/lib/alerts/Message.js +41 -50
- package/lib/alerts/alert.spec.js +15 -11
- package/lib/alerts/helpers.js +4 -7
- package/lib/alerts/index.js +6 -6
- package/lib/alerts/types.js +5 -0
- package/lib/alerts/withAlert.js +10 -12
- 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 +10 -12
- package/lib/avatar/avatar.spec.js +30 -28
- package/lib/avatar/index.js +24 -69
- package/lib/avatar/types.js +5 -0
- package/lib/badge/badge.spec.js +6 -6
- package/lib/badge/index.js +12 -28
- package/lib/badge/types.js +5 -0
- package/lib/buttons/ActivateButton.js +8 -8
- package/lib/buttons/AddButton.js +8 -8
- package/lib/buttons/Button.js +22 -14
- package/lib/buttons/ButtonGroups.js +4 -9
- package/lib/buttons/CancelButton.js +20 -7
- package/lib/buttons/DangerButton.js +18 -23
- package/lib/buttons/DefaultButton.js +91 -145
- package/lib/buttons/DestroyButton.js +18 -9
- package/lib/buttons/EditButton.js +8 -8
- package/lib/buttons/InactivateButton.js +8 -8
- package/lib/buttons/InfoButton.js +18 -23
- package/lib/buttons/PrimaryButton.js +18 -23
- package/lib/buttons/RestoreButton.js +8 -8
- package/lib/buttons/SaveButton.js +19 -6
- package/lib/buttons/SuccessButton.js +17 -22
- package/lib/buttons/WarningButton.js +17 -22
- package/lib/buttons/button_container/index.js +12 -25
- package/lib/buttons/buttons.spec.js +52 -52
- package/lib/buttons/index.js +33 -33
- package/lib/buttons/split_button/index.js +9 -46
- package/lib/buttons/types.js +5 -0
- package/lib/calendar/DangerCalendar.js +17 -8
- package/lib/calendar/InfoCalendar.js +17 -8
- package/lib/calendar/PrimaryCalendar.js +17 -8
- package/lib/calendar/SuccessCalendar.js +17 -8
- package/lib/calendar/WarningCalendar.js +17 -8
- package/lib/calendar/base/Day.js +9 -15
- package/lib/calendar/base/Month.js +19 -14
- package/lib/calendar/base/Week.js +19 -15
- package/lib/calendar/base/helpers.js +16 -16
- package/lib/calendar/base/index.js +58 -51
- package/lib/calendar/calendar.spec.js +27 -25
- package/lib/calendar/index.js +15 -15
- package/lib/calendar/types.js +5 -0
- package/lib/checkbox/Label.js +8 -18
- package/lib/checkbox/checkbox.spec.js +34 -33
- package/lib/checkbox/index.js +67 -94
- package/lib/checkbox/types.js +5 -0
- package/lib/dialog/Alert.js +11 -16
- package/lib/dialog/Custom.js +26 -34
- package/lib/dialog/Error.js +9 -14
- package/lib/dialog/Information.js +9 -14
- package/lib/dialog/Question.js +16 -27
- package/lib/dialog/Warning.js +9 -14
- package/lib/dialog/base/Content.js +5 -14
- package/lib/dialog/base/Footer.js +6 -12
- package/lib/dialog/base/Header.js +17 -31
- package/lib/dialog/base/index.js +14 -36
- package/lib/dialog/base/style.js +2 -2
- package/lib/dialog/dialog.spec.js +42 -38
- package/lib/dialog/form/index.js +37 -47
- package/lib/dialog/index.js +16 -16
- package/lib/dialog/types.js +5 -0
- package/lib/drawer/Content.js +8 -17
- package/lib/drawer/Drawer.js +50 -61
- package/lib/drawer/Drawer.spec.js +35 -32
- package/lib/drawer/Header.js +29 -48
- package/lib/drawer/helpers.js +5 -5
- package/lib/drawer/index.js +9 -9
- package/lib/drawer/types.js +5 -0
- package/lib/dropdown/Popup.js +35 -21
- package/lib/dropdown/dropdown.spec.js +41 -29
- package/lib/dropdown/helper.js +2 -2
- package/lib/dropdown/types.js +5 -0
- package/lib/dropdown/withDropdown.js +34 -51
- package/lib/fieldset/fieldset.spec.js +5 -5
- package/lib/fieldset/index.js +34 -55
- package/lib/fieldset/types.js +5 -0
- package/lib/form/Field.js +40 -30
- package/lib/form/FieldArray.js +31 -31
- package/lib/form/FieldNumber.js +18 -18
- package/lib/form/FieldPeriod.js +25 -25
- package/lib/form/form.spec.js +25 -23
- package/lib/form/helpers.js +24 -13
- package/lib/form/index.js +72 -55
- package/lib/form/withFieldHOC.js +38 -32
- package/lib/form/withFormSecurity.js +32 -19
- package/lib/gridlayout/GridCol.js +8 -23
- package/lib/gridlayout/GridRow.js +9 -29
- package/lib/gridlayout/gridLayout.spec.js +8 -8
- package/lib/gridlayout/index.js +6 -6
- package/lib/gridlayout/types.js +5 -0
- package/lib/icons/helper.js +560 -563
- package/lib/icons/icons.spec.js +12 -12
- package/lib/icons/index.js +29 -46
- package/lib/icons/types.js +5 -0
- package/lib/index.js +18 -18
- package/lib/inputs/base/InputTextBase.js +58 -157
- package/lib/inputs/base/base.spec.js +39 -38
- package/lib/inputs/base/helpers.js +10 -10
- package/lib/inputs/base/types.js +5 -0
- package/lib/inputs/color/color_input.spec.js +10 -10
- package/lib/inputs/color/index.js +55 -43
- package/lib/inputs/color/types.js +5 -0
- package/lib/inputs/date/Dialog.js +5 -12
- package/lib/inputs/date/Dropdown.js +21 -63
- package/lib/inputs/date/date.spec.js +12 -14
- package/lib/inputs/date/helpers.js +6 -6
- package/lib/inputs/date/index.js +265 -415
- package/lib/inputs/date/types.js +5 -0
- package/lib/inputs/inputHOC.js +53 -99
- package/lib/inputs/mask/BaseMask.js +14 -25
- package/lib/inputs/mask/Cnpj.js +33 -32
- package/lib/inputs/mask/Cpf.js +33 -34
- package/lib/inputs/mask/Phone.js +7 -15
- package/lib/inputs/mask/ZipCode.js +7 -7
- package/lib/inputs/mask/helpers.js +25 -40
- package/lib/inputs/mask/imaskHOC.js +190 -251
- package/lib/inputs/mask/index.js +11 -11
- package/lib/inputs/mask/input_mask.spec.js +103 -126
- package/lib/inputs/mask/types.js +5 -0
- package/lib/inputs/multiSelect/ActionButtons.js +10 -22
- package/lib/inputs/multiSelect/Dropdown.js +76 -93
- package/lib/inputs/multiSelect/helper.js +2 -2
- package/lib/inputs/multiSelect/index.js +97 -104
- package/lib/inputs/multiSelect/types.js +5 -0
- package/lib/inputs/number/BaseNumber.js +18 -30
- package/lib/inputs/number/Currency.js +10 -20
- package/lib/inputs/number/Decimal.js +5 -5
- package/lib/inputs/number/format_number.js +1 -1
- package/lib/inputs/number/index.js +16 -22
- package/lib/inputs/number/numberfield.spec.js +9 -8
- package/lib/inputs/number/types.js +5 -0
- package/lib/inputs/period/Dialog.js +5 -12
- package/lib/inputs/period/Dropdown.js +19 -63
- package/lib/inputs/period/PeriodList.js +12 -25
- package/lib/inputs/period/helper.js +34 -74
- package/lib/inputs/period/index.js +156 -198
- package/lib/inputs/period/types.js +5 -0
- package/lib/inputs/search/index.js +150 -263
- package/lib/inputs/search/search_input.spec.js +19 -13
- package/lib/inputs/select/ActionButtons.js +20 -26
- package/lib/inputs/select/Dropdown.js +59 -82
- package/lib/inputs/select/helper.js +19 -15
- package/lib/inputs/select/index.js +22 -20
- package/lib/inputs/select/multiple/Selecteds.js +9 -17
- package/lib/inputs/select/multiple/index.js +299 -408
- package/lib/inputs/select/select.spec.js +71 -54
- package/lib/inputs/select/simple/index.js +310 -457
- package/lib/inputs/select/types.js +5 -0
- package/lib/inputs/text/index.js +6 -5
- package/lib/inputs/text/textfield.spec.js +7 -7
- package/lib/inputs/text/types.js +5 -0
- package/lib/inputs/textarea/index.js +11 -21
- package/lib/inputs/textarea/textarea.spec.js +7 -7
- 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 +50 -48
- package/lib/labelMessages/index.js +48 -56
- package/lib/labelMessages/labelMessages.spec.js +17 -17
- package/lib/labelMessages/types.js +5 -0
- package/lib/labels/DangerLabel.js +18 -9
- package/lib/labels/DefaultLabel.js +44 -66
- package/lib/labels/InfoLabel.js +18 -9
- package/lib/labels/PrimaryLabel.js +18 -9
- package/lib/labels/SuccessLabel.js +18 -9
- package/lib/labels/WarningLabel.js +18 -9
- package/lib/labels/index.js +16 -16
- package/lib/labels/label.spec.js +20 -20
- 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 +54 -84
- package/lib/list/Separator.js +5 -5
- package/lib/list/helpers.js +6 -11
- package/lib/list/index.js +45 -123
- package/lib/list/list.spec.js +102 -131
- package/lib/list/types.js +5 -0
- package/lib/menus/float/MenuItem.js +18 -38
- package/lib/menus/float/float-menu.spec.js +39 -33
- package/lib/menus/float/helpers.js +5 -5
- package/lib/menus/float/index.js +18 -38
- package/lib/menus/float/types.js +5 -0
- package/lib/menus/index.js +5 -5
- package/lib/menus/sidenav/ExpandMenu.js +7 -19
- package/lib/menus/sidenav/MenuLink.js +6 -20
- package/lib/menus/sidenav/NavMenuGroup.js +6 -17
- package/lib/menus/sidenav/NavMenuItem.js +46 -62
- package/lib/menus/sidenav/NavSubMenuItem.js +23 -24
- package/lib/menus/sidenav/helpers.js +6 -6
- package/lib/menus/sidenav/index.js +71 -83
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +10 -19
- package/lib/menus/sidenav/popup_menu_search/index.js +41 -28
- package/lib/menus/sidenav/sidenav.spec.js +30 -26
- package/lib/menus/sidenav/types.js +5 -0
- package/lib/noPermission/index.js +8 -8
- package/lib/panel/Content.js +15 -27
- package/lib/panel/DangerPanel.js +8 -8
- package/lib/panel/Default.js +40 -57
- package/lib/panel/Header.js +19 -41
- package/lib/panel/InfoPanel.js +8 -8
- package/lib/panel/PrimaryPanel.js +8 -8
- package/lib/panel/SuccessPanel.js +8 -8
- package/lib/panel/ToolBar.js +5 -10
- package/lib/panel/WarningPanel.js +8 -8
- package/lib/panel/helpers.js +10 -6
- package/lib/panel/index.js +19 -19
- package/lib/panel/panel.spec.js +30 -30
- 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 +18 -18
- package/lib/popover/types.js +5 -0
- package/lib/progress/Bar.js +42 -52
- package/lib/progress/index.js +19 -27
- package/lib/progress/progress.spec.js +25 -17
- package/lib/progress/types.js +5 -0
- package/lib/radio/index.js +44 -58
- package/lib/radio/radio.spec.js +22 -20
- package/lib/radio/types.js +5 -0
- package/lib/skeleton/SkeletonContainer.js +9 -9
- package/lib/skeleton/index.js +18 -18
- package/lib/spinner/SpinnerLoading.js +45 -53
- package/lib/spinner/index.js +42 -37
- package/lib/spinner/spinner.spec.js +14 -10
- package/lib/spinner/types.js +5 -0
- package/lib/split/Split.js +83 -90
- package/lib/split/SplitSide.js +8 -28
- package/lib/split/helpers.js +5 -5
- package/lib/split/index.js +6 -6
- package/lib/split/split.spec.js +57 -40
- package/lib/split/types.js +5 -0
- package/lib/table/Body.js +25 -32
- package/lib/table/Header.js +19 -26
- package/lib/table/HeaderColumn.js +14 -28
- package/lib/table/Row.js +23 -39
- package/lib/table/RowColumn.js +23 -41
- package/lib/table/helpers.js +6 -6
- package/lib/table/index.js +45 -71
- package/lib/table/table.spec.js +52 -51
- package/lib/table/types.js +5 -0
- package/lib/tabs/DropdownItems.js +21 -31
- package/lib/tabs/Menu.js +22 -26
- package/lib/tabs/MenuItems.js +33 -47
- package/lib/tabs/Panel.js +37 -60
- package/lib/tabs/index.js +125 -99
- package/lib/tabs/tabHelpers.js +13 -11
- package/lib/tabs/tabs.spec.js +76 -111
- package/lib/tabs/types.js +5 -0
- package/lib/toolbar/ButtonBar.js +54 -35
- package/lib/toolbar/LabelBar.js +45 -32
- package/lib/toolbar/Separator.js +5 -5
- package/lib/toolbar/ToolBarGroup.js +10 -16
- package/lib/toolbar/helpers.js +3 -3
- package/lib/toolbar/index.js +35 -40
- package/lib/toolbar/toolbar.spec.js +42 -42
- package/lib/toolbar/types.js +5 -0
- package/lib/tooltip/index.js +35 -44
- package/lib/tooltip/tooltip.spec.js +42 -23
- 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 +32 -53
- package/lib/treetable/index.js +16 -104
- package/lib/treetable/types.d.js +5 -0
- package/lib/treeview/Header.js +5 -17
- package/lib/treeview/Node.js +268 -390
- package/lib/treeview/constants.js +3 -3
- package/lib/treeview/index.js +379 -555
- package/lib/treeview/treeview.spec.js +38 -28
- package/lib/treeview/types.js +5 -0
- package/lib/treeview_old/Header.js +8 -8
- package/lib/treeview_old/Node.js +38 -32
- package/lib/treeview_old/index.js +10 -10
- package/lib/uitour/helpers.js +1 -1
- package/lib/uitour/index.js +53 -41
- package/lib/uitour/uitour.spec.js +22 -22
- 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/treetable/TRow.js +0 -255
- package/lib/treetable/treetable.spec.js +0 -302
package/lib/split/Split.js
CHANGED
|
@@ -1,53 +1,69 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/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); }
|
|
6
4
|
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
exports
|
|
11
|
-
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
|
+
exports.default = void 0;
|
|
15
9
|
|
|
16
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
11
|
|
|
18
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
-
|
|
20
12
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
21
13
|
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
22
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); }
|
|
23
17
|
|
|
24
|
-
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; }
|
|
19
|
+
|
|
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); }
|
|
21
|
+
|
|
22
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
+
|
|
24
|
+
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
|
+
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 _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; }
|
|
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
|
+
|
|
32
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
|
|
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;
|
|
25
54
|
|
|
26
|
-
var Split = function Split(props) {
|
|
27
55
|
var _useState = (0, _react.useState)({
|
|
28
56
|
secondaryPaneSize: 0,
|
|
29
57
|
resizing: false,
|
|
30
58
|
visibleSplitSide: true,
|
|
31
59
|
isHidePane: true
|
|
32
60
|
}),
|
|
33
|
-
_useState2 = (
|
|
61
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
62
|
state = _useState2[0],
|
|
35
63
|
setState = _useState2[1];
|
|
36
64
|
|
|
37
65
|
var container = (0, _react.useRef)();
|
|
38
66
|
var splitter = (0, _react.useRef)();
|
|
39
|
-
var hotKey = props.hotKey,
|
|
40
|
-
secondaryInitialSize = props.secondaryInitialSize,
|
|
41
|
-
onSecondaryPaneSizeChange = props.onSecondaryPaneSizeChange,
|
|
42
|
-
vertical = props.vertical,
|
|
43
|
-
primaryIndex = props.primaryIndex,
|
|
44
|
-
percentage = props.percentage,
|
|
45
|
-
primaryMinSize = props.primaryMinSize,
|
|
46
|
-
secondaryMinSize = props.secondaryMinSize,
|
|
47
|
-
customClass = props.customClass,
|
|
48
|
-
children = props.children,
|
|
49
|
-
hideSplitSideOnToggleClick = props.hideSplitSideOnToggleClick,
|
|
50
|
-
style = props.style;
|
|
51
67
|
|
|
52
68
|
var getSecondaryPaneSize = function getSecondaryPaneSize(containerRect, splitterRect, clientPosition, offsetMouse) {
|
|
53
69
|
var totalSize = vertical ? containerRect.height : containerRect.width;
|
|
@@ -85,37 +101,41 @@ var Split = function Split(props) {
|
|
|
85
101
|
};
|
|
86
102
|
|
|
87
103
|
var clearSelection = function clearSelection() {
|
|
88
|
-
|
|
89
|
-
|
|
104
|
+
var docuemntSelection = Selection;
|
|
105
|
+
|
|
106
|
+
if (document.createRange() && nodeParameter) {
|
|
107
|
+
var range = document.createRange();
|
|
90
108
|
range.collapse();
|
|
91
|
-
range.
|
|
109
|
+
range.selectNode(nodeParameter);
|
|
92
110
|
} else if (window.getSelection) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
111
|
+
var selection = window.getSelection();
|
|
112
|
+
|
|
113
|
+
if (selection && selection.empty) {
|
|
114
|
+
selection.empty();
|
|
115
|
+
} else if (selection && selection.removeAllRanges) {
|
|
116
|
+
selection.removeAllRanges();
|
|
97
117
|
}
|
|
98
|
-
} else if (
|
|
99
|
-
|
|
118
|
+
} else if (docuemntSelection) {
|
|
119
|
+
docuemntSelection.empty();
|
|
100
120
|
}
|
|
101
121
|
};
|
|
102
122
|
|
|
103
123
|
var handleResize = function handleResize() {
|
|
104
|
-
if (splitter.current && !percentage) {
|
|
124
|
+
if (container.current && splitter.current && !percentage) {
|
|
105
125
|
var containerRect = container.current.getBoundingClientRect();
|
|
106
126
|
var splitterRect = splitter.current.getBoundingClientRect();
|
|
107
127
|
var secondaryPaneSize = getSecondaryPaneSize(containerRect, splitterRect, {
|
|
108
128
|
left: splitterRect.left,
|
|
109
129
|
top: splitterRect.top
|
|
110
130
|
}, false);
|
|
111
|
-
setState((
|
|
131
|
+
setState(_extends({}, state, {
|
|
112
132
|
secondaryPaneSize: secondaryPaneSize
|
|
113
133
|
}));
|
|
114
134
|
}
|
|
115
135
|
};
|
|
116
136
|
|
|
117
137
|
var handleMouseMove = function handleMouseMove(e) {
|
|
118
|
-
if (state.resizing) {
|
|
138
|
+
if (container.current && splitter.current && state.resizing) {
|
|
119
139
|
var containerRect = container.current.getBoundingClientRect();
|
|
120
140
|
var splitterRect = splitter.current.getBoundingClientRect();
|
|
121
141
|
var secondaryPaneSize = getSecondaryPaneSize(containerRect, splitterRect, {
|
|
@@ -123,7 +143,7 @@ var Split = function Split(props) {
|
|
|
123
143
|
top: e.clientY
|
|
124
144
|
}, true);
|
|
125
145
|
clearSelection();
|
|
126
|
-
setState((
|
|
146
|
+
setState(_extends({}, state, {
|
|
127
147
|
secondaryPaneSize: secondaryPaneSize
|
|
128
148
|
}));
|
|
129
149
|
}
|
|
@@ -131,7 +151,7 @@ var Split = function Split(props) {
|
|
|
131
151
|
|
|
132
152
|
var handleSplitterMouseDown = function handleSplitterMouseDown() {
|
|
133
153
|
clearSelection();
|
|
134
|
-
setState((
|
|
154
|
+
setState(_extends({}, state, {
|
|
135
155
|
resizing: true
|
|
136
156
|
}));
|
|
137
157
|
};
|
|
@@ -149,20 +169,20 @@ var Split = function Split(props) {
|
|
|
149
169
|
visibleSplitSide = state.visibleSplitSide;
|
|
150
170
|
|
|
151
171
|
if (event.ctrlKey) {
|
|
152
|
-
setState((
|
|
172
|
+
setState(_extends({}, state, {
|
|
153
173
|
visibleSplitSide: false
|
|
154
174
|
}));
|
|
155
175
|
|
|
156
176
|
switch (keyCode) {
|
|
157
177
|
case arrow.left:
|
|
158
178
|
if (isHidePane) {
|
|
159
|
-
setState((
|
|
179
|
+
setState(_extends({}, state, {
|
|
160
180
|
visibleSplitSide: !visibleSplitSide,
|
|
161
181
|
secondaryPaneSize: 100,
|
|
162
182
|
isHidePane: false
|
|
163
183
|
}));
|
|
164
|
-
} else {
|
|
165
|
-
setState((
|
|
184
|
+
} else if (state.secondaryPaneSize) {
|
|
185
|
+
setState(_extends({}, state, {
|
|
166
186
|
visibleSplitSide: !visibleSplitSide,
|
|
167
187
|
secondaryPaneSize: secondaryPaneValue,
|
|
168
188
|
isHidePane: true
|
|
@@ -173,13 +193,13 @@ var Split = function Split(props) {
|
|
|
173
193
|
|
|
174
194
|
case arrow.right:
|
|
175
195
|
if (isHidePane) {
|
|
176
|
-
setState((
|
|
196
|
+
setState(_extends({}, state, {
|
|
177
197
|
visibleSplitSide: !visibleSplitSide,
|
|
178
198
|
secondaryPaneSize: 0,
|
|
179
199
|
isHidePane: false
|
|
180
200
|
}));
|
|
181
201
|
} else {
|
|
182
|
-
setState((
|
|
202
|
+
setState(_extends({}, state, {
|
|
183
203
|
visibleSplitSide: !visibleSplitSide,
|
|
184
204
|
secondaryPaneSize: secondaryPaneValue,
|
|
185
205
|
isHidePane: true
|
|
@@ -190,13 +210,13 @@ var Split = function Split(props) {
|
|
|
190
210
|
|
|
191
211
|
case arrow.up:
|
|
192
212
|
if (isHidePane) {
|
|
193
|
-
setState((
|
|
213
|
+
setState(_extends({}, state, {
|
|
194
214
|
visibleSplitSide: !visibleSplitSide,
|
|
195
215
|
secondaryPaneSize: 100,
|
|
196
216
|
isHidePane: false
|
|
197
217
|
}));
|
|
198
218
|
} else {
|
|
199
|
-
setState((
|
|
219
|
+
setState(_extends({}, state, {
|
|
200
220
|
visibleSplitSide: !visibleSplitSide,
|
|
201
221
|
secondaryPaneSize: secondaryPaneValue,
|
|
202
222
|
isHidePane: true
|
|
@@ -207,13 +227,13 @@ var Split = function Split(props) {
|
|
|
207
227
|
|
|
208
228
|
case arrow.down:
|
|
209
229
|
if (isHidePane) {
|
|
210
|
-
setState((
|
|
230
|
+
setState(_extends({}, state, {
|
|
211
231
|
visibleSplitSide: !visibleSplitSide,
|
|
212
232
|
secondaryPaneSize: 0,
|
|
213
233
|
isHidePane: false
|
|
214
234
|
}));
|
|
215
235
|
} else {
|
|
216
|
-
setState((
|
|
236
|
+
setState(_extends({}, state, {
|
|
217
237
|
visibleSplitSide: !visibleSplitSide,
|
|
218
238
|
secondaryPaneSize: secondaryPaneValue,
|
|
219
239
|
isHidePane: true
|
|
@@ -235,17 +255,18 @@ var Split = function Split(props) {
|
|
|
235
255
|
|
|
236
256
|
if (secondaryInitialSize) {
|
|
237
257
|
secondaryPaneSize = secondaryInitialSize;
|
|
238
|
-
} else {
|
|
258
|
+
} else if (container.current && splitter.current) {
|
|
239
259
|
var containerRect = container.current.getBoundingClientRect();
|
|
240
260
|
var splitterRect = splitter.current.getBoundingClientRect();
|
|
241
261
|
secondaryPaneSize = getSecondaryPaneSize(containerRect, splitterRect, {
|
|
242
262
|
left: containerRect.left + (containerRect.width - splitterRect.width) / 2,
|
|
243
263
|
top: containerRect.top + (containerRect.height - splitterRect.height) / 2
|
|
244
264
|
}, false);
|
|
245
|
-
}
|
|
265
|
+
}
|
|
246
266
|
|
|
267
|
+
secondaryPaneSize = secondaryPaneSize; // TODO: Ao revisar este componente, encontrar solução melhor
|
|
247
268
|
|
|
248
|
-
setState((
|
|
269
|
+
setState(_extends({}, state, {
|
|
249
270
|
secondaryPaneSize: secondaryPaneSize
|
|
250
271
|
}));
|
|
251
272
|
return function () {
|
|
@@ -291,38 +312,38 @@ var Split = function Split(props) {
|
|
|
291
312
|
containerClasses += ' layout-changing';
|
|
292
313
|
}
|
|
293
314
|
|
|
294
|
-
return /*#__PURE__*/_react
|
|
315
|
+
return /*#__PURE__*/_react.default.createElement(_helpers.default.Provider, {
|
|
295
316
|
value: getChildContext()
|
|
296
|
-
}, /*#__PURE__*/_react
|
|
317
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
297
318
|
className: containerClasses,
|
|
298
319
|
style: style,
|
|
299
320
|
ref: function ref(r) {
|
|
300
321
|
container.current = r;
|
|
301
322
|
}
|
|
302
|
-
}, hideSplitSideOnToggleClick === 'primary' ? visibleSplitSide && children[0] : children[0], /*#__PURE__*/_react
|
|
323
|
+
}, hideSplitSideOnToggleClick === 'primary' ? visibleSplitSide && children[0] : children[0], /*#__PURE__*/_react.default.createElement("div", {
|
|
303
324
|
role: "button",
|
|
304
|
-
onKeyPress:
|
|
325
|
+
onKeyPress: undefined,
|
|
305
326
|
tabIndex: -1,
|
|
306
327
|
className: "layout-splitter",
|
|
307
328
|
ref: function ref(r) {
|
|
308
329
|
splitter.current = r;
|
|
309
330
|
},
|
|
310
331
|
onMouseUp: function onMouseUp() {
|
|
311
|
-
return setState((
|
|
332
|
+
return setState(_extends({}, state, {
|
|
312
333
|
resizing: false
|
|
313
334
|
}));
|
|
314
335
|
},
|
|
315
336
|
onMouseDown: function onMouseDown() {
|
|
316
337
|
handleSplitterMouseDown();
|
|
317
338
|
}
|
|
318
|
-
}, /*#__PURE__*/_react
|
|
339
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
319
340
|
role: "button",
|
|
320
|
-
tabIndex:
|
|
341
|
+
tabIndex: -1,
|
|
321
342
|
onDoubleClick: function onDoubleClick() {
|
|
322
|
-
return state.secondaryPaneSize === 100 ? setState((
|
|
343
|
+
return state.secondaryPaneSize === 100 ? setState(_extends({}, state, {
|
|
323
344
|
secondaryPaneSize: 50,
|
|
324
345
|
resizing: false
|
|
325
|
-
})) : setState((
|
|
346
|
+
})) : setState(_extends({}, state, {
|
|
326
347
|
secondaryPaneSize: 100,
|
|
327
348
|
resizing: false
|
|
328
349
|
}));
|
|
@@ -331,33 +352,5 @@ var Split = function Split(props) {
|
|
|
331
352
|
})), hideSplitSideOnToggleClick === 'secondary' ? visibleSplitSide && children[1] : children[1]));
|
|
332
353
|
};
|
|
333
354
|
|
|
334
|
-
Split.propTypes = {
|
|
335
|
-
style: _propTypes["default"].object,
|
|
336
|
-
customClass: _propTypes["default"].string,
|
|
337
|
-
vertical: _propTypes["default"].bool,
|
|
338
|
-
percentage: _propTypes["default"].bool,
|
|
339
|
-
primaryIndex: _propTypes["default"].number,
|
|
340
|
-
primaryMinSize: _propTypes["default"].number,
|
|
341
|
-
hotKey: _propTypes["default"].bool,
|
|
342
|
-
secondaryInitialSize: _propTypes["default"].number,
|
|
343
|
-
secondaryMinSize: _propTypes["default"].number,
|
|
344
|
-
hideSplitSideOnToggleClick: _propTypes["default"].string,
|
|
345
|
-
onSecondaryPaneSizeChange: _propTypes["default"].func,
|
|
346
|
-
children: _propTypes["default"].arrayOf(_propTypes["default"].node)
|
|
347
|
-
};
|
|
348
|
-
Split.defaultProps = {
|
|
349
|
-
style: {},
|
|
350
|
-
customClass: '',
|
|
351
|
-
vertical: false,
|
|
352
|
-
percentage: false,
|
|
353
|
-
primaryIndex: 0,
|
|
354
|
-
primaryMinSize: 0,
|
|
355
|
-
secondaryInitialSize: undefined,
|
|
356
|
-
secondaryMinSize: 0,
|
|
357
|
-
hideSplitSideOnToggleClick: 'primary',
|
|
358
|
-
onSecondaryPaneSizeChange: null,
|
|
359
|
-
children: [],
|
|
360
|
-
hotKey: false
|
|
361
|
-
};
|
|
362
355
|
var _default = Split;
|
|
363
|
-
exports
|
|
356
|
+
exports.default = _default;
|
package/lib/split/SplitSide.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/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); }
|
|
6
4
|
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
exports
|
|
8
|
+
exports.default = void 0;
|
|
11
9
|
|
|
12
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
11
|
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
12
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
17
13
|
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
9
7
|
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
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
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
Object.defineProperty(exports, "SplitSide", {
|
|
9
7
|
enumerable: true,
|
|
10
8
|
get: function get() {
|
|
11
|
-
return _SplitSide
|
|
9
|
+
return _SplitSide.default;
|
|
12
10
|
}
|
|
13
11
|
});
|
|
14
|
-
exports
|
|
12
|
+
exports.default = void 0;
|
|
15
13
|
|
|
16
14
|
require("../assets/styles/split.scss");
|
|
17
15
|
|
|
@@ -19,5 +17,7 @@ var _Split = _interopRequireDefault(require("./Split"));
|
|
|
19
17
|
|
|
20
18
|
var _SplitSide = _interopRequireDefault(require("./SplitSide"));
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
var _default = _Split.default;
|
|
23
|
+
exports.default = _default;
|